diff --git a/.changeset/afraid-mugs-priest.md b/.changeset/afraid-mugs-priest.md new file mode 100644 index 000000000000..d4faa51b11da --- /dev/null +++ b/.changeset/afraid-mugs-priest.md @@ -0,0 +1,7 @@ +--- +"@rocket.chat/meteor": patch +"@rocket.chat/core-typings": patch +"@rocket.chat/livechat": patch +--- + +Fixes issue causing the setDepartment Livechat API overriding some triggers conditions diff --git a/.changeset/blue-files-deny.md b/.changeset/blue-files-deny.md new file mode 100644 index 000000000000..861a77367100 --- /dev/null +++ b/.changeset/blue-files-deny.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Fix room name updation on admin edit room flow. diff --git a/.changeset/brave-snakes-scream.md b/.changeset/brave-snakes-scream.md deleted file mode 100644 index 914f248cd821..000000000000 --- a/.changeset/brave-snakes-scream.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -Fixed an issue where broadcasted events were published twice within the same instance diff --git a/.changeset/breezy-fireants-float.md b/.changeset/breezy-fireants-float.md new file mode 100644 index 000000000000..c43d2c6934bd --- /dev/null +++ b/.changeset/breezy-fireants-float.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Fixes an issue not allowing edit webhooks properly diff --git a/.changeset/bright-cycles-count.md b/.changeset/bright-cycles-count.md new file mode 100644 index 000000000000..284cceb72fae --- /dev/null +++ b/.changeset/bright-cycles-count.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +fix: Trigger `IPostLivechatRoomStarted` app event after inquiry is created. Previously, this event was fired after a room was created. This allowed to do some actions on rooms, but more elevated actions like transfering a room were not possible as at this point, an inquiry didn't exist. diff --git a/.changeset/brown-comics-cheat.md b/.changeset/brown-comics-cheat.md deleted file mode 100644 index a7907979881b..000000000000 --- a/.changeset/brown-comics-cheat.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -"@rocket.chat/meteor": patch -"@rocket.chat/core-typings": patch -"@rocket.chat/model-typings": patch ---- - -chore: Calculate & Store MAC stats -Added new info to the stats: `omnichannelContactsBySource`, `uniqueContactsOfLastMonth`, `uniqueContactsOfLastWeek`, `uniqueContactsOfYesterday` diff --git a/.changeset/brown-houses-rush.md b/.changeset/brown-houses-rush.md new file mode 100644 index 000000000000..67fcb02f95e4 --- /dev/null +++ b/.changeset/brown-houses-rush.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +Fixed a problem that caused Business Hours feature (Multiple) to make bot agents not available when turning on the feature, and not making them available after that. Now, Business Hours will ignore Bot users, allowing admins to decide manually if a bot should be or not be active during a period of time diff --git a/.changeset/calm-penguins-do.md b/.changeset/calm-penguins-do.md new file mode 100644 index 000000000000..6a83fae9030d --- /dev/null +++ b/.changeset/calm-penguins-do.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +Now we are considering channels with auto-join inside teams on user creation diff --git a/.changeset/chatty-horses-peel.md b/.changeset/chatty-horses-peel.md new file mode 100644 index 000000000000..38885b27b0e6 --- /dev/null +++ b/.changeset/chatty-horses-peel.md @@ -0,0 +1,9 @@ +--- +"@rocket.chat/meteor": patch +--- + +**Fixed enterprise settings value not being updated when license is removed or invalid** + +Added a license callbacks `onRemoveLicense` and `onInvalidateLicense` to update enterprise settings values when a license is removed/invalid. +This solves a specific scenario where in case of a downgrade (license removal), `settings.get` would continue to return `value` for enterprise settings instead of `invalidValue` as it should. +This would remain the case until the workspace was restarted. diff --git a/.changeset/clean-cars-teach.md b/.changeset/clean-cars-teach.md new file mode 100644 index 000000000000..dc569636d246 --- /dev/null +++ b/.changeset/clean-cars-teach.md @@ -0,0 +1,11 @@ +--- +"@rocket.chat/meteor": minor +"@rocket.chat/core-typings": minor +"@rocket.chat/livechat": minor +--- + +**Added the ability for premium workspaces to hide Rocket.Chat's watermark as well as change the Livechat widget's logo** + +The new settings (named below) can be found in the Omnichannel workspace settings within the livechat section. +- Hide "powered by Rocket.Chat" +- Livechat widget logo (svg, png, jpg) diff --git a/.changeset/cmd_preview.md b/.changeset/cmd_preview.md new file mode 100644 index 000000000000..978ed4306f72 --- /dev/null +++ b/.changeset/cmd_preview.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +Fixed message composer command preview for text type diff --git a/.changeset/config.json b/.changeset/config.json index 9d77693b3b31..b93fac2c92a3 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -1,6 +1,6 @@ { "$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json", - "changelog": "@changesets/changelog-git", + "changelog": ["@rocket.chat/release-changelog", { "repo": "RocketChat/Rocket.Chat" }], "commit": false, "fixed": [ ["@rocket.chat/meteor", "@rocket.chat/core-typings", "@rocket.chat/rest-typings"] diff --git a/.changeset/cool-zoos-move.md b/.changeset/cool-zoos-move.md deleted file mode 100644 index dda6fbe2b02e..000000000000 --- a/.changeset/cool-zoos-move.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -fixed threads breaking when sending messages too fast diff --git a/.changeset/cuddly-rocks-fix.md b/.changeset/cuddly-rocks-fix.md new file mode 100644 index 000000000000..ced0904df59b --- /dev/null +++ b/.changeset/cuddly-rocks-fix.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": minor +--- + +Deprecate `insertOrUpdateUser` Meteor method diff --git a/.changeset/curly-dodos-tan.md b/.changeset/curly-dodos-tan.md new file mode 100644 index 000000000000..939f21275499 --- /dev/null +++ b/.changeset/curly-dodos-tan.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Fixes an issue not allowing admin users to edit the room name diff --git a/.changeset/curly-impalas-wave.md b/.changeset/curly-impalas-wave.md new file mode 100644 index 000000000000..242c2ae62df8 --- /dev/null +++ b/.changeset/curly-impalas-wave.md @@ -0,0 +1,6 @@ +--- +'@rocket.chat/meteor': patch +--- + +fix: Fixes SAML Role mapping of custom roles +fixed: here https://github.com/RocketChat/Rocket.Chat/pull/31830 diff --git a/.changeset/curly-years-smile.md b/.changeset/curly-years-smile.md new file mode 100644 index 000000000000..78ce09097844 --- /dev/null +++ b/.changeset/curly-years-smile.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +fixed an issue with the composer losing its edit state and highlighted after resizing the window. diff --git a/.changeset/cyan-countries-impress.md b/.changeset/cyan-countries-impress.md new file mode 100644 index 000000000000..6bd78b6f62f8 --- /dev/null +++ b/.changeset/cyan-countries-impress.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Fixed matrix homeserver domain setting not being visible in admin panel diff --git a/.changeset/cyan-shoes-fly.md b/.changeset/cyan-shoes-fly.md new file mode 100644 index 000000000000..e89b64a01a31 --- /dev/null +++ b/.changeset/cyan-shoes-fly.md @@ -0,0 +1,6 @@ +--- +"@rocket.chat/meteor": minor +"@rocket.chat/livechat": minor +--- + +Added Livechat setting `Hide system messages` & API method `setHiddenSystemMessages`, to customize system message visibility within the widget. diff --git a/.changeset/dirty-islands-mate.md b/.changeset/dirty-islands-mate.md new file mode 100644 index 000000000000..22e4eaf85d78 --- /dev/null +++ b/.changeset/dirty-islands-mate.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +fixed some apps-engine bridges receiving data in a wrong format diff --git a/.changeset/dull-trainers-drive.md b/.changeset/dull-trainers-drive.md deleted file mode 100644 index f5a673cd8c30..000000000000 --- a/.changeset/dull-trainers-drive.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -fix: Remove model-level query restrictions for monitors diff --git a/.changeset/eight-rice-tease.md b/.changeset/eight-rice-tease.md new file mode 100644 index 000000000000..7b4ac3879d0f --- /dev/null +++ b/.changeset/eight-rice-tease.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +Fixed issue with quote attachments still being displayed within the message even after removing link diff --git a/.changeset/eleven-gorillas-deliver.md b/.changeset/eleven-gorillas-deliver.md deleted file mode 100644 index 403bd294828b..000000000000 --- a/.changeset/eleven-gorillas-deliver.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Fix trying to upload same file again and again. diff --git a/.changeset/empty-hounds-jog.md b/.changeset/empty-hounds-jog.md new file mode 100644 index 000000000000..b6830e0522ef --- /dev/null +++ b/.changeset/empty-hounds-jog.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/ddp-client": patch +--- + +fix: livechat sdk reconnect not resubscribing diff --git a/.changeset/fair-triggers-suffer.md b/.changeset/fair-triggers-suffer.md new file mode 100644 index 000000000000..565aa3e19392 --- /dev/null +++ b/.changeset/fair-triggers-suffer.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/livechat": patch +--- + +Allows the after-guest-registration trigger to run when starting a new chat after finishing a chat when the clear guest data when chat ended setting is set to false diff --git a/.changeset/five-dragons-joke.md b/.changeset/five-dragons-joke.md new file mode 100644 index 000000000000..09a636ec3213 --- /dev/null +++ b/.changeset/five-dragons-joke.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': minor +--- + +Freezes the permission table's first column allowing the user to visualize the permission name when scrolling horizontally diff --git a/.changeset/flat-fishes-sniff.md b/.changeset/flat-fishes-sniff.md new file mode 100644 index 000000000000..836b83123f7d --- /dev/null +++ b/.changeset/flat-fishes-sniff.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Fix notifications specially for DMs when preference is set to mentions. diff --git a/.changeset/flat-windows-juggle.md b/.changeset/flat-windows-juggle.md new file mode 100644 index 000000000000..4a0410b7fab1 --- /dev/null +++ b/.changeset/flat-windows-juggle.md @@ -0,0 +1,6 @@ +--- +"@rocket.chat/meteor": patch +"@rocket.chat/web-ui-registration": patch +--- + +Fixed login email verification flow when a user tries to join with username diff --git a/.changeset/fluffy-monkeys-sing.md b/.changeset/fluffy-monkeys-sing.md deleted file mode 100644 index db93491b0ecd..000000000000 --- a/.changeset/fluffy-monkeys-sing.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -Changed the name of the administration Logs page to "Records", implemented a tab layout in this page and added a new tab called "Analytic reports" that shows the most recent result of the statistics endpoint. diff --git a/.changeset/funny-cooks-sneeze.md b/.changeset/funny-cooks-sneeze.md new file mode 100644 index 000000000000..c7b019a3d92b --- /dev/null +++ b/.changeset/funny-cooks-sneeze.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +Fixed room owner specified on room import not being inserted as a room member or owner. diff --git a/.changeset/fuzzy-cherries-buy.md b/.changeset/fuzzy-cherries-buy.md new file mode 100644 index 000000000000..e185a148c917 --- /dev/null +++ b/.changeset/fuzzy-cherries-buy.md @@ -0,0 +1,7 @@ +--- +"@rocket.chat/meteor": major +--- + +Api login should not suggest which credential is wrong (password/username) + +Failed login attemps will always return `Unauthorized` instead of the internal fail reason diff --git a/.changeset/fuzzy-vans-own.md b/.changeset/fuzzy-vans-own.md new file mode 100644 index 000000000000..3508c6786a73 --- /dev/null +++ b/.changeset/fuzzy-vans-own.md @@ -0,0 +1,16 @@ +--- +"@rocket.chat/meteor": minor +"@rocket.chat/livechat": minor +--- + +Improved Livechat's theming capabilities + + +| Name (`setTheme`, `initialize`) | Workspace setting | Default value | Description | +|---------------------------------|----------------------------------------|---------------|-------------| +| `position` | Livechat widget position on the screen | `right` | Changes the widget position on the screen. Can be `left` or `right` | +| `background` | Livechat background | `N/A` | Changes the message list background. Accepts the same values as the CSS property [background](https://developer.mozilla.org/en-US/docs/Web/CSS/background) | +| `guestBubbleBackgroundColor` | `N/A` | `N/A` | Changes the guest's message bubble background color | +| `agentBubbleBackgroundColor` | `N/A` | `N/A` | Changes the agent's message bubble background color | +| `hideGuestAvatar` | `N/A` | `false` | Hides/shows the guest avatar | +| `hideAgentAvatar` | `N/A` | `true` | Hides/shows the agent avatar | diff --git a/.changeset/gentle-radios-relate.md b/.changeset/gentle-radios-relate.md deleted file mode 100644 index 8d5f12b3a286..000000000000 --- a/.changeset/gentle-radios-relate.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -Fixed DM room with "guest" user kept as "read only" after reactivating user diff --git a/.changeset/gold-tigers-rhyme.md b/.changeset/gold-tigers-rhyme.md new file mode 100644 index 000000000000..c5d0a3645aef --- /dev/null +++ b/.changeset/gold-tigers-rhyme.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +fix: Jump to message only works once diff --git a/.changeset/good-baboons-shop.md b/.changeset/good-baboons-shop.md new file mode 100644 index 000000000000..5a7230d841fb --- /dev/null +++ b/.changeset/good-baboons-shop.md @@ -0,0 +1,13 @@ +--- +"@rocket.chat/meteor": minor +"@rocket.chat/rest-typings": minor +--- + +**Added Livechat's new theming settings to Appearance page (available for Premium workspaces)** + +Newly added settings are: +- `Livechat widget position on the screen`: Changes the widget position between left or right of the viewport +- `Livechat background`: Changes the message list background. Receives the same value as the CSS's background property. +- `Hide system messages`: Changes the visibility of system messages displayed on the widget. +- `Hide "powered by Rocket.Chat"`: Changes the visibility of Rocket.Chat's watermark on the widget. + diff --git a/.changeset/good-ghosts-doubt.md b/.changeset/good-ghosts-doubt.md new file mode 100644 index 000000000000..5f4ed8f5a36d --- /dev/null +++ b/.changeset/good-ghosts-doubt.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': minor +--- + +Introduces a resizable Contextualbar allowing users to change the width just by dragging it diff --git a/.changeset/good-panthers-call.md b/.changeset/good-panthers-call.md new file mode 100644 index 000000000000..a55e198cc191 --- /dev/null +++ b/.changeset/good-panthers-call.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +This fix allows links such as ones starting with "notes://" and other specific apps to be rendered in the User panel as they are in the messages diff --git a/.changeset/grumpy-eagles-roll.md b/.changeset/grumpy-eagles-roll.md new file mode 100644 index 000000000000..37e0c7af1688 --- /dev/null +++ b/.changeset/grumpy-eagles-roll.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +Fixed Mail dryrun sending email to all users diff --git a/.changeset/happy-jars-lick.md b/.changeset/happy-jars-lick.md new file mode 100644 index 000000000000..61b02aa8f077 --- /dev/null +++ b/.changeset/happy-jars-lick.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +fix: Corrected SVG image preview by setting correct format during thumbnail generation diff --git a/.changeset/happy-pillows-call.md b/.changeset/happy-pillows-call.md new file mode 100644 index 000000000000..9100e1f7fe1b --- /dev/null +++ b/.changeset/happy-pillows-call.md @@ -0,0 +1,6 @@ +--- +"@rocket.chat/meteor": patch +"@rocket.chat/model-typings": patch +--- + +Changed logic that process custom fields from visitors when updating its data, making the process more reliable and faster. diff --git a/.changeset/heavy-ads-carry.md b/.changeset/heavy-ads-carry.md deleted file mode 100644 index c04e52fb48a0..000000000000 --- a/.changeset/heavy-ads-carry.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -fix: Change plan name from Enterprise to Premium on marketplace filtering diff --git a/.changeset/khaki-feet-dance.md b/.changeset/khaki-feet-dance.md deleted file mode 100644 index a419afa34143..000000000000 --- a/.changeset/khaki-feet-dance.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -feat: Save visitor's activity on agent's interaction diff --git a/.changeset/khaki-oranges-wink.md b/.changeset/khaki-oranges-wink.md new file mode 100644 index 000000000000..d03418158399 --- /dev/null +++ b/.changeset/khaki-oranges-wink.md @@ -0,0 +1,6 @@ +--- +"@rocket.chat/meteor": minor +"@rocket.chat/i18n": minor +--- + +Added a new formatter shortcut to add hyperlinks to a message diff --git a/.changeset/kind-books-love.md b/.changeset/kind-books-love.md deleted file mode 100644 index 40ce15453ff4..000000000000 --- a/.changeset/kind-books-love.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -Fixed message disappearing from room after erased even if "Show Deleted Status" is enabled diff --git a/.changeset/kind-dragons-flash.md b/.changeset/kind-dragons-flash.md new file mode 100644 index 000000000000..a7619ccf5d95 --- /dev/null +++ b/.changeset/kind-dragons-flash.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': minor +--- + +feat: add a11y doc links diff --git a/.changeset/large-files-agree.md b/.changeset/large-files-agree.md new file mode 100644 index 000000000000..63d534012662 --- /dev/null +++ b/.changeset/large-files-agree.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +Fixed mentions not working when mentioned user changes username. diff --git a/.changeset/large-pandas-beam.md b/.changeset/large-pandas-beam.md deleted file mode 100644 index 19f1eade9a9b..000000000000 --- a/.changeset/large-pandas-beam.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": minor ---- - -New setting to automatically enable autotranslate when joining rooms diff --git a/.changeset/large-toys-matter.md b/.changeset/large-toys-matter.md new file mode 100644 index 000000000000..5dae3df44a46 --- /dev/null +++ b/.changeset/large-toys-matter.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +fixed an issue with the user presence not updating automatically for other users. diff --git a/.changeset/long-phones-reflect.md b/.changeset/long-phones-reflect.md new file mode 100644 index 000000000000..4c822bd2fecb --- /dev/null +++ b/.changeset/long-phones-reflect.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +fixed a small issue that was causing the room layout to shift when loading apps messages diff --git a/.changeset/lovely-berries-type.md b/.changeset/lovely-berries-type.md new file mode 100644 index 000000000000..2c7d82476f1f --- /dev/null +++ b/.changeset/lovely-berries-type.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +Allowed upload of `lst` files diff --git a/.changeset/lucky-ducks-join.md b/.changeset/lucky-ducks-join.md new file mode 100644 index 000000000000..e64661b0841b --- /dev/null +++ b/.changeset/lucky-ducks-join.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Fixed an issue where the login button for Custom OAuth services would not work if any non-custom login service was also available diff --git a/.changeset/lucky-vans-develop.md b/.changeset/lucky-vans-develop.md deleted file mode 100644 index e57b7a1e68d5..000000000000 --- a/.changeset/lucky-vans-develop.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -Fixed issue with file attachments in rooms' messages export having no content diff --git a/.changeset/mean-rabbits-hope.md b/.changeset/mean-rabbits-hope.md new file mode 100644 index 000000000000..fcef7795e78c --- /dev/null +++ b/.changeset/mean-rabbits-hope.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Fix error on changing a discussion name diff --git a/.changeset/moody-cups-search.md b/.changeset/moody-cups-search.md new file mode 100644 index 000000000000..a4846da652a4 --- /dev/null +++ b/.changeset/moody-cups-search.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Fixes an issue allowing only numbers, if trigger's condition is 'visitor time on site' diff --git a/.changeset/moody-ghosts-add.md b/.changeset/moody-ghosts-add.md new file mode 100644 index 000000000000..3b38317dcb97 --- /dev/null +++ b/.changeset/moody-ghosts-add.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Don't use the registration.yaml file to configure Matrix Federation anymore. diff --git a/.changeset/nice-chairs-add.md b/.changeset/nice-chairs-add.md deleted file mode 100644 index dfc9d763e1c0..000000000000 --- a/.changeset/nice-chairs-add.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -"@rocket.chat/meteor": minor -"@rocket.chat/core-typings": minor ---- - -Added `push` statistic, containing three bits. Each bit represents a boolean: -``` -1 1 1 -| | | -| | +- push enabled = 0b1 = 1 -| +--- push gateway enabled = 0b10 = 2 -+----- push gateway changed = 0b100 = 4 -``` diff --git a/.changeset/nice-ducks-shout.md b/.changeset/nice-ducks-shout.md new file mode 100644 index 000000000000..fc8ce46dcace --- /dev/null +++ b/.changeset/nice-ducks-shout.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Fixed auto-availability of reactivated livechat agents; they now stay 'Not Available' until manually set to 'Available' diff --git a/.changeset/nine-ads-hide.md b/.changeset/nine-ads-hide.md new file mode 100644 index 000000000000..b09886787279 --- /dev/null +++ b/.changeset/nine-ads-hide.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": minor +--- + +feat: show date on message's scroll diff --git a/.changeset/nine-houses-reply.md b/.changeset/nine-houses-reply.md new file mode 100644 index 000000000000..29bbe0882a76 --- /dev/null +++ b/.changeset/nine-houses-reply.md @@ -0,0 +1,6 @@ +--- +"@rocket.chat/meteor": patch +"@rocket.chat/livechat": patch +--- + +Livechat: A registered user loses their messages if 'registerGuest' is called using the same token. diff --git a/.changeset/odd-hounds-thank.md b/.changeset/odd-hounds-thank.md deleted file mode 100644 index aaddc5d51a38..000000000000 --- a/.changeset/odd-hounds-thank.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -chore: Change plan name Enterprise to Premium on marketplace diff --git a/.changeset/old-zoos-hang.md b/.changeset/old-zoos-hang.md deleted file mode 100644 index eb39a6c9d83c..000000000000 --- a/.changeset/old-zoos-hang.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -fix: mobile ringing notification missing call id diff --git a/.changeset/orange-dragons-fly.md b/.changeset/orange-dragons-fly.md new file mode 100644 index 000000000000..a1ca0faa90b6 --- /dev/null +++ b/.changeset/orange-dragons-fly.md @@ -0,0 +1,6 @@ +--- +"@rocket.chat/livechat": minor +--- + +chore: Refactor & Improve Livechat Widget API +Refactors and adds better error handling to the widget's API calls diff --git a/.changeset/perfect-pianos-yawn.md b/.changeset/perfect-pianos-yawn.md deleted file mode 100644 index 349bca33ecf7..000000000000 --- a/.changeset/perfect-pianos-yawn.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/presence': minor ---- - -Add peak connections monitoring and methods to get and reset the counter diff --git a/.changeset/pink-ants-sing.md b/.changeset/pink-ants-sing.md new file mode 100644 index 000000000000..7b4841a11561 --- /dev/null +++ b/.changeset/pink-ants-sing.md @@ -0,0 +1,6 @@ +--- +"@rocket.chat/meteor": patch +--- + +Fixed a UI issue that allowed a user to "mark" a room as favorite even when a room was not default. The Back-End was correctly ignoring the `favorite` property from being updated when the room was not default, but the UI still allowed users to try. +As UI allowed but changes were not saved, this gave the impression that the function was not working. diff --git a/.changeset/polite-cars-love.md b/.changeset/polite-cars-love.md new file mode 100644 index 000000000000..08c5bd235efa --- /dev/null +++ b/.changeset/polite-cars-love.md @@ -0,0 +1,6 @@ +--- +"@rocket.chat/meteor": patch +"@rocket.chat/livechat": patch +--- + +Fixes issue where the livechat offline form would render even when disabled diff --git a/.changeset/popular-actors-cheat.md b/.changeset/popular-actors-cheat.md deleted file mode 100644 index aad5ec6ae638..000000000000 --- a/.changeset/popular-actors-cheat.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@rocket.chat/meteor": patch -"@rocket.chat/model-typings": patch ---- - -Do not allow auto-translation to be enabled in E2E rooms diff --git a/.changeset/proud-shrimps-cheat.md b/.changeset/proud-shrimps-cheat.md deleted file mode 100644 index cad8bc8bfa32..000000000000 --- a/.changeset/proud-shrimps-cheat.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -fix: Unable to send attachments via email as an omni-agent diff --git a/.changeset/quick-cheetahs-help.md b/.changeset/quick-cheetahs-help.md new file mode 100644 index 000000000000..12005d73ec1a --- /dev/null +++ b/.changeset/quick-cheetahs-help.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/web-ui-registration": patch +--- + +fixed the login page crashing when receiving unexpected errors diff --git a/.changeset/quiet-phones-reply.md b/.changeset/quiet-phones-reply.md deleted file mode 100644 index f2735e615491..000000000000 --- a/.changeset/quiet-phones-reply.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Search users using full name too on share message modal diff --git a/.changeset/rich-dingos-mix.md b/.changeset/rich-dingos-mix.md new file mode 100644 index 000000000000..d514535a97b4 --- /dev/null +++ b/.changeset/rich-dingos-mix.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Added reactions tooltip loader diff --git a/.changeset/rich-dogs-smell.md b/.changeset/rich-dogs-smell.md deleted file mode 100644 index be27db28e227..000000000000 --- a/.changeset/rich-dogs-smell.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': minor ---- - -Fix typing indicator of Apps user diff --git a/.changeset/rich-rocks-happen.md b/.changeset/rich-rocks-happen.md new file mode 100644 index 000000000000..7c7b13f6f02c --- /dev/null +++ b/.changeset/rich-rocks-happen.md @@ -0,0 +1,7 @@ +--- +'@rocket.chat/meteor': minor +'@rocket.chat/core-typings': minor +'@rocket.chat/livechat': minor +--- + +Added new Livechat trigger action "Send message (external service)" diff --git a/.changeset/rude-avocados-notice.md b/.changeset/rude-avocados-notice.md new file mode 100644 index 000000000000..8b8b8715657c --- /dev/null +++ b/.changeset/rude-avocados-notice.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Fixed discussion names displaying as IDs in sidebar search results diff --git a/.changeset/selfish-hounds-pay.md b/.changeset/selfish-hounds-pay.md deleted file mode 100644 index 3ca321bd392f..000000000000 --- a/.changeset/selfish-hounds-pay.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -fix: Monitors now able to forward a chat without taking it first diff --git a/.changeset/serious-cows-compete.md b/.changeset/serious-cows-compete.md new file mode 100644 index 000000000000..be419a9bd9cd --- /dev/null +++ b/.changeset/serious-cows-compete.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +Fixed a bug on the rooms page's "Favorite" setting, which previously failed to designate selected rooms as favorites by default. diff --git a/.changeset/seven-carpets-march.md b/.changeset/seven-carpets-march.md deleted file mode 100644 index 46fd1b7ddb62..000000000000 --- a/.changeset/seven-carpets-march.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Add new permission to allow kick users from rooms without being a member diff --git a/.changeset/shiny-pillows-run.md b/.changeset/shiny-pillows-run.md deleted file mode 100644 index 9a85d37a2f9d..000000000000 --- a/.changeset/shiny-pillows-run.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -fix: cloud alerts not working diff --git a/.changeset/shy-bananas-repeat.md b/.changeset/shy-bananas-repeat.md new file mode 100644 index 000000000000..8fe1388897a2 --- /dev/null +++ b/.changeset/shy-bananas-repeat.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Fixed Federation not working with Microservice deployments diff --git a/.changeset/silly-socks-divide.md b/.changeset/silly-socks-divide.md new file mode 100644 index 000000000000..aeaa5619a8b2 --- /dev/null +++ b/.changeset/silly-socks-divide.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/eslint-config": patch +--- + +Fixed react eslint config diff --git a/.changeset/silver-chicken-learn.md b/.changeset/silver-chicken-learn.md new file mode 100644 index 000000000000..3257849ba45c --- /dev/null +++ b/.changeset/silver-chicken-learn.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/livechat": patch +--- + +fixed livechat UI blinking different colors when the chat is finished diff --git a/.changeset/slimy-clocks-argue.md b/.changeset/slimy-clocks-argue.md new file mode 100644 index 000000000000..35d4e9e3e433 --- /dev/null +++ b/.changeset/slimy-clocks-argue.md @@ -0,0 +1,6 @@ +--- +"@rocket.chat/meteor": patch +"@rocket.chat/core-services": patch +--- + +`stopped` lifecycle method was unexpectedly synchronous when using microservices, causing our code to create race conditions. diff --git a/.changeset/slow-coats-shout.md b/.changeset/slow-coats-shout.md deleted file mode 100644 index 4a226e84d161..000000000000 --- a/.changeset/slow-coats-shout.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"@rocket.chat/meteor": minor ---- - -Add the daily and monthly peaks of concurrent connections to statistics - - Added `dailyPeakConnections` statistic for monitoring the daily peak of concurrent connections in a workspace; - - Added `maxMonthlyPeakConnections` statistic for monitoring the last 30 days peak of concurrent connections in a workspace; diff --git a/.changeset/slow-jobs-think.md b/.changeset/slow-jobs-think.md new file mode 100644 index 000000000000..24d3bdba07ae --- /dev/null +++ b/.changeset/slow-jobs-think.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +fix: CRM integration mismatch on callback type vs code validation. Previously, callback was attempting to register a `LivechatStarted` event, however, our internal code was expecting a `LivechatStart` event, causing the hook to receive incomplete data diff --git a/.changeset/small-beers-call.md b/.changeset/small-beers-call.md new file mode 100644 index 000000000000..0e0f7414b8fc --- /dev/null +++ b/.changeset/small-beers-call.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +Looking at the user's permission before rendering the 'Start Call' button on the UserInfo panel, so if the user does not have the permissions, the button does not show diff --git a/.changeset/smart-squids-begin.md b/.changeset/smart-squids-begin.md new file mode 100644 index 000000000000..48f3f460ea7e --- /dev/null +++ b/.changeset/smart-squids-begin.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Fixes the missing space between name and user name on system messages diff --git a/.changeset/soft-cows-juggle.md b/.changeset/soft-cows-juggle.md deleted file mode 100644 index 6fcb20506483..000000000000 --- a/.changeset/soft-cows-juggle.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -download translation files through CDN diff --git a/.changeset/spicy-wombats-shout.md b/.changeset/spicy-wombats-shout.md new file mode 100644 index 000000000000..d84a815241dc --- /dev/null +++ b/.changeset/spicy-wombats-shout.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': minor +--- + +Introduces message navigability, allowing users to navigate on messages through keyboard diff --git a/.changeset/spotty-students-warn.md b/.changeset/spotty-students-warn.md new file mode 100644 index 000000000000..f3a5808df4b3 --- /dev/null +++ b/.changeset/spotty-students-warn.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +fix: Show always all rooms when requesting chat history, even unserved ones. A faulty condition caused an issue where chat history was only able to present either served or unserved chats at once, without a proper way to get both. Now, the Chat history feature will showcase all closed rooms for the requested visitor. diff --git a/.changeset/stale-masks-learn.md b/.changeset/stale-masks-learn.md deleted file mode 100644 index 1523b02b0c95..000000000000 --- a/.changeset/stale-masks-learn.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/server-fetch': patch ---- - -Fixed an issue where the payload of an HTTP request made by an app wouldn't be correctly encoded in some cases diff --git a/.changeset/strange-jars-invent.md b/.changeset/strange-jars-invent.md new file mode 100644 index 000000000000..b91aa564894f --- /dev/null +++ b/.changeset/strange-jars-invent.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +fix: Validate rooms are not taken before processing by queue. This will prevent an issue that caused a room, that's on an invalid state, to be re-processed by the queue worker, assigning it again to another user despite being already assigned to one. This happens when a room's inquiry gets to an state where it desyncs from the room object. Room is taken & served while inquiry is still queued. This fix will also reconciliate both when something like this happens: whenever the queue picks a chat that's already taken, it will update it's inquiry object to reflect that and avoid processing again. diff --git a/.changeset/strange-lamps-taste.md b/.changeset/strange-lamps-taste.md new file mode 100644 index 000000000000..88b61f5e5dec --- /dev/null +++ b/.changeset/strange-lamps-taste.md @@ -0,0 +1,6 @@ +--- +'@rocket.chat/ddp-client': patch +'@rocket.chat/meteor': patch +--- + +Revert unintentional changes real time presence data payload diff --git a/.changeset/strange-papayas-yell.md b/.changeset/strange-papayas-yell.md deleted file mode 100644 index ca194dd2f9d4..000000000000 --- a/.changeset/strange-papayas-yell.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -fix: Disables GenericMenu without any sections or items diff --git a/.changeset/strange-rivers-live.md b/.changeset/strange-rivers-live.md new file mode 100644 index 000000000000..b1ebd05c284d --- /dev/null +++ b/.changeset/strange-rivers-live.md @@ -0,0 +1,8 @@ +--- +'@rocket.chat/core-typings': minor +'@rocket.chat/i18n': minor +'@rocket.chat/meteor': minor +--- + +Added support for allowing agents to forward inquiries to departments that may not have any online agents given that `Allow department to receive forwarded inquiries even when there's no available agents` is set to `true` in the department configuration. +This configuration empowers agents to seamlessly direct incoming requests to the designated department, ensuring efficient handling of queries even when departmental resources are not actively online. When an agent becomes available, any pending inquiries will be automatically routed to them if the routing algorithm supports it. diff --git a/.changeset/strong-bananas-flash.md b/.changeset/strong-bananas-flash.md new file mode 100644 index 000000000000..d41697836d11 --- /dev/null +++ b/.changeset/strong-bananas-flash.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Fixed duplicate API calls during livechat room forwarding by adding loading state for submit button diff --git a/.changeset/stupid-trains-trade.md b/.changeset/stupid-trains-trade.md new file mode 100644 index 000000000000..7fe64964cd04 --- /dev/null +++ b/.changeset/stupid-trains-trade.md @@ -0,0 +1,24 @@ +--- +"@rocket.chat/message-parser": patch +--- + +feat(message-parser): add timestamps pattern + +### Usage + +Pattern: + +- {timestamp} is a Unix timestamp +- {format} is an optional parameter that can be used to customize the date and time format. + +#### Formats + +| Format | Description | Example | +| ------ | ------------------------- | --------------------------------------- | +| `t` | Short time | 12:00 AM | +| `T` | Long time | 12:00:00 AM | +| `d` | Short date | 12/31/2020 | +| `D` | Long date | Thursday, December 31, 2020 | +| `f` | Full date and time | Thursday, December 31, 2020 12:00 AM | +| `F` | Full date and time (long) | Thursday, December 31, 2020 12:00:00 AM | +| `R` | Relative time | 1 year ago | diff --git a/.changeset/sweet-books-trade.md b/.changeset/sweet-books-trade.md new file mode 100644 index 000000000000..be828d662f32 --- /dev/null +++ b/.changeset/sweet-books-trade.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +fixed search room not showing the new name room name changes diff --git a/.changeset/sweet-chefs-exist.md b/.changeset/sweet-chefs-exist.md deleted file mode 100644 index 6ceee63dd762..000000000000 --- a/.changeset/sweet-chefs-exist.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Check for room scoped permissions for starting discussions diff --git a/.changeset/sweet-feet-relate.md b/.changeset/sweet-feet-relate.md deleted file mode 100644 index f7da740ebcc0..000000000000 --- a/.changeset/sweet-feet-relate.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -fix: user dropdown menu position on RTL layout diff --git a/.changeset/tall-bears-compete.md b/.changeset/tall-bears-compete.md new file mode 100644 index 000000000000..6929ba4d0afd --- /dev/null +++ b/.changeset/tall-bears-compete.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/web-ui-registration": patch +--- + +Fixed a bug that caused the Login page to crash when closing the Two-Factor Authentication modal using the Cancel button or the X button. diff --git a/.changeset/ten-bobcats-occur.md b/.changeset/ten-bobcats-occur.md new file mode 100644 index 000000000000..325e40a21fa6 --- /dev/null +++ b/.changeset/ten-bobcats-occur.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Fixed an issue where the sync ldap avatars background process would never run diff --git a/.changeset/thin-keys-impress.md b/.changeset/thin-keys-impress.md new file mode 100644 index 000000000000..8679299972fc --- /dev/null +++ b/.changeset/thin-keys-impress.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/livechat": patch +--- + +Fixes issue of the `setDepartment` Livechat API method not setting the store value properly (is was only setting on the guest object) diff --git a/.changeset/thirty-beds-taste.md b/.changeset/thirty-beds-taste.md new file mode 100644 index 000000000000..fd525635c870 --- /dev/null +++ b/.changeset/thirty-beds-taste.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +Improved the layout of the 2FA modals and changed the email 2FA resend email anchor to a button. diff --git a/.changeset/thirty-berries-learn.md b/.changeset/thirty-berries-learn.md new file mode 100644 index 000000000000..99a88729c99a --- /dev/null +++ b/.changeset/thirty-berries-learn.md @@ -0,0 +1,8 @@ +--- +"@rocket.chat/meteor": patch +--- + +**Added tag to premium settings in CE workspaces** + +A premium tag will be displayed alongside the setting label for premium exclusive settings in CE workspaces. +This will bring visibility for users of our premium features while also informing them of the reason why the setting is currently disabled. diff --git a/.changeset/thirty-ducks-smell.md b/.changeset/thirty-ducks-smell.md new file mode 100644 index 000000000000..e6f482d5fcea --- /dev/null +++ b/.changeset/thirty-ducks-smell.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/models": patch +--- + +Fix proxified model props were missing context before attribution diff --git a/.changeset/thirty-jokes-compete.md b/.changeset/thirty-jokes-compete.md deleted file mode 100644 index 9d4095e7771b..000000000000 --- a/.changeset/thirty-jokes-compete.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -chore: Deprecate un-used meteor method for omnichannel analytics diff --git a/.changeset/thirty-pumpkins-fix.md b/.changeset/thirty-pumpkins-fix.md deleted file mode 100644 index 11b92b064e15..000000000000 --- a/.changeset/thirty-pumpkins-fix.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -'@rocket.chat/core-typings': minor -'@rocket.chat/rest-typings': minor -'@rocket.chat/tools': minor -'@rocket.chat/meteor': minor ---- - -Added option to select between two script engine options for the integrations diff --git a/.changeset/tidy-bears-applaud.md b/.changeset/tidy-bears-applaud.md deleted file mode 100644 index cff12f3dc7d3..000000000000 --- a/.changeset/tidy-bears-applaud.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -"@rocket.chat/meteor": minor -"@rocket.chat/core-typings": minor -"@rocket.chat/model-typings": minor -"@rocket.chat/rest-typings": minor ---- - -Create a deployment fingerprint to identify possible deployment changes caused by database cloning. A question to the admin will confirm if it's a regular deployment change or an intent of a new deployment and correct identification values as needed. -The fingerprint is composed by `${siteUrl}${dbConnectionString}` and hashed via `sha256` in `base64`. -An environment variable named `AUTO_ACCEPT_FINGERPRINT`, when set to `true`, can be used to auto-accept an expected fingerprint change as a regular deployment update. diff --git a/.changeset/tiny-toes-fail.md b/.changeset/tiny-toes-fail.md new file mode 100644 index 000000000000..3b065d2e3ece --- /dev/null +++ b/.changeset/tiny-toes-fail.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': minor +--- + +Introduced new methods for Rocket.Chat Apps to interact with livechat: `findOpenRoomsByAgentId` and `countOpenRoomsByAgentId` diff --git a/.changeset/tiny-wolves-deliver.md b/.changeset/tiny-wolves-deliver.md deleted file mode 100644 index f89564a9b53c..000000000000 --- a/.changeset/tiny-wolves-deliver.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/ui-theming': patch ---- - -fix: light-theme font-disabled color diff --git a/.changeset/tough-apples-turn.md b/.changeset/tough-apples-turn.md deleted file mode 100644 index 056a0645186e..000000000000 --- a/.changeset/tough-apples-turn.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -Forward headers when using proxy for file uploads diff --git a/.changeset/tough-carrots-walk.md b/.changeset/tough-carrots-walk.md deleted file mode 100644 index 2851e697b85e..000000000000 --- a/.changeset/tough-carrots-walk.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@rocket.chat/rest-typings': minor -'@rocket.chat/license': patch -'@rocket.chat/meteor': patch ---- - -feat: added `licenses.info` endpoint diff --git a/.changeset/tough-doors-juggle.md b/.changeset/tough-doors-juggle.md new file mode 100644 index 000000000000..9da2ab1c6075 --- /dev/null +++ b/.changeset/tough-doors-juggle.md @@ -0,0 +1,9 @@ +--- +"@rocket.chat/meteor": patch +--- + +Introduced a new step to the queue worker: when an inquiry that's on an improper status is selected for processing, queue worker will first check its status and will attempt to fix it. +For example, if an inquiry points to a closed room, there's no point in processing, system will now remove the inquiry +If an inquiry is already taken, the inquiry will be updated to reflect the new status and clean the queue. + +This prevents issues where the queue worker attempted to process an inquiry _forever_ because it was in an improper state. diff --git a/.changeset/twelve-files-deny.md b/.changeset/twelve-files-deny.md deleted file mode 100644 index 123bf0a7764b..000000000000 --- a/.changeset/twelve-files-deny.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -'@rocket.chat/license': minor -'@rocket.chat/jwt': minor -'@rocket.chat/omnichannel-services': minor -'@rocket.chat/omnichannel-transcript': minor -'@rocket.chat/authorization-service': minor -'@rocket.chat/stream-hub-service': minor -'@rocket.chat/presence-service': minor -'@rocket.chat/account-service': minor -'@rocket.chat/core-services': minor -'@rocket.chat/model-typings': minor -'@rocket.chat/core-typings': minor -'@rocket.chat/rest-typings': minor -'@rocket.chat/ddp-streamer': minor -'@rocket.chat/queue-worker': minor -'@rocket.chat/presence': minor -'@rocket.chat/meteor': minor ---- - -Implemented the License library, it is used to handle the functionality like expiration date, modules, limits, etc. -Also added a version v3 of the license, which contains an extended list of features. -v2 is still supported, since we convert it to v3 on the fly. diff --git a/.changeset/twenty-dolls-obey.md b/.changeset/twenty-dolls-obey.md new file mode 100644 index 000000000000..c886cf9cbc83 --- /dev/null +++ b/.changeset/twenty-dolls-obey.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +Fix error during migration 304. Throwing `Cannot read property 'finally' of undefined` error. diff --git a/.changeset/twenty-yaks-grab.md b/.changeset/twenty-yaks-grab.md new file mode 100644 index 000000000000..38cf79704956 --- /dev/null +++ b/.changeset/twenty-yaks-grab.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Fixes an issue where messages are not updating properly after pruning the room diff --git a/.changeset/two-suns-marry.md b/.changeset/two-suns-marry.md new file mode 100644 index 000000000000..3eae6383a62f --- /dev/null +++ b/.changeset/two-suns-marry.md @@ -0,0 +1,6 @@ +--- +'@rocket.chat/i18n': minor +'@rocket.chat/meteor': minor +--- + +feat: `ConnectionStatusBar` redesign diff --git a/.changeset/warm-melons-type.md b/.changeset/warm-melons-type.md deleted file mode 100644 index 5b187b8a7f11..000000000000 --- a/.changeset/warm-melons-type.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"@rocket.chat/meteor": patch -"@rocket.chat/core-typings": patch -"@rocket.chat/omnichannel-services": patch ---- - -feat: Disable and annonimize visitors instead of removing diff --git a/.changeset/wicked-humans-hang.md b/.changeset/wicked-humans-hang.md deleted file mode 100644 index e793bc978902..000000000000 --- a/.changeset/wicked-humans-hang.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -Improve cache of static files diff --git a/.changeset/wicked-jars-double.md b/.changeset/wicked-jars-double.md deleted file mode 100644 index 23deffe8606f..000000000000 --- a/.changeset/wicked-jars-double.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -Handle the username update in the background diff --git a/.changeset/wicked-months-laugh.md b/.changeset/wicked-months-laugh.md new file mode 100644 index 000000000000..684b4180a257 --- /dev/null +++ b/.changeset/wicked-months-laugh.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Fix users presence stuck as online after connecting using mobile apps diff --git a/.changeset/wild-keys-obey.md b/.changeset/wild-keys-obey.md new file mode 100644 index 000000000000..9de92ee5671b --- /dev/null +++ b/.changeset/wild-keys-obey.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/livechat": patch +--- + +Fixes issue causing a desync in different browser windows when a chat is closed and started again diff --git a/.changeset/young-doors-bathe.md b/.changeset/young-doors-bathe.md new file mode 100644 index 000000000000..24d004b5214e --- /dev/null +++ b/.changeset/young-doors-bathe.md @@ -0,0 +1,6 @@ +--- +'@rocket.chat/meteor': patch +'@rocket.chat/ddp-streamer': patch +--- + +Fix web UI not showing users presence updating to offline diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 6e14d4935eaf..0b2af2ef7881 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -22,15 +22,13 @@ --> ## Proposed changes (including videos or screenshots) - - - ## Issue(s) diff --git a/.github/actions/build-docker/action.yml b/.github/actions/build-docker/action.yml index 284a0985b78e..364957ecdf01 100644 --- a/.github/actions/build-docker/action.yml +++ b/.github/actions/build-docker/action.yml @@ -13,6 +13,10 @@ inputs: required: false description: 'Platform' type: string + build-containers: + required: false + description: 'Containers to build along with Rocket.Chat' + type: string runs: using: composite @@ -54,11 +58,7 @@ runs: - name: Build Docker images shell: bash run: | - args=(rocketchat) - - if [[ '${{ inputs.platform }}' = 'alpine' ]]; then - args+=($SERVICES_PUBLISH) - fi; + args=(rocketchat ${{ inputs.build-containers }}) docker compose -f docker-compose-ci.yml build "${args[@]}" @@ -66,10 +66,6 @@ runs: if: (github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'release' || github.ref == 'refs/heads/develop') shell: bash run: | - args=(rocketchat) - - if [[ '${{ inputs.platform }}' = 'alpine' ]]; then - args+=($SERVICES_PUBLISH) - fi; + args=(rocketchat ${{ inputs.build-containers }}) docker compose -f docker-compose-ci.yml push "${args[@]}" diff --git a/.github/actions/meteor-build/action.yml b/.github/actions/meteor-build/action.yml index 21fec059c8de..d261000ceb87 100644 --- a/.github/actions/meteor-build/action.yml +++ b/.github/actions/meteor-build/action.yml @@ -103,18 +103,19 @@ runs: working-directory: ./apps/meteor run: meteor reset - - name: Build Rocket.Chat From Pull Request + - name: Build Rocket.Chat shell: bash - if: startsWith(github.ref, 'refs/pull/') == true env: METEOR_PROFILE: 1000 BABEL_ENV: ${{ inputs.coverage == 'true' && 'coverage' || '' }} - run: yarn build:ci -- --directory /tmp/dist + run: | + # check if BABEL_ENV is set to coverage + if [[ $BABEL_ENV == "coverage" ]]; then + echo -e "rocketchat:coverage\n" >> ./apps/meteor/.meteor/packages + echo "Coverage enabled" + fi - - name: Build Rocket.Chat - shell: bash - if: startsWith(github.ref, 'refs/pull/') != true - run: yarn build:ci -- --directory /tmp/dist + yarn build:ci - name: Prepare build shell: bash diff --git a/.github/actions/setup-node/action.yml b/.github/actions/setup-node/action.yml index d3a463492cbb..0e921e81f1f3 100644 --- a/.github/actions/setup-node/action.yml +++ b/.github/actions/setup-node/action.yml @@ -41,6 +41,5 @@ runs: cache: 'yarn' - name: yarn install - if: steps.cache-node-modules.outputs.cache-hit != 'true' shell: bash run: yarn diff --git a/.github/workflows/ci-code-check.yml b/.github/workflows/ci-code-check.yml index 57cdac047423..75deb399d2f2 100644 --- a/.github/workflows/ci-code-check.yml +++ b/.github/workflows/ci-code-check.yml @@ -27,7 +27,7 @@ jobs: with: swap-size-gb: 4 - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup NodeJS uses: ./.github/actions/setup-node diff --git a/.github/workflows/ci-test-e2e.yml b/.github/workflows/ci-test-e2e.yml index d77966f186b3..12bb361d76f2 100644 --- a/.github/workflows/ci-test-e2e.yml +++ b/.github/workflows/ci-test-e2e.yml @@ -43,6 +43,10 @@ on: default: 1 required: false type: number + retries: + default: 0 + required: false + type: number type: required: true type: string @@ -82,13 +86,21 @@ jobs: name: MongoDB ${{ matrix.mongodb-version }} (${{ matrix.shard }}/${{ inputs.total-shard }}) steps: + - name: Login to GitHub Container Registry + if: (github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'release' || github.ref == 'refs/heads/develop') + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ secrets.CR_USER }} + password: ${{ secrets.CR_PAT }} + - name: Launch MongoDB uses: supercharge/mongodb-github-action@v1.10.0 with: mongodb-version: ${{ matrix.mongodb-version }} mongodb-replica-set: rs0 - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup NodeJS uses: ./.github/actions/setup-node @@ -127,6 +139,12 @@ jobs: - run: yarn build + - name: Prepare code coverage directory + if: inputs.release == 'ee' + run: | + mkdir -p /tmp/coverage + chmod 777 /tmp/coverage + - name: Start containers for CE if: inputs.release == 'ce' env: @@ -141,6 +159,8 @@ jobs: MONGO_URL: 'mongodb://host.docker.internal:27017/rocketchat?replicaSet=rs0&directConnection=true' ENTERPRISE_LICENSE: ${{ inputs.enterprise-license }} TRANSPORTER: ${{ inputs.transporter }} + COVERAGE_DIR: '/tmp/coverage' + COVERAGE_REPORTER: 'lcov' run: | docker compose -f docker-compose-ci.yml up -d @@ -152,7 +172,7 @@ jobs: path: | ~/.cache/ms-playwright # This is the version of Playwright that we are using, if you are willing to upgrade, you should update this. - key: playwright-1.37.1 + key: playwright-1.40.1 - name: Install Playwright if: inputs.type == 'ui' && steps.cache-playwright.outputs.cache-hit != 'true' @@ -184,6 +204,8 @@ jobs: env: WEBHOOK_TEST_URL: 'http://host.docker.internal:10000' IS_EE: ${{ inputs.release == 'ee' && 'true' || '' }} + COVERAGE_DIR: '/tmp/coverage' + COVERAGE_REPORTER: 'lcovonly' run: | for i in $(seq 1 2); do npm run testapi && s=0 && break || s=$? @@ -204,6 +226,9 @@ jobs: sleep 10 done; done; + docker compose -f ../../docker-compose-ci.yml stop + + ls -l $COVERAGE_DIR exit $s - name: E2E Test UI (${{ matrix.shard }}/${{ inputs.total-shard }}) @@ -220,6 +245,7 @@ jobs: QASE_API_TOKEN: ${{ secrets.QASE_API_TOKEN }} QASE_REPORT: ${{ github.ref == 'refs/heads/develop' && 'true' || '' }} CI: true + PLAYWRIGHT_RETRIES: ${{ inputs.retries }} working-directory: ./apps/meteor run: | yarn prepare @@ -249,6 +275,22 @@ jobs: verbose: true token: ${{ secrets.CODECOV_TOKEN }} + - uses: codecov/codecov-action@v3 + if: inputs.type == 'api' && inputs.release == 'ee' + with: + directory: /tmp/coverage + working-directory: . + flags: e2e-api + verbose: true + token: ${{ secrets.CODECOV_TOKEN }} + + - name: Store e2e-api-ee-coverage + if: inputs.type == 'api' && inputs.release == 'ee' + uses: actions/upload-artifact@v3 + with: + name: e2e-api-ee-coverage + path: /tmp/coverage + - name: Store e2e-ee-coverage if: inputs.type == 'ui' && inputs.release == 'ee' uses: actions/upload-artifact@v3 diff --git a/.github/workflows/ci-test-unit.yml b/.github/workflows/ci-test-unit.yml index b4ef5cb273ad..066cc2e3773e 100644 --- a/.github/workflows/ci-test-unit.yml +++ b/.github/workflows/ci-test-unit.yml @@ -21,7 +21,7 @@ jobs: name: Unit Tests steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup NodeJS uses: ./.github/actions/setup-node diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ec8e905cd803..51e034505a85 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,9 +80,49 @@ jobs: echo "DOCKER_TAG: ${DOCKER_TAG}" echo "gh-docker-tag=${DOCKER_TAG}" >> $GITHUB_OUTPUT + notify-draft-services: + name: 🚀 Notify external services - draft + runs-on: ubuntu-20.04 + needs: [release-versions] + steps: + - uses: Bhacaz/checkout-files@v2 + with: + files: package.json + branch: ${{ github.ref }} + + - name: Register release on cloud as Draft + if: github.event_name == 'release' + env: + UPDATE_TOKEN: ${{ secrets.UPDATE_TOKEN }} + run: | + REPO_VERSION=$(node -p "require('./package.json').version") + + if [[ '${{ github.event_name }}' = 'release' ]]; then + GIT_TAG="${GITHUB_REF#*tags/}" + GIT_BRANCH="" + ARTIFACT_NAME="${REPO_VERSION}" + RC_VERSION=$GIT_TAG + + if [[ '${{ needs.release-versions.outputs.release }}' = 'release-candidate' ]]; then + RC_RELEASE=candidate + elif [[ '${{ needs.release-versions.outputs.release }}' = 'latest' ]]; then + RC_RELEASE=stable + fi + else + GIT_TAG="" + GIT_BRANCH="${GITHUB_REF#*heads/}" + ARTIFACT_NAME="${REPO_VERSION}.$GITHUB_SHA" + RC_VERSION="${REPO_VERSION}" + RC_RELEASE=develop + fi; + + curl -H "Content-Type: application/json" -H "X-Update-Token: $UPDATE_TOKEN" -d \ + "{\"nodeVersion\": \"${{ needs.release-versions.outputs.node-version }}\", \"compatibleMongoVersions\": [\"4.4\", \"5.0\", \"6.0\"], \"commit\": \"$GITHUB_SHA\", \"tag\": \"$RC_VERSION\", \"branch\": \"$GIT_BRANCH\", \"artifactName\": \"$ARTIFACT_NAME\", \"releaseType\": \"draft\", \"draftAs\": \"$RC_RELEASE\"}" \ + https://releases.rocket.chat/update + packages-build: name: 📦 Build Packages - needs: [release-versions] + needs: [release-versions, notify-draft-services] runs-on: ubuntu-20.04 steps: - name: Github Info @@ -100,7 +140,7 @@ jobs: with: swap-size-gb: 4 - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup NodeJS uses: ./.github/actions/setup-node @@ -138,12 +178,12 @@ jobs: echo "github.event_name: ${{ github.event_name }}" cat $GITHUB_EVENT_PATH - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: ./.github/actions/meteor-build with: node-version: ${{ needs.release-versions.outputs.node-version }} - coverage: true + coverage: ${{ github.event_name != 'release' }} build-prod: name: 📦 Meteor Build - official @@ -162,12 +202,12 @@ jobs: echo "github.event_name: ${{ github.event_name }}" cat $GITHUB_EVENT_PATH - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: ./.github/actions/meteor-build with: node-version: ${{ needs.release-versions.outputs.node-version }} - coverage: false + coverage: ${{ github.event_name != 'release' }} build-gh-docker-coverage: name: 🚢 Build Docker Images for Testing @@ -179,7 +219,6 @@ jobs: RC_DOCKER_TAG: ${{ matrix.platform == 'alpine' && needs.release-versions.outputs.rc-docker-tag-alpine || needs.release-versions.outputs.rc-docker-tag }} DOCKER_TAG: ${{ needs.release-versions.outputs.gh-docker-tag }} LOWERCASE_REPOSITORY: ${{ needs.release-versions.outputs.lowercase-repo }} - SERVICES_PUBLISH: 'authorization-service account-service ddp-streamer-service presence-service stream-hub-service' strategy: fail-fast: false @@ -187,7 +226,7 @@ jobs: platform: ['official', 'alpine'] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 # we only build and publish the actual docker images if not a PR from a fork - uses: ./.github/actions/build-docker @@ -197,6 +236,7 @@ jobs: CR_PAT: ${{ secrets.CR_PAT }} node-version: ${{ needs.release-versions.outputs.node-version }} platform: ${{ matrix.platform }} + build-containers: ${{ matrix.platform == 'alpine' && 'authorization-service account-service ddp-streamer-service presence-service stream-hub-service queue-worker-service omnichannel-transcript-service' || '' }} build-gh-docker: name: 🚢 Build Docker Images for Production @@ -208,7 +248,6 @@ jobs: RC_DOCKER_TAG: ${{ matrix.platform == 'alpine' && needs.release-versions.outputs.rc-docker-tag-alpine || needs.release-versions.outputs.rc-docker-tag }} DOCKER_TAG: ${{ needs.release-versions.outputs.gh-docker-tag }} LOWERCASE_REPOSITORY: ${{ needs.release-versions.outputs.lowercase-repo }} - SERVICES_PUBLISH: 'authorization-service account-service ddp-streamer-service presence-service stream-hub-service' strategy: fail-fast: false @@ -216,7 +255,7 @@ jobs: platform: ['official', 'alpine'] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: ./.github/actions/build-docker with: @@ -224,6 +263,7 @@ jobs: CR_PAT: ${{ secrets.CR_PAT }} node-version: ${{ needs.release-versions.outputs.node-version }} platform: ${{ matrix.platform }} + build-containers: ${{ matrix.platform == 'alpine' && 'authorization-service account-service ddp-streamer-service presence-service stream-hub-service queue-worker-service omnichannel-transcript-service' || '' }} - name: Rename official Docker tag to GitHub Container Registry if: matrix.platform == 'official' @@ -290,6 +330,7 @@ jobs: rc-dockerfile-alpine: ${{ needs.release-versions.outputs.rc-dockerfile-alpine }} rc-docker-tag-alpine: ${{ needs.release-versions.outputs.rc-docker-tag-alpine }} gh-docker-tag: ${{ needs.release-versions.outputs.gh-docker-tag }} + retries: ${{ (github.event_name == 'release' || github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master') && 2 || 0 }} secrets: CR_USER: ${{ secrets.CR_USER }} CR_PAT: ${{ secrets.CR_PAT }} @@ -339,6 +380,7 @@ jobs: rc-dockerfile-alpine: ${{ needs.release-versions.outputs.rc-dockerfile-alpine }} rc-docker-tag-alpine: ${{ needs.release-versions.outputs.rc-docker-tag-alpine }} gh-docker-tag: ${{ needs.release-versions.outputs.gh-docker-tag }} + retries: ${{ (github.event_name == 'release' || github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master') && 2 || 0 }} secrets: CR_USER: ${{ secrets.CR_USER }} CR_PAT: ${{ secrets.CR_PAT }} @@ -415,7 +457,7 @@ jobs: needs: [build, checks, release-versions] if: github.event_name == 'release' || github.ref == 'refs/heads/develop' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Restore build uses: actions/download-artifact@v3 @@ -684,21 +726,6 @@ jobs: # Makes build fail if the release isn't there curl --fail https://releases.rocket.chat/$RC_VERSION/info - - name: RedHat Registry - if: github.event_name == 'release' - env: - REDHAT_REGISTRY_PID: ${{ secrets.REDHAT_REGISTRY_PID }} - REDHAT_REGISTRY_KEY: ${{ secrets.REDHAT_REGISTRY_KEY }} - run: | - GIT_TAG="${GITHUB_REF#*tags/}" - - curl -X POST \ - https://connect.redhat.com/api/v2/projects/$REDHAT_REGISTRY_PID/build \ - -H "Authorization: Bearer $REDHAT_REGISTRY_KEY" \ - -H 'Cache-Control: no-cache' \ - -H 'Content-Type: application/json' \ - -d '{"tag":"'$GIT_TAG'"}' - trigger-dependent-workflows: runs-on: ubuntu-latest if: github.event_name == 'release' diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 4e9706156c3a..483b404a6dc8 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -13,7 +13,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: # We must fetch at least the immediate parents so that if this is # a pull request then we can checkout the head. diff --git a/.github/workflows/new-release.yml b/.github/workflows/new-release.yml index 937c4d1b6b52..f10578d5879f 100644 --- a/.github/workflows/new-release.yml +++ b/.github/workflows/new-release.yml @@ -25,7 +25,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: ${{ github.event.inputs.base-ref }} fetch-depth: 0 diff --git a/.github/workflows/pr-update-description.yml b/.github/workflows/pr-update-description.yml new file mode 100644 index 000000000000..71b4ffeda801 --- /dev/null +++ b/.github/workflows/pr-update-description.yml @@ -0,0 +1,39 @@ +name: 'Release PR Description' + +on: + pull_request: + branches: + - master + +concurrency: ${{ github.workflow }}-${{ github.ref }} + +jobs: + update-pr: + runs-on: ubuntu-latest + if: startsWith(github.head_ref, 'release-') + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ secrets.CI_PAT }} + + - name: Setup NodeJS + uses: ./.github/actions/setup-node + with: + node-version: 14.21.3 + cache-modules: true + install: true + + - uses: dtinth/setup-github-actions-caching-for-turbo@v1 + + - name: Build packages + run: yarn build + + - name: Update PR description + uses: ./packages/release-action + with: + action: update-pr-description + env: + GITHUB_TOKEN: ${{ secrets.CI_PAT }} + diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index ca4b6979961f..e133a3153722 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 token: ${{ secrets.CI_PAT }} diff --git a/.gitignore b/.gitignore index 3fcb40b03610..fcf2b8cd07c7 100644 --- a/.gitignore +++ b/.gitignore @@ -45,4 +45,8 @@ yarn-error.log* .idea/ .exrc .history -.envrc \ No newline at end of file +.envrc + +*.sublime-workspace + +**/.vim/ diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 000000000000..e24ff7d2ebf1 --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,26 @@ +tasks: + - init: | + nvm install $(jq -r .engines.node package.json) && + curl https://install.meteor.com/ | sh && + export PATH="$PATH:$HOME/.meteor" && + yarn && + export ROOT_URL=$(gp url 3000) + command: yarn build && yarn dev + +ports: + - port: 3000 + visibility: public + onOpen: open-preview + +github: + prebuilds: + master: true + pullRequests: true + pullRequestsFromForks: true + addCheck: true + addComment: true + addBadge: true + +vscode: + extensions: + - esbenp.prettier-vscode \ No newline at end of file diff --git a/.husky/pre-push b/.husky/pre-push deleted file mode 100755 index 7e116981132d..000000000000 --- a/.husky/pre-push +++ /dev/null @@ -1,4 +0,0 @@ -[ "$HUSKY" = "0" ] && echo "skipping push hook" && exit 0 - -yarn lint && \ -yarn testunit diff --git a/.kodiak.toml b/.kodiak.toml index 884f356a1712..7f89eed8f169 100644 --- a/.kodiak.toml +++ b/.kodiak.toml @@ -5,9 +5,8 @@ version = 1 method = "squash" automerge_label = ["stat: ready to merge", "automerge"] block_on_neutral_required_check_runs = true -blocking_labels = ["stat: needs QA", "Invalid PR Title"] +blocking_labels = ["stat: needs QA", "Invalid PR Title", "do not merge"] prioritize_ready_to_merge = true -merge.do_not_merge=true [merge.message] title = "pull_request_title" diff --git a/.vscode/settings.json b/.vscode/settings.json index c9d889142050..4eaf1836d1fd 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -29,6 +29,7 @@ "oauthapps", "omnichannel", "photoswipe", + "proxify", "searchbox", "tmid", "tshow" diff --git a/.yarn/patches/typia-npm-5.3.3-21d3e18463.patch b/.yarn/patches/typia-npm-5.3.3-21d3e18463.patch new file mode 100644 index 000000000000..1487a9f4712d --- /dev/null +++ b/.yarn/patches/typia-npm-5.3.3-21d3e18463.patch @@ -0,0 +1,320 @@ +diff --git a/lib/factories/internal/metadata/iterate_metadata_intersection.js b/lib/factories/internal/metadata/iterate_metadata_intersection.js +index 260670b8ea37b63dcacadeffa26450f81087c90e..f07b44b16099d896ab40c46f03df86ee2f2c1a90 100644 +--- a/lib/factories/internal/metadata/iterate_metadata_intersection.js ++++ b/lib/factories/internal/metadata/iterate_metadata_intersection.js +@@ -247,7 +247,7 @@ var iterate_metadata_intersection = function (checker) { + var tags = MetadataTypeTagFactory_1.MetadataTypeTagFactory.analyze(errors)(target)(objects.map(function (om) { return om.objects; }).flat(), explore); + if (tags.length) + if (target === "array") +- meta.arrays.at(-1).tags.push(tags); ++ meta.arrays.slice(-1)[0].tags.push(tags); + else if (booleanLiteral === null) + meta.atomics.find(function (a) { return a.type === target; }).tags.push(tags); + else { +diff --git a/lib/programmers/CheckerProgrammer.js b/lib/programmers/CheckerProgrammer.js +index bbec09f22798d144b96f59bb946e7e32e3438c05..dc13cb47b72358b8e6165b768cff2360db2bd617 100644 +--- a/lib/programmers/CheckerProgrammer.js ++++ b/lib/programmers/CheckerProgrammer.js +@@ -458,8 +458,8 @@ var CheckerProgrammer; + ? "".concat(explore.postfix.slice(0, -1), "[").concat(index, "]\"") + : "\"[".concat(index, "]\"") })); + }); +- var rest = tuple.elements.length && tuple.elements.at(-1).rest !== null +- ? CheckerProgrammer.decode(project)(config)(importer)(typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(input)("slice"), undefined, [ExpressionFactory_1.ExpressionFactory.number(tuple.elements.length - 1)]), (0, wrap_metadata_rest_tuple_1.wrap_metadata_rest_tuple)(tuple.elements.at(-1).rest), __assign(__assign({}, explore), { start: tuple.elements.length - 1 })) ++ var rest = tuple.elements.length && tuple.elements.slice(-1)[0].rest !== null ++ ? CheckerProgrammer.decode(project)(config)(importer)(typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(input)("slice"), undefined, [ExpressionFactory_1.ExpressionFactory.number(tuple.elements.length - 1)]), (0, wrap_metadata_rest_tuple_1.wrap_metadata_rest_tuple)(tuple.elements.slice(-1)[0].rest), __assign(__assign({}, explore), { start: tuple.elements.length - 1 })) + : null; + var arrayLength = typescript_1.default.factory.createPropertyAccessExpression(input, "length"); + return config.combiner(explore)("and")(input, __spreadArray(__spreadArray(__spreadArray([], __read((rest === null +diff --git a/lib/programmers/TypiaProgrammer.js b/lib/programmers/TypiaProgrammer.js +index c75ab1bc077b788e36c32834ea4916c22df34500..99452220e2dd090d4d562296e26fb266faa617f9 100644 +--- a/lib/programmers/TypiaProgrammer.js ++++ b/lib/programmers/TypiaProgrammer.js +@@ -165,7 +165,7 @@ var TypiaProgrammer; + .split("\n"); + if (lines.length === 0) + return [0, 0]; +- return [lines.length, lines.at(-1).length + 1]; ++ return [lines.length, lines.slice(-1)[0].length + 1]; + })() + : [0, 0], 2), line = _k[0], pos = _k[1]; + console.error("".concat(file, ":").concat(line, ":").concat(pos, " - ").concat(category, " TS").concat(diag.code, ": ").concat(diag.messageText)); +diff --git a/lib/programmers/internal/application_tuple.js b/lib/programmers/internal/application_tuple.js +index 5c1853a3a1692f95fe702bdae9813e958f54ac4c..04ca996c2ffe72d1cd5969e45a38e91937b975b1 100644 +--- a/lib/programmers/internal/application_tuple.js ++++ b/lib/programmers/internal/application_tuple.js +@@ -22,15 +22,15 @@ var application_tuple = function (options) { + var schema = __assign(__assign({ type: "array", items: tuple.type.elements.map(function (meta, i) { + var _a; + return (0, application_schema_1.application_schema)(options)(false)(components)((_a = meta.rest) !== null && _a !== void 0 ? _a : meta)(__assign(__assign({}, attribute), { "x-typia-rest": i === tuple.type.elements.length - 1 && meta.rest !== null, "x-typia-required": meta.required, "x-typia-optional": meta.optional })); +- }) }, attribute), { minItems: !!((_a = tuple.type.elements.at(-1)) === null || _a === void 0 ? void 0 : _a.rest) ++ }) }, attribute), { minItems: !!((_a = tuple.type.elements.slice(-1)[0]) === null || _a === void 0 ? void 0 : _a.rest) + ? tuple.type.elements.length - 1 +- : tuple.type.elements.filter(function (x) { return !x.optional; }).length, maxItems: !!((_b = tuple.type.elements.at(-1)) === null || _b === void 0 ? void 0 : _b.rest) ++ : tuple.type.elements.filter(function (x) { return !x.optional; }).length, maxItems: !!((_b = tuple.type.elements.slice(-1)[0]) === null || _b === void 0 ? void 0 : _b.rest) + ? undefined + : tuple.type.elements.length }); + if (options.purpose === "ajv") + if (tuple.type.elements.length === 0) + return schema; +- else if (!((_c = tuple.type.elements.at(-1)) === null || _c === void 0 ? void 0 : _c.rest)) ++ else if (!((_c = tuple.type.elements.slice(-1)[0]) === null || _c === void 0 ? void 0 : _c.rest)) + return schema; + var wrapper = __assign(__assign({}, schema), { items: (0, application_schema_1.application_schema)(options)(false)(components)(tuple.type.elements.reduce(function (x, y) { var _a, _b; return Metadata_1.Metadata.merge((_a = x.rest) !== null && _a !== void 0 ? _a : x, (_b = y.rest) !== null && _b !== void 0 ? _b : y); }, Metadata_1.Metadata.initialize()))(tuple.type.recursive ? {} : attribute), "x-typia-tuple": schema, minItems: schema.minItems, maxItems: schema.maxItems }); + return wrapper; +diff --git a/lib/programmers/json/JsonStringifyProgrammer.js b/lib/programmers/json/JsonStringifyProgrammer.js +index ce0ae787164f7eba68ef35b05232b4b94ad8e7d7..8f70cfc8c8e9d82cd1ec5004ca5637487f57b3bc 100644 +--- a/lib/programmers/json/JsonStringifyProgrammer.js ++++ b/lib/programmers/json/JsonStringifyProgrammer.js +@@ -424,10 +424,10 @@ var JsonStringifyProgrammer; + var rest = (function () { + if (tuple.elements.length === 0) + return null; +- var last = tuple.elements.at(-1); ++ var last = tuple.elements.slice(-1)[0]; + if (last.rest === null) + return null; +- var code = decode(project)(config)(importer)(typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(input)("slice"), undefined, [ExpressionFactory_1.ExpressionFactory.number(tuple.elements.length - 1)]), (0, wrap_metadata_rest_tuple_1.wrap_metadata_rest_tuple)(tuple.elements.at(-1).rest), __assign(__assign({}, explore), { start: tuple.elements.length - 1 })); ++ var code = decode(project)(config)(importer)(typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(input)("slice"), undefined, [ExpressionFactory_1.ExpressionFactory.number(tuple.elements.length - 1)]), (0, wrap_metadata_rest_tuple_1.wrap_metadata_rest_tuple)(tuple.elements.slice(-1)[0].rest), __assign(__assign({}, explore), { start: tuple.elements.length - 1 })); + return typescript_1.default.factory.createCallExpression(importer.use("rest"), undefined, [code]); + })(); + return StringifyJoinder_1.StringifyJoiner.tuple(children, rest); +diff --git a/lib/programmers/misc/MiscCloneProgrammer.js b/lib/programmers/misc/MiscCloneProgrammer.js +index 3db6bc92637284468c5fe47ef59f51a9b41d06eb..0b3fa9deaaadf28d4f348225c0d44f49700c1bca 100644 +--- a/lib/programmers/misc/MiscCloneProgrammer.js ++++ b/lib/programmers/misc/MiscCloneProgrammer.js +@@ -291,11 +291,11 @@ var MiscCloneProgrammer; + var rest = (function () { + if (tuple.elements.length === 0) + return null; +- var last = tuple.elements.at(-1); ++ var last = tuple.elements.slice(-1)[0]; + var rest = last.rest; + if (rest === null) + return null; +- return decode(project)(config)(importer)(typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(input)("slice"), undefined, [ExpressionFactory_1.ExpressionFactory.number(tuple.elements.length - 1)]), (0, wrap_metadata_rest_tuple_1.wrap_metadata_rest_tuple)(tuple.elements.at(-1).rest), __assign(__assign({}, explore), { start: tuple.elements.length - 1 })); ++ return decode(project)(config)(importer)(typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(input)("slice"), undefined, [ExpressionFactory_1.ExpressionFactory.number(tuple.elements.length - 1)]), (0, wrap_metadata_rest_tuple_1.wrap_metadata_rest_tuple)(tuple.elements.slice(-1)[0].rest), __assign(__assign({}, explore), { start: tuple.elements.length - 1 })); + })(); + return CloneJoiner_1.CloneJoiner.tuple(children, rest); + }; +diff --git a/lib/programmers/misc/MiscPruneProgrammer.js b/lib/programmers/misc/MiscPruneProgrammer.js +index 8440aaba9e449dae2468e96dfd7035ac7e170cfc..e97ceec78427b7eed08db23cc4775fdb10c6b2ff 100644 +--- a/lib/programmers/misc/MiscPruneProgrammer.js ++++ b/lib/programmers/misc/MiscPruneProgrammer.js +@@ -272,11 +272,11 @@ var MiscPruneProgrammer; + var rest = (function () { + if (tuple.elements.length === 0) + return null; +- var last = tuple.elements.at(-1); ++ var last = tuple.elements.slice(-1)[0]; + var rest = last.rest; + if (rest === null || filter(rest) === false) + return null; +- return decode(project)(config)(importer)(typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(input)("slice"), undefined, [ExpressionFactory_1.ExpressionFactory.number(tuple.elements.length - 1)]), (0, wrap_metadata_rest_tuple_1.wrap_metadata_rest_tuple)(tuple.elements.at(-1).rest), __assign(__assign({}, explore), { start: tuple.elements.length - 1 })); ++ return decode(project)(config)(importer)(typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(input)("slice"), undefined, [ExpressionFactory_1.ExpressionFactory.number(tuple.elements.length - 1)]), (0, wrap_metadata_rest_tuple_1.wrap_metadata_rest_tuple)(tuple.elements.slice(-1)[0].rest), __assign(__assign({}, explore), { start: tuple.elements.length - 1 })); + })(); + return PruneJoiner_1.PruneJoiner.tuple(children, rest); + }; +diff --git a/lib/programmers/notations/NotationGeneralProgrammer.js b/lib/programmers/notations/NotationGeneralProgrammer.js +index 6e0b582a802180d7671c00b999469e7e59193b30..f11cc1d523875a040d3e27ce9a850b083c5d0275 100644 +--- a/lib/programmers/notations/NotationGeneralProgrammer.js ++++ b/lib/programmers/notations/NotationGeneralProgrammer.js +@@ -301,11 +301,11 @@ var NotationGeneralProgrammer; + var rest = (function () { + if (tuple.elements.length === 0) + return null; +- var last = tuple.elements.at(-1); ++ var last = tuple.elements.slice(-1)[0]; + var rest = last.rest; + if (rest === null) + return null; +- return decode(project)(config)(importer)(typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(input)("slice"), undefined, [ExpressionFactory_1.ExpressionFactory.number(tuple.elements.length - 1)]), (0, wrap_metadata_rest_tuple_1.wrap_metadata_rest_tuple)(tuple.elements.at(-1).rest), __assign(__assign({}, explore), { start: tuple.elements.length - 1 })); ++ return decode(project)(config)(importer)(typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(input)("slice"), undefined, [ExpressionFactory_1.ExpressionFactory.number(tuple.elements.length - 1)]), (0, wrap_metadata_rest_tuple_1.wrap_metadata_rest_tuple)(tuple.elements.slice(-1)[0].rest), __assign(__assign({}, explore), { start: tuple.elements.length - 1 })); + })(); + return NotationJoiner_1.NotationJoiner.tuple(children, rest); + }; +diff --git a/lib/transformers/CallExpressionTransformer.js b/lib/transformers/CallExpressionTransformer.js +index 2c5a23879d171ee271ebf6857dc9c65ec29c0ea7..96a40845614f6c54fe8e4ebc48a7d8efeba52a41 100644 +--- a/lib/transformers/CallExpressionTransformer.js ++++ b/lib/transformers/CallExpressionTransformer.js +@@ -101,7 +101,7 @@ var CallExpressionTransformer; + var location = path_1.default.resolve(declaration.getSourceFile().fileName); + if (isTarget(location) === false) + return expression; +- var module = location.split(path_1.default.sep).at(-1).split(".")[0]; ++ var module = location.split(path_1.default.sep).slice(-1)[0].split(".")[0]; + var name = project.checker.getTypeAtLocation(declaration).symbol.name; + var functor = (_b = FUNCTORS[module]) === null || _b === void 0 ? void 0 : _b[name]; + if (functor === undefined) +diff --git a/src/factories/internal/metadata/iterate_metadata_intersection.ts b/src/factories/internal/metadata/iterate_metadata_intersection.ts +index f46caa25c987092597073e046ae3b9e8130bd994..1eedd727c74f173a5b98a9572b865e058885811d 100644 +--- a/src/factories/internal/metadata/iterate_metadata_intersection.ts ++++ b/src/factories/internal/metadata/iterate_metadata_intersection.ts +@@ -214,7 +214,7 @@ export const iterate_metadata_intersection = + target, + )(objects.map((om) => om.objects).flat(), explore); + if (tags.length) +- if (target === "array") meta.arrays.at(-1)!.tags.push(tags); ++ if (target === "array") meta.arrays.slice(-1)[0]!.tags.push(tags); + else if (booleanLiteral === null) + meta.atomics.find((a) => a.type === target)!.tags.push(tags); + else { +diff --git a/src/programmers/CheckerProgrammer.ts b/src/programmers/CheckerProgrammer.ts +index 892748b80755b89d1449f4d515aa3166534c6b19..8cb5ce35fe6f918545c82066f0583dead2661c89 100644 +--- a/src/programmers/CheckerProgrammer.ts ++++ b/src/programmers/CheckerProgrammer.ts +@@ -702,14 +702,14 @@ export namespace CheckerProgrammer { + ), + ); + const rest: ts.Expression | null = +- tuple.elements.length && tuple.elements.at(-1)!.rest !== null ++ tuple.elements.length && tuple.elements.slice(-1)[0]!.rest !== null + ? decode(project)(config)(importer)( + ts.factory.createCallExpression( + IdentifierFactory.access(input)("slice"), + undefined, + [ExpressionFactory.number(tuple.elements.length - 1)], + ), +- wrap_metadata_rest_tuple(tuple.elements.at(-1)!.rest!), ++ wrap_metadata_rest_tuple(tuple.elements.slice(-1)[0]!.rest!), + { + ...explore, + start: tuple.elements.length - 1, +diff --git a/src/programmers/TypiaProgrammer.ts b/src/programmers/TypiaProgrammer.ts +index e01eccf62eccd73e1f0720db897f539256a6bbc1..cae5eb6fc702d359d4886acefdb68d42691edf97 100644 +--- a/src/programmers/TypiaProgrammer.ts ++++ b/src/programmers/TypiaProgrammer.ts +@@ -101,7 +101,7 @@ export namespace TypiaProgrammer { + .file!.text.substring(0, diag.start) + .split("\n"); + if (lines.length === 0) return [0, 0]; +- return [lines.length, lines.at(-1)!.length + 1]; ++ return [lines.length, lines.slice(-1)[0]!.length + 1]; + })() + : [0, 0]; + console.error( +diff --git a/src/programmers/internal/application_tuple.ts b/src/programmers/internal/application_tuple.ts +index 5e10b9051e4a846f298aa8f086109e8d6bb38bf9..a8e24d5c2a2a4a4d5d1dc49eb45b4784654a4b66 100644 +--- a/src/programmers/internal/application_tuple.ts ++++ b/src/programmers/internal/application_tuple.ts +@@ -28,16 +28,16 @@ export const application_tuple = + }), + ), + ...attribute, +- minItems: !!tuple.type.elements.at(-1)?.rest ++ minItems: !!tuple.type.elements.slice(-1)[0]?.rest + ? tuple.type.elements.length - 1 + : tuple.type.elements.filter((x) => !x.optional).length, +- maxItems: !!tuple.type.elements.at(-1)?.rest ++ maxItems: !!tuple.type.elements.slice(-1)[0]?.rest + ? undefined + : tuple.type.elements.length, + }; + if (options.purpose === "ajv") + if (tuple.type.elements.length === 0) return schema; +- else if (!tuple.type.elements.at(-1)?.rest) return schema; ++ else if (!tuple.type.elements.slice(-1)[0]?.rest) return schema; + + const wrapper: IJsonSchema.IArray = { + ...schema, +diff --git a/src/programmers/json/JsonStringifyProgrammer.ts b/src/programmers/json/JsonStringifyProgrammer.ts +index c317cec2c78e984a6e64c7bf287d0c67e530e309..5974830c62dbd2b865aa2e64e2e757283258d872 100644 +--- a/src/programmers/json/JsonStringifyProgrammer.ts ++++ b/src/programmers/json/JsonStringifyProgrammer.ts +@@ -543,7 +543,7 @@ export namespace JsonStringifyProgrammer { + ); + const rest = (() => { + if (tuple.elements.length === 0) return null; +- const last = tuple.elements.at(-1)!; ++ const last = tuple.elements.slice(-1)[0]!; + if (last.rest === null) return null; + + const code = decode(project)(config)(importer)( +@@ -552,7 +552,7 @@ export namespace JsonStringifyProgrammer { + undefined, + [ExpressionFactory.number(tuple.elements.length - 1)], + ), +- wrap_metadata_rest_tuple(tuple.elements.at(-1)!.rest!), ++ wrap_metadata_rest_tuple(tuple.elements.slice(-1)[0]!.rest!), + { + ...explore, + start: tuple.elements.length - 1, +diff --git a/src/programmers/misc/MiscCloneProgrammer.ts b/src/programmers/misc/MiscCloneProgrammer.ts +index 94d768b0a0738c0caccd711671351d1f22fa3848..739fd5f2baf4d2eb8e9dd65d73179242a0244707 100644 +--- a/src/programmers/misc/MiscCloneProgrammer.ts ++++ b/src/programmers/misc/MiscCloneProgrammer.ts +@@ -343,7 +343,7 @@ export namespace MiscCloneProgrammer { + const rest = (() => { + if (tuple.elements.length === 0) return null; + +- const last: Metadata = tuple.elements.at(-1)!; ++ const last: Metadata = tuple.elements.slice(-1)[0]!; + const rest: Metadata | null = last.rest; + if (rest === null) return null; + +@@ -353,7 +353,7 @@ export namespace MiscCloneProgrammer { + undefined, + [ExpressionFactory.number(tuple.elements.length - 1)], + ), +- wrap_metadata_rest_tuple(tuple.elements.at(-1)!.rest!), ++ wrap_metadata_rest_tuple(tuple.elements.slice(-1)[0]!.rest!), + { + ...explore, + start: tuple.elements.length - 1, +diff --git a/src/programmers/misc/MiscPruneProgrammer.ts b/src/programmers/misc/MiscPruneProgrammer.ts +index ed1465267066e382ae6696a25a806c2489597593..661f3cd93ae66070c978bd3e8d2b8db07189fe47 100644 +--- a/src/programmers/misc/MiscPruneProgrammer.ts ++++ b/src/programmers/misc/MiscPruneProgrammer.ts +@@ -310,7 +310,7 @@ export namespace MiscPruneProgrammer { + const rest = (() => { + if (tuple.elements.length === 0) return null; + +- const last: Metadata = tuple.elements.at(-1)!; ++ const last: Metadata = tuple.elements.slice(-1)[0]!; + const rest: Metadata | null = last.rest; + if (rest === null || filter(rest) === false) return null; + +@@ -320,7 +320,7 @@ export namespace MiscPruneProgrammer { + undefined, + [ExpressionFactory.number(tuple.elements.length - 1)], + ), +- wrap_metadata_rest_tuple(tuple.elements.at(-1)!.rest!), ++ wrap_metadata_rest_tuple(tuple.elements.slice(-1)[0]!.rest!), + { + ...explore, + start: tuple.elements.length - 1, +diff --git a/src/programmers/notations/NotationGeneralProgrammer.ts b/src/programmers/notations/NotationGeneralProgrammer.ts +index bd49b1e34002b1a1ec4f5444a8f91fa0ab794360..71d676de290986045910602ab10c6ef09a19c07d 100644 +--- a/src/programmers/notations/NotationGeneralProgrammer.ts ++++ b/src/programmers/notations/NotationGeneralProgrammer.ts +@@ -353,7 +353,7 @@ export namespace NotationGeneralProgrammer { + const rest = (() => { + if (tuple.elements.length === 0) return null; + +- const last: Metadata = tuple.elements.at(-1)!; ++ const last: Metadata = tuple.elements.slice(-1)[0]!; + const rest: Metadata | null = last.rest; + if (rest === null) return null; + +@@ -363,7 +363,7 @@ export namespace NotationGeneralProgrammer { + undefined, + [ExpressionFactory.number(tuple.elements.length - 1)], + ), +- wrap_metadata_rest_tuple(tuple.elements.at(-1)!.rest!), ++ wrap_metadata_rest_tuple(tuple.elements.slice(-1)[0]!.rest!), + { + ...explore, + start: tuple.elements.length - 1, +diff --git a/src/transformers/CallExpressionTransformer.ts b/src/transformers/CallExpressionTransformer.ts +index c58a1b143ce4f204bb249a4858c9d16a26f97408..9e9ffcf73e4c01aa6ac8c213669fdcd50e0181b9 100644 +--- a/src/transformers/CallExpressionTransformer.ts ++++ b/src/transformers/CallExpressionTransformer.ts +@@ -111,7 +111,7 @@ export namespace CallExpressionTransformer { + // TRANSFORMATION + //---- + // FUNCTION NAME +- const module: string = location.split(path.sep).at(-1)!.split(".")[0]!; ++ const module: string = location.split(path.sep).slice(-1)[0]!.split(".")[0]!; + const { name } = project.checker.getTypeAtLocation(declaration).symbol; + + // FIND TRANSFORMER diff --git a/.yarn/releases/yarn-3.2.2.cjs b/.yarn/releases/yarn-3.2.2.cjs deleted file mode 100755 index 0912bea85eae..000000000000 --- a/.yarn/releases/yarn-3.2.2.cjs +++ /dev/null @@ -1,783 +0,0 @@ -#!/usr/bin/env node -/* eslint-disable */ -//prettier-ignore -(()=>{var nge=Object.create,Mh=Object.defineProperty,sge=Object.defineProperties,oge=Object.getOwnPropertyDescriptor,age=Object.getOwnPropertyDescriptors,Age=Object.getOwnPropertyNames,DE=Object.getOwnPropertySymbols,lge=Object.getPrototypeOf,eQ=Object.prototype.hasOwnProperty,OO=Object.prototype.propertyIsEnumerable;var MO=(r,e,t)=>e in r?Mh(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,N=(r,e)=>{for(var t in e||(e={}))eQ.call(e,t)&&MO(r,t,e[t]);if(DE)for(var t of DE(e))OO.call(e,t)&&MO(r,t,e[t]);return r},te=(r,e)=>sge(r,age(e)),cge=r=>Mh(r,"__esModule",{value:!0});var Or=(r,e)=>{var t={};for(var i in r)eQ.call(r,i)&&e.indexOf(i)<0&&(t[i]=r[i]);if(r!=null&&DE)for(var i of DE(r))e.indexOf(i)<0&&OO.call(r,i)&&(t[i]=r[i]);return t},uge=(r,e)=>()=>(r&&(e=r(r=0)),e),w=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),ft=(r,e)=>{for(var t in e)Mh(r,t,{get:e[t],enumerable:!0})},gge=(r,e,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Age(e))!eQ.call(r,i)&&i!=="default"&&Mh(r,i,{get:()=>e[i],enumerable:!(t=oge(e,i))||t.enumerable});return r},ge=r=>gge(cge(Mh(r!=null?nge(lge(r)):{},"default",r&&r.__esModule&&"default"in r?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r);var cM=w((i7e,oM)=>{oM.exports=aM;aM.sync=xge;var AM=require("fs");function kge(r,e){var t=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!t||(t=t.split(";"),t.indexOf("")!==-1))return!0;for(var i=0;i{uM.exports=gM;gM.sync=Pge;var fM=require("fs");function gM(r,e,t){fM.stat(r,function(i,n){t(i,i?!1:hM(n,e))})}function Pge(r,e){return hM(fM.statSync(r),e)}function hM(r,e){return r.isFile()&&Dge(r,e)}function Dge(r,e){var t=r.mode,i=r.uid,n=r.gid,s=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),o=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),l=parseInt("010",8),c=parseInt("001",8),u=a|l,g=t&c||t&l&&n===o||t&a&&i===s||t&u&&s===0;return g}});var CM=w((o7e,dM)=>{var s7e=require("fs"),zE;process.platform==="win32"||global.TESTING_WINDOWS?zE=cM():zE=pM();dM.exports=CQ;CQ.sync=Rge;function CQ(r,e,t){if(typeof e=="function"&&(t=e,e={}),!t){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(i,n){CQ(r,e||{},function(s,o){s?n(s):i(o)})})}zE(r,e||{},function(i,n){i&&(i.code==="EACCES"||e&&e.ignoreErrors)&&(i=null,n=!1),t(i,n)})}function Rge(r,e){try{return zE.sync(r,e||{})}catch(t){if(e&&e.ignoreErrors||t.code==="EACCES")return!1;throw t}}});var bM=w((a7e,mM)=>{var Xu=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",EM=require("path"),Fge=Xu?";":":",IM=CM(),yM=r=>Object.assign(new Error(`not found: ${r}`),{code:"ENOENT"}),wM=(r,e)=>{let t=e.colon||Fge,i=r.match(/\//)||Xu&&r.match(/\\/)?[""]:[...Xu?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(t)],n=Xu?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=Xu?n.split(t):[""];return Xu&&r.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:i,pathExt:s,pathExtExe:n}},BM=(r,e,t)=>{typeof e=="function"&&(t=e,e={}),e||(e={});let{pathEnv:i,pathExt:n,pathExtExe:s}=wM(r,e),o=[],a=c=>new Promise((u,g)=>{if(c===i.length)return e.all&&o.length?u(o):g(yM(r));let f=i[c],h=/^".*"$/.test(f)?f.slice(1,-1):f,p=EM.join(h,r),m=!h&&/^\.[\\\/]/.test(r)?r.slice(0,2)+p:p;u(l(m,c,0))}),l=(c,u,g)=>new Promise((f,h)=>{if(g===n.length)return f(a(u+1));let p=n[g];IM(c+p,{pathExt:s},(m,y)=>{if(!m&&y)if(e.all)o.push(c+p);else return f(c+p);return f(l(c,u,g+1))})});return t?a(0).then(c=>t(null,c),t):a(0)},Nge=(r,e)=>{e=e||{};let{pathEnv:t,pathExt:i,pathExtExe:n}=wM(r,e),s=[];for(let o=0;o{"use strict";var QM=(r={})=>{let e=r.env||process.env;return(r.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"};mQ.exports=QM;mQ.exports.default=QM});var PM=w((l7e,vM)=>{"use strict";var xM=require("path"),Lge=bM(),Tge=SM();function kM(r,e){let t=r.options.env||process.env,i=process.cwd(),n=r.options.cwd!=null,s=n&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(r.options.cwd)}catch(a){}let o;try{o=Lge.sync(r.command,{path:t[Tge({env:t})],pathExt:e?xM.delimiter:void 0})}catch(a){}finally{s&&process.chdir(i)}return o&&(o=xM.resolve(n?r.options.cwd:"",o)),o}function Oge(r){return kM(r)||kM(r,!0)}vM.exports=Oge});var DM=w((c7e,EQ)=>{"use strict";var IQ=/([()\][%!^"`<>&|;, *?])/g;function Mge(r){return r=r.replace(IQ,"^$1"),r}function Kge(r,e){return r=`${r}`,r=r.replace(/(\\*)"/g,'$1$1\\"'),r=r.replace(/(\\*)$/,"$1$1"),r=`"${r}"`,r=r.replace(IQ,"^$1"),e&&(r=r.replace(IQ,"^$1")),r}EQ.exports.command=Mge;EQ.exports.argument=Kge});var FM=w((u7e,RM)=>{"use strict";RM.exports=/^#!(.*)/});var LM=w((g7e,NM)=>{"use strict";var Uge=FM();NM.exports=(r="")=>{let e=r.match(Uge);if(!e)return null;let[t,i]=e[0].replace(/#! ?/,"").split(" "),n=t.split("/").pop();return n==="env"?i:i?`${n} ${i}`:n}});var OM=w((f7e,TM)=>{"use strict";var yQ=require("fs"),Hge=LM();function jge(r){let e=150,t=Buffer.alloc(e),i;try{i=yQ.openSync(r,"r"),yQ.readSync(i,t,0,e,0),yQ.closeSync(i)}catch(n){}return Hge(t.toString())}TM.exports=jge});var HM=w((h7e,MM)=>{"use strict";var Gge=require("path"),KM=PM(),UM=DM(),Yge=OM(),qge=process.platform==="win32",Jge=/\.(?:com|exe)$/i,Wge=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function zge(r){r.file=KM(r);let e=r.file&&Yge(r.file);return e?(r.args.unshift(r.file),r.command=e,KM(r)):r.file}function _ge(r){if(!qge)return r;let e=zge(r),t=!Jge.test(e);if(r.options.forceShell||t){let i=Wge.test(e);r.command=Gge.normalize(r.command),r.command=UM.command(r.command),r.args=r.args.map(s=>UM.argument(s,i));let n=[r.command].concat(r.args).join(" ");r.args=["/d","/s","/c",`"${n}"`],r.command=process.env.comspec||"cmd.exe",r.options.windowsVerbatimArguments=!0}return r}function Vge(r,e,t){e&&!Array.isArray(e)&&(t=e,e=null),e=e?e.slice(0):[],t=Object.assign({},t);let i={command:r,args:e,options:t,file:void 0,original:{command:r,args:e}};return t.shell?i:_ge(i)}MM.exports=Vge});var YM=w((p7e,jM)=>{"use strict";var wQ=process.platform==="win32";function BQ(r,e){return Object.assign(new Error(`${e} ${r.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${r.command}`,path:r.command,spawnargs:r.args})}function Xge(r,e){if(!wQ)return;let t=r.emit;r.emit=function(i,n){if(i==="exit"){let s=GM(n,e,"spawn");if(s)return t.call(r,"error",s)}return t.apply(r,arguments)}}function GM(r,e){return wQ&&r===1&&!e.file?BQ(e.original,"spawn"):null}function Zge(r,e){return wQ&&r===1&&!e.file?BQ(e.original,"spawnSync"):null}jM.exports={hookChildProcess:Xge,verifyENOENT:GM,verifyENOENTSync:Zge,notFoundError:BQ}});var SQ=w((d7e,Zu)=>{"use strict";var qM=require("child_process"),bQ=HM(),QQ=YM();function JM(r,e,t){let i=bQ(r,e,t),n=qM.spawn(i.command,i.args,i.options);return QQ.hookChildProcess(n,i),n}function $ge(r,e,t){let i=bQ(r,e,t),n=qM.spawnSync(i.command,i.args,i.options);return n.error=n.error||QQ.verifyENOENTSync(n.status,i),n}Zu.exports=JM;Zu.exports.spawn=JM;Zu.exports.sync=$ge;Zu.exports._parse=bQ;Zu.exports._enoent=QQ});var zM=w((C7e,WM)=>{"use strict";function efe(r,e){function t(){this.constructor=r}t.prototype=e.prototype,r.prototype=new t}function cc(r,e,t,i){this.message=r,this.expected=e,this.found=t,this.location=i,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,cc)}efe(cc,Error);cc.buildMessage=function(r,e){var t={literal:function(c){return'"'+n(c.text)+'"'},class:function(c){var u="",g;for(g=0;g0){for(g=1,f=1;g>",le=me(">>",!1),fe=">&",gt=me(">&",!1),Ht=">",Mt=me(">",!1),Ei="<<<",jt=me("<<<",!1),Qr="<&",Oi=me("<&",!1),Xs="<",Un=me("<",!1),Hn=function(C){return{type:"argument",segments:[].concat(...C)}},Sr=function(C){return C},jn="$'",fs=me("$'",!1),ba="'",DA=me("'",!1),Nu=function(C){return[{type:"text",text:C}]},hs='""',RA=me('""',!1),Qa=function(){return{type:"text",text:""}},Lu='"',FA=me('"',!1),NA=function(C){return C},vr=function(C){return{type:"arithmetic",arithmetic:C,quoted:!0}},zl=function(C){return{type:"shell",shell:C,quoted:!0}},Tu=function(C){return te(N({type:"variable"},C),{quoted:!0})},xo=function(C){return{type:"text",text:C}},Ou=function(C){return{type:"arithmetic",arithmetic:C,quoted:!1}},Sh=function(C){return{type:"shell",shell:C,quoted:!1}},vh=function(C){return te(N({type:"variable"},C),{quoted:!1})},Dr=function(C){return{type:"glob",pattern:C}},Ae=/^[^']/,ko=_e(["'"],!0,!1),Gn=function(C){return C.join("")},Mu=/^[^$"]/,St=_e(["$",'"'],!0,!1),_l=`\\ -`,Yn=me(`\\ -`,!1),ps=function(){return""},ds="\\",pt=me("\\",!1),Po=/^[\\$"`]/,lt=_e(["\\","$",'"',"`"],!1,!1),mn=function(C){return C},S="\\a",Tt=me("\\a",!1),Ku=function(){return"a"},Vl="\\b",xh=me("\\b",!1),kh=function(){return"\b"},Ph=/^[Ee]/,Dh=_e(["E","e"],!1,!1),Rh=function(){return""},j="\\f",wt=me("\\f",!1),LA=function(){return"\f"},$i="\\n",Xl=me("\\n",!1),$e=function(){return` -`},Sa="\\r",Uu=me("\\r",!1),yE=function(){return"\r"},Fh="\\t",wE=me("\\t",!1),gr=function(){return" "},qn="\\v",Zl=me("\\v",!1),Nh=function(){return"\v"},Zs=/^[\\'"?]/,va=_e(["\\","'",'"',"?"],!1,!1),En=function(C){return String.fromCharCode(parseInt(C,16))},Oe="\\x",Hu=me("\\x",!1),$l="\\u",$s=me("\\u",!1),ec="\\U",TA=me("\\U",!1),ju=function(C){return String.fromCodePoint(parseInt(C,16))},Gu=/^[0-7]/,xa=_e([["0","7"]],!1,!1),ka=/^[0-9a-fA-f]/,nt=_e([["0","9"],["a","f"],["A","f"]],!1,!1),Do=ot(),OA="-",tc=me("-",!1),eo="+",rc=me("+",!1),BE=".",Lh=me(".",!1),Yu=function(C,Q,F){return{type:"number",value:(C==="-"?-1:1)*parseFloat(Q.join("")+"."+F.join(""))}},Th=function(C,Q){return{type:"number",value:(C==="-"?-1:1)*parseInt(Q.join(""))}},bE=function(C){return N({type:"variable"},C)},ic=function(C){return{type:"variable",name:C}},QE=function(C){return C},qu="*",MA=me("*",!1),Tr="/",SE=me("/",!1),to=function(C,Q,F){return{type:Q==="*"?"multiplication":"division",right:F}},ro=function(C,Q){return Q.reduce((F,U)=>N({left:F},U),C)},Ju=function(C,Q,F){return{type:Q==="+"?"addition":"subtraction",right:F}},KA="$((",R=me("$((",!1),G="))",Ce=me("))",!1),He=function(C){return C},Te="$(",Xe=me("$(",!1),Et=function(C){return C},Rt="${",Jn=me("${",!1),Ob=":-",lO=me(":-",!1),cO=function(C,Q){return{name:C,defaultValue:Q}},Mb=":-}",uO=me(":-}",!1),gO=function(C){return{name:C,defaultValue:[]}},Kb=":+",fO=me(":+",!1),hO=function(C,Q){return{name:C,alternativeValue:Q}},Ub=":+}",pO=me(":+}",!1),dO=function(C){return{name:C,alternativeValue:[]}},Hb=function(C){return{name:C}},CO="$",mO=me("$",!1),EO=function(C){return e.isGlobPattern(C)},IO=function(C){return C},jb=/^[a-zA-Z0-9_]/,Gb=_e([["a","z"],["A","Z"],["0","9"],"_"],!1,!1),Yb=function(){return M()},qb=/^[$@*?#a-zA-Z0-9_\-]/,Jb=_e(["$","@","*","?","#",["a","z"],["A","Z"],["0","9"],"_","-"],!1,!1),yO=/^[(){}<>$|&; \t"']/,Wu=_e(["(",")","{","}","<",">","$","|","&",";"," "," ",'"',"'"],!1,!1),Wb=/^[<>&; \t"']/,zb=_e(["<",">","&",";"," "," ",'"',"'"],!1,!1),vE=/^[ \t]/,xE=_e([" "," "],!1,!1),B=0,Ue=0,UA=[{line:1,column:1}],d=0,E=[],I=0,D;if("startRule"in e){if(!(e.startRule in i))throw new Error(`Can't start parsing from rule "`+e.startRule+'".');n=i[e.startRule]}function M(){return r.substring(Ue,B)}function z(){return yt(Ue,B)}function ie(C,Q){throw Q=Q!==void 0?Q:yt(Ue,B),Mi([ut(C)],r.substring(Ue,B),Q)}function we(C,Q){throw Q=Q!==void 0?Q:yt(Ue,B),Wn(C,Q)}function me(C,Q){return{type:"literal",text:C,ignoreCase:Q}}function _e(C,Q,F){return{type:"class",parts:C,inverted:Q,ignoreCase:F}}function ot(){return{type:"any"}}function Bt(){return{type:"end"}}function ut(C){return{type:"other",description:C}}function st(C){var Q=UA[C],F;if(Q)return Q;for(F=C-1;!UA[F];)F--;for(Q=UA[F],Q={line:Q.line,column:Q.column};Fd&&(d=B,E=[]),E.push(C))}function Wn(C,Q){return new cc(C,null,null,Q)}function Mi(C,Q,F){return new cc(cc.buildMessage(C,Q),C,Q,F)}function HA(){var C,Q;return C=B,Q=Yr(),Q===t&&(Q=null),Q!==t&&(Ue=C,Q=s(Q)),C=Q,C}function Yr(){var C,Q,F,U,ue;if(C=B,Q=qr(),Q!==t){for(F=[],U=Ye();U!==t;)F.push(U),U=Ye();F!==t?(U=Pa(),U!==t?(ue=Cs(),ue===t&&(ue=null),ue!==t?(Ue=C,Q=o(Q,U,ue),C=Q):(B=C,C=t)):(B=C,C=t)):(B=C,C=t)}else B=C,C=t;if(C===t)if(C=B,Q=qr(),Q!==t){for(F=[],U=Ye();U!==t;)F.push(U),U=Ye();F!==t?(U=Pa(),U===t&&(U=null),U!==t?(Ue=C,Q=a(Q,U),C=Q):(B=C,C=t)):(B=C,C=t)}else B=C,C=t;return C}function Cs(){var C,Q,F,U,ue;for(C=B,Q=[],F=Ye();F!==t;)Q.push(F),F=Ye();if(Q!==t)if(F=Yr(),F!==t){for(U=[],ue=Ye();ue!==t;)U.push(ue),ue=Ye();U!==t?(Ue=C,Q=l(F),C=Q):(B=C,C=t)}else B=C,C=t;else B=C,C=t;return C}function Pa(){var C;return r.charCodeAt(B)===59?(C=c,B++):(C=t,I===0&&xe(u)),C===t&&(r.charCodeAt(B)===38?(C=g,B++):(C=t,I===0&&xe(f))),C}function qr(){var C,Q,F;return C=B,Q=wO(),Q!==t?(F=Hue(),F===t&&(F=null),F!==t?(Ue=C,Q=h(Q,F),C=Q):(B=C,C=t)):(B=C,C=t),C}function Hue(){var C,Q,F,U,ue,De,Ct;for(C=B,Q=[],F=Ye();F!==t;)Q.push(F),F=Ye();if(Q!==t)if(F=jue(),F!==t){for(U=[],ue=Ye();ue!==t;)U.push(ue),ue=Ye();if(U!==t)if(ue=qr(),ue!==t){for(De=[],Ct=Ye();Ct!==t;)De.push(Ct),Ct=Ye();De!==t?(Ue=C,Q=p(F,ue),C=Q):(B=C,C=t)}else B=C,C=t;else B=C,C=t}else B=C,C=t;else B=C,C=t;return C}function jue(){var C;return r.substr(B,2)===m?(C=m,B+=2):(C=t,I===0&&xe(y)),C===t&&(r.substr(B,2)===b?(C=b,B+=2):(C=t,I===0&&xe(v))),C}function wO(){var C,Q,F;return C=B,Q=que(),Q!==t?(F=Gue(),F===t&&(F=null),F!==t?(Ue=C,Q=x(Q,F),C=Q):(B=C,C=t)):(B=C,C=t),C}function Gue(){var C,Q,F,U,ue,De,Ct;for(C=B,Q=[],F=Ye();F!==t;)Q.push(F),F=Ye();if(Q!==t)if(F=Yue(),F!==t){for(U=[],ue=Ye();ue!==t;)U.push(ue),ue=Ye();if(U!==t)if(ue=wO(),ue!==t){for(De=[],Ct=Ye();Ct!==t;)De.push(Ct),Ct=Ye();De!==t?(Ue=C,Q=T(F,ue),C=Q):(B=C,C=t)}else B=C,C=t;else B=C,C=t}else B=C,C=t;else B=C,C=t;return C}function Yue(){var C;return r.substr(B,2)===q?(C=q,B+=2):(C=t,I===0&&xe(Y)),C===t&&(r.charCodeAt(B)===124?(C=$,B++):(C=t,I===0&&xe(_))),C}function kE(){var C,Q,F,U,ue,De;if(C=B,Q=NO(),Q!==t)if(r.charCodeAt(B)===61?(F=ne,B++):(F=t,I===0&&xe(ee)),F!==t)if(U=QO(),U!==t){for(ue=[],De=Ye();De!==t;)ue.push(De),De=Ye();ue!==t?(Ue=C,Q=A(Q,U),C=Q):(B=C,C=t)}else B=C,C=t;else B=C,C=t;else B=C,C=t;if(C===t)if(C=B,Q=NO(),Q!==t)if(r.charCodeAt(B)===61?(F=ne,B++):(F=t,I===0&&xe(ee)),F!==t){for(U=[],ue=Ye();ue!==t;)U.push(ue),ue=Ye();U!==t?(Ue=C,Q=oe(Q),C=Q):(B=C,C=t)}else B=C,C=t;else B=C,C=t;return C}function que(){var C,Q,F,U,ue,De,Ct,bt,$r,Ii,ms;for(C=B,Q=[],F=Ye();F!==t;)Q.push(F),F=Ye();if(Q!==t)if(r.charCodeAt(B)===40?(F=ce,B++):(F=t,I===0&&xe(Z)),F!==t){for(U=[],ue=Ye();ue!==t;)U.push(ue),ue=Ye();if(U!==t)if(ue=Yr(),ue!==t){for(De=[],Ct=Ye();Ct!==t;)De.push(Ct),Ct=Ye();if(De!==t)if(r.charCodeAt(B)===41?(Ct=O,B++):(Ct=t,I===0&&xe(L)),Ct!==t){for(bt=[],$r=Ye();$r!==t;)bt.push($r),$r=Ye();if(bt!==t){for($r=[],Ii=Oh();Ii!==t;)$r.push(Ii),Ii=Oh();if($r!==t){for(Ii=[],ms=Ye();ms!==t;)Ii.push(ms),ms=Ye();Ii!==t?(Ue=C,Q=de(ue,$r),C=Q):(B=C,C=t)}else B=C,C=t}else B=C,C=t}else B=C,C=t;else B=C,C=t}else B=C,C=t;else B=C,C=t}else B=C,C=t;else B=C,C=t;if(C===t){for(C=B,Q=[],F=Ye();F!==t;)Q.push(F),F=Ye();if(Q!==t)if(r.charCodeAt(B)===123?(F=Be,B++):(F=t,I===0&&xe(je)),F!==t){for(U=[],ue=Ye();ue!==t;)U.push(ue),ue=Ye();if(U!==t)if(ue=Yr(),ue!==t){for(De=[],Ct=Ye();Ct!==t;)De.push(Ct),Ct=Ye();if(De!==t)if(r.charCodeAt(B)===125?(Ct=re,B++):(Ct=t,I===0&&xe(se)),Ct!==t){for(bt=[],$r=Ye();$r!==t;)bt.push($r),$r=Ye();if(bt!==t){for($r=[],Ii=Oh();Ii!==t;)$r.push(Ii),Ii=Oh();if($r!==t){for(Ii=[],ms=Ye();ms!==t;)Ii.push(ms),ms=Ye();Ii!==t?(Ue=C,Q=be(ue,$r),C=Q):(B=C,C=t)}else B=C,C=t}else B=C,C=t}else B=C,C=t;else B=C,C=t}else B=C,C=t;else B=C,C=t}else B=C,C=t;else B=C,C=t;if(C===t){for(C=B,Q=[],F=Ye();F!==t;)Q.push(F),F=Ye();if(Q!==t){for(F=[],U=kE();U!==t;)F.push(U),U=kE();if(F!==t){for(U=[],ue=Ye();ue!==t;)U.push(ue),ue=Ye();if(U!==t){if(ue=[],De=bO(),De!==t)for(;De!==t;)ue.push(De),De=bO();else ue=t;if(ue!==t){for(De=[],Ct=Ye();Ct!==t;)De.push(Ct),Ct=Ye();De!==t?(Ue=C,Q=he(F,ue),C=Q):(B=C,C=t)}else B=C,C=t}else B=C,C=t}else B=C,C=t}else B=C,C=t;if(C===t){for(C=B,Q=[],F=Ye();F!==t;)Q.push(F),F=Ye();if(Q!==t){if(F=[],U=kE(),U!==t)for(;U!==t;)F.push(U),U=kE();else F=t;if(F!==t){for(U=[],ue=Ye();ue!==t;)U.push(ue),ue=Ye();U!==t?(Ue=C,Q=Fe(F),C=Q):(B=C,C=t)}else B=C,C=t}else B=C,C=t}}}return C}function BO(){var C,Q,F,U,ue;for(C=B,Q=[],F=Ye();F!==t;)Q.push(F),F=Ye();if(Q!==t){if(F=[],U=PE(),U!==t)for(;U!==t;)F.push(U),U=PE();else F=t;if(F!==t){for(U=[],ue=Ye();ue!==t;)U.push(ue),ue=Ye();U!==t?(Ue=C,Q=Ke(F),C=Q):(B=C,C=t)}else B=C,C=t}else B=C,C=t;return C}function bO(){var C,Q,F;for(C=B,Q=[],F=Ye();F!==t;)Q.push(F),F=Ye();if(Q!==t?(F=Oh(),F!==t?(Ue=C,Q=ke(F),C=Q):(B=C,C=t)):(B=C,C=t),C===t){for(C=B,Q=[],F=Ye();F!==t;)Q.push(F),F=Ye();Q!==t?(F=PE(),F!==t?(Ue=C,Q=ke(F),C=Q):(B=C,C=t)):(B=C,C=t)}return C}function Oh(){var C,Q,F,U,ue;for(C=B,Q=[],F=Ye();F!==t;)Q.push(F),F=Ye();return Q!==t?(ve.test(r.charAt(B))?(F=r.charAt(B),B++):(F=t,I===0&&xe(pe)),F===t&&(F=null),F!==t?(U=Jue(),U!==t?(ue=PE(),ue!==t?(Ue=C,Q=V(F,U,ue),C=Q):(B=C,C=t)):(B=C,C=t)):(B=C,C=t)):(B=C,C=t),C}function Jue(){var C;return r.substr(B,2)===Qe?(C=Qe,B+=2):(C=t,I===0&&xe(le)),C===t&&(r.substr(B,2)===fe?(C=fe,B+=2):(C=t,I===0&&xe(gt)),C===t&&(r.charCodeAt(B)===62?(C=Ht,B++):(C=t,I===0&&xe(Mt)),C===t&&(r.substr(B,3)===Ei?(C=Ei,B+=3):(C=t,I===0&&xe(jt)),C===t&&(r.substr(B,2)===Qr?(C=Qr,B+=2):(C=t,I===0&&xe(Oi)),C===t&&(r.charCodeAt(B)===60?(C=Xs,B++):(C=t,I===0&&xe(Un))))))),C}function PE(){var C,Q,F;for(C=B,Q=[],F=Ye();F!==t;)Q.push(F),F=Ye();return Q!==t?(F=QO(),F!==t?(Ue=C,Q=ke(F),C=Q):(B=C,C=t)):(B=C,C=t),C}function QO(){var C,Q,F;if(C=B,Q=[],F=SO(),F!==t)for(;F!==t;)Q.push(F),F=SO();else Q=t;return Q!==t&&(Ue=C,Q=Hn(Q)),C=Q,C}function SO(){var C,Q;return C=B,Q=Wue(),Q!==t&&(Ue=C,Q=Sr(Q)),C=Q,C===t&&(C=B,Q=zue(),Q!==t&&(Ue=C,Q=Sr(Q)),C=Q,C===t&&(C=B,Q=_ue(),Q!==t&&(Ue=C,Q=Sr(Q)),C=Q,C===t&&(C=B,Q=Vue(),Q!==t&&(Ue=C,Q=Sr(Q)),C=Q))),C}function Wue(){var C,Q,F,U;return C=B,r.substr(B,2)===jn?(Q=jn,B+=2):(Q=t,I===0&&xe(fs)),Q!==t?(F=$ue(),F!==t?(r.charCodeAt(B)===39?(U=ba,B++):(U=t,I===0&&xe(DA)),U!==t?(Ue=C,Q=Nu(F),C=Q):(B=C,C=t)):(B=C,C=t)):(B=C,C=t),C}function zue(){var C,Q,F,U;return C=B,r.charCodeAt(B)===39?(Q=ba,B++):(Q=t,I===0&&xe(DA)),Q!==t?(F=Xue(),F!==t?(r.charCodeAt(B)===39?(U=ba,B++):(U=t,I===0&&xe(DA)),U!==t?(Ue=C,Q=Nu(F),C=Q):(B=C,C=t)):(B=C,C=t)):(B=C,C=t),C}function _ue(){var C,Q,F,U;if(C=B,r.substr(B,2)===hs?(Q=hs,B+=2):(Q=t,I===0&&xe(RA)),Q!==t&&(Ue=C,Q=Qa()),C=Q,C===t)if(C=B,r.charCodeAt(B)===34?(Q=Lu,B++):(Q=t,I===0&&xe(FA)),Q!==t){for(F=[],U=vO();U!==t;)F.push(U),U=vO();F!==t?(r.charCodeAt(B)===34?(U=Lu,B++):(U=t,I===0&&xe(FA)),U!==t?(Ue=C,Q=NA(F),C=Q):(B=C,C=t)):(B=C,C=t)}else B=C,C=t;return C}function Vue(){var C,Q,F;if(C=B,Q=[],F=xO(),F!==t)for(;F!==t;)Q.push(F),F=xO();else Q=t;return Q!==t&&(Ue=C,Q=NA(Q)),C=Q,C}function vO(){var C,Q;return C=B,Q=RO(),Q!==t&&(Ue=C,Q=vr(Q)),C=Q,C===t&&(C=B,Q=FO(),Q!==t&&(Ue=C,Q=zl(Q)),C=Q,C===t&&(C=B,Q=Zb(),Q!==t&&(Ue=C,Q=Tu(Q)),C=Q,C===t&&(C=B,Q=Zue(),Q!==t&&(Ue=C,Q=xo(Q)),C=Q))),C}function xO(){var C,Q;return C=B,Q=RO(),Q!==t&&(Ue=C,Q=Ou(Q)),C=Q,C===t&&(C=B,Q=FO(),Q!==t&&(Ue=C,Q=Sh(Q)),C=Q,C===t&&(C=B,Q=Zb(),Q!==t&&(Ue=C,Q=vh(Q)),C=Q,C===t&&(C=B,Q=rge(),Q!==t&&(Ue=C,Q=Dr(Q)),C=Q,C===t&&(C=B,Q=tge(),Q!==t&&(Ue=C,Q=xo(Q)),C=Q)))),C}function Xue(){var C,Q,F;for(C=B,Q=[],Ae.test(r.charAt(B))?(F=r.charAt(B),B++):(F=t,I===0&&xe(ko));F!==t;)Q.push(F),Ae.test(r.charAt(B))?(F=r.charAt(B),B++):(F=t,I===0&&xe(ko));return Q!==t&&(Ue=C,Q=Gn(Q)),C=Q,C}function Zue(){var C,Q,F;if(C=B,Q=[],F=kO(),F===t&&(Mu.test(r.charAt(B))?(F=r.charAt(B),B++):(F=t,I===0&&xe(St))),F!==t)for(;F!==t;)Q.push(F),F=kO(),F===t&&(Mu.test(r.charAt(B))?(F=r.charAt(B),B++):(F=t,I===0&&xe(St)));else Q=t;return Q!==t&&(Ue=C,Q=Gn(Q)),C=Q,C}function kO(){var C,Q,F;return C=B,r.substr(B,2)===_l?(Q=_l,B+=2):(Q=t,I===0&&xe(Yn)),Q!==t&&(Ue=C,Q=ps()),C=Q,C===t&&(C=B,r.charCodeAt(B)===92?(Q=ds,B++):(Q=t,I===0&&xe(pt)),Q!==t?(Po.test(r.charAt(B))?(F=r.charAt(B),B++):(F=t,I===0&&xe(lt)),F!==t?(Ue=C,Q=mn(F),C=Q):(B=C,C=t)):(B=C,C=t)),C}function $ue(){var C,Q,F;for(C=B,Q=[],F=PO(),F===t&&(Ae.test(r.charAt(B))?(F=r.charAt(B),B++):(F=t,I===0&&xe(ko)));F!==t;)Q.push(F),F=PO(),F===t&&(Ae.test(r.charAt(B))?(F=r.charAt(B),B++):(F=t,I===0&&xe(ko)));return Q!==t&&(Ue=C,Q=Gn(Q)),C=Q,C}function PO(){var C,Q,F;return C=B,r.substr(B,2)===S?(Q=S,B+=2):(Q=t,I===0&&xe(Tt)),Q!==t&&(Ue=C,Q=Ku()),C=Q,C===t&&(C=B,r.substr(B,2)===Vl?(Q=Vl,B+=2):(Q=t,I===0&&xe(xh)),Q!==t&&(Ue=C,Q=kh()),C=Q,C===t&&(C=B,r.charCodeAt(B)===92?(Q=ds,B++):(Q=t,I===0&&xe(pt)),Q!==t?(Ph.test(r.charAt(B))?(F=r.charAt(B),B++):(F=t,I===0&&xe(Dh)),F!==t?(Ue=C,Q=Rh(),C=Q):(B=C,C=t)):(B=C,C=t),C===t&&(C=B,r.substr(B,2)===j?(Q=j,B+=2):(Q=t,I===0&&xe(wt)),Q!==t&&(Ue=C,Q=LA()),C=Q,C===t&&(C=B,r.substr(B,2)===$i?(Q=$i,B+=2):(Q=t,I===0&&xe(Xl)),Q!==t&&(Ue=C,Q=$e()),C=Q,C===t&&(C=B,r.substr(B,2)===Sa?(Q=Sa,B+=2):(Q=t,I===0&&xe(Uu)),Q!==t&&(Ue=C,Q=yE()),C=Q,C===t&&(C=B,r.substr(B,2)===Fh?(Q=Fh,B+=2):(Q=t,I===0&&xe(wE)),Q!==t&&(Ue=C,Q=gr()),C=Q,C===t&&(C=B,r.substr(B,2)===qn?(Q=qn,B+=2):(Q=t,I===0&&xe(Zl)),Q!==t&&(Ue=C,Q=Nh()),C=Q,C===t&&(C=B,r.charCodeAt(B)===92?(Q=ds,B++):(Q=t,I===0&&xe(pt)),Q!==t?(Zs.test(r.charAt(B))?(F=r.charAt(B),B++):(F=t,I===0&&xe(va)),F!==t?(Ue=C,Q=mn(F),C=Q):(B=C,C=t)):(B=C,C=t),C===t&&(C=ege()))))))))),C}function ege(){var C,Q,F,U,ue,De,Ct,bt,$r,Ii,ms,$b;return C=B,r.charCodeAt(B)===92?(Q=ds,B++):(Q=t,I===0&&xe(pt)),Q!==t?(F=_b(),F!==t?(Ue=C,Q=En(F),C=Q):(B=C,C=t)):(B=C,C=t),C===t&&(C=B,r.substr(B,2)===Oe?(Q=Oe,B+=2):(Q=t,I===0&&xe(Hu)),Q!==t?(F=B,U=B,ue=_b(),ue!==t?(De=zn(),De!==t?(ue=[ue,De],U=ue):(B=U,U=t)):(B=U,U=t),U===t&&(U=_b()),U!==t?F=r.substring(F,B):F=U,F!==t?(Ue=C,Q=En(F),C=Q):(B=C,C=t)):(B=C,C=t),C===t&&(C=B,r.substr(B,2)===$l?(Q=$l,B+=2):(Q=t,I===0&&xe($s)),Q!==t?(F=B,U=B,ue=zn(),ue!==t?(De=zn(),De!==t?(Ct=zn(),Ct!==t?(bt=zn(),bt!==t?(ue=[ue,De,Ct,bt],U=ue):(B=U,U=t)):(B=U,U=t)):(B=U,U=t)):(B=U,U=t),U!==t?F=r.substring(F,B):F=U,F!==t?(Ue=C,Q=En(F),C=Q):(B=C,C=t)):(B=C,C=t),C===t&&(C=B,r.substr(B,2)===ec?(Q=ec,B+=2):(Q=t,I===0&&xe(TA)),Q!==t?(F=B,U=B,ue=zn(),ue!==t?(De=zn(),De!==t?(Ct=zn(),Ct!==t?(bt=zn(),bt!==t?($r=zn(),$r!==t?(Ii=zn(),Ii!==t?(ms=zn(),ms!==t?($b=zn(),$b!==t?(ue=[ue,De,Ct,bt,$r,Ii,ms,$b],U=ue):(B=U,U=t)):(B=U,U=t)):(B=U,U=t)):(B=U,U=t)):(B=U,U=t)):(B=U,U=t)):(B=U,U=t)):(B=U,U=t),U!==t?F=r.substring(F,B):F=U,F!==t?(Ue=C,Q=ju(F),C=Q):(B=C,C=t)):(B=C,C=t)))),C}function _b(){var C;return Gu.test(r.charAt(B))?(C=r.charAt(B),B++):(C=t,I===0&&xe(xa)),C}function zn(){var C;return ka.test(r.charAt(B))?(C=r.charAt(B),B++):(C=t,I===0&&xe(nt)),C}function tge(){var C,Q,F,U,ue;if(C=B,Q=[],F=B,r.charCodeAt(B)===92?(U=ds,B++):(U=t,I===0&&xe(pt)),U!==t?(r.length>B?(ue=r.charAt(B),B++):(ue=t,I===0&&xe(Do)),ue!==t?(Ue=F,U=mn(ue),F=U):(B=F,F=t)):(B=F,F=t),F===t&&(F=B,U=B,I++,ue=LO(),I--,ue===t?U=void 0:(B=U,U=t),U!==t?(r.length>B?(ue=r.charAt(B),B++):(ue=t,I===0&&xe(Do)),ue!==t?(Ue=F,U=mn(ue),F=U):(B=F,F=t)):(B=F,F=t)),F!==t)for(;F!==t;)Q.push(F),F=B,r.charCodeAt(B)===92?(U=ds,B++):(U=t,I===0&&xe(pt)),U!==t?(r.length>B?(ue=r.charAt(B),B++):(ue=t,I===0&&xe(Do)),ue!==t?(Ue=F,U=mn(ue),F=U):(B=F,F=t)):(B=F,F=t),F===t&&(F=B,U=B,I++,ue=LO(),I--,ue===t?U=void 0:(B=U,U=t),U!==t?(r.length>B?(ue=r.charAt(B),B++):(ue=t,I===0&&xe(Do)),ue!==t?(Ue=F,U=mn(ue),F=U):(B=F,F=t)):(B=F,F=t));else Q=t;return Q!==t&&(Ue=C,Q=Gn(Q)),C=Q,C}function Vb(){var C,Q,F,U,ue,De;if(C=B,r.charCodeAt(B)===45?(Q=OA,B++):(Q=t,I===0&&xe(tc)),Q===t&&(r.charCodeAt(B)===43?(Q=eo,B++):(Q=t,I===0&&xe(rc))),Q===t&&(Q=null),Q!==t){if(F=[],ve.test(r.charAt(B))?(U=r.charAt(B),B++):(U=t,I===0&&xe(pe)),U!==t)for(;U!==t;)F.push(U),ve.test(r.charAt(B))?(U=r.charAt(B),B++):(U=t,I===0&&xe(pe));else F=t;if(F!==t)if(r.charCodeAt(B)===46?(U=BE,B++):(U=t,I===0&&xe(Lh)),U!==t){if(ue=[],ve.test(r.charAt(B))?(De=r.charAt(B),B++):(De=t,I===0&&xe(pe)),De!==t)for(;De!==t;)ue.push(De),ve.test(r.charAt(B))?(De=r.charAt(B),B++):(De=t,I===0&&xe(pe));else ue=t;ue!==t?(Ue=C,Q=Yu(Q,F,ue),C=Q):(B=C,C=t)}else B=C,C=t;else B=C,C=t}else B=C,C=t;if(C===t){if(C=B,r.charCodeAt(B)===45?(Q=OA,B++):(Q=t,I===0&&xe(tc)),Q===t&&(r.charCodeAt(B)===43?(Q=eo,B++):(Q=t,I===0&&xe(rc))),Q===t&&(Q=null),Q!==t){if(F=[],ve.test(r.charAt(B))?(U=r.charAt(B),B++):(U=t,I===0&&xe(pe)),U!==t)for(;U!==t;)F.push(U),ve.test(r.charAt(B))?(U=r.charAt(B),B++):(U=t,I===0&&xe(pe));else F=t;F!==t?(Ue=C,Q=Th(Q,F),C=Q):(B=C,C=t)}else B=C,C=t;if(C===t&&(C=B,Q=Zb(),Q!==t&&(Ue=C,Q=bE(Q)),C=Q,C===t&&(C=B,Q=nc(),Q!==t&&(Ue=C,Q=ic(Q)),C=Q,C===t)))if(C=B,r.charCodeAt(B)===40?(Q=ce,B++):(Q=t,I===0&&xe(Z)),Q!==t){for(F=[],U=Ye();U!==t;)F.push(U),U=Ye();if(F!==t)if(U=DO(),U!==t){for(ue=[],De=Ye();De!==t;)ue.push(De),De=Ye();ue!==t?(r.charCodeAt(B)===41?(De=O,B++):(De=t,I===0&&xe(L)),De!==t?(Ue=C,Q=QE(U),C=Q):(B=C,C=t)):(B=C,C=t)}else B=C,C=t;else B=C,C=t}else B=C,C=t}return C}function Xb(){var C,Q,F,U,ue,De,Ct,bt;if(C=B,Q=Vb(),Q!==t){for(F=[],U=B,ue=[],De=Ye();De!==t;)ue.push(De),De=Ye();if(ue!==t)if(r.charCodeAt(B)===42?(De=qu,B++):(De=t,I===0&&xe(MA)),De===t&&(r.charCodeAt(B)===47?(De=Tr,B++):(De=t,I===0&&xe(SE))),De!==t){for(Ct=[],bt=Ye();bt!==t;)Ct.push(bt),bt=Ye();Ct!==t?(bt=Vb(),bt!==t?(Ue=U,ue=to(Q,De,bt),U=ue):(B=U,U=t)):(B=U,U=t)}else B=U,U=t;else B=U,U=t;for(;U!==t;){for(F.push(U),U=B,ue=[],De=Ye();De!==t;)ue.push(De),De=Ye();if(ue!==t)if(r.charCodeAt(B)===42?(De=qu,B++):(De=t,I===0&&xe(MA)),De===t&&(r.charCodeAt(B)===47?(De=Tr,B++):(De=t,I===0&&xe(SE))),De!==t){for(Ct=[],bt=Ye();bt!==t;)Ct.push(bt),bt=Ye();Ct!==t?(bt=Vb(),bt!==t?(Ue=U,ue=to(Q,De,bt),U=ue):(B=U,U=t)):(B=U,U=t)}else B=U,U=t;else B=U,U=t}F!==t?(Ue=C,Q=ro(Q,F),C=Q):(B=C,C=t)}else B=C,C=t;return C}function DO(){var C,Q,F,U,ue,De,Ct,bt;if(C=B,Q=Xb(),Q!==t){for(F=[],U=B,ue=[],De=Ye();De!==t;)ue.push(De),De=Ye();if(ue!==t)if(r.charCodeAt(B)===43?(De=eo,B++):(De=t,I===0&&xe(rc)),De===t&&(r.charCodeAt(B)===45?(De=OA,B++):(De=t,I===0&&xe(tc))),De!==t){for(Ct=[],bt=Ye();bt!==t;)Ct.push(bt),bt=Ye();Ct!==t?(bt=Xb(),bt!==t?(Ue=U,ue=Ju(Q,De,bt),U=ue):(B=U,U=t)):(B=U,U=t)}else B=U,U=t;else B=U,U=t;for(;U!==t;){for(F.push(U),U=B,ue=[],De=Ye();De!==t;)ue.push(De),De=Ye();if(ue!==t)if(r.charCodeAt(B)===43?(De=eo,B++):(De=t,I===0&&xe(rc)),De===t&&(r.charCodeAt(B)===45?(De=OA,B++):(De=t,I===0&&xe(tc))),De!==t){for(Ct=[],bt=Ye();bt!==t;)Ct.push(bt),bt=Ye();Ct!==t?(bt=Xb(),bt!==t?(Ue=U,ue=Ju(Q,De,bt),U=ue):(B=U,U=t)):(B=U,U=t)}else B=U,U=t;else B=U,U=t}F!==t?(Ue=C,Q=ro(Q,F),C=Q):(B=C,C=t)}else B=C,C=t;return C}function RO(){var C,Q,F,U,ue,De;if(C=B,r.substr(B,3)===KA?(Q=KA,B+=3):(Q=t,I===0&&xe(R)),Q!==t){for(F=[],U=Ye();U!==t;)F.push(U),U=Ye();if(F!==t)if(U=DO(),U!==t){for(ue=[],De=Ye();De!==t;)ue.push(De),De=Ye();ue!==t?(r.substr(B,2)===G?(De=G,B+=2):(De=t,I===0&&xe(Ce)),De!==t?(Ue=C,Q=He(U),C=Q):(B=C,C=t)):(B=C,C=t)}else B=C,C=t;else B=C,C=t}else B=C,C=t;return C}function FO(){var C,Q,F,U;return C=B,r.substr(B,2)===Te?(Q=Te,B+=2):(Q=t,I===0&&xe(Xe)),Q!==t?(F=Yr(),F!==t?(r.charCodeAt(B)===41?(U=O,B++):(U=t,I===0&&xe(L)),U!==t?(Ue=C,Q=Et(F),C=Q):(B=C,C=t)):(B=C,C=t)):(B=C,C=t),C}function Zb(){var C,Q,F,U,ue,De;return C=B,r.substr(B,2)===Rt?(Q=Rt,B+=2):(Q=t,I===0&&xe(Jn)),Q!==t?(F=nc(),F!==t?(r.substr(B,2)===Ob?(U=Ob,B+=2):(U=t,I===0&&xe(lO)),U!==t?(ue=BO(),ue!==t?(r.charCodeAt(B)===125?(De=re,B++):(De=t,I===0&&xe(se)),De!==t?(Ue=C,Q=cO(F,ue),C=Q):(B=C,C=t)):(B=C,C=t)):(B=C,C=t)):(B=C,C=t)):(B=C,C=t),C===t&&(C=B,r.substr(B,2)===Rt?(Q=Rt,B+=2):(Q=t,I===0&&xe(Jn)),Q!==t?(F=nc(),F!==t?(r.substr(B,3)===Mb?(U=Mb,B+=3):(U=t,I===0&&xe(uO)),U!==t?(Ue=C,Q=gO(F),C=Q):(B=C,C=t)):(B=C,C=t)):(B=C,C=t),C===t&&(C=B,r.substr(B,2)===Rt?(Q=Rt,B+=2):(Q=t,I===0&&xe(Jn)),Q!==t?(F=nc(),F!==t?(r.substr(B,2)===Kb?(U=Kb,B+=2):(U=t,I===0&&xe(fO)),U!==t?(ue=BO(),ue!==t?(r.charCodeAt(B)===125?(De=re,B++):(De=t,I===0&&xe(se)),De!==t?(Ue=C,Q=hO(F,ue),C=Q):(B=C,C=t)):(B=C,C=t)):(B=C,C=t)):(B=C,C=t)):(B=C,C=t),C===t&&(C=B,r.substr(B,2)===Rt?(Q=Rt,B+=2):(Q=t,I===0&&xe(Jn)),Q!==t?(F=nc(),F!==t?(r.substr(B,3)===Ub?(U=Ub,B+=3):(U=t,I===0&&xe(pO)),U!==t?(Ue=C,Q=dO(F),C=Q):(B=C,C=t)):(B=C,C=t)):(B=C,C=t),C===t&&(C=B,r.substr(B,2)===Rt?(Q=Rt,B+=2):(Q=t,I===0&&xe(Jn)),Q!==t?(F=nc(),F!==t?(r.charCodeAt(B)===125?(U=re,B++):(U=t,I===0&&xe(se)),U!==t?(Ue=C,Q=Hb(F),C=Q):(B=C,C=t)):(B=C,C=t)):(B=C,C=t),C===t&&(C=B,r.charCodeAt(B)===36?(Q=CO,B++):(Q=t,I===0&&xe(mO)),Q!==t?(F=nc(),F!==t?(Ue=C,Q=Hb(F),C=Q):(B=C,C=t)):(B=C,C=t)))))),C}function rge(){var C,Q,F;return C=B,Q=ige(),Q!==t?(Ue=B,F=EO(Q),F?F=void 0:F=t,F!==t?(Ue=C,Q=IO(Q),C=Q):(B=C,C=t)):(B=C,C=t),C}function ige(){var C,Q,F,U,ue;if(C=B,Q=[],F=B,U=B,I++,ue=TO(),I--,ue===t?U=void 0:(B=U,U=t),U!==t?(r.length>B?(ue=r.charAt(B),B++):(ue=t,I===0&&xe(Do)),ue!==t?(Ue=F,U=mn(ue),F=U):(B=F,F=t)):(B=F,F=t),F!==t)for(;F!==t;)Q.push(F),F=B,U=B,I++,ue=TO(),I--,ue===t?U=void 0:(B=U,U=t),U!==t?(r.length>B?(ue=r.charAt(B),B++):(ue=t,I===0&&xe(Do)),ue!==t?(Ue=F,U=mn(ue),F=U):(B=F,F=t)):(B=F,F=t);else Q=t;return Q!==t&&(Ue=C,Q=Gn(Q)),C=Q,C}function NO(){var C,Q,F;if(C=B,Q=[],jb.test(r.charAt(B))?(F=r.charAt(B),B++):(F=t,I===0&&xe(Gb)),F!==t)for(;F!==t;)Q.push(F),jb.test(r.charAt(B))?(F=r.charAt(B),B++):(F=t,I===0&&xe(Gb));else Q=t;return Q!==t&&(Ue=C,Q=Yb()),C=Q,C}function nc(){var C,Q,F;if(C=B,Q=[],qb.test(r.charAt(B))?(F=r.charAt(B),B++):(F=t,I===0&&xe(Jb)),F!==t)for(;F!==t;)Q.push(F),qb.test(r.charAt(B))?(F=r.charAt(B),B++):(F=t,I===0&&xe(Jb));else Q=t;return Q!==t&&(Ue=C,Q=Yb()),C=Q,C}function LO(){var C;return yO.test(r.charAt(B))?(C=r.charAt(B),B++):(C=t,I===0&&xe(Wu)),C}function TO(){var C;return Wb.test(r.charAt(B))?(C=r.charAt(B),B++):(C=t,I===0&&xe(zb)),C}function Ye(){var C,Q;if(C=[],vE.test(r.charAt(B))?(Q=r.charAt(B),B++):(Q=t,I===0&&xe(xE)),Q!==t)for(;Q!==t;)C.push(Q),vE.test(r.charAt(B))?(Q=r.charAt(B),B++):(Q=t,I===0&&xe(xE));else C=t;return C}if(D=n(),D!==t&&B===r.length)return D;throw D!==t&&B{"use strict";function rfe(r,e){function t(){this.constructor=r}t.prototype=e.prototype,r.prototype=new t}function gc(r,e,t,i){this.message=r,this.expected=e,this.found=t,this.location=i,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,gc)}rfe(gc,Error);gc.buildMessage=function(r,e){var t={literal:function(c){return'"'+n(c.text)+'"'},class:function(c){var u="",g;for(g=0;g0){for(g=1,f=1;gq&&(q=v,Y=[]),Y.push(pe))}function se(pe,V){return new gc(pe,null,null,V)}function be(pe,V,Qe){return new gc(gc.buildMessage(pe,V),pe,V,Qe)}function he(){var pe,V,Qe,le;return pe=v,V=Fe(),V!==t?(r.charCodeAt(v)===47?(Qe=s,v++):(Qe=t,$===0&&re(o)),Qe!==t?(le=Fe(),le!==t?(x=pe,V=a(V,le),pe=V):(v=pe,pe=t)):(v=pe,pe=t)):(v=pe,pe=t),pe===t&&(pe=v,V=Fe(),V!==t&&(x=pe,V=l(V)),pe=V),pe}function Fe(){var pe,V,Qe,le;return pe=v,V=Ke(),V!==t?(r.charCodeAt(v)===64?(Qe=c,v++):(Qe=t,$===0&&re(u)),Qe!==t?(le=ve(),le!==t?(x=pe,V=g(V,le),pe=V):(v=pe,pe=t)):(v=pe,pe=t)):(v=pe,pe=t),pe===t&&(pe=v,V=Ke(),V!==t&&(x=pe,V=f(V)),pe=V),pe}function Ke(){var pe,V,Qe,le,fe;return pe=v,r.charCodeAt(v)===64?(V=c,v++):(V=t,$===0&&re(u)),V!==t?(Qe=ke(),Qe!==t?(r.charCodeAt(v)===47?(le=s,v++):(le=t,$===0&&re(o)),le!==t?(fe=ke(),fe!==t?(x=pe,V=h(),pe=V):(v=pe,pe=t)):(v=pe,pe=t)):(v=pe,pe=t)):(v=pe,pe=t),pe===t&&(pe=v,V=ke(),V!==t&&(x=pe,V=h()),pe=V),pe}function ke(){var pe,V,Qe;if(pe=v,V=[],p.test(r.charAt(v))?(Qe=r.charAt(v),v++):(Qe=t,$===0&&re(m)),Qe!==t)for(;Qe!==t;)V.push(Qe),p.test(r.charAt(v))?(Qe=r.charAt(v),v++):(Qe=t,$===0&&re(m));else V=t;return V!==t&&(x=pe,V=h()),pe=V,pe}function ve(){var pe,V,Qe;if(pe=v,V=[],y.test(r.charAt(v))?(Qe=r.charAt(v),v++):(Qe=t,$===0&&re(b)),Qe!==t)for(;Qe!==t;)V.push(Qe),y.test(r.charAt(v))?(Qe=r.charAt(v),v++):(Qe=t,$===0&&re(b));else V=t;return V!==t&&(x=pe,V=h()),pe=V,pe}if(_=n(),_!==t&&v===r.length)return _;throw _!==t&&v{"use strict";function $M(r){return typeof r=="undefined"||r===null}function nfe(r){return typeof r=="object"&&r!==null}function sfe(r){return Array.isArray(r)?r:$M(r)?[]:[r]}function ofe(r,e){var t,i,n,s;if(e)for(s=Object.keys(e),t=0,i=s.length;t{"use strict";function ep(r,e){Error.call(this),this.name="YAMLException",this.reason=r,this.mark=e,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():""),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}ep.prototype=Object.create(Error.prototype);ep.prototype.constructor=ep;ep.prototype.toString=function(e){var t=this.name+": ";return t+=this.reason||"(unknown reason)",!e&&this.mark&&(t+=" "+this.mark.toString()),t};e1.exports=ep});var i1=w((L7e,t1)=>{"use strict";var r1=hc();function RQ(r,e,t,i,n){this.name=r,this.buffer=e,this.position=t,this.line=i,this.column=n}RQ.prototype.getSnippet=function(e,t){var i,n,s,o,a;if(!this.buffer)return null;for(e=e||4,t=t||75,i="",n=this.position;n>0&&`\0\r -\x85\u2028\u2029`.indexOf(this.buffer.charAt(n-1))===-1;)if(n-=1,this.position-n>t/2-1){i=" ... ",n+=5;break}for(s="",o=this.position;ot/2-1){s=" ... ",o-=5;break}return a=this.buffer.slice(n,o),r1.repeat(" ",e)+i+a+s+` -`+r1.repeat(" ",e+this.position-n+i.length)+"^"};RQ.prototype.toString=function(e){var t,i="";return this.name&&(i+='in "'+this.name+'" '),i+="at line "+(this.line+1)+", column "+(this.column+1),e||(t=this.getSnippet(),t&&(i+=`: -`+t)),i};t1.exports=RQ});var ci=w((T7e,n1)=>{"use strict";var s1=tg(),lfe=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],cfe=["scalar","sequence","mapping"];function ufe(r){var e={};return r!==null&&Object.keys(r).forEach(function(t){r[t].forEach(function(i){e[String(i)]=t})}),e}function gfe(r,e){if(e=e||{},Object.keys(e).forEach(function(t){if(lfe.indexOf(t)===-1)throw new s1('Unknown option "'+t+'" is met in definition of "'+r+'" YAML type.')}),this.tag=r,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(t){return t},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.defaultStyle=e.defaultStyle||null,this.styleAliases=ufe(e.styleAliases||null),cfe.indexOf(this.kind)===-1)throw new s1('Unknown kind "'+this.kind+'" is specified for "'+r+'" YAML type.')}n1.exports=gfe});var pc=w((O7e,o1)=>{"use strict";var a1=hc(),tI=tg(),ffe=ci();function FQ(r,e,t){var i=[];return r.include.forEach(function(n){t=FQ(n,e,t)}),r[e].forEach(function(n){t.forEach(function(s,o){s.tag===n.tag&&s.kind===n.kind&&i.push(o)}),t.push(n)}),t.filter(function(n,s){return i.indexOf(s)===-1})}function hfe(){var r={scalar:{},sequence:{},mapping:{},fallback:{}},e,t;function i(n){r[n.kind][n.tag]=r.fallback[n.tag]=n}for(e=0,t=arguments.length;e{"use strict";var pfe=ci();A1.exports=new pfe("tag:yaml.org,2002:str",{kind:"scalar",construct:function(r){return r!==null?r:""}})});var u1=w((K7e,c1)=>{"use strict";var dfe=ci();c1.exports=new dfe("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(r){return r!==null?r:[]}})});var f1=w((U7e,g1)=>{"use strict";var Cfe=ci();g1.exports=new Cfe("tag:yaml.org,2002:map",{kind:"mapping",construct:function(r){return r!==null?r:{}}})});var rI=w((H7e,h1)=>{"use strict";var mfe=pc();h1.exports=new mfe({explicit:[l1(),u1(),f1()]})});var d1=w((j7e,p1)=>{"use strict";var Efe=ci();function Ife(r){if(r===null)return!0;var e=r.length;return e===1&&r==="~"||e===4&&(r==="null"||r==="Null"||r==="NULL")}function yfe(){return null}function wfe(r){return r===null}p1.exports=new Efe("tag:yaml.org,2002:null",{kind:"scalar",resolve:Ife,construct:yfe,predicate:wfe,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})});var m1=w((G7e,C1)=>{"use strict";var Bfe=ci();function bfe(r){if(r===null)return!1;var e=r.length;return e===4&&(r==="true"||r==="True"||r==="TRUE")||e===5&&(r==="false"||r==="False"||r==="FALSE")}function Qfe(r){return r==="true"||r==="True"||r==="TRUE"}function Sfe(r){return Object.prototype.toString.call(r)==="[object Boolean]"}C1.exports=new Bfe("tag:yaml.org,2002:bool",{kind:"scalar",resolve:bfe,construct:Qfe,predicate:Sfe,represent:{lowercase:function(r){return r?"true":"false"},uppercase:function(r){return r?"TRUE":"FALSE"},camelcase:function(r){return r?"True":"False"}},defaultStyle:"lowercase"})});var I1=w((Y7e,E1)=>{"use strict";var vfe=hc(),xfe=ci();function kfe(r){return 48<=r&&r<=57||65<=r&&r<=70||97<=r&&r<=102}function Pfe(r){return 48<=r&&r<=55}function Dfe(r){return 48<=r&&r<=57}function Rfe(r){if(r===null)return!1;var e=r.length,t=0,i=!1,n;if(!e)return!1;if(n=r[t],(n==="-"||n==="+")&&(n=r[++t]),n==="0"){if(t+1===e)return!0;if(n=r[++t],n==="b"){for(t++;t=0?"0b"+r.toString(2):"-0b"+r.toString(2).slice(1)},octal:function(r){return r>=0?"0"+r.toString(8):"-0"+r.toString(8).slice(1)},decimal:function(r){return r.toString(10)},hexadecimal:function(r){return r>=0?"0x"+r.toString(16).toUpperCase():"-0x"+r.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})});var B1=w((q7e,y1)=>{"use strict";var w1=hc(),Lfe=ci(),Tfe=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Ofe(r){return!(r===null||!Tfe.test(r)||r[r.length-1]==="_")}function Mfe(r){var e,t,i,n;return e=r.replace(/_/g,"").toLowerCase(),t=e[0]==="-"?-1:1,n=[],"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?t===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:e.indexOf(":")>=0?(e.split(":").forEach(function(s){n.unshift(parseFloat(s,10))}),e=0,i=1,n.forEach(function(s){e+=s*i,i*=60}),t*e):t*parseFloat(e,10)}var Kfe=/^[-+]?[0-9]+e/;function Ufe(r,e){var t;if(isNaN(r))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===r)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===r)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(w1.isNegativeZero(r))return"-0.0";return t=r.toString(10),Kfe.test(t)?t.replace("e",".e"):t}function Hfe(r){return Object.prototype.toString.call(r)==="[object Number]"&&(r%1!=0||w1.isNegativeZero(r))}y1.exports=new Lfe("tag:yaml.org,2002:float",{kind:"scalar",resolve:Ofe,construct:Mfe,predicate:Hfe,represent:Ufe,defaultStyle:"lowercase"})});var NQ=w((J7e,b1)=>{"use strict";var jfe=pc();b1.exports=new jfe({include:[rI()],implicit:[d1(),m1(),I1(),B1()]})});var LQ=w((W7e,Q1)=>{"use strict";var Gfe=pc();Q1.exports=new Gfe({include:[NQ()]})});var k1=w((z7e,S1)=>{"use strict";var Yfe=ci(),v1=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),x1=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function qfe(r){return r===null?!1:v1.exec(r)!==null||x1.exec(r)!==null}function Jfe(r){var e,t,i,n,s,o,a,l=0,c=null,u,g,f;if(e=v1.exec(r),e===null&&(e=x1.exec(r)),e===null)throw new Error("Date resolve error");if(t=+e[1],i=+e[2]-1,n=+e[3],!e[4])return new Date(Date.UTC(t,i,n));if(s=+e[4],o=+e[5],a=+e[6],e[7]){for(l=e[7].slice(0,3);l.length<3;)l+="0";l=+l}return e[9]&&(u=+e[10],g=+(e[11]||0),c=(u*60+g)*6e4,e[9]==="-"&&(c=-c)),f=new Date(Date.UTC(t,i,n,s,o,a,l)),c&&f.setTime(f.getTime()-c),f}function Wfe(r){return r.toISOString()}S1.exports=new Yfe("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:qfe,construct:Jfe,instanceOf:Date,represent:Wfe})});var D1=w((_7e,P1)=>{"use strict";var zfe=ci();function _fe(r){return r==="<<"||r===null}P1.exports=new zfe("tag:yaml.org,2002:merge",{kind:"scalar",resolve:_fe})});var N1=w((V7e,R1)=>{"use strict";var dc;try{F1=require,dc=F1("buffer").Buffer}catch(r){}var F1,Vfe=ci(),TQ=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= -\r`;function Xfe(r){if(r===null)return!1;var e,t,i=0,n=r.length,s=TQ;for(t=0;t64)){if(e<0)return!1;i+=6}return i%8==0}function Zfe(r){var e,t,i=r.replace(/[\r\n=]/g,""),n=i.length,s=TQ,o=0,a=[];for(e=0;e>16&255),a.push(o>>8&255),a.push(o&255)),o=o<<6|s.indexOf(i.charAt(e));return t=n%4*6,t===0?(a.push(o>>16&255),a.push(o>>8&255),a.push(o&255)):t===18?(a.push(o>>10&255),a.push(o>>2&255)):t===12&&a.push(o>>4&255),dc?dc.from?dc.from(a):new dc(a):a}function $fe(r){var e="",t=0,i,n,s=r.length,o=TQ;for(i=0;i>18&63],e+=o[t>>12&63],e+=o[t>>6&63],e+=o[t&63]),t=(t<<8)+r[i];return n=s%3,n===0?(e+=o[t>>18&63],e+=o[t>>12&63],e+=o[t>>6&63],e+=o[t&63]):n===2?(e+=o[t>>10&63],e+=o[t>>4&63],e+=o[t<<2&63],e+=o[64]):n===1&&(e+=o[t>>2&63],e+=o[t<<4&63],e+=o[64],e+=o[64]),e}function ehe(r){return dc&&dc.isBuffer(r)}R1.exports=new Vfe("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Xfe,construct:Zfe,predicate:ehe,represent:$fe})});var T1=w((X7e,L1)=>{"use strict";var the=ci(),rhe=Object.prototype.hasOwnProperty,ihe=Object.prototype.toString;function nhe(r){if(r===null)return!0;var e=[],t,i,n,s,o,a=r;for(t=0,i=a.length;t{"use strict";var ohe=ci(),ahe=Object.prototype.toString;function Ahe(r){if(r===null)return!0;var e,t,i,n,s,o=r;for(s=new Array(o.length),e=0,t=o.length;e{"use strict";var che=ci(),uhe=Object.prototype.hasOwnProperty;function ghe(r){if(r===null)return!0;var e,t=r;for(e in t)if(uhe.call(t,e)&&t[e]!==null)return!1;return!0}function fhe(r){return r!==null?r:{}}K1.exports=new che("tag:yaml.org,2002:set",{kind:"mapping",resolve:ghe,construct:fhe})});var ig=w((eXe,H1)=>{"use strict";var hhe=pc();H1.exports=new hhe({include:[LQ()],implicit:[k1(),D1()],explicit:[N1(),T1(),M1(),U1()]})});var G1=w((tXe,j1)=>{"use strict";var phe=ci();function dhe(){return!0}function Che(){}function mhe(){return""}function Ehe(r){return typeof r=="undefined"}j1.exports=new phe("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:dhe,construct:Che,predicate:Ehe,represent:mhe})});var q1=w((rXe,Y1)=>{"use strict";var Ihe=ci();function yhe(r){if(r===null||r.length===0)return!1;var e=r,t=/\/([gim]*)$/.exec(r),i="";return!(e[0]==="/"&&(t&&(i=t[1]),i.length>3||e[e.length-i.length-1]!=="/"))}function whe(r){var e=r,t=/\/([gim]*)$/.exec(r),i="";return e[0]==="/"&&(t&&(i=t[1]),e=e.slice(1,e.length-i.length-1)),new RegExp(e,i)}function Bhe(r){var e="/"+r.source+"/";return r.global&&(e+="g"),r.multiline&&(e+="m"),r.ignoreCase&&(e+="i"),e}function bhe(r){return Object.prototype.toString.call(r)==="[object RegExp]"}Y1.exports=new Ihe("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:yhe,construct:whe,predicate:bhe,represent:Bhe})});var z1=w((iXe,J1)=>{"use strict";var iI;try{W1=require,iI=W1("esprima")}catch(r){typeof window!="undefined"&&(iI=window.esprima)}var W1,Qhe=ci();function She(r){if(r===null)return!1;try{var e="("+r+")",t=iI.parse(e,{range:!0});return!(t.type!=="Program"||t.body.length!==1||t.body[0].type!=="ExpressionStatement"||t.body[0].expression.type!=="ArrowFunctionExpression"&&t.body[0].expression.type!=="FunctionExpression")}catch(i){return!1}}function vhe(r){var e="("+r+")",t=iI.parse(e,{range:!0}),i=[],n;if(t.type!=="Program"||t.body.length!==1||t.body[0].type!=="ExpressionStatement"||t.body[0].expression.type!=="ArrowFunctionExpression"&&t.body[0].expression.type!=="FunctionExpression")throw new Error("Failed to resolve function");return t.body[0].expression.params.forEach(function(s){i.push(s.name)}),n=t.body[0].expression.body.range,t.body[0].expression.body.type==="BlockStatement"?new Function(i,e.slice(n[0]+1,n[1]-1)):new Function(i,"return "+e.slice(n[0],n[1]))}function xhe(r){return r.toString()}function khe(r){return Object.prototype.toString.call(r)==="[object Function]"}J1.exports=new Qhe("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:She,construct:vhe,predicate:khe,represent:xhe})});var tp=w((nXe,_1)=>{"use strict";var V1=pc();_1.exports=V1.DEFAULT=new V1({include:[ig()],explicit:[G1(),q1(),z1()]})});var pK=w((sXe,rp)=>{"use strict";var Oa=hc(),X1=tg(),Phe=i1(),Z1=ig(),Dhe=tp(),JA=Object.prototype.hasOwnProperty,nI=1,$1=2,eK=3,sI=4,OQ=1,Rhe=2,tK=3,Fhe=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Nhe=/[\x85\u2028\u2029]/,Lhe=/[,\[\]\{\}]/,rK=/^(?:!|!!|![a-z\-]+!)$/i,iK=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function nK(r){return Object.prototype.toString.call(r)}function Lo(r){return r===10||r===13}function Cc(r){return r===9||r===32}function yn(r){return r===9||r===32||r===10||r===13}function ng(r){return r===44||r===91||r===93||r===123||r===125}function The(r){var e;return 48<=r&&r<=57?r-48:(e=r|32,97<=e&&e<=102?e-97+10:-1)}function Ohe(r){return r===120?2:r===117?4:r===85?8:0}function Mhe(r){return 48<=r&&r<=57?r-48:-1}function sK(r){return r===48?"\0":r===97?"\x07":r===98?"\b":r===116||r===9?" ":r===110?` -`:r===118?"\v":r===102?"\f":r===114?"\r":r===101?"":r===32?" ":r===34?'"':r===47?"/":r===92?"\\":r===78?"\x85":r===95?"\xA0":r===76?"\u2028":r===80?"\u2029":""}function Khe(r){return r<=65535?String.fromCharCode(r):String.fromCharCode((r-65536>>10)+55296,(r-65536&1023)+56320)}var oK=new Array(256),aK=new Array(256);for(var sg=0;sg<256;sg++)oK[sg]=sK(sg)?1:0,aK[sg]=sK(sg);function Uhe(r,e){this.input=r,this.filename=e.filename||null,this.schema=e.schema||Dhe,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=r.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function AK(r,e){return new X1(e,new Phe(r.filename,r.input,r.position,r.line,r.position-r.lineStart))}function dt(r,e){throw AK(r,e)}function oI(r,e){r.onWarning&&r.onWarning.call(null,AK(r,e))}var lK={YAML:function(e,t,i){var n,s,o;e.version!==null&&dt(e,"duplication of %YAML directive"),i.length!==1&&dt(e,"YAML directive accepts exactly one argument"),n=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),n===null&&dt(e,"ill-formed argument of the YAML directive"),s=parseInt(n[1],10),o=parseInt(n[2],10),s!==1&&dt(e,"unacceptable YAML version of the document"),e.version=i[0],e.checkLineBreaks=o<2,o!==1&&o!==2&&oI(e,"unsupported YAML version of the document")},TAG:function(e,t,i){var n,s;i.length!==2&&dt(e,"TAG directive accepts exactly two arguments"),n=i[0],s=i[1],rK.test(n)||dt(e,"ill-formed tag handle (first argument) of the TAG directive"),JA.call(e.tagMap,n)&&dt(e,'there is a previously declared suffix for "'+n+'" tag handle'),iK.test(s)||dt(e,"ill-formed tag prefix (second argument) of the TAG directive"),e.tagMap[n]=s}};function WA(r,e,t,i){var n,s,o,a;if(e1&&(r.result+=Oa.repeat(` -`,e-1))}function Hhe(r,e,t){var i,n,s,o,a,l,c,u,g=r.kind,f=r.result,h;if(h=r.input.charCodeAt(r.position),yn(h)||ng(h)||h===35||h===38||h===42||h===33||h===124||h===62||h===39||h===34||h===37||h===64||h===96||(h===63||h===45)&&(n=r.input.charCodeAt(r.position+1),yn(n)||t&&ng(n)))return!1;for(r.kind="scalar",r.result="",s=o=r.position,a=!1;h!==0;){if(h===58){if(n=r.input.charCodeAt(r.position+1),yn(n)||t&&ng(n))break}else if(h===35){if(i=r.input.charCodeAt(r.position-1),yn(i))break}else{if(r.position===r.lineStart&&aI(r)||t&&ng(h))break;if(Lo(h))if(l=r.line,c=r.lineStart,u=r.lineIndent,ei(r,!1,-1),r.lineIndent>=e){a=!0,h=r.input.charCodeAt(r.position);continue}else{r.position=o,r.line=l,r.lineStart=c,r.lineIndent=u;break}}a&&(WA(r,s,o,!1),KQ(r,r.line-l),s=o=r.position,a=!1),Cc(h)||(o=r.position+1),h=r.input.charCodeAt(++r.position)}return WA(r,s,o,!1),r.result?!0:(r.kind=g,r.result=f,!1)}function jhe(r,e){var t,i,n;if(t=r.input.charCodeAt(r.position),t!==39)return!1;for(r.kind="scalar",r.result="",r.position++,i=n=r.position;(t=r.input.charCodeAt(r.position))!==0;)if(t===39)if(WA(r,i,r.position,!0),t=r.input.charCodeAt(++r.position),t===39)i=r.position,r.position++,n=r.position;else return!0;else Lo(t)?(WA(r,i,n,!0),KQ(r,ei(r,!1,e)),i=n=r.position):r.position===r.lineStart&&aI(r)?dt(r,"unexpected end of the document within a single quoted scalar"):(r.position++,n=r.position);dt(r,"unexpected end of the stream within a single quoted scalar")}function Ghe(r,e){var t,i,n,s,o,a;if(a=r.input.charCodeAt(r.position),a!==34)return!1;for(r.kind="scalar",r.result="",r.position++,t=i=r.position;(a=r.input.charCodeAt(r.position))!==0;){if(a===34)return WA(r,t,r.position,!0),r.position++,!0;if(a===92){if(WA(r,t,r.position,!0),a=r.input.charCodeAt(++r.position),Lo(a))ei(r,!1,e);else if(a<256&&oK[a])r.result+=aK[a],r.position++;else if((o=Ohe(a))>0){for(n=o,s=0;n>0;n--)a=r.input.charCodeAt(++r.position),(o=The(a))>=0?s=(s<<4)+o:dt(r,"expected hexadecimal character");r.result+=Khe(s),r.position++}else dt(r,"unknown escape sequence");t=i=r.position}else Lo(a)?(WA(r,t,i,!0),KQ(r,ei(r,!1,e)),t=i=r.position):r.position===r.lineStart&&aI(r)?dt(r,"unexpected end of the document within a double quoted scalar"):(r.position++,i=r.position)}dt(r,"unexpected end of the stream within a double quoted scalar")}function Yhe(r,e){var t=!0,i,n=r.tag,s,o=r.anchor,a,l,c,u,g,f={},h,p,m,y;if(y=r.input.charCodeAt(r.position),y===91)l=93,g=!1,s=[];else if(y===123)l=125,g=!0,s={};else return!1;for(r.anchor!==null&&(r.anchorMap[r.anchor]=s),y=r.input.charCodeAt(++r.position);y!==0;){if(ei(r,!0,e),y=r.input.charCodeAt(r.position),y===l)return r.position++,r.tag=n,r.anchor=o,r.kind=g?"mapping":"sequence",r.result=s,!0;t||dt(r,"missed comma between flow collection entries"),p=h=m=null,c=u=!1,y===63&&(a=r.input.charCodeAt(r.position+1),yn(a)&&(c=u=!0,r.position++,ei(r,!0,e))),i=r.line,ag(r,e,nI,!1,!0),p=r.tag,h=r.result,ei(r,!0,e),y=r.input.charCodeAt(r.position),(u||r.line===i)&&y===58&&(c=!0,y=r.input.charCodeAt(++r.position),ei(r,!0,e),ag(r,e,nI,!1,!0),m=r.result),g?og(r,s,f,p,h,m):c?s.push(og(r,null,f,p,h,m)):s.push(h),ei(r,!0,e),y=r.input.charCodeAt(r.position),y===44?(t=!0,y=r.input.charCodeAt(++r.position)):t=!1}dt(r,"unexpected end of the stream within a flow collection")}function qhe(r,e){var t,i,n=OQ,s=!1,o=!1,a=e,l=0,c=!1,u,g;if(g=r.input.charCodeAt(r.position),g===124)i=!1;else if(g===62)i=!0;else return!1;for(r.kind="scalar",r.result="";g!==0;)if(g=r.input.charCodeAt(++r.position),g===43||g===45)OQ===n?n=g===43?tK:Rhe:dt(r,"repeat of a chomping mode identifier");else if((u=Mhe(g))>=0)u===0?dt(r,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?dt(r,"repeat of an indentation width identifier"):(a=e+u-1,o=!0);else break;if(Cc(g)){do g=r.input.charCodeAt(++r.position);while(Cc(g));if(g===35)do g=r.input.charCodeAt(++r.position);while(!Lo(g)&&g!==0)}for(;g!==0;){for(MQ(r),r.lineIndent=0,g=r.input.charCodeAt(r.position);(!o||r.lineIndenta&&(a=r.lineIndent),Lo(g)){l++;continue}if(r.lineIndente)&&l!==0)dt(r,"bad indentation of a sequence entry");else if(r.lineIndente)&&(ag(r,e,sI,!0,n)&&(p?f=r.result:h=r.result),p||(og(r,c,u,g,f,h,s,o),g=f=h=null),ei(r,!0,-1),y=r.input.charCodeAt(r.position)),r.lineIndent>e&&y!==0)dt(r,"bad indentation of a mapping entry");else if(r.lineIndente?l=1:r.lineIndent===e?l=0:r.lineIndente?l=1:r.lineIndent===e?l=0:r.lineIndent tag; it should be "scalar", not "'+r.kind+'"'),g=0,f=r.implicitTypes.length;g tag; it should be "'+h.kind+'", not "'+r.kind+'"'),h.resolve(r.result)?(r.result=h.construct(r.result),r.anchor!==null&&(r.anchorMap[r.anchor]=r.result)):dt(r,"cannot resolve a node with !<"+r.tag+"> explicit tag")):dt(r,"unknown tag !<"+r.tag+">");return r.listener!==null&&r.listener("close",r),r.tag!==null||r.anchor!==null||u}function Vhe(r){var e=r.position,t,i,n,s=!1,o;for(r.version=null,r.checkLineBreaks=r.legacy,r.tagMap={},r.anchorMap={};(o=r.input.charCodeAt(r.position))!==0&&(ei(r,!0,-1),o=r.input.charCodeAt(r.position),!(r.lineIndent>0||o!==37));){for(s=!0,o=r.input.charCodeAt(++r.position),t=r.position;o!==0&&!yn(o);)o=r.input.charCodeAt(++r.position);for(i=r.input.slice(t,r.position),n=[],i.length<1&&dt(r,"directive name must not be less than one character in length");o!==0;){for(;Cc(o);)o=r.input.charCodeAt(++r.position);if(o===35){do o=r.input.charCodeAt(++r.position);while(o!==0&&!Lo(o));break}if(Lo(o))break;for(t=r.position;o!==0&&!yn(o);)o=r.input.charCodeAt(++r.position);n.push(r.input.slice(t,r.position))}o!==0&&MQ(r),JA.call(lK,i)?lK[i](r,i,n):oI(r,'unknown document directive "'+i+'"')}if(ei(r,!0,-1),r.lineIndent===0&&r.input.charCodeAt(r.position)===45&&r.input.charCodeAt(r.position+1)===45&&r.input.charCodeAt(r.position+2)===45?(r.position+=3,ei(r,!0,-1)):s&&dt(r,"directives end mark is expected"),ag(r,r.lineIndent-1,sI,!1,!0),ei(r,!0,-1),r.checkLineBreaks&&Nhe.test(r.input.slice(e,r.position))&&oI(r,"non-ASCII line breaks are interpreted as content"),r.documents.push(r.result),r.position===r.lineStart&&aI(r)){r.input.charCodeAt(r.position)===46&&(r.position+=3,ei(r,!0,-1));return}if(r.position{"use strict";var ip=hc(),np=tg(),$he=tp(),epe=ig(),dK=Object.prototype.toString,CK=Object.prototype.hasOwnProperty,tpe=9,sp=10,rpe=13,ipe=32,npe=33,spe=34,mK=35,ope=37,ape=38,Ape=39,lpe=42,EK=44,cpe=45,IK=58,upe=61,gpe=62,fpe=63,hpe=64,yK=91,wK=93,ppe=96,BK=123,dpe=124,bK=125,Ki={};Ki[0]="\\0";Ki[7]="\\a";Ki[8]="\\b";Ki[9]="\\t";Ki[10]="\\n";Ki[11]="\\v";Ki[12]="\\f";Ki[13]="\\r";Ki[27]="\\e";Ki[34]='\\"';Ki[92]="\\\\";Ki[133]="\\N";Ki[160]="\\_";Ki[8232]="\\L";Ki[8233]="\\P";var Cpe=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function mpe(r,e){var t,i,n,s,o,a,l;if(e===null)return{};for(t={},i=Object.keys(e),n=0,s=i.length;n0?r.charCodeAt(s-1):null,f=f&&vK(o,a)}else{for(s=0;si&&r[g+1]!==" ",g=s);else if(!Ag(o))return AI;a=s>0?r.charCodeAt(s-1):null,f=f&&vK(o,a)}c=c||u&&s-g-1>i&&r[g+1]!==" "}return!l&&!c?f&&!n(r)?kK:PK:t>9&&xK(r)?AI:c?RK:DK}function Spe(r,e,t,i){r.dump=function(){if(e.length===0)return"''";if(!r.noCompatMode&&Cpe.indexOf(e)!==-1)return"'"+e+"'";var n=r.indent*Math.max(1,t),s=r.lineWidth===-1?-1:Math.max(Math.min(r.lineWidth,40),r.lineWidth-n),o=i||r.flowLevel>-1&&t>=r.flowLevel;function a(l){return Ipe(r,l)}switch(Bpe(e,o,r.indent,s,a)){case kK:return e;case PK:return"'"+e.replace(/'/g,"''")+"'";case DK:return"|"+FK(e,r.indent)+NK(SK(e,n));case RK:return">"+FK(e,r.indent)+NK(SK(bpe(e,s),n));case AI:return'"'+Qpe(e,s)+'"';default:throw new np("impossible error: invalid scalar style")}}()}function FK(r,e){var t=xK(r)?String(e):"",i=r[r.length-1]===` -`,n=i&&(r[r.length-2]===` -`||r===` -`),s=n?"+":i?"":"-";return t+s+` -`}function NK(r){return r[r.length-1]===` -`?r.slice(0,-1):r}function bpe(r,e){for(var t=/(\n+)([^\n]*)/g,i=function(){var c=r.indexOf(` -`);return c=c!==-1?c:r.length,t.lastIndex=c,LK(r.slice(0,c),e)}(),n=r[0]===` -`||r[0]===" ",s,o;o=t.exec(r);){var a=o[1],l=o[2];s=l[0]===" ",i+=a+(!n&&!s&&l!==""?` -`:"")+LK(l,e),n=s}return i}function LK(r,e){if(r===""||r[0]===" ")return r;for(var t=/ [^ ]/g,i,n=0,s,o=0,a=0,l="";i=t.exec(r);)a=i.index,a-n>e&&(s=o>n?o:a,l+=` -`+r.slice(n,s),n=s+1),o=a;return l+=` -`,r.length-n>e&&o>n?l+=r.slice(n,o)+` -`+r.slice(o+1):l+=r.slice(n),l.slice(1)}function Qpe(r){for(var e="",t,i,n,s=0;s=55296&&t<=56319&&(i=r.charCodeAt(s+1),i>=56320&&i<=57343)){e+=QK((t-55296)*1024+i-56320+65536),s++;continue}n=Ki[t],e+=!n&&Ag(t)?r[s]:n||QK(t)}return e}function vpe(r,e,t){var i="",n=r.tag,s,o;for(s=0,o=t.length;s1024&&(u+="? "),u+=r.dump+(r.condenseFlow?'"':"")+":"+(r.condenseFlow?"":" "),!!mc(r,e,c,!1,!1)&&(u+=r.dump,i+=u));r.tag=n,r.dump="{"+i+"}"}function Ppe(r,e,t,i){var n="",s=r.tag,o=Object.keys(t),a,l,c,u,g,f;if(r.sortKeys===!0)o.sort();else if(typeof r.sortKeys=="function")o.sort(r.sortKeys);else if(r.sortKeys)throw new np("sortKeys must be a boolean or a function");for(a=0,l=o.length;a1024,g&&(r.dump&&sp===r.dump.charCodeAt(0)?f+="?":f+="? "),f+=r.dump,g&&(f+=HQ(r,e)),!!mc(r,e+1,u,!0,g)&&(r.dump&&sp===r.dump.charCodeAt(0)?f+=":":f+=": ",f+=r.dump,n+=f));r.tag=s,r.dump=n||"{}"}function TK(r,e,t){var i,n,s,o,a,l;for(n=t?r.explicitTypes:r.implicitTypes,s=0,o=n.length;s tag resolver accepts not "'+l+'" style');r.dump=i}return!0}return!1}function mc(r,e,t,i,n,s){r.tag=null,r.dump=t,TK(r,t,!1)||TK(r,t,!0);var o=dK.call(r.dump);i&&(i=r.flowLevel<0||r.flowLevel>e);var a=o==="[object Object]"||o==="[object Array]",l,c;if(a&&(l=r.duplicates.indexOf(t),c=l!==-1),(r.tag!==null&&r.tag!=="?"||c||r.indent!==2&&e>0)&&(n=!1),c&&r.usedDuplicates[l])r.dump="*ref_"+l;else{if(a&&c&&!r.usedDuplicates[l]&&(r.usedDuplicates[l]=!0),o==="[object Object]")i&&Object.keys(r.dump).length!==0?(Ppe(r,e,r.dump,n),c&&(r.dump="&ref_"+l+r.dump)):(kpe(r,e,r.dump),c&&(r.dump="&ref_"+l+" "+r.dump));else if(o==="[object Array]"){var u=r.noArrayIndent&&e>0?e-1:e;i&&r.dump.length!==0?(xpe(r,u,r.dump,n),c&&(r.dump="&ref_"+l+r.dump)):(vpe(r,u,r.dump),c&&(r.dump="&ref_"+l+" "+r.dump))}else if(o==="[object String]")r.tag!=="?"&&Spe(r,r.dump,e,s);else{if(r.skipInvalid)return!1;throw new np("unacceptable kind of an object to dump "+o)}r.tag!==null&&r.tag!=="?"&&(r.dump="!<"+r.tag+"> "+r.dump)}return!0}function Dpe(r,e){var t=[],i=[],n,s;for(GQ(r,t,i),n=0,s=i.length;n{"use strict";var lI=pK(),KK=MK();function cI(r){return function(){throw new Error("Function "+r+" is deprecated and cannot be used.")}}Mr.exports.Type=ci();Mr.exports.Schema=pc();Mr.exports.FAILSAFE_SCHEMA=rI();Mr.exports.JSON_SCHEMA=NQ();Mr.exports.CORE_SCHEMA=LQ();Mr.exports.DEFAULT_SAFE_SCHEMA=ig();Mr.exports.DEFAULT_FULL_SCHEMA=tp();Mr.exports.load=lI.load;Mr.exports.loadAll=lI.loadAll;Mr.exports.safeLoad=lI.safeLoad;Mr.exports.safeLoadAll=lI.safeLoadAll;Mr.exports.dump=KK.dump;Mr.exports.safeDump=KK.safeDump;Mr.exports.YAMLException=tg();Mr.exports.MINIMAL_SCHEMA=rI();Mr.exports.SAFE_SCHEMA=ig();Mr.exports.DEFAULT_SCHEMA=tp();Mr.exports.scan=cI("scan");Mr.exports.parse=cI("parse");Mr.exports.compose=cI("compose");Mr.exports.addConstructor=cI("addConstructor")});var jK=w((AXe,HK)=>{"use strict";var Fpe=UK();HK.exports=Fpe});var YK=w((lXe,GK)=>{"use strict";function Npe(r,e){function t(){this.constructor=r}t.prototype=e.prototype,r.prototype=new t}function Ec(r,e,t,i){this.message=r,this.expected=e,this.found=t,this.location=i,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Ec)}Npe(Ec,Error);Ec.buildMessage=function(r,e){var t={literal:function(c){return'"'+n(c.text)+'"'},class:function(c){var u="",g;for(g=0;g0){for(g=1,f=1;g({[He]:Ce})))},q=function(R){return R},Y=function(R){return R},$=Zs("correct indentation"),_=" ",ne=gr(" ",!1),ee=function(R){return R.length===KA*Ju},A=function(R){return R.length===(KA+1)*Ju},oe=function(){return KA++,!0},ce=function(){return KA--,!0},Z=function(){return Uu()},O=Zs("pseudostring"),L=/^[^\r\n\t ?:,\][{}#&*!|>'"%@`\-]/,de=qn(["\r",` -`," "," ","?",":",",","]","[","{","}","#","&","*","!","|",">","'",'"',"%","@","`","-"],!0,!1),Be=/^[^\r\n\t ,\][{}:#"']/,je=qn(["\r",` -`," "," ",",","]","[","{","}",":","#",'"',"'"],!0,!1),re=function(){return Uu().replace(/^ *| *$/g,"")},se="--",be=gr("--",!1),he=/^[a-zA-Z\/0-9]/,Fe=qn([["a","z"],["A","Z"],"/",["0","9"]],!1,!1),Ke=/^[^\r\n\t :,]/,ke=qn(["\r",` -`," "," ",":",","],!0,!1),ve="null",pe=gr("null",!1),V=function(){return null},Qe="true",le=gr("true",!1),fe=function(){return!0},gt="false",Ht=gr("false",!1),Mt=function(){return!1},Ei=Zs("string"),jt='"',Qr=gr('"',!1),Oi=function(){return""},Xs=function(R){return R},Un=function(R){return R.join("")},Hn=/^[^"\\\0-\x1F\x7F]/,Sr=qn(['"',"\\",["\0",""],"\x7F"],!0,!1),jn='\\"',fs=gr('\\"',!1),ba=function(){return'"'},DA="\\\\",Nu=gr("\\\\",!1),hs=function(){return"\\"},RA="\\/",Qa=gr("\\/",!1),Lu=function(){return"/"},FA="\\b",NA=gr("\\b",!1),vr=function(){return"\b"},zl="\\f",Tu=gr("\\f",!1),xo=function(){return"\f"},Ou="\\n",Sh=gr("\\n",!1),vh=function(){return` -`},Dr="\\r",Ae=gr("\\r",!1),ko=function(){return"\r"},Gn="\\t",Mu=gr("\\t",!1),St=function(){return" "},_l="\\u",Yn=gr("\\u",!1),ps=function(R,G,Ce,He){return String.fromCharCode(parseInt(`0x${R}${G}${Ce}${He}`))},ds=/^[0-9a-fA-F]/,pt=qn([["0","9"],["a","f"],["A","F"]],!1,!1),Po=Zs("blank space"),lt=/^[ \t]/,mn=qn([" "," "],!1,!1),S=Zs("white space"),Tt=/^[ \t\n\r]/,Ku=qn([" "," ",` -`,"\r"],!1,!1),Vl=`\r -`,xh=gr(`\r -`,!1),kh=` -`,Ph=gr(` -`,!1),Dh="\r",Rh=gr("\r",!1),j=0,wt=0,LA=[{line:1,column:1}],$i=0,Xl=[],$e=0,Sa;if("startRule"in e){if(!(e.startRule in i))throw new Error(`Can't start parsing from rule "`+e.startRule+'".');n=i[e.startRule]}function Uu(){return r.substring(wt,j)}function yE(){return En(wt,j)}function Fh(R,G){throw G=G!==void 0?G:En(wt,j),$l([Zs(R)],r.substring(wt,j),G)}function wE(R,G){throw G=G!==void 0?G:En(wt,j),Hu(R,G)}function gr(R,G){return{type:"literal",text:R,ignoreCase:G}}function qn(R,G,Ce){return{type:"class",parts:R,inverted:G,ignoreCase:Ce}}function Zl(){return{type:"any"}}function Nh(){return{type:"end"}}function Zs(R){return{type:"other",description:R}}function va(R){var G=LA[R],Ce;if(G)return G;for(Ce=R-1;!LA[Ce];)Ce--;for(G=LA[Ce],G={line:G.line,column:G.column};Ce$i&&($i=j,Xl=[]),Xl.push(R))}function Hu(R,G){return new Ec(R,null,null,G)}function $l(R,G,Ce){return new Ec(Ec.buildMessage(R,G),R,G,Ce)}function $s(){var R;return R=ju(),R}function ec(){var R,G,Ce;for(R=j,G=[],Ce=TA();Ce!==t;)G.push(Ce),Ce=TA();return G!==t&&(wt=R,G=s(G)),R=G,R}function TA(){var R,G,Ce,He,Te;return R=j,G=ka(),G!==t?(r.charCodeAt(j)===45?(Ce=o,j++):(Ce=t,$e===0&&Oe(a)),Ce!==t?(He=Tr(),He!==t?(Te=xa(),Te!==t?(wt=R,G=l(Te),R=G):(j=R,R=t)):(j=R,R=t)):(j=R,R=t)):(j=R,R=t),R}function ju(){var R,G,Ce;for(R=j,G=[],Ce=Gu();Ce!==t;)G.push(Ce),Ce=Gu();return G!==t&&(wt=R,G=c(G)),R=G,R}function Gu(){var R,G,Ce,He,Te,Xe,Et,Rt,Jn;if(R=j,G=Tr(),G===t&&(G=null),G!==t){if(Ce=j,r.charCodeAt(j)===35?(He=u,j++):(He=t,$e===0&&Oe(g)),He!==t){if(Te=[],Xe=j,Et=j,$e++,Rt=ro(),$e--,Rt===t?Et=void 0:(j=Et,Et=t),Et!==t?(r.length>j?(Rt=r.charAt(j),j++):(Rt=t,$e===0&&Oe(f)),Rt!==t?(Et=[Et,Rt],Xe=Et):(j=Xe,Xe=t)):(j=Xe,Xe=t),Xe!==t)for(;Xe!==t;)Te.push(Xe),Xe=j,Et=j,$e++,Rt=ro(),$e--,Rt===t?Et=void 0:(j=Et,Et=t),Et!==t?(r.length>j?(Rt=r.charAt(j),j++):(Rt=t,$e===0&&Oe(f)),Rt!==t?(Et=[Et,Rt],Xe=Et):(j=Xe,Xe=t)):(j=Xe,Xe=t);else Te=t;Te!==t?(He=[He,Te],Ce=He):(j=Ce,Ce=t)}else j=Ce,Ce=t;if(Ce===t&&(Ce=null),Ce!==t){if(He=[],Te=to(),Te!==t)for(;Te!==t;)He.push(Te),Te=to();else He=t;He!==t?(wt=R,G=h(),R=G):(j=R,R=t)}else j=R,R=t}else j=R,R=t;if(R===t&&(R=j,G=ka(),G!==t?(Ce=tc(),Ce!==t?(He=Tr(),He===t&&(He=null),He!==t?(r.charCodeAt(j)===58?(Te=p,j++):(Te=t,$e===0&&Oe(m)),Te!==t?(Xe=Tr(),Xe===t&&(Xe=null),Xe!==t?(Et=xa(),Et!==t?(wt=R,G=y(Ce,Et),R=G):(j=R,R=t)):(j=R,R=t)):(j=R,R=t)):(j=R,R=t)):(j=R,R=t)):(j=R,R=t),R===t&&(R=j,G=ka(),G!==t?(Ce=eo(),Ce!==t?(He=Tr(),He===t&&(He=null),He!==t?(r.charCodeAt(j)===58?(Te=p,j++):(Te=t,$e===0&&Oe(m)),Te!==t?(Xe=Tr(),Xe===t&&(Xe=null),Xe!==t?(Et=xa(),Et!==t?(wt=R,G=y(Ce,Et),R=G):(j=R,R=t)):(j=R,R=t)):(j=R,R=t)):(j=R,R=t)):(j=R,R=t)):(j=R,R=t),R===t))){if(R=j,G=ka(),G!==t)if(Ce=eo(),Ce!==t)if(He=Tr(),He!==t)if(Te=BE(),Te!==t){if(Xe=[],Et=to(),Et!==t)for(;Et!==t;)Xe.push(Et),Et=to();else Xe=t;Xe!==t?(wt=R,G=y(Ce,Te),R=G):(j=R,R=t)}else j=R,R=t;else j=R,R=t;else j=R,R=t;else j=R,R=t;if(R===t)if(R=j,G=ka(),G!==t)if(Ce=eo(),Ce!==t){if(He=[],Te=j,Xe=Tr(),Xe===t&&(Xe=null),Xe!==t?(r.charCodeAt(j)===44?(Et=b,j++):(Et=t,$e===0&&Oe(v)),Et!==t?(Rt=Tr(),Rt===t&&(Rt=null),Rt!==t?(Jn=eo(),Jn!==t?(wt=Te,Xe=x(Ce,Jn),Te=Xe):(j=Te,Te=t)):(j=Te,Te=t)):(j=Te,Te=t)):(j=Te,Te=t),Te!==t)for(;Te!==t;)He.push(Te),Te=j,Xe=Tr(),Xe===t&&(Xe=null),Xe!==t?(r.charCodeAt(j)===44?(Et=b,j++):(Et=t,$e===0&&Oe(v)),Et!==t?(Rt=Tr(),Rt===t&&(Rt=null),Rt!==t?(Jn=eo(),Jn!==t?(wt=Te,Xe=x(Ce,Jn),Te=Xe):(j=Te,Te=t)):(j=Te,Te=t)):(j=Te,Te=t)):(j=Te,Te=t);else He=t;He!==t?(Te=Tr(),Te===t&&(Te=null),Te!==t?(r.charCodeAt(j)===58?(Xe=p,j++):(Xe=t,$e===0&&Oe(m)),Xe!==t?(Et=Tr(),Et===t&&(Et=null),Et!==t?(Rt=xa(),Rt!==t?(wt=R,G=T(Ce,He,Rt),R=G):(j=R,R=t)):(j=R,R=t)):(j=R,R=t)):(j=R,R=t)):(j=R,R=t)}else j=R,R=t;else j=R,R=t}return R}function xa(){var R,G,Ce,He,Te,Xe,Et;if(R=j,G=j,$e++,Ce=j,He=ro(),He!==t?(Te=nt(),Te!==t?(r.charCodeAt(j)===45?(Xe=o,j++):(Xe=t,$e===0&&Oe(a)),Xe!==t?(Et=Tr(),Et!==t?(He=[He,Te,Xe,Et],Ce=He):(j=Ce,Ce=t)):(j=Ce,Ce=t)):(j=Ce,Ce=t)):(j=Ce,Ce=t),$e--,Ce!==t?(j=G,G=void 0):G=t,G!==t?(Ce=to(),Ce!==t?(He=Do(),He!==t?(Te=ec(),Te!==t?(Xe=OA(),Xe!==t?(wt=R,G=q(Te),R=G):(j=R,R=t)):(j=R,R=t)):(j=R,R=t)):(j=R,R=t)):(j=R,R=t),R===t&&(R=j,G=ro(),G!==t?(Ce=Do(),Ce!==t?(He=ju(),He!==t?(Te=OA(),Te!==t?(wt=R,G=q(He),R=G):(j=R,R=t)):(j=R,R=t)):(j=R,R=t)):(j=R,R=t),R===t))if(R=j,G=rc(),G!==t){if(Ce=[],He=to(),He!==t)for(;He!==t;)Ce.push(He),He=to();else Ce=t;Ce!==t?(wt=R,G=Y(G),R=G):(j=R,R=t)}else j=R,R=t;return R}function ka(){var R,G,Ce;for($e++,R=j,G=[],r.charCodeAt(j)===32?(Ce=_,j++):(Ce=t,$e===0&&Oe(ne));Ce!==t;)G.push(Ce),r.charCodeAt(j)===32?(Ce=_,j++):(Ce=t,$e===0&&Oe(ne));return G!==t?(wt=j,Ce=ee(G),Ce?Ce=void 0:Ce=t,Ce!==t?(G=[G,Ce],R=G):(j=R,R=t)):(j=R,R=t),$e--,R===t&&(G=t,$e===0&&Oe($)),R}function nt(){var R,G,Ce;for(R=j,G=[],r.charCodeAt(j)===32?(Ce=_,j++):(Ce=t,$e===0&&Oe(ne));Ce!==t;)G.push(Ce),r.charCodeAt(j)===32?(Ce=_,j++):(Ce=t,$e===0&&Oe(ne));return G!==t?(wt=j,Ce=A(G),Ce?Ce=void 0:Ce=t,Ce!==t?(G=[G,Ce],R=G):(j=R,R=t)):(j=R,R=t),R}function Do(){var R;return wt=j,R=oe(),R?R=void 0:R=t,R}function OA(){var R;return wt=j,R=ce(),R?R=void 0:R=t,R}function tc(){var R;return R=ic(),R===t&&(R=Lh()),R}function eo(){var R,G,Ce;if(R=ic(),R===t){if(R=j,G=[],Ce=Yu(),Ce!==t)for(;Ce!==t;)G.push(Ce),Ce=Yu();else G=t;G!==t&&(wt=R,G=Z()),R=G}return R}function rc(){var R;return R=Th(),R===t&&(R=bE(),R===t&&(R=ic(),R===t&&(R=Lh()))),R}function BE(){var R;return R=Th(),R===t&&(R=ic(),R===t&&(R=Yu())),R}function Lh(){var R,G,Ce,He,Te,Xe;if($e++,R=j,L.test(r.charAt(j))?(G=r.charAt(j),j++):(G=t,$e===0&&Oe(de)),G!==t){for(Ce=[],He=j,Te=Tr(),Te===t&&(Te=null),Te!==t?(Be.test(r.charAt(j))?(Xe=r.charAt(j),j++):(Xe=t,$e===0&&Oe(je)),Xe!==t?(Te=[Te,Xe],He=Te):(j=He,He=t)):(j=He,He=t);He!==t;)Ce.push(He),He=j,Te=Tr(),Te===t&&(Te=null),Te!==t?(Be.test(r.charAt(j))?(Xe=r.charAt(j),j++):(Xe=t,$e===0&&Oe(je)),Xe!==t?(Te=[Te,Xe],He=Te):(j=He,He=t)):(j=He,He=t);Ce!==t?(wt=R,G=re(),R=G):(j=R,R=t)}else j=R,R=t;return $e--,R===t&&(G=t,$e===0&&Oe(O)),R}function Yu(){var R,G,Ce,He,Te;if(R=j,r.substr(j,2)===se?(G=se,j+=2):(G=t,$e===0&&Oe(be)),G===t&&(G=null),G!==t)if(he.test(r.charAt(j))?(Ce=r.charAt(j),j++):(Ce=t,$e===0&&Oe(Fe)),Ce!==t){for(He=[],Ke.test(r.charAt(j))?(Te=r.charAt(j),j++):(Te=t,$e===0&&Oe(ke));Te!==t;)He.push(Te),Ke.test(r.charAt(j))?(Te=r.charAt(j),j++):(Te=t,$e===0&&Oe(ke));He!==t?(wt=R,G=re(),R=G):(j=R,R=t)}else j=R,R=t;else j=R,R=t;return R}function Th(){var R,G;return R=j,r.substr(j,4)===ve?(G=ve,j+=4):(G=t,$e===0&&Oe(pe)),G!==t&&(wt=R,G=V()),R=G,R}function bE(){var R,G;return R=j,r.substr(j,4)===Qe?(G=Qe,j+=4):(G=t,$e===0&&Oe(le)),G!==t&&(wt=R,G=fe()),R=G,R===t&&(R=j,r.substr(j,5)===gt?(G=gt,j+=5):(G=t,$e===0&&Oe(Ht)),G!==t&&(wt=R,G=Mt()),R=G),R}function ic(){var R,G,Ce,He;return $e++,R=j,r.charCodeAt(j)===34?(G=jt,j++):(G=t,$e===0&&Oe(Qr)),G!==t?(r.charCodeAt(j)===34?(Ce=jt,j++):(Ce=t,$e===0&&Oe(Qr)),Ce!==t?(wt=R,G=Oi(),R=G):(j=R,R=t)):(j=R,R=t),R===t&&(R=j,r.charCodeAt(j)===34?(G=jt,j++):(G=t,$e===0&&Oe(Qr)),G!==t?(Ce=QE(),Ce!==t?(r.charCodeAt(j)===34?(He=jt,j++):(He=t,$e===0&&Oe(Qr)),He!==t?(wt=R,G=Xs(Ce),R=G):(j=R,R=t)):(j=R,R=t)):(j=R,R=t)),$e--,R===t&&(G=t,$e===0&&Oe(Ei)),R}function QE(){var R,G,Ce;if(R=j,G=[],Ce=qu(),Ce!==t)for(;Ce!==t;)G.push(Ce),Ce=qu();else G=t;return G!==t&&(wt=R,G=Un(G)),R=G,R}function qu(){var R,G,Ce,He,Te,Xe;return Hn.test(r.charAt(j))?(R=r.charAt(j),j++):(R=t,$e===0&&Oe(Sr)),R===t&&(R=j,r.substr(j,2)===jn?(G=jn,j+=2):(G=t,$e===0&&Oe(fs)),G!==t&&(wt=R,G=ba()),R=G,R===t&&(R=j,r.substr(j,2)===DA?(G=DA,j+=2):(G=t,$e===0&&Oe(Nu)),G!==t&&(wt=R,G=hs()),R=G,R===t&&(R=j,r.substr(j,2)===RA?(G=RA,j+=2):(G=t,$e===0&&Oe(Qa)),G!==t&&(wt=R,G=Lu()),R=G,R===t&&(R=j,r.substr(j,2)===FA?(G=FA,j+=2):(G=t,$e===0&&Oe(NA)),G!==t&&(wt=R,G=vr()),R=G,R===t&&(R=j,r.substr(j,2)===zl?(G=zl,j+=2):(G=t,$e===0&&Oe(Tu)),G!==t&&(wt=R,G=xo()),R=G,R===t&&(R=j,r.substr(j,2)===Ou?(G=Ou,j+=2):(G=t,$e===0&&Oe(Sh)),G!==t&&(wt=R,G=vh()),R=G,R===t&&(R=j,r.substr(j,2)===Dr?(G=Dr,j+=2):(G=t,$e===0&&Oe(Ae)),G!==t&&(wt=R,G=ko()),R=G,R===t&&(R=j,r.substr(j,2)===Gn?(G=Gn,j+=2):(G=t,$e===0&&Oe(Mu)),G!==t&&(wt=R,G=St()),R=G,R===t&&(R=j,r.substr(j,2)===_l?(G=_l,j+=2):(G=t,$e===0&&Oe(Yn)),G!==t?(Ce=MA(),Ce!==t?(He=MA(),He!==t?(Te=MA(),Te!==t?(Xe=MA(),Xe!==t?(wt=R,G=ps(Ce,He,Te,Xe),R=G):(j=R,R=t)):(j=R,R=t)):(j=R,R=t)):(j=R,R=t)):(j=R,R=t)))))))))),R}function MA(){var R;return ds.test(r.charAt(j))?(R=r.charAt(j),j++):(R=t,$e===0&&Oe(pt)),R}function Tr(){var R,G;if($e++,R=[],lt.test(r.charAt(j))?(G=r.charAt(j),j++):(G=t,$e===0&&Oe(mn)),G!==t)for(;G!==t;)R.push(G),lt.test(r.charAt(j))?(G=r.charAt(j),j++):(G=t,$e===0&&Oe(mn));else R=t;return $e--,R===t&&(G=t,$e===0&&Oe(Po)),R}function SE(){var R,G;if($e++,R=[],Tt.test(r.charAt(j))?(G=r.charAt(j),j++):(G=t,$e===0&&Oe(Ku)),G!==t)for(;G!==t;)R.push(G),Tt.test(r.charAt(j))?(G=r.charAt(j),j++):(G=t,$e===0&&Oe(Ku));else R=t;return $e--,R===t&&(G=t,$e===0&&Oe(S)),R}function to(){var R,G,Ce,He,Te,Xe;if(R=j,G=ro(),G!==t){for(Ce=[],He=j,Te=Tr(),Te===t&&(Te=null),Te!==t?(Xe=ro(),Xe!==t?(Te=[Te,Xe],He=Te):(j=He,He=t)):(j=He,He=t);He!==t;)Ce.push(He),He=j,Te=Tr(),Te===t&&(Te=null),Te!==t?(Xe=ro(),Xe!==t?(Te=[Te,Xe],He=Te):(j=He,He=t)):(j=He,He=t);Ce!==t?(G=[G,Ce],R=G):(j=R,R=t)}else j=R,R=t;return R}function ro(){var R;return r.substr(j,2)===Vl?(R=Vl,j+=2):(R=t,$e===0&&Oe(xh)),R===t&&(r.charCodeAt(j)===10?(R=kh,j++):(R=t,$e===0&&Oe(Ph)),R===t&&(r.charCodeAt(j)===13?(R=Dh,j++):(R=t,$e===0&&Oe(Rh)))),R}let Ju=2,KA=0;if(Sa=n(),Sa!==t&&j===r.length)return Sa;throw Sa!==t&&j{"use strict";var Upe=r=>{let e=!1,t=!1,i=!1;for(let n=0;n{if(!(typeof r=="string"||Array.isArray(r)))throw new TypeError("Expected the input to be `string | string[]`");e=Object.assign({pascalCase:!1},e);let t=n=>e.pascalCase?n.charAt(0).toUpperCase()+n.slice(1):n;return Array.isArray(r)?r=r.map(n=>n.trim()).filter(n=>n.length).join("-"):r=r.trim(),r.length===0?"":r.length===1?e.pascalCase?r.toUpperCase():r.toLowerCase():(r!==r.toLowerCase()&&(r=Upe(r)),r=r.replace(/^[_.\- ]+/,"").toLowerCase().replace(/[_.\- ]+(\w|$)/g,(n,s)=>s.toUpperCase()).replace(/\d+(\w|$)/g,n=>n.toUpperCase()),t(r))};JQ.exports=_K;JQ.exports.default=_K});var ZK=w((pXe,XK)=>{XK.exports=[{name:"AppVeyor",constant:"APPVEYOR",env:"APPVEYOR",pr:"APPVEYOR_PULL_REQUEST_NUMBER"},{name:"Azure Pipelines",constant:"AZURE_PIPELINES",env:"SYSTEM_TEAMFOUNDATIONCOLLECTIONURI",pr:"SYSTEM_PULLREQUEST_PULLREQUESTID"},{name:"Appcircle",constant:"APPCIRCLE",env:"AC_APPCIRCLE"},{name:"Bamboo",constant:"BAMBOO",env:"bamboo_planKey"},{name:"Bitbucket Pipelines",constant:"BITBUCKET",env:"BITBUCKET_COMMIT",pr:"BITBUCKET_PR_ID"},{name:"Bitrise",constant:"BITRISE",env:"BITRISE_IO",pr:"BITRISE_PULL_REQUEST"},{name:"Buddy",constant:"BUDDY",env:"BUDDY_WORKSPACE_ID",pr:"BUDDY_EXECUTION_PULL_REQUEST_ID"},{name:"Buildkite",constant:"BUILDKITE",env:"BUILDKITE",pr:{env:"BUILDKITE_PULL_REQUEST",ne:"false"}},{name:"CircleCI",constant:"CIRCLE",env:"CIRCLECI",pr:"CIRCLE_PULL_REQUEST"},{name:"Cirrus CI",constant:"CIRRUS",env:"CIRRUS_CI",pr:"CIRRUS_PR"},{name:"AWS CodeBuild",constant:"CODEBUILD",env:"CODEBUILD_BUILD_ARN"},{name:"Codefresh",constant:"CODEFRESH",env:"CF_BUILD_ID",pr:{any:["CF_PULL_REQUEST_NUMBER","CF_PULL_REQUEST_ID"]}},{name:"Codeship",constant:"CODESHIP",env:{CI_NAME:"codeship"}},{name:"Drone",constant:"DRONE",env:"DRONE",pr:{DRONE_BUILD_EVENT:"pull_request"}},{name:"dsari",constant:"DSARI",env:"DSARI"},{name:"GitHub Actions",constant:"GITHUB_ACTIONS",env:"GITHUB_ACTIONS",pr:{GITHUB_EVENT_NAME:"pull_request"}},{name:"GitLab CI",constant:"GITLAB",env:"GITLAB_CI",pr:"CI_MERGE_REQUEST_ID"},{name:"GoCD",constant:"GOCD",env:"GO_PIPELINE_LABEL"},{name:"LayerCI",constant:"LAYERCI",env:"LAYERCI",pr:"LAYERCI_PULL_REQUEST"},{name:"Hudson",constant:"HUDSON",env:"HUDSON_URL"},{name:"Jenkins",constant:"JENKINS",env:["JENKINS_URL","BUILD_ID"],pr:{any:["ghprbPullId","CHANGE_ID"]}},{name:"Magnum CI",constant:"MAGNUM",env:"MAGNUM"},{name:"Netlify CI",constant:"NETLIFY",env:"NETLIFY",pr:{env:"PULL_REQUEST",ne:"false"}},{name:"Nevercode",constant:"NEVERCODE",env:"NEVERCODE",pr:{env:"NEVERCODE_PULL_REQUEST",ne:"false"}},{name:"Render",constant:"RENDER",env:"RENDER",pr:{IS_PULL_REQUEST:"true"}},{name:"Sail CI",constant:"SAIL",env:"SAILCI",pr:"SAIL_PULL_REQUEST_NUMBER"},{name:"Semaphore",constant:"SEMAPHORE",env:"SEMAPHORE",pr:"PULL_REQUEST_NUMBER"},{name:"Screwdriver",constant:"SCREWDRIVER",env:"SCREWDRIVER",pr:{env:"SD_PULL_REQUEST",ne:"false"}},{name:"Shippable",constant:"SHIPPABLE",env:"SHIPPABLE",pr:{IS_PULL_REQUEST:"true"}},{name:"Solano CI",constant:"SOLANO",env:"TDDIUM",pr:"TDDIUM_PR_ID"},{name:"Strider CD",constant:"STRIDER",env:"STRIDER"},{name:"TaskCluster",constant:"TASKCLUSTER",env:["TASK_ID","RUN_ID"]},{name:"TeamCity",constant:"TEAMCITY",env:"TEAMCITY_VERSION"},{name:"Travis CI",constant:"TRAVIS",env:"TRAVIS",pr:{env:"TRAVIS_PULL_REQUEST",ne:"false"}},{name:"Vercel",constant:"VERCEL",env:"NOW_BUILDER"},{name:"Visual Studio App Center",constant:"APPCENTER",env:"APPCENTER_BUILD_ID"}]});var Ic=w(Xn=>{"use strict";var $K=ZK(),To=process.env;Object.defineProperty(Xn,"_vendors",{value:$K.map(function(r){return r.constant})});Xn.name=null;Xn.isPR=null;$K.forEach(function(r){let t=(Array.isArray(r.env)?r.env:[r.env]).every(function(i){return eU(i)});if(Xn[r.constant]=t,t)switch(Xn.name=r.name,typeof r.pr){case"string":Xn.isPR=!!To[r.pr];break;case"object":"env"in r.pr?Xn.isPR=r.pr.env in To&&To[r.pr.env]!==r.pr.ne:"any"in r.pr?Xn.isPR=r.pr.any.some(function(i){return!!To[i]}):Xn.isPR=eU(r.pr);break;default:Xn.isPR=null}});Xn.isCI=!!(To.CI||To.CONTINUOUS_INTEGRATION||To.BUILD_NUMBER||To.RUN_ID||Xn.name);function eU(r){return typeof r=="string"?!!To[r]:Object.keys(r).every(function(e){return To[e]===r[e]})}});var cg={};ft(cg,{KeyRelationship:()=>Bc,applyCascade:()=>fp,base64RegExp:()=>sU,colorStringAlphaRegExp:()=>nU,colorStringRegExp:()=>iU,computeKey:()=>zA,getPrintable:()=>ti,hasExactLength:()=>cU,hasForbiddenKeys:()=>mde,hasKeyRelationship:()=>eS,hasMaxLength:()=>tde,hasMinLength:()=>ede,hasMutuallyExclusiveKeys:()=>Ede,hasRequiredKeys:()=>Cde,hasUniqueItems:()=>rde,isArray:()=>Jpe,isAtLeast:()=>sde,isAtMost:()=>ode,isBase64:()=>pde,isBoolean:()=>Gpe,isDate:()=>qpe,isDict:()=>zpe,isEnum:()=>nn,isHexColor:()=>hde,isISO8601:()=>fde,isInExclusiveRange:()=>Ade,isInInclusiveRange:()=>ade,isInstanceOf:()=>Vpe,isInteger:()=>lde,isJSON:()=>dde,isLiteral:()=>Hpe,isLowerCase:()=>cde,isNegative:()=>ide,isNullable:()=>$pe,isNumber:()=>Ype,isObject:()=>_pe,isOneOf:()=>Xpe,isOptional:()=>Zpe,isPositive:()=>nde,isString:()=>gp,isTuple:()=>Wpe,isUUID4:()=>gde,isUnknown:()=>lU,isUpperCase:()=>ude,iso8601RegExp:()=>$Q,makeCoercionFn:()=>wc,makeSetter:()=>AU,makeTrait:()=>aU,makeValidator:()=>vt,matchesRegExp:()=>hp,plural:()=>hI,pushError:()=>mt,simpleKeyRegExp:()=>rU,uuid4RegExp:()=>oU});function vt({test:r}){return aU(r)()}function ti(r){return r===null?"null":r===void 0?"undefined":r===""?"an empty string":JSON.stringify(r)}function zA(r,e){var t,i,n;return typeof e=="number"?`${(t=r==null?void 0:r.p)!==null&&t!==void 0?t:"."}[${e}]`:rU.test(e)?`${(i=r==null?void 0:r.p)!==null&&i!==void 0?i:""}.${e}`:`${(n=r==null?void 0:r.p)!==null&&n!==void 0?n:"."}[${JSON.stringify(e)}]`}function wc(r,e){return t=>{let i=r[e];return r[e]=t,wc(r,e).bind(null,i)}}function AU(r,e){return t=>{r[e]=t}}function hI(r,e,t){return r===1?e:t}function mt({errors:r,p:e}={},t){return r==null||r.push(`${e!=null?e:"."}: ${t}`),!1}function Hpe(r){return vt({test:(e,t)=>e!==r?mt(t,`Expected a literal (got ${ti(r)})`):!0})}function nn(r){let e=Array.isArray(r)?r:Object.values(r),t=new Set(e);return vt({test:(i,n)=>t.has(i)?!0:mt(n,`Expected a valid enumeration value (got ${ti(i)})`)})}var rU,iU,nU,sU,oU,$Q,aU,lU,gp,jpe,Gpe,Ype,qpe,Jpe,Wpe,zpe,_pe,Vpe,Xpe,fp,Zpe,$pe,ede,tde,cU,rde,ide,nde,sde,ode,ade,Ade,lde,hp,cde,ude,gde,fde,hde,pde,dde,Cde,mde,Ede,Bc,Ide,eS,ys=uge(()=>{rU=/^[a-zA-Z_][a-zA-Z0-9_]*$/,iU=/^#[0-9a-f]{6}$/i,nU=/^#[0-9a-f]{6}([0-9a-f]{2})?$/i,sU=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,oU=/^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}$/i,$Q=/^(?:[1-9]\d{3}(-?)(?:(?:0[1-9]|1[0-2])\1(?:0[1-9]|1\d|2[0-8])|(?:0[13-9]|1[0-2])\1(?:29|30)|(?:0[13578]|1[02])(?:\1)31|00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[0-5]))|(?:[1-9]\d(?:0[48]|[2468][048]|[13579][26])|(?:[2468][048]|[13579][26])00)(?:(-?)02(?:\2)29|-?366))T(?:[01]\d|2[0-3])(:?)[0-5]\d(?:\3[0-5]\d)?(?:Z|[+-][01]\d(?:\3[0-5]\d)?)$/,aU=r=>()=>r;lU=()=>vt({test:(r,e)=>!0});gp=()=>vt({test:(r,e)=>typeof r!="string"?mt(e,`Expected a string (got ${ti(r)})`):!0});jpe=new Map([["true",!0],["True",!0],["1",!0],[1,!0],["false",!1],["False",!1],["0",!1],[0,!1]]),Gpe=()=>vt({test:(r,e)=>{var t;if(typeof r!="boolean"){if(typeof(e==null?void 0:e.coercions)!="undefined"){if(typeof(e==null?void 0:e.coercion)=="undefined")return mt(e,"Unbound coercion result");let i=jpe.get(r);if(typeof i!="undefined")return e.coercions.push([(t=e.p)!==null&&t!==void 0?t:".",e.coercion.bind(null,i)]),!0}return mt(e,`Expected a boolean (got ${ti(r)})`)}return!0}}),Ype=()=>vt({test:(r,e)=>{var t;if(typeof r!="number"){if(typeof(e==null?void 0:e.coercions)!="undefined"){if(typeof(e==null?void 0:e.coercion)=="undefined")return mt(e,"Unbound coercion result");let i;if(typeof r=="string"){let n;try{n=JSON.parse(r)}catch(s){}if(typeof n=="number")if(JSON.stringify(n)===r)i=n;else return mt(e,`Received a number that can't be safely represented by the runtime (${r})`)}if(typeof i!="undefined")return e.coercions.push([(t=e.p)!==null&&t!==void 0?t:".",e.coercion.bind(null,i)]),!0}return mt(e,`Expected a number (got ${ti(r)})`)}return!0}}),qpe=()=>vt({test:(r,e)=>{var t;if(!(r instanceof Date)){if(typeof(e==null?void 0:e.coercions)!="undefined"){if(typeof(e==null?void 0:e.coercion)=="undefined")return mt(e,"Unbound coercion result");let i;if(typeof r=="string"&&$Q.test(r))i=new Date(r);else{let n;if(typeof r=="string"){let s;try{s=JSON.parse(r)}catch(o){}typeof s=="number"&&(n=s)}else typeof r=="number"&&(n=r);if(typeof n!="undefined")if(Number.isSafeInteger(n)||!Number.isSafeInteger(n*1e3))i=new Date(n*1e3);else return mt(e,`Received a timestamp that can't be safely represented by the runtime (${r})`)}if(typeof i!="undefined")return e.coercions.push([(t=e.p)!==null&&t!==void 0?t:".",e.coercion.bind(null,i)]),!0}return mt(e,`Expected a date (got ${ti(r)})`)}return!0}}),Jpe=(r,{delimiter:e}={})=>vt({test:(t,i)=>{var n;if(typeof t=="string"&&typeof e!="undefined"&&typeof(i==null?void 0:i.coercions)!="undefined"){if(typeof(i==null?void 0:i.coercion)=="undefined")return mt(i,"Unbound coercion result");t=t.split(e),i.coercions.push([(n=i.p)!==null&&n!==void 0?n:".",i.coercion.bind(null,t)])}if(!Array.isArray(t))return mt(i,`Expected an array (got ${ti(t)})`);let s=!0;for(let o=0,a=t.length;o{let t=cU(r.length);return vt({test:(i,n)=>{var s;if(typeof i=="string"&&typeof e!="undefined"&&typeof(n==null?void 0:n.coercions)!="undefined"){if(typeof(n==null?void 0:n.coercion)=="undefined")return mt(n,"Unbound coercion result");i=i.split(e),n.coercions.push([(s=n.p)!==null&&s!==void 0?s:".",n.coercion.bind(null,i)])}if(!Array.isArray(i))return mt(n,`Expected a tuple (got ${ti(i)})`);let o=t(i,Object.assign({},n));for(let a=0,l=i.length;avt({test:(t,i)=>{if(typeof t!="object"||t===null)return mt(i,`Expected an object (got ${ti(t)})`);let n=Object.keys(t),s=!0;for(let o=0,a=n.length;o{let t=Object.keys(r);return vt({test:(i,n)=>{if(typeof i!="object"||i===null)return mt(n,`Expected an object (got ${ti(i)})`);let s=new Set([...t,...Object.keys(i)]),o={},a=!0;for(let l of s){if(l==="constructor"||l==="__proto__")a=mt(Object.assign(Object.assign({},n),{p:zA(n,l)}),"Unsafe property name");else{let c=Object.prototype.hasOwnProperty.call(r,l)?r[l]:void 0,u=Object.prototype.hasOwnProperty.call(i,l)?i[l]:void 0;typeof c!="undefined"?a=c(u,Object.assign(Object.assign({},n),{p:zA(n,l),coercion:wc(i,l)}))&&a:e===null?a=mt(Object.assign(Object.assign({},n),{p:zA(n,l)}),`Extraneous property (got ${ti(u)})`):Object.defineProperty(o,l,{enumerable:!0,get:()=>u,set:AU(i,l)})}if(!a&&(n==null?void 0:n.errors)==null)break}return e!==null&&(a||(n==null?void 0:n.errors)!=null)&&(a=e(o,n)&&a),a}})},Vpe=r=>vt({test:(e,t)=>e instanceof r?!0:mt(t,`Expected an instance of ${r.name} (got ${ti(e)})`)}),Xpe=(r,{exclusive:e=!1}={})=>vt({test:(t,i)=>{var n,s,o;let a=[],l=typeof(i==null?void 0:i.errors)!="undefined"?[]:void 0;for(let c=0,u=r.length;c1?mt(i,`Expected to match exactly a single predicate (matched ${a.join(", ")})`):(o=i==null?void 0:i.errors)===null||o===void 0||o.push(...l),!1}}),fp=(r,e)=>vt({test:(t,i)=>{var n,s;let o={value:t},a=typeof(i==null?void 0:i.coercions)!="undefined"?wc(o,"value"):void 0,l=typeof(i==null?void 0:i.coercions)!="undefined"?[]:void 0;if(!r(t,Object.assign(Object.assign({},i),{coercion:a,coercions:l})))return!1;let c=[];if(typeof l!="undefined")for(let[,u]of l)c.push(u());try{if(typeof(i==null?void 0:i.coercions)!="undefined"){if(o.value!==t){if(typeof(i==null?void 0:i.coercion)=="undefined")return mt(i,"Unbound coercion result");i.coercions.push([(n=i.p)!==null&&n!==void 0?n:".",i.coercion.bind(null,o.value)])}(s=i==null?void 0:i.coercions)===null||s===void 0||s.push(...l)}return e.every(u=>u(o.value,i))}finally{for(let u of c)u()}}}),Zpe=r=>vt({test:(e,t)=>typeof e=="undefined"?!0:r(e,t)}),$pe=r=>vt({test:(e,t)=>e===null?!0:r(e,t)}),ede=r=>vt({test:(e,t)=>e.length>=r?!0:mt(t,`Expected to have a length of at least ${r} elements (got ${e.length})`)}),tde=r=>vt({test:(e,t)=>e.length<=r?!0:mt(t,`Expected to have a length of at most ${r} elements (got ${e.length})`)}),cU=r=>vt({test:(e,t)=>e.length!==r?mt(t,`Expected to have a length of exactly ${r} elements (got ${e.length})`):!0}),rde=({map:r}={})=>vt({test:(e,t)=>{let i=new Set,n=new Set;for(let s=0,o=e.length;svt({test:(r,e)=>r<=0?!0:mt(e,`Expected to be negative (got ${r})`)}),nde=()=>vt({test:(r,e)=>r>=0?!0:mt(e,`Expected to be positive (got ${r})`)}),sde=r=>vt({test:(e,t)=>e>=r?!0:mt(t,`Expected to be at least ${r} (got ${e})`)}),ode=r=>vt({test:(e,t)=>e<=r?!0:mt(t,`Expected to be at most ${r} (got ${e})`)}),ade=(r,e)=>vt({test:(t,i)=>t>=r&&t<=e?!0:mt(i,`Expected to be in the [${r}; ${e}] range (got ${t})`)}),Ade=(r,e)=>vt({test:(t,i)=>t>=r&&tvt({test:(e,t)=>e!==Math.round(e)?mt(t,`Expected to be an integer (got ${e})`):Number.isSafeInteger(e)?!0:mt(t,`Expected to be a safe integer (got ${e})`)}),hp=r=>vt({test:(e,t)=>r.test(e)?!0:mt(t,`Expected to match the pattern ${r.toString()} (got ${ti(e)})`)}),cde=()=>vt({test:(r,e)=>r!==r.toLowerCase()?mt(e,`Expected to be all-lowercase (got ${r})`):!0}),ude=()=>vt({test:(r,e)=>r!==r.toUpperCase()?mt(e,`Expected to be all-uppercase (got ${r})`):!0}),gde=()=>vt({test:(r,e)=>oU.test(r)?!0:mt(e,`Expected to be a valid UUID v4 (got ${ti(r)})`)}),fde=()=>vt({test:(r,e)=>$Q.test(r)?!1:mt(e,`Expected to be a valid ISO 8601 date string (got ${ti(r)})`)}),hde=({alpha:r=!1})=>vt({test:(e,t)=>(r?iU.test(e):nU.test(e))?!0:mt(t,`Expected to be a valid hexadecimal color string (got ${ti(e)})`)}),pde=()=>vt({test:(r,e)=>sU.test(r)?!0:mt(e,`Expected to be a valid base 64 string (got ${ti(r)})`)}),dde=(r=lU())=>vt({test:(e,t)=>{let i;try{i=JSON.parse(e)}catch(n){return mt(t,`Expected to be a valid JSON string (got ${ti(e)})`)}return r(i,t)}}),Cde=r=>{let e=new Set(r);return vt({test:(t,i)=>{let n=new Set(Object.keys(t)),s=[];for(let o of e)n.has(o)||s.push(o);return s.length>0?mt(i,`Missing required ${hI(s.length,"property","properties")} ${s.map(o=>`"${o}"`).join(", ")}`):!0}})},mde=r=>{let e=new Set(r);return vt({test:(t,i)=>{let n=new Set(Object.keys(t)),s=[];for(let o of e)n.has(o)&&s.push(o);return s.length>0?mt(i,`Forbidden ${hI(s.length,"property","properties")} ${s.map(o=>`"${o}"`).join(", ")}`):!0}})},Ede=r=>{let e=new Set(r);return vt({test:(t,i)=>{let n=new Set(Object.keys(t)),s=[];for(let o of e)n.has(o)&&s.push(o);return s.length>1?mt(i,`Mutually exclusive properties ${s.map(o=>`"${o}"`).join(", ")}`):!0}})};(function(r){r.Forbids="Forbids",r.Requires="Requires"})(Bc||(Bc={}));Ide={[Bc.Forbids]:{expect:!1,message:"forbids using"},[Bc.Requires]:{expect:!0,message:"requires using"}},eS=(r,e,t,{ignore:i=[]}={})=>{let n=new Set(i),s=new Set(t),o=Ide[e];return vt({test:(a,l)=>{let c=new Set(Object.keys(a));if(!c.has(r)||n.has(a[r]))return!0;let u=[];for(let g of s)(c.has(g)&&!n.has(a[g]))!==o.expect&&u.push(g);return u.length>=1?mt(l,`Property "${r}" ${o.message} ${hI(u.length,"property","properties")} ${u.map(g=>`"${g}"`).join(", ")}`):!0}})}});var kU=w((dZe,xU)=>{"use strict";xU.exports=(r,...e)=>new Promise(t=>{t(r(...e))})});var gg=w((CZe,aS)=>{"use strict";var Ode=kU(),PU=r=>{if(r<1)throw new TypeError("Expected `concurrency` to be a number from 1 and up");let e=[],t=0,i=()=>{t--,e.length>0&&e.shift()()},n=(a,l,...c)=>{t++;let u=Ode(a,...c);l(u),u.then(i,i)},s=(a,l,...c)=>{tnew Promise(c=>s(a,c,...l));return Object.defineProperties(o,{activeCount:{get:()=>t},pendingCount:{get:()=>e.length}}),o};aS.exports=PU;aS.exports.default=PU});var mp=w((EZe,DU)=>{var Mde="2.0.0",Kde=256,Ude=Number.MAX_SAFE_INTEGER||9007199254740991,Hde=16;DU.exports={SEMVER_SPEC_VERSION:Mde,MAX_LENGTH:Kde,MAX_SAFE_INTEGER:Ude,MAX_SAFE_COMPONENT_LENGTH:Hde}});var Ep=w((IZe,RU)=>{var jde=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{};RU.exports=jde});var bc=w((VA,FU)=>{var{MAX_SAFE_COMPONENT_LENGTH:AS}=mp(),Gde=Ep();VA=FU.exports={};var Yde=VA.re=[],rt=VA.src=[],it=VA.t={},qde=0,xt=(r,e,t)=>{let i=qde++;Gde(i,e),it[r]=i,rt[i]=e,Yde[i]=new RegExp(e,t?"g":void 0)};xt("NUMERICIDENTIFIER","0|[1-9]\\d*");xt("NUMERICIDENTIFIERLOOSE","[0-9]+");xt("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*");xt("MAINVERSION",`(${rt[it.NUMERICIDENTIFIER]})\\.(${rt[it.NUMERICIDENTIFIER]})\\.(${rt[it.NUMERICIDENTIFIER]})`);xt("MAINVERSIONLOOSE",`(${rt[it.NUMERICIDENTIFIERLOOSE]})\\.(${rt[it.NUMERICIDENTIFIERLOOSE]})\\.(${rt[it.NUMERICIDENTIFIERLOOSE]})`);xt("PRERELEASEIDENTIFIER",`(?:${rt[it.NUMERICIDENTIFIER]}|${rt[it.NONNUMERICIDENTIFIER]})`);xt("PRERELEASEIDENTIFIERLOOSE",`(?:${rt[it.NUMERICIDENTIFIERLOOSE]}|${rt[it.NONNUMERICIDENTIFIER]})`);xt("PRERELEASE",`(?:-(${rt[it.PRERELEASEIDENTIFIER]}(?:\\.${rt[it.PRERELEASEIDENTIFIER]})*))`);xt("PRERELEASELOOSE",`(?:-?(${rt[it.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${rt[it.PRERELEASEIDENTIFIERLOOSE]})*))`);xt("BUILDIDENTIFIER","[0-9A-Za-z-]+");xt("BUILD",`(?:\\+(${rt[it.BUILDIDENTIFIER]}(?:\\.${rt[it.BUILDIDENTIFIER]})*))`);xt("FULLPLAIN",`v?${rt[it.MAINVERSION]}${rt[it.PRERELEASE]}?${rt[it.BUILD]}?`);xt("FULL",`^${rt[it.FULLPLAIN]}$`);xt("LOOSEPLAIN",`[v=\\s]*${rt[it.MAINVERSIONLOOSE]}${rt[it.PRERELEASELOOSE]}?${rt[it.BUILD]}?`);xt("LOOSE",`^${rt[it.LOOSEPLAIN]}$`);xt("GTLT","((?:<|>)?=?)");xt("XRANGEIDENTIFIERLOOSE",`${rt[it.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);xt("XRANGEIDENTIFIER",`${rt[it.NUMERICIDENTIFIER]}|x|X|\\*`);xt("XRANGEPLAIN",`[v=\\s]*(${rt[it.XRANGEIDENTIFIER]})(?:\\.(${rt[it.XRANGEIDENTIFIER]})(?:\\.(${rt[it.XRANGEIDENTIFIER]})(?:${rt[it.PRERELEASE]})?${rt[it.BUILD]}?)?)?`);xt("XRANGEPLAINLOOSE",`[v=\\s]*(${rt[it.XRANGEIDENTIFIERLOOSE]})(?:\\.(${rt[it.XRANGEIDENTIFIERLOOSE]})(?:\\.(${rt[it.XRANGEIDENTIFIERLOOSE]})(?:${rt[it.PRERELEASELOOSE]})?${rt[it.BUILD]}?)?)?`);xt("XRANGE",`^${rt[it.GTLT]}\\s*${rt[it.XRANGEPLAIN]}$`);xt("XRANGELOOSE",`^${rt[it.GTLT]}\\s*${rt[it.XRANGEPLAINLOOSE]}$`);xt("COERCE",`(^|[^\\d])(\\d{1,${AS}})(?:\\.(\\d{1,${AS}}))?(?:\\.(\\d{1,${AS}}))?(?:$|[^\\d])`);xt("COERCERTL",rt[it.COERCE],!0);xt("LONETILDE","(?:~>?)");xt("TILDETRIM",`(\\s*)${rt[it.LONETILDE]}\\s+`,!0);VA.tildeTrimReplace="$1~";xt("TILDE",`^${rt[it.LONETILDE]}${rt[it.XRANGEPLAIN]}$`);xt("TILDELOOSE",`^${rt[it.LONETILDE]}${rt[it.XRANGEPLAINLOOSE]}$`);xt("LONECARET","(?:\\^)");xt("CARETTRIM",`(\\s*)${rt[it.LONECARET]}\\s+`,!0);VA.caretTrimReplace="$1^";xt("CARET",`^${rt[it.LONECARET]}${rt[it.XRANGEPLAIN]}$`);xt("CARETLOOSE",`^${rt[it.LONECARET]}${rt[it.XRANGEPLAINLOOSE]}$`);xt("COMPARATORLOOSE",`^${rt[it.GTLT]}\\s*(${rt[it.LOOSEPLAIN]})$|^$`);xt("COMPARATOR",`^${rt[it.GTLT]}\\s*(${rt[it.FULLPLAIN]})$|^$`);xt("COMPARATORTRIM",`(\\s*)${rt[it.GTLT]}\\s*(${rt[it.LOOSEPLAIN]}|${rt[it.XRANGEPLAIN]})`,!0);VA.comparatorTrimReplace="$1$2$3";xt("HYPHENRANGE",`^\\s*(${rt[it.XRANGEPLAIN]})\\s+-\\s+(${rt[it.XRANGEPLAIN]})\\s*$`);xt("HYPHENRANGELOOSE",`^\\s*(${rt[it.XRANGEPLAINLOOSE]})\\s+-\\s+(${rt[it.XRANGEPLAINLOOSE]})\\s*$`);xt("STAR","(<|>)?=?\\s*\\*");xt("GTE0","^\\s*>=\\s*0.0.0\\s*$");xt("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")});var Ip=w((yZe,NU)=>{var Jde=["includePrerelease","loose","rtl"],Wde=r=>r?typeof r!="object"?{loose:!0}:Jde.filter(e=>r[e]).reduce((e,t)=>(e[t]=!0,e),{}):{};NU.exports=Wde});var yI=w((wZe,LU)=>{var TU=/^[0-9]+$/,OU=(r,e)=>{let t=TU.test(r),i=TU.test(e);return t&&i&&(r=+r,e=+e),r===e?0:t&&!i?-1:i&&!t?1:rOU(e,r);LU.exports={compareIdentifiers:OU,rcompareIdentifiers:zde}});var Hi=w((BZe,MU)=>{var wI=Ep(),{MAX_LENGTH:KU,MAX_SAFE_INTEGER:BI}=mp(),{re:UU,t:HU}=bc(),_de=Ip(),{compareIdentifiers:yp}=yI(),Bs=class{constructor(e,t){if(t=_de(t),e instanceof Bs){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid Version: ${e}`);if(e.length>KU)throw new TypeError(`version is longer than ${KU} characters`);wI("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let i=e.trim().match(t.loose?UU[HU.LOOSE]:UU[HU.FULL]);if(!i)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>BI||this.major<0)throw new TypeError("Invalid major version");if(this.minor>BI||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>BI||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map(n=>{if(/^[0-9]+$/.test(n)){let s=+n;if(s>=0&&s=0;)typeof this.prerelease[i]=="number"&&(this.prerelease[i]++,i=-2);i===-1&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error(`invalid increment argument: ${e}`)}return this.format(),this.raw=this.version,this}};MU.exports=Bs});var Qc=w((bZe,jU)=>{var{MAX_LENGTH:Vde}=mp(),{re:GU,t:YU}=bc(),qU=Hi(),Xde=Ip(),Zde=(r,e)=>{if(e=Xde(e),r instanceof qU)return r;if(typeof r!="string"||r.length>Vde||!(e.loose?GU[YU.LOOSE]:GU[YU.FULL]).test(r))return null;try{return new qU(r,e)}catch(i){return null}};jU.exports=Zde});var WU=w((QZe,JU)=>{var $de=Qc(),eCe=(r,e)=>{let t=$de(r,e);return t?t.version:null};JU.exports=eCe});var _U=w((SZe,zU)=>{var tCe=Qc(),rCe=(r,e)=>{let t=tCe(r.trim().replace(/^[=v]+/,""),e);return t?t.version:null};zU.exports=rCe});var XU=w((vZe,VU)=>{var iCe=Hi(),nCe=(r,e,t,i)=>{typeof t=="string"&&(i=t,t=void 0);try{return new iCe(r,t).inc(e,i).version}catch(n){return null}};VU.exports=nCe});var bs=w((xZe,ZU)=>{var $U=Hi(),sCe=(r,e,t)=>new $U(r,t).compare(new $U(e,t));ZU.exports=sCe});var bI=w((kZe,e2)=>{var oCe=bs(),aCe=(r,e,t)=>oCe(r,e,t)===0;e2.exports=aCe});var i2=w((PZe,t2)=>{var r2=Qc(),ACe=bI(),lCe=(r,e)=>{if(ACe(r,e))return null;{let t=r2(r),i=r2(e),n=t.prerelease.length||i.prerelease.length,s=n?"pre":"",o=n?"prerelease":"";for(let a in t)if((a==="major"||a==="minor"||a==="patch")&&t[a]!==i[a])return s+a;return o}};t2.exports=lCe});var s2=w((DZe,n2)=>{var cCe=Hi(),uCe=(r,e)=>new cCe(r,e).major;n2.exports=uCe});var a2=w((RZe,o2)=>{var gCe=Hi(),fCe=(r,e)=>new gCe(r,e).minor;o2.exports=fCe});var l2=w((FZe,A2)=>{var hCe=Hi(),pCe=(r,e)=>new hCe(r,e).patch;A2.exports=pCe});var u2=w((NZe,c2)=>{var dCe=Qc(),CCe=(r,e)=>{let t=dCe(r,e);return t&&t.prerelease.length?t.prerelease:null};c2.exports=CCe});var f2=w((LZe,g2)=>{var mCe=bs(),ECe=(r,e,t)=>mCe(e,r,t);g2.exports=ECe});var p2=w((TZe,h2)=>{var ICe=bs(),yCe=(r,e)=>ICe(r,e,!0);h2.exports=yCe});var QI=w((OZe,d2)=>{var C2=Hi(),wCe=(r,e,t)=>{let i=new C2(r,t),n=new C2(e,t);return i.compare(n)||i.compareBuild(n)};d2.exports=wCe});var E2=w((MZe,m2)=>{var BCe=QI(),bCe=(r,e)=>r.sort((t,i)=>BCe(t,i,e));m2.exports=bCe});var y2=w((KZe,I2)=>{var QCe=QI(),SCe=(r,e)=>r.sort((t,i)=>QCe(i,t,e));I2.exports=SCe});var wp=w((UZe,w2)=>{var vCe=bs(),xCe=(r,e,t)=>vCe(r,e,t)>0;w2.exports=xCe});var SI=w((HZe,B2)=>{var kCe=bs(),PCe=(r,e,t)=>kCe(r,e,t)<0;B2.exports=PCe});var lS=w((jZe,b2)=>{var DCe=bs(),RCe=(r,e,t)=>DCe(r,e,t)!==0;b2.exports=RCe});var vI=w((GZe,Q2)=>{var FCe=bs(),NCe=(r,e,t)=>FCe(r,e,t)>=0;Q2.exports=NCe});var xI=w((YZe,S2)=>{var LCe=bs(),TCe=(r,e,t)=>LCe(r,e,t)<=0;S2.exports=TCe});var cS=w((qZe,v2)=>{var OCe=bI(),MCe=lS(),KCe=wp(),UCe=vI(),HCe=SI(),jCe=xI(),GCe=(r,e,t,i)=>{switch(e){case"===":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r===t;case"!==":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r!==t;case"":case"=":case"==":return OCe(r,t,i);case"!=":return MCe(r,t,i);case">":return KCe(r,t,i);case">=":return UCe(r,t,i);case"<":return HCe(r,t,i);case"<=":return jCe(r,t,i);default:throw new TypeError(`Invalid operator: ${e}`)}};v2.exports=GCe});var k2=w((JZe,x2)=>{var YCe=Hi(),qCe=Qc(),{re:kI,t:PI}=bc(),JCe=(r,e)=>{if(r instanceof YCe)return r;if(typeof r=="number"&&(r=String(r)),typeof r!="string")return null;e=e||{};let t=null;if(!e.rtl)t=r.match(kI[PI.COERCE]);else{let i;for(;(i=kI[PI.COERCERTL].exec(r))&&(!t||t.index+t[0].length!==r.length);)(!t||i.index+i[0].length!==t.index+t[0].length)&&(t=i),kI[PI.COERCERTL].lastIndex=i.index+i[1].length+i[2].length;kI[PI.COERCERTL].lastIndex=-1}return t===null?null:qCe(`${t[2]}.${t[3]||"0"}.${t[4]||"0"}`,e)};x2.exports=JCe});var D2=w((WZe,P2)=>{"use strict";P2.exports=function(r){r.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}});var Bp=w((zZe,R2)=>{"use strict";R2.exports=Gt;Gt.Node=Sc;Gt.create=Gt;function Gt(r){var e=this;if(e instanceof Gt||(e=new Gt),e.tail=null,e.head=null,e.length=0,r&&typeof r.forEach=="function")r.forEach(function(n){e.push(n)});else if(arguments.length>0)for(var t=0,i=arguments.length;t1)t=e;else if(this.head)i=this.head.next,t=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var n=0;i!==null;n++)t=r(t,i.value,n),i=i.next;return t};Gt.prototype.reduceReverse=function(r,e){var t,i=this.tail;if(arguments.length>1)t=e;else if(this.tail)i=this.tail.prev,t=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var n=this.length-1;i!==null;n--)t=r(t,i.value,n),i=i.prev;return t};Gt.prototype.toArray=function(){for(var r=new Array(this.length),e=0,t=this.head;t!==null;e++)r[e]=t.value,t=t.next;return r};Gt.prototype.toArrayReverse=function(){for(var r=new Array(this.length),e=0,t=this.tail;t!==null;e++)r[e]=t.value,t=t.prev;return r};Gt.prototype.slice=function(r,e){e=e||this.length,e<0&&(e+=this.length),r=r||0,r<0&&(r+=this.length);var t=new Gt;if(ethis.length&&(e=this.length);for(var i=0,n=this.head;n!==null&&ithis.length&&(e=this.length);for(var i=this.length,n=this.tail;n!==null&&i>e;i--)n=n.prev;for(;n!==null&&i>r;i--,n=n.prev)t.push(n.value);return t};Gt.prototype.splice=function(r,e,...t){r>this.length&&(r=this.length-1),r<0&&(r=this.length+r);for(var i=0,n=this.head;n!==null&&i{"use strict";var VCe=Bp(),vc=Symbol("max"),Ua=Symbol("length"),fg=Symbol("lengthCalculator"),bp=Symbol("allowStale"),xc=Symbol("maxAge"),Ha=Symbol("dispose"),N2=Symbol("noDisposeOnSet"),yi=Symbol("lruList"),oo=Symbol("cache"),L2=Symbol("updateAgeOnGet"),uS=()=>1,T2=class{constructor(e){if(typeof e=="number"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!="number"||e.max<0))throw new TypeError("max must be a non-negative number");let t=this[vc]=e.max||Infinity,i=e.length||uS;if(this[fg]=typeof i!="function"?uS:i,this[bp]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[xc]=e.maxAge||0,this[Ha]=e.dispose,this[N2]=e.noDisposeOnSet||!1,this[L2]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!="number"||e<0)throw new TypeError("max must be a non-negative number");this[vc]=e||Infinity,Qp(this)}get max(){return this[vc]}set allowStale(e){this[bp]=!!e}get allowStale(){return this[bp]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[xc]=e,Qp(this)}get maxAge(){return this[xc]}set lengthCalculator(e){typeof e!="function"&&(e=uS),e!==this[fg]&&(this[fg]=e,this[Ua]=0,this[yi].forEach(t=>{t.length=this[fg](t.value,t.key),this[Ua]+=t.length})),Qp(this)}get lengthCalculator(){return this[fg]}get length(){return this[Ua]}get itemCount(){return this[yi].length}rforEach(e,t){t=t||this;for(let i=this[yi].tail;i!==null;){let n=i.prev;M2(this,e,i,t),i=n}}forEach(e,t){t=t||this;for(let i=this[yi].head;i!==null;){let n=i.next;M2(this,e,i,t),i=n}}keys(){return this[yi].toArray().map(e=>e.key)}values(){return this[yi].toArray().map(e=>e.value)}reset(){this[Ha]&&this[yi]&&this[yi].length&&this[yi].forEach(e=>this[Ha](e.key,e.value)),this[oo]=new Map,this[yi]=new VCe,this[Ua]=0}dump(){return this[yi].map(e=>DI(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[yi]}set(e,t,i){if(i=i||this[xc],i&&typeof i!="number")throw new TypeError("maxAge must be a number");let n=i?Date.now():0,s=this[fg](t,e);if(this[oo].has(e)){if(s>this[vc])return hg(this,this[oo].get(e)),!1;let l=this[oo].get(e).value;return this[Ha]&&(this[N2]||this[Ha](e,l.value)),l.now=n,l.maxAge=i,l.value=t,this[Ua]+=s-l.length,l.length=s,this.get(e),Qp(this),!0}let o=new O2(e,t,s,n,i);return o.length>this[vc]?(this[Ha]&&this[Ha](e,t),!1):(this[Ua]+=o.length,this[yi].unshift(o),this[oo].set(e,this[yi].head),Qp(this),!0)}has(e){if(!this[oo].has(e))return!1;let t=this[oo].get(e).value;return!DI(this,t)}get(e){return gS(this,e,!0)}peek(e){return gS(this,e,!1)}pop(){let e=this[yi].tail;return e?(hg(this,e),e.value):null}del(e){hg(this,this[oo].get(e))}load(e){this.reset();let t=Date.now();for(let i=e.length-1;i>=0;i--){let n=e[i],s=n.e||0;if(s===0)this.set(n.k,n.v);else{let o=s-t;o>0&&this.set(n.k,n.v,o)}}}prune(){this[oo].forEach((e,t)=>gS(this,t,!1))}},gS=(r,e,t)=>{let i=r[oo].get(e);if(i){let n=i.value;if(DI(r,n)){if(hg(r,i),!r[bp])return}else t&&(r[L2]&&(i.value.now=Date.now()),r[yi].unshiftNode(i));return n.value}},DI=(r,e)=>{if(!e||!e.maxAge&&!r[xc])return!1;let t=Date.now()-e.now;return e.maxAge?t>e.maxAge:r[xc]&&t>r[xc]},Qp=r=>{if(r[Ua]>r[vc])for(let e=r[yi].tail;r[Ua]>r[vc]&&e!==null;){let t=e.prev;hg(r,e),e=t}},hg=(r,e)=>{if(e){let t=e.value;r[Ha]&&r[Ha](t.key,t.value),r[Ua]-=t.length,r[oo].delete(t.key),r[yi].removeNode(e)}},O2=class{constructor(e,t,i,n,s){this.key=e,this.value=t,this.length=i,this.now=n,this.maxAge=s||0}},M2=(r,e,t,i)=>{let n=t.value;DI(r,n)&&(hg(r,t),r[bp]||(n=void 0)),n&&e.call(i,n.value,n.key,r)};F2.exports=T2});var Qs=w((VZe,U2)=>{var pg=class{constructor(e,t){if(t=XCe(t),e instanceof pg)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new pg(e.raw,t);if(e instanceof fS)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(i=>this.parseRange(i.trim())).filter(i=>i.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${e}`);if(this.set.length>1){let i=this.set[0];if(this.set=this.set.filter(n=>!j2(n[0])),this.set.length===0)this.set=[i];else if(this.set.length>1){for(let n of this.set)if(n.length===1&&rme(n[0])){this.set=[n];break}}}this.format()}format(){return this.range=this.set.map(e=>e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){e=e.trim();let i=`parseRange:${Object.keys(this.options).join(",")}:${e}`,n=H2.get(i);if(n)return n;let s=this.options.loose,o=s?ji[ki.HYPHENRANGELOOSE]:ji[ki.HYPHENRANGE];e=e.replace(o,sme(this.options.includePrerelease)),zr("hyphen replace",e),e=e.replace(ji[ki.COMPARATORTRIM],$Ce),zr("comparator trim",e,ji[ki.COMPARATORTRIM]),e=e.replace(ji[ki.TILDETRIM],eme),e=e.replace(ji[ki.CARETTRIM],tme),e=e.split(/\s+/).join(" ");let a=s?ji[ki.COMPARATORLOOSE]:ji[ki.COMPARATOR],l=e.split(" ").map(f=>ime(f,this.options)).join(" ").split(/\s+/).map(f=>nme(f,this.options)).filter(this.options.loose?f=>!!f.match(a):()=>!0).map(f=>new fS(f,this.options)),c=l.length,u=new Map;for(let f of l){if(j2(f))return[f];u.set(f.value,f)}u.size>1&&u.has("")&&u.delete("");let g=[...u.values()];return H2.set(i,g),g}intersects(e,t){if(!(e instanceof pg))throw new TypeError("a Range is required");return this.set.some(i=>G2(i,t)&&e.set.some(n=>G2(n,t)&&i.every(s=>n.every(o=>s.intersects(o,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new ZCe(e,this.options)}catch(t){return!1}for(let t=0;tr.value==="<0.0.0-0",rme=r=>r.value==="",G2=(r,e)=>{let t=!0,i=r.slice(),n=i.pop();for(;t&&i.length;)t=i.every(s=>n.intersects(s,e)),n=i.pop();return t},ime=(r,e)=>(zr("comp",r,e),r=lme(r,e),zr("caret",r),r=Ame(r,e),zr("tildes",r),r=cme(r,e),zr("xrange",r),r=ume(r,e),zr("stars",r),r),on=r=>!r||r.toLowerCase()==="x"||r==="*",Ame=(r,e)=>r.trim().split(/\s+/).map(t=>gme(t,e)).join(" "),gme=(r,e)=>{let t=e.loose?ji[ki.TILDELOOSE]:ji[ki.TILDE];return r.replace(t,(i,n,s,o,a)=>{zr("tilde",r,i,n,s,o,a);let l;return on(n)?l="":on(s)?l=`>=${n}.0.0 <${+n+1}.0.0-0`:on(o)?l=`>=${n}.${s}.0 <${n}.${+s+1}.0-0`:a?(zr("replaceTilde pr",a),l=`>=${n}.${s}.${o}-${a} <${n}.${+s+1}.0-0`):l=`>=${n}.${s}.${o} <${n}.${+s+1}.0-0`,zr("tilde return",l),l})},lme=(r,e)=>r.trim().split(/\s+/).map(t=>fme(t,e)).join(" "),fme=(r,e)=>{zr("caret",r,e);let t=e.loose?ji[ki.CARETLOOSE]:ji[ki.CARET],i=e.includePrerelease?"-0":"";return r.replace(t,(n,s,o,a,l)=>{zr("caret",r,n,s,o,a,l);let c;return on(s)?c="":on(o)?c=`>=${s}.0.0${i} <${+s+1}.0.0-0`:on(a)?s==="0"?c=`>=${s}.${o}.0${i} <${s}.${+o+1}.0-0`:c=`>=${s}.${o}.0${i} <${+s+1}.0.0-0`:l?(zr("replaceCaret pr",l),s==="0"?o==="0"?c=`>=${s}.${o}.${a}-${l} <${s}.${o}.${+a+1}-0`:c=`>=${s}.${o}.${a}-${l} <${s}.${+o+1}.0-0`:c=`>=${s}.${o}.${a}-${l} <${+s+1}.0.0-0`):(zr("no pr"),s==="0"?o==="0"?c=`>=${s}.${o}.${a}${i} <${s}.${o}.${+a+1}-0`:c=`>=${s}.${o}.${a}${i} <${s}.${+o+1}.0-0`:c=`>=${s}.${o}.${a} <${+s+1}.0.0-0`),zr("caret return",c),c})},cme=(r,e)=>(zr("replaceXRanges",r,e),r.split(/\s+/).map(t=>hme(t,e)).join(" ")),hme=(r,e)=>{r=r.trim();let t=e.loose?ji[ki.XRANGELOOSE]:ji[ki.XRANGE];return r.replace(t,(i,n,s,o,a,l)=>{zr("xRange",r,i,n,s,o,a,l);let c=on(s),u=c||on(o),g=u||on(a),f=g;return n==="="&&f&&(n=""),l=e.includePrerelease?"-0":"",c?n===">"||n==="<"?i="<0.0.0-0":i="*":n&&f?(u&&(o=0),a=0,n===">"?(n=">=",u?(s=+s+1,o=0,a=0):(o=+o+1,a=0)):n==="<="&&(n="<",u?s=+s+1:o=+o+1),n==="<"&&(l="-0"),i=`${n+s}.${o}.${a}${l}`):u?i=`>=${s}.0.0${l} <${+s+1}.0.0-0`:g&&(i=`>=${s}.${o}.0${l} <${s}.${+o+1}.0-0`),zr("xRange return",i),i})},ume=(r,e)=>(zr("replaceStars",r,e),r.trim().replace(ji[ki.STAR],"")),nme=(r,e)=>(zr("replaceGTE0",r,e),r.trim().replace(ji[e.includePrerelease?ki.GTE0PRE:ki.GTE0],"")),sme=r=>(e,t,i,n,s,o,a,l,c,u,g,f,h)=>(on(i)?t="":on(n)?t=`>=${i}.0.0${r?"-0":""}`:on(s)?t=`>=${i}.${n}.0${r?"-0":""}`:o?t=`>=${t}`:t=`>=${t}${r?"-0":""}`,on(c)?l="":on(u)?l=`<${+c+1}.0.0-0`:on(g)?l=`<${c}.${+u+1}.0-0`:f?l=`<=${c}.${u}.${g}-${f}`:r?l=`<${c}.${u}.${+g+1}-0`:l=`<=${l}`,`${t} ${l}`.trim()),ome=(r,e,t)=>{for(let i=0;i0){let n=r[i].semver;if(n.major===e.major&&n.minor===e.minor&&n.patch===e.patch)return!0}return!1}return!0}});var Sp=w((XZe,Y2)=>{var vp=Symbol("SemVer ANY"),xp=class{static get ANY(){return vp}constructor(e,t){if(t=pme(t),e instanceof xp){if(e.loose===!!t.loose)return e;e=e.value}pS("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===vp?this.value="":this.value=this.operator+this.semver.version,pS("comp",this)}parse(e){let t=this.options.loose?q2[J2.COMPARATORLOOSE]:q2[J2.COMPARATOR],i=e.match(t);if(!i)throw new TypeError(`Invalid comparator: ${e}`);this.operator=i[1]!==void 0?i[1]:"",this.operator==="="&&(this.operator=""),i[2]?this.semver=new W2(i[2],this.options.loose):this.semver=vp}toString(){return this.value}test(e){if(pS("Comparator.test",e,this.options.loose),this.semver===vp||e===vp)return!0;if(typeof e=="string")try{e=new W2(e,this.options)}catch(t){return!1}return hS(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof xp))throw new TypeError("a Comparator is required");if((!t||typeof t!="object")&&(t={loose:!!t,includePrerelease:!1}),this.operator==="")return this.value===""?!0:new z2(e.value,t).test(this.value);if(e.operator==="")return e.value===""?!0:new z2(this.value,t).test(e.semver);let i=(this.operator===">="||this.operator===">")&&(e.operator===">="||e.operator===">"),n=(this.operator==="<="||this.operator==="<")&&(e.operator==="<="||e.operator==="<"),s=this.semver.version===e.semver.version,o=(this.operator===">="||this.operator==="<=")&&(e.operator===">="||e.operator==="<="),a=hS(this.semver,"<",e.semver,t)&&(this.operator===">="||this.operator===">")&&(e.operator==="<="||e.operator==="<"),l=hS(this.semver,">",e.semver,t)&&(this.operator==="<="||this.operator==="<")&&(e.operator===">="||e.operator===">");return i||n||s&&o||a||l}};Y2.exports=xp;var pme=Ip(),{re:q2,t:J2}=bc(),hS=cS(),pS=Ep(),W2=Hi(),z2=Qs()});var kp=w((ZZe,_2)=>{var dme=Qs(),Cme=(r,e,t)=>{try{e=new dme(e,t)}catch(i){return!1}return e.test(r)};_2.exports=Cme});var X2=w(($Ze,V2)=>{var mme=Qs(),Eme=(r,e)=>new mme(r,e).set.map(t=>t.map(i=>i.value).join(" ").trim().split(" "));V2.exports=Eme});var $2=w((e$e,Z2)=>{var Ime=Hi(),yme=Qs(),wme=(r,e,t)=>{let i=null,n=null,s=null;try{s=new yme(e,t)}catch(o){return null}return r.forEach(o=>{s.test(o)&&(!i||n.compare(o)===-1)&&(i=o,n=new Ime(i,t))}),i};Z2.exports=wme});var tH=w((t$e,eH)=>{var Bme=Hi(),bme=Qs(),Qme=(r,e,t)=>{let i=null,n=null,s=null;try{s=new bme(e,t)}catch(o){return null}return r.forEach(o=>{s.test(o)&&(!i||n.compare(o)===1)&&(i=o,n=new Bme(i,t))}),i};eH.exports=Qme});var nH=w((r$e,rH)=>{var dS=Hi(),Sme=Qs(),iH=wp(),vme=(r,e)=>{r=new Sme(r,e);let t=new dS("0.0.0");if(r.test(t)||(t=new dS("0.0.0-0"),r.test(t)))return t;t=null;for(let i=0;i{let a=new dS(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||iH(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),s&&(!t||iH(t,s))&&(t=s)}return t&&r.test(t)?t:null};rH.exports=vme});var oH=w((i$e,sH)=>{var xme=Qs(),kme=(r,e)=>{try{return new xme(r,e).range||"*"}catch(t){return null}};sH.exports=kme});var RI=w((n$e,aH)=>{var Pme=Hi(),AH=Sp(),{ANY:Dme}=AH,Rme=Qs(),Fme=kp(),lH=wp(),cH=SI(),Nme=xI(),Lme=vI(),Tme=(r,e,t,i)=>{r=new Pme(r,i),e=new Rme(e,i);let n,s,o,a,l;switch(t){case">":n=lH,s=Nme,o=cH,a=">",l=">=";break;case"<":n=cH,s=Lme,o=lH,a="<",l="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Fme(r,e,i))return!1;for(let c=0;c{h.semver===Dme&&(h=new AH(">=0.0.0")),g=g||h,f=f||h,n(h.semver,g.semver,i)?g=h:o(h.semver,f.semver,i)&&(f=h)}),g.operator===a||g.operator===l||(!f.operator||f.operator===a)&&s(r,f.semver))return!1;if(f.operator===l&&o(r,f.semver))return!1}return!0};aH.exports=Tme});var gH=w((s$e,uH)=>{var Ome=RI(),Mme=(r,e,t)=>Ome(r,e,">",t);uH.exports=Mme});var hH=w((o$e,fH)=>{var Kme=RI(),Ume=(r,e,t)=>Kme(r,e,"<",t);fH.exports=Ume});var CH=w((a$e,pH)=>{var dH=Qs(),Hme=(r,e,t)=>(r=new dH(r,t),e=new dH(e,t),r.intersects(e));pH.exports=Hme});var EH=w((A$e,mH)=>{var jme=kp(),Gme=bs();mH.exports=(r,e,t)=>{let i=[],n=null,s=null,o=r.sort((u,g)=>Gme(u,g,t));for(let u of o)jme(u,e,t)?(s=u,n||(n=u)):(s&&i.push([n,s]),s=null,n=null);n&&i.push([n,null]);let a=[];for(let[u,g]of i)u===g?a.push(u):!g&&u===o[0]?a.push("*"):g?u===o[0]?a.push(`<=${g}`):a.push(`${u} - ${g}`):a.push(`>=${u}`);let l=a.join(" || "),c=typeof e.raw=="string"?e.raw:String(e);return l.length{var yH=Qs(),FI=Sp(),{ANY:CS}=FI,Pp=kp(),mS=bs(),qme=(r,e,t={})=>{if(r===e)return!0;r=new yH(r,t),e=new yH(e,t);let i=!1;e:for(let n of r.set){for(let s of e.set){let o=Yme(n,s,t);if(i=i||o!==null,o)continue e}if(i)return!1}return!0},Yme=(r,e,t)=>{if(r===e)return!0;if(r.length===1&&r[0].semver===CS){if(e.length===1&&e[0].semver===CS)return!0;t.includePrerelease?r=[new FI(">=0.0.0-0")]:r=[new FI(">=0.0.0")]}if(e.length===1&&e[0].semver===CS){if(t.includePrerelease)return!0;e=[new FI(">=0.0.0")]}let i=new Set,n,s;for(let h of r)h.operator===">"||h.operator===">="?n=wH(n,h,t):h.operator==="<"||h.operator==="<="?s=BH(s,h,t):i.add(h.semver);if(i.size>1)return null;let o;if(n&&s){if(o=mS(n.semver,s.semver,t),o>0)return null;if(o===0&&(n.operator!==">="||s.operator!=="<="))return null}for(let h of i){if(n&&!Pp(h,String(n),t)||s&&!Pp(h,String(s),t))return null;for(let p of e)if(!Pp(h,String(p),t))return!1;return!0}let a,l,c,u,g=s&&!t.includePrerelease&&s.semver.prerelease.length?s.semver:!1,f=n&&!t.includePrerelease&&n.semver.prerelease.length?n.semver:!1;g&&g.prerelease.length===1&&s.operator==="<"&&g.prerelease[0]===0&&(g=!1);for(let h of e){if(u=u||h.operator===">"||h.operator===">=",c=c||h.operator==="<"||h.operator==="<=",n){if(f&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===f.major&&h.semver.minor===f.minor&&h.semver.patch===f.patch&&(f=!1),h.operator===">"||h.operator===">="){if(a=wH(n,h,t),a===h&&a!==n)return!1}else if(n.operator===">="&&!Pp(n.semver,String(h),t))return!1}if(s){if(g&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===g.major&&h.semver.minor===g.minor&&h.semver.patch===g.patch&&(g=!1),h.operator==="<"||h.operator==="<="){if(l=BH(s,h,t),l===h&&l!==s)return!1}else if(s.operator==="<="&&!Pp(s.semver,String(h),t))return!1}if(!h.operator&&(s||n)&&o!==0)return!1}return!(n&&c&&!s&&o!==0||s&&u&&!n&&o!==0||f||g)},wH=(r,e,t)=>{if(!r)return e;let i=mS(r.semver,e.semver,t);return i>0?r:i<0||e.operator===">"&&r.operator===">="?e:r},BH=(r,e,t)=>{if(!r)return e;let i=mS(r.semver,e.semver,t);return i<0?r:i>0||e.operator==="<"&&r.operator==="<="?e:r};IH.exports=qme});var ri=w((c$e,QH)=>{var ES=bc();QH.exports={re:ES.re,src:ES.src,tokens:ES.t,SEMVER_SPEC_VERSION:mp().SEMVER_SPEC_VERSION,SemVer:Hi(),compareIdentifiers:yI().compareIdentifiers,rcompareIdentifiers:yI().rcompareIdentifiers,parse:Qc(),valid:WU(),clean:_U(),inc:XU(),diff:i2(),major:s2(),minor:a2(),patch:l2(),prerelease:u2(),compare:bs(),rcompare:f2(),compareLoose:p2(),compareBuild:QI(),sort:E2(),rsort:y2(),gt:wp(),lt:SI(),eq:bI(),neq:lS(),gte:vI(),lte:xI(),cmp:cS(),coerce:k2(),Comparator:Sp(),Range:Qs(),satisfies:kp(),toComparators:X2(),maxSatisfying:$2(),minSatisfying:tH(),minVersion:nH(),validRange:oH(),outside:RI(),gtr:gH(),ltr:hH(),intersects:CH(),simplifyRange:EH(),subset:bH()}});var IS=w(NI=>{"use strict";Object.defineProperty(NI,"__esModule",{value:!0});NI.VERSION=void 0;NI.VERSION="9.1.0"});var Yt=w((exports,module)=>{"use strict";var __spreadArray=exports&&exports.__spreadArray||function(r,e,t){if(t||arguments.length===2)for(var i=0,n=e.length,s;i{(function(r,e){typeof define=="function"&&define.amd?define([],e):typeof LI=="object"&&LI.exports?LI.exports=e():r.regexpToAst=e()})(typeof self!="undefined"?self:SH,function(){function r(){}r.prototype.saveState=function(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}},r.prototype.restoreState=function(p){this.idx=p.idx,this.input=p.input,this.groupIdx=p.groupIdx},r.prototype.pattern=function(p){this.idx=0,this.input=p,this.groupIdx=0,this.consumeChar("/");var m=this.disjunction();this.consumeChar("/");for(var y={type:"Flags",loc:{begin:this.idx,end:p.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};this.isRegExpFlag();)switch(this.popChar()){case"g":o(y,"global");break;case"i":o(y,"ignoreCase");break;case"m":o(y,"multiLine");break;case"u":o(y,"unicode");break;case"y":o(y,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:y,value:m,loc:this.loc(0)}},r.prototype.disjunction=function(){var p=[],m=this.idx;for(p.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),p.push(this.alternative());return{type:"Disjunction",value:p,loc:this.loc(m)}},r.prototype.alternative=function(){for(var p=[],m=this.idx;this.isTerm();)p.push(this.term());return{type:"Alternative",value:p,loc:this.loc(m)}},r.prototype.term=function(){return this.isAssertion()?this.assertion():this.atom()},r.prototype.assertion=function(){var p=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(p)};case"$":return{type:"EndAnchor",loc:this.loc(p)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(p)};case"B":return{type:"NonWordBoundary",loc:this.loc(p)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");var m;switch(this.popChar()){case"=":m="Lookahead";break;case"!":m="NegativeLookahead";break}a(m);var y=this.disjunction();return this.consumeChar(")"),{type:m,value:y,loc:this.loc(p)}}l()},r.prototype.quantifier=function(p){var m,y=this.idx;switch(this.popChar()){case"*":m={atLeast:0,atMost:Infinity};break;case"+":m={atLeast:1,atMost:Infinity};break;case"?":m={atLeast:0,atMost:1};break;case"{":var b=this.integerIncludingZero();switch(this.popChar()){case"}":m={atLeast:b,atMost:b};break;case",":var v;this.isDigit()?(v=this.integerIncludingZero(),m={atLeast:b,atMost:v}):m={atLeast:b,atMost:Infinity},this.consumeChar("}");break}if(p===!0&&m===void 0)return;a(m);break}if(!(p===!0&&m===void 0))return a(m),this.peekChar(0)==="?"?(this.consumeChar("?"),m.greedy=!1):m.greedy=!0,m.type="Quantifier",m.loc=this.loc(y),m},r.prototype.atom=function(){var p,m=this.idx;switch(this.peekChar()){case".":p=this.dotAll();break;case"\\":p=this.atomEscape();break;case"[":p=this.characterClass();break;case"(":p=this.group();break}return p===void 0&&this.isPatternCharacter()&&(p=this.patternCharacter()),a(p),p.loc=this.loc(m),this.isQuantifier()&&(p.quantifier=this.quantifier()),p},r.prototype.dotAll=function(){return this.consumeChar("."),{type:"Set",complement:!0,value:[n(` -`),n("\r"),n("\u2028"),n("\u2029")]}},r.prototype.atomEscape=function(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}},r.prototype.decimalEscapeAtom=function(){var p=this.positiveInteger();return{type:"GroupBackReference",value:p}},r.prototype.characterClassEscape=function(){var p,m=!1;switch(this.popChar()){case"d":p=u;break;case"D":p=u,m=!0;break;case"s":p=f;break;case"S":p=f,m=!0;break;case"w":p=g;break;case"W":p=g,m=!0;break}return a(p),{type:"Set",value:p,complement:m}},r.prototype.controlEscapeAtom=function(){var p;switch(this.popChar()){case"f":p=n("\f");break;case"n":p=n(` -`);break;case"r":p=n("\r");break;case"t":p=n(" ");break;case"v":p=n("\v");break}return a(p),{type:"Character",value:p}},r.prototype.controlLetterEscapeAtom=function(){this.consumeChar("c");var p=this.popChar();if(/[a-zA-Z]/.test(p)===!1)throw Error("Invalid ");var m=p.toUpperCase().charCodeAt(0)-64;return{type:"Character",value:m}},r.prototype.nulCharacterAtom=function(){return this.consumeChar("0"),{type:"Character",value:n("\0")}},r.prototype.hexEscapeSequenceAtom=function(){return this.consumeChar("x"),this.parseHexDigits(2)},r.prototype.regExpUnicodeEscapeSequenceAtom=function(){return this.consumeChar("u"),this.parseHexDigits(4)},r.prototype.identityEscapeAtom=function(){var p=this.popChar();return{type:"Character",value:n(p)}},r.prototype.classPatternCharacterAtom=function(){switch(this.peekChar()){case` -`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:var p=this.popChar();return{type:"Character",value:n(p)}}},r.prototype.characterClass=function(){var p=[],m=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),m=!0);this.isClassAtom();){var y=this.classAtom(),b=y.type==="Character";if(b&&this.isRangeDash()){this.consumeChar("-");var v=this.classAtom(),x=v.type==="Character";if(x){if(v.value=this.input.length)throw Error("Unexpected end of input");this.idx++},r.prototype.loc=function(p){return{begin:p,end:this.idx}};var e=/[0-9a-fA-F]/,t=/[0-9]/,i=/[1-9]/;function n(p){return p.charCodeAt(0)}function s(p,m){p.length!==void 0?p.forEach(function(y){m.push(y)}):m.push(p)}function o(p,m){if(p[m]===!0)throw"duplicate flag "+m;p[m]=!0}function a(p){if(p===void 0)throw Error("Internal Error - Should never get here!")}function l(){throw Error("Internal Error - Should never get here!")}var c,u=[];for(c=n("0");c<=n("9");c++)u.push(c);var g=[n("_")].concat(u);for(c=n("a");c<=n("z");c++)g.push(c);for(c=n("A");c<=n("Z");c++)g.push(c);var f=[n(" "),n("\f"),n(` -`),n("\r"),n(" "),n("\v"),n(" "),n("\xA0"),n("\u1680"),n("\u2000"),n("\u2001"),n("\u2002"),n("\u2003"),n("\u2004"),n("\u2005"),n("\u2006"),n("\u2007"),n("\u2008"),n("\u2009"),n("\u200A"),n("\u2028"),n("\u2029"),n("\u202F"),n("\u205F"),n("\u3000"),n("\uFEFF")];function h(){}return h.prototype.visitChildren=function(p){for(var m in p){var y=p[m];p.hasOwnProperty(m)&&(y.type!==void 0?this.visit(y):Array.isArray(y)&&y.forEach(function(b){this.visit(b)},this))}},h.prototype.visit=function(p){switch(p.type){case"Pattern":this.visitPattern(p);break;case"Flags":this.visitFlags(p);break;case"Disjunction":this.visitDisjunction(p);break;case"Alternative":this.visitAlternative(p);break;case"StartAnchor":this.visitStartAnchor(p);break;case"EndAnchor":this.visitEndAnchor(p);break;case"WordBoundary":this.visitWordBoundary(p);break;case"NonWordBoundary":this.visitNonWordBoundary(p);break;case"Lookahead":this.visitLookahead(p);break;case"NegativeLookahead":this.visitNegativeLookahead(p);break;case"Character":this.visitCharacter(p);break;case"Set":this.visitSet(p);break;case"Group":this.visitGroup(p);break;case"GroupBackReference":this.visitGroupBackReference(p);break;case"Quantifier":this.visitQuantifier(p);break}this.visitChildren(p)},h.prototype.visitPattern=function(p){},h.prototype.visitFlags=function(p){},h.prototype.visitDisjunction=function(p){},h.prototype.visitAlternative=function(p){},h.prototype.visitStartAnchor=function(p){},h.prototype.visitEndAnchor=function(p){},h.prototype.visitWordBoundary=function(p){},h.prototype.visitNonWordBoundary=function(p){},h.prototype.visitLookahead=function(p){},h.prototype.visitNegativeLookahead=function(p){},h.prototype.visitCharacter=function(p){},h.prototype.visitSet=function(p){},h.prototype.visitGroup=function(p){},h.prototype.visitGroupBackReference=function(p){},h.prototype.visitQuantifier=function(p){},{RegExpParser:r,BaseRegExpVisitor:h,VERSION:"0.5.0"}})});var MI=w(dg=>{"use strict";Object.defineProperty(dg,"__esModule",{value:!0});dg.clearRegExpParserCache=dg.getRegExpAst=void 0;var Jme=TI(),OI={},Wme=new Jme.RegExpParser;function zme(r){var e=r.toString();if(OI.hasOwnProperty(e))return OI[e];var t=Wme.pattern(e);return OI[e]=t,t}dg.getRegExpAst=zme;function _me(){OI={}}dg.clearRegExpParserCache=_me});var DH=w(Bn=>{"use strict";var Vme=Bn&&Bn.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Bn,"__esModule",{value:!0});Bn.canMatchCharCode=Bn.firstCharOptimizedIndices=Bn.getOptimizedStartCodesIndices=Bn.failedOptimizationPrefixMsg=void 0;var vH=TI(),Ss=Yt(),xH=MI(),ja=yS(),kH="Complement Sets are not supported for first char optimization";Bn.failedOptimizationPrefixMsg=`Unable to use "first char" lexer optimizations: -`;function Xme(r,e){e===void 0&&(e=!1);try{var t=(0,xH.getRegExpAst)(r),i=KI(t.value,{},t.flags.ignoreCase);return i}catch(s){if(s.message===kH)e&&(0,Ss.PRINT_WARNING)(""+Bn.failedOptimizationPrefixMsg+(" Unable to optimize: < "+r.toString()+` > -`)+` Complement Sets cannot be automatically optimized. - This will disable the lexer's first char optimizations. - See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{var n="";e&&(n=` - This will disable the lexer's first char optimizations. - See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),(0,Ss.PRINT_ERROR)(Bn.failedOptimizationPrefixMsg+` -`+(" Failed parsing: < "+r.toString()+` > -`)+(" Using the regexp-to-ast library version: "+vH.VERSION+` -`)+" Please open an issue at: https://github.com/bd82/regexp-to-ast/issues"+n)}}return[]}Bn.getOptimizedStartCodesIndices=Xme;function KI(r,e,t){switch(r.type){case"Disjunction":for(var i=0;i=ja.minOptimizationVal)for(var f=u.from>=ja.minOptimizationVal?u.from:ja.minOptimizationVal,h=u.to,p=(0,ja.charCodeToOptimizedIndex)(f),m=(0,ja.charCodeToOptimizedIndex)(h),y=p;y<=m;y++)e[y]=y}}});break;case"Group":KI(o.value,e,t);break;default:throw Error("Non Exhaustive Match")}var a=o.quantifier!==void 0&&o.quantifier.atLeast===0;if(o.type==="Group"&&wS(o)===!1||o.type!=="Group"&&a===!1)break}break;default:throw Error("non exhaustive match!")}return(0,Ss.values)(e)}Bn.firstCharOptimizedIndices=KI;function UI(r,e,t){var i=(0,ja.charCodeToOptimizedIndex)(r);e[i]=i,t===!0&&Zme(r,e)}function Zme(r,e){var t=String.fromCharCode(r),i=t.toUpperCase();if(i!==t){var n=(0,ja.charCodeToOptimizedIndex)(i.charCodeAt(0));e[n]=n}else{var s=t.toLowerCase();if(s!==t){var n=(0,ja.charCodeToOptimizedIndex)(s.charCodeAt(0));e[n]=n}}}function PH(r,e){return(0,Ss.find)(r.value,function(t){if(typeof t=="number")return(0,Ss.contains)(e,t);var i=t;return(0,Ss.find)(e,function(n){return i.from<=n&&n<=i.to})!==void 0})}function wS(r){return r.quantifier&&r.quantifier.atLeast===0?!0:r.value?(0,Ss.isArray)(r.value)?(0,Ss.every)(r.value,wS):wS(r.value):!1}var $me=function(r){Vme(e,r);function e(t){var i=r.call(this)||this;return i.targetCharCodes=t,i.found=!1,i}return e.prototype.visitChildren=function(t){if(this.found!==!0){switch(t.type){case"Lookahead":this.visitLookahead(t);return;case"NegativeLookahead":this.visitNegativeLookahead(t);return}r.prototype.visitChildren.call(this,t)}},e.prototype.visitCharacter=function(t){(0,Ss.contains)(this.targetCharCodes,t.value)&&(this.found=!0)},e.prototype.visitSet=function(t){t.complement?PH(t,this.targetCharCodes)===void 0&&(this.found=!0):PH(t,this.targetCharCodes)!==void 0&&(this.found=!0)},e}(vH.BaseRegExpVisitor);function eEe(r,e){if(e instanceof RegExp){var t=(0,xH.getRegExpAst)(e),i=new $me(r);return i.visit(t),i.found}else return(0,Ss.find)(e,function(n){return(0,Ss.contains)(r,n.charCodeAt(0))})!==void 0}Bn.canMatchCharCode=eEe});var yS=w(Ze=>{"use strict";var RH=Ze&&Ze.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Ze,"__esModule",{value:!0});Ze.charCodeToOptimizedIndex=Ze.minOptimizationVal=Ze.buildLineBreakIssueMessage=Ze.LineTerminatorOptimizedTester=Ze.isShortPattern=Ze.isCustomPattern=Ze.cloneEmptyGroups=Ze.performWarningRuntimeChecks=Ze.performRuntimeChecks=Ze.addStickyFlag=Ze.addStartOfInput=Ze.findUnreachablePatterns=Ze.findModesThatDoNotExist=Ze.findInvalidGroupType=Ze.findDuplicatePatterns=Ze.findUnsupportedFlags=Ze.findStartOfInputAnchor=Ze.findEmptyMatchRegExps=Ze.findEndOfInputAnchor=Ze.findInvalidPatterns=Ze.findMissingPatterns=Ze.validatePatterns=Ze.analyzeTokenTypes=Ze.enableSticky=Ze.disableSticky=Ze.SUPPORT_STICKY=Ze.MODES=Ze.DEFAULT_MODE=void 0;var FH=TI(),Ar=Dp(),Ne=Yt(),Cg=DH(),NH=MI(),Mo="PATTERN";Ze.DEFAULT_MODE="defaultMode";Ze.MODES="modes";Ze.SUPPORT_STICKY=typeof new RegExp("(?:)").sticky=="boolean";function tEe(){Ze.SUPPORT_STICKY=!1}Ze.disableSticky=tEe;function rEe(){Ze.SUPPORT_STICKY=!0}Ze.enableSticky=rEe;function nEe(r,e){e=(0,Ne.defaults)(e,{useSticky:Ze.SUPPORT_STICKY,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",` -`],tracer:function(v,x){return x()}});var t=e.tracer;t("initCharCodeToOptimizedIndexMap",function(){iEe()});var i;t("Reject Lexer.NA",function(){i=(0,Ne.reject)(r,function(v){return v[Mo]===Ar.Lexer.NA})});var n=!1,s;t("Transform Patterns",function(){n=!1,s=(0,Ne.map)(i,function(v){var x=v[Mo];if((0,Ne.isRegExp)(x)){var T=x.source;return T.length===1&&T!=="^"&&T!=="$"&&T!=="."&&!x.ignoreCase?T:T.length===2&&T[0]==="\\"&&!(0,Ne.contains)(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],T[1])?T[1]:e.useSticky?bS(x):BS(x)}else{if((0,Ne.isFunction)(x))return n=!0,{exec:x};if((0,Ne.has)(x,"exec"))return n=!0,x;if(typeof x=="string"){if(x.length===1)return x;var q=x.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),Y=new RegExp(q);return e.useSticky?bS(Y):BS(Y)}else throw Error("non exhaustive match")}})});var o,a,l,c,u;t("misc mapping",function(){o=(0,Ne.map)(i,function(v){return v.tokenTypeIdx}),a=(0,Ne.map)(i,function(v){var x=v.GROUP;if(x!==Ar.Lexer.SKIPPED){if((0,Ne.isString)(x))return x;if((0,Ne.isUndefined)(x))return!1;throw Error("non exhaustive match")}}),l=(0,Ne.map)(i,function(v){var x=v.LONGER_ALT;if(x){var T=(0,Ne.isArray)(x)?(0,Ne.map)(x,function(q){return(0,Ne.indexOf)(i,q)}):[(0,Ne.indexOf)(i,x)];return T}}),c=(0,Ne.map)(i,function(v){return v.PUSH_MODE}),u=(0,Ne.map)(i,function(v){return(0,Ne.has)(v,"POP_MODE")})});var g;t("Line Terminator Handling",function(){var v=OH(e.lineTerminatorCharacters);g=(0,Ne.map)(i,function(x){return!1}),e.positionTracking!=="onlyOffset"&&(g=(0,Ne.map)(i,function(x){if((0,Ne.has)(x,"LINE_BREAKS"))return x.LINE_BREAKS;if(TH(x,v)===!1)return(0,Cg.canMatchCharCode)(v,x.PATTERN)}))});var f,h,p,m;t("Misc Mapping #2",function(){f=(0,Ne.map)(i,QS),h=(0,Ne.map)(s,LH),p=(0,Ne.reduce)(i,function(v,x){var T=x.GROUP;return(0,Ne.isString)(T)&&T!==Ar.Lexer.SKIPPED&&(v[T]=[]),v},{}),m=(0,Ne.map)(s,function(v,x){return{pattern:s[x],longerAlt:l[x],canLineTerminator:g[x],isCustom:f[x],short:h[x],group:a[x],push:c[x],pop:u[x],tokenTypeIdx:o[x],tokenType:i[x]}})});var y=!0,b=[];return e.safeMode||t("First Char Optimization",function(){b=(0,Ne.reduce)(i,function(v,x,T){if(typeof x.PATTERN=="string"){var q=x.PATTERN.charCodeAt(0),Y=vS(q);SS(v,Y,m[T])}else if((0,Ne.isArray)(x.START_CHARS_HINT)){var $;(0,Ne.forEach)(x.START_CHARS_HINT,function(ne){var ee=typeof ne=="string"?ne.charCodeAt(0):ne,A=vS(ee);$!==A&&($=A,SS(v,A,m[T]))})}else if((0,Ne.isRegExp)(x.PATTERN))if(x.PATTERN.unicode)y=!1,e.ensureOptimizations&&(0,Ne.PRINT_ERROR)(""+Cg.failedOptimizationPrefixMsg+(" Unable to analyze < "+x.PATTERN.toString()+` > pattern. -`)+` The regexp unicode flag is not currently supported by the regexp-to-ast library. - This will disable the lexer's first char optimizations. - For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{var _=(0,Cg.getOptimizedStartCodesIndices)(x.PATTERN,e.ensureOptimizations);(0,Ne.isEmpty)(_)&&(y=!1),(0,Ne.forEach)(_,function(ne){SS(v,ne,m[T])})}else e.ensureOptimizations&&(0,Ne.PRINT_ERROR)(""+Cg.failedOptimizationPrefixMsg+(" TokenType: <"+x.name+`> is using a custom token pattern without providing parameter. -`)+` This will disable the lexer's first char optimizations. - For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),y=!1;return v},[])}),t("ArrayPacking",function(){b=(0,Ne.packArray)(b)}),{emptyGroups:p,patternIdxToConfig:m,charCodeToPatternIdxToConfig:b,hasCustom:n,canBeOptimized:y}}Ze.analyzeTokenTypes=nEe;function oEe(r,e){var t=[],i=MH(r);t=t.concat(i.errors);var n=KH(i.valid),s=n.valid;return t=t.concat(n.errors),t=t.concat(sEe(s)),t=t.concat(UH(s)),t=t.concat(HH(s,e)),t=t.concat(jH(s)),t}Ze.validatePatterns=oEe;function sEe(r){var e=[],t=(0,Ne.filter)(r,function(i){return(0,Ne.isRegExp)(i[Mo])});return e=e.concat(GH(t)),e=e.concat(qH(t)),e=e.concat(JH(t)),e=e.concat(WH(t)),e=e.concat(YH(t)),e}function MH(r){var e=(0,Ne.filter)(r,function(n){return!(0,Ne.has)(n,Mo)}),t=(0,Ne.map)(e,function(n){return{message:"Token Type: ->"+n.name+"<- missing static 'PATTERN' property",type:Ar.LexerDefinitionErrorType.MISSING_PATTERN,tokenTypes:[n]}}),i=(0,Ne.difference)(r,e);return{errors:t,valid:i}}Ze.findMissingPatterns=MH;function KH(r){var e=(0,Ne.filter)(r,function(n){var s=n[Mo];return!(0,Ne.isRegExp)(s)&&!(0,Ne.isFunction)(s)&&!(0,Ne.has)(s,"exec")&&!(0,Ne.isString)(s)}),t=(0,Ne.map)(e,function(n){return{message:"Token Type: ->"+n.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:Ar.LexerDefinitionErrorType.INVALID_PATTERN,tokenTypes:[n]}}),i=(0,Ne.difference)(r,e);return{errors:t,valid:i}}Ze.findInvalidPatterns=KH;var aEe=/[^\\][\$]/;function GH(r){var e=function(n){RH(s,n);function s(){var o=n!==null&&n.apply(this,arguments)||this;return o.found=!1,o}return s.prototype.visitEndAnchor=function(o){this.found=!0},s}(FH.BaseRegExpVisitor),t=(0,Ne.filter)(r,function(n){var s=n[Mo];try{var o=(0,NH.getRegExpAst)(s),a=new e;return a.visit(o),a.found}catch(l){return aEe.test(s.source)}}),i=(0,Ne.map)(t,function(n){return{message:`Unexpected RegExp Anchor Error: - Token Type: ->`+n.name+`<- static 'PATTERN' cannot contain end of input anchor '$' - See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Ar.LexerDefinitionErrorType.EOI_ANCHOR_FOUND,tokenTypes:[n]}});return i}Ze.findEndOfInputAnchor=GH;function YH(r){var e=(0,Ne.filter)(r,function(i){var n=i[Mo];return n.test("")}),t=(0,Ne.map)(e,function(i){return{message:"Token Type: ->"+i.name+"<- static 'PATTERN' must not match an empty string",type:Ar.LexerDefinitionErrorType.EMPTY_MATCH_PATTERN,tokenTypes:[i]}});return t}Ze.findEmptyMatchRegExps=YH;var AEe=/[^\\[][\^]|^\^/;function qH(r){var e=function(n){RH(s,n);function s(){var o=n!==null&&n.apply(this,arguments)||this;return o.found=!1,o}return s.prototype.visitStartAnchor=function(o){this.found=!0},s}(FH.BaseRegExpVisitor),t=(0,Ne.filter)(r,function(n){var s=n[Mo];try{var o=(0,NH.getRegExpAst)(s),a=new e;return a.visit(o),a.found}catch(l){return AEe.test(s.source)}}),i=(0,Ne.map)(t,function(n){return{message:`Unexpected RegExp Anchor Error: - Token Type: ->`+n.name+`<- static 'PATTERN' cannot contain start of input anchor '^' - See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Ar.LexerDefinitionErrorType.SOI_ANCHOR_FOUND,tokenTypes:[n]}});return i}Ze.findStartOfInputAnchor=qH;function JH(r){var e=(0,Ne.filter)(r,function(i){var n=i[Mo];return n instanceof RegExp&&(n.multiline||n.global)}),t=(0,Ne.map)(e,function(i){return{message:"Token Type: ->"+i.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Ar.LexerDefinitionErrorType.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[i]}});return t}Ze.findUnsupportedFlags=JH;function WH(r){var e=[],t=(0,Ne.map)(r,function(s){return(0,Ne.reduce)(r,function(o,a){return s.PATTERN.source===a.PATTERN.source&&!(0,Ne.contains)(e,a)&&a.PATTERN!==Ar.Lexer.NA&&(e.push(a),o.push(a)),o},[])});t=(0,Ne.compact)(t);var i=(0,Ne.filter)(t,function(s){return s.length>1}),n=(0,Ne.map)(i,function(s){var o=(0,Ne.map)(s,function(l){return l.name}),a=(0,Ne.first)(s).PATTERN;return{message:"The same RegExp pattern ->"+a+"<-"+("has been used in all of the following Token Types: "+o.join(", ")+" <-"),type:Ar.LexerDefinitionErrorType.DUPLICATE_PATTERNS_FOUND,tokenTypes:s}});return n}Ze.findDuplicatePatterns=WH;function UH(r){var e=(0,Ne.filter)(r,function(i){if(!(0,Ne.has)(i,"GROUP"))return!1;var n=i.GROUP;return n!==Ar.Lexer.SKIPPED&&n!==Ar.Lexer.NA&&!(0,Ne.isString)(n)}),t=(0,Ne.map)(e,function(i){return{message:"Token Type: ->"+i.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Ar.LexerDefinitionErrorType.INVALID_GROUP_TYPE_FOUND,tokenTypes:[i]}});return t}Ze.findInvalidGroupType=UH;function HH(r,e){var t=(0,Ne.filter)(r,function(n){return n.PUSH_MODE!==void 0&&!(0,Ne.contains)(e,n.PUSH_MODE)}),i=(0,Ne.map)(t,function(n){var s="Token Type: ->"+n.name+"<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->"+n.PUSH_MODE+"<-which does not exist";return{message:s,type:Ar.LexerDefinitionErrorType.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[n]}});return i}Ze.findModesThatDoNotExist=HH;function jH(r){var e=[],t=(0,Ne.reduce)(r,function(i,n,s){var o=n.PATTERN;return o===Ar.Lexer.NA||((0,Ne.isString)(o)?i.push({str:o,idx:s,tokenType:n}):(0,Ne.isRegExp)(o)&&cEe(o)&&i.push({str:o.source,idx:s,tokenType:n})),i},[]);return(0,Ne.forEach)(r,function(i,n){(0,Ne.forEach)(t,function(s){var o=s.str,a=s.idx,l=s.tokenType;if(n"+i.name+"<-")+`in the lexer's definition. -See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:c,type:Ar.LexerDefinitionErrorType.UNREACHABLE_PATTERN,tokenTypes:[i,l]})}})}),e}Ze.findUnreachablePatterns=jH;function lEe(r,e){if((0,Ne.isRegExp)(e)){var t=e.exec(r);return t!==null&&t.index===0}else{if((0,Ne.isFunction)(e))return e(r,0,[],{});if((0,Ne.has)(e,"exec"))return e.exec(r,0,[],{});if(typeof e=="string")return e===r;throw Error("non exhaustive match")}}function cEe(r){var e=[".","\\","[","]","|","^","$","(",")","?","*","+","{"];return(0,Ne.find)(e,function(t){return r.source.indexOf(t)!==-1})===void 0}function BS(r){var e=r.ignoreCase?"i":"";return new RegExp("^(?:"+r.source+")",e)}Ze.addStartOfInput=BS;function bS(r){var e=r.ignoreCase?"iy":"y";return new RegExp(""+r.source,e)}Ze.addStickyFlag=bS;function uEe(r,e,t){var i=[];return(0,Ne.has)(r,Ze.DEFAULT_MODE)||i.push({message:"A MultiMode Lexer cannot be initialized without a <"+Ze.DEFAULT_MODE+`> property in its definition -`,type:Ar.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),(0,Ne.has)(r,Ze.MODES)||i.push({message:"A MultiMode Lexer cannot be initialized without a <"+Ze.MODES+`> property in its definition -`,type:Ar.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),(0,Ne.has)(r,Ze.MODES)&&(0,Ne.has)(r,Ze.DEFAULT_MODE)&&!(0,Ne.has)(r.modes,r.defaultMode)&&i.push({message:"A MultiMode Lexer cannot be initialized with a "+Ze.DEFAULT_MODE+": <"+r.defaultMode+`>which does not exist -`,type:Ar.LexerDefinitionErrorType.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),(0,Ne.has)(r,Ze.MODES)&&(0,Ne.forEach)(r.modes,function(n,s){(0,Ne.forEach)(n,function(o,a){(0,Ne.isUndefined)(o)&&i.push({message:"A Lexer cannot be initialized using an undefined Token Type. Mode:"+("<"+s+"> at index: <"+a+`> -`),type:Ar.LexerDefinitionErrorType.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED})})}),i}Ze.performRuntimeChecks=uEe;function gEe(r,e,t){var i=[],n=!1,s=(0,Ne.compact)((0,Ne.flatten)((0,Ne.mapValues)(r.modes,function(l){return l}))),o=(0,Ne.reject)(s,function(l){return l[Mo]===Ar.Lexer.NA}),a=OH(t);return e&&(0,Ne.forEach)(o,function(l){var c=TH(l,a);if(c!==!1){var u=zH(l,c),g={message:u,type:c.issue,tokenType:l};i.push(g)}else(0,Ne.has)(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(n=!0):(0,Cg.canMatchCharCode)(a,l.PATTERN)&&(n=!0)}),e&&!n&&i.push({message:`Warning: No LINE_BREAKS Found. - This Lexer has been defined to track line and column information, - But none of the Token Types can be identified as matching a line terminator. - See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS - for details.`,type:Ar.LexerDefinitionErrorType.NO_LINE_BREAKS_FLAGS}),i}Ze.performWarningRuntimeChecks=gEe;function fEe(r){var e={},t=(0,Ne.keys)(r);return(0,Ne.forEach)(t,function(i){var n=r[i];if((0,Ne.isArray)(n))e[i]=[];else throw Error("non exhaustive match")}),e}Ze.cloneEmptyGroups=fEe;function QS(r){var e=r.PATTERN;if((0,Ne.isRegExp)(e))return!1;if((0,Ne.isFunction)(e))return!0;if((0,Ne.has)(e,"exec"))return!0;if((0,Ne.isString)(e))return!1;throw Error("non exhaustive match")}Ze.isCustomPattern=QS;function LH(r){return(0,Ne.isString)(r)&&r.length===1?r.charCodeAt(0):!1}Ze.isShortPattern=LH;Ze.LineTerminatorOptimizedTester={test:function(r){for(var e=r.length,t=this.lastIndex;t Token Type -`)+(" Root cause: "+e.errMsg+`. -`)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR";if(e.issue===Ar.LexerDefinitionErrorType.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the option. -`+(" The problem is in the <"+r.name+`> Token Type -`)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK";throw Error("non exhaustive match")}Ze.buildLineBreakIssueMessage=zH;function OH(r){var e=(0,Ne.map)(r,function(t){return(0,Ne.isString)(t)&&t.length>0?t.charCodeAt(0):t});return e}function SS(r,e,t){r[e]===void 0?r[e]=[t]:r[e].push(t)}Ze.minOptimizationVal=256;var HI=[];function vS(r){return r255?255+~~(r/255):r}}});var mg=w(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.isTokenType=Ft.hasExtendingTokensTypesMapProperty=Ft.hasExtendingTokensTypesProperty=Ft.hasCategoriesProperty=Ft.hasShortKeyProperty=Ft.singleAssignCategoriesToksMap=Ft.assignCategoriesMapProp=Ft.assignCategoriesTokensProp=Ft.assignTokenDefaultProps=Ft.expandCategories=Ft.augmentTokenTypes=Ft.tokenIdxToClass=Ft.tokenShortNameIdx=Ft.tokenStructuredMatcherNoCategories=Ft.tokenStructuredMatcher=void 0;var ii=Yt();function hEe(r,e){var t=r.tokenTypeIdx;return t===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[t]===!0}Ft.tokenStructuredMatcher=hEe;function pEe(r,e){return r.tokenTypeIdx===e.tokenTypeIdx}Ft.tokenStructuredMatcherNoCategories=pEe;Ft.tokenShortNameIdx=1;Ft.tokenIdxToClass={};function dEe(r){var e=_H(r);VH(e),ZH(e),XH(e),(0,ii.forEach)(e,function(t){t.isParent=t.categoryMatches.length>0})}Ft.augmentTokenTypes=dEe;function _H(r){for(var e=(0,ii.cloneArr)(r),t=r,i=!0;i;){t=(0,ii.compact)((0,ii.flatten)((0,ii.map)(t,function(s){return s.CATEGORIES})));var n=(0,ii.difference)(t,e);e=e.concat(n),(0,ii.isEmpty)(n)?i=!1:t=n}return e}Ft.expandCategories=_H;function VH(r){(0,ii.forEach)(r,function(e){$H(e)||(Ft.tokenIdxToClass[Ft.tokenShortNameIdx]=e,e.tokenTypeIdx=Ft.tokenShortNameIdx++),xS(e)&&!(0,ii.isArray)(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),xS(e)||(e.CATEGORIES=[]),ej(e)||(e.categoryMatches=[]),tj(e)||(e.categoryMatchesMap={})})}Ft.assignTokenDefaultProps=VH;function XH(r){(0,ii.forEach)(r,function(e){e.categoryMatches=[],(0,ii.forEach)(e.categoryMatchesMap,function(t,i){e.categoryMatches.push(Ft.tokenIdxToClass[i].tokenTypeIdx)})})}Ft.assignCategoriesTokensProp=XH;function ZH(r){(0,ii.forEach)(r,function(e){kS([],e)})}Ft.assignCategoriesMapProp=ZH;function kS(r,e){(0,ii.forEach)(r,function(t){e.categoryMatchesMap[t.tokenTypeIdx]=!0}),(0,ii.forEach)(e.CATEGORIES,function(t){var i=r.concat(e);(0,ii.contains)(i,t)||kS(i,t)})}Ft.singleAssignCategoriesToksMap=kS;function $H(r){return(0,ii.has)(r,"tokenTypeIdx")}Ft.hasShortKeyProperty=$H;function xS(r){return(0,ii.has)(r,"CATEGORIES")}Ft.hasCategoriesProperty=xS;function ej(r){return(0,ii.has)(r,"categoryMatches")}Ft.hasExtendingTokensTypesProperty=ej;function tj(r){return(0,ii.has)(r,"categoryMatchesMap")}Ft.hasExtendingTokensTypesMapProperty=tj;function CEe(r){return(0,ii.has)(r,"tokenTypeIdx")}Ft.isTokenType=CEe});var PS=w(jI=>{"use strict";Object.defineProperty(jI,"__esModule",{value:!0});jI.defaultLexerErrorProvider=void 0;jI.defaultLexerErrorProvider={buildUnableToPopLexerModeMessage:function(r){return"Unable to pop Lexer Mode after encountering Token ->"+r.image+"<- The Mode Stack is empty"},buildUnexpectedCharactersMessage:function(r,e,t,i,n){return"unexpected character: ->"+r.charAt(e)+"<- at offset: "+e+","+(" skipped "+t+" characters.")}}});var Dp=w(kc=>{"use strict";Object.defineProperty(kc,"__esModule",{value:!0});kc.Lexer=kc.LexerDefinitionErrorType=void 0;var ao=yS(),lr=Yt(),mEe=mg(),EEe=PS(),IEe=MI(),yEe;(function(r){r[r.MISSING_PATTERN=0]="MISSING_PATTERN",r[r.INVALID_PATTERN=1]="INVALID_PATTERN",r[r.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",r[r.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",r[r.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",r[r.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",r[r.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",r[r.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",r[r.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",r[r.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",r[r.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",r[r.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",r[r.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",r[r.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",r[r.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",r[r.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",r[r.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK"})(yEe=kc.LexerDefinitionErrorType||(kc.LexerDefinitionErrorType={}));var Rp={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[` -`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:EEe.defaultLexerErrorProvider,traceInitPerf:!1,skipValidations:!1};Object.freeze(Rp);var wEe=function(){function r(e,t){var i=this;if(t===void 0&&(t=Rp),this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.config=void 0,this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},typeof t=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object. -a boolean 2nd argument is no longer supported`);this.config=(0,lr.merge)(Rp,t);var n=this.config.traceInitPerf;n===!0?(this.traceInitMaxIdent=Infinity,this.traceInitPerf=!0):typeof n=="number"&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",function(){var s,o=!0;i.TRACE_INIT("Lexer Config handling",function(){if(i.config.lineTerminatorsPattern===Rp.lineTerminatorsPattern)i.config.lineTerminatorsPattern=ao.LineTerminatorOptimizedTester;else if(i.config.lineTerminatorCharacters===Rp.lineTerminatorCharacters)throw Error(`Error: Missing property on the Lexer config. - For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(t.safeMode&&t.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');i.trackStartLines=/full|onlyStart/i.test(i.config.positionTracking),i.trackEndLines=/full/i.test(i.config.positionTracking),(0,lr.isArray)(e)?(s={modes:{}},s.modes[ao.DEFAULT_MODE]=(0,lr.cloneArr)(e),s[ao.DEFAULT_MODE]=ao.DEFAULT_MODE):(o=!1,s=(0,lr.cloneObj)(e))}),i.config.skipValidations===!1&&(i.TRACE_INIT("performRuntimeChecks",function(){i.lexerDefinitionErrors=i.lexerDefinitionErrors.concat((0,ao.performRuntimeChecks)(s,i.trackStartLines,i.config.lineTerminatorCharacters))}),i.TRACE_INIT("performWarningRuntimeChecks",function(){i.lexerDefinitionWarning=i.lexerDefinitionWarning.concat((0,ao.performWarningRuntimeChecks)(s,i.trackStartLines,i.config.lineTerminatorCharacters))})),s.modes=s.modes?s.modes:{},(0,lr.forEach)(s.modes,function(u,g){s.modes[g]=(0,lr.reject)(u,function(f){return(0,lr.isUndefined)(f)})});var a=(0,lr.keys)(s.modes);if((0,lr.forEach)(s.modes,function(u,g){i.TRACE_INIT("Mode: <"+g+"> processing",function(){if(i.modes.push(g),i.config.skipValidations===!1&&i.TRACE_INIT("validatePatterns",function(){i.lexerDefinitionErrors=i.lexerDefinitionErrors.concat((0,ao.validatePatterns)(u,a))}),(0,lr.isEmpty)(i.lexerDefinitionErrors)){(0,mEe.augmentTokenTypes)(u);var f;i.TRACE_INIT("analyzeTokenTypes",function(){f=(0,ao.analyzeTokenTypes)(u,{lineTerminatorCharacters:i.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:i.TRACE_INIT.bind(i)})}),i.patternIdxToConfig[g]=f.patternIdxToConfig,i.charCodeToPatternIdxToConfig[g]=f.charCodeToPatternIdxToConfig,i.emptyGroups=(0,lr.merge)(i.emptyGroups,f.emptyGroups),i.hasCustom=f.hasCustom||i.hasCustom,i.canModeBeOptimized[g]=f.canBeOptimized}})}),i.defaultMode=s.defaultMode,!(0,lr.isEmpty)(i.lexerDefinitionErrors)&&!i.config.deferDefinitionErrorsHandling){var l=(0,lr.map)(i.lexerDefinitionErrors,function(u){return u.message}),c=l.join(`----------------------- -`);throw new Error(`Errors detected in definition of Lexer: -`+c)}(0,lr.forEach)(i.lexerDefinitionWarning,function(u){(0,lr.PRINT_WARNING)(u.message)}),i.TRACE_INIT("Choosing sub-methods implementations",function(){if(ao.SUPPORT_STICKY?(i.chopInput=lr.IDENTITY,i.match=i.matchWithTest):(i.updateLastIndex=lr.NOOP,i.match=i.matchWithExec),o&&(i.handleModes=lr.NOOP),i.trackStartLines===!1&&(i.computeNewColumn=lr.IDENTITY),i.trackEndLines===!1&&(i.updateTokenEndLineColumnLocation=lr.NOOP),/full/i.test(i.config.positionTracking))i.createTokenInstance=i.createFullToken;else if(/onlyStart/i.test(i.config.positionTracking))i.createTokenInstance=i.createStartOnlyToken;else if(/onlyOffset/i.test(i.config.positionTracking))i.createTokenInstance=i.createOffsetOnlyToken;else throw Error('Invalid config option: "'+i.config.positionTracking+'"');i.hasCustom?(i.addToken=i.addTokenUsingPush,i.handlePayload=i.handlePayloadWithCustom):(i.addToken=i.addTokenUsingMemberAccess,i.handlePayload=i.handlePayloadNoCustom)}),i.TRACE_INIT("Failed Optimization Warnings",function(){var u=(0,lr.reduce)(i.canModeBeOptimized,function(g,f,h){return f===!1&&g.push(h),g},[]);if(t.ensureOptimizations&&!(0,lr.isEmpty)(u))throw Error("Lexer Modes: < "+u.join(", ")+` > cannot be optimized. - Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode. - Or inspect the console log for details on how to resolve these issues.`)}),i.TRACE_INIT("clearRegExpParserCache",function(){(0,IEe.clearRegExpParserCache)()}),i.TRACE_INIT("toFastProperties",function(){(0,lr.toFastProperties)(i)})})}return r.prototype.tokenize=function(e,t){if(t===void 0&&(t=this.defaultMode),!(0,lr.isEmpty)(this.lexerDefinitionErrors)){var i=(0,lr.map)(this.lexerDefinitionErrors,function(o){return o.message}),n=i.join(`----------------------- -`);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer: -`+n)}var s=this.tokenizeInternal(e,t);return s},r.prototype.tokenizeInternal=function(e,t){var i=this,n,s,o,a,l,c,u,g,f,h,p,m,y,b,v,x,T=e,q=T.length,Y=0,$=0,_=this.hasCustom?0:Math.floor(e.length/10),ne=new Array(_),ee=[],A=this.trackStartLines?1:void 0,oe=this.trackStartLines?1:void 0,ce=(0,ao.cloneEmptyGroups)(this.emptyGroups),Z=this.trackStartLines,O=this.config.lineTerminatorsPattern,L=0,de=[],Be=[],je=[],re=[];Object.freeze(re);var se=void 0;function be(){return de}function he(Sr){var jn=(0,ao.charCodeToOptimizedIndex)(Sr),fs=Be[jn];return fs===void 0?re:fs}var Fe=function(Sr){if(je.length===1&&Sr.tokenType.PUSH_MODE===void 0){var jn=i.config.errorMessageProvider.buildUnableToPopLexerModeMessage(Sr);ee.push({offset:Sr.startOffset,line:Sr.startLine!==void 0?Sr.startLine:void 0,column:Sr.startColumn!==void 0?Sr.startColumn:void 0,length:Sr.image.length,message:jn})}else{je.pop();var fs=(0,lr.last)(je);de=i.patternIdxToConfig[fs],Be=i.charCodeToPatternIdxToConfig[fs],L=de.length;var ba=i.canModeBeOptimized[fs]&&i.config.safeMode===!1;Be&&ba?se=he:se=be}};function Ke(Sr){je.push(Sr),Be=this.charCodeToPatternIdxToConfig[Sr],de=this.patternIdxToConfig[Sr],L=de.length,L=de.length;var jn=this.canModeBeOptimized[Sr]&&this.config.safeMode===!1;Be&&jn?se=he:se=be}Ke.call(this,t);for(var ke;Yc.length){c=a,u=g,ke=gt;break}}}break}}if(c!==null){if(f=c.length,h=ke.group,h!==void 0&&(p=ke.tokenTypeIdx,m=this.createTokenInstance(c,Y,p,ke.tokenType,A,oe,f),this.handlePayload(m,u),h===!1?$=this.addToken(ne,$,m):ce[h].push(m)),e=this.chopInput(e,f),Y=Y+f,oe=this.computeNewColumn(oe,f),Z===!0&&ke.canLineTerminator===!0){var Mt=0,Ei=void 0,jt=void 0;O.lastIndex=0;do Ei=O.test(c),Ei===!0&&(jt=O.lastIndex-1,Mt++);while(Ei===!0);Mt!==0&&(A=A+Mt,oe=f-jt,this.updateTokenEndLineColumnLocation(m,h,jt,Mt,A,oe,f))}this.handleModes(ke,Fe,Ke,m)}else{for(var Qr=Y,Oi=A,Xs=oe,Un=!1;!Un&&Y <"+e+">");var n=(0,lr.timer)(t),s=n.time,o=n.value,a=s>10?console.warn:console.log;return this.traceInitIndent time: "+s+"ms"),this.traceInitIndent--,o}else return t()},r.SKIPPED="This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.",r.NA=/NOT_APPLICABLE/,r}();kc.Lexer=wEe});var XA=w(Pi=>{"use strict";Object.defineProperty(Pi,"__esModule",{value:!0});Pi.tokenMatcher=Pi.createTokenInstance=Pi.EOF=Pi.createToken=Pi.hasTokenLabel=Pi.tokenName=Pi.tokenLabel=void 0;var Ao=Yt(),BEe=Dp(),DS=mg();function bEe(r){return rj(r)?r.LABEL:r.name}Pi.tokenLabel=bEe;function QEe(r){return r.name}Pi.tokenName=QEe;function rj(r){return(0,Ao.isString)(r.LABEL)&&r.LABEL!==""}Pi.hasTokenLabel=rj;var SEe="parent",ij="categories",nj="label",sj="group",oj="push_mode",aj="pop_mode",Aj="longer_alt",lj="line_breaks",cj="start_chars_hint";function uj(r){return vEe(r)}Pi.createToken=uj;function vEe(r){var e=r.pattern,t={};if(t.name=r.name,(0,Ao.isUndefined)(e)||(t.PATTERN=e),(0,Ao.has)(r,SEe))throw`The parent property is no longer supported. -See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return(0,Ao.has)(r,ij)&&(t.CATEGORIES=r[ij]),(0,DS.augmentTokenTypes)([t]),(0,Ao.has)(r,nj)&&(t.LABEL=r[nj]),(0,Ao.has)(r,sj)&&(t.GROUP=r[sj]),(0,Ao.has)(r,aj)&&(t.POP_MODE=r[aj]),(0,Ao.has)(r,oj)&&(t.PUSH_MODE=r[oj]),(0,Ao.has)(r,Aj)&&(t.LONGER_ALT=r[Aj]),(0,Ao.has)(r,lj)&&(t.LINE_BREAKS=r[lj]),(0,Ao.has)(r,cj)&&(t.START_CHARS_HINT=r[cj]),t}Pi.EOF=uj({name:"EOF",pattern:BEe.Lexer.NA});(0,DS.augmentTokenTypes)([Pi.EOF]);function xEe(r,e,t,i,n,s,o,a){return{image:e,startOffset:t,endOffset:i,startLine:n,endLine:s,startColumn:o,endColumn:a,tokenTypeIdx:r.tokenTypeIdx,tokenType:r}}Pi.createTokenInstance=xEe;function kEe(r,e){return(0,DS.tokenStructuredMatcher)(r,e)}Pi.tokenMatcher=kEe});var bn=w(Vt=>{"use strict";var Ga=Vt&&Vt.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Vt,"__esModule",{value:!0});Vt.serializeProduction=Vt.serializeGrammar=Vt.Terminal=Vt.Alternation=Vt.RepetitionWithSeparator=Vt.Repetition=Vt.RepetitionMandatoryWithSeparator=Vt.RepetitionMandatory=Vt.Option=Vt.Alternative=Vt.Rule=Vt.NonTerminal=Vt.AbstractProduction=void 0;var fr=Yt(),PEe=XA(),Ko=function(){function r(e){this._definition=e}return Object.defineProperty(r.prototype,"definition",{get:function(){return this._definition},set:function(e){this._definition=e},enumerable:!1,configurable:!0}),r.prototype.accept=function(e){e.visit(this),(0,fr.forEach)(this.definition,function(t){t.accept(e)})},r}();Vt.AbstractProduction=Ko;var gj=function(r){Ga(e,r);function e(t){var i=r.call(this,[])||this;return i.idx=1,(0,fr.assign)(i,(0,fr.pick)(t,function(n){return n!==void 0})),i}return Object.defineProperty(e.prototype,"definition",{get:function(){return this.referencedRule!==void 0?this.referencedRule.definition:[]},set:function(t){},enumerable:!1,configurable:!0}),e.prototype.accept=function(t){t.visit(this)},e}(Ko);Vt.NonTerminal=gj;var fj=function(r){Ga(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.orgText="",(0,fr.assign)(i,(0,fr.pick)(t,function(n){return n!==void 0})),i}return e}(Ko);Vt.Rule=fj;var hj=function(r){Ga(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.ignoreAmbiguities=!1,(0,fr.assign)(i,(0,fr.pick)(t,function(n){return n!==void 0})),i}return e}(Ko);Vt.Alternative=hj;var pj=function(r){Ga(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.idx=1,(0,fr.assign)(i,(0,fr.pick)(t,function(n){return n!==void 0})),i}return e}(Ko);Vt.Option=pj;var dj=function(r){Ga(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.idx=1,(0,fr.assign)(i,(0,fr.pick)(t,function(n){return n!==void 0})),i}return e}(Ko);Vt.RepetitionMandatory=dj;var Cj=function(r){Ga(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.idx=1,(0,fr.assign)(i,(0,fr.pick)(t,function(n){return n!==void 0})),i}return e}(Ko);Vt.RepetitionMandatoryWithSeparator=Cj;var mj=function(r){Ga(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.idx=1,(0,fr.assign)(i,(0,fr.pick)(t,function(n){return n!==void 0})),i}return e}(Ko);Vt.Repetition=mj;var Ej=function(r){Ga(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.idx=1,(0,fr.assign)(i,(0,fr.pick)(t,function(n){return n!==void 0})),i}return e}(Ko);Vt.RepetitionWithSeparator=Ej;var Ij=function(r){Ga(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.idx=1,i.ignoreAmbiguities=!1,i.hasPredicates=!1,(0,fr.assign)(i,(0,fr.pick)(t,function(n){return n!==void 0})),i}return Object.defineProperty(e.prototype,"definition",{get:function(){return this._definition},set:function(t){this._definition=t},enumerable:!1,configurable:!0}),e}(Ko);Vt.Alternation=Ij;var GI=function(){function r(e){this.idx=1,(0,fr.assign)(this,(0,fr.pick)(e,function(t){return t!==void 0}))}return r.prototype.accept=function(e){e.visit(this)},r}();Vt.Terminal=GI;function DEe(r){return(0,fr.map)(r,Fp)}Vt.serializeGrammar=DEe;function Fp(r){function e(s){return(0,fr.map)(s,Fp)}if(r instanceof gj){var t={type:"NonTerminal",name:r.nonTerminalName,idx:r.idx};return(0,fr.isString)(r.label)&&(t.label=r.label),t}else{if(r instanceof hj)return{type:"Alternative",definition:e(r.definition)};if(r instanceof pj)return{type:"Option",idx:r.idx,definition:e(r.definition)};if(r instanceof dj)return{type:"RepetitionMandatory",idx:r.idx,definition:e(r.definition)};if(r instanceof Cj)return{type:"RepetitionMandatoryWithSeparator",idx:r.idx,separator:Fp(new GI({terminalType:r.separator})),definition:e(r.definition)};if(r instanceof Ej)return{type:"RepetitionWithSeparator",idx:r.idx,separator:Fp(new GI({terminalType:r.separator})),definition:e(r.definition)};if(r instanceof mj)return{type:"Repetition",idx:r.idx,definition:e(r.definition)};if(r instanceof Ij)return{type:"Alternation",idx:r.idx,definition:e(r.definition)};if(r instanceof GI){var i={type:"Terminal",name:r.terminalType.name,label:(0,PEe.tokenLabel)(r.terminalType),idx:r.idx};(0,fr.isString)(r.label)&&(i.terminalLabel=r.label);var n=r.terminalType.PATTERN;return r.terminalType.PATTERN&&(i.pattern=(0,fr.isRegExp)(n)?n.source:n),i}else{if(r instanceof fj)return{type:"Rule",name:r.name,orgText:r.orgText,definition:e(r.definition)};throw Error("non exhaustive match")}}}Vt.serializeProduction=Fp});var qI=w(YI=>{"use strict";Object.defineProperty(YI,"__esModule",{value:!0});YI.RestWalker=void 0;var RS=Yt(),Qn=bn(),REe=function(){function r(){}return r.prototype.walk=function(e,t){var i=this;t===void 0&&(t=[]),(0,RS.forEach)(e.definition,function(n,s){var o=(0,RS.drop)(e.definition,s+1);if(n instanceof Qn.NonTerminal)i.walkProdRef(n,o,t);else if(n instanceof Qn.Terminal)i.walkTerminal(n,o,t);else if(n instanceof Qn.Alternative)i.walkFlat(n,o,t);else if(n instanceof Qn.Option)i.walkOption(n,o,t);else if(n instanceof Qn.RepetitionMandatory)i.walkAtLeastOne(n,o,t);else if(n instanceof Qn.RepetitionMandatoryWithSeparator)i.walkAtLeastOneSep(n,o,t);else if(n instanceof Qn.RepetitionWithSeparator)i.walkManySep(n,o,t);else if(n instanceof Qn.Repetition)i.walkMany(n,o,t);else if(n instanceof Qn.Alternation)i.walkOr(n,o,t);else throw Error("non exhaustive match")})},r.prototype.walkTerminal=function(e,t,i){},r.prototype.walkProdRef=function(e,t,i){},r.prototype.walkFlat=function(e,t,i){var n=t.concat(i);this.walk(e,n)},r.prototype.walkOption=function(e,t,i){var n=t.concat(i);this.walk(e,n)},r.prototype.walkAtLeastOne=function(e,t,i){var n=[new Qn.Option({definition:e.definition})].concat(t,i);this.walk(e,n)},r.prototype.walkAtLeastOneSep=function(e,t,i){var n=yj(e,t,i);this.walk(e,n)},r.prototype.walkMany=function(e,t,i){var n=[new Qn.Option({definition:e.definition})].concat(t,i);this.walk(e,n)},r.prototype.walkManySep=function(e,t,i){var n=yj(e,t,i);this.walk(e,n)},r.prototype.walkOr=function(e,t,i){var n=this,s=t.concat(i);(0,RS.forEach)(e.definition,function(o){var a=new Qn.Alternative({definition:[o]});n.walk(a,s)})},r}();YI.RestWalker=REe;function yj(r,e,t){var i=[new Qn.Option({definition:[new Qn.Terminal({terminalType:r.separator})].concat(r.definition)})],n=i.concat(e,t);return n}});var Eg=w(JI=>{"use strict";Object.defineProperty(JI,"__esModule",{value:!0});JI.GAstVisitor=void 0;var Uo=bn(),FEe=function(){function r(){}return r.prototype.visit=function(e){var t=e;switch(t.constructor){case Uo.NonTerminal:return this.visitNonTerminal(t);case Uo.Alternative:return this.visitAlternative(t);case Uo.Option:return this.visitOption(t);case Uo.RepetitionMandatory:return this.visitRepetitionMandatory(t);case Uo.RepetitionMandatoryWithSeparator:return this.visitRepetitionMandatoryWithSeparator(t);case Uo.RepetitionWithSeparator:return this.visitRepetitionWithSeparator(t);case Uo.Repetition:return this.visitRepetition(t);case Uo.Alternation:return this.visitAlternation(t);case Uo.Terminal:return this.visitTerminal(t);case Uo.Rule:return this.visitRule(t);default:throw Error("non exhaustive match")}},r.prototype.visitNonTerminal=function(e){},r.prototype.visitAlternative=function(e){},r.prototype.visitOption=function(e){},r.prototype.visitRepetition=function(e){},r.prototype.visitRepetitionMandatory=function(e){},r.prototype.visitRepetitionMandatoryWithSeparator=function(e){},r.prototype.visitRepetitionWithSeparator=function(e){},r.prototype.visitAlternation=function(e){},r.prototype.visitTerminal=function(e){},r.prototype.visitRule=function(e){},r}();JI.GAstVisitor=FEe});var Lp=w(Gi=>{"use strict";var NEe=Gi&&Gi.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Gi,"__esModule",{value:!0});Gi.collectMethods=Gi.DslMethodsCollectorVisitor=Gi.getProductionDslName=Gi.isBranchingProd=Gi.isOptionalProd=Gi.isSequenceProd=void 0;var Np=Yt(),xr=bn(),LEe=Eg();function TEe(r){return r instanceof xr.Alternative||r instanceof xr.Option||r instanceof xr.Repetition||r instanceof xr.RepetitionMandatory||r instanceof xr.RepetitionMandatoryWithSeparator||r instanceof xr.RepetitionWithSeparator||r instanceof xr.Terminal||r instanceof xr.Rule}Gi.isSequenceProd=TEe;function FS(r,e){e===void 0&&(e=[]);var t=r instanceof xr.Option||r instanceof xr.Repetition||r instanceof xr.RepetitionWithSeparator;return t?!0:r instanceof xr.Alternation?(0,Np.some)(r.definition,function(i){return FS(i,e)}):r instanceof xr.NonTerminal&&(0,Np.contains)(e,r)?!1:r instanceof xr.AbstractProduction?(r instanceof xr.NonTerminal&&e.push(r),(0,Np.every)(r.definition,function(i){return FS(i,e)})):!1}Gi.isOptionalProd=FS;function OEe(r){return r instanceof xr.Alternation}Gi.isBranchingProd=OEe;function MEe(r){if(r instanceof xr.NonTerminal)return"SUBRULE";if(r instanceof xr.Option)return"OPTION";if(r instanceof xr.Alternation)return"OR";if(r instanceof xr.RepetitionMandatory)return"AT_LEAST_ONE";if(r instanceof xr.RepetitionMandatoryWithSeparator)return"AT_LEAST_ONE_SEP";if(r instanceof xr.RepetitionWithSeparator)return"MANY_SEP";if(r instanceof xr.Repetition)return"MANY";if(r instanceof xr.Terminal)return"CONSUME";throw Error("non exhaustive match")}Gi.getProductionDslName=MEe;var wj=function(r){NEe(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.separator="-",t.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]},t}return e.prototype.reset=function(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}},e.prototype.visitTerminal=function(t){var i=t.terminalType.name+this.separator+"Terminal";(0,Np.has)(this.dslMethods,i)||(this.dslMethods[i]=[]),this.dslMethods[i].push(t)},e.prototype.visitNonTerminal=function(t){var i=t.nonTerminalName+this.separator+"Terminal";(0,Np.has)(this.dslMethods,i)||(this.dslMethods[i]=[]),this.dslMethods[i].push(t)},e.prototype.visitOption=function(t){this.dslMethods.option.push(t)},e.prototype.visitRepetitionWithSeparator=function(t){this.dslMethods.repetitionWithSeparator.push(t)},e.prototype.visitRepetitionMandatory=function(t){this.dslMethods.repetitionMandatory.push(t)},e.prototype.visitRepetitionMandatoryWithSeparator=function(t){this.dslMethods.repetitionMandatoryWithSeparator.push(t)},e.prototype.visitRepetition=function(t){this.dslMethods.repetition.push(t)},e.prototype.visitAlternation=function(t){this.dslMethods.alternation.push(t)},e}(LEe.GAstVisitor);Gi.DslMethodsCollectorVisitor=wj;var WI=new wj;function KEe(r){WI.reset(),r.accept(WI);var e=WI.dslMethods;return WI.reset(),e}Gi.collectMethods=KEe});var LS=w(Ho=>{"use strict";Object.defineProperty(Ho,"__esModule",{value:!0});Ho.firstForTerminal=Ho.firstForBranching=Ho.firstForSequence=Ho.first=void 0;var zI=Yt(),Bj=bn(),NS=Lp();function _I(r){if(r instanceof Bj.NonTerminal)return _I(r.referencedRule);if(r instanceof Bj.Terminal)return Sj(r);if((0,NS.isSequenceProd)(r))return bj(r);if((0,NS.isBranchingProd)(r))return Qj(r);throw Error("non exhaustive match")}Ho.first=_I;function bj(r){for(var e=[],t=r.definition,i=0,n=t.length>i,s,o=!0;n&&o;)s=t[i],o=(0,NS.isOptionalProd)(s),e=e.concat(_I(s)),i=i+1,n=t.length>i;return(0,zI.uniq)(e)}Ho.firstForSequence=bj;function Qj(r){var e=(0,zI.map)(r.definition,function(t){return _I(t)});return(0,zI.uniq)((0,zI.flatten)(e))}Ho.firstForBranching=Qj;function Sj(r){return[r.terminalType]}Ho.firstForTerminal=Sj});var TS=w(VI=>{"use strict";Object.defineProperty(VI,"__esModule",{value:!0});VI.IN=void 0;VI.IN="_~IN~_"});var Dj=w(vs=>{"use strict";var UEe=vs&&vs.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(vs,"__esModule",{value:!0});vs.buildInProdFollowPrefix=vs.buildBetweenProdsFollowPrefix=vs.computeAllProdsFollows=vs.ResyncFollowsWalker=void 0;var HEe=qI(),jEe=LS(),vj=Yt(),xj=TS(),GEe=bn(),Pj=function(r){UEe(e,r);function e(t){var i=r.call(this)||this;return i.topProd=t,i.follows={},i}return e.prototype.startWalking=function(){return this.walk(this.topProd),this.follows},e.prototype.walkTerminal=function(t,i,n){},e.prototype.walkProdRef=function(t,i,n){var s=kj(t.referencedRule,t.idx)+this.topProd.name,o=i.concat(n),a=new GEe.Alternative({definition:o}),l=(0,jEe.first)(a);this.follows[s]=l},e}(HEe.RestWalker);vs.ResyncFollowsWalker=Pj;function YEe(r){var e={};return(0,vj.forEach)(r,function(t){var i=new Pj(t).startWalking();(0,vj.assign)(e,i)}),e}vs.computeAllProdsFollows=YEe;function kj(r,e){return r.name+e+xj.IN}vs.buildBetweenProdsFollowPrefix=kj;function qEe(r){var e=r.terminalType.name;return e+r.idx+xj.IN}vs.buildInProdFollowPrefix=qEe});var Tp=w(Ya=>{"use strict";Object.defineProperty(Ya,"__esModule",{value:!0});Ya.defaultGrammarValidatorErrorProvider=Ya.defaultGrammarResolverErrorProvider=Ya.defaultParserErrorProvider=void 0;var Ig=XA(),JEe=Yt(),lo=Yt(),OS=bn(),Rj=Lp();Ya.defaultParserErrorProvider={buildMismatchTokenMessage:function(r){var e=r.expected,t=r.actual,i=r.previous,n=r.ruleName,s=(0,Ig.hasTokenLabel)(e),o=s?"--> "+(0,Ig.tokenLabel)(e)+" <--":"token of type --> "+e.name+" <--",a="Expecting "+o+" but found --> '"+t.image+"' <--";return a},buildNotAllInputParsedMessage:function(r){var e=r.firstRedundant,t=r.ruleName;return"Redundant input, expecting EOF but found: "+e.image},buildNoViableAltMessage:function(r){var e=r.expectedPathsPerAlt,t=r.actual,i=r.previous,n=r.customUserDescription,s=r.ruleName,o="Expecting: ",a=(0,lo.first)(t).image,l=` -but found: '`+a+"'";if(n)return o+n+l;var c=(0,lo.reduce)(e,function(h,p){return h.concat(p)},[]),u=(0,lo.map)(c,function(h){return"["+(0,lo.map)(h,function(p){return(0,Ig.tokenLabel)(p)}).join(", ")+"]"}),g=(0,lo.map)(u,function(h,p){return" "+(p+1)+". "+h}),f=`one of these possible Token sequences: -`+g.join(` -`);return o+f+l},buildEarlyExitMessage:function(r){var e=r.expectedIterationPaths,t=r.actual,i=r.customUserDescription,n=r.ruleName,s="Expecting: ",o=(0,lo.first)(t).image,a=` -but found: '`+o+"'";if(i)return s+i+a;var l=(0,lo.map)(e,function(u){return"["+(0,lo.map)(u,function(g){return(0,Ig.tokenLabel)(g)}).join(",")+"]"}),c=`expecting at least one iteration which starts with one of these possible Token sequences:: - `+("<"+l.join(" ,")+">");return s+c+a}};Object.freeze(Ya.defaultParserErrorProvider);Ya.defaultGrammarResolverErrorProvider={buildRuleNotFoundError:function(r,e){var t="Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<- -inside top level rule: ->`+r.name+"<-";return t}};Ya.defaultGrammarValidatorErrorProvider={buildDuplicateFoundError:function(r,e){function t(u){return u instanceof OS.Terminal?u.terminalType.name:u instanceof OS.NonTerminal?u.nonTerminalName:""}var i=r.name,n=(0,lo.first)(e),s=n.idx,o=(0,Rj.getProductionDslName)(n),a=t(n),l=s>0,c="->"+o+(l?s:"")+"<- "+(a?"with argument: ->"+a+"<-":"")+` - appears more than once (`+e.length+" times) in the top level rule: ->"+i+`<-. - For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES - `;return c=c.replace(/[ \t]+/g," "),c=c.replace(/\s\s+/g,` -`),c},buildNamespaceConflictError:function(r){var e=`Namespace conflict found in grammar. -`+("The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <"+r.name+`>. -`)+`To resolve this make sure each Terminal and Non-Terminal names are unique -This is easy to accomplish by using the convention that Terminal names start with an uppercase letter -and Non-Terminal names start with a lower case letter.`;return e},buildAlternationPrefixAmbiguityError:function(r){var e=(0,lo.map)(r.prefixPath,function(n){return(0,Ig.tokenLabel)(n)}).join(", "),t=r.alternation.idx===0?"":r.alternation.idx,i="Ambiguous alternatives: <"+r.ambiguityIndices.join(" ,")+`> due to common lookahead prefix -`+("in inside <"+r.topLevelRule.name+`> Rule, -`)+("<"+e+`> may appears as a prefix path in all these alternatives. -`)+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX -For Further details.`;return i},buildAlternationAmbiguityError:function(r){var e=(0,lo.map)(r.prefixPath,function(n){return(0,Ig.tokenLabel)(n)}).join(", "),t=r.alternation.idx===0?"":r.alternation.idx,i="Ambiguous Alternatives Detected: <"+r.ambiguityIndices.join(" ,")+"> in "+(" inside <"+r.topLevelRule.name+`> Rule, -`)+("<"+e+`> may appears as a prefix path in all these alternatives. -`);return i=i+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES -For Further details.`,i},buildEmptyRepetitionError:function(r){var e=(0,Rj.getProductionDslName)(r.repetition);r.repetition.idx!==0&&(e+=r.repetition.idx);var t="The repetition <"+e+"> within Rule <"+r.topLevelRule.name+`> can never consume any tokens. -This could lead to an infinite loop.`;return t},buildTokenNameError:function(r){return"deprecated"},buildEmptyAlternationError:function(r){var e="Ambiguous empty alternative: <"+(r.emptyChoiceIdx+1)+">"+(" in inside <"+r.topLevelRule.name+`> Rule. -`)+"Only the last alternative may be an empty alternative.";return e},buildTooManyAlternativesError:function(r){var e=`An Alternation cannot have more than 256 alternatives: -`+(" inside <"+r.topLevelRule.name+`> Rule. - has `+(r.alternation.definition.length+1)+" alternatives.");return e},buildLeftRecursionError:function(r){var e=r.topLevelRule.name,t=JEe.map(r.leftRecursionPath,function(s){return s.name}),i=e+" --> "+t.concat([e]).join(" --> "),n=`Left Recursion found in grammar. -`+("rule: <"+e+`> can be invoked from itself (directly or indirectly) -`)+(`without consuming any Tokens. The grammar path that causes this is: - `+i+` -`)+` To fix this refactor your grammar to remove the left recursion. -see: https://en.wikipedia.org/wiki/LL_parser#Left_Factoring.`;return n},buildInvalidRuleNameError:function(r){return"deprecated"},buildDuplicateRuleNameError:function(r){var e;r.topLevelRule instanceof OS.Rule?e=r.topLevelRule.name:e=r.topLevelRule;var t="Duplicate definition, rule: ->"+e+"<- is already defined in the grammar: ->"+r.grammarName+"<-";return t}}});var Lj=w(ZA=>{"use strict";var WEe=ZA&&ZA.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(ZA,"__esModule",{value:!0});ZA.GastRefResolverVisitor=ZA.resolveGrammar=void 0;var zEe=$n(),Fj=Yt(),_Ee=Eg();function VEe(r,e){var t=new Nj(r,e);return t.resolveRefs(),t.errors}ZA.resolveGrammar=VEe;var Nj=function(r){WEe(e,r);function e(t,i){var n=r.call(this)||this;return n.nameToTopRule=t,n.errMsgProvider=i,n.errors=[],n}return e.prototype.resolveRefs=function(){var t=this;(0,Fj.forEach)((0,Fj.values)(this.nameToTopRule),function(i){t.currTopLevel=i,i.accept(t)})},e.prototype.visitNonTerminal=function(t){var i=this.nameToTopRule[t.nonTerminalName];if(i)t.referencedRule=i;else{var n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,t);this.errors.push({message:n,type:zEe.ParserDefinitionErrorType.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:t.nonTerminalName})}},e}(_Ee.GAstVisitor);ZA.GastRefResolverVisitor=Nj});var Mp=w(Kr=>{"use strict";var Pc=Kr&&Kr.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Kr,"__esModule",{value:!0});Kr.nextPossibleTokensAfter=Kr.possiblePathsFrom=Kr.NextTerminalAfterAtLeastOneSepWalker=Kr.NextTerminalAfterAtLeastOneWalker=Kr.NextTerminalAfterManySepWalker=Kr.NextTerminalAfterManyWalker=Kr.AbstractNextTerminalAfterProductionWalker=Kr.NextAfterTokenWalker=Kr.AbstractNextPossibleTokensWalker=void 0;var Tj=qI(),Kt=Yt(),XEe=LS(),Dt=bn(),Oj=function(r){Pc(e,r);function e(t,i){var n=r.call(this)||this;return n.topProd=t,n.path=i,n.possibleTokTypes=[],n.nextProductionName="",n.nextProductionOccurrence=0,n.found=!1,n.isAtEndOfPath=!1,n}return e.prototype.startWalking=function(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=(0,Kt.cloneArr)(this.path.ruleStack).reverse(),this.occurrenceStack=(0,Kt.cloneArr)(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes},e.prototype.walk=function(t,i){i===void 0&&(i=[]),this.found||r.prototype.walk.call(this,t,i)},e.prototype.walkProdRef=function(t,i,n){if(t.referencedRule.name===this.nextProductionName&&t.idx===this.nextProductionOccurrence){var s=i.concat(n);this.updateExpectedNext(),this.walk(t.referencedRule,s)}},e.prototype.updateExpectedNext=function(){(0,Kt.isEmpty)(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())},e}(Tj.RestWalker);Kr.AbstractNextPossibleTokensWalker=Oj;var ZEe=function(r){Pc(e,r);function e(t,i){var n=r.call(this,t,i)||this;return n.path=i,n.nextTerminalName="",n.nextTerminalOccurrence=0,n.nextTerminalName=n.path.lastTok.name,n.nextTerminalOccurrence=n.path.lastTokOccurrence,n}return e.prototype.walkTerminal=function(t,i,n){if(this.isAtEndOfPath&&t.terminalType.name===this.nextTerminalName&&t.idx===this.nextTerminalOccurrence&&!this.found){var s=i.concat(n),o=new Dt.Alternative({definition:s});this.possibleTokTypes=(0,XEe.first)(o),this.found=!0}},e}(Oj);Kr.NextAfterTokenWalker=ZEe;var Op=function(r){Pc(e,r);function e(t,i){var n=r.call(this)||this;return n.topRule=t,n.occurrence=i,n.result={token:void 0,occurrence:void 0,isEndOfRule:void 0},n}return e.prototype.startWalking=function(){return this.walk(this.topRule),this.result},e}(Tj.RestWalker);Kr.AbstractNextTerminalAfterProductionWalker=Op;var $Ee=function(r){Pc(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.walkMany=function(t,i,n){if(t.idx===this.occurrence){var s=(0,Kt.first)(i.concat(n));this.result.isEndOfRule=s===void 0,s instanceof Dt.Terminal&&(this.result.token=s.terminalType,this.result.occurrence=s.idx)}else r.prototype.walkMany.call(this,t,i,n)},e}(Op);Kr.NextTerminalAfterManyWalker=$Ee;var eIe=function(r){Pc(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.walkManySep=function(t,i,n){if(t.idx===this.occurrence){var s=(0,Kt.first)(i.concat(n));this.result.isEndOfRule=s===void 0,s instanceof Dt.Terminal&&(this.result.token=s.terminalType,this.result.occurrence=s.idx)}else r.prototype.walkManySep.call(this,t,i,n)},e}(Op);Kr.NextTerminalAfterManySepWalker=eIe;var tIe=function(r){Pc(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.walkAtLeastOne=function(t,i,n){if(t.idx===this.occurrence){var s=(0,Kt.first)(i.concat(n));this.result.isEndOfRule=s===void 0,s instanceof Dt.Terminal&&(this.result.token=s.terminalType,this.result.occurrence=s.idx)}else r.prototype.walkAtLeastOne.call(this,t,i,n)},e}(Op);Kr.NextTerminalAfterAtLeastOneWalker=tIe;var rIe=function(r){Pc(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.walkAtLeastOneSep=function(t,i,n){if(t.idx===this.occurrence){var s=(0,Kt.first)(i.concat(n));this.result.isEndOfRule=s===void 0,s instanceof Dt.Terminal&&(this.result.token=s.terminalType,this.result.occurrence=s.idx)}else r.prototype.walkAtLeastOneSep.call(this,t,i,n)},e}(Op);Kr.NextTerminalAfterAtLeastOneSepWalker=rIe;function Mj(r,e,t){t===void 0&&(t=[]),t=(0,Kt.cloneArr)(t);var i=[],n=0;function s(c){return c.concat((0,Kt.drop)(r,n+1))}function o(c){var u=Mj(s(c),e,t);return i.concat(u)}for(;t.length=0;ce--){var Z=b.definition[ce],O={idx:p,def:Z.definition.concat((0,Kt.drop)(h)),ruleStack:m,occurrenceStack:y};g.push(O),g.push(o)}else if(b instanceof Dt.Alternative)g.push({idx:p,def:b.definition.concat((0,Kt.drop)(h)),ruleStack:m,occurrenceStack:y});else if(b instanceof Dt.Rule)g.push(iIe(b,p,m,y));else throw Error("non exhaustive match")}}return u}Kr.nextPossibleTokensAfter=nIe;function iIe(r,e,t,i){var n=(0,Kt.cloneArr)(t);n.push(r.name);var s=(0,Kt.cloneArr)(i);return s.push(1),{idx:e,def:r.definition,ruleStack:n,occurrenceStack:s}}});var Kp=w(tr=>{"use strict";var Kj=tr&&tr.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(tr,"__esModule",{value:!0});tr.areTokenCategoriesNotUsed=tr.isStrictPrefixOfPath=tr.containsPath=tr.getLookaheadPathsForOptionalProd=tr.getLookaheadPathsForOr=tr.lookAheadSequenceFromAlternatives=tr.buildSingleAlternativeLookaheadFunction=tr.buildAlternativesLookAheadFunc=tr.buildLookaheadFuncForOptionalProd=tr.buildLookaheadFuncForOr=tr.getProdType=tr.PROD_TYPE=void 0;var cr=Yt(),Uj=Mp(),sIe=qI(),XI=mg(),$A=bn(),oIe=Eg(),ui;(function(r){r[r.OPTION=0]="OPTION",r[r.REPETITION=1]="REPETITION",r[r.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",r[r.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",r[r.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",r[r.ALTERNATION=5]="ALTERNATION"})(ui=tr.PROD_TYPE||(tr.PROD_TYPE={}));function aIe(r){if(r instanceof $A.Option)return ui.OPTION;if(r instanceof $A.Repetition)return ui.REPETITION;if(r instanceof $A.RepetitionMandatory)return ui.REPETITION_MANDATORY;if(r instanceof $A.RepetitionMandatoryWithSeparator)return ui.REPETITION_MANDATORY_WITH_SEPARATOR;if(r instanceof $A.RepetitionWithSeparator)return ui.REPETITION_WITH_SEPARATOR;if(r instanceof $A.Alternation)return ui.ALTERNATION;throw Error("non exhaustive match")}tr.getProdType=aIe;function AIe(r,e,t,i,n,s){var o=Hj(r,e,t),a=MS(o)?XI.tokenStructuredMatcherNoCategories:XI.tokenStructuredMatcher;return s(o,i,a,n)}tr.buildLookaheadFuncForOr=AIe;function lIe(r,e,t,i,n,s){var o=jj(r,e,n,t),a=MS(o)?XI.tokenStructuredMatcherNoCategories:XI.tokenStructuredMatcher;return s(o[0],a,i)}tr.buildLookaheadFuncForOptionalProd=lIe;function cIe(r,e,t,i){var n=r.length,s=(0,cr.every)(r,function(l){return(0,cr.every)(l,function(c){return c.length===1})});if(e)return function(l){for(var c=(0,cr.map)(l,function(x){return x.GATE}),u=0;u{"use strict";var HS=Xt&&Xt.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Xt,"__esModule",{value:!0});Xt.checkPrefixAlternativesAmbiguities=Xt.validateSomeNonEmptyLookaheadPath=Xt.validateTooManyAlts=Xt.RepetionCollector=Xt.validateAmbiguousAlternationAlternatives=Xt.validateEmptyOrAlternative=Xt.getFirstNoneTerminal=Xt.validateNoLeftRecursion=Xt.validateRuleIsOverridden=Xt.validateRuleDoesNotAlreadyExist=Xt.OccurrenceValidationCollector=Xt.identifyProductionForDuplicates=Xt.validateGrammar=void 0;var nr=Yt(),kr=Yt(),jo=$n(),jS=Lp(),yg=Kp(),pIe=Mp(),co=bn(),GS=Eg();function mIe(r,e,t,i,n){var s=nr.map(r,function(h){return dIe(h,i)}),o=nr.map(r,function(h){return YS(h,h,i)}),a=[],l=[],c=[];(0,kr.every)(o,kr.isEmpty)&&(a=(0,kr.map)(r,function(h){return Wj(h,i)}),l=(0,kr.map)(r,function(h){return zj(h,e,i)}),c=Vj(r,e,i));var u=CIe(r,t,i),g=(0,kr.map)(r,function(h){return _j(h,i)}),f=(0,kr.map)(r,function(h){return Jj(h,r,n,i)});return nr.flatten(s.concat(c,o,a,l,u,g,f))}Xt.validateGrammar=mIe;function dIe(r,e){var t=new $j;r.accept(t);var i=t.allProductions,n=nr.groupBy(i,Xj),s=nr.pick(n,function(a){return a.length>1}),o=nr.map(nr.values(s),function(a){var l=nr.first(a),c=e.buildDuplicateFoundError(r,a),u=(0,jS.getProductionDslName)(l),g={message:c,type:jo.ParserDefinitionErrorType.DUPLICATE_PRODUCTIONS,ruleName:r.name,dslName:u,occurrence:l.idx},f=Zj(l);return f&&(g.parameter=f),g});return o}function Xj(r){return(0,jS.getProductionDslName)(r)+"_#_"+r.idx+"_#_"+Zj(r)}Xt.identifyProductionForDuplicates=Xj;function Zj(r){return r instanceof co.Terminal?r.terminalType.name:r instanceof co.NonTerminal?r.nonTerminalName:""}var $j=function(r){HS(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.allProductions=[],t}return e.prototype.visitNonTerminal=function(t){this.allProductions.push(t)},e.prototype.visitOption=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionWithSeparator=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionMandatory=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionMandatoryWithSeparator=function(t){this.allProductions.push(t)},e.prototype.visitRepetition=function(t){this.allProductions.push(t)},e.prototype.visitAlternation=function(t){this.allProductions.push(t)},e.prototype.visitTerminal=function(t){this.allProductions.push(t)},e}(GS.GAstVisitor);Xt.OccurrenceValidationCollector=$j;function Jj(r,e,t,i){var n=[],s=(0,kr.reduce)(e,function(a,l){return l.name===r.name?a+1:a},0);if(s>1){var o=i.buildDuplicateRuleNameError({topLevelRule:r,grammarName:t});n.push({message:o,type:jo.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:r.name})}return n}Xt.validateRuleDoesNotAlreadyExist=Jj;function EIe(r,e,t){var i=[],n;return nr.contains(e,r)||(n="Invalid rule override, rule: ->"+r+"<- cannot be overridden in the grammar: ->"+t+"<-as it is not defined in any of the super grammars ",i.push({message:n,type:jo.ParserDefinitionErrorType.INVALID_RULE_OVERRIDE,ruleName:r})),i}Xt.validateRuleIsOverridden=EIe;function YS(r,e,t,i){i===void 0&&(i=[]);var n=[],s=Up(e.definition);if(nr.isEmpty(s))return[];var o=r.name,a=nr.contains(s,r);a&&n.push({message:t.buildLeftRecursionError({topLevelRule:r,leftRecursionPath:i}),type:jo.ParserDefinitionErrorType.LEFT_RECURSION,ruleName:o});var l=nr.difference(s,i.concat([r])),c=nr.map(l,function(u){var g=nr.cloneArr(i);return g.push(u),YS(r,u,t,g)});return n.concat(nr.flatten(c))}Xt.validateNoLeftRecursion=YS;function Up(r){var e=[];if(nr.isEmpty(r))return e;var t=nr.first(r);if(t instanceof co.NonTerminal)e.push(t.referencedRule);else if(t instanceof co.Alternative||t instanceof co.Option||t instanceof co.RepetitionMandatory||t instanceof co.RepetitionMandatoryWithSeparator||t instanceof co.RepetitionWithSeparator||t instanceof co.Repetition)e=e.concat(Up(t.definition));else if(t instanceof co.Alternation)e=nr.flatten(nr.map(t.definition,function(o){return Up(o.definition)}));else if(!(t instanceof co.Terminal))throw Error("non exhaustive match");var i=(0,jS.isOptionalProd)(t),n=r.length>1;if(i&&n){var s=nr.drop(r);return e.concat(Up(s))}else return e}Xt.getFirstNoneTerminal=Up;var qS=function(r){HS(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.alternations=[],t}return e.prototype.visitAlternation=function(t){this.alternations.push(t)},e}(GS.GAstVisitor);function Wj(r,e){var t=new qS;r.accept(t);var i=t.alternations,n=nr.reduce(i,function(s,o){var a=nr.dropRight(o.definition),l=nr.map(a,function(c,u){var g=(0,pIe.nextPossibleTokensAfter)([c],[],null,1);return nr.isEmpty(g)?{message:e.buildEmptyAlternationError({topLevelRule:r,alternation:o,emptyChoiceIdx:u}),type:jo.ParserDefinitionErrorType.NONE_LAST_EMPTY_ALT,ruleName:r.name,occurrence:o.idx,alternative:u+1}:null});return s.concat(nr.compact(l))},[]);return n}Xt.validateEmptyOrAlternative=Wj;function zj(r,e,t){var i=new qS;r.accept(i);var n=i.alternations;n=(0,kr.reject)(n,function(o){return o.ignoreAmbiguities===!0});var s=nr.reduce(n,function(o,a){var l=a.idx,c=a.maxLookahead||e,u=(0,yg.getLookaheadPathsForOr)(l,r,c,a),g=IIe(u,a,r,t),f=eG(u,a,r,t);return o.concat(g,f)},[]);return s}Xt.validateAmbiguousAlternationAlternatives=zj;var tG=function(r){HS(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.allProductions=[],t}return e.prototype.visitRepetitionWithSeparator=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionMandatory=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionMandatoryWithSeparator=function(t){this.allProductions.push(t)},e.prototype.visitRepetition=function(t){this.allProductions.push(t)},e}(GS.GAstVisitor);Xt.RepetionCollector=tG;function _j(r,e){var t=new qS;r.accept(t);var i=t.alternations,n=nr.reduce(i,function(s,o){return o.definition.length>255&&s.push({message:e.buildTooManyAlternativesError({topLevelRule:r,alternation:o}),type:jo.ParserDefinitionErrorType.TOO_MANY_ALTS,ruleName:r.name,occurrence:o.idx}),s},[]);return n}Xt.validateTooManyAlts=_j;function Vj(r,e,t){var i=[];return(0,kr.forEach)(r,function(n){var s=new tG;n.accept(s);var o=s.allProductions;(0,kr.forEach)(o,function(a){var l=(0,yg.getProdType)(a),c=a.maxLookahead||e,u=a.idx,g=(0,yg.getLookaheadPathsForOptionalProd)(u,n,l,c),f=g[0];if((0,kr.isEmpty)((0,kr.flatten)(f))){var h=t.buildEmptyRepetitionError({topLevelRule:n,repetition:a});i.push({message:h,type:jo.ParserDefinitionErrorType.NO_NON_EMPTY_LOOKAHEAD,ruleName:n.name})}})}),i}Xt.validateSomeNonEmptyLookaheadPath=Vj;function IIe(r,e,t,i){var n=[],s=(0,kr.reduce)(r,function(a,l,c){return e.definition[c].ignoreAmbiguities===!0||(0,kr.forEach)(l,function(u){var g=[c];(0,kr.forEach)(r,function(f,h){c!==h&&(0,yg.containsPath)(f,u)&&e.definition[h].ignoreAmbiguities!==!0&&g.push(h)}),g.length>1&&!(0,yg.containsPath)(n,u)&&(n.push(u),a.push({alts:g,path:u}))}),a},[]),o=nr.map(s,function(a){var l=(0,kr.map)(a.alts,function(u){return u+1}),c=i.buildAlternationAmbiguityError({topLevelRule:t,alternation:e,ambiguityIndices:l,prefixPath:a.path});return{message:c,type:jo.ParserDefinitionErrorType.AMBIGUOUS_ALTS,ruleName:t.name,occurrence:e.idx,alternatives:[a.alts]}});return o}function eG(r,e,t,i){var n=[],s=(0,kr.reduce)(r,function(o,a,l){var c=(0,kr.map)(a,function(u){return{idx:l,path:u}});return o.concat(c)},[]);return(0,kr.forEach)(s,function(o){var a=e.definition[o.idx];if(a.ignoreAmbiguities!==!0){var l=o.idx,c=o.path,u=(0,kr.findAll)(s,function(f){return e.definition[f.idx].ignoreAmbiguities!==!0&&f.idx{"use strict";Object.defineProperty(wg,"__esModule",{value:!0});wg.validateGrammar=wg.resolveGrammar=void 0;var WS=Yt(),yIe=Lj(),wIe=JS(),rG=Tp();function BIe(r){r=(0,WS.defaults)(r,{errMsgProvider:rG.defaultGrammarResolverErrorProvider});var e={};return(0,WS.forEach)(r.rules,function(t){e[t.name]=t}),(0,yIe.resolveGrammar)(e,r.errMsgProvider)}wg.resolveGrammar=BIe;function bIe(r){return r=(0,WS.defaults)(r,{errMsgProvider:rG.defaultGrammarValidatorErrorProvider}),(0,wIe.validateGrammar)(r.rules,r.maxLookahead,r.tokenTypes,r.errMsgProvider,r.grammarName)}wg.validateGrammar=bIe});var Bg=w(Sn=>{"use strict";var Hp=Sn&&Sn.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Sn,"__esModule",{value:!0});Sn.EarlyExitException=Sn.NotAllInputParsedException=Sn.NoViableAltException=Sn.MismatchedTokenException=Sn.isRecognitionException=void 0;var QIe=Yt(),nG="MismatchedTokenException",sG="NoViableAltException",oG="EarlyExitException",aG="NotAllInputParsedException",AG=[nG,sG,oG,aG];Object.freeze(AG);function SIe(r){return(0,QIe.contains)(AG,r.name)}Sn.isRecognitionException=SIe;var ZI=function(r){Hp(e,r);function e(t,i){var n=this.constructor,s=r.call(this,t)||this;return s.token=i,s.resyncedTokens=[],Object.setPrototypeOf(s,n.prototype),Error.captureStackTrace&&Error.captureStackTrace(s,s.constructor),s}return e}(Error),vIe=function(r){Hp(e,r);function e(t,i,n){var s=r.call(this,t,i)||this;return s.previousToken=n,s.name=nG,s}return e}(ZI);Sn.MismatchedTokenException=vIe;var xIe=function(r){Hp(e,r);function e(t,i,n){var s=r.call(this,t,i)||this;return s.previousToken=n,s.name=sG,s}return e}(ZI);Sn.NoViableAltException=xIe;var kIe=function(r){Hp(e,r);function e(t,i){var n=r.call(this,t,i)||this;return n.name=aG,n}return e}(ZI);Sn.NotAllInputParsedException=kIe;var PIe=function(r){Hp(e,r);function e(t,i,n){var s=r.call(this,t,i)||this;return s.previousToken=n,s.name=oG,s}return e}(ZI);Sn.EarlyExitException=PIe});var _S=w(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});Yi.attemptInRepetitionRecovery=Yi.Recoverable=Yi.InRuleRecoveryException=Yi.IN_RULE_RECOVERY_EXCEPTION=Yi.EOF_FOLLOW_KEY=void 0;var $I=XA(),xs=Yt(),DIe=Bg(),RIe=TS(),FIe=$n();Yi.EOF_FOLLOW_KEY={};Yi.IN_RULE_RECOVERY_EXCEPTION="InRuleRecoveryException";function zS(r){this.name=Yi.IN_RULE_RECOVERY_EXCEPTION,this.message=r}Yi.InRuleRecoveryException=zS;zS.prototype=Error.prototype;var NIe=function(){function r(){}return r.prototype.initRecoverable=function(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=(0,xs.has)(e,"recoveryEnabled")?e.recoveryEnabled:FIe.DEFAULT_PARSER_CONFIG.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=lG)},r.prototype.getTokenToInsert=function(e){var t=(0,$I.createTokenInstance)(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t},r.prototype.canTokenTypeBeInsertedInRecovery=function(e){return!0},r.prototype.tryInRepetitionRecovery=function(e,t,i,n){for(var s=this,o=this.findReSyncTokenType(),a=this.exportLexerState(),l=[],c=!1,u=this.LA(1),g=this.LA(1),f=function(){var h=s.LA(0),p=s.errorMessageProvider.buildMismatchTokenMessage({expected:n,actual:u,previous:h,ruleName:s.getCurrRuleFullName()}),m=new DIe.MismatchedTokenException(p,u,s.LA(0));m.resyncedTokens=(0,xs.dropRight)(l),s.SAVE_ERROR(m)};!c;)if(this.tokenMatcher(g,n)){f();return}else if(i.call(this)){f(),e.apply(this,t);return}else this.tokenMatcher(g,o)?c=!0:(g=this.SKIP_TOKEN(),this.addToResyncTokens(g,l));this.importLexerState(a)},r.prototype.shouldInRepetitionRecoveryBeTried=function(e,t,i){return!(i===!1||e===void 0||t===void 0||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t)))},r.prototype.getFollowsForInRuleRecovery=function(e,t){var i=this.getCurrentGrammarPath(e,t),n=this.getNextPossibleTokenTypes(i);return n},r.prototype.tryInRuleRecovery=function(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t)){var i=this.getTokenToInsert(e);return i}if(this.canRecoverWithSingleTokenDeletion(e)){var n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new zS("sad sad panda")},r.prototype.canPerformInRuleRecovery=function(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)},r.prototype.canRecoverWithSingleTokenInsertion=function(e,t){var i=this;if(!this.canTokenTypeBeInsertedInRecovery(e)||(0,xs.isEmpty)(t))return!1;var n=this.LA(1),s=(0,xs.find)(t,function(o){return i.tokenMatcher(n,o)})!==void 0;return s},r.prototype.canRecoverWithSingleTokenDeletion=function(e){var t=this.tokenMatcher(this.LA(2),e);return t},r.prototype.isInCurrentRuleReSyncSet=function(e){var t=this.getCurrFollowKey(),i=this.getFollowSetFromFollowKey(t);return(0,xs.contains)(i,e)},r.prototype.findReSyncTokenType=function(){for(var e=this.flattenFollowSet(),t=this.LA(1),i=2;;){var n=t.tokenType;if((0,xs.contains)(e,n))return n;t=this.LA(i),i++}},r.prototype.getCurrFollowKey=function(){if(this.RULE_STACK.length===1)return Yi.EOF_FOLLOW_KEY;var e=this.getLastExplicitRuleShortName(),t=this.getLastExplicitRuleOccurrenceIndex(),i=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(i)}},r.prototype.buildFullFollowKeyStack=function(){var e=this,t=this.RULE_STACK,i=this.RULE_OCCURRENCE_STACK;return(0,xs.map)(t,function(n,s){return s===0?Yi.EOF_FOLLOW_KEY:{ruleName:e.shortRuleNameToFullName(n),idxInCallingRule:i[s],inRule:e.shortRuleNameToFullName(t[s-1])}})},r.prototype.flattenFollowSet=function(){var e=this,t=(0,xs.map)(this.buildFullFollowKeyStack(),function(i){return e.getFollowSetFromFollowKey(i)});return(0,xs.flatten)(t)},r.prototype.getFollowSetFromFollowKey=function(e){if(e===Yi.EOF_FOLLOW_KEY)return[$I.EOF];var t=e.ruleName+e.idxInCallingRule+RIe.IN+e.inRule;return this.resyncFollows[t]},r.prototype.addToResyncTokens=function(e,t){return this.tokenMatcher(e,$I.EOF)||t.push(e),t},r.prototype.reSyncTo=function(e){for(var t=[],i=this.LA(1);this.tokenMatcher(i,e)===!1;)i=this.SKIP_TOKEN(),this.addToResyncTokens(i,t);return(0,xs.dropRight)(t)},r.prototype.attemptInRepetitionRecovery=function(e,t,i,n,s,o,a){},r.prototype.getCurrentGrammarPath=function(e,t){var i=this.getHumanReadableRuleStack(),n=(0,xs.cloneArr)(this.RULE_OCCURRENCE_STACK),s={ruleStack:i,occurrenceStack:n,lastTok:e,lastTokOccurrence:t};return s},r.prototype.getHumanReadableRuleStack=function(){var e=this;return(0,xs.map)(this.RULE_STACK,function(t){return e.shortRuleNameToFullName(t)})},r}();Yi.Recoverable=NIe;function lG(r,e,t,i,n,s,o){var a=this.getKeyForAutomaticLookahead(i,n),l=this.firstAfterRepMap[a];if(l===void 0){var c=this.getCurrRuleFullName(),u=this.getGAstProductions()[c],g=new s(u,n);l=g.startWalking(),this.firstAfterRepMap[a]=l}var f=l.token,h=l.occurrence,p=l.isEndOfRule;this.RULE_STACK.length===1&&p&&f===void 0&&(f=$I.EOF,h=1),this.shouldInRepetitionRecoveryBeTried(f,h,o)&&this.tryInRepetitionRecovery(r,e,t,f)}Yi.attemptInRepetitionRecovery=lG});var ey=w(Jt=>{"use strict";Object.defineProperty(Jt,"__esModule",{value:!0});Jt.getKeyForAutomaticLookahead=Jt.AT_LEAST_ONE_SEP_IDX=Jt.MANY_SEP_IDX=Jt.AT_LEAST_ONE_IDX=Jt.MANY_IDX=Jt.OPTION_IDX=Jt.OR_IDX=Jt.BITS_FOR_ALT_IDX=Jt.BITS_FOR_RULE_IDX=Jt.BITS_FOR_OCCURRENCE_IDX=Jt.BITS_FOR_METHOD_TYPE=void 0;Jt.BITS_FOR_METHOD_TYPE=4;Jt.BITS_FOR_OCCURRENCE_IDX=8;Jt.BITS_FOR_RULE_IDX=12;Jt.BITS_FOR_ALT_IDX=8;Jt.OR_IDX=1<{"use strict";Object.defineProperty(ty,"__esModule",{value:!0});ty.LooksAhead=void 0;var qa=Kp(),uo=Yt(),cG=$n(),Ja=ey(),Dc=Lp(),TIe=function(){function r(){}return r.prototype.initLooksAhead=function(e){this.dynamicTokensEnabled=(0,uo.has)(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:cG.DEFAULT_PARSER_CONFIG.dynamicTokensEnabled,this.maxLookahead=(0,uo.has)(e,"maxLookahead")?e.maxLookahead:cG.DEFAULT_PARSER_CONFIG.maxLookahead,this.lookAheadFuncsCache=(0,uo.isES2015MapSupported)()?new Map:[],(0,uo.isES2015MapSupported)()?(this.getLaFuncFromCache=this.getLaFuncFromMap,this.setLaFuncCache=this.setLaFuncCacheUsingMap):(this.getLaFuncFromCache=this.getLaFuncFromObj,this.setLaFuncCache=this.setLaFuncUsingObj)},r.prototype.preComputeLookaheadFunctions=function(e){var t=this;(0,uo.forEach)(e,function(i){t.TRACE_INIT(i.name+" Rule Lookahead",function(){var n=(0,Dc.collectMethods)(i),s=n.alternation,o=n.repetition,a=n.option,l=n.repetitionMandatory,c=n.repetitionMandatoryWithSeparator,u=n.repetitionWithSeparator;(0,uo.forEach)(s,function(g){var f=g.idx===0?"":g.idx;t.TRACE_INIT(""+(0,Dc.getProductionDslName)(g)+f,function(){var h=(0,qa.buildLookaheadFuncForOr)(g.idx,i,g.maxLookahead||t.maxLookahead,g.hasPredicates,t.dynamicTokensEnabled,t.lookAheadBuilderForAlternatives),p=(0,Ja.getKeyForAutomaticLookahead)(t.fullRuleNameToShort[i.name],Ja.OR_IDX,g.idx);t.setLaFuncCache(p,h)})}),(0,uo.forEach)(o,function(g){t.computeLookaheadFunc(i,g.idx,Ja.MANY_IDX,qa.PROD_TYPE.REPETITION,g.maxLookahead,(0,Dc.getProductionDslName)(g))}),(0,uo.forEach)(a,function(g){t.computeLookaheadFunc(i,g.idx,Ja.OPTION_IDX,qa.PROD_TYPE.OPTION,g.maxLookahead,(0,Dc.getProductionDslName)(g))}),(0,uo.forEach)(l,function(g){t.computeLookaheadFunc(i,g.idx,Ja.AT_LEAST_ONE_IDX,qa.PROD_TYPE.REPETITION_MANDATORY,g.maxLookahead,(0,Dc.getProductionDslName)(g))}),(0,uo.forEach)(c,function(g){t.computeLookaheadFunc(i,g.idx,Ja.AT_LEAST_ONE_SEP_IDX,qa.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,g.maxLookahead,(0,Dc.getProductionDslName)(g))}),(0,uo.forEach)(u,function(g){t.computeLookaheadFunc(i,g.idx,Ja.MANY_SEP_IDX,qa.PROD_TYPE.REPETITION_WITH_SEPARATOR,g.maxLookahead,(0,Dc.getProductionDslName)(g))})})})},r.prototype.computeLookaheadFunc=function(e,t,i,n,s,o){var a=this;this.TRACE_INIT(""+o+(t===0?"":t),function(){var l=(0,qa.buildLookaheadFuncForOptionalProd)(t,e,s||a.maxLookahead,a.dynamicTokensEnabled,n,a.lookAheadBuilderForOptional),c=(0,Ja.getKeyForAutomaticLookahead)(a.fullRuleNameToShort[e.name],i,t);a.setLaFuncCache(c,l)})},r.prototype.lookAheadBuilderForOptional=function(e,t,i){return(0,qa.buildSingleAlternativeLookaheadFunction)(e,t,i)},r.prototype.lookAheadBuilderForAlternatives=function(e,t,i,n){return(0,qa.buildAlternativesLookAheadFunc)(e,t,i,n)},r.prototype.getKeyForAutomaticLookahead=function(e,t){var i=this.getLastExplicitRuleShortName();return(0,Ja.getKeyForAutomaticLookahead)(i,e,t)},r.prototype.getLaFuncFromCache=function(e){},r.prototype.getLaFuncFromMap=function(e){return this.lookAheadFuncsCache.get(e)},r.prototype.getLaFuncFromObj=function(e){return this.lookAheadFuncsCache[e]},r.prototype.setLaFuncCache=function(e,t){},r.prototype.setLaFuncCacheUsingMap=function(e,t){this.lookAheadFuncsCache.set(e,t)},r.prototype.setLaFuncUsingObj=function(e,t){this.lookAheadFuncsCache[e]=t},r}();ty.LooksAhead=TIe});var gG=w(Go=>{"use strict";Object.defineProperty(Go,"__esModule",{value:!0});Go.addNoneTerminalToCst=Go.addTerminalToCst=Go.setNodeLocationFull=Go.setNodeLocationOnlyOffset=void 0;function OIe(r,e){isNaN(r.startOffset)===!0?(r.startOffset=e.startOffset,r.endOffset=e.endOffset):r.endOffset{"use strict";Object.defineProperty(el,"__esModule",{value:!0});el.defineNameProp=el.functionName=el.classNameFromInstance=void 0;var HIe=Yt();function jIe(r){return fG(r.constructor)}el.classNameFromInstance=jIe;var hG="name";function fG(r){var e=r.name;return e||"anonymous"}el.functionName=fG;function GIe(r,e){var t=Object.getOwnPropertyDescriptor(r,hG);return(0,HIe.isUndefined)(t)||t.configurable?(Object.defineProperty(r,hG,{enumerable:!1,configurable:!0,writable:!1,value:e}),!0):!1}el.defineNameProp=GIe});var EG=w(Di=>{"use strict";Object.defineProperty(Di,"__esModule",{value:!0});Di.validateRedundantMethods=Di.validateMissingCstMethods=Di.validateVisitor=Di.CstVisitorDefinitionError=Di.createBaseVisitorConstructorWithDefaults=Di.createBaseSemanticVisitorConstructor=Di.defaultVisit=void 0;var ks=Yt(),jp=VS();function pG(r,e){for(var t=(0,ks.keys)(r),i=t.length,n=0;n: - `+(""+s.join(` - -`).replace(/\n/g,` - `)))}}};return t.prototype=i,t.prototype.constructor=t,t._RULE_NAMES=e,t}Di.createBaseSemanticVisitorConstructor=YIe;function qIe(r,e,t){var i=function(){};(0,jp.defineNameProp)(i,r+"BaseSemanticsWithDefaults");var n=Object.create(t.prototype);return(0,ks.forEach)(e,function(s){n[s]=pG}),i.prototype=n,i.prototype.constructor=i,i}Di.createBaseVisitorConstructorWithDefaults=qIe;var XS;(function(r){r[r.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",r[r.MISSING_METHOD=1]="MISSING_METHOD"})(XS=Di.CstVisitorDefinitionError||(Di.CstVisitorDefinitionError={}));function dG(r,e){var t=CG(r,e),i=mG(r,e);return t.concat(i)}Di.validateVisitor=dG;function CG(r,e){var t=(0,ks.map)(e,function(i){if(!(0,ks.isFunction)(r[i]))return{msg:"Missing visitor method: <"+i+"> on "+(0,jp.functionName)(r.constructor)+" CST Visitor.",type:XS.MISSING_METHOD,methodName:i}});return(0,ks.compact)(t)}Di.validateMissingCstMethods=CG;var JIe=["constructor","visit","validateVisitor"];function mG(r,e){var t=[];for(var i in r)(0,ks.isFunction)(r[i])&&!(0,ks.contains)(JIe,i)&&!(0,ks.contains)(e,i)&&t.push({msg:"Redundant visitor method: <"+i+"> on "+(0,jp.functionName)(r.constructor)+` CST Visitor -There is no Grammar Rule corresponding to this method's name. -`,type:XS.REDUNDANT_METHOD,methodName:i});return t}Di.validateRedundantMethods=mG});var yG=w(ry=>{"use strict";Object.defineProperty(ry,"__esModule",{value:!0});ry.TreeBuilder=void 0;var bg=gG(),ni=Yt(),IG=EG(),WIe=$n(),zIe=function(){function r(){}return r.prototype.initTreeBuilder=function(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=(0,ni.has)(e,"nodeLocationTracking")?e.nodeLocationTracking:WIe.DEFAULT_PARSER_CONFIG.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=ni.NOOP,this.cstFinallyStateUpdate=ni.NOOP,this.cstPostTerminal=ni.NOOP,this.cstPostNonTerminal=ni.NOOP,this.cstPostRule=ni.NOOP;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=bg.setNodeLocationFull,this.setNodeLocationFromNode=bg.setNodeLocationFull,this.cstPostRule=ni.NOOP,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=ni.NOOP,this.setNodeLocationFromNode=ni.NOOP,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=bg.setNodeLocationOnlyOffset,this.setNodeLocationFromNode=bg.setNodeLocationOnlyOffset,this.cstPostRule=ni.NOOP,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=ni.NOOP,this.setNodeLocationFromNode=ni.NOOP,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=ni.NOOP,this.setNodeLocationFromNode=ni.NOOP,this.cstPostRule=ni.NOOP,this.setInitialNodeLocation=ni.NOOP;else throw Error('Invalid config option: "'+e.nodeLocationTracking+'"')},r.prototype.setInitialNodeLocationOnlyOffsetRecovery=function(e){e.location={startOffset:NaN,endOffset:NaN}},r.prototype.setInitialNodeLocationOnlyOffsetRegular=function(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}},r.prototype.setInitialNodeLocationFullRecovery=function(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}},r.prototype.setInitialNodeLocationFullRegular=function(e){var t=this.LA(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}},r.prototype.cstInvocationStateUpdate=function(e,t){var i={name:e,children:{}};this.setInitialNodeLocation(i),this.CST_STACK.push(i)},r.prototype.cstFinallyStateUpdate=function(){this.CST_STACK.pop()},r.prototype.cstPostRuleFull=function(e){var t=this.LA(0),i=e.location;i.startOffset<=t.startOffset?(i.endOffset=t.endOffset,i.endLine=t.endLine,i.endColumn=t.endColumn):(i.startOffset=NaN,i.startLine=NaN,i.startColumn=NaN)},r.prototype.cstPostRuleOnlyOffset=function(e){var t=this.LA(0),i=e.location;i.startOffset<=t.startOffset?i.endOffset=t.endOffset:i.startOffset=NaN},r.prototype.cstPostTerminal=function(e,t){var i=this.CST_STACK[this.CST_STACK.length-1];(0,bg.addTerminalToCst)(i,t,e),this.setNodeLocationFromToken(i.location,t)},r.prototype.cstPostNonTerminal=function(e,t){var i=this.CST_STACK[this.CST_STACK.length-1];(0,bg.addNoneTerminalToCst)(i,t,e),this.setNodeLocationFromNode(i.location,e.location)},r.prototype.getBaseCstVisitorConstructor=function(){if((0,ni.isUndefined)(this.baseCstVisitorConstructor)){var e=(0,IG.createBaseSemanticVisitorConstructor)(this.className,(0,ni.keys)(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor},r.prototype.getBaseCstVisitorConstructorWithDefaults=function(){if((0,ni.isUndefined)(this.baseCstVisitorWithDefaultsConstructor)){var e=(0,IG.createBaseVisitorConstructorWithDefaults)(this.className,(0,ni.keys)(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor},r.prototype.getLastExplicitRuleShortName=function(){var e=this.RULE_STACK;return e[e.length-1]},r.prototype.getPreviousExplicitRuleShortName=function(){var e=this.RULE_STACK;return e[e.length-2]},r.prototype.getLastExplicitRuleOccurrenceIndex=function(){var e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]},r}();ry.TreeBuilder=zIe});var BG=w(iy=>{"use strict";Object.defineProperty(iy,"__esModule",{value:!0});iy.LexerAdapter=void 0;var wG=$n(),_Ie=function(){function r(){}return r.prototype.initLexerAdapter=function(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1},Object.defineProperty(r.prototype,"input",{get:function(){return this.tokVector},set:function(e){if(this.selfAnalysisDone!==!0)throw Error("Missing invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length},enumerable:!1,configurable:!0}),r.prototype.SKIP_TOKEN=function(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):wG.END_OF_FILE},r.prototype.LA=function(e){var t=this.currIdx+e;return t<0||this.tokVectorLength<=t?wG.END_OF_FILE:this.tokVector[t]},r.prototype.consumeToken=function(){this.currIdx++},r.prototype.exportLexerState=function(){return this.currIdx},r.prototype.importLexerState=function(e){this.currIdx=e},r.prototype.resetLexerState=function(){this.currIdx=-1},r.prototype.moveToTerminatedState=function(){this.currIdx=this.tokVector.length-1},r.prototype.getLexerPosition=function(){return this.exportLexerState()},r}();iy.LexerAdapter=_Ie});var QG=w(ny=>{"use strict";Object.defineProperty(ny,"__esModule",{value:!0});ny.RecognizerApi=void 0;var bG=Yt(),VIe=Bg(),ZS=$n(),XIe=Tp(),ZIe=JS(),$Ie=bn(),eye=function(){function r(){}return r.prototype.ACTION=function(e){return e.call(this)},r.prototype.consume=function(e,t,i){return this.consumeInternal(t,e,i)},r.prototype.subrule=function(e,t,i){return this.subruleInternal(t,e,i)},r.prototype.option=function(e,t){return this.optionInternal(t,e)},r.prototype.or=function(e,t){return this.orInternal(t,e)},r.prototype.many=function(e,t){return this.manyInternal(e,t)},r.prototype.atLeastOne=function(e,t){return this.atLeastOneInternal(e,t)},r.prototype.CONSUME=function(e,t){return this.consumeInternal(e,0,t)},r.prototype.CONSUME1=function(e,t){return this.consumeInternal(e,1,t)},r.prototype.CONSUME2=function(e,t){return this.consumeInternal(e,2,t)},r.prototype.CONSUME3=function(e,t){return this.consumeInternal(e,3,t)},r.prototype.CONSUME4=function(e,t){return this.consumeInternal(e,4,t)},r.prototype.CONSUME5=function(e,t){return this.consumeInternal(e,5,t)},r.prototype.CONSUME6=function(e,t){return this.consumeInternal(e,6,t)},r.prototype.CONSUME7=function(e,t){return this.consumeInternal(e,7,t)},r.prototype.CONSUME8=function(e,t){return this.consumeInternal(e,8,t)},r.prototype.CONSUME9=function(e,t){return this.consumeInternal(e,9,t)},r.prototype.SUBRULE=function(e,t){return this.subruleInternal(e,0,t)},r.prototype.SUBRULE1=function(e,t){return this.subruleInternal(e,1,t)},r.prototype.SUBRULE2=function(e,t){return this.subruleInternal(e,2,t)},r.prototype.SUBRULE3=function(e,t){return this.subruleInternal(e,3,t)},r.prototype.SUBRULE4=function(e,t){return this.subruleInternal(e,4,t)},r.prototype.SUBRULE5=function(e,t){return this.subruleInternal(e,5,t)},r.prototype.SUBRULE6=function(e,t){return this.subruleInternal(e,6,t)},r.prototype.SUBRULE7=function(e,t){return this.subruleInternal(e,7,t)},r.prototype.SUBRULE8=function(e,t){return this.subruleInternal(e,8,t)},r.prototype.SUBRULE9=function(e,t){return this.subruleInternal(e,9,t)},r.prototype.OPTION=function(e){return this.optionInternal(e,0)},r.prototype.OPTION1=function(e){return this.optionInternal(e,1)},r.prototype.OPTION2=function(e){return this.optionInternal(e,2)},r.prototype.OPTION3=function(e){return this.optionInternal(e,3)},r.prototype.OPTION4=function(e){return this.optionInternal(e,4)},r.prototype.OPTION5=function(e){return this.optionInternal(e,5)},r.prototype.OPTION6=function(e){return this.optionInternal(e,6)},r.prototype.OPTION7=function(e){return this.optionInternal(e,7)},r.prototype.OPTION8=function(e){return this.optionInternal(e,8)},r.prototype.OPTION9=function(e){return this.optionInternal(e,9)},r.prototype.OR=function(e){return this.orInternal(e,0)},r.prototype.OR1=function(e){return this.orInternal(e,1)},r.prototype.OR2=function(e){return this.orInternal(e,2)},r.prototype.OR3=function(e){return this.orInternal(e,3)},r.prototype.OR4=function(e){return this.orInternal(e,4)},r.prototype.OR5=function(e){return this.orInternal(e,5)},r.prototype.OR6=function(e){return this.orInternal(e,6)},r.prototype.OR7=function(e){return this.orInternal(e,7)},r.prototype.OR8=function(e){return this.orInternal(e,8)},r.prototype.OR9=function(e){return this.orInternal(e,9)},r.prototype.MANY=function(e){this.manyInternal(0,e)},r.prototype.MANY1=function(e){this.manyInternal(1,e)},r.prototype.MANY2=function(e){this.manyInternal(2,e)},r.prototype.MANY3=function(e){this.manyInternal(3,e)},r.prototype.MANY4=function(e){this.manyInternal(4,e)},r.prototype.MANY5=function(e){this.manyInternal(5,e)},r.prototype.MANY6=function(e){this.manyInternal(6,e)},r.prototype.MANY7=function(e){this.manyInternal(7,e)},r.prototype.MANY8=function(e){this.manyInternal(8,e)},r.prototype.MANY9=function(e){this.manyInternal(9,e)},r.prototype.MANY_SEP=function(e){this.manySepFirstInternal(0,e)},r.prototype.MANY_SEP1=function(e){this.manySepFirstInternal(1,e)},r.prototype.MANY_SEP2=function(e){this.manySepFirstInternal(2,e)},r.prototype.MANY_SEP3=function(e){this.manySepFirstInternal(3,e)},r.prototype.MANY_SEP4=function(e){this.manySepFirstInternal(4,e)},r.prototype.MANY_SEP5=function(e){this.manySepFirstInternal(5,e)},r.prototype.MANY_SEP6=function(e){this.manySepFirstInternal(6,e)},r.prototype.MANY_SEP7=function(e){this.manySepFirstInternal(7,e)},r.prototype.MANY_SEP8=function(e){this.manySepFirstInternal(8,e)},r.prototype.MANY_SEP9=function(e){this.manySepFirstInternal(9,e)},r.prototype.AT_LEAST_ONE=function(e){this.atLeastOneInternal(0,e)},r.prototype.AT_LEAST_ONE1=function(e){return this.atLeastOneInternal(1,e)},r.prototype.AT_LEAST_ONE2=function(e){this.atLeastOneInternal(2,e)},r.prototype.AT_LEAST_ONE3=function(e){this.atLeastOneInternal(3,e)},r.prototype.AT_LEAST_ONE4=function(e){this.atLeastOneInternal(4,e)},r.prototype.AT_LEAST_ONE5=function(e){this.atLeastOneInternal(5,e)},r.prototype.AT_LEAST_ONE6=function(e){this.atLeastOneInternal(6,e)},r.prototype.AT_LEAST_ONE7=function(e){this.atLeastOneInternal(7,e)},r.prototype.AT_LEAST_ONE8=function(e){this.atLeastOneInternal(8,e)},r.prototype.AT_LEAST_ONE9=function(e){this.atLeastOneInternal(9,e)},r.prototype.AT_LEAST_ONE_SEP=function(e){this.atLeastOneSepFirstInternal(0,e)},r.prototype.AT_LEAST_ONE_SEP1=function(e){this.atLeastOneSepFirstInternal(1,e)},r.prototype.AT_LEAST_ONE_SEP2=function(e){this.atLeastOneSepFirstInternal(2,e)},r.prototype.AT_LEAST_ONE_SEP3=function(e){this.atLeastOneSepFirstInternal(3,e)},r.prototype.AT_LEAST_ONE_SEP4=function(e){this.atLeastOneSepFirstInternal(4,e)},r.prototype.AT_LEAST_ONE_SEP5=function(e){this.atLeastOneSepFirstInternal(5,e)},r.prototype.AT_LEAST_ONE_SEP6=function(e){this.atLeastOneSepFirstInternal(6,e)},r.prototype.AT_LEAST_ONE_SEP7=function(e){this.atLeastOneSepFirstInternal(7,e)},r.prototype.AT_LEAST_ONE_SEP8=function(e){this.atLeastOneSepFirstInternal(8,e)},r.prototype.AT_LEAST_ONE_SEP9=function(e){this.atLeastOneSepFirstInternal(9,e)},r.prototype.RULE=function(e,t,i){if(i===void 0&&(i=ZS.DEFAULT_RULE_CONFIG),(0,bG.contains)(this.definedRulesNames,e)){var n=XIe.defaultGrammarValidatorErrorProvider.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),s={message:n,type:ZS.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(s)}this.definedRulesNames.push(e);var o=this.defineRule(e,t,i);return this[e]=o,o},r.prototype.OVERRIDE_RULE=function(e,t,i){i===void 0&&(i=ZS.DEFAULT_RULE_CONFIG);var n=[];n=n.concat((0,ZIe.validateRuleIsOverridden)(e,this.definedRulesNames,this.className)),this.definitionErrors=this.definitionErrors.concat(n);var s=this.defineRule(e,t,i);return this[e]=s,s},r.prototype.BACKTRACK=function(e,t){return function(){this.isBackTrackingStack.push(1);var i=this.saveRecogState();try{return e.apply(this,t),!0}catch(n){if((0,VIe.isRecognitionException)(n))return!1;throw n}finally{this.reloadRecogState(i),this.isBackTrackingStack.pop()}}},r.prototype.getGAstProductions=function(){return this.gastProductionsCache},r.prototype.getSerializedGastProductions=function(){return(0,$Ie.serializeGrammar)((0,bG.values)(this.gastProductionsCache))},r}();ny.RecognizerApi=eye});var kG=w(sy=>{"use strict";Object.defineProperty(sy,"__esModule",{value:!0});sy.RecognizerEngine=void 0;var Fr=Yt(),es=ey(),oy=Bg(),SG=Kp(),Qg=Mp(),vG=$n(),tye=_S(),xG=XA(),Gp=mg(),rye=VS(),iye=function(){function r(){}return r.prototype.initRecognizerEngine=function(e,t){if(this.className=(0,rye.classNameFromInstance)(this),this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=Gp.tokenStructuredMatcherNoCategories,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},(0,Fr.has)(t,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a property. - See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0 - For Further details.`);if((0,Fr.isArray)(e)){if((0,Fr.isEmpty)(e))throw Error(`A Token Vocabulary cannot be empty. - Note that the first argument for the parser constructor - is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument. - See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0 - For Further details.`)}if((0,Fr.isArray)(e))this.tokensMap=(0,Fr.reduce)(e,function(o,a){return o[a.name]=a,o},{});else if((0,Fr.has)(e,"modes")&&(0,Fr.every)((0,Fr.flatten)((0,Fr.values)(e.modes)),Gp.isTokenType)){var i=(0,Fr.flatten)((0,Fr.values)(e.modes)),n=(0,Fr.uniq)(i);this.tokensMap=(0,Fr.reduce)(n,function(o,a){return o[a.name]=a,o},{})}else if((0,Fr.isObject)(e))this.tokensMap=(0,Fr.cloneObj)(e);else throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=xG.EOF;var s=(0,Fr.every)((0,Fr.values)(e),function(o){return(0,Fr.isEmpty)(o.categoryMatches)});this.tokenMatcher=s?Gp.tokenStructuredMatcherNoCategories:Gp.tokenStructuredMatcher,(0,Gp.augmentTokenTypes)((0,Fr.values)(this.tokensMap))},r.prototype.defineRule=function(e,t,i){if(this.selfAnalysisDone)throw Error("Grammar rule <"+e+`> may not be defined after the 'performSelfAnalysis' method has been called' -Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);var n=(0,Fr.has)(i,"resyncEnabled")?i.resyncEnabled:vG.DEFAULT_RULE_CONFIG.resyncEnabled,s=(0,Fr.has)(i,"recoveryValueFunc")?i.recoveryValueFunc:vG.DEFAULT_RULE_CONFIG.recoveryValueFunc,o=this.ruleShortNameIdx<t},r.prototype.orInternal=function(e,t){var i=this.getKeyForAutomaticLookahead(es.OR_IDX,t),n=(0,Fr.isArray)(e)?e:e.DEF,s=this.getLaFuncFromCache(i),o=s.call(this,n);if(o!==void 0){var a=n[o];return a.ALT.call(this)}this.raiseNoAltException(t,e.ERR_MSG)},r.prototype.ruleFinallyStateUpdate=function(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){var e=this.LA(1),t=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new oy.NotAllInputParsedException(t,e))}},r.prototype.subruleInternal=function(e,t,i){var n;try{var s=i!==void 0?i.ARGS:void 0;return n=e.call(this,t,s),this.cstPostNonTerminal(n,i!==void 0&&i.LABEL!==void 0?i.LABEL:e.ruleName),n}catch(o){this.subruleInternalError(o,i,e.ruleName)}},r.prototype.subruleInternalError=function(e,t,i){throw(0,oy.isRecognitionException)(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,t!==void 0&&t.LABEL!==void 0?t.LABEL:i),delete e.partialCstResult),e},r.prototype.consumeInternal=function(e,t,i){var n;try{var s=this.LA(1);this.tokenMatcher(s,e)===!0?(this.consumeToken(),n=s):this.consumeInternalError(e,s,i)}catch(o){n=this.consumeInternalRecovery(e,t,o)}return this.cstPostTerminal(i!==void 0&&i.LABEL!==void 0?i.LABEL:e.name,n),n},r.prototype.consumeInternalError=function(e,t,i){var n,s=this.LA(0);throw i!==void 0&&i.ERR_MSG?n=i.ERR_MSG:n=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:s,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new oy.MismatchedTokenException(n,t,s))},r.prototype.consumeInternalRecovery=function(e,t,i){if(this.recoveryEnabled&&i.name==="MismatchedTokenException"&&!this.isBackTracking()){var n=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,n)}catch(s){throw s.name===tye.IN_RULE_RECOVERY_EXCEPTION?i:s}}else throw i},r.prototype.saveRecogState=function(){var e=this.errors,t=(0,Fr.cloneArr)(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK}},r.prototype.reloadRecogState=function(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK},r.prototype.ruleInvocationStateUpdate=function(e,t,i){this.RULE_OCCURRENCE_STACK.push(i),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(t,e)},r.prototype.isBackTracking=function(){return this.isBackTrackingStack.length!==0},r.prototype.getCurrRuleFullName=function(){var e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]},r.prototype.shortRuleNameToFullName=function(e){return this.shortRuleNameToFull[e]},r.prototype.isAtEndOfInput=function(){return this.tokenMatcher(this.LA(1),xG.EOF)},r.prototype.reset=function(){this.resetLexerState(),this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]},r}();sy.RecognizerEngine=iye});var DG=w(ay=>{"use strict";Object.defineProperty(ay,"__esModule",{value:!0});ay.ErrorHandler=void 0;var $S=Bg(),ev=Yt(),PG=Kp(),nye=$n(),sye=function(){function r(){}return r.prototype.initErrorHandler=function(e){this._errors=[],this.errorMessageProvider=(0,ev.has)(e,"errorMessageProvider")?e.errorMessageProvider:nye.DEFAULT_PARSER_CONFIG.errorMessageProvider},r.prototype.SAVE_ERROR=function(e){if((0,$S.isRecognitionException)(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:(0,ev.cloneArr)(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")},Object.defineProperty(r.prototype,"errors",{get:function(){return(0,ev.cloneArr)(this._errors)},set:function(e){this._errors=e},enumerable:!1,configurable:!0}),r.prototype.raiseEarlyExitException=function(e,t,i){for(var n=this.getCurrRuleFullName(),s=this.getGAstProductions()[n],o=(0,PG.getLookaheadPathsForOptionalProd)(e,s,t,this.maxLookahead),a=o[0],l=[],c=1;c<=this.maxLookahead;c++)l.push(this.LA(c));var u=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:a,actual:l,previous:this.LA(0),customUserDescription:i,ruleName:n});throw this.SAVE_ERROR(new $S.EarlyExitException(u,this.LA(1),this.LA(0)))},r.prototype.raiseNoAltException=function(e,t){for(var i=this.getCurrRuleFullName(),n=this.getGAstProductions()[i],s=(0,PG.getLookaheadPathsForOr)(e,n,this.maxLookahead),o=[],a=1;a<=this.maxLookahead;a++)o.push(this.LA(a));var l=this.LA(0),c=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:s,actual:o,previous:l,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new $S.NoViableAltException(c,this.LA(1),l))},r}();ay.ErrorHandler=sye});var NG=w(Ay=>{"use strict";Object.defineProperty(Ay,"__esModule",{value:!0});Ay.ContentAssist=void 0;var RG=Mp(),FG=Yt(),oye=function(){function r(){}return r.prototype.initContentAssist=function(){},r.prototype.computeContentAssist=function(e,t){var i=this.gastProductionsCache[e];if((0,FG.isUndefined)(i))throw Error("Rule ->"+e+"<- does not exist in this grammar.");return(0,RG.nextPossibleTokensAfter)([i],t,this.tokenMatcher,this.maxLookahead)},r.prototype.getNextPossibleTokenTypes=function(e){var t=(0,FG.first)(e.ruleStack),i=this.getGAstProductions(),n=i[t],s=new RG.NextAfterTokenWalker(n,e).startWalking();return s},r}();Ay.ContentAssist=oye});var jG=w(ly=>{"use strict";Object.defineProperty(ly,"__esModule",{value:!0});ly.GastRecorder=void 0;var vn=Yt(),Yo=bn(),aye=Dp(),LG=mg(),TG=XA(),Aye=$n(),lye=ey(),cy={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(cy);var OG=!0,MG=Math.pow(2,lye.BITS_FOR_OCCURRENCE_IDX)-1,KG=(0,TG.createToken)({name:"RECORDING_PHASE_TOKEN",pattern:aye.Lexer.NA});(0,LG.augmentTokenTypes)([KG]);var UG=(0,TG.createTokenInstance)(KG,`This IToken indicates the Parser is in Recording Phase - See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(UG);var cye={name:`This CSTNode indicates the Parser is in Recording Phase - See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},gye=function(){function r(){}return r.prototype.initGastRecorder=function(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1},r.prototype.enableRecording=function(){var e=this;this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",function(){for(var t=function(n){var s=n>0?n:"";e["CONSUME"+s]=function(o,a){return this.consumeInternalRecord(o,n,a)},e["SUBRULE"+s]=function(o,a){return this.subruleInternalRecord(o,n,a)},e["OPTION"+s]=function(o){return this.optionInternalRecord(o,n)},e["OR"+s]=function(o){return this.orInternalRecord(o,n)},e["MANY"+s]=function(o){this.manyInternalRecord(n,o)},e["MANY_SEP"+s]=function(o){this.manySepFirstInternalRecord(n,o)},e["AT_LEAST_ONE"+s]=function(o){this.atLeastOneInternalRecord(n,o)},e["AT_LEAST_ONE_SEP"+s]=function(o){this.atLeastOneSepFirstInternalRecord(n,o)}},i=0;i<10;i++)t(i);e.consume=function(n,s,o){return this.consumeInternalRecord(s,n,o)},e.subrule=function(n,s,o){return this.subruleInternalRecord(s,n,o)},e.option=function(n,s){return this.optionInternalRecord(s,n)},e.or=function(n,s){return this.orInternalRecord(s,n)},e.many=function(n,s){this.manyInternalRecord(n,s)},e.atLeastOne=function(n,s){this.atLeastOneInternalRecord(n,s)},e.ACTION=e.ACTION_RECORD,e.BACKTRACK=e.BACKTRACK_RECORD,e.LA=e.LA_RECORD})},r.prototype.disableRecording=function(){var e=this;this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",function(){for(var t=0;t<10;t++){var i=t>0?t:"";delete e["CONSUME"+i],delete e["SUBRULE"+i],delete e["OPTION"+i],delete e["OR"+i],delete e["MANY"+i],delete e["MANY_SEP"+i],delete e["AT_LEAST_ONE"+i],delete e["AT_LEAST_ONE_SEP"+i]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})},r.prototype.ACTION_RECORD=function(e){},r.prototype.BACKTRACK_RECORD=function(e,t){return function(){return!0}},r.prototype.LA_RECORD=function(e){return Aye.END_OF_FILE},r.prototype.topLevelRuleRecord=function(e,t){try{var i=new Yo.Rule({definition:[],name:e});return i.name=e,this.recordingProdStack.push(i),t.call(this),this.recordingProdStack.pop(),i}catch(n){if(n.KNOWN_RECORDER_ERROR!==!0)try{n.message=n.message+` - This error was thrown during the "grammar recording phase" For more info see: - https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch(s){throw n}throw n}},r.prototype.optionInternalRecord=function(e,t){return Yp.call(this,Yo.Option,e,t)},r.prototype.atLeastOneInternalRecord=function(e,t){Yp.call(this,Yo.RepetitionMandatory,t,e)},r.prototype.atLeastOneSepFirstInternalRecord=function(e,t){Yp.call(this,Yo.RepetitionMandatoryWithSeparator,t,e,OG)},r.prototype.manyInternalRecord=function(e,t){Yp.call(this,Yo.Repetition,t,e)},r.prototype.manySepFirstInternalRecord=function(e,t){Yp.call(this,Yo.RepetitionWithSeparator,t,e,OG)},r.prototype.orInternalRecord=function(e,t){return uye.call(this,e,t)},r.prototype.subruleInternalRecord=function(e,t,i){if(uy(t),!e||(0,vn.has)(e,"ruleName")===!1){var n=new Error(" argument is invalid"+(" expecting a Parser method reference but got: <"+JSON.stringify(e)+">")+(` - inside top level rule: <`+this.recordingProdStack[0].name+">"));throw n.KNOWN_RECORDER_ERROR=!0,n}var s=(0,vn.peek)(this.recordingProdStack),o=e.ruleName,a=new Yo.NonTerminal({idx:t,nonTerminalName:o,label:i==null?void 0:i.LABEL,referencedRule:void 0});return s.definition.push(a),this.outputCst?cye:cy},r.prototype.consumeInternalRecord=function(e,t,i){if(uy(t),!(0,LG.hasShortKeyProperty)(e)){var n=new Error(" argument is invalid"+(" expecting a TokenType reference but got: <"+JSON.stringify(e)+">")+(` - inside top level rule: <`+this.recordingProdStack[0].name+">"));throw n.KNOWN_RECORDER_ERROR=!0,n}var s=(0,vn.peek)(this.recordingProdStack),o=new Yo.Terminal({idx:t,terminalType:e,label:i==null?void 0:i.LABEL});return s.definition.push(o),UG},r}();ly.GastRecorder=gye;function Yp(r,e,t,i){i===void 0&&(i=!1),uy(t);var n=(0,vn.peek)(this.recordingProdStack),s=(0,vn.isFunction)(e)?e:e.DEF,o=new r({definition:[],idx:t});return i&&(o.separator=e.SEP),(0,vn.has)(e,"MAX_LOOKAHEAD")&&(o.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(o),s.call(this),n.definition.push(o),this.recordingProdStack.pop(),cy}function uye(r,e){var t=this;uy(e);var i=(0,vn.peek)(this.recordingProdStack),n=(0,vn.isArray)(r)===!1,s=n===!1?r:r.DEF,o=new Yo.Alternation({definition:[],idx:e,ignoreAmbiguities:n&&r.IGNORE_AMBIGUITIES===!0});(0,vn.has)(r,"MAX_LOOKAHEAD")&&(o.maxLookahead=r.MAX_LOOKAHEAD);var a=(0,vn.some)(s,function(l){return(0,vn.isFunction)(l.GATE)});return o.hasPredicates=a,i.definition.push(o),(0,vn.forEach)(s,function(l){var c=new Yo.Alternative({definition:[]});o.definition.push(c),(0,vn.has)(l,"IGNORE_AMBIGUITIES")?c.ignoreAmbiguities=l.IGNORE_AMBIGUITIES:(0,vn.has)(l,"GATE")&&(c.ignoreAmbiguities=!0),t.recordingProdStack.push(c),l.ALT.call(t),t.recordingProdStack.pop()}),cy}function HG(r){return r===0?"":""+r}function uy(r){if(r<0||r>MG){var e=new Error("Invalid DSL Method idx value: <"+r+`> - `+("Idx value must be a none negative value smaller than "+(MG+1)));throw e.KNOWN_RECORDER_ERROR=!0,e}}});var YG=w(gy=>{"use strict";Object.defineProperty(gy,"__esModule",{value:!0});gy.PerformanceTracer=void 0;var GG=Yt(),fye=$n(),hye=function(){function r(){}return r.prototype.initPerformanceTracer=function(e){if((0,GG.has)(e,"traceInitPerf")){var t=e.traceInitPerf,i=typeof t=="number";this.traceInitMaxIdent=i?t:Infinity,this.traceInitPerf=i?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=fye.DEFAULT_PARSER_CONFIG.traceInitPerf;this.traceInitIndent=-1},r.prototype.TRACE_INIT=function(e,t){if(this.traceInitPerf===!0){this.traceInitIndent++;var i=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <"+e+">");var n=(0,GG.timer)(t),s=n.time,o=n.value,a=s>10?console.warn:console.log;return this.traceInitIndent time: "+s+"ms"),this.traceInitIndent--,o}else return t()},r}();gy.PerformanceTracer=hye});var qG=w(fy=>{"use strict";Object.defineProperty(fy,"__esModule",{value:!0});fy.applyMixins=void 0;function pye(r,e){e.forEach(function(t){var i=t.prototype;Object.getOwnPropertyNames(i).forEach(function(n){if(n!=="constructor"){var s=Object.getOwnPropertyDescriptor(i,n);s&&(s.get||s.set)?Object.defineProperty(r.prototype,n,s):r.prototype[n]=t.prototype[n]}})})}fy.applyMixins=pye});var $n=w(Er=>{"use strict";var JG=Er&&Er.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Er,"__esModule",{value:!0});Er.EmbeddedActionsParser=Er.CstParser=Er.Parser=Er.EMPTY_ALT=Er.ParserDefinitionErrorType=Er.DEFAULT_RULE_CONFIG=Er.DEFAULT_PARSER_CONFIG=Er.END_OF_FILE=void 0;var an=Yt(),dye=Dj(),WG=XA(),zG=Tp(),_G=iG(),Cye=_S(),mye=uG(),Eye=yG(),Iye=BG(),yye=QG(),wye=kG(),Bye=DG(),bye=NG(),Qye=jG(),Sye=YG(),vye=qG();Er.END_OF_FILE=(0,WG.createTokenInstance)(WG.EOF,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(Er.END_OF_FILE);Er.DEFAULT_PARSER_CONFIG=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:zG.defaultParserErrorProvider,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1});Er.DEFAULT_RULE_CONFIG=Object.freeze({recoveryValueFunc:function(){},resyncEnabled:!0});var xye;(function(r){r[r.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",r[r.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",r[r.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",r[r.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",r[r.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",r[r.LEFT_RECURSION=5]="LEFT_RECURSION",r[r.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",r[r.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",r[r.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",r[r.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",r[r.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",r[r.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",r[r.TOO_MANY_ALTS=12]="TOO_MANY_ALTS"})(xye=Er.ParserDefinitionErrorType||(Er.ParserDefinitionErrorType={}));function kye(r){return r===void 0&&(r=void 0),function(){return r}}Er.EMPTY_ALT=kye;var hy=function(){function r(e,t){this.definitionErrors=[],this.selfAnalysisDone=!1;var i=this;if(i.initErrorHandler(t),i.initLexerAdapter(),i.initLooksAhead(t),i.initRecognizerEngine(e,t),i.initRecoverable(t),i.initTreeBuilder(t),i.initContentAssist(),i.initGastRecorder(t),i.initPerformanceTracer(t),(0,an.has)(t,"ignoredIssues"))throw new Error(`The IParserConfig property has been deprecated. - Please use the flag on the relevant DSL method instead. - See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES - For further details.`);this.skipValidations=(0,an.has)(t,"skipValidations")?t.skipValidations:Er.DEFAULT_PARSER_CONFIG.skipValidations}return r.performSelfAnalysis=function(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")},r.prototype.performSelfAnalysis=function(){var e=this;this.TRACE_INIT("performSelfAnalysis",function(){var t;e.selfAnalysisDone=!0;var i=e.className;e.TRACE_INIT("toFastProps",function(){(0,an.toFastProperties)(e)}),e.TRACE_INIT("Grammar Recording",function(){try{e.enableRecording(),(0,an.forEach)(e.definedRulesNames,function(s){var o=e[s],a=o.originalGrammarAction,l=void 0;e.TRACE_INIT(s+" Rule",function(){l=e.topLevelRuleRecord(s,a)}),e.gastProductionsCache[s]=l})}finally{e.disableRecording()}});var n=[];if(e.TRACE_INIT("Grammar Resolving",function(){n=(0,_G.resolveGrammar)({rules:(0,an.values)(e.gastProductionsCache)}),e.definitionErrors=e.definitionErrors.concat(n)}),e.TRACE_INIT("Grammar Validations",function(){if((0,an.isEmpty)(n)&&e.skipValidations===!1){var s=(0,_G.validateGrammar)({rules:(0,an.values)(e.gastProductionsCache),maxLookahead:e.maxLookahead,tokenTypes:(0,an.values)(e.tokensMap),errMsgProvider:zG.defaultGrammarValidatorErrorProvider,grammarName:i});e.definitionErrors=e.definitionErrors.concat(s)}}),(0,an.isEmpty)(e.definitionErrors)&&(e.recoveryEnabled&&e.TRACE_INIT("computeAllProdsFollows",function(){var s=(0,dye.computeAllProdsFollows)((0,an.values)(e.gastProductionsCache));e.resyncFollows=s}),e.TRACE_INIT("ComputeLookaheadFunctions",function(){e.preComputeLookaheadFunctions((0,an.values)(e.gastProductionsCache))})),!r.DEFER_DEFINITION_ERRORS_HANDLING&&!(0,an.isEmpty)(e.definitionErrors))throw t=(0,an.map)(e.definitionErrors,function(s){return s.message}),new Error(`Parser Definition Errors detected: - `+t.join(` -------------------------------- -`))})},r.DEFER_DEFINITION_ERRORS_HANDLING=!1,r}();Er.Parser=hy;(0,vye.applyMixins)(hy,[Cye.Recoverable,mye.LooksAhead,Eye.TreeBuilder,Iye.LexerAdapter,wye.RecognizerEngine,yye.RecognizerApi,Bye.ErrorHandler,bye.ContentAssist,Qye.GastRecorder,Sye.PerformanceTracer]);var Pye=function(r){JG(e,r);function e(t,i){i===void 0&&(i=Er.DEFAULT_PARSER_CONFIG);var n=this,s=(0,an.cloneObj)(i);return s.outputCst=!0,n=r.call(this,t,s)||this,n}return e}(hy);Er.CstParser=Pye;var Dye=function(r){JG(e,r);function e(t,i){i===void 0&&(i=Er.DEFAULT_PARSER_CONFIG);var n=this,s=(0,an.cloneObj)(i);return s.outputCst=!1,n=r.call(this,t,s)||this,n}return e}(hy);Er.EmbeddedActionsParser=Dye});var XG=w(py=>{"use strict";Object.defineProperty(py,"__esModule",{value:!0});py.createSyntaxDiagramsCode=void 0;var VG=IS();function Rye(r,e){var t=e===void 0?{}:e,i=t.resourceBase,n=i===void 0?"https://unpkg.com/chevrotain@"+VG.VERSION+"/diagrams/":i,s=t.css,o=s===void 0?"https://unpkg.com/chevrotain@"+VG.VERSION+"/diagrams/diagrams.css":s,a=` - - - - - -`,l=` - -`,c=` - - - - -`,u=` -
-`,g=` - -`,f=` - -`;return a+l+c+u+g+f}py.createSyntaxDiagramsCode=Rye});var eY=w(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.Parser=Ve.createSyntaxDiagramsCode=Ve.clearCache=Ve.GAstVisitor=Ve.serializeProduction=Ve.serializeGrammar=Ve.Terminal=Ve.Rule=Ve.RepetitionWithSeparator=Ve.RepetitionMandatoryWithSeparator=Ve.RepetitionMandatory=Ve.Repetition=Ve.Option=Ve.NonTerminal=Ve.Alternative=Ve.Alternation=Ve.defaultLexerErrorProvider=Ve.NoViableAltException=Ve.NotAllInputParsedException=Ve.MismatchedTokenException=Ve.isRecognitionException=Ve.EarlyExitException=Ve.defaultParserErrorProvider=Ve.tokenName=Ve.tokenMatcher=Ve.tokenLabel=Ve.EOF=Ve.createTokenInstance=Ve.createToken=Ve.LexerDefinitionErrorType=Ve.Lexer=Ve.EMPTY_ALT=Ve.ParserDefinitionErrorType=Ve.EmbeddedActionsParser=Ve.CstParser=Ve.VERSION=void 0;var Fye=IS();Object.defineProperty(Ve,"VERSION",{enumerable:!0,get:function(){return Fye.VERSION}});var dy=$n();Object.defineProperty(Ve,"CstParser",{enumerable:!0,get:function(){return dy.CstParser}});Object.defineProperty(Ve,"EmbeddedActionsParser",{enumerable:!0,get:function(){return dy.EmbeddedActionsParser}});Object.defineProperty(Ve,"ParserDefinitionErrorType",{enumerable:!0,get:function(){return dy.ParserDefinitionErrorType}});Object.defineProperty(Ve,"EMPTY_ALT",{enumerable:!0,get:function(){return dy.EMPTY_ALT}});var ZG=Dp();Object.defineProperty(Ve,"Lexer",{enumerable:!0,get:function(){return ZG.Lexer}});Object.defineProperty(Ve,"LexerDefinitionErrorType",{enumerable:!0,get:function(){return ZG.LexerDefinitionErrorType}});var Sg=XA();Object.defineProperty(Ve,"createToken",{enumerable:!0,get:function(){return Sg.createToken}});Object.defineProperty(Ve,"createTokenInstance",{enumerable:!0,get:function(){return Sg.createTokenInstance}});Object.defineProperty(Ve,"EOF",{enumerable:!0,get:function(){return Sg.EOF}});Object.defineProperty(Ve,"tokenLabel",{enumerable:!0,get:function(){return Sg.tokenLabel}});Object.defineProperty(Ve,"tokenMatcher",{enumerable:!0,get:function(){return Sg.tokenMatcher}});Object.defineProperty(Ve,"tokenName",{enumerable:!0,get:function(){return Sg.tokenName}});var Nye=Tp();Object.defineProperty(Ve,"defaultParserErrorProvider",{enumerable:!0,get:function(){return Nye.defaultParserErrorProvider}});var qp=Bg();Object.defineProperty(Ve,"EarlyExitException",{enumerable:!0,get:function(){return qp.EarlyExitException}});Object.defineProperty(Ve,"isRecognitionException",{enumerable:!0,get:function(){return qp.isRecognitionException}});Object.defineProperty(Ve,"MismatchedTokenException",{enumerable:!0,get:function(){return qp.MismatchedTokenException}});Object.defineProperty(Ve,"NotAllInputParsedException",{enumerable:!0,get:function(){return qp.NotAllInputParsedException}});Object.defineProperty(Ve,"NoViableAltException",{enumerable:!0,get:function(){return qp.NoViableAltException}});var Lye=PS();Object.defineProperty(Ve,"defaultLexerErrorProvider",{enumerable:!0,get:function(){return Lye.defaultLexerErrorProvider}});var qo=bn();Object.defineProperty(Ve,"Alternation",{enumerable:!0,get:function(){return qo.Alternation}});Object.defineProperty(Ve,"Alternative",{enumerable:!0,get:function(){return qo.Alternative}});Object.defineProperty(Ve,"NonTerminal",{enumerable:!0,get:function(){return qo.NonTerminal}});Object.defineProperty(Ve,"Option",{enumerable:!0,get:function(){return qo.Option}});Object.defineProperty(Ve,"Repetition",{enumerable:!0,get:function(){return qo.Repetition}});Object.defineProperty(Ve,"RepetitionMandatory",{enumerable:!0,get:function(){return qo.RepetitionMandatory}});Object.defineProperty(Ve,"RepetitionMandatoryWithSeparator",{enumerable:!0,get:function(){return qo.RepetitionMandatoryWithSeparator}});Object.defineProperty(Ve,"RepetitionWithSeparator",{enumerable:!0,get:function(){return qo.RepetitionWithSeparator}});Object.defineProperty(Ve,"Rule",{enumerable:!0,get:function(){return qo.Rule}});Object.defineProperty(Ve,"Terminal",{enumerable:!0,get:function(){return qo.Terminal}});var $G=bn();Object.defineProperty(Ve,"serializeGrammar",{enumerable:!0,get:function(){return $G.serializeGrammar}});Object.defineProperty(Ve,"serializeProduction",{enumerable:!0,get:function(){return $G.serializeProduction}});var Tye=Eg();Object.defineProperty(Ve,"GAstVisitor",{enumerable:!0,get:function(){return Tye.GAstVisitor}});function Oye(){console.warn(`The clearCache function was 'soft' removed from the Chevrotain API. - It performs no action other than printing this message. - Please avoid using it as it will be completely removed in the future`)}Ve.clearCache=Oye;var Mye=XG();Object.defineProperty(Ve,"createSyntaxDiagramsCode",{enumerable:!0,get:function(){return Mye.createSyntaxDiagramsCode}});var Kye=function(){function r(){throw new Error(`The Parser class has been deprecated, use CstParser or EmbeddedActionsParser instead. -See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_7-0-0`)}return r}();Ve.Parser=Kye});var iY=w((Z$e,tY)=>{var Cy=eY(),Wa=Cy.createToken,rY=Cy.tokenMatcher,tv=Cy.Lexer,Uye=Cy.EmbeddedActionsParser;tY.exports=r=>{let e=Wa({name:"LogicalOperator",pattern:tv.NA}),t=Wa({name:"Or",pattern:/\|/,categories:e}),i=Wa({name:"Xor",pattern:/\^/,categories:e}),n=Wa({name:"And",pattern:/&/,categories:e}),s=Wa({name:"Not",pattern:/!/}),o=Wa({name:"LParen",pattern:/\(/}),a=Wa({name:"RParen",pattern:/\)/}),l=Wa({name:"Query",pattern:r}),u=[Wa({name:"WhiteSpace",pattern:/\s+/,group:tv.SKIPPED}),t,i,n,o,a,s,e,l],g=new tv(u);class f extends Uye{constructor(p){super(u);this.RULE("expression",()=>this.SUBRULE(this.logicalExpression)),this.RULE("logicalExpression",()=>{let y=this.SUBRULE(this.atomicExpression);return this.MANY(()=>{let b=y,v=this.CONSUME(e),x=this.SUBRULE2(this.atomicExpression);rY(v,t)?y=T=>b(T)||x(T):rY(v,i)?y=T=>!!(b(T)^x(T)):y=T=>b(T)&&x(T)}),y}),this.RULE("atomicExpression",()=>this.OR([{ALT:()=>this.SUBRULE(this.parenthesisExpression)},{ALT:()=>{let{image:m}=this.CONSUME(l);return y=>y(m)}},{ALT:()=>{this.CONSUME(s);let m=this.SUBRULE(this.atomicExpression);return y=>!m(y)}}])),this.RULE("parenthesisExpression",()=>{let m;return this.CONSUME(o),m=this.SUBRULE(this.expression),this.CONSUME(a),m}),this.performSelfAnalysis()}}return{TinylogicLexer:g,TinylogicParser:f}}});var nY=w(my=>{var Hye=iY();my.makeParser=(r=/[a-z]+/)=>{let{TinylogicLexer:e,TinylogicParser:t}=Hye(r),i=new t;return(n,s)=>{let o=e.tokenize(n);return i.input=o.tokens,i.expression()(s)}};my.parse=my.makeParser()});var oY=w((eet,sY)=>{"use strict";sY.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var rv=w((tet,aY)=>{var Jp=oY(),AY={};for(let r of Object.keys(Jp))AY[Jp[r]]=r;var at={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};aY.exports=at;for(let r of Object.keys(at)){if(!("channels"in at[r]))throw new Error("missing channels property: "+r);if(!("labels"in at[r]))throw new Error("missing channel labels property: "+r);if(at[r].labels.length!==at[r].channels)throw new Error("channel and label counts mismatch: "+r);let{channels:e,labels:t}=at[r];delete at[r].channels,delete at[r].labels,Object.defineProperty(at[r],"channels",{value:e}),Object.defineProperty(at[r],"labels",{value:t})}at.rgb.hsl=function(r){let e=r[0]/255,t=r[1]/255,i=r[2]/255,n=Math.min(e,t,i),s=Math.max(e,t,i),o=s-n,a,l;s===n?a=0:e===s?a=(t-i)/o:t===s?a=2+(i-e)/o:i===s&&(a=4+(e-t)/o),a=Math.min(a*60,360),a<0&&(a+=360);let c=(n+s)/2;return s===n?l=0:c<=.5?l=o/(s+n):l=o/(2-s-n),[a,l*100,c*100]};at.rgb.hsv=function(r){let e,t,i,n,s,o=r[0]/255,a=r[1]/255,l=r[2]/255,c=Math.max(o,a,l),u=c-Math.min(o,a,l),g=function(f){return(c-f)/6/u+1/2};return u===0?(n=0,s=0):(s=u/c,e=g(o),t=g(a),i=g(l),o===c?n=i-t:a===c?n=1/3+e-i:l===c&&(n=2/3+t-e),n<0?n+=1:n>1&&(n-=1)),[n*360,s*100,c*100]};at.rgb.hwb=function(r){let e=r[0],t=r[1],i=r[2],n=at.rgb.hsl(r)[0],s=1/255*Math.min(e,Math.min(t,i));return i=1-1/255*Math.max(e,Math.max(t,i)),[n,s*100,i*100]};at.rgb.cmyk=function(r){let e=r[0]/255,t=r[1]/255,i=r[2]/255,n=Math.min(1-e,1-t,1-i),s=(1-e-n)/(1-n)||0,o=(1-t-n)/(1-n)||0,a=(1-i-n)/(1-n)||0;return[s*100,o*100,a*100,n*100]};function jye(r,e){return(r[0]-e[0])**2+(r[1]-e[1])**2+(r[2]-e[2])**2}at.rgb.keyword=function(r){let e=AY[r];if(e)return e;let t=Infinity,i;for(let n of Object.keys(Jp)){let s=Jp[n],o=jye(r,s);o.04045?((e+.055)/1.055)**2.4:e/12.92,t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,i=i>.04045?((i+.055)/1.055)**2.4:i/12.92;let n=e*.4124+t*.3576+i*.1805,s=e*.2126+t*.7152+i*.0722,o=e*.0193+t*.1192+i*.9505;return[n*100,s*100,o*100]};at.rgb.lab=function(r){let e=at.rgb.xyz(r),t=e[0],i=e[1],n=e[2];t/=95.047,i/=100,n/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,i=i>.008856?i**(1/3):7.787*i+16/116,n=n>.008856?n**(1/3):7.787*n+16/116;let s=116*i-16,o=500*(t-i),a=200*(i-n);return[s,o,a]};at.hsl.rgb=function(r){let e=r[0]/360,t=r[1]/100,i=r[2]/100,n,s,o;if(t===0)return o=i*255,[o,o,o];i<.5?n=i*(1+t):n=i+t-i*t;let a=2*i-n,l=[0,0,0];for(let c=0;c<3;c++)s=e+1/3*-(c-1),s<0&&s++,s>1&&s--,6*s<1?o=a+(n-a)*6*s:2*s<1?o=n:3*s<2?o=a+(n-a)*(2/3-s)*6:o=a,l[c]=o*255;return l};at.hsl.hsv=function(r){let e=r[0],t=r[1]/100,i=r[2]/100,n=t,s=Math.max(i,.01);i*=2,t*=i<=1?i:2-i,n*=s<=1?s:2-s;let o=(i+t)/2,a=i===0?2*n/(s+n):2*t/(i+t);return[e,a*100,o*100]};at.hsv.rgb=function(r){let e=r[0]/60,t=r[1]/100,i=r[2]/100,n=Math.floor(e)%6,s=e-Math.floor(e),o=255*i*(1-t),a=255*i*(1-t*s),l=255*i*(1-t*(1-s));switch(i*=255,n){case 0:return[i,l,o];case 1:return[a,i,o];case 2:return[o,i,l];case 3:return[o,a,i];case 4:return[l,o,i];case 5:return[i,o,a]}};at.hsv.hsl=function(r){let e=r[0],t=r[1]/100,i=r[2]/100,n=Math.max(i,.01),s,o;o=(2-t)*i;let a=(2-t)*n;return s=t*n,s/=a<=1?a:2-a,s=s||0,o/=2,[e,s*100,o*100]};at.hwb.rgb=function(r){let e=r[0]/360,t=r[1]/100,i=r[2]/100,n=t+i,s;n>1&&(t/=n,i/=n);let o=Math.floor(6*e),a=1-i;s=6*e-o,(o&1)!=0&&(s=1-s);let l=t+s*(a-t),c,u,g;switch(o){default:case 6:case 0:c=a,u=l,g=t;break;case 1:c=l,u=a,g=t;break;case 2:c=t,u=a,g=l;break;case 3:c=t,u=l,g=a;break;case 4:c=l,u=t,g=a;break;case 5:c=a,u=t,g=l;break}return[c*255,u*255,g*255]};at.cmyk.rgb=function(r){let e=r[0]/100,t=r[1]/100,i=r[2]/100,n=r[3]/100,s=1-Math.min(1,e*(1-n)+n),o=1-Math.min(1,t*(1-n)+n),a=1-Math.min(1,i*(1-n)+n);return[s*255,o*255,a*255]};at.xyz.rgb=function(r){let e=r[0]/100,t=r[1]/100,i=r[2]/100,n,s,o;return n=e*3.2406+t*-1.5372+i*-.4986,s=e*-.9689+t*1.8758+i*.0415,o=e*.0557+t*-.204+i*1.057,n=n>.0031308?1.055*n**(1/2.4)-.055:n*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,n=Math.min(Math.max(0,n),1),s=Math.min(Math.max(0,s),1),o=Math.min(Math.max(0,o),1),[n*255,s*255,o*255]};at.xyz.lab=function(r){let e=r[0],t=r[1],i=r[2];e/=95.047,t/=100,i/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,t=t>.008856?t**(1/3):7.787*t+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;let n=116*t-16,s=500*(e-t),o=200*(t-i);return[n,s,o]};at.lab.xyz=function(r){let e=r[0],t=r[1],i=r[2],n,s,o;s=(e+16)/116,n=t/500+s,o=s-i/200;let a=s**3,l=n**3,c=o**3;return s=a>.008856?a:(s-16/116)/7.787,n=l>.008856?l:(n-16/116)/7.787,o=c>.008856?c:(o-16/116)/7.787,n*=95.047,s*=100,o*=108.883,[n,s,o]};at.lab.lch=function(r){let e=r[0],t=r[1],i=r[2],n;n=Math.atan2(i,t)*360/2/Math.PI,n<0&&(n+=360);let o=Math.sqrt(t*t+i*i);return[e,o,n]};at.lch.lab=function(r){let e=r[0],t=r[1],n=r[2]/360*2*Math.PI,s=t*Math.cos(n),o=t*Math.sin(n);return[e,s,o]};at.rgb.ansi16=function(r,e=null){let[t,i,n]=r,s=e===null?at.rgb.hsv(r)[2]:e;if(s=Math.round(s/50),s===0)return 30;let o=30+(Math.round(n/255)<<2|Math.round(i/255)<<1|Math.round(t/255));return s===2&&(o+=60),o};at.hsv.ansi16=function(r){return at.rgb.ansi16(at.hsv.rgb(r),r[2])};at.rgb.ansi256=function(r){let e=r[0],t=r[1],i=r[2];return e===t&&t===i?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(i/255*5)};at.ansi16.rgb=function(r){let e=r%10;if(e===0||e===7)return r>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let t=(~~(r>50)+1)*.5,i=(e&1)*t*255,n=(e>>1&1)*t*255,s=(e>>2&1)*t*255;return[i,n,s]};at.ansi256.rgb=function(r){if(r>=232){let s=(r-232)*10+8;return[s,s,s]}r-=16;let e,t=Math.floor(r/36)/5*255,i=Math.floor((e=r%36)/6)/5*255,n=e%6/5*255;return[t,i,n]};at.rgb.hex=function(r){let t=(((Math.round(r[0])&255)<<16)+((Math.round(r[1])&255)<<8)+(Math.round(r[2])&255)).toString(16).toUpperCase();return"000000".substring(t.length)+t};at.hex.rgb=function(r){let e=r.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let t=e[0];e[0].length===3&&(t=t.split("").map(a=>a+a).join(""));let i=parseInt(t,16),n=i>>16&255,s=i>>8&255,o=i&255;return[n,s,o]};at.rgb.hcg=function(r){let e=r[0]/255,t=r[1]/255,i=r[2]/255,n=Math.max(Math.max(e,t),i),s=Math.min(Math.min(e,t),i),o=n-s,a,l;return o<1?a=s/(1-o):a=0,o<=0?l=0:n===e?l=(t-i)/o%6:n===t?l=2+(i-e)/o:l=4+(e-t)/o,l/=6,l%=1,[l*360,o*100,a*100]};at.hsl.hcg=function(r){let e=r[1]/100,t=r[2]/100,i=t<.5?2*e*t:2*e*(1-t),n=0;return i<1&&(n=(t-.5*i)/(1-i)),[r[0],i*100,n*100]};at.hsv.hcg=function(r){let e=r[1]/100,t=r[2]/100,i=e*t,n=0;return i<1&&(n=(t-i)/(1-i)),[r[0],i*100,n*100]};at.hcg.rgb=function(r){let e=r[0]/360,t=r[1]/100,i=r[2]/100;if(t===0)return[i*255,i*255,i*255];let n=[0,0,0],s=e%1*6,o=s%1,a=1-o,l=0;switch(Math.floor(s)){case 0:n[0]=1,n[1]=o,n[2]=0;break;case 1:n[0]=a,n[1]=1,n[2]=0;break;case 2:n[0]=0,n[1]=1,n[2]=o;break;case 3:n[0]=0,n[1]=a,n[2]=1;break;case 4:n[0]=o,n[1]=0,n[2]=1;break;default:n[0]=1,n[1]=0,n[2]=a}return l=(1-t)*i,[(t*n[0]+l)*255,(t*n[1]+l)*255,(t*n[2]+l)*255]};at.hcg.hsv=function(r){let e=r[1]/100,t=r[2]/100,i=e+t*(1-e),n=0;return i>0&&(n=e/i),[r[0],n*100,i*100]};at.hcg.hsl=function(r){let e=r[1]/100,i=r[2]/100*(1-e)+.5*e,n=0;return i>0&&i<.5?n=e/(2*i):i>=.5&&i<1&&(n=e/(2*(1-i))),[r[0],n*100,i*100]};at.hcg.hwb=function(r){let e=r[1]/100,t=r[2]/100,i=e+t*(1-e);return[r[0],(i-e)*100,(1-i)*100]};at.hwb.hcg=function(r){let e=r[1]/100,t=r[2]/100,i=1-t,n=i-e,s=0;return n<1&&(s=(i-n)/(1-n)),[r[0],n*100,s*100]};at.apple.rgb=function(r){return[r[0]/65535*255,r[1]/65535*255,r[2]/65535*255]};at.rgb.apple=function(r){return[r[0]/255*65535,r[1]/255*65535,r[2]/255*65535]};at.gray.rgb=function(r){return[r[0]/100*255,r[0]/100*255,r[0]/100*255]};at.gray.hsl=function(r){return[0,0,r[0]]};at.gray.hsv=at.gray.hsl;at.gray.hwb=function(r){return[0,100,r[0]]};at.gray.cmyk=function(r){return[0,0,0,r[0]]};at.gray.lab=function(r){return[r[0],0,0]};at.gray.hex=function(r){let e=Math.round(r[0]/100*255)&255,i=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(i.length)+i};at.rgb.gray=function(r){return[(r[0]+r[1]+r[2])/3/255*100]}});var cY=w((ret,lY)=>{var Ey=rv();function Gye(){let r={},e=Object.keys(Ey);for(let t=e.length,i=0;i{var iv=rv(),Wye=cY(),vg={},zye=Object.keys(iv);function _ye(r){let e=function(...t){let i=t[0];return i==null?i:(i.length>1&&(t=i),r(t))};return"conversion"in r&&(e.conversion=r.conversion),e}function Vye(r){let e=function(...t){let i=t[0];if(i==null)return i;i.length>1&&(t=i);let n=r(t);if(typeof n=="object")for(let s=n.length,o=0;o{vg[r]={},Object.defineProperty(vg[r],"channels",{value:iv[r].channels}),Object.defineProperty(vg[r],"labels",{value:iv[r].labels});let e=Wye(r);Object.keys(e).forEach(i=>{let n=e[i];vg[r][i]=Vye(n),vg[r][i].raw=_ye(n)})});uY.exports=vg});var mY=w((net,fY)=>{"use strict";var hY=(r,e)=>(...t)=>`[${r(...t)+e}m`,pY=(r,e)=>(...t)=>{let i=r(...t);return`[${38+e};5;${i}m`},dY=(r,e)=>(...t)=>{let i=r(...t);return`[${38+e};2;${i[0]};${i[1]};${i[2]}m`},Iy=r=>r,CY=(r,e,t)=>[r,e,t],xg=(r,e,t)=>{Object.defineProperty(r,e,{get:()=>{let i=t();return Object.defineProperty(r,e,{value:i,enumerable:!0,configurable:!0}),i},enumerable:!0,configurable:!0})},nv,kg=(r,e,t,i)=>{nv===void 0&&(nv=gY());let n=i?10:0,s={};for(let[o,a]of Object.entries(nv)){let l=o==="ansi16"?"ansi":o;o===e?s[l]=r(t,n):typeof a=="object"&&(s[l]=r(a[e],n))}return s};function Xye(){let r=new Map,e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};e.color.gray=e.color.blackBright,e.bgColor.bgGray=e.bgColor.bgBlackBright,e.color.grey=e.color.blackBright,e.bgColor.bgGrey=e.bgColor.bgBlackBright;for(let[t,i]of Object.entries(e)){for(let[n,s]of Object.entries(i))e[n]={open:`[${s[0]}m`,close:`[${s[1]}m`},i[n]=e[n],r.set(s[0],s[1]);Object.defineProperty(e,t,{value:i,enumerable:!1})}return Object.defineProperty(e,"codes",{value:r,enumerable:!1}),e.color.close="",e.bgColor.close="",xg(e.color,"ansi",()=>kg(hY,"ansi16",Iy,!1)),xg(e.color,"ansi256",()=>kg(pY,"ansi256",Iy,!1)),xg(e.color,"ansi16m",()=>kg(dY,"rgb",CY,!1)),xg(e.bgColor,"ansi",()=>kg(hY,"ansi16",Iy,!0)),xg(e.bgColor,"ansi256",()=>kg(pY,"ansi256",Iy,!0)),xg(e.bgColor,"ansi16m",()=>kg(dY,"rgb",CY,!0)),e}Object.defineProperty(fY,"exports",{enumerable:!0,get:Xye})});var IY=w((set,EY)=>{"use strict";EY.exports=(r,e=process.argv)=>{let t=r.startsWith("-")?"":r.length===1?"-":"--",i=e.indexOf(t+r),n=e.indexOf("--");return i!==-1&&(n===-1||i{"use strict";var Zye=require("os"),wY=require("tty"),Ps=IY(),{env:gi}=process,tl;Ps("no-color")||Ps("no-colors")||Ps("color=false")||Ps("color=never")?tl=0:(Ps("color")||Ps("colors")||Ps("color=true")||Ps("color=always"))&&(tl=1);"FORCE_COLOR"in gi&&(gi.FORCE_COLOR==="true"?tl=1:gi.FORCE_COLOR==="false"?tl=0:tl=gi.FORCE_COLOR.length===0?1:Math.min(parseInt(gi.FORCE_COLOR,10),3));function sv(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function ov(r,e){if(tl===0)return 0;if(Ps("color=16m")||Ps("color=full")||Ps("color=truecolor"))return 3;if(Ps("color=256"))return 2;if(r&&!e&&tl===void 0)return 0;let t=tl||0;if(gi.TERM==="dumb")return t;if(process.platform==="win32"){let i=Zye.release().split(".");return Number(i[0])>=10&&Number(i[2])>=10586?Number(i[2])>=14931?3:2:1}if("CI"in gi)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(i=>i in gi)||gi.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in gi)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(gi.TEAMCITY_VERSION)?1:0;if("GITHUB_ACTIONS"in gi)return 1;if(gi.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in gi){let i=parseInt((gi.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(gi.TERM_PROGRAM){case"iTerm.app":return i>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(gi.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(gi.TERM)||"COLORTERM"in gi?1:t}function $ye(r){let e=ov(r,r&&r.isTTY);return sv(e)}yY.exports={supportsColor:$ye,stdout:sv(ov(!0,wY.isatty(1))),stderr:sv(ov(!0,wY.isatty(2)))}});var QY=w((aet,bY)=>{"use strict";var ewe=(r,e,t)=>{let i=r.indexOf(e);if(i===-1)return r;let n=e.length,s=0,o="";do o+=r.substr(s,i-s)+e+t,s=i+n,i=r.indexOf(e,s);while(i!==-1);return o+=r.substr(s),o},twe=(r,e,t,i)=>{let n=0,s="";do{let o=r[i-1]==="\r";s+=r.substr(n,(o?i-1:i)-n)+e+(o?`\r -`:` -`)+t,n=i+1,i=r.indexOf(` -`,n)}while(i!==-1);return s+=r.substr(n),s};bY.exports={stringReplaceAll:ewe,stringEncaseCRLFWithFirstIndex:twe}});var PY=w((Aet,SY)=>{"use strict";var rwe=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,vY=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,iwe=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,nwe=/\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.)|([^\\])/gi,swe=new Map([["n",` -`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a","\x07"]]);function xY(r){let e=r[0]==="u",t=r[1]==="{";return e&&!t&&r.length===5||r[0]==="x"&&r.length===3?String.fromCharCode(parseInt(r.slice(1),16)):e&&t?String.fromCodePoint(parseInt(r.slice(2,-1),16)):swe.get(r)||r}function owe(r,e){let t=[],i=e.trim().split(/\s*,\s*/g),n;for(let s of i){let o=Number(s);if(!Number.isNaN(o))t.push(o);else if(n=s.match(iwe))t.push(n[2].replace(nwe,(a,l,c)=>l?xY(l):c));else throw new Error(`Invalid Chalk template style argument: ${s} (in style '${r}')`)}return t}function awe(r){vY.lastIndex=0;let e=[],t;for(;(t=vY.exec(r))!==null;){let i=t[1];if(t[2]){let n=owe(i,t[2]);e.push([i].concat(n))}else e.push([i])}return e}function kY(r,e){let t={};for(let n of e)for(let s of n.styles)t[s[0]]=n.inverse?null:s.slice(1);let i=r;for(let[n,s]of Object.entries(t))if(!!Array.isArray(s)){if(!(n in i))throw new Error(`Unknown Chalk style: ${n}`);i=s.length>0?i[n](...s):i[n]}return i}SY.exports=(r,e)=>{let t=[],i=[],n=[];if(e.replace(rwe,(s,o,a,l,c,u)=>{if(o)n.push(xY(o));else if(l){let g=n.join("");n=[],i.push(t.length===0?g:kY(r,t)(g)),t.push({inverse:a,styles:awe(l)})}else if(c){if(t.length===0)throw new Error("Found extraneous } in Chalk template literal");i.push(kY(r,t)(n.join(""))),n=[],t.pop()}else n.push(u)}),i.push(n.join("")),t.length>0){let s=`Chalk template literal is missing ${t.length} closing bracket${t.length===1?"":"s"} (\`}\`)`;throw new Error(s)}return i.join("")}});var uv=w((cet,DY)=>{"use strict";var Wp=mY(),{stdout:av,stderr:Av}=BY(),{stringReplaceAll:Awe,stringEncaseCRLFWithFirstIndex:lwe}=QY(),RY=["ansi","ansi","ansi256","ansi16m"],Pg=Object.create(null),cwe=(r,e={})=>{if(e.level>3||e.level<0)throw new Error("The `level` option should be an integer from 0 to 3");let t=av?av.level:0;r.level=e.level===void 0?t:e.level},FY=class{constructor(e){return NY(e)}},NY=r=>{let e={};return cwe(e,r),e.template=(...t)=>uwe(e.template,...t),Object.setPrototypeOf(e,yy.prototype),Object.setPrototypeOf(e.template,e),e.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},e.template.Instance=FY,e.template};function yy(r){return NY(r)}for(let[r,e]of Object.entries(Wp))Pg[r]={get(){let t=wy(this,lv(e.open,e.close,this._styler),this._isEmpty);return Object.defineProperty(this,r,{value:t}),t}};Pg.visible={get(){let r=wy(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:r}),r}};var LY=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let r of LY)Pg[r]={get(){let{level:e}=this;return function(...t){let i=lv(Wp.color[RY[e]][r](...t),Wp.color.close,this._styler);return wy(this,i,this._isEmpty)}}};for(let r of LY){let e="bg"+r[0].toUpperCase()+r.slice(1);Pg[e]={get(){let{level:t}=this;return function(...i){let n=lv(Wp.bgColor[RY[t]][r](...i),Wp.bgColor.close,this._styler);return wy(this,n,this._isEmpty)}}}}var gwe=Object.defineProperties(()=>{},te(N({},Pg),{level:{enumerable:!0,get(){return this._generator.level},set(r){this._generator.level=r}}})),lv=(r,e,t)=>{let i,n;return t===void 0?(i=r,n=e):(i=t.openAll+r,n=e+t.closeAll),{open:r,close:e,openAll:i,closeAll:n,parent:t}},wy=(r,e,t)=>{let i=(...n)=>fwe(i,n.length===1?""+n[0]:n.join(" "));return i.__proto__=gwe,i._generator=r,i._styler=e,i._isEmpty=t,i},fwe=(r,e)=>{if(r.level<=0||!e)return r._isEmpty?"":e;let t=r._styler;if(t===void 0)return e;let{openAll:i,closeAll:n}=t;if(e.indexOf("")!==-1)for(;t!==void 0;)e=Awe(e,t.close,t.open),t=t.parent;let s=e.indexOf(` -`);return s!==-1&&(e=lwe(e,n,i,s)),i+e+n},cv,uwe=(r,...e)=>{let[t]=e;if(!Array.isArray(t))return e.join(" ");let i=e.slice(1),n=[t.raw[0]];for(let s=1;s{"use strict";Ds.isInteger=r=>typeof r=="number"?Number.isInteger(r):typeof r=="string"&&r.trim()!==""?Number.isInteger(Number(r)):!1;Ds.find=(r,e)=>r.nodes.find(t=>t.type===e);Ds.exceedsLimit=(r,e,t=1,i)=>i===!1||!Ds.isInteger(r)||!Ds.isInteger(e)?!1:(Number(e)-Number(r))/Number(t)>=i;Ds.escapeNode=(r,e=0,t)=>{let i=r.nodes[e];!i||(t&&i.type===t||i.type==="open"||i.type==="close")&&i.escaped!==!0&&(i.value="\\"+i.value,i.escaped=!0)};Ds.encloseBrace=r=>r.type!=="brace"?!1:r.commas>>0+r.ranges>>0==0?(r.invalid=!0,!0):!1;Ds.isInvalidBrace=r=>r.type!=="brace"?!1:r.invalid===!0||r.dollar?!0:r.commas>>0+r.ranges>>0==0||r.open!==!0||r.close!==!0?(r.invalid=!0,!0):!1;Ds.isOpenOrClose=r=>r.type==="open"||r.type==="close"?!0:r.open===!0||r.close===!0;Ds.reduce=r=>r.reduce((e,t)=>(t.type==="text"&&e.push(t.value),t.type==="range"&&(t.type="text"),e),[]);Ds.flatten=(...r)=>{let e=[],t=i=>{for(let n=0;n{"use strict";var OY=By();TY.exports=(r,e={})=>{let t=(i,n={})=>{let s=e.escapeInvalid&&OY.isInvalidBrace(n),o=i.invalid===!0&&e.escapeInvalid===!0,a="";if(i.value)return(s||o)&&OY.isOpenOrClose(i)?"\\"+i.value:i.value;if(i.value)return i.value;if(i.nodes)for(let l of i.nodes)a+=t(l);return a};return t(r)}});var KY=w((fet,MY)=>{"use strict";MY.exports=function(r){return typeof r=="number"?r-r==0:typeof r=="string"&&r.trim()!==""?Number.isFinite?Number.isFinite(+r):isFinite(+r):!1}});var zY=w((het,UY)=>{"use strict";var HY=KY(),Rc=(r,e,t)=>{if(HY(r)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||r===e)return String(r);if(HY(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let i=N({relaxZeros:!0},t);typeof i.strictZeros=="boolean"&&(i.relaxZeros=i.strictZeros===!1);let n=String(i.relaxZeros),s=String(i.shorthand),o=String(i.capture),a=String(i.wrap),l=r+":"+e+"="+n+s+o+a;if(Rc.cache.hasOwnProperty(l))return Rc.cache[l].result;let c=Math.min(r,e),u=Math.max(r,e);if(Math.abs(c-u)===1){let m=r+"|"+e;return i.capture?`(${m})`:i.wrap===!1?m:`(?:${m})`}let g=GY(r)||GY(e),f={min:r,max:e,a:c,b:u},h=[],p=[];if(g&&(f.isPadded=g,f.maxLen=String(f.max).length),c<0){let m=u<0?Math.abs(u):1;p=jY(m,Math.abs(c),f,i),c=f.a=0}return u>=0&&(h=jY(c,u,f,i)),f.negatives=p,f.positives=h,f.result=hwe(p,h,i),i.capture===!0?f.result=`(${f.result})`:i.wrap!==!1&&h.length+p.length>1&&(f.result=`(?:${f.result})`),Rc.cache[l]=f,f.result};function hwe(r,e,t){let i=gv(r,e,"-",!1,t)||[],n=gv(e,r,"",!1,t)||[],s=gv(r,e,"-?",!0,t)||[];return i.concat(s).concat(n).join("|")}function dwe(r,e){let t=1,i=1,n=YY(r,t),s=new Set([e]);for(;r<=n&&n<=e;)s.add(n),t+=1,n=YY(r,t);for(n=qY(e+1,i)-1;r1&&a.count.pop(),a.count.push(u.count[0]),a.string=a.pattern+JY(a.count),o=c+1;continue}t.isPadded&&(g=Iwe(c,t,i)),u.string=g+u.pattern+JY(u.count),s.push(u),o=c+1,a=u}return s}function gv(r,e,t,i,n){let s=[];for(let o of r){let{string:a}=o;!i&&!WY(e,"string",a)&&s.push(t+a),i&&WY(e,"string",a)&&s.push(t+a)}return s}function Cwe(r,e){let t=[];for(let i=0;ie?1:e>r?-1:0}function WY(r,e,t){return r.some(i=>i[e]===t)}function YY(r,e){return Number(String(r).slice(0,-e)+"9".repeat(e))}function qY(r,e){return r-r%Math.pow(10,e)}function JY(r){let[e=0,t=""]=r;return t||e>1?`{${e+(t?","+t:"")}}`:""}function mwe(r,e,t){return`[${r}${e-r==1?"":"-"}${e}]`}function GY(r){return/^-?(0+)\d/.test(r)}function Iwe(r,e,t){if(!e.isPadded)return r;let i=Math.abs(e.maxLen-String(r).length),n=t.relaxZeros!==!1;switch(i){case 0:return"";case 1:return n?"0?":"0";case 2:return n?"0{0,2}":"00";default:return n?`0{0,${i}}`:`0{${i}}`}}Rc.cache={};Rc.clearCache=()=>Rc.cache={};UY.exports=Rc});var pv=w((pet,_Y)=>{"use strict";var ywe=require("util"),VY=zY(),XY=r=>r!==null&&typeof r=="object"&&!Array.isArray(r),wwe=r=>e=>r===!0?Number(e):String(e),fv=r=>typeof r=="number"||typeof r=="string"&&r!=="",_p=r=>Number.isInteger(+r),hv=r=>{let e=`${r}`,t=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return!1;for(;e[++t]==="0";);return t>0},Bwe=(r,e,t)=>typeof r=="string"||typeof e=="string"?!0:t.stringify===!0,bwe=(r,e,t)=>{if(e>0){let i=r[0]==="-"?"-":"";i&&(r=r.slice(1)),r=i+r.padStart(i?e-1:e,"0")}return t===!1?String(r):r},ZY=(r,e)=>{let t=r[0]==="-"?"-":"";for(t&&(r=r.slice(1),e--);r.length{r.negatives.sort((o,a)=>oa?1:0),r.positives.sort((o,a)=>oa?1:0);let t=e.capture?"":"?:",i="",n="",s;return r.positives.length&&(i=r.positives.join("|")),r.negatives.length&&(n=`-(${t}${r.negatives.join("|")})`),i&&n?s=`${i}|${n}`:s=i||n,e.wrap?`(${t}${s})`:s},$Y=(r,e,t,i)=>{if(t)return VY(r,e,N({wrap:!1},i));let n=String.fromCharCode(r);if(r===e)return n;let s=String.fromCharCode(e);return`[${n}-${s}]`},eq=(r,e,t)=>{if(Array.isArray(r)){let i=t.wrap===!0,n=t.capture?"":"?:";return i?`(${n}${r.join("|")})`:r.join("|")}return VY(r,e,t)},tq=(...r)=>new RangeError("Invalid range arguments: "+ywe.inspect(...r)),rq=(r,e,t)=>{if(t.strictRanges===!0)throw tq([r,e]);return[]},Swe=(r,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${r}" to be a number`);return[]},vwe=(r,e,t=1,i={})=>{let n=Number(r),s=Number(e);if(!Number.isInteger(n)||!Number.isInteger(s)){if(i.strictRanges===!0)throw tq([r,e]);return[]}n===0&&(n=0),s===0&&(s=0);let o=n>s,a=String(r),l=String(e),c=String(t);t=Math.max(Math.abs(t),1);let u=hv(a)||hv(l)||hv(c),g=u?Math.max(a.length,l.length,c.length):0,f=u===!1&&Bwe(r,e,i)===!1,h=i.transform||wwe(f);if(i.toRegex&&t===1)return $Y(ZY(r,g),ZY(e,g),!0,i);let p={negatives:[],positives:[]},m=v=>p[v<0?"negatives":"positives"].push(Math.abs(v)),y=[],b=0;for(;o?n>=s:n<=s;)i.toRegex===!0&&t>1?m(n):y.push(bwe(h(n,b),g,f)),n=o?n-t:n+t,b++;return i.toRegex===!0?t>1?Qwe(p,i):eq(y,null,N({wrap:!1},i)):y},xwe=(r,e,t=1,i={})=>{if(!_p(r)&&r.length>1||!_p(e)&&e.length>1)return rq(r,e,i);let n=i.transform||(f=>String.fromCharCode(f)),s=`${r}`.charCodeAt(0),o=`${e}`.charCodeAt(0),a=s>o,l=Math.min(s,o),c=Math.max(s,o);if(i.toRegex&&t===1)return $Y(l,c,!1,i);let u=[],g=0;for(;a?s>=o:s<=o;)u.push(n(s,g)),s=a?s-t:s+t,g++;return i.toRegex===!0?eq(u,null,{wrap:!1,options:i}):u},Qy=(r,e,t,i={})=>{if(e==null&&fv(r))return[r];if(!fv(r)||!fv(e))return rq(r,e,i);if(typeof t=="function")return Qy(r,e,1,{transform:t});if(XY(t))return Qy(r,e,0,t);let n=N({},i);return n.capture===!0&&(n.wrap=!0),t=t||n.step||1,_p(t)?_p(r)&&_p(e)?vwe(r,e,t,n):xwe(r,e,Math.max(Math.abs(t),1),n):t!=null&&!XY(t)?Swe(t,n):Qy(r,e,1,t)};_Y.exports=Qy});var sq=w((det,iq)=>{"use strict";var kwe=pv(),nq=By(),Pwe=(r,e={})=>{let t=(i,n={})=>{let s=nq.isInvalidBrace(n),o=i.invalid===!0&&e.escapeInvalid===!0,a=s===!0||o===!0,l=e.escapeInvalid===!0?"\\":"",c="";if(i.isOpen===!0||i.isClose===!0)return l+i.value;if(i.type==="open")return a?l+i.value:"(";if(i.type==="close")return a?l+i.value:")";if(i.type==="comma")return i.prev.type==="comma"?"":a?i.value:"|";if(i.value)return i.value;if(i.nodes&&i.ranges>0){let u=nq.reduce(i.nodes),g=kwe(...u,te(N({},e),{wrap:!1,toRegex:!0}));if(g.length!==0)return u.length>1&&g.length>1?`(${g})`:g}if(i.nodes)for(let u of i.nodes)c+=t(u,i);return c};return t(r)};iq.exports=Pwe});var Aq=w((Cet,oq)=>{"use strict";var Dwe=pv(),aq=by(),Dg=By(),Fc=(r="",e="",t=!1)=>{let i=[];if(r=[].concat(r),e=[].concat(e),!e.length)return r;if(!r.length)return t?Dg.flatten(e).map(n=>`{${n}}`):e;for(let n of r)if(Array.isArray(n))for(let s of n)i.push(Fc(s,e,t));else for(let s of e)t===!0&&typeof s=="string"&&(s=`{${s}}`),i.push(Array.isArray(s)?Fc(n,s,t):n+s);return Dg.flatten(i)},Rwe=(r,e={})=>{let t=e.rangeLimit===void 0?1e3:e.rangeLimit,i=(n,s={})=>{n.queue=[];let o=s,a=s.queue;for(;o.type!=="brace"&&o.type!=="root"&&o.parent;)o=o.parent,a=o.queue;if(n.invalid||n.dollar){a.push(Fc(a.pop(),aq(n,e)));return}if(n.type==="brace"&&n.invalid!==!0&&n.nodes.length===2){a.push(Fc(a.pop(),["{}"]));return}if(n.nodes&&n.ranges>0){let g=Dg.reduce(n.nodes);if(Dg.exceedsLimit(...g,e.step,t))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let f=Dwe(...g,e);f.length===0&&(f=aq(n,e)),a.push(Fc(a.pop(),f)),n.nodes=[];return}let l=Dg.encloseBrace(n),c=n.queue,u=n;for(;u.type!=="brace"&&u.type!=="root"&&u.parent;)u=u.parent,c=u.queue;for(let g=0;g{"use strict";lq.exports={MAX_LENGTH:1024*64,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:` -`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var pq=w((Eet,uq)=>{"use strict";var Fwe=by(),{MAX_LENGTH:gq,CHAR_BACKSLASH:dv,CHAR_BACKTICK:Nwe,CHAR_COMMA:Lwe,CHAR_DOT:Twe,CHAR_LEFT_PARENTHESES:Owe,CHAR_RIGHT_PARENTHESES:Mwe,CHAR_LEFT_CURLY_BRACE:Kwe,CHAR_RIGHT_CURLY_BRACE:Uwe,CHAR_LEFT_SQUARE_BRACKET:fq,CHAR_RIGHT_SQUARE_BRACKET:hq,CHAR_DOUBLE_QUOTE:Hwe,CHAR_SINGLE_QUOTE:jwe,CHAR_NO_BREAK_SPACE:Gwe,CHAR_ZERO_WIDTH_NOBREAK_SPACE:Ywe}=cq(),qwe=(r,e={})=>{if(typeof r!="string")throw new TypeError("Expected a string");let t=e||{},i=typeof t.maxLength=="number"?Math.min(gq,t.maxLength):gq;if(r.length>i)throw new SyntaxError(`Input length (${r.length}), exceeds max characters (${i})`);let n={type:"root",input:r,nodes:[]},s=[n],o=n,a=n,l=0,c=r.length,u=0,g=0,f,h={},p=()=>r[u++],m=y=>{if(y.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&y.type==="text"){a.value+=y.value;return}return o.nodes.push(y),y.parent=o,y.prev=a,a=y,y};for(m({type:"bos"});u0){if(o.ranges>0){o.ranges=0;let y=o.nodes.shift();o.nodes=[y,{type:"text",value:Fwe(o)}]}m({type:"comma",value:f}),o.commas++;continue}if(f===Twe&&g>0&&o.commas===0){let y=o.nodes;if(g===0||y.length===0){m({type:"text",value:f});continue}if(a.type==="dot"){if(o.range=[],a.value+=f,a.type="range",o.nodes.length!==3&&o.nodes.length!==5){o.invalid=!0,o.ranges=0,a.type="text";continue}o.ranges++,o.args=[];continue}if(a.type==="range"){y.pop();let b=y[y.length-1];b.value+=a.value+f,a=b,o.ranges--;continue}m({type:"dot",value:f});continue}m({type:"text",value:f})}do if(o=s.pop(),o.type!=="root"){o.nodes.forEach(v=>{v.nodes||(v.type==="open"&&(v.isOpen=!0),v.type==="close"&&(v.isClose=!0),v.nodes||(v.type="text"),v.invalid=!0)});let y=s[s.length-1],b=y.nodes.indexOf(o);y.nodes.splice(b,1,...o.nodes)}while(s.length>0);return m({type:"eos"}),n};uq.exports=qwe});var mq=w((Iet,dq)=>{"use strict";var Cq=by(),Jwe=sq(),Wwe=Aq(),zwe=pq(),ts=(r,e={})=>{let t=[];if(Array.isArray(r))for(let i of r){let n=ts.create(i,e);Array.isArray(n)?t.push(...n):t.push(n)}else t=[].concat(ts.create(r,e));return e&&e.expand===!0&&e.nodupes===!0&&(t=[...new Set(t)]),t};ts.parse=(r,e={})=>zwe(r,e);ts.stringify=(r,e={})=>typeof r=="string"?Cq(ts.parse(r,e),e):Cq(r,e);ts.compile=(r,e={})=>(typeof r=="string"&&(r=ts.parse(r,e)),Jwe(r,e));ts.expand=(r,e={})=>{typeof r=="string"&&(r=ts.parse(r,e));let t=Wwe(r,e);return e.noempty===!0&&(t=t.filter(Boolean)),e.nodupes===!0&&(t=[...new Set(t)]),t};ts.create=(r,e={})=>r===""||r.length<3?[r]:e.expand!==!0?ts.compile(r,e):ts.expand(r,e);dq.exports=ts});var Vp=w((yet,Eq)=>{"use strict";var _we=require("path"),Jo="\\\\/",Iq=`[^${Jo}]`,za="\\.",Vwe="\\+",Xwe="\\?",Sy="\\/",Zwe="(?=.)",yq="[^/]",Cv=`(?:${Sy}|$)`,wq=`(?:^|${Sy})`,mv=`${za}{1,2}${Cv}`,$we=`(?!${za})`,eBe=`(?!${wq}${mv})`,tBe=`(?!${za}{0,1}${Cv})`,rBe=`(?!${mv})`,iBe=`[^.${Sy}]`,nBe=`${yq}*?`,Bq={DOT_LITERAL:za,PLUS_LITERAL:Vwe,QMARK_LITERAL:Xwe,SLASH_LITERAL:Sy,ONE_CHAR:Zwe,QMARK:yq,END_ANCHOR:Cv,DOTS_SLASH:mv,NO_DOT:$we,NO_DOTS:eBe,NO_DOT_SLASH:tBe,NO_DOTS_SLASH:rBe,QMARK_NO_DOT:iBe,STAR:nBe,START_ANCHOR:wq},sBe=te(N({},Bq),{SLASH_LITERAL:`[${Jo}]`,QMARK:Iq,STAR:`${Iq}*?`,DOTS_SLASH:`${za}{1,2}(?:[${Jo}]|$)`,NO_DOT:`(?!${za})`,NO_DOTS:`(?!(?:^|[${Jo}])${za}{1,2}(?:[${Jo}]|$))`,NO_DOT_SLASH:`(?!${za}{0,1}(?:[${Jo}]|$))`,NO_DOTS_SLASH:`(?!${za}{1,2}(?:[${Jo}]|$))`,QMARK_NO_DOT:`[^.${Jo}]`,START_ANCHOR:`(?:^|[${Jo}])`,END_ANCHOR:`(?:[${Jo}]|$)`}),oBe={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};Eq.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:oBe,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:_we.sep,extglobChars(r){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${r.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(r){return r===!0?sBe:Bq}}});var Xp=w(xn=>{"use strict";var aBe=require("path"),ABe=process.platform==="win32",{REGEX_BACKSLASH:lBe,REGEX_REMOVE_BACKSLASH:cBe,REGEX_SPECIAL_CHARS:uBe,REGEX_SPECIAL_CHARS_GLOBAL:gBe}=Vp();xn.isObject=r=>r!==null&&typeof r=="object"&&!Array.isArray(r);xn.hasRegexChars=r=>uBe.test(r);xn.isRegexChar=r=>r.length===1&&xn.hasRegexChars(r);xn.escapeRegex=r=>r.replace(gBe,"\\$1");xn.toPosixSlashes=r=>r.replace(lBe,"/");xn.removeBackslashes=r=>r.replace(cBe,e=>e==="\\"?"":e);xn.supportsLookbehinds=()=>{let r=process.version.slice(1).split(".").map(Number);return r.length===3&&r[0]>=9||r[0]===8&&r[1]>=10};xn.isWindows=r=>r&&typeof r.windows=="boolean"?r.windows:ABe===!0||aBe.sep==="\\";xn.escapeLast=(r,e,t)=>{let i=r.lastIndexOf(e,t);return i===-1?r:r[i-1]==="\\"?xn.escapeLast(r,e,i-1):`${r.slice(0,i)}\\${r.slice(i)}`};xn.removePrefix=(r,e={})=>{let t=r;return t.startsWith("./")&&(t=t.slice(2),e.prefix="./"),t};xn.wrapOutput=(r,e={},t={})=>{let i=t.contains?"":"^",n=t.contains?"":"$",s=`${i}(?:${r})${n}`;return e.negated===!0&&(s=`(?:^(?!${s}).*$)`),s}});var Dq=w((Bet,bq)=>{"use strict";var Qq=Xp(),{CHAR_ASTERISK:Ev,CHAR_AT:fBe,CHAR_BACKWARD_SLASH:Zp,CHAR_COMMA:hBe,CHAR_DOT:Iv,CHAR_EXCLAMATION_MARK:yv,CHAR_FORWARD_SLASH:Sq,CHAR_LEFT_CURLY_BRACE:wv,CHAR_LEFT_PARENTHESES:Bv,CHAR_LEFT_SQUARE_BRACKET:pBe,CHAR_PLUS:dBe,CHAR_QUESTION_MARK:vq,CHAR_RIGHT_CURLY_BRACE:CBe,CHAR_RIGHT_PARENTHESES:xq,CHAR_RIGHT_SQUARE_BRACKET:mBe}=Vp(),kq=r=>r===Sq||r===Zp,Pq=r=>{r.isPrefix!==!0&&(r.depth=r.isGlobstar?Infinity:1)},EBe=(r,e)=>{let t=e||{},i=r.length-1,n=t.parts===!0||t.scanToEnd===!0,s=[],o=[],a=[],l=r,c=-1,u=0,g=0,f=!1,h=!1,p=!1,m=!1,y=!1,b=!1,v=!1,x=!1,T=!1,q=!1,Y=0,$,_,ne={value:"",depth:0,isGlob:!1},ee=()=>c>=i,A=()=>l.charCodeAt(c+1),oe=()=>($=_,l.charCodeAt(++c));for(;c0&&(Z=l.slice(0,u),l=l.slice(u),g-=u),ce&&p===!0&&g>0?(ce=l.slice(0,g),O=l.slice(g)):p===!0?(ce="",O=l):ce=l,ce&&ce!==""&&ce!=="/"&&ce!==l&&kq(ce.charCodeAt(ce.length-1))&&(ce=ce.slice(0,-1)),t.unescape===!0&&(O&&(O=Qq.removeBackslashes(O)),ce&&v===!0&&(ce=Qq.removeBackslashes(ce)));let L={prefix:Z,input:r,start:u,base:ce,glob:O,isBrace:f,isBracket:h,isGlob:p,isExtglob:m,isGlobstar:y,negated:x,negatedExtglob:T};if(t.tokens===!0&&(L.maxDepth=0,kq(_)||o.push(ne),L.tokens=o),t.parts===!0||t.tokens===!0){let de;for(let Be=0;Be{"use strict";var vy=Vp(),rs=Xp(),{MAX_LENGTH:xy,POSIX_REGEX_SOURCE:IBe,REGEX_NON_SPECIAL_CHARS:yBe,REGEX_SPECIAL_CHARS_BACKREF:wBe,REPLACEMENTS:Fq}=vy,BBe=(r,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...r,e);r.sort();let t=`[${r.join("-")}]`;try{new RegExp(t)}catch(i){return r.map(n=>rs.escapeRegex(n)).join("..")}return t},Rg=(r,e)=>`Missing ${r}: "${e}" - use "\\\\${e}" to match literal characters`,Nq=(r,e)=>{if(typeof r!="string")throw new TypeError("Expected a string");r=Fq[r]||r;let t=N({},e),i=typeof t.maxLength=="number"?Math.min(xy,t.maxLength):xy,n=r.length;if(n>i)throw new SyntaxError(`Input length: ${n}, exceeds maximum allowed length: ${i}`);let s={type:"bos",value:"",output:t.prepend||""},o=[s],a=t.capture?"":"?:",l=rs.isWindows(e),c=vy.globChars(l),u=vy.extglobChars(c),{DOT_LITERAL:g,PLUS_LITERAL:f,SLASH_LITERAL:h,ONE_CHAR:p,DOTS_SLASH:m,NO_DOT:y,NO_DOT_SLASH:b,NO_DOTS_SLASH:v,QMARK:x,QMARK_NO_DOT:T,STAR:q,START_ANCHOR:Y}=c,$=V=>`(${a}(?:(?!${Y}${V.dot?m:g}).)*?)`,_=t.dot?"":y,ne=t.dot?x:T,ee=t.bash===!0?$(t):q;t.capture&&(ee=`(${ee})`),typeof t.noext=="boolean"&&(t.noextglob=t.noext);let A={input:r,index:-1,start:0,dot:t.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:o};r=rs.removePrefix(r,A),n=r.length;let oe=[],ce=[],Z=[],O=s,L,de=()=>A.index===n-1,Be=A.peek=(V=1)=>r[A.index+V],je=A.advance=()=>r[++A.index]||"",re=()=>r.slice(A.index+1),se=(V="",Qe=0)=>{A.consumed+=V,A.index+=Qe},be=V=>{A.output+=V.output!=null?V.output:V.value,se(V.value)},he=()=>{let V=1;for(;Be()==="!"&&(Be(2)!=="("||Be(3)==="?");)je(),A.start++,V++;return V%2==0?!1:(A.negated=!0,A.start++,!0)},Fe=V=>{A[V]++,Z.push(V)},Ke=V=>{A[V]--,Z.pop()},ke=V=>{if(O.type==="globstar"){let Qe=A.braces>0&&(V.type==="comma"||V.type==="brace"),le=V.extglob===!0||oe.length&&(V.type==="pipe"||V.type==="paren");V.type!=="slash"&&V.type!=="paren"&&!Qe&&!le&&(A.output=A.output.slice(0,-O.output.length),O.type="star",O.value="*",O.output=ee,A.output+=O.output)}if(oe.length&&V.type!=="paren"&&(oe[oe.length-1].inner+=V.value),(V.value||V.output)&&be(V),O&&O.type==="text"&&V.type==="text"){O.value+=V.value,O.output=(O.output||"")+V.value;return}V.prev=O,o.push(V),O=V},ve=(V,Qe)=>{let le=te(N({},u[Qe]),{conditions:1,inner:""});le.prev=O,le.parens=A.parens,le.output=A.output;let fe=(t.capture?"(":"")+le.open;Fe("parens"),ke({type:V,value:Qe,output:A.output?"":p}),ke({type:"paren",extglob:!0,value:je(),output:fe}),oe.push(le)},pe=V=>{let Qe=V.close+(t.capture?")":""),le;if(V.type==="negate"){let fe=ee;V.inner&&V.inner.length>1&&V.inner.includes("/")&&(fe=$(t)),(fe!==ee||de()||/^\)+$/.test(re()))&&(Qe=V.close=`)$))${fe}`),V.inner.includes("*")&&(le=re())&&/^\.[^\\/.]+$/.test(le)&&(Qe=V.close=`)${le})${fe})`),V.prev.type==="bos"&&(A.negatedExtglob=!0)}ke({type:"paren",extglob:!0,value:L,output:Qe}),Ke("parens")};if(t.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(r)){let V=!1,Qe=r.replace(wBe,(le,fe,gt,Ht,Mt,Ei)=>Ht==="\\"?(V=!0,le):Ht==="?"?fe?fe+Ht+(Mt?x.repeat(Mt.length):""):Ei===0?ne+(Mt?x.repeat(Mt.length):""):x.repeat(gt.length):Ht==="."?g.repeat(gt.length):Ht==="*"?fe?fe+Ht+(Mt?ee:""):ee:fe?le:`\\${le}`);return V===!0&&(t.unescape===!0?Qe=Qe.replace(/\\/g,""):Qe=Qe.replace(/\\+/g,le=>le.length%2==0?"\\\\":le?"\\":"")),Qe===r&&t.contains===!0?(A.output=r,A):(A.output=rs.wrapOutput(Qe,A,e),A)}for(;!de();){if(L=je(),L==="\0")continue;if(L==="\\"){let le=Be();if(le==="/"&&t.bash!==!0||le==="."||le===";")continue;if(!le){L+="\\",ke({type:"text",value:L});continue}let fe=/^\\+/.exec(re()),gt=0;if(fe&&fe[0].length>2&&(gt=fe[0].length,A.index+=gt,gt%2!=0&&(L+="\\")),t.unescape===!0?L=je():L+=je(),A.brackets===0){ke({type:"text",value:L});continue}}if(A.brackets>0&&(L!=="]"||O.value==="["||O.value==="[^")){if(t.posix!==!1&&L===":"){let le=O.value.slice(1);if(le.includes("[")&&(O.posix=!0,le.includes(":"))){let fe=O.value.lastIndexOf("["),gt=O.value.slice(0,fe),Ht=O.value.slice(fe+2),Mt=IBe[Ht];if(Mt){O.value=gt+Mt,A.backtrack=!0,je(),!s.output&&o.indexOf(O)===1&&(s.output=p);continue}}}(L==="["&&Be()!==":"||L==="-"&&Be()==="]")&&(L=`\\${L}`),L==="]"&&(O.value==="["||O.value==="[^")&&(L=`\\${L}`),t.posix===!0&&L==="!"&&O.value==="["&&(L="^"),O.value+=L,be({value:L});continue}if(A.quotes===1&&L!=='"'){L=rs.escapeRegex(L),O.value+=L,be({value:L});continue}if(L==='"'){A.quotes=A.quotes===1?0:1,t.keepQuotes===!0&&ke({type:"text",value:L});continue}if(L==="("){Fe("parens"),ke({type:"paren",value:L});continue}if(L===")"){if(A.parens===0&&t.strictBrackets===!0)throw new SyntaxError(Rg("opening","("));let le=oe[oe.length-1];if(le&&A.parens===le.parens+1){pe(oe.pop());continue}ke({type:"paren",value:L,output:A.parens?")":"\\)"}),Ke("parens");continue}if(L==="["){if(t.nobracket===!0||!re().includes("]")){if(t.nobracket!==!0&&t.strictBrackets===!0)throw new SyntaxError(Rg("closing","]"));L=`\\${L}`}else Fe("brackets");ke({type:"bracket",value:L});continue}if(L==="]"){if(t.nobracket===!0||O&&O.type==="bracket"&&O.value.length===1){ke({type:"text",value:L,output:`\\${L}`});continue}if(A.brackets===0){if(t.strictBrackets===!0)throw new SyntaxError(Rg("opening","["));ke({type:"text",value:L,output:`\\${L}`});continue}Ke("brackets");let le=O.value.slice(1);if(O.posix!==!0&&le[0]==="^"&&!le.includes("/")&&(L=`/${L}`),O.value+=L,be({value:L}),t.literalBrackets===!1||rs.hasRegexChars(le))continue;let fe=rs.escapeRegex(O.value);if(A.output=A.output.slice(0,-O.value.length),t.literalBrackets===!0){A.output+=fe,O.value=fe;continue}O.value=`(${a}${fe}|${O.value})`,A.output+=O.value;continue}if(L==="{"&&t.nobrace!==!0){Fe("braces");let le={type:"brace",value:L,output:"(",outputIndex:A.output.length,tokensIndex:A.tokens.length};ce.push(le),ke(le);continue}if(L==="}"){let le=ce[ce.length-1];if(t.nobrace===!0||!le){ke({type:"text",value:L,output:L});continue}let fe=")";if(le.dots===!0){let gt=o.slice(),Ht=[];for(let Mt=gt.length-1;Mt>=0&&(o.pop(),gt[Mt].type!=="brace");Mt--)gt[Mt].type!=="dots"&&Ht.unshift(gt[Mt].value);fe=BBe(Ht,t),A.backtrack=!0}if(le.comma!==!0&&le.dots!==!0){let gt=A.output.slice(0,le.outputIndex),Ht=A.tokens.slice(le.tokensIndex);le.value=le.output="\\{",L=fe="\\}",A.output=gt;for(let Mt of Ht)A.output+=Mt.output||Mt.value}ke({type:"brace",value:L,output:fe}),Ke("braces"),ce.pop();continue}if(L==="|"){oe.length>0&&oe[oe.length-1].conditions++,ke({type:"text",value:L});continue}if(L===","){let le=L,fe=ce[ce.length-1];fe&&Z[Z.length-1]==="braces"&&(fe.comma=!0,le="|"),ke({type:"comma",value:L,output:le});continue}if(L==="/"){if(O.type==="dot"&&A.index===A.start+1){A.start=A.index+1,A.consumed="",A.output="",o.pop(),O=s;continue}ke({type:"slash",value:L,output:h});continue}if(L==="."){if(A.braces>0&&O.type==="dot"){O.value==="."&&(O.output=g);let le=ce[ce.length-1];O.type="dots",O.output+=L,O.value+=L,le.dots=!0;continue}if(A.braces+A.parens===0&&O.type!=="bos"&&O.type!=="slash"){ke({type:"text",value:L,output:g});continue}ke({type:"dot",value:L,output:g});continue}if(L==="?"){if(!(O&&O.value==="(")&&t.noextglob!==!0&&Be()==="("&&Be(2)!=="?"){ve("qmark",L);continue}if(O&&O.type==="paren"){let fe=Be(),gt=L;if(fe==="<"&&!rs.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(O.value==="("&&!/[!=<:]/.test(fe)||fe==="<"&&!/<([!=]|\w+>)/.test(re()))&&(gt=`\\${L}`),ke({type:"text",value:L,output:gt});continue}if(t.dot!==!0&&(O.type==="slash"||O.type==="bos")){ke({type:"qmark",value:L,output:T});continue}ke({type:"qmark",value:L,output:x});continue}if(L==="!"){if(t.noextglob!==!0&&Be()==="("&&(Be(2)!=="?"||!/[!=<:]/.test(Be(3)))){ve("negate",L);continue}if(t.nonegate!==!0&&A.index===0){he();continue}}if(L==="+"){if(t.noextglob!==!0&&Be()==="("&&Be(2)!=="?"){ve("plus",L);continue}if(O&&O.value==="("||t.regex===!1){ke({type:"plus",value:L,output:f});continue}if(O&&(O.type==="bracket"||O.type==="paren"||O.type==="brace")||A.parens>0){ke({type:"plus",value:L});continue}ke({type:"plus",value:f});continue}if(L==="@"){if(t.noextglob!==!0&&Be()==="("&&Be(2)!=="?"){ke({type:"at",extglob:!0,value:L,output:""});continue}ke({type:"text",value:L});continue}if(L!=="*"){(L==="$"||L==="^")&&(L=`\\${L}`);let le=yBe.exec(re());le&&(L+=le[0],A.index+=le[0].length),ke({type:"text",value:L});continue}if(O&&(O.type==="globstar"||O.star===!0)){O.type="star",O.star=!0,O.value+=L,O.output=ee,A.backtrack=!0,A.globstar=!0,se(L);continue}let V=re();if(t.noextglob!==!0&&/^\([^?]/.test(V)){ve("star",L);continue}if(O.type==="star"){if(t.noglobstar===!0){se(L);continue}let le=O.prev,fe=le.prev,gt=le.type==="slash"||le.type==="bos",Ht=fe&&(fe.type==="star"||fe.type==="globstar");if(t.bash===!0&&(!gt||V[0]&&V[0]!=="/")){ke({type:"star",value:L,output:""});continue}let Mt=A.braces>0&&(le.type==="comma"||le.type==="brace"),Ei=oe.length&&(le.type==="pipe"||le.type==="paren");if(!gt&&le.type!=="paren"&&!Mt&&!Ei){ke({type:"star",value:L,output:""});continue}for(;V.slice(0,3)==="/**";){let jt=r[A.index+4];if(jt&&jt!=="/")break;V=V.slice(3),se("/**",3)}if(le.type==="bos"&&de()){O.type="globstar",O.value+=L,O.output=$(t),A.output=O.output,A.globstar=!0,se(L);continue}if(le.type==="slash"&&le.prev.type!=="bos"&&!Ht&&de()){A.output=A.output.slice(0,-(le.output+O.output).length),le.output=`(?:${le.output}`,O.type="globstar",O.output=$(t)+(t.strictSlashes?")":"|$)"),O.value+=L,A.globstar=!0,A.output+=le.output+O.output,se(L);continue}if(le.type==="slash"&&le.prev.type!=="bos"&&V[0]==="/"){let jt=V[1]!==void 0?"|$":"";A.output=A.output.slice(0,-(le.output+O.output).length),le.output=`(?:${le.output}`,O.type="globstar",O.output=`${$(t)}${h}|${h}${jt})`,O.value+=L,A.output+=le.output+O.output,A.globstar=!0,se(L+je()),ke({type:"slash",value:"/",output:""});continue}if(le.type==="bos"&&V[0]==="/"){O.type="globstar",O.value+=L,O.output=`(?:^|${h}|${$(t)}${h})`,A.output=O.output,A.globstar=!0,se(L+je()),ke({type:"slash",value:"/",output:""});continue}A.output=A.output.slice(0,-O.output.length),O.type="globstar",O.output=$(t),O.value+=L,A.output+=O.output,A.globstar=!0,se(L);continue}let Qe={type:"star",value:L,output:ee};if(t.bash===!0){Qe.output=".*?",(O.type==="bos"||O.type==="slash")&&(Qe.output=_+Qe.output),ke(Qe);continue}if(O&&(O.type==="bracket"||O.type==="paren")&&t.regex===!0){Qe.output=L,ke(Qe);continue}(A.index===A.start||O.type==="slash"||O.type==="dot")&&(O.type==="dot"?(A.output+=b,O.output+=b):t.dot===!0?(A.output+=v,O.output+=v):(A.output+=_,O.output+=_),Be()!=="*"&&(A.output+=p,O.output+=p)),ke(Qe)}for(;A.brackets>0;){if(t.strictBrackets===!0)throw new SyntaxError(Rg("closing","]"));A.output=rs.escapeLast(A.output,"["),Ke("brackets")}for(;A.parens>0;){if(t.strictBrackets===!0)throw new SyntaxError(Rg("closing",")"));A.output=rs.escapeLast(A.output,"("),Ke("parens")}for(;A.braces>0;){if(t.strictBrackets===!0)throw new SyntaxError(Rg("closing","}"));A.output=rs.escapeLast(A.output,"{"),Ke("braces")}if(t.strictSlashes!==!0&&(O.type==="star"||O.type==="bracket")&&ke({type:"maybe_slash",value:"",output:`${h}?`}),A.backtrack===!0){A.output="";for(let V of A.tokens)A.output+=V.output!=null?V.output:V.value,V.suffix&&(A.output+=V.suffix)}return A};Nq.fastpaths=(r,e)=>{let t=N({},e),i=typeof t.maxLength=="number"?Math.min(xy,t.maxLength):xy,n=r.length;if(n>i)throw new SyntaxError(`Input length: ${n}, exceeds maximum allowed length: ${i}`);r=Fq[r]||r;let s=rs.isWindows(e),{DOT_LITERAL:o,SLASH_LITERAL:a,ONE_CHAR:l,DOTS_SLASH:c,NO_DOT:u,NO_DOTS:g,NO_DOTS_SLASH:f,STAR:h,START_ANCHOR:p}=vy.globChars(s),m=t.dot?g:u,y=t.dot?f:u,b=t.capture?"":"?:",v={negated:!1,prefix:""},x=t.bash===!0?".*?":h;t.capture&&(x=`(${x})`);let T=_=>_.noglobstar===!0?x:`(${b}(?:(?!${p}${_.dot?c:o}).)*?)`,q=_=>{switch(_){case"*":return`${m}${l}${x}`;case".*":return`${o}${l}${x}`;case"*.*":return`${m}${x}${o}${l}${x}`;case"*/*":return`${m}${x}${a}${l}${y}${x}`;case"**":return m+T(t);case"**/*":return`(?:${m}${T(t)}${a})?${y}${l}${x}`;case"**/*.*":return`(?:${m}${T(t)}${a})?${y}${x}${o}${l}${x}`;case"**/.*":return`(?:${m}${T(t)}${a})?${o}${l}${x}`;default:{let ne=/^(.*?)\.(\w+)$/.exec(_);if(!ne)return;let ee=q(ne[1]);return ee?ee+o+ne[2]:void 0}}},Y=rs.removePrefix(r,v),$=q(Y);return $&&t.strictSlashes!==!0&&($+=`${a}?`),$};Rq.exports=Nq});var Oq=w((Qet,Tq)=>{"use strict";var bBe=require("path"),QBe=Dq(),bv=Lq(),Qv=Xp(),SBe=Vp(),vBe=r=>r&&typeof r=="object"&&!Array.isArray(r),_r=(r,e,t=!1)=>{if(Array.isArray(r)){let u=r.map(f=>_r(f,e,t));return f=>{for(let h of u){let p=h(f);if(p)return p}return!1}}let i=vBe(r)&&r.tokens&&r.input;if(r===""||typeof r!="string"&&!i)throw new TypeError("Expected pattern to be a non-empty string");let n=e||{},s=Qv.isWindows(e),o=i?_r.compileRe(r,e):_r.makeRe(r,e,!1,!0),a=o.state;delete o.state;let l=()=>!1;if(n.ignore){let u=te(N({},e),{ignore:null,onMatch:null,onResult:null});l=_r(n.ignore,u,t)}let c=(u,g=!1)=>{let{isMatch:f,match:h,output:p}=_r.test(u,o,e,{glob:r,posix:s}),m={glob:r,state:a,regex:o,posix:s,input:u,output:p,match:h,isMatch:f};return typeof n.onResult=="function"&&n.onResult(m),f===!1?(m.isMatch=!1,g?m:!1):l(u)?(typeof n.onIgnore=="function"&&n.onIgnore(m),m.isMatch=!1,g?m:!1):(typeof n.onMatch=="function"&&n.onMatch(m),g?m:!0)};return t&&(c.state=a),c};_r.test=(r,e,t,{glob:i,posix:n}={})=>{if(typeof r!="string")throw new TypeError("Expected input to be a string");if(r==="")return{isMatch:!1,output:""};let s=t||{},o=s.format||(n?Qv.toPosixSlashes:null),a=r===i,l=a&&o?o(r):r;return a===!1&&(l=o?o(r):r,a=l===i),(a===!1||s.capture===!0)&&(s.matchBase===!0||s.basename===!0?a=_r.matchBase(r,e,t,n):a=e.exec(l)),{isMatch:Boolean(a),match:a,output:l}};_r.matchBase=(r,e,t,i=Qv.isWindows(t))=>(e instanceof RegExp?e:_r.makeRe(e,t)).test(bBe.basename(r));_r.isMatch=(r,e,t)=>_r(e,t)(r);_r.parse=(r,e)=>Array.isArray(r)?r.map(t=>_r.parse(t,e)):bv(r,te(N({},e),{fastpaths:!1}));_r.scan=(r,e)=>QBe(r,e);_r.compileRe=(r,e,t=!1,i=!1)=>{if(t===!0)return r.output;let n=e||{},s=n.contains?"":"^",o=n.contains?"":"$",a=`${s}(?:${r.output})${o}`;r&&r.negated===!0&&(a=`^(?!${a}).*$`);let l=_r.toRegex(a,e);return i===!0&&(l.state=r),l};_r.makeRe=(r,e={},t=!1,i=!1)=>{if(!r||typeof r!="string")throw new TypeError("Expected a non-empty string");let n={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(r[0]==="."||r[0]==="*")&&(n.output=bv.fastpaths(r,e)),n.output||(n=bv(r,e)),_r.compileRe(n,e,t,i)};_r.toRegex=(r,e)=>{try{let t=e||{};return new RegExp(r,t.flags||(t.nocase?"i":""))}catch(t){if(e&&e.debug===!0)throw t;return/$^/}};_r.constants=SBe;Tq.exports=_r});var Sv=w((vet,Mq)=>{"use strict";Mq.exports=Oq()});var is=w((xet,Kq)=>{"use strict";var Uq=require("util"),Hq=mq(),Wo=Sv(),vv=Xp(),jq=r=>r===""||r==="./",Pr=(r,e,t)=>{e=[].concat(e),r=[].concat(r);let i=new Set,n=new Set,s=new Set,o=0,a=u=>{s.add(u.output),t&&t.onResult&&t.onResult(u)};for(let u=0;u!i.has(u));if(t&&c.length===0){if(t.failglob===!0)throw new Error(`No matches found for "${e.join(", ")}"`);if(t.nonull===!0||t.nullglob===!0)return t.unescape?e.map(u=>u.replace(/\\/g,"")):e}return c};Pr.match=Pr;Pr.matcher=(r,e)=>Wo(r,e);Pr.isMatch=(r,e,t)=>Wo(e,t)(r);Pr.any=Pr.isMatch;Pr.not=(r,e,t={})=>{e=[].concat(e).map(String);let i=new Set,n=[],s=a=>{t.onResult&&t.onResult(a),n.push(a.output)},o=Pr(r,e,te(N({},t),{onResult:s}));for(let a of n)o.includes(a)||i.add(a);return[...i]};Pr.contains=(r,e,t)=>{if(typeof r!="string")throw new TypeError(`Expected a string: "${Uq.inspect(r)}"`);if(Array.isArray(e))return e.some(i=>Pr.contains(r,i,t));if(typeof e=="string"){if(jq(r)||jq(e))return!1;if(r.includes(e)||r.startsWith("./")&&r.slice(2).includes(e))return!0}return Pr.isMatch(r,e,te(N({},t),{contains:!0}))};Pr.matchKeys=(r,e,t)=>{if(!vv.isObject(r))throw new TypeError("Expected the first argument to be an object");let i=Pr(Object.keys(r),e,t),n={};for(let s of i)n[s]=r[s];return n};Pr.some=(r,e,t)=>{let i=[].concat(r);for(let n of[].concat(e)){let s=Wo(String(n),t);if(i.some(o=>s(o)))return!0}return!1};Pr.every=(r,e,t)=>{let i=[].concat(r);for(let n of[].concat(e)){let s=Wo(String(n),t);if(!i.every(o=>s(o)))return!1}return!0};Pr.all=(r,e,t)=>{if(typeof r!="string")throw new TypeError(`Expected a string: "${Uq.inspect(r)}"`);return[].concat(e).every(i=>Wo(i,t)(r))};Pr.capture=(r,e,t)=>{let i=vv.isWindows(t),s=Wo.makeRe(String(r),te(N({},t),{capture:!0})).exec(i?vv.toPosixSlashes(e):e);if(s)return s.slice(1).map(o=>o===void 0?"":o)};Pr.makeRe=(...r)=>Wo.makeRe(...r);Pr.scan=(...r)=>Wo.scan(...r);Pr.parse=(r,e)=>{let t=[];for(let i of[].concat(r||[]))for(let n of Hq(String(i),e))t.push(Wo.parse(n,e));return t};Pr.braces=(r,e)=>{if(typeof r!="string")throw new TypeError("Expected a string");return e&&e.nobrace===!0||!/\{.*\}/.test(r)?[r]:Hq(r,e)};Pr.braceExpand=(r,e)=>{if(typeof r!="string")throw new TypeError("Expected a string");return Pr.braces(r,te(N({},e),{expand:!0}))};Kq.exports=Pr});var Yq=w((ket,Gq)=>{"use strict";Gq.exports=({onlyFirst:r=!1}={})=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,r?void 0:"g")}});var Jq=w((Pet,qq)=>{"use strict";var xBe=Yq();qq.exports=r=>typeof r=="string"?r.replace(xBe(),""):r});var AJ=w((zet,aJ)=>{"use strict";aJ.exports=(...r)=>[...new Set([].concat(...r))]});var jv=w((_et,lJ)=>{"use strict";var UBe=require("stream"),cJ=UBe.PassThrough,HBe=Array.prototype.slice;lJ.exports=jBe;function jBe(){let r=[],e=!1,t=HBe.call(arguments),i=t[t.length-1];i&&!Array.isArray(i)&&i.pipe==null?t.pop():i={};let n=i.end!==!1;i.objectMode==null&&(i.objectMode=!0),i.highWaterMark==null&&(i.highWaterMark=64*1024);let s=cJ(i);function o(){for(let c=0,u=arguments.length;c0||(e=!1,a())}function f(h){function p(){h.removeListener("merge2UnpipeEnd",p),h.removeListener("end",p),g()}if(h._readableState.endEmitted)return g();h.on("merge2UnpipeEnd",p),h.on("end",p),h.pipe(s,{end:!1}),h.resume()}for(let h=0;h{"use strict";Object.defineProperty(Fy,"__esModule",{value:!0});function GBe(r){return r.reduce((e,t)=>[].concat(e,t),[])}Fy.flatten=GBe;function YBe(r,e){let t=[[]],i=0;for(let n of r)e(n)?(i++,t[i]=[]):t[i].push(n);return t}Fy.splitWhen=YBe});var fJ=w(Gv=>{"use strict";Object.defineProperty(Gv,"__esModule",{value:!0});function qBe(r){return r.code==="ENOENT"}Gv.isEnoentCodeError=qBe});var pJ=w(Yv=>{"use strict";Object.defineProperty(Yv,"__esModule",{value:!0});var hJ=class{constructor(e,t){this.name=e,this.isBlockDevice=t.isBlockDevice.bind(t),this.isCharacterDevice=t.isCharacterDevice.bind(t),this.isDirectory=t.isDirectory.bind(t),this.isFIFO=t.isFIFO.bind(t),this.isFile=t.isFile.bind(t),this.isSocket=t.isSocket.bind(t),this.isSymbolicLink=t.isSymbolicLink.bind(t)}};function JBe(r,e){return new hJ(r,e)}Yv.createDirentFromStats=JBe});var dJ=w(Kg=>{"use strict";Object.defineProperty(Kg,"__esModule",{value:!0});var WBe=require("path"),zBe=2,_Be=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\())/g;function VBe(r){return r.replace(/\\/g,"/")}Kg.unixify=VBe;function XBe(r,e){return WBe.resolve(r,e)}Kg.makeAbsolute=XBe;function ZBe(r){return r.replace(_Be,"\\$2")}Kg.escape=ZBe;function $Be(r){if(r.charAt(0)==="."){let e=r.charAt(1);if(e==="/"||e==="\\")return r.slice(zBe)}return r}Kg.removeLeadingDotSegment=$Be});var mJ=w((ett,CJ)=>{CJ.exports=function(e){if(typeof e!="string"||e==="")return!1;for(var t;t=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(t[2])return!0;e=e.slice(t.index+t[0].length)}return!1}});var yJ=w((ttt,EJ)=>{var e0e=mJ(),IJ={"{":"}","(":")","[":"]"},t0e=function(r){if(r[0]==="!")return!0;for(var e=0,t=-2,i=-2,n=-2,s=-2,o=-2;ee&&(o===-1||o>i||(o=r.indexOf("\\",e),o===-1||o>i)))||n!==-1&&r[e]==="{"&&r[e+1]!=="}"&&(n=r.indexOf("}",e),n>e&&(o=r.indexOf("\\",e),o===-1||o>n))||s!==-1&&r[e]==="("&&r[e+1]==="?"&&/[:!=]/.test(r[e+2])&&r[e+3]!==")"&&(s=r.indexOf(")",e),s>e&&(o=r.indexOf("\\",e),o===-1||o>s))||t!==-1&&r[e]==="("&&r[e+1]!=="|"&&(tt&&(o=r.indexOf("\\",t),o===-1||o>s))))return!0;if(r[e]==="\\"){var a=r[e+1];e+=2;var l=IJ[a];if(l){var c=r.indexOf(l,e);c!==-1&&(e=c+1)}if(r[e]==="!")return!0}else e++}return!1},r0e=function(r){if(r[0]==="!")return!0;for(var e=0;e{"use strict";var i0e=yJ(),n0e=require("path").posix.dirname,s0e=require("os").platform()==="win32",qv="/",o0e=/\\/g,a0e=/[\{\[].*[\}\]]$/,A0e=/(^|[^\\])([\{\[]|\([^\)]+$)/,l0e=/\\([\!\*\?\|\[\]\(\)\{\}])/g;wJ.exports=function(e,t){var i=Object.assign({flipBackslashes:!0},t);i.flipBackslashes&&s0e&&e.indexOf(qv)<0&&(e=e.replace(o0e,qv)),a0e.test(e)&&(e+=qv),e+="a";do e=n0e(e);while(i0e(e)||A0e.test(e));return e.replace(l0e,"$1")}});var RJ=w(si=>{"use strict";Object.defineProperty(si,"__esModule",{value:!0});var c0e=require("path"),u0e=BJ(),bJ=is(),g0e=Sv(),QJ="**",f0e="\\",h0e=/[*?]|^!/,p0e=/\[.*]/,d0e=/(?:^|[^!*+?@])\(.*\|.*\)/,C0e=/[!*+?@]\(.*\)/,m0e=/{.*(?:,|\.\.).*}/;function vJ(r,e={}){return!SJ(r,e)}si.isStaticPattern=vJ;function SJ(r,e={}){return!!(e.caseSensitiveMatch===!1||r.includes(f0e)||h0e.test(r)||p0e.test(r)||d0e.test(r)||e.extglob!==!1&&C0e.test(r)||e.braceExpansion!==!1&&m0e.test(r))}si.isDynamicPattern=SJ;function E0e(r){return Ny(r)?r.slice(1):r}si.convertToPositivePattern=E0e;function I0e(r){return"!"+r}si.convertToNegativePattern=I0e;function Ny(r){return r.startsWith("!")&&r[1]!=="("}si.isNegativePattern=Ny;function xJ(r){return!Ny(r)}si.isPositivePattern=xJ;function y0e(r){return r.filter(Ny)}si.getNegativePatterns=y0e;function w0e(r){return r.filter(xJ)}si.getPositivePatterns=w0e;function B0e(r){return u0e(r,{flipBackslashes:!1})}si.getBaseDirectory=B0e;function b0e(r){return r.includes(QJ)}si.hasGlobStar=b0e;function kJ(r){return r.endsWith("/"+QJ)}si.endsWithSlashGlobStar=kJ;function Q0e(r){let e=c0e.basename(r);return kJ(r)||vJ(e)}si.isAffectDepthOfReadingPattern=Q0e;function S0e(r){return r.reduce((e,t)=>e.concat(PJ(t)),[])}si.expandPatternsWithBraceExpansion=S0e;function PJ(r){return bJ.braces(r,{expand:!0,nodupes:!0})}si.expandBraceExpansion=PJ;function v0e(r,e){let t=g0e.scan(r,Object.assign(Object.assign({},e),{parts:!0}));return t.parts.length===0?[r]:t.parts}si.getPatternParts=v0e;function DJ(r,e){return bJ.makeRe(r,e)}si.makeRe=DJ;function x0e(r,e){return r.map(t=>DJ(t,e))}si.convertPatternsToRe=x0e;function k0e(r,e){return e.some(t=>t.test(r))}si.matchAny=k0e});var NJ=w(Jv=>{"use strict";Object.defineProperty(Jv,"__esModule",{value:!0});var P0e=jv();function D0e(r){let e=P0e(r);return r.forEach(t=>{t.once("error",i=>e.emit("error",i))}),e.once("close",()=>FJ(r)),e.once("end",()=>FJ(r)),e}Jv.merge=D0e;function FJ(r){r.forEach(e=>e.emit("close"))}});var LJ=w(Ly=>{"use strict";Object.defineProperty(Ly,"__esModule",{value:!0});function R0e(r){return typeof r=="string"}Ly.isString=R0e;function F0e(r){return r===""}Ly.isEmpty=F0e});var Xa=w(Va=>{"use strict";Object.defineProperty(Va,"__esModule",{value:!0});var N0e=gJ();Va.array=N0e;var L0e=fJ();Va.errno=L0e;var T0e=pJ();Va.fs=T0e;var O0e=dJ();Va.path=O0e;var M0e=RJ();Va.pattern=M0e;var K0e=NJ();Va.stream=K0e;var U0e=LJ();Va.string=U0e});var UJ=w(Za=>{"use strict";Object.defineProperty(Za,"__esModule",{value:!0});var Mc=Xa();function H0e(r,e){let t=TJ(r),i=OJ(r,e.ignore),n=t.filter(l=>Mc.pattern.isStaticPattern(l,e)),s=t.filter(l=>Mc.pattern.isDynamicPattern(l,e)),o=Wv(n,i,!1),a=Wv(s,i,!0);return o.concat(a)}Za.generate=H0e;function Wv(r,e,t){let i=MJ(r);return"."in i?[zv(".",r,e,t)]:KJ(i,e,t)}Za.convertPatternsToTasks=Wv;function TJ(r){return Mc.pattern.getPositivePatterns(r)}Za.getPositivePatterns=TJ;function OJ(r,e){return Mc.pattern.getNegativePatterns(r).concat(e).map(Mc.pattern.convertToPositivePattern)}Za.getNegativePatternsAsPositive=OJ;function MJ(r){let e={};return r.reduce((t,i)=>{let n=Mc.pattern.getBaseDirectory(i);return n in t?t[n].push(i):t[n]=[i],t},e)}Za.groupPatternsByBaseDirectory=MJ;function KJ(r,e,t){return Object.keys(r).map(i=>zv(i,r[i],e,t))}Za.convertPatternGroupsToTasks=KJ;function zv(r,e,t,i){return{dynamic:i,positive:e,negative:t,base:r,patterns:[].concat(e,t.map(Mc.pattern.convertToNegativePattern))}}Za.convertPatternGroupToTask=zv});var jJ=w(Ty=>{"use strict";Object.defineProperty(Ty,"__esModule",{value:!0});Ty.read=void 0;function j0e(r,e,t){e.fs.lstat(r,(i,n)=>{if(i!==null){HJ(t,i);return}if(!n.isSymbolicLink()||!e.followSymbolicLink){_v(t,n);return}e.fs.stat(r,(s,o)=>{if(s!==null){if(e.throwErrorOnBrokenSymbolicLink){HJ(t,s);return}_v(t,n);return}e.markSymbolicLink&&(o.isSymbolicLink=()=>!0),_v(t,o)})})}Ty.read=j0e;function HJ(r,e){r(e)}function _v(r,e){r(null,e)}});var GJ=w(Oy=>{"use strict";Object.defineProperty(Oy,"__esModule",{value:!0});Oy.read=void 0;function G0e(r,e){let t=e.fs.lstatSync(r);if(!t.isSymbolicLink()||!e.followSymbolicLink)return t;try{let i=e.fs.statSync(r);return e.markSymbolicLink&&(i.isSymbolicLink=()=>!0),i}catch(i){if(!e.throwErrorOnBrokenSymbolicLink)return t;throw i}}Oy.read=G0e});var YJ=w(rl=>{"use strict";Object.defineProperty(rl,"__esModule",{value:!0});rl.createFileSystemAdapter=rl.FILE_SYSTEM_ADAPTER=void 0;var My=require("fs");rl.FILE_SYSTEM_ADAPTER={lstat:My.lstat,stat:My.stat,lstatSync:My.lstatSync,statSync:My.statSync};function Y0e(r){return r===void 0?rl.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},rl.FILE_SYSTEM_ADAPTER),r)}rl.createFileSystemAdapter=Y0e});var JJ=w(Vv=>{"use strict";Object.defineProperty(Vv,"__esModule",{value:!0});var q0e=YJ(),qJ=class{constructor(e={}){this._options=e,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=q0e.createFileSystemAdapter(this._options.fs),this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0)}_getValue(e,t){return e!=null?e:t}};Vv.default=qJ});var Kc=w(il=>{"use strict";Object.defineProperty(il,"__esModule",{value:!0});il.statSync=il.stat=il.Settings=void 0;var WJ=jJ(),J0e=GJ(),Xv=JJ();il.Settings=Xv.default;function W0e(r,e,t){if(typeof e=="function"){WJ.read(r,Zv(),e);return}WJ.read(r,Zv(e),t)}il.stat=W0e;function z0e(r,e){let t=Zv(e);return J0e.read(r,t)}il.statSync=z0e;function Zv(r={}){return r instanceof Xv.default?r:new Xv.default(r)}});var _J=w((ftt,zJ)=>{zJ.exports=_0e;function _0e(r,e){var t,i,n,s=!0;Array.isArray(r)?(t=[],i=r.length):(n=Object.keys(r),t={},i=n.length);function o(l){function c(){e&&e(l,t),e=null}s?process.nextTick(c):c()}function a(l,c,u){t[l]=u,(--i==0||c)&&o(c)}i?n?n.forEach(function(l){r[l](function(c,u){a(l,c,u)})}):r.forEach(function(l,c){l(function(u,g){a(c,u,g)})}):o(null),s=!1}});var $v=w(Ky=>{"use strict";Object.defineProperty(Ky,"__esModule",{value:!0});Ky.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;var Uy=process.versions.node.split(".");if(Uy[0]===void 0||Uy[1]===void 0)throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);var VJ=Number.parseInt(Uy[0],10),V0e=Number.parseInt(Uy[1],10),XJ=10,X0e=10,Z0e=VJ>XJ,$0e=VJ===XJ&&V0e>=X0e;Ky.IS_SUPPORT_READDIR_WITH_FILE_TYPES=Z0e||$0e});var $J=w(Hy=>{"use strict";Object.defineProperty(Hy,"__esModule",{value:!0});Hy.createDirentFromStats=void 0;var ZJ=class{constructor(e,t){this.name=e,this.isBlockDevice=t.isBlockDevice.bind(t),this.isCharacterDevice=t.isCharacterDevice.bind(t),this.isDirectory=t.isDirectory.bind(t),this.isFIFO=t.isFIFO.bind(t),this.isFile=t.isFile.bind(t),this.isSocket=t.isSocket.bind(t),this.isSymbolicLink=t.isSymbolicLink.bind(t)}};function ebe(r,e){return new ZJ(r,e)}Hy.createDirentFromStats=ebe});var ex=w(jy=>{"use strict";Object.defineProperty(jy,"__esModule",{value:!0});jy.fs=void 0;var tbe=$J();jy.fs=tbe});var tx=w(Gy=>{"use strict";Object.defineProperty(Gy,"__esModule",{value:!0});Gy.joinPathSegments=void 0;function rbe(r,e,t){return r.endsWith(t)?r+e:r+t+e}Gy.joinPathSegments=rbe});var s3=w(nl=>{"use strict";Object.defineProperty(nl,"__esModule",{value:!0});nl.readdir=nl.readdirWithFileTypes=nl.read=void 0;var ibe=Kc(),e3=_J(),nbe=$v(),t3=ex(),r3=tx();function sbe(r,e,t){if(!e.stats&&nbe.IS_SUPPORT_READDIR_WITH_FILE_TYPES){i3(r,e,t);return}n3(r,e,t)}nl.read=sbe;function i3(r,e,t){e.fs.readdir(r,{withFileTypes:!0},(i,n)=>{if(i!==null){Yy(t,i);return}let s=n.map(a=>({dirent:a,name:a.name,path:r3.joinPathSegments(r,a.name,e.pathSegmentSeparator)}));if(!e.followSymbolicLinks){rx(t,s);return}let o=s.map(a=>obe(a,e));e3(o,(a,l)=>{if(a!==null){Yy(t,a);return}rx(t,l)})})}nl.readdirWithFileTypes=i3;function obe(r,e){return t=>{if(!r.dirent.isSymbolicLink()){t(null,r);return}e.fs.stat(r.path,(i,n)=>{if(i!==null){if(e.throwErrorOnBrokenSymbolicLink){t(i);return}t(null,r);return}r.dirent=t3.fs.createDirentFromStats(r.name,n),t(null,r)})}}function n3(r,e,t){e.fs.readdir(r,(i,n)=>{if(i!==null){Yy(t,i);return}let s=n.map(o=>{let a=r3.joinPathSegments(r,o,e.pathSegmentSeparator);return l=>{ibe.stat(a,e.fsStatSettings,(c,u)=>{if(c!==null){l(c);return}let g={name:o,path:a,dirent:t3.fs.createDirentFromStats(o,u)};e.stats&&(g.stats=u),l(null,g)})}});e3(s,(o,a)=>{if(o!==null){Yy(t,o);return}rx(t,a)})})}nl.readdir=n3;function Yy(r,e){r(e)}function rx(r,e){r(null,e)}});var c3=w(sl=>{"use strict";Object.defineProperty(sl,"__esModule",{value:!0});sl.readdir=sl.readdirWithFileTypes=sl.read=void 0;var abe=Kc(),Abe=$v(),o3=ex(),a3=tx();function lbe(r,e){return!e.stats&&Abe.IS_SUPPORT_READDIR_WITH_FILE_TYPES?A3(r,e):l3(r,e)}sl.read=lbe;function A3(r,e){return e.fs.readdirSync(r,{withFileTypes:!0}).map(i=>{let n={dirent:i,name:i.name,path:a3.joinPathSegments(r,i.name,e.pathSegmentSeparator)};if(n.dirent.isSymbolicLink()&&e.followSymbolicLinks)try{let s=e.fs.statSync(n.path);n.dirent=o3.fs.createDirentFromStats(n.name,s)}catch(s){if(e.throwErrorOnBrokenSymbolicLink)throw s}return n})}sl.readdirWithFileTypes=A3;function l3(r,e){return e.fs.readdirSync(r).map(i=>{let n=a3.joinPathSegments(r,i,e.pathSegmentSeparator),s=abe.statSync(n,e.fsStatSettings),o={name:i,path:n,dirent:o3.fs.createDirentFromStats(i,s)};return e.stats&&(o.stats=s),o})}sl.readdir=l3});var u3=w(ol=>{"use strict";Object.defineProperty(ol,"__esModule",{value:!0});ol.createFileSystemAdapter=ol.FILE_SYSTEM_ADAPTER=void 0;var Ug=require("fs");ol.FILE_SYSTEM_ADAPTER={lstat:Ug.lstat,stat:Ug.stat,lstatSync:Ug.lstatSync,statSync:Ug.statSync,readdir:Ug.readdir,readdirSync:Ug.readdirSync};function cbe(r){return r===void 0?ol.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},ol.FILE_SYSTEM_ADAPTER),r)}ol.createFileSystemAdapter=cbe});var f3=w(ix=>{"use strict";Object.defineProperty(ix,"__esModule",{value:!0});var ube=require("path"),gbe=Kc(),fbe=u3(),g3=class{constructor(e={}){this._options=e,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=fbe.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,ube.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new gbe.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(e,t){return e!=null?e:t}};ix.default=g3});var qy=w(al=>{"use strict";Object.defineProperty(al,"__esModule",{value:!0});al.Settings=al.scandirSync=al.scandir=void 0;var h3=s3(),hbe=c3(),nx=f3();al.Settings=nx.default;function pbe(r,e,t){if(typeof e=="function"){h3.read(r,sx(),e);return}h3.read(r,sx(e),t)}al.scandir=pbe;function dbe(r,e){let t=sx(e);return hbe.read(r,t)}al.scandirSync=dbe;function sx(r={}){return r instanceof nx.default?r:new nx.default(r)}});var d3=w((Btt,p3)=>{"use strict";function Cbe(r){var e=new r,t=e;function i(){var s=e;return s.next?e=s.next:(e=new r,t=e),s.next=null,s}function n(s){t.next=s,t=s}return{get:i,release:n}}p3.exports=Cbe});var m3=w((btt,ox)=>{"use strict";var mbe=d3();function C3(r,e,t){if(typeof r=="function"&&(t=e,e=r,r=null),t<1)throw new Error("fastqueue concurrency must be greater than 1");var i=mbe(Ebe),n=null,s=null,o=0,a=null,l={push:m,drain:Vo,saturated:Vo,pause:u,paused:!1,concurrency:t,running:c,resume:h,idle:p,length:g,getQueue:f,unshift:y,empty:Vo,kill:v,killAndDrain:x,error:T};return l;function c(){return o}function u(){l.paused=!0}function g(){for(var q=n,Y=0;q;)q=q.next,Y++;return Y}function f(){for(var q=n,Y=[];q;)Y.push(q.value),q=q.next;return Y}function h(){if(!!l.paused){l.paused=!1;for(var q=0;q{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});Xo.joinPathSegments=Xo.replacePathSegmentSeparator=Xo.isAppliedFilter=Xo.isFatalError=void 0;function ybe(r,e){return r.errorFilter===null?!0:!r.errorFilter(e)}Xo.isFatalError=ybe;function wbe(r,e){return r===null||r(e)}Xo.isAppliedFilter=wbe;function Bbe(r,e){return r.split(/[/\\]/).join(e)}Xo.replacePathSegmentSeparator=Bbe;function bbe(r,e,t){return r===""?e:r.endsWith(t)?r+e:r+t+e}Xo.joinPathSegments=bbe});var Ax=w(ax=>{"use strict";Object.defineProperty(ax,"__esModule",{value:!0});var Qbe=Jy(),E3=class{constructor(e,t){this._root=e,this._settings=t,this._root=Qbe.replacePathSegmentSeparator(e,t.pathSegmentSeparator)}};ax.default=E3});var cx=w(lx=>{"use strict";Object.defineProperty(lx,"__esModule",{value:!0});var Sbe=require("events"),vbe=qy(),xbe=m3(),Wy=Jy(),kbe=Ax(),I3=class extends kbe.default{constructor(e,t){super(e,t);this._settings=t,this._scandir=vbe.scandir,this._emitter=new Sbe.EventEmitter,this._queue=xbe(this._worker.bind(this),this._settings.concurrency),this._isFatalError=!1,this._isDestroyed=!1,this._queue.drain=()=>{this._isFatalError||this._emitter.emit("end")}}read(){return this._isFatalError=!1,this._isDestroyed=!1,setImmediate(()=>{this._pushToQueue(this._root,this._settings.basePath)}),this._emitter}get isDestroyed(){return this._isDestroyed}destroy(){if(this._isDestroyed)throw new Error("The reader is already destroyed");this._isDestroyed=!0,this._queue.killAndDrain()}onEntry(e){this._emitter.on("entry",e)}onError(e){this._emitter.once("error",e)}onEnd(e){this._emitter.once("end",e)}_pushToQueue(e,t){let i={directory:e,base:t};this._queue.push(i,n=>{n!==null&&this._handleError(n)})}_worker(e,t){this._scandir(e.directory,this._settings.fsScandirSettings,(i,n)=>{if(i!==null){t(i,void 0);return}for(let s of n)this._handleEntry(s,e.base);t(null,void 0)})}_handleError(e){this._isDestroyed||!Wy.isFatalError(this._settings,e)||(this._isFatalError=!0,this._isDestroyed=!0,this._emitter.emit("error",e))}_handleEntry(e,t){if(this._isDestroyed||this._isFatalError)return;let i=e.path;t!==void 0&&(e.path=Wy.joinPathSegments(t,e.name,this._settings.pathSegmentSeparator)),Wy.isAppliedFilter(this._settings.entryFilter,e)&&this._emitEntry(e),e.dirent.isDirectory()&&Wy.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(i,e.path)}_emitEntry(e){this._emitter.emit("entry",e)}};lx.default=I3});var w3=w(ux=>{"use strict";Object.defineProperty(ux,"__esModule",{value:!0});var Pbe=cx(),y3=class{constructor(e,t){this._root=e,this._settings=t,this._reader=new Pbe.default(this._root,this._settings),this._storage=new Set}read(e){this._reader.onError(t=>{Dbe(e,t)}),this._reader.onEntry(t=>{this._storage.add(t)}),this._reader.onEnd(()=>{Rbe(e,[...this._storage])}),this._reader.read()}};ux.default=y3;function Dbe(r,e){r(e)}function Rbe(r,e){r(null,e)}});var b3=w(gx=>{"use strict";Object.defineProperty(gx,"__esModule",{value:!0});var Fbe=require("stream"),Nbe=cx(),B3=class{constructor(e,t){this._root=e,this._settings=t,this._reader=new Nbe.default(this._root,this._settings),this._stream=new Fbe.Readable({objectMode:!0,read:()=>{},destroy:()=>{this._reader.isDestroyed||this._reader.destroy()}})}read(){return this._reader.onError(e=>{this._stream.emit("error",e)}),this._reader.onEntry(e=>{this._stream.push(e)}),this._reader.onEnd(()=>{this._stream.push(null)}),this._reader.read(),this._stream}};gx.default=B3});var S3=w(fx=>{"use strict";Object.defineProperty(fx,"__esModule",{value:!0});var Lbe=qy(),zy=Jy(),Tbe=Ax(),Q3=class extends Tbe.default{constructor(){super(...arguments);this._scandir=Lbe.scandirSync,this._storage=new Set,this._queue=new Set}read(){return this._pushToQueue(this._root,this._settings.basePath),this._handleQueue(),[...this._storage]}_pushToQueue(e,t){this._queue.add({directory:e,base:t})}_handleQueue(){for(let e of this._queue.values())this._handleDirectory(e.directory,e.base)}_handleDirectory(e,t){try{let i=this._scandir(e,this._settings.fsScandirSettings);for(let n of i)this._handleEntry(n,t)}catch(i){this._handleError(i)}}_handleError(e){if(!!zy.isFatalError(this._settings,e))throw e}_handleEntry(e,t){let i=e.path;t!==void 0&&(e.path=zy.joinPathSegments(t,e.name,this._settings.pathSegmentSeparator)),zy.isAppliedFilter(this._settings.entryFilter,e)&&this._pushToStorage(e),e.dirent.isDirectory()&&zy.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(i,e.path)}_pushToStorage(e){this._storage.add(e)}};fx.default=Q3});var x3=w(hx=>{"use strict";Object.defineProperty(hx,"__esModule",{value:!0});var Obe=S3(),v3=class{constructor(e,t){this._root=e,this._settings=t,this._reader=new Obe.default(this._root,this._settings)}read(){return this._reader.read()}};hx.default=v3});var P3=w(px=>{"use strict";Object.defineProperty(px,"__esModule",{value:!0});var Mbe=require("path"),Kbe=qy(),k3=class{constructor(e={}){this._options=e,this.basePath=this._getValue(this._options.basePath,void 0),this.concurrency=this._getValue(this._options.concurrency,Number.POSITIVE_INFINITY),this.deepFilter=this._getValue(this._options.deepFilter,null),this.entryFilter=this._getValue(this._options.entryFilter,null),this.errorFilter=this._getValue(this._options.errorFilter,null),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,Mbe.sep),this.fsScandirSettings=new Kbe.Settings({followSymbolicLinks:this._options.followSymbolicLinks,fs:this._options.fs,pathSegmentSeparator:this._options.pathSegmentSeparator,stats:this._options.stats,throwErrorOnBrokenSymbolicLink:this._options.throwErrorOnBrokenSymbolicLink})}_getValue(e,t){return e!=null?e:t}};px.default=k3});var Cx=w(Zo=>{"use strict";Object.defineProperty(Zo,"__esModule",{value:!0});Zo.Settings=Zo.walkStream=Zo.walkSync=Zo.walk=void 0;var D3=w3(),Ube=b3(),Hbe=x3(),dx=P3();Zo.Settings=dx.default;function jbe(r,e,t){if(typeof e=="function"){new D3.default(r,_y()).read(e);return}new D3.default(r,_y(e)).read(t)}Zo.walk=jbe;function Gbe(r,e){let t=_y(e);return new Hbe.default(r,t).read()}Zo.walkSync=Gbe;function Ybe(r,e){let t=_y(e);return new Ube.default(r,t).read()}Zo.walkStream=Ybe;function _y(r={}){return r instanceof dx.default?r:new dx.default(r)}});var Ex=w(mx=>{"use strict";Object.defineProperty(mx,"__esModule",{value:!0});var qbe=require("path"),Jbe=Kc(),R3=Xa(),F3=class{constructor(e){this._settings=e,this._fsStatSettings=new Jbe.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(e){return qbe.resolve(this._settings.cwd,e)}_makeEntry(e,t){let i={name:t,path:t,dirent:R3.fs.createDirentFromStats(t,e)};return this._settings.stats&&(i.stats=e),i}_isFatalError(e){return!R3.errno.isEnoentCodeError(e)&&!this._settings.suppressErrors}};mx.default=F3});var yx=w(Ix=>{"use strict";Object.defineProperty(Ix,"__esModule",{value:!0});var Wbe=require("stream"),zbe=Kc(),_be=Cx(),Vbe=Ex(),N3=class extends Vbe.default{constructor(){super(...arguments);this._walkStream=_be.walkStream,this._stat=zbe.stat}dynamic(e,t){return this._walkStream(e,t)}static(e,t){let i=e.map(this._getFullEntryPath,this),n=new Wbe.PassThrough({objectMode:!0});n._write=(s,o,a)=>this._getEntry(i[s],e[s],t).then(l=>{l!==null&&t.entryFilter(l)&&n.push(l),s===i.length-1&&n.end(),a()}).catch(a);for(let s=0;sthis._makeEntry(n,t)).catch(n=>{if(i.errorFilter(n))return null;throw n})}_getStat(e){return new Promise((t,i)=>{this._stat(e,this._fsStatSettings,(n,s)=>n===null?t(s):i(n))})}};Ix.default=N3});var T3=w(wx=>{"use strict";Object.defineProperty(wx,"__esModule",{value:!0});var Hg=Xa(),L3=class{constructor(e,t,i){this._patterns=e,this._settings=t,this._micromatchOptions=i,this._storage=[],this._fillStorage()}_fillStorage(){let e=Hg.pattern.expandPatternsWithBraceExpansion(this._patterns);for(let t of e){let i=this._getPatternSegments(t),n=this._splitSegmentsIntoSections(i);this._storage.push({complete:n.length<=1,pattern:t,segments:i,sections:n})}}_getPatternSegments(e){return Hg.pattern.getPatternParts(e,this._micromatchOptions).map(i=>Hg.pattern.isDynamicPattern(i,this._settings)?{dynamic:!0,pattern:i,patternRe:Hg.pattern.makeRe(i,this._micromatchOptions)}:{dynamic:!1,pattern:i})}_splitSegmentsIntoSections(e){return Hg.array.splitWhen(e,t=>t.dynamic&&Hg.pattern.hasGlobStar(t.pattern))}};wx.default=L3});var M3=w(Bx=>{"use strict";Object.defineProperty(Bx,"__esModule",{value:!0});var Xbe=T3(),O3=class extends Xbe.default{match(e){let t=e.split("/"),i=t.length,n=this._storage.filter(s=>!s.complete||s.segments.length>i);for(let s of n){let o=s.sections[0];if(!s.complete&&i>o.length||t.every((l,c)=>{let u=s.segments[c];return!!(u.dynamic&&u.patternRe.test(l)||!u.dynamic&&u.pattern===l)}))return!0}return!1}};Bx.default=O3});var U3=w(bx=>{"use strict";Object.defineProperty(bx,"__esModule",{value:!0});var Vy=Xa(),Zbe=M3(),K3=class{constructor(e,t){this._settings=e,this._micromatchOptions=t}getFilter(e,t,i){let n=this._getMatcher(t),s=this._getNegativePatternsRe(i);return o=>this._filter(e,o,n,s)}_getMatcher(e){return new Zbe.default(e,this._settings,this._micromatchOptions)}_getNegativePatternsRe(e){let t=e.filter(Vy.pattern.isAffectDepthOfReadingPattern);return Vy.pattern.convertPatternsToRe(t,this._micromatchOptions)}_filter(e,t,i,n){let s=this._getEntryLevel(e,t.path);if(this._isSkippedByDeep(s)||this._isSkippedSymbolicLink(t))return!1;let o=Vy.path.removeLeadingDotSegment(t.path);return this._isSkippedByPositivePatterns(o,i)?!1:this._isSkippedByNegativePatterns(o,n)}_isSkippedByDeep(e){return e>=this._settings.deep}_isSkippedSymbolicLink(e){return!this._settings.followSymbolicLinks&&e.dirent.isSymbolicLink()}_getEntryLevel(e,t){let i=e.split("/").length;return t.split("/").length-(e===""?0:i)}_isSkippedByPositivePatterns(e,t){return!this._settings.baseNameMatch&&!t.match(e)}_isSkippedByNegativePatterns(e,t){return!Vy.pattern.matchAny(e,t)}};bx.default=K3});var j3=w(Qx=>{"use strict";Object.defineProperty(Qx,"__esModule",{value:!0});var sd=Xa(),H3=class{constructor(e,t){this._settings=e,this._micromatchOptions=t,this.index=new Map}getFilter(e,t){let i=sd.pattern.convertPatternsToRe(e,this._micromatchOptions),n=sd.pattern.convertPatternsToRe(t,this._micromatchOptions);return s=>this._filter(s,i,n)}_filter(e,t,i){if(this._settings.unique){if(this._isDuplicateEntry(e))return!1;this._createIndexRecord(e)}if(this._onlyFileFilter(e)||this._onlyDirectoryFilter(e)||this._isSkippedByAbsoluteNegativePatterns(e,i))return!1;let n=this._settings.baseNameMatch?e.name:e.path;return this._isMatchToPatterns(n,t)&&!this._isMatchToPatterns(e.path,i)}_isDuplicateEntry(e){return this.index.has(e.path)}_createIndexRecord(e){this.index.set(e.path,void 0)}_onlyFileFilter(e){return this._settings.onlyFiles&&!e.dirent.isFile()}_onlyDirectoryFilter(e){return this._settings.onlyDirectories&&!e.dirent.isDirectory()}_isSkippedByAbsoluteNegativePatterns(e,t){if(!this._settings.absolute)return!1;let i=sd.path.makeAbsolute(this._settings.cwd,e.path);return this._isMatchToPatterns(i,t)}_isMatchToPatterns(e,t){let i=sd.path.removeLeadingDotSegment(e);return sd.pattern.matchAny(i,t)}};Qx.default=H3});var Y3=w(Sx=>{"use strict";Object.defineProperty(Sx,"__esModule",{value:!0});var $be=Xa(),G3=class{constructor(e){this._settings=e}getFilter(){return e=>this._isNonFatalError(e)}_isNonFatalError(e){return $be.errno.isEnoentCodeError(e)||this._settings.suppressErrors}};Sx.default=G3});var W3=w(vx=>{"use strict";Object.defineProperty(vx,"__esModule",{value:!0});var q3=Xa(),J3=class{constructor(e){this._settings=e}getTransformer(){return e=>this._transform(e)}_transform(e){let t=e.path;return this._settings.absolute&&(t=q3.path.makeAbsolute(this._settings.cwd,t),t=q3.path.unixify(t)),this._settings.markDirectories&&e.dirent.isDirectory()&&(t+="/"),this._settings.objectMode?Object.assign(Object.assign({},e),{path:t}):t}};vx.default=J3});var Xy=w(xx=>{"use strict";Object.defineProperty(xx,"__esModule",{value:!0});var eQe=require("path"),tQe=U3(),rQe=j3(),iQe=Y3(),nQe=W3(),z3=class{constructor(e){this._settings=e,this.errorFilter=new iQe.default(this._settings),this.entryFilter=new rQe.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new tQe.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new nQe.default(this._settings)}_getRootDirectory(e){return eQe.resolve(this._settings.cwd,e.base)}_getReaderOptions(e){let t=e.base==="."?"":e.base;return{basePath:t,pathSegmentSeparator:"/",concurrency:this._settings.concurrency,deepFilter:this.deepFilter.getFilter(t,e.positive,e.negative),entryFilter:this.entryFilter.getFilter(e.positive,e.negative),errorFilter:this.errorFilter.getFilter(),followSymbolicLinks:this._settings.followSymbolicLinks,fs:this._settings.fs,stats:this._settings.stats,throwErrorOnBrokenSymbolicLink:this._settings.throwErrorOnBrokenSymbolicLink,transform:this.entryTransformer.getTransformer()}}_getMicromatchOptions(){return{dot:this._settings.dot,matchBase:this._settings.baseNameMatch,nobrace:!this._settings.braceExpansion,nocase:!this._settings.caseSensitiveMatch,noext:!this._settings.extglob,noglobstar:!this._settings.globstar,posix:!0,strictSlashes:!1}}};xx.default=z3});var V3=w(kx=>{"use strict";Object.defineProperty(kx,"__esModule",{value:!0});var sQe=yx(),oQe=Xy(),_3=class extends oQe.default{constructor(){super(...arguments);this._reader=new sQe.default(this._settings)}read(e){let t=this._getRootDirectory(e),i=this._getReaderOptions(e),n=[];return new Promise((s,o)=>{let a=this.api(t,e,i);a.once("error",o),a.on("data",l=>n.push(i.transform(l))),a.once("end",()=>s(n))})}api(e,t,i){return t.dynamic?this._reader.dynamic(e,i):this._reader.static(t.patterns,i)}};kx.default=_3});var Z3=w(Px=>{"use strict";Object.defineProperty(Px,"__esModule",{value:!0});var aQe=require("stream"),AQe=yx(),lQe=Xy(),X3=class extends lQe.default{constructor(){super(...arguments);this._reader=new AQe.default(this._settings)}read(e){let t=this._getRootDirectory(e),i=this._getReaderOptions(e),n=this.api(t,e,i),s=new aQe.Readable({objectMode:!0,read:()=>{}});return n.once("error",o=>s.emit("error",o)).on("data",o=>s.emit("data",i.transform(o))).once("end",()=>s.emit("end")),s.once("close",()=>n.destroy()),s}api(e,t,i){return t.dynamic?this._reader.dynamic(e,i):this._reader.static(t.patterns,i)}};Px.default=X3});var eW=w(Dx=>{"use strict";Object.defineProperty(Dx,"__esModule",{value:!0});var cQe=Kc(),uQe=Cx(),gQe=Ex(),$3=class extends gQe.default{constructor(){super(...arguments);this._walkSync=uQe.walkSync,this._statSync=cQe.statSync}dynamic(e,t){return this._walkSync(e,t)}static(e,t){let i=[];for(let n of e){let s=this._getFullEntryPath(n),o=this._getEntry(s,n,t);o===null||!t.entryFilter(o)||i.push(o)}return i}_getEntry(e,t,i){try{let n=this._getStat(e);return this._makeEntry(n,t)}catch(n){if(i.errorFilter(n))return null;throw n}}_getStat(e){return this._statSync(e,this._fsStatSettings)}};Dx.default=$3});var rW=w(Rx=>{"use strict";Object.defineProperty(Rx,"__esModule",{value:!0});var fQe=eW(),hQe=Xy(),tW=class extends hQe.default{constructor(){super(...arguments);this._reader=new fQe.default(this._settings)}read(e){let t=this._getRootDirectory(e),i=this._getReaderOptions(e);return this.api(t,e,i).map(i.transform)}api(e,t,i){return t.dynamic?this._reader.dynamic(e,i):this._reader.static(t.patterns,i)}};Rx.default=tW});var nW=w(od=>{"use strict";Object.defineProperty(od,"__esModule",{value:!0});var jg=require("fs"),pQe=require("os"),dQe=pQe.cpus().length;od.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:jg.lstat,lstatSync:jg.lstatSync,stat:jg.stat,statSync:jg.statSync,readdir:jg.readdir,readdirSync:jg.readdirSync};var iW=class{constructor(e={}){this._options=e,this.absolute=this._getValue(this._options.absolute,!1),this.baseNameMatch=this._getValue(this._options.baseNameMatch,!1),this.braceExpansion=this._getValue(this._options.braceExpansion,!0),this.caseSensitiveMatch=this._getValue(this._options.caseSensitiveMatch,!0),this.concurrency=this._getValue(this._options.concurrency,dQe),this.cwd=this._getValue(this._options.cwd,process.cwd()),this.deep=this._getValue(this._options.deep,Infinity),this.dot=this._getValue(this._options.dot,!1),this.extglob=this._getValue(this._options.extglob,!0),this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!0),this.fs=this._getFileSystemMethods(this._options.fs),this.globstar=this._getValue(this._options.globstar,!0),this.ignore=this._getValue(this._options.ignore,[]),this.markDirectories=this._getValue(this._options.markDirectories,!1),this.objectMode=this._getValue(this._options.objectMode,!1),this.onlyDirectories=this._getValue(this._options.onlyDirectories,!1),this.onlyFiles=this._getValue(this._options.onlyFiles,!0),this.stats=this._getValue(this._options.stats,!1),this.suppressErrors=this._getValue(this._options.suppressErrors,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!1),this.unique=this._getValue(this._options.unique,!0),this.onlyDirectories&&(this.onlyFiles=!1),this.stats&&(this.objectMode=!0)}_getValue(e,t){return e===void 0?t:e}_getFileSystemMethods(e={}){return Object.assign(Object.assign({},od.DEFAULT_FILE_SYSTEM_ADAPTER),e)}};od.default=iW});var Zy=w((ztt,sW)=>{"use strict";var oW=UJ(),CQe=V3(),mQe=Z3(),EQe=rW(),Fx=nW(),Uc=Xa();async function Lx(r,e){Gg(r);let t=Nx(r,CQe.default,e),i=await Promise.all(t);return Uc.array.flatten(i)}(function(r){function e(o,a){Gg(o);let l=Nx(o,EQe.default,a);return Uc.array.flatten(l)}r.sync=e;function t(o,a){Gg(o);let l=Nx(o,mQe.default,a);return Uc.stream.merge(l)}r.stream=t;function i(o,a){Gg(o);let l=[].concat(o),c=new Fx.default(a);return oW.generate(l,c)}r.generateTasks=i;function n(o,a){Gg(o);let l=new Fx.default(a);return Uc.pattern.isDynamicPattern(o,l)}r.isDynamicPattern=n;function s(o){return Gg(o),Uc.path.escape(o)}r.escapePath=s})(Lx||(Lx={}));function Nx(r,e,t){let i=[].concat(r),n=new Fx.default(t),s=oW.generate(i,n),o=new e(n);return s.map(o.read,o)}function Gg(r){if(![].concat(r).every(i=>Uc.string.isString(i)&&!Uc.string.isEmpty(i)))throw new TypeError("Patterns must be a string (non empty) or an array of strings")}sW.exports=Lx});var AW=w(Hc=>{"use strict";var{promisify:IQe}=require("util"),aW=require("fs");async function Tx(r,e,t){if(typeof t!="string")throw new TypeError(`Expected a string, got ${typeof t}`);try{return(await IQe(aW[r])(t))[e]()}catch(i){if(i.code==="ENOENT")return!1;throw i}}function Ox(r,e,t){if(typeof t!="string")throw new TypeError(`Expected a string, got ${typeof t}`);try{return aW[r](t)[e]()}catch(i){if(i.code==="ENOENT")return!1;throw i}}Hc.isFile=Tx.bind(null,"stat","isFile");Hc.isDirectory=Tx.bind(null,"stat","isDirectory");Hc.isSymlink=Tx.bind(null,"lstat","isSymbolicLink");Hc.isFileSync=Ox.bind(null,"statSync","isFile");Hc.isDirectorySync=Ox.bind(null,"statSync","isDirectory");Hc.isSymlinkSync=Ox.bind(null,"lstatSync","isSymbolicLink")});var fW=w((Vtt,Mx)=>{"use strict";var jc=require("path"),lW=AW(),cW=r=>r.length>1?`{${r.join(",")}}`:r[0],uW=(r,e)=>{let t=r[0]==="!"?r.slice(1):r;return jc.isAbsolute(t)?t:jc.join(e,t)},yQe=(r,e)=>jc.extname(r)?`**/${r}`:`**/${r}.${cW(e)}`,gW=(r,e)=>{if(e.files&&!Array.isArray(e.files))throw new TypeError(`Expected \`files\` to be of type \`Array\` but received type \`${typeof e.files}\``);if(e.extensions&&!Array.isArray(e.extensions))throw new TypeError(`Expected \`extensions\` to be of type \`Array\` but received type \`${typeof e.extensions}\``);return e.files&&e.extensions?e.files.map(t=>jc.posix.join(r,yQe(t,e.extensions))):e.files?e.files.map(t=>jc.posix.join(r,`**/${t}`)):e.extensions?[jc.posix.join(r,`**/*.${cW(e.extensions)}`)]:[jc.posix.join(r,"**")]};Mx.exports=async(r,e)=>{if(e=N({cwd:process.cwd()},e),typeof e.cwd!="string")throw new TypeError(`Expected \`cwd\` to be of type \`string\` but received type \`${typeof e.cwd}\``);let t=await Promise.all([].concat(r).map(async i=>await lW.isDirectory(uW(i,e.cwd))?gW(i,e):i));return[].concat.apply([],t)};Mx.exports.sync=(r,e)=>{if(e=N({cwd:process.cwd()},e),typeof e.cwd!="string")throw new TypeError(`Expected \`cwd\` to be of type \`string\` but received type \`${typeof e.cwd}\``);let t=[].concat(r).map(i=>lW.isDirectorySync(uW(i,e.cwd))?gW(i,e):i);return[].concat.apply([],t)}});var BW=w((Xtt,hW)=>{function pW(r){return Array.isArray(r)?r:[r]}var dW="",CW=" ",Kx="\\",wQe=/^\s+$/,BQe=/^\\!/,bQe=/^\\#/,QQe=/\r?\n/g,SQe=/^\.*\/|^\.+$/,Ux="/",mW=typeof Symbol!="undefined"?Symbol.for("node-ignore"):"node-ignore",vQe=(r,e,t)=>Object.defineProperty(r,e,{value:t}),xQe=/([0-z])-([0-z])/g,kQe=r=>r.replace(xQe,(e,t,i)=>t.charCodeAt(0)<=i.charCodeAt(0)?e:dW),PQe=r=>{let{length:e}=r;return r.slice(0,e-e%2)},DQe=[[/\\?\s+$/,r=>r.indexOf("\\")===0?CW:dW],[/\\\s/g,()=>CW],[/[\\$.|*+(){^]/g,r=>`\\${r}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(r,e,t)=>e+6`${e}[^\\/]*`],[/\\\\\\(?=[$.|*+(){^])/g,()=>Kx],[/\\\\/g,()=>Kx],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(r,e,t,i,n)=>e===Kx?`\\[${t}${PQe(i)}${n}`:n==="]"&&i.length%2==0?`[${kQe(t)}${i}]`:"[]"],[/(?:[^*])$/,r=>/\/$/.test(r)?`${r}$`:`${r}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(r,e)=>`${e?`${e}[^/]+`:"[^/]*"}(?=$|\\/$)`]],EW=Object.create(null),RQe=(r,e)=>{let t=EW[r];return t||(t=DQe.reduce((i,n)=>i.replace(n[0],n[1].bind(r)),r),EW[r]=t),e?new RegExp(t,"i"):new RegExp(t)},Hx=r=>typeof r=="string",FQe=r=>r&&Hx(r)&&!wQe.test(r)&&r.indexOf("#")!==0,NQe=r=>r.split(QQe),IW=class{constructor(e,t,i,n){this.origin=e,this.pattern=t,this.negative=i,this.regex=n}},LQe=(r,e)=>{let t=r,i=!1;r.indexOf("!")===0&&(i=!0,r=r.substr(1)),r=r.replace(BQe,"!").replace(bQe,"#");let n=RQe(r,e);return new IW(t,r,i,n)},TQe=(r,e)=>{throw new e(r)},$a=(r,e,t)=>Hx(r)?r?$a.isNotRelative(r)?t(`path should be a \`path.relative()\`d string, but got "${e}"`,RangeError):!0:t("path must not be empty",TypeError):t(`path must be a string, but got \`${e}\``,TypeError),yW=r=>SQe.test(r);$a.isNotRelative=yW;$a.convert=r=>r;var wW=class{constructor({ignorecase:e=!0}={}){vQe(this,mW,!0),this._rules=[],this._ignorecase=e,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(e){if(e&&e[mW]){this._rules=this._rules.concat(e._rules),this._added=!0;return}if(FQe(e)){let t=LQe(e,this._ignorecase);this._added=!0,this._rules.push(t)}}add(e){return this._added=!1,pW(Hx(e)?NQe(e):e).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(e){return this.add(e)}_testOne(e,t){let i=!1,n=!1;return this._rules.forEach(s=>{let{negative:o}=s;if(n===o&&i!==n||o&&!i&&!n&&!t)return;s.regex.test(e)&&(i=!o,n=o)}),{ignored:i,unignored:n}}_test(e,t,i,n){let s=e&&$a.convert(e);return $a(s,e,TQe),this._t(s,t,i,n)}_t(e,t,i,n){if(e in t)return t[e];if(n||(n=e.split(Ux)),n.pop(),!n.length)return t[e]=this._testOne(e,i);let s=this._t(n.join(Ux)+Ux,t,i,n);return t[e]=s.ignored?s:this._testOne(e,i)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return pW(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}},$y=r=>new wW(r),OQe=()=>!1,MQe=r=>$a(r&&$a.convert(r),r,OQe);$y.isPathValid=MQe;$y.default=$y;hW.exports=$y;if(typeof process!="undefined"&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform==="win32")){let r=t=>/^\\\\\?\\/.test(t)||/["<>|\u0000-\u001F]+/u.test(t)?t:t.replace(/\\/g,"/");$a.convert=r;let e=/^[a-z]:\//i;$a.isNotRelative=t=>e.test(t)||yW(t)}});var QW=w((Ztt,bW)=>{"use strict";bW.exports=r=>{let e=/^\\\\\?\\/.test(r),t=/[^\u0000-\u0080]+/.test(r);return e||t?r:r.replace(/\\/g,"/")}});var RW=w(($tt,jx)=>{"use strict";var{promisify:KQe}=require("util"),SW=require("fs"),eA=require("path"),vW=Zy(),UQe=BW(),ad=QW(),xW=["**/node_modules/**","**/flow-typed/**","**/coverage/**","**/.git"],HQe=KQe(SW.readFile),jQe=r=>e=>e.startsWith("!")?"!"+eA.posix.join(r,e.slice(1)):eA.posix.join(r,e),GQe=(r,e)=>{let t=ad(eA.relative(e.cwd,eA.dirname(e.fileName)));return r.split(/\r?\n/).filter(Boolean).filter(i=>!i.startsWith("#")).map(jQe(t))},kW=r=>{let e=UQe();for(let t of r)e.add(GQe(t.content,{cwd:t.cwd,fileName:t.filePath}));return e},YQe=(r,e)=>{if(r=ad(r),eA.isAbsolute(e)){if(ad(e).startsWith(r))return e;throw new Error(`Path ${e} is not in cwd ${r}`)}return eA.join(r,e)},PW=(r,e)=>t=>r.ignores(ad(eA.relative(e,YQe(e,t.path||t)))),qQe=async(r,e)=>{let t=eA.join(e,r),i=await HQe(t,"utf8");return{cwd:e,filePath:t,content:i}},JQe=(r,e)=>{let t=eA.join(e,r),i=SW.readFileSync(t,"utf8");return{cwd:e,filePath:t,content:i}},DW=({ignore:r=[],cwd:e=ad(process.cwd())}={})=>({ignore:r,cwd:e});jx.exports=async r=>{r=DW(r);let e=await vW("**/.gitignore",{ignore:xW.concat(r.ignore),cwd:r.cwd}),t=await Promise.all(e.map(n=>qQe(n,r.cwd))),i=kW(t);return PW(i,r.cwd)};jx.exports.sync=r=>{r=DW(r);let t=vW.sync("**/.gitignore",{ignore:xW.concat(r.ignore),cwd:r.cwd}).map(n=>JQe(n,r.cwd)),i=kW(t);return PW(i,r.cwd)}});var TW=w((ert,FW)=>{"use strict";var{Transform:WQe}=require("stream"),Gx=class extends WQe{constructor(){super({objectMode:!0})}},NW=class extends Gx{constructor(e){super();this._filter=e}_transform(e,t,i){this._filter(e)&&this.push(e),i()}},LW=class extends Gx{constructor(){super();this._pushed=new Set}_transform(e,t,i){this._pushed.has(e)||(this.push(e),this._pushed.add(e)),i()}};FW.exports={FilterStream:NW,UniqueStream:LW}});var Wx=w((trt,Gc)=>{"use strict";var OW=require("fs"),ew=AJ(),zQe=jv(),tw=Zy(),rw=fW(),Yx=RW(),{FilterStream:_Qe,UniqueStream:VQe}=TW(),MW=()=>!1,KW=r=>r[0]==="!",XQe=r=>{if(!r.every(e=>typeof e=="string"))throw new TypeError("Patterns must be a string or an array of strings")},ZQe=(r={})=>{if(!r.cwd)return;let e;try{e=OW.statSync(r.cwd)}catch{return}if(!e.isDirectory())throw new Error("The `cwd` option must be a path to a directory")},$Qe=r=>r.stats instanceof OW.Stats?r.path:r,iw=(r,e)=>{r=ew([].concat(r)),XQe(r),ZQe(e);let t=[];e=N({ignore:[],expandDirectories:!0},e);for(let[i,n]of r.entries()){if(KW(n))continue;let s=r.slice(i).filter(a=>KW(a)).map(a=>a.slice(1)),o=te(N({},e),{ignore:e.ignore.concat(s)});t.push({pattern:n,options:o})}return t},eSe=(r,e)=>{let t={};return r.options.cwd&&(t.cwd=r.options.cwd),Array.isArray(r.options.expandDirectories)?t=te(N({},t),{files:r.options.expandDirectories}):typeof r.options.expandDirectories=="object"&&(t=N(N({},t),r.options.expandDirectories)),e(r.pattern,t)},qx=(r,e)=>r.options.expandDirectories?eSe(r,e):[r.pattern],UW=r=>r&&r.gitignore?Yx.sync({cwd:r.cwd,ignore:r.ignore}):MW,Jx=r=>e=>{let{options:t}=r;return t.ignore&&Array.isArray(t.ignore)&&t.expandDirectories&&(t.ignore=rw.sync(t.ignore)),{pattern:e,options:t}};Gc.exports=async(r,e)=>{let t=iw(r,e),i=async()=>e&&e.gitignore?Yx({cwd:e.cwd,ignore:e.ignore}):MW,n=async()=>{let l=await Promise.all(t.map(async c=>{let u=await qx(c,rw);return Promise.all(u.map(Jx(c)))}));return ew(...l)},[s,o]=await Promise.all([i(),n()]),a=await Promise.all(o.map(l=>tw(l.pattern,l.options)));return ew(...a).filter(l=>!s($Qe(l)))};Gc.exports.sync=(r,e)=>{let t=iw(r,e),i=[];for(let o of t){let a=qx(o,rw.sync).map(Jx(o));i.push(...a)}let n=UW(e),s=[];for(let o of i)s=ew(s,tw.sync(o.pattern,o.options));return s.filter(o=>!n(o))};Gc.exports.stream=(r,e)=>{let t=iw(r,e),i=[];for(let a of t){let l=qx(a,rw.sync).map(Jx(a));i.push(...l)}let n=UW(e),s=new _Qe(a=>!n(a)),o=new VQe;return zQe(i.map(a=>tw.stream(a.pattern,a.options))).pipe(s).pipe(o)};Gc.exports.generateGlobTasks=iw;Gc.exports.hasMagic=(r,e)=>[].concat(r).some(t=>tw.isDynamicPattern(t,e));Gc.exports.gitignore=Yx});var Rn=w((xrt,t4)=>{function fSe(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}t4.exports=fSe});var rk=w((krt,r4)=>{var hSe=typeof global=="object"&&global&&global.Object===Object&&global;r4.exports=hSe});var Ns=w((Prt,i4)=>{var pSe=rk(),dSe=typeof self=="object"&&self&&self.Object===Object&&self,CSe=pSe||dSe||Function("return this")();i4.exports=CSe});var s4=w((Drt,n4)=>{var mSe=Ns(),ESe=function(){return mSe.Date.now()};n4.exports=ESe});var a4=w((Rrt,o4)=>{var ISe=/\s/;function ySe(r){for(var e=r.length;e--&&ISe.test(r.charAt(e)););return e}o4.exports=ySe});var l4=w((Frt,A4)=>{var wSe=a4(),BSe=/^\s+/;function bSe(r){return r&&r.slice(0,wSe(r)+1).replace(BSe,"")}A4.exports=bSe});var Jc=w((Nrt,c4)=>{var QSe=Ns(),SSe=QSe.Symbol;c4.exports=SSe});var h4=w((Lrt,u4)=>{var g4=Jc(),f4=Object.prototype,vSe=f4.hasOwnProperty,xSe=f4.toString,Ed=g4?g4.toStringTag:void 0;function kSe(r){var e=vSe.call(r,Ed),t=r[Ed];try{r[Ed]=void 0;var i=!0}catch(s){}var n=xSe.call(r);return i&&(e?r[Ed]=t:delete r[Ed]),n}u4.exports=kSe});var d4=w((Trt,p4)=>{var PSe=Object.prototype,DSe=PSe.toString;function RSe(r){return DSe.call(r)}p4.exports=RSe});var Wc=w((Ort,C4)=>{var m4=Jc(),FSe=h4(),NSe=d4(),LSe="[object Null]",TSe="[object Undefined]",E4=m4?m4.toStringTag:void 0;function OSe(r){return r==null?r===void 0?TSe:LSe:E4&&E4 in Object(r)?FSe(r):NSe(r)}C4.exports=OSe});var ta=w((Mrt,I4)=>{function MSe(r){return r!=null&&typeof r=="object"}I4.exports=MSe});var Id=w((Krt,y4)=>{var KSe=Wc(),USe=ta(),HSe="[object Symbol]";function jSe(r){return typeof r=="symbol"||USe(r)&&KSe(r)==HSe}y4.exports=jSe});var Q4=w((Urt,w4)=>{var GSe=l4(),B4=Rn(),YSe=Id(),b4=0/0,qSe=/^[-+]0x[0-9a-f]+$/i,JSe=/^0b[01]+$/i,WSe=/^0o[0-7]+$/i,zSe=parseInt;function _Se(r){if(typeof r=="number")return r;if(YSe(r))return b4;if(B4(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=B4(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=GSe(r);var t=JSe.test(r);return t||WSe.test(r)?zSe(r.slice(2),t?2:8):qSe.test(r)?b4:+r}w4.exports=_Se});var x4=w((Hrt,S4)=>{var VSe=Rn(),ik=s4(),v4=Q4(),XSe="Expected a function",ZSe=Math.max,$Se=Math.min;function eve(r,e,t){var i,n,s,o,a,l,c=0,u=!1,g=!1,f=!0;if(typeof r!="function")throw new TypeError(XSe);e=v4(e)||0,VSe(t)&&(u=!!t.leading,g="maxWait"in t,s=g?ZSe(v4(t.maxWait)||0,e):s,f="trailing"in t?!!t.trailing:f);function h(Y){var $=i,_=n;return i=n=void 0,c=Y,o=r.apply(_,$),o}function p(Y){return c=Y,a=setTimeout(b,e),u?h(Y):o}function m(Y){var $=Y-l,_=Y-c,ne=e-$;return g?$Se(ne,s-_):ne}function y(Y){var $=Y-l,_=Y-c;return l===void 0||$>=e||$<0||g&&_>=s}function b(){var Y=ik();if(y(Y))return v(Y);a=setTimeout(b,m(Y))}function v(Y){return a=void 0,f&&i?h(Y):(i=n=void 0,o)}function x(){a!==void 0&&clearTimeout(a),c=0,i=l=n=a=void 0}function T(){return a===void 0?o:v(ik())}function q(){var Y=ik(),$=y(Y);if(i=arguments,n=this,l=Y,$){if(a===void 0)return p(l);if(g)return clearTimeout(a),a=setTimeout(b,e),h(l)}return a===void 0&&(a=setTimeout(b,e)),o}return q.cancel=x,q.flush=T,q}S4.exports=eve});var P4=w((jrt,k4)=>{var tve=x4(),rve=Rn(),ive="Expected a function";function nve(r,e,t){var i=!0,n=!0;if(typeof r!="function")throw new TypeError(ive);return rve(t)&&(i="leading"in t?!!t.leading:i,n="trailing"in t?!!t.trailing:n),tve(r,e,{leading:i,maxWait:e,trailing:n})}k4.exports=nve});var iA=w((rA,Bw)=>{"use strict";Object.defineProperty(rA,"__esModule",{value:!0});var M4=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function Cve(r){return M4.includes(r)}var mve=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","FormData","URLSearchParams","HTMLElement",...M4];function Eve(r){return mve.includes(r)}var Ive=["null","undefined","string","number","bigint","boolean","symbol"];function yve(r){return Ive.includes(r)}function Xg(r){return e=>typeof e===r}var{toString:K4}=Object.prototype,vd=r=>{let e=K4.call(r).slice(8,-1);if(/HTML\w+Element/.test(e)&&W.domElement(r))return"HTMLElement";if(Eve(e))return e},hr=r=>e=>vd(e)===r;function W(r){if(r===null)return"null";switch(typeof r){case"undefined":return"undefined";case"string":return"string";case"number":return"number";case"boolean":return"boolean";case"function":return"Function";case"bigint":return"bigint";case"symbol":return"symbol";default:}if(W.observable(r))return"Observable";if(W.array(r))return"Array";if(W.buffer(r))return"Buffer";let e=vd(r);if(e)return e;if(r instanceof String||r instanceof Boolean||r instanceof Number)throw new TypeError("Please don't use object wrappers for primitive types");return"Object"}W.undefined=Xg("undefined");W.string=Xg("string");var wve=Xg("number");W.number=r=>wve(r)&&!W.nan(r);W.bigint=Xg("bigint");W.function_=Xg("function");W.null_=r=>r===null;W.class_=r=>W.function_(r)&&r.toString().startsWith("class ");W.boolean=r=>r===!0||r===!1;W.symbol=Xg("symbol");W.numericString=r=>W.string(r)&&!W.emptyStringOrWhitespace(r)&&!Number.isNaN(Number(r));W.array=(r,e)=>Array.isArray(r)?W.function_(e)?r.every(e):!0:!1;W.buffer=r=>{var e,t,i,n;return(n=(i=(t=(e=r)===null||e===void 0?void 0:e.constructor)===null||t===void 0?void 0:t.isBuffer)===null||i===void 0?void 0:i.call(t,r))!==null&&n!==void 0?n:!1};W.nullOrUndefined=r=>W.null_(r)||W.undefined(r);W.object=r=>!W.null_(r)&&(typeof r=="object"||W.function_(r));W.iterable=r=>{var e;return W.function_((e=r)===null||e===void 0?void 0:e[Symbol.iterator])};W.asyncIterable=r=>{var e;return W.function_((e=r)===null||e===void 0?void 0:e[Symbol.asyncIterator])};W.generator=r=>W.iterable(r)&&W.function_(r.next)&&W.function_(r.throw);W.asyncGenerator=r=>W.asyncIterable(r)&&W.function_(r.next)&&W.function_(r.throw);W.nativePromise=r=>hr("Promise")(r);var Bve=r=>{var e,t;return W.function_((e=r)===null||e===void 0?void 0:e.then)&&W.function_((t=r)===null||t===void 0?void 0:t.catch)};W.promise=r=>W.nativePromise(r)||Bve(r);W.generatorFunction=hr("GeneratorFunction");W.asyncGeneratorFunction=r=>vd(r)==="AsyncGeneratorFunction";W.asyncFunction=r=>vd(r)==="AsyncFunction";W.boundFunction=r=>W.function_(r)&&!r.hasOwnProperty("prototype");W.regExp=hr("RegExp");W.date=hr("Date");W.error=hr("Error");W.map=r=>hr("Map")(r);W.set=r=>hr("Set")(r);W.weakMap=r=>hr("WeakMap")(r);W.weakSet=r=>hr("WeakSet")(r);W.int8Array=hr("Int8Array");W.uint8Array=hr("Uint8Array");W.uint8ClampedArray=hr("Uint8ClampedArray");W.int16Array=hr("Int16Array");W.uint16Array=hr("Uint16Array");W.int32Array=hr("Int32Array");W.uint32Array=hr("Uint32Array");W.float32Array=hr("Float32Array");W.float64Array=hr("Float64Array");W.bigInt64Array=hr("BigInt64Array");W.bigUint64Array=hr("BigUint64Array");W.arrayBuffer=hr("ArrayBuffer");W.sharedArrayBuffer=hr("SharedArrayBuffer");W.dataView=hr("DataView");W.directInstanceOf=(r,e)=>Object.getPrototypeOf(r)===e.prototype;W.urlInstance=r=>hr("URL")(r);W.urlString=r=>{if(!W.string(r))return!1;try{return new URL(r),!0}catch(e){return!1}};W.truthy=r=>Boolean(r);W.falsy=r=>!r;W.nan=r=>Number.isNaN(r);W.primitive=r=>W.null_(r)||yve(typeof r);W.integer=r=>Number.isInteger(r);W.safeInteger=r=>Number.isSafeInteger(r);W.plainObject=r=>{if(K4.call(r)!=="[object Object]")return!1;let e=Object.getPrototypeOf(r);return e===null||e===Object.getPrototypeOf({})};W.typedArray=r=>Cve(vd(r));var bve=r=>W.safeInteger(r)&&r>=0;W.arrayLike=r=>!W.nullOrUndefined(r)&&!W.function_(r)&&bve(r.length);W.inRange=(r,e)=>{if(W.number(e))return r>=Math.min(0,e)&&r<=Math.max(e,0);if(W.array(e)&&e.length===2)return r>=Math.min(...e)&&r<=Math.max(...e);throw new TypeError(`Invalid range: ${JSON.stringify(e)}`)};var Qve=1,Sve=["innerHTML","ownerDocument","style","attributes","nodeValue"];W.domElement=r=>W.object(r)&&r.nodeType===Qve&&W.string(r.nodeName)&&!W.plainObject(r)&&Sve.every(e=>e in r);W.observable=r=>{var e,t,i,n;return r?r===((t=(e=r)[Symbol.observable])===null||t===void 0?void 0:t.call(e))||r===((n=(i=r)["@@observable"])===null||n===void 0?void 0:n.call(i)):!1};W.nodeStream=r=>W.object(r)&&W.function_(r.pipe)&&!W.observable(r);W.infinite=r=>r===Infinity||r===-Infinity;var U4=r=>e=>W.integer(e)&&Math.abs(e%2)===r;W.evenInteger=U4(0);W.oddInteger=U4(1);W.emptyArray=r=>W.array(r)&&r.length===0;W.nonEmptyArray=r=>W.array(r)&&r.length>0;W.emptyString=r=>W.string(r)&&r.length===0;W.nonEmptyString=r=>W.string(r)&&r.length>0;var vve=r=>W.string(r)&&!/\S/.test(r);W.emptyStringOrWhitespace=r=>W.emptyString(r)||vve(r);W.emptyObject=r=>W.object(r)&&!W.map(r)&&!W.set(r)&&Object.keys(r).length===0;W.nonEmptyObject=r=>W.object(r)&&!W.map(r)&&!W.set(r)&&Object.keys(r).length>0;W.emptySet=r=>W.set(r)&&r.size===0;W.nonEmptySet=r=>W.set(r)&&r.size>0;W.emptyMap=r=>W.map(r)&&r.size===0;W.nonEmptyMap=r=>W.map(r)&&r.size>0;W.propertyKey=r=>W.any([W.string,W.number,W.symbol],r);W.formData=r=>hr("FormData")(r);W.urlSearchParams=r=>hr("URLSearchParams")(r);var H4=(r,e,t)=>{if(!W.function_(e))throw new TypeError(`Invalid predicate: ${JSON.stringify(e)}`);if(t.length===0)throw new TypeError("Invalid number of values");return r.call(t,e)};W.any=(r,...e)=>(W.array(r)?r:[r]).some(i=>H4(Array.prototype.some,i,e));W.all=(r,...e)=>H4(Array.prototype.every,r,e);var We=(r,e,t,i={})=>{if(!r){let{multipleValues:n}=i,s=n?`received values of types ${[...new Set(t.map(o=>`\`${W(o)}\``))].join(", ")}`:`received value of type \`${W(t)}\``;throw new TypeError(`Expected value which is \`${e}\`, ${s}.`)}};rA.assert={undefined:r=>We(W.undefined(r),"undefined",r),string:r=>We(W.string(r),"string",r),number:r=>We(W.number(r),"number",r),bigint:r=>We(W.bigint(r),"bigint",r),function_:r=>We(W.function_(r),"Function",r),null_:r=>We(W.null_(r),"null",r),class_:r=>We(W.class_(r),"Class",r),boolean:r=>We(W.boolean(r),"boolean",r),symbol:r=>We(W.symbol(r),"symbol",r),numericString:r=>We(W.numericString(r),"string with a number",r),array:(r,e)=>{We(W.array(r),"Array",r),e&&r.forEach(e)},buffer:r=>We(W.buffer(r),"Buffer",r),nullOrUndefined:r=>We(W.nullOrUndefined(r),"null or undefined",r),object:r=>We(W.object(r),"Object",r),iterable:r=>We(W.iterable(r),"Iterable",r),asyncIterable:r=>We(W.asyncIterable(r),"AsyncIterable",r),generator:r=>We(W.generator(r),"Generator",r),asyncGenerator:r=>We(W.asyncGenerator(r),"AsyncGenerator",r),nativePromise:r=>We(W.nativePromise(r),"native Promise",r),promise:r=>We(W.promise(r),"Promise",r),generatorFunction:r=>We(W.generatorFunction(r),"GeneratorFunction",r),asyncGeneratorFunction:r=>We(W.asyncGeneratorFunction(r),"AsyncGeneratorFunction",r),asyncFunction:r=>We(W.asyncFunction(r),"AsyncFunction",r),boundFunction:r=>We(W.boundFunction(r),"Function",r),regExp:r=>We(W.regExp(r),"RegExp",r),date:r=>We(W.date(r),"Date",r),error:r=>We(W.error(r),"Error",r),map:r=>We(W.map(r),"Map",r),set:r=>We(W.set(r),"Set",r),weakMap:r=>We(W.weakMap(r),"WeakMap",r),weakSet:r=>We(W.weakSet(r),"WeakSet",r),int8Array:r=>We(W.int8Array(r),"Int8Array",r),uint8Array:r=>We(W.uint8Array(r),"Uint8Array",r),uint8ClampedArray:r=>We(W.uint8ClampedArray(r),"Uint8ClampedArray",r),int16Array:r=>We(W.int16Array(r),"Int16Array",r),uint16Array:r=>We(W.uint16Array(r),"Uint16Array",r),int32Array:r=>We(W.int32Array(r),"Int32Array",r),uint32Array:r=>We(W.uint32Array(r),"Uint32Array",r),float32Array:r=>We(W.float32Array(r),"Float32Array",r),float64Array:r=>We(W.float64Array(r),"Float64Array",r),bigInt64Array:r=>We(W.bigInt64Array(r),"BigInt64Array",r),bigUint64Array:r=>We(W.bigUint64Array(r),"BigUint64Array",r),arrayBuffer:r=>We(W.arrayBuffer(r),"ArrayBuffer",r),sharedArrayBuffer:r=>We(W.sharedArrayBuffer(r),"SharedArrayBuffer",r),dataView:r=>We(W.dataView(r),"DataView",r),urlInstance:r=>We(W.urlInstance(r),"URL",r),urlString:r=>We(W.urlString(r),"string with a URL",r),truthy:r=>We(W.truthy(r),"truthy",r),falsy:r=>We(W.falsy(r),"falsy",r),nan:r=>We(W.nan(r),"NaN",r),primitive:r=>We(W.primitive(r),"primitive",r),integer:r=>We(W.integer(r),"integer",r),safeInteger:r=>We(W.safeInteger(r),"integer",r),plainObject:r=>We(W.plainObject(r),"plain object",r),typedArray:r=>We(W.typedArray(r),"TypedArray",r),arrayLike:r=>We(W.arrayLike(r),"array-like",r),domElement:r=>We(W.domElement(r),"HTMLElement",r),observable:r=>We(W.observable(r),"Observable",r),nodeStream:r=>We(W.nodeStream(r),"Node.js Stream",r),infinite:r=>We(W.infinite(r),"infinite number",r),emptyArray:r=>We(W.emptyArray(r),"empty array",r),nonEmptyArray:r=>We(W.nonEmptyArray(r),"non-empty array",r),emptyString:r=>We(W.emptyString(r),"empty string",r),nonEmptyString:r=>We(W.nonEmptyString(r),"non-empty string",r),emptyStringOrWhitespace:r=>We(W.emptyStringOrWhitespace(r),"empty string or whitespace",r),emptyObject:r=>We(W.emptyObject(r),"empty object",r),nonEmptyObject:r=>We(W.nonEmptyObject(r),"non-empty object",r),emptySet:r=>We(W.emptySet(r),"empty set",r),nonEmptySet:r=>We(W.nonEmptySet(r),"non-empty set",r),emptyMap:r=>We(W.emptyMap(r),"empty map",r),nonEmptyMap:r=>We(W.nonEmptyMap(r),"non-empty map",r),propertyKey:r=>We(W.propertyKey(r),"PropertyKey",r),formData:r=>We(W.formData(r),"FormData",r),urlSearchParams:r=>We(W.urlSearchParams(r),"URLSearchParams",r),evenInteger:r=>We(W.evenInteger(r),"even integer",r),oddInteger:r=>We(W.oddInteger(r),"odd integer",r),directInstanceOf:(r,e)=>We(W.directInstanceOf(r,e),"T",r),inRange:(r,e)=>We(W.inRange(r,e),"in range",r),any:(r,...e)=>We(W.any(r,...e),"predicate returns truthy for any value",e,{multipleValues:!0}),all:(r,...e)=>We(W.all(r,...e),"predicate returns truthy for all values",e,{multipleValues:!0})};Object.defineProperties(W,{class:{value:W.class_},function:{value:W.function_},null:{value:W.null_}});Object.defineProperties(rA.assert,{class:{value:rA.assert.class_},function:{value:rA.assert.function_},null:{value:rA.assert.null_}});rA.default=W;Bw.exports=W;Bw.exports.default=W;Bw.exports.assert=rA.assert});var j4=w((Wit,Bk)=>{"use strict";var bk=class extends Error{constructor(e){super(e||"Promise was canceled");this.name="CancelError"}get isCanceled(){return!0}},xd=class{static fn(e){return(...t)=>new xd((i,n,s)=>{t.push(s),e(...t).then(i,n)})}constructor(e){this._cancelHandlers=[],this._isPending=!0,this._isCanceled=!1,this._rejectOnCancel=!0,this._promise=new Promise((t,i)=>{this._reject=i;let n=a=>{this._isPending=!1,t(a)},s=a=>{this._isPending=!1,i(a)},o=a=>{if(!this._isPending)throw new Error("The `onCancel` handler was attached after the promise settled.");this._cancelHandlers.push(a)};return Object.defineProperties(o,{shouldReject:{get:()=>this._rejectOnCancel,set:a=>{this._rejectOnCancel=a}}}),e(n,s,o)})}then(e,t){return this._promise.then(e,t)}catch(e){return this._promise.catch(e)}finally(e){return this._promise.finally(e)}cancel(e){if(!(!this._isPending||this._isCanceled)){if(this._cancelHandlers.length>0)try{for(let t of this._cancelHandlers)t()}catch(t){this._reject(t)}this._isCanceled=!0,this._rejectOnCancel&&this._reject(new bk(e))}}get isCanceled(){return this._isCanceled}};Object.setPrototypeOf(xd.prototype,Promise.prototype);Bk.exports=xd;Bk.exports.CancelError=bk});var G4=w((Qk,Sk)=>{"use strict";Object.defineProperty(Qk,"__esModule",{value:!0});var xve=require("tls"),vk=(r,e)=>{let t;typeof e=="function"?t={connect:e}:t=e;let i=typeof t.connect=="function",n=typeof t.secureConnect=="function",s=typeof t.close=="function",o=()=>{i&&t.connect(),r instanceof xve.TLSSocket&&n&&(r.authorized?t.secureConnect():r.authorizationError||r.once("secureConnect",t.secureConnect)),s&&r.once("close",t.close)};r.writable&&!r.connecting?o():r.connecting?r.once("connect",o):r.destroyed&&s&&t.close(r._hadError)};Qk.default=vk;Sk.exports=vk;Sk.exports.default=vk});var Y4=w((xk,kk)=>{"use strict";Object.defineProperty(xk,"__esModule",{value:!0});var kve=G4(),Pve=Number(process.versions.node.split(".")[0]),Pk=r=>{let e={start:Date.now(),socket:void 0,lookup:void 0,connect:void 0,secureConnect:void 0,upload:void 0,response:void 0,end:void 0,error:void 0,abort:void 0,phases:{wait:void 0,dns:void 0,tcp:void 0,tls:void 0,request:void 0,firstByte:void 0,download:void 0,total:void 0}};r.timings=e;let t=o=>{let a=o.emit.bind(o);o.emit=(l,...c)=>(l==="error"&&(e.error=Date.now(),e.phases.total=e.error-e.start,o.emit=a),a(l,...c))};t(r),r.prependOnceListener("abort",()=>{e.abort=Date.now(),(!e.response||Pve>=13)&&(e.phases.total=Date.now()-e.start)});let i=o=>{e.socket=Date.now(),e.phases.wait=e.socket-e.start;let a=()=>{e.lookup=Date.now(),e.phases.dns=e.lookup-e.socket};o.prependOnceListener("lookup",a),kve.default(o,{connect:()=>{e.connect=Date.now(),e.lookup===void 0&&(o.removeListener("lookup",a),e.lookup=e.connect,e.phases.dns=e.lookup-e.socket),e.phases.tcp=e.connect-e.lookup},secureConnect:()=>{e.secureConnect=Date.now(),e.phases.tls=e.secureConnect-e.connect}})};r.socket?i(r.socket):r.prependOnceListener("socket",i);let n=()=>{var o;e.upload=Date.now(),e.phases.request=e.upload-(o=e.secureConnect,o!=null?o:e.connect)};return(()=>typeof r.writableFinished=="boolean"?r.writableFinished:r.finished&&r.outputSize===0&&(!r.socket||r.socket.writableLength===0))()?n():r.prependOnceListener("finish",n),r.prependOnceListener("response",o=>{e.response=Date.now(),e.phases.firstByte=e.response-e.upload,o.timings=e,t(o),o.prependOnceListener("end",()=>{e.end=Date.now(),e.phases.download=e.end-e.response,e.phases.total=e.end-e.start})}),e};xk.default=Pk;kk.exports=Pk;kk.exports.default=Pk});var X4=w((zit,Dk)=>{"use strict";var{V4MAPPED:Dve,ADDRCONFIG:Rve,ALL:q4,promises:{Resolver:J4},lookup:Fve}=require("dns"),{promisify:Rk}=require("util"),Nve=require("os"),Zg=Symbol("cacheableLookupCreateConnection"),Fk=Symbol("cacheableLookupInstance"),W4=Symbol("expires"),Lve=typeof q4=="number",z4=r=>{if(!(r&&typeof r.createConnection=="function"))throw new Error("Expected an Agent instance as the first argument")},Tve=r=>{for(let e of r)e.family!==6&&(e.address=`::ffff:${e.address}`,e.family=6)},_4=()=>{let r=!1,e=!1;for(let t of Object.values(Nve.networkInterfaces()))for(let i of t)if(!i.internal&&(i.family==="IPv6"?e=!0:r=!0,r&&e))return{has4:r,has6:e};return{has4:r,has6:e}},Ove=r=>Symbol.iterator in r,V4={ttl:!0},Mve={all:!0},Nk=class{constructor({cache:e=new Map,maxTtl:t=Infinity,fallbackDuration:i=3600,errorTtl:n=.15,resolver:s=new J4,lookup:o=Fve}={}){if(this.maxTtl=t,this.errorTtl=n,this._cache=e,this._resolver=s,this._dnsLookup=Rk(o),this._resolver instanceof J4?(this._resolve4=this._resolver.resolve4.bind(this._resolver),this._resolve6=this._resolver.resolve6.bind(this._resolver)):(this._resolve4=Rk(this._resolver.resolve4.bind(this._resolver)),this._resolve6=Rk(this._resolver.resolve6.bind(this._resolver))),this._iface=_4(),this._pending={},this._nextRemovalTime=!1,this._hostnamesToFallback=new Set,i<1)this._fallback=!1;else{this._fallback=!0;let a=setInterval(()=>{this._hostnamesToFallback.clear()},i*1e3);a.unref&&a.unref()}this.lookup=this.lookup.bind(this),this.lookupAsync=this.lookupAsync.bind(this)}set servers(e){this.clear(),this._resolver.setServers(e)}get servers(){return this._resolver.getServers()}lookup(e,t,i){if(typeof t=="function"?(i=t,t={}):typeof t=="number"&&(t={family:t}),!i)throw new Error("Callback must be a function.");this.lookupAsync(e,t).then(n=>{t.all?i(null,n):i(null,n.address,n.family,n.expires,n.ttl)},i)}async lookupAsync(e,t={}){typeof t=="number"&&(t={family:t});let i=await this.query(e);if(t.family===6){let n=i.filter(s=>s.family===6);t.hints&Dve&&(Lve&&t.hints&q4||n.length===0)?Tve(i):i=n}else t.family===4&&(i=i.filter(n=>n.family===4));if(t.hints&Rve){let{_iface:n}=this;i=i.filter(s=>s.family===6?n.has6:n.has4)}if(i.length===0){let n=new Error(`cacheableLookup ENOTFOUND ${e}`);throw n.code="ENOTFOUND",n.hostname=e,n}return t.all?i:i[0]}async query(e){let t=await this._cache.get(e);if(!t){let i=this._pending[e];if(i)t=await i;else{let n=this.queryAndCache(e);this._pending[e]=n,t=await n}}return t=t.map(i=>N({},i)),t}async _resolve(e){let t=async c=>{try{return await c}catch(u){if(u.code==="ENODATA"||u.code==="ENOTFOUND")return[];throw u}},[i,n]=await Promise.all([this._resolve4(e,V4),this._resolve6(e,V4)].map(c=>t(c))),s=0,o=0,a=0,l=Date.now();for(let c of i)c.family=4,c.expires=l+c.ttl*1e3,s=Math.max(s,c.ttl);for(let c of n)c.family=6,c.expires=l+c.ttl*1e3,o=Math.max(o,c.ttl);return i.length>0?n.length>0?a=Math.min(s,o):a=s:a=o,{entries:[...i,...n],cacheTtl:a}}async _lookup(e){try{return{entries:await this._dnsLookup(e,{all:!0}),cacheTtl:0}}catch(t){return{entries:[],cacheTtl:0}}}async _set(e,t,i){if(this.maxTtl>0&&i>0){i=Math.min(i,this.maxTtl)*1e3,t[W4]=Date.now()+i;try{await this._cache.set(e,t,i)}catch(n){this.lookupAsync=async()=>{let s=new Error("Cache Error. Please recreate the CacheableLookup instance.");throw s.cause=n,s}}Ove(this._cache)&&this._tick(i)}}async queryAndCache(e){if(this._hostnamesToFallback.has(e))return this._dnsLookup(e,Mve);try{let t=await this._resolve(e);t.entries.length===0&&this._fallback&&(t=await this._lookup(e),t.entries.length!==0&&this._hostnamesToFallback.add(e));let i=t.entries.length===0?this.errorTtl:t.cacheTtl;return await this._set(e,t.entries,i),delete this._pending[e],t.entries}catch(t){throw delete this._pending[e],t}}_tick(e){let t=this._nextRemovalTime;(!t||e{this._nextRemovalTime=!1;let i=Infinity,n=Date.now();for(let[s,o]of this._cache){let a=o[W4];n>=a?this._cache.delete(s):a("lookup"in t||(t.lookup=this.lookup),e[Zg](t,i))}uninstall(e){if(z4(e),e[Zg]){if(e[Fk]!==this)throw new Error("The agent is not owned by this CacheableLookup instance");e.createConnection=e[Zg],delete e[Zg],delete e[Fk]}}updateInterfaceInfo(){let{_iface:e}=this;this._iface=_4(),(e.has4&&!this._iface.has4||e.has6&&!this._iface.has6)&&this._cache.clear()}clear(e){if(e){this._cache.delete(e);return}this._cache.clear()}};Dk.exports=Nk;Dk.exports.default=Nk});var e8=w((_it,Lk)=>{"use strict";var Kve=typeof URL=="undefined"?require("url").URL:URL,Uve="text/plain",Hve="us-ascii",Z4=(r,e)=>e.some(t=>t instanceof RegExp?t.test(r):t===r),jve=(r,{stripHash:e})=>{let t=r.match(/^data:([^,]*?),([^#]*?)(?:#(.*))?$/);if(!t)throw new Error(`Invalid URL: ${r}`);let i=t[1].split(";"),n=t[2],s=e?"":t[3],o=!1;i[i.length-1]==="base64"&&(i.pop(),o=!0);let a=(i.shift()||"").toLowerCase(),c=[...i.map(u=>{let[g,f=""]=u.split("=").map(h=>h.trim());return g==="charset"&&(f=f.toLowerCase(),f===Hve)?"":`${g}${f?`=${f}`:""}`}).filter(Boolean)];return o&&c.push("base64"),(c.length!==0||a&&a!==Uve)&&c.unshift(a),`data:${c.join(";")},${o?n.trim():n}${s?`#${s}`:""}`},$4=(r,e)=>{if(e=N({defaultProtocol:"http:",normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripWWW:!0,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:!0,removeDirectoryIndex:!1,sortQueryParameters:!0},e),Reflect.has(e,"normalizeHttps"))throw new Error("options.normalizeHttps is renamed to options.forceHttp");if(Reflect.has(e,"normalizeHttp"))throw new Error("options.normalizeHttp is renamed to options.forceHttps");if(Reflect.has(e,"stripFragment"))throw new Error("options.stripFragment is renamed to options.stripHash");if(r=r.trim(),/^data:/i.test(r))return jve(r,e);let t=r.startsWith("//");!t&&/^\.*\//.test(r)||(r=r.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,e.defaultProtocol));let n=new Kve(r);if(e.forceHttp&&e.forceHttps)throw new Error("The `forceHttp` and `forceHttps` options cannot be used together");if(e.forceHttp&&n.protocol==="https:"&&(n.protocol="http:"),e.forceHttps&&n.protocol==="http:"&&(n.protocol="https:"),e.stripAuthentication&&(n.username="",n.password=""),e.stripHash&&(n.hash=""),n.pathname&&(n.pathname=n.pathname.replace(/((?!:).|^)\/{2,}/g,(s,o)=>/^(?!\/)/g.test(o)?`${o}/`:"/")),n.pathname&&(n.pathname=decodeURI(n.pathname)),e.removeDirectoryIndex===!0&&(e.removeDirectoryIndex=[/^index\.[a-z]+$/]),Array.isArray(e.removeDirectoryIndex)&&e.removeDirectoryIndex.length>0){let s=n.pathname.split("/"),o=s[s.length-1];Z4(o,e.removeDirectoryIndex)&&(s=s.slice(0,s.length-1),n.pathname=s.slice(1).join("/")+"/")}if(n.hostname&&(n.hostname=n.hostname.replace(/\.$/,""),e.stripWWW&&/^www\.([a-z\-\d]{2,63})\.([a-z.]{2,5})$/.test(n.hostname)&&(n.hostname=n.hostname.replace(/^www\./,""))),Array.isArray(e.removeQueryParameters))for(let s of[...n.searchParams.keys()])Z4(s,e.removeQueryParameters)&&n.searchParams.delete(s);return e.sortQueryParameters&&n.searchParams.sort(),e.removeTrailingSlash&&(n.pathname=n.pathname.replace(/\/$/,"")),r=n.toString(),(e.removeTrailingSlash||n.pathname==="/")&&n.hash===""&&(r=r.replace(/\/$/,"")),t&&!e.normalizeProtocol&&(r=r.replace(/^http:\/\//,"//")),e.stripProtocol&&(r=r.replace(/^(?:https?:)?\/\//,"")),r};Lk.exports=$4;Lk.exports.default=$4});var i8=w((Vit,t8)=>{t8.exports=r8;function r8(r,e){if(r&&e)return r8(r)(e);if(typeof r!="function")throw new TypeError("need wrapper function");return Object.keys(r).forEach(function(i){t[i]=r[i]}),t;function t(){for(var i=new Array(arguments.length),n=0;n{var n8=i8();Tk.exports=n8(bw);Tk.exports.strict=n8(s8);bw.proto=bw(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return bw(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return s8(this)},configurable:!0})});function bw(r){var e=function(){return e.called?e.value:(e.called=!0,e.value=r.apply(this,arguments))};return e.called=!1,e}function s8(r){var e=function(){if(e.called)throw new Error(e.onceError);return e.called=!0,e.value=r.apply(this,arguments)},t=r.name||"Function wrapped with `once`";return e.onceError=t+" shouldn't be called more than once",e.called=!1,e}});var Mk=w((Zit,o8)=>{var Gve=Ok(),Yve=function(){},qve=function(r){return r.setHeader&&typeof r.abort=="function"},Jve=function(r){return r.stdio&&Array.isArray(r.stdio)&&r.stdio.length===3},a8=function(r,e,t){if(typeof e=="function")return a8(r,null,e);e||(e={}),t=Gve(t||Yve);var i=r._writableState,n=r._readableState,s=e.readable||e.readable!==!1&&r.readable,o=e.writable||e.writable!==!1&&r.writable,a=function(){r.writable||l()},l=function(){o=!1,s||t.call(r)},c=function(){s=!1,o||t.call(r)},u=function(p){t.call(r,p?new Error("exited with error code: "+p):null)},g=function(p){t.call(r,p)},f=function(){if(s&&!(n&&n.ended))return t.call(r,new Error("premature close"));if(o&&!(i&&i.ended))return t.call(r,new Error("premature close"))},h=function(){r.req.on("finish",l)};return qve(r)?(r.on("complete",l),r.on("abort",f),r.req?h():r.on("request",h)):o&&!i&&(r.on("end",a),r.on("close",a)),Jve(r)&&r.on("exit",u),r.on("end",c),r.on("finish",l),e.error!==!1&&r.on("error",g),r.on("close",f),function(){r.removeListener("complete",l),r.removeListener("abort",f),r.removeListener("request",h),r.req&&r.req.removeListener("finish",l),r.removeListener("end",a),r.removeListener("close",a),r.removeListener("finish",l),r.removeListener("exit",u),r.removeListener("end",c),r.removeListener("error",g),r.removeListener("close",f)}};o8.exports=a8});var c8=w(($it,A8)=>{var Wve=Ok(),zve=Mk(),Kk=require("fs"),kd=function(){},_ve=/^v?\.0/.test(process.version),Qw=function(r){return typeof r=="function"},Vve=function(r){return!_ve||!Kk?!1:(r instanceof(Kk.ReadStream||kd)||r instanceof(Kk.WriteStream||kd))&&Qw(r.close)},Xve=function(r){return r.setHeader&&Qw(r.abort)},Zve=function(r,e,t,i){i=Wve(i);var n=!1;r.on("close",function(){n=!0}),zve(r,{readable:e,writable:t},function(o){if(o)return i(o);n=!0,i()});var s=!1;return function(o){if(!n&&!s){if(s=!0,Vve(r))return r.close(kd);if(Xve(r))return r.abort();if(Qw(r.destroy))return r.destroy();i(o||new Error("stream was destroyed"))}}},l8=function(r){r()},$ve=function(r,e){return r.pipe(e)},exe=function(){var r=Array.prototype.slice.call(arguments),e=Qw(r[r.length-1]||kd)&&r.pop()||kd;if(Array.isArray(r[0])&&(r=r[0]),r.length<2)throw new Error("pump requires two streams per minimum");var t,i=r.map(function(n,s){var o=s0;return Zve(n,o,a,function(l){t||(t=l),l&&i.forEach(l8),!o&&(i.forEach(l8),e(t))})});return r.reduce($ve)};A8.exports=exe});var g8=w((ent,u8)=>{"use strict";var{PassThrough:txe}=require("stream");u8.exports=r=>{r=N({},r);let{array:e}=r,{encoding:t}=r,i=t==="buffer",n=!1;e?n=!(t||i):t=t||"utf8",i&&(t=null);let s=new txe({objectMode:n});t&&s.setEncoding(t);let o=0,a=[];return s.on("data",l=>{a.push(l),n?o=a.length:o+=l.length}),s.getBufferedValue=()=>e?a:i?Buffer.concat(a,o):a.join(""),s.getBufferedLength=()=>o,s}});var f8=w((tnt,$g)=>{"use strict";var rxe=c8(),ixe=g8(),Uk=class extends Error{constructor(){super("maxBuffer exceeded");this.name="MaxBufferError"}};async function Sw(r,e){if(!r)return Promise.reject(new Error("Expected a stream"));e=N({maxBuffer:Infinity},e);let{maxBuffer:t}=e,i;return await new Promise((n,s)=>{let o=a=>{a&&(a.bufferedData=i.getBufferedValue()),s(a)};i=rxe(r,ixe(e),a=>{if(a){o(a);return}n()}),i.on("data",()=>{i.getBufferedLength()>t&&o(new Uk)})}),i.getBufferedValue()}$g.exports=Sw;$g.exports.default=Sw;$g.exports.buffer=(r,e)=>Sw(r,te(N({},e),{encoding:"buffer"}));$g.exports.array=(r,e)=>Sw(r,te(N({},e),{array:!0}));$g.exports.MaxBufferError=Uk});var p8=w((int,h8)=>{"use strict";var nxe=[200,203,204,206,300,301,404,405,410,414,501],sxe=[200,203,204,300,301,302,303,307,308,404,405,410,414,501],oxe={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},axe={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function Hk(r){let e={};if(!r)return e;let t=r.trim().split(/\s*,\s*/);for(let i of t){let[n,s]=i.split(/\s*=\s*/,2);e[n]=s===void 0?!0:s.replace(/^"|"$/g,"")}return e}function Axe(r){let e=[];for(let t in r){let i=r[t];e.push(i===!0?t:t+"="+i)}if(!!e.length)return e.join(", ")}h8.exports=class{constructor(e,t,{shared:i,cacheHeuristic:n,immutableMinTimeToLive:s,ignoreCargoCult:o,trustServerDate:a,_fromObject:l}={}){if(l){this._fromObject(l);return}if(!t||!t.headers)throw Error("Response headers missing");this._assertRequestHasHeaders(e),this._responseTime=this.now(),this._isShared=i!==!1,this._trustServerDate=a!==void 0?a:!0,this._cacheHeuristic=n!==void 0?n:.1,this._immutableMinTtl=s!==void 0?s:24*3600*1e3,this._status="status"in t?t.status:200,this._resHeaders=t.headers,this._rescc=Hk(t.headers["cache-control"]),this._method="method"in e?e.method:"GET",this._url=e.url,this._host=e.headers.host,this._noAuthorization=!e.headers.authorization,this._reqHeaders=t.headers.vary?e.headers:null,this._reqcc=Hk(e.headers["cache-control"]),o&&"pre-check"in this._rescc&&"post-check"in this._rescc&&(delete this._rescc["pre-check"],delete this._rescc["post-check"],delete this._rescc["no-cache"],delete this._rescc["no-store"],delete this._rescc["must-revalidate"],this._resHeaders=Object.assign({},this._resHeaders,{"cache-control":Axe(this._rescc)}),delete this._resHeaders.expires,delete this._resHeaders.pragma),!t.headers["cache-control"]&&/no-cache/.test(t.headers.pragma)&&(this._rescc["no-cache"]=!0)}now(){return Date.now()}storable(){return!!(!this._reqcc["no-store"]&&(this._method==="GET"||this._method==="HEAD"||this._method==="POST"&&this._hasExplicitExpiration())&&sxe.indexOf(this._status)!==-1&&!this._rescc["no-store"]&&(!this._isShared||!this._rescc.private)&&(!this._isShared||this._noAuthorization||this._allowsStoringAuthenticated())&&(this._resHeaders.expires||this._rescc.public||this._rescc["max-age"]||this._rescc["s-maxage"]||nxe.indexOf(this._status)!==-1))}_hasExplicitExpiration(){return this._isShared&&this._rescc["s-maxage"]||this._rescc["max-age"]||this._resHeaders.expires}_assertRequestHasHeaders(e){if(!e||!e.headers)throw Error("Request headers missing")}satisfiesWithoutRevalidation(e){this._assertRequestHasHeaders(e);let t=Hk(e.headers["cache-control"]);return t["no-cache"]||/no-cache/.test(e.headers.pragma)||t["max-age"]&&this.age()>t["max-age"]||t["min-fresh"]&&this.timeToLive()<1e3*t["min-fresh"]||this.stale()&&!(t["max-stale"]&&!this._rescc["must-revalidate"]&&(t["max-stale"]===!0||t["max-stale"]>this.age()-this.maxAge()))?!1:this._requestMatches(e,!1)}_requestMatches(e,t){return(!this._url||this._url===e.url)&&this._host===e.headers.host&&(!e.method||this._method===e.method||t&&e.method==="HEAD")&&this._varyMatches(e)}_allowsStoringAuthenticated(){return this._rescc["must-revalidate"]||this._rescc.public||this._rescc["s-maxage"]}_varyMatches(e){if(!this._resHeaders.vary)return!0;if(this._resHeaders.vary==="*")return!1;let t=this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/);for(let i of t)if(e.headers[i]!==this._reqHeaders[i])return!1;return!0}_copyWithoutHopByHopHeaders(e){let t={};for(let i in e)oxe[i]||(t[i]=e[i]);if(e.connection){let i=e.connection.trim().split(/\s*,\s*/);for(let n of i)delete t[n]}if(t.warning){let i=t.warning.split(/,/).filter(n=>!/^\s*1[0-9][0-9]/.test(n));i.length?t.warning=i.join(",").trim():delete t.warning}return t}responseHeaders(){let e=this._copyWithoutHopByHopHeaders(this._resHeaders),t=this.age();return t>3600*24&&!this._hasExplicitExpiration()&&this.maxAge()>3600*24&&(e.warning=(e.warning?`${e.warning}, `:"")+'113 - "rfc7234 5.5.4"'),e.age=`${Math.round(t)}`,e.date=new Date(this.now()).toUTCString(),e}date(){return this._trustServerDate?this._serverDate():this._responseTime}_serverDate(){let e=Date.parse(this._resHeaders.date);if(isFinite(e)){let t=8*3600*1e3;if(Math.abs(this._responseTime-e)e&&(e=i)}let t=(this.now()-this._responseTime)/1e3;return e+t}_ageValue(){let e=parseInt(this._resHeaders.age);return isFinite(e)?e:0}maxAge(){if(!this.storable()||this._rescc["no-cache"]||this._isShared&&this._resHeaders["set-cookie"]&&!this._rescc.public&&!this._rescc.immutable||this._resHeaders.vary==="*")return 0;if(this._isShared){if(this._rescc["proxy-revalidate"])return 0;if(this._rescc["s-maxage"])return parseInt(this._rescc["s-maxage"],10)}if(this._rescc["max-age"])return parseInt(this._rescc["max-age"],10);let e=this._rescc.immutable?this._immutableMinTtl:0,t=this._serverDate();if(this._resHeaders.expires){let i=Date.parse(this._resHeaders.expires);return Number.isNaN(i)||ii)return Math.max(e,(t-i)/1e3*this._cacheHeuristic)}return e}timeToLive(){return Math.max(0,this.maxAge()-this.age())*1e3}stale(){return this.maxAge()<=this.age()}static fromObject(e){return new this(void 0,void 0,{_fromObject:e})}_fromObject(e){if(this._responseTime)throw Error("Reinitialized");if(!e||e.v!==1)throw Error("Invalid serialization");this._responseTime=e.t,this._isShared=e.sh,this._cacheHeuristic=e.ch,this._immutableMinTtl=e.imm!==void 0?e.imm:24*3600*1e3,this._status=e.st,this._resHeaders=e.resh,this._rescc=e.rescc,this._method=e.m,this._url=e.u,this._host=e.h,this._noAuthorization=e.a,this._reqHeaders=e.reqh,this._reqcc=e.reqcc}toObject(){return{v:1,t:this._responseTime,sh:this._isShared,ch:this._cacheHeuristic,imm:this._immutableMinTtl,st:this._status,resh:this._resHeaders,rescc:this._rescc,m:this._method,u:this._url,h:this._host,a:this._noAuthorization,reqh:this._reqHeaders,reqcc:this._reqcc}}revalidationHeaders(e){this._assertRequestHasHeaders(e);let t=this._copyWithoutHopByHopHeaders(e.headers);if(delete t["if-range"],!this._requestMatches(e,!0)||!this.storable())return delete t["if-none-match"],delete t["if-modified-since"],t;if(this._resHeaders.etag&&(t["if-none-match"]=t["if-none-match"]?`${t["if-none-match"]}, ${this._resHeaders.etag}`:this._resHeaders.etag),t["accept-ranges"]||t["if-match"]||t["if-unmodified-since"]||this._method&&this._method!="GET"){if(delete t["if-modified-since"],t["if-none-match"]){let n=t["if-none-match"].split(/,/).filter(s=>!/^\s*W\//.test(s));n.length?t["if-none-match"]=n.join(",").trim():delete t["if-none-match"]}}else this._resHeaders["last-modified"]&&!t["if-modified-since"]&&(t["if-modified-since"]=this._resHeaders["last-modified"]);return t}revalidatedPolicy(e,t){if(this._assertRequestHasHeaders(e),!t||!t.headers)throw Error("Response headers missing");let i=!1;if(t.status!==void 0&&t.status!=304?i=!1:t.headers.etag&&!/^\s*W\//.test(t.headers.etag)?i=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\s*W\//,"")===t.headers.etag:this._resHeaders.etag&&t.headers.etag?i=this._resHeaders.etag.replace(/^\s*W\//,"")===t.headers.etag.replace(/^\s*W\//,""):this._resHeaders["last-modified"]?i=this._resHeaders["last-modified"]===t.headers["last-modified"]:!this._resHeaders.etag&&!this._resHeaders["last-modified"]&&!t.headers.etag&&!t.headers["last-modified"]&&(i=!0),!i)return{policy:new this.constructor(e,t),modified:t.status!=304,matches:!1};let n={};for(let o in this._resHeaders)n[o]=o in t.headers&&!axe[o]?t.headers[o]:this._resHeaders[o];let s=Object.assign({},t,{status:this._status,method:this._method,headers:n});return{policy:new this.constructor(e,s,{shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl,trustServerDate:this._trustServerDate}),modified:!1,matches:!0}}}});var vw=w((nnt,d8)=>{"use strict";d8.exports=r=>{let e={};for(let[t,i]of Object.entries(r))e[t.toLowerCase()]=i;return e}});var E8=w((snt,C8)=>{"use strict";var lxe=require("stream").Readable,cxe=vw(),m8=class extends lxe{constructor(e,t,i,n){if(typeof e!="number")throw new TypeError("Argument `statusCode` should be a number");if(typeof t!="object")throw new TypeError("Argument `headers` should be an object");if(!(i instanceof Buffer))throw new TypeError("Argument `body` should be a buffer");if(typeof n!="string")throw new TypeError("Argument `url` should be a string");super();this.statusCode=e,this.headers=cxe(t),this.body=i,this.url=n}_read(){this.push(this.body),this.push(null)}};C8.exports=m8});var y8=w((ont,I8)=>{"use strict";var uxe=["destroy","setTimeout","socket","headers","trailers","rawHeaders","statusCode","httpVersion","httpVersionMinor","httpVersionMajor","rawTrailers","statusMessage"];I8.exports=(r,e)=>{let t=new Set(Object.keys(r).concat(uxe));for(let i of t)i in e||(e[i]=typeof r[i]=="function"?r[i].bind(r):r[i])}});var B8=w((ant,w8)=>{"use strict";var gxe=require("stream").PassThrough,fxe=y8(),hxe=r=>{if(!(r&&r.pipe))throw new TypeError("Parameter `response` must be a response stream.");let e=new gxe;return fxe(r,e),r.pipe(e)};w8.exports=hxe});var b8=w(jk=>{jk.stringify=function r(e){if(typeof e=="undefined")return e;if(e&&Buffer.isBuffer(e))return JSON.stringify(":base64:"+e.toString("base64"));if(e&&e.toJSON&&(e=e.toJSON()),e&&typeof e=="object"){var t="",i=Array.isArray(e);t=i?"[":"{";var n=!0;for(var s in e){var o=typeof e[s]=="function"||!i&&typeof e[s]=="undefined";Object.hasOwnProperty.call(e,s)&&!o&&(n||(t+=","),n=!1,i?e[s]==null?t+="null":t+=r(e[s]):e[s]!==void 0&&(t+=r(s)+":"+r(e[s])))}return t+=i?"]":"}",t}else return typeof e=="string"?JSON.stringify(/^:/.test(e)?":"+e:e):typeof e=="undefined"?"null":JSON.stringify(e)};jk.parse=function(r){return JSON.parse(r,function(e,t){return typeof t=="string"?/^:base64:/.test(t)?Buffer.from(t.substring(8),"base64"):/^:/.test(t)?t.substring(1):t:t})}});var x8=w((lnt,Q8)=>{"use strict";var pxe=require("events"),S8=b8(),dxe=r=>{let e={redis:"@keyv/redis",mongodb:"@keyv/mongo",mongo:"@keyv/mongo",sqlite:"@keyv/sqlite",postgresql:"@keyv/postgres",postgres:"@keyv/postgres",mysql:"@keyv/mysql"};if(r.adapter||r.uri){let t=r.adapter||/^[^:]*/.exec(r.uri)[0];return new(require(e[t]))(r)}return new Map},v8=class extends pxe{constructor(e,t){super();if(this.opts=Object.assign({namespace:"keyv",serialize:S8.stringify,deserialize:S8.parse},typeof e=="string"?{uri:e}:e,t),!this.opts.store){let i=Object.assign({},this.opts);this.opts.store=dxe(i)}typeof this.opts.store.on=="function"&&this.opts.store.on("error",i=>this.emit("error",i)),this.opts.store.namespace=this.opts.namespace}_getKeyPrefix(e){return`${this.opts.namespace}:${e}`}get(e,t){e=this._getKeyPrefix(e);let{store:i}=this.opts;return Promise.resolve().then(()=>i.get(e)).then(n=>typeof n=="string"?this.opts.deserialize(n):n).then(n=>{if(n!==void 0){if(typeof n.expires=="number"&&Date.now()>n.expires){this.delete(e);return}return t&&t.raw?n:n.value}})}set(e,t,i){e=this._getKeyPrefix(e),typeof i=="undefined"&&(i=this.opts.ttl),i===0&&(i=void 0);let{store:n}=this.opts;return Promise.resolve().then(()=>{let s=typeof i=="number"?Date.now()+i:null;return t={value:t,expires:s},this.opts.serialize(t)}).then(s=>n.set(e,s,i)).then(()=>!0)}delete(e){e=this._getKeyPrefix(e);let{store:t}=this.opts;return Promise.resolve().then(()=>t.delete(e))}clear(){let{store:e}=this.opts;return Promise.resolve().then(()=>e.clear())}};Q8.exports=v8});var D8=w((cnt,k8)=>{"use strict";var Cxe=require("events"),xw=require("url"),mxe=e8(),Exe=f8(),Gk=p8(),P8=E8(),Ixe=vw(),yxe=B8(),wxe=x8(),ia=class{constructor(e,t){if(typeof e!="function")throw new TypeError("Parameter `request` must be a function");return this.cache=new wxe({uri:typeof t=="string"&&t,store:typeof t!="string"&&t,namespace:"cacheable-request"}),this.createCacheableRequest(e)}createCacheableRequest(e){return(t,i)=>{let n;if(typeof t=="string")n=Yk(xw.parse(t)),t={};else if(t instanceof xw.URL)n=Yk(xw.parse(t.toString())),t={};else{let[g,...f]=(t.path||"").split("?"),h=f.length>0?`?${f.join("?")}`:"";n=Yk(te(N({},t),{pathname:g,search:h}))}t=N(N({headers:{},method:"GET",cache:!0,strictTtl:!1,automaticFailover:!1},t),Bxe(n)),t.headers=Ixe(t.headers);let s=new Cxe,o=mxe(xw.format(n),{stripWWW:!1,removeTrailingSlash:!1,stripAuthentication:!1}),a=`${t.method}:${o}`,l=!1,c=!1,u=g=>{c=!0;let f=!1,h,p=new Promise(y=>{h=()=>{f||(f=!0,y())}}),m=y=>{if(l&&!g.forceRefresh){y.status=y.statusCode;let v=Gk.fromObject(l.cachePolicy).revalidatedPolicy(g,y);if(!v.modified){let x=v.policy.responseHeaders();y=new P8(l.statusCode,x,l.body,l.url),y.cachePolicy=v.policy,y.fromCache=!0}}y.fromCache||(y.cachePolicy=new Gk(g,y,g),y.fromCache=!1);let b;g.cache&&y.cachePolicy.storable()?(b=yxe(y),(async()=>{try{let v=Exe.buffer(y);if(await Promise.race([p,new Promise(Y=>y.once("end",Y))]),f)return;let x=await v,T={cachePolicy:y.cachePolicy.toObject(),url:y.url,statusCode:y.fromCache?l.statusCode:y.statusCode,body:x},q=g.strictTtl?y.cachePolicy.timeToLive():void 0;g.maxTtl&&(q=q?Math.min(q,g.maxTtl):g.maxTtl),await this.cache.set(a,T,q)}catch(v){s.emit("error",new ia.CacheError(v))}})()):g.cache&&l&&(async()=>{try{await this.cache.delete(a)}catch(v){s.emit("error",new ia.CacheError(v))}})(),s.emit("response",b||y),typeof i=="function"&&i(b||y)};try{let y=e(g,m);y.once("error",h),y.once("abort",h),s.emit("request",y)}catch(y){s.emit("error",new ia.RequestError(y))}};return(async()=>{let g=async h=>{await Promise.resolve();let p=h.cache?await this.cache.get(a):void 0;if(typeof p=="undefined")return u(h);let m=Gk.fromObject(p.cachePolicy);if(m.satisfiesWithoutRevalidation(h)&&!h.forceRefresh){let y=m.responseHeaders(),b=new P8(p.statusCode,y,p.body,p.url);b.cachePolicy=m,b.fromCache=!0,s.emit("response",b),typeof i=="function"&&i(b)}else l=p,h.headers=m.revalidationHeaders(h),u(h)},f=h=>s.emit("error",new ia.CacheError(h));this.cache.once("error",f),s.on("response",()=>this.cache.removeListener("error",f));try{await g(t)}catch(h){t.automaticFailover&&!c&&u(t),s.emit("error",new ia.CacheError(h))}})(),s}}};function Bxe(r){let e=N({},r);return e.path=`${r.pathname||"/"}${r.search||""}`,delete e.pathname,delete e.search,e}function Yk(r){return{protocol:r.protocol,auth:r.auth,hostname:r.hostname||r.host||"localhost",port:r.port,pathname:r.pathname,search:r.search}}ia.RequestError=class extends Error{constructor(r){super(r.message);this.name="RequestError",Object.assign(this,r)}};ia.CacheError=class extends Error{constructor(r){super(r.message);this.name="CacheError",Object.assign(this,r)}};k8.exports=ia});var F8=w((unt,R8)=>{"use strict";var bxe=["aborted","complete","headers","httpVersion","httpVersionMinor","httpVersionMajor","method","rawHeaders","rawTrailers","setTimeout","socket","statusCode","statusMessage","trailers","url"];R8.exports=(r,e)=>{if(e._readableState.autoDestroy)throw new Error("The second stream must have the `autoDestroy` option set to `false`");let t=new Set(Object.keys(r).concat(bxe)),i={};for(let n of t)n in e||(i[n]={get(){let s=r[n];return typeof s=="function"?s.bind(r):s},set(s){r[n]=s},enumerable:!0,configurable:!1});return Object.defineProperties(e,i),r.once("aborted",()=>{e.destroy(),e.emit("aborted")}),r.once("close",()=>{r.complete&&e.readable?e.once("end",()=>{e.emit("close")}):e.emit("close")}),e}});var L8=w((gnt,N8)=>{"use strict";var{Transform:Qxe,PassThrough:Sxe}=require("stream"),qk=require("zlib"),vxe=F8();N8.exports=r=>{let e=(r.headers["content-encoding"]||"").toLowerCase();if(!["gzip","deflate","br"].includes(e))return r;let t=e==="br";if(t&&typeof qk.createBrotliDecompress!="function")return r.destroy(new Error("Brotli is not supported on Node.js < 12")),r;let i=!0,n=new Qxe({transform(a,l,c){i=!1,c(null,a)},flush(a){a()}}),s=new Sxe({autoDestroy:!1,destroy(a,l){r.destroy(),l(a)}}),o=t?qk.createBrotliDecompress():qk.createUnzip();return o.once("error",a=>{if(i&&!r.readable){s.end();return}s.destroy(a)}),vxe(r,s),r.pipe(n).pipe(o).pipe(s),s}});var Jk=w((fnt,T8)=>{"use strict";var O8=class{constructor(e={}){if(!(e.maxSize&&e.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");this.maxSize=e.maxSize,this.onEviction=e.onEviction,this.cache=new Map,this.oldCache=new Map,this._size=0}_set(e,t){if(this.cache.set(e,t),this._size++,this._size>=this.maxSize){if(this._size=0,typeof this.onEviction=="function")for(let[i,n]of this.oldCache.entries())this.onEviction(i,n);this.oldCache=this.cache,this.cache=new Map}}get(e){if(this.cache.has(e))return this.cache.get(e);if(this.oldCache.has(e)){let t=this.oldCache.get(e);return this.oldCache.delete(e),this._set(e,t),t}}set(e,t){return this.cache.has(e)?this.cache.set(e,t):this._set(e,t),this}has(e){return this.cache.has(e)||this.oldCache.has(e)}peek(e){if(this.cache.has(e))return this.cache.get(e);if(this.oldCache.has(e))return this.oldCache.get(e)}delete(e){let t=this.cache.delete(e);return t&&this._size--,this.oldCache.delete(e)||t}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}*keys(){for(let[e]of this)yield e}*values(){for(let[,e]of this)yield e}*[Symbol.iterator](){for(let e of this.cache)yield e;for(let e of this.oldCache){let[t]=e;this.cache.has(t)||(yield e)}}get size(){let e=0;for(let t of this.oldCache.keys())this.cache.has(t)||e++;return Math.min(this._size+e,this.maxSize)}};T8.exports=O8});var zk=w((hnt,M8)=>{"use strict";var xxe=require("events"),kxe=require("tls"),Pxe=require("http2"),Dxe=Jk(),gn=Symbol("currentStreamsCount"),K8=Symbol("request"),Ls=Symbol("cachedOriginSet"),ef=Symbol("gracefullyClosing"),Rxe=["maxDeflateDynamicTableSize","maxSessionMemory","maxHeaderListPairs","maxOutstandingPings","maxReservedRemoteStreams","maxSendHeaderBlockLength","paddingStrategy","localAddress","path","rejectUnauthorized","minDHSize","ca","cert","clientCertEngine","ciphers","key","pfx","servername","minVersion","maxVersion","secureProtocol","crl","honorCipherOrder","ecdhCurve","dhparam","secureOptions","sessionIdContext"],Fxe=(r,e,t)=>{let i=0,n=r.length;for(;i>>1;t(r[s],e)?i=s+1:n=s}return i},Nxe=(r,e)=>r.remoteSettings.maxConcurrentStreams>e.remoteSettings.maxConcurrentStreams,Wk=(r,e)=>{for(let t of r)t[Ls].lengthe[Ls].includes(i))&&t[gn]+e[gn]<=e.remoteSettings.maxConcurrentStreams&&U8(t)},Lxe=(r,e)=>{for(let t of r)e[Ls].lengtht[Ls].includes(i))&&e[gn]+t[gn]<=t.remoteSettings.maxConcurrentStreams&&U8(e)},H8=({agent:r,isFree:e})=>{let t={};for(let i in r.sessions){let s=r.sessions[i].filter(o=>{let a=o[nA.kCurrentStreamsCount]{r[ef]=!0,r[gn]===0&&r.close()},nA=class extends xxe{constructor({timeout:e=6e4,maxSessions:t=Infinity,maxFreeSessions:i=10,maxCachedTlsSessions:n=100}={}){super();this.sessions={},this.queue={},this.timeout=e,this.maxSessions=t,this.maxFreeSessions=i,this._freeSessionsCount=0,this._sessionsCount=0,this.settings={enablePush:!1},this.tlsSessionCache=new Dxe({maxSize:n})}static normalizeOrigin(e,t){return typeof e=="string"&&(e=new URL(e)),t&&e.hostname!==t&&(e.hostname=t),e.origin}normalizeOptions(e){let t="";if(e)for(let i of Rxe)e[i]&&(t+=`:${e[i]}`);return t}_tryToCreateNewSession(e,t){if(!(e in this.queue)||!(t in this.queue[e]))return;let i=this.queue[e][t];this._sessionsCount{Array.isArray(i)?(i=[...i],n()):i=[{resolve:n,reject:s}];let o=this.normalizeOptions(t),a=nA.normalizeOrigin(e,t&&t.servername);if(a===void 0){for(let{reject:u}of i)u(new TypeError("The `origin` argument needs to be a string or an URL object"));return}if(o in this.sessions){let u=this.sessions[o],g=-1,f=-1,h;for(let p of u){let m=p.remoteSettings.maxConcurrentStreams;if(m=m||p[ef]||p.destroyed)continue;h||(g=m),y>f&&(h=p,f=y)}}if(h){if(i.length!==1){for(let{reject:p}of i){let m=new Error(`Expected the length of listeners to be 1, got ${i.length}. -Please report this to https://github.com/szmarczak/http2-wrapper/`);p(m)}return}i[0].resolve(h);return}}if(o in this.queue){if(a in this.queue[o]){this.queue[o][a].listeners.push(...i),this._tryToCreateNewSession(o,a);return}}else this.queue[o]={};let l=()=>{o in this.queue&&this.queue[o][a]===c&&(delete this.queue[o][a],Object.keys(this.queue[o]).length===0&&delete this.queue[o])},c=()=>{let u=`${a}:${o}`,g=!1;try{let f=Pxe.connect(e,N({createConnection:this.createConnection,settings:this.settings,session:this.tlsSessionCache.get(u)},t));f[gn]=0,f[ef]=!1;let h=()=>f[gn]{this.tlsSessionCache.set(u,y)}),f.once("error",y=>{for(let{reject:b}of i)b(y);this.tlsSessionCache.delete(u)}),f.setTimeout(this.timeout,()=>{f.destroy()}),f.once("close",()=>{if(g){p&&this._freeSessionsCount--,this._sessionsCount--;let y=this.sessions[o];y.splice(y.indexOf(f),1),y.length===0&&delete this.sessions[o]}else{let y=new Error("Session closed without receiving a SETTINGS frame");y.code="HTTP2WRAPPER_NOSETTINGS";for(let{reject:b}of i)b(y);l()}this._tryToCreateNewSession(o,a)});let m=()=>{if(!(!(o in this.queue)||!h())){for(let y of f[Ls])if(y in this.queue[o]){let{listeners:b}=this.queue[o][y];for(;b.length!==0&&h();)b.shift().resolve(f);let v=this.queue[o];if(v[y].listeners.length===0&&(delete v[y],Object.keys(v).length===0)){delete this.queue[o];break}if(!h())break}}};f.on("origin",()=>{f[Ls]=f.originSet,!!h()&&(m(),Wk(this.sessions[o],f))}),f.once("remoteSettings",()=>{if(f.ref(),f.unref(),this._sessionsCount++,c.destroyed){let y=new Error("Agent has been destroyed");for(let b of i)b.reject(y);f.destroy();return}f[Ls]=f.originSet;{let y=this.sessions;if(o in y){let b=y[o];b.splice(Fxe(b,f,Nxe),0,f)}else y[o]=[f]}this._freeSessionsCount+=1,g=!0,this.emit("session",f),m(),l(),f[gn]===0&&this._freeSessionsCount>this.maxFreeSessions&&f.close(),i.length!==0&&(this.getSession(a,t,i),i.length=0),f.on("remoteSettings",()=>{m(),Wk(this.sessions[o],f)})}),f[K8]=f.request,f.request=(y,b)=>{if(f[ef])throw new Error("The session is gracefully closing. No new streams are allowed.");let v=f[K8](y,b);return f.ref(),++f[gn],f[gn]===f.remoteSettings.maxConcurrentStreams&&this._freeSessionsCount--,v.once("close",()=>{if(p=h(),--f[gn],!f.destroyed&&!f.closed&&(Lxe(this.sessions[o],f),h()&&!f.closed)){p||(this._freeSessionsCount++,p=!0);let x=f[gn]===0;x&&f.unref(),x&&(this._freeSessionsCount>this.maxFreeSessions||f[ef])?f.close():(Wk(this.sessions[o],f),m())}}),v}}catch(f){for(let h of i)h.reject(f);l()}};c.listeners=i,c.completed=!1,c.destroyed=!1,this.queue[o][a]=c,this._tryToCreateNewSession(o,a)})}request(e,t,i,n){return new Promise((s,o)=>{this.getSession(e,t,[{reject:o,resolve:a=>{try{s(a.request(i,n))}catch(l){o(l)}}}])})}createConnection(e,t){return nA.connect(e,t)}static connect(e,t){t.ALPNProtocols=["h2"];let i=e.port||443,n=e.hostname||e.host;return typeof t.servername=="undefined"&&(t.servername=n),kxe.connect(i,n,t)}closeFreeSessions(){for(let e of Object.values(this.sessions))for(let t of e)t[gn]===0&&t.close()}destroy(e){for(let t of Object.values(this.sessions))for(let i of t)i.destroy(e);for(let t of Object.values(this.queue))for(let i of Object.values(t))i.destroyed=!0;this.queue={}}get freeSessions(){return H8({agent:this,isFree:!0})}get busySessions(){return H8({agent:this,isFree:!1})}};nA.kCurrentStreamsCount=gn;nA.kGracefullyClosing=ef;M8.exports={Agent:nA,globalAgent:new nA}});var _k=w((pnt,j8)=>{"use strict";var{Readable:Txe}=require("stream"),G8=class extends Txe{constructor(e,t){super({highWaterMark:t,autoDestroy:!1});this.statusCode=null,this.statusMessage="",this.httpVersion="2.0",this.httpVersionMajor=2,this.httpVersionMinor=0,this.headers={},this.trailers={},this.req=null,this.aborted=!1,this.complete=!1,this.upgrade=null,this.rawHeaders=[],this.rawTrailers=[],this.socket=e,this.connection=e,this._dumped=!1}_destroy(e){this.req._request.destroy(e)}setTimeout(e,t){return this.req.setTimeout(e,t),this}_dump(){this._dumped||(this._dumped=!0,this.removeAllListeners("data"),this.resume())}_read(){this.req&&this.req._request.resume()}};j8.exports=G8});var Vk=w((dnt,Y8)=>{"use strict";Y8.exports=r=>{let e={protocol:r.protocol,hostname:typeof r.hostname=="string"&&r.hostname.startsWith("[")?r.hostname.slice(1,-1):r.hostname,host:r.host,hash:r.hash,search:r.search,pathname:r.pathname,href:r.href,path:`${r.pathname||""}${r.search||""}`};return typeof r.port=="string"&&r.port.length!==0&&(e.port=Number(r.port)),(r.username||r.password)&&(e.auth=`${r.username||""}:${r.password||""}`),e}});var J8=w((Cnt,q8)=>{"use strict";q8.exports=(r,e,t)=>{for(let i of t)r.on(i,(...n)=>e.emit(i,...n))}});var z8=w((mnt,W8)=>{"use strict";W8.exports=r=>{switch(r){case":method":case":scheme":case":authority":case":path":return!0;default:return!1}}});var V8=w((Int,_8)=>{"use strict";var tf=(r,e,t)=>{_8.exports[e]=class extends r{constructor(...n){super(typeof t=="string"?t:t(n));this.name=`${super.name} [${e}]`,this.code=e}}};tf(TypeError,"ERR_INVALID_ARG_TYPE",r=>{let e=r[0].includes(".")?"property":"argument",t=r[1],i=Array.isArray(t);return i&&(t=`${t.slice(0,-1).join(", ")} or ${t.slice(-1)}`),`The "${r[0]}" ${e} must be ${i?"one of":"of"} type ${t}. Received ${typeof r[2]}`});tf(TypeError,"ERR_INVALID_PROTOCOL",r=>`Protocol "${r[0]}" not supported. Expected "${r[1]}"`);tf(Error,"ERR_HTTP_HEADERS_SENT",r=>`Cannot ${r[0]} headers after they are sent to the client`);tf(TypeError,"ERR_INVALID_HTTP_TOKEN",r=>`${r[0]} must be a valid HTTP token [${r[1]}]`);tf(TypeError,"ERR_HTTP_INVALID_HEADER_VALUE",r=>`Invalid value "${r[0]} for header "${r[1]}"`);tf(TypeError,"ERR_INVALID_CHAR",r=>`Invalid character in ${r[0]} [${r[1]}]`)});var eP=w((ynt,X8)=>{"use strict";var Oxe=require("http2"),{Writable:Mxe}=require("stream"),{Agent:Z8,globalAgent:Kxe}=zk(),Uxe=_k(),Hxe=Vk(),jxe=J8(),Gxe=z8(),{ERR_INVALID_ARG_TYPE:Xk,ERR_INVALID_PROTOCOL:Yxe,ERR_HTTP_HEADERS_SENT:$8,ERR_INVALID_HTTP_TOKEN:qxe,ERR_HTTP_INVALID_HEADER_VALUE:Jxe,ERR_INVALID_CHAR:Wxe}=V8(),{HTTP2_HEADER_STATUS:ez,HTTP2_HEADER_METHOD:tz,HTTP2_HEADER_PATH:rz,HTTP2_METHOD_CONNECT:zxe}=Oxe.constants,Wi=Symbol("headers"),Zk=Symbol("origin"),$k=Symbol("session"),iz=Symbol("options"),kw=Symbol("flushedHeaders"),Pd=Symbol("jobs"),_xe=/^[\^`\-\w!#$%&*+.|~]+$/,Vxe=/[^\t\u0020-\u007E\u0080-\u00FF]/,nz=class extends Mxe{constructor(e,t,i){super({autoDestroy:!1});let n=typeof e=="string"||e instanceof URL;if(n&&(e=Hxe(e instanceof URL?e:new URL(e))),typeof t=="function"||t===void 0?(i=t,t=n?e:N({},e)):t=N(N({},e),t),t.h2session)this[$k]=t.h2session;else if(t.agent===!1)this.agent=new Z8({maxFreeSessions:0});else if(typeof t.agent=="undefined"||t.agent===null)typeof t.createConnection=="function"?(this.agent=new Z8({maxFreeSessions:0}),this.agent.createConnection=t.createConnection):this.agent=Kxe;else if(typeof t.agent.request=="function")this.agent=t.agent;else throw new Xk("options.agent",["Agent-like Object","undefined","false"],t.agent);if(t.protocol&&t.protocol!=="https:")throw new Yxe(t.protocol,"https:");let s=t.port||t.defaultPort||this.agent&&this.agent.defaultPort||443,o=t.hostname||t.host||"localhost";delete t.hostname,delete t.host,delete t.port;let{timeout:a}=t;if(t.timeout=void 0,this[Wi]=Object.create(null),this[Pd]=[],this.socket=null,this.connection=null,this.method=t.method||"GET",this.path=t.path,this.res=null,this.aborted=!1,this.reusedSocket=!1,t.headers)for(let[l,c]of Object.entries(t.headers))this.setHeader(l,c);t.auth&&!("authorization"in this[Wi])&&(this[Wi].authorization="Basic "+Buffer.from(t.auth).toString("base64")),t.session=t.tlsSession,t.path=t.socketPath,this[iz]=t,s===443?(this[Zk]=`https://${o}`,":authority"in this[Wi]||(this[Wi][":authority"]=o)):(this[Zk]=`https://${o}:${s}`,":authority"in this[Wi]||(this[Wi][":authority"]=`${o}:${s}`)),a&&this.setTimeout(a),i&&this.once("response",i),this[kw]=!1}get method(){return this[Wi][tz]}set method(e){e&&(this[Wi][tz]=e.toUpperCase())}get path(){return this[Wi][rz]}set path(e){e&&(this[Wi][rz]=e)}get _mustNotHaveABody(){return this.method==="GET"||this.method==="HEAD"||this.method==="DELETE"}_write(e,t,i){if(this._mustNotHaveABody){i(new Error("The GET, HEAD and DELETE methods must NOT have a body"));return}this.flushHeaders();let n=()=>this._request.write(e,t,i);this._request?n():this[Pd].push(n)}_final(e){if(this.destroyed)return;this.flushHeaders();let t=()=>{if(this._mustNotHaveABody){e();return}this._request.end(e)};this._request?t():this[Pd].push(t)}abort(){this.res&&this.res.complete||(this.aborted||process.nextTick(()=>this.emit("abort")),this.aborted=!0,this.destroy())}_destroy(e,t){this.res&&this.res._dump(),this._request&&this._request.destroy(),t(e)}async flushHeaders(){if(this[kw]||this.destroyed)return;this[kw]=!0;let e=this.method===zxe,t=i=>{if(this._request=i,this.destroyed){i.destroy();return}e||jxe(i,this,["timeout","continue","close","error"]);let n=o=>(...a)=>{!this.writable&&!this.destroyed?o(...a):this.once("finish",()=>{o(...a)})};i.once("response",n((o,a,l)=>{let c=new Uxe(this.socket,i.readableHighWaterMark);this.res=c,c.req=this,c.statusCode=o[ez],c.headers=o,c.rawHeaders=l,c.once("end",()=>{this.aborted?(c.aborted=!0,c.emit("aborted")):(c.complete=!0,c.socket=null,c.connection=null)}),e?(c.upgrade=!0,this.emit("connect",c,i,Buffer.alloc(0))?this.emit("close"):i.destroy()):(i.on("data",u=>{!c._dumped&&!c.push(u)&&i.pause()}),i.once("end",()=>{c.push(null)}),this.emit("response",c)||c._dump())})),i.once("headers",n(o=>this.emit("information",{statusCode:o[ez]}))),i.once("trailers",n((o,a,l)=>{let{res:c}=this;c.trailers=o,c.rawTrailers=l}));let{socket:s}=i.session;this.socket=s,this.connection=s;for(let o of this[Pd])o();this.emit("socket",this.socket)};if(this[$k])try{t(this[$k].request(this[Wi]))}catch(i){this.emit("error",i)}else{this.reusedSocket=!0;try{t(await this.agent.request(this[Zk],this[iz],this[Wi]))}catch(i){this.emit("error",i)}}}getHeader(e){if(typeof e!="string")throw new Xk("name","string",e);return this[Wi][e.toLowerCase()]}get headersSent(){return this[kw]}removeHeader(e){if(typeof e!="string")throw new Xk("name","string",e);if(this.headersSent)throw new $8("remove");delete this[Wi][e.toLowerCase()]}setHeader(e,t){if(this.headersSent)throw new $8("set");if(typeof e!="string"||!_xe.test(e)&&!Gxe(e))throw new qxe("Header name",e);if(typeof t=="undefined")throw new Jxe(t,e);if(Vxe.test(t))throw new Wxe("header content",e);this[Wi][e.toLowerCase()]=t}setNoDelay(){}setSocketKeepAlive(){}setTimeout(e,t){let i=()=>this._request.setTimeout(e,t);return this._request?i():this[Pd].push(i),this}get maxHeadersCount(){if(!this.destroyed&&this._request)return this._request.session.localSettings.maxHeaderListSize}set maxHeadersCount(e){}};X8.exports=nz});var oz=w((wnt,sz)=>{"use strict";var Xxe=require("tls");sz.exports=(r={})=>new Promise((e,t)=>{let i=Xxe.connect(r,()=>{r.resolveSocket?(i.off("error",t),e({alpnProtocol:i.alpnProtocol,socket:i})):(i.destroy(),e({alpnProtocol:i.alpnProtocol}))});i.on("error",t)})});var Az=w((Bnt,az)=>{"use strict";var Zxe=require("net");az.exports=r=>{let e=r.host,t=r.headers&&r.headers.host;return t&&(t.startsWith("[")?t.indexOf("]")===-1?e=t:e=t.slice(1,-1):e=t.split(":",1)[0]),Zxe.isIP(e)?"":e}});var uz=w((bnt,tP)=>{"use strict";var lz=require("http"),rP=require("https"),$xe=oz(),eke=Jk(),tke=eP(),rke=Az(),ike=Vk(),Pw=new eke({maxSize:100}),Dd=new Map,cz=(r,e,t)=>{e._httpMessage={shouldKeepAlive:!0};let i=()=>{r.emit("free",e,t)};e.on("free",i);let n=()=>{r.removeSocket(e,t)};e.on("close",n);let s=()=>{r.removeSocket(e,t),e.off("close",n),e.off("free",i),e.off("agentRemove",s)};e.on("agentRemove",s),r.emit("free",e,t)},nke=async r=>{let e=`${r.host}:${r.port}:${r.ALPNProtocols.sort()}`;if(!Pw.has(e)){if(Dd.has(e))return(await Dd.get(e)).alpnProtocol;let{path:t,agent:i}=r;r.path=r.socketPath;let n=$xe(r);Dd.set(e,n);try{let{socket:s,alpnProtocol:o}=await n;if(Pw.set(e,o),r.path=t,o==="h2")s.destroy();else{let{globalAgent:a}=rP,l=rP.Agent.prototype.createConnection;i?i.createConnection===l?cz(i,s,r):s.destroy():a.createConnection===l?cz(a,s,r):s.destroy()}return Dd.delete(e),o}catch(s){throw Dd.delete(e),s}}return Pw.get(e)};tP.exports=async(r,e,t)=>{if((typeof r=="string"||r instanceof URL)&&(r=ike(new URL(r))),typeof e=="function"&&(t=e,e=void 0),e=te(N(N({ALPNProtocols:["h2","http/1.1"]},r),e),{resolveSocket:!0}),!Array.isArray(e.ALPNProtocols)||e.ALPNProtocols.length===0)throw new Error("The `ALPNProtocols` option must be an Array with at least one entry");e.protocol=e.protocol||"https:";let i=e.protocol==="https:";e.host=e.hostname||e.host||"localhost",e.session=e.tlsSession,e.servername=e.servername||rke(e),e.port=e.port||(i?443:80),e._defaultAgent=i?rP.globalAgent:lz.globalAgent;let n=e.agent;if(n){if(n.addRequest)throw new Error("The `options.agent` object can contain only `http`, `https` or `http2` properties");e.agent=n[i?"https":"http"]}return i&&await nke(e)==="h2"?(n&&(e.agent=n.http2),new tke(e,t)):lz.request(e,t)};tP.exports.protocolCache=Pw});var fz=w((Qnt,gz)=>{"use strict";var ske=require("http2"),oke=zk(),iP=eP(),ake=_k(),Ake=uz(),lke=(r,e,t)=>new iP(r,e,t),cke=(r,e,t)=>{let i=new iP(r,e,t);return i.end(),i};gz.exports=te(N(te(N({},ske),{ClientRequest:iP,IncomingMessage:ake}),oke),{request:lke,get:cke,auto:Ake})});var sP=w(nP=>{"use strict";Object.defineProperty(nP,"__esModule",{value:!0});var hz=iA();nP.default=r=>hz.default.nodeStream(r)&&hz.default.function_(r.getBoundary)});var mz=w(oP=>{"use strict";Object.defineProperty(oP,"__esModule",{value:!0});var pz=require("fs"),dz=require("util"),Cz=iA(),uke=sP(),gke=dz.promisify(pz.stat);oP.default=async(r,e)=>{if(e&&"content-length"in e)return Number(e["content-length"]);if(!r)return 0;if(Cz.default.string(r))return Buffer.byteLength(r);if(Cz.default.buffer(r))return r.length;if(uke.default(r))return dz.promisify(r.getLength.bind(r))();if(r instanceof pz.ReadStream){let{size:t}=await gke(r.path);return t===0?void 0:t}}});var AP=w(aP=>{"use strict";Object.defineProperty(aP,"__esModule",{value:!0});function fke(r,e,t){let i={};for(let n of t)i[n]=(...s)=>{e.emit(n,...s)},r.on(n,i[n]);return()=>{for(let n of t)r.off(n,i[n])}}aP.default=fke});var Ez=w(lP=>{"use strict";Object.defineProperty(lP,"__esModule",{value:!0});lP.default=()=>{let r=[];return{once(e,t,i){e.once(t,i),r.push({origin:e,event:t,fn:i})},unhandleAll(){for(let e of r){let{origin:t,event:i,fn:n}=e;t.removeListener(i,n)}r.length=0}}}});var yz=w(Rd=>{"use strict";Object.defineProperty(Rd,"__esModule",{value:!0});Rd.TimeoutError=void 0;var hke=require("net"),pke=Ez(),Iz=Symbol("reentry"),dke=()=>{},cP=class extends Error{constructor(e,t){super(`Timeout awaiting '${t}' for ${e}ms`);this.event=t,this.name="TimeoutError",this.code="ETIMEDOUT"}};Rd.TimeoutError=cP;Rd.default=(r,e,t)=>{if(Iz in r)return dke;r[Iz]=!0;let i=[],{once:n,unhandleAll:s}=pke.default(),o=(g,f,h)=>{var p;let m=setTimeout(f,g,g,h);(p=m.unref)===null||p===void 0||p.call(m);let y=()=>{clearTimeout(m)};return i.push(y),y},{host:a,hostname:l}=t,c=(g,f)=>{r.destroy(new cP(g,f))},u=()=>{for(let g of i)g();s()};if(r.once("error",g=>{if(u(),r.listenerCount("error")===0)throw g}),r.once("close",u),n(r,"response",g=>{n(g,"end",u)}),typeof e.request!="undefined"&&o(e.request,c,"request"),typeof e.socket!="undefined"){let g=()=>{c(e.socket,"socket")};r.setTimeout(e.socket,g),i.push(()=>{r.removeListener("timeout",g)})}return n(r,"socket",g=>{var f;let{socketPath:h}=r;if(g.connecting){let p=Boolean(h!=null?h:hke.isIP((f=l!=null?l:a)!==null&&f!==void 0?f:"")!==0);if(typeof e.lookup!="undefined"&&!p&&typeof g.address().address=="undefined"){let m=o(e.lookup,c,"lookup");n(g,"lookup",m)}if(typeof e.connect!="undefined"){let m=()=>o(e.connect,c,"connect");p?n(g,"connect",m()):n(g,"lookup",y=>{y===null&&n(g,"connect",m())})}typeof e.secureConnect!="undefined"&&t.protocol==="https:"&&n(g,"connect",()=>{let m=o(e.secureConnect,c,"secureConnect");n(g,"secureConnect",m)})}if(typeof e.send!="undefined"){let p=()=>o(e.send,c,"send");g.connecting?n(g,"connect",()=>{n(r,"upload-complete",p())}):n(r,"upload-complete",p())}}),typeof e.response!="undefined"&&n(r,"upload-complete",()=>{let g=o(e.response,c,"response");n(r,"response",g)}),u}});var Bz=w(uP=>{"use strict";Object.defineProperty(uP,"__esModule",{value:!0});var wz=iA();uP.default=r=>{r=r;let e={protocol:r.protocol,hostname:wz.default.string(r.hostname)&&r.hostname.startsWith("[")?r.hostname.slice(1,-1):r.hostname,host:r.host,hash:r.hash,search:r.search,pathname:r.pathname,href:r.href,path:`${r.pathname||""}${r.search||""}`};return wz.default.string(r.port)&&r.port.length>0&&(e.port=Number(r.port)),(r.username||r.password)&&(e.auth=`${r.username||""}:${r.password||""}`),e}});var bz=w(gP=>{"use strict";Object.defineProperty(gP,"__esModule",{value:!0});var Cke=require("url"),mke=["protocol","host","hostname","port","pathname","search"];gP.default=(r,e)=>{var t,i;if(e.path){if(e.pathname)throw new TypeError("Parameters `path` and `pathname` are mutually exclusive.");if(e.search)throw new TypeError("Parameters `path` and `search` are mutually exclusive.");if(e.searchParams)throw new TypeError("Parameters `path` and `searchParams` are mutually exclusive.")}if(e.search&&e.searchParams)throw new TypeError("Parameters `search` and `searchParams` are mutually exclusive.");if(!r){if(!e.protocol)throw new TypeError("No URL protocol specified");r=`${e.protocol}//${(i=(t=e.hostname)!==null&&t!==void 0?t:e.host)!==null&&i!==void 0?i:""}`}let n=new Cke.URL(r);if(e.path){let s=e.path.indexOf("?");s===-1?e.pathname=e.path:(e.pathname=e.path.slice(0,s),e.search=e.path.slice(s+1)),delete e.path}for(let s of mke)e[s]&&(n[s]=e[s].toString());return n}});var Sz=w(fP=>{"use strict";Object.defineProperty(fP,"__esModule",{value:!0});var Qz=class{constructor(){this.weakMap=new WeakMap,this.map=new Map}set(e,t){typeof e=="object"?this.weakMap.set(e,t):this.map.set(e,t)}get(e){return typeof e=="object"?this.weakMap.get(e):this.map.get(e)}has(e){return typeof e=="object"?this.weakMap.has(e):this.map.has(e)}};fP.default=Qz});var pP=w(hP=>{"use strict";Object.defineProperty(hP,"__esModule",{value:!0});var Eke=async r=>{let e=[],t=0;for await(let i of r)e.push(i),t+=Buffer.byteLength(i);return Buffer.isBuffer(e[0])?Buffer.concat(e,t):Buffer.from(e.join(""))};hP.default=Eke});var xz=w(Vc=>{"use strict";Object.defineProperty(Vc,"__esModule",{value:!0});Vc.dnsLookupIpVersionToFamily=Vc.isDnsLookupIpVersion=void 0;var vz={auto:0,ipv4:4,ipv6:6};Vc.isDnsLookupIpVersion=r=>r in vz;Vc.dnsLookupIpVersionToFamily=r=>{if(Vc.isDnsLookupIpVersion(r))return vz[r];throw new Error("Invalid DNS lookup IP version")}});var dP=w(Dw=>{"use strict";Object.defineProperty(Dw,"__esModule",{value:!0});Dw.isResponseOk=void 0;Dw.isResponseOk=r=>{let{statusCode:e}=r,t=r.request.options.followRedirect?299:399;return e>=200&&e<=t||e===304}});var Pz=w(CP=>{"use strict";Object.defineProperty(CP,"__esModule",{value:!0});var kz=new Set;CP.default=r=>{kz.has(r)||(kz.add(r),process.emitWarning(`Got: ${r}`,{type:"DeprecationWarning"}))}});var Dz=w(mP=>{"use strict";Object.defineProperty(mP,"__esModule",{value:!0});var Ir=iA(),Ike=(r,e)=>{if(Ir.default.null_(r.encoding))throw new TypeError("To get a Buffer, set `options.responseType` to `buffer` instead");Ir.assert.any([Ir.default.string,Ir.default.undefined],r.encoding),Ir.assert.any([Ir.default.boolean,Ir.default.undefined],r.resolveBodyOnly),Ir.assert.any([Ir.default.boolean,Ir.default.undefined],r.methodRewriting),Ir.assert.any([Ir.default.boolean,Ir.default.undefined],r.isStream),Ir.assert.any([Ir.default.string,Ir.default.undefined],r.responseType),r.responseType===void 0&&(r.responseType="text");let{retry:t}=r;if(e?r.retry=N({},e.retry):r.retry={calculateDelay:i=>i.computedValue,limit:0,methods:[],statusCodes:[],errorCodes:[],maxRetryAfter:void 0},Ir.default.object(t)?(r.retry=N(N({},r.retry),t),r.retry.methods=[...new Set(r.retry.methods.map(i=>i.toUpperCase()))],r.retry.statusCodes=[...new Set(r.retry.statusCodes)],r.retry.errorCodes=[...new Set(r.retry.errorCodes)]):Ir.default.number(t)&&(r.retry.limit=t),Ir.default.undefined(r.retry.maxRetryAfter)&&(r.retry.maxRetryAfter=Math.min(...[r.timeout.request,r.timeout.connect].filter(Ir.default.number))),Ir.default.object(r.pagination)){e&&(r.pagination=N(N({},e.pagination),r.pagination));let{pagination:i}=r;if(!Ir.default.function_(i.transform))throw new Error("`options.pagination.transform` must be implemented");if(!Ir.default.function_(i.shouldContinue))throw new Error("`options.pagination.shouldContinue` must be implemented");if(!Ir.default.function_(i.filter))throw new TypeError("`options.pagination.filter` must be implemented");if(!Ir.default.function_(i.paginate))throw new Error("`options.pagination.paginate` must be implemented")}return r.responseType==="json"&&r.headers.accept===void 0&&(r.headers.accept="application/json"),r};mP.default=Ike});var Rz=w(Fd=>{"use strict";Object.defineProperty(Fd,"__esModule",{value:!0});Fd.retryAfterStatusCodes=void 0;Fd.retryAfterStatusCodes=new Set([413,429,503]);var yke=({attemptCount:r,retryOptions:e,error:t,retryAfter:i})=>{if(r>e.limit)return 0;let n=e.methods.includes(t.options.method),s=e.errorCodes.includes(t.code),o=t.response&&e.statusCodes.includes(t.response.statusCode);if(!n||!s&&!o)return 0;if(t.response){if(i)return e.maxRetryAfter===void 0||i>e.maxRetryAfter?0:i;if(t.response.statusCode===413)return 0}let a=Math.random()*100;return 2**(r-1)*1e3+a};Fd.default=yke});var Ld=w(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.UnsupportedProtocolError=qt.ReadError=qt.TimeoutError=qt.UploadError=qt.CacheError=qt.HTTPError=qt.MaxRedirectsError=qt.RequestError=qt.setNonEnumerableProperties=qt.knownHookEvents=qt.withoutBody=qt.kIsNormalizedAlready=void 0;var Fz=require("util"),Nz=require("stream"),wke=require("fs"),gl=require("url"),Lz=require("http"),EP=require("http"),Bke=require("https"),bke=Y4(),Qke=X4(),Tz=D8(),Ske=L8(),vke=fz(),xke=vw(),Ee=iA(),kke=mz(),Oz=sP(),Pke=AP(),Mz=yz(),Dke=Bz(),Kz=bz(),Rke=Sz(),Fke=pP(),Uz=xz(),Nke=dP(),fl=Pz(),Lke=Dz(),Tke=Rz(),IP,Fi=Symbol("request"),Rw=Symbol("response"),rf=Symbol("responseSize"),nf=Symbol("downloadedSize"),sf=Symbol("bodySize"),of=Symbol("uploadedSize"),Fw=Symbol("serverResponsesPiped"),Hz=Symbol("unproxyEvents"),jz=Symbol("isFromCache"),yP=Symbol("cancelTimeouts"),Gz=Symbol("startedReading"),af=Symbol("stopReading"),Nw=Symbol("triggerRead"),hl=Symbol("body"),Nd=Symbol("jobs"),Yz=Symbol("originalResponse"),qz=Symbol("retryTimeout");qt.kIsNormalizedAlready=Symbol("isNormalizedAlready");var Oke=Ee.default.string(process.versions.brotli);qt.withoutBody=new Set(["GET","HEAD"]);qt.knownHookEvents=["init","beforeRequest","beforeRedirect","beforeError","beforeRetry","afterResponse"];function Mke(r){for(let e in r){let t=r[e];if(!Ee.default.string(t)&&!Ee.default.number(t)&&!Ee.default.boolean(t)&&!Ee.default.null_(t)&&!Ee.default.undefined(t))throw new TypeError(`The \`searchParams\` value '${String(t)}' must be a string, number, boolean or null`)}}function Kke(r){return Ee.default.object(r)&&!("statusCode"in r)}var wP=new Rke.default,Uke=async r=>new Promise((e,t)=>{let i=n=>{t(n)};r.pending||e(),r.once("error",i),r.once("ready",()=>{r.off("error",i),e()})}),Hke=new Set([300,301,302,303,304,307,308]),jke=["context","body","json","form"];qt.setNonEnumerableProperties=(r,e)=>{let t={};for(let i of r)if(!!i)for(let n of jke)n in i&&(t[n]={writable:!0,configurable:!0,enumerable:!1,value:i[n]});Object.defineProperties(e,t)};var hi=class extends Error{constructor(e,t,i){var n;super(e);if(Error.captureStackTrace(this,this.constructor),this.name="RequestError",this.code=t.code,i instanceof BP?(Object.defineProperty(this,"request",{enumerable:!1,value:i}),Object.defineProperty(this,"response",{enumerable:!1,value:i[Rw]}),Object.defineProperty(this,"options",{enumerable:!1,value:i.options})):Object.defineProperty(this,"options",{enumerable:!1,value:i}),this.timings=(n=this.request)===null||n===void 0?void 0:n.timings,Ee.default.string(t.stack)&&Ee.default.string(this.stack)){let s=this.stack.indexOf(this.message)+this.message.length,o=this.stack.slice(s).split(` -`).reverse(),a=t.stack.slice(t.stack.indexOf(t.message)+t.message.length).split(` -`).reverse();for(;a.length!==0&&a[0]===o[0];)o.shift();this.stack=`${this.stack.slice(0,s)}${o.reverse().join(` -`)}${a.reverse().join(` -`)}`}}};qt.RequestError=hi;var bP=class extends hi{constructor(e){super(`Redirected ${e.options.maxRedirects} times. Aborting.`,{},e);this.name="MaxRedirectsError"}};qt.MaxRedirectsError=bP;var QP=class extends hi{constructor(e){super(`Response code ${e.statusCode} (${e.statusMessage})`,{},e.request);this.name="HTTPError"}};qt.HTTPError=QP;var SP=class extends hi{constructor(e,t){super(e.message,e,t);this.name="CacheError"}};qt.CacheError=SP;var vP=class extends hi{constructor(e,t){super(e.message,e,t);this.name="UploadError"}};qt.UploadError=vP;var xP=class extends hi{constructor(e,t,i){super(e.message,e,i);this.name="TimeoutError",this.event=e.event,this.timings=t}};qt.TimeoutError=xP;var Lw=class extends hi{constructor(e,t){super(e.message,e,t);this.name="ReadError"}};qt.ReadError=Lw;var kP=class extends hi{constructor(e){super(`Unsupported protocol "${e.url.protocol}"`,{},e);this.name="UnsupportedProtocolError"}};qt.UnsupportedProtocolError=kP;var Gke=["socket","connect","continue","information","upgrade","timeout"],BP=class extends Nz.Duplex{constructor(e,t={},i){super({autoDestroy:!1,highWaterMark:0});this[nf]=0,this[of]=0,this.requestInitialized=!1,this[Fw]=new Set,this.redirects=[],this[af]=!1,this[Nw]=!1,this[Nd]=[],this.retryCount=0,this._progressCallbacks=[];let n=()=>this._unlockWrite(),s=()=>this._lockWrite();this.on("pipe",c=>{c.prependListener("data",n),c.on("data",s),c.prependListener("end",n),c.on("end",s)}),this.on("unpipe",c=>{c.off("data",n),c.off("data",s),c.off("end",n),c.off("end",s)}),this.on("pipe",c=>{c instanceof EP.IncomingMessage&&(this.options.headers=N(N({},c.headers),this.options.headers))});let{json:o,body:a,form:l}=t;if((o||a||l)&&this._lockWrite(),qt.kIsNormalizedAlready in t)this.options=t;else try{this.options=this.constructor.normalizeArguments(e,t,i)}catch(c){Ee.default.nodeStream(t.body)&&t.body.destroy(),this.destroy(c);return}(async()=>{var c;try{this.options.body instanceof wke.ReadStream&&await Uke(this.options.body);let{url:u}=this.options;if(!u)throw new TypeError("Missing `url` property");if(this.requestUrl=u.toString(),decodeURI(this.requestUrl),await this._finalizeBody(),await this._makeRequest(),this.destroyed){(c=this[Fi])===null||c===void 0||c.destroy();return}for(let g of this[Nd])g();this[Nd].length=0,this.requestInitialized=!0}catch(u){if(u instanceof hi){this._beforeError(u);return}this.destroyed||this.destroy(u)}})()}static normalizeArguments(e,t,i){var n,s,o,a,l;let c=t;if(Ee.default.object(e)&&!Ee.default.urlInstance(e))t=N(N(N({},i),e),t);else{if(e&&t&&t.url!==void 0)throw new TypeError("The `url` option is mutually exclusive with the `input` argument");t=N(N({},i),t),e!==void 0&&(t.url=e),Ee.default.urlInstance(t.url)&&(t.url=new gl.URL(t.url.toString()))}if(t.cache===!1&&(t.cache=void 0),t.dnsCache===!1&&(t.dnsCache=void 0),Ee.assert.any([Ee.default.string,Ee.default.undefined],t.method),Ee.assert.any([Ee.default.object,Ee.default.undefined],t.headers),Ee.assert.any([Ee.default.string,Ee.default.urlInstance,Ee.default.undefined],t.prefixUrl),Ee.assert.any([Ee.default.object,Ee.default.undefined],t.cookieJar),Ee.assert.any([Ee.default.object,Ee.default.string,Ee.default.undefined],t.searchParams),Ee.assert.any([Ee.default.object,Ee.default.string,Ee.default.undefined],t.cache),Ee.assert.any([Ee.default.object,Ee.default.number,Ee.default.undefined],t.timeout),Ee.assert.any([Ee.default.object,Ee.default.undefined],t.context),Ee.assert.any([Ee.default.object,Ee.default.undefined],t.hooks),Ee.assert.any([Ee.default.boolean,Ee.default.undefined],t.decompress),Ee.assert.any([Ee.default.boolean,Ee.default.undefined],t.ignoreInvalidCookies),Ee.assert.any([Ee.default.boolean,Ee.default.undefined],t.followRedirect),Ee.assert.any([Ee.default.number,Ee.default.undefined],t.maxRedirects),Ee.assert.any([Ee.default.boolean,Ee.default.undefined],t.throwHttpErrors),Ee.assert.any([Ee.default.boolean,Ee.default.undefined],t.http2),Ee.assert.any([Ee.default.boolean,Ee.default.undefined],t.allowGetBody),Ee.assert.any([Ee.default.string,Ee.default.undefined],t.localAddress),Ee.assert.any([Uz.isDnsLookupIpVersion,Ee.default.undefined],t.dnsLookupIpVersion),Ee.assert.any([Ee.default.object,Ee.default.undefined],t.https),Ee.assert.any([Ee.default.boolean,Ee.default.undefined],t.rejectUnauthorized),t.https&&(Ee.assert.any([Ee.default.boolean,Ee.default.undefined],t.https.rejectUnauthorized),Ee.assert.any([Ee.default.function_,Ee.default.undefined],t.https.checkServerIdentity),Ee.assert.any([Ee.default.string,Ee.default.object,Ee.default.array,Ee.default.undefined],t.https.certificateAuthority),Ee.assert.any([Ee.default.string,Ee.default.object,Ee.default.array,Ee.default.undefined],t.https.key),Ee.assert.any([Ee.default.string,Ee.default.object,Ee.default.array,Ee.default.undefined],t.https.certificate),Ee.assert.any([Ee.default.string,Ee.default.undefined],t.https.passphrase),Ee.assert.any([Ee.default.string,Ee.default.buffer,Ee.default.array,Ee.default.undefined],t.https.pfx)),Ee.assert.any([Ee.default.object,Ee.default.undefined],t.cacheOptions),Ee.default.string(t.method)?t.method=t.method.toUpperCase():t.method="GET",t.headers===(i==null?void 0:i.headers)?t.headers=N({},t.headers):t.headers=xke(N(N({},i==null?void 0:i.headers),t.headers)),"slashes"in t)throw new TypeError("The legacy `url.Url` has been deprecated. Use `URL` instead.");if("auth"in t)throw new TypeError("Parameter `auth` is deprecated. Use `username` / `password` instead.");if("searchParams"in t&&t.searchParams&&t.searchParams!==(i==null?void 0:i.searchParams)){let h;if(Ee.default.string(t.searchParams)||t.searchParams instanceof gl.URLSearchParams)h=new gl.URLSearchParams(t.searchParams);else{Mke(t.searchParams),h=new gl.URLSearchParams;for(let p in t.searchParams){let m=t.searchParams[p];m===null?h.append(p,""):m!==void 0&&h.append(p,m)}}(n=i==null?void 0:i.searchParams)===null||n===void 0||n.forEach((p,m)=>{h.has(m)||h.append(m,p)}),t.searchParams=h}if(t.username=(s=t.username)!==null&&s!==void 0?s:"",t.password=(o=t.password)!==null&&o!==void 0?o:"",Ee.default.undefined(t.prefixUrl)?t.prefixUrl=(a=i==null?void 0:i.prefixUrl)!==null&&a!==void 0?a:"":(t.prefixUrl=t.prefixUrl.toString(),t.prefixUrl!==""&&!t.prefixUrl.endsWith("/")&&(t.prefixUrl+="/")),Ee.default.string(t.url)){if(t.url.startsWith("/"))throw new Error("`input` must not start with a slash when using `prefixUrl`");t.url=Kz.default(t.prefixUrl+t.url,t)}else(Ee.default.undefined(t.url)&&t.prefixUrl!==""||t.protocol)&&(t.url=Kz.default(t.prefixUrl,t));if(t.url){"port"in t&&delete t.port;let{prefixUrl:h}=t;Object.defineProperty(t,"prefixUrl",{set:m=>{let y=t.url;if(!y.href.startsWith(m))throw new Error(`Cannot change \`prefixUrl\` from ${h} to ${m}: ${y.href}`);t.url=new gl.URL(m+y.href.slice(h.length)),h=m},get:()=>h});let{protocol:p}=t.url;if(p==="unix:"&&(p="http:",t.url=new gl.URL(`http://unix${t.url.pathname}${t.url.search}`)),t.searchParams&&(t.url.search=t.searchParams.toString()),p!=="http:"&&p!=="https:")throw new kP(t);t.username===""?t.username=t.url.username:t.url.username=t.username,t.password===""?t.password=t.url.password:t.url.password=t.password}let{cookieJar:u}=t;if(u){let{setCookie:h,getCookieString:p}=u;Ee.assert.function_(h),Ee.assert.function_(p),h.length===4&&p.length===0&&(h=Fz.promisify(h.bind(t.cookieJar)),p=Fz.promisify(p.bind(t.cookieJar)),t.cookieJar={setCookie:h,getCookieString:p})}let{cache:g}=t;if(g&&(wP.has(g)||wP.set(g,new Tz((h,p)=>{let m=h[Fi](h,p);return Ee.default.promise(m)&&(m.once=(y,b)=>{if(y==="error")m.catch(b);else if(y==="abort")(async()=>{try{(await m).once("abort",b)}catch(v){}})();else throw new Error(`Unknown HTTP2 promise event: ${y}`);return m}),m},g))),t.cacheOptions=N({},t.cacheOptions),t.dnsCache===!0)IP||(IP=new Qke.default),t.dnsCache=IP;else if(!Ee.default.undefined(t.dnsCache)&&!t.dnsCache.lookup)throw new TypeError(`Parameter \`dnsCache\` must be a CacheableLookup instance or a boolean, got ${Ee.default(t.dnsCache)}`);Ee.default.number(t.timeout)?t.timeout={request:t.timeout}:i&&t.timeout!==i.timeout?t.timeout=N(N({},i.timeout),t.timeout):t.timeout=N({},t.timeout),t.context||(t.context={});let f=t.hooks===(i==null?void 0:i.hooks);t.hooks=N({},t.hooks);for(let h of qt.knownHookEvents)if(h in t.hooks)if(Ee.default.array(t.hooks[h]))t.hooks[h]=[...t.hooks[h]];else throw new TypeError(`Parameter \`${h}\` must be an Array, got ${Ee.default(t.hooks[h])}`);else t.hooks[h]=[];if(i&&!f)for(let h of qt.knownHookEvents)i.hooks[h].length>0&&(t.hooks[h]=[...i.hooks[h],...t.hooks[h]]);if("family"in t&&fl.default('"options.family" was never documented, please use "options.dnsLookupIpVersion"'),(i==null?void 0:i.https)&&(t.https=N(N({},i.https),t.https)),"rejectUnauthorized"in t&&fl.default('"options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"'),"checkServerIdentity"in t&&fl.default('"options.checkServerIdentity" was never documented, please use "options.https.checkServerIdentity"'),"ca"in t&&fl.default('"options.ca" was never documented, please use "options.https.certificateAuthority"'),"key"in t&&fl.default('"options.key" was never documented, please use "options.https.key"'),"cert"in t&&fl.default('"options.cert" was never documented, please use "options.https.certificate"'),"passphrase"in t&&fl.default('"options.passphrase" was never documented, please use "options.https.passphrase"'),"pfx"in t&&fl.default('"options.pfx" was never documented, please use "options.https.pfx"'),"followRedirects"in t)throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead.");if(t.agent){for(let h in t.agent)if(h!=="http"&&h!=="https"&&h!=="http2")throw new TypeError(`Expected the \`options.agent\` properties to be \`http\`, \`https\` or \`http2\`, got \`${h}\``)}return t.maxRedirects=(l=t.maxRedirects)!==null&&l!==void 0?l:0,qt.setNonEnumerableProperties([i,c],t),Lke.default(t,i)}_lockWrite(){let e=()=>{throw new TypeError("The payload has been already provided")};this.write=e,this.end=e}_unlockWrite(){this.write=super.write,this.end=super.end}async _finalizeBody(){let{options:e}=this,{headers:t}=e,i=!Ee.default.undefined(e.form),n=!Ee.default.undefined(e.json),s=!Ee.default.undefined(e.body),o=i||n||s,a=qt.withoutBody.has(e.method)&&!(e.method==="GET"&&e.allowGetBody);if(this._cannotHaveBody=a,o){if(a)throw new TypeError(`The \`${e.method}\` method cannot be used with a body`);if([s,i,n].filter(l=>l).length>1)throw new TypeError("The `body`, `json` and `form` options are mutually exclusive");if(s&&!(e.body instanceof Nz.Readable)&&!Ee.default.string(e.body)&&!Ee.default.buffer(e.body)&&!Oz.default(e.body))throw new TypeError("The `body` option must be a stream.Readable, string or Buffer");if(i&&!Ee.default.object(e.form))throw new TypeError("The `form` option must be an Object");{let l=!Ee.default.string(t["content-type"]);s?(Oz.default(e.body)&&l&&(t["content-type"]=`multipart/form-data; boundary=${e.body.getBoundary()}`),this[hl]=e.body):i?(l&&(t["content-type"]="application/x-www-form-urlencoded"),this[hl]=new gl.URLSearchParams(e.form).toString()):(l&&(t["content-type"]="application/json"),this[hl]=e.stringifyJson(e.json));let c=await kke.default(this[hl],e.headers);Ee.default.undefined(t["content-length"])&&Ee.default.undefined(t["transfer-encoding"])&&!a&&!Ee.default.undefined(c)&&(t["content-length"]=String(c))}}else a?this._lockWrite():this._unlockWrite();this[sf]=Number(t["content-length"])||void 0}async _onResponseBase(e){let{options:t}=this,{url:i}=t;this[Yz]=e,t.decompress&&(e=Ske(e));let n=e.statusCode,s=e;s.statusMessage=s.statusMessage?s.statusMessage:Lz.STATUS_CODES[n],s.url=t.url.toString(),s.requestUrl=this.requestUrl,s.redirectUrls=this.redirects,s.request=this,s.isFromCache=e.fromCache||!1,s.ip=this.ip,s.retryCount=this.retryCount,this[jz]=s.isFromCache,this[rf]=Number(e.headers["content-length"])||void 0,this[Rw]=e,e.once("end",()=>{this[rf]=this[nf],this.emit("downloadProgress",this.downloadProgress)}),e.once("error",a=>{e.destroy(),this._beforeError(new Lw(a,this))}),e.once("aborted",()=>{this._beforeError(new Lw({name:"Error",message:"The server aborted pending request",code:"ECONNRESET"},this))}),this.emit("downloadProgress",this.downloadProgress);let o=e.headers["set-cookie"];if(Ee.default.object(t.cookieJar)&&o){let a=o.map(async l=>t.cookieJar.setCookie(l,i.toString()));t.ignoreInvalidCookies&&(a=a.map(async l=>l.catch(()=>{})));try{await Promise.all(a)}catch(l){this._beforeError(l);return}}if(t.followRedirect&&e.headers.location&&Hke.has(n)){if(e.resume(),this[Fi]&&(this[yP](),delete this[Fi],this[Hz]()),(n===303&&t.method!=="GET"&&t.method!=="HEAD"||!t.methodRewriting)&&(t.method="GET","body"in t&&delete t.body,"json"in t&&delete t.json,"form"in t&&delete t.form,this[hl]=void 0,delete t.headers["content-length"]),this.redirects.length>=t.maxRedirects){this._beforeError(new bP(this));return}try{let l=Buffer.from(e.headers.location,"binary").toString(),c=new gl.URL(l,i),u=c.toString();decodeURI(u),c.hostname!==i.hostname||c.port!==i.port?("host"in t.headers&&delete t.headers.host,"cookie"in t.headers&&delete t.headers.cookie,"authorization"in t.headers&&delete t.headers.authorization,(t.username||t.password)&&(t.username="",t.password="")):(c.username=t.username,c.password=t.password),this.redirects.push(u),t.url=c;for(let g of t.hooks.beforeRedirect)await g(t,s);this.emit("redirect",s,t),await this._makeRequest()}catch(l){this._beforeError(l);return}return}if(t.isStream&&t.throwHttpErrors&&!Nke.isResponseOk(s)){this._beforeError(new QP(s));return}e.on("readable",()=>{this[Nw]&&this._read()}),this.on("resume",()=>{e.resume()}),this.on("pause",()=>{e.pause()}),e.once("end",()=>{this.push(null)}),this.emit("response",e);for(let a of this[Fw])if(!a.headersSent){for(let l in e.headers){let c=t.decompress?l!=="content-encoding":!0,u=e.headers[l];c&&a.setHeader(l,u)}a.statusCode=n}}async _onResponse(e){try{await this._onResponseBase(e)}catch(t){this._beforeError(t)}}_onRequest(e){let{options:t}=this,{timeout:i,url:n}=t;bke.default(e),this[yP]=Mz.default(e,i,n);let s=t.cache?"cacheableResponse":"response";e.once(s,l=>{this._onResponse(l)}),e.once("error",l=>{var c;e.destroy(),(c=e.res)===null||c===void 0||c.removeAllListeners("end"),l=l instanceof Mz.TimeoutError?new xP(l,this.timings,this):new hi(l.message,l,this),this._beforeError(l)}),this[Hz]=Pke.default(e,this,Gke),this[Fi]=e,this.emit("uploadProgress",this.uploadProgress);let o=this[hl],a=this.redirects.length===0?this:e;Ee.default.nodeStream(o)?(o.pipe(a),o.once("error",l=>{this._beforeError(new vP(l,this))})):(this._unlockWrite(),Ee.default.undefined(o)?(this._cannotHaveBody||this._noPipe)&&(a.end(),this._lockWrite()):(this._writeRequest(o,void 0,()=>{}),a.end(),this._lockWrite())),this.emit("request",e)}async _createCacheableRequest(e,t){return new Promise((i,n)=>{Object.assign(t,Dke.default(e)),delete t.url;let s,o=wP.get(t.cache)(t,async a=>{a._readableState.autoDestroy=!1,s&&(await s).emit("cacheableResponse",a),i(a)});t.url=e,o.once("error",n),o.once("request",async a=>{s=a,i(s)})})}async _makeRequest(){var e,t,i,n,s;let{options:o}=this,{headers:a}=o;for(let b in a)if(Ee.default.undefined(a[b]))delete a[b];else if(Ee.default.null_(a[b]))throw new TypeError(`Use \`undefined\` instead of \`null\` to delete the \`${b}\` header`);if(o.decompress&&Ee.default.undefined(a["accept-encoding"])&&(a["accept-encoding"]=Oke?"gzip, deflate, br":"gzip, deflate"),o.cookieJar){let b=await o.cookieJar.getCookieString(o.url.toString());Ee.default.nonEmptyString(b)&&(o.headers.cookie=b)}for(let b of o.hooks.beforeRequest){let v=await b(o);if(!Ee.default.undefined(v)){o.request=()=>v;break}}o.body&&this[hl]!==o.body&&(this[hl]=o.body);let{agent:l,request:c,timeout:u,url:g}=o;if(o.dnsCache&&!("lookup"in o)&&(o.lookup=o.dnsCache.lookup),g.hostname==="unix"){let b=/(?.+?):(?.+)/.exec(`${g.pathname}${g.search}`);if(b==null?void 0:b.groups){let{socketPath:v,path:x}=b.groups;Object.assign(o,{socketPath:v,path:x,host:""})}}let f=g.protocol==="https:",h;o.http2?h=vke.auto:h=f?Bke.request:Lz.request;let p=(e=o.request)!==null&&e!==void 0?e:h,m=o.cache?this._createCacheableRequest:p;l&&!o.http2&&(o.agent=l[f?"https":"http"]),o[Fi]=p,delete o.request,delete o.timeout;let y=o;if(y.shared=(t=o.cacheOptions)===null||t===void 0?void 0:t.shared,y.cacheHeuristic=(i=o.cacheOptions)===null||i===void 0?void 0:i.cacheHeuristic,y.immutableMinTimeToLive=(n=o.cacheOptions)===null||n===void 0?void 0:n.immutableMinTimeToLive,y.ignoreCargoCult=(s=o.cacheOptions)===null||s===void 0?void 0:s.ignoreCargoCult,o.dnsLookupIpVersion!==void 0)try{y.family=Uz.dnsLookupIpVersionToFamily(o.dnsLookupIpVersion)}catch(b){throw new Error("Invalid `dnsLookupIpVersion` option value")}o.https&&("rejectUnauthorized"in o.https&&(y.rejectUnauthorized=o.https.rejectUnauthorized),o.https.checkServerIdentity&&(y.checkServerIdentity=o.https.checkServerIdentity),o.https.certificateAuthority&&(y.ca=o.https.certificateAuthority),o.https.certificate&&(y.cert=o.https.certificate),o.https.key&&(y.key=o.https.key),o.https.passphrase&&(y.passphrase=o.https.passphrase),o.https.pfx&&(y.pfx=o.https.pfx));try{let b=await m(g,y);Ee.default.undefined(b)&&(b=h(g,y)),o.request=c,o.timeout=u,o.agent=l,o.https&&("rejectUnauthorized"in o.https&&delete y.rejectUnauthorized,o.https.checkServerIdentity&&delete y.checkServerIdentity,o.https.certificateAuthority&&delete y.ca,o.https.certificate&&delete y.cert,o.https.key&&delete y.key,o.https.passphrase&&delete y.passphrase,o.https.pfx&&delete y.pfx),Kke(b)?this._onRequest(b):this.writable?(this.once("finish",()=>{this._onResponse(b)}),this._unlockWrite(),this.end(),this._lockWrite()):this._onResponse(b)}catch(b){throw b instanceof Tz.CacheError?new SP(b,this):new hi(b.message,b,this)}}async _error(e){try{for(let t of this.options.hooks.beforeError)e=await t(e)}catch(t){e=new hi(t.message,t,this)}this.destroy(e)}_beforeError(e){if(this[af])return;let{options:t}=this,i=this.retryCount+1;this[af]=!0,e instanceof hi||(e=new hi(e.message,e,this));let n=e,{response:s}=n;(async()=>{if(s&&!s.body){s.setEncoding(this._readableState.encoding);try{s.rawBody=await Fke.default(s),s.body=s.rawBody.toString()}catch(o){}}if(this.listenerCount("retry")!==0){let o;try{let a;s&&"retry-after"in s.headers&&(a=Number(s.headers["retry-after"]),Number.isNaN(a)?(a=Date.parse(s.headers["retry-after"])-Date.now(),a<=0&&(a=1)):a*=1e3),o=await t.retry.calculateDelay({attemptCount:i,retryOptions:t.retry,error:n,retryAfter:a,computedValue:Tke.default({attemptCount:i,retryOptions:t.retry,error:n,retryAfter:a,computedValue:0})})}catch(a){this._error(new hi(a.message,a,this));return}if(o){let a=async()=>{try{for(let l of this.options.hooks.beforeRetry)await l(this.options,n,i)}catch(l){this._error(new hi(l.message,e,this));return}this.destroyed||(this.destroy(),this.emit("retry",i,e))};this[qz]=setTimeout(a,o);return}}this._error(n)})()}_read(){this[Nw]=!0;let e=this[Rw];if(e&&!this[af]){e.readableLength&&(this[Nw]=!1);let t;for(;(t=e.read())!==null;){this[nf]+=t.length,this[Gz]=!0;let i=this.downloadProgress;i.percent<1&&this.emit("downloadProgress",i),this.push(t)}}}_write(e,t,i){let n=()=>{this._writeRequest(e,t,i)};this.requestInitialized?n():this[Nd].push(n)}_writeRequest(e,t,i){this[Fi].destroyed||(this._progressCallbacks.push(()=>{this[of]+=Buffer.byteLength(e,t);let n=this.uploadProgress;n.percent<1&&this.emit("uploadProgress",n)}),this[Fi].write(e,t,n=>{!n&&this._progressCallbacks.length>0&&this._progressCallbacks.shift()(),i(n)}))}_final(e){let t=()=>{for(;this._progressCallbacks.length!==0;)this._progressCallbacks.shift()();if(!(Fi in this)){e();return}if(this[Fi].destroyed){e();return}this[Fi].end(i=>{i||(this[sf]=this[of],this.emit("uploadProgress",this.uploadProgress),this[Fi].emit("upload-complete")),e(i)})};this.requestInitialized?t():this[Nd].push(t)}_destroy(e,t){var i;this[af]=!0,clearTimeout(this[qz]),Fi in this&&(this[yP](),((i=this[Rw])===null||i===void 0?void 0:i.complete)||this[Fi].destroy()),e!==null&&!Ee.default.undefined(e)&&!(e instanceof hi)&&(e=new hi(e.message,e,this)),t(e)}get _isAboutToError(){return this[af]}get ip(){var e;return(e=this.socket)===null||e===void 0?void 0:e.remoteAddress}get aborted(){var e,t,i;return((t=(e=this[Fi])===null||e===void 0?void 0:e.destroyed)!==null&&t!==void 0?t:this.destroyed)&&!((i=this[Yz])===null||i===void 0?void 0:i.complete)}get socket(){var e,t;return(t=(e=this[Fi])===null||e===void 0?void 0:e.socket)!==null&&t!==void 0?t:void 0}get downloadProgress(){let e;return this[rf]?e=this[nf]/this[rf]:this[rf]===this[nf]?e=1:e=0,{percent:e,transferred:this[nf],total:this[rf]}}get uploadProgress(){let e;return this[sf]?e=this[of]/this[sf]:this[sf]===this[of]?e=1:e=0,{percent:e,transferred:this[of],total:this[sf]}}get timings(){var e;return(e=this[Fi])===null||e===void 0?void 0:e.timings}get isFromCache(){return this[jz]}pipe(e,t){if(this[Gz])throw new Error("Failed to pipe. The response has been emitted already.");return e instanceof EP.ServerResponse&&this[Fw].add(e),super.pipe(e,t)}unpipe(e){return e instanceof EP.ServerResponse&&this[Fw].delete(e),super.unpipe(e),this}};qt.default=BP});var Td=w(Co=>{"use strict";var Yke=Co&&Co.__createBinding||(Object.create?function(r,e,t,i){i===void 0&&(i=t),Object.defineProperty(r,i,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]}),qke=Co&&Co.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Yke(e,r,t)};Object.defineProperty(Co,"__esModule",{value:!0});Co.CancelError=Co.ParseError=void 0;var Jz=Ld(),Wz=class extends Jz.RequestError{constructor(e,t){let{options:i}=t.request;super(`${e.message} in "${i.url.toString()}"`,e,t.request);this.name="ParseError"}};Co.ParseError=Wz;var zz=class extends Jz.RequestError{constructor(e){super("Promise was canceled",{},e);this.name="CancelError"}get isCanceled(){return!0}};Co.CancelError=zz;qke(Ld(),Co)});var Vz=w(PP=>{"use strict";Object.defineProperty(PP,"__esModule",{value:!0});var _z=Td(),Jke=(r,e,t,i)=>{let{rawBody:n}=r;try{if(e==="text")return n.toString(i);if(e==="json")return n.length===0?"":t(n.toString());if(e==="buffer")return n;throw new _z.ParseError({message:`Unknown body type '${e}'`,name:"Error"},r)}catch(s){throw new _z.ParseError(s,r)}};PP.default=Jke});var DP=w(pl=>{"use strict";var Wke=pl&&pl.__createBinding||(Object.create?function(r,e,t,i){i===void 0&&(i=t),Object.defineProperty(r,i,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]}),zke=pl&&pl.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Wke(e,r,t)};Object.defineProperty(pl,"__esModule",{value:!0});var _ke=require("events"),Vke=iA(),Xke=j4(),Tw=Td(),Xz=Vz(),Zz=Ld(),Zke=AP(),$ke=pP(),$z=dP(),ePe=["request","response","redirect","uploadProgress","downloadProgress"];function e5(r){let e,t,i=new _ke.EventEmitter,n=new Xke((o,a,l)=>{let c=u=>{let g=new Zz.default(void 0,r);g.retryCount=u,g._noPipe=!0,l(()=>g.destroy()),l.shouldReject=!1,l(()=>a(new Tw.CancelError(g))),e=g,g.once("response",async p=>{var m;if(p.retryCount=u,p.request.aborted)return;let y;try{y=await $ke.default(g),p.rawBody=y}catch(T){return}if(g._isAboutToError)return;let b=((m=p.headers["content-encoding"])!==null&&m!==void 0?m:"").toLowerCase(),v=["gzip","deflate","br"].includes(b),{options:x}=g;if(v&&!x.decompress)p.body=y;else try{p.body=Xz.default(p,x.responseType,x.parseJson,x.encoding)}catch(T){if(p.body=y.toString(),$z.isResponseOk(p)){g._beforeError(T);return}}try{for(let[T,q]of x.hooks.afterResponse.entries())p=await q(p,async Y=>{let $=Zz.default.normalizeArguments(void 0,te(N({},Y),{retry:{calculateDelay:()=>0},throwHttpErrors:!1,resolveBodyOnly:!1}),x);$.hooks.afterResponse=$.hooks.afterResponse.slice(0,T);for(let ne of $.hooks.beforeRetry)await ne($);let _=e5($);return l(()=>{_.catch(()=>{}),_.cancel()}),_})}catch(T){g._beforeError(new Tw.RequestError(T.message,T,g));return}if(!$z.isResponseOk(p)){g._beforeError(new Tw.HTTPError(p));return}t=p,o(g.options.resolveBodyOnly?p.body:p)});let f=p=>{if(n.isCanceled)return;let{options:m}=g;if(p instanceof Tw.HTTPError&&!m.throwHttpErrors){let{response:y}=p;o(g.options.resolveBodyOnly?y.body:y);return}a(p)};g.once("error",f);let h=g.options.body;g.once("retry",(p,m)=>{var y,b;if(h===((y=m.request)===null||y===void 0?void 0:y.options.body)&&Vke.default.nodeStream((b=m.request)===null||b===void 0?void 0:b.options.body)){f(m);return}c(p)}),Zke.default(g,i,ePe)};c(0)});n.on=(o,a)=>(i.on(o,a),n);let s=o=>{let a=(async()=>{await n;let{options:l}=t.request;return Xz.default(t,o,l.parseJson,l.encoding)})();return Object.defineProperties(a,Object.getOwnPropertyDescriptors(n)),a};return n.json=()=>{let{headers:o}=e.options;return!e.writableFinished&&o.accept===void 0&&(o.accept="application/json"),s("json")},n.buffer=()=>s("buffer"),n.text=()=>s("text"),n}pl.default=e5;zke(Td(),pl)});var t5=w(RP=>{"use strict";Object.defineProperty(RP,"__esModule",{value:!0});var tPe=Td();function rPe(r,...e){let t=(async()=>{if(r instanceof tPe.RequestError)try{for(let n of e)if(n)for(let s of n)r=await s(r)}catch(n){r=n}throw r})(),i=()=>t;return t.json=i,t.text=i,t.buffer=i,t.on=i,t}RP.default=rPe});var n5=w(FP=>{"use strict";Object.defineProperty(FP,"__esModule",{value:!0});var r5=iA();function i5(r){for(let e of Object.values(r))(r5.default.plainObject(e)||r5.default.array(e))&&i5(e);return Object.freeze(r)}FP.default=i5});var o5=w(s5=>{"use strict";Object.defineProperty(s5,"__esModule",{value:!0})});var NP=w(Ts=>{"use strict";var iPe=Ts&&Ts.__createBinding||(Object.create?function(r,e,t,i){i===void 0&&(i=t),Object.defineProperty(r,i,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]}),nPe=Ts&&Ts.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&iPe(e,r,t)};Object.defineProperty(Ts,"__esModule",{value:!0});Ts.defaultHandler=void 0;var a5=iA(),Os=DP(),sPe=t5(),Ow=Ld(),oPe=n5(),aPe={RequestError:Os.RequestError,CacheError:Os.CacheError,ReadError:Os.ReadError,HTTPError:Os.HTTPError,MaxRedirectsError:Os.MaxRedirectsError,TimeoutError:Os.TimeoutError,ParseError:Os.ParseError,CancelError:Os.CancelError,UnsupportedProtocolError:Os.UnsupportedProtocolError,UploadError:Os.UploadError},APe=async r=>new Promise(e=>{setTimeout(e,r)}),{normalizeArguments:Mw}=Ow.default,A5=(...r)=>{let e;for(let t of r)e=Mw(void 0,t,e);return e},lPe=r=>r.isStream?new Ow.default(void 0,r):Os.default(r),cPe=r=>"defaults"in r&&"options"in r.defaults,uPe=["get","post","put","patch","head","delete"];Ts.defaultHandler=(r,e)=>e(r);var l5=(r,e)=>{if(r)for(let t of r)t(e)},c5=r=>{r._rawHandlers=r.handlers,r.handlers=r.handlers.map(i=>(n,s)=>{let o,a=i(n,l=>(o=s(l),o));if(a!==o&&!n.isStream&&o){let l=a,{then:c,catch:u,finally:g}=l;Object.setPrototypeOf(l,Object.getPrototypeOf(o)),Object.defineProperties(l,Object.getOwnPropertyDescriptors(o)),l.then=c,l.catch=u,l.finally=g}return a});let e=(i,n={},s)=>{var o,a;let l=0,c=u=>r.handlers[l++](u,l===r.handlers.length?lPe:c);if(a5.default.plainObject(i)){let u=N(N({},i),n);Ow.setNonEnumerableProperties([i,n],u),n=u,i=void 0}try{let u;try{l5(r.options.hooks.init,n),l5((o=n.hooks)===null||o===void 0?void 0:o.init,n)}catch(f){u=f}let g=Mw(i,n,s!=null?s:r.options);if(g[Ow.kIsNormalizedAlready]=!0,u)throw new Os.RequestError(u.message,u,g);return c(g)}catch(u){if(n.isStream)throw u;return sPe.default(u,r.options.hooks.beforeError,(a=n.hooks)===null||a===void 0?void 0:a.beforeError)}};e.extend=(...i)=>{let n=[r.options],s=[...r._rawHandlers],o;for(let a of i)cPe(a)?(n.push(a.defaults.options),s.push(...a.defaults._rawHandlers),o=a.defaults.mutableDefaults):(n.push(a),"handlers"in a&&s.push(...a.handlers),o=a.mutableDefaults);return s=s.filter(a=>a!==Ts.defaultHandler),s.length===0&&s.push(Ts.defaultHandler),c5({options:A5(...n),handlers:s,mutableDefaults:Boolean(o)})};let t=async function*(i,n){let s=Mw(i,n,r.options);s.resolveBodyOnly=!1;let o=s.pagination;if(!a5.default.object(o))throw new TypeError("`options.pagination` must be implemented");let a=[],{countLimit:l}=o,c=0;for(;c{let s=[];for await(let o of t(i,n))s.push(o);return s},e.paginate.each=t,e.stream=(i,n)=>e(i,te(N({},n),{isStream:!0}));for(let i of uPe)e[i]=(n,s)=>e(n,te(N({},s),{method:i})),e.stream[i]=(n,s)=>e(n,te(N({},s),{method:i,isStream:!0}));return Object.assign(e,aPe),Object.defineProperty(e,"defaults",{value:r.mutableDefaults?r:oPe.default(r),writable:r.mutableDefaults,configurable:r.mutableDefaults,enumerable:!0}),e.mergeOptions=A5,e};Ts.default=c5;nPe(o5(),Ts)});var Uw=w((sA,Kw)=>{"use strict";var gPe=sA&&sA.__createBinding||(Object.create?function(r,e,t,i){i===void 0&&(i=t),Object.defineProperty(r,i,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]}),u5=sA&&sA.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&gPe(e,r,t)};Object.defineProperty(sA,"__esModule",{value:!0});var fPe=require("url"),g5=NP(),hPe={options:{method:"GET",retry:{limit:2,methods:["GET","PUT","HEAD","DELETE","OPTIONS","TRACE"],statusCodes:[408,413,429,500,502,503,504,521,522,524],errorCodes:["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"],maxRetryAfter:void 0,calculateDelay:({computedValue:r})=>r},timeout:{},headers:{"user-agent":"got (https://github.com/sindresorhus/got)"},hooks:{init:[],beforeRequest:[],beforeRedirect:[],beforeRetry:[],beforeError:[],afterResponse:[]},cache:void 0,dnsCache:void 0,decompress:!0,throwHttpErrors:!0,followRedirect:!0,isStream:!1,responseType:"text",resolveBodyOnly:!1,maxRedirects:10,prefixUrl:"",methodRewriting:!0,ignoreInvalidCookies:!1,context:{},http2:!1,allowGetBody:!1,https:void 0,pagination:{transform:r=>r.request.options.responseType==="json"?r.body:JSON.parse(r.body),paginate:r=>{if(!Reflect.has(r.headers,"link"))return!1;let e=r.headers.link.split(","),t;for(let i of e){let n=i.split(";");if(n[1].includes("next")){t=n[0].trimStart().trim(),t=t.slice(1,-1);break}}return t?{url:new fPe.URL(t)}:!1},filter:()=>!0,shouldContinue:()=>!0,countLimit:Infinity,backoff:0,requestLimit:1e4,stackAllItems:!0},parseJson:r=>JSON.parse(r),stringifyJson:r=>JSON.stringify(r),cacheOptions:{}},handlers:[g5.defaultHandler],mutableDefaults:!1},LP=g5.default(hPe);sA.default=LP;Kw.exports=LP;Kw.exports.default=LP;Kw.exports.__esModule=!0;u5(NP(),sA);u5(DP(),sA)});var d5=w(Af=>{"use strict";var znt=require("net"),pPe=require("tls"),TP=require("http"),f5=require("https"),dPe=require("events"),_nt=require("assert"),CPe=require("util");Af.httpOverHttp=mPe;Af.httpsOverHttp=EPe;Af.httpOverHttps=IPe;Af.httpsOverHttps=yPe;function mPe(r){var e=new oA(r);return e.request=TP.request,e}function EPe(r){var e=new oA(r);return e.request=TP.request,e.createSocket=h5,e.defaultPort=443,e}function IPe(r){var e=new oA(r);return e.request=f5.request,e}function yPe(r){var e=new oA(r);return e.request=f5.request,e.createSocket=h5,e.defaultPort=443,e}function oA(r){var e=this;e.options=r||{},e.proxyOptions=e.options.proxy||{},e.maxSockets=e.options.maxSockets||TP.Agent.defaultMaxSockets,e.requests=[],e.sockets=[],e.on("free",function(i,n,s,o){for(var a=p5(n,s,o),l=0,c=e.requests.length;l=this.maxSockets){s.requests.push(o);return}s.createSocket(o,function(a){a.on("free",l),a.on("close",c),a.on("agentRemove",c),e.onSocket(a);function l(){s.emit("free",a,o)}function c(u){s.removeSocket(a),a.removeListener("free",l),a.removeListener("close",c),a.removeListener("agentRemove",c)}})};oA.prototype.createSocket=function(e,t){var i=this,n={};i.sockets.push(n);var s=OP({},i.proxyOptions,{method:"CONNECT",path:e.host+":"+e.port,agent:!1,headers:{host:e.host+":"+e.port}});e.localAddress&&(s.localAddress=e.localAddress),s.proxyAuth&&(s.headers=s.headers||{},s.headers["Proxy-Authorization"]="Basic "+new Buffer(s.proxyAuth).toString("base64")),dl("making CONNECT request");var o=i.request(s);o.useChunkedEncodingByDefault=!1,o.once("response",a),o.once("upgrade",l),o.once("connect",c),o.once("error",u),o.end();function a(g){g.upgrade=!0}function l(g,f,h){process.nextTick(function(){c(g,f,h)})}function c(g,f,h){if(o.removeAllListeners(),f.removeAllListeners(),g.statusCode!==200){dl("tunneling socket could not be established, statusCode=%d",g.statusCode),f.destroy();var p=new Error("tunneling socket could not be established, statusCode="+g.statusCode);p.code="ECONNRESET",e.request.emit("error",p),i.removeSocket(n);return}if(h.length>0){dl("got illegal response body from proxy"),f.destroy();var p=new Error("got illegal response body from proxy");p.code="ECONNRESET",e.request.emit("error",p),i.removeSocket(n);return}return dl("tunneling connection has established"),i.sockets[i.sockets.indexOf(n)]=f,t(f)}function u(g){o.removeAllListeners(),dl(`tunneling socket could not be established, cause=%s -`,g.message,g.stack);var f=new Error("tunneling socket could not be established, cause="+g.message);f.code="ECONNRESET",e.request.emit("error",f),i.removeSocket(n)}};oA.prototype.removeSocket=function(e){var t=this.sockets.indexOf(e);if(t!==-1){this.sockets.splice(t,1);var i=this.requests.shift();i&&this.createSocket(i,function(n){i.request.onSocket(n)})}};function h5(r,e){var t=this;oA.prototype.createSocket.call(t,r,function(i){var n=r.request.getHeader("host"),s=OP({},t.options,{socket:i,servername:n?n.replace(/:.*$/,""):r.host}),o=pPe.connect(0,s);t.sockets[t.sockets.indexOf(i)]=o,e(o)})}function p5(r,e,t){return typeof r=="string"?{host:r,port:e,localAddress:t}:r}function OP(r){for(var e=1,t=arguments.length;e{C5.exports=d5()});var x5=w((Gw,jP)=>{var v5=Object.assign({},require("fs")),GP=function(){var r=typeof document!="undefined"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename!="undefined"&&(r=r||__filename),function(e){e=e||{};var t=typeof e!="undefined"?e:{},i,n;t.ready=new Promise(function(d,E){i=d,n=E});var s={},o;for(o in t)t.hasOwnProperty(o)&&(s[o]=t[o]);var a=[],l="./this.program",c=function(d,E){throw E},u=!1,g=!0,f="";function h(d){return t.locateFile?t.locateFile(d,f):f+d}var p,m,y,b;g&&(u?f=require("path").dirname(f)+"/":f=__dirname+"/",p=function(E,I){var D=xa(E);return D?I?D:D.toString():(y||(y=v5),b||(b=require("path")),E=b.normalize(E),y.readFileSync(E,I?null:"utf8"))},m=function(E){var I=p(E,!0);return I.buffer||(I=new Uint8Array(I)),Z(I.buffer),I},process.argv.length>1&&(l=process.argv[1].replace(/\\/g,"/")),a=process.argv.slice(2),c=function(d){process.exit(d)},t.inspect=function(){return"[Emscripten Module object]"});var v=t.print||console.log.bind(console),x=t.printErr||console.warn.bind(console);for(o in s)s.hasOwnProperty(o)&&(t[o]=s[o]);s=null,t.arguments&&(a=t.arguments),t.thisProgram&&(l=t.thisProgram),t.quit&&(c=t.quit);var T=16;function q(d,E){return E||(E=T),Math.ceil(d/E)*E}var Y=0,$=function(d){Y=d},_;t.wasmBinary&&(_=t.wasmBinary);var ne=t.noExitRuntime||!0;typeof WebAssembly!="object"&&vr("no native wasm support detected");function ee(d,E,I){switch(E=E||"i8",E.charAt(E.length-1)==="*"&&(E="i32"),E){case"i1":return pe[d>>0];case"i8":return pe[d>>0];case"i16":return Qe[d>>1];case"i32":return fe[d>>2];case"i64":return fe[d>>2];case"float":return Ht[d>>2];case"double":return Mt[d>>3];default:vr("invalid type for getValue: "+E)}return null}var A,oe=!1,ce;function Z(d,E){d||vr("Assertion failed: "+E)}function O(d){var E=t["_"+d];return Z(E,"Cannot call unknown function "+d+", make sure it is exported"),E}function L(d,E,I,D,M){var z={string:function(st){var yt=0;if(st!=null&&st!==0){var xe=(st.length<<2)+1;yt=B(xe),be(st,yt,xe)}return yt},array:function(st){var yt=B(st.length);return Ke(st,yt),yt}};function ie(st){return E==="string"?re(st):E==="boolean"?Boolean(st):st}var we=O(d),me=[],_e=0;if(D)for(var ot=0;ot=D);)++M;if(M-E>16&&d.subarray&&Be)return Be.decode(d.subarray(E,M));for(var z="";E>10,56320|_e&1023)}}return z}function re(d,E){return d?je(V,d,E):""}function se(d,E,I,D){if(!(D>0))return 0;for(var M=I,z=I+D-1,ie=0;ie=55296&&we<=57343){var me=d.charCodeAt(++ie);we=65536+((we&1023)<<10)|me&1023}if(we<=127){if(I>=z)break;E[I++]=we}else if(we<=2047){if(I+1>=z)break;E[I++]=192|we>>6,E[I++]=128|we&63}else if(we<=65535){if(I+2>=z)break;E[I++]=224|we>>12,E[I++]=128|we>>6&63,E[I++]=128|we&63}else{if(I+3>=z)break;E[I++]=240|we>>18,E[I++]=128|we>>12&63,E[I++]=128|we>>6&63,E[I++]=128|we&63}}return E[I]=0,I-M}function be(d,E,I){return se(d,V,E,I)}function he(d){for(var E=0,I=0;I=55296&&D<=57343&&(D=65536+((D&1023)<<10)|d.charCodeAt(++I)&1023),D<=127?++E:D<=2047?E+=2:D<=65535?E+=3:E+=4}return E}function Fe(d){var E=he(d)+1,I=Et(E);return I&&se(d,pe,I,E),I}function Ke(d,E){pe.set(d,E)}function ke(d,E){return d%E>0&&(d+=E-d%E),d}var ve,pe,V,Qe,le,fe,gt,Ht,Mt;function Ei(d){ve=d,t.HEAP8=pe=new Int8Array(d),t.HEAP16=Qe=new Int16Array(d),t.HEAP32=fe=new Int32Array(d),t.HEAPU8=V=new Uint8Array(d),t.HEAPU16=le=new Uint16Array(d),t.HEAPU32=gt=new Uint32Array(d),t.HEAPF32=Ht=new Float32Array(d),t.HEAPF64=Mt=new Float64Array(d)}var jt=t.INITIAL_MEMORY||16777216,Qr,Oi=[],Xs=[],Un=[],Hn=!1;function Sr(){if(t.preRun)for(typeof t.preRun=="function"&&(t.preRun=[t.preRun]);t.preRun.length;)ba(t.preRun.shift());ko(Oi)}function jn(){Hn=!0,!t.noFSInit&&!S.init.initialized&&S.init(),ps.init(),ko(Xs)}function fs(){if(t.postRun)for(typeof t.postRun=="function"&&(t.postRun=[t.postRun]);t.postRun.length;)Nu(t.postRun.shift());ko(Un)}function ba(d){Oi.unshift(d)}function DA(d){Xs.unshift(d)}function Nu(d){Un.unshift(d)}var hs=0,RA=null,Qa=null;function Lu(d){return d}function FA(d){hs++,t.monitorRunDependencies&&t.monitorRunDependencies(hs)}function NA(d){if(hs--,t.monitorRunDependencies&&t.monitorRunDependencies(hs),hs==0&&(RA!==null&&(clearInterval(RA),RA=null),Qa)){var E=Qa;Qa=null,E()}}t.preloadedImages={},t.preloadedAudios={};function vr(d){t.onAbort&&t.onAbort(d),d+="",x(d),oe=!0,ce=1,d="abort("+d+"). Build with -s ASSERTIONS=1 for more info.";var E=new WebAssembly.RuntimeError(d);throw n(E),E}var zl="data:application/octet-stream;base64,";function Tu(d){return d.startsWith(zl)}var xo="data:application/octet-stream;base64,AGFzbQEAAAABlAInYAF/AX9gA39/fwF/YAF/AGACf38Bf2ACf38AYAV/f39/fwF/YAR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gIAAkAgASgCAEUEQCABQgA3AwgMAQsgASABKAIALQAArSABKAIALQAHrUI4hiABKAIALQAGrUIwhnwgASgCAC0ABa1CKIZ8IAEoAgAtAAStQiCGfCABKAIALQADrUIYhnwgASgCAC0AAq1CEIZ8IAEoAgAtAAGtQgiGfHw3AwgLIAEpAwghAiABQRBqJAAgAgvcAQEBfyMAQRBrIgEkACABIAA2AgwgASgCDARAIAEoAgwoAigEQCABKAIMKAIoQQA2AiggASgCDCgCKEIANwMgIAEoAgwCfiABKAIMKQMYIAEoAgwpAyBWBEAgASgCDCkDGAwBCyABKAIMKQMgCzcDGAsgASABKAIMKQMYNwMAA0AgASkDACABKAIMKQMIWkUEQCABKAIMKAIAIAEpAwCnQQR0aigCABAVIAEgASkDAEIBfDcDAAwBCwsgASgCDCgCABAVIAEoAgwoAgQQFSABKAIMEBULIAFBEGokAAvwAgICfwF+AkAgAkUNACAAIAJqIgNBAWsgAToAACAAIAE6AAAgAkEDSQ0AIANBAmsgAToAACAAIAE6AAEgA0EDayABOgAAIAAgAToAAiACQQdJDQAgA0EEayABOgAAIAAgAToAAyACQQlJDQAgAEEAIABrQQNxIgRqIgMgAUH/AXFBgYKECGwiADYCACADIAIgBGtBfHEiAmoiAUEEayAANgIAIAJBCUkNACADIAA2AgggAyAANgIEIAFBCGsgADYCACABQQxrIAA2AgAgAkEZSQ0AIAMgADYCGCADIAA2AhQgAyAANgIQIAMgADYCDCABQRBrIAA2AgAgAUEUayAANgIAIAFBGGsgADYCACABQRxrIAA2AgAgAiADQQRxQRhyIgFrIgJBIEkNACAArUKBgICAEH4hBSABIANqIQEDQCABIAU3AxggASAFNwMQIAEgBTcDCCABIAU3AwAgAUEgaiEBIAJBIGsiAkEfSw0ACwsLawEBfyMAQSBrIgIgADYCHCACQgEgAigCHK2GNwMQIAJBDGogATYCAANAIAIgAigCDCIAQQRqNgIMIAIgACgCADYCCCACKAIIQQBIRQRAIAIgAikDEEIBIAIoAgithoQ3AxAMAQsLIAIpAxALYAIBfwF+IwBBEGsiASQAIAEgADYCBAJAIAEoAgQoAiRBAUcEQCABKAIEQQxqQRJBABAUIAFCfzcDCAwBCyABIAEoAgRBAEIAQQ0QIDcDCAsgASkDCCECIAFBEGokACACC6UCAQJ/IwBBIGsiAyQAIAMgADYCGCADIAE2AhQgAyACNwMIIAMoAhgoAgAhASADKAIUIQQgAykDCCECIwBBIGsiACQAIAAgATYCFCAAIAQ2AhAgACACNwMIAkACQCAAKAIUKAIkQQFGBEAgACkDCEL///////////8AWA0BCyAAKAIUQQxqQRJBABAUIABCfzcDGAwBCyAAIAAoAhQgACgCECAAKQMIQQsQIDcDGAsgACkDGCECIABBIGokACADIAI3AwACQCACQgBTBEAgAygCGEEIaiADKAIYKAIAEBcgA0F/NgIcDAELIAMpAwAgAykDCFIEQCADKAIYQQhqQQZBGxAUIANBfzYCHAwBCyADQQA2AhwLIAMoAhwhACADQSBqJAAgAAsxAQF/IwBBEGsiASQAIAEgADYCDCABKAIMBEAgASgCDBBSIAEoAgwQFQsgAUEQaiQACy8BAX8jAEEQayIBJAAgASAANgIMIAEoAgwoAggQFSABKAIMQQA2AgggAUEQaiQAC80BAQF/IwBBEGsiAiQAIAIgADYCCCACIAE2AgQCQCACKAIILQAoQQFxBEAgAkF/NgIMDAELIAIoAgRFBEAgAigCCEEMakESQQAQFCACQX82AgwMAQsgAigCBBA7IAIoAggoAgAEQCACKAIIKAIAIAIoAgQQOUEASARAIAIoAghBDGogAigCCCgCABAXIAJBfzYCDAwCCwsgAigCCCACKAIEQjhBAxAgQgBTBEAgAkF/NgIMDAELIAJBADYCDAsgAigCDCEAIAJBEGokACAAC98EAQF/IwBBIGsiAiAANgIYIAIgATYCFAJAIAIoAhhFBEAgAkEBNgIcDAELIAIgAigCGCgCADYCDAJAIAIoAhgoAggEQCACIAIoAhgoAgg2AhAMAQsgAkEBNgIQIAJBADYCCANAAkAgAigCCCACKAIYLwEETw0AAkAgAigCDCACKAIIai0AAEEfSwRAIAIoAgwgAigC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QASADIAMoAqQBKAIwQQAQOjYClAEgAyADKAKkASgCOEEAEDo2ApgBAkACQAJAAkAgAygClAFBAkYEQCADKAKYAUEBRg0BCyADKAKUAUEBRgRAIAMoApgBQQJGDQELIAMoApQBQQJHDQEgAygCmAFBAkcNAQsgAygCpAEiACAALwEMQYAQcjsBDAwBCyADKAKkASIAIAAvAQxB/+8DcTsBDCADKAKUAUECRgRAIANB9eABIAMoAqQBKAIwIAMoAqgBQQhqEI4BNgKQASADKAKQAUUEQCADQX82AqwBDAMLCwJAIAMoAqABQYACcQ0AIAMoApgBQQJHDQAgA0H1xgEgAygCpAEoAjggAygCqAFBCGoQjgE2AkggAygCSEUEQCADKAKQARAjIANBfzYCrAEMAwsgAygCSCADKAKQATYCACADIAMoAkg2ApABCwsCQCADKAKkAS8BUkUEQCADKAKkASIAIAAvAQxB/v8DcTsBDAwBCyADKAKkASIAIAAvAQxBAXI7AQwLIAMgAygCpAEgAygCoAEQZUEBcToAhgEgAyADKAKgAUGACnFBgApHBH8gAy0AhgEFQQELQQFxOgCHASADAn9BASADKAKkAS8BUkGBAkYNABpBASADKAKkAS8BUkGCAkYNABogAygCpAEvAVJBgwJGC0EBcToAhQEgAy0AhwFBAXEEQCADIANBIGpCHBApNgIcIAMoAhxFBEAgAygCqAFBCGpBDkEAEBQgAygCkAEQIyADQX82AqwBDAILAkAgAygCoAFBgAJxBEACQCADKAKgAUGACHENACADKAKkASkDIEL/////D1YNACADKAKkASkDKEL/////D1gNAgsgAygCHCADKAKkASkDKBAtIAMoAhwgAygCpAEpAyAQLQwBCwJAAkAgAygCoAFBgAhxDQAgAygCpAEpAyBC/////w9WDQAgAygCpAEpAyhC/////w9WDQAgAygCpAEpA0hC/////w9YDQELIAMoAqQBKQMoQv////8PWgRAIAMoAhwgAygCpAEpAygQLQsgAygCpAEpAyBC/////w9aBEAgAygCHCADKAKkASkDIBAtCyADKAKkASkDSEL/////D1oEQCADKAIcIAMoAqQBKQNIEC0LCwsCfyMAQRBrIgAgAygCHDYCDCAAKAIMLQAAQQFxRQsEQCADKAKoAUEIakEUQQAQFCADKAIcEBYgAygCkAEQIyADQX82AqwBDAILIANBAQJ/IwBBEGsiACADKAIcNgIMAn4gACgCDC0AAEEBcQRAIAAoAgwpAxAMAQtCAAunQf//A3ELIANBIGpBgAYQVTYCjAEgAygCHBAWIAMoAowBIAMoApABNgIAIAMgAygCjAE2ApABCyADLQCFAUEBcQRAIAMgA0EVakIHECk2AhAgAygCEEUEQCADKAKoAUEIakEOQQAQFCADKAKQARAjIANBfzYCrAEMAgsgAygCEEECEB8gAygCEEG9EkECEEEgAygCECADKAKkAS8BUkH/AXEQlgEgAygCECADKAKkASgCEEH//wNxEB8CfyMAQRBrIgAgAygCEDYCDCAAKAIMLQAAQQFxRQsEQCADKAKoAUEIakEUQQAQFCADKAIQEBYgAygCkAEQIyADQX82AqwBDAILIANBgbICQQcgA0EVakGABhBVNgIMIAMoAhAQFiADKAIMIAMoApABNgIAIAMgAygCDDYCkAELIAMgA0HQAGpCLhApIgA2AkwgAEUEQCADKAKoAUEIakEOQQAQFCADKAKQARAjIANBfzYCrAEMAQsgAygCTEHxEkH2EiADKAKgAUGAAnEbQQQQQSADKAKgAUGAAnFFBEAgAygCTCADLQCGAUEBcQR/QS0FIAMoAqQBLwEIC0H//wNxEB8LIAMoAkwgAy0AhgFBAXEEf0EtBSADKAKkAS8BCgtB//8DcRAfIAMoAkwgAygCpAEvAQwQHwJAIAMtAIUBQQFxBEAgAygCTEHjABAfDAELIAMoAkwgAygCpAEoAhBB//8DcRAfCyADKAKkASgCFCADQZ4BaiADQZwBahCNASADKAJMIAMvAZ4BEB8gAygCTCADLwGcARAfAkACQCADLQCFAUEBcUUNACADKAKkASkDKEIUWg0AIAMoAkxBABAhDAELIAMoAkwgAygCpAEoAhgQIQsCQAJAIAMoAqABQYACcUGAAkcNACADKAKkASkDIEL/////D1QEQCADKAKkASkDKEL/////D1QNAQsgAygCTEF/ECEgAygCTEF/ECEMAQsCQCAD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AUoAhwhACAFQSBqJAAgAAumAQEBfyMAQRBrIgIkACACIAA2AgggAiABNgIEAkAgAigCCC0AKEEBcQRAIAJBfzYCDAwBCyACKAIIKAIABEAgAigCCCgCACACKAIEEGdBAEgEQCACKAIIQQxqIAIoAggoAgAQFyACQX82AgwMAgsLIAIoAgggAkEEakIEQRMQIEIAUwRAIAJBfzYCDAwBCyACQQA2AgwLIAIoAgwhACACQRBqJAAgAAuNCAIBfwF+IwBBkAFrIgMkACADIAA2AoQBIAMgATYCgAEgAyACNgJ8IAMQUwJAIAMoAoABKQMIQgBSBEAgAyADKAKAASgCACgCACkDSDcDYCADIAMoAoABKAIAKAIAKQNINwNoDAELIANCADcDYCADQgA3A2gLIANCADcDcAJAA0AgAykDcCADKAKAASkDCFQEQCADKAKAASgCACADKQNwp0EEdGooAgApA0ggAykDaFQEQCADIAMoAoABKAIAIAMpA3CnQQR0aigCACkDSDcDaAsgAykDaCADKAKAASkDIFYEQCADKAJ8QRNBABAUIANCfzcDiAEMAwsgAyADKAKAASgCACADKQNwp0EEdGooAgApA0ggAygCgAEoAgAgAykDcKdBBHRqKAIAKQMgfCADKAKAASgCACADKQNwp0EEdGooAgAoAjAQUUH//wNxrXxCHnw3A1ggAykDWCADKQNgVgRAIAMgAykDWDcDYAsgAykDYCADKAKAASkDIFYEQCADKAJ8QRNBABAUIANCfzcDiAEMAwsgAygChAEoAgAgAygCgAEoAgAgAykDcKdBBHRqKAIAKQNIQQAQJ0EASARAIAMoAnwgAygChAEoAgAQFyADQn83A4gBDAMLIAMgAygChAEoAgBBAEEBIAMoAnwQjAFCf1EEQCADEFIgA0J/NwOIAQwDCwJ/IAMoAoABKAIAIAMpA3CnQQR0aigCACEBIwBBEGsiACQAIAAgATYCCCAAIAM2AgQCQAJAAkAgACgCCC8BCiAAKAIELwEKSA0AIAAoAggoAhAgACgCBCgCEEcNACAAKAIIKAIUIAAoAgQoAhRHDQAgACgCCCgCMCAAKAIEKAIwEIYBDQELIABBfzYCDAwB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gIcIAMgATYCGCADIAI2AhQgAyADKAIcQdwWaiADKAIUQQJ0aigCADYCECADIAMoAhRBAXQ2AgwDQAJAIAMoAgwgAygCHCgC0ChKDQACQCADKAIMIAMoAhwoAtAoTg0AIAMoAhggAygCHCADKAIMQQJ0akHgFmooAgBBAnRqLwEAIAMoAhggAygCHEHcFmogAygCDEECdGooAgBBAnRqLwEATgRAIAMoAhggAygCHCADKAIMQQJ0akHgFmooAgBBAnRqLwEAIAMoAhggAygCHEHcFmogAygCDEECdGooAgBBAnRqLwEARw0BIAMoAhwgAygCDEECdGpB4BZqKAIAIAMoAhxB2Chqai0AACADKAIcQdwWaiADKAIMQQJ0aigCACADKAIcQdgoamotAABKDQELIAMgAygCDEEBajYCDAsgAygCGCADKAIQQQJ0ai8BACADKAIYIAMoAhxB3BZqIAMoAgxBAnRqKAIAQQJ0ai8BAEgNAAJAIAMoAhggAygCEEECdGovAQAgAygCGCADKAIcQdwWaiADKAIMQQJ0aigCAEECdGovAQBHDQAgAygCECADKAIcQdgoamotAAAgAygCHEHcFmogAygCDEECdGooAgAgAygCHEHYKGpqLQAASg0ADAELIAMoAhxB3BZqIAMoAhRBAnRqIAMoAhxB3BZqIAMoAgxBAnRqKAIANgIAIAMgAygCDDYCFCADIAMoAgxBAXQ2AgwMAQsLIAMoAhxB3BZqIAMoAhRBAnRqIAMoAhA2AgAL1xMBA38jAEEwayICJAAgAiAANgIsIAIgATYCKCACIAIoAigoAgA2AiQgAiACKAIoKAIIKAIANgIgIAIgAigCKCgCCCgCDDYCHCACQX82AhAgAigCLEEANgLQKCACKAIsQb0ENgLUKCACQQA2AhgDQCACKAIYIAIoAhxIBEACQCACKAIkIAIoAhhBAnRqLwEABEAgAiACKAIYIgE2AhAgAigCLEHcFmohAyACKAIsIgQoAtAoQQFqIQAgBCAANgLQKCAAQQJ0IANqIAE2AgAgAigCGCACKAIsQdgoampBADoAAAwBCyACKAIkIAIoAhhBAnRqQQA7AQILIAIgAigCGEEBajYCGAwBCwsDQCACKAIsKALQKEECSARAAkAgAigCEEECSARAIAIgAigCEEEBaiIANgIQDAELQQAhAAsgAigCLEHcFmohAyACKAIsIgQoAtAoQQFqIQEgBCABNgLQKCABQQJ0IANqIAA2AgAgAiAANgIMIAIoAiQgAigCDEECdGpBATsBACACKAIMIAIoAixB2ChqakEAOgAAIAIoAiwiACAAKAKoLUEBazYCqC0gAigCIARAIAIoAiwiACAAKAKsLSACKAIgIAIoAgxBAnRqLwECazYCrC0LDAELCyACKAIoIAIoAhA2AgQgAiACKAIsKALQKEECbTYCGANAIAIoAhhBAU4EQCACKAIsIAIoAiQgAigCGBB5IAIgAigCGEEBazYCGAwBCwsgAiACKAIcNgIMA0AgAiACKAIsKALgFjYCGCACKAIsQdwWaiEBIAIoAiwiAygC0CghACADIABBAWs2AtAoIAIoAiwgAEECdCABaigCADYC4BYgAigCLCACKAIkQQEQeSACIAIoAiwoAuAWNgIUIAIoAhghASACKAIsQdwWaiEDIAIoAiwiBCgC1ChBAWshACAEIAA2AtQoIABBAnQgA2ogATYCACACKAIUIQEgAigCLEHcFmohAyACKAIsIgQoAtQoQQFrIQAgBCAANgLUKCAAQQJ0IANqIAE2AgAgAigCJCACKAIMQQJ0aiACKAIkIAIoAhhBAnRqLwEAIAIoAiQgAigCFEECdGovAQBqOwEAIAIoAgwgAigCLEHYKGpqAn8gAigCGCACKAIsQdgoamotAAAgAigCFCACKAIsQdgoamotAABOBEAgAigCGCACKAIsQdgoamotAAAMAQsgAigCFCACKAIsQdgoamotAAALQQFqOgAAIAIoAiQgAigCFEECdGogAigCDCIAOwECIAIoAiQgAigCGEECdGogADsBAiACIAIoAgwiAEEBajYCDCACKAIsIAA2AuAWIAIoAiwgAigCJEEBEHkgAigCLCgC0ChBAk4NAAsgAigCLCgC4BYhASACKAIsQdwWaiEDIAIoAiwiBCgC1ChBAWshACAEIAA2AtQoIABBAnQgA2ogATYCACACKAIoIQEjAEFAaiIAIAIoAiw2AjwgACABNgI4IAAgACgCOCgCADY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tCAAunQf//A3ELAn8jAEEQayIAIAMoAgQ2AgwgACgCDCgCBAtBgAYQVTYCACADKAIEEBYgAyADKAIANgIcCyADKAIcIQAgA0EgaiQAIAALtAIBAX8jAEEwayIDJAAgAyAANgIoIAMgATcDICADIAI2AhwCQCADKQMgUARAIANBAToALwwBCyADIAMoAigpAxAgAykDIHw3AwgCQCADKQMIIAMpAyBaBEAgAykDCEL/////AFgNAQsgAygCHEEOQQAQFCADQQA6AC8MAQsgAyADKAIoKAIAIAMpAwinQQR0EE4iADYCBCAARQRAIAMoAhxBDkEAEBQgA0EAOgAvDAELIAMoAiggAygCBDYCACADIAMoAigpAwg3AxADQCADKQMQIAMpAwhaRQRAIAMoAigoAgAgAykDEKdBBHRqELUBIAMgAykDEEIBfDcDEAwBCwsgAygCKCADKQMIIgE3AxAgAygCKCABNwMIIANBAToALwsgAy0AL0EBcSEAIANBMGokACAAC8wBAQF/IwBBIGsiAiQAIAIgADcDECACIAE2AgwgAkEwEBgiATYCCAJAIAFFBEAgAigCDEEOQQAQFCACQQA2AhwMAQsgAigCCEEANgIAIAIoAghCADcDECACKAIIQgA3AwggAigCCEIANwMgIAIoAghCADcDGCACKAIIQQA2AiggAigCCEEAOgAsIAIoAgggAikDECACKAIMEI8BQQFxRQRAIAIoAggQJSACQQA2AhwMAQsgAiACKAIINgIcCyACKAIcIQEgAkEgaiQAIAEL1gIBAX8jAEEgayIDJAAgAyAANgIYIAMgATYCFCADIAI2AhAgAyADQQxqQgQQKTYCCAJAIAMoAghFBEAgA0F/NgIcDAELA0AgAygCFARAIAMoAhQoAgQgAygCEHFBgAZxBEAgAygCCEIAECwaIAMoAgggAygCFC8BCBAfIAMoAgggAygCFC8BChAfAn8jAEEQayIAIAMoAgg2AgwgACgCDC0AAEEBcUULBEAgAygCGEEIakEUQQAQFCADKAIIEBYgA0F/NgIcDAQLIAMoAhggA0EMakIEEDZBAEgEQCADKAIIEBYgA0F/NgIcDAQLIAMoAhQvAQoEQCADKAIYIAMoA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ECwaIAFBADoAFwwBCyABKAKoASABKQM4QQAQJ0EASARAIAEoApABIAEoAqgBEBcgAUEANgKsAQwCCyABIAEoAqgBQjggAUFAayABKAKQARBCIgU2AqQBIAVFBEAgAUEANgKsAQwCCyABQQE6ABcLIAEoAqQBQgQQHigAAEHQlpkwRwRAIAEoApABQRVBABAUIAEtABdBAXEEQCABKAKkARAWCyABQQA2AqwBDAELIAEgASgCpAEQMTcDMAJAIAEoApQBQQRxRQ0AIAEpAzAgASkDOHxCDHwgASkDmAEgASkDGHxRDQAgASgCkAFBFUEAEBQgAS0AF0EBcQRAIAEoAqQBEBYLIAFBADYCrAEMAQsgASgCpAFCBBAeGiABIAEoAqQBECo2AgwgASABKAKkARAqNgIEIAEoAhBB//8DRgRAIAEgASgCDDYCEAsgASgCCEH//wNGBEAgASABKAIENgIICwJAIAEoApQBQQRxRQ0AIAEoAgggASgCBEYEQCABKAIQIAEoAgxGDQELIAEoApABQRVBABAUIAEtABdBAXEEQCABKAKkARAWCyABQQA2AqwBDAELAkAgASgCEEUEQCABKAIIRQ0BCyABKAKQAUEBQQAQFCABLQAXQQFxBEAgASgCpAEQFgsgAUEANgKsAQwBCyABIAEoAqQBEDE3AyggASABKAKkARAxNwMgIAEpAyggASkDIFIEQCABKAKQAUEBQQAQFCABLQAXQQFxBEAgASgCpAEQFgsgAUEANgKsAQwBCyABIAEoAqQBEDE3AzAgASABKAKkARAxNwOAAQJ/IwBBEGsiBSABKAKkATYCDCAFKAIMLQAAQQFxRQsEQCABKAKQAUEUQQAQFCABLQAXQQFxBEAgASgCpAEQFgsgAUEANgKsAQwBCyABLQAXQQFxBEAgASgCpAEQFgsCQCABKQOAAUL///////////8AWARAIAEpA4ABIAEpA4ABIAEpAzB8WA0BCyABKAKQAUEEQRYQFCABQQA2AqwBDAELIAEpA4ABIAEpAzB8IAEpA5gBIAEpAzh8VgRAIAEoApABQRVBABAUIAFBADYCrAEMAQsCQCABKAKUAUEEcUUNACABKQOAASABKQMwfCABKQOYASABKQM4fFENACABKAKQAUEVQQAQFCABQQA2AqwBDAELIAEpAyggASkDMEIugFYEQCABKAKQAUEVQQAQFCABQQA2AqwBDAELIAEgASkDKCABKAKQARCQASIFNgKMASAFRQRAIAFBADYCrAEMAQsgASgCjAFBAToALCABKAKMASABKQMwNwMYIAEoAowBIAEpA4ABNwMgIAEgASgCjAE2AqwBCyABKAKsASEFIAFBsAFqJAAgACAFNgJQDAELIAAoAmQgACkDMBAsGiAAKAJkIQUgACkDWCEJIAAoAmgoAhQhBiAAKAJUIQcjAEHQAGsiASQAIAEgBTYCSCABIAk3A0AgASAGNgI8IAEgBzYCOAJAIAEoAkgQMEIWVARAIAEoAjhBFUEAEBQgAUEANgJMDAELIwBBEGsiBSABKAJINgIMIAECfiAFKAIMLQAAQQFxBEAgBSgCDCkDEAwBC0IACzcDCCABKAJIQgQQHhogASgCSBAqBEAgASgCOEEBQQAQFCABQQA2AkwMAQsgASABKAJIEB1B//8Dca03AyggASABKAJIEB1B//8Dca03AyAgASkDICABKQMoUgRAIAEoAjhBE0EAEBQgAUEANgJMDAELIAEgASgCSBAqrTcDGCABIAEoAkgQKq03AxAgASkDECABKQMQIAEpAxh8VgRAIAEoAjhBBEEWEBQgAUEANgJMDAELIAEpAxAgASkDGHwgASkDQCABKQMIfFYEQCABKAI4QRVBABAUIAFBADYCTAwBCwJAIAEoAjxBBHFFDQAgASkDECABKQMYfCABKQNAIAEpAwh8UQ0AIAEoAjhBFUEAEBQgAUEANgJMDAELIAEgASkDICABKAI4EJABIgU2AjQgBUUEQCABQQA2AkwMAQsgASgCNEEAOgAsIAEoAjQgASkDGDcDGCABKAI0IAEpAxA3AyAgASABKAI0NgJMCyABKAJMIQUgAUHQAGokACAAIAU2AlALIAAoAlBFBEAgAEEANgJsDAELIAAoAmQgACkDMEIUfBAsGiAAIAAoAmQQHTsBTiAAKAJQKQMgIAAoAlApAxh8IAApA1ggACkDMHxWBEAgACgCVEEVQQAQFCAAKAJQECUgAEEANgJsDAEL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RqNgIoAkAgAigCKCACKAIgai0AACACLQAKRw0AIAIoAiggAigCIEEBa2otAAAgAi0AC0cNACACKAIoLQAAIAIoAiwtAABHDQAgAiACKAIoIgBBAWo2AiggAC0AASACKAIsLQABRwRADAELIAIgAigCLEECajYCLCACIAIoAihBAWo2AigDQCACIAIoAiwiAEEBajYCLCAALQABIQEgAiACKAIoIgBBAWo2AigCf0EAIAAtAAEgAUcNABogAiACKAIsIgBBAWo2AiwgAC0AASEBIAIgAigCKCIAQQFqNgIoQQAgAC0AASABRw0AGiACIAIoAiwiAEEBajYCLCAALQABIQEgAiACKAIoIgBBAWo2AihBACAALQABIAFHDQAaIAIgAigCLCIAQQFqNgIsIAAtAAEhASACIAIoAigiAEEBajYCKEEAIAAtAAEgAUcNABogAiACKAIsIgBBAWo2AiwgAC0AASEBIAIgAigCKCIAQQFqNgIoQQAgAC0AASABRw0AGiACIAIoAiwiAEEBajYCLCAALQABIQEgAiACKAIoIgBBAWo2AihBACAALQABIAFHDQAaIAIgAigCLCIAQQFqNgIsIAAtAAEhASACIAIoAigiAEEBajYCKEEAIAAtAAEgAUcNABogAiACKAIsIgBBAWo2AiwgAC0AASEBIAIgAigCKCIAQQFqNgIoQQAgAC0AASABRw0AGiACKAIsIAIoAgxJC0EBcQ0ACyACQYICIAIoAgwgAigCLGtrNgIkIAIgAigCDEGCAms2AiwgAigCJCACKAIgSgRAIAIoAjggAigCNDYCcCACIAIoAiQ2AiAgAigCJCACKAIcTg0CIAIgAigCLCACKAIgQQFrai0AADoACyACIAIoAiwgAigCIGotAAA6AAoLCyACIAIoAhQgAigCNCACKAIQcUEBdGovAQAiATYCNEEAIQAgASACKAIYSwR/IAIgAigCMEEBayIANgIwIABBAEcFQQALQQFxDQELCwJAIAIoAiAgAigCOCgCdE0EQCACIAIoAiA2AjwMAQsgAiACKAI4KAJ0NgI8CyACKAI8C5IQAQF/IwBBMGsiAiQAIAIgADYCKCACIAE2AiQgAgJ/IAIoAigoAiwgAigCKCgCDEEFa0kEQCACKAIoKAIsDAELIAIoAigoAgxBBWsLNgIgIAJBADYCECACIAIoAigoAgAoAgQ2AgwDQAJAIAJB//8DNgIcIAIgAigCKCgCvC1BKmpBA3U2AhQgAigCKCgCACgCECACKAIUSQ0AIAIgAigCKCgCACgCECACKAIUazYCFCACIAIoAigoAmwgAigCKCgCXGs2AhggAigCHCACKAIYIAIoAigoAgAoAgRqSwRAIAIgAigCGCACKAIoKAIAKAIEajYCHAsgAigCHCACKAIUSwRAIAIgAigCFDYCHAsCQCACKAIcIAIoAiBPDQACQCACKAIcRQRAIAIoAiRBBEcNAQsgAigCJEUNACACKAIcIAIoAhggAigCKCgCACgCBGpGDQELDAELQQAhACACIAIoAiRBBEYEfyACKAIcIAIoAhggAigCKCgCACgCBGpGBUEAC0EBcTYCECACKAIoQQBBACACKAIQEF0gAigCKCgCCCACKAIoKAIUQQRraiACKAIcOgAAIAIoAigoAgggAigCKCgCFEEDa2ogAigCHEEIdjoAACACKAIoKAIIIAIoAigoAhRBAmtqIAIoAhxBf3M6AAAgAigCKCgCCCACKAIoKAIUQQFraiACKAIcQX9zQQh2OgAAIAIoAigoAgAQHCACKAIYBEAgAigCGCACKAIcSwRAIAIgAigCHDYCGAsgAigCKCgCACgCDCACKAIoKAI4IAIoAigoAlxqIAIoAhgQGRogAigCKCgCACIAIAIoAhggACgCDGo2AgwgAigCKCgCACIAIAAoAhAgAigCGGs2AhAgAigCKCgCACIAIAIoAhggACgCFGo2AhQgAigCKCIAIAIoAhggACgCXGo2AlwgAiACKAIcIAIoAhhrNgIcCyACKAIcBEAgAigCKCgCACACKAIoKAIAKAIMIAIoAhwQdhogAigCKCgCACIAIAIoAhwgACgCDGo2AgwgAigCKCgCACIAIAAoAhAgAigCHGs2AhAgAigCKCgCACIAIAIoAhwgACgCFGo2AhQLIAIoAhBFDQELCyACIAIoAgwgAigCKCgCACgCBGs2AgwgAigCDARAAkAgAigCDCACKAIoKAIsTwRAIAIoAihBAjYCsC0gAigCKCgCO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IUaws2AhQgAgJ/IAIoAhQgAigCKCgCLEsEQCACKAIoKAIsDAELIAIoAhQLNgIgIAIgAigCKCgCbCACKAIoKAJcazYCGAJAIAIoAhggAigCIEkEQCACKAIYRQRAIAIoAiRBBEcNAgsgAigCJEUNASACKAIoKAIAKAIEDQEgAigCGCACKAIUSw0BCyACAn8gAigCGCACKAIUSwRAIAIoAhQMAQsgAigCGAs2AhwgAgJ/QQAgAigCJEEERw0AGkEAIAIoAigoAgAoAgQNABogAigCHCACKAIYRgtBAXE2AhAgAigCKCACKAIoKAI4IAIoAigoAlxqIAIoAhwgAigCEBBdIAIoAigiACACKAIcIAAoAlxqNgJcIAIoAigoAgAQHAsgAkECQQAgAigCEBs2AiwLIAIoAiwhACACQTBqJAAgAAuyAgEBfyMAQRBrIgEkACABIAA2AggCQCABKAIIEHgEQCABQX42AgwMAQsgASABKAIIKAIcKAIENgIEIAEoAggoAhwoAggEQCABKAIIKAIoIAEoAggoAhwoAgggASgCCCgCJBEEAAsgASgCCCgCHCgCRARAIAEoAggoAiggASgCCCgCHCgCRCABKAIIKAIkEQQACyABKAIIKAIcKAJABEAgASgCCCgCKCABKAIIKAIcKAJAIAEoAggoAiQRBAALIAEoAggoAhwoAjgEQCABKAIIKAIoIAEoAggoAhwoAjggASgCCCgCJBEEAAsgASgCCCgCKCABKAIIKAIcIAEoAggoAiQRBAAgASgCCEEANgIcIAFBfUEAIAEoAgRB8QBGGzYCDAsgASgCDCEAIAFBEGokACAAC+sXAQJ/IwBB8ABrIgMgADYCbCADIAE2AmggAyACNgJkIANBfzYCXCADIAMoAmgvAQI2AlQgA0EANgJQIANBBzYCTCADQQQ2AkggAygCVEUEQCADQYoBNgJMIANBAzYCSAsgA0EANgJgA0AgAygCYCADKAJkSkUEQCADIAMoAlQ2AlggAyADKAJoIAMoAmBBAWpBAnRqLwECNgJUIAMgAygCUEEBaiIANgJQAkACQCADKAJMIABMDQAgAygCWCADKAJURw0ADAELAkAgAygCUCADKAJISARAA0AgA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oAkAgASkDUKdBBHRqKAIABEAgASgCWCgCQCABKQNQp0EEdGooAgApA0ggASkDOFoEQCABIAEoAlgoAkAgASkDUKdBBHRqKAIAKQNINwM4IAEgASkDUDcDGAsLIAEgASkDUEIBfDcDUAwBCwsgASkDGEJ/UgRAIAEoAlghAiABKQMYIQcgASgCWEEIaiEDIwBBMGsiACQAIAAgAjYCJCAAIAc3AxggACADNgIUIAAgACgCJCAAKQMYIAAoAhQQYCIHNwMIAkAgB1AEQCAAQgA3AygMAQsgACAAKAIkKAJAIAApAxinQQR0aigCADYCBAJAIAApAwggACkDCCAAKAIEKQMgfFgEQCAAKQMIIAAoAgQpAyB8Qv///////////wBYDQELIAAoAhRBBEEWEBQgAEIANwMoDAELIAAgACgCBCkDICAAKQMIfDcDCCAAKAIELwEMQQhxBEAgACgCJCgCACAAKQMIQQAQJ0EASARAIAAoAhQgACgCJCgCABAXIABCADcDKAwCCyAAKAIkKAIAIABCBBArQgRSBEAgACgCFCAAKAIkKAIAEBcgAEIANwMoDAILIAAoAABB0JadwABGBEAgACAAKQMIQgR8NwMICyAAIAApAwhCDHw3AwggACgCBEEAEGVBAXEEQCAAIAApAwhCCHw3AwgLIAApAwhC////////////AFYEQCAAKAIUQQRBFhAUIABCADcDKAwCCwsgACAAKQMINwMoCyAAKQMoIQcgAEEwaiQAIAEgBzcDOCAHUARAIAEoAigQFSABQX82AlwMBAsLCyABKQM4QgBSBEACfyABKAJYKAIAIQIgASkDOCEHIwBBEGsiACQAIAAgAjYCCCAAIAc3AwACQCAAKAIIKAIkQQFGBEAgACgCCEEMakESQQAQFCAAQX82AgwMAQsgACgCCEEAIAApAwBBERAgQgBTBEAgAEF/NgIMDAELIAAoAghBATYCJCAAQQA2AgwLIAAoAgwhAiAAQRBqJAAgAkEASAsEQCABQgA3AzgLCwsgASkDOFAEQAJ/IAEoAlgoAgAhAiMAQRBrIgAkACAAIAI2AggCQCAAKAIIKAIkQQFGBEAgACgCCEEMakESQQAQFCAAQX82AgwM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SbASAANgIAQX8FQQALIQAgAykDCCEBIANBEGokAEJ/IAEgABsL1QQBBX8jAEGwAWsiASQAIAEgADYCqAEgASgCqAEQOAJAAkAgASgCqAEoAgBBAE4EQCABKAKoASgCAEGAFCgCAEgNAQsgASABKAKoASgCADYCECABQSBqQY8SIAFBEGoQbyABQQA2AqQBIAEgAUEgajYCoAEMAQsgASABKAKoASgCAEECdEGAE2ooAgA2AqQBAkACQAJAAkAgASgCqAEoAgBBAnRBkBRqKAIAQQFrDgIAAQILIAEoAqgBKAIEIQJBkJkBKAIAIQRBACEAAkACQANAIAIgAEGgiAFqLQAARwRAQdcAIQMgAEEBaiIAQdcARw0BDAILCyAAIgMNAEGAiQEhAgwBC0GAiQEhAANAIAAtAAAhBSAAQQFqIgIhACAFDQAgAiEAIANBAWsiAw0ACwsgBCgCFBogASACNgKgAQwCCyMAQRBrIgAgASgCqAEoAgQ2AgwgAUEAIAAoAgxrQQJ0QajZAGooAgA2AqABDAELIAFBADYCoAELCwJAIAEoAqABRQRAIAEgASgCpAE2AqwBDAELIAEgASgCoAEQLgJ/IAEoAqQBBEAgASgCpAEQLkECagwBC0EAC2pBAWoQGCIANgIcIABFBEAgAUG4EygCADYCrAEMAQsgASgCHCEAAn8gASgCpAEEQCABKAKkAQwBC0H6EgshA0HfEkH6EiABKAKkARshAiABIAEoAqABNgIIIAEgAjYCBCABIAM2AgAgAEG+CiABEG8gASgCqAEgASgCHDYCCCABIAEoAhw2AqwBCyABKAKsASEAIAFBsAFqJAAgAAsIAEEBQTgQfwszAQF/IAAoAhQiAyABIAIgACgCECADayIBIAEgAksbIgEQGRogACAAKAIUIAFqNgIUIAILjwUCBn4BfyABIAEoAgBBD2pBcHEiAUEQajYCACAAAnwgASkDACEDIAEpAwghBiMAQSBrIggkAAJAIAZC////////////AIMiBEKAgICAgIDAgDx9IARCgICAgICAwP/DAH1UBEAgBkIEhiADQjyIhCEEIANC//////////8PgyIDQoGAgICAgICACFoEQCAEQoGAgICAgICAwAB8IQIMAgsgBEKAgICAgICAgEB9IQIgA0KAgICAgICAgAiFQgBSDQEgAiAEQgGDfCECDAELIANQIARCgICAgICAwP//AFQgBEKAgICAgIDA//8AURtFBEAgBkIEhiADQjyIhEL/////////A4NCgICAgICAgPz/AIQhAgwBC0KAgICAgICA+P8AIQIgBEL///////+//8MAVg0AQgAhAiAEQjCIpyIAQZH3AEkNACADIQIgBkL///////8/g0KAgICAgIDAAIQiBSEHAkAgAEGB9wBrIgFBwABxBEAgAiABQUBqrYYhB0IAIQIMAQsgAUUNACAHIAGtIgSGIAJBwAAgAWutiIQhByACIASGIQILIAggAjcDECAIIAc3AxgCQEGB+AAgAGsiAEHAAHEEQCAFIABBQGqtiCEDQgAhBQwBCyAARQ0AIAVBwAAgAGuthiADIACtIgKIhCEDIAUgAoghBQsgCCADNwMAIAggBTcDCCAIKQMIQgSGIAgpAwAiA0I8iIQhAiAIKQMQIAgpAxiEQgBSrSADQv//////////D4OEIgNCgYCAgICAgIAIWgRAIAJCAXwhAgwBCyADQoCAgICAgICACIVCAFINACACQgGDIAJ8IQILIAhBIGokACACIAZCgICAgICAgICAf4OEvws5AwALrRcDEn8CfgF8IwBBsARrIgkkACAJQQA2AiwCQCABvSIYQn9XBEBBASESQa4IIRMgAZoiAb0hGAwBCyAEQYAQcQRAQQEhEkGxCCETDAELQbQIQa8IIARBAXEiEhshEyASRSEXCwJAIBhCgICAgICAgPj/AINCgICAgICAgPj/AFEEQCAAQSAgAiASQQNqIg0gBEH//3txECYgACATIBIQIiAAQeQLQbUSIAVBIHEiAxtBjw1BuRIgAxsgASABYhtBAxAiDAELIAlBEGohEAJAAn8CQCABIAlBLGoQqQEiASABoCIBRAAAAAAAAAAAYgRAIAkgCSgCLCIGQQFrNgIsIAVBIHIiFEHhAEcNAQwDCyAFQSByIhRB4QBGDQIgCSgCLCELQQYgAyADQQBIGwwBCyAJIAZBHWsiCzYCLCABRAAAAAAAALBBoiEBQQYgAyADQQBIGwshCiAJQTBqIAlB0AJ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AAAAABiDQALIABBICACIA4CfwJAIANFDQAgCCAJa0ESayADTg0AIAMgEGogDGtBAmoMAQsgECAJQRBqIAxqayAIagsiA2oiDSAEECYgACAKIA4QIiAAQTAgAiANIARBgIAEcxAmIAAgCUEQaiAIIAlBEGprIgUQIiAAQTAgAyAFIBAgDGsiA2prQQBBABAmIAAgDCADECILIABBICACIA0gBEGAwABzECYgCUGwBGokACACIA0gAiANShsLBgBB4J8BCwYAQdyfAQsGAEHUnwELGAEBfyMAQRBrIgEgADYCDCABKAIMQQRqCxgBAX8jAEEQayIBIAA2AgwgASgCDEEIagtpAQF/IwBBEGsiASQAIAEgADYCDCABKAIMKAIUBEAgASgCDCgCFBAbCyABQQA2AgggASgCDCgCBARAIAEgASgCDCgCBDYCCAsgASgCDEEEahA4IAEoAgwQFSABKAIIIQAgAUEQaiQAIAALqQEBA38CQCAALQAAIgJFDQADQCABLQAAIgRFBEAgAiEDDAILAkAgAiAERg0AIAJBIHIgAiACQcEAa0EaSRsgAS0AACICQSByIAIgAkHBAGtBGkkbRg0AIAAtAAAhAwwCCyABQQFqIQEgAC0AASECIABBAWohACACDQALCyADQf8BcSIAQSByIAAgAEHBAGtBGkkbIAEtAAAiAEEgciAAIABBwQBrQRpJG2sLiAEBAX8jAEEQayICJAAgAiAANgIMIAIgATYCCCMAQRBrIgAgAigCDDYCDCAAKAIMQQA2AgAgACgCDEEANgIEIAAoAgxBADYCCCACKAIMIAIoAgg2AgACQCACKAIMEKwBQQFGBEAgAigCDEG0mwEoAgA2AgQMAQsgAigCDEEANgIECyACQRBqJAAL2AkBAX8jAEGwAWsiBSQAIAUgADYCpAEgBSABNgKgASAFIAI2ApwBIAUgAzcDkAEgBSAENgKMASAFIAUoAqABNgKIAQJAAkACQAJAAkACQAJAAkACQAJAAkAgBSgCjAEODwABAgMEBQcICQkJCQkJBgkLIAUoAogBQgA3AyAgBUIANwOoAQwJCyAFIAUoAqQBIAUoApwBIAUpA5ABECsiAzcDgAEgA0IAUwRAIA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oAnRBggJNBEAgASgCKBBcAkAgASgCKCgCdEGCAksNACABKAIkDQAgAUEANgIsDAQLIAEoAigoAnRFDQELIAEoAihBADYCYAJAIAEoAigoAnRBA0kNACABKAIoKAJsRQ0AIAEgASgCKCgCOCABKAIoKAJsakEBazYCGCABIAEoAhgtAAA2AhwgASgCHCECIAEgASgCGCIDQQFqNgIYAkAgAy0AASACRw0AIAEoAhwhAiABIAEoAhgiA0EBajYCGCADLQABIAJHDQAgASgCHCECIAEgASgCGCIDQQFqNgIYIAMtAAEgAkcNACABIAEoAigoAjggASgCKCgCbGpBggJqNgIUA0AgASgCHCECIAEgASgCGCIDQQFqNgIYAn9BACADLQABIAJHDQAaIAEoAhwhAiABIAEoAhgiA0EBajYCGEEAIAMtAAEgAkcNABogASgCHCECIAEgASgCGCIDQQFqNgIYQQAgAy0AASACRw0AGiABKAIcIQIgASABKAIYIgNBAWo2AhhBACADLQABIAJHDQAaIAEoAhwhAiABIAEoAhgiA0EBajYCGEEAIAMtAAEgAkcNABogASgCHCECIAEgASgCGCIDQQFqNgIYQQAgAy0AASACRw0AGiABKAIcIQIgASABKAIYIgNBAWo2AhhBACADLQABIAJHDQAaIAEoAhwhAiABIAEoAhgiA0EBajYCGEEAIAMtAAEgAkcNABogASgCGCABKAIUSQtBAXENAAsgASgCKEGCAiABKAIUIAEoAhhrazYCYCABKAIoKAJgIAEoAigoAnRLBEAgASgCKCABKAIoKAJ0NgJgCwsLAkAgASgCKCgCYEEDTwRAIAEgASgCKCgCYEEDazoAEyABQQE7ARAgASgCKCICKAKkLSACKAKgLUEBdGogAS8BEDsBACABLQATIQMgASgCKCICKAKYLSEEIAIgAigCoC0iAkEBajYCoC0gAiAEaiADOgAAIAEgAS8BEEEBazsBECABKAIoIAEtABNB0N0Aai0AAEECdGpBmAlqIgIgAi8BAEEBajsBACABKAIoQYgTagJ/IAEvARBBgAJJBEAgAS8BEC0A0FkMAQsgAS8BEEEHdkGAAmotANBZC0ECdGoiAiACLwEAQQFq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QQZGDQ0LIAAoAlBByP4ANgIECwJAIAAoAkRBBkkNACAAKAJAQYICSQ0AIAAoAlggACgCSDYCDCAAKAJYIAAoAkA2AhAgACgCWCAAKAJMNgIAIAAoAlggACgCRDYCBCAAKAJQIAAoAjw2AjwgACgCUCAAKAI4NgJAIAAoAjAhAiMAQeAAayIBIAAoAlg2AlwgASACNgJYIAEgASgCXCgCHDYCVCABIAEoAlwoAgA2AlAgASABKAJQIAEoAlwoAgRBBWtqNgJMIAEgASgCXCgCDDYCSCABIAEoAkggASgCWCABKAJcKAIQa2s2AkQgASABKAJIIAEoAlwoAhBBgQJrajYCQCABIAEoAlQoAiw2AjwgASABKAJUKAIwNgI4IAEgASgCVCgCNDYCNCABIAEoAlQoAjg2AjAgASABKAJUKAI8NgIsIAEgASgCVCgCQDYCKCABIAEoAlQoAlA2AiQgASABKAJUKAJUNgIgIAFBASABKAJUKAJYdEEBazYCHCABQQEgASgCVCgCXHRBAWs2AhgDQCABKAIoQQ9JBEAgASABKAJQIgJBAWo2AlAgASABKAIsIAItAAAgASgCKHRqNgIsIAEgASgCKEEIajYCKCABIAEoAlAiAkEBajYCUCABIAEoAiwgAi0AACABKAIodGo2AiwgASABKAIoQQhqNgIoCyABIAEoAiQgASgCLCABKAIccUECdGooAQA2ARACQAJAA0AgASABLQARNgIMIAEgASgCLCABKAIMdjYCLCABIAEoAiggASgCDGs2AiggASABLQAQNgIMIAEoAgxFBEAgAS8BEiECIAEgASgCSCIDQQFqNgJIIAMgAjoAAAwCCyABKAIMQRBxBEAgASABLwESNgIIIAEgASgCDEEPcTYCDCABKAIMBEAgASgCKCABKAIMSQRAIAEgASgCUCICQQFqNgJQIAEgASgCLCACLQAAIAEoAih0ajYCLCABIAEoAihBCGo2AigLIAEgASgCCCABKAIsQQEgASgCDHRBAWtxajYCCCABIAEoAiwgASgCDHY2AiwgASABKAIoIAEoAgxrNgIoCyABKAIoQQ9JBEAgASABKAJQIgJBAWo2AlAgASABKAIsIAItAAAgASgCKHRqNgIsIAEgASgCKEEIajYCKCABIAEoAlAiAkEBajYCUCABIAEoAiwgAi0AACABKAIodGo2AiwgASABKAIoQQhqNgIoCyABIAEoAiAgASgCLCABKAIYcUECdGooAQA2ARACQANAIAEgAS0AETYCDCABIAEoAiwgASgCDHY2AiwgASABKAIoIAEoAgxrNgIoIAEgAS0AEDYCDCABKAIMQRBxBEAgASABLwESNgIEIAEgASgCDEEPcTYCDCABKAIoIAEoAgxJBEAgASABKAJQIgJBAWo2AlAgASABKAIsIAItAAAgASgCKHRqNgIsIAEgASgCKEEIajYCKCABKAIoIAEoAgxJBEAgASABKAJQIgJBAWo2AlAgASABKAIsIAItAAAgASgCKHRqNgIsIAEgASgCKEEIajYCKAsLIAEgASgCBCABKAIsQQEgASgCDHRBAWtxajYCBCABIAEoAiwgASgCDHY2AiwgASABKAIoIAEoAgxrNgIoIAEgASgCSCABKAJEazYCDAJAIAEoAgQgASgCDEsEQCABIAEoAgQgASgCDGs2AgwgASgCDCABKAI4SwRAIAEoAlQoAsQ3BEAgASgCXEHdDDYCGCABKAJUQdH+ADYCBAwKCwsgASABKAIwNgIAAkAgASgCNEUEQCABIAEoAgAgASgCPCABKAIMa2o2AgAgASgCDCABKAIISQRAIAEgASgCCCABKAIMazYCCANAIAEgASgCACICQQFqNgIAIAItAAAhAiABIAEoAkgiA0EBajYCSCADIAI6AAAgASABKAIMQQFrIgI2AgwgAg0ACyABIAEoAkggASgCBGs2AgALDAELAkAgASgCNCABKAIMSQRAIAEgASgCACABKAI8IAEoAjRqIAEoAgxrajYCACABIAEoAgwgASgCNGs2AgwgASgCDCABKAIISQRAIAEgASgCCCABKAIMazYCCANAIAEgASgCACICQQFqNgIAIAItAAAhAiABIAEoAkgiA0EBajYCSCADIAI6AAAgASABKAIMQQFrIgI2AgwgAg0ACyABIAEoAjA2AgAgASgCNCABKAIISQRAIAEgASgCNDYCDCABIAEoAgggASgCDGs2AggDQCABIAEoAgAiAkEBajYCACACLQAAIQIgASABKAJIIgNBAWo2AkggAyACOgAAIAEgASgCDEEBayICNgIMIAINAAsgASABKAJIIAEoAgRrNgIACwsMAQsgASABKAIAIAEoAjQgASgCDGtqNgIAIAEoAgwgASgCCEkEQCABIAEoAgggASgCDGs2AggDQCABIAEoAgAiAkEBajYCACACLQAAIQIgASABKAJIIgNBAWo2AkggAyACOgAAIAEgASgCDEEBayICNgIMIAINAAsgASABKAJIIAEoAgRrNgIACwsLA0AgASgCCEECSwRAIAEgASgCACICQQFqNgIAIAItAAAhAiABIAEoAkgiA0EBajYCSCADIAI6AAAgASABKAIAIgJBAWo2AgAgAi0AACECIAEgASgCSCIDQQFqNgJIIAMgAjoAACABIAEoAgAiAkEBajYCACACLQAAIQIgASABKAJIIgNBAWo2AkggAyACOgAAIAEgASgCCEEDazYCCAwBCwsMAQsgASABKAJIIAEoAgRrNgIAA0AgASABKAIAIgJBAWo2AgAgAi0AACECIAEgASgCSCIDQQFqNgJIIAMgAjoAACABIAEoAgAiAkEBajYCACACLQAAIQIgASABKAJIIgNBAWo2AkggAyACOgAAIAEgASgCACICQQFqNgIAIAItAAAhAiABIAEoAkgiA0EBajYCSCADIAI6AAAgASABKAIIQQNrNgIIIAEoAghBAksNAAsLIAEoAggEQCABIAEoAgAiAkEBajYCACACLQAAIQIgASABKAJIIgNBAWo2AkggAyACOgAAIAEoAghBAUsEQCABIAEoAgAiAkEBajYCACACLQAAIQIgASABKAJIIgNBAWo2AkggAyACOgAACwsMAgsgASgCDEHAAHFFBEAgASABKAIgIAEvARIgASgCLEEBIAEoAgx0QQFrcWpBAnRqKAEANgEQDAELCyABKAJcQYUPNgIYIAEoAlRB0f4ANgIEDAQLDAILIAEoAgxBwABxRQRAIAEgASgCJCABLwESIAEoAixBASABKAIMdEEBa3FqQQJ0aigBADYBEAwBCwsgASgCDEEgcQRAIAEoAlRBv/4ANgIEDAILIAEoAlxB6Q42AhggASgCVEHR/gA2AgQMAQsgASgCUCABKAJMSQR/IAEoAkggASgCQEkFQQALQQFxDQEL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AOwBDAFMAYwBzAIMAowDDAOMAAgEAAAAAAAAQABAAEAAQABAAEAAQABAAEQARABEAEQASABIAEgASABMAEwATABMAFAAUABQAFAAVABUAFQAVABAATQDKAAAAAQACAAMABAAFAAcACQANABEAGQAhADEAQQBhAIEAwQABAYEBAQIBAwEEAQYBCAEMARABGAEgATABQAFgAAAAABAAEAAQABAAEQARABIAEgATABMAFAAUABUAFQAWABYAFwAXABgAGAAZABkAGgAaABsAGwAcABwAHQAdAEAAQAAQABEAEgAAAAgABwAJAAYACgAFAAsABAAMAAMADQACAA4AAQAPAEGw8gALwRFgBwAAAAhQAAAIEAAUCHMAEgcfAAAIcAAACDAAAAnAABAHCgAACGAAAAggAAAJoAAACAAAAAiAAAAIQAAACeAAEAcGAAAIWAAACBgAAAmQABMHOwAACHgAAAg4AAAJ0AARBxEAAAhoAAAIKAAACbAAAAgIAAAIiAAACEgAAAnwABAHBAAACFQAAAgUABUI4wATBysAAAh0AAAINAAACcgAEQcNAAAIZAAACCQAAAmoAAAIBAAACIQAAAhEAAAJ6AAQBwgAAAhcAAAIHAAACZgAFAdTAAAIfAAACDwAAAnYABIHFwAACGwAAAgsAAAJuAAACAwAAAiMAAAITAAACfgAEAcDAAAIUgAACBIAFQijABMHIwAACHIAAAgyAAAJxAARBwsAAAhiAAAIIgAACaQAAAgCAAAIggAACEIAAAnkABAHBwAACFoAAAgaAAAJlAAUB0MAAAh6AAAIOgAACdQAEgcTAAAIagAACCoAAAm0AAAICgAACIoAAAhKAAAJ9AAQBwUAAAhWAAAIFgBACAAAEwczAAAIdgAACDYAAAnMABEHDwAACGYAAAgmAAAJrAAACAYAAAiGAAAIRgAACewAEAcJAAAIXgAACB4AAAmcABQHYwAACH4AAAg+AAAJ3AASBxsAAAhuAAAILgAACbwAAAgOAAAIjgAACE4AAAn8AGAHAAAACFEAAAgRABUIgwASBx8AAAhxAAAIMQAACcIAEAcKAAAIYQAACCEAAAmiAAAIAQAACIEAAAhBAAAJ4gAQBwYAAAhZ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q9fGAQVseNtKIarDKS/Q/DpUIE5VxZSN/////////////////////8=";Tu(xo)||(xo=h(xo));function Ou(d){try{if(d==xo&&_)return new Uint8Array(_);var E=xa(d);if(E)return E;if(m)return m(d);throw"sync fetching of the wasm failed: you can preload it to Module['wasmBinary'] manually, or emcc.py will do that for you when generating HTML (but not JS)"}catch(I){vr(I)}}function Sh(d,E){var I,D,M;try{M=Ou(d),D=new WebAssembly.Module(M),I=new WebAssembly.Instance(D,E)}catch(ie){var z=ie.toString();throw x("failed to compile wasm module: "+z),(z.includes("imported Memory")||z.includes("memory import"))&&x("Memory size incompatibility issues may be due to changing INITIAL_MEMORY at runtime to something too large. Use ALLOW_MEMORY_GROWTH to allow any size memory (and also make sure not to set INITIAL_MEMORY at runtime to something smaller than it was at compile time)."),ie}return[I,D]}function vh(){var d={a:ka};function E(M,z){var ie=M.exports;t.asm=ie,A=t.asm.u,Ei(A.buffer),Qr=t.asm.pa,DA(t.asm.v),NA("wasm-instantiate")}if(FA("wasm-instantiate"),t.instantiateWasm)try{var I=t.instantiateWasm(d,E);return I}catch(M){return x("Module.instantiateWasm callback failed with error: "+M),!1}var D=Sh(xo,d);return E(D[0]),t.asm}var Dr,Ae;function ko(d){for(;d.length>0;){var E=d.shift();if(typeof E=="function"){E(t);continue}var I=E.func;typeof I=="number"?E.arg===void 0?Qr.get(I)():Qr.get(I)(E.arg):I(E.arg===void 0?null:E.arg)}}function Gn(d,E){var I=new Date(fe[d>>2]*1e3);fe[E>>2]=I.getUTCSeconds(),fe[E+4>>2]=I.getUTCMinutes(),fe[E+8>>2]=I.getUTCHours(),fe[E+12>>2]=I.getUTCDate(),fe[E+16>>2]=I.getUTCMonth(),fe[E+20>>2]=I.getUTCFullYear()-1900,fe[E+24>>2]=I.getUTCDay(),fe[E+36>>2]=0,fe[E+32>>2]=0;var D=Date.UTC(I.getUTCFullYear(),0,1,0,0,0,0),M=(I.getTime()-D)/(1e3*60*60*24)|0;return fe[E+28>>2]=M,Gn.GMTString||(Gn.GMTString=Fe("GMT")),fe[E+40>>2]=Gn.GMTString,E}function Mu(d,E){return Gn(d,E)}var St={splitPath:function(d){var E=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return E.exec(d).slice(1)},normalizeArray:function(d,E){for(var I=0,D=d.length-1;D>=0;D--){var M=d[D];M==="."?d.splice(D,1):M===".."?(d.splice(D,1),I++):I&&(d.splice(D,1),I--)}if(E)for(;I;I--)d.unshift("..");return d},normalize:function(d){var E=d.charAt(0)==="/",I=d.substr(-1)==="/";return d=St.normalizeArray(d.split("/").filter(function(D){return!!D}),!E).join("/"),!d&&!E&&(d="."),d&&I&&(d+="/"),(E?"/":"")+d},dirname:function(d){var E=St.splitPath(d),I=E[0],D=E[1];return!I&&!D?".":(D&&(D=D.substr(0,D.length-1)),I+D)},basename:function(d){if(d==="/")return"/";d=St.normalize(d),d=d.replace(/\/$/,"");var E=d.lastIndexOf("/");return E===-1?d:d.substr(E+1)},extname:function(d){return St.splitPath(d)[3]},join:function(){var d=Array.prototype.slice.call(arguments,0);return St.normalize(d.join("/"))},join2:function(d,E){return St.normalize(d+"/"+E)}};function _l(){if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function"){var d=new Uint8Array(1);return function(){return crypto.getRandomValues(d),d[0]}}else if(g)try{var E=require("crypto");return function(){return E.randomBytes(1)[0]}}catch(I){}return function(){vr("randomDevice")}}var Yn={resolve:function(){for(var d="",E=!1,I=arguments.length-1;I>=-1&&!E;I--){var D=I>=0?arguments[I]:S.cwd();if(typeof D!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!D)return"";d=D+"/"+d,E=D.charAt(0)==="/"}return d=St.normalizeArray(d.split("/").filter(function(M){return!!M}),!E).join("/"),(E?"/":"")+d||"."},relative:function(d,E){d=Yn.resolve(d).substr(1),E=Yn.resolve(E).substr(1);function I(_e){for(var ot=0;ot<_e.length&&_e[ot]==="";ot++);for(var Bt=_e.length-1;Bt>=0&&_e[Bt]==="";Bt--);return ot>Bt?[]:_e.slice(ot,Bt-ot+1)}for(var D=I(d.split("/")),M=I(E.split("/")),z=Math.min(D.length,M.length),ie=z,we=0;we0?E=D.slice(0,M).toString("utf-8"):E=null}else typeof window!="undefined"&&typeof window.prompt=="function"?(E=window.prompt("Input: "),E!==null&&(E+=` -`)):typeof readline=="function"&&(E=readline(),E!==null&&(E+=` -`));if(!E)return null;d.input=TA(E,!0)}return d.input.shift()},put_char:function(d,E){E===null||E===10?(v(je(d.output,0)),d.output=[]):E!=0&&d.output.push(E)},flush:function(d){d.output&&d.output.length>0&&(v(je(d.output,0)),d.output=[])}},default_tty1_ops:{put_char:function(d,E){E===null||E===10?(x(je(d.output,0)),d.output=[]):E!=0&&d.output.push(E)},flush:function(d){d.output&&d.output.length>0&&(x(je(d.output,0)),d.output=[])}}};function ds(d){for(var E=q(d,65536),I=Et(E);d=E)){var D=1024*1024;E=Math.max(E,I*(I>>0),I!=0&&(E=Math.max(E,256));var M=d.contents;d.contents=new Uint8Array(E),d.usedBytes>0&&d.contents.set(M.subarray(0,d.usedBytes),0)}},resizeFileStorage:function(d,E){if(d.usedBytes!=E)if(E==0)d.contents=null,d.usedBytes=0;else{var I=d.contents;d.contents=new Uint8Array(E),I&&d.contents.set(I.subarray(0,Math.min(E,d.usedBytes))),d.usedBytes=E}},node_ops:{getattr:function(d){var E={};return E.dev=S.isChrdev(d.mode)?d.id:1,E.ino=d.id,E.mode=d.mode,E.nlink=1,E.uid=0,E.gid=0,E.rdev=d.rdev,S.isDir(d.mode)?E.size=4096:S.isFile(d.mode)?E.size=d.usedBytes:S.isLink(d.mode)?E.size=d.link.length:E.size=0,E.atime=new Date(d.timestamp),E.mtime=new Date(d.timestamp),E.ctime=new Date(d.timestamp),E.blksize=4096,E.blocks=Math.ceil(E.size/E.blksize),E},setattr:function(d,E){E.mode!==void 0&&(d.mode=E.mode),E.timestamp!==void 0&&(d.timestamp=E.timestamp),E.size!==void 0&&pt.resizeFileStorage(d,E.size)},lookup:function(d,E){throw S.genericErrors[44]},mknod:function(d,E,I,D){return pt.createNode(d,E,I,D)},rename:function(d,E,I){if(S.isDir(d.mode)){var D;try{D=S.lookupNode(E,I)}catch(z){}if(D)for(var M in D.contents)throw new S.ErrnoError(55)}delete d.parent.contents[d.name],d.parent.timestamp=Date.now(),d.name=I,E.contents[I]=d,E.timestamp=d.parent.timestamp,d.parent=E},unlink:function(d,E){delete d.contents[E],d.timestamp=Date.now()},rmdir:function(d,E){var I=S.lookupNode(d,E);for(var D in I.contents)throw new S.ErrnoError(55);delete d.contents[E],d.timestamp=Date.now()},readdir:function(d){var E=[".",".."];for(var I in d.contents)!d.contents.hasOwnProperty(I)||E.push(I);return E},symlink:function(d,E,I){var D=pt.createNode(d,E,511|40960,0);return D.link=I,D},readlink:function(d){if(!S.isLink(d.mode))throw new S.ErrnoError(28);return d.link}},stream_ops:{read:function(d,E,I,D,M){var z=d.node.contents;if(M>=d.node.usedBytes)return 0;var ie=Math.min(d.node.usedBytes-M,D);if(ie>8&&z.subarray)E.set(z.subarray(M,M+ie),I);else for(var we=0;we0||D+I>2)}catch(I){throw I.code?new S.ErrnoError(lt.convertNodeCode(I)):I}return E.mode},realPath:function(d){for(var E=[];d.parent!==d;)E.push(d.name),d=d.parent;return E.push(d.mount.opts.root),E.reverse(),St.join.apply(null,E)},flagsForNode:function(d){d&=~2097152,d&=~2048,d&=~32768,d&=~524288;var E=0;for(var I in lt.flagsForNodeMap)d&I&&(E|=lt.flagsForNodeMap[I],d^=I);if(d)throw new S.ErrnoError(28);return E},node_ops:{getattr:function(d){var E=lt.realPath(d),I;try{I=Oe.lstatSync(E)}catch(D){throw D.code?new S.ErrnoError(lt.convertNodeCode(D)):D}return lt.isWindows&&!I.blksize&&(I.blksize=4096),lt.isWindows&&!I.blocks&&(I.blocks=(I.size+I.blksize-1)/I.blksize|0),{dev:I.dev,ino:I.ino,mode:I.mode,nlink:I.nlink,uid:I.uid,gid:I.gid,rdev:I.rdev,size:I.size,atime:I.atime,mtime:I.mtime,ctime:I.ctime,blksize:I.blksize,blocks:I.blocks}},setattr:function(d,E){var I=lt.realPath(d);try{if(E.mode!==void 0&&(Oe.chmodSync(I,E.mode),d.mode=E.mode),E.timestamp!==void 0){var D=new Date(E.timestamp);Oe.utimesSync(I,D,D)}E.size!==void 0&&Oe.truncateSync(I,E.size)}catch(M){throw M.code?new S.ErrnoError(lt.convertNodeCode(M)):M}},lookup:function(d,E){var I=St.join2(lt.realPath(d),E),D=lt.getMode(I);return lt.createNode(d,E,D)},mknod:function(d,E,I,D){var M=lt.createNode(d,E,I,D),z=lt.realPath(M);try{S.isDir(M.mode)?Oe.mkdirSync(z,M.mode):Oe.writeFileSync(z,"",{mode:M.mode})}catch(ie){throw ie.code?new S.ErrnoError(lt.convertNodeCode(ie)):ie}return M},rename:function(d,E,I){var D=lt.realPath(d),M=St.join2(lt.realPath(E),I);try{Oe.renameSync(D,M)}catch(z){throw z.code?new S.ErrnoError(lt.convertNodeCode(z)):z}d.name=I},unlink:function(d,E){var I=St.join2(lt.realPath(d),E);try{Oe.unlinkSync(I)}catch(D){throw D.code?new S.ErrnoError(lt.convertNodeCode(D)):D}},rmdir:function(d,E){var I=St.join2(lt.realPath(d),E);try{Oe.rmdirSync(I)}catch(D){throw D.code?new S.ErrnoError(lt.convertNodeCode(D)):D}},readdir:function(d){var E=lt.realPath(d);try{return Oe.readdirSync(E)}catch(I){throw I.code?new S.ErrnoError(lt.convertNodeCode(I)):I}},symlink:function(d,E,I){var D=St.join2(lt.realPath(d),E);try{Oe.symlinkSync(I,D)}catch(M){throw M.code?new S.ErrnoError(lt.convertNodeCode(M)):M}},readlink:function(d){var E=lt.realPath(d);try{return E=Oe.readlinkSync(E),E=Hu.relative(Hu.resolve(d.mount.opts.root),E),E}catch(I){throw I.code?new S.ErrnoError(lt.convertNodeCode(I)):I}}},stream_ops:{open:function(d){var E=lt.realPath(d.node);try{S.isFile(d.node.mode)&&(d.nfd=Oe.openSync(E,lt.flagsForNode(d.flags)))}catch(I){throw I.code?new S.ErrnoError(lt.convertNodeCode(I)):I}},close:function(d){try{S.isFile(d.node.mode)&&d.nfd&&Oe.closeSync(d.nfd)}catch(E){throw E.code?new S.ErrnoError(lt.convertNodeCode(E)):E}},read:function(d,E,I,D,M){if(D===0)return 0;try{return Oe.readSync(d.nfd,lt.bufferFrom(E.buffer),I,D,M)}catch(z){throw new S.ErrnoError(lt.convertNodeCode(z))}},write:function(d,E,I,D,M){try{return Oe.writeSync(d.nfd,lt.bufferFrom(E.buffer),I,D,M)}catch(z){throw new S.ErrnoError(lt.convertNodeCode(z))}},llseek:function(d,E,I){var D=E;if(I===1)D+=d.position;else if(I===2&&S.isFile(d.node.mode))try{var M=Oe.fstatSync(d.nfd);D+=M.size}catch(z){throw new S.ErrnoError(lt.convertNodeCode(z))}if(D<0)throw new S.ErrnoError(28);return D},mmap:function(d,E,I,D,M,z){if(E!==0)throw new S.ErrnoError(28);if(!S.isFile(d.node.mode))throw new S.ErrnoError(43);var ie=ds(I);return lt.stream_ops.read(d,pe,ie,I,D),{ptr:ie,allocated:!0}},msync:function(d,E,I,D,M){if(!S.isFile(d.node.mode))throw new S.ErrnoError(43);if(M&2)return 0;var z=lt.stream_ops.write(d,E,0,D,I,!1);return 0}}},mn={lookupPath:function(d){return{path:d,node:{mode:lt.getMode(d)}}},createStandardStreams:function(){S.streams[0]={fd:0,nfd:0,position:0,path:"",flags:0,tty:!0,seekable:!1};for(var d=1;d<3;d++)S.streams[d]={fd:d,nfd:d,position:0,path:"",flags:577,tty:!0,seekable:!1}},cwd:function(){return process.cwd()},chdir:function(){process.chdir.apply(void 0,arguments)},mknod:function(d,E){S.isDir(d)?Oe.mkdirSync(d,E):Oe.writeFileSync(d,"",{mode:E})},mkdir:function(){Oe.mkdirSync.apply(void 0,arguments)},symlink:function(){Oe.symlinkSync.apply(void 0,arguments)},rename:function(){Oe.renameSync.apply(void 0,arguments)},rmdir:function(){Oe.rmdirSync.apply(void 0,arguments)},readdir:function(){Oe.readdirSync.apply(void 0,arguments)},unlink:function(){Oe.unlinkSync.apply(void 0,arguments)},readlink:function(){return Oe.readlinkSync.apply(void 0,arguments)},stat:function(){return Oe.statSync.apply(void 0,arguments)},lstat:function(){return Oe.lstatSync.apply(void 0,arguments)},chmod:function(){Oe.chmodSync.apply(void 0,arguments)},fchmod:function(){Oe.fchmodSync.apply(void 0,arguments)},chown:function(){Oe.chownSync.apply(void 0,arguments)},fchown:function(){Oe.fchownSync.apply(void 0,arguments)},truncate:function(){Oe.truncateSync.apply(void 0,arguments)},ftruncate:function(d,E){if(E<0)throw new S.ErrnoError(28);Oe.ftruncateSync.apply(void 0,arguments)},utime:function(){Oe.utimesSync.apply(void 0,arguments)},open:function(d,E,I,D){typeof E=="string"&&(E=$s.modeStringToFlags(E));var M=Oe.openSync(d,lt.flagsForNode(E),I),z=D!=null?D:S.nextfd(M),ie={fd:z,nfd:M,position:0,path:d,flags:E,seekable:!0};return S.streams[z]=ie,ie},close:function(d){d.stream_ops||Oe.closeSync(d.nfd),S.closeStream(d.fd)},llseek:function(d,E,I){if(d.stream_ops)return $s.llseek(d,E,I);var D=E;if(I===1)D+=d.position;else if(I===2)D+=Oe.fstatSync(d.nfd).size;else if(I!==0)throw new S.ErrnoError(Po.EINVAL);if(D<0)throw new S.ErrnoError(Po.EINVAL);return d.position=D,D},read:function(d,E,I,D,M){if(d.stream_ops)return $s.read(d,E,I,D,M);var z=typeof M!="undefined";!z&&d.seekable&&(M=d.position);var ie=Oe.readSync(d.nfd,lt.bufferFrom(E.buffer),I,D,M);return z||(d.position+=ie),ie},write:function(d,E,I,D,M){if(d.stream_ops)return $s.write(d,E,I,D,M);d.flags&+"1024"&&S.llseek(d,0,+"2");var z=typeof M!="undefined";!z&&d.seekable&&(M=d.position);var ie=Oe.writeSync(d.nfd,lt.bufferFrom(E.buffer),I,D,M);return z||(d.position+=ie),ie},allocate:function(){throw new S.ErrnoError(Po.EOPNOTSUPP)},mmap:function(d,E,I,D,M,z){if(d.stream_ops)return $s.mmap(d,E,I,D,M,z);if(E!==0)throw new S.ErrnoError(28);var ie=ds(I);return S.read(d,pe,ie,I,D),{ptr:ie,allocated:!0}},msync:function(d,E,I,D,M){return d.stream_ops?$s.msync(d,E,I,D,M):(M&2||S.write(d,E,0,D,I),0)},munmap:function(){return 0},ioctl:function(){throw new S.ErrnoError(Po.ENOTTY)}},S={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,trackingDelegate:{},tracking:{openFlags:{READ:1,WRITE:2}},ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:function(d,E){if(d=Yn.resolve(S.cwd(),d),E=E||{},!d)return{path:"",node:null};var I={follow_mount:!0,recurse_count:0};for(var D in I)E[D]===void 0&&(E[D]=I[D]);if(E.recurse_count>8)throw new S.ErrnoError(32);for(var M=St.normalizeArray(d.split("/").filter(function(ut){return!!ut}),!1),z=S.root,ie="/",we=0;we40)throw new S.ErrnoError(32)}}return{path:ie,node:z}},getPath:function(d){for(var E;;){if(S.isRoot(d)){var I=d.mount.mountpoint;return E?I[I.length-1]!=="/"?I+"/"+E:I+E:I}E=E?d.name+"/"+E:d.name,d=d.parent}},hashName:function(d,E){for(var I=0,D=0;D>>0)%S.nameTable.length},hashAddNode:function(d){var E=S.hashName(d.parent.id,d.name);d.name_next=S.nameTable[E],S.nameTable[E]=d},hashRemoveNode:function(d){var E=S.hashName(d.parent.id,d.name);if(S.nameTable[E]===d)S.nameTable[E]=d.name_next;else for(var I=S.nameTable[E];I;){if(I.name_next===d){I.name_next=d.name_next;break}I=I.name_next}},lookupNode:function(d,E){var I=S.mayLookup(d);if(I)throw new S.ErrnoError(I,d);for(var D=S.hashName(d.id,E),M=S.nameTable[D];M;M=M.name_next){var z=M.name;if(M.parent.id===d.id&&z===E)return M}return S.lookup(d,E)},createNode:function(d,E,I,D){var M=new S.FSNode(d,E,I,D);return S.hashAddNode(M),M},destroyNode:function(d){S.hashRemoveNode(d)},isRoot:function(d){return d===d.parent},isMountpoint:function(d){return!!d.mounted},isFile:function(d){return(d&61440)==32768},isDir:function(d){return(d&61440)==16384},isLink:function(d){return(d&61440)==40960},isChrdev:function(d){return(d&61440)==8192},isBlkdev:function(d){return(d&61440)==24576},isFIFO:function(d){return(d&61440)==4096},isSocket:function(d){return(d&49152)==49152},flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:function(d){var E=S.flagModes[d];if(typeof E=="undefined")throw new Error("Unknown file open mode: "+d);return E},flagsToPermissionString:function(d){var E=["r","w","rw"][d&3];return d&512&&(E+="w"),E},nodePermissions:function(d,E){return S.ignorePermissions?0:E.includes("r")&&!(d.mode&292)||E.includes("w")&&!(d.mode&146)||E.includes("x")&&!(d.mode&73)?2:0},mayLookup:function(d){var E=S.nodePermissions(d,"x");return E||(d.node_ops.lookup?0:2)},mayCreate:function(d,E){try{var I=S.lookupNode(d,E);return 20}catch(D){}return S.nodePermissions(d,"wx")},mayDelete:function(d,E,I){var D;try{D=S.lookupNode(d,E)}catch(z){return z.errno}var M=S.nodePermissions(d,"wx");if(M)return M;if(I){if(!S.isDir(D.mode))return 54;if(S.isRoot(D)||S.getPath(D)===S.cwd())return 10}else if(S.isDir(D.mode))return 31;return 0},mayOpen:function(d,E){return d?S.isLink(d.mode)?32:S.isDir(d.mode)&&(S.flagsToPermissionString(E)!=="r"||E&512)?31:S.nodePermissions(d,S.flagsToPermissionString(E)):44},MAX_OPEN_FDS:4096,nextfd:function(d,E){d=d||0,E=E||S.MAX_OPEN_FDS;for(var I=d;I<=E;I++)if(!S.streams[I])return I;throw new S.ErrnoError(33)},getStream:function(d){return S.streams[d]},createStream:function(d,E,I){S.FSStream||(S.FSStream=function(){},S.FSStream.prototype={object:{get:function(){return this.node},set:function(ie){this.node=ie}},isRead:{get:function(){return(this.flags&2097155)!=1}},isWrite:{get:function(){return(this.flags&2097155)!=0}},isAppend:{get:function(){return this.flags&1024}}});var D=new S.FSStream;for(var M in d)D[M]=d[M];d=D;var z=S.nextfd(E,I);return d.fd=z,S.streams[z]=d,d},closeStream:function(d){S.streams[d]=null},chrdev_stream_ops:{open:function(d){var E=S.getDevice(d.node.rdev);d.stream_ops=E.stream_ops,d.stream_ops.open&&d.stream_ops.open(d)},llseek:function(){throw new S.ErrnoError(70)}},major:function(d){return d>>8},minor:function(d){return d&255},makedev:function(d,E){return d<<8|E},registerDevice:function(d,E){S.devices[d]={stream_ops:E}},getDevice:function(d){return S.devices[d]},getMounts:function(d){for(var E=[],I=[d];I.length;){var D=I.pop();E.push(D),I.push.apply(I,D.mounts)}return E},syncfs:function(d,E){typeof d=="function"&&(E=d,d=!1),S.syncFSRequests++,S.syncFSRequests>1&&x("warning: "+S.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var I=S.getMounts(S.root.mount),D=0;function M(ie){return S.syncFSRequests--,E(ie)}function z(ie){if(ie)return z.errored?void 0:(z.errored=!0,M(ie));++D>=I.length&&M(null)}I.forEach(function(ie){if(!ie.type.syncfs)return z(null);ie.type.syncfs(ie,d,z)})},mount:function(d,E,I){var D=I==="/",M=!I,z;if(D&&S.root)throw new S.ErrnoError(10);if(!D&&!M){var ie=S.lookupPath(I,{follow_mount:!1});if(I=ie.path,z=ie.node,S.isMountpoint(z))throw new S.ErrnoError(10);if(!S.isDir(z.mode))throw new S.ErrnoError(54)}var we={type:d,opts:E,mountpoint:I,mounts:[]},me=d.mount(we);return me.mount=we,we.root=me,D?S.root=me:z&&(z.mounted=we,z.mount&&z.mount.mounts.push(we)),me},unmount:function(d){var E=S.lookupPath(d,{follow_mount:!1});if(!S.isMountpoint(E.node))throw new S.ErrnoError(28);var I=E.node,D=I.mounted,M=S.getMounts(D);Object.keys(S.nameTable).forEach(function(ie){for(var we=S.nameTable[ie];we;){var me=we.name_next;M.includes(we.mount)&&S.destroyNode(we),we=me}}),I.mounted=null;var z=I.mount.mounts.indexOf(D);I.mount.mounts.splice(z,1)},lookup:function(d,E){return d.node_ops.lookup(d,E)},mknod:function(d,E,I){var D=S.lookupPath(d,{parent:!0}),M=D.node,z=St.basename(d);if(!z||z==="."||z==="..")throw new S.ErrnoError(28);var ie=S.mayCreate(M,z);if(ie)throw new S.ErrnoError(ie);if(!M.node_ops.mknod)throw new S.ErrnoError(63);return M.node_ops.mknod(M,z,E,I)},create:function(d,E){return E=E!==void 0?E:438,E&=4095,E|=32768,S.mknod(d,E,0)},mkdir:function(d,E){return E=E!==void 0?E:511,E&=511|512,E|=16384,S.mknod(d,E,0)},mkdirTree:function(d,E){for(var I=d.split("/"),D="",M=0;Mthis.length-1||ut<0)){var st=ut%this.chunkSize,yt=ut/this.chunkSize|0;return this.getter(yt)[st]}},z.prototype.setDataGetter=function(ut){this.getter=ut},z.prototype.cacheLength=function(){var ut=new XMLHttpRequest;if(ut.open("HEAD",I,!1),ut.send(null),!(ut.status>=200&&ut.status<300||ut.status===304))throw new Error("Couldn't load "+I+". Status: "+ut.status);var st=Number(ut.getResponseHeader("Content-length")),yt,xe=(yt=ut.getResponseHeader("Accept-Ranges"))&&yt==="bytes",Wn=(yt=ut.getResponseHeader("Content-Encoding"))&&yt==="gzip",Mi=1024*1024;xe||(Mi=st);var HA=function(Cs,Pa){if(Cs>Pa)throw new Error("invalid range ("+Cs+", "+Pa+") or no bytes requested!");if(Pa>st-1)throw new Error("only "+st+" bytes available! programmer error!");var qr=new XMLHttpRequest;if(qr.open("GET",I,!1),st!==Mi&&qr.setRequestHeader("Range","bytes="+Cs+"-"+Pa),typeof Uint8Array!="undefined"&&(qr.responseType="arraybuffer"),qr.overrideMimeType&&qr.overrideMimeType("text/plain; charset=x-user-defined"),qr.send(null),!(qr.status>=200&&qr.status<300||qr.status===304))throw new Error("Couldn't load "+I+". Status: "+qr.status);return qr.response!==void 0?new Uint8Array(qr.response||[]):TA(qr.responseText||"",!0)},Yr=this;Yr.setDataGetter(function(Cs){var Pa=Cs*Mi,qr=(Cs+1)*Mi-1;if(qr=Math.min(qr,st-1),typeof Yr.chunks[Cs]=="undefined"&&(Yr.chunks[Cs]=HA(Pa,qr)),typeof Yr.chunks[Cs]=="undefined")throw new Error("doXHR failed!");return Yr.chunks[Cs]}),(Wn||!st)&&(Mi=st=1,st=this.getter(0).length,Mi=st,v("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=st,this._chunkSize=Mi,this.lengthKnown=!0},typeof XMLHttpRequest!="undefined"){if(!u)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var ie=new z;Object.defineProperties(ie,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var we={isDevice:!1,contents:ie}}else var we={isDevice:!1,url:I};var me=S.createFile(d,E,we,D,M);we.contents?me.contents=we.contents:we.url&&(me.contents=null,me.url=we.url),Object.defineProperties(me,{usedBytes:{get:function(){return this.contents.length}}});var _e={},ot=Object.keys(me.stream_ops);return ot.forEach(function(Bt){var ut=me.stream_ops[Bt];_e[Bt]=function(){return S.forceLoadFile(me),ut.apply(null,arguments)}}),_e.read=function(ut,st,yt,xe,Wn){S.forceLoadFile(me);var Mi=ut.node.contents;if(Wn>=Mi.length)return 0;var HA=Math.min(Mi.length-Wn,xe);if(Mi.slice)for(var Yr=0;Yr>2]=D.dev,fe[I+4>>2]=0,fe[I+8>>2]=D.ino,fe[I+12>>2]=D.mode,fe[I+16>>2]=D.nlink,fe[I+20>>2]=D.uid,fe[I+24>>2]=D.gid,fe[I+28>>2]=D.rdev,fe[I+32>>2]=0,Ae=[D.size>>>0,(Dr=D.size,+Math.abs(Dr)>=1?Dr>0?(Math.min(+Math.floor(Dr/4294967296),4294967295)|0)>>>0:~~+Math.ceil((Dr-+(~~Dr>>>0))/4294967296)>>>0:0)],fe[I+40>>2]=Ae[0],fe[I+44>>2]=Ae[1],fe[I+48>>2]=4096,fe[I+52>>2]=D.blocks,fe[I+56>>2]=D.atime.getTime()/1e3|0,fe[I+60>>2]=0,fe[I+64>>2]=D.mtime.getTime()/1e3|0,fe[I+68>>2]=0,fe[I+72>>2]=D.ctime.getTime()/1e3|0,fe[I+76>>2]=0,Ae=[D.ino>>>0,(Dr=D.ino,+Math.abs(Dr)>=1?Dr>0?(Math.min(+Math.floor(Dr/4294967296),4294967295)|0)>>>0:~~+Math.ceil((Dr-+(~~Dr>>>0))/4294967296)>>>0:0)],fe[I+80>>2]=Ae[0],fe[I+84>>2]=Ae[1],0},doMsync:function(d,E,I,D,M){var z=V.slice(d,d+I);S.msync(E,z,M,I,D)},doMkdir:function(d,E){return d=St.normalize(d),d[d.length-1]==="/"&&(d=d.substr(0,d.length-1)),S.mkdir(d,E,0),0},doMknod:function(d,E,I){switch(E&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}return S.mknod(d,E,I),0},doReadlink:function(d,E,I){if(I<=0)return-28;var D=S.readlink(d),M=Math.min(I,he(D)),z=pe[E+M];return be(D,E,I+1),pe[E+M]=z,M},doAccess:function(d,E){if(E&~7)return-28;var I,D=S.lookupPath(d,{follow:!0});if(I=D.node,!I)return-44;var M="";return E&4&&(M+="r"),E&2&&(M+="w"),E&1&&(M+="x"),M&&S.nodePermissions(I,M)?-2:0},doDup:function(d,E,I){var D=S.getStream(I);return D&&S.close(D),S.open(d,E,0,I,I).fd},doReadv:function(d,E,I,D){for(var M=0,z=0;z>2],we=fe[E+(z*8+4)>>2],me=S.read(d,pe,ie,we,D);if(me<0)return-1;if(M+=me,me>2],we=fe[E+(z*8+4)>>2],me=S.write(d,pe,ie,we,D);if(me<0)return-1;M+=me}return M},varargs:void 0,get:function(){Tt.varargs+=4;var d=fe[Tt.varargs-4>>2];return d},getStr:function(d){var E=re(d);return E},getStreamFromFD:function(d){var E=S.getStream(d);if(!E)throw new S.ErrnoError(8);return E},get64:function(d,E){return d}};function Ku(d,E){try{return d=Tt.getStr(d),S.chmod(d,E),0}catch(I){return(typeof S=="undefined"||!(I instanceof S.ErrnoError))&&vr(I),-I.errno}}function Vl(d){return fe[Rt()>>2]=d,d}function xh(d,E,I){Tt.varargs=I;try{var D=Tt.getStreamFromFD(d);switch(E){case 0:{var M=Tt.get();if(M<0)return-28;var z;return z=S.open(D.path,D.flags,0,M),z.fd}case 1:case 2:return 0;case 3:return D.flags;case 4:{var M=Tt.get();return D.flags|=M,0}case 12:{var M=Tt.get(),ie=0;return Qe[M+ie>>1]=2,0}case 13:case 14:return 0;case 16:case 8:return-28;case 9:return Vl(28),-1;default:return-28}}catch(we){return(typeof S=="undefined"||!(we instanceof S.ErrnoError))&&vr(we),-we.errno}}function kh(d,E){try{var I=Tt.getStreamFromFD(d);return Tt.doStat(S.stat,I.path,E)}catch(D){return(typeof S=="undefined"||!(D instanceof S.ErrnoError))&&vr(D),-D.errno}}function Ph(d,E,I){Tt.varargs=I;try{var D=Tt.getStreamFromFD(d);switch(E){case 21509:case 21505:return D.tty?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return D.tty?0:-59;case 21519:{if(!D.tty)return-59;var M=Tt.get();return fe[M>>2]=0,0}case 21520:return D.tty?-28:-59;case 21531:{var M=Tt.get();return S.ioctl(D,E,M)}case 21523:return D.tty?0:-59;case 21524:return D.tty?0:-59;default:vr("bad ioctl syscall "+E)}}catch(z){return(typeof S=="undefined"||!(z instanceof S.ErrnoError))&&vr(z),-z.errno}}function Dh(d,E,I){Tt.varargs=I;try{var D=Tt.getStr(d),M=I?Tt.get():0,z=S.open(D,E,M);return z.fd}catch(ie){return(typeof S=="undefined"||!(ie instanceof S.ErrnoError))&&vr(ie),-ie.errno}}function Rh(d,E){try{return d=Tt.getStr(d),E=Tt.getStr(E),S.rename(d,E),0}catch(I){return(typeof S=="undefined"||!(I instanceof S.ErrnoError))&&vr(I),-I.errno}}function j(d){try{return d=Tt.getStr(d),S.rmdir(d),0}catch(E){return(typeof S=="undefined"||!(E instanceof S.ErrnoError))&&vr(E),-E.errno}}function wt(d,E){try{return d=Tt.getStr(d),Tt.doStat(S.stat,d,E)}catch(I){return(typeof S=="undefined"||!(I instanceof S.ErrnoError))&&vr(I),-I.errno}}function LA(d){try{return d=Tt.getStr(d),S.unlink(d),0}catch(E){return(typeof S=="undefined"||!(E instanceof S.ErrnoError))&&vr(E),-E.errno}}function $i(d,E,I){V.copyWithin(d,E,E+I)}function Xl(d){try{return A.grow(d-ve.byteLength+65535>>>16),Ei(A.buffer),1}catch(E){}}function $e(d){var E=V.length;d=d>>>0;var I=2147483648;if(d>I)return!1;for(var D=1;D<=4;D*=2){var M=E*(1+.2/D);M=Math.min(M,d+100663296);var z=Math.min(I,ke(Math.max(d,M),65536)),ie=Xl(z);if(ie)return!0}return!1}function Sa(d){try{var E=Tt.getStreamFromFD(d);return S.close(E),0}catch(I){return(typeof S=="undefined"||!(I instanceof S.ErrnoError))&&vr(I),I.errno}}function Uu(d,E){try{var I=Tt.getStreamFromFD(d),D=I.tty?2:S.isDir(I.mode)?3:S.isLink(I.mode)?7:4;return pe[E>>0]=D,0}catch(M){return(typeof S=="undefined"||!(M instanceof S.ErrnoError))&&vr(M),M.errno}}function yE(d,E,I,D){try{var M=Tt.getStreamFromFD(d),z=Tt.doReadv(M,E,I);return fe[D>>2]=z,0}catch(ie){return(typeof S=="undefined"||!(ie instanceof S.ErrnoError))&&vr(ie),ie.errno}}function Fh(d,E,I,D,M){try{var z=Tt.getStreamFromFD(d),ie=4294967296,we=I*ie+(E>>>0),me=9007199254740992;return we<=-me||we>=me?-61:(S.llseek(z,we,D),Ae=[z.position>>>0,(Dr=z.position,+Math.abs(Dr)>=1?Dr>0?(Math.min(+Math.floor(Dr/4294967296),4294967295)|0)>>>0:~~+Math.ceil((Dr-+(~~Dr>>>0))/4294967296)>>>0:0)],fe[M>>2]=Ae[0],fe[M+4>>2]=Ae[1],z.getdents&&we===0&&D===0&&(z.getdents=null),0)}catch(_e){return(typeof S=="undefined"||!(_e instanceof S.ErrnoError))&&vr(_e),_e.errno}}function wE(d,E,I,D){try{var M=Tt.getStreamFromFD(d),z=Tt.doWritev(M,E,I);return fe[D>>2]=z,0}catch(ie){return(typeof S=="undefined"||!(ie instanceof S.ErrnoError))&&vr(ie),ie.errno}}function gr(d){$(d)}function qn(d){var E=Date.now()/1e3|0;return d&&(fe[d>>2]=E),E}function Zl(){if(Zl.called)return;Zl.called=!0;var d=new Date().getFullYear(),E=new Date(d,0,1),I=new Date(d,6,1),D=E.getTimezoneOffset(),M=I.getTimezoneOffset(),z=Math.max(D,M);fe[zb()>>2]=z*60,fe[Wb()>>2]=Number(D!=M);function ie(Bt){var ut=Bt.toTimeString().match(/\(([A-Za-z ]+)\)$/);return ut?ut[1]:"GMT"}var we=ie(E),me=ie(I),_e=Fe(we),ot=Fe(me);M>2]=_e,fe[Wu()+4>>2]=ot):(fe[Wu()>>2]=ot,fe[Wu()+4>>2]=_e)}function Nh(d){Zl();var E=Date.UTC(fe[d+20>>2]+1900,fe[d+16>>2],fe[d+12>>2],fe[d+8>>2],fe[d+4>>2],fe[d>>2],0),I=new Date(E);fe[d+24>>2]=I.getUTCDay();var D=Date.UTC(I.getUTCFullYear(),0,1,0,0,0,0),M=(I.getTime()-D)/(1e3*60*60*24)|0;return fe[d+28>>2]=M,I.getTime()/1e3|0}var Zs=function(d,E,I,D){d||(d=this),this.parent=d,this.mount=d.mount,this.mounted=null,this.id=S.nextInode++,this.name=E,this.mode=I,this.node_ops={},this.stream_ops={},this.rdev=D},va=292|73,En=146;if(Object.defineProperties(Zs.prototype,{read:{get:function(){return(this.mode&va)===va},set:function(d){d?this.mode|=va:this.mode&=~va}},write:{get:function(){return(this.mode&En)===En},set:function(d){d?this.mode|=En:this.mode&=~En}},isFolder:{get:function(){return S.isDir(this.mode)}},isDevice:{get:function(){return S.isChrdev(this.mode)}}}),S.FSNode=Zs,S.staticInit(),g){var Oe=v5,Hu=require("path");lt.staticInit()}if(g){var $l=function(d){return function(){try{return d.apply(this,arguments)}catch(E){throw E.code?new S.ErrnoError(Po[E.code]):E}}},$s=Object.assign({},S);for(var ec in mn)S[ec]=$l(mn[ec])}else throw new Error("NODERAWFS is currently only supported on Node.js environment.");function TA(d,E,I){var D=I>0?I:he(d)+1,M=new Array(D),z=se(d,M,0,M.length);return E&&(M.length=z),M}var ju=typeof atob=="function"?atob:function(d){var E="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",I="",D,M,z,ie,we,me,_e,ot=0;d=d.replace(/[^A-Za-z0-9\+\/\=]/g,"");do ie=E.indexOf(d.charAt(ot++)),we=E.indexOf(d.charAt(ot++)),me=E.indexOf(d.charAt(ot++)),_e=E.indexOf(d.charAt(ot++)),D=ie<<2|we>>4,M=(we&15)<<4|me>>2,z=(me&3)<<6|_e,I=I+String.fromCharCode(D),me!==64&&(I=I+String.fromCharCode(M)),_e!==64&&(I=I+String.fromCharCode(z));while(ot0||(Sr(),hs>0))return;function E(){Ue||(Ue=!0,t.calledRun=!0,!oe&&(jn(),i(t),t.onRuntimeInitialized&&t.onRuntimeInitialized(),fs()))}t.setStatus?(t.setStatus("Running..."),setTimeout(function(){setTimeout(function(){t.setStatus("")},1),E()},1)):E()}if(t.run=UA,t.preInit)for(typeof t.preInit=="function"&&(t.preInit=[t.preInit]);t.preInit.length>0;)t.preInit.pop()();return UA(),e}}();typeof Gw=="object"&&typeof jP=="object"?jP.exports=GP:typeof define=="function"&&define.amd?define([],function(){return GP}):typeof Gw=="object"&&(Gw.createModule=GP)});var $5=w((Nst,Z5)=>{function KPe(r,e){for(var t=-1,i=r==null?0:r.length,n=Array(i);++t{var UPe=Array.isArray;e9.exports=UPe});var o9=w((Tst,t9)=>{var r9=Jc(),HPe=$5(),jPe=Ks(),GPe=Id(),YPe=1/0,i9=r9?r9.prototype:void 0,n9=i9?i9.toString:void 0;function s9(r){if(typeof r=="string")return r;if(jPe(r))return HPe(r,s9)+"";if(GPe(r))return n9?n9.call(r):"";var e=r+"";return e=="0"&&1/r==-YPe?"-0":e}t9.exports=s9});var lf=w((Ost,a9)=>{var qPe=o9();function JPe(r){return r==null?"":qPe(r)}a9.exports=JPe});var VP=w((Mst,A9)=>{function WPe(r,e,t){var i=-1,n=r.length;e<0&&(e=-e>n?0:n+e),t=t>n?n:t,t<0&&(t+=n),n=e>t?0:t-e>>>0,e>>>=0;for(var s=Array(n);++i{var zPe=VP();function _Pe(r,e,t){var i=r.length;return t=t===void 0?i:t,!e&&t>=i?r:zPe(r,e,t)}l9.exports=_Pe});var XP=w((Ust,u9)=>{var VPe="\\ud800-\\udfff",XPe="\\u0300-\\u036f",ZPe="\\ufe20-\\ufe2f",$Pe="\\u20d0-\\u20ff",eDe=XPe+ZPe+$Pe,tDe="\\ufe0e\\ufe0f",rDe="\\u200d",iDe=RegExp("["+rDe+VPe+eDe+tDe+"]");function nDe(r){return iDe.test(r)}u9.exports=nDe});var f9=w((Hst,g9)=>{function sDe(r){return r.split("")}g9.exports=sDe});var y9=w((jst,h9)=>{var p9="\\ud800-\\udfff",oDe="\\u0300-\\u036f",aDe="\\ufe20-\\ufe2f",ADe="\\u20d0-\\u20ff",lDe=oDe+aDe+ADe,cDe="\\ufe0e\\ufe0f",uDe="["+p9+"]",ZP="["+lDe+"]",$P="\\ud83c[\\udffb-\\udfff]",gDe="(?:"+ZP+"|"+$P+")",d9="[^"+p9+"]",C9="(?:\\ud83c[\\udde6-\\uddff]){2}",m9="[\\ud800-\\udbff][\\udc00-\\udfff]",fDe="\\u200d",E9=gDe+"?",I9="["+cDe+"]?",hDe="(?:"+fDe+"(?:"+[d9,C9,m9].join("|")+")"+I9+E9+")*",pDe=I9+E9+hDe,dDe="(?:"+[d9+ZP+"?",ZP,C9,m9,uDe].join("|")+")",CDe=RegExp($P+"(?="+$P+")|"+dDe+pDe,"g");function mDe(r){return r.match(CDe)||[]}h9.exports=mDe});var B9=w((Gst,w9)=>{var EDe=f9(),IDe=XP(),yDe=y9();function wDe(r){return IDe(r)?yDe(r):EDe(r)}w9.exports=wDe});var Q9=w((Yst,b9)=>{var BDe=c9(),bDe=XP(),QDe=B9(),SDe=lf();function vDe(r){return function(e){e=SDe(e);var t=bDe(e)?QDe(e):void 0,i=t?t[0]:e.charAt(0),n=t?BDe(t,1).join(""):e.slice(1);return i[r]()+n}}b9.exports=vDe});var v9=w((qst,S9)=>{var xDe=Q9(),kDe=xDe("toUpperCase");S9.exports=kDe});var Zw=w((Jst,x9)=>{var PDe=lf(),DDe=v9();function RDe(r){return DDe(PDe(r).toLowerCase())}x9.exports=RDe});var k9=w((Wst,$w)=>{function FDe(){var r=0,e=1,t=2,i=3,n=4,s=5,o=6,a=7,l=8,c=9,u=10,g=11,f=12,h=13,p=14,m=15,y=16,b=17,v=0,x=1,T=2,q=3,Y=4;function $(A,oe){return 55296<=A.charCodeAt(oe)&&A.charCodeAt(oe)<=56319&&56320<=A.charCodeAt(oe+1)&&A.charCodeAt(oe+1)<=57343}function _(A,oe){oe===void 0&&(oe=0);var ce=A.charCodeAt(oe);if(55296<=ce&&ce<=56319&&oe=1){var Z=A.charCodeAt(oe-1),O=ce;return 55296<=Z&&Z<=56319?(Z-55296)*1024+(O-56320)+65536:O}return ce}function ne(A,oe,ce){var Z=[A].concat(oe).concat([ce]),O=Z[Z.length-2],L=ce,de=Z.lastIndexOf(p);if(de>1&&Z.slice(1,de).every(function(re){return re==i})&&[i,h,b].indexOf(A)==-1)return T;var Be=Z.lastIndexOf(n);if(Be>0&&Z.slice(1,Be).every(function(re){return re==n})&&[f,n].indexOf(O)==-1)return Z.filter(function(re){return re==n}).length%2==1?q:Y;if(O==r&&L==e)return v;if(O==t||O==r||O==e)return L==p&&oe.every(function(re){return re==i})?T:x;if(L==t||L==r||L==e)return x;if(O==o&&(L==o||L==a||L==c||L==u))return v;if((O==c||O==a)&&(L==a||L==l))return v;if((O==u||O==l)&&L==l)return v;if(L==i||L==m)return v;if(L==s)return v;if(O==f)return v;var je=Z.indexOf(i)!=-1?Z.lastIndexOf(i)-1:Z.length-2;return[h,b].indexOf(Z[je])!=-1&&Z.slice(je+1,-1).every(function(re){return re==i})&&L==p||O==m&&[y,b].indexOf(L)!=-1?v:oe.indexOf(n)!=-1?T:O==n&&L==n?v:x}this.nextBreak=function(A,oe){if(oe===void 0&&(oe=0),oe<0)return 0;if(oe>=A.length-1)return A.length;for(var ce=ee(_(A,oe)),Z=[],O=oe+1;O{var NDe=/^(.*?)(\x1b\[[^m]+m|\x1b\]8;;.*?(\x1b\\|\u0007))/,eB;function LDe(){if(eB)return eB;if(typeof Intl.Segmenter!="undefined"){let r=new Intl.Segmenter("en",{granularity:"grapheme"});return eB=e=>Array.from(r.segment(e),({segment:t})=>t)}else{let r=k9(),e=new r;return eB=t=>e.splitGraphemes(t)}}P9.exports=(r,e=0,t=r.length)=>{if(e<0||t<0)throw new RangeError("Negative indices aren't supported by this implementation");let i=t-e,n="",s=0,o=0;for(;r.length>0;){let a=r.match(NDe)||[r,r,void 0],l=LDe()(a[1]),c=Math.min(e-s,l.length);l=l.slice(c);let u=Math.min(i-o,l.length);n+=l.slice(0,u).join(""),s+=c,o+=u,typeof a[2]!="undefined"&&(n+=a[2]),r=r.slice(a[0].length)}return n}});var cf=w((Bot,q9)=>{"use strict";var J9=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"]]),wot=q9.exports=r=>r?Object.keys(r).map(e=>[J9.has(e)?J9.get(e):e,r[e]]).reduce((e,t)=>(e[t[0]]=t[1],e),Object.create(null)):{}});var uf=w((bot,W9)=>{"use strict";var zDe=require("events"),z9=require("stream"),qd=Bp(),_9=require("string_decoder").StringDecoder,lA=Symbol("EOF"),Jd=Symbol("maybeEmitEnd"),Il=Symbol("emittedEnd"),oB=Symbol("emittingEnd"),aB=Symbol("closed"),V9=Symbol("read"),iD=Symbol("flush"),X9=Symbol("flushChunk"),Nn=Symbol("encoding"),cA=Symbol("decoder"),AB=Symbol("flowing"),Wd=Symbol("paused"),zd=Symbol("resume"),pn=Symbol("bufferLength"),Z9=Symbol("bufferPush"),nD=Symbol("bufferShift"),_i=Symbol("objectMode"),Vi=Symbol("destroyed"),$9=global._MP_NO_ITERATOR_SYMBOLS_!=="1",_De=$9&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),VDe=$9&&Symbol.iterator||Symbol("iterator not implemented"),e_=r=>r==="end"||r==="finish"||r==="prefinish",XDe=r=>r instanceof ArrayBuffer||typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,ZDe=r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r);W9.exports=class t_ extends z9{constructor(e){super();this[AB]=!1,this[Wd]=!1,this.pipes=new qd,this.buffer=new qd,this[_i]=e&&e.objectMode||!1,this[_i]?this[Nn]=null:this[Nn]=e&&e.encoding||null,this[Nn]==="buffer"&&(this[Nn]=null),this[cA]=this[Nn]?new _9(this[Nn]):null,this[lA]=!1,this[Il]=!1,this[oB]=!1,this[aB]=!1,this.writable=!0,this.readable=!0,this[pn]=0,this[Vi]=!1}get bufferLength(){return this[pn]}get encoding(){return this[Nn]}set encoding(e){if(this[_i])throw new Error("cannot set encoding in objectMode");if(this[Nn]&&e!==this[Nn]&&(this[cA]&&this[cA].lastNeed||this[pn]))throw new Error("cannot change encoding");this[Nn]!==e&&(this[cA]=e?new _9(e):null,this.buffer.length&&(this.buffer=this.buffer.map(t=>this[cA].write(t)))),this[Nn]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[_i]}set objectMode(e){this[_i]=this[_i]||!!e}write(e,t,i){if(this[lA])throw new Error("write after end");return this[Vi]?(this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0):(typeof t=="function"&&(i=t,t="utf8"),t||(t="utf8"),!this[_i]&&!Buffer.isBuffer(e)&&(ZDe(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):XDe(e)?e=Buffer.from(e):typeof e!="string"&&(this.objectMode=!0)),!this.objectMode&&!e.length?(this[pn]!==0&&this.emit("readable"),i&&i(),this.flowing):(typeof e=="string"&&!this[_i]&&!(t===this[Nn]&&!this[cA].lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[Nn]&&(e=this[cA].write(e)),this.flowing?(this[pn]!==0&&this[iD](!0),this.emit("data",e)):this[Z9](e),this[pn]!==0&&this.emit("readable"),i&&i(),this.flowing))}read(e){if(this[Vi])return null;try{return this[pn]===0||e===0||e>this[pn]?null:(this[_i]&&(e=null),this.buffer.length>1&&!this[_i]&&(this.encoding?this.buffer=new qd([Array.from(this.buffer).join("")]):this.buffer=new qd([Buffer.concat(Array.from(this.buffer),this[pn])])),this[V9](e||null,this.buffer.head.value))}finally{this[Jd]()}}[V9](e,t){return e===t.length||e===null?this[nD]():(this.buffer.head.value=t.slice(e),t=t.slice(0,e),this[pn]-=e),this.emit("data",t),!this.buffer.length&&!this[lA]&&this.emit("drain"),t}end(e,t,i){return typeof e=="function"&&(i=e,e=null),typeof t=="function"&&(i=t,t="utf8"),e&&this.write(e,t),i&&this.once("end",i),this[lA]=!0,this.writable=!1,(this.flowing||!this[Wd])&&this[Jd](),this}[zd](){this[Vi]||(this[Wd]=!1,this[AB]=!0,this.emit("resume"),this.buffer.length?this[iD]():this[lA]?this[Jd]():this.emit("drain"))}resume(){return this[zd]()}pause(){this[AB]=!1,this[Wd]=!0}get destroyed(){return this[Vi]}get flowing(){return this[AB]}get paused(){return this[Wd]}[Z9](e){return this[_i]?this[pn]+=1:this[pn]+=e.length,this.buffer.push(e)}[nD](){return this.buffer.length&&(this[_i]?this[pn]-=1:this[pn]-=this.buffer.head.value.length),this.buffer.shift()}[iD](e){do;while(this[X9](this[nD]()));!e&&!this.buffer.length&&!this[lA]&&this.emit("drain")}[X9](e){return e?(this.emit("data",e),this.flowing):!1}pipe(e,t){if(this[Vi])return;let i=this[Il];t=t||{},e===process.stdout||e===process.stderr?t.end=!1:t.end=t.end!==!1;let n={dest:e,opts:t,ondrain:s=>this[zd]()};return this.pipes.push(n),e.on("drain",n.ondrain),this[zd](),i&&n.opts.end&&n.dest.end(),e}addListener(e,t){return this.on(e,t)}on(e,t){try{return super.on(e,t)}finally{e==="data"&&!this.pipes.length&&!this.flowing?this[zd]():e_(e)&&this[Il]&&(super.emit(e),this.removeAllListeners(e))}}get emittedEnd(){return this[Il]}[Jd](){!this[oB]&&!this[Il]&&!this[Vi]&&this.buffer.length===0&&this[lA]&&(this[oB]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[aB]&&this.emit("close"),this[oB]=!1)}emit(e,t){if(e!=="error"&&e!=="close"&&e!==Vi&&this[Vi])return;if(e==="data"){if(!t)return;this.pipes.length&&this.pipes.forEach(n=>n.dest.write(t)===!1&&this.pause())}else if(e==="end"){if(this[Il]===!0)return;this[Il]=!0,this.readable=!1,this[cA]&&(t=this[cA].end(),t&&(this.pipes.forEach(n=>n.dest.write(t)),super.emit("data",t))),this.pipes.forEach(n=>{n.dest.removeListener("drain",n.ondrain),n.opts.end&&n.dest.end()})}else if(e==="close"&&(this[aB]=!0,!this[Il]&&!this[Vi]))return;let i=new Array(arguments.length);if(i[0]=e,i[1]=t,arguments.length>2)for(let n=2;n{e.push(i),this[_i]||(e.dataLength+=i.length)}),t.then(()=>e)}concat(){return this[_i]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(e=>this[_i]?Promise.reject(new Error("cannot concat in objectMode")):this[Nn]?e.join(""):Buffer.concat(e,e.dataLength))}promise(){return new Promise((e,t)=>{this.on(Vi,()=>t(new Error("stream destroyed"))),this.on("end",()=>e()),this.on("error",i=>t(i))})}[_De](){return{next:()=>{let t=this.read();if(t!==null)return Promise.resolve({done:!1,value:t});if(this[lA])return Promise.resolve({done:!0});let i=null,n=null,s=c=>{this.removeListener("data",o),this.removeListener("end",a),n(c)},o=c=>{this.removeListener("error",s),this.removeListener("end",a),this.pause(),i({value:c,done:!!this[lA]})},a=()=>{this.removeListener("error",s),this.removeListener("data",o),i({done:!0})},l=()=>s(new Error("stream destroyed"));return new Promise((c,u)=>{n=u,i=c,this.once(Vi,l),this.once("error",s),this.once("end",a),this.once("data",o)})}}}[VDe](){return{next:()=>{let t=this.read();return{value:t,done:t===null}}}}destroy(e){return this[Vi]?(e?this.emit("error",e):this.emit(Vi),this):(this[Vi]=!0,this.buffer=new qd,this[pn]=0,typeof this.close=="function"&&!this[aB]&&this.close(),e?this.emit("error",e):this.emit(Vi),this)}static isStream(e){return!!e&&(e instanceof t_||e instanceof z9||e instanceof zDe&&(typeof e.pipe=="function"||typeof e.write=="function"&&typeof e.end=="function"))}}});var i_=w((Qot,r_)=>{var $De=require("zlib").constants||{ZLIB_VERNUM:4736};r_.exports=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:Infinity,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},$De))});var fD=w(as=>{"use strict";var sD=require("assert"),yl=require("buffer").Buffer,n_=require("zlib"),Zc=as.constants=i_(),eRe=uf(),s_=yl.concat,$c=Symbol("_superWrite"),_d=class extends Error{constructor(e){super("zlib: "+e.message);this.code=e.code,this.errno=e.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+e.message,Error.captureStackTrace(this,this.constructor)}get name(){return"ZlibError"}},tRe=Symbol("opts"),Vd=Symbol("flushFlag"),o_=Symbol("finishFlushFlag"),oD=Symbol("fullFlushFlag"),pr=Symbol("handle"),lB=Symbol("onError"),gf=Symbol("sawError"),aD=Symbol("level"),AD=Symbol("strategy"),lD=Symbol("ended"),Sot=Symbol("_defaultFullFlush"),cD=class extends eRe{constructor(e,t){if(!e||typeof e!="object")throw new TypeError("invalid options for ZlibBase constructor");super(e);this[gf]=!1,this[lD]=!1,this[tRe]=e,this[Vd]=e.flush,this[o_]=e.finishFlush;try{this[pr]=new n_[t](e)}catch(i){throw new _d(i)}this[lB]=i=>{this[gf]||(this[gf]=!0,this.close(),this.emit("error",i))},this[pr].on("error",i=>this[lB](new _d(i))),this.once("end",()=>this.close)}close(){this[pr]&&(this[pr].close(),this[pr]=null,this.emit("close"))}reset(){if(!this[gf])return sD(this[pr],"zlib binding closed"),this[pr].reset()}flush(e){this.ended||(typeof e!="number"&&(e=this[oD]),this.write(Object.assign(yl.alloc(0),{[Vd]:e})))}end(e,t,i){return e&&this.write(e,t),this.flush(this[o_]),this[lD]=!0,super.end(null,null,i)}get ended(){return this[lD]}write(e,t,i){if(typeof t=="function"&&(i=t,t="utf8"),typeof e=="string"&&(e=yl.from(e,t)),this[gf])return;sD(this[pr],"zlib binding closed");let n=this[pr]._handle,s=n.close;n.close=()=>{};let o=this[pr].close;this[pr].close=()=>{},yl.concat=c=>c;let a;try{let c=typeof e[Vd]=="number"?e[Vd]:this[Vd];a=this[pr]._processChunk(e,c),yl.concat=s_}catch(c){yl.concat=s_,this[lB](new _d(c))}finally{this[pr]&&(this[pr]._handle=n,n.close=s,this[pr].close=o,this[pr].removeAllListeners("error"))}this[pr]&&this[pr].on("error",c=>this[lB](new _d(c)));let l;if(a)if(Array.isArray(a)&&a.length>0){l=this[$c](yl.from(a[0]));for(let c=1;c{this.flush(n),s()};try{this[pr].params(e,t)}finally{this[pr].flush=i}this[pr]&&(this[aD]=e,this[AD]=t)}}}},a_=class extends wl{constructor(e){super(e,"Deflate")}},A_=class extends wl{constructor(e){super(e,"Inflate")}},uD=Symbol("_portable"),l_=class extends wl{constructor(e){super(e,"Gzip");this[uD]=e&&!!e.portable}[$c](e){return this[uD]?(this[uD]=!1,e[9]=255,super[$c](e)):super[$c](e)}},c_=class extends wl{constructor(e){super(e,"Gunzip")}},u_=class extends wl{constructor(e){super(e,"DeflateRaw")}},g_=class extends wl{constructor(e){super(e,"InflateRaw")}},f_=class extends wl{constructor(e){super(e,"Unzip")}},gD=class extends cD{constructor(e,t){e=e||{},e.flush=e.flush||Zc.BROTLI_OPERATION_PROCESS,e.finishFlush=e.finishFlush||Zc.BROTLI_OPERATION_FINISH,super(e,t),this[oD]=Zc.BROTLI_OPERATION_FLUSH}},h_=class extends gD{constructor(e){super(e,"BrotliCompress")}},p_=class extends gD{constructor(e){super(e,"BrotliDecompress")}};as.Deflate=a_;as.Inflate=A_;as.Gzip=l_;as.Gunzip=c_;as.DeflateRaw=u_;as.InflateRaw=g_;as.Unzip=f_;typeof n_.BrotliCompress=="function"?(as.BrotliCompress=h_,as.BrotliDecompress=p_):as.BrotliCompress=as.BrotliDecompress=class{constructor(){throw new Error("Brotli is not supported in this version of Node.js")}}});var Xd=w(cB=>{"use strict";cB.name=new Map([["0","File"],["","OldFile"],["1","Link"],["2","SymbolicLink"],["3","CharacterDevice"],["4","BlockDevice"],["5","Directory"],["6","FIFO"],["7","ContiguousFile"],["g","GlobalExtendedHeader"],["x","ExtendedHeader"],["A","SolarisACL"],["D","GNUDumpDir"],["I","Inode"],["K","NextFileHasLongLinkpath"],["L","NextFileHasLongPath"],["M","ContinuationFile"],["N","OldGnuLongPath"],["S","SparseFile"],["V","TapeVolumeHeader"],["X","OldExtendedHeader"]]);cB.code=new Map(Array.from(cB.name).map(r=>[r[1],r[0]]))});var Zd=w((Dot,d_)=>{"use strict";var kot=Xd(),rRe=uf(),hD=Symbol("slurp");d_.exports=class extends rRe{constructor(e,t,i){super();switch(this.pause(),this.extended=t,this.globalExtended=i,this.header=e,this.startBlockSize=512*Math.ceil(e.size/512),this.blockRemain=this.startBlockSize,this.remain=e.size,this.type=e.type,this.meta=!1,this.ignore=!1,this.type){case"File":case"OldFile":case"Link":case"SymbolicLink":case"CharacterDevice":case"BlockDevice":case"Directory":case"FIFO":case"ContiguousFile":case"GNUDumpDir":break;case"NextFileHasLongLinkpath":case"NextFileHasLongPath":case"OldGnuLongPath":case"GlobalExtendedHeader":case"ExtendedHeader":case"OldExtendedHeader":this.meta=!0;break;default:this.ignore=!0}this.path=e.path,this.mode=e.mode,this.mode&&(this.mode=this.mode&4095),this.uid=e.uid,this.gid=e.gid,this.uname=e.uname,this.gname=e.gname,this.size=e.size,this.mtime=e.mtime,this.atime=e.atime,this.ctime=e.ctime,this.linkpath=e.linkpath,this.uname=e.uname,this.gname=e.gname,t&&this[hD](t),i&&this[hD](i,!0)}write(e){let t=e.length;if(t>this.blockRemain)throw new Error("writing more to entry than is appropriate");let i=this.remain,n=this.blockRemain;return this.remain=Math.max(0,i-t),this.blockRemain=Math.max(0,n-t),this.ignore?!0:i>=t?super.write(e):super.write(e.slice(0,i))}[hD](e,t){for(let i in e)e[i]!==null&&e[i]!==void 0&&!(t&&i==="path")&&(this[i]=e[i])}}});var E_=w(pD=>{"use strict";var Rot=pD.encode=(r,e)=>{if(Number.isSafeInteger(r))r<0?nRe(r,e):iRe(r,e);else throw Error("cannot encode number outside of javascript safe integer range");return e},iRe=(r,e)=>{e[0]=128;for(var t=e.length;t>1;t--)e[t-1]=r&255,r=Math.floor(r/256)},nRe=(r,e)=>{e[0]=255;var t=!1;r=r*-1;for(var i=e.length;i>1;i--){var n=r&255;r=Math.floor(r/256),t?e[i-1]=C_(n):n===0?e[i-1]=0:(t=!0,e[i-1]=m_(n))}},Fot=pD.parse=r=>{var e=r[r.length-1],t=r[0],i;if(t===128)i=oRe(r.slice(1,r.length));else if(t===255)i=sRe(r);else throw Error("invalid base256 encoding");if(!Number.isSafeInteger(i))throw Error("parsed number outside of javascript safe integer range");return i},sRe=r=>{for(var e=r.length,t=0,i=!1,n=e-1;n>-1;n--){var s=r[n],o;i?o=C_(s):s===0?o=s:(i=!0,o=m_(s)),o!==0&&(t-=o*Math.pow(256,e-n-1))}return t},oRe=r=>{for(var e=r.length,t=0,i=e-1;i>-1;i--){var n=r[i];n!==0&&(t+=n*Math.pow(256,e-i-1))}return t},C_=r=>(255^r)&255,m_=r=>(255^r)+1&255});var hf=w((Lot,I_)=>{"use strict";var dD=Xd(),ff=require("path").posix,y_=E_(),CD=Symbol("slurp"),As=Symbol("type"),w_=class{constructor(e,t,i,n){this.cksumValid=!1,this.needPax=!1,this.nullBlock=!1,this.block=null,this.path=null,this.mode=null,this.uid=null,this.gid=null,this.size=null,this.mtime=null,this.cksum=null,this[As]="0",this.linkpath=null,this.uname=null,this.gname=null,this.devmaj=0,this.devmin=0,this.atime=null,this.ctime=null,Buffer.isBuffer(e)?this.decode(e,t||0,i,n):e&&this.set(e)}decode(e,t,i,n){if(t||(t=0),!e||!(e.length>=t+512))throw new Error("need 512 bytes for header");if(this.path=eu(e,t,100),this.mode=Bl(e,t+100,8),this.uid=Bl(e,t+108,8),this.gid=Bl(e,t+116,8),this.size=Bl(e,t+124,12),this.mtime=mD(e,t+136,12),this.cksum=Bl(e,t+148,12),this[CD](i),this[CD](n,!0),this[As]=eu(e,t+156,1),this[As]===""&&(this[As]="0"),this[As]==="0"&&this.path.substr(-1)==="/"&&(this[As]="5"),this[As]==="5"&&(this.size=0),this.linkpath=eu(e,t+157,100),e.slice(t+257,t+265).toString()==="ustar\x0000")if(this.uname=eu(e,t+265,32),this.gname=eu(e,t+297,32),this.devmaj=Bl(e,t+329,8),this.devmin=Bl(e,t+337,8),e[t+475]!==0){let o=eu(e,t+345,155);this.path=o+"/"+this.path}else{let o=eu(e,t+345,130);o&&(this.path=o+"/"+this.path),this.atime=mD(e,t+476,12),this.ctime=mD(e,t+488,12)}let s=8*32;for(let o=t;o=t+512))throw new Error("need 512 bytes for header");let i=this.ctime||this.atime?130:155,n=aRe(this.path||"",i),s=n[0],o=n[1];this.needPax=n[2],this.needPax=tu(e,t,100,s)||this.needPax,this.needPax=bl(e,t+100,8,this.mode)||this.needPax,this.needPax=bl(e,t+108,8,this.uid)||this.needPax,this.needPax=bl(e,t+116,8,this.gid)||this.needPax,this.needPax=bl(e,t+124,12,this.size)||this.needPax,this.needPax=ED(e,t+136,12,this.mtime)||this.needPax,e[t+156]=this[As].charCodeAt(0),this.needPax=tu(e,t+157,100,this.linkpath)||this.needPax,e.write("ustar\x0000",t+257,8),this.needPax=tu(e,t+265,32,this.uname)||this.needPax,this.needPax=tu(e,t+297,32,this.gname)||this.needPax,this.needPax=bl(e,t+329,8,this.devmaj)||this.needPax,this.needPax=bl(e,t+337,8,this.devmin)||this.needPax,this.needPax=tu(e,t+345,i,o)||this.needPax,e[t+475]!==0?this.needPax=tu(e,t+345,155,o)||this.needPax:(this.needPax=tu(e,t+345,130,o)||this.needPax,this.needPax=ED(e,t+476,12,this.atime)||this.needPax,this.needPax=ED(e,t+488,12,this.ctime)||this.needPax);let a=8*32;for(let l=t;l{let t=100,i=r,n="",s,o=ff.parse(r).root||".";if(Buffer.byteLength(i)t&&Buffer.byteLength(n)<=e?s=[i.substr(0,t-1),n,!0]:(i=ff.join(ff.basename(n),i),n=ff.dirname(n));while(n!==o&&!s);s||(s=[r.substr(0,t-1),"",!0])}return s},eu=(r,e,t)=>r.slice(e,e+t).toString("utf8").replace(/\0.*/,""),mD=(r,e,t)=>ARe(Bl(r,e,t)),ARe=r=>r===null?null:new Date(r*1e3),Bl=(r,e,t)=>r[e]&128?y_.parse(r.slice(e,e+t)):lRe(r,e,t),cRe=r=>isNaN(r)?null:r,lRe=(r,e,t)=>cRe(parseInt(r.slice(e,e+t).toString("utf8").replace(/\0.*$/,"").trim(),8)),uRe={12:8589934591,8:2097151},bl=(r,e,t,i)=>i===null?!1:i>uRe[t]||i<0?(y_.encode(i,r.slice(e,e+t)),!0):(gRe(r,e,t,i),!1),gRe=(r,e,t,i)=>r.write(fRe(i,t),e,t,"ascii"),fRe=(r,e)=>hRe(Math.floor(r).toString(8),e),hRe=(r,e)=>(r.length===e-1?r:new Array(e-r.length-1).join("0")+r+" ")+"\0",ED=(r,e,t,i)=>i===null?!1:bl(r,e,t,i.getTime()/1e3),pRe=new Array(156).join("\0"),tu=(r,e,t,i)=>i===null?!1:(r.write(i+pRe,e,t,"utf8"),i.length!==Buffer.byteLength(i)||i.length>t);I_.exports=w_});var gB=w((Tot,B_)=>{"use strict";var dRe=hf(),CRe=require("path"),uB=class{constructor(e,t){this.atime=e.atime||null,this.charset=e.charset||null,this.comment=e.comment||null,this.ctime=e.ctime||null,this.gid=e.gid||null,this.gname=e.gname||null,this.linkpath=e.linkpath||null,this.mtime=e.mtime||null,this.path=e.path||null,this.size=e.size||null,this.uid=e.uid||null,this.uname=e.uname||null,this.dev=e.dev||null,this.ino=e.ino||null,this.nlink=e.nlink||null,this.global=t||!1}encode(){let e=this.encodeBody();if(e==="")return null;let t=Buffer.byteLength(e),i=512*Math.ceil(1+t/512),n=Buffer.allocUnsafe(i);for(let s=0;s<512;s++)n[s]=0;new dRe({path:("PaxHeader/"+CRe.basename(this.path)).slice(0,99),mode:this.mode||420,uid:this.uid||null,gid:this.gid||null,size:t,mtime:this.mtime||null,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime||null,ctime:this.ctime||null}).encode(n),n.write(e,512,t,"utf8");for(let s=t+512;s=Math.pow(10,s)&&(s+=1),s+n+i}};uB.parse=(r,e,t)=>new uB(mRe(ERe(r),e),t);var mRe=(r,e)=>e?Object.keys(r).reduce((t,i)=>(t[i]=r[i],t),e):r,ERe=r=>r.replace(/\n$/,"").split(` -`).reduce(IRe,Object.create(null)),IRe=(r,e)=>{let t=parseInt(e,10);if(t!==Buffer.byteLength(e)+1)return r;e=e.substr((t+" ").length);let i=e.split("="),n=i.shift().replace(/^SCHILY\.(dev|ino|nlink)/,"$1");if(!n)return r;let s=i.join("=");return r[n]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(n)?new Date(s*1e3):/^[0-9]+$/.test(s)?+s:s,r};B_.exports=uB});var fB=w((Oot,b_)=>{"use strict";b_.exports=r=>class extends r{warn(e,t,i={}){this.file&&(i.file=this.file),this.cwd&&(i.cwd=this.cwd),i.code=t instanceof Error&&t.code||e,i.tarCode=e,!this.strict&&i.recoverable!==!1?(t instanceof Error&&(i=Object.assign(t,i),t=t.message),this.emit("warn",i.tarCode,t,i)):t instanceof Error?this.emit("error",Object.assign(t,i)):this.emit("error",Object.assign(new Error(`${e}: ${t}`),i))}}});var yD=w((Mot,Q_)=>{"use strict";var hB=["|","<",">","?",":"],ID=hB.map(r=>String.fromCharCode(61440+r.charCodeAt(0))),yRe=new Map(hB.map((r,e)=>[r,ID[e]])),wRe=new Map(ID.map((r,e)=>[r,hB[e]]));Q_.exports={encode:r=>hB.reduce((e,t)=>e.split(t).join(yRe.get(t)),r),decode:r=>ID.reduce((e,t)=>e.split(t).join(wRe.get(t)),r)}});var v_=w((Kot,S_)=>{"use strict";S_.exports=(r,e,t)=>(r&=4095,t&&(r=(r|384)&~18),e&&(r&256&&(r|=64),r&32&&(r|=8),r&4&&(r|=1)),r)});var xD=w((Yot,x_)=>{"use strict";var k_=uf(),P_=gB(),D_=hf(),Uot=Zd(),sa=require("fs"),pf=require("path"),Hot=Xd(),BRe=16*1024*1024,R_=Symbol("process"),F_=Symbol("file"),N_=Symbol("directory"),wD=Symbol("symlink"),L_=Symbol("hardlink"),$d=Symbol("header"),pB=Symbol("read"),BD=Symbol("lstat"),dB=Symbol("onlstat"),bD=Symbol("onread"),QD=Symbol("onreadlink"),SD=Symbol("openfile"),vD=Symbol("onopenfile"),ru=Symbol("close"),CB=Symbol("mode"),T_=fB(),bRe=yD(),O_=v_(),mB=T_(class extends k_{constructor(e,t){if(t=t||{},super(t),typeof e!="string")throw new TypeError("path is required");this.path=e,this.portable=!!t.portable,this.myuid=process.getuid&&process.getuid(),this.myuser=process.env.USER||"",this.maxReadSize=t.maxReadSize||BRe,this.linkCache=t.linkCache||new Map,this.statCache=t.statCache||new Map,this.preservePaths=!!t.preservePaths,this.cwd=t.cwd||process.cwd(),this.strict=!!t.strict,this.noPax=!!t.noPax,this.noMtime=!!t.noMtime,this.mtime=t.mtime||null,typeof t.onwarn=="function"&&this.on("warn",t.onwarn);let i=!1;if(!this.preservePaths&&pf.win32.isAbsolute(e)){let n=pf.win32.parse(e);this.path=e.substr(n.root.length),i=n.root}this.win32=!!t.win32||process.platform==="win32",this.win32&&(this.path=bRe.decode(this.path.replace(/\\/g,"/")),e=e.replace(/\\/g,"/")),this.absolute=t.absolute||pf.resolve(this.cwd,e),this.path===""&&(this.path="./"),i&&this.warn("TAR_ENTRY_INFO",`stripping ${i} from absolute path`,{entry:this,path:i+this.path}),this.statCache.has(this.absolute)?this[dB](this.statCache.get(this.absolute)):this[BD]()}[BD](){sa.lstat(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[dB](t)})}[dB](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=QRe(e),this.emit("stat",e),this[R_]()}[R_](){switch(this.type){case"File":return this[F_]();case"Directory":return this[N_]();case"SymbolicLink":return this[wD]();default:return this.end()}}[CB](e){return O_(e,this.type==="Directory",this.portable)}[$d](){this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.header=new D_({path:this.path,linkpath:this.linkpath,mode:this[CB](this.stat.mode),uid:this.portable?null:this.stat.uid,gid:this.portable?null:this.stat.gid,size:this.stat.size,mtime:this.noMtime?null:this.mtime||this.stat.mtime,type:this.type,uname:this.portable?null:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?null:this.stat.atime,ctime:this.portable?null:this.stat.ctime}),this.header.encode()&&!this.noPax&&this.write(new P_({atime:this.portable?null:this.header.atime,ctime:this.portable?null:this.header.ctime,gid:this.portable?null:this.header.gid,mtime:this.noMtime?null:this.mtime||this.header.mtime,path:this.path,linkpath:this.linkpath,size:this.header.size,uid:this.portable?null:this.header.uid,uname:this.portable?null:this.header.uname,dev:this.portable?null:this.stat.dev,ino:this.portable?null:this.stat.ino,nlink:this.portable?null:this.stat.nlink}).encode()),this.write(this.header.block)}[N_](){this.path.substr(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[$d](),this.end()}[wD](){sa.readlink(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[QD](t)})}[QD](e){this.linkpath=e.replace(/\\/g,"/"),this[$d](),this.end()}[L_](e){this.type="Link",this.linkpath=pf.relative(this.cwd,e).replace(/\\/g,"/"),this.stat.size=0,this[$d](),this.end()}[F_](){if(this.stat.nlink>1){let e=this.stat.dev+":"+this.stat.ino;if(this.linkCache.has(e)){let t=this.linkCache.get(e);if(t.indexOf(this.cwd)===0)return this[L_](t)}this.linkCache.set(e,this.absolute)}if(this[$d](),this.stat.size===0)return this.end();this[SD]()}[SD](){sa.open(this.absolute,"r",(e,t)=>{if(e)return this.emit("error",e);this[vD](t)})}[vD](e){let t=512*Math.ceil(this.stat.size/512),i=Math.min(t,this.maxReadSize),n=Buffer.allocUnsafe(i);this[pB](e,n,0,n.length,0,this.stat.size,t)}[pB](e,t,i,n,s,o,a){sa.read(e,t,i,n,s,(l,c)=>{if(l)return this[ru](e,()=>this.emit("error",l));this[bD](e,t,i,n,s,o,a,c)})}[ru](e,t){sa.close(e,t)}[bD](e,t,i,n,s,o,a,l){if(l<=0&&o>0){let u=new Error("encountered unexpected EOF");return u.path=this.absolute,u.syscall="read",u.code="EOF",this[ru](e,()=>this.emit("error",u))}if(l>o){let u=new Error("did not encounter expected EOF");return u.path=this.absolute,u.syscall="read",u.code="EOF",this[ru](e,()=>this.emit("error",u))}if(l===o)for(let u=l;uu?this.emit("error",u):this.end());i>=n&&(t=Buffer.allocUnsafe(n),i=0),n=t.length-i,this[pB](e,t,i,n,s,o,a)}}),M_=class extends mB{constructor(e,t){super(e,t)}[BD](){this[dB](sa.lstatSync(this.absolute))}[wD](){this[QD](sa.readlinkSync(this.absolute))}[SD](){this[vD](sa.openSync(this.absolute,"r"))}[pB](e,t,i,n,s,o,a){let l=!0;try{let c=sa.readSync(e,t,i,n,s);this[bD](e,t,i,n,s,o,a,c),l=!1}finally{if(l)try{this[ru](e,()=>{})}catch(c){}}}[ru](e,t){sa.closeSync(e),t()}},SRe=T_(class extends k_{constructor(e,t){t=t||{},super(t),this.preservePaths=!!t.preservePaths,this.portable=!!t.portable,this.strict=!!t.strict,this.noPax=!!t.noPax,this.noMtime=!!t.noMtime,this.readEntry=e,this.type=e.type,this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.path=e.path,this.mode=this[CB](e.mode),this.uid=this.portable?null:e.uid,this.gid=this.portable?null:e.gid,this.uname=this.portable?null:e.uname,this.gname=this.portable?null:e.gname,this.size=e.size,this.mtime=this.noMtime?null:t.mtime||e.mtime,this.atime=this.portable?null:e.atime,this.ctime=this.portable?null:e.ctime,this.linkpath=e.linkpath,typeof t.onwarn=="function"&&this.on("warn",t.onwarn);let i=!1;if(pf.isAbsolute(this.path)&&!this.preservePaths){let n=pf.parse(this.path);i=n.root,this.path=this.path.substr(n.root.length)}this.remain=e.size,this.blockRemain=e.startBlockSize,this.header=new D_({path:this.path,linkpath:this.linkpath,mode:this.mode,uid:this.portable?null:this.uid,gid:this.portable?null:this.gid,size:this.size,mtime:this.noMtime?null:this.mtime,type:this.type,uname:this.portable?null:this.uname,atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime}),i&&this.warn("TAR_ENTRY_INFO",`stripping ${i} from absolute path`,{entry:this,path:i+this.path}),this.header.encode()&&!this.noPax&&super.write(new P_({atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime,gid:this.portable?null:this.gid,mtime:this.noMtime?null:this.mtime,path:this.path,linkpath:this.linkpath,size:this.size,uid:this.portable?null:this.uid,uname:this.portable?null:this.uname,dev:this.portable?null:this.readEntry.dev,ino:this.portable?null:this.readEntry.ino,nlink:this.portable?null:this.readEntry.nlink}).encode()),super.write(this.header.block),e.pipe(this)}[CB](e){return O_(e,this.type==="Directory",this.portable)}write(e){let t=e.length;if(t>this.blockRemain)throw new Error("writing more to entry than is appropriate");return this.blockRemain-=t,super.write(e)}end(){return this.blockRemain&&this.write(Buffer.alloc(this.blockRemain)),super.end()}});mB.Sync=M_;mB.Tar=SRe;var QRe=r=>r.isFile()?"File":r.isDirectory()?"Directory":r.isSymbolicLink()?"SymbolicLink":"Unsupported";x_.exports=mB});var SB=w((Jot,K_)=>{"use strict";var kD=class{constructor(e,t){this.path=e||"./",this.absolute=t,this.entry=null,this.stat=null,this.readdir=null,this.pending=!1,this.ignore=!1,this.piped=!1}},vRe=uf(),xRe=fD(),kRe=Zd(),PD=xD(),PRe=PD.Sync,DRe=PD.Tar,RRe=Bp(),U_=Buffer.alloc(1024),EB=Symbol("onStat"),IB=Symbol("ended"),oa=Symbol("queue"),df=Symbol("current"),iu=Symbol("process"),yB=Symbol("processing"),H_=Symbol("processJob"),aa=Symbol("jobs"),DD=Symbol("jobDone"),wB=Symbol("addFSEntry"),j_=Symbol("addTarEntry"),RD=Symbol("stat"),FD=Symbol("readdir"),BB=Symbol("onreaddir"),bB=Symbol("pipe"),G_=Symbol("entry"),ND=Symbol("entryOpt"),LD=Symbol("writeEntryClass"),Y_=Symbol("write"),TD=Symbol("ondrain"),QB=require("fs"),q_=require("path"),FRe=fB(),OD=FRe(class extends vRe{constructor(e){super(e);e=e||Object.create(null),this.opt=e,this.file=e.file||"",this.cwd=e.cwd||process.cwd(),this.maxReadSize=e.maxReadSize,this.preservePaths=!!e.preservePaths,this.strict=!!e.strict,this.noPax=!!e.noPax,this.prefix=(e.prefix||"").replace(/(\\|\/)+$/,""),this.linkCache=e.linkCache||new Map,this.statCache=e.statCache||new Map,this.readdirCache=e.readdirCache||new Map,this[LD]=PD,typeof e.onwarn=="function"&&this.on("warn",e.onwarn),this.portable=!!e.portable,this.zip=null,e.gzip?(typeof e.gzip!="object"&&(e.gzip={}),this.portable&&(e.gzip.portable=!0),this.zip=new xRe.Gzip(e.gzip),this.zip.on("data",t=>super.write(t)),this.zip.on("end",t=>super.end()),this.zip.on("drain",t=>this[TD]()),this.on("resume",t=>this.zip.resume())):this.on("drain",this[TD]),this.noDirRecurse=!!e.noDirRecurse,this.follow=!!e.follow,this.noMtime=!!e.noMtime,this.mtime=e.mtime||null,this.filter=typeof e.filter=="function"?e.filter:t=>!0,this[oa]=new RRe,this[aa]=0,this.jobs=+e.jobs||4,this[yB]=!1,this[IB]=!1}[Y_](e){return super.write(e)}add(e){return this.write(e),this}end(e){return e&&this.write(e),this[IB]=!0,this[iu](),this}write(e){if(this[IB])throw new Error("write after end");return e instanceof kRe?this[j_](e):this[wB](e),this.flowing}[j_](e){let t=q_.resolve(this.cwd,e.path);if(this.prefix&&(e.path=this.prefix+"/"+e.path.replace(/^\.(\/+|$)/,"")),!this.filter(e.path,e))e.resume();else{let i=new kD(e.path,t,!1);i.entry=new DRe(e,this[ND](i)),i.entry.on("end",n=>this[DD](i)),this[aa]+=1,this[oa].push(i)}this[iu]()}[wB](e){let t=q_.resolve(this.cwd,e);this.prefix&&(e=this.prefix+"/"+e.replace(/^\.(\/+|$)/,"")),this[oa].push(new kD(e,t)),this[iu]()}[RD](e){e.pending=!0,this[aa]+=1;let t=this.follow?"stat":"lstat";QB[t](e.absolute,(i,n)=>{e.pending=!1,this[aa]-=1,i?this.emit("error",i):this[EB](e,n)})}[EB](e,t){this.statCache.set(e.absolute,t),e.stat=t,this.filter(e.path,t)||(e.ignore=!0),this[iu]()}[FD](e){e.pending=!0,this[aa]+=1,QB.readdir(e.absolute,(t,i)=>{if(e.pending=!1,this[aa]-=1,t)return this.emit("error",t);this[BB](e,i)})}[BB](e,t){this.readdirCache.set(e.absolute,t),e.readdir=t,this[iu]()}[iu](){if(!this[yB]){this[yB]=!0;for(let e=this[oa].head;e!==null&&this[aa]this.warn(t,i,n),noPax:this.noPax,cwd:this.cwd,absolute:e.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime}}[G_](e){this[aa]+=1;try{return new this[LD](e.path,this[ND](e)).on("end",()=>this[DD](e)).on("error",t=>this.emit("error",t))}catch(t){this.emit("error",t)}}[TD](){this[df]&&this[df].entry&&this[df].entry.resume()}[bB](e){e.piped=!0,e.readdir&&e.readdir.forEach(n=>{let s=this.prefix?e.path.slice(this.prefix.length+1)||"./":e.path,o=s==="./"?"":s.replace(/\/*$/,"/");this[wB](o+n)});let t=e.entry,i=this.zip;i?t.on("data",n=>{i.write(n)||t.pause()}):t.on("data",n=>{super.write(n)||t.pause()})}pause(){return this.zip&&this.zip.pause(),super.pause()}}),J_=class extends OD{constructor(e){super(e);this[LD]=PRe}pause(){}resume(){}[RD](e){let t=this.follow?"statSync":"lstatSync";this[EB](e,QB[t](e.absolute))}[FD](e,t){this[BB](e,QB.readdirSync(e.absolute))}[bB](e){let t=e.entry,i=this.zip;e.readdir&&e.readdir.forEach(n=>{let s=this.prefix?e.path.slice(this.prefix.length+1)||"./":e.path,o=s==="./"?"":s.replace(/\/*$/,"/");this[wB](o+n)}),i?t.on("data",n=>{i.write(n)}):t.on("data",n=>{super[Y_](n)})}};OD.Sync=J_;K_.exports=OD});var wf=w(eC=>{"use strict";var NRe=uf(),LRe=require("events").EventEmitter,Us=require("fs"),vB=process.binding("fs"),Wot=vB.writeBuffers,TRe=vB.FSReqWrap||vB.FSReqCallback,Cf=Symbol("_autoClose"),Aa=Symbol("_close"),tC=Symbol("_ended"),or=Symbol("_fd"),W_=Symbol("_finished"),nu=Symbol("_flags"),MD=Symbol("_flush"),KD=Symbol("_handleChunk"),UD=Symbol("_makeBuf"),HD=Symbol("_mode"),xB=Symbol("_needDrain"),mf=Symbol("_onerror"),Ef=Symbol("_onopen"),jD=Symbol("_onread"),su=Symbol("_onwrite"),Ql=Symbol("_open"),Sl=Symbol("_path"),ou=Symbol("_pos"),la=Symbol("_queue"),If=Symbol("_read"),z_=Symbol("_readSize"),vl=Symbol("_reading"),kB=Symbol("_remain"),__=Symbol("_size"),PB=Symbol("_write"),yf=Symbol("_writing"),DB=Symbol("_defaultFlag"),GD=class extends NRe{constructor(e,t){if(t=t||{},super(t),this.writable=!1,typeof e!="string")throw new TypeError("path must be a string");this[or]=typeof t.fd=="number"?t.fd:null,this[Sl]=e,this[z_]=t.readSize||16*1024*1024,this[vl]=!1,this[__]=typeof t.size=="number"?t.size:Infinity,this[kB]=this[__],this[Cf]=typeof t.autoClose=="boolean"?t.autoClose:!0,typeof this[or]=="number"?this[If]():this[Ql]()}get fd(){return this[or]}get path(){return this[Sl]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[Ql](){Us.open(this[Sl],"r",(e,t)=>this[Ef](e,t))}[Ef](e,t){e?this[mf](e):(this[or]=t,this.emit("open",t),this[If]())}[UD](){return Buffer.allocUnsafe(Math.min(this[z_],this[kB]))}[If](){if(!this[vl]){this[vl]=!0;let e=this[UD]();if(e.length===0)return process.nextTick(()=>this[jD](null,0,e));Us.read(this[or],e,0,e.length,null,(t,i,n)=>this[jD](t,i,n))}}[jD](e,t,i){this[vl]=!1,e?this[mf](e):this[KD](t,i)&&this[If]()}[Aa](){this[Cf]&&typeof this[or]=="number"&&(Us.close(this[or],e=>this.emit("close")),this[or]=null)}[mf](e){this[vl]=!0,this[Aa](),this.emit("error",e)}[KD](e,t){let i=!1;return this[kB]-=e,e>0&&(i=super.write(ethis[Ef](e,t))}[Ef](e,t){this[DB]&&this[nu]==="r+"&&e&&e.code==="ENOENT"?(this[nu]="w",this[Ql]()):e?this[mf](e):(this[or]=t,this.emit("open",t),this[MD]())}end(e,t){e&&this.write(e,t),this[tC]=!0,!this[yf]&&!this[la].length&&typeof this[or]=="number"&&this[su](null,0)}write(e,t){return typeof e=="string"&&(e=new Buffer(e,t)),this[tC]?(this.emit("error",new Error("write() after end()")),!1):this[or]===null||this[yf]||this[la].length?(this[la].push(e),this[xB]=!0,!1):(this[yf]=!0,this[PB](e),!0)}[PB](e){Us.write(this[or],e,0,e.length,this[ou],(t,i)=>this[su](t,i))}[su](e,t){e?this[mf](e):(this[ou]!==null&&(this[ou]+=t),this[la].length?this[MD]():(this[yf]=!1,this[tC]&&!this[W_]?(this[W_]=!0,this[Aa](),this.emit("finish")):this[xB]&&(this[xB]=!1,this.emit("drain"))))}[MD](){if(this[la].length===0)this[tC]&&this[su](null,0);else if(this[la].length===1)this[PB](this[la].pop());else{let e=this[la];this[la]=[],ORe(this[or],e,this[ou],(t,i)=>this[su](t,i))}}[Aa](){this[Cf]&&typeof this[or]=="number"&&(Us.close(this[or],e=>this.emit("close")),this[or]=null)}},X_=class extends YD{[Ql](){let e;try{e=Us.openSync(this[Sl],this[nu],this[HD])}catch(t){if(this[DB]&&this[nu]==="r+"&&t&&t.code==="ENOENT")return this[nu]="w",this[Ql]();throw t}this[Ef](null,e)}[Aa](){if(this[Cf]&&typeof this[or]=="number"){try{Us.closeSync(this[or])}catch(e){}this[or]=null,this.emit("close")}}[PB](e){try{this[su](null,Us.writeSync(this[or],e,0,e.length,this[ou]))}catch(t){this[su](t,0)}}},ORe=(r,e,t,i)=>{let n=(o,a)=>i(o,a,e),s=new TRe;s.oncomplete=n,vB.writeBuffers(r,e,t,s)};eC.ReadStream=GD;eC.ReadStreamSync=V_;eC.WriteStream=YD;eC.WriteStreamSync=X_});var nC=w((Xot,Z_)=>{"use strict";var MRe=fB(),_ot=require("path"),KRe=hf(),URe=require("events"),HRe=Bp(),jRe=1024*1024,GRe=Zd(),$_=gB(),YRe=fD(),qD=Buffer.from([31,139]),Hs=Symbol("state"),au=Symbol("writeEntry"),uA=Symbol("readEntry"),JD=Symbol("nextEntry"),eV=Symbol("processEntry"),js=Symbol("extendedHeader"),rC=Symbol("globalExtendedHeader"),xl=Symbol("meta"),tV=Symbol("emitMeta"),yr=Symbol("buffer"),gA=Symbol("queue"),Au=Symbol("ended"),rV=Symbol("emittedEnd"),lu=Symbol("emit"),Ln=Symbol("unzip"),RB=Symbol("consumeChunk"),FB=Symbol("consumeChunkSub"),WD=Symbol("consumeBody"),iV=Symbol("consumeMeta"),nV=Symbol("consumeHeader"),NB=Symbol("consuming"),zD=Symbol("bufferConcat"),_D=Symbol("maybeEnd"),iC=Symbol("writing"),kl=Symbol("aborted"),LB=Symbol("onDone"),cu=Symbol("sawValidEntry"),TB=Symbol("sawNullBlock"),OB=Symbol("sawEOF"),qRe=r=>!0;Z_.exports=MRe(class extends URe{constructor(e){e=e||{},super(e),this.file=e.file||"",this[cu]=null,this.on(LB,t=>{(this[Hs]==="begin"||this[cu]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),e.ondone?this.on(LB,e.ondone):this.on(LB,t=>{this.emit("prefinish"),this.emit("finish"),this.emit("end"),this.emit("close")}),this.strict=!!e.strict,this.maxMetaEntrySize=e.maxMetaEntrySize||jRe,this.filter=typeof e.filter=="function"?e.filter:qRe,this.writable=!0,this.readable=!1,this[gA]=new HRe,this[yr]=null,this[uA]=null,this[au]=null,this[Hs]="begin",this[xl]="",this[js]=null,this[rC]=null,this[Au]=!1,this[Ln]=null,this[kl]=!1,this[TB]=!1,this[OB]=!1,typeof e.onwarn=="function"&&this.on("warn",e.onwarn),typeof e.onentry=="function"&&this.on("entry",e.onentry)}[nV](e,t){this[cu]===null&&(this[cu]=!1);let i;try{i=new KRe(e,t,this[js],this[rC])}catch(n){return this.warn("TAR_ENTRY_INVALID",n)}if(i.nullBlock)this[TB]?(this[OB]=!0,this[Hs]==="begin"&&(this[Hs]="header"),this[lu]("eof")):(this[TB]=!0,this[lu]("nullBlock"));else if(this[TB]=!1,!i.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:i});else if(!i.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:i});else{let n=i.type;if(/^(Symbolic)?Link$/.test(n)&&!i.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:i});else if(!/^(Symbolic)?Link$/.test(n)&&i.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:i});else{let s=this[au]=new GRe(i,this[js],this[rC]);if(!this[cu])if(s.remain){let o=()=>{s.invalid||(this[cu]=!0)};s.on("end",o)}else this[cu]=!0;s.meta?s.size>this.maxMetaEntrySize?(s.ignore=!0,this[lu]("ignoredEntry",s),this[Hs]="ignore",s.resume()):s.size>0&&(this[xl]="",s.on("data",o=>this[xl]+=o),this[Hs]="meta"):(this[js]=null,s.ignore=s.ignore||!this.filter(s.path,s),s.ignore?(this[lu]("ignoredEntry",s),this[Hs]=s.remain?"ignore":"header",s.resume()):(s.remain?this[Hs]="body":(this[Hs]="header",s.end()),this[uA]?this[gA].push(s):(this[gA].push(s),this[JD]())))}}}[eV](e){let t=!0;return e?Array.isArray(e)?this.emit.apply(this,e):(this[uA]=e,this.emit("entry",e),e.emittedEnd||(e.on("end",i=>this[JD]()),t=!1)):(this[uA]=null,t=!1),t}[JD](){do;while(this[eV](this[gA].shift()));if(!this[gA].length){let e=this[uA];!e||e.flowing||e.size===e.remain?this[iC]||this.emit("drain"):e.once("drain",i=>this.emit("drain"))}}[WD](e,t){let i=this[au],n=i.blockRemain,s=n>=e.length&&t===0?e:e.slice(t,t+n);return i.write(s),i.blockRemain||(this[Hs]="header",this[au]=null,i.end()),s.length}[iV](e,t){let i=this[au],n=this[WD](e,t);return this[au]||this[tV](i),n}[lu](e,t,i){!this[gA].length&&!this[uA]?this.emit(e,t,i):this[gA].push([e,t,i])}[tV](e){switch(this[lu]("meta",this[xl]),e.type){case"ExtendedHeader":case"OldExtendedHeader":this[js]=$_.parse(this[xl],this[js],!1);break;case"GlobalExtendedHeader":this[rC]=$_.parse(this[xl],this[rC],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":this[js]=this[js]||Object.create(null),this[js].path=this[xl].replace(/\0.*/,"");break;case"NextFileHasLongLinkpath":this[js]=this[js]||Object.create(null),this[js].linkpath=this[xl].replace(/\0.*/,"");break;default:throw new Error("unknown meta: "+e.type)}}abort(e){this[kl]=!0,this.emit("abort",e),this.warn("TAR_ABORT",e,{recoverable:!1})}write(e){if(this[kl])return;if(this[Ln]===null&&e){if(this[yr]&&(e=Buffer.concat([this[yr],e]),this[yr]=null),e.lengththis[RB](s)),this[Ln].on("error",s=>this.abort(s)),this[Ln].on("end",s=>{this[Au]=!0,this[RB]()}),this[iC]=!0;let n=this[Ln][i?"end":"write"](e);return this[iC]=!1,n}}this[iC]=!0,this[Ln]?this[Ln].write(e):this[RB](e),this[iC]=!1;let t=this[gA].length?!1:this[uA]?this[uA].flowing:!0;return!t&&!this[gA].length&&this[uA].once("drain",i=>this.emit("drain")),t}[zD](e){e&&!this[kl]&&(this[yr]=this[yr]?Buffer.concat([this[yr],e]):e)}[_D](){if(this[Au]&&!this[rV]&&!this[kl]&&!this[NB]){this[rV]=!0;let e=this[au];if(e&&e.blockRemain){let t=this[yr]?this[yr].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${e.blockRemain} more bytes, only ${t} available)`,{entry:e}),this[yr]&&e.write(this[yr]),e.end()}this[lu](LB)}}[RB](e){if(this[NB])this[zD](e);else if(!e&&!this[yr])this[_D]();else{if(this[NB]=!0,this[yr]){this[zD](e);let t=this[yr];this[yr]=null,this[FB](t)}else this[FB](e);for(;this[yr]&&this[yr].length>=512&&!this[kl]&&!this[OB];){let t=this[yr];this[yr]=null,this[FB](t)}this[NB]=!1}(!this[yr]||this[Au])&&this[_D]()}[FB](e){let t=0,i=e.length;for(;t+512<=i&&!this[kl]&&!this[OB];)switch(this[Hs]){case"begin":case"header":this[nV](e,t),t+=512;break;case"ignore":case"body":t+=this[WD](e,t);break;case"meta":t+=this[iV](e,t);break;default:throw new Error("invalid state: "+this[Hs])}t{"use strict";var JRe=cf(),oV=nC(),Bf=require("fs"),WRe=wf(),aV=require("path"),Zot=sV.exports=(r,e,t)=>{typeof r=="function"?(t=r,e=null,r={}):Array.isArray(r)&&(e=r,r={}),typeof e=="function"&&(t=e,e=null),e?e=Array.from(e):e=[];let i=JRe(r);if(i.sync&&typeof t=="function")throw new TypeError("callback not supported for sync tar functions");if(!i.file&&typeof t=="function")throw new TypeError("callback only supported with file option");return e.length&&_Re(i,e),i.noResume||zRe(i),i.file&&i.sync?VRe(i):i.file?XRe(i,t):AV(i)},zRe=r=>{let e=r.onentry;r.onentry=e?t=>{e(t),t.resume()}:t=>t.resume()},_Re=(r,e)=>{let t=new Map(e.map(s=>[s.replace(/\/+$/,""),!0])),i=r.filter,n=(s,o)=>{let a=o||aV.parse(s).root||".",l=s===a?!1:t.has(s)?t.get(s):n(aV.dirname(s),a);return t.set(s,l),l};r.filter=i?(s,o)=>i(s,o)&&n(s.replace(/\/+$/,"")):s=>n(s.replace(/\/+$/,""))},VRe=r=>{let e=AV(r),t=r.file,i=!0,n;try{let s=Bf.statSync(t),o=r.maxReadSize||16*1024*1024;if(s.size{let t=new oV(r),i=r.maxReadSize||16*1024*1024,n=r.file,s=new Promise((o,a)=>{t.on("error",a),t.on("end",o),Bf.stat(n,(l,c)=>{if(l)a(l);else{let u=new WRe.ReadStream(n,{readSize:i,size:c.size});u.on("error",a),u.pipe(t)}})});return e?s.then(e,e):s},AV=r=>new oV(r)});var hV=w((rat,lV)=>{"use strict";var ZRe=cf(),KB=SB(),eat=require("fs"),cV=wf(),uV=MB(),gV=require("path"),tat=lV.exports=(r,e,t)=>{if(typeof e=="function"&&(t=e),Array.isArray(r)&&(e=r,r={}),!e||!Array.isArray(e)||!e.length)throw new TypeError("no files or directories specified");e=Array.from(e);let i=ZRe(r);if(i.sync&&typeof t=="function")throw new TypeError("callback not supported for sync tar functions");if(!i.file&&typeof t=="function")throw new TypeError("callback only supported with file option");return i.file&&i.sync?$Re(i,e):i.file?eFe(i,e,t):i.sync?tFe(i,e):rFe(i,e)},$Re=(r,e)=>{let t=new KB.Sync(r),i=new cV.WriteStreamSync(r.file,{mode:r.mode||438});t.pipe(i),fV(t,e)},eFe=(r,e,t)=>{let i=new KB(r),n=new cV.WriteStream(r.file,{mode:r.mode||438});i.pipe(n);let s=new Promise((o,a)=>{n.on("error",a),n.on("close",o),i.on("error",a)});return VD(i,e),t?s.then(t,t):s},fV=(r,e)=>{e.forEach(t=>{t.charAt(0)==="@"?uV({file:gV.resolve(r.cwd,t.substr(1)),sync:!0,noResume:!0,onentry:i=>r.add(i)}):r.add(t)}),r.end()},VD=(r,e)=>{for(;e.length;){let t=e.shift();if(t.charAt(0)==="@")return uV({file:gV.resolve(r.cwd,t.substr(1)),noResume:!0,onentry:i=>r.add(i)}).then(i=>VD(r,e));r.add(t)}r.end()},tFe=(r,e)=>{let t=new KB.Sync(r);return fV(t,e),t},rFe=(r,e)=>{let t=new KB(r);return VD(t,e),t}});var XD=w((sat,pV)=>{"use strict";var iFe=cf(),dV=SB(),iat=nC(),Gs=require("fs"),CV=wf(),mV=MB(),EV=require("path"),IV=hf(),nat=pV.exports=(r,e,t)=>{let i=iFe(r);if(!i.file)throw new TypeError("file is required");if(i.gzip)throw new TypeError("cannot append to compressed archives");if(!e||!Array.isArray(e)||!e.length)throw new TypeError("no files or directories specified");return e=Array.from(e),i.sync?nFe(i,e):sFe(i,e,t)},nFe=(r,e)=>{let t=new dV.Sync(r),i=!0,n,s;try{try{n=Gs.openSync(r.file,"r+")}catch(l){if(l.code==="ENOENT")n=Gs.openSync(r.file,"w+");else throw l}let o=Gs.fstatSync(n),a=Buffer.alloc(512);e:for(s=0;so.size)break;s+=c,r.mtimeCache&&r.mtimeCache.set(l.path,l.mtime)}i=!1,oFe(r,t,s,n,e)}finally{if(i)try{Gs.closeSync(n)}catch(o){}}},oFe=(r,e,t,i,n)=>{let s=new CV.WriteStreamSync(r.file,{fd:i,start:t});e.pipe(s),aFe(e,n)},sFe=(r,e,t)=>{e=Array.from(e);let i=new dV(r),n=(o,a,l)=>{let c=(p,m)=>{p?Gs.close(o,y=>l(p)):l(null,m)},u=0;if(a===0)return c(null,0);let g=0,f=Buffer.alloc(512),h=(p,m)=>{if(p)return c(p);if(g+=m,g<512&&m)return Gs.read(o,f,g,f.length-g,u+g,h);if(u===0&&f[0]===31&&f[1]===139)return c(new Error("cannot append to compressed archives"));if(g<512)return c(null,u);let y=new IV(f);if(!y.cksumValid)return c(null,u);let b=512*Math.ceil(y.size/512);if(u+b+512>a||(u+=b+512,u>=a))return c(null,u);r.mtimeCache&&r.mtimeCache.set(y.path,y.mtime),g=0,Gs.read(o,f,0,512,u,h)};Gs.read(o,f,0,512,u,h)},s=new Promise((o,a)=>{i.on("error",a);let l="r+",c=(u,g)=>{if(u&&u.code==="ENOENT"&&l==="r+")return l="w+",Gs.open(r.file,l,c);if(u)return a(u);Gs.fstat(g,(f,h)=>{if(f)return a(f);n(g,h.size,(p,m)=>{if(p)return a(p);let y=new CV.WriteStream(r.file,{fd:g,start:m});i.pipe(y),y.on("error",a),y.on("close",o),yV(i,e)})})};Gs.open(r.file,l,c)});return t?s.then(t,t):s},aFe=(r,e)=>{e.forEach(t=>{t.charAt(0)==="@"?mV({file:EV.resolve(r.cwd,t.substr(1)),sync:!0,noResume:!0,onentry:i=>r.add(i)}):r.add(t)}),r.end()},yV=(r,e)=>{for(;e.length;){let t=e.shift();if(t.charAt(0)==="@")return mV({file:EV.resolve(r.cwd,t.substr(1)),noResume:!0,onentry:i=>r.add(i)}).then(i=>yV(r,e));r.add(t)}r.end()}});var BV=w((aat,wV)=>{"use strict";var AFe=cf(),lFe=XD(),oat=wV.exports=(r,e,t)=>{let i=AFe(r);if(!i.file)throw new TypeError("file is required");if(i.gzip)throw new TypeError("cannot append to compressed archives");if(!e||!Array.isArray(e)||!e.length)throw new TypeError("no files or directories specified");return e=Array.from(e),cFe(i),lFe(i,e,t)},cFe=r=>{let e=r.filter;r.mtimeCache||(r.mtimeCache=new Map),r.filter=e?(t,i)=>e(t,i)&&!(r.mtimeCache.get(t)>i.mtime):(t,i)=>!(r.mtimeCache.get(t)>i.mtime)}});var SV=w((Aat,bV)=>{var{promisify:QV}=require("util"),Pl=require("fs"),uFe=r=>{if(!r)r={mode:511,fs:Pl};else if(typeof r=="object")r=N({mode:511,fs:Pl},r);else if(typeof r=="number")r={mode:r,fs:Pl};else if(typeof r=="string")r={mode:parseInt(r,8),fs:Pl};else throw new TypeError("invalid options argument");return r.mkdir=r.mkdir||r.fs.mkdir||Pl.mkdir,r.mkdirAsync=QV(r.mkdir),r.stat=r.stat||r.fs.stat||Pl.stat,r.statAsync=QV(r.stat),r.statSync=r.statSync||r.fs.statSync||Pl.statSync,r.mkdirSync=r.mkdirSync||r.fs.mkdirSync||Pl.mkdirSync,r};bV.exports=uFe});var xV=w((lat,vV)=>{var gFe=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,{resolve:fFe,parse:hFe}=require("path"),pFe=r=>{if(/\0/.test(r))throw Object.assign(new TypeError("path must be a string without null bytes"),{path:r,code:"ERR_INVALID_ARG_VALUE"});if(r=fFe(r),gFe==="win32"){let e=/[*|"<>?:]/,{root:t}=hFe(r);if(e.test(r.substr(t.length)))throw Object.assign(new Error("Illegal characters in path."),{path:r,code:"EINVAL"})}return r};vV.exports=pFe});var FV=w((cat,kV)=>{var{dirname:PV}=require("path"),DV=(r,e,t=void 0)=>t===e?Promise.resolve():r.statAsync(e).then(i=>i.isDirectory()?t:void 0,i=>i.code==="ENOENT"?DV(r,PV(e),e):void 0),RV=(r,e,t=void 0)=>{if(t!==e)try{return r.statSync(e).isDirectory()?t:void 0}catch(i){return i.code==="ENOENT"?RV(r,PV(e),e):void 0}};kV.exports={findMade:DV,findMadeSync:RV}});var eR=w((uat,NV)=>{var{dirname:LV}=require("path"),ZD=(r,e,t)=>{e.recursive=!1;let i=LV(r);return i===r?e.mkdirAsync(r,e).catch(n=>{if(n.code!=="EISDIR")throw n}):e.mkdirAsync(r,e).then(()=>t||r,n=>{if(n.code==="ENOENT")return ZD(i,e).then(s=>ZD(r,e,s));if(n.code!=="EEXIST"&&n.code!=="EROFS")throw n;return e.statAsync(r).then(s=>{if(s.isDirectory())return t;throw n},()=>{throw n})})},$D=(r,e,t)=>{let i=LV(r);if(e.recursive=!1,i===r)try{return e.mkdirSync(r,e)}catch(n){if(n.code!=="EISDIR")throw n;return}try{return e.mkdirSync(r,e),t||r}catch(n){if(n.code==="ENOENT")return $D(r,e,$D(i,e,t));if(n.code!=="EEXIST"&&n.code!=="EROFS")throw n;try{if(!e.statSync(r).isDirectory())throw n}catch(s){throw n}}};NV.exports={mkdirpManual:ZD,mkdirpManualSync:$D}});var MV=w((gat,TV)=>{var{dirname:OV}=require("path"),{findMade:dFe,findMadeSync:CFe}=FV(),{mkdirpManual:mFe,mkdirpManualSync:EFe}=eR(),IFe=(r,e)=>(e.recursive=!0,OV(r)===r?e.mkdirAsync(r,e):dFe(e,r).then(i=>e.mkdirAsync(r,e).then(()=>i).catch(n=>{if(n.code==="ENOENT")return mFe(r,e);throw n}))),yFe=(r,e)=>{if(e.recursive=!0,OV(r)===r)return e.mkdirSync(r,e);let i=CFe(e,r);try{return e.mkdirSync(r,e),i}catch(n){if(n.code==="ENOENT")return EFe(r,e);throw n}};TV.exports={mkdirpNative:IFe,mkdirpNativeSync:yFe}});var jV=w((fat,KV)=>{var UV=require("fs"),wFe=process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version,tR=wFe.replace(/^v/,"").split("."),HV=+tR[0]>10||+tR[0]==10&&+tR[1]>=12,BFe=HV?r=>r.mkdir===UV.mkdir:()=>!1,bFe=HV?r=>r.mkdirSync===UV.mkdirSync:()=>!1;KV.exports={useNative:BFe,useNativeSync:bFe}});var zV=w((hat,GV)=>{var bf=SV(),Qf=xV(),{mkdirpNative:YV,mkdirpNativeSync:qV}=MV(),{mkdirpManual:JV,mkdirpManualSync:WV}=eR(),{useNative:QFe,useNativeSync:SFe}=jV(),Sf=(r,e)=>(r=Qf(r),e=bf(e),QFe(e)?YV(r,e):JV(r,e)),vFe=(r,e)=>(r=Qf(r),e=bf(e),SFe(e)?qV(r,e):WV(r,e));Sf.sync=vFe;Sf.native=(r,e)=>YV(Qf(r),bf(e));Sf.manual=(r,e)=>JV(Qf(r),bf(e));Sf.nativeSync=(r,e)=>qV(Qf(r),bf(e));Sf.manualSync=(r,e)=>WV(Qf(r),bf(e));GV.exports=Sf});var t6=w((pat,_V)=>{"use strict";var Ys=require("fs"),uu=require("path"),xFe=Ys.lchown?"lchown":"chown",kFe=Ys.lchownSync?"lchownSync":"chownSync",VV=Ys.lchown&&!process.version.match(/v1[1-9]+\./)&&!process.version.match(/v10\.[6-9]/),XV=(r,e,t)=>{try{return Ys[kFe](r,e,t)}catch(i){if(i.code!=="ENOENT")throw i}},PFe=(r,e,t)=>{try{return Ys.chownSync(r,e,t)}catch(i){if(i.code!=="ENOENT")throw i}},DFe=VV?(r,e,t,i)=>n=>{!n||n.code!=="EISDIR"?i(n):Ys.chown(r,e,t,i)}:(r,e,t,i)=>i,rR=VV?(r,e,t)=>{try{return XV(r,e,t)}catch(i){if(i.code!=="EISDIR")throw i;PFe(r,e,t)}}:(r,e,t)=>XV(r,e,t),RFe=process.version,ZV=(r,e,t)=>Ys.readdir(r,e,t),FFe=(r,e)=>Ys.readdirSync(r,e);/^v4\./.test(RFe)&&(ZV=(r,e,t)=>Ys.readdir(r,t));var UB=(r,e,t,i)=>{Ys[xFe](r,e,t,DFe(r,e,t,n=>{i(n&&n.code!=="ENOENT"?n:null)}))},$V=(r,e,t,i,n)=>{if(typeof e=="string")return Ys.lstat(uu.resolve(r,e),(s,o)=>{if(s)return n(s.code!=="ENOENT"?s:null);o.name=e,$V(r,o,t,i,n)});if(e.isDirectory())iR(uu.resolve(r,e.name),t,i,s=>{if(s)return n(s);let o=uu.resolve(r,e.name);UB(o,t,i,n)});else{let s=uu.resolve(r,e.name);UB(s,t,i,n)}},iR=(r,e,t,i)=>{ZV(r,{withFileTypes:!0},(n,s)=>{if(n){if(n.code==="ENOENT")return i();if(n.code!=="ENOTDIR"&&n.code!=="ENOTSUP")return i(n)}if(n||!s.length)return UB(r,e,t,i);let o=s.length,a=null,l=c=>{if(!a){if(c)return i(a=c);if(--o==0)return UB(r,e,t,i)}};s.forEach(c=>$V(r,c,e,t,l))})},NFe=(r,e,t,i)=>{if(typeof e=="string")try{let n=Ys.lstatSync(uu.resolve(r,e));n.name=e,e=n}catch(n){if(n.code==="ENOENT")return;throw n}e.isDirectory()&&e6(uu.resolve(r,e.name),t,i),rR(uu.resolve(r,e.name),t,i)},e6=(r,e,t)=>{let i;try{i=FFe(r,{withFileTypes:!0})}catch(n){if(n.code==="ENOENT")return;if(n.code==="ENOTDIR"||n.code==="ENOTSUP")return rR(r,e,t);throw n}return i&&i.length&&i.forEach(n=>NFe(r,n,e,t)),rR(r,e,t)};_V.exports=iR;iR.sync=e6});var s6=w((mat,nR)=>{"use strict";var r6=zV(),qs=require("fs"),HB=require("path"),i6=t6(),sR=class extends Error{constructor(e,t){super("Cannot extract through symbolic link");this.path=t,this.symlink=e}get name(){return"SylinkError"}},sC=class extends Error{constructor(e,t){super(t+": Cannot cd into '"+e+"'");this.path=e,this.code=t}get name(){return"CwdError"}},dat=nR.exports=(r,e,t)=>{let i=e.umask,n=e.mode|448,s=(n&i)!=0,o=e.uid,a=e.gid,l=typeof o=="number"&&typeof a=="number"&&(o!==e.processUid||a!==e.processGid),c=e.preserve,u=e.unlink,g=e.cache,f=e.cwd,h=(y,b)=>{y?t(y):(g.set(r,!0),b&&l?i6(b,o,a,v=>h(v)):s?qs.chmod(r,n,t):t())};if(g&&g.get(r)===!0)return h();if(r===f)return qs.stat(r,(y,b)=>{(y||!b.isDirectory())&&(y=new sC(r,y&&y.code||"ENOTDIR")),h(y)});if(c)return r6(r,{mode:n}).then(y=>h(null,y),h);let m=HB.relative(f,r).split(/\/|\\/);jB(f,m,n,g,u,f,null,h)},jB=(r,e,t,i,n,s,o,a)=>{if(!e.length)return a(null,o);let l=e.shift(),c=r+"/"+l;if(i.get(c))return jB(c,e,t,i,n,s,o,a);qs.mkdir(c,t,n6(c,e,t,i,n,s,o,a))},n6=(r,e,t,i,n,s,o,a)=>l=>{if(l){if(l.path&&HB.dirname(l.path)===s&&(l.code==="ENOTDIR"||l.code==="ENOENT"))return a(new sC(s,l.code));qs.lstat(r,(c,u)=>{if(c)a(c);else if(u.isDirectory())jB(r,e,t,i,n,s,o,a);else if(n)qs.unlink(r,g=>{if(g)return a(g);qs.mkdir(r,t,n6(r,e,t,i,n,s,o,a))});else{if(u.isSymbolicLink())return a(new sR(r,r+"/"+e.join("/")));a(l)}})}else o=o||r,jB(r,e,t,i,n,s,o,a)},Cat=nR.exports.sync=(r,e)=>{let t=e.umask,i=e.mode|448,n=(i&t)!=0,s=e.uid,o=e.gid,a=typeof s=="number"&&typeof o=="number"&&(s!==e.processUid||o!==e.processGid),l=e.preserve,c=e.unlink,u=e.cache,g=e.cwd,f=y=>{u.set(r,!0),y&&a&&i6.sync(y,s,o),n&&qs.chmodSync(r,i)};if(u&&u.get(r)===!0)return f();if(r===g){let y=!1,b="ENOTDIR";try{y=qs.statSync(r).isDirectory()}catch(v){b=v.code}finally{if(!y)throw new sC(r,b)}f();return}if(l)return f(r6.sync(r,i));let p=HB.relative(g,r).split(/\/|\\/),m=null;for(let y=p.shift(),b=g;y&&(b+="/"+y);y=p.shift())if(!u.get(b))try{qs.mkdirSync(b,i),m=m||b,u.set(b,!0)}catch(v){if(v.path&&HB.dirname(v.path)===g&&(v.code==="ENOTDIR"||v.code==="ENOENT"))return new sC(g,v.code);let x=qs.lstatSync(b);if(x.isDirectory()){u.set(b,!0);continue}else if(c){qs.unlinkSync(b),qs.mkdirSync(b,i),m=m||b,u.set(b,!0);continue}else if(x.isSymbolicLink())return new sR(b,b+"/"+p.join("/"))}return f(m)}});var A6=w((Eat,o6)=>{var a6=require("assert");o6.exports=()=>{let r=new Map,e=new Map,{join:t}=require("path"),i=u=>t(u).split(/[\\\/]/).slice(0,-1).reduce((g,f)=>g.length?g.concat(t(g[g.length-1],f)):[f],[]),n=new Set,s=u=>{let g=e.get(u);if(!g)throw new Error("function does not have any path reservations");return{paths:g.paths.map(f=>r.get(f)),dirs:[...g.dirs].map(f=>r.get(f))}},o=u=>{let{paths:g,dirs:f}=s(u);return g.every(h=>h[0]===u)&&f.every(h=>h[0]instanceof Set&&h[0].has(u))},a=u=>n.has(u)||!o(u)?!1:(n.add(u),u(()=>l(u)),!0),l=u=>{if(!n.has(u))return!1;let{paths:g,dirs:f}=e.get(u),h=new Set;return g.forEach(p=>{let m=r.get(p);a6.equal(m[0],u),m.length===1?r.delete(p):(m.shift(),typeof m[0]=="function"?h.add(m[0]):m[0].forEach(y=>h.add(y)))}),f.forEach(p=>{let m=r.get(p);a6(m[0]instanceof Set),m[0].size===1&&m.length===1?r.delete(p):m[0].size===1?(m.shift(),h.add(m[0])):m[0].delete(u)}),n.delete(u),h.forEach(p=>a(p)),!0};return{check:o,reserve:(u,g)=>{let f=new Set(u.map(h=>i(h)).reduce((h,p)=>h.concat(p)));return e.set(g,{dirs:f,paths:u}),u.forEach(h=>{let p=r.get(h);p?p.push(g):r.set(h,[g])}),f.forEach(h=>{let p=r.get(h);p?p[p.length-1]instanceof Set?p[p.length-1].add(g):p.push(new Set([g])):r.set(h,[new Set([g])])}),a(g)}}}});var u6=w((Iat,l6)=>{var LFe=process.env.__FAKE_PLATFORM__||process.platform,TFe=LFe==="win32",OFe=global.__FAKE_TESTING_FS__||require("fs"),{O_CREAT:MFe,O_TRUNC:KFe,O_WRONLY:UFe,UV_FS_O_FILEMAP:c6=0}=OFe.constants,HFe=TFe&&!!c6,jFe=512*1024,GFe=c6|KFe|MFe|UFe;l6.exports=HFe?r=>r"w"});var hR=w((bat,g6)=>{"use strict";var YFe=require("assert"),yat=require("events").EventEmitter,qFe=nC(),$t=require("fs"),JFe=wf(),fA=require("path"),oR=s6(),wat=oR.sync,f6=yD(),WFe=A6(),h6=Symbol("onEntry"),aR=Symbol("checkFs"),p6=Symbol("checkFs2"),AR=Symbol("isReusable"),hA=Symbol("makeFs"),lR=Symbol("file"),cR=Symbol("directory"),GB=Symbol("link"),d6=Symbol("symlink"),C6=Symbol("hardlink"),m6=Symbol("unsupported"),Bat=Symbol("unknown"),E6=Symbol("checkPath"),vf=Symbol("mkdir"),dn=Symbol("onError"),YB=Symbol("pending"),I6=Symbol("pend"),xf=Symbol("unpend"),uR=Symbol("ended"),gR=Symbol("maybeClose"),fR=Symbol("skip"),oC=Symbol("doChown"),aC=Symbol("uid"),AC=Symbol("gid"),y6=require("crypto"),w6=u6(),qB=()=>{throw new Error("sync function called cb somehow?!?")},zFe=(r,e)=>{if(process.platform!=="win32")return $t.unlink(r,e);let t=r+".DELETE."+y6.randomBytes(16).toString("hex");$t.rename(r,t,i=>{if(i)return e(i);$t.unlink(t,e)})},_Fe=r=>{if(process.platform!=="win32")return $t.unlinkSync(r);let e=r+".DELETE."+y6.randomBytes(16).toString("hex");$t.renameSync(r,e),$t.unlinkSync(e)},B6=(r,e,t)=>r===r>>>0?r:e===e>>>0?e:t,JB=class extends qFe{constructor(e){if(e||(e={}),e.ondone=t=>{this[uR]=!0,this[gR]()},super(e),this.reservations=WFe(),this.transform=typeof e.transform=="function"?e.transform:null,this.writable=!0,this.readable=!1,this[YB]=0,this[uR]=!1,this.dirCache=e.dirCache||new Map,typeof e.uid=="number"||typeof e.gid=="number"){if(typeof e.uid!="number"||typeof e.gid!="number")throw new TypeError("cannot set owner without number uid and gid");if(e.preserveOwner)throw new TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=e.uid,this.gid=e.gid,this.setOwner=!0}else this.uid=null,this.gid=null,this.setOwner=!1;e.preserveOwner===void 0&&typeof e.uid!="number"?this.preserveOwner=process.getuid&&process.getuid()===0:this.preserveOwner=!!e.preserveOwner,this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():null,this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():null,this.forceChown=e.forceChown===!0,this.win32=!!e.win32||process.platform==="win32",this.newer=!!e.newer,this.keep=!!e.keep,this.noMtime=!!e.noMtime,this.preservePaths=!!e.preservePaths,this.unlink=!!e.unlink,this.cwd=fA.resolve(e.cwd||process.cwd()),this.strip=+e.strip||0,this.processUmask=process.umask(),this.umask=typeof e.umask=="number"?e.umask:this.processUmask,this.dmode=e.dmode||511&~this.umask,this.fmode=e.fmode||438&~this.umask,this.on("entry",t=>this[h6](t))}warn(e,t,i={}){return(e==="TAR_BAD_ARCHIVE"||e==="TAR_ABORT")&&(i.recoverable=!1),super.warn(e,t,i)}[gR](){this[uR]&&this[YB]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"),this.emit("close"))}[E6](e){if(this.strip){let t=e.path.split(/\/|\\/);if(t.length=this.strip&&(e.linkpath=i.slice(this.strip).join("/"))}}if(!this.preservePaths){let t=e.path;if(t.match(/(^|\/|\\)\.\.(\\|\/|$)/))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:e,path:t}),!1;if(fA.win32.isAbsolute(t)){let i=fA.win32.parse(t);e.path=t.substr(i.root.length);let n=i.root;this.warn("TAR_ENTRY_INFO",`stripping ${n} from absolute path`,{entry:e,path:t})}}if(this.win32){let t=fA.win32.parse(e.path);e.path=t.root===""?f6.encode(e.path):t.root+f6.encode(e.path.substr(t.root.length))}return fA.isAbsolute(e.path)?e.absolute=e.path:e.absolute=fA.resolve(this.cwd,e.path),!0}[h6](e){if(!this[E6](e))return e.resume();switch(YFe.equal(typeof e.absolute,"string"),e.type){case"Directory":case"GNUDumpDir":e.mode&&(e.mode=e.mode|448);case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[aR](e);case"CharacterDevice":case"BlockDevice":case"FIFO":return this[m6](e)}}[dn](e,t){e.name==="CwdError"?this.emit("error",e):(this.warn("TAR_ENTRY_ERROR",e,{entry:t}),this[xf](),t.resume())}[vf](e,t,i){oR(e,{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:t},i)}[oC](e){return this.forceChown||this.preserveOwner&&(typeof e.uid=="number"&&e.uid!==this.processUid||typeof e.gid=="number"&&e.gid!==this.processGid)||typeof this.uid=="number"&&this.uid!==this.processUid||typeof this.gid=="number"&&this.gid!==this.processGid}[aC](e){return B6(this.uid,e.uid,this.processUid)}[AC](e){return B6(this.gid,e.gid,this.processGid)}[lR](e,t){let i=e.mode&4095||this.fmode,n=new JFe.WriteStream(e.absolute,{flags:w6(e.size),mode:i,autoClose:!1});n.on("error",l=>this[dn](l,e));let s=1,o=l=>{if(l)return this[dn](l,e);--s==0&&$t.close(n.fd,c=>{t(),c?this[dn](c,e):this[xf]()})};n.on("finish",l=>{let c=e.absolute,u=n.fd;if(e.mtime&&!this.noMtime){s++;let g=e.atime||new Date,f=e.mtime;$t.futimes(u,g,f,h=>h?$t.utimes(c,g,f,p=>o(p&&h)):o())}if(this[oC](e)){s++;let g=this[aC](e),f=this[AC](e);$t.fchown(u,g,f,h=>h?$t.chown(c,g,f,p=>o(p&&h)):o())}o()});let a=this.transform&&this.transform(e)||e;a!==e&&(a.on("error",l=>this[dn](l,e)),e.pipe(a)),a.pipe(n)}[cR](e,t){let i=e.mode&4095||this.dmode;this[vf](e.absolute,i,n=>{if(n)return t(),this[dn](n,e);let s=1,o=a=>{--s==0&&(t(),this[xf](),e.resume())};e.mtime&&!this.noMtime&&(s++,$t.utimes(e.absolute,e.atime||new Date,e.mtime,o)),this[oC](e)&&(s++,$t.chown(e.absolute,this[aC](e),this[AC](e),o)),o()})}[m6](e){e.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${e.type}`,{entry:e}),e.resume()}[d6](e,t){this[GB](e,e.linkpath,"symlink",t)}[C6](e,t){this[GB](e,fA.resolve(this.cwd,e.linkpath),"link",t)}[I6](){this[YB]++}[xf](){this[YB]--,this[gR]()}[fR](e){this[xf](),e.resume()}[AR](e,t){return e.type==="File"&&!this.unlink&&t.isFile()&&t.nlink<=1&&process.platform!=="win32"}[aR](e){this[I6]();let t=[e.path];e.linkpath&&t.push(e.linkpath),this.reservations.reserve(t,i=>this[p6](e,i))}[p6](e,t){this[vf](fA.dirname(e.absolute),this.dmode,i=>{if(i)return t(),this[dn](i,e);$t.lstat(e.absolute,(n,s)=>{s&&(this.keep||this.newer&&s.mtime>e.mtime)?(this[fR](e),t()):n||this[AR](e,s)?this[hA](null,e,t):s.isDirectory()?e.type==="Directory"?!e.mode||(s.mode&4095)===e.mode?this[hA](null,e,t):$t.chmod(e.absolute,e.mode,o=>this[hA](o,e,t)):$t.rmdir(e.absolute,o=>this[hA](o,e,t)):zFe(e.absolute,o=>this[hA](o,e,t))})})}[hA](e,t,i){if(e)return this[dn](e,t);switch(t.type){case"File":case"OldFile":case"ContiguousFile":return this[lR](t,i);case"Link":return this[C6](t,i);case"SymbolicLink":return this[d6](t,i);case"Directory":case"GNUDumpDir":return this[cR](t,i)}}[GB](e,t,i,n){$t[i](t,e.absolute,s=>{if(s)return this[dn](s,e);n(),this[xf](),e.resume()})}},b6=class extends JB{constructor(e){super(e)}[aR](e){let t=this[vf](fA.dirname(e.absolute),this.dmode,qB);if(t)return this[dn](t,e);try{let i=$t.lstatSync(e.absolute);if(this.keep||this.newer&&i.mtime>e.mtime)return this[fR](e);if(this[AR](e,i))return this[hA](null,e,qB);try{return i.isDirectory()?e.type==="Directory"?e.mode&&(i.mode&4095)!==e.mode&&$t.chmodSync(e.absolute,e.mode):$t.rmdirSync(e.absolute):_Fe(e.absolute),this[hA](null,e,qB)}catch(n){return this[dn](n,e)}}catch(i){return this[hA](null,e,qB)}}[lR](e,t){let i=e.mode&4095||this.fmode,n=l=>{let c;try{$t.closeSync(o)}catch(u){c=u}(l||c)&&this[dn](l||c,e)},s,o;try{o=$t.openSync(e.absolute,w6(e.size),i)}catch(l){return n(l)}let a=this.transform&&this.transform(e)||e;a!==e&&(a.on("error",l=>this[dn](l,e)),e.pipe(a)),a.on("data",l=>{try{$t.writeSync(o,l,0,l.length)}catch(c){n(c)}}),a.on("end",l=>{let c=null;if(e.mtime&&!this.noMtime){let u=e.atime||new Date,g=e.mtime;try{$t.futimesSync(o,u,g)}catch(f){try{$t.utimesSync(e.absolute,u,g)}catch(h){c=f}}}if(this[oC](e)){let u=this[aC](e),g=this[AC](e);try{$t.fchownSync(o,u,g)}catch(f){try{$t.chownSync(e.absolute,u,g)}catch(h){c=c||f}}}n(c)})}[cR](e,t){let i=e.mode&4095||this.dmode,n=this[vf](e.absolute,i);if(n)return this[dn](n,e);if(e.mtime&&!this.noMtime)try{$t.utimesSync(e.absolute,e.atime||new Date,e.mtime)}catch(s){}if(this[oC](e))try{$t.chownSync(e.absolute,this[aC](e),this[AC](e))}catch(s){}e.resume()}[vf](e,t){try{return oR.sync(e,{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:t})}catch(i){return i}}[GB](e,t,i,n){try{$t[i+"Sync"](t,e.absolute),e.resume()}catch(s){return this[dn](s,e)}}};JB.Sync=b6;g6.exports=JB});var k6=w((Sat,Q6)=>{"use strict";var VFe=cf(),WB=hR(),S6=require("fs"),v6=wf(),x6=require("path"),Qat=Q6.exports=(r,e,t)=>{typeof r=="function"?(t=r,e=null,r={}):Array.isArray(r)&&(e=r,r={}),typeof e=="function"&&(t=e,e=null),e?e=Array.from(e):e=[];let i=VFe(r);if(i.sync&&typeof t=="function")throw new TypeError("callback not supported for sync tar functions");if(!i.file&&typeof t=="function")throw new TypeError("callback only supported with file option");return e.length&&XFe(i,e),i.file&&i.sync?ZFe(i):i.file?$Fe(i,t):i.sync?eNe(i):tNe(i)},XFe=(r,e)=>{let t=new Map(e.map(s=>[s.replace(/\/+$/,""),!0])),i=r.filter,n=(s,o)=>{let a=o||x6.parse(s).root||".",l=s===a?!1:t.has(s)?t.get(s):n(x6.dirname(s),a);return t.set(s,l),l};r.filter=i?(s,o)=>i(s,o)&&n(s.replace(/\/+$/,"")):s=>n(s.replace(/\/+$/,""))},ZFe=r=>{let e=new WB.Sync(r),t=r.file,i=!0,n,s=S6.statSync(t),o=r.maxReadSize||16*1024*1024;new v6.ReadStreamSync(t,{readSize:o,size:s.size}).pipe(e)},$Fe=(r,e)=>{let t=new WB(r),i=r.maxReadSize||16*1024*1024,n=r.file,s=new Promise((o,a)=>{t.on("error",a),t.on("close",o),S6.stat(n,(l,c)=>{if(l)a(l);else{let u=new v6.ReadStream(n,{readSize:i,size:c.size});u.on("error",a),u.pipe(t)}})});return e?s.then(e,e):s},eNe=r=>new WB.Sync(r),tNe=r=>new WB(r)});var P6=w(pi=>{"use strict";pi.c=pi.create=hV();pi.r=pi.replace=XD();pi.t=pi.list=MB();pi.u=pi.update=BV();pi.x=pi.extract=k6();pi.Pack=SB();pi.Unpack=hR();pi.Parse=nC();pi.ReadEntry=Zd();pi.WriteEntry=xD();pi.Header=hf();pi.Pax=gB();pi.types=Xd()});var L6=w((kat,N6)=>{var dR;N6.exports.getContent=()=>(typeof dR=="undefined"&&(dR=require("zlib").brotliDecompressSync(Buffer.from("W1YWV8M2Bm73erNK/X8Ao59vhTJuj9A5ts0kuKSIx2QXjDzsGUs8PbdVZG5L6XYdVdXEZDLGumN1mwNUlCz73iKPJZC1igLZRK2zc13JaeOOPfeI2pEQlNZxCCqfcByDjjBMiKtBg7utoxYaTXZNuOE10KOQ8BnumEiaeYZZ1yOG2/yN3T9Q6UbzsAqJzf62LV/qfysaEstGqsaGu18PWSv9ilJB+HenKQgyx5MHJk6bcH05DqofPku3C5V3rL8N/hZQYNx6JTAkU5btGjpyS8/xyie/f75Ov36pjkul8GI6pmLhjLV9Q4a6yM+q9EAONZuZ5uu75Hg4UCXZgJzjYjowVu5wb6e97Ti9aFQ7qZlDPY1de830PV3T4NfglBN12SWPCeLe7jdBQJmIbojYfPmS/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/ePUhP7HrHcC0o2gWI4CVW+RWgv7CqIZ/9X1lmAPXI+Y+XtanZQ9/YnC7qAGxqi+QazGaH3BKVB7iCi6P2sGBfHBtyKI7m4fmOCOJ1bPebG250slOEaXVYUmmkS8qL4qz18G78fW/38Iqdd92DSWNioJz4vLl8hmIrR+itRWzmQP+5rk3ASeI9XfTEC22qejk7EQU8SJGPk4+blgvtg7WB6x1yh4CNF0+XEXL+NlLFLqcHJinFlqmjd0OzrSnFjdb5nm2+tDjuQwTKBQ9l8=","base64")).toString()),dR)});var H6=w((CR,U6)=>{(function(r,e){typeof CR=="object"?U6.exports=e():typeof define=="function"&&define.amd?define(e):r.treeify=e()})(CR,function(){function r(n,s){var o=s?"\u2514":"\u251C";return n?o+="\u2500 ":o+="\u2500\u2500\u2510",o}function e(n,s){var o=[];for(var a in n)!n.hasOwnProperty(a)||s&&typeof n[a]=="function"||o.push(a);return o}function t(n,s,o,a,l,c,u){var g="",f=0,h,p,m=a.slice(0);if(m.push([s,o])&&a.length>0&&(a.forEach(function(b,v){v>0&&(g+=(b[1]?" ":"\u2502")+" "),!p&&b[0]===s&&(p=!0)}),g+=r(n,o)+n,l&&(typeof s!="object"||s instanceof Date)&&(g+=": "+s),p&&(g+=" (circular ref.)"),u(g)),!p&&typeof s=="object"){var y=e(s,c);y.forEach(function(b){h=++f===y.length,t(b,s[b],h,m,l,c,u)})}}var i={};return i.asLines=function(n,s,o,a){var l=typeof o!="function"?o:!1;t(".",n,!1,[],s,l,a||o)},i.asTree=function(n,s,o){var a="";return t(".",n,!1,[],s,o,function(l){a+=l+` -`}),a},i})});var _B=w((sAt,X6)=>{var ENe=Ks(),INe=Id(),yNe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,wNe=/^\w*$/;function BNe(r,e){if(ENe(r))return!1;var t=typeof r;return t=="number"||t=="symbol"||t=="boolean"||r==null||INe(r)?!0:wNe.test(r)||!yNe.test(r)||e!=null&&r in Object(e)}X6.exports=BNe});var VB=w((oAt,Z6)=>{var bNe=Wc(),QNe=Rn(),SNe="[object AsyncFunction]",vNe="[object Function]",xNe="[object GeneratorFunction]",kNe="[object Proxy]";function PNe(r){if(!QNe(r))return!1;var e=bNe(r);return e==vNe||e==xNe||e==SNe||e==kNe}Z6.exports=PNe});var e7=w((aAt,$6)=>{var DNe=Ns(),RNe=DNe["__core-js_shared__"];$6.exports=RNe});var i7=w((AAt,t7)=>{var QR=e7(),r7=function(){var r=/[^.]+$/.exec(QR&&QR.keys&&QR.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function FNe(r){return!!r7&&r7 in r}t7.exports=FNe});var SR=w((lAt,n7)=>{var NNe=Function.prototype,LNe=NNe.toString;function TNe(r){if(r!=null){try{return LNe.call(r)}catch(e){}try{return r+""}catch(e){}}return""}n7.exports=TNe});var o7=w((cAt,s7)=>{var ONe=VB(),MNe=i7(),KNe=Rn(),UNe=SR(),HNe=/[\\^$.*+?()[\]{}|]/g,jNe=/^\[object .+?Constructor\]$/,GNe=Function.prototype,YNe=Object.prototype,qNe=GNe.toString,JNe=YNe.hasOwnProperty,WNe=RegExp("^"+qNe.call(JNe).replace(HNe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function zNe(r){if(!KNe(r)||MNe(r))return!1;var e=ONe(r)?WNe:jNe;return e.test(UNe(r))}s7.exports=zNe});var A7=w((uAt,a7)=>{function _Ne(r,e){return r==null?void 0:r[e]}a7.exports=_Ne});var Rl=w((gAt,l7)=>{var VNe=o7(),XNe=A7();function ZNe(r,e){var t=XNe(r,e);return VNe(t)?t:void 0}l7.exports=ZNe});var cC=w((fAt,c7)=>{var $Ne=Rl(),eLe=$Ne(Object,"create");c7.exports=eLe});var f7=w((hAt,u7)=>{var g7=cC();function tLe(){this.__data__=g7?g7(null):{},this.size=0}u7.exports=tLe});var p7=w((pAt,h7)=>{function rLe(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}h7.exports=rLe});var C7=w((dAt,d7)=>{var iLe=cC(),nLe="__lodash_hash_undefined__",sLe=Object.prototype,oLe=sLe.hasOwnProperty;function aLe(r){var e=this.__data__;if(iLe){var t=e[r];return t===nLe?void 0:t}return oLe.call(e,r)?e[r]:void 0}d7.exports=aLe});var E7=w((CAt,m7)=>{var ALe=cC(),lLe=Object.prototype,cLe=lLe.hasOwnProperty;function uLe(r){var e=this.__data__;return ALe?e[r]!==void 0:cLe.call(e,r)}m7.exports=uLe});var y7=w((mAt,I7)=>{var gLe=cC(),fLe="__lodash_hash_undefined__";function hLe(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=gLe&&e===void 0?fLe:e,this}I7.exports=hLe});var B7=w((EAt,w7)=>{var pLe=f7(),dLe=p7(),CLe=C7(),mLe=E7(),ELe=y7();function kf(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e{function ILe(){this.__data__=[],this.size=0}b7.exports=ILe});var Pf=w((yAt,S7)=>{function yLe(r,e){return r===e||r!==r&&e!==e}S7.exports=yLe});var uC=w((wAt,v7)=>{var wLe=Pf();function BLe(r,e){for(var t=r.length;t--;)if(wLe(r[t][0],e))return t;return-1}v7.exports=BLe});var k7=w((BAt,x7)=>{var bLe=uC(),QLe=Array.prototype,SLe=QLe.splice;function vLe(r){var e=this.__data__,t=bLe(e,r);if(t<0)return!1;var i=e.length-1;return t==i?e.pop():SLe.call(e,t,1),--this.size,!0}x7.exports=vLe});var D7=w((bAt,P7)=>{var xLe=uC();function kLe(r){var e=this.__data__,t=xLe(e,r);return t<0?void 0:e[t][1]}P7.exports=kLe});var F7=w((QAt,R7)=>{var PLe=uC();function DLe(r){return PLe(this.__data__,r)>-1}R7.exports=DLe});var L7=w((SAt,N7)=>{var RLe=uC();function FLe(r,e){var t=this.__data__,i=RLe(t,r);return i<0?(++this.size,t.push([r,e])):t[i][1]=e,this}N7.exports=FLe});var gC=w((vAt,T7)=>{var NLe=Q7(),LLe=k7(),TLe=D7(),OLe=F7(),MLe=L7();function Df(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e{var KLe=Rl(),ULe=Ns(),HLe=KLe(ULe,"Map");O7.exports=HLe});var U7=w((kAt,M7)=>{var K7=B7(),jLe=gC(),GLe=XB();function YLe(){this.size=0,this.__data__={hash:new K7,map:new(GLe||jLe),string:new K7}}M7.exports=YLe});var j7=w((PAt,H7)=>{function qLe(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}H7.exports=qLe});var fC=w((DAt,G7)=>{var JLe=j7();function WLe(r,e){var t=r.__data__;return JLe(e)?t[typeof e=="string"?"string":"hash"]:t.map}G7.exports=WLe});var q7=w((RAt,Y7)=>{var zLe=fC();function _Le(r){var e=zLe(this,r).delete(r);return this.size-=e?1:0,e}Y7.exports=_Le});var W7=w((FAt,J7)=>{var VLe=fC();function XLe(r){return VLe(this,r).get(r)}J7.exports=XLe});var _7=w((NAt,z7)=>{var ZLe=fC();function $Le(r){return ZLe(this,r).has(r)}z7.exports=$Le});var X7=w((LAt,V7)=>{var eTe=fC();function tTe(r,e){var t=eTe(this,r),i=t.size;return t.set(r,e),this.size+=t.size==i?0:1,this}V7.exports=tTe});var ZB=w((TAt,Z7)=>{var rTe=U7(),iTe=q7(),nTe=W7(),sTe=_7(),oTe=X7();function Rf(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e{var eX=ZB(),aTe="Expected a function";function vR(r,e){if(typeof r!="function"||e!=null&&typeof e!="function")throw new TypeError(aTe);var t=function(){var i=arguments,n=e?e.apply(this,i):i[0],s=t.cache;if(s.has(n))return s.get(n);var o=r.apply(this,i);return t.cache=s.set(n,o)||s,o};return t.cache=new(vR.Cache||eX),t}vR.Cache=eX;$7.exports=vR});var iX=w((MAt,rX)=>{var ATe=tX(),lTe=500;function cTe(r){var e=ATe(r,function(i){return t.size===lTe&&t.clear(),i}),t=e.cache;return e}rX.exports=cTe});var sX=w((KAt,nX)=>{var uTe=iX(),gTe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,fTe=/\\(\\)?/g,hTe=uTe(function(r){var e=[];return r.charCodeAt(0)===46&&e.push(""),r.replace(gTe,function(t,i,n,s){e.push(n?s.replace(fTe,"$1"):i||t)}),e});nX.exports=hTe});var Ff=w((UAt,oX)=>{var pTe=Ks(),dTe=_B(),CTe=sX(),mTe=lf();function ETe(r,e){return pTe(r)?r:dTe(r,e)?[r]:CTe(mTe(r))}oX.exports=ETe});var gu=w((HAt,aX)=>{var ITe=Id(),yTe=1/0;function wTe(r){if(typeof r=="string"||ITe(r))return r;var e=r+"";return e=="0"&&1/r==-yTe?"-0":e}aX.exports=wTe});var hC=w((jAt,AX)=>{var BTe=Ff(),bTe=gu();function QTe(r,e){e=BTe(e,r);for(var t=0,i=e.length;r!=null&&t{var STe=Rl(),vTe=function(){try{var r=STe(Object,"defineProperty");return r({},"",{}),r}catch(e){}}();lX.exports=vTe});var Nf=w((YAt,cX)=>{var uX=xR();function xTe(r,e,t){e=="__proto__"&&uX?uX(r,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):r[e]=t}cX.exports=xTe});var $B=w((qAt,gX)=>{var kTe=Nf(),PTe=Pf(),DTe=Object.prototype,RTe=DTe.hasOwnProperty;function FTe(r,e,t){var i=r[e];(!(RTe.call(r,e)&&PTe(i,t))||t===void 0&&!(e in r))&&kTe(r,e,t)}gX.exports=FTe});var pC=w((JAt,fX)=>{var NTe=9007199254740991,LTe=/^(?:0|[1-9]\d*)$/;function TTe(r,e){var t=typeof r;return e=e==null?NTe:e,!!e&&(t=="number"||t!="symbol"&<e.test(r))&&r>-1&&r%1==0&&r{var OTe=$B(),MTe=Ff(),KTe=pC(),pX=Rn(),UTe=gu();function HTe(r,e,t,i){if(!pX(r))return r;e=MTe(e,r);for(var n=-1,s=e.length,o=s-1,a=r;a!=null&&++n{var jTe=hC(),GTe=kR(),YTe=Ff();function qTe(r,e,t){for(var i=-1,n=e.length,s={};++i{function JTe(r,e){return r!=null&&e in Object(r)}mX.exports=JTe});var yX=w((VAt,IX)=>{var WTe=Wc(),zTe=ta(),_Te="[object Arguments]";function VTe(r){return zTe(r)&&WTe(r)==_Te}IX.exports=VTe});var dC=w((XAt,wX)=>{var BX=yX(),XTe=ta(),bX=Object.prototype,ZTe=bX.hasOwnProperty,$Te=bX.propertyIsEnumerable,eOe=BX(function(){return arguments}())?BX:function(r){return XTe(r)&&ZTe.call(r,"callee")&&!$Te.call(r,"callee")};wX.exports=eOe});var e0=w((ZAt,QX)=>{var tOe=9007199254740991;function rOe(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=tOe}QX.exports=rOe});var PR=w(($At,SX)=>{var iOe=Ff(),nOe=dC(),sOe=Ks(),oOe=pC(),aOe=e0(),AOe=gu();function lOe(r,e,t){e=iOe(e,r);for(var i=-1,n=e.length,s=!1;++i{var cOe=EX(),uOe=PR();function gOe(r,e){return r!=null&&uOe(r,e,cOe)}vX.exports=gOe});var kX=w((tlt,xX)=>{var fOe=CX(),hOe=DR();function pOe(r,e){return fOe(r,e,function(t,i){return hOe(r,i)})}xX.exports=pOe});var t0=w((rlt,PX)=>{function dOe(r,e){for(var t=-1,i=e.length,n=r.length;++t{var RX=Jc(),COe=dC(),mOe=Ks(),FX=RX?RX.isConcatSpreadable:void 0;function EOe(r){return mOe(r)||COe(r)||!!(FX&&r&&r[FX])}DX.exports=EOe});var OX=w((nlt,LX)=>{var IOe=t0(),yOe=NX();function TX(r,e,t,i,n){var s=-1,o=r.length;for(t||(t=yOe),n||(n=[]);++s0&&t(a)?e>1?TX(a,e-1,t,i,n):IOe(n,a):i||(n[n.length]=a)}return n}LX.exports=TX});var KX=w((slt,MX)=>{var wOe=OX();function BOe(r){var e=r==null?0:r.length;return e?wOe(r,1):[]}MX.exports=BOe});var HX=w((olt,UX)=>{function bOe(r,e,t){switch(t.length){case 0:return r.call(e);case 1:return r.call(e,t[0]);case 2:return r.call(e,t[0],t[1]);case 3:return r.call(e,t[0],t[1],t[2])}return r.apply(e,t)}UX.exports=bOe});var RR=w((alt,jX)=>{var QOe=HX(),GX=Math.max;function SOe(r,e,t){return e=GX(e===void 0?r.length-1:e,0),function(){for(var i=arguments,n=-1,s=GX(i.length-e,0),o=Array(s);++n{function vOe(r){return function(){return r}}YX.exports=vOe});var r0=w((llt,JX)=>{function xOe(r){return r}JX.exports=xOe});var _X=w((clt,WX)=>{var kOe=qX(),zX=xR(),POe=r0(),DOe=zX?function(r,e){return zX(r,"toString",{configurable:!0,enumerable:!1,value:kOe(e),writable:!0})}:POe;WX.exports=DOe});var XX=w((ult,VX)=>{var ROe=800,FOe=16,NOe=Date.now;function LOe(r){var e=0,t=0;return function(){var i=NOe(),n=FOe-(i-t);if(t=i,n>0){if(++e>=ROe)return arguments[0]}else e=0;return r.apply(void 0,arguments)}}VX.exports=LOe});var FR=w((glt,ZX)=>{var TOe=_X(),OOe=XX(),MOe=OOe(TOe);ZX.exports=MOe});var eZ=w((flt,$X)=>{var KOe=KX(),UOe=RR(),HOe=FR();function jOe(r){return HOe(UOe(r,void 0,KOe),r+"")}$X.exports=jOe});var rZ=w((hlt,tZ)=>{var GOe=kX(),YOe=eZ(),qOe=YOe(function(r,e){return r==null?{}:GOe(r,e)});tZ.exports=qOe});var hZ=w((uut,uZ)=>{"use strict";var GR;try{GR=Map}catch(r){}var YR;try{YR=Set}catch(r){}function gZ(r,e,t){if(!r||typeof r!="object"||typeof r=="function")return r;if(r.nodeType&&"cloneNode"in r)return r.cloneNode(!0);if(r instanceof Date)return new Date(r.getTime());if(r instanceof RegExp)return new RegExp(r);if(Array.isArray(r))return r.map(fZ);if(GR&&r instanceof GR)return new Map(Array.from(r.entries()));if(YR&&r instanceof YR)return new Set(Array.from(r.values()));if(r instanceof Object){e.push(r);var i=Object.create(r);t.push(i);for(var n in r){var s=e.findIndex(function(o){return o===r[n]});i[n]=s>-1?t[s]:gZ(r[n],e,t)}return i}return r}function fZ(r){return gZ(r,[],[])}uZ.exports=fZ});var IC=w(qR=>{"use strict";Object.defineProperty(qR,"__esModule",{value:!0});qR.default=eMe;var tMe=Object.prototype.toString,rMe=Error.prototype.toString,iMe=RegExp.prototype.toString,nMe=typeof Symbol!="undefined"?Symbol.prototype.toString:()=>"",sMe=/^Symbol\((.*)\)(.*)$/;function oMe(r){return r!=+r?"NaN":r===0&&1/r<0?"-0":""+r}function pZ(r,e=!1){if(r==null||r===!0||r===!1)return""+r;let t=typeof r;if(t==="number")return oMe(r);if(t==="string")return e?`"${r}"`:r;if(t==="function")return"[Function "+(r.name||"anonymous")+"]";if(t==="symbol")return nMe.call(r).replace(sMe,"Symbol($1)");let i=tMe.call(r).slice(8,-1);return i==="Date"?isNaN(r.getTime())?""+r:r.toISOString(r):i==="Error"||r instanceof Error?"["+rMe.call(r)+"]":i==="RegExp"?iMe.call(r):null}function eMe(r,e){let t=pZ(r,e);return t!==null?t:JSON.stringify(r,function(i,n){let s=pZ(this[i],e);return s!==null?s:n},2)}});var CA=w(bi=>{"use strict";Object.defineProperty(bi,"__esModule",{value:!0});bi.default=bi.array=bi.object=bi.boolean=bi.date=bi.number=bi.string=bi.mixed=void 0;var dZ=aMe(IC());function aMe(r){return r&&r.__esModule?r:{default:r}}var CZ={default:"${path} is invalid",required:"${path} is a required field",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:r,type:e,value:t,originalValue:i})=>{let n=i!=null&&i!==t,s=`${r} must be a \`${e}\` type, but the final value was: \`${(0,dZ.default)(t,!0)}\``+(n?` (cast from the value \`${(0,dZ.default)(i,!0)}\`).`:".");return t===null&&(s+='\n If "null" is intended as an empty value be sure to mark the schema as `.nullable()`'),s},defined:"${path} must be defined"};bi.mixed=CZ;var mZ={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"};bi.string=mZ;var EZ={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"};bi.number=EZ;var IZ={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"};bi.date=IZ;var yZ={isValue:"${path} field must be ${value}"};bi.boolean=yZ;var wZ={noUnknown:"${path} field has unspecified keys: ${unknown}"};bi.object=wZ;var BZ={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must be have ${length} items"};bi.array=BZ;var AMe=Object.assign(Object.create(null),{mixed:CZ,string:mZ,number:EZ,date:IZ,object:wZ,array:BZ,boolean:yZ});bi.default=AMe});var QZ=w((hut,bZ)=>{var lMe=Object.prototype,cMe=lMe.hasOwnProperty;function uMe(r,e){return r!=null&&cMe.call(r,e)}bZ.exports=uMe});var yC=w((put,SZ)=>{var gMe=QZ(),fMe=PR();function hMe(r,e){return r!=null&&fMe(r,e,gMe)}SZ.exports=hMe});var Tf=w(o0=>{"use strict";Object.defineProperty(o0,"__esModule",{value:!0});o0.default=void 0;var pMe=r=>r&&r.__isYupSchema__;o0.default=pMe});var kZ=w(a0=>{"use strict";Object.defineProperty(a0,"__esModule",{value:!0});a0.default=void 0;var dMe=vZ(yC()),CMe=vZ(Tf());function vZ(r){return r&&r.__esModule?r:{default:r}}var xZ=class{constructor(e,t){if(this.refs=e,this.refs=e,typeof t=="function"){this.fn=t;return}if(!(0,dMe.default)(t,"is"))throw new TypeError("`is:` is required for `when()` conditions");if(!t.then&&!t.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:i,then:n,otherwise:s}=t,o=typeof i=="function"?i:(...a)=>a.every(l=>l===i);this.fn=function(...a){let l=a.pop(),c=a.pop(),u=o(...a)?n:s;if(!!u)return typeof u=="function"?u(c):c.concat(u.resolve(l))}}resolve(e,t){let i=this.refs.map(s=>s.getValue(t==null?void 0:t.value,t==null?void 0:t.parent,t==null?void 0:t.context)),n=this.fn.apply(e,i.concat(e,t));if(n===void 0||n===e)return e;if(!(0,CMe.default)(n))throw new TypeError("conditions must return a schema object");return n.resolve(t)}},mMe=xZ;a0.default=mMe});var WR=w(JR=>{"use strict";Object.defineProperty(JR,"__esModule",{value:!0});JR.default=EMe;function EMe(r){return r==null?[]:[].concat(r)}});var fu=w(A0=>{"use strict";Object.defineProperty(A0,"__esModule",{value:!0});A0.default=void 0;var IMe=PZ(IC()),yMe=PZ(WR());function PZ(r){return r&&r.__esModule?r:{default:r}}function zR(){return zR=Object.assign||function(r){for(var e=1;e(0,IMe.default)(t[s])):typeof e=="function"?e(t):e}static isError(e){return e&&e.name==="ValidationError"}constructor(e,t,i,n){super();this.name="ValidationError",this.value=t,this.path=i,this.type=n,this.errors=[],this.inner=[],(0,yMe.default)(e).forEach(s=>{wC.isError(s)?(this.errors.push(...s.errors),this.inner=this.inner.concat(s.inner.length?s.inner:s)):this.errors.push(s)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0],Error.captureStackTrace&&Error.captureStackTrace(this,wC)}};A0.default=wC});var l0=w(_R=>{"use strict";Object.defineProperty(_R,"__esModule",{value:!0});_R.default=BMe;var VR=bMe(fu());function bMe(r){return r&&r.__esModule?r:{default:r}}var QMe=r=>{let e=!1;return(...t)=>{e||(e=!0,r(...t))}};function BMe(r,e){let{endEarly:t,tests:i,args:n,value:s,errors:o,sort:a,path:l}=r,c=QMe(e),u=i.length,g=[];if(o=o||[],!u)return o.length?c(new VR.default(o,s,l)):c(null,s);for(let f=0;f{function SMe(r){return function(e,t,i){for(var n=-1,s=Object(e),o=i(e),a=o.length;a--;){var l=o[r?a:++n];if(t(s[l],l,s)===!1)break}return e}}DZ.exports=SMe});var XR=w((wut,FZ)=>{var vMe=RZ(),xMe=vMe();FZ.exports=xMe});var LZ=w((But,NZ)=>{function kMe(r,e){for(var t=-1,i=Array(r);++t{function PMe(){return!1}TZ.exports=PMe});var bC=w((BC,Of)=>{var DMe=Ns(),RMe=OZ(),MZ=typeof BC=="object"&&BC&&!BC.nodeType&&BC,KZ=MZ&&typeof Of=="object"&&Of&&!Of.nodeType&&Of,FMe=KZ&&KZ.exports===MZ,UZ=FMe?DMe.Buffer:void 0,NMe=UZ?UZ.isBuffer:void 0,LMe=NMe||RMe;Of.exports=LMe});var jZ=w((Qut,HZ)=>{var TMe=Wc(),OMe=e0(),MMe=ta(),KMe="[object Arguments]",UMe="[object Array]",HMe="[object Boolean]",jMe="[object Date]",GMe="[object Error]",YMe="[object Function]",qMe="[object Map]",JMe="[object Number]",WMe="[object Object]",zMe="[object RegExp]",_Me="[object Set]",VMe="[object String]",XMe="[object WeakMap]",ZMe="[object ArrayBuffer]",$Me="[object DataView]",e1e="[object Float32Array]",t1e="[object Float64Array]",r1e="[object Int8Array]",i1e="[object Int16Array]",n1e="[object Int32Array]",s1e="[object Uint8Array]",o1e="[object Uint8ClampedArray]",a1e="[object Uint16Array]",A1e="[object Uint32Array]",wr={};wr[e1e]=wr[t1e]=wr[r1e]=wr[i1e]=wr[n1e]=wr[s1e]=wr[o1e]=wr[a1e]=wr[A1e]=!0;wr[KMe]=wr[UMe]=wr[ZMe]=wr[HMe]=wr[$Me]=wr[jMe]=wr[GMe]=wr[YMe]=wr[qMe]=wr[JMe]=wr[WMe]=wr[zMe]=wr[_Me]=wr[VMe]=wr[XMe]=!1;function l1e(r){return MMe(r)&&OMe(r.length)&&!!wr[TMe(r)]}HZ.exports=l1e});var c0=w((Sut,GZ)=>{function c1e(r){return function(e){return r(e)}}GZ.exports=c1e});var u0=w((QC,Mf)=>{var u1e=rk(),YZ=typeof QC=="object"&&QC&&!QC.nodeType&&QC,SC=YZ&&typeof Mf=="object"&&Mf&&!Mf.nodeType&&Mf,g1e=SC&&SC.exports===YZ,ZR=g1e&&u1e.process,f1e=function(){try{var r=SC&&SC.require&&SC.require("util").types;return r||ZR&&ZR.binding&&ZR.binding("util")}catch(e){}}();Mf.exports=f1e});var g0=w((vut,qZ)=>{var h1e=jZ(),p1e=c0(),JZ=u0(),WZ=JZ&&JZ.isTypedArray,d1e=WZ?p1e(WZ):h1e;qZ.exports=d1e});var $R=w((xut,zZ)=>{var C1e=LZ(),m1e=dC(),E1e=Ks(),I1e=bC(),y1e=pC(),w1e=g0(),B1e=Object.prototype,b1e=B1e.hasOwnProperty;function Q1e(r,e){var t=E1e(r),i=!t&&m1e(r),n=!t&&!i&&I1e(r),s=!t&&!i&&!n&&w1e(r),o=t||i||n||s,a=o?C1e(r.length,String):[],l=a.length;for(var c in r)(e||b1e.call(r,c))&&!(o&&(c=="length"||n&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||y1e(c,l)))&&a.push(c);return a}zZ.exports=Q1e});var f0=w((kut,_Z)=>{var S1e=Object.prototype;function v1e(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||S1e;return r===t}_Z.exports=v1e});var eF=w((Put,VZ)=>{function x1e(r,e){return function(t){return r(e(t))}}VZ.exports=x1e});var ZZ=w((Dut,XZ)=>{var k1e=eF(),P1e=k1e(Object.keys,Object);XZ.exports=P1e});var e$=w((Rut,$Z)=>{var D1e=f0(),R1e=ZZ(),F1e=Object.prototype,N1e=F1e.hasOwnProperty;function L1e(r){if(!D1e(r))return R1e(r);var e=[];for(var t in Object(r))N1e.call(r,t)&&t!="constructor"&&e.push(t);return e}$Z.exports=L1e});var vC=w((Fut,t$)=>{var T1e=VB(),O1e=e0();function M1e(r){return r!=null&&O1e(r.length)&&!T1e(r)}t$.exports=M1e});var Kf=w((Nut,r$)=>{var K1e=$R(),U1e=e$(),H1e=vC();function j1e(r){return H1e(r)?K1e(r):U1e(r)}r$.exports=j1e});var tF=w((Lut,i$)=>{var G1e=XR(),Y1e=Kf();function q1e(r,e){return r&&G1e(r,e,Y1e)}i$.exports=q1e});var s$=w((Tut,n$)=>{var J1e=gC();function W1e(){this.__data__=new J1e,this.size=0}n$.exports=W1e});var a$=w((Out,o$)=>{function z1e(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}o$.exports=z1e});var l$=w((Mut,A$)=>{function _1e(r){return this.__data__.get(r)}A$.exports=_1e});var u$=w((Kut,c$)=>{function V1e(r){return this.__data__.has(r)}c$.exports=V1e});var f$=w((Uut,g$)=>{var X1e=gC(),Z1e=XB(),$1e=ZB(),eKe=200;function tKe(r,e){var t=this.__data__;if(t instanceof X1e){var i=t.__data__;if(!Z1e||i.length{var rKe=gC(),iKe=s$(),nKe=a$(),sKe=l$(),oKe=u$(),aKe=f$();function Uf(r){var e=this.__data__=new rKe(r);this.size=e.size}Uf.prototype.clear=iKe;Uf.prototype.delete=nKe;Uf.prototype.get=sKe;Uf.prototype.has=oKe;Uf.prototype.set=aKe;h$.exports=Uf});var d$=w((jut,p$)=>{var AKe="__lodash_hash_undefined__";function lKe(r){return this.__data__.set(r,AKe),this}p$.exports=lKe});var m$=w((Gut,C$)=>{function cKe(r){return this.__data__.has(r)}C$.exports=cKe});var I$=w((Yut,E$)=>{var uKe=ZB(),gKe=d$(),fKe=m$();function h0(r){var e=-1,t=r==null?0:r.length;for(this.__data__=new uKe;++e{function hKe(r,e){for(var t=-1,i=r==null?0:r.length;++t{function pKe(r,e){return r.has(e)}B$.exports=pKe});var rF=w((Wut,Q$)=>{var dKe=I$(),CKe=w$(),mKe=b$(),EKe=1,IKe=2;function yKe(r,e,t,i,n,s){var o=t&EKe,a=r.length,l=e.length;if(a!=l&&!(o&&l>a))return!1;var c=s.get(r),u=s.get(e);if(c&&u)return c==e&&u==r;var g=-1,f=!0,h=t&IKe?new dKe:void 0;for(s.set(r,e),s.set(e,r);++g{var wKe=Ns(),BKe=wKe.Uint8Array;S$.exports=BKe});var x$=w((_ut,v$)=>{function bKe(r){var e=-1,t=Array(r.size);return r.forEach(function(i,n){t[++e]=[n,i]}),t}v$.exports=bKe});var P$=w((Vut,k$)=>{function QKe(r){var e=-1,t=Array(r.size);return r.forEach(function(i){t[++e]=i}),t}k$.exports=QKe});var L$=w((Xut,D$)=>{var R$=Jc(),F$=iF(),SKe=Pf(),vKe=rF(),xKe=x$(),kKe=P$(),PKe=1,DKe=2,RKe="[object Boolean]",FKe="[object Date]",NKe="[object Error]",LKe="[object Map]",TKe="[object Number]",OKe="[object RegExp]",MKe="[object Set]",KKe="[object String]",UKe="[object Symbol]",HKe="[object ArrayBuffer]",jKe="[object DataView]",N$=R$?R$.prototype:void 0,nF=N$?N$.valueOf:void 0;function GKe(r,e,t,i,n,s,o){switch(t){case jKe:if(r.byteLength!=e.byteLength||r.byteOffset!=e.byteOffset)return!1;r=r.buffer,e=e.buffer;case HKe:return!(r.byteLength!=e.byteLength||!s(new F$(r),new F$(e)));case RKe:case FKe:case TKe:return SKe(+r,+e);case NKe:return r.name==e.name&&r.message==e.message;case OKe:case KKe:return r==e+"";case LKe:var a=xKe;case MKe:var l=i&PKe;if(a||(a=kKe),r.size!=e.size&&!l)return!1;var c=o.get(r);if(c)return c==e;i|=DKe,o.set(r,e);var u=vKe(a(r),a(e),i,n,s,o);return o.delete(r),u;case UKe:if(nF)return nF.call(r)==nF.call(e)}return!1}D$.exports=GKe});var sF=w((Zut,T$)=>{var YKe=t0(),qKe=Ks();function JKe(r,e,t){var i=e(r);return qKe(r)?i:YKe(i,t(r))}T$.exports=JKe});var M$=w(($ut,O$)=>{function WKe(r,e){for(var t=-1,i=r==null?0:r.length,n=0,s=[];++t{function zKe(){return[]}K$.exports=zKe});var p0=w((tgt,U$)=>{var _Ke=M$(),VKe=oF(),XKe=Object.prototype,ZKe=XKe.propertyIsEnumerable,H$=Object.getOwnPropertySymbols,$Ke=H$?function(r){return r==null?[]:(r=Object(r),_Ke(H$(r),function(e){return ZKe.call(r,e)}))}:VKe;U$.exports=$Ke});var aF=w((rgt,j$)=>{var eUe=sF(),tUe=p0(),rUe=Kf();function iUe(r){return eUe(r,rUe,tUe)}j$.exports=iUe});var q$=w((igt,G$)=>{var Y$=aF(),nUe=1,sUe=Object.prototype,oUe=sUe.hasOwnProperty;function aUe(r,e,t,i,n,s){var o=t&nUe,a=Y$(r),l=a.length,c=Y$(e),u=c.length;if(l!=u&&!o)return!1;for(var g=l;g--;){var f=a[g];if(!(o?f in e:oUe.call(e,f)))return!1}var h=s.get(r),p=s.get(e);if(h&&p)return h==e&&p==r;var m=!0;s.set(r,e),s.set(e,r);for(var y=o;++g{var AUe=Rl(),lUe=Ns(),cUe=AUe(lUe,"DataView");J$.exports=cUe});var _$=w((sgt,z$)=>{var uUe=Rl(),gUe=Ns(),fUe=uUe(gUe,"Promise");z$.exports=fUe});var X$=w((ogt,V$)=>{var hUe=Rl(),pUe=Ns(),dUe=hUe(pUe,"Set");V$.exports=dUe});var $$=w((agt,Z$)=>{var CUe=Rl(),mUe=Ns(),EUe=CUe(mUe,"WeakMap");Z$.exports=EUe});var kC=w((Agt,eee)=>{var AF=W$(),lF=XB(),cF=_$(),uF=X$(),gF=$$(),tee=Wc(),Hf=SR(),ree="[object Map]",IUe="[object Object]",iee="[object Promise]",nee="[object Set]",see="[object WeakMap]",oee="[object DataView]",yUe=Hf(AF),wUe=Hf(lF),BUe=Hf(cF),bUe=Hf(uF),QUe=Hf(gF),hu=tee;(AF&&hu(new AF(new ArrayBuffer(1)))!=oee||lF&&hu(new lF)!=ree||cF&&hu(cF.resolve())!=iee||uF&&hu(new uF)!=nee||gF&&hu(new gF)!=see)&&(hu=function(r){var e=tee(r),t=e==IUe?r.constructor:void 0,i=t?Hf(t):"";if(i)switch(i){case yUe:return oee;case wUe:return ree;case BUe:return iee;case bUe:return nee;case QUe:return see}return e});eee.exports=hu});var hee=w((lgt,aee)=>{var fF=xC(),SUe=rF(),vUe=L$(),xUe=q$(),Aee=kC(),lee=Ks(),cee=bC(),kUe=g0(),PUe=1,uee="[object Arguments]",gee="[object Array]",d0="[object Object]",DUe=Object.prototype,fee=DUe.hasOwnProperty;function RUe(r,e,t,i,n,s){var o=lee(r),a=lee(e),l=o?gee:Aee(r),c=a?gee:Aee(e);l=l==uee?d0:l,c=c==uee?d0:c;var u=l==d0,g=c==d0,f=l==c;if(f&&cee(r)){if(!cee(e))return!1;o=!0,u=!1}if(f&&!u)return s||(s=new fF),o||kUe(r)?SUe(r,e,t,i,n,s):vUe(r,e,l,t,i,n,s);if(!(t&PUe)){var h=u&&fee.call(r,"__wrapped__"),p=g&&fee.call(e,"__wrapped__");if(h||p){var m=h?r.value():r,y=p?e.value():e;return s||(s=new fF),n(m,y,t,i,s)}}return f?(s||(s=new fF),xUe(r,e,t,i,n,s)):!1}aee.exports=RUe});var hF=w((cgt,pee)=>{var FUe=hee(),dee=ta();function Cee(r,e,t,i,n){return r===e?!0:r==null||e==null||!dee(r)&&!dee(e)?r!==r&&e!==e:FUe(r,e,t,i,Cee,n)}pee.exports=Cee});var Eee=w((ugt,mee)=>{var NUe=xC(),LUe=hF(),TUe=1,OUe=2;function MUe(r,e,t,i){var n=t.length,s=n,o=!i;if(r==null)return!s;for(r=Object(r);n--;){var a=t[n];if(o&&a[2]?a[1]!==r[a[0]]:!(a[0]in r))return!1}for(;++n{var KUe=Rn();function UUe(r){return r===r&&!KUe(r)}Iee.exports=UUe});var wee=w((fgt,yee)=>{var HUe=pF(),jUe=Kf();function GUe(r){for(var e=jUe(r),t=e.length;t--;){var i=e[t],n=r[i];e[t]=[i,n,HUe(n)]}return e}yee.exports=GUe});var dF=w((hgt,Bee)=>{function YUe(r,e){return function(t){return t==null?!1:t[r]===e&&(e!==void 0||r in Object(t))}}Bee.exports=YUe});var Qee=w((pgt,bee)=>{var qUe=Eee(),JUe=wee(),WUe=dF();function zUe(r){var e=JUe(r);return e.length==1&&e[0][2]?WUe(e[0][0],e[0][1]):function(t){return t===r||qUe(t,r,e)}}bee.exports=zUe});var C0=w((dgt,See)=>{var _Ue=hC();function VUe(r,e,t){var i=r==null?void 0:_Ue(r,e);return i===void 0?t:i}See.exports=VUe});var xee=w((Cgt,vee)=>{var XUe=hF(),ZUe=C0(),$Ue=DR(),e2e=_B(),t2e=pF(),r2e=dF(),i2e=gu(),n2e=1,s2e=2;function o2e(r,e){return e2e(r)&&t2e(e)?r2e(i2e(r),e):function(t){var i=ZUe(t,r);return i===void 0&&i===e?$Ue(t,r):XUe(e,i,n2e|s2e)}}vee.exports=o2e});var Pee=w((mgt,kee)=>{function a2e(r){return function(e){return e==null?void 0:e[r]}}kee.exports=a2e});var Ree=w((Egt,Dee)=>{var A2e=hC();function l2e(r){return function(e){return A2e(e,r)}}Dee.exports=l2e});var Nee=w((Igt,Fee)=>{var c2e=Pee(),u2e=Ree(),g2e=_B(),f2e=gu();function h2e(r){return g2e(r)?c2e(f2e(r)):u2e(r)}Fee.exports=h2e});var CF=w((ygt,Lee)=>{var p2e=Qee(),d2e=xee(),C2e=r0(),m2e=Ks(),E2e=Nee();function I2e(r){return typeof r=="function"?r:r==null?C2e:typeof r=="object"?m2e(r)?d2e(r[0],r[1]):p2e(r):E2e(r)}Lee.exports=I2e});var mF=w((wgt,Tee)=>{var y2e=Nf(),w2e=tF(),B2e=CF();function b2e(r,e){var t={};return e=B2e(e,3),w2e(r,function(i,n,s){y2e(t,n,e(i,n,s))}),t}Tee.exports=b2e});var PC=w((Bgt,Oee)=>{"use strict";function pu(r){this._maxSize=r,this.clear()}pu.prototype.clear=function(){this._size=0,this._values=Object.create(null)};pu.prototype.get=function(r){return this._values[r]};pu.prototype.set=function(r,e){return this._size>=this._maxSize&&this.clear(),r in this._values||this._size++,this._values[r]=e};var Q2e=/[^.^\]^[]+|(?=\[\]|\.\.)/g,Mee=/^\d+$/,S2e=/^\d/,v2e=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,x2e=/^\s*(['"]?)(.*?)(\1)\s*$/,EF=512,Kee=new pu(EF),Uee=new pu(EF),Hee=new pu(EF);Oee.exports={Cache:pu,split:yF,normalizePath:IF,setter:function(r){var e=IF(r);return Uee.get(r)||Uee.set(r,function(i,n){for(var s=0,o=e.length,a=i;s{"use strict";Object.defineProperty(DC,"__esModule",{value:!0});DC.create=F2e;DC.default=void 0;var N2e=PC(),m0={context:"$",value:"."};function F2e(r,e){return new E0(r,e)}var E0=class{constructor(e,t={}){if(typeof e!="string")throw new TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),e==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===m0.context,this.isValue=this.key[0]===m0.value,this.isSibling=!this.isContext&&!this.isValue;let i=this.isContext?m0.context:this.isValue?m0.value:"";this.path=this.key.slice(i.length),this.getter=this.path&&(0,N2e.getter)(this.path,!0),this.map=t.map}getValue(e,t,i){let n=this.isContext?i:this.isValue?e:t;return this.getter&&(n=this.getter(n||{})),this.map&&(n=this.map(n)),n}cast(e,t){return this.getValue(e,t==null?void 0:t.parent,t==null?void 0:t.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}};DC.default=E0;E0.prototype.__isYupRef=!0});var jee=w(BF=>{"use strict";Object.defineProperty(BF,"__esModule",{value:!0});BF.default=L2e;var T2e=bF(mF()),I0=bF(fu()),O2e=bF(du());function bF(r){return r&&r.__esModule?r:{default:r}}function y0(){return y0=Object.assign||function(r){for(var e=1;e=0)&&(t[n]=r[n]);return t}function L2e(r){function e(t,i){let{value:n,path:s="",label:o,options:a,originalValue:l,sync:c}=t,u=M2e(t,["value","path","label","options","originalValue","sync"]),{name:g,test:f,params:h,message:p}=r,{parent:m,context:y}=a;function b(Y){return O2e.default.isRef(Y)?Y.getValue(n,m,y):Y}function v(Y={}){let $=(0,T2e.default)(y0({value:n,originalValue:l,label:o,path:Y.path||s},h,Y.params),b),_=new I0.default(I0.default.formatError(Y.message||p,$),n,$.path,Y.type||g);return _.params=$,_}let x=y0({path:s,parent:m,type:g,createError:v,resolve:b,options:a,originalValue:l},u);if(!c){try{Promise.resolve(f.call(x,n,x)).then(Y=>{I0.default.isError(Y)?i(Y):Y?i(null,Y):i(v())})}catch(Y){i(Y)}return}let T;try{var q;if(T=f.call(x,n,x),typeof((q=T)==null?void 0:q.then)=="function")throw new Error(`Validation test of type: "${x.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`)}catch(Y){i(Y);return}I0.default.isError(T)?i(T):T?i(null,T):i(v())}return e.OPTIONS=r,e}});var QF=w(RC=>{"use strict";Object.defineProperty(RC,"__esModule",{value:!0});RC.getIn=Gee;RC.default=void 0;var K2e=PC(),U2e=r=>r.substr(0,r.length-1).substr(1);function Gee(r,e,t,i=t){let n,s,o;return e?((0,K2e.forEach)(e,(a,l,c)=>{let u=l?U2e(a):a;if(r=r.resolve({context:i,parent:n,value:t}),r.innerType){let g=c?parseInt(u,10):0;if(t&&g>=t.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${a}, in the path: ${e}. because there is no value at that index. `);n=t,t=t&&t[g],r=r.innerType}if(!c){if(!r.fields||!r.fields[u])throw new Error(`The schema does not contain the path: ${e}. (failed at: ${o} which is a type: "${r._type}")`);n=t,t=t&&t[u],r=r.fields[u]}s=u,o=l?"["+a+"]":"."+a}),{schema:r,parent:n,parentPath:s}):{parent:n,parentPath:e,schema:r}}var H2e=(r,e,t,i)=>Gee(r,e,t,i).schema,j2e=H2e;RC.default=j2e});var qee=w(w0=>{"use strict";Object.defineProperty(w0,"__esModule",{value:!0});w0.default=void 0;var Yee=G2e(du());function G2e(r){return r&&r.__esModule?r:{default:r}}var B0=class{constructor(){this.list=new Set,this.refs=new Map}get size(){return this.list.size+this.refs.size}describe(){let e=[];for(let t of this.list)e.push(t);for(let[,t]of this.refs)e.push(t.describe());return e}toArray(){return Array.from(this.list).concat(Array.from(this.refs.values()))}add(e){Yee.default.isRef(e)?this.refs.set(e.key,e):this.list.add(e)}delete(e){Yee.default.isRef(e)?this.refs.delete(e.key):this.list.delete(e)}has(e,t){if(this.list.has(e))return!0;let i,n=this.refs.values();for(;i=n.next(),!i.done;)if(t(i.value)===e)return!0;return!1}clone(){let e=new B0;return e.list=new Set(this.list),e.refs=new Map(this.refs),e}merge(e,t){let i=this.clone();return e.list.forEach(n=>i.add(n)),e.refs.forEach(n=>i.add(n)),t.list.forEach(n=>i.delete(n)),t.refs.forEach(n=>i.delete(n)),i}};w0.default=B0});var EA=w(b0=>{"use strict";Object.defineProperty(b0,"__esModule",{value:!0});b0.default=void 0;var Jee=mA(hZ()),jf=CA(),Y2e=mA(kZ()),Wee=mA(l0()),Q0=mA(jee()),zee=mA(IC()),q2e=mA(du()),J2e=QF(),W2e=mA(WR()),_ee=mA(fu()),Vee=mA(qee());function mA(r){return r&&r.__esModule?r:{default:r}}function Js(){return Js=Object.assign||function(r){for(var e=1;e{this.typeError(jf.mixed.notType)}),this.type=(e==null?void 0:e.type)||"mixed",this.spec=Js({strip:!1,strict:!1,abortEarly:!0,recursive:!0,nullable:!1,presence:"optional"},e==null?void 0:e.spec)}get _type(){return this.type}_typeCheck(e){return!0}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;let t=Object.create(Object.getPrototypeOf(this));return t.type=this.type,t._typeError=this._typeError,t._whitelistError=this._whitelistError,t._blacklistError=this._blacklistError,t._whitelist=this._whitelist.clone(),t._blacklist=this._blacklist.clone(),t.exclusiveTests=Js({},this.exclusiveTests),t.deps=[...this.deps],t.conditions=[...this.conditions],t.tests=[...this.tests],t.transforms=[...this.transforms],t.spec=(0,Jee.default)(Js({},this.spec,e)),t}label(e){var t=this.clone();return t.spec.label=e,t}meta(...e){if(e.length===0)return this.spec.meta;let t=this.clone();return t.spec.meta=Object.assign(t.spec.meta||{},e[0]),t}withMutation(e){let t=this._mutate;this._mutate=!0;let i=e(this);return this._mutate=t,i}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let t=this,i=e.clone(),n=Js({},t.spec,i.spec);return i.spec=n,i._typeError||(i._typeError=t._typeError),i._whitelistError||(i._whitelistError=t._whitelistError),i._blacklistError||(i._blacklistError=t._blacklistError),i._whitelist=t._whitelist.merge(e._whitelist,e._blacklist),i._blacklist=t._blacklist.merge(e._blacklist,e._whitelist),i.tests=t.tests,i.exclusiveTests=t.exclusiveTests,i.withMutation(s=>{e.tests.forEach(o=>{s.test(o.OPTIONS)})}),i}isType(e){return this.spec.nullable&&e===null?!0:this._typeCheck(e)}resolve(e){let t=this;if(t.conditions.length){let i=t.conditions;t=t.clone(),t.conditions=[],t=i.reduce((n,s)=>s.resolve(n,e),t),t=t.resolve(e)}return t}cast(e,t={}){let i=this.resolve(Js({value:e},t)),n=i._cast(e,t);if(e!==void 0&&t.assert!==!1&&i.isType(n)!==!0){let s=(0,zee.default)(e),o=(0,zee.default)(n);throw new TypeError(`The value of ${t.path||"field"} could not be cast to a value that satisfies the schema type: "${i._type}". - -attempted value: ${s} -`+(o!==s?`result of cast: ${o}`:""))}return n}_cast(e,t){let i=e===void 0?e:this.transforms.reduce((n,s)=>s.call(this,n,e,this),e);return i===void 0&&(i=this.getDefault()),i}_validate(e,t={},i){let{sync:n,path:s,from:o=[],originalValue:a=e,strict:l=this.spec.strict,abortEarly:c=this.spec.abortEarly}=t,u=e;l||(u=this._cast(u,Js({assert:!1},t)));let g={value:u,path:s,options:t,originalValue:a,schema:this,label:this.spec.label,sync:n,from:o},f=[];this._typeError&&f.push(this._typeError),this._whitelistError&&f.push(this._whitelistError),this._blacklistError&&f.push(this._blacklistError),(0,Wee.default)({args:g,value:u,path:s,sync:n,tests:f,endEarly:c},h=>{if(h)return void i(h,u);(0,Wee.default)({tests:this.tests,args:g,path:s,sync:n,value:u,endEarly:c},i)})}validate(e,t,i){let n=this.resolve(Js({},t,{value:e}));return typeof i=="function"?n._validate(e,t,i):new Promise((s,o)=>n._validate(e,t,(a,l)=>{a?o(a):s(l)}))}validateSync(e,t){let i=this.resolve(Js({},t,{value:e})),n;return i._validate(e,Js({},t,{sync:!0}),(s,o)=>{if(s)throw s;n=o}),n}isValid(e,t){return this.validate(e,t).then(()=>!0,i=>{if(_ee.default.isError(i))return!1;throw i})}isValidSync(e,t){try{return this.validateSync(e,t),!0}catch(i){if(_ee.default.isError(i))return!1;throw i}}_getDefault(){let e=this.spec.default;return e==null?e:typeof e=="function"?e.call(this):(0,Jee.default)(e)}getDefault(e){return this.resolve(e||{})._getDefault()}default(e){return arguments.length===0?this._getDefault():this.clone({default:e})}strict(e=!0){var t=this.clone();return t.spec.strict=e,t}_isPresent(e){return e!=null}defined(e=jf.mixed.defined){return this.test({message:e,name:"defined",exclusive:!0,test(t){return t!==void 0}})}required(e=jf.mixed.required){return this.clone({presence:"required"}).withMutation(t=>t.test({message:e,name:"required",exclusive:!0,test(i){return this.schema._isPresent(i)}}))}notRequired(){var e=this.clone({presence:"optional"});return e.tests=e.tests.filter(t=>t.OPTIONS.name!=="required"),e}nullable(e=!0){var t=this.clone({nullable:e!==!1});return t}transform(e){var t=this.clone();return t.transforms.push(e),t}test(...e){let t;if(e.length===1?typeof e[0]=="function"?t={test:e[0]}:t=e[0]:e.length===2?t={name:e[0],test:e[1]}:t={name:e[0],message:e[1],test:e[2]},t.message===void 0&&(t.message=jf.mixed.default),typeof t.test!="function")throw new TypeError("`test` is a required parameters");let i=this.clone(),n=(0,Q0.default)(t),s=t.exclusive||t.name&&i.exclusiveTests[t.name]===!0;if(t.exclusive&&!t.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return t.name&&(i.exclusiveTests[t.name]=!!t.exclusive),i.tests=i.tests.filter(o=>!(o.OPTIONS.name===t.name&&(s||o.OPTIONS.test===n.OPTIONS.test))),i.tests.push(n),i}when(e,t){!Array.isArray(e)&&typeof e!="string"&&(t=e,e=".");let i=this.clone(),n=(0,W2e.default)(e).map(s=>new q2e.default(s));return n.forEach(s=>{s.isSibling&&i.deps.push(s.key)}),i.conditions.push(new Y2e.default(n,t)),i}typeError(e){var t=this.clone();return t._typeError=(0,Q0.default)({message:e,name:"typeError",test(i){return i!==void 0&&!this.schema.isType(i)?this.createError({params:{type:this.schema._type}}):!0}}),t}oneOf(e,t=jf.mixed.oneOf){var i=this.clone();return e.forEach(n=>{i._whitelist.add(n),i._blacklist.delete(n)}),i._whitelistError=(0,Q0.default)({message:t,name:"oneOf",test(n){if(n===void 0)return!0;let s=this.schema._whitelist;return s.has(n,this.resolve)?!0:this.createError({params:{values:s.toArray().join(", ")}})}}),i}notOneOf(e,t=jf.mixed.notOneOf){var i=this.clone();return e.forEach(n=>{i._blacklist.add(n),i._whitelist.delete(n)}),i._blacklistError=(0,Q0.default)({message:t,name:"notOneOf",test(n){let s=this.schema._blacklist;return s.has(n,this.resolve)?this.createError({params:{values:s.toArray().join(", ")}}):!0}}),i}strip(e=!0){let t=this.clone();return t.spec.strip=e,t}describe(){let e=this.clone(),{label:t,meta:i}=e.spec;return{meta:i,label:t,type:e.type,oneOf:e._whitelist.describe(),notOneOf:e._blacklist.describe(),tests:e.tests.map(s=>({name:s.OPTIONS.name,params:s.OPTIONS.params})).filter((s,o,a)=>a.findIndex(l=>l.name===s.name)===o)}}};b0.default=ua;ua.prototype.__isYupSchema__=!0;for(let r of["validate","validateSync"])ua.prototype[`${r}At`]=function(e,t,i={}){let{parent:n,parentPath:s,schema:o}=(0,J2e.getIn)(this,e,t,i.context);return o[r](n&&n[s],Js({},i,{parent:n,path:e}))};for(let r of["equals","is"])ua.prototype[r]=ua.prototype.oneOf;for(let r of["not","nope"])ua.prototype[r]=ua.prototype.notOneOf;ua.prototype.optional=ua.prototype.notRequired});var Zee=w(FC=>{"use strict";Object.defineProperty(FC,"__esModule",{value:!0});FC.create=Xee;FC.default=void 0;var _2e=z2e(EA());function z2e(r){return r&&r.__esModule?r:{default:r}}var SF=_2e.default,V2e=SF;FC.default=V2e;function Xee(){return new SF}Xee.prototype=SF.prototype});var Gf=w(S0=>{"use strict";Object.defineProperty(S0,"__esModule",{value:!0});S0.default=void 0;var X2e=r=>r==null;S0.default=X2e});var ite=w(NC=>{"use strict";Object.defineProperty(NC,"__esModule",{value:!0});NC.create=$ee;NC.default=void 0;var Z2e=ete(EA()),tte=CA(),rte=ete(Gf());function ete(r){return r&&r.__esModule?r:{default:r}}function $ee(){return new v0}var v0=class extends Z2e.default{constructor(){super({type:"boolean"});this.withMutation(()=>{this.transform(function(e){if(!this.isType(e)){if(/^(true|1)$/i.test(String(e)))return!0;if(/^(false|0)$/i.test(String(e)))return!1}return e})})}_typeCheck(e){return e instanceof Boolean&&(e=e.valueOf()),typeof e=="boolean"}isTrue(e=tte.boolean.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"true"},test(t){return(0,rte.default)(t)||t===!0}})}isFalse(e=tte.boolean.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"false"},test(t){return(0,rte.default)(t)||t===!1}})}};NC.default=v0;$ee.prototype=v0.prototype});var ote=w(LC=>{"use strict";Object.defineProperty(LC,"__esModule",{value:!0});LC.create=nte;LC.default=void 0;var ga=CA(),IA=ste(Gf()),$2e=ste(EA());function ste(r){return r&&r.__esModule?r:{default:r}}var eHe=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i,tHe=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,rHe=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,iHe=r=>(0,IA.default)(r)||r===r.trim(),nHe={}.toString();function nte(){return new x0}var x0=class extends $2e.default{constructor(){super({type:"string"});this.withMutation(()=>{this.transform(function(e){if(this.isType(e)||Array.isArray(e))return e;let t=e!=null&&e.toString?e.toString():e;return t===nHe?e:t})})}_typeCheck(e){return e instanceof String&&(e=e.valueOf()),typeof e=="string"}_isPresent(e){return super._isPresent(e)&&!!e.length}length(e,t=ga.string.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},test(i){return(0,IA.default)(i)||i.length===this.resolve(e)}})}min(e,t=ga.string.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},test(i){return(0,IA.default)(i)||i.length>=this.resolve(e)}})}max(e,t=ga.string.max){return this.test({name:"max",exclusive:!0,message:t,params:{max:e},test(i){return(0,IA.default)(i)||i.length<=this.resolve(e)}})}matches(e,t){let i=!1,n,s;return t&&(typeof t=="object"?{excludeEmptyString:i=!1,message:n,name:s}=t:n=t),this.test({name:s||"matches",message:n||ga.string.matches,params:{regex:e},test:o=>(0,IA.default)(o)||o===""&&i||o.search(e)!==-1})}email(e=ga.string.email){return this.matches(eHe,{name:"email",message:e,excludeEmptyString:!0})}url(e=ga.string.url){return this.matches(tHe,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=ga.string.uuid){return this.matches(rHe,{name:"uuid",message:e,excludeEmptyString:!1})}ensure(){return this.default("").transform(e=>e===null?"":e)}trim(e=ga.string.trim){return this.transform(t=>t!=null?t.trim():t).test({message:e,name:"trim",test:iHe})}lowercase(e=ga.string.lowercase){return this.transform(t=>(0,IA.default)(t)?t:t.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,test:t=>(0,IA.default)(t)||t===t.toLowerCase()})}uppercase(e=ga.string.uppercase){return this.transform(t=>(0,IA.default)(t)?t:t.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,test:t=>(0,IA.default)(t)||t===t.toUpperCase()})}};LC.default=x0;nte.prototype=x0.prototype});var lte=w(TC=>{"use strict";Object.defineProperty(TC,"__esModule",{value:!0});TC.create=ate;TC.default=void 0;var Cu=CA(),mu=Ate(Gf()),sHe=Ate(EA());function Ate(r){return r&&r.__esModule?r:{default:r}}var oHe=r=>r!=+r;function ate(){return new k0}var k0=class extends sHe.default{constructor(){super({type:"number"});this.withMutation(()=>{this.transform(function(e){let t=e;if(typeof t=="string"){if(t=t.replace(/\s/g,""),t==="")return NaN;t=+t}return this.isType(t)?t:parseFloat(t)})})}_typeCheck(e){return e instanceof Number&&(e=e.valueOf()),typeof e=="number"&&!oHe(e)}min(e,t=Cu.number.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},test(i){return(0,mu.default)(i)||i>=this.resolve(e)}})}max(e,t=Cu.number.max){return this.test({message:t,name:"max",exclusive:!0,params:{max:e},test(i){return(0,mu.default)(i)||i<=this.resolve(e)}})}lessThan(e,t=Cu.number.lessThan){return this.test({message:t,name:"max",exclusive:!0,params:{less:e},test(i){return(0,mu.default)(i)||ithis.resolve(e)}})}positive(e=Cu.number.positive){return this.moreThan(0,e)}negative(e=Cu.number.negative){return this.lessThan(0,e)}integer(e=Cu.number.integer){return this.test({name:"integer",message:e,test:t=>(0,mu.default)(t)||Number.isInteger(t)})}truncate(){return this.transform(e=>(0,mu.default)(e)?e:e|0)}round(e){var t,i=["ceil","floor","round","trunc"];if(e=((t=e)==null?void 0:t.toLowerCase())||"round",e==="trunc")return this.truncate();if(i.indexOf(e.toLowerCase())===-1)throw new TypeError("Only valid options for round() are: "+i.join(", "));return this.transform(n=>(0,mu.default)(n)?n:Math[e](n))}};TC.default=k0;ate.prototype=k0.prototype});var cte=w(vF=>{"use strict";Object.defineProperty(vF,"__esModule",{value:!0});vF.default=aHe;var AHe=/^(\d{4}|[+\-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;function aHe(r){var e=[1,4,5,6,7,10,11],t=0,i,n;if(n=AHe.exec(r)){for(var s=0,o;o=e[s];++s)n[o]=+n[o]||0;n[2]=(+n[2]||1)-1,n[3]=+n[3]||1,n[7]=n[7]?String(n[7]).substr(0,3):0,(n[8]===void 0||n[8]==="")&&(n[9]===void 0||n[9]==="")?i=+new Date(n[1],n[2],n[3],n[4],n[5],n[6],n[7]):(n[8]!=="Z"&&n[9]!==void 0&&(t=n[10]*60+n[11],n[9]==="+"&&(t=0-t)),i=Date.UTC(n[1],n[2],n[3],n[4],n[5]+t,n[6],n[7]))}else i=Date.parse?Date.parse(r):NaN;return i}});var fte=w(OC=>{"use strict";Object.defineProperty(OC,"__esModule",{value:!0});OC.create=xF;OC.default=void 0;var lHe=P0(cte()),ute=CA(),gte=P0(Gf()),cHe=P0(du()),uHe=P0(EA());function P0(r){return r&&r.__esModule?r:{default:r}}var kF=new Date(""),gHe=r=>Object.prototype.toString.call(r)==="[object Date]";function xF(){return new MC}var MC=class extends uHe.default{constructor(){super({type:"date"});this.withMutation(()=>{this.transform(function(e){return this.isType(e)?e:(e=(0,lHe.default)(e),isNaN(e)?kF:new Date(e))})})}_typeCheck(e){return gHe(e)&&!isNaN(e.getTime())}prepareParam(e,t){let i;if(cHe.default.isRef(e))i=e;else{let n=this.cast(e);if(!this._typeCheck(n))throw new TypeError(`\`${t}\` must be a Date or a value that can be \`cast()\` to a Date`);i=n}return i}min(e,t=ute.date.min){let i=this.prepareParam(e,"min");return this.test({message:t,name:"min",exclusive:!0,params:{min:e},test(n){return(0,gte.default)(n)||n>=this.resolve(i)}})}max(e,t=ute.date.max){var i=this.prepareParam(e,"max");return this.test({message:t,name:"max",exclusive:!0,params:{max:e},test(n){return(0,gte.default)(n)||n<=this.resolve(i)}})}};OC.default=MC;MC.INVALID_DATE=kF;xF.prototype=MC.prototype;xF.INVALID_DATE=kF});var pte=w((Tgt,hte)=>{function fHe(r,e,t,i){var n=-1,s=r==null?0:r.length;for(i&&s&&(t=r[++n]);++n{function hHe(r){return function(e){return r==null?void 0:r[e]}}dte.exports=hHe});var Ete=w((Mgt,mte)=>{var pHe=Cte(),dHe={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},CHe=pHe(dHe);mte.exports=CHe});var yte=w((Kgt,Ite)=>{var mHe=Ete(),EHe=lf(),IHe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,yHe="\\u0300-\\u036f",wHe="\\ufe20-\\ufe2f",BHe="\\u20d0-\\u20ff",bHe=yHe+wHe+BHe,QHe="["+bHe+"]",SHe=RegExp(QHe,"g");function vHe(r){return r=EHe(r),r&&r.replace(IHe,mHe).replace(SHe,"")}Ite.exports=vHe});var Bte=w((Ugt,wte)=>{var xHe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function kHe(r){return r.match(xHe)||[]}wte.exports=kHe});var Qte=w((Hgt,bte)=>{var PHe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function DHe(r){return PHe.test(r)}bte.exports=DHe});var Yte=w((jgt,Ste)=>{var vte="\\ud800-\\udfff",RHe="\\u0300-\\u036f",FHe="\\ufe20-\\ufe2f",NHe="\\u20d0-\\u20ff",LHe=RHe+FHe+NHe,xte="\\u2700-\\u27bf",kte="a-z\\xdf-\\xf6\\xf8-\\xff",THe="\\xac\\xb1\\xd7\\xf7",OHe="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",MHe="\\u2000-\\u206f",KHe=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Pte="A-Z\\xc0-\\xd6\\xd8-\\xde",UHe="\\ufe0e\\ufe0f",Dte=THe+OHe+MHe+KHe,Rte="['\u2019]",Fte="["+Dte+"]",HHe="["+LHe+"]",Nte="\\d+",jHe="["+xte+"]",Lte="["+kte+"]",Tte="[^"+vte+Dte+Nte+xte+kte+Pte+"]",GHe="\\ud83c[\\udffb-\\udfff]",YHe="(?:"+HHe+"|"+GHe+")",qHe="[^"+vte+"]",Ote="(?:\\ud83c[\\udde6-\\uddff]){2}",Mte="[\\ud800-\\udbff][\\udc00-\\udfff]",Yf="["+Pte+"]",JHe="\\u200d",Kte="(?:"+Lte+"|"+Tte+")",WHe="(?:"+Yf+"|"+Tte+")",Ute="(?:"+Rte+"(?:d|ll|m|re|s|t|ve))?",Hte="(?:"+Rte+"(?:D|LL|M|RE|S|T|VE))?",jte=YHe+"?",Gte="["+UHe+"]?",zHe="(?:"+JHe+"(?:"+[qHe,Ote,Mte].join("|")+")"+Gte+jte+")*",_He="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",VHe="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",XHe=Gte+jte+zHe,ZHe="(?:"+[jHe,Ote,Mte].join("|")+")"+XHe,$He=RegExp([Yf+"?"+Lte+"+"+Ute+"(?="+[Fte,Yf,"$"].join("|")+")",WHe+"+"+Hte+"(?="+[Fte,Yf+Kte,"$"].join("|")+")",Yf+"?"+Kte+"+"+Ute,Yf+"+"+Hte,VHe,_He,Nte,ZHe].join("|"),"g");function eje(r){return r.match($He)||[]}Ste.exports=eje});var Jte=w((Ggt,qte)=>{var tje=Bte(),rje=Qte(),ije=lf(),nje=Yte();function sje(r,e,t){return r=ije(r),e=t?void 0:e,e===void 0?rje(r)?nje(r):tje(r):r.match(e)||[]}qte.exports=sje});var PF=w((Ygt,Wte)=>{var oje=pte(),aje=yte(),Aje=Jte(),lje="['\u2019]",cje=RegExp(lje,"g");function uje(r){return function(e){return oje(Aje(aje(e).replace(cje,"")),r,"")}}Wte.exports=uje});var _te=w((qgt,zte)=>{var gje=PF(),fje=gje(function(r,e,t){return r+(t?"_":"")+e.toLowerCase()});zte.exports=fje});var Xte=w((Jgt,Vte)=>{var hje=Zw(),pje=PF(),dje=pje(function(r,e,t){return e=e.toLowerCase(),r+(t?hje(e):e)});Vte.exports=dje});var $te=w((Wgt,Zte)=>{var Cje=Nf(),mje=tF(),Eje=CF();function Ije(r,e){var t={};return e=Eje(e,3),mje(r,function(i,n,s){Cje(t,e(i,n,s),i)}),t}Zte.exports=Ije});var tre=w((zgt,DF)=>{DF.exports=function(r){return ere(yje(r),r)};DF.exports.array=ere;function ere(r,e){var t=r.length,i=new Array(t),n={},s=t,o=wje(e),a=Bje(r);for(e.forEach(function(c){if(!a.has(c[0])||!a.has(c[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});s--;)n[s]||l(r[s],s,new Set);return i;function l(c,u,g){if(g.has(c)){var f;try{f=", node was:"+JSON.stringify(c)}catch(m){f=""}throw new Error("Cyclic dependency"+f)}if(!a.has(c))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(c));if(!n[u]){n[u]=!0;var h=o.get(c)||new Set;if(h=Array.from(h),u=h.length){g.add(c);do{var p=h[--u];l(p,a.get(p),g)}while(u);g.delete(c)}i[--t]=c}}}function yje(r){for(var e=new Set,t=0,i=r.length;t{"use strict";Object.defineProperty(RF,"__esModule",{value:!0});RF.default=bje;var Qje=D0(yC()),Sje=D0(tre()),vje=PC(),xje=D0(du()),kje=D0(Tf());function D0(r){return r&&r.__esModule?r:{default:r}}function bje(r,e=[]){let t=[],i=[];function n(s,o){var a=(0,vje.split)(s)[0];~i.indexOf(a)||i.push(a),~e.indexOf(`${o}-${a}`)||t.push([o,a])}for(let s in r)if((0,Qje.default)(r,s)){let o=r[s];~i.indexOf(s)||i.push(s),xje.default.isRef(o)&&o.isSibling?n(o.path,s):(0,kje.default)(o)&&"deps"in o&&o.deps.forEach(a=>n(a,s))}return Sje.default.array(i,t).reverse()}});var nre=w(FF=>{"use strict";Object.defineProperty(FF,"__esModule",{value:!0});FF.default=Pje;function ire(r,e){let t=Infinity;return r.some((i,n)=>{var s;if(((s=e.path)==null?void 0:s.indexOf(i))!==-1)return t=n,!0}),t}function Pje(r){return(e,t)=>ire(r,e)-ire(r,t)}});var ure=w(KC=>{"use strict";Object.defineProperty(KC,"__esModule",{value:!0});KC.create=sre;KC.default=void 0;var ore=fa(yC()),are=fa(_te()),Dje=fa(Xte()),Rje=fa($te()),Fje=fa(mF()),Nje=PC(),Are=CA(),Lje=fa(rre()),lre=fa(nre()),Tje=fa(l0()),Oje=fa(fu()),NF=fa(EA());function fa(r){return r&&r.__esModule?r:{default:r}}function qf(){return qf=Object.assign||function(r){for(var e=1;eObject.prototype.toString.call(r)==="[object Object]";function Mje(r,e){let t=Object.keys(r.fields);return Object.keys(e).filter(i=>t.indexOf(i)===-1)}var Kje=(0,lre.default)([]),R0=class extends NF.default{constructor(e){super({type:"object"});this.fields=Object.create(null),this._sortErrors=Kje,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{this.transform(function(i){if(typeof i=="string")try{i=JSON.parse(i)}catch(n){i=null}return this.isType(i)?i:null}),e&&this.shape(e)})}_typeCheck(e){return cre(e)||typeof e=="function"}_cast(e,t={}){var i;let n=super._cast(e,t);if(n===void 0)return this.getDefault();if(!this._typeCheck(n))return n;let s=this.fields,o=(i=t.stripUnknown)!=null?i:this.spec.noUnknown,a=this._nodes.concat(Object.keys(n).filter(g=>this._nodes.indexOf(g)===-1)),l={},c=qf({},t,{parent:l,__validating:t.__validating||!1}),u=!1;for(let g of a){let f=s[g],h=(0,ore.default)(n,g);if(f){let p,m=n[g];c.path=(t.path?`${t.path}.`:"")+g,f=f.resolve({value:m,context:t.context,parent:l});let y="spec"in f?f.spec:void 0,b=y==null?void 0:y.strict;if(y==null?void 0:y.strip){u=u||g in n;continue}p=!t.__validating||!b?f.cast(n[g],c):n[g],p!==void 0&&(l[g]=p)}else h&&!o&&(l[g]=n[g]);l[g]!==n[g]&&(u=!0)}return u?l:n}_validate(e,t={},i){let n=[],{sync:s,from:o=[],originalValue:a=e,abortEarly:l=this.spec.abortEarly,recursive:c=this.spec.recursive}=t;o=[{schema:this,value:a},...o],t.__validating=!0,t.originalValue=a,t.from=o,super._validate(e,t,(u,g)=>{if(u){if(!Oje.default.isError(u)||l)return void i(u,g);n.push(u)}if(!c||!cre(g)){i(n[0]||null,g);return}a=a||g;let f=this._nodes.map(h=>(p,m)=>{let y=h.indexOf(".")===-1?(t.path?`${t.path}.`:"")+h:`${t.path||""}["${h}"]`,b=this.fields[h];if(b&&"validate"in b){b.validate(g[h],qf({},t,{path:y,from:o,strict:!0,parent:g,originalValue:a[h]}),m);return}m(null)});(0,Tje.default)({sync:s,tests:f,value:g,errors:n,endEarly:l,sort:this._sortErrors,path:t.path},i)})}clone(e){let t=super.clone(e);return t.fields=qf({},this.fields),t._nodes=this._nodes,t._excludedEdges=this._excludedEdges,t._sortErrors=this._sortErrors,t}concat(e){let t=super.concat(e),i=t.fields;for(let[n,s]of Object.entries(this.fields)){let o=i[n];o===void 0?i[n]=s:o instanceof NF.default&&s instanceof NF.default&&(i[n]=s.concat(o))}return t.withMutation(()=>t.shape(i))}getDefaultFromShape(){let e={};return this._nodes.forEach(t=>{let i=this.fields[t];e[t]="default"in i?i.getDefault():void 0}),e}_getDefault(){if("default"in this.spec)return super._getDefault();if(!!this._nodes.length)return this.getDefaultFromShape()}shape(e,t=[]){let i=this.clone(),n=Object.assign(i.fields,e);if(i.fields=n,i._sortErrors=(0,lre.default)(Object.keys(n)),t.length){Array.isArray(t[0])||(t=[t]);let s=t.map(([o,a])=>`${o}-${a}`);i._excludedEdges=i._excludedEdges.concat(s)}return i._nodes=(0,Lje.default)(n,i._excludedEdges),i}pick(e){let t={};for(let i of e)this.fields[i]&&(t[i]=this.fields[i]);return this.clone().withMutation(i=>(i.fields={},i.shape(t)))}omit(e){let t=this.clone(),i=t.fields;t.fields={};for(let n of e)delete i[n];return t.withMutation(()=>t.shape(i))}from(e,t,i){let n=(0,Nje.getter)(e,!0);return this.transform(s=>{if(s==null)return s;let o=s;return(0,ore.default)(s,e)&&(o=qf({},s),i||delete o[e],o[t]=n(s)),o})}noUnknown(e=!0,t=Are.object.noUnknown){typeof e=="string"&&(t=e,e=!0);let i=this.test({name:"noUnknown",exclusive:!0,message:t,test(n){if(n==null)return!0;let s=Mje(this.schema,n);return!e||s.length===0||this.createError({params:{unknown:s.join(", ")}})}});return i.spec.noUnknown=e,i}unknown(e=!0,t=Are.object.noUnknown){return this.noUnknown(!e,t)}transformKeys(e){return this.transform(t=>t&&(0,Rje.default)(t,(i,n)=>e(n)))}camelCase(){return this.transformKeys(Dje.default)}snakeCase(){return this.transformKeys(are.default)}constantCase(){return this.transformKeys(e=>(0,are.default)(e).toUpperCase())}describe(){let e=super.describe();return e.fields=(0,Fje.default)(this.fields,t=>t.describe()),e}};KC.default=R0;function sre(r){return new R0(r)}sre.prototype=R0.prototype});var fre=w(UC=>{"use strict";Object.defineProperty(UC,"__esModule",{value:!0});UC.create=gre;UC.default=void 0;var LF=Jf(Gf()),Uje=Jf(Tf()),Hje=Jf(IC()),TF=CA(),jje=Jf(l0()),Gje=Jf(fu()),Yje=Jf(EA());function Jf(r){return r&&r.__esModule?r:{default:r}}function F0(){return F0=Object.assign||function(r){for(var e=1;e{this.transform(function(t){if(typeof t=="string")try{t=JSON.parse(t)}catch(i){t=null}return this.isType(t)?t:null})})}_typeCheck(e){return Array.isArray(e)}get _subType(){return this.innerType}_cast(e,t){let i=super._cast(e,t);if(!this._typeCheck(i)||!this.innerType)return i;let n=!1,s=i.map((o,a)=>{let l=this.innerType.cast(o,F0({},t,{path:`${t.path||""}[${a}]`}));return l!==o&&(n=!0),l});return n?s:i}_validate(e,t={},i){var n,s;let o=[],a=t.sync,l=t.path,c=this.innerType,u=(n=t.abortEarly)!=null?n:this.spec.abortEarly,g=(s=t.recursive)!=null?s:this.spec.recursive,f=t.originalValue!=null?t.originalValue:e;super._validate(e,t,(h,p)=>{if(h){if(!Gje.default.isError(h)||u)return void i(h,p);o.push(h)}if(!g||!c||!this._typeCheck(p)){i(o[0]||null,p);return}f=f||p;let m=new Array(p.length);for(let y=0;yc.validate(b,x,q)}(0,jje.default)({sync:a,path:l,value:p,errors:o,endEarly:u,tests:m},i)})}clone(e){let t=super.clone(e);return t.innerType=this.innerType,t}concat(e){let t=super.concat(e);return t.innerType=this.innerType,e.innerType&&(t.innerType=t.innerType?t.innerType.concat(e.innerType):e.innerType),t}of(e){let t=this.clone();if(!(0,Uje.default)(e))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+(0,Hje.default)(e));return t.innerType=e,t}length(e,t=TF.array.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},test(i){return(0,LF.default)(i)||i.length===this.resolve(e)}})}min(e,t){return t=t||TF.array.min,this.test({message:t,name:"min",exclusive:!0,params:{min:e},test(i){return(0,LF.default)(i)||i.length>=this.resolve(e)}})}max(e,t){return t=t||TF.array.max,this.test({message:t,name:"max",exclusive:!0,params:{max:e},test(i){return(0,LF.default)(i)||i.length<=this.resolve(e)}})}ensure(){return this.default(()=>[]).transform((e,t)=>this._typeCheck(e)?e:t==null?[]:[].concat(t))}compact(e){let t=e?(i,n,s)=>!e(i,n,s):i=>!!i;return this.transform(i=>i!=null?i.filter(t):i)}describe(){let e=super.describe();return this.innerType&&(e.innerType=this.innerType.describe()),e}nullable(e=!0){return super.nullable(e)}defined(){return super.defined()}required(e){return super.required(e)}};UC.default=N0;gre.prototype=N0.prototype});var hre=w(HC=>{"use strict";Object.defineProperty(HC,"__esModule",{value:!0});HC.create=qje;HC.default=void 0;var Wje=Jje(Tf());function Jje(r){return r&&r.__esModule?r:{default:r}}function qje(r){return new OF(r)}var OF=class{constructor(e){this.type="lazy",this.__isYupSchema__=!0,this._resolve=(t,i={})=>{let n=this.builder(t,i);if(!(0,Wje.default)(n))throw new TypeError("lazy() functions must return a valid schema");return n.resolve(i)},this.builder=e}resolve(e){return this._resolve(e.value,e)}cast(e,t){return this._resolve(e,t).cast(e,t)}validate(e,t,i){return this._resolve(e,t).validate(e,t,i)}validateSync(e,t){return this._resolve(e,t).validateSync(e,t)}validateAt(e,t,i){return this._resolve(t,i).validateAt(e,t,i)}validateSyncAt(e,t,i){return this._resolve(t,i).validateSyncAt(e,t,i)}describe(){return null}isValid(e,t){return this._resolve(e,t).isValid(e,t)}isValidSync(e,t){return this._resolve(e,t).isValidSync(e,t)}},zje=OF;HC.default=zje});var pre=w(MF=>{"use strict";Object.defineProperty(MF,"__esModule",{value:!0});MF.default=_je;var Xje=Vje(CA());function Vje(r){return r&&r.__esModule?r:{default:r}}function _je(r){Object.keys(r).forEach(e=>{Object.keys(r[e]).forEach(t=>{Xje.default[e][t]=r[e][t]})})}});var UF=w(Br=>{"use strict";Object.defineProperty(Br,"__esModule",{value:!0});Br.addMethod=Zje;Object.defineProperty(Br,"MixedSchema",{enumerable:!0,get:function(){return dre.default}});Object.defineProperty(Br,"mixed",{enumerable:!0,get:function(){return dre.create}});Object.defineProperty(Br,"BooleanSchema",{enumerable:!0,get:function(){return KF.default}});Object.defineProperty(Br,"bool",{enumerable:!0,get:function(){return KF.create}});Object.defineProperty(Br,"boolean",{enumerable:!0,get:function(){return KF.create}});Object.defineProperty(Br,"StringSchema",{enumerable:!0,get:function(){return Cre.default}});Object.defineProperty(Br,"string",{enumerable:!0,get:function(){return Cre.create}});Object.defineProperty(Br,"NumberSchema",{enumerable:!0,get:function(){return mre.default}});Object.defineProperty(Br,"number",{enumerable:!0,get:function(){return mre.create}});Object.defineProperty(Br,"DateSchema",{enumerable:!0,get:function(){return Ere.default}});Object.defineProperty(Br,"date",{enumerable:!0,get:function(){return Ere.create}});Object.defineProperty(Br,"ObjectSchema",{enumerable:!0,get:function(){return Ire.default}});Object.defineProperty(Br,"object",{enumerable:!0,get:function(){return Ire.create}});Object.defineProperty(Br,"ArraySchema",{enumerable:!0,get:function(){return yre.default}});Object.defineProperty(Br,"array",{enumerable:!0,get:function(){return yre.create}});Object.defineProperty(Br,"ref",{enumerable:!0,get:function(){return $je.create}});Object.defineProperty(Br,"lazy",{enumerable:!0,get:function(){return eGe.create}});Object.defineProperty(Br,"ValidationError",{enumerable:!0,get:function(){return tGe.default}});Object.defineProperty(Br,"reach",{enumerable:!0,get:function(){return rGe.default}});Object.defineProperty(Br,"isSchema",{enumerable:!0,get:function(){return wre.default}});Object.defineProperty(Br,"setLocale",{enumerable:!0,get:function(){return iGe.default}});Object.defineProperty(Br,"BaseSchema",{enumerable:!0,get:function(){return nGe.default}});var dre=Eu(Zee()),KF=Eu(ite()),Cre=Eu(ote()),mre=Eu(lte()),Ere=Eu(fte()),Ire=Eu(ure()),yre=Eu(fre()),$je=du(),eGe=hre(),tGe=jC(fu()),rGe=jC(QF()),wre=jC(Tf()),iGe=jC(pre()),nGe=jC(EA());function jC(r){return r&&r.__esModule?r:{default:r}}function Bre(){if(typeof WeakMap!="function")return null;var r=new WeakMap;return Bre=function(){return r},r}function Eu(r){if(r&&r.__esModule)return r;if(r===null||typeof r!="object"&&typeof r!="function")return{default:r};var e=Bre();if(e&&e.has(r))return e.get(r);var t={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in r)if(Object.prototype.hasOwnProperty.call(r,n)){var s=i?Object.getOwnPropertyDescriptor(r,n):null;s&&(s.get||s.set)?Object.defineProperty(t,n,s):t[n]=r[n]}return t.default=r,e&&e.set(r,t),t}function Zje(r,e,t){if(!r||!(0,wre.default)(r.prototype))throw new TypeError("You must provide a yup schema constructor function");if(typeof e!="string")throw new TypeError("A Method name must be provided");if(typeof t!="function")throw new TypeError("Method function must be provided");r.prototype[e]=t}});var xre=w((hft,YC)=>{"use strict";var aGe=process.env.TERM_PROGRAM==="Hyper",AGe=process.platform==="win32",Qre=process.platform==="linux",HF={ballotDisabled:"\u2612",ballotOff:"\u2610",ballotOn:"\u2611",bullet:"\u2022",bulletWhite:"\u25E6",fullBlock:"\u2588",heart:"\u2764",identicalTo:"\u2261",line:"\u2500",mark:"\u203B",middot:"\xB7",minus:"\uFF0D",multiplication:"\xD7",obelus:"\xF7",pencilDownRight:"\u270E",pencilRight:"\u270F",pencilUpRight:"\u2710",percent:"%",pilcrow2:"\u2761",pilcrow:"\xB6",plusMinus:"\xB1",section:"\xA7",starsOff:"\u2606",starsOn:"\u2605",upDownArrow:"\u2195"},Sre=Object.assign({},HF,{check:"\u221A",cross:"\xD7",ellipsisLarge:"...",ellipsis:"...",info:"i",question:"?",questionSmall:"?",pointer:">",pointerSmall:"\xBB",radioOff:"( )",radioOn:"(*)",warning:"\u203C"}),vre=Object.assign({},HF,{ballotCross:"\u2718",check:"\u2714",cross:"\u2716",ellipsisLarge:"\u22EF",ellipsis:"\u2026",info:"\u2139",question:"?",questionFull:"\uFF1F",questionSmall:"\uFE56",pointer:Qre?"\u25B8":"\u276F",pointerSmall:Qre?"\u2023":"\u203A",radioOff:"\u25EF",radioOn:"\u25C9",warning:"\u26A0"});YC.exports=AGe&&!aGe?Sre:vre;Reflect.defineProperty(YC.exports,"common",{enumerable:!1,value:HF});Reflect.defineProperty(YC.exports,"windows",{enumerable:!1,value:Sre});Reflect.defineProperty(YC.exports,"other",{enumerable:!1,value:vre})});var Eo=w((pft,jF)=>{"use strict";var lGe=r=>r!==null&&typeof r=="object"&&!Array.isArray(r),cGe=/[\u001b\u009b][[\]#;?()]*(?:(?:(?:[^\W_]*;?[^\W_]*)\u0007)|(?:(?:[0-9]{1,4}(;[0-9]{0,4})*)?[~0-9=<>cf-nqrtyA-PRZ]))/g,kre=()=>{let r={enabled:!0,visible:!0,styles:{},keys:{}};"FORCE_COLOR"in process.env&&(r.enabled=process.env.FORCE_COLOR!=="0");let e=s=>{let o=s.open=`[${s.codes[0]}m`,a=s.close=`[${s.codes[1]}m`,l=s.regex=new RegExp(`\\u001b\\[${s.codes[1]}m`,"g");return s.wrap=(c,u)=>{c.includes(a)&&(c=c.replace(l,a+o));let g=o+c+a;return u?g.replace(/\r*\n/g,`${a}$&${o}`):g},s},t=(s,o,a)=>typeof s=="function"?s(o):s.wrap(o,a),i=(s,o)=>{if(s===""||s==null)return"";if(r.enabled===!1)return s;if(r.visible===!1)return"";let a=""+s,l=a.includes(` -`),c=o.length;for(c>0&&o.includes("unstyle")&&(o=[...new Set(["unstyle",...o])].reverse());c-- >0;)a=t(r.styles[o[c]],a,l);return a},n=(s,o,a)=>{r.styles[s]=e({name:s,codes:o}),(r.keys[a]||(r.keys[a]=[])).push(s),Reflect.defineProperty(r,s,{configurable:!0,enumerable:!0,set(c){r.alias(s,c)},get(){let c=u=>i(u,c.stack);return Reflect.setPrototypeOf(c,r),c.stack=this.stack?this.stack.concat(s):[s],c}})};return n("reset",[0,0],"modifier"),n("bold",[1,22],"modifier"),n("dim",[2,22],"modifier"),n("italic",[3,23],"modifier"),n("underline",[4,24],"modifier"),n("inverse",[7,27],"modifier"),n("hidden",[8,28],"modifier"),n("strikethrough",[9,29],"modifier"),n("black",[30,39],"color"),n("red",[31,39],"color"),n("green",[32,39],"color"),n("yellow",[33,39],"color"),n("blue",[34,39],"color"),n("magenta",[35,39],"color"),n("cyan",[36,39],"color"),n("white",[37,39],"color"),n("gray",[90,39],"color"),n("grey",[90,39],"color"),n("bgBlack",[40,49],"bg"),n("bgRed",[41,49],"bg"),n("bgGreen",[42,49],"bg"),n("bgYellow",[43,49],"bg"),n("bgBlue",[44,49],"bg"),n("bgMagenta",[45,49],"bg"),n("bgCyan",[46,49],"bg"),n("bgWhite",[47,49],"bg"),n("blackBright",[90,39],"bright"),n("redBright",[91,39],"bright"),n("greenBright",[92,39],"bright"),n("yellowBright",[93,39],"bright"),n("blueBright",[94,39],"bright"),n("magentaBright",[95,39],"bright"),n("cyanBright",[96,39],"bright"),n("whiteBright",[97,39],"bright"),n("bgBlackBright",[100,49],"bgBright"),n("bgRedBright",[101,49],"bgBright"),n("bgGreenBright",[102,49],"bgBright"),n("bgYellowBright",[103,49],"bgBright"),n("bgBlueBright",[104,49],"bgBright"),n("bgMagentaBright",[105,49],"bgBright"),n("bgCyanBright",[106,49],"bgBright"),n("bgWhiteBright",[107,49],"bgBright"),r.ansiRegex=cGe,r.hasColor=r.hasAnsi=s=>(r.ansiRegex.lastIndex=0,typeof s=="string"&&s!==""&&r.ansiRegex.test(s)),r.alias=(s,o)=>{let a=typeof o=="string"?r[o]:o;if(typeof a!="function")throw new TypeError("Expected alias to be the name of an existing color (string) or a function");a.stack||(Reflect.defineProperty(a,"name",{value:s}),r.styles[s]=a,a.stack=[s]),Reflect.defineProperty(r,s,{configurable:!0,enumerable:!0,set(l){r.alias(s,l)},get(){let l=c=>i(c,l.stack);return Reflect.setPrototypeOf(l,r),l.stack=this.stack?this.stack.concat(a.stack):a.stack,l}})},r.theme=s=>{if(!lGe(s))throw new TypeError("Expected theme to be an object");for(let o of Object.keys(s))r.alias(o,s[o]);return r},r.alias("unstyle",s=>typeof s=="string"&&s!==""?(r.ansiRegex.lastIndex=0,s.replace(r.ansiRegex,"")):""),r.alias("noop",s=>s),r.none=r.clear=r.noop,r.stripColor=r.unstyle,r.symbols=xre(),r.define=n,r};jF.exports=kre();jF.exports.create=kre});var Xi=w(Lt=>{"use strict";var uGe=Object.prototype.toString,Ws=Eo(),Pre=!1,GF=[],Dre={yellow:"blue",cyan:"red",green:"magenta",black:"white",blue:"yellow",red:"cyan",magenta:"green",white:"black"};Lt.longest=(r,e)=>r.reduce((t,i)=>Math.max(t,e?i[e].length:i.length),0);Lt.hasColor=r=>!!r&&Ws.hasColor(r);var T0=Lt.isObject=r=>r!==null&&typeof r=="object"&&!Array.isArray(r);Lt.nativeType=r=>uGe.call(r).slice(8,-1).toLowerCase().replace(/\s/g,"");Lt.isAsyncFn=r=>Lt.nativeType(r)==="asyncfunction";Lt.isPrimitive=r=>r!=null&&typeof r!="object"&&typeof r!="function";Lt.resolve=(r,e,...t)=>typeof e=="function"?e.call(r,...t):e;Lt.scrollDown=(r=[])=>[...r.slice(1),r[0]];Lt.scrollUp=(r=[])=>[r.pop(),...r];Lt.reorder=(r=[])=>{let e=r.slice();return e.sort((t,i)=>t.index>i.index?1:t.index{let i=r.length,n=t===i?0:t<0?i-1:t,s=r[e];r[e]=r[n],r[n]=s};Lt.width=(r,e=80)=>{let t=r&&r.columns?r.columns:e;return r&&typeof r.getWindowSize=="function"&&(t=r.getWindowSize()[0]),process.platform==="win32"?t-1:t};Lt.height=(r,e=20)=>{let t=r&&r.rows?r.rows:e;return r&&typeof r.getWindowSize=="function"&&(t=r.getWindowSize()[1]),t};Lt.wordWrap=(r,e={})=>{if(!r)return r;typeof e=="number"&&(e={width:e});let{indent:t="",newline:i=` -`+t,width:n=80}=e;n-=((i+t).match(/[^\S\n]/g)||[]).length;let o=`.{1,${n}}([\\s\\u200B]+|$)|[^\\s\\u200B]+?([\\s\\u200B]+|$)`,a=r.trim(),l=new RegExp(o,"g"),c=a.match(l)||[];return c=c.map(u=>u.replace(/\n$/,"")),e.padEnd&&(c=c.map(u=>u.padEnd(n," "))),e.padStart&&(c=c.map(u=>u.padStart(n," "))),t+c.join(i)};Lt.unmute=r=>{let e=r.stack.find(i=>Ws.keys.color.includes(i));return e?Ws[e]:r.stack.find(i=>i.slice(2)==="bg")?Ws[e.slice(2)]:i=>i};Lt.pascal=r=>r?r[0].toUpperCase()+r.slice(1):"";Lt.inverse=r=>{if(!r||!r.stack)return r;let e=r.stack.find(i=>Ws.keys.color.includes(i));if(e){let i=Ws["bg"+Lt.pascal(e)];return i?i.black:r}let t=r.stack.find(i=>i.slice(0,2)==="bg");return t?Ws[t.slice(2).toLowerCase()]||r:Ws.none};Lt.complement=r=>{if(!r||!r.stack)return r;let e=r.stack.find(i=>Ws.keys.color.includes(i)),t=r.stack.find(i=>i.slice(0,2)==="bg");if(e&&!t)return Ws[Dre[e]||e];if(t){let i=t.slice(2).toLowerCase(),n=Dre[i];return n&&Ws["bg"+Lt.pascal(n)]||r}return Ws.none};Lt.meridiem=r=>{let e=r.getHours(),t=r.getMinutes(),i=e>=12?"pm":"am";e=e%12;let n=e===0?12:e,s=t<10?"0"+t:t;return n+":"+s+" "+i};Lt.set=(r={},e="",t)=>e.split(".").reduce((i,n,s,o)=>{let a=o.length-1>s?i[n]||{}:t;return!Lt.isObject(a)&&s{let i=r[e]==null?e.split(".").reduce((n,s)=>n&&n[s],r):r[e];return i==null?t:i};Lt.mixin=(r,e)=>{if(!T0(r))return e;if(!T0(e))return r;for(let t of Object.keys(e)){let i=Object.getOwnPropertyDescriptor(e,t);if(i.hasOwnProperty("value"))if(r.hasOwnProperty(t)&&T0(i.value)){let n=Object.getOwnPropertyDescriptor(r,t);T0(n.value)?r[t]=Lt.merge({},r[t],e[t]):Reflect.defineProperty(r,t,i)}else Reflect.defineProperty(r,t,i);else Reflect.defineProperty(r,t,i)}return r};Lt.merge=(...r)=>{let e={};for(let t of r)Lt.mixin(e,t);return e};Lt.mixinEmitter=(r,e)=>{let t=e.constructor.prototype;for(let i of Object.keys(t)){let n=t[i];typeof n=="function"?Lt.define(r,i,n.bind(e)):Lt.define(r,i,n)}};Lt.onExit=r=>{let e=(t,i)=>{Pre||(Pre=!0,GF.forEach(n=>n()),t===!0&&process.exit(128+i))};GF.length===0&&(process.once("SIGTERM",e.bind(null,!0,15)),process.once("SIGINT",e.bind(null,!0,2)),process.once("exit",e)),GF.push(r)};Lt.define=(r,e,t)=>{Reflect.defineProperty(r,e,{value:t})};Lt.defineExport=(r,e,t)=>{let i;Reflect.defineProperty(r,e,{enumerable:!0,configurable:!0,set(n){i=n},get(){return i?i():t()}})}});var Rre=w(zf=>{"use strict";zf.ctrl={a:"first",b:"backward",c:"cancel",d:"deleteForward",e:"last",f:"forward",g:"reset",i:"tab",k:"cutForward",l:"reset",n:"newItem",m:"cancel",j:"submit",p:"search",r:"remove",s:"save",u:"undo",w:"cutLeft",x:"toggleCursor",v:"paste"};zf.shift={up:"shiftUp",down:"shiftDown",left:"shiftLeft",right:"shiftRight",tab:"prev"};zf.fn={up:"pageUp",down:"pageDown",left:"pageLeft",right:"pageRight",delete:"deleteForward"};zf.option={b:"backward",f:"forward",d:"cutRight",left:"cutLeft",up:"altUp",down:"altDown"};zf.keys={pageup:"pageUp",pagedown:"pageDown",home:"home",end:"end",cancel:"cancel",delete:"deleteForward",backspace:"delete",down:"down",enter:"submit",escape:"cancel",left:"left",space:"space",number:"number",return:"submit",right:"right",tab:"next",up:"up"}});var Lre=w((mft,Fre)=>{"use strict";var Nre=require("readline"),gGe=Rre(),fGe=/^(?:\x1b)([a-zA-Z0-9])$/,hGe=/^(?:\x1b+)(O|N|\[|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/,pGe={OP:"f1",OQ:"f2",OR:"f3",OS:"f4","[11~":"f1","[12~":"f2","[13~":"f3","[14~":"f4","[[A":"f1","[[B":"f2","[[C":"f3","[[D":"f4","[[E":"f5","[15~":"f5","[17~":"f6","[18~":"f7","[19~":"f8","[20~":"f9","[21~":"f10","[23~":"f11","[24~":"f12","[A":"up","[B":"down","[C":"right","[D":"left","[E":"clear","[F":"end","[H":"home",OA:"up",OB:"down",OC:"right",OD:"left",OE:"clear",OF:"end",OH:"home","[1~":"home","[2~":"insert","[3~":"delete","[4~":"end","[5~":"pageup","[6~":"pagedown","[[5~":"pageup","[[6~":"pagedown","[7~":"home","[8~":"end","[a":"up","[b":"down","[c":"right","[d":"left","[e":"clear","[2$":"insert","[3$":"delete","[5$":"pageup","[6$":"pagedown","[7$":"home","[8$":"end",Oa:"up",Ob:"down",Oc:"right",Od:"left",Oe:"clear","[2^":"insert","[3^":"delete","[5^":"pageup","[6^":"pagedown","[7^":"home","[8^":"end","[Z":"tab"};function dGe(r){return["[a","[b","[c","[d","[e","[2$","[3$","[5$","[6$","[7$","[8$","[Z"].includes(r)}function CGe(r){return["Oa","Ob","Oc","Od","Oe","[2^","[3^","[5^","[6^","[7^","[8^"].includes(r)}var O0=(r="",e={})=>{let t,i=N({name:e.name,ctrl:!1,meta:!1,shift:!1,option:!1,sequence:r,raw:r},e);if(Buffer.isBuffer(r)?r[0]>127&&r[1]===void 0?(r[0]-=128,r=""+String(r)):r=String(r):r!==void 0&&typeof r!="string"?r=String(r):r||(r=i.sequence||""),i.sequence=i.sequence||r||i.name,r==="\r")i.raw=void 0,i.name="return";else if(r===` -`)i.name="enter";else if(r===" ")i.name="tab";else if(r==="\b"||r==="\x7F"||r==="\x7F"||r==="\b")i.name="backspace",i.meta=r.charAt(0)==="";else if(r===""||r==="")i.name="escape",i.meta=r.length===2;else if(r===" "||r===" ")i.name="space",i.meta=r.length===2;else if(r<="")i.name=String.fromCharCode(r.charCodeAt(0)+"a".charCodeAt(0)-1),i.ctrl=!0;else if(r.length===1&&r>="0"&&r<="9")i.name="number";else if(r.length===1&&r>="a"&&r<="z")i.name=r;else if(r.length===1&&r>="A"&&r<="Z")i.name=r.toLowerCase(),i.shift=!0;else if(t=fGe.exec(r))i.meta=!0,i.shift=/^[A-Z]$/.test(t[1]);else if(t=hGe.exec(r)){let n=[...r];n[0]===""&&n[1]===""&&(i.option=!0);let s=[t[1],t[2],t[4],t[6]].filter(Boolean).join(""),o=(t[3]||t[5]||1)-1;i.ctrl=!!(o&4),i.meta=!!(o&10),i.shift=!!(o&1),i.code=s,i.name=pGe[s],i.shift=dGe(s)||i.shift,i.ctrl=CGe(s)||i.ctrl}return i};O0.listen=(r={},e)=>{let{stdin:t}=r;if(!t||t!==process.stdin&&!t.isTTY)throw new Error("Invalid stream passed");let i=Nre.createInterface({terminal:!0,input:t});Nre.emitKeypressEvents(t,i);let n=(a,l)=>e(a,O0(a,l),i),s=t.isRaw;return t.isTTY&&t.setRawMode(!0),t.on("keypress",n),i.resume(),()=>{t.isTTY&&t.setRawMode(s),t.removeListener("keypress",n),i.pause(),i.close()}};O0.action=(r,e,t)=>{let i=N(N({},gGe),t);return e.ctrl?(e.action=i.ctrl[e.name],e):e.option&&i.option?(e.action=i.option[e.name],e):e.shift?(e.action=i.shift[e.name],e):(e.action=i.keys[e.name],e)};Fre.exports=O0});var Ore=w((Eft,Tre)=>{"use strict";Tre.exports=r=>{r.timers=r.timers||{};let e=r.options.timers;if(!!e)for(let t of Object.keys(e)){let i=e[t];typeof i=="number"&&(i={interval:i}),mGe(r,t,i)}};function mGe(r,e,t={}){let i=r.timers[e]={name:e,start:Date.now(),ms:0,tick:0},n=t.interval||120;i.frames=t.frames||[],i.loading=!0;let s=setInterval(()=>{i.ms=Date.now()-i.start,i.tick++,r.render()},n);return i.stop=()=>{i.loading=!1,clearInterval(s)},Reflect.defineProperty(i,"interval",{value:s}),r.once("close",()=>i.stop()),i.stop}});var Ure=w((Ift,Mre)=>{"use strict";var{define:EGe,width:IGe}=Xi(),Kre=class{constructor(e){let t=e.options;EGe(this,"_prompt",e),this.type=e.type,this.name=e.name,this.message="",this.header="",this.footer="",this.error="",this.hint="",this.input="",this.cursor=0,this.index=0,this.lines=0,this.tick=0,this.prompt="",this.buffer="",this.width=IGe(t.stdout||process.stdout),Object.assign(this,t),this.name=this.name||this.message,this.message=this.message||this.name,this.symbols=e.symbols,this.styles=e.styles,this.required=new Set,this.cancelled=!1,this.submitted=!1}clone(){let e=N({},this);return e.status=this.status,e.buffer=Buffer.from(e.buffer),delete e.clone,e}set color(e){this._color=e}get color(){let e=this.prompt.styles;if(this.cancelled)return e.cancelled;if(this.submitted)return e.submitted;let t=this._color||e[this.status];return typeof t=="function"?t:e.pending}set loading(e){this._loading=e}get loading(){return typeof this._loading=="boolean"?this._loading:this.loadingChoices?"choices":!1}get status(){return this.cancelled?"cancelled":this.submitted?"submitted":"pending"}};Mre.exports=Kre});var jre=w((yft,Hre)=>{"use strict";var YF=Xi(),Ni=Eo(),qF={default:Ni.noop,noop:Ni.noop,set inverse(r){this._inverse=r},get inverse(){return this._inverse||YF.inverse(this.primary)},set complement(r){this._complement=r},get complement(){return this._complement||YF.complement(this.primary)},primary:Ni.cyan,success:Ni.green,danger:Ni.magenta,strong:Ni.bold,warning:Ni.yellow,muted:Ni.dim,disabled:Ni.gray,dark:Ni.dim.gray,underline:Ni.underline,set info(r){this._info=r},get info(){return this._info||this.primary},set em(r){this._em=r},get em(){return this._em||this.primary.underline},set heading(r){this._heading=r},get heading(){return this._heading||this.muted.underline},set pending(r){this._pending=r},get pending(){return this._pending||this.primary},set submitted(r){this._submitted=r},get submitted(){return this._submitted||this.success},set cancelled(r){this._cancelled=r},get cancelled(){return this._cancelled||this.danger},set typing(r){this._typing=r},get typing(){return this._typing||this.dim},set placeholder(r){this._placeholder=r},get placeholder(){return this._placeholder||this.primary.dim},set highlight(r){this._highlight=r},get highlight(){return this._highlight||this.inverse}};qF.merge=(r={})=>{r.styles&&typeof r.styles.enabled=="boolean"&&(Ni.enabled=r.styles.enabled),r.styles&&typeof r.styles.visible=="boolean"&&(Ni.visible=r.styles.visible);let e=YF.merge({},qF,r.styles);delete e.merge;for(let t of Object.keys(Ni))e.hasOwnProperty(t)||Reflect.defineProperty(e,t,{get:()=>Ni[t]});for(let t of Object.keys(Ni.styles))e.hasOwnProperty(t)||Reflect.defineProperty(e,t,{get:()=>Ni[t]});return e};Hre.exports=qF});var Yre=w((wft,Gre)=>{"use strict";var JF=process.platform==="win32",yA=Eo(),yGe=Xi(),WF=te(N({},yA.symbols),{upDownDoubleArrow:"\u21D5",upDownDoubleArrow2:"\u2B0D",upDownArrow:"\u2195",asterisk:"*",asterism:"\u2042",bulletWhite:"\u25E6",electricArrow:"\u2301",ellipsisLarge:"\u22EF",ellipsisSmall:"\u2026",fullBlock:"\u2588",identicalTo:"\u2261",indicator:yA.symbols.check,leftAngle:"\u2039",mark:"\u203B",minus:"\u2212",multiplication:"\xD7",obelus:"\xF7",percent:"%",pilcrow:"\xB6",pilcrow2:"\u2761",pencilUpRight:"\u2710",pencilDownRight:"\u270E",pencilRight:"\u270F",plus:"+",plusMinus:"\xB1",pointRight:"\u261E",rightAngle:"\u203A",section:"\xA7",hexagon:{off:"\u2B21",on:"\u2B22",disabled:"\u2B22"},ballot:{on:"\u2611",off:"\u2610",disabled:"\u2612"},stars:{on:"\u2605",off:"\u2606",disabled:"\u2606"},folder:{on:"\u25BC",off:"\u25B6",disabled:"\u25B6"},prefix:{pending:yA.symbols.question,submitted:yA.symbols.check,cancelled:yA.symbols.cross},separator:{pending:yA.symbols.pointerSmall,submitted:yA.symbols.middot,cancelled:yA.symbols.middot},radio:{off:JF?"( )":"\u25EF",on:JF?"(*)":"\u25C9",disabled:JF?"(|)":"\u24BE"},numbers:["\u24EA","\u2460","\u2461","\u2462","\u2463","\u2464","\u2465","\u2466","\u2467","\u2468","\u2469","\u246A","\u246B","\u246C","\u246D","\u246E","\u246F","\u2470","\u2471","\u2472","\u2473","\u3251","\u3252","\u3253","\u3254","\u3255","\u3256","\u3257","\u3258","\u3259","\u325A","\u325B","\u325C","\u325D","\u325E","\u325F","\u32B1","\u32B2","\u32B3","\u32B4","\u32B5","\u32B6","\u32B7","\u32B8","\u32B9","\u32BA","\u32BB","\u32BC","\u32BD","\u32BE","\u32BF"]});WF.merge=r=>{let e=yGe.merge({},yA.symbols,WF,r.symbols);return delete e.merge,e};Gre.exports=WF});var Jre=w((Bft,qre)=>{"use strict";var wGe=jre(),BGe=Yre(),bGe=Xi();qre.exports=r=>{r.options=bGe.merge({},r.options.theme,r.options),r.symbols=BGe.merge(r.options),r.styles=wGe.merge(r.options)}});var Xre=w((Wre,zre)=>{"use strict";var _re=process.env.TERM_PROGRAM==="Apple_Terminal",QGe=Eo(),zF=Xi(),Io=zre.exports=Wre,Lr="[",Vre="\x07",_F=!1,Fl=Io.code={bell:Vre,beep:Vre,beginning:`${Lr}G`,down:`${Lr}J`,esc:Lr,getPosition:`${Lr}6n`,hide:`${Lr}?25l`,line:`${Lr}2K`,lineEnd:`${Lr}K`,lineStart:`${Lr}1K`,restorePosition:Lr+(_re?"8":"u"),savePosition:Lr+(_re?"7":"s"),screen:`${Lr}2J`,show:`${Lr}?25h`,up:`${Lr}1J`},Iu=Io.cursor={get hidden(){return _F},hide(){return _F=!0,Fl.hide},show(){return _F=!1,Fl.show},forward:(r=1)=>`${Lr}${r}C`,backward:(r=1)=>`${Lr}${r}D`,nextLine:(r=1)=>`${Lr}E`.repeat(r),prevLine:(r=1)=>`${Lr}F`.repeat(r),up:(r=1)=>r?`${Lr}${r}A`:"",down:(r=1)=>r?`${Lr}${r}B`:"",right:(r=1)=>r?`${Lr}${r}C`:"",left:(r=1)=>r?`${Lr}${r}D`:"",to(r,e){return e?`${Lr}${e+1};${r+1}H`:`${Lr}${r+1}G`},move(r=0,e=0){let t="";return t+=r<0?Iu.left(-r):r>0?Iu.right(r):"",t+=e<0?Iu.up(-e):e>0?Iu.down(e):"",t},restore(r={}){let{after:e,cursor:t,initial:i,input:n,prompt:s,size:o,value:a}=r;if(i=zF.isPrimitive(i)?String(i):"",n=zF.isPrimitive(n)?String(n):"",a=zF.isPrimitive(a)?String(a):"",o){let l=Io.cursor.up(o)+Io.cursor.to(s.length),c=n.length-t;return c>0&&(l+=Io.cursor.left(c)),l}if(a||e){let l=!n&&!!i?-i.length:-n.length+t;return e&&(l-=e.length),n===""&&i&&!s.includes(i)&&(l+=i.length),Io.cursor.move(l)}}},VF=Io.erase={screen:Fl.screen,up:Fl.up,down:Fl.down,line:Fl.line,lineEnd:Fl.lineEnd,lineStart:Fl.lineStart,lines(r){let e="";for(let t=0;t{if(!e)return VF.line+Iu.to(0);let t=s=>[...QGe.unstyle(s)].length,i=r.split(/\r?\n/),n=0;for(let s of i)n+=1+Math.floor(Math.max(t(s)-1,0)/e);return(VF.line+Iu.prevLine()).repeat(n-1)+VF.line+Iu.to(0)}});var _f=w((bft,Zre)=>{"use strict";var SGe=require("events"),$re=Eo(),XF=Lre(),vGe=Ore(),xGe=Ure(),kGe=Jre(),Tn=Xi(),yu=Xre(),M0=class extends SGe{constructor(e={}){super();this.name=e.name,this.type=e.type,this.options=e,kGe(this),vGe(this),this.state=new xGe(this),this.initial=[e.initial,e.default].find(t=>t!=null),this.stdout=e.stdout||process.stdout,this.stdin=e.stdin||process.stdin,this.scale=e.scale||1,this.term=this.options.term||process.env.TERM_PROGRAM,this.margin=DGe(this.options.margin),this.setMaxListeners(0),PGe(this)}async keypress(e,t={}){this.keypressed=!0;let i=XF.action(e,XF(e,t),this.options.actions);this.state.keypress=i,this.emit("keypress",e,i),this.emit("state",this.state.clone());let n=this.options[i.action]||this[i.action]||this.dispatch;if(typeof n=="function")return await n.call(this,e,i);this.alert()}alert(){delete this.state.alert,this.options.show===!1?this.emit("alert"):this.stdout.write(yu.code.beep)}cursorHide(){this.stdout.write(yu.cursor.hide()),Tn.onExit(()=>this.cursorShow())}cursorShow(){this.stdout.write(yu.cursor.show())}write(e){!e||(this.stdout&&this.state.show!==!1&&this.stdout.write(e),this.state.buffer+=e)}clear(e=0){let t=this.state.buffer;this.state.buffer="",!(!t&&!e||this.options.show===!1)&&this.stdout.write(yu.cursor.down(e)+yu.clear(t,this.width))}restore(){if(this.state.closed||this.options.show===!1)return;let{prompt:e,after:t,rest:i}=this.sections(),{cursor:n,initial:s="",input:o="",value:a=""}=this,l=this.state.size=i.length,c={after:t,cursor:n,initial:s,input:o,prompt:e,size:l,value:a},u=yu.cursor.restore(c);u&&this.stdout.write(u)}sections(){let{buffer:e,input:t,prompt:i}=this.state;i=$re.unstyle(i);let n=$re.unstyle(e),s=n.indexOf(i),o=n.slice(0,s),l=n.slice(s).split(` -`),c=l[0],u=l[l.length-1],f=(i+(t?" "+t:"")).length,h=fe.call(this,this.value),this.result=()=>i.call(this,this.value),typeof t.initial=="function"&&(this.initial=await t.initial.call(this,this)),typeof t.onRun=="function"&&await t.onRun.call(this,this),typeof t.onSubmit=="function"){let n=t.onSubmit.bind(this),s=this.submit.bind(this);delete this.options.onSubmit,this.submit=async()=>(await n(this.name,this.value,this),s())}await this.start(),await this.render()}render(){throw new Error("expected prompt to have a custom render method")}run(){return new Promise(async(e,t)=>{if(this.once("submit",e),this.once("cancel",t),await this.skip())return this.render=()=>{},this.submit();await this.initialize(),this.emit("run")})}async element(e,t,i){let{options:n,state:s,symbols:o,timers:a}=this,l=a&&a[e];s.timer=l;let c=n[e]||s[e]||o[e],u=t&&t[e]!=null?t[e]:await c;if(u==="")return u;let g=await this.resolve(u,s,t,i);return!g&&t&&t[e]?this.resolve(c,s,t,i):g}async prefix(){let e=await this.element("prefix")||this.symbols,t=this.timers&&this.timers.prefix,i=this.state;return i.timer=t,Tn.isObject(e)&&(e=e[i.status]||e.pending),Tn.hasColor(e)?e:(this.styles[i.status]||this.styles.pending)(e)}async message(){let e=await this.element("message");return Tn.hasColor(e)?e:this.styles.strong(e)}async separator(){let e=await this.element("separator")||this.symbols,t=this.timers&&this.timers.separator,i=this.state;i.timer=t;let n=e[i.status]||e.pending||i.separator,s=await this.resolve(n,i);return Tn.isObject(s)&&(s=s[i.status]||s.pending),Tn.hasColor(s)?s:this.styles.muted(s)}async pointer(e,t){let i=await this.element("pointer",e,t);if(typeof i=="string"&&Tn.hasColor(i))return i;if(i){let n=this.styles,s=this.index===t,o=s?n.primary:c=>c,a=await this.resolve(i[s?"on":"off"]||i,this.state),l=Tn.hasColor(a)?a:o(a);return s?l:" ".repeat(a.length)}}async indicator(e,t){let i=await this.element("indicator",e,t);if(typeof i=="string"&&Tn.hasColor(i))return i;if(i){let n=this.styles,s=e.enabled===!0,o=s?n.success:n.dark,a=i[s?"on":"off"]||i;return Tn.hasColor(a)?a:o(a)}return""}body(){return null}footer(){if(this.state.status==="pending")return this.element("footer")}header(){if(this.state.status==="pending")return this.element("header")}async hint(){if(this.state.status==="pending"&&!this.isValue(this.state.input)){let e=await this.element("hint");return Tn.hasColor(e)?e:this.styles.muted(e)}}error(e){return this.state.submitted?"":e||this.state.error}format(e){return e}result(e){return e}validate(e){return this.options.required===!0?this.isValue(e):!0}isValue(e){return e!=null&&e!==""}resolve(e,...t){return Tn.resolve(this,e,...t)}get base(){return M0.prototype}get style(){return this.styles[this.state.status]}get height(){return this.options.rows||Tn.height(this.stdout,25)}get width(){return this.options.columns||Tn.width(this.stdout,80)}get size(){return{width:this.width,height:this.height}}set cursor(e){this.state.cursor=e}get cursor(){return this.state.cursor}set input(e){this.state.input=e}get input(){return this.state.input}set value(e){this.state.value=e}get value(){let{input:e,value:t}=this.state,i=[t,e].find(this.isValue.bind(this));return this.isValue(i)?i:this.initial}static get prompt(){return e=>new this(e).run()}};function PGe(r){let e=n=>r[n]===void 0||typeof r[n]=="function",t=["actions","choices","initial","margin","roles","styles","symbols","theme","timers","value"],i=["body","footer","error","header","hint","indicator","message","prefix","separator","skip"];for(let n of Object.keys(r.options)){if(t.includes(n)||/^on[A-Z]/.test(n))continue;let s=r.options[n];typeof s=="function"&&e(n)?i.includes(n)||(r[n]=s.bind(r)):typeof r[n]!="function"&&(r[n]=s)}}function DGe(r){typeof r=="number"&&(r=[r,r,r,r]);let e=[].concat(r||[]),t=n=>n%2==0?` -`:" ",i=[];for(let n=0;n<4;n++){let s=t(n);e[n]?i.push(s.repeat(e[n])):i.push("")}return i}Zre.exports=M0});var rie=w((Qft,eie)=>{"use strict";var RGe=Xi(),tie={default(r,e){return e},checkbox(r,e){throw new Error("checkbox role is not implemented yet")},editable(r,e){throw new Error("editable role is not implemented yet")},expandable(r,e){throw new Error("expandable role is not implemented yet")},heading(r,e){return e.disabled="",e.indicator=[e.indicator," "].find(t=>t!=null),e.message=e.message||"",e},input(r,e){throw new Error("input role is not implemented yet")},option(r,e){return tie.default(r,e)},radio(r,e){throw new Error("radio role is not implemented yet")},separator(r,e){return e.disabled="",e.indicator=[e.indicator," "].find(t=>t!=null),e.message=e.message||r.symbols.line.repeat(5),e},spacer(r,e){return e}};eie.exports=(r,e={})=>{let t=RGe.merge({},tie,e.roles);return t[r]||t.default}});var qC=w((Sft,iie)=>{"use strict";var FGe=Eo(),NGe=_f(),LGe=rie(),K0=Xi(),{reorder:ZF,scrollUp:TGe,scrollDown:OGe,isObject:nie,swap:MGe}=K0,sie=class extends NGe{constructor(e){super(e);this.cursorHide(),this.maxSelected=e.maxSelected||Infinity,this.multiple=e.multiple||!1,this.initial=e.initial||0,this.delay=e.delay||0,this.longest=0,this.num=""}async initialize(){typeof this.options.initial=="function"&&(this.initial=await this.options.initial.call(this)),await this.reset(!0),await super.initialize()}async reset(){let{choices:e,initial:t,autofocus:i,suggest:n}=this.options;if(this.state._choices=[],this.state.choices=[],this.choices=await Promise.all(await this.toChoices(e)),this.choices.forEach(s=>s.enabled=!1),typeof n!="function"&&this.selectable.length===0)throw new Error("At least one choice must be selectable");nie(t)&&(t=Object.keys(t)),Array.isArray(t)?(i!=null&&(this.index=this.findIndex(i)),t.forEach(s=>this.enable(this.find(s))),await this.render()):(i!=null&&(t=i),typeof t=="string"&&(t=this.findIndex(t)),typeof t=="number"&&t>-1&&(this.index=Math.max(0,Math.min(t,this.choices.length)),this.enable(this.find(this.index)))),this.isDisabled(this.focused)&&await this.down()}async toChoices(e,t){this.state.loadingChoices=!0;let i=[],n=0,s=async(o,a)=>{typeof o=="function"&&(o=await o.call(this)),o instanceof Promise&&(o=await o);for(let l=0;l(this.state.loadingChoices=!1,o))}async toChoice(e,t,i){if(typeof e=="function"&&(e=await e.call(this,this)),e instanceof Promise&&(e=await e),typeof e=="string"&&(e={name:e}),e.normalized)return e;e.normalized=!0;let n=e.value;if(e=LGe(e.role,this.options)(this,e),typeof e.disabled=="string"&&!e.hint&&(e.hint=e.disabled,e.disabled=!0),e.disabled===!0&&e.hint==null&&(e.hint="(disabled)"),e.index!=null)return e;e.name=e.name||e.key||e.title||e.value||e.message,e.message=e.message||e.name||"",e.value=[e.value,e.name].find(this.isValue.bind(this)),e.input="",e.index=t,e.cursor=0,K0.define(e,"parent",i),e.level=i?i.level+1:1,e.indent==null&&(e.indent=i?i.indent+" ":e.indent||""),e.path=i?i.path+"."+e.name:e.name,e.enabled=!!(this.multiple&&!this.isDisabled(e)&&(e.enabled||this.isSelected(e))),this.isDisabled(e)||(this.longest=Math.max(this.longest,FGe.unstyle(e.message).length));let o=N({},e);return e.reset=(a=o.input,l=o.value)=>{for(let c of Object.keys(o))e[c]=o[c];e.input=a,e.value=l},n==null&&typeof e.initial=="function"&&(e.input=await e.initial.call(this,this.state,e,t)),e}async onChoice(e,t){this.emit("choice",e,t,this),typeof e.onChoice=="function"&&await e.onChoice.call(this,this.state,e,t)}async addChoice(e,t,i){let n=await this.toChoice(e,t,i);return this.choices.push(n),this.index=this.choices.length-1,this.limit=this.choices.length,n}async newItem(e,t,i){let n=N({name:"New choice name?",editable:!0,newChoice:!0},e),s=await this.addChoice(n,t,i);return s.updateChoice=()=>{delete s.newChoice,s.name=s.message=s.input,s.input="",s.cursor=0},this.render()}indent(e){return e.indent==null?e.level>1?" ".repeat(e.level-1):"":e.indent}dispatch(e,t){if(this.multiple&&this[t.name])return this[t.name]();this.alert()}focus(e,t){return typeof t!="boolean"&&(t=e.enabled),t&&!e.enabled&&this.selected.length>=this.maxSelected?this.alert():(this.index=e.index,e.enabled=t&&!this.isDisabled(e),e)}space(){return this.multiple?(this.toggle(this.focused),this.render()):this.alert()}a(){if(this.maxSelectedt.enabled);return this.choices.forEach(t=>t.enabled=!e),this.render()}i(){return this.choices.length-this.selected.length>this.maxSelected?this.alert():(this.choices.forEach(e=>e.enabled=!e.enabled),this.render())}g(e=this.focused){return this.choices.some(t=>!!t.parent)?(this.toggle(e.parent&&!e.choices?e.parent:e),this.render()):this.a()}toggle(e,t){if(!e.enabled&&this.selected.length>=this.maxSelected)return this.alert();typeof t!="boolean"&&(t=!e.enabled),e.enabled=t,e.choices&&e.choices.forEach(n=>this.toggle(n,t));let i=e.parent;for(;i;){let n=i.choices.filter(s=>this.isDisabled(s));i.enabled=n.every(s=>s.enabled===!0),i=i.parent}return oie(this,this.choices),this.emit("toggle",e,this),e}enable(e){return this.selected.length>=this.maxSelected?this.alert():(e.enabled=!this.isDisabled(e),e.choices&&e.choices.forEach(this.enable.bind(this)),e)}disable(e){return e.enabled=!1,e.choices&&e.choices.forEach(this.disable.bind(this)),e}number(e){this.num+=e;let t=i=>{let n=Number(i);if(n>this.choices.length-1)return this.alert();let s=this.focused,o=this.choices.find(a=>n===a.index);if(!o.enabled&&this.selected.length>=this.maxSelected)return this.alert();if(this.visible.indexOf(o)===-1){let a=ZF(this.choices),l=a.indexOf(o);if(s.index>l){let c=a.slice(l,l+this.limit),u=a.filter(g=>!c.includes(g));this.choices=c.concat(u)}else{let c=l-this.limit+1;this.choices=a.slice(c).concat(a.slice(0,c))}}return this.index=this.choices.indexOf(o),this.toggle(this.focused),this.render()};return clearTimeout(this.numberTimeout),new Promise(i=>{let n=this.choices.length,s=this.num,o=(a=!1,l)=>{clearTimeout(this.numberTimeout),a&&(l=t(s)),this.num="",i(l)};if(s==="0"||s.length===1&&Number(s+"0")>n)return o(!0);if(Number(s)>n)return o(!1,this.alert());this.numberTimeout=setTimeout(()=>o(!0),this.delay)})}home(){return this.choices=ZF(this.choices),this.index=0,this.render()}end(){let e=this.choices.length-this.limit,t=ZF(this.choices);return this.choices=t.slice(e).concat(t.slice(0,e)),this.index=this.limit-1,this.render()}first(){return this.index=0,this.render()}last(){return this.index=this.visible.length-1,this.render()}prev(){return this.visible.length<=1?this.alert():this.up()}next(){return this.visible.length<=1?this.alert():this.down()}right(){return this.cursor>=this.input.length?this.alert():(this.cursor++,this.render())}left(){return this.cursor<=0?this.alert():(this.cursor--,this.render())}up(){let e=this.choices.length,t=this.visible.length,i=this.index;return this.options.scroll===!1&&i===0?this.alert():e>t&&i===0?this.scrollUp():(this.index=(i-1%e+e)%e,this.isDisabled()?this.up():this.render())}down(){let e=this.choices.length,t=this.visible.length,i=this.index;return this.options.scroll===!1&&i===t-1?this.alert():e>t&&i===t-1?this.scrollDown():(this.index=(i+1)%e,this.isDisabled()?this.down():this.render())}scrollUp(e=0){return this.choices=TGe(this.choices),this.index=e,this.isDisabled()?this.up():this.render()}scrollDown(e=this.visible.length-1){return this.choices=OGe(this.choices),this.index=e,this.isDisabled()?this.down():this.render()}async shiftUp(){if(this.options.sort===!0){this.sorting=!0,this.swap(this.index-1),await this.up(),this.sorting=!1;return}return this.scrollUp(this.index)}async shiftDown(){if(this.options.sort===!0){this.sorting=!0,this.swap(this.index+1),await this.down(),this.sorting=!1;return}return this.scrollDown(this.index)}pageUp(){return this.visible.length<=1?this.alert():(this.limit=Math.max(this.limit-1,0),this.index=Math.min(this.limit-1,this.index),this._limit=this.limit,this.isDisabled()?this.up():this.render())}pageDown(){return this.visible.length>=this.choices.length?this.alert():(this.index=Math.max(0,this.index),this.limit=Math.min(this.limit+1,this.choices.length),this._limit=this.limit,this.isDisabled()?this.down():this.render())}swap(e){MGe(this.choices,this.index,e)}isDisabled(e=this.focused){return e&&["disabled","collapsed","hidden","completing","readonly"].some(i=>e[i]===!0)?!0:e&&e.role==="heading"}isEnabled(e=this.focused){if(Array.isArray(e))return e.every(t=>this.isEnabled(t));if(e.choices){let t=e.choices.filter(i=>!this.isDisabled(i));return e.enabled&&t.every(i=>this.isEnabled(i))}return e.enabled&&!this.isDisabled(e)}isChoice(e,t){return e.name===t||e.index===Number(t)}isSelected(e){return Array.isArray(this.initial)?this.initial.some(t=>this.isChoice(e,t)):this.isChoice(e,this.initial)}map(e=[],t="value"){return[].concat(e||[]).reduce((i,n)=>(i[n]=this.find(n,t),i),{})}filter(e,t){let i=(a,l)=>[a.name,l].includes(e),n=typeof e=="function"?e:i,o=(this.options.multiple?this.state._choices:this.choices).filter(n);return t?o.map(a=>a[t]):o}find(e,t){if(nie(e))return t?e[t]:e;let i=(o,a)=>[o.name,a].includes(e),n=typeof e=="function"?e:i,s=this.choices.find(n);if(s)return t?s[t]:s}findIndex(e){return this.choices.indexOf(this.find(e))}async submit(){let e=this.focused;if(!e)return this.alert();if(e.newChoice)return e.input?(e.updateChoice(),this.render()):this.alert();if(this.choices.some(o=>o.newChoice))return this.alert();let{reorder:t,sort:i}=this.options,n=this.multiple===!0,s=this.selected;return s===void 0?this.alert():(Array.isArray(s)&&t!==!1&&i!==!0&&(s=K0.reorder(s)),this.value=n?s.map(o=>o.name):s.name,super.submit())}set choices(e=[]){this.state._choices=this.state._choices||[],this.state.choices=e;for(let t of e)this.state._choices.some(i=>i.name===t.name)||this.state._choices.push(t);if(!this._initial&&this.options.initial){this._initial=!0;let t=this.initial;if(typeof t=="string"||typeof t=="number"){let i=this.find(t);i&&(this.initial=i.index,this.focus(i,!0))}}}get choices(){return oie(this,this.state.choices||[])}set visible(e){this.state.visible=e}get visible(){return(this.state.visible||this.choices).slice(0,this.limit)}set limit(e){this.state.limit=e}get limit(){let{state:e,options:t,choices:i}=this,n=e.limit||this._limit||t.limit||i.length;return Math.min(n,this.height)}set value(e){super.value=e}get value(){return typeof super.value!="string"&&super.value===this.initial?this.input:super.value}set index(e){this.state.index=e}get index(){return Math.max(0,this.state?this.state.index:0)}get enabled(){return this.filter(this.isEnabled.bind(this))}get focused(){let e=this.choices[this.index];return e&&this.state.submitted&&this.multiple!==!0&&(e.enabled=!0),e}get selectable(){return this.choices.filter(e=>!this.isDisabled(e))}get selected(){return this.multiple?this.enabled:this.focused}};function oie(r,e){if(e instanceof Promise)return e;if(typeof e=="function"){if(K0.isAsyncFn(e))return e;e=e.call(r,r)}for(let t of e){if(Array.isArray(t.choices)){let i=t.choices.filter(n=>!r.isDisabled(n));t.enabled=i.every(n=>n.enabled===!0)}r.isDisabled(t)===!0&&delete t.enabled}return e}iie.exports=sie});var Nl=w((vft,aie)=>{"use strict";var KGe=qC(),$F=Xi(),Aie=class extends KGe{constructor(e){super(e);this.emptyError=this.options.emptyError||"No items were selected"}async dispatch(e,t){if(this.multiple)return this[t.name]?await this[t.name](e,t):await super.dispatch(e,t);this.alert()}separator(){if(this.options.separator)return super.separator();let e=this.styles.muted(this.symbols.ellipsis);return this.state.submitted?super.separator():e}pointer(e,t){return!this.multiple||this.options.pointer?super.pointer(e,t):""}indicator(e,t){return this.multiple?super.indicator(e,t):""}choiceMessage(e,t){let i=this.resolve(e.message,this.state,e,t);return e.role==="heading"&&!$F.hasColor(i)&&(i=this.styles.strong(i)),this.resolve(i,this.state,e,t)}choiceSeparator(){return":"}async renderChoice(e,t){await this.onChoice(e,t);let i=this.index===t,n=await this.pointer(e,t),s=await this.indicator(e,t)+(e.pad||""),o=await this.resolve(e.hint,this.state,e,t);o&&!$F.hasColor(o)&&(o=this.styles.muted(o));let a=this.indent(e),l=await this.choiceMessage(e,t),c=()=>[this.margin[3],a+n+s,l,this.margin[1],o].filter(Boolean).join(" ");return e.role==="heading"?c():e.disabled?($F.hasColor(l)||(l=this.styles.disabled(l)),c()):(i&&(l=this.styles.em(l)),c())}async renderChoices(){if(this.state.loading==="choices")return this.styles.warning("Loading choices");if(this.state.submitted)return"";let e=this.visible.map(async(s,o)=>await this.renderChoice(s,o)),t=await Promise.all(e);t.length||t.push(this.styles.danger("No matching choices"));let i=this.margin[0]+t.join(` -`),n;return this.options.choicesHeader&&(n=await this.resolve(this.options.choicesHeader,this.state)),[n,i].filter(Boolean).join(` -`)}format(){return!this.state.submitted||this.state.cancelled?"":Array.isArray(this.selected)?this.selected.map(e=>this.styles.primary(e.name)).join(", "):this.styles.primary(this.selected.name)}async render(){let{submitted:e,size:t}=this.state,i="",n=await this.header(),s=await this.prefix(),o=await this.separator(),a=await this.message();this.options.promptLine!==!1&&(i=[s,a,o,""].join(" "),this.state.prompt=i);let l=await this.format(),c=await this.error()||await this.hint(),u=await this.renderChoices(),g=await this.footer();l&&(i+=l),c&&!i.includes(c)&&(i+=" "+c),e&&!l&&!u.trim()&&this.multiple&&this.emptyError!=null&&(i+=this.styles.danger(this.emptyError)),this.clear(t),this.write([n,i,u,g].filter(Boolean).join(` -`)),this.write(this.margin[2]),this.restore()}};aie.exports=Aie});var uie=w((xft,lie)=>{"use strict";var UGe=Nl(),HGe=(r,e)=>{let t=r.toLowerCase();return i=>{let s=i.toLowerCase().indexOf(t),o=e(i.slice(s,s+t.length));return s>=0?i.slice(0,s)+o+i.slice(s+t.length):i}},cie=class extends UGe{constructor(e){super(e);this.cursorShow()}moveCursor(e){this.state.cursor+=e}dispatch(e){return this.append(e)}space(e){return this.options.multiple?super.space(e):this.append(e)}append(e){let{cursor:t,input:i}=this.state;return this.input=i.slice(0,t)+e+i.slice(t),this.moveCursor(1),this.complete()}delete(){let{cursor:e,input:t}=this.state;return t?(this.input=t.slice(0,e-1)+t.slice(e),this.moveCursor(-1),this.complete()):this.alert()}deleteForward(){let{cursor:e,input:t}=this.state;return t[e]===void 0?this.alert():(this.input=`${t}`.slice(0,e)+`${t}`.slice(e+1),this.complete())}number(e){return this.append(e)}async complete(){this.completing=!0,this.choices=await this.suggest(this.input,this.state._choices),this.state.limit=void 0,this.index=Math.min(Math.max(this.visible.length-1,0),this.index),await this.render(),this.completing=!1}suggest(e=this.input,t=this.state._choices){if(typeof this.options.suggest=="function")return this.options.suggest.call(this,e,t);let i=e.toLowerCase();return t.filter(n=>n.message.toLowerCase().includes(i))}pointer(){return""}format(){if(!this.focused)return this.input;if(this.options.multiple&&this.state.submitted)return this.selected.map(e=>this.styles.primary(e.message)).join(", ");if(this.state.submitted){let e=this.value=this.input=this.focused.value;return this.styles.primary(e)}return this.input}async render(){if(this.state.status!=="pending")return super.render();let e=this.options.highlight?this.options.highlight.bind(this):this.styles.placeholder,t=HGe(this.input,e),i=this.choices;this.choices=i.map(n=>te(N({},n),{message:t(n.message)})),await super.render(),this.choices=i}submit(){return this.options.multiple&&(this.value=this.selected.map(e=>e.name)),super.submit()}};lie.exports=cie});var tN=w((kft,gie)=>{"use strict";var eN=Xi();gie.exports=(r,e={})=>{r.cursorHide();let{input:t="",initial:i="",pos:n,showCursor:s=!0,color:o}=e,a=o||r.styles.placeholder,l=eN.inverse(r.styles.primary),c=m=>l(r.styles.black(m)),u=t,g=" ",f=c(g);if(r.blink&&r.blink.off===!0&&(c=m=>m,f=""),s&&n===0&&i===""&&t==="")return c(g);if(s&&n===0&&(t===i||t===""))return c(i[0])+a(i.slice(1));i=eN.isPrimitive(i)?`${i}`:"",t=eN.isPrimitive(t)?`${t}`:"";let h=i&&i.startsWith(t)&&i!==t,p=h?c(i[t.length]):f;if(n!==t.length&&s===!0&&(u=t.slice(0,n)+c(t[n])+t.slice(n+1),p=""),s===!1&&(p=""),h){let m=r.styles.unstyle(u+p);return u+p+a(i.slice(m.length))}return u+p}});var U0=w((Pft,fie)=>{"use strict";var jGe=Eo(),GGe=Nl(),YGe=tN(),hie=class extends GGe{constructor(e){super(te(N({},e),{multiple:!0}));this.type="form",this.initial=this.options.initial,this.align=[this.options.align,"right"].find(t=>t!=null),this.emptyError="",this.values={}}async reset(e){return await super.reset(),e===!0&&(this._index=this.index),this.index=this._index,this.values={},this.choices.forEach(t=>t.reset&&t.reset()),this.render()}dispatch(e){return!!e&&this.append(e)}append(e){let t=this.focused;if(!t)return this.alert();let{cursor:i,input:n}=t;return t.value=t.input=n.slice(0,i)+e+n.slice(i),t.cursor++,this.render()}delete(){let e=this.focused;if(!e||e.cursor<=0)return this.alert();let{cursor:t,input:i}=e;return e.value=e.input=i.slice(0,t-1)+i.slice(t),e.cursor--,this.render()}deleteForward(){let e=this.focused;if(!e)return this.alert();let{cursor:t,input:i}=e;if(i[t]===void 0)return this.alert();let n=`${i}`.slice(0,t)+`${i}`.slice(t+1);return e.value=e.input=n,this.render()}right(){let e=this.focused;return e?e.cursor>=e.input.length?this.alert():(e.cursor++,this.render()):this.alert()}left(){let e=this.focused;return e?e.cursor<=0?this.alert():(e.cursor--,this.render()):this.alert()}space(e,t){return this.dispatch(e,t)}number(e,t){return this.dispatch(e,t)}next(){let e=this.focused;if(!e)return this.alert();let{initial:t,input:i}=e;return t&&t.startsWith(i)&&i!==t?(e.value=e.input=t,e.cursor=e.value.length,this.render()):super.next()}prev(){let e=this.focused;return e?e.cursor===0?super.prev():(e.value=e.input="",e.cursor=0,this.render()):this.alert()}separator(){return""}format(e){return this.state.submitted?"":super.format(e)}pointer(){return""}indicator(e){return e.input?"\u29BF":"\u2299"}async choiceSeparator(e,t){let i=await this.resolve(e.separator,this.state,e,t)||":";return i?" "+this.styles.disabled(i):""}async renderChoice(e,t){await this.onChoice(e,t);let{state:i,styles:n}=this,{cursor:s,initial:o="",name:a,hint:l,input:c=""}=e,{muted:u,submitted:g,primary:f,danger:h}=n,p=l,m=this.index===t,y=e.validate||(()=>!0),b=await this.choiceSeparator(e,t),v=e.message;this.align==="right"&&(v=v.padStart(this.longest+1," ")),this.align==="left"&&(v=v.padEnd(this.longest+1," "));let x=this.values[a]=c||o,T=c?"success":"dark";await y.call(e,x,this.state)!==!0&&(T="danger");let Y=n[T](await this.indicator(e,t))+(e.pad||""),$=this.indent(e),_=()=>[$,Y,v+b,c,p].filter(Boolean).join(" ");if(i.submitted)return v=jGe.unstyle(v),c=g(c),p="",_();if(e.format)c=await e.format.call(this,c,e,t);else{let ne=this.styles.muted;c=YGe(this,{input:c,initial:o,pos:s,showCursor:m,color:ne})}return this.isValue(c)||(c=this.styles.muted(this.symbols.ellipsis)),e.result&&(this.values[a]=await e.result.call(this,x,e,t)),m&&(v=f(v)),e.error?c+=(c?" ":"")+h(e.error.trim()):e.hint&&(c+=(c?" ":"")+u(e.hint.trim())),_()}async submit(){return this.value=this.values,super.base.submit.call(this)}};fie.exports=hie});var rN=w((Dft,pie)=>{"use strict";var qGe=U0(),JGe=()=>{throw new Error("expected prompt to have a custom authenticate method")},die=(r=JGe)=>{class e extends qGe{constructor(i){super(i)}async submit(){this.value=await r.call(this,this.values,this.state),super.base.submit.call(this)}static create(i){return die(i)}}return e};pie.exports=die()});var Eie=w((Rft,Cie)=>{"use strict";var WGe=rN();function zGe(r,e){return r.username===this.options.username&&r.password===this.options.password}var mie=(r=zGe)=>{let e=[{name:"username",message:"username"},{name:"password",message:"password",format(i){return this.options.showPassword?i:(this.state.submitted?this.styles.primary:this.styles.muted)(this.symbols.asterisk.repeat(i.length))}}];class t extends WGe.create(r){constructor(n){super(te(N({},n),{choices:e}))}static create(n){return mie(n)}}return t};Cie.exports=mie()});var H0=w((Fft,Iie)=>{"use strict";var _Ge=_f(),{isPrimitive:VGe,hasColor:XGe}=Xi(),yie=class extends _Ge{constructor(e){super(e);this.cursorHide()}async initialize(){let e=await this.resolve(this.initial,this.state);this.input=await this.cast(e),await super.initialize()}dispatch(e){return this.isValue(e)?(this.input=e,this.submit()):this.alert()}format(e){let{styles:t,state:i}=this;return i.submitted?t.success(e):t.primary(e)}cast(e){return this.isTrue(e)}isTrue(e){return/^[ty1]/i.test(e)}isFalse(e){return/^[fn0]/i.test(e)}isValue(e){return VGe(e)&&(this.isTrue(e)||this.isFalse(e))}async hint(){if(this.state.status==="pending"){let e=await this.element("hint");return XGe(e)?e:this.styles.muted(e)}}async render(){let{input:e,size:t}=this.state,i=await this.prefix(),n=await this.separator(),s=await this.message(),o=this.styles.muted(this.default),a=[i,s,o,n].filter(Boolean).join(" ");this.state.prompt=a;let l=await this.header(),c=this.value=this.cast(e),u=await this.format(c),g=await this.error()||await this.hint(),f=await this.footer();g&&!a.includes(g)&&(u+=" "+g),a+=" "+u,this.clear(t),this.write([l,a,f].filter(Boolean).join(` -`)),this.restore()}set value(e){super.value=e}get value(){return this.cast(super.value)}};Iie.exports=yie});var bie=w((Nft,wie)=>{"use strict";var ZGe=H0(),Bie=class extends ZGe{constructor(e){super(e);this.default=this.options.default||(this.initial?"(Y/n)":"(y/N)")}};wie.exports=Bie});var vie=w((Lft,Qie)=>{"use strict";var $Ge=Nl(),eYe=U0(),Vf=eYe.prototype,Sie=class extends $Ge{constructor(e){super(te(N({},e),{multiple:!0}));this.align=[this.options.align,"left"].find(t=>t!=null),this.emptyError="",this.values={}}dispatch(e,t){let i=this.focused,n=i.parent||{};return!i.editable&&!n.editable&&(e==="a"||e==="i")?super[e]():Vf.dispatch.call(this,e,t)}append(e,t){return Vf.append.call(this,e,t)}delete(e,t){return Vf.delete.call(this,e,t)}space(e){return this.focused.editable?this.append(e):super.space()}number(e){return this.focused.editable?this.append(e):super.number(e)}next(){return this.focused.editable?Vf.next.call(this):super.next()}prev(){return this.focused.editable?Vf.prev.call(this):super.prev()}async indicator(e,t){let i=e.indicator||"",n=e.editable?i:super.indicator(e,t);return await this.resolve(n,this.state,e,t)||""}indent(e){return e.role==="heading"?"":e.editable?" ":" "}async renderChoice(e,t){return e.indent="",e.editable?Vf.renderChoice.call(this,e,t):super.renderChoice(e,t)}error(){return""}footer(){return this.state.error}async validate(){let e=!0;for(let t of this.choices){if(typeof t.validate!="function"||t.role==="heading")continue;let i=t.parent?this.value[t.parent.name]:this.value;if(t.editable?i=t.value===t.name?t.initial||"":t.value:this.isDisabled(t)||(i=t.enabled===!0),e=await t.validate(i,this.state),e!==!0)break}return e!==!0&&(this.state.error=typeof e=="string"?e:"Invalid Input"),e}submit(){if(this.focused.newChoice===!0)return super.submit();if(this.choices.some(e=>e.newChoice))return this.alert();this.value={};for(let e of this.choices){let t=e.parent?this.value[e.parent.name]:this.value;if(e.role==="heading"){this.value[e.name]={};continue}e.editable?t[e.name]=e.value===e.name?e.initial||"":e.value:this.isDisabled(e)||(t[e.name]=e.enabled===!0)}return this.base.submit.call(this)}};Qie.exports=Sie});var wu=w((Tft,xie)=>{"use strict";var tYe=_f(),rYe=tN(),{isPrimitive:iYe}=Xi(),kie=class extends tYe{constructor(e){super(e);this.initial=iYe(this.initial)?String(this.initial):"",this.initial&&this.cursorHide(),this.state.prevCursor=0,this.state.clipboard=[]}async keypress(e,t={}){let i=this.state.prevKeypress;return this.state.prevKeypress=t,this.options.multiline===!0&&t.name==="return"&&(!i||i.name!=="return")?this.append(` -`,t):super.keypress(e,t)}moveCursor(e){this.cursor+=e}reset(){return this.input=this.value="",this.cursor=0,this.render()}dispatch(e,t){if(!e||t.ctrl||t.code)return this.alert();this.append(e)}append(e){let{cursor:t,input:i}=this.state;this.input=`${i}`.slice(0,t)+e+`${i}`.slice(t),this.moveCursor(String(e).length),this.render()}insert(e){this.append(e)}delete(){let{cursor:e,input:t}=this.state;if(e<=0)return this.alert();this.input=`${t}`.slice(0,e-1)+`${t}`.slice(e),this.moveCursor(-1),this.render()}deleteForward(){let{cursor:e,input:t}=this.state;if(t[e]===void 0)return this.alert();this.input=`${t}`.slice(0,e)+`${t}`.slice(e+1),this.render()}cutForward(){let e=this.cursor;if(this.input.length<=e)return this.alert();this.state.clipboard.push(this.input.slice(e)),this.input=this.input.slice(0,e),this.render()}cutLeft(){let e=this.cursor;if(e===0)return this.alert();let t=this.input.slice(0,e),i=this.input.slice(e),n=t.split(" ");this.state.clipboard.push(n.pop()),this.input=n.join(" "),this.cursor=this.input.length,this.input+=i,this.render()}paste(){if(!this.state.clipboard.length)return this.alert();this.insert(this.state.clipboard.pop()),this.render()}toggleCursor(){this.state.prevCursor?(this.cursor=this.state.prevCursor,this.state.prevCursor=0):(this.state.prevCursor=this.cursor,this.cursor=0),this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.input.length-1,this.render()}next(){let e=this.initial!=null?String(this.initial):"";if(!e||!e.startsWith(this.input))return this.alert();this.input=this.initial,this.cursor=this.initial.length,this.render()}prev(){if(!this.input)return this.alert();this.reset()}backward(){return this.left()}forward(){return this.right()}right(){return this.cursor>=this.input.length?this.alert():(this.moveCursor(1),this.render())}left(){return this.cursor<=0?this.alert():(this.moveCursor(-1),this.render())}isValue(e){return!!e}async format(e=this.value){let t=await this.resolve(this.initial,this.state);return this.state.submitted?this.styles.submitted(e||t):rYe(this,{input:e,initial:t,pos:this.cursor})}async render(){let e=this.state.size,t=await this.prefix(),i=await this.separator(),n=await this.message(),s=[t,n,i].filter(Boolean).join(" ");this.state.prompt=s;let o=await this.header(),a=await this.format(),l=await this.error()||await this.hint(),c=await this.footer();l&&!a.includes(l)&&(a+=" "+l),s+=" "+a,this.clear(e),this.write([o,s,c].filter(Boolean).join(` -`)),this.restore()}};xie.exports=kie});var Die=w((Oft,Pie)=>{"use strict";var nYe=r=>r.filter((e,t)=>r.lastIndexOf(e)===t),j0=r=>nYe(r).filter(Boolean);Pie.exports=(r,e={},t="")=>{let{past:i=[],present:n=""}=e,s,o;switch(r){case"prev":case"undo":return s=i.slice(0,i.length-1),o=i[i.length-1]||"",{past:j0([t,...s]),present:o};case"next":case"redo":return s=i.slice(1),o=i[0]||"",{past:j0([...s,t]),present:o};case"save":return{past:j0([...i,t]),present:""};case"remove":return o=j0(i.filter(a=>a!==t)),n="",o.length&&(n=o.pop()),{past:o,present:n};default:throw new Error(`Invalid action: "${r}"`)}}});var iN=w((Mft,Rie)=>{"use strict";var sYe=wu(),Fie=Die(),Nie=class extends sYe{constructor(e){super(e);let t=this.options.history;if(t&&t.store){let i=t.values||this.initial;this.autosave=!!t.autosave,this.store=t.store,this.data=this.store.get("values")||{past:[],present:i},this.initial=this.data.present||this.data.past[this.data.past.length-1]}}completion(e){return this.store?(this.data=Fie(e,this.data,this.input),this.data.present?(this.input=this.data.present,this.cursor=this.input.length,this.render()):this.alert()):this.alert()}altUp(){return this.completion("prev")}altDown(){return this.completion("next")}prev(){return this.save(),super.prev()}save(){!this.store||(this.data=Fie("save",this.data,this.input),this.store.set("values",this.data))}submit(){return this.store&&this.autosave===!0&&this.save(),super.submit()}};Rie.exports=Nie});var Oie=w((Kft,Lie)=>{"use strict";var oYe=wu(),Tie=class extends oYe{format(){return""}};Lie.exports=Tie});var Uie=w((Uft,Mie)=>{"use strict";var aYe=wu(),Kie=class extends aYe{constructor(e={}){super(e);this.sep=this.options.separator||/, */,this.initial=e.initial||""}split(e=this.value){return e?String(e).split(this.sep):[]}format(){let e=this.state.submitted?this.styles.primary:t=>t;return this.list.map(e).join(", ")}async submit(e){let t=this.state.error||await this.validate(this.list,this.state);return t!==!0?(this.state.error=t,super.submit()):(this.value=this.list,super.submit())}get list(){return this.split()}};Mie.exports=Kie});var Gie=w((Hft,Hie)=>{"use strict";var AYe=Nl(),jie=class extends AYe{constructor(e){super(te(N({},e),{multiple:!0}))}};Hie.exports=jie});var nN=w((jft,Yie)=>{"use strict";var lYe=wu(),qie=class extends lYe{constructor(e={}){super(N({style:"number"},e));this.min=this.isValue(e.min)?this.toNumber(e.min):-Infinity,this.max=this.isValue(e.max)?this.toNumber(e.max):Infinity,this.delay=e.delay!=null?e.delay:1e3,this.float=e.float!==!1,this.round=e.round===!0||e.float===!1,this.major=e.major||10,this.minor=e.minor||1,this.initial=e.initial!=null?e.initial:"",this.input=String(this.initial),this.cursor=this.input.length,this.cursorShow()}append(e){return!/[-+.]/.test(e)||e==="."&&this.input.includes(".")?this.alert("invalid number"):super.append(e)}number(e){return super.append(e)}next(){return this.input&&this.input!==this.initial?this.alert():this.isValue(this.initial)?(this.input=this.initial,this.cursor=String(this.initial).length,this.render()):this.alert()}up(e){let t=e||this.minor,i=this.toNumber(this.input);return i>this.max+t?this.alert():(this.input=`${i+t}`,this.render())}down(e){let t=e||this.minor,i=this.toNumber(this.input);return ithis.isValue(t));return this.value=this.toNumber(e||0),super.submit()}};Yie.exports=qie});var Wie=w((Gft,Jie)=>{Jie.exports=nN()});var Vie=w((Yft,zie)=>{"use strict";var cYe=wu(),_ie=class extends cYe{constructor(e){super(e);this.cursorShow()}format(e=this.input){return this.keypressed?(this.state.submitted?this.styles.primary:this.styles.muted)(this.symbols.asterisk.repeat(e.length)):""}};zie.exports=_ie});var ene=w((qft,Xie)=>{"use strict";var uYe=Eo(),gYe=qC(),Zie=Xi(),$ie=class extends gYe{constructor(e={}){super(e);this.widths=[].concat(e.messageWidth||50),this.align=[].concat(e.align||"left"),this.linebreak=e.linebreak||!1,this.edgeLength=e.edgeLength||3,this.newline=e.newline||` - `;let t=e.startNumber||1;typeof this.scale=="number"&&(this.scaleKey=!1,this.scale=Array(this.scale).fill(0).map((i,n)=>({name:n+t})))}async reset(){return this.tableized=!1,await super.reset(),this.render()}tableize(){if(this.tableized===!0)return;this.tableized=!0;let e=0;for(let t of this.choices){e=Math.max(e,t.message.length),t.scaleIndex=t.initial||2,t.scale=[];for(let i=0;i=this.scale.length-1?this.alert():(e.scaleIndex++,this.render())}left(){let e=this.focused;return e.scaleIndex<=0?this.alert():(e.scaleIndex--,this.render())}indent(){return""}format(){return this.state.submitted?this.choices.map(t=>this.styles.info(t.index)).join(", "):""}pointer(){return""}renderScaleKey(){if(this.scaleKey===!1||this.state.submitted)return"";let e=this.scale.map(i=>` ${i.name} - ${i.message}`);return["",...e].map(i=>this.styles.muted(i)).join(` -`)}renderScaleHeading(e){let t=this.scale.map(l=>l.name);typeof this.options.renderScaleHeading=="function"&&(t=this.options.renderScaleHeading.call(this,e));let i=this.scaleLength-t.join("").length,n=Math.round(i/(t.length-1)),o=t.map(l=>this.styles.strong(l)).join(" ".repeat(n)),a=" ".repeat(this.widths[0]);return this.margin[3]+a+this.margin[1]+o}scaleIndicator(e,t,i){if(typeof this.options.scaleIndicator=="function")return this.options.scaleIndicator.call(this,e,t,i);let n=e.scaleIndex===t.index;return t.disabled?this.styles.hint(this.symbols.radio.disabled):n?this.styles.success(this.symbols.radio.on):this.symbols.radio.off}renderScale(e,t){let i=e.scale.map(s=>this.scaleIndicator(e,s,t)),n=this.term==="Hyper"?"":" ";return i.join(n+this.symbols.line.repeat(this.edgeLength))}async renderChoice(e,t){await this.onChoice(e,t);let i=this.index===t,n=await this.pointer(e,t),s=await e.hint;s&&!Zie.hasColor(s)&&(s=this.styles.muted(s));let o=p=>this.margin[3]+p.replace(/\s+$/,"").padEnd(this.widths[0]," "),a=this.newline,l=this.indent(e),c=await this.resolve(e.message,this.state,e,t),u=await this.renderScale(e,t),g=this.margin[1]+this.margin[3];this.scaleLength=uYe.unstyle(u).length,this.widths[0]=Math.min(this.widths[0],this.width-this.scaleLength-g.length);let h=Zie.wordWrap(c,{width:this.widths[0],newline:a}).split(` -`).map(p=>o(p)+this.margin[1]);return i&&(u=this.styles.info(u),h=h.map(p=>this.styles.info(p))),h[0]+=u,this.linebreak&&h.push(""),[l+n,h.join(` -`)].filter(Boolean)}async renderChoices(){if(this.state.submitted)return"";this.tableize();let e=this.visible.map(async(n,s)=>await this.renderChoice(n,s)),t=await Promise.all(e),i=await this.renderScaleHeading();return this.margin[0]+[i,...t.map(n=>n.join(" "))].join(` -`)}async render(){let{submitted:e,size:t}=this.state,i=await this.prefix(),n=await this.separator(),s=await this.message(),o="";this.options.promptLine!==!1&&(o=[i,s,n,""].join(" "),this.state.prompt=o);let a=await this.header(),l=await this.format(),c=await this.renderScaleKey(),u=await this.error()||await this.hint(),g=await this.renderChoices(),f=await this.footer(),h=this.emptyError;l&&(o+=l),u&&!o.includes(u)&&(o+=" "+u),e&&!l&&!g.trim()&&this.multiple&&h!=null&&(o+=this.styles.danger(h)),this.clear(t),this.write([a,o,c,g,f].filter(Boolean).join(` -`)),this.state.submitted||this.write(this.margin[2]),this.restore()}submit(){this.value={};for(let e of this.choices)this.value[e.name]=e.scaleIndex;return this.base.submit.call(this)}};Xie.exports=$ie});var nne=w((Jft,tne)=>{"use strict";var rne=Eo(),fYe=(r="")=>typeof r=="string"?r.replace(/^['"]|['"]$/g,""):"",ine=class{constructor(e){this.name=e.key,this.field=e.field||{},this.value=fYe(e.initial||this.field.initial||""),this.message=e.message||this.name,this.cursor=0,this.input="",this.lines=[]}},hYe=async(r={},e={},t=i=>i)=>{let i=new Set,n=r.fields||[],s=r.template,o=[],a=[],l=[],c=1;typeof s=="function"&&(s=await s());let u=-1,g=()=>s[++u],f=()=>s[u+1],h=p=>{p.line=c,o.push(p)};for(h({type:"bos",value:""});uT.name===b.key);b.field=n.find(T=>T.name===b.key),x||(x=new ine(b),a.push(x)),x.lines.push(b.line-1);continue}let m=o[o.length-1];m.type==="text"&&m.line===c?m.value+=p:h({type:"text",value:p})}return h({type:"eos",value:""}),{input:s,tabstops:o,unique:i,keys:l,items:a}};tne.exports=async r=>{let e=r.options,t=new Set(e.required===!0?[]:e.required||[]),i=N(N({},e.values),e.initial),{tabstops:n,items:s,keys:o}=await hYe(e,i),a=sN("result",r,e),l=sN("format",r,e),c=sN("validate",r,e,!0),u=r.isValue.bind(r);return async(g={},f=!1)=>{let h=0;g.required=t,g.items=s,g.keys=o,g.output="";let p=async(v,x,T,q)=>{let Y=await c(v,x,T,q);return Y===!1?"Invalid field "+T.name:Y};for(let v of n){let x=v.value,T=v.key;if(v.type!=="template"){x&&(g.output+=x);continue}if(v.type==="template"){let q=s.find(ee=>ee.name===T);e.required===!0&&g.required.add(q.name);let Y=[q.input,g.values[q.value],q.value,x].find(u),_=(q.field||{}).message||v.inner;if(f){let ee=await p(g.values[T],g,q,h);if(ee&&typeof ee=="string"||ee===!1){g.invalid.set(T,ee);continue}g.invalid.delete(T);let A=await a(g.values[T],g,q,h);g.output+=rne.unstyle(A);continue}q.placeholder=!1;let ne=x;x=await l(x,g,q,h),Y!==x?(g.values[T]=Y,x=r.styles.typing(Y),g.missing.delete(_)):(g.values[T]=void 0,Y=`<${_}>`,x=r.styles.primary(Y),q.placeholder=!0,g.required.has(T)&&g.missing.add(_)),g.missing.has(_)&&g.validating&&(x=r.styles.warning(Y)),g.invalid.has(T)&&g.validating&&(x=r.styles.danger(Y)),h===g.index&&(ne!==x?x=r.styles.underline(x):x=r.styles.heading(rne.unstyle(x))),h++}x&&(g.output+=x)}let m=g.output.split(` -`).map(v=>" "+v),y=s.length,b=0;for(let v of s)g.invalid.has(v.name)&&v.lines.forEach(x=>{m[x][0]===" "&&(m[x]=g.styles.danger(g.symbols.bullet)+m[x].slice(1))}),r.isValue(g.values[v.name])&&b++;return g.completed=(b/y*100).toFixed(0),g.output=m.join(` -`),g.output}};function sN(r,e,t,i){return(n,s,o,a)=>typeof o.field[r]=="function"?o.field[r].call(e,n,s,o,a):[i,n].find(l=>e.isValue(l))}});var ane=w((Wft,sne)=>{"use strict";var pYe=Eo(),dYe=nne(),CYe=_f(),one=class extends CYe{constructor(e){super(e);this.cursorHide(),this.reset(!0)}async initialize(){this.interpolate=await dYe(this),await super.initialize()}async reset(e){this.state.keys=[],this.state.invalid=new Map,this.state.missing=new Set,this.state.completed=0,this.state.values={},e!==!0&&(await this.initialize(),await this.render())}moveCursor(e){let t=this.getItem();this.cursor+=e,t.cursor+=e}dispatch(e,t){if(!t.code&&!t.ctrl&&e!=null&&this.getItem()){this.append(e,t);return}this.alert()}append(e,t){let i=this.getItem(),n=i.input.slice(0,this.cursor),s=i.input.slice(this.cursor);this.input=i.input=`${n}${e}${s}`,this.moveCursor(1),this.render()}delete(){let e=this.getItem();if(this.cursor<=0||!e.input)return this.alert();let t=e.input.slice(this.cursor),i=e.input.slice(0,this.cursor-1);this.input=e.input=`${i}${t}`,this.moveCursor(-1),this.render()}increment(e){return e>=this.state.keys.length-1?0:e+1}decrement(e){return e<=0?this.state.keys.length-1:e-1}first(){this.state.index=0,this.render()}last(){this.state.index=this.state.keys.length-1,this.render()}right(){if(this.cursor>=this.input.length)return this.alert();this.moveCursor(1),this.render()}left(){if(this.cursor<=0)return this.alert();this.moveCursor(-1),this.render()}prev(){this.state.index=this.decrement(this.state.index),this.getItem(),this.render()}next(){this.state.index=this.increment(this.state.index),this.getItem(),this.render()}up(){this.prev()}down(){this.next()}format(e){let t=this.state.completed<100?this.styles.warning:this.styles.success;return this.state.submitted===!0&&this.state.completed!==100&&(t=this.styles.danger),t(`${this.state.completed}% completed`)}async render(){let{index:e,keys:t=[],submitted:i,size:n}=this.state,s=[this.options.newline,` -`].find(v=>v!=null),o=await this.prefix(),a=await this.separator(),l=await this.message(),c=[o,l,a].filter(Boolean).join(" ");this.state.prompt=c;let u=await this.header(),g=await this.error()||"",f=await this.hint()||"",h=i?"":await this.interpolate(this.state),p=this.state.key=t[e]||"",m=await this.format(p),y=await this.footer();m&&(c+=" "+m),f&&!m&&this.state.completed===0&&(c+=" "+f),this.clear(n);let b=[u,c,h,y,g.trim()];this.write(b.filter(Boolean).join(s)),this.restore()}getItem(e){let{items:t,keys:i,index:n}=this.state,s=t.find(o=>o.name===i[n]);return s&&s.input!=null&&(this.input=s.input,this.cursor=s.cursor),s}async submit(){typeof this.interpolate!="function"&&await this.initialize(),await this.interpolate(this.state,!0);let{invalid:e,missing:t,output:i,values:n}=this.state;if(e.size){let a="";for(let[l,c]of e)a+=`Invalid ${l}: ${c} -`;return this.state.error=a,super.submit()}if(t.size)return this.state.error="Required: "+[...t.keys()].join(", "),super.submit();let o=pYe.unstyle(i).split(` -`).map(a=>a.slice(1)).join(` -`);return this.value={values:n,result:o},super.submit()}};sne.exports=one});var cne=w((zft,Ane)=>{"use strict";var mYe="(Use + to sort)",EYe=Nl(),lne=class extends EYe{constructor(e){super(te(N({},e),{reorder:!1,sort:!0,multiple:!0}));this.state.hint=[this.options.hint,mYe].find(this.isValue.bind(this))}indicator(){return""}async renderChoice(e,t){let i=await super.renderChoice(e,t),n=this.symbols.identicalTo+" ",s=this.index===t&&this.sorting?this.styles.muted(n):" ";return this.options.drag===!1&&(s=""),this.options.numbered===!0?s+`${t+1} - `+i:s+i}get selected(){return this.choices}submit(){return this.value=this.choices.map(e=>e.value),super.submit()}};Ane.exports=lne});var fne=w((_ft,une)=>{"use strict";var IYe=qC(),gne=class extends IYe{constructor(e={}){super(e);if(this.emptyError=e.emptyError||"No items were selected",this.term=process.env.TERM_PROGRAM,!this.options.header){let t=["","4 - Strongly Agree","3 - Agree","2 - Neutral","1 - Disagree","0 - Strongly Disagree",""];t=t.map(i=>this.styles.muted(i)),this.state.header=t.join(` - `)}}async toChoices(...e){if(this.createdScales)return!1;this.createdScales=!0;let t=await super.toChoices(...e);for(let i of t)i.scale=yYe(5,this.options),i.scaleIdx=2;return t}dispatch(){this.alert()}space(){let e=this.focused,t=e.scale[e.scaleIdx],i=t.selected;return e.scale.forEach(n=>n.selected=!1),t.selected=!i,this.render()}indicator(){return""}pointer(){return""}separator(){return this.styles.muted(this.symbols.ellipsis)}right(){let e=this.focused;return e.scaleIdx>=e.scale.length-1?this.alert():(e.scaleIdx++,this.render())}left(){let e=this.focused;return e.scaleIdx<=0?this.alert():(e.scaleIdx--,this.render())}indent(){return" "}async renderChoice(e,t){await this.onChoice(e,t);let i=this.index===t,n=this.term==="Hyper",s=n?9:8,o=n?"":" ",a=this.symbols.line.repeat(s),l=" ".repeat(s+(n?0:1)),c=x=>(x?this.styles.success("\u25C9"):"\u25EF")+o,u=t+1+".",g=i?this.styles.heading:this.styles.noop,f=await this.resolve(e.message,this.state,e,t),h=this.indent(e),p=h+e.scale.map((x,T)=>c(T===e.scaleIdx)).join(a),m=x=>x===e.scaleIdx?g(x):x,y=h+e.scale.map((x,T)=>m(T)).join(l),b=()=>[u,f].filter(Boolean).join(" "),v=()=>[b(),p,y," "].filter(Boolean).join(` -`);return i&&(p=this.styles.cyan(p),y=this.styles.cyan(y)),v()}async renderChoices(){if(this.state.submitted)return"";let e=this.visible.map(async(i,n)=>await this.renderChoice(i,n)),t=await Promise.all(e);return t.length||t.push(this.styles.danger("No matching choices")),t.join(` -`)}format(){return this.state.submitted?this.choices.map(t=>this.styles.info(t.scaleIdx)).join(", "):""}async render(){let{submitted:e,size:t}=this.state,i=await this.prefix(),n=await this.separator(),s=await this.message(),o=[i,s,n].filter(Boolean).join(" ");this.state.prompt=o;let a=await this.header(),l=await this.format(),c=await this.error()||await this.hint(),u=await this.renderChoices(),g=await this.footer();(l||!c)&&(o+=" "+l),c&&!o.includes(c)&&(o+=" "+c),e&&!l&&!u&&this.multiple&&this.type!=="form"&&(o+=this.styles.danger(this.emptyError)),this.clear(t),this.write([o,a,u,g].filter(Boolean).join(` -`)),this.restore()}submit(){this.value={};for(let e of this.choices)this.value[e.name]=e.scaleIdx;return this.base.submit.call(this)}};function yYe(r,e={}){if(Array.isArray(e.scale))return e.scale.map(i=>N({},i));let t=[];for(let i=1;i{hne.exports=iN()});var mne=w((Xft,dne)=>{"use strict";var wYe=H0(),Cne=class extends wYe{async initialize(){await super.initialize(),this.value=this.initial=!!this.options.initial,this.disabled=this.options.disabled||"no",this.enabled=this.options.enabled||"yes",await this.render()}reset(){this.value=this.initial,this.render()}delete(){this.alert()}toggle(){this.value=!this.value,this.render()}enable(){if(this.value===!0)return this.alert();this.value=!0,this.render()}disable(){if(this.value===!1)return this.alert();this.value=!1,this.render()}up(){this.toggle()}down(){this.toggle()}right(){this.toggle()}left(){this.toggle()}next(){this.toggle()}prev(){this.toggle()}dispatch(e="",t){switch(e.toLowerCase()){case" ":return this.toggle();case"1":case"y":case"t":return this.enable();case"0":case"n":case"f":return this.disable();default:return this.alert()}}format(){let e=i=>this.styles.primary.underline(i);return[this.value?this.disabled:e(this.disabled),this.value?e(this.enabled):this.enabled].join(this.styles.muted(" / "))}async render(){let{size:e}=this.state,t=await this.header(),i=await this.prefix(),n=await this.separator(),s=await this.message(),o=await this.format(),a=await this.error()||await this.hint(),l=await this.footer(),c=[i,s,n,o].join(" ");this.state.prompt=c,a&&!c.includes(a)&&(c+=" "+a),this.clear(e),this.write([t,c,l].filter(Boolean).join(` -`)),this.write(this.margin[2]),this.restore()}};dne.exports=Cne});var yne=w((Zft,Ene)=>{"use strict";var BYe=Nl(),Ine=class extends BYe{constructor(e){super(e);if(typeof this.options.correctChoice!="number"||this.options.correctChoice<0)throw new Error("Please specify the index of the correct answer from the list of choices")}async toChoices(e,t){let i=await super.toChoices(e,t);if(i.length<2)throw new Error("Please give at least two choices to the user");if(this.options.correctChoice>i.length)throw new Error("Please specify the index of the correct answer from the list of choices");return i}check(e){return e.index===this.options.correctChoice}async result(e){return{selectedAnswer:e,correctAnswer:this.options.choices[this.options.correctChoice].value,correct:await this.check(this.state)}}};Ene.exports=Ine});var Bne=w(oN=>{"use strict";var wne=Xi(),mi=(r,e)=>{wne.defineExport(oN,r,e),wne.defineExport(oN,r.toLowerCase(),e)};mi("AutoComplete",()=>uie());mi("BasicAuth",()=>Eie());mi("Confirm",()=>bie());mi("Editable",()=>vie());mi("Form",()=>U0());mi("Input",()=>iN());mi("Invisible",()=>Oie());mi("List",()=>Uie());mi("MultiSelect",()=>Gie());mi("Numeral",()=>Wie());mi("Password",()=>Vie());mi("Scale",()=>ene());mi("Select",()=>Nl());mi("Snippet",()=>ane());mi("Sort",()=>cne());mi("Survey",()=>fne());mi("Text",()=>pne());mi("Toggle",()=>mne());mi("Quiz",()=>yne())});var Qne=w((eht,bne)=>{bne.exports={ArrayPrompt:qC(),AuthPrompt:rN(),BooleanPrompt:H0(),NumberPrompt:nN(),StringPrompt:wu()}});var WC=w((tht,Sne)=>{"use strict";var vne=require("assert"),aN=require("events"),Ll=Xi(),ha=class extends aN{constructor(e,t){super();this.options=Ll.merge({},e),this.answers=N({},t)}register(e,t){if(Ll.isObject(e)){for(let n of Object.keys(e))this.register(n,e[n]);return this}vne.equal(typeof t,"function","expected a function");let i=e.toLowerCase();return t.prototype instanceof this.Prompt?this.prompts[i]=t:this.prompts[i]=t(this.Prompt,this),this}async prompt(e=[]){for(let t of[].concat(e))try{typeof t=="function"&&(t=await t.call(this)),await this.ask(Ll.merge({},this.options,t))}catch(i){return Promise.reject(i)}return this.answers}async ask(e){typeof e=="function"&&(e=await e.call(this));let t=Ll.merge({},this.options,e),{type:i,name:n}=e,{set:s,get:o}=Ll;if(typeof i=="function"&&(i=await i.call(this,e,this.answers)),!i)return this.answers[n];vne(this.prompts[i],`Prompt "${i}" is not registered`);let a=new this.prompts[i](t),l=o(this.answers,n);a.state.answers=this.answers,a.enquirer=this,n&&a.on("submit",u=>{this.emit("answer",n,u,a),s(this.answers,n,u)});let c=a.emit.bind(a);return a.emit=(...u)=>(this.emit.call(this,...u),c(...u)),this.emit("prompt",a,this),t.autofill&&l!=null?(a.value=a.input=l,t.autofill==="show"&&await a.submit()):l=a.value=await a.run(),l}use(e){return e.call(this,this),this}set Prompt(e){this._Prompt=e}get Prompt(){return this._Prompt||this.constructor.Prompt}get prompts(){return this.constructor.prompts}static set Prompt(e){this._Prompt=e}static get Prompt(){return this._Prompt||_f()}static get prompts(){return Bne()}static get types(){return Qne()}static get prompt(){let e=(t,...i)=>{let n=new this(...i),s=n.emit.bind(n);return n.emit=(...o)=>(e.emit(...o),s(...o)),n.prompt(t)};return Ll.mixinEmitter(e,new aN),e}};Ll.mixinEmitter(ha,new aN);var AN=ha.prompts;for(let r of Object.keys(AN)){let e=r.toLowerCase(),t=i=>new AN[r](i).run();ha.prompt[e]=t,ha[e]=t,ha[r]||Reflect.defineProperty(ha,r,{get:()=>AN[r]})}var JC=r=>{Ll.defineExport(ha,r,()=>ha.types[r])};JC("ArrayPrompt");JC("AuthPrompt");JC("BooleanPrompt");JC("NumberPrompt");JC("StringPrompt");Sne.exports=ha});var Une=w((Yht,Kne)=>{function xYe(r,e){for(var t=-1,i=r==null?0:r.length;++t{var kYe=$B(),PYe=Nf();function DYe(r,e,t,i){var n=!t;t||(t={});for(var s=-1,o=e.length;++s{var RYe=Zf(),FYe=Kf();function NYe(r,e){return r&&RYe(e,FYe(e),r)}jne.exports=NYe});var qne=w((Wht,Yne)=>{function LYe(r){var e=[];if(r!=null)for(var t in Object(r))e.push(t);return e}Yne.exports=LYe});var Wne=w((zht,Jne)=>{var TYe=Rn(),OYe=f0(),MYe=qne(),KYe=Object.prototype,UYe=KYe.hasOwnProperty;function HYe(r){if(!TYe(r))return MYe(r);var e=OYe(r),t=[];for(var i in r)i=="constructor"&&(e||!UYe.call(r,i))||t.push(i);return t}Jne.exports=HYe});var $f=w((_ht,zne)=>{var jYe=$R(),GYe=Wne(),YYe=vC();function qYe(r){return YYe(r)?jYe(r,!0):GYe(r)}zne.exports=qYe});var Vne=w((Vht,_ne)=>{var JYe=Zf(),WYe=$f();function zYe(r,e){return r&&JYe(e,WYe(e),r)}_ne.exports=zYe});var hN=w((em,eh)=>{var _Ye=Ns(),Xne=typeof em=="object"&&em&&!em.nodeType&&em,Zne=Xne&&typeof eh=="object"&&eh&&!eh.nodeType&&eh,VYe=Zne&&Zne.exports===Xne,$ne=VYe?_Ye.Buffer:void 0,ese=$ne?$ne.allocUnsafe:void 0;function XYe(r,e){if(e)return r.slice();var t=r.length,i=ese?ese(t):new r.constructor(t);return r.copy(i),i}eh.exports=XYe});var pN=w((Xht,tse)=>{function ZYe(r,e){var t=-1,i=r.length;for(e||(e=Array(i));++t{var $Ye=Zf(),eqe=p0();function tqe(r,e){return $Ye(r,eqe(r),e)}rse.exports=tqe});var G0=w(($ht,nse)=>{var rqe=eF(),iqe=rqe(Object.getPrototypeOf,Object);nse.exports=iqe});var dN=w((ept,sse)=>{var nqe=t0(),sqe=G0(),oqe=p0(),aqe=oF(),Aqe=Object.getOwnPropertySymbols,lqe=Aqe?function(r){for(var e=[];r;)nqe(e,oqe(r)),r=sqe(r);return e}:aqe;sse.exports=lqe});var ase=w((tpt,ose)=>{var cqe=Zf(),uqe=dN();function gqe(r,e){return cqe(r,uqe(r),e)}ose.exports=gqe});var lse=w((rpt,Ase)=>{var fqe=sF(),hqe=dN(),pqe=$f();function dqe(r){return fqe(r,pqe,hqe)}Ase.exports=dqe});var use=w((ipt,cse)=>{var Cqe=Object.prototype,mqe=Cqe.hasOwnProperty;function Eqe(r){var e=r.length,t=new r.constructor(e);return e&&typeof r[0]=="string"&&mqe.call(r,"index")&&(t.index=r.index,t.input=r.input),t}cse.exports=Eqe});var Y0=w((npt,gse)=>{var fse=iF();function Iqe(r){var e=new r.constructor(r.byteLength);return new fse(e).set(new fse(r)),e}gse.exports=Iqe});var pse=w((spt,hse)=>{var yqe=Y0();function wqe(r,e){var t=e?yqe(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.byteLength)}hse.exports=wqe});var Cse=w((opt,dse)=>{var Bqe=/\w*$/;function bqe(r){var e=new r.constructor(r.source,Bqe.exec(r));return e.lastIndex=r.lastIndex,e}dse.exports=bqe});var wse=w((apt,mse)=>{var Ese=Jc(),Ise=Ese?Ese.prototype:void 0,yse=Ise?Ise.valueOf:void 0;function Qqe(r){return yse?Object(yse.call(r)):{}}mse.exports=Qqe});var CN=w((Apt,Bse)=>{var Sqe=Y0();function vqe(r,e){var t=e?Sqe(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.length)}Bse.exports=vqe});var Qse=w((lpt,bse)=>{var xqe=Y0(),kqe=pse(),Pqe=Cse(),Dqe=wse(),Rqe=CN(),Fqe="[object Boolean]",Nqe="[object Date]",Lqe="[object Map]",Tqe="[object Number]",Oqe="[object RegExp]",Mqe="[object Set]",Kqe="[object String]",Uqe="[object Symbol]",Hqe="[object ArrayBuffer]",jqe="[object DataView]",Gqe="[object Float32Array]",Yqe="[object Float64Array]",qqe="[object Int8Array]",Jqe="[object Int16Array]",Wqe="[object Int32Array]",zqe="[object Uint8Array]",_qe="[object Uint8ClampedArray]",Vqe="[object Uint16Array]",Xqe="[object Uint32Array]";function Zqe(r,e,t){var i=r.constructor;switch(e){case Hqe:return xqe(r);case Fqe:case Nqe:return new i(+r);case jqe:return kqe(r,t);case Gqe:case Yqe:case qqe:case Jqe:case Wqe:case zqe:case _qe:case Vqe:case Xqe:return Rqe(r,t);case Lqe:return new i;case Tqe:case Kqe:return new i(r);case Oqe:return Pqe(r);case Mqe:return new i;case Uqe:return Dqe(r)}}bse.exports=Zqe});var xse=w((cpt,Sse)=>{var $qe=Rn(),vse=Object.create,eJe=function(){function r(){}return function(e){if(!$qe(e))return{};if(vse)return vse(e);r.prototype=e;var t=new r;return r.prototype=void 0,t}}();Sse.exports=eJe});var mN=w((upt,kse)=>{var tJe=xse(),rJe=G0(),iJe=f0();function nJe(r){return typeof r.constructor=="function"&&!iJe(r)?tJe(rJe(r)):{}}kse.exports=nJe});var Dse=w((gpt,Pse)=>{var sJe=kC(),oJe=ta(),aJe="[object Map]";function AJe(r){return oJe(r)&&sJe(r)==aJe}Pse.exports=AJe});var Lse=w((fpt,Rse)=>{var lJe=Dse(),cJe=c0(),Fse=u0(),Nse=Fse&&Fse.isMap,uJe=Nse?cJe(Nse):lJe;Rse.exports=uJe});var Ose=w((hpt,Tse)=>{var gJe=kC(),fJe=ta(),hJe="[object Set]";function pJe(r){return fJe(r)&&gJe(r)==hJe}Tse.exports=pJe});var Hse=w((ppt,Mse)=>{var dJe=Ose(),CJe=c0(),Kse=u0(),Use=Kse&&Kse.isSet,mJe=Use?CJe(Use):dJe;Mse.exports=mJe});var Jse=w((dpt,jse)=>{var EJe=xC(),IJe=Une(),yJe=$B(),wJe=Gne(),BJe=Vne(),bJe=hN(),QJe=pN(),SJe=ise(),vJe=ase(),xJe=aF(),kJe=lse(),PJe=kC(),DJe=use(),RJe=Qse(),FJe=mN(),NJe=Ks(),LJe=bC(),TJe=Lse(),OJe=Rn(),MJe=Hse(),KJe=Kf(),UJe=$f(),HJe=1,jJe=2,GJe=4,Gse="[object Arguments]",YJe="[object Array]",qJe="[object Boolean]",JJe="[object Date]",WJe="[object Error]",Yse="[object Function]",zJe="[object GeneratorFunction]",_Je="[object Map]",VJe="[object Number]",qse="[object Object]",XJe="[object RegExp]",ZJe="[object Set]",$Je="[object String]",e3e="[object Symbol]",t3e="[object WeakMap]",r3e="[object ArrayBuffer]",i3e="[object DataView]",n3e="[object Float32Array]",s3e="[object Float64Array]",o3e="[object Int8Array]",a3e="[object Int16Array]",A3e="[object Int32Array]",l3e="[object Uint8Array]",c3e="[object Uint8ClampedArray]",u3e="[object Uint16Array]",g3e="[object Uint32Array]",dr={};dr[Gse]=dr[YJe]=dr[r3e]=dr[i3e]=dr[qJe]=dr[JJe]=dr[n3e]=dr[s3e]=dr[o3e]=dr[a3e]=dr[A3e]=dr[_Je]=dr[VJe]=dr[qse]=dr[XJe]=dr[ZJe]=dr[$Je]=dr[e3e]=dr[l3e]=dr[c3e]=dr[u3e]=dr[g3e]=!0;dr[WJe]=dr[Yse]=dr[t3e]=!1;function q0(r,e,t,i,n,s){var o,a=e&HJe,l=e&jJe,c=e&GJe;if(t&&(o=n?t(r,i,n,s):t(r)),o!==void 0)return o;if(!OJe(r))return r;var u=NJe(r);if(u){if(o=DJe(r),!a)return QJe(r,o)}else{var g=PJe(r),f=g==Yse||g==zJe;if(LJe(r))return bJe(r,a);if(g==qse||g==Gse||f&&!n){if(o=l||f?{}:FJe(r),!a)return l?vJe(r,BJe(o,r)):SJe(r,wJe(o,r))}else{if(!dr[g])return n?r:{};o=RJe(r,g,a)}}s||(s=new EJe);var h=s.get(r);if(h)return h;s.set(r,o),MJe(r)?r.forEach(function(y){o.add(q0(y,e,t,y,r,s))}):TJe(r)&&r.forEach(function(y,b){o.set(b,q0(y,e,t,b,r,s))});var p=c?l?kJe:xJe:l?UJe:KJe,m=u?void 0:p(r);return IJe(m||r,function(y,b){m&&(b=y,y=r[b]),yJe(o,b,q0(y,e,t,b,r,s))}),o}jse.exports=q0});var EN=w((Cpt,Wse)=>{var f3e=Jse(),h3e=1,p3e=4;function d3e(r){return f3e(r,h3e|p3e)}Wse.exports=d3e});var _se=w((mpt,zse)=>{var C3e=kR();function m3e(r,e,t){return r==null?r:C3e(r,e,t)}zse.exports=m3e});var toe=w((bpt,eoe)=>{function E3e(r){var e=r==null?0:r.length;return e?r[e-1]:void 0}eoe.exports=E3e});var ioe=w((Qpt,roe)=>{var I3e=hC(),y3e=VP();function w3e(r,e){return e.length<2?r:I3e(r,y3e(e,0,-1))}roe.exports=w3e});var soe=w((Spt,noe)=>{var B3e=Ff(),b3e=toe(),Q3e=ioe(),S3e=gu();function v3e(r,e){return e=B3e(e,r),r=Q3e(r,e),r==null||delete r[S3e(b3e(e))]}noe.exports=v3e});var aoe=w((vpt,ooe)=>{var x3e=soe();function k3e(r,e){return r==null?!0:x3e(r,e)}ooe.exports=k3e});var doe=w((idt,poe)=>{poe.exports={name:"@yarnpkg/cli",version:"3.2.2",license:"BSD-2-Clause",main:"./sources/index.ts",dependencies:{"@yarnpkg/core":"workspace:^","@yarnpkg/fslib":"workspace:^","@yarnpkg/libzip":"workspace:^","@yarnpkg/parsers":"workspace:^","@yarnpkg/plugin-compat":"workspace:^","@yarnpkg/plugin-dlx":"workspace:^","@yarnpkg/plugin-essentials":"workspace:^","@yarnpkg/plugin-file":"workspace:^","@yarnpkg/plugin-git":"workspace:^","@yarnpkg/plugin-github":"workspace:^","@yarnpkg/plugin-http":"workspace:^","@yarnpkg/plugin-init":"workspace:^","@yarnpkg/plugin-link":"workspace:^","@yarnpkg/plugin-nm":"workspace:^","@yarnpkg/plugin-npm":"workspace:^","@yarnpkg/plugin-npm-cli":"workspace:^","@yarnpkg/plugin-pack":"workspace:^","@yarnpkg/plugin-patch":"workspace:^","@yarnpkg/plugin-pnp":"workspace:^","@yarnpkg/plugin-pnpm":"workspace:^","@yarnpkg/shell":"workspace:^",chalk:"^3.0.0","ci-info":"^3.2.0",clipanion:"^3.2.0-rc.4",semver:"^7.1.2",tslib:"^1.13.0",typanion:"^3.3.0",yup:"^0.32.9"},devDependencies:{"@types/semver":"^7.1.0","@types/yup":"^0","@yarnpkg/builder":"workspace:^","@yarnpkg/monorepo":"workspace:^","@yarnpkg/pnpify":"workspace:^",micromatch:"^4.0.2"},peerDependencies:{"@yarnpkg/core":"workspace:^"},scripts:{postpack:"rm -rf lib",prepack:'run build:compile "$(pwd)"',"build:cli+hook":"run build:pnp:hook && builder build bundle","build:cli":"builder build bundle","run:cli":"builder run","update-local":"run build:cli --no-git-hash && rsync -a --delete bundles/ bin/"},publishConfig:{main:"./lib/index.js",types:"./lib/index.d.ts",bin:null},files:["/lib/**/*","!/lib/pluginConfiguration.*","!/lib/cli.*"],"@yarnpkg/builder":{bundles:{standard:["@yarnpkg/plugin-essentials","@yarnpkg/plugin-compat","@yarnpkg/plugin-dlx","@yarnpkg/plugin-file","@yarnpkg/plugin-git","@yarnpkg/plugin-github","@yarnpkg/plugin-http","@yarnpkg/plugin-init","@yarnpkg/plugin-link","@yarnpkg/plugin-nm","@yarnpkg/plugin-npm","@yarnpkg/plugin-npm-cli","@yarnpkg/plugin-pack","@yarnpkg/plugin-patch","@yarnpkg/plugin-pnp","@yarnpkg/plugin-pnpm"]}},repository:{type:"git",url:"ssh://git@github.com/yarnpkg/berry.git",directory:"packages/yarnpkg-cli"},engines:{node:">=12 <14 || 14.2 - 14.9 || >14.10.0"}}});var DN=w((LEt,rae)=>{"use strict";rae.exports=function(e,t){t===!0&&(t=0);var i=e.indexOf("://"),n=e.substring(0,i).split("+").filter(Boolean);return typeof t=="number"?n[t]:n}});var RN=w((TEt,iae)=>{"use strict";var V3e=DN();function nae(r){if(Array.isArray(r))return r.indexOf("ssh")!==-1||r.indexOf("rsync")!==-1;if(typeof r!="string")return!1;var e=V3e(r);return r=r.substring(r.indexOf("://")+3),nae(e)?!0:r.indexOf("@"){"use strict";var X3e=DN(),Z3e=RN(),$3e=require("querystring");function eWe(r){r=(r||"").trim();var e={protocols:X3e(r),protocol:null,port:null,resource:"",user:"",pathname:"",hash:"",search:"",href:r,query:Object.create(null)},t=r.indexOf("://"),i=-1,n=null,s=null;r.startsWith(".")&&(r.startsWith("./")&&(r=r.substring(2)),e.pathname=r,e.protocol="file");var o=r.charAt(1);return e.protocol||(e.protocol=e.protocols[0],e.protocol||(Z3e(r)?e.protocol="ssh":((o==="/"||o==="~")&&(r=r.substring(2)),e.protocol="file"))),t!==-1&&(r=r.substring(t+3)),s=r.split("/"),e.protocol!=="file"?e.resource=s.shift():e.resource="",n=e.resource.split("@"),n.length===2&&(e.user=n[0],e.resource=n[1]),n=e.resource.split(":"),n.length===2&&(e.resource=n[0],n[1]?(e.port=Number(n[1]),isNaN(e.port)&&(e.port=null,s.unshift(n[1]))):e.port=null),s=s.filter(Boolean),e.protocol==="file"?e.pathname=e.href:e.pathname=e.pathname||(e.protocol!=="file"||e.href[0]==="/"?"/":"")+s.join("/"),n=e.pathname.split("#"),n.length===2&&(e.pathname=n[0],e.hash=n[1]),n=e.pathname.split("?"),n.length===2&&(e.pathname=n[0],e.search=n[1]),e.query=$3e.parse(e.search),e.href=e.href.replace(/\/$/,""),e.pathname=e.pathname.replace(/\/$/,""),e}sae.exports=eWe});var lae=w((MEt,aae)=>{"use strict";var tWe="text/plain",rWe="us-ascii",Aae=(r,e)=>e.some(t=>t instanceof RegExp?t.test(r):t===r),iWe=(r,{stripHash:e})=>{let t=/^data:(?[^,]*?),(?[^#]*?)(?:#(?.*))?$/.exec(r);if(!t)throw new Error(`Invalid URL: ${r}`);let{type:i,data:n,hash:s}=t.groups,o=i.split(";");s=e?"":s;let a=!1;o[o.length-1]==="base64"&&(o.pop(),a=!0);let l=(o.shift()||"").toLowerCase(),u=[...o.map(g=>{let[f,h=""]=g.split("=").map(p=>p.trim());return f==="charset"&&(h=h.toLowerCase(),h===rWe)?"":`${f}${h?`=${h}`:""}`}).filter(Boolean)];return a&&u.push("base64"),(u.length!==0||l&&l!==tWe)&&u.unshift(l),`data:${u.join(";")},${a?n.trim():n}${s?`#${s}`:""}`},nWe=(r,e)=>{if(e=N({defaultProtocol:"http:",normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripTextFragment:!0,stripWWW:!0,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:!0,removeSingleSlash:!0,removeDirectoryIndex:!1,sortQueryParameters:!0},e),r=r.trim(),/^data:/i.test(r))return iWe(r,e);if(/^view-source:/i.test(r))throw new Error("`view-source:` is not supported as it is a non-standard protocol");let t=r.startsWith("//");!t&&/^\.*\//.test(r)||(r=r.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,e.defaultProtocol));let n=new URL(r);if(e.forceHttp&&e.forceHttps)throw new Error("The `forceHttp` and `forceHttps` options cannot be used together");if(e.forceHttp&&n.protocol==="https:"&&(n.protocol="http:"),e.forceHttps&&n.protocol==="http:"&&(n.protocol="https:"),e.stripAuthentication&&(n.username="",n.password=""),e.stripHash?n.hash="":e.stripTextFragment&&(n.hash=n.hash.replace(/#?:~:text.*?$/i,"")),n.pathname&&(n.pathname=n.pathname.replace(/(?0){let o=n.pathname.split("/"),a=o[o.length-1];Aae(a,e.removeDirectoryIndex)&&(o=o.slice(0,o.length-1),n.pathname=o.slice(1).join("/")+"/")}if(n.hostname&&(n.hostname=n.hostname.replace(/\.$/,""),e.stripWWW&&/^www\.(?!www\.)(?:[a-z\-\d]{1,63})\.(?:[a-z.\-\d]{2,63})$/.test(n.hostname)&&(n.hostname=n.hostname.replace(/^www\./,""))),Array.isArray(e.removeQueryParameters))for(let o of[...n.searchParams.keys()])Aae(o,e.removeQueryParameters)&&n.searchParams.delete(o);e.removeQueryParameters===!0&&(n.search=""),e.sortQueryParameters&&n.searchParams.sort(),e.removeTrailingSlash&&(n.pathname=n.pathname.replace(/\/$/,""));let s=r;return r=n.toString(),!e.removeSingleSlash&&n.pathname==="/"&&!s.endsWith("/")&&n.hash===""&&(r=r.replace(/\/$/,"")),(e.removeTrailingSlash||n.pathname==="/")&&n.hash===""&&e.removeSingleSlash&&(r=r.replace(/\/$/,"")),t&&!e.normalizeProtocol&&(r=r.replace(/^http:\/\//,"//")),e.stripProtocol&&(r=r.replace(/^(?:https?:)?\/\//,"")),r};aae.exports=nWe});var uae=w((KEt,cae)=>{"use strict";var sWe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},oWe=oae(),aWe=lae();function AWe(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(typeof r!="string"||!r.trim())throw new Error("Invalid url.");e&&((typeof e=="undefined"?"undefined":sWe(e))!=="object"&&(e={stripHash:!1}),r=aWe(r,e));var t=oWe(r);return t}cae.exports=AWe});var hae=w((UEt,gae)=>{"use strict";var lWe=uae(),fae=RN();function cWe(r){var e=lWe(r);e.token="";var t=e.user.split(":");return t.length===2&&(t[1]==="x-oauth-basic"?e.token=t[0]:t[0]==="x-token-auth"&&(e.token=t[1])),fae(e.protocols)||fae(r)?e.protocol="ssh":e.protocols.length?e.protocol=e.protocols[0]:e.protocol="file",e.href=e.href.replace(/\/$/,""),e}gae.exports=cWe});var dae=w((HEt,pae)=>{"use strict";var uWe=hae();function FN(r){if(typeof r!="string")throw new Error("The url must be a string.");var e=uWe(r),t=e.resource.split("."),i=null;switch(e.toString=function(l){return FN.stringify(this,l)},e.source=t.length>2?t.slice(1-t.length).join("."):e.source=e.resource,e.git_suffix=/\.git$/.test(e.pathname),e.name=decodeURIComponent(e.pathname.replace(/^\//,"").replace(/\.git$/,"")),e.owner=decodeURIComponent(e.user),e.source){case"git.cloudforge.com":e.owner=e.user,e.organization=t[0],e.source="cloudforge.com";break;case"visualstudio.com":if(e.resource==="vs-ssh.visualstudio.com"){i=e.name.split("/"),i.length===4&&(e.organization=i[1],e.owner=i[2],e.name=i[3],e.full_name=i[2]+"/"+i[3]);break}else{i=e.name.split("/"),i.length===2?(e.owner=i[1],e.name=i[1],e.full_name="_git/"+e.name):i.length===3?(e.name=i[2],i[0]==="DefaultCollection"?(e.owner=i[2],e.organization=i[0],e.full_name=e.organization+"/_git/"+e.name):(e.owner=i[0],e.full_name=e.owner+"/_git/"+e.name)):i.length===4&&(e.organization=i[0],e.owner=i[1],e.name=i[3],e.full_name=e.organization+"/"+e.owner+"/_git/"+e.name);break}case"dev.azure.com":case"azure.com":if(e.resource==="ssh.dev.azure.com"){i=e.name.split("/"),i.length===4&&(e.organization=i[1],e.owner=i[2],e.name=i[3]);break}else{i=e.name.split("/"),i.length===5?(e.organization=i[0],e.owner=i[1],e.name=i[4],e.full_name="_git/"+e.name):i.length===3?(e.name=i[2],i[0]==="DefaultCollection"?(e.owner=i[2],e.organization=i[0],e.full_name=e.organization+"/_git/"+e.name):(e.owner=i[0],e.full_name=e.owner+"/_git/"+e.name)):i.length===4&&(e.organization=i[0],e.owner=i[1],e.name=i[3],e.full_name=e.organization+"/"+e.owner+"/_git/"+e.name);break}default:i=e.name.split("/");var n=i.length-1;if(i.length>=2){var s=i.indexOf("blob",2),o=i.indexOf("tree",2),a=i.indexOf("commit",2);n=s>0?s-1:o>0?o-1:a>0?a-1:n,e.owner=i.slice(0,n).join("/"),e.name=i[n],a&&(e.commit=i[n+2])}e.ref="",e.filepathtype="",e.filepath="",i.length>n+2&&["blob","tree"].indexOf(i[n+1])>=0&&(e.filepathtype=i[n+1],e.ref=i[n+2],i.length>n+3&&(e.filepath=i.slice(n+3).join("/"))),e.organization=e.owner;break}return e.full_name||(e.full_name=e.owner,e.name&&(e.full_name&&(e.full_name+="/"),e.full_name+=e.name)),e}FN.stringify=function(r,e){e=e||(r.protocols&&r.protocols.length?r.protocols.join("+"):r.protocol);var t=r.port?":"+r.port:"",i=r.user||"git",n=r.git_suffix?".git":"";switch(e){case"ssh":return t?"ssh://"+i+"@"+r.resource+t+"/"+r.full_name+n:i+"@"+r.resource+":"+r.full_name+n;case"git+ssh":case"ssh+git":case"ftp":case"ftps":return e+"://"+i+"@"+r.resource+t+"/"+r.full_name+n;case"http":case"https":var s=r.token?gWe(r):r.user&&(r.protocols.includes("http")||r.protocols.includes("https"))?r.user+"@":"";return e+"://"+s+r.resource+t+"/"+r.full_name+n;default:return r.href}};function gWe(r){switch(r.source){case"bitbucket.org":return"x-token-auth:"+r.token+"@";default:return r.token+"@"}}pae.exports=FN});var cL=w((Vwt,Mae)=>{var DWe=Nf(),RWe=Pf();function FWe(r,e,t){(t!==void 0&&!RWe(r[e],t)||t===void 0&&!(e in r))&&DWe(r,e,t)}Mae.exports=FWe});var Uae=w((Xwt,Kae)=>{var NWe=vC(),LWe=ta();function TWe(r){return LWe(r)&&NWe(r)}Kae.exports=TWe});var Gae=w((Zwt,Hae)=>{var OWe=Wc(),MWe=G0(),KWe=ta(),UWe="[object Object]",HWe=Function.prototype,jWe=Object.prototype,jae=HWe.toString,GWe=jWe.hasOwnProperty,YWe=jae.call(Object);function qWe(r){if(!KWe(r)||OWe(r)!=UWe)return!1;var e=MWe(r);if(e===null)return!0;var t=GWe.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&jae.call(t)==YWe}Hae.exports=qWe});var uL=w(($wt,Yae)=>{function JWe(r,e){if(!(e==="constructor"&&typeof r[e]=="function")&&e!="__proto__")return r[e]}Yae.exports=JWe});var Jae=w((eBt,qae)=>{var WWe=Zf(),zWe=$f();function _We(r){return WWe(r,zWe(r))}qae.exports=_We});var Zae=w((tBt,Wae)=>{var zae=cL(),VWe=hN(),XWe=CN(),ZWe=pN(),$We=mN(),_ae=dC(),Vae=Ks(),e4e=Uae(),t4e=bC(),r4e=VB(),i4e=Rn(),n4e=Gae(),s4e=g0(),Xae=uL(),o4e=Jae();function a4e(r,e,t,i,n,s,o){var a=Xae(r,t),l=Xae(e,t),c=o.get(l);if(c){zae(r,t,c);return}var u=s?s(a,l,t+"",r,e,o):void 0,g=u===void 0;if(g){var f=Vae(l),h=!f&&t4e(l),p=!f&&!h&&s4e(l);u=l,f||h||p?Vae(a)?u=a:e4e(a)?u=ZWe(a):h?(g=!1,u=VWe(l,!0)):p?(g=!1,u=XWe(l,!0)):u=[]:n4e(l)||_ae(l)?(u=a,_ae(a)?u=o4e(a):(!i4e(a)||r4e(a))&&(u=$We(l))):g=!1}g&&(o.set(l,u),n(u,l,i,s,o),o.delete(l)),zae(r,t,u)}Wae.exports=a4e});var tAe=w((rBt,$ae)=>{var A4e=xC(),l4e=cL(),c4e=XR(),u4e=Zae(),g4e=Rn(),f4e=$f(),h4e=uL();function eAe(r,e,t,i,n){r!==e&&c4e(e,function(s,o){if(n||(n=new A4e),g4e(s))u4e(r,e,o,t,eAe,i,n);else{var a=i?i(h4e(r,o),s,o+"",r,e,n):void 0;a===void 0&&(a=s),l4e(r,o,a)}},f4e)}$ae.exports=eAe});var iAe=w((iBt,rAe)=>{var p4e=r0(),d4e=RR(),C4e=FR();function m4e(r,e){return C4e(d4e(r,e,p4e),r+"")}rAe.exports=m4e});var sAe=w((nBt,nAe)=>{var E4e=Pf(),I4e=vC(),y4e=pC(),w4e=Rn();function B4e(r,e,t){if(!w4e(t))return!1;var i=typeof e;return(i=="number"?I4e(t)&&y4e(e,t.length):i=="string"&&e in t)?E4e(t[e],r):!1}nAe.exports=B4e});var aAe=w((sBt,oAe)=>{var b4e=iAe(),Q4e=sAe();function S4e(r){return b4e(function(e,t){var i=-1,n=t.length,s=n>1?t[n-1]:void 0,o=n>2?t[2]:void 0;for(s=r.length>3&&typeof s=="function"?(n--,s):void 0,o&&Q4e(t[0],t[1],o)&&(s=n<3?void 0:s,n=1),e=Object(e);++i{var v4e=tAe(),x4e=aAe(),k4e=x4e(function(r,e,t){v4e(r,e,t)});AAe.exports=k4e});var QAe=w((u0t,bAe)=>{var QL;bAe.exports=()=>(typeof QL=="undefined"&&(QL=require("zlib").brotliDecompressSync(Buffer.from("W8aBWMM86xigdkIKKln3s6WtEQ8xBfvtGm6l6HpWsM0HlG2fJUSg2yACwxuWsoJiQVU1b2mMsbbD2jhAVbLq6wOxXSGkuAai1rhjCNmwktEatn0bh2yzFJ6DjhWTRsWjxW4OZpG5hevFO0Y4KH1xt2tGfiQqb0Ge/cqOg+eObuOoLKh8LvMs05MkvGyS8LZL9Vncf7R/hUSi/6j223sFG6nRVySV/u7AOBf/F0lYp0ki6SkgjpsHYYgoMdd2RLrULU/74nrZNP88vmnLRRMkjFXwVcaklPKSzqyo1wKuaYujlenq36aS8wnL94QsyE1pdubo4/Ts/77N/P/5+bqHblKjKBPS1e7mQOgwZfED0s3HxxhLNhpkSdUVi3OefH6/9Pv6BU7Gohy1y8p45S3L7nQsYkg5VcNJdGwbOu/V6q1av63G/zycE0vIQyyBFtCM/S82r09R5n+b6j2Xm38HUJmXvwRknzrWaSwyBLKVylNeXeSFQnb+Qgc0CCjxBZmmotNKePIDb4M8HpuV1qb0TVDSl9EN0uPj1aL8Lf54eB/QZV08Vvf0TCZfOpMQ4g1QhsgiIq4xDmw3R0OYgB9gS02zaomvEv9tX6nOIbUfKse52zG40pFjMOBBAfpby6/jFUyoao4wHf0yE6bBiAk3ly6IPhMquAQX813/v1y8n/nM5y0lWUncJgXF9UDZMT2DrDhtYMq5wYXnKfE6Hhx0qRXH92cmyaSdtr+kpDdSpqTUivWhkc4qW3guNwfO5An8o24k7aF9HOThl2Pr2Py+970OXE6vcM2goNElECq6sd+1OwPpAwdWbba05zeR9uJpuYsgM6EcxVL4NaE5Le+RE/yosf3x0MGtqI/HN8sAo4INSEU3glyMChV/K/nxP5z8/+fHvfcV1dOmn2vNHsgQQhwi2vQvpseB5rVoSLuxftRwPR0Pu7uf0YzjHF9VV0MRQIukY/AWcSwQTRyJogOPWc3+ePXvzHp8c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yZrXQKYT083KbjHHph82ENFsF09y7C7xfmFSyJc8WLACTVeOp8PZTn2WRsNGZXgovZfdr59qkSL3TvXRF1YD9IGmQjUnJpqat9HVwXTZjrPODj2lUcHwUQPwKAyMcCiD2wGhl7yjk9X1cvlGHEaoTfrRFT4kQ15ykZ8xFgDbVRSZTdnhHPq4YJXp89ePceMngfS5EFAxxvqs6fkbabBUlMfzBa26jTM2bNblrLfkTqANbG0enlPmbmSQijN72AwQEmy252+HIauDnzFns5V9TTYSteyS2wnAeUTxK+nXdFgWixSz5Ddwaw+b2/PPz2b7CXvZxYIbc1hubNqedon5sY07VPIC5LJhRTyOnur5JShazvUz7QtGJ39UZVFLiTuWHE8v2JbyyBR7WEdBEzWhvlN5fALuMVx5qTLZTeT01MTH8FCDUJAZ1Dl7zDYFDCjXOZeHguPV9Vhj9Qj5McphX42vmIxU3DzIpemzTwsgu6qbqu8a6K8B3lGLOt0XuAiemPqcx9z70xWX+gYX9QT2YnD29s8gQ5ss2sI7SWiJRXhwr2YX+i9P7kx9FegGB+aoFZKl6g5Zwm937BXPy0X2LYXyl2WYSJ/+JDu1NGW9Oa9balk2GALck2AHUi2IHAyZxIKMCuRHxDHRU+ONxh1bWMPPnngexnKcoQYrGrnIpgNrESZRQyKvaWGxCRqkdxbz/7ys2l7fEd4lBiwcSriIN2kjkyjeVHMkxLFvDmZNYe+EF/fw9oMFTDbPH6+H4T/GVHAA==","base64")).toString()),QL)});var TAe=w((Y0t,LAe)=>{var kL;LAe.exports=()=>(typeof kL=="undefined"&&(kL=require("zlib").brotliDecompressSync(Buffer.from("G98hACwL4rGroa5xFloZvem1VcYrNr4K3e9n9r8/X5MOCYHdva5v4pXS1QjWc4tyDqmKnix1U4T8ajah2kQmaKYVQGR2JkiPD9HmUr1q9nHCWrGdiqCk8rzbStVePjiEPXFcOP9pv14jAZX9QobAiuy5lEef34ZwEy7i3Jm3yyHaX2JHqrpVVex8hKx0EbLCdhlOrXITGgMCBEptPxtRLx3hx9+LfNF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mVRi233XYnGzbk2bYUwIaY4J0rvpIa0544NaCGXdREUETpEXfRH+d4vF8xWBvjywV0wBpQtq2wLL9lilSdusZXoNGCNak+1896M7QvzRtipbCCKM7vSqblsJtfCmo9JXvjZrR4gSc1xfOfXmVkBQ0PQlYc6GNWSFHwiHdEQAW25VHS0SA7y297NOmCzopl9s3CTrewPN1LCphOjBJYNaM1ngLmVKcI2mqUdXZi/GqWRB6civuE9Vmeqv1ZPz1BGPUi75o5ZvuJO4+OA1y9M0D/1MvWX8Os2SLU3mdIYn3TNzTMLiMCoEOzGGJvqVsyjxmb3xZ6oe7nMfIzyaF/rgMRRw/iiGqi7Hpcvj3VGL5amadFOlZi1Ha3L2jKIW0k0B/92/vswU0HKRl+3JftBu/dr3SSnN0JCd99a4LoULqp4ynOmEIf9TgJqZ16lLOOTG5hytXjTEE4BlRK1FIAJH0S5m51pXlDnky2ksR1ZqgJqt06tvhXn5y2Xc/bs3BWwVw5RA5btkWV0KZ3QEiI551w0gOk69aMuHfTTjBjY/ON+sqb19PjDttU+CUt+AiuYi9Xa0ZWmEr0F5haATGKTdLlOk5uF6wWr2SvtMppNNCDVND/oIc1C6S/2ClprLrbGMdWw9hG8JSc6fEBbz9nO9dJU/oaN+05bGVeVr/ZoAe2muur64b5pcjmDNUAuSZjOctRdLWrZWO7AfdbHVuO8NyNLlXAbvSXAX0x3Ve7unalIzbKlEmVV2PDTL92+DUZwBIUYhkGaFP5ETAA==","base64")).toString()),kL)});var YAe=w((TL,OL)=>{(function(r){TL&&typeof TL=="object"&&typeof OL!="undefined"?OL.exports=r():typeof define=="function"&&define.amd?define([],r):typeof window!="undefined"?window.isWindows=r():typeof global!="undefined"?global.isWindows=r():typeof self!="undefined"?self.isWindows=r():this.isWindows=r()})(function(){"use strict";return function(){return process&&(process.platform==="win32"||/^(msys|cygwin)$/.test(process.env.OSTYPE))}})});var zAe=w((Vbt,qAe)=>{"use strict";ML.ifExists=C8e;var ah=require("util"),zs=require("path"),JAe=YAe(),m8e=/^#!\s*(?:\/usr\/bin\/env)?\s*([^ \t]+)(.*)$/,E8e={createPwshFile:!0,createCmdFile:JAe(),fs:require("fs")},I8e=new Map([[".js","node"],[".cjs","node"],[".mjs","node"],[".cmd","cmd"],[".bat","cmd"],[".ps1","pwsh"],[".sh","sh"]]);function WAe(r){let e=N(N({},E8e),r),t=e.fs;return e.fs_={chmod:t.chmod?ah.promisify(t.chmod):async()=>{},mkdir:ah.promisify(t.mkdir),readFile:ah.promisify(t.readFile),stat:ah.promisify(t.stat),unlink:ah.promisify(t.unlink),writeFile:ah.promisify(t.writeFile)},e}async function ML(r,e,t){let i=WAe(t);await i.fs_.stat(r),await y8e(r,e,i)}function C8e(r,e,t){return ML(r,e,t).catch(()=>{})}function w8e(r,e){return e.fs_.unlink(r).catch(()=>{})}async function y8e(r,e,t){let i=await Q8e(r,t);return await B8e(e,t),b8e(r,e,i,t)}function B8e(r,e){return e.fs_.mkdir(zs.dirname(r),{recursive:!0})}function b8e(r,e,t,i){let n=WAe(i),s=[{generator:x8e,extension:""}];return n.createCmdFile&&s.push({generator:v8e,extension:".cmd"}),n.createPwshFile&&s.push({generator:k8e,extension:".ps1"}),Promise.all(s.map(o=>S8e(r,e+o.extension,t,o.generator,n)))}function P8e(r,e){return w8e(r,e)}function R8e(r,e){return D8e(r,e)}async function Q8e(r,e){let n=(await e.fs_.readFile(r,"utf8")).trim().split(/\r*\n/)[0].match(m8e);if(!n){let s=zs.extname(r).toLowerCase();return{program:I8e.get(s)||null,additionalArgs:""}}return{program:n[1],additionalArgs:n[2]}}async function S8e(r,e,t,i,n){let s=n.preserveSymlinks?"--preserve-symlinks":"",o=[t.additionalArgs,s].filter(a=>a).join(" ");return n=Object.assign({},n,{prog:t.program,args:o}),await P8e(e,n),await n.fs_.writeFile(e,i(r,e,n),"utf8"),R8e(e,n)}function v8e(r,e,t){let n=zs.relative(zs.dirname(e),r).split("/").join("\\"),s=zs.isAbsolute(n)?`"${n}"`:`"%~dp0\\${n}"`,o,a=t.prog,l=t.args||"",c=KL(t.nodePath).win32;a?(o=`"%~dp0\\${a}.exe"`,n=s):(a=s,l="",n="");let u=t.progArgs?`${t.progArgs.join(" ")} `:"",g=c?`@SET NODE_PATH=${c}\r -`:"";return o?g+=`@IF EXIST ${o} (\r - ${o} ${l} ${n} ${u}%*\r -) ELSE (\r - @SETLOCAL\r - @SET PATHEXT=%PATHEXT:;.JS;=;%\r - ${a} ${l} ${n} ${u}%*\r -)\r -`:g+=`@${a} ${l} ${n} ${u}%*\r -`,g}function x8e(r,e,t){let i=zs.relative(zs.dirname(e),r),n=t.prog&&t.prog.split("\\").join("/"),s;i=i.split("\\").join("/");let o=zs.isAbsolute(i)?`"${i}"`:`"$basedir/${i}"`,a=t.args||"",l=KL(t.nodePath).posix;n?(s=`"$basedir/${t.prog}"`,i=o):(n=o,a="",i="");let c=t.progArgs?`${t.progArgs.join(" ")} `:"",u=`#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\\\,/,g')") - -case \`uname\` in - *CYGWIN*) basedir=\`cygpath -w "$basedir"\`;; -esac - -`,g=t.nodePath?`export NODE_PATH="${l}" -`:"";return s?u+=`${g}if [ -x ${s} ]; then - exec ${s} ${a} ${i} ${c}"$@" -else - exec ${n} ${a} ${i} ${c}"$@" -fi -`:u+=`${g}${n} ${a} ${i} ${c}"$@" -exit $? -`,u}function k8e(r,e,t){let i=zs.relative(zs.dirname(e),r),n=t.prog&&t.prog.split("\\").join("/"),s=n&&`"${n}$exe"`,o;i=i.split("\\").join("/");let a=zs.isAbsolute(i)?`"${i}"`:`"$basedir/${i}"`,l=t.args||"",c=KL(t.nodePath),u=c.win32,g=c.posix;s?(o=`"$basedir/${t.prog}$exe"`,i=a):(s=a,l="",i="");let f=t.progArgs?`${t.progArgs.join(" ")} `:"",h=`#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -${t.nodePath?`$env_node_path=$env:NODE_PATH -$env:NODE_PATH="${u}" -`:""}if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -}`;return t.nodePath&&(h+=` else { - $env:NODE_PATH="${g}" -}`),o?h+=` -$ret=0 -if (Test-Path ${o}) { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & ${o} ${l} ${i} ${f}$args - } else { - & ${o} ${l} ${i} ${f}$args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & ${s} ${l} ${i} ${f}$args - } else { - & ${s} ${l} ${i} ${f}$args - } - $ret=$LASTEXITCODE -} -${t.nodePath?`$env:NODE_PATH=$env_node_path -`:""}exit $ret -`:h+=` -# Support pipeline input -if ($MyInvocation.ExpectingInput) { - $input | & ${s} ${l} ${i} ${f}$args -} else { - & ${s} ${l} ${i} ${f}$args -} -${t.nodePath?`$env:NODE_PATH=$env_node_path -`:""}exit $LASTEXITCODE -`,h}function D8e(r,e){return e.fs_.chmod(r,493)}function KL(r){if(!r)return{win32:"",posix:""};let e=typeof r=="string"?r.split(zs.delimiter):Array.from(r),t={};for(let i=0;i`/mnt/${a.toLowerCase()}`):e[i];t.win32=t.win32?`${t.win32};${n}`:n,t.posix=t.posix?`${t.posix}:${s}`:s,t[i]={win32:n,posix:s}}return t}qAe.exports=ML});var eT=w((RSt,hle)=>{hle.exports=require("stream")});var mle=w((FSt,ple)=>{"use strict";function dle(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable})),t.push.apply(t,i)}return t}function Z8e(r){for(var e=1;e0?this.tail.next=i:this.head=i,this.tail=i,++this.length}},{key:"unshift",value:function(t){var i={data:t,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}},{key:"shift",value:function(){if(this.length!==0){var t=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(this.length===0)return"";for(var i=this.head,n=""+i.data;i=i.next;)n+=t+i.data;return n}},{key:"concat",value:function(t){if(this.length===0)return lb.alloc(0);for(var i=lb.allocUnsafe(t>>>0),n=this.head,s=0;n;)nze(n.data,i,s),s+=n.data.length,n=n.next;return i}},{key:"consume",value:function(t,i){var n;return to.length?o.length:t;if(a===o.length?s+=o:s+=o.slice(0,t),t-=a,t===0){a===o.length?(++n,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=o.slice(a));break}++n}return this.length-=n,s}},{key:"_getBuffer",value:function(t){var i=lb.allocUnsafe(t),n=this.head,s=1;for(n.data.copy(i),t-=n.data.length;n=n.next;){var o=n.data,a=t>o.length?o.length:t;if(o.copy(i,i.length-t,0,a),t-=a,t===0){a===o.length?(++s,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=o.slice(a));break}++s}return this.length-=s,i}},{key:ize,value:function(t,i){return tT(this,Z8e({},i,{depth:0,customInspect:!1}))}}]),r}()});var iT=w((NSt,Ele)=>{"use strict";function sze(r,e){var t=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(e?e(r):r&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(rT,this,r)):process.nextTick(rT,this,r)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(r||null,function(s){!e&&s?t._writableState?t._writableState.errorEmitted?process.nextTick(cb,t):(t._writableState.errorEmitted=!0,process.nextTick(Ile,t,s)):process.nextTick(Ile,t,s):e?(process.nextTick(cb,t),e(s)):process.nextTick(cb,t)}),this)}function Ile(r,e){rT(r,e),cb(r)}function cb(r){r._writableState&&!r._writableState.emitClose||r._readableState&&!r._readableState.emitClose||r.emit("close")}function oze(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function rT(r,e){r.emit("error",e)}function aze(r,e){var t=r._readableState,i=r._writableState;t&&t.autoDestroy||i&&i.autoDestroy?r.destroy(e):r.emit("error",e)}Ele.exports={destroy:sze,undestroy:oze,errorOrDestroy:aze}});var Ul=w((LSt,yle)=>{"use strict";var wle={};function _s(r,e,t){t||(t=Error);function i(s,o,a){return typeof e=="string"?e:e(s,o,a)}class n extends t{constructor(o,a,l){super(i(o,a,l))}}n.prototype.name=t.name,n.prototype.code=r,wle[r]=n}function Ble(r,e){if(Array.isArray(r)){let t=r.length;return r=r.map(i=>String(i)),t>2?`one of ${e} ${r.slice(0,t-1).join(", ")}, or `+r[t-1]:t===2?`one of ${e} ${r[0]} or ${r[1]}`:`of ${e} ${r[0]}`}else return`of ${e} ${String(r)}`}function Aze(r,e,t){return r.substr(!t||t<0?0:+t,e.length)===e}function lze(r,e,t){return(t===void 0||t>r.length)&&(t=r.length),r.substring(t-e.length,t)===e}function cze(r,e,t){return typeof t!="number"&&(t=0),t+e.length>r.length?!1:r.indexOf(e,t)!==-1}_s("ERR_INVALID_OPT_VALUE",function(r,e){return'The value "'+e+'" is invalid for option "'+r+'"'},TypeError);_s("ERR_INVALID_ARG_TYPE",function(r,e,t){let i;typeof e=="string"&&Aze(e,"not ")?(i="must not be",e=e.replace(/^not /,"")):i="must be";let n;if(lze(r," argument"))n=`The ${r} ${i} ${Ble(e,"type")}`;else{let s=cze(r,".")?"property":"argument";n=`The "${r}" ${s} ${i} ${Ble(e,"type")}`}return n+=`. Received type ${typeof t}`,n},TypeError);_s("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");_s("ERR_METHOD_NOT_IMPLEMENTED",function(r){return"The "+r+" method is not implemented"});_s("ERR_STREAM_PREMATURE_CLOSE","Premature close");_s("ERR_STREAM_DESTROYED",function(r){return"Cannot call "+r+" after a stream was destroyed"});_s("ERR_MULTIPLE_CALLBACK","Callback called multiple times");_s("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");_s("ERR_STREAM_WRITE_AFTER_END","write after end");_s("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);_s("ERR_UNKNOWN_ENCODING",function(r){return"Unknown encoding: "+r},TypeError);_s("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");yle.exports.codes=wle});var nT=w((TSt,ble)=>{"use strict";var uze=Ul().codes.ERR_INVALID_OPT_VALUE;function gze(r,e,t){return r.highWaterMark!=null?r.highWaterMark:e?r[t]:null}function fze(r,e,t,i){var n=gze(e,i,t);if(n!=null){if(!(isFinite(n)&&Math.floor(n)===n)||n<0){var s=i?t:"highWaterMark";throw new uze(s,n)}return Math.floor(n)}return r.objectMode?16:16*1024}ble.exports={getHighWaterMark:fze}});var Qle=w((OSt,sT)=>{typeof Object.create=="function"?sT.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:sT.exports=function(e,t){if(t){e.super_=t;var i=function(){};i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e}}});var Hl=w((MSt,oT)=>{try{if(aT=require("util"),typeof aT.inherits!="function")throw"";oT.exports=aT.inherits}catch(r){oT.exports=Qle()}var aT});var vle=w((KSt,Sle)=>{Sle.exports=require("util").deprecate});var cT=w((USt,xle)=>{"use strict";xle.exports=Gr;function kle(r){var e=this;this.next=null,this.entry=null,this.finish=function(){hze(e,r)}}var ch;Gr.WritableState=Gm;var pze={deprecate:vle()},Ple=eT(),ub=require("buffer").Buffer,dze=global.Uint8Array||function(){};function Cze(r){return ub.from(r)}function mze(r){return ub.isBuffer(r)||r instanceof dze}var AT=iT(),Eze=nT(),Ize=Eze.getHighWaterMark,jl=Ul().codes,yze=jl.ERR_INVALID_ARG_TYPE,wze=jl.ERR_METHOD_NOT_IMPLEMENTED,Bze=jl.ERR_MULTIPLE_CALLBACK,bze=jl.ERR_STREAM_CANNOT_PIPE,Qze=jl.ERR_STREAM_DESTROYED,Sze=jl.ERR_STREAM_NULL_VALUES,vze=jl.ERR_STREAM_WRITE_AFTER_END,xze=jl.ERR_UNKNOWN_ENCODING,uh=AT.errorOrDestroy;Hl()(Gr,Ple);function kze(){}function Gm(r,e,t){ch=ch||ku(),r=r||{},typeof t!="boolean"&&(t=e instanceof ch),this.objectMode=!!r.objectMode,t&&(this.objectMode=this.objectMode||!!r.writableObjectMode),this.highWaterMark=Ize(this,r,"writableHighWaterMark",t),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var i=r.decodeStrings===!1;this.decodeStrings=!i,this.defaultEncoding=r.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(n){Pze(e,n)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=r.emitClose!==!1,this.autoDestroy=!!r.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new kle(this)}Gm.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t};(function(){try{Object.defineProperty(Gm.prototype,"buffer",{get:pze.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(r){}})();var gb;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(gb=Function.prototype[Symbol.hasInstance],Object.defineProperty(Gr,Symbol.hasInstance,{value:function(e){return gb.call(this,e)?!0:this!==Gr?!1:e&&e._writableState instanceof Gm}})):gb=function(e){return e instanceof this};function Gr(r){ch=ch||ku();var e=this instanceof ch;if(!e&&!gb.call(Gr,this))return new Gr(r);this._writableState=new Gm(r,this,e),this.writable=!0,r&&(typeof r.write=="function"&&(this._write=r.write),typeof r.writev=="function"&&(this._writev=r.writev),typeof r.destroy=="function"&&(this._destroy=r.destroy),typeof r.final=="function"&&(this._final=r.final)),Ple.call(this)}Gr.prototype.pipe=function(){uh(this,new bze)};function Dze(r,e){var t=new vze;uh(r,t),process.nextTick(e,t)}function Rze(r,e,t,i){var n;return t===null?n=new Sze:typeof t!="string"&&!e.objectMode&&(n=new yze("chunk",["string","Buffer"],t)),n?(uh(r,n),process.nextTick(i,n),!1):!0}Gr.prototype.write=function(r,e,t){var i=this._writableState,n=!1,s=!i.objectMode&&mze(r);return s&&!ub.isBuffer(r)&&(r=Cze(r)),typeof e=="function"&&(t=e,e=null),s?e="buffer":e||(e=i.defaultEncoding),typeof t!="function"&&(t=kze),i.ending?Dze(this,t):(s||Rze(this,i,r,t))&&(i.pendingcb++,n=Fze(this,i,s,r,e,t)),n};Gr.prototype.cork=function(){this._writableState.corked++};Gr.prototype.uncork=function(){var r=this._writableState;r.corked&&(r.corked--,!r.writing&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&Dle(this,r))};Gr.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new xze(e);return this._writableState.defaultEncoding=e,this};Object.defineProperty(Gr.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Nze(r,e,t){return!r.objectMode&&r.decodeStrings!==!1&&typeof e=="string"&&(e=ub.from(e,t)),e}Object.defineProperty(Gr.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Fze(r,e,t,i,n,s){if(!t){var o=Nze(e,i,n);i!==o&&(t=!0,n="buffer",i=o)}var a=e.objectMode?1:i.length;e.length+=a;var l=e.length{"use strict";var Hze=Object.keys||function(r){var e=[];for(var t in r)e.push(t);return e};Nle.exports=Ea;var Lle=uT(),gT=cT();Hl()(Ea,Lle);for(fT=Hze(gT.prototype),fb=0;fb{var pb=require("buffer"),vA=pb.Buffer;function Ole(r,e){for(var t in r)e[t]=r[t]}vA.from&&vA.alloc&&vA.allocUnsafe&&vA.allocUnsafeSlow?Tle.exports=pb:(Ole(pb,hT),hT.Buffer=gh);function gh(r,e,t){return vA(r,e,t)}Ole(vA,gh);gh.from=function(r,e,t){if(typeof r=="number")throw new TypeError("Argument must not be a number");return vA(r,e,t)};gh.alloc=function(r,e,t){if(typeof r!="number")throw new TypeError("Argument must be a number");var i=vA(r);return e!==void 0?typeof t=="string"?i.fill(e,t):i.fill(e):i.fill(0),i};gh.allocUnsafe=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return vA(r)};gh.allocUnsafeSlow=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return pb.SlowBuffer(r)}});var CT=w(Kle=>{"use strict";var pT=Mle().Buffer,Ule=pT.isEncoding||function(r){switch(r=""+r,r&&r.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Yze(r){if(!r)return"utf8";for(var e;;)switch(r){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return r;default:if(e)return;r=(""+r).toLowerCase(),e=!0}}function qze(r){var e=Yze(r);if(typeof e!="string"&&(pT.isEncoding===Ule||!Ule(r)))throw new Error("Unknown encoding: "+r);return e||r}Kle.StringDecoder=qm;function qm(r){this.encoding=qze(r);var e;switch(this.encoding){case"utf16le":this.text=Wze,this.end=zze,e=4;break;case"utf8":this.fillLast=Jze,e=4;break;case"base64":this.text=_ze,this.end=Vze,e=3;break;default:this.write=Xze,this.end=Zze;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=pT.allocUnsafe(e)}qm.prototype.write=function(r){if(r.length===0)return"";var e,t;if(this.lastNeed){if(e=this.fillLast(r),e===void 0)return"";t=this.lastNeed,this.lastNeed=0}else t=0;return t>5==6?2:r>>4==14?3:r>>3==30?4:r>>6==2?-1:-2}function t5e(r,e,t){var i=e.length-1;if(i=0?(n>0&&(r.lastNeed=n-1),n):--i=0?(n>0&&(r.lastNeed=n-2),n):--i=0?(n>0&&(n===2?n=0:r.lastNeed=n-3),n):0))}function r5e(r,e,t){if((e[0]&192)!=128)return r.lastNeed=0,"\uFFFD";if(r.lastNeed>1&&e.length>1){if((e[1]&192)!=128)return r.lastNeed=1,"\uFFFD";if(r.lastNeed>2&&e.length>2&&(e[2]&192)!=128)return r.lastNeed=2,"\uFFFD"}}function Jze(r){var e=this.lastTotal-this.lastNeed,t=r5e(this,r,e);if(t!==void 0)return t;if(this.lastNeed<=r.length)return r.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);r.copy(this.lastChar,e,0,r.length),this.lastNeed-=r.length}function e5e(r,e){var t=t5e(this,r,e);if(!this.lastNeed)return r.toString("utf8",e);this.lastTotal=t;var i=r.length-(t-this.lastNeed);return r.copy(this.lastChar,0,i),r.toString("utf8",e,i)}function $ze(r){var e=r&&r.length?this.write(r):"";return this.lastNeed?e+"\uFFFD":e}function Wze(r,e){if((r.length-e)%2==0){var t=r.toString("utf16le",e);if(t){var i=t.charCodeAt(t.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=r[r.length-2],this.lastChar[1]=r[r.length-1],t.slice(0,-1)}return t}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=r[r.length-1],r.toString("utf16le",e,r.length-1)}function zze(r){var e=r&&r.length?this.write(r):"";if(this.lastNeed){var t=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,t)}return e}function _ze(r,e){var t=(r.length-e)%3;return t===0?r.toString("base64",e):(this.lastNeed=3-t,this.lastTotal=3,t===1?this.lastChar[0]=r[r.length-1]:(this.lastChar[0]=r[r.length-2],this.lastChar[1]=r[r.length-1]),r.toString("base64",e,r.length-t))}function Vze(r){var e=r&&r.length?this.write(r):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function Xze(r){return r.toString(this.encoding)}function Zze(r){return r&&r.length?this.write(r):""}});var db=w((GSt,Hle)=>{"use strict";var jle=Ul().codes.ERR_STREAM_PREMATURE_CLOSE;function i5e(r){var e=!1;return function(){if(!e){e=!0;for(var t=arguments.length,i=new Array(t),n=0;n{"use strict";var Cb;function Gl(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}var o5e=db(),Yl=Symbol("lastResolve"),Pu=Symbol("lastReject"),Jm=Symbol("error"),mb=Symbol("ended"),Du=Symbol("lastPromise"),mT=Symbol("handlePromise"),Ru=Symbol("stream");function ql(r,e){return{value:r,done:e}}function a5e(r){var e=r[Yl];if(e!==null){var t=r[Ru].read();t!==null&&(r[Du]=null,r[Yl]=null,r[Pu]=null,e(ql(t,!1)))}}function A5e(r){process.nextTick(a5e,r)}function l5e(r,e){return function(t,i){r.then(function(){if(e[mb]){t(ql(void 0,!0));return}e[mT](t,i)},i)}}var c5e=Object.getPrototypeOf(function(){}),u5e=Object.setPrototypeOf((Cb={get stream(){return this[Ru]},next:function(){var e=this,t=this[Jm];if(t!==null)return Promise.reject(t);if(this[mb])return Promise.resolve(ql(void 0,!0));if(this[Ru].destroyed)return new Promise(function(o,a){process.nextTick(function(){e[Jm]?a(e[Jm]):o(ql(void 0,!0))})});var i=this[Du],n;if(i)n=new Promise(l5e(i,this));else{var s=this[Ru].read();if(s!==null)return Promise.resolve(ql(s,!1));n=new Promise(this[mT])}return this[Du]=n,n}},Gl(Cb,Symbol.asyncIterator,function(){return this}),Gl(Cb,"return",function(){var e=this;return new Promise(function(t,i){e[Ru].destroy(null,function(n){if(n){i(n);return}t(ql(void 0,!0))})})}),Cb),c5e),g5e=function(e){var t,i=Object.create(u5e,(t={},Gl(t,Ru,{value:e,writable:!0}),Gl(t,Yl,{value:null,writable:!0}),Gl(t,Pu,{value:null,writable:!0}),Gl(t,Jm,{value:null,writable:!0}),Gl(t,mb,{value:e._readableState.endEmitted,writable:!0}),Gl(t,mT,{value:function(s,o){var a=i[Ru].read();a?(i[Du]=null,i[Yl]=null,i[Pu]=null,s(ql(a,!1))):(i[Yl]=s,i[Pu]=o)},writable:!0}),t));return i[Du]=null,o5e(e,function(n){if(n&&n.code!=="ERR_STREAM_PREMATURE_CLOSE"){var s=i[Pu];s!==null&&(i[Du]=null,i[Yl]=null,i[Pu]=null,s(n)),i[Jm]=n;return}var o=i[Yl];o!==null&&(i[Du]=null,i[Yl]=null,i[Pu]=null,o(ql(void 0,!0))),i[mb]=!0}),e.on("readable",A5e.bind(null,i)),i};Yle.exports=g5e});var _le=w((qSt,Jle)=>{"use strict";function Wle(r,e,t,i,n,s,o){try{var a=r[s](o),l=a.value}catch(c){t(c);return}a.done?e(l):Promise.resolve(l).then(i,n)}function f5e(r){return function(){var e=this,t=arguments;return new Promise(function(i,n){var s=r.apply(e,t);function o(l){Wle(s,i,n,o,a,"next",l)}function a(l){Wle(s,i,n,o,a,"throw",l)}o(void 0)})}}function zle(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable})),t.push.apply(t,i)}return t}function p5e(r){for(var e=1;e{"use strict";Vle.exports=Ut;var fh;Ut.ReadableState=Xle;var JSt=require("events").EventEmitter,Zle=function(e,t){return e.listeners(t).length},Wm=eT(),Eb=require("buffer").Buffer,m5e=global.Uint8Array||function(){};function E5e(r){return Eb.from(r)}function I5e(r){return Eb.isBuffer(r)||r instanceof m5e}var ET=require("util"),Pt;ET&&ET.debuglog?Pt=ET.debuglog("stream"):Pt=function(){};var y5e=mle(),IT=iT(),w5e=nT(),B5e=w5e.getHighWaterMark,Ib=Ul().codes,b5e=Ib.ERR_INVALID_ARG_TYPE,Q5e=Ib.ERR_STREAM_PUSH_AFTER_EOF,S5e=Ib.ERR_METHOD_NOT_IMPLEMENTED,v5e=Ib.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,hh,yT,wT;Hl()(Ut,Wm);var zm=IT.errorOrDestroy,BT=["error","close","destroy","pause","resume"];function x5e(r,e,t){if(typeof r.prependListener=="function")return r.prependListener(e,t);!r._events||!r._events[e]?r.on(e,t):Array.isArray(r._events[e])?r._events[e].unshift(t):r._events[e]=[t,r._events[e]]}function Xle(r,e,t){fh=fh||ku(),r=r||{},typeof t!="boolean"&&(t=e instanceof fh),this.objectMode=!!r.objectMode,t&&(this.objectMode=this.objectMode||!!r.readableObjectMode),this.highWaterMark=B5e(this,r,"readableHighWaterMark",t),this.buffer=new y5e,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=r.emitClose!==!1,this.autoDestroy=!!r.autoDestroy,this.destroyed=!1,this.defaultEncoding=r.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,r.encoding&&(hh||(hh=CT().StringDecoder),this.decoder=new hh(r.encoding),this.encoding=r.encoding)}function Ut(r){if(fh=fh||ku(),!(this instanceof Ut))return new Ut(r);var e=this instanceof fh;this._readableState=new Xle(r,this,e),this.readable=!0,r&&(typeof r.read=="function"&&(this._read=r.read),typeof r.destroy=="function"&&(this._destroy=r.destroy)),Wm.call(this)}Object.defineProperty(Ut.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){!this._readableState||(this._readableState.destroyed=e)}});Ut.prototype.destroy=IT.destroy;Ut.prototype._undestroy=IT.undestroy;Ut.prototype._destroy=function(r,e){e(r)};Ut.prototype.push=function(r,e){var t=this._readableState,i;return t.objectMode?i=!0:typeof r=="string"&&(e=e||t.defaultEncoding,e!==t.encoding&&(r=Eb.from(r,e),e=""),i=!0),$le(this,r,e,!1,i)};Ut.prototype.unshift=function(r){return $le(this,r,null,!0,!1)};function $le(r,e,t,i,n){Pt("readableAddChunk",e);var s=r._readableState;if(e===null)s.reading=!1,P5e(r,s);else{var o;if(n||(o=k5e(s,e)),o)zm(r,o);else if(s.objectMode||e&&e.length>0)if(typeof e!="string"&&!s.objectMode&&Object.getPrototypeOf(e)!==Eb.prototype&&(e=E5e(e)),i)s.endEmitted?zm(r,new v5e):bT(r,s,e,!0);else if(s.ended)zm(r,new Q5e);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!t?(e=s.decoder.write(e),s.objectMode||e.length!==0?bT(r,s,e,!1):QT(r,s)):bT(r,s,e,!1)}else i||(s.reading=!1,QT(r,s))}return!s.ended&&(s.length=ece?r=ece:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),r}function tce(r,e){return r<=0||e.length===0&&e.ended?0:e.objectMode?1:r!==r?e.flowing&&e.length?e.buffer.head.data.length:e.length:(r>e.highWaterMark&&(e.highWaterMark=D5e(r)),r<=e.length?r:e.ended?e.length:(e.needReadable=!0,0))}Ut.prototype.read=function(r){Pt("read",r),r=parseInt(r,10);var e=this._readableState,t=r;if(r!==0&&(e.emittedReadable=!1),r===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return Pt("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?ST(this):yb(this),null;if(r=tce(r,e),r===0&&e.ended)return e.length===0&&ST(this),null;var i=e.needReadable;Pt("need readable",i),(e.length===0||e.length-r0?n=rce(r,e):n=null,n===null?(e.needReadable=e.length<=e.highWaterMark,r=0):(e.length-=r,e.awaitDrain=0),e.length===0&&(e.ended||(e.needReadable=!0),t!==r&&e.ended&&ST(this)),n!==null&&this.emit("data",n),n};function P5e(r,e){if(Pt("onEofChunk"),!e.ended){if(e.decoder){var t=e.decoder.end();t&&t.length&&(e.buffer.push(t),e.length+=e.objectMode?1:t.length)}e.ended=!0,e.sync?yb(r):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,ice(r)))}}function yb(r){var e=r._readableState;Pt("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(Pt("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(ice,r))}function ice(r){var e=r._readableState;Pt("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(r.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,vT(r)}function QT(r,e){e.readingMore||(e.readingMore=!0,process.nextTick(R5e,r,e))}function R5e(r,e){for(;!e.reading&&!e.ended&&(e.length1&&nce(i.pipes,r)!==-1)&&!c&&(Pt("false write response, pause",i.awaitDrain),i.awaitDrain++),t.pause())}function f(y){Pt("onerror",y),m(),r.removeListener("error",f),Zle(r,"error")===0&&zm(r,y)}x5e(r,"error",f);function h(){r.removeListener("finish",p),m()}r.once("close",h);function p(){Pt("onfinish"),r.removeListener("close",h),m()}r.once("finish",p);function m(){Pt("unpipe"),t.unpipe(r)}return r.emit("pipe",t),i.flowing||(Pt("pipe resume"),t.resume()),r};function F5e(r){return function(){var t=r._readableState;Pt("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,t.awaitDrain===0&&Zle(r,"data")&&(t.flowing=!0,vT(r))}}Ut.prototype.unpipe=function(r){var e=this._readableState,t={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return r&&r!==e.pipes?this:(r||(r=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,r&&r.emit("unpipe",this,t),this);if(!r){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var s=0;s0,i.flowing!==!1&&this.resume()):r==="readable"&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,Pt("on readable",i.length,i.reading),i.length?yb(this):i.reading||process.nextTick(N5e,this)),t};Ut.prototype.addListener=Ut.prototype.on;Ut.prototype.removeListener=function(r,e){var t=Wm.prototype.removeListener.call(this,r,e);return r==="readable"&&process.nextTick(sce,this),t};Ut.prototype.removeAllListeners=function(r){var e=Wm.prototype.removeAllListeners.apply(this,arguments);return(r==="readable"||r===void 0)&&process.nextTick(sce,this),e};function sce(r){var e=r._readableState;e.readableListening=r.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:r.listenerCount("data")>0&&r.resume()}function N5e(r){Pt("readable nexttick read 0"),r.read(0)}Ut.prototype.resume=function(){var r=this._readableState;return r.flowing||(Pt("resume"),r.flowing=!r.readableListening,L5e(this,r)),r.paused=!1,this};function L5e(r,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(T5e,r,e))}function T5e(r,e){Pt("resume",e.reading),e.reading||r.read(0),e.resumeScheduled=!1,r.emit("resume"),vT(r),e.flowing&&!e.reading&&r.read(0)}Ut.prototype.pause=function(){return Pt("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(Pt("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function vT(r){var e=r._readableState;for(Pt("flow",e.flowing);e.flowing&&r.read()!==null;);}Ut.prototype.wrap=function(r){var e=this,t=this._readableState,i=!1;r.on("end",function(){if(Pt("wrapped end"),t.decoder&&!t.ended){var o=t.decoder.end();o&&o.length&&e.push(o)}e.push(null)}),r.on("data",function(o){if(Pt("wrapped data"),t.decoder&&(o=t.decoder.write(o)),!(t.objectMode&&o==null)&&!(!t.objectMode&&(!o||!o.length))){var a=e.push(o);a||(i=!0,r.pause())}});for(var n in r)this[n]===void 0&&typeof r[n]=="function"&&(this[n]=function(a){return function(){return r[a].apply(r,arguments)}}(n));for(var s=0;s=e.length?(e.decoder?t=e.buffer.join(""):e.buffer.length===1?t=e.buffer.first():t=e.buffer.concat(e.length),e.buffer.clear()):t=e.buffer.consume(r,e.decoder),t}function ST(r){var e=r._readableState;Pt("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(O5e,e,r))}function O5e(r,e){if(Pt("endReadableNT",r.endEmitted,r.length),!r.endEmitted&&r.length===0&&(r.endEmitted=!0,e.readable=!1,e.emit("end"),r.autoDestroy)){var t=e._writableState;(!t||t.autoDestroy&&t.finished)&&e.destroy()}}typeof Symbol=="function"&&(Ut.from=function(r,e){return wT===void 0&&(wT=_le()),wT(Ut,r,e)});function nce(r,e){for(var t=0,i=r.length;t{"use strict";oce.exports=xA;var wb=Ul().codes,M5e=wb.ERR_METHOD_NOT_IMPLEMENTED,K5e=wb.ERR_MULTIPLE_CALLBACK,U5e=wb.ERR_TRANSFORM_ALREADY_TRANSFORMING,H5e=wb.ERR_TRANSFORM_WITH_LENGTH_0,Bb=ku();Hl()(xA,Bb);function j5e(r,e){var t=this._transformState;t.transforming=!1;var i=t.writecb;if(i===null)return this.emit("error",new K5e);t.writechunk=null,t.writecb=null,e!=null&&this.push(e),i(r);var n=this._readableState;n.reading=!1,(n.needReadable||n.length{"use strict";Ace.exports=_m;var lce=xT();Hl()(_m,lce);function _m(r){if(!(this instanceof _m))return new _m(r);lce.call(this,r)}_m.prototype._transform=function(r,e,t){t(null,r)}});var pce=w((VSt,uce)=>{"use strict";var kT;function Y5e(r){var e=!1;return function(){e||(e=!0,r.apply(void 0,arguments))}}var gce=Ul().codes,q5e=gce.ERR_MISSING_ARGS,J5e=gce.ERR_STREAM_DESTROYED;function fce(r){if(r)throw r}function W5e(r){return r.setHeader&&typeof r.abort=="function"}function z5e(r,e,t,i){i=Y5e(i);var n=!1;r.on("close",function(){n=!0}),kT===void 0&&(kT=db()),kT(r,{readable:e,writable:t},function(o){if(o)return i(o);n=!0,i()});var s=!1;return function(o){if(!n&&!s){if(s=!0,W5e(r))return r.abort();if(typeof r.destroy=="function")return r.destroy();i(o||new J5e("pipe"))}}}function hce(r){r()}function _5e(r,e){return r.pipe(e)}function V5e(r){return!r.length||typeof r[r.length-1]!="function"?fce:r.pop()}function X5e(){for(var r=arguments.length,e=new Array(r),t=0;t0;return z5e(o,l,c,function(u){n||(n=u),u&&s.forEach(hce),!l&&(s.forEach(hce),i(n))})});return e.reduce(_5e)}uce.exports=X5e});var ph=w((Vs,Vm)=>{var Xm=require("stream");process.env.READABLE_STREAM==="disable"&&Xm?(Vm.exports=Xm.Readable,Object.assign(Vm.exports,Xm),Vm.exports.Stream=Xm):(Vs=Vm.exports=uT(),Vs.Stream=Xm||Vs,Vs.Readable=Vs,Vs.Writable=cT(),Vs.Duplex=ku(),Vs.Transform=xT(),Vs.PassThrough=cce(),Vs.finished=db(),Vs.pipeline=pce())});var mce=w((XSt,dce)=>{"use strict";var{Buffer:So}=require("buffer"),Cce=Symbol.for("BufferList");function mr(r){if(!(this instanceof mr))return new mr(r);mr._init.call(this,r)}mr._init=function(e){Object.defineProperty(this,Cce,{value:!0}),this._bufs=[],this.length=0,e&&this.append(e)};mr.prototype._new=function(e){return new mr(e)};mr.prototype._offset=function(e){if(e===0)return[0,0];let t=0;for(let i=0;ithis.length||e<0)return;let t=this._offset(e);return this._bufs[t[0]][t[1]]};mr.prototype.slice=function(e,t){return typeof e=="number"&&e<0&&(e+=this.length),typeof t=="number"&&t<0&&(t+=this.length),this.copy(null,0,e,t)};mr.prototype.copy=function(e,t,i,n){if((typeof i!="number"||i<0)&&(i=0),(typeof n!="number"||n>this.length)&&(n=this.length),i>=this.length||n<=0)return e||So.alloc(0);let s=!!e,o=this._offset(i),a=n-i,l=a,c=s&&t||0,u=o[1];if(i===0&&n===this.length){if(!s)return this._bufs.length===1?this._bufs[0]:So.concat(this._bufs,this.length);for(let g=0;gf)this._bufs[g].copy(e,c,u),c+=f;else{this._bufs[g].copy(e,c,u,u+l),c+=f;break}l-=f,u&&(u=0)}return e.length>c?e.slice(0,c):e};mr.prototype.shallowSlice=function(e,t){if(e=e||0,t=typeof t!="number"?this.length:t,e<0&&(e+=this.length),t<0&&(t+=this.length),e===t)return this._new();let i=this._offset(e),n=this._offset(t),s=this._bufs.slice(i[0],n[0]+1);return n[1]===0?s.pop():s[s.length-1]=s[s.length-1].slice(0,n[1]),i[1]!==0&&(s[0]=s[0].slice(i[1])),this._new(s)};mr.prototype.toString=function(e,t,i){return this.slice(t,i).toString(e)};mr.prototype.consume=function(e){if(e=Math.trunc(e),Number.isNaN(e)||e<=0)return this;for(;this._bufs.length;)if(e>=this._bufs[0].length)e-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(e),this.length-=e;break}return this};mr.prototype.duplicate=function(){let e=this._new();for(let t=0;tthis.length?this.length:e;let i=this._offset(e),n=i[0],s=i[1];for(;n=r.length){let l=o.indexOf(r,s);if(l!==-1)return this._reverseOffset([n,l]);s=o.length-r.length+1}else{let l=this._reverseOffset([n,s]);if(this._match(l,r))return l;s++}s=0}return-1};mr.prototype._match=function(r,e){if(this.length-r{"use strict";var PT=ph().Duplex,Z5e=Hl(),Zm=mce();function Zi(r){if(!(this instanceof Zi))return new Zi(r);if(typeof r=="function"){this._callback=r;let e=function(i){this._callback&&(this._callback(i),this._callback=null)}.bind(this);this.on("pipe",function(i){i.on("error",e)}),this.on("unpipe",function(i){i.removeListener("error",e)}),r=null}Zm._init.call(this,r),PT.call(this)}Z5e(Zi,PT);Object.assign(Zi.prototype,Zm.prototype);Zi.prototype._new=function(e){return new Zi(e)};Zi.prototype._write=function(e,t,i){this._appendBuffer(e),typeof i=="function"&&i()};Zi.prototype._read=function(e){if(!this.length)return this.push(null);e=Math.min(e,this.length),this.push(this.slice(0,e)),this.consume(e)};Zi.prototype.end=function(e){PT.prototype.end.call(this,e),this._callback&&(this._callback(null,this.slice()),this._callback=null)};Zi.prototype._destroy=function(e,t){this._bufs.length=0,this.length=0,t(e)};Zi.prototype._isBufferList=function(e){return e instanceof Zi||e instanceof Zm||Zi.isBufferList(e)};Zi.isBufferList=Zm.isBufferList;bb.exports=Zi;bb.exports.BufferListStream=Zi;bb.exports.BufferList=Zm});var FT=w(dh=>{var $5e=Buffer.alloc,e9e="0000000000000000000",t9e="7777777777777777777",Ice="0".charCodeAt(0),yce=Buffer.from("ustar\0","binary"),r9e=Buffer.from("00","binary"),i9e=Buffer.from("ustar ","binary"),n9e=Buffer.from(" \0","binary"),s9e=parseInt("7777",8),$m=257,DT=263,o9e=function(r,e,t){return typeof r!="number"?t:(r=~~r,r>=e?e:r>=0||(r+=e,r>=0)?r:0)},a9e=function(r){switch(r){case 0:return"file";case 1:return"link";case 2:return"symlink";case 3:return"character-device";case 4:return"block-device";case 5:return"directory";case 6:return"fifo";case 7:return"contiguous-file";case 72:return"pax-header";case 55:return"pax-global-header";case 27:return"gnu-long-link-path";case 28:case 30:return"gnu-long-path"}return null},A9e=function(r){switch(r){case"file":return 0;case"link":return 1;case"symlink":return 2;case"character-device":return 3;case"block-device":return 4;case"directory":return 5;case"fifo":return 6;case"contiguous-file":return 7;case"pax-header":return 72}return 0},wce=function(r,e,t,i){for(;te?t9e.slice(0,e)+" ":e9e.slice(0,e-r.length)+r+" "};function l9e(r){var e;if(r[0]===128)e=!0;else if(r[0]===255)e=!1;else return null;for(var t=[],i=r.length-1;i>0;i--){var n=r[i];e?t.push(n):t.push(255-n)}var s=0,o=t.length;for(i=0;i=Math.pow(10,t)&&t++,e+t+r};dh.decodeLongPath=function(r,e){return Ch(r,0,r.length,e)};dh.encodePax=function(r){var e="";r.name&&(e+=RT(" path="+r.name+` -`)),r.linkname&&(e+=RT(" linkpath="+r.linkname+` -`));var t=r.pax;if(t)for(var i in t)e+=RT(" "+i+"="+t[i]+` -`);return Buffer.from(e)};dh.decodePax=function(r){for(var e={};r.length;){for(var t=0;t100;){var n=t.indexOf("/");if(n===-1)return null;i+=i?"/"+t.slice(0,n):t.slice(0,n),t=t.slice(n+1)}return Buffer.byteLength(t)>100||Buffer.byteLength(i)>155||r.linkname&&Buffer.byteLength(r.linkname)>100?null:(e.write(t),e.write(Jl(r.mode&s9e,6),100),e.write(Jl(r.uid,6),108),e.write(Jl(r.gid,6),116),e.write(Jl(r.size,11),124),e.write(Jl(r.mtime.getTime()/1e3|0,11),136),e[156]=Ice+A9e(r.type),r.linkname&&e.write(r.linkname,157),yce.copy(e,$m),r9e.copy(e,DT),r.uname&&e.write(r.uname,265),r.gname&&e.write(r.gname,297),e.write(Jl(r.devmajor||0,6),329),e.write(Jl(r.devminor||0,6),337),i&&e.write(i,345),e.write(Jl(Bce(e),6),148),e)};dh.decode=function(r,e,t){var i=r[156]===0?0:r[156]-Ice,n=Ch(r,0,100,e),s=Wl(r,100,8),o=Wl(r,108,8),a=Wl(r,116,8),l=Wl(r,124,12),c=Wl(r,136,12),u=a9e(i),g=r[157]===0?null:Ch(r,157,100,e),f=Ch(r,265,32),h=Ch(r,297,32),p=Wl(r,329,8),m=Wl(r,337,8),y=Bce(r);if(y===8*32)return null;if(y!==Wl(r,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(yce.compare(r,$m,$m+6)===0)r[345]&&(n=Ch(r,345,155,e)+"/"+n);else if(!(i9e.compare(r,$m,$m+6)===0&&n9e.compare(r,DT,DT+2)===0)){if(!t)throw new Error("Invalid tar header: unknown format.")}return i===0&&n&&n[n.length-1]==="/"&&(i=5),{name:n,mode:s,uid:o,gid:a,size:l,mtime:new Date(1e3*c),type:u,linkname:g,uname:f,gname:h,devmajor:p,devminor:m}}});var Pce=w((evt,bce)=>{var Qce=require("util"),c9e=Ece(),eE=FT(),Sce=ph().Writable,vce=ph().PassThrough,xce=function(){},kce=function(r){return r&=511,r&&512-r},u9e=function(r,e){var t=new Qb(r,e);return t.end(),t},g9e=function(r,e){return e.path&&(r.name=e.path),e.linkpath&&(r.linkname=e.linkpath),e.size&&(r.size=parseInt(e.size,10)),r.pax=e,r},Qb=function(r,e){this._parent=r,this.offset=e,vce.call(this,{autoDestroy:!1})};Qce.inherits(Qb,vce);Qb.prototype.destroy=function(r){this._parent.destroy(r)};var kA=function(r){if(!(this instanceof kA))return new kA(r);Sce.call(this,r),r=r||{},this._offset=0,this._buffer=c9e(),this._missing=0,this._partial=!1,this._onparse=xce,this._header=null,this._stream=null,this._overflow=null,this._cb=null,this._locked=!1,this._destroyed=!1,this._pax=null,this._paxGlobal=null,this._gnuLongPath=null,this._gnuLongLinkPath=null;var e=this,t=e._buffer,i=function(){e._continue()},n=function(f){if(e._locked=!1,f)return e.destroy(f);e._stream||i()},s=function(){e._stream=null;var f=kce(e._header.size);f?e._parse(f,o):e._parse(512,g),e._locked||i()},o=function(){e._buffer.consume(kce(e._header.size)),e._parse(512,g),i()},a=function(){var f=e._header.size;e._paxGlobal=eE.decodePax(t.slice(0,f)),t.consume(f),s()},l=function(){var f=e._header.size;e._pax=eE.decodePax(t.slice(0,f)),e._paxGlobal&&(e._pax=Object.assign({},e._paxGlobal,e._pax)),t.consume(f),s()},c=function(){var f=e._header.size;this._gnuLongPath=eE.decodeLongPath(t.slice(0,f),r.filenameEncoding),t.consume(f),s()},u=function(){var f=e._header.size;this._gnuLongLinkPath=eE.decodeLongPath(t.slice(0,f),r.filenameEncoding),t.consume(f),s()},g=function(){var f=e._offset,h;try{h=e._header=eE.decode(t.slice(0,512),r.filenameEncoding,r.allowUnknownFormat)}catch(p){e.emit("error",p)}if(t.consume(512),!h){e._parse(512,g),i();return}if(h.type==="gnu-long-path"){e._parse(h.size,c),i();return}if(h.type==="gnu-long-link-path"){e._parse(h.size,u),i();return}if(h.type==="pax-global-header"){e._parse(h.size,a),i();return}if(h.type==="pax-header"){e._parse(h.size,l),i();return}if(e._gnuLongPath&&(h.name=e._gnuLongPath,e._gnuLongPath=null),e._gnuLongLinkPath&&(h.linkname=e._gnuLongLinkPath,e._gnuLongLinkPath=null),e._pax&&(e._header=h=g9e(h,e._pax),e._pax=null),e._locked=!0,!h.size||h.type==="directory"){e._parse(512,g),e.emit("entry",h,u9e(e,f),n);return}e._stream=new Qb(e,f),e.emit("entry",h,e._stream,n),e._parse(h.size,s),i()};this._onheader=g,this._parse(512,g)};Qce.inherits(kA,Sce);kA.prototype.destroy=function(r){this._destroyed||(this._destroyed=!0,r&&this.emit("error",r),this.emit("close"),this._stream&&this._stream.emit("close"))};kA.prototype._parse=function(r,e){this._destroyed||(this._offset+=r,this._missing=r,e===this._onheader&&(this._partial=!1),this._onparse=e)};kA.prototype._continue=function(){if(!this._destroyed){var r=this._cb;this._cb=xce,this._overflow?this._write(this._overflow,void 0,r):r()}};kA.prototype._write=function(r,e,t){if(!this._destroyed){var i=this._stream,n=this._buffer,s=this._missing;if(r.length&&(this._partial=!0),r.lengths&&(o=r.slice(s),r=r.slice(0,s)),i?i.end(r):n.append(r),this._overflow=o,this._onparse()}};kA.prototype._final=function(r){if(this._partial)return this.destroy(new Error("Unexpected end of data"));r()};bce.exports=kA});var Rce=w((tvt,Dce)=>{Dce.exports=require("fs").constants||require("constants")});var Oce=w((rvt,Fce)=>{var mh=Rce(),Nce=Mk(),Sb=Hl(),f9e=Buffer.alloc,Lce=ph().Readable,Eh=ph().Writable,h9e=require("string_decoder").StringDecoder,vb=FT(),p9e=parseInt("755",8),d9e=parseInt("644",8),Tce=f9e(1024),NT=function(){},LT=function(r,e){e&=511,e&&r.push(Tce.slice(0,512-e))};function C9e(r){switch(r&mh.S_IFMT){case mh.S_IFBLK:return"block-device";case mh.S_IFCHR:return"character-device";case mh.S_IFDIR:return"directory";case mh.S_IFIFO:return"fifo";case mh.S_IFLNK:return"symlink"}return"file"}var xb=function(r){Eh.call(this),this.written=0,this._to=r,this._destroyed=!1};Sb(xb,Eh);xb.prototype._write=function(r,e,t){if(this.written+=r.length,this._to.push(r))return t();this._to._drain=t};xb.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var kb=function(){Eh.call(this),this.linkname="",this._decoder=new h9e("utf-8"),this._destroyed=!1};Sb(kb,Eh);kb.prototype._write=function(r,e,t){this.linkname+=this._decoder.write(r),t()};kb.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var tE=function(){Eh.call(this),this._destroyed=!1};Sb(tE,Eh);tE.prototype._write=function(r,e,t){t(new Error("No body allowed for this entry"))};tE.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var Ia=function(r){if(!(this instanceof Ia))return new Ia(r);Lce.call(this,r),this._drain=NT,this._finalized=!1,this._finalizing=!1,this._destroyed=!1,this._stream=null};Sb(Ia,Lce);Ia.prototype.entry=function(r,e,t){if(this._stream)throw new Error("already piping an entry");if(!(this._finalized||this._destroyed)){typeof e=="function"&&(t=e,e=null),t||(t=NT);var i=this;if((!r.size||r.type==="symlink")&&(r.size=0),r.type||(r.type=C9e(r.mode)),r.mode||(r.mode=r.type==="directory"?p9e:d9e),r.uid||(r.uid=0),r.gid||(r.gid=0),r.mtime||(r.mtime=new Date),typeof e=="string"&&(e=Buffer.from(e)),Buffer.isBuffer(e)){r.size=e.length,this._encode(r);var n=this.push(e);return LT(i,r.size),n?process.nextTick(t):this._drain=t,new tE}if(r.type==="symlink"&&!r.linkname){var s=new kb;return Nce(s,function(a){if(a)return i.destroy(),t(a);r.linkname=s.linkname,i._encode(r),t()}),s}if(this._encode(r),r.type!=="file"&&r.type!=="contiguous-file")return process.nextTick(t),new tE;var o=new xb(this);return this._stream=o,Nce(o,function(a){if(i._stream=null,a)return i.destroy(),t(a);if(o.written!==r.size)return i.destroy(),t(new Error("size mismatch"));LT(i,r.size),i._finalizing&&i.finalize(),t()}),o}};Ia.prototype.finalize=function(){if(this._stream){this._finalizing=!0;return}this._finalized||(this._finalized=!0,this.push(Tce),this.push(null))};Ia.prototype.destroy=function(r){this._destroyed||(this._destroyed=!0,r&&this.emit("error",r),this.emit("close"),this._stream&&this._stream.destroy&&this._stream.destroy())};Ia.prototype._encode=function(r){if(!r.pax){var e=vb.encode(r);if(e){this.push(e);return}}this._encodePax(r)};Ia.prototype._encodePax=function(r){var e=vb.encodePax({name:r.name,linkname:r.linkname,pax:r.pax}),t={name:"PaxHeader",mode:r.mode,uid:r.uid,gid:r.gid,size:e.length,mtime:r.mtime,type:"pax-header",linkname:r.linkname&&"PaxHeader",uname:r.uname,gname:r.gname,devmajor:r.devmajor,devminor:r.devminor};this.push(vb.encode(t)),this.push(e),LT(this,e.length),t.size=r.size,t.type=r.type,this.push(vb.encode(t))};Ia.prototype._read=function(r){var e=this._drain;this._drain=NT,e()};Fce.exports=Ia});var Mce=w(TT=>{TT.extract=Pce();TT.pack=Oce()});var Xce=w((Qvt,Wce)=>{"use strict";var Ih=class{constructor(e,t,i){this.__specs=e||{},Object.keys(this.__specs).forEach(n=>{if(typeof this.__specs[n]=="string"){let s=this.__specs[n],o=this.__specs[s];if(o){let a=o.aliases||[];a.push(n,s),o.aliases=[...new Set(a)],this.__specs[n]=o}else throw new Error(`Alias refers to invalid key: ${s} -> ${n}`)}}),this.__opts=t||{},this.__providers=_ce(i.filter(n=>n!=null&&typeof n=="object")),this.__isFiggyPudding=!0}get(e){return jT(this,e,!0)}get[Symbol.toStringTag](){return"FiggyPudding"}forEach(e,t=this){for(let[i,n]of this.entries())e.call(t,n,i,this)}toJSON(){let e={};return this.forEach((t,i)=>{e[i]=t}),e}*entries(e){for(let i of Object.keys(this.__specs))yield[i,this.get(i)];let t=e||this.__opts.other;if(t){let i=new Set;for(let n of this.__providers){let s=n.entries?n.entries(t):P9e(n);for(let[o,a]of s)t(o)&&!i.has(o)&&(i.add(o),yield[o,a])}}}*[Symbol.iterator](){for(let[e,t]of this.entries())yield[e,t]}*keys(){for(let[e]of this.entries())yield e}*values(){for(let[,e]of this.entries())yield e}concat(...e){return new Proxy(new Ih(this.__specs,this.__opts,_ce(this.__providers).concat(e)),zce)}};try{let r=require("util");Ih.prototype[r.inspect.custom]=function(e,t){return this[Symbol.toStringTag]+" "+r.inspect(this.toJSON(),t)}}catch(r){}function D9e(r){throw Object.assign(new Error(`invalid config key requested: ${r}`),{code:"EBADKEY"})}function jT(r,e,t){let i=r.__specs[e];if(t&&!i&&(!r.__opts.other||!r.__opts.other(e)))D9e(e);else{i||(i={});let n;for(let s of r.__providers){if(n=Vce(e,s),n===void 0&&i.aliases&&i.aliases.length){for(let o of i.aliases)if(o!==e&&(n=Vce(o,s),n!==void 0))break}if(n!==void 0)break}return n===void 0&&i.default!==void 0?typeof i.default=="function"?i.default(r):i.default:n}}function Vce(r,e){let t;return e.__isFiggyPudding?t=jT(e,r,!1):typeof e.get=="function"?t=e.get(r):t=e[r],t}var zce={has(r,e){return e in r.__specs&&jT(r,e,!1)!==void 0},ownKeys(r){return Object.keys(r.__specs)},get(r,e){return typeof e=="symbol"||e.slice(0,2)==="__"||e in Ih.prototype?r[e]:r.get(e)},set(r,e,t){if(typeof e=="symbol"||e.slice(0,2)==="__")return r[e]=t,!0;throw new Error("figgyPudding options cannot be modified. Use .concat() instead.")},deleteProperty(){throw new Error("figgyPudding options cannot be deleted. Use .concat() and shadow them instead.")}};Wce.exports=R9e;function R9e(r,e){function t(...i){return new Proxy(new Ih(r,e,i),zce)}return t}function _ce(r){let e=[];return r.forEach(t=>e.unshift(t)),e}function P9e(r){return Object.keys(r).map(e=>[e,r[e]])}});var eue=w((Svt,ya)=>{"use strict";var iE=require("crypto"),F9e=Xce(),N9e=require("stream").Transform,Zce=["sha256","sha384","sha512"],L9e=/^[a-z0-9+/]+(?:=?=?)$/i,T9e=/^([^-]+)-([^?]+)([?\S*]*)$/,O9e=/^([^-]+)-([A-Za-z0-9+/=]{44,88})(\?[\x21-\x7E]*)*$/,M9e=/^[\x21-\x7E]+$/,Cn=F9e({algorithms:{default:["sha512"]},error:{default:!1},integrity:{},options:{default:[]},pickAlgorithm:{default:()=>K9e},Promise:{default:()=>Promise},sep:{default:" "},single:{default:!1},size:{},strict:{default:!1}}),Fu=class{get isHash(){return!0}constructor(e,t){t=Cn(t);let i=!!t.strict;this.source=e.trim();let n=this.source.match(i?O9e:T9e);if(!n||i&&!Zce.some(o=>o===n[1]))return;this.algorithm=n[1],this.digest=n[2];let s=n[3];this.options=s?s.slice(1).split("?"):[]}hexDigest(){return this.digest&&Buffer.from(this.digest,"base64").toString("hex")}toJSON(){return this.toString()}toString(e){if(e=Cn(e),e.strict&&!(Zce.some(i=>i===this.algorithm)&&this.digest.match(L9e)&&(this.options||[]).every(i=>i.match(M9e))))return"";let t=this.options&&this.options.length?`?${this.options.join("?")}`:"";return`${this.algorithm}-${this.digest}${t}`}},yh=class{get isIntegrity(){return!0}toJSON(){return this.toString()}toString(e){e=Cn(e);let t=e.sep||" ";return e.strict&&(t=t.replace(/\S+/g," ")),Object.keys(this).map(i=>this[i].map(n=>Fu.prototype.toString.call(n,e)).filter(n=>n.length).join(t)).filter(i=>i.length).join(t)}concat(e,t){t=Cn(t);let i=typeof e=="string"?e:nE(e,t);return wa(`${this.toString(t)} ${i}`,t)}hexDigest(){return wa(this,{single:!0}).hexDigest()}match(e,t){t=Cn(t);let i=wa(e,t),n=i.pickAlgorithm(t);return this[n]&&i[n]&&this[n].find(s=>i[n].find(o=>s.digest===o.digest))||!1}pickAlgorithm(e){e=Cn(e);let t=e.pickAlgorithm,i=Object.keys(this);if(!i.length)throw new Error(`No algorithms available for ${JSON.stringify(this.toString())}`);return i.reduce((n,s)=>t(n,s)||n)}};ya.exports.parse=wa;function wa(r,e){if(e=Cn(e),typeof r=="string")return GT(r,e);if(r.algorithm&&r.digest){let t=new yh;return t[r.algorithm]=[r],GT(nE(t,e),e)}else return GT(nE(r,e),e)}function GT(r,e){return e.single?new Fu(r,e):r.trim().split(/\s+/).reduce((t,i)=>{let n=new Fu(i,e);if(n.algorithm&&n.digest){let s=n.algorithm;t[s]||(t[s]=[]),t[s].push(n)}return t},new yh)}ya.exports.stringify=nE;function nE(r,e){return e=Cn(e),r.algorithm&&r.digest?Fu.prototype.toString.call(r,e):typeof r=="string"?nE(wa(r,e),e):yh.prototype.toString.call(r,e)}ya.exports.fromHex=U9e;function U9e(r,e,t){t=Cn(t);let i=t.options&&t.options.length?`?${t.options.join("?")}`:"";return wa(`${e}-${Buffer.from(r,"hex").toString("base64")}${i}`,t)}ya.exports.fromData=H9e;function H9e(r,e){e=Cn(e);let t=e.algorithms,i=e.options&&e.options.length?`?${e.options.join("?")}`:"";return t.reduce((n,s)=>{let o=iE.createHash(s).update(r).digest("base64"),a=new Fu(`${s}-${o}${i}`,e);if(a.algorithm&&a.digest){let l=a.algorithm;n[l]||(n[l]=[]),n[l].push(a)}return n},new yh)}ya.exports.fromStream=j9e;function j9e(r,e){e=Cn(e);let t=e.Promise||Promise,i=YT(e);return new t((n,s)=>{r.pipe(i),r.on("error",s),i.on("error",s);let o;i.on("integrity",a=>{o=a}),i.on("end",()=>n(o)),i.on("data",()=>{})})}ya.exports.checkData=G9e;function G9e(r,e,t){if(t=Cn(t),e=wa(e,t),!Object.keys(e).length){if(t.error)throw Object.assign(new Error("No valid integrity hashes to check against"),{code:"EINTEGRITY"});return!1}let i=e.pickAlgorithm(t),n=iE.createHash(i).update(r).digest("base64"),s=wa({algorithm:i,digest:n}),o=s.match(e,t);if(o||!t.error)return o;if(typeof t.size=="number"&&r.length!==t.size){let a=new Error(`data size mismatch when checking ${e}. - Wanted: ${t.size} - Found: ${r.length}`);throw a.code="EBADSIZE",a.found=r.length,a.expected=t.size,a.sri=e,a}else{let a=new Error(`Integrity checksum failed when using ${i}: Wanted ${e}, but got ${s}. (${r.length} bytes)`);throw a.code="EINTEGRITY",a.found=s,a.expected=e,a.algorithm=i,a.sri=e,a}}ya.exports.checkStream=Y9e;function Y9e(r,e,t){t=Cn(t);let i=t.Promise||Promise,n=YT(t.concat({integrity:e}));return new i((s,o)=>{r.pipe(n),r.on("error",o),n.on("error",o);let a;n.on("verified",l=>{a=l}),n.on("end",()=>s(a)),n.on("data",()=>{})})}ya.exports.integrityStream=YT;function YT(r){r=Cn(r);let e=r.integrity&&wa(r.integrity,r),t=e&&Object.keys(e).length,i=t&&e.pickAlgorithm(r),n=t&&e[i],s=Array.from(new Set(r.algorithms.concat(i?[i]:[]))),o=s.map(iE.createHash),a=0,l=new N9e({transform(c,u,g){a+=c.length,o.forEach(f=>f.update(c,u)),g(null,c,u)}}).on("end",()=>{let c=r.options&&r.options.length?`?${r.options.join("?")}`:"",u=wa(o.map((f,h)=>`${s[h]}-${f.digest("base64")}${c}`).join(" "),r),g=t&&u.match(e,r);if(typeof r.size=="number"&&a!==r.size){let f=new Error(`stream size mismatch when checking ${e}. - Wanted: ${r.size} - Found: ${a}`);f.code="EBADSIZE",f.found=a,f.expected=r.size,f.sri=e,l.emit("error",f)}else if(r.integrity&&!g){let f=new Error(`${e} integrity checksum failed when using ${i}: wanted ${n} but got ${u}. (${a} bytes)`);f.code="EINTEGRITY",f.found=u,f.expected=n,f.algorithm=i,f.sri=e,l.emit("error",f)}else l.emit("size",a),l.emit("integrity",u),g&&l.emit("verified",g)});return l}ya.exports.create=q9e;function q9e(r){r=Cn(r);let e=r.algorithms,t=r.options.length?`?${r.options.join("?")}`:"",i=e.map(iE.createHash);return{update:function(n,s){return i.forEach(o=>o.update(n,s)),this},digest:function(n){return e.reduce((o,a)=>{let l=i.shift().digest("base64"),c=new Fu(`${a}-${l}${t}`,r);if(c.algorithm&&c.digest){let u=c.algorithm;o[u]||(o[u]=[]),o[u].push(c)}return o},new yh)}}}var J9e=new Set(iE.getHashes()),$ce=["md5","whirlpool","sha1","sha224","sha256","sha384","sha512","sha3","sha3-256","sha3-384","sha3-512","sha3_256","sha3_384","sha3_512"].filter(r=>J9e.has(r));function K9e(r,e){return $ce.indexOf(r.toLowerCase())>=$ce.indexOf(e.toLowerCase())?r:e}});var EC={};ft(EC,{BuildType:()=>cs,Cache:()=>Nt,Configuration:()=>ye,DEFAULT_LOCK_FILENAME:()=>fk,DEFAULT_RC_FILENAME:()=>gk,FormatType:()=>Ri,InstallMode:()=>Ci,LightReport:()=>pA,LinkType:()=>Qt,Manifest:()=>At,MessageName:()=>X,MultiFetcher:()=>yd,PackageExtensionStatus:()=>qi,PackageExtensionType:()=>wi,Project:()=>ze,ProjectLookup:()=>ul,Report:()=>Ji,ReportError:()=>ct,SettingsType:()=>Ie,StreamReport:()=>Je,TAG_REGEXP:()=>zg,TelemetryManager:()=>mC,ThrowReport:()=>di,VirtualFetcher:()=>Bd,Workspace:()=>CC,WorkspaceFetcher:()=>bd,WorkspaceResolver:()=>oi,YarnVersion:()=>Ur,execUtils:()=>Nr,folderUtils:()=>sk,formatUtils:()=>ae,hashUtils:()=>Dn,httpUtils:()=>ir,miscUtils:()=>Se,nodeUtils:()=>Vg,parseMessageName:()=>II,scriptUtils:()=>Zt,semverUtils:()=>Wt,stringifyMessageName:()=>_A,structUtils:()=>P,tgzUtils:()=>Bi,treeUtils:()=>ls});var Nr={};ft(Nr,{EndStrategy:()=>ss,ExecError:()=>Ik,PipeError:()=>ww,execvp:()=>pve,pipevp:()=>ra});var Zh={};ft(Zh,{AliasFS:()=>Na,CwdFS:()=>_t,DEFAULT_COMPRESSION_LEVEL:()=>lc,FakeFS:()=>YA,Filename:()=>kt,JailFS:()=>La,LazyFS:()=>_h,LinkStrategy:()=>Gh,NoFS:()=>jE,NodeFS:()=>ar,PortablePath:()=>Me,PosixFS:()=>Vh,ProxiedFS:()=>Qi,VirtualFS:()=>Wr,ZipFS:()=>li,ZipOpenFS:()=>Is,constants:()=>Rr,extendFs:()=>WE,normalizeLineEndings:()=>sc,npath:()=>H,opendir:()=>KE,patchFs:()=>pQ,ppath:()=>k,statUtils:()=>rQ,toFilename:()=>Jr,xfs:()=>K});var Rr={};ft(Rr,{SAFE_TIME:()=>tQ,S_IFDIR:()=>Da,S_IFLNK:()=>Fa,S_IFMT:()=>_n,S_IFREG:()=>Ra});var _n=61440,Da=16384,Ra=32768,Fa=40960,tQ=456789e3;var rQ={};ft(rQ,{BigIntStatsEntry:()=>Uh,DEFAULT_MODE:()=>Kh,DirEntry:()=>KO,StatEntry:()=>jA,areStatsEqual:()=>nQ,clearStats:()=>RE,convertToBigIntStats:()=>FE,makeDefaultStats:()=>Hh,makeEmptyStats:()=>fge});var iQ=ge(require("util"));var Kh=Ra|420,KO=class{constructor(){this.name="";this.mode=0}isBlockDevice(){return!1}isCharacterDevice(){return!1}isDirectory(){return(this.mode&_n)===Da}isFIFO(){return!1}isFile(){return(this.mode&_n)===Ra}isSocket(){return!1}isSymbolicLink(){return(this.mode&_n)===Fa}},jA=class{constructor(){this.uid=0;this.gid=0;this.size=0;this.blksize=0;this.atimeMs=0;this.mtimeMs=0;this.ctimeMs=0;this.birthtimeMs=0;this.atime=new Date(0);this.mtime=new Date(0);this.ctime=new Date(0);this.birthtime=new Date(0);this.dev=0;this.ino=0;this.mode=Kh;this.nlink=1;this.rdev=0;this.blocks=1}isBlockDevice(){return!1}isCharacterDevice(){return!1}isDirectory(){return(this.mode&_n)===Da}isFIFO(){return!1}isFile(){return(this.mode&_n)===Ra}isSocket(){return!1}isSymbolicLink(){return(this.mode&_n)===Fa}},Uh=class{constructor(){this.uid=BigInt(0);this.gid=BigInt(0);this.size=BigInt(0);this.blksize=BigInt(0);this.atimeMs=BigInt(0);this.mtimeMs=BigInt(0);this.ctimeMs=BigInt(0);this.birthtimeMs=BigInt(0);this.atimeNs=BigInt(0);this.mtimeNs=BigInt(0);this.ctimeNs=BigInt(0);this.birthtimeNs=BigInt(0);this.atime=new Date(0);this.mtime=new Date(0);this.ctime=new Date(0);this.birthtime=new Date(0);this.dev=BigInt(0);this.ino=BigInt(0);this.mode=BigInt(Kh);this.nlink=BigInt(1);this.rdev=BigInt(0);this.blocks=BigInt(1)}isBlockDevice(){return!1}isCharacterDevice(){return!1}isDirectory(){return(this.mode&BigInt(_n))===BigInt(Da)}isFIFO(){return!1}isFile(){return(this.mode&BigInt(_n))===BigInt(Ra)}isSocket(){return!1}isSymbolicLink(){return(this.mode&BigInt(_n))===BigInt(Fa)}};function Hh(){return new jA}function fge(){return RE(Hh())}function RE(r){for(let e in r)if(Object.prototype.hasOwnProperty.call(r,e)){let t=r[e];typeof t=="number"?r[e]=0:typeof t=="bigint"?r[e]=BigInt(0):iQ.types.isDate(t)&&(r[e]=new Date(0))}return r}function FE(r){let e=new Uh;for(let t in r)if(Object.prototype.hasOwnProperty.call(r,t)){let i=r[t];typeof i=="number"?e[t]=BigInt(i):iQ.types.isDate(i)&&(e[t]=new Date(i))}return e.atimeNs=e.atimeMs*BigInt(1e6),e.mtimeNs=e.mtimeMs*BigInt(1e6),e.ctimeNs=e.ctimeMs*BigInt(1e6),e.birthtimeNs=e.birthtimeMs*BigInt(1e6),e}function nQ(r,e){if(r.atimeMs!==e.atimeMs||r.birthtimeMs!==e.birthtimeMs||r.blksize!==e.blksize||r.blocks!==e.blocks||r.ctimeMs!==e.ctimeMs||r.dev!==e.dev||r.gid!==e.gid||r.ino!==e.ino||r.isBlockDevice()!==e.isBlockDevice()||r.isCharacterDevice()!==e.isCharacterDevice()||r.isDirectory()!==e.isDirectory()||r.isFIFO()!==e.isFIFO()||r.isFile()!==e.isFile()||r.isSocket()!==e.isSocket()||r.isSymbolicLink()!==e.isSymbolicLink()||r.mode!==e.mode||r.mtimeMs!==e.mtimeMs||r.nlink!==e.nlink||r.rdev!==e.rdev||r.size!==e.size||r.uid!==e.uid)return!1;let t=r,i=e;return!(t.atimeNs!==i.atimeNs||t.mtimeNs!==i.mtimeNs||t.ctimeNs!==i.ctimeNs||t.birthtimeNs!==i.birthtimeNs)}var LE=ge(require("fs"));var jh=ge(require("path")),UO;(function(i){i[i.File=0]="File",i[i.Portable=1]="Portable",i[i.Native=2]="Native"})(UO||(UO={}));var Me={root:"/",dot:"."},kt={nodeModules:"node_modules",manifest:"package.json",lockfile:"yarn.lock",virtual:"__virtual__",pnpJs:".pnp.js",pnpCjs:".pnp.cjs",rc:".yarnrc.yml"},H=Object.create(jh.default),k=Object.create(jh.default.posix);H.cwd=()=>process.cwd();k.cwd=()=>sQ(process.cwd());k.resolve=(...r)=>r.length>0&&k.isAbsolute(r[0])?jh.default.posix.resolve(...r):jh.default.posix.resolve(k.cwd(),...r);var HO=function(r,e,t){return e=r.normalize(e),t=r.normalize(t),e===t?".":(e.endsWith(r.sep)||(e=e+r.sep),t.startsWith(e)?t.slice(e.length):null)};H.fromPortablePath=jO;H.toPortablePath=sQ;H.contains=(r,e)=>HO(H,r,e);k.contains=(r,e)=>HO(k,r,e);var hge=/^([a-zA-Z]:.*)$/,pge=/^\/\/(\.\/)?(.*)$/,dge=/^\/([a-zA-Z]:.*)$/,Cge=/^\/unc\/(\.dot\/)?(.*)$/;function jO(r){if(process.platform!=="win32")return r;let e,t;if(e=r.match(dge))r=e[1];else if(t=r.match(Cge))r=`\\\\${t[1]?".\\":""}${t[2]}`;else return r;return r.replace(/\//g,"\\")}function sQ(r){if(process.platform!=="win32")return r;r=r.replace(/\\/g,"/");let e,t;return(e=r.match(hge))?r=`/${e[1]}`:(t=r.match(pge))&&(r=`/unc/${t[1]?".dot/":""}${t[2]}`),r}function NE(r,e){return r===H?jO(e):sQ(e)}function Jr(r){if(H.parse(r).dir!==""||k.parse(r).dir!=="")throw new Error(`Invalid filename: "${r}"`);return r}var TE=new Date(tQ*1e3),Gh;(function(t){t.Allow="allow",t.ReadOnly="readOnly"})(Gh||(Gh={}));async function GO(r,e,t,i,n){let s=r.pathUtils.normalize(e),o=t.pathUtils.normalize(i),a=[],l=[],{atime:c,mtime:u}=n.stableTime?{atime:TE,mtime:TE}:await t.lstatPromise(o);await r.mkdirpPromise(r.pathUtils.dirname(e),{utimes:[c,u]});let g=typeof r.lutimesPromise=="function"?r.lutimesPromise.bind(r):r.utimesPromise.bind(r);await oQ(a,l,g,r,s,t,o,te(N({},n),{didParentExist:!0}));for(let f of a)await f();await Promise.all(l.map(f=>f()))}async function oQ(r,e,t,i,n,s,o,a){var h,p;let l=a.didParentExist?await mge(i,n):null,c=await s.lstatPromise(o),{atime:u,mtime:g}=a.stableTime?{atime:TE,mtime:TE}:c,f;switch(!0){case c.isDirectory():f=await Ege(r,e,t,i,n,l,s,o,c,a);break;case c.isFile():f=await Ige(r,e,t,i,n,l,s,o,c,a);break;case c.isSymbolicLink():f=await yge(r,e,t,i,n,l,s,o,c,a);break;default:throw new Error(`Unsupported file type (${c.mode})`)}return(f||((h=l==null?void 0:l.mtime)==null?void 0:h.getTime())!==g.getTime()||((p=l==null?void 0:l.atime)==null?void 0:p.getTime())!==u.getTime())&&(e.push(()=>t(n,u,g)),f=!0),(l===null||(l.mode&511)!=(c.mode&511))&&(e.push(()=>i.chmodPromise(n,c.mode&511)),f=!0),f}async function mge(r,e){try{return await r.lstatPromise(e)}catch(t){return null}}async function Ege(r,e,t,i,n,s,o,a,l,c){if(s!==null&&!s.isDirectory())if(c.overwrite)r.push(async()=>i.removePromise(n)),s=null;else return!1;let u=!1;s===null&&(r.push(async()=>{try{await i.mkdirPromise(n,{mode:l.mode})}catch(h){if(h.code!=="EEXIST")throw h}}),u=!0);let g=await o.readdirPromise(a),f=c.didParentExist&&!s?te(N({},c),{didParentExist:!1}):c;if(c.stableSort)for(let h of g.sort())await oQ(r,e,t,i,i.pathUtils.join(n,h),o,o.pathUtils.join(a,h),f)&&(u=!0);else(await Promise.all(g.map(async p=>{await oQ(r,e,t,i,i.pathUtils.join(n,p),o,o.pathUtils.join(a,p),f)}))).some(p=>p)&&(u=!0);return u}var aQ=new WeakMap;function AQ(r,e,t,i,n){return async()=>{await r.linkPromise(t,e),n===Gh.ReadOnly&&(i.mode&=~146,await r.chmodPromise(e,i.mode))}}function wge(r,e,t,i,n){let s=aQ.get(r);return typeof s=="undefined"?async()=>{try{await r.copyFilePromise(t,e,LE.default.constants.COPYFILE_FICLONE_FORCE),aQ.set(r,!0)}catch(o){if(o.code==="ENOSYS"||o.code==="ENOTSUP")aQ.set(r,!1),await AQ(r,e,t,i,n)();else throw o}}:s?async()=>r.copyFilePromise(t,e,LE.default.constants.COPYFILE_FICLONE_FORCE):AQ(r,e,t,i,n)}async function Ige(r,e,t,i,n,s,o,a,l,c){var f;if(s!==null)if(c.overwrite)r.push(async()=>i.removePromise(n)),s=null;else return!1;let u=(f=c.linkStrategy)!=null?f:null,g=i===o?u!==null?wge(i,n,a,l,u):async()=>i.copyFilePromise(a,n,LE.default.constants.COPYFILE_FICLONE):u!==null?AQ(i,n,a,l,u):async()=>i.writeFilePromise(n,await o.readFilePromise(a));return r.push(async()=>g()),!0}async function yge(r,e,t,i,n,s,o,a,l,c){if(s!==null)if(c.overwrite)r.push(async()=>i.removePromise(n)),s=null;else return!1;return r.push(async()=>{await i.symlinkPromise(NE(i.pathUtils,await o.readlinkPromise(a)),n)}),!0}function Es(r,e){return Object.assign(new Error(`${r}: ${e}`),{code:r})}function OE(r){return Es("EBUSY",r)}function Yh(r,e){return Es("ENOSYS",`${r}, ${e}`)}function GA(r){return Es("EINVAL",`invalid argument, ${r}`)}function Ai(r){return Es("EBADF",`bad file descriptor, ${r}`)}function io(r){return Es("ENOENT",`no such file or directory, ${r}`)}function Ro(r){return Es("ENOTDIR",`not a directory, ${r}`)}function qh(r){return Es("EISDIR",`illegal operation on a directory, ${r}`)}function ME(r){return Es("EEXIST",`file already exists, ${r}`)}function In(r){return Es("EROFS",`read-only filesystem, ${r}`)}function YO(r){return Es("ENOTEMPTY",`directory not empty, ${r}`)}function qO(r){return Es("EOPNOTSUPP",`operation not supported, ${r}`)}function JO(){return Es("ERR_DIR_CLOSED","Directory handle was closed")}var lQ=class extends Error{constructor(e,t){super(e);this.name="Libzip Error",this.code=t}};var WO=class{constructor(e,t,i={}){this.path=e;this.nextDirent=t;this.opts=i;this.closed=!1}throwIfClosed(){if(this.closed)throw JO()}async*[Symbol.asyncIterator](){try{let e;for(;(e=await this.read())!==null;)yield e}finally{await this.close()}}read(e){let t=this.readSync();return typeof e!="undefined"?e(null,t):Promise.resolve(t)}readSync(){return this.throwIfClosed(),this.nextDirent()}close(e){return this.closeSync(),typeof e!="undefined"?e(null):Promise.resolve()}closeSync(){var e,t;this.throwIfClosed(),(t=(e=this.opts).onClose)==null||t.call(e),this.closed=!0}};function KE(r,e,t,i){let n=()=>{let s=t.shift();return typeof s=="undefined"?null:Object.assign(r.statSync(r.pathUtils.join(e,s)),{name:s})};return new WO(e,n,i)}var zO=ge(require("os"));var YA=class{constructor(e){this.pathUtils=e}async*genTraversePromise(e,{stableSort:t=!1}={}){let i=[e];for(;i.length>0;){let n=i.shift();if((await this.lstatPromise(n)).isDirectory()){let o=await this.readdirPromise(n);if(t)for(let a of o.sort())i.push(this.pathUtils.join(n,a));else throw new Error("Not supported")}else yield n}}async removePromise(e,{recursive:t=!0,maxRetries:i=5}={}){let n;try{n=await this.lstatPromise(e)}catch(s){if(s.code==="ENOENT")return;throw s}if(n.isDirectory()){if(t){let s=await this.readdirPromise(e);await Promise.all(s.map(o=>this.removePromise(this.pathUtils.resolve(e,o))))}for(let s=0;s<=i;s++)try{await this.rmdirPromise(e);break}catch(o){if(o.code!=="EBUSY"&&o.code!=="ENOTEMPTY")throw o;ssetTimeout(a,s*100))}}else await this.unlinkPromise(e)}removeSync(e,{recursive:t=!0}={}){let i;try{i=this.lstatSync(e)}catch(n){if(n.code==="ENOENT")return;throw n}if(i.isDirectory()){if(t)for(let n of this.readdirSync(e))this.removeSync(this.pathUtils.resolve(e,n));this.rmdirSync(e)}else this.unlinkSync(e)}async mkdirpPromise(e,{chmod:t,utimes:i}={}){if(e=this.resolve(e),e===this.pathUtils.dirname(e))return;let n=e.split(this.pathUtils.sep),s;for(let o=2;o<=n.length;++o){let a=n.slice(0,o).join(this.pathUtils.sep);if(!this.existsSync(a)){try{await this.mkdirPromise(a)}catch(l){if(l.code==="EEXIST")continue;throw l}if(s!=null||(s=a),t!=null&&await this.chmodPromise(a,t),i!=null)await this.utimesPromise(a,i[0],i[1]);else{let l=await this.statPromise(this.pathUtils.dirname(a));await this.utimesPromise(a,l.atime,l.mtime)}}}return s}mkdirpSync(e,{chmod:t,utimes:i}={}){if(e=this.resolve(e),e===this.pathUtils.dirname(e))return;let n=e.split(this.pathUtils.sep),s;for(let o=2;o<=n.length;++o){let a=n.slice(0,o).join(this.pathUtils.sep);if(!this.existsSync(a)){try{this.mkdirSync(a)}catch(l){if(l.code==="EEXIST")continue;throw l}if(s!=null||(s=a),t!=null&&this.chmodSync(a,t),i!=null)this.utimesSync(a,i[0],i[1]);else{let l=this.statSync(this.pathUtils.dirname(a));this.utimesSync(a,l.atime,l.mtime)}}}return s}async copyPromise(e,t,{baseFs:i=this,overwrite:n=!0,stableSort:s=!1,stableTime:o=!1,linkStrategy:a=null}={}){return await GO(this,e,i,t,{overwrite:n,stableSort:s,stableTime:o,linkStrategy:a})}copySync(e,t,{baseFs:i=this,overwrite:n=!0}={}){let s=i.lstatSync(t),o=this.existsSync(e);if(s.isDirectory()){this.mkdirpSync(e);let l=i.readdirSync(t);for(let c of l)this.copySync(this.pathUtils.join(e,c),i.pathUtils.join(t,c),{baseFs:i,overwrite:n})}else if(s.isFile()){if(!o||n){o&&this.removeSync(e);let l=i.readFileSync(t);this.writeFileSync(e,l)}}else if(s.isSymbolicLink()){if(!o||n){o&&this.removeSync(e);let l=i.readlinkSync(t);this.symlinkSync(NE(this.pathUtils,l),e)}}else throw new Error(`Unsupported file type (file: ${t}, mode: 0o${s.mode.toString(8).padStart(6,"0")})`);let a=s.mode&511;this.chmodSync(e,a)}async changeFilePromise(e,t,i={}){return Buffer.isBuffer(t)?this.changeFileBufferPromise(e,t,i):this.changeFileTextPromise(e,t,i)}async changeFileBufferPromise(e,t,{mode:i}={}){let n=Buffer.alloc(0);try{n=await this.readFilePromise(e)}catch(s){}Buffer.compare(n,t)!==0&&await this.writeFilePromise(e,t,{mode:i})}async changeFileTextPromise(e,t,{automaticNewlines:i,mode:n}={}){let s="";try{s=await this.readFilePromise(e,"utf8")}catch(a){}let o=i?sc(s,t):t;s!==o&&await this.writeFilePromise(e,o,{mode:n})}changeFileSync(e,t,i={}){return Buffer.isBuffer(t)?this.changeFileBufferSync(e,t,i):this.changeFileTextSync(e,t,i)}changeFileBufferSync(e,t,{mode:i}={}){let n=Buffer.alloc(0);try{n=this.readFileSync(e)}catch(s){}Buffer.compare(n,t)!==0&&this.writeFileSync(e,t,{mode:i})}changeFileTextSync(e,t,{automaticNewlines:i=!1,mode:n}={}){let s="";try{s=this.readFileSync(e,"utf8")}catch(a){}let o=i?sc(s,t):t;s!==o&&this.writeFileSync(e,o,{mode:n})}async movePromise(e,t){try{await this.renamePromise(e,t)}catch(i){if(i.code==="EXDEV")await this.copyPromise(t,e),await this.removePromise(e);else throw i}}moveSync(e,t){try{this.renameSync(e,t)}catch(i){if(i.code==="EXDEV")this.copySync(t,e),this.removeSync(e);else throw i}}async lockPromise(e,t){let i=`${e}.flock`,n=1e3/60,s=Date.now(),o=null,a=async()=>{let l;try{[l]=await this.readJsonPromise(i)}catch(c){return Date.now()-s<500}try{return process.kill(l,0),!0}catch(c){return!1}};for(;o===null;)try{o=await this.openPromise(i,"wx")}catch(l){if(l.code==="EEXIST"){if(!await a())try{await this.unlinkPromise(i);continue}catch(c){}if(Date.now()-s<60*1e3)await new Promise(c=>setTimeout(c,n));else throw new Error(`Couldn't acquire a lock in a reasonable time (via ${i})`)}else throw l}await this.writePromise(o,JSON.stringify([process.pid]));try{return await t()}finally{try{await this.closePromise(o),await this.unlinkPromise(i)}catch(l){}}}async readJsonPromise(e){let t=await this.readFilePromise(e,"utf8");try{return JSON.parse(t)}catch(i){throw i.message+=` (in ${e})`,i}}readJsonSync(e){let t=this.readFileSync(e,"utf8");try{return JSON.parse(t)}catch(i){throw i.message+=` (in ${e})`,i}}async writeJsonPromise(e,t){return await this.writeFilePromise(e,`${JSON.stringify(t,null,2)} -`)}writeJsonSync(e,t){return this.writeFileSync(e,`${JSON.stringify(t,null,2)} -`)}async preserveTimePromise(e,t){let i=await this.lstatPromise(e),n=await t();typeof n!="undefined"&&(e=n),this.lutimesPromise?await this.lutimesPromise(e,i.atime,i.mtime):i.isSymbolicLink()||await this.utimesPromise(e,i.atime,i.mtime)}async preserveTimeSync(e,t){let i=this.lstatSync(e),n=t();typeof n!="undefined"&&(e=n),this.lutimesSync?this.lutimesSync(e,i.atime,i.mtime):i.isSymbolicLink()||this.utimesSync(e,i.atime,i.mtime)}},oc=class extends YA{constructor(){super(k)}};function Bge(r){let e=r.match(/\r?\n/g);if(e===null)return zO.EOL;let t=e.filter(n=>n===`\r -`).length,i=e.length-t;return t>i?`\r -`:` -`}function sc(r,e){return e.replace(/\r?\n/g,Bge(r))}var zu=ge(require("fs")),cQ=ge(require("stream")),ZO=ge(require("util")),uQ=ge(require("zlib"));var _O=ge(require("fs"));var ar=class extends oc{constructor(e=_O.default){super();this.realFs=e,typeof this.realFs.lutimes!="undefined"&&(this.lutimesPromise=this.lutimesPromiseImpl,this.lutimesSync=this.lutimesSyncImpl)}getExtractHint(){return!1}getRealPath(){return Me.root}resolve(e){return k.resolve(e)}async openPromise(e,t,i){return await new Promise((n,s)=>{this.realFs.open(H.fromPortablePath(e),t,i,this.makeCallback(n,s))})}openSync(e,t,i){return this.realFs.openSync(H.fromPortablePath(e),t,i)}async opendirPromise(e,t){return await new Promise((i,n)=>{typeof t!="undefined"?this.realFs.opendir(H.fromPortablePath(e),t,this.makeCallback(i,n)):this.realFs.opendir(H.fromPortablePath(e),this.makeCallback(i,n))}).then(i=>Object.defineProperty(i,"path",{value:e,configurable:!0,writable:!0}))}opendirSync(e,t){let i=typeof t!="undefined"?this.realFs.opendirSync(H.fromPortablePath(e),t):this.realFs.opendirSync(H.fromPortablePath(e));return Object.defineProperty(i,"path",{value:e,configurable:!0,writable:!0})}async readPromise(e,t,i=0,n=0,s=-1){return await new Promise((o,a)=>{this.realFs.read(e,t,i,n,s,(l,c)=>{l?a(l):o(c)})})}readSync(e,t,i,n,s){return this.realFs.readSync(e,t,i,n,s)}async writePromise(e,t,i,n,s){return await new Promise((o,a)=>typeof t=="string"?this.realFs.write(e,t,i,this.makeCallback(o,a)):this.realFs.write(e,t,i,n,s,this.makeCallback(o,a)))}writeSync(e,t,i,n,s){return typeof t=="string"?this.realFs.writeSync(e,t,i):this.realFs.writeSync(e,t,i,n,s)}async closePromise(e){await new Promise((t,i)=>{this.realFs.close(e,this.makeCallback(t,i))})}closeSync(e){this.realFs.closeSync(e)}createReadStream(e,t){let i=e!==null?H.fromPortablePath(e):e;return this.realFs.createReadStream(i,t)}createWriteStream(e,t){let i=e!==null?H.fromPortablePath(e):e;return this.realFs.createWriteStream(i,t)}async realpathPromise(e){return await new Promise((t,i)=>{this.realFs.realpath(H.fromPortablePath(e),{},this.makeCallback(t,i))}).then(t=>H.toPortablePath(t))}realpathSync(e){return H.toPortablePath(this.realFs.realpathSync(H.fromPortablePath(e),{}))}async existsPromise(e){return await new Promise(t=>{this.realFs.exists(H.fromPortablePath(e),t)})}accessSync(e,t){return this.realFs.accessSync(H.fromPortablePath(e),t)}async accessPromise(e,t){return await new Promise((i,n)=>{this.realFs.access(H.fromPortablePath(e),t,this.makeCallback(i,n))})}existsSync(e){return this.realFs.existsSync(H.fromPortablePath(e))}async statPromise(e,t){return await new Promise((i,n)=>{t?this.realFs.stat(H.fromPortablePath(e),t,this.makeCallback(i,n)):this.realFs.stat(H.fromPortablePath(e),this.makeCallback(i,n))})}statSync(e,t){return t?this.realFs.statSync(H.fromPortablePath(e),t):this.realFs.statSync(H.fromPortablePath(e))}async fstatPromise(e,t){return await new Promise((i,n)=>{t?this.realFs.fstat(e,t,this.makeCallback(i,n)):this.realFs.fstat(e,this.makeCallback(i,n))})}fstatSync(e,t){return t?this.realFs.fstatSync(e,t):this.realFs.fstatSync(e)}async lstatPromise(e,t){return await new Promise((i,n)=>{t?this.realFs.lstat(H.fromPortablePath(e),t,this.makeCallback(i,n)):this.realFs.lstat(H.fromPortablePath(e),this.makeCallback(i,n))})}lstatSync(e,t){return t?this.realFs.lstatSync(H.fromPortablePath(e),t):this.realFs.lstatSync(H.fromPortablePath(e))}async fchmodPromise(e,t){return await new Promise((i,n)=>{this.realFs.fchmod(e,t,this.makeCallback(i,n))})}fchmodSync(e,t){return this.realFs.fchmodSync(e,t)}async chmodPromise(e,t){return await new Promise((i,n)=>{this.realFs.chmod(H.fromPortablePath(e),t,this.makeCallback(i,n))})}chmodSync(e,t){return this.realFs.chmodSync(H.fromPortablePath(e),t)}async chownPromise(e,t,i){return await new Promise((n,s)=>{this.realFs.chown(H.fromPortablePath(e),t,i,this.makeCallback(n,s))})}chownSync(e,t,i){return this.realFs.chownSync(H.fromPortablePath(e),t,i)}async renamePromise(e,t){return await new Promise((i,n)=>{this.realFs.rename(H.fromPortablePath(e),H.fromPortablePath(t),this.makeCallback(i,n))})}renameSync(e,t){return this.realFs.renameSync(H.fromPortablePath(e),H.fromPortablePath(t))}async copyFilePromise(e,t,i=0){return await new Promise((n,s)=>{this.realFs.copyFile(H.fromPortablePath(e),H.fromPortablePath(t),i,this.makeCallback(n,s))})}copyFileSync(e,t,i=0){return this.realFs.copyFileSync(H.fromPortablePath(e),H.fromPortablePath(t),i)}async appendFilePromise(e,t,i){return await new Promise((n,s)=>{let o=typeof e=="string"?H.fromPortablePath(e):e;i?this.realFs.appendFile(o,t,i,this.makeCallback(n,s)):this.realFs.appendFile(o,t,this.makeCallback(n,s))})}appendFileSync(e,t,i){let n=typeof e=="string"?H.fromPortablePath(e):e;i?this.realFs.appendFileSync(n,t,i):this.realFs.appendFileSync(n,t)}async writeFilePromise(e,t,i){return await new Promise((n,s)=>{let o=typeof e=="string"?H.fromPortablePath(e):e;i?this.realFs.writeFile(o,t,i,this.makeCallback(n,s)):this.realFs.writeFile(o,t,this.makeCallback(n,s))})}writeFileSync(e,t,i){let n=typeof e=="string"?H.fromPortablePath(e):e;i?this.realFs.writeFileSync(n,t,i):this.realFs.writeFileSync(n,t)}async unlinkPromise(e){return await new Promise((t,i)=>{this.realFs.unlink(H.fromPortablePath(e),this.makeCallback(t,i))})}unlinkSync(e){return this.realFs.unlinkSync(H.fromPortablePath(e))}async utimesPromise(e,t,i){return await new Promise((n,s)=>{this.realFs.utimes(H.fromPortablePath(e),t,i,this.makeCallback(n,s))})}utimesSync(e,t,i){this.realFs.utimesSync(H.fromPortablePath(e),t,i)}async lutimesPromiseImpl(e,t,i){let n=this.realFs.lutimes;if(typeof n=="undefined")throw Yh("unavailable Node binding",`lutimes '${e}'`);return await new Promise((s,o)=>{n.call(this.realFs,H.fromPortablePath(e),t,i,this.makeCallback(s,o))})}lutimesSyncImpl(e,t,i){let n=this.realFs.lutimesSync;if(typeof n=="undefined")throw Yh("unavailable Node binding",`lutimes '${e}'`);n.call(this.realFs,H.fromPortablePath(e),t,i)}async mkdirPromise(e,t){return await new Promise((i,n)=>{this.realFs.mkdir(H.fromPortablePath(e),t,this.makeCallback(i,n))})}mkdirSync(e,t){return this.realFs.mkdirSync(H.fromPortablePath(e),t)}async rmdirPromise(e,t){return await new Promise((i,n)=>{t?this.realFs.rmdir(H.fromPortablePath(e),t,this.makeCallback(i,n)):this.realFs.rmdir(H.fromPortablePath(e),this.makeCallback(i,n))})}rmdirSync(e,t){return this.realFs.rmdirSync(H.fromPortablePath(e),t)}async linkPromise(e,t){return await new Promise((i,n)=>{this.realFs.link(H.fromPortablePath(e),H.fromPortablePath(t),this.makeCallback(i,n))})}linkSync(e,t){return this.realFs.linkSync(H.fromPortablePath(e),H.fromPortablePath(t))}async symlinkPromise(e,t,i){return await new Promise((n,s)=>{this.realFs.symlink(H.fromPortablePath(e.replace(/\/+$/,"")),H.fromPortablePath(t),i,this.makeCallback(n,s))})}symlinkSync(e,t,i){return this.realFs.symlinkSync(H.fromPortablePath(e.replace(/\/+$/,"")),H.fromPortablePath(t),i)}async readFilePromise(e,t){return await new Promise((i,n)=>{let s=typeof e=="string"?H.fromPortablePath(e):e;this.realFs.readFile(s,t,this.makeCallback(i,n))})}readFileSync(e,t){let i=typeof e=="string"?H.fromPortablePath(e):e;return this.realFs.readFileSync(i,t)}async readdirPromise(e,t){return await new Promise((i,n)=>{(t==null?void 0:t.withFileTypes)?this.realFs.readdir(H.fromPortablePath(e),{withFileTypes:!0},this.makeCallback(i,n)):this.realFs.readdir(H.fromPortablePath(e),this.makeCallback(s=>i(s),n))})}readdirSync(e,t){return(t==null?void 0:t.withFileTypes)?this.realFs.readdirSync(H.fromPortablePath(e),{withFileTypes:!0}):this.realFs.readdirSync(H.fromPortablePath(e))}async readlinkPromise(e){return await new Promise((t,i)=>{this.realFs.readlink(H.fromPortablePath(e),this.makeCallback(t,i))}).then(t=>H.toPortablePath(t))}readlinkSync(e){return H.toPortablePath(this.realFs.readlinkSync(H.fromPortablePath(e)))}async truncatePromise(e,t){return await new Promise((i,n)=>{this.realFs.truncate(H.fromPortablePath(e),t,this.makeCallback(i,n))})}truncateSync(e,t){return this.realFs.truncateSync(H.fromPortablePath(e),t)}async ftruncatePromise(e,t){return await new Promise((i,n)=>{this.realFs.ftruncate(e,t,this.makeCallback(i,n))})}ftruncateSync(e,t){return this.realFs.ftruncateSync(e,t)}watch(e,t,i){return this.realFs.watch(H.fromPortablePath(e),t,i)}watchFile(e,t,i){return this.realFs.watchFile(H.fromPortablePath(e),t,i)}unwatchFile(e,t){return this.realFs.unwatchFile(H.fromPortablePath(e),t)}makeCallback(e,t){return(i,n)=>{i?t(i):e(n)}}};var VO=ge(require("events"));var ac;(function(t){t.Change="change",t.Stop="stop"})(ac||(ac={}));var Ac;(function(i){i.Ready="ready",i.Running="running",i.Stopped="stopped"})(Ac||(Ac={}));function XO(r,e){if(r!==e)throw new Error(`Invalid StatWatcher status: expected '${e}', got '${r}'`)}var Jh=class extends VO.EventEmitter{constructor(e,t,{bigint:i=!1}={}){super();this.status=Ac.Ready;this.changeListeners=new Map;this.startTimeout=null;this.fakeFs=e,this.path=t,this.bigint=i,this.lastStats=this.stat()}static create(e,t,i){let n=new Jh(e,t,i);return n.start(),n}start(){XO(this.status,Ac.Ready),this.status=Ac.Running,this.startTimeout=setTimeout(()=>{this.startTimeout=null,this.fakeFs.existsSync(this.path)||this.emit(ac.Change,this.lastStats,this.lastStats)},3)}stop(){XO(this.status,Ac.Running),this.status=Ac.Stopped,this.startTimeout!==null&&(clearTimeout(this.startTimeout),this.startTimeout=null),this.emit(ac.Stop)}stat(){try{return this.fakeFs.statSync(this.path,{bigint:this.bigint})}catch(e){let t=this.bigint?new Uh:new jA;return RE(t)}}makeInterval(e){let t=setInterval(()=>{let i=this.stat(),n=this.lastStats;nQ(i,n)||(this.lastStats=i,this.emit(ac.Change,i,n))},e.interval);return e.persistent?t:t.unref()}registerChangeListener(e,t){this.addListener(ac.Change,e),this.changeListeners.set(e,this.makeInterval(t))}unregisterChangeListener(e){this.removeListener(ac.Change,e);let t=this.changeListeners.get(e);typeof t!="undefined"&&clearInterval(t),this.changeListeners.delete(e)}unregisterAllChangeListeners(){for(let e of this.changeListeners.keys())this.unregisterChangeListener(e)}hasChangeListeners(){return this.changeListeners.size>0}ref(){for(let e of this.changeListeners.values())e.ref();return this}unref(){for(let e of this.changeListeners.values())e.unref();return this}};var UE=new WeakMap;function HE(r,e,t,i){let n,s,o,a;switch(typeof t){case"function":n=!1,s=!0,o=5007,a=t;break;default:({bigint:n=!1,persistent:s=!0,interval:o=5007}=t),a=i;break}let l=UE.get(r);typeof l=="undefined"&&UE.set(r,l=new Map);let c=l.get(e);return typeof c=="undefined"&&(c=Jh.create(r,e,{bigint:n}),l.set(e,c)),c.registerChangeListener(a,{persistent:s,interval:o}),c}function Wh(r,e,t){let i=UE.get(r);if(typeof i=="undefined")return;let n=i.get(e);typeof n!="undefined"&&(typeof t=="undefined"?n.unregisterAllChangeListeners():n.unregisterChangeListener(t),n.hasChangeListeners()||(n.stop(),i.delete(e)))}function zh(r){let e=UE.get(r);if(typeof e!="undefined")for(let t of e.keys())Wh(r,t)}var lc="mixed";function bge(r){if(typeof r=="string"&&String(+r)===r)return+r;if(Number.isFinite(r))return r<0?Date.now()/1e3:r;if(ZO.types.isDate(r))return r.getTime()/1e3;throw new Error("Invalid time")}function $O(){return Buffer.from([80,75,5,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])}var li=class extends oc{constructor(e,t){super();this.lzSource=null;this.listings=new Map;this.entries=new Map;this.fileSources=new Map;this.fds=new Map;this.nextFd=0;this.ready=!1;this.readOnly=!1;this.libzip=t.libzip;let i=t;if(this.level=typeof i.level!="undefined"?i.level:lc,e!=null||(e=$O()),typeof e=="string"){let{baseFs:o=new ar}=i;this.baseFs=o,this.path=e}else this.path=null,this.baseFs=null;if(t.stats)this.stats=t.stats;else if(typeof e=="string")try{this.stats=this.baseFs.statSync(e)}catch(o){if(o.code==="ENOENT"&&i.create)this.stats=Hh();else throw o}else this.stats=Hh();let n=this.libzip.malloc(4);try{let o=0;if(typeof e=="string"&&i.create&&(o|=this.libzip.ZIP_CREATE|this.libzip.ZIP_TRUNCATE),t.readOnly&&(o|=this.libzip.ZIP_RDONLY,this.readOnly=!0),typeof e=="string")this.zip=this.libzip.open(H.fromPortablePath(e),o,n);else{let a=this.allocateUnattachedSource(e);try{this.zip=this.libzip.openFromSource(a,o,n),this.lzSource=a}catch(l){throw this.libzip.source.free(a),l}}if(this.zip===0){let a=this.libzip.struct.errorS();throw this.libzip.error.initWithCode(a,this.libzip.getValue(n,"i32")),this.makeLibzipError(a)}}finally{this.libzip.free(n)}this.listings.set(Me.root,new Set);let s=this.libzip.getNumEntries(this.zip,0);for(let o=0;oe)throw new Error("Overread");let n=this.libzip.HEAPU8.subarray(t,t+e);return Buffer.from(n)}finally{this.libzip.free(t)}}finally{this.libzip.source.close(this.lzSource),this.libzip.source.free(this.lzSource),this.ready=!1}}prepareClose(){if(!this.ready)throw OE("archive closed, close");zh(this)}saveAndClose(){if(!this.path||!this.baseFs)throw new Error("ZipFS cannot be saved and must be discarded when loaded from a buffer");if(this.prepareClose(),this.readOnly){this.discardAndClose();return}let e=this.baseFs.existsSync(this.path)||this.stats.mode===Kh?void 0:this.stats.mode;if(this.entries.size===0)this.discardAndClose(),this.baseFs.writeFileSync(this.path,$O(),{mode:e});else{if(this.libzip.close(this.zip)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));typeof e!="undefined"&&this.baseFs.chmodSync(this.path,e)}this.ready=!1}discardAndClose(){this.prepareClose(),this.libzip.discard(this.zip),this.ready=!1}resolve(e){return k.resolve(Me.root,e)}async openPromise(e,t,i){return this.openSync(e,t,i)}openSync(e,t,i){let n=this.nextFd++;return this.fds.set(n,{cursor:0,p:e}),n}hasOpenFileHandles(){return!!this.fds.size}async opendirPromise(e,t){return this.opendirSync(e,t)}opendirSync(e,t={}){let i=this.resolveFilename(`opendir '${e}'`,e);if(!this.entries.has(i)&&!this.listings.has(i))throw io(`opendir '${e}'`);let n=this.listings.get(i);if(!n)throw Ro(`opendir '${e}'`);let s=[...n],o=this.openSync(i,"r");return KE(this,i,s,{onClose:()=>{this.closeSync(o)}})}async readPromise(e,t,i,n,s){return this.readSync(e,t,i,n,s)}readSync(e,t,i=0,n=t.byteLength,s=-1){let o=this.fds.get(e);if(typeof o=="undefined")throw Ai("read");let a=s===-1||s===null?o.cursor:s,l=this.readFileSync(o.p);l.copy(t,i,a,a+n);let c=Math.max(0,Math.min(l.length-a,n));return(s===-1||s===null)&&(o.cursor+=c),c}async writePromise(e,t,i,n,s){return typeof t=="string"?this.writeSync(e,t,s):this.writeSync(e,t,i,n,s)}writeSync(e,t,i,n,s){throw typeof this.fds.get(e)=="undefined"?Ai("read"):new Error("Unimplemented")}async closePromise(e){return this.closeSync(e)}closeSync(e){if(typeof this.fds.get(e)=="undefined")throw Ai("read");this.fds.delete(e)}createReadStream(e,{encoding:t}={}){if(e===null)throw new Error("Unimplemented");let i=this.openSync(e,"r"),n=Object.assign(new cQ.PassThrough({emitClose:!0,autoDestroy:!0,destroy:(o,a)=>{clearImmediate(s),this.closeSync(i),a(o)}}),{close(){n.destroy()},bytesRead:0,path:e}),s=setImmediate(async()=>{try{let o=await this.readFilePromise(e,t);n.bytesRead=o.length,n.end(o)}catch(o){n.destroy(o)}});return n}createWriteStream(e,{encoding:t}={}){if(this.readOnly)throw In(`open '${e}'`);if(e===null)throw new Error("Unimplemented");let i=[],n=this.openSync(e,"w"),s=Object.assign(new cQ.PassThrough({autoDestroy:!0,emitClose:!0,destroy:(o,a)=>{try{o?a(o):(this.writeFileSync(e,Buffer.concat(i),t),a(null))}catch(l){a(l)}finally{this.closeSync(n)}}}),{bytesWritten:0,path:e,close(){s.destroy()}});return s.on("data",o=>{let a=Buffer.from(o);s.bytesWritten+=a.length,i.push(a)}),s}async realpathPromise(e){return this.realpathSync(e)}realpathSync(e){let t=this.resolveFilename(`lstat '${e}'`,e);if(!this.entries.has(t)&&!this.listings.has(t))throw io(`lstat '${e}'`);return t}async existsPromise(e){return this.existsSync(e)}existsSync(e){if(!this.ready)throw OE(`archive closed, existsSync '${e}'`);if(this.symlinkCount===0){let i=k.resolve(Me.root,e);return this.entries.has(i)||this.listings.has(i)}let t;try{t=this.resolveFilename(`stat '${e}'`,e,void 0,!1)}catch(i){return!1}return t===void 0?!1:this.entries.has(t)||this.listings.has(t)}async accessPromise(e,t){return this.accessSync(e,t)}accessSync(e,t=zu.constants.F_OK){let i=this.resolveFilename(`access '${e}'`,e);if(!this.entries.has(i)&&!this.listings.has(i))throw io(`access '${e}'`);if(this.readOnly&&t&zu.constants.W_OK)throw In(`access '${e}'`)}async statPromise(e,t={bigint:!1}){return t.bigint?this.statSync(e,{bigint:!0}):this.statSync(e)}statSync(e,t={bigint:!1,throwIfNoEntry:!0}){let i=this.resolveFilename(`stat '${e}'`,e,void 0,t.throwIfNoEntry);if(i!==void 0){if(!this.entries.has(i)&&!this.listings.has(i)){if(t.throwIfNoEntry===!1)return;throw io(`stat '${e}'`)}if(e[e.length-1]==="/"&&!this.listings.has(i))throw Ro(`stat '${e}'`);return this.statImpl(`stat '${e}'`,i,t)}}async fstatPromise(e,t){return this.fstatSync(e,t)}fstatSync(e,t){let i=this.fds.get(e);if(typeof i=="undefined")throw Ai("fstatSync");let{p:n}=i,s=this.resolveFilename(`stat '${n}'`,n);if(!this.entries.has(s)&&!this.listings.has(s))throw io(`stat '${n}'`);if(n[n.length-1]==="/"&&!this.listings.has(s))throw Ro(`stat '${n}'`);return this.statImpl(`fstat '${n}'`,s,t)}async lstatPromise(e,t={bigint:!1}){return t.bigint?this.lstatSync(e,{bigint:!0}):this.lstatSync(e)}lstatSync(e,t={bigint:!1,throwIfNoEntry:!0}){let i=this.resolveFilename(`lstat '${e}'`,e,!1,t.throwIfNoEntry);if(i!==void 0){if(!this.entries.has(i)&&!this.listings.has(i)){if(t.throwIfNoEntry===!1)return;throw io(`lstat '${e}'`)}if(e[e.length-1]==="/"&&!this.listings.has(i))throw Ro(`lstat '${e}'`);return this.statImpl(`lstat '${e}'`,i,t)}}statImpl(e,t,i={}){let n=this.entries.get(t);if(typeof n!="undefined"){let s=this.libzip.struct.statS();if(this.libzip.statIndex(this.zip,n,0,0,s)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));let a=this.stats.uid,l=this.stats.gid,c=this.libzip.struct.statSize(s)>>>0,u=512,g=Math.ceil(c/u),f=(this.libzip.struct.statMtime(s)>>>0)*1e3,h=f,p=f,m=f,y=new Date(h),b=new Date(p),v=new Date(m),x=new Date(f),T=this.listings.has(t)?Da:this.isSymbolicLink(n)?Fa:Ra,q=T===Da?493:420,Y=T|this.getUnixMode(n,q)&511,$=this.libzip.struct.statCrc(s),_=Object.assign(new jA,{uid:a,gid:l,size:c,blksize:u,blocks:g,atime:y,birthtime:b,ctime:v,mtime:x,atimeMs:h,birthtimeMs:p,ctimeMs:m,mtimeMs:f,mode:Y,crc:$});return i.bigint===!0?FE(_):_}if(this.listings.has(t)){let s=this.stats.uid,o=this.stats.gid,a=0,l=512,c=0,u=this.stats.mtimeMs,g=this.stats.mtimeMs,f=this.stats.mtimeMs,h=this.stats.mtimeMs,p=new Date(u),m=new Date(g),y=new Date(f),b=new Date(h),v=Da|493,x=0,T=Object.assign(new jA,{uid:s,gid:o,size:a,blksize:l,blocks:c,atime:p,birthtime:m,ctime:y,mtime:b,atimeMs:u,birthtimeMs:g,ctimeMs:f,mtimeMs:h,mode:v,crc:x});return i.bigint===!0?FE(T):T}throw new Error("Unreachable")}getUnixMode(e,t){if(this.libzip.file.getExternalAttributes(this.zip,e,0,0,this.libzip.uint08S,this.libzip.uint32S)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));return this.libzip.getValue(this.libzip.uint08S,"i8")>>>0!==this.libzip.ZIP_OPSYS_UNIX?t:this.libzip.getValue(this.libzip.uint32S,"i32")>>>16}registerListing(e){let t=this.listings.get(e);if(t)return t;this.registerListing(k.dirname(e)).add(k.basename(e));let n=new Set;return this.listings.set(e,n),n}registerEntry(e,t){this.registerListing(k.dirname(e)).add(k.basename(e)),this.entries.set(e,t)}unregisterListing(e){this.listings.delete(e);let t=this.listings.get(k.dirname(e));t==null||t.delete(k.basename(e))}unregisterEntry(e){this.unregisterListing(e);let t=this.entries.get(e);this.entries.delete(e),typeof t!="undefined"&&(this.fileSources.delete(t),this.isSymbolicLink(t)&&this.symlinkCount--)}deleteEntry(e,t){if(this.unregisterEntry(e),this.libzip.delete(this.zip,t)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip))}resolveFilename(e,t,i=!0,n=!0){if(!this.ready)throw OE(`archive closed, ${e}`);let s=k.resolve(Me.root,t);if(s==="/")return Me.root;let o=this.entries.get(s);if(i&&o!==void 0)if(this.symlinkCount!==0&&this.isSymbolicLink(o)){let a=this.getFileSource(o).toString();return this.resolveFilename(e,k.resolve(k.dirname(s),a),!0,n)}else return s;for(;;){let a=this.resolveFilename(e,k.dirname(s),!0,n);if(a===void 0)return a;let l=this.listings.has(a),c=this.entries.has(a);if(!l&&!c){if(n===!1)return;throw io(e)}if(!l)throw Ro(e);if(s=k.resolve(a,k.basename(s)),!i||this.symlinkCount===0)break;let u=this.libzip.name.locate(this.zip,s.slice(1));if(u===-1)break;if(this.isSymbolicLink(u)){let g=this.getFileSource(u).toString();s=k.resolve(k.dirname(s),g)}else break}return s}allocateBuffer(e){Buffer.isBuffer(e)||(e=Buffer.from(e));let t=this.libzip.malloc(e.byteLength);if(!t)throw new Error("Couldn't allocate enough memory");return new Uint8Array(this.libzip.HEAPU8.buffer,t,e.byteLength).set(e),{buffer:t,byteLength:e.byteLength}}allocateUnattachedSource(e){let t=this.libzip.struct.errorS(),{buffer:i,byteLength:n}=this.allocateBuffer(e),s=this.libzip.source.fromUnattachedBuffer(i,n,0,!0,t);if(s===0)throw this.libzip.free(t),this.makeLibzipError(t);return s}allocateSource(e){let{buffer:t,byteLength:i}=this.allocateBuffer(e),n=this.libzip.source.fromBuffer(this.zip,t,i,0,!0);if(n===0)throw this.libzip.free(t),this.makeLibzipError(this.libzip.getError(this.zip));return n}setFileSource(e,t){let i=Buffer.isBuffer(t)?t:Buffer.from(t),n=k.relative(Me.root,e),s=this.allocateSource(t);try{let o=this.libzip.file.add(this.zip,n,s,this.libzip.ZIP_FL_OVERWRITE);if(o===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));if(this.level!=="mixed"){let a=this.level===0?this.libzip.ZIP_CM_STORE:this.libzip.ZIP_CM_DEFLATE;if(this.libzip.file.setCompression(this.zip,o,0,a,this.level)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip))}return this.fileSources.set(o,i),o}catch(o){throw this.libzip.source.free(s),o}}isSymbolicLink(e){if(this.symlinkCount===0)return!1;if(this.libzip.file.getExternalAttributes(this.zip,e,0,0,this.libzip.uint08S,this.libzip.uint32S)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));return this.libzip.getValue(this.libzip.uint08S,"i8")>>>0!==this.libzip.ZIP_OPSYS_UNIX?!1:(this.libzip.getValue(this.libzip.uint32S,"i32")>>>16&_n)===Fa}getFileSource(e,t={asyncDecompress:!1}){let i=this.fileSources.get(e);if(typeof i!="undefined")return i;let n=this.libzip.struct.statS();if(this.libzip.statIndex(this.zip,e,0,0,n)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));let o=this.libzip.struct.statCompSize(n),a=this.libzip.struct.statCompMethod(n),l=this.libzip.malloc(o);try{let c=this.libzip.fopenIndex(this.zip,e,0,this.libzip.ZIP_FL_COMPRESSED);if(c===0)throw this.makeLibzipError(this.libzip.getError(this.zip));try{let u=this.libzip.fread(c,l,o,0);if(u===-1)throw this.makeLibzipError(this.libzip.file.getError(c));if(uo)throw new Error("Overread");let g=this.libzip.HEAPU8.subarray(l,l+o),f=Buffer.from(g);if(a===0)return this.fileSources.set(e,f),f;if(t.asyncDecompress)return new Promise((h,p)=>{uQ.default.inflateRaw(f,(m,y)=>{m?p(m):(this.fileSources.set(e,y),h(y))})});{let h=uQ.default.inflateRawSync(f);return this.fileSources.set(e,h),h}}finally{this.libzip.fclose(c)}}finally{this.libzip.free(l)}}async fchmodPromise(e,t){return this.chmodPromise(this.fdToPath(e,"fchmod"),t)}fchmodSync(e,t){return this.chmodSync(this.fdToPath(e,"fchmodSync"),t)}async chmodPromise(e,t){return this.chmodSync(e,t)}chmodSync(e,t){if(this.readOnly)throw In(`chmod '${e}'`);t&=493;let i=this.resolveFilename(`chmod '${e}'`,e,!1),n=this.entries.get(i);if(typeof n=="undefined")throw new Error(`Assertion failed: The entry should have been registered (${i})`);let o=this.getUnixMode(n,Ra|0)&~511|t;if(this.libzip.file.setExternalAttributes(this.zip,n,0,0,this.libzip.ZIP_OPSYS_UNIX,o<<16)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip))}async chownPromise(e,t,i){return this.chownSync(e,t,i)}chownSync(e,t,i){throw new Error("Unimplemented")}async renamePromise(e,t){return this.renameSync(e,t)}renameSync(e,t){throw new Error("Unimplemented")}async copyFilePromise(e,t,i){let{indexSource:n,indexDest:s,resolvedDestP:o}=this.prepareCopyFile(e,t,i),a=await this.getFileSource(n,{asyncDecompress:!0}),l=this.setFileSource(o,a);l!==s&&this.registerEntry(o,l)}copyFileSync(e,t,i=0){let{indexSource:n,indexDest:s,resolvedDestP:o}=this.prepareCopyFile(e,t,i),a=this.getFileSource(n),l=this.setFileSource(o,a);l!==s&&this.registerEntry(o,l)}prepareCopyFile(e,t,i=0){if(this.readOnly)throw In(`copyfile '${e} -> '${t}'`);if((i&zu.constants.COPYFILE_FICLONE_FORCE)!=0)throw Yh("unsupported clone operation",`copyfile '${e}' -> ${t}'`);let n=this.resolveFilename(`copyfile '${e} -> ${t}'`,e),s=this.entries.get(n);if(typeof s=="undefined")throw GA(`copyfile '${e}' -> '${t}'`);let o=this.resolveFilename(`copyfile '${e}' -> ${t}'`,t),a=this.entries.get(o);if((i&(zu.constants.COPYFILE_EXCL|zu.constants.COPYFILE_FICLONE_FORCE))!=0&&typeof a!="undefined")throw ME(`copyfile '${e}' -> '${t}'`);return{indexSource:s,resolvedDestP:o,indexDest:a}}async appendFilePromise(e,t,i){if(this.readOnly)throw In(`open '${e}'`);return typeof i=="undefined"?i={flag:"a"}:typeof i=="string"?i={flag:"a",encoding:i}:typeof i.flag=="undefined"&&(i=N({flag:"a"},i)),this.writeFilePromise(e,t,i)}appendFileSync(e,t,i={}){if(this.readOnly)throw In(`open '${e}'`);return typeof i=="undefined"?i={flag:"a"}:typeof i=="string"?i={flag:"a",encoding:i}:typeof i.flag=="undefined"&&(i=N({flag:"a"},i)),this.writeFileSync(e,t,i)}fdToPath(e,t){var n;let i=(n=this.fds.get(e))==null?void 0:n.p;if(typeof i=="undefined")throw Ai(t);return i}async writeFilePromise(e,t,i){let{encoding:n,mode:s,index:o,resolvedP:a}=this.prepareWriteFile(e,i);o!==void 0&&typeof i=="object"&&i.flag&&i.flag.includes("a")&&(t=Buffer.concat([await this.getFileSource(o,{asyncDecompress:!0}),Buffer.from(t)])),n!==null&&(t=t.toString(n));let l=this.setFileSource(a,t);l!==o&&this.registerEntry(a,l),s!==null&&await this.chmodPromise(a,s)}writeFileSync(e,t,i){let{encoding:n,mode:s,index:o,resolvedP:a}=this.prepareWriteFile(e,i);o!==void 0&&typeof i=="object"&&i.flag&&i.flag.includes("a")&&(t=Buffer.concat([this.getFileSource(o),Buffer.from(t)])),n!==null&&(t=t.toString(n));let l=this.setFileSource(a,t);l!==o&&this.registerEntry(a,l),s!==null&&this.chmodSync(a,s)}prepareWriteFile(e,t){if(typeof e=="number"&&(e=this.fdToPath(e,"read")),this.readOnly)throw In(`open '${e}'`);let i=this.resolveFilename(`open '${e}'`,e);if(this.listings.has(i))throw qh(`open '${e}'`);let n=null,s=null;typeof t=="string"?n=t:typeof t=="object"&&({encoding:n=null,mode:s=null}=t);let o=this.entries.get(i);return{encoding:n,mode:s,resolvedP:i,index:o}}async unlinkPromise(e){return this.unlinkSync(e)}unlinkSync(e){if(this.readOnly)throw In(`unlink '${e}'`);let t=this.resolveFilename(`unlink '${e}'`,e);if(this.listings.has(t))throw qh(`unlink '${e}'`);let i=this.entries.get(t);if(typeof i=="undefined")throw GA(`unlink '${e}'`);this.deleteEntry(t,i)}async utimesPromise(e,t,i){return this.utimesSync(e,t,i)}utimesSync(e,t,i){if(this.readOnly)throw In(`utimes '${e}'`);let n=this.resolveFilename(`utimes '${e}'`,e);this.utimesImpl(n,i)}async lutimesPromise(e,t,i){return this.lutimesSync(e,t,i)}lutimesSync(e,t,i){if(this.readOnly)throw In(`lutimes '${e}'`);let n=this.resolveFilename(`utimes '${e}'`,e,!1);this.utimesImpl(n,i)}utimesImpl(e,t){this.listings.has(e)&&(this.entries.has(e)||this.hydrateDirectory(e));let i=this.entries.get(e);if(i===void 0)throw new Error("Unreachable");if(this.libzip.file.setMtime(this.zip,i,0,bge(t),0)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip))}async mkdirPromise(e,t){return this.mkdirSync(e,t)}mkdirSync(e,{mode:t=493,recursive:i=!1}={}){if(i)return this.mkdirpSync(e,{chmod:t});if(this.readOnly)throw In(`mkdir '${e}'`);let n=this.resolveFilename(`mkdir '${e}'`,e);if(this.entries.has(n)||this.listings.has(n))throw ME(`mkdir '${e}'`);this.hydrateDirectory(n),this.chmodSync(n,t)}async rmdirPromise(e,t){return this.rmdirSync(e,t)}rmdirSync(e,{recursive:t=!1}={}){if(this.readOnly)throw In(`rmdir '${e}'`);if(t){this.removeSync(e);return}let i=this.resolveFilename(`rmdir '${e}'`,e),n=this.listings.get(i);if(!n)throw Ro(`rmdir '${e}'`);if(n.size>0)throw YO(`rmdir '${e}'`);let s=this.entries.get(i);if(typeof s=="undefined")throw GA(`rmdir '${e}'`);this.deleteEntry(e,s)}hydrateDirectory(e){let t=this.libzip.dir.add(this.zip,k.relative(Me.root,e));if(t===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));return this.registerListing(e),this.registerEntry(e,t),t}async linkPromise(e,t){return this.linkSync(e,t)}linkSync(e,t){throw qO(`link '${e}' -> '${t}'`)}async symlinkPromise(e,t){return this.symlinkSync(e,t)}symlinkSync(e,t){if(this.readOnly)throw In(`symlink '${e}' -> '${t}'`);let i=this.resolveFilename(`symlink '${e}' -> '${t}'`,t);if(this.listings.has(i))throw qh(`symlink '${e}' -> '${t}'`);if(this.entries.has(i))throw ME(`symlink '${e}' -> '${t}'`);let n=this.setFileSource(i,e);if(this.registerEntry(i,n),this.libzip.file.setExternalAttributes(this.zip,n,0,0,this.libzip.ZIP_OPSYS_UNIX,(Fa|511)<<16)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));this.symlinkCount+=1}async readFilePromise(e,t){typeof t=="object"&&(t=t?t.encoding:void 0);let i=await this.readFileBuffer(e,{asyncDecompress:!0});return t?i.toString(t):i}readFileSync(e,t){typeof t=="object"&&(t=t?t.encoding:void 0);let i=this.readFileBuffer(e);return t?i.toString(t):i}readFileBuffer(e,t={asyncDecompress:!1}){typeof e=="number"&&(e=this.fdToPath(e,"read"));let i=this.resolveFilename(`open '${e}'`,e);if(!this.entries.has(i)&&!this.listings.has(i))throw io(`open '${e}'`);if(e[e.length-1]==="/"&&!this.listings.has(i))throw Ro(`open '${e}'`);if(this.listings.has(i))throw qh("read");let n=this.entries.get(i);if(n===void 0)throw new Error("Unreachable");return this.getFileSource(n,t)}async readdirPromise(e,t){return this.readdirSync(e,t)}readdirSync(e,t){let i=this.resolveFilename(`scandir '${e}'`,e);if(!this.entries.has(i)&&!this.listings.has(i))throw io(`scandir '${e}'`);let n=this.listings.get(i);if(!n)throw Ro(`scandir '${e}'`);let s=[...n];return(t==null?void 0:t.withFileTypes)?s.map(o=>Object.assign(this.statImpl("lstat",k.join(e,o)),{name:o})):s}async readlinkPromise(e){let t=this.prepareReadlink(e);return(await this.getFileSource(t,{asyncDecompress:!0})).toString()}readlinkSync(e){let t=this.prepareReadlink(e);return this.getFileSource(t).toString()}prepareReadlink(e){let t=this.resolveFilename(`readlink '${e}'`,e,!1);if(!this.entries.has(t)&&!this.listings.has(t))throw io(`readlink '${e}'`);if(e[e.length-1]==="/"&&!this.listings.has(t))throw Ro(`open '${e}'`);if(this.listings.has(t))throw GA(`readlink '${e}'`);let i=this.entries.get(t);if(i===void 0)throw new Error("Unreachable");if(!this.isSymbolicLink(i))throw GA(`readlink '${e}'`);return i}async truncatePromise(e,t=0){let i=this.resolveFilename(`open '${e}'`,e),n=this.entries.get(i);if(typeof n=="undefined")throw GA(`open '${e}'`);let s=await this.getFileSource(n,{asyncDecompress:!0}),o=Buffer.alloc(t,0);return s.copy(o),await this.writeFilePromise(e,o)}truncateSync(e,t=0){let i=this.resolveFilename(`open '${e}'`,e),n=this.entries.get(i);if(typeof n=="undefined")throw GA(`open '${e}'`);let s=this.getFileSource(n),o=Buffer.alloc(t,0);return s.copy(o),this.writeFileSync(e,o)}async ftruncatePromise(e,t){return this.truncatePromise(this.fdToPath(e,"ftruncate"),t)}ftruncateSync(e,t){return this.truncateSync(this.fdToPath(e,"ftruncateSync"),t)}watch(e,t,i){let n;switch(typeof t){case"function":case"string":case"undefined":n=!0;break;default:({persistent:n=!0}=t);break}if(!n)return{on:()=>{},close:()=>{}};let s=setInterval(()=>{},24*60*60*1e3);return{on:()=>{},close:()=>{clearInterval(s)}}}watchFile(e,t,i){let n=k.resolve(Me.root,e);return HE(this,n,t,i)}unwatchFile(e,t){let i=k.resolve(Me.root,e);return Wh(this,i,t)}};var Qi=class extends YA{getExtractHint(e){return this.baseFs.getExtractHint(e)}resolve(e){return this.mapFromBase(this.baseFs.resolve(this.mapToBase(e)))}getRealPath(){return this.mapFromBase(this.baseFs.getRealPath())}async openPromise(e,t,i){return this.baseFs.openPromise(this.mapToBase(e),t,i)}openSync(e,t,i){return this.baseFs.openSync(this.mapToBase(e),t,i)}async opendirPromise(e,t){return Object.assign(await this.baseFs.opendirPromise(this.mapToBase(e),t),{path:e})}opendirSync(e,t){return Object.assign(this.baseFs.opendirSync(this.mapToBase(e),t),{path:e})}async readPromise(e,t,i,n,s){return await this.baseFs.readPromise(e,t,i,n,s)}readSync(e,t,i,n,s){return this.baseFs.readSync(e,t,i,n,s)}async writePromise(e,t,i,n,s){return typeof t=="string"?await this.baseFs.writePromise(e,t,i):await this.baseFs.writePromise(e,t,i,n,s)}writeSync(e,t,i,n,s){return typeof t=="string"?this.baseFs.writeSync(e,t,i):this.baseFs.writeSync(e,t,i,n,s)}async closePromise(e){return this.baseFs.closePromise(e)}closeSync(e){this.baseFs.closeSync(e)}createReadStream(e,t){return this.baseFs.createReadStream(e!==null?this.mapToBase(e):e,t)}createWriteStream(e,t){return this.baseFs.createWriteStream(e!==null?this.mapToBase(e):e,t)}async realpathPromise(e){return this.mapFromBase(await this.baseFs.realpathPromise(this.mapToBase(e)))}realpathSync(e){return this.mapFromBase(this.baseFs.realpathSync(this.mapToBase(e)))}async existsPromise(e){return this.baseFs.existsPromise(this.mapToBase(e))}existsSync(e){return this.baseFs.existsSync(this.mapToBase(e))}accessSync(e,t){return this.baseFs.accessSync(this.mapToBase(e),t)}async accessPromise(e,t){return this.baseFs.accessPromise(this.mapToBase(e),t)}async statPromise(e,t){return this.baseFs.statPromise(this.mapToBase(e),t)}statSync(e,t){return this.baseFs.statSync(this.mapToBase(e),t)}async fstatPromise(e,t){return this.baseFs.fstatPromise(e,t)}fstatSync(e,t){return this.baseFs.fstatSync(e,t)}lstatPromise(e,t){return this.baseFs.lstatPromise(this.mapToBase(e),t)}lstatSync(e,t){return this.baseFs.lstatSync(this.mapToBase(e),t)}async fchmodPromise(e,t){return this.baseFs.fchmodPromise(e,t)}fchmodSync(e,t){return this.baseFs.fchmodSync(e,t)}async chmodPromise(e,t){return this.baseFs.chmodPromise(this.mapToBase(e),t)}chmodSync(e,t){return this.baseFs.chmodSync(this.mapToBase(e),t)}async chownPromise(e,t,i){return this.baseFs.chownPromise(this.mapToBase(e),t,i)}chownSync(e,t,i){return this.baseFs.chownSync(this.mapToBase(e),t,i)}async renamePromise(e,t){return this.baseFs.renamePromise(this.mapToBase(e),this.mapToBase(t))}renameSync(e,t){return this.baseFs.renameSync(this.mapToBase(e),this.mapToBase(t))}async copyFilePromise(e,t,i=0){return this.baseFs.copyFilePromise(this.mapToBase(e),this.mapToBase(t),i)}copyFileSync(e,t,i=0){return this.baseFs.copyFileSync(this.mapToBase(e),this.mapToBase(t),i)}async appendFilePromise(e,t,i){return this.baseFs.appendFilePromise(this.fsMapToBase(e),t,i)}appendFileSync(e,t,i){return this.baseFs.appendFileSync(this.fsMapToBase(e),t,i)}async writeFilePromise(e,t,i){return this.baseFs.writeFilePromise(this.fsMapToBase(e),t,i)}writeFileSync(e,t,i){return this.baseFs.writeFileSync(this.fsMapToBase(e),t,i)}async unlinkPromise(e){return this.baseFs.unlinkPromise(this.mapToBase(e))}unlinkSync(e){return this.baseFs.unlinkSync(this.mapToBase(e))}async utimesPromise(e,t,i){return this.baseFs.utimesPromise(this.mapToBase(e),t,i)}utimesSync(e,t,i){return this.baseFs.utimesSync(this.mapToBase(e),t,i)}async mkdirPromise(e,t){return this.baseFs.mkdirPromise(this.mapToBase(e),t)}mkdirSync(e,t){return this.baseFs.mkdirSync(this.mapToBase(e),t)}async rmdirPromise(e,t){return this.baseFs.rmdirPromise(this.mapToBase(e),t)}rmdirSync(e,t){return this.baseFs.rmdirSync(this.mapToBase(e),t)}async linkPromise(e,t){return this.baseFs.linkPromise(this.mapToBase(e),this.mapToBase(t))}linkSync(e,t){return this.baseFs.linkSync(this.mapToBase(e),this.mapToBase(t))}async symlinkPromise(e,t,i){let n=this.mapToBase(t);if(this.pathUtils.isAbsolute(e))return this.baseFs.symlinkPromise(this.mapToBase(e),n,i);let s=this.mapToBase(this.pathUtils.join(this.pathUtils.dirname(t),e)),o=this.baseFs.pathUtils.relative(this.baseFs.pathUtils.dirname(n),s);return this.baseFs.symlinkPromise(o,n,i)}symlinkSync(e,t,i){let n=this.mapToBase(t);if(this.pathUtils.isAbsolute(e))return this.baseFs.symlinkSync(this.mapToBase(e),n,i);let s=this.mapToBase(this.pathUtils.join(this.pathUtils.dirname(t),e)),o=this.baseFs.pathUtils.relative(this.baseFs.pathUtils.dirname(n),s);return this.baseFs.symlinkSync(o,n,i)}async readFilePromise(e,t){return t==="utf8"?this.baseFs.readFilePromise(this.fsMapToBase(e),t):this.baseFs.readFilePromise(this.fsMapToBase(e),t)}readFileSync(e,t){return t==="utf8"?this.baseFs.readFileSync(this.fsMapToBase(e),t):this.baseFs.readFileSync(this.fsMapToBase(e),t)}async readdirPromise(e,t){return this.baseFs.readdirPromise(this.mapToBase(e),t)}readdirSync(e,t){return this.baseFs.readdirSync(this.mapToBase(e),t)}async readlinkPromise(e){return this.mapFromBase(await this.baseFs.readlinkPromise(this.mapToBase(e)))}readlinkSync(e){return this.mapFromBase(this.baseFs.readlinkSync(this.mapToBase(e)))}async truncatePromise(e,t){return this.baseFs.truncatePromise(this.mapToBase(e),t)}truncateSync(e,t){return this.baseFs.truncateSync(this.mapToBase(e),t)}async ftruncatePromise(e,t){return this.baseFs.ftruncatePromise(e,t)}ftruncateSync(e,t){return this.baseFs.ftruncateSync(e,t)}watch(e,t,i){return this.baseFs.watch(this.mapToBase(e),t,i)}watchFile(e,t,i){return this.baseFs.watchFile(this.mapToBase(e),t,i)}unwatchFile(e,t){return this.baseFs.unwatchFile(this.mapToBase(e),t)}fsMapToBase(e){return typeof e=="number"?e:this.mapToBase(e)}};var Na=class extends Qi{constructor(e,{baseFs:t,pathUtils:i}){super(i);this.target=e,this.baseFs=t}getRealPath(){return this.target}getBaseFs(){return this.baseFs}mapFromBase(e){return e}mapToBase(e){return e}};var _t=class extends Qi{constructor(e,{baseFs:t=new ar}={}){super(k);this.target=this.pathUtils.normalize(e),this.baseFs=t}getRealPath(){return this.pathUtils.resolve(this.baseFs.getRealPath(),this.target)}resolve(e){return this.pathUtils.isAbsolute(e)?k.normalize(e):this.baseFs.resolve(k.join(this.target,e))}mapFromBase(e){return e}mapToBase(e){return this.pathUtils.isAbsolute(e)?e:this.pathUtils.join(this.target,e)}};var eM=Me.root,La=class extends Qi{constructor(e,{baseFs:t=new ar}={}){super(k);this.target=this.pathUtils.resolve(Me.root,e),this.baseFs=t}getRealPath(){return this.pathUtils.resolve(this.baseFs.getRealPath(),this.pathUtils.relative(Me.root,this.target))}getTarget(){return this.target}getBaseFs(){return this.baseFs}mapToBase(e){let t=this.pathUtils.normalize(e);if(this.pathUtils.isAbsolute(e))return this.pathUtils.resolve(this.target,this.pathUtils.relative(eM,e));if(t.match(/^\.\.\/?/))throw new Error(`Resolving this path (${e}) would escape the jail`);return this.pathUtils.resolve(this.target,e)}mapFromBase(e){return this.pathUtils.resolve(eM,this.pathUtils.relative(this.target,e))}};var _h=class extends Qi{constructor(e,t){super(t);this.instance=null;this.factory=e}get baseFs(){return this.instance||(this.instance=this.factory()),this.instance}set baseFs(e){this.instance=e}mapFromBase(e){return e}mapToBase(e){return e}};var et=()=>Object.assign(new Error("ENOSYS: unsupported filesystem access"),{code:"ENOSYS"}),gQ=class extends YA{constructor(){super(k)}getExtractHint(){throw et()}getRealPath(){throw et()}resolve(){throw et()}async openPromise(){throw et()}openSync(){throw et()}async opendirPromise(){throw et()}opendirSync(){throw et()}async readPromise(){throw et()}readSync(){throw et()}async writePromise(){throw et()}writeSync(){throw et()}async closePromise(){throw et()}closeSync(){throw et()}createWriteStream(){throw et()}createReadStream(){throw et()}async realpathPromise(){throw et()}realpathSync(){throw et()}async readdirPromise(){throw et()}readdirSync(){throw et()}async existsPromise(e){throw et()}existsSync(e){throw et()}async accessPromise(){throw et()}accessSync(){throw et()}async statPromise(){throw et()}statSync(){throw et()}async fstatPromise(e){throw et()}fstatSync(e){throw et()}async lstatPromise(e){throw et()}lstatSync(e){throw et()}async fchmodPromise(){throw et()}fchmodSync(){throw et()}async chmodPromise(){throw et()}chmodSync(){throw et()}async chownPromise(){throw et()}chownSync(){throw et()}async mkdirPromise(){throw et()}mkdirSync(){throw et()}async rmdirPromise(){throw et()}rmdirSync(){throw et()}async linkPromise(){throw et()}linkSync(){throw et()}async symlinkPromise(){throw et()}symlinkSync(){throw et()}async renamePromise(){throw et()}renameSync(){throw et()}async copyFilePromise(){throw et()}copyFileSync(){throw et()}async appendFilePromise(){throw et()}appendFileSync(){throw et()}async writeFilePromise(){throw et()}writeFileSync(){throw et()}async unlinkPromise(){throw et()}unlinkSync(){throw et()}async utimesPromise(){throw et()}utimesSync(){throw et()}async readFilePromise(){throw et()}readFileSync(){throw et()}async readlinkPromise(){throw et()}readlinkSync(){throw et()}async truncatePromise(){throw et()}truncateSync(){throw et()}async ftruncatePromise(e,t){throw et()}ftruncateSync(e,t){throw et()}watch(){throw et()}watchFile(){throw et()}unwatchFile(){throw et()}},jE=gQ;jE.instance=new gQ;var Vh=class extends Qi{constructor(e){super(H);this.baseFs=e}mapFromBase(e){return H.fromPortablePath(e)}mapToBase(e){return H.toPortablePath(e)}};var Qge=/^[0-9]+$/,fQ=/^(\/(?:[^/]+\/)*?(?:\$\$virtual|__virtual__))((?:\/((?:[^/]+-)?[a-f0-9]+)(?:\/([^/]+))?)?((?:\/.*)?))$/,Sge=/^([^/]+-)?[a-f0-9]+$/,Wr=class extends Qi{static makeVirtualPath(e,t,i){if(k.basename(e)!=="__virtual__")throw new Error('Assertion failed: Virtual folders must be named "__virtual__"');if(!k.basename(t).match(Sge))throw new Error("Assertion failed: Virtual components must be ended by an hexadecimal hash");let s=k.relative(k.dirname(e),i).split("/"),o=0;for(;o{let t=r.indexOf(e);if(t<=0)return null;let i=t;for(;t>=0&&(i=t+e.length,r[i]!==k.sep);){if(r[t-1]===k.sep)return null;t=r.indexOf(e,i)}return r.length>i&&r[i]!==k.sep?null:r.slice(0,i)},Is=class extends oc{constructor({libzip:e,baseFs:t=new ar,filter:i=null,maxOpenFiles:n=Infinity,readOnlyArchives:s=!1,useCache:o=!0,maxAge:a=5e3,fileExtensions:l=null}){super();this.fdMap=new Map;this.nextFd=3;this.isZip=new Set;this.notZip=new Set;this.realPaths=new Map;this.limitOpenFilesTimeout=null;this.libzipFactory=typeof e!="function"?()=>e:e,this.baseFs=t,this.zipInstances=o?new Map:null,this.filter=i,this.maxOpenFiles=n,this.readOnlyArchives=s,this.maxAge=a,this.fileExtensions=l}static async openPromise(e,t){let i=new Is(t);try{return await e(i)}finally{i.saveAndClose()}}get libzip(){return typeof this.libzipInstance=="undefined"&&(this.libzipInstance=this.libzipFactory()),this.libzipInstance}getExtractHint(e){return this.baseFs.getExtractHint(e)}getRealPath(){return this.baseFs.getRealPath()}saveAndClose(){if(zh(this),this.zipInstances)for(let[e,{zipFs:t}]of this.zipInstances.entries())t.saveAndClose(),this.zipInstances.delete(e)}discardAndClose(){if(zh(this),this.zipInstances)for(let[e,{zipFs:t}]of this.zipInstances.entries())t.discardAndClose(),this.zipInstances.delete(e)}resolve(e){return this.baseFs.resolve(e)}remapFd(e,t){let i=this.nextFd++|Vn;return this.fdMap.set(i,[e,t]),i}async openPromise(e,t,i){return await this.makeCallPromise(e,async()=>await this.baseFs.openPromise(e,t,i),async(n,{subPath:s})=>this.remapFd(n,await n.openPromise(s,t,i)))}openSync(e,t,i){return this.makeCallSync(e,()=>this.baseFs.openSync(e,t,i),(n,{subPath:s})=>this.remapFd(n,n.openSync(s,t,i)))}async opendirPromise(e,t){return await this.makeCallPromise(e,async()=>await this.baseFs.opendirPromise(e,t),async(i,{subPath:n})=>await i.opendirPromise(n,t),{requireSubpath:!1})}opendirSync(e,t){return this.makeCallSync(e,()=>this.baseFs.opendirSync(e,t),(i,{subPath:n})=>i.opendirSync(n,t),{requireSubpath:!1})}async readPromise(e,t,i,n,s){if((e&Vn)==0)return await this.baseFs.readPromise(e,t,i,n,s);let o=this.fdMap.get(e);if(typeof o=="undefined")throw Ai("read");let[a,l]=o;return await a.readPromise(l,t,i,n,s)}readSync(e,t,i,n,s){if((e&Vn)==0)return this.baseFs.readSync(e,t,i,n,s);let o=this.fdMap.get(e);if(typeof o=="undefined")throw Ai("readSync");let[a,l]=o;return a.readSync(l,t,i,n,s)}async writePromise(e,t,i,n,s){if((e&Vn)==0)return typeof t=="string"?await this.baseFs.writePromise(e,t,i):await this.baseFs.writePromise(e,t,i,n,s);let o=this.fdMap.get(e);if(typeof o=="undefined")throw Ai("write");let[a,l]=o;return typeof t=="string"?await a.writePromise(l,t,i):await a.writePromise(l,t,i,n,s)}writeSync(e,t,i,n,s){if((e&Vn)==0)return typeof t=="string"?this.baseFs.writeSync(e,t,i):this.baseFs.writeSync(e,t,i,n,s);let o=this.fdMap.get(e);if(typeof o=="undefined")throw Ai("writeSync");let[a,l]=o;return typeof t=="string"?a.writeSync(l,t,i):a.writeSync(l,t,i,n,s)}async closePromise(e){if((e&Vn)==0)return await this.baseFs.closePromise(e);let t=this.fdMap.get(e);if(typeof t=="undefined")throw Ai("close");this.fdMap.delete(e);let[i,n]=t;return await i.closePromise(n)}closeSync(e){if((e&Vn)==0)return this.baseFs.closeSync(e);let t=this.fdMap.get(e);if(typeof t=="undefined")throw Ai("closeSync");this.fdMap.delete(e);let[i,n]=t;return i.closeSync(n)}createReadStream(e,t){return e===null?this.baseFs.createReadStream(e,t):this.makeCallSync(e,()=>this.baseFs.createReadStream(e,t),(i,{archivePath:n,subPath:s})=>{let o=i.createReadStream(s,t);return o.path=H.fromPortablePath(this.pathUtils.join(n,s)),o})}createWriteStream(e,t){return e===null?this.baseFs.createWriteStream(e,t):this.makeCallSync(e,()=>this.baseFs.createWriteStream(e,t),(i,{subPath:n})=>i.createWriteStream(n,t))}async realpathPromise(e){return await this.makeCallPromise(e,async()=>await this.baseFs.realpathPromise(e),async(t,{archivePath:i,subPath:n})=>{let s=this.realPaths.get(i);return typeof s=="undefined"&&(s=await this.baseFs.realpathPromise(i),this.realPaths.set(i,s)),this.pathUtils.join(s,this.pathUtils.relative(Me.root,await t.realpathPromise(n)))})}realpathSync(e){return this.makeCallSync(e,()=>this.baseFs.realpathSync(e),(t,{archivePath:i,subPath:n})=>{let s=this.realPaths.get(i);return typeof s=="undefined"&&(s=this.baseFs.realpathSync(i),this.realPaths.set(i,s)),this.pathUtils.join(s,this.pathUtils.relative(Me.root,t.realpathSync(n)))})}async existsPromise(e){return await this.makeCallPromise(e,async()=>await this.baseFs.existsPromise(e),async(t,{subPath:i})=>await t.existsPromise(i))}existsSync(e){return this.makeCallSync(e,()=>this.baseFs.existsSync(e),(t,{subPath:i})=>t.existsSync(i))}async accessPromise(e,t){return await this.makeCallPromise(e,async()=>await this.baseFs.accessPromise(e,t),async(i,{subPath:n})=>await i.accessPromise(n,t))}accessSync(e,t){return this.makeCallSync(e,()=>this.baseFs.accessSync(e,t),(i,{subPath:n})=>i.accessSync(n,t))}async statPromise(e,t){return await this.makeCallPromise(e,async()=>await this.baseFs.statPromise(e,t),async(i,{subPath:n})=>await i.statPromise(n,t))}statSync(e,t){return this.makeCallSync(e,()=>this.baseFs.statSync(e,t),(i,{subPath:n})=>i.statSync(n,t))}async fstatPromise(e,t){if((e&Vn)==0)return this.baseFs.fstatPromise(e,t);let i=this.fdMap.get(e);if(typeof i=="undefined")throw Ai("fstat");let[n,s]=i;return n.fstatPromise(s,t)}fstatSync(e,t){if((e&Vn)==0)return this.baseFs.fstatSync(e,t);let i=this.fdMap.get(e);if(typeof i=="undefined")throw Ai("fstatSync");let[n,s]=i;return n.fstatSync(s,t)}async lstatPromise(e,t){return await this.makeCallPromise(e,async()=>await this.baseFs.lstatPromise(e,t),async(i,{subPath:n})=>await i.lstatPromise(n,t))}lstatSync(e,t){return this.makeCallSync(e,()=>this.baseFs.lstatSync(e,t),(i,{subPath:n})=>i.lstatSync(n,t))}async fchmodPromise(e,t){if((e&Vn)==0)return this.baseFs.fchmodPromise(e,t);let i=this.fdMap.get(e);if(typeof i=="undefined")throw Ai("fchmod");let[n,s]=i;return n.fchmodPromise(s,t)}fchmodSync(e,t){if((e&Vn)==0)return this.baseFs.fchmodSync(e,t);let i=this.fdMap.get(e);if(typeof i=="undefined")throw Ai("fchmodSync");let[n,s]=i;return n.fchmodSync(s,t)}async chmodPromise(e,t){return await this.makeCallPromise(e,async()=>await this.baseFs.chmodPromise(e,t),async(i,{subPath:n})=>await i.chmodPromise(n,t))}chmodSync(e,t){return this.makeCallSync(e,()=>this.baseFs.chmodSync(e,t),(i,{subPath:n})=>i.chmodSync(n,t))}async chownPromise(e,t,i){return await this.makeCallPromise(e,async()=>await this.baseFs.chownPromise(e,t,i),async(n,{subPath:s})=>await n.chownPromise(s,t,i))}chownSync(e,t,i){return this.makeCallSync(e,()=>this.baseFs.chownSync(e,t,i),(n,{subPath:s})=>n.chownSync(s,t,i))}async renamePromise(e,t){return await this.makeCallPromise(e,async()=>await this.makeCallPromise(t,async()=>await this.baseFs.renamePromise(e,t),async()=>{throw Object.assign(new Error("EEXDEV: cross-device link not permitted"),{code:"EEXDEV"})}),async(i,{subPath:n})=>await this.makeCallPromise(t,async()=>{throw Object.assign(new Error("EEXDEV: cross-device link not permitted"),{code:"EEXDEV"})},async(s,{subPath:o})=>{if(i!==s)throw Object.assign(new Error("EEXDEV: cross-device link not permitted"),{code:"EEXDEV"});return await i.renamePromise(n,o)}))}renameSync(e,t){return this.makeCallSync(e,()=>this.makeCallSync(t,()=>this.baseFs.renameSync(e,t),()=>{throw Object.assign(new Error("EEXDEV: cross-device link not permitted"),{code:"EEXDEV"})}),(i,{subPath:n})=>this.makeCallSync(t,()=>{throw Object.assign(new Error("EEXDEV: cross-device link not permitted"),{code:"EEXDEV"})},(s,{subPath:o})=>{if(i!==s)throw Object.assign(new Error("EEXDEV: cross-device link not permitted"),{code:"EEXDEV"});return i.renameSync(n,o)}))}async copyFilePromise(e,t,i=0){let n=async(s,o,a,l)=>{if((i&Xh.constants.COPYFILE_FICLONE_FORCE)!=0)throw Object.assign(new Error(`EXDEV: cross-device clone not permitted, copyfile '${o}' -> ${l}'`),{code:"EXDEV"});if(i&Xh.constants.COPYFILE_EXCL&&await this.existsPromise(o))throw Object.assign(new Error(`EEXIST: file already exists, copyfile '${o}' -> '${l}'`),{code:"EEXIST"});let c;try{c=await s.readFilePromise(o)}catch(u){throw Object.assign(new Error(`EINVAL: invalid argument, copyfile '${o}' -> '${l}'`),{code:"EINVAL"})}await a.writeFilePromise(l,c)};return await this.makeCallPromise(e,async()=>await this.makeCallPromise(t,async()=>await this.baseFs.copyFilePromise(e,t,i),async(s,{subPath:o})=>await n(this.baseFs,e,s,o)),async(s,{subPath:o})=>await this.makeCallPromise(t,async()=>await n(s,o,this.baseFs,t),async(a,{subPath:l})=>s!==a?await n(s,o,a,l):await s.copyFilePromise(o,l,i)))}copyFileSync(e,t,i=0){let n=(s,o,a,l)=>{if((i&Xh.constants.COPYFILE_FICLONE_FORCE)!=0)throw Object.assign(new Error(`EXDEV: cross-device clone not permitted, copyfile '${o}' -> ${l}'`),{code:"EXDEV"});if(i&Xh.constants.COPYFILE_EXCL&&this.existsSync(o))throw Object.assign(new Error(`EEXIST: file already exists, copyfile '${o}' -> '${l}'`),{code:"EEXIST"});let c;try{c=s.readFileSync(o)}catch(u){throw Object.assign(new Error(`EINVAL: invalid argument, copyfile '${o}' -> '${l}'`),{code:"EINVAL"})}a.writeFileSync(l,c)};return this.makeCallSync(e,()=>this.makeCallSync(t,()=>this.baseFs.copyFileSync(e,t,i),(s,{subPath:o})=>n(this.baseFs,e,s,o)),(s,{subPath:o})=>this.makeCallSync(t,()=>n(s,o,this.baseFs,t),(a,{subPath:l})=>s!==a?n(s,o,a,l):s.copyFileSync(o,l,i)))}async appendFilePromise(e,t,i){return await this.makeCallPromise(e,async()=>await this.baseFs.appendFilePromise(e,t,i),async(n,{subPath:s})=>await n.appendFilePromise(s,t,i))}appendFileSync(e,t,i){return this.makeCallSync(e,()=>this.baseFs.appendFileSync(e,t,i),(n,{subPath:s})=>n.appendFileSync(s,t,i))}async writeFilePromise(e,t,i){return await this.makeCallPromise(e,async()=>await this.baseFs.writeFilePromise(e,t,i),async(n,{subPath:s})=>await n.writeFilePromise(s,t,i))}writeFileSync(e,t,i){return this.makeCallSync(e,()=>this.baseFs.writeFileSync(e,t,i),(n,{subPath:s})=>n.writeFileSync(s,t,i))}async unlinkPromise(e){return await this.makeCallPromise(e,async()=>await this.baseFs.unlinkPromise(e),async(t,{subPath:i})=>await t.unlinkPromise(i))}unlinkSync(e){return this.makeCallSync(e,()=>this.baseFs.unlinkSync(e),(t,{subPath:i})=>t.unlinkSync(i))}async utimesPromise(e,t,i){return await this.makeCallPromise(e,async()=>await this.baseFs.utimesPromise(e,t,i),async(n,{subPath:s})=>await n.utimesPromise(s,t,i))}utimesSync(e,t,i){return this.makeCallSync(e,()=>this.baseFs.utimesSync(e,t,i),(n,{subPath:s})=>n.utimesSync(s,t,i))}async mkdirPromise(e,t){return await this.makeCallPromise(e,async()=>await this.baseFs.mkdirPromise(e,t),async(i,{subPath:n})=>await i.mkdirPromise(n,t))}mkdirSync(e,t){return this.makeCallSync(e,()=>this.baseFs.mkdirSync(e,t),(i,{subPath:n})=>i.mkdirSync(n,t))}async rmdirPromise(e,t){return await this.makeCallPromise(e,async()=>await this.baseFs.rmdirPromise(e,t),async(i,{subPath:n})=>await i.rmdirPromise(n,t))}rmdirSync(e,t){return this.makeCallSync(e,()=>this.baseFs.rmdirSync(e,t),(i,{subPath:n})=>i.rmdirSync(n,t))}async linkPromise(e,t){return await this.makeCallPromise(t,async()=>await this.baseFs.linkPromise(e,t),async(i,{subPath:n})=>await i.linkPromise(e,n))}linkSync(e,t){return this.makeCallSync(t,()=>this.baseFs.linkSync(e,t),(i,{subPath:n})=>i.linkSync(e,n))}async symlinkPromise(e,t,i){return await this.makeCallPromise(t,async()=>await this.baseFs.symlinkPromise(e,t,i),async(n,{subPath:s})=>await n.symlinkPromise(e,s))}symlinkSync(e,t,i){return this.makeCallSync(t,()=>this.baseFs.symlinkSync(e,t,i),(n,{subPath:s})=>n.symlinkSync(e,s))}async readFilePromise(e,t){return this.makeCallPromise(e,async()=>{switch(t){case"utf8":return await this.baseFs.readFilePromise(e,t);default:return await this.baseFs.readFilePromise(e,t)}},async(i,{subPath:n})=>await i.readFilePromise(n,t))}readFileSync(e,t){return this.makeCallSync(e,()=>{switch(t){case"utf8":return this.baseFs.readFileSync(e,t);default:return this.baseFs.readFileSync(e,t)}},(i,{subPath:n})=>i.readFileSync(n,t))}async readdirPromise(e,t){return await this.makeCallPromise(e,async()=>await this.baseFs.readdirPromise(e,t),async(i,{subPath:n})=>await i.readdirPromise(n,t),{requireSubpath:!1})}readdirSync(e,t){return this.makeCallSync(e,()=>this.baseFs.readdirSync(e,t),(i,{subPath:n})=>i.readdirSync(n,t),{requireSubpath:!1})}async readlinkPromise(e){return await this.makeCallPromise(e,async()=>await this.baseFs.readlinkPromise(e),async(t,{subPath:i})=>await t.readlinkPromise(i))}readlinkSync(e){return this.makeCallSync(e,()=>this.baseFs.readlinkSync(e),(t,{subPath:i})=>t.readlinkSync(i))}async truncatePromise(e,t){return await this.makeCallPromise(e,async()=>await this.baseFs.truncatePromise(e,t),async(i,{subPath:n})=>await i.truncatePromise(n,t))}truncateSync(e,t){return this.makeCallSync(e,()=>this.baseFs.truncateSync(e,t),(i,{subPath:n})=>i.truncateSync(n,t))}async ftruncatePromise(e,t){if((e&Vn)==0)return this.baseFs.ftruncatePromise(e,t);let i=this.fdMap.get(e);if(typeof i=="undefined")throw Ai("ftruncate");let[n,s]=i;return n.ftruncatePromise(s,t)}ftruncateSync(e,t){if((e&Vn)==0)return this.baseFs.ftruncateSync(e,t);let i=this.fdMap.get(e);if(typeof i=="undefined")throw Ai("ftruncateSync");let[n,s]=i;return n.ftruncateSync(s,t)}watch(e,t,i){return this.makeCallSync(e,()=>this.baseFs.watch(e,t,i),(n,{subPath:s})=>n.watch(s,t,i))}watchFile(e,t,i){return this.makeCallSync(e,()=>this.baseFs.watchFile(e,t,i),()=>HE(this,e,t,i))}unwatchFile(e,t){return this.makeCallSync(e,()=>this.baseFs.unwatchFile(e,t),()=>Wh(this,e,t))}async makeCallPromise(e,t,i,{requireSubpath:n=!0}={}){if(typeof e!="string")return await t();let s=this.resolve(e),o=this.findZip(s);return o?n&&o.subPath==="/"?await t():await this.getZipPromise(o.archivePath,async a=>await i(a,o)):await t()}makeCallSync(e,t,i,{requireSubpath:n=!0}={}){if(typeof e!="string")return t();let s=this.resolve(e),o=this.findZip(s);return!o||n&&o.subPath==="/"?t():this.getZipSync(o.archivePath,a=>i(a,o))}findZip(e){if(this.filter&&!this.filter.test(e))return null;let t="";for(;;){let i=e.substring(t.length),n;if(!this.fileExtensions)n=tM(i,".zip");else for(let s of this.fileExtensions)if(n=tM(i,s),n)break;if(!n)return null;if(t=this.pathUtils.join(t,n),this.isZip.has(t)===!1){if(this.notZip.has(t))continue;try{if(!this.baseFs.lstatSync(t).isFile()){this.notZip.add(t);continue}}catch{return null}this.isZip.add(t)}return{archivePath:t,subPath:this.pathUtils.join(Me.root,e.substring(t.length))}}}limitOpenFiles(e){if(this.zipInstances===null)return;let t=Date.now(),i=t+this.maxAge,n=e===null?0:this.zipInstances.size-e;for(let[s,{zipFs:o,expiresAt:a,refCount:l}]of this.zipInstances.entries())if(!(l!==0||o.hasOpenFileHandles())){if(t>=a){o.saveAndClose(),this.zipInstances.delete(s),n-=1;continue}else if(e===null||n<=0){i=a;break}o.saveAndClose(),this.zipInstances.delete(s),n-=1}this.limitOpenFilesTimeout===null&&(e===null&&this.zipInstances.size>0||e!==null)&&(this.limitOpenFilesTimeout=setTimeout(()=>{this.limitOpenFilesTimeout=null,this.limitOpenFiles(null)},i-t).unref())}async getZipPromise(e,t){let i=async()=>({baseFs:this.baseFs,libzip:this.libzip,readOnly:this.readOnlyArchives,stats:await this.baseFs.statPromise(e)});if(this.zipInstances){let n=this.zipInstances.get(e);if(!n){let s=await i();n=this.zipInstances.get(e),n||(n={zipFs:new li(e,s),expiresAt:0,refCount:0})}this.zipInstances.delete(e),this.limitOpenFiles(this.maxOpenFiles-1),this.zipInstances.set(e,n),n.expiresAt=Date.now()+this.maxAge,n.refCount+=1;try{return await t(n.zipFs)}finally{n.refCount-=1}}else{let n=new li(e,await i());try{return await t(n)}finally{n.saveAndClose()}}}getZipSync(e,t){let i=()=>({baseFs:this.baseFs,libzip:this.libzip,readOnly:this.readOnlyArchives,stats:this.baseFs.statSync(e)});if(this.zipInstances){let n=this.zipInstances.get(e);return n||(n={zipFs:new li(e,i()),expiresAt:0,refCount:0}),this.zipInstances.delete(e),this.limitOpenFiles(this.maxOpenFiles-1),this.zipInstances.set(e,n),n.expiresAt=Date.now()+this.maxAge,t(n.zipFs)}else{let n=new li(e,i());try{return t(n)}finally{n.saveAndClose()}}}};var Vu=ge(require("util"));var GE=ge(require("url"));var hQ=class extends Qi{constructor(e){super(H);this.baseFs=e}mapFromBase(e){return e}mapToBase(e){return e instanceof GE.URL?(0,GE.fileURLToPath)(e):e}};var en=Symbol("kBaseFs"),Ta=Symbol("kFd"),qA=Symbol("kClosePromise"),YE=Symbol("kCloseResolve"),qE=Symbol("kCloseReject"),_u=Symbol("kRefs"),Fo=Symbol("kRef"),No=Symbol("kUnref"),Q6e,S6e,v6e,x6e,JE=class{constructor(e,t){this[Q6e]=1;this[S6e]=void 0;this[v6e]=void 0;this[x6e]=void 0;this[en]=t,this[Ta]=e}get fd(){return this[Ta]}async appendFile(e,t){var i;try{this[Fo](this.appendFile);let n=(i=typeof t=="string"?t:t==null?void 0:t.encoding)!=null?i:void 0;return await this[en].appendFilePromise(this.fd,e,n?{encoding:n}:void 0)}finally{this[No]()}}chown(e,t){throw new Error("Method not implemented.")}async chmod(e){try{return this[Fo](this.chmod),await this[en].fchmodPromise(this.fd,e)}finally{this[No]()}}createReadStream(e){return this[en].createReadStream(null,te(N({},e),{fd:this.fd}))}createWriteStream(e){return this[en].createWriteStream(null,te(N({},e),{fd:this.fd}))}datasync(){throw new Error("Method not implemented.")}sync(){throw new Error("Method not implemented.")}async read(e,t,i,n){var s,o,a;try{this[Fo](this.read);let l;return Buffer.isBuffer(e)?l=e:(e!=null||(e={}),l=(s=e.buffer)!=null?s:Buffer.alloc(16384),t=e.offset||0,i=(o=e.length)!=null?o:l.byteLength,n=(a=e.position)!=null?a:null),t!=null||(t=0),i!=null||(i=0),i===0?{bytesRead:i,buffer:l}:{bytesRead:await this[en].readPromise(this.fd,l,t,i,n),buffer:l}}finally{this[No]()}}async readFile(e){var t;try{this[Fo](this.readFile);let i=(t=typeof e=="string"?e:e==null?void 0:e.encoding)!=null?t:void 0;return await this[en].readFilePromise(this.fd,i)}finally{this[No]()}}async stat(e){try{return this[Fo](this.stat),await this[en].fstatPromise(this.fd,e)}finally{this[No]()}}async truncate(e){try{return this[Fo](this.truncate),await this[en].ftruncatePromise(this.fd,e)}finally{this[No]()}}utimes(e,t){throw new Error("Method not implemented.")}async writeFile(e,t){var i;try{this[Fo](this.writeFile);let n=(i=typeof t=="string"?t:t==null?void 0:t.encoding)!=null?i:void 0;await this[en].writeFilePromise(this.fd,e,n)}finally{this[No]()}}async write(...e){try{if(this[Fo](this.write),ArrayBuffer.isView(e[0])){let[t,i,n,s]=e;return{bytesWritten:await this[en].writePromise(this.fd,t,i!=null?i:void 0,n!=null?n:void 0,s!=null?s:void 0),buffer:t}}else{let[t,i,n]=e;return{bytesWritten:await this[en].writePromise(this.fd,t,i,n),buffer:t}}}finally{this[No]()}}async writev(e,t){try{this[Fo](this.writev);let i=0;if(typeof t!="undefined")for(let n of e){let s=await this.write(n,void 0,void 0,t);i+=s.bytesWritten,t+=s.bytesWritten}else for(let n of e)i+=(await this.write(n)).bytesWritten;return{buffers:e,bytesWritten:i}}finally{this[No]()}}readv(e,t){throw new Error("Method not implemented.")}close(){if(this[Ta]===-1)return Promise.resolve();if(this[qA])return this[qA];if(this[_u]--,this[_u]===0){let e=this[Ta];this[Ta]=-1,this[qA]=this[en].closePromise(e).finally(()=>{this[qA]=void 0})}else this[qA]=new Promise((e,t)=>{this[YE]=e,this[qE]=t}).finally(()=>{this[qA]=void 0,this[qE]=void 0,this[YE]=void 0});return this[qA]}[(en,Ta,Q6e=_u,S6e=qA,v6e=YE,x6e=qE,Fo)](e){if(this[Ta]===-1){let t=new Error("file closed");throw t.code="EBADF",t.syscall=e.name,t}this[_u]++}[No](){if(this[_u]--,this[_u]===0){let e=this[Ta];this[Ta]=-1,this[en].closePromise(e).then(this[YE],this[qE])}}};var vge=new Set(["accessSync","appendFileSync","createReadStream","createWriteStream","chmodSync","fchmodSync","chownSync","closeSync","copyFileSync","linkSync","lstatSync","fstatSync","lutimesSync","mkdirSync","openSync","opendirSync","readlinkSync","readFileSync","readdirSync","readlinkSync","realpathSync","renameSync","rmdirSync","statSync","symlinkSync","truncateSync","ftruncateSync","unlinkSync","unwatchFile","utimesSync","watch","watchFile","writeFileSync","writeSync"]),rM=new Set(["accessPromise","appendFilePromise","fchmodPromise","chmodPromise","chownPromise","closePromise","copyFilePromise","linkPromise","fstatPromise","lstatPromise","lutimesPromise","mkdirPromise","openPromise","opendirPromise","readdirPromise","realpathPromise","readFilePromise","readdirPromise","readlinkPromise","renamePromise","rmdirPromise","statPromise","symlinkPromise","truncatePromise","ftruncatePromise","unlinkPromise","utimesPromise","writeFilePromise","writeSync"]);function pQ(r,e){e=new hQ(e);let t=(i,n,s)=>{let o=i[n];i[n]=s,typeof(o==null?void 0:o[Vu.promisify.custom])!="undefined"&&(s[Vu.promisify.custom]=o[Vu.promisify.custom])};{t(r,"exists",(i,...n)=>{let o=typeof n[n.length-1]=="function"?n.pop():()=>{};process.nextTick(()=>{e.existsPromise(i).then(a=>{o(a)},()=>{o(!1)})})}),t(r,"read",(...i)=>{let[n,s,o,a,l,c]=i;if(i.length<=3){let u={};i.length<3?c=i[1]:(u=i[1],c=i[2]),{buffer:s=Buffer.alloc(16384),offset:o=0,length:a=s.byteLength,position:l}=u}if(o==null&&(o=0),a|=0,a===0){process.nextTick(()=>{c(null,0,s)});return}l==null&&(l=-1),process.nextTick(()=>{e.readPromise(n,s,o,a,l).then(u=>{c(null,u,s)},u=>{c(u,0,s)})})});for(let i of rM){let n=i.replace(/Promise$/,"");if(typeof r[n]=="undefined")continue;let s=e[i];if(typeof s=="undefined")continue;t(r,n,(...a)=>{let c=typeof a[a.length-1]=="function"?a.pop():()=>{};process.nextTick(()=>{s.apply(e,a).then(u=>{c(null,u)},u=>{c(u)})})})}r.realpath.native=r.realpath}{t(r,"existsSync",i=>{try{return e.existsSync(i)}catch(n){return!1}}),t(r,"readSync",(...i)=>{let[n,s,o,a,l]=i;return i.length<=3&&({offset:o=0,length:a=s.byteLength,position:l}=i[2]||{}),o==null&&(o=0),a|=0,a===0?0:(l==null&&(l=-1),e.readSync(n,s,o,a,l))});for(let i of vge){let n=i;if(typeof r[n]=="undefined")continue;let s=e[i];typeof s!="undefined"&&t(r,n,s.bind(e))}r.realpathSync.native=r.realpathSync}{let i=process.emitWarning;process.emitWarning=()=>{};let n;try{n=r.promises}finally{process.emitWarning=i}if(typeof n!="undefined"){for(let s of rM){let o=s.replace(/Promise$/,"");if(typeof n[o]=="undefined")continue;let a=e[s];typeof a!="undefined"&&s!=="open"&&t(n,o,(l,...c)=>l instanceof JE?l[o].apply(l,c):a.call(e,l,...c))}t(n,"open",async(...s)=>{let o=await e.openPromise(...s);return new JE(o,e)})}}r.read[Vu.promisify.custom]=async(i,n,...s)=>({bytesRead:await e.readPromise(i,n,...s),buffer:n}),r.write[Vu.promisify.custom]=async(i,n,...s)=>({bytesWritten:await e.writePromise(i,n,...s),buffer:n})}function WE(r,e){let t=Object.create(r);return pQ(t,e),t}var iM=ge(require("os"));function nM(r){let e=Math.ceil(Math.random()*4294967296).toString(16).padStart(8,"0");return`${r}${e}`}var no=new Set,dQ=null;function sM(){if(dQ)return dQ;let r=H.toPortablePath(iM.default.tmpdir()),e=K.realpathSync(r);return process.once("exit",()=>{K.rmtempSync()}),dQ={tmpdir:r,realTmpdir:e}}var K=Object.assign(new ar,{detachTemp(r){no.delete(r)},mktempSync(r){let{tmpdir:e,realTmpdir:t}=sM();for(;;){let i=nM("xfs-");try{this.mkdirSync(k.join(e,i))}catch(s){if(s.code==="EEXIST")continue;throw s}let n=k.join(t,i);if(no.add(n),typeof r=="undefined")return n;try{return r(n)}finally{if(no.has(n)){no.delete(n);try{this.removeSync(n)}catch{}}}}},async mktempPromise(r){let{tmpdir:e,realTmpdir:t}=sM();for(;;){let i=nM("xfs-");try{await this.mkdirPromise(k.join(e,i))}catch(s){if(s.code==="EEXIST")continue;throw s}let n=k.join(t,i);if(no.add(n),typeof r=="undefined")return n;try{return await r(n)}finally{if(no.has(n)){no.delete(n);try{await this.removePromise(n)}catch{}}}}},async rmtempPromise(){await Promise.all(Array.from(no.values()).map(async r=>{try{await K.removePromise(r,{maxRetries:0}),no.delete(r)}catch{}}))},rmtempSync(){for(let r of no)try{K.removeSync(r),no.delete(r)}catch{}}});var mk=ge(SQ());var op={};ft(op,{parseResolution:()=>$E,parseShell:()=>_E,parseSyml:()=>Si,stringifyArgument:()=>PQ,stringifyArgumentSegment:()=>DQ,stringifyArithmeticExpression:()=>ZE,stringifyCommand:()=>kQ,stringifyCommandChain:()=>eg,stringifyCommandChainThen:()=>xQ,stringifyCommandLine:()=>VE,stringifyCommandLineThen:()=>vQ,stringifyEnvSegment:()=>XE,stringifyRedirectArgument:()=>$h,stringifyResolution:()=>eI,stringifyShell:()=>$u,stringifyShellLine:()=>$u,stringifySyml:()=>Ma,stringifyValueArgument:()=>uc});var _M=ge(zM());function _E(r,e={isGlobPattern:()=>!1}){try{return(0,_M.parse)(r,e)}catch(t){throw t.location&&(t.message=t.message.replace(/(\.)?$/,` (line ${t.location.start.line}, column ${t.location.start.column})$1`)),t}}function $u(r,{endSemicolon:e=!1}={}){return r.map(({command:t,type:i},n)=>`${VE(t)}${i===";"?n!==r.length-1||e?";":"":" &"}`).join(" ")}function VE(r){return`${eg(r.chain)}${r.then?` ${vQ(r.then)}`:""}`}function vQ(r){return`${r.type} ${VE(r.line)}`}function eg(r){return`${kQ(r)}${r.then?` ${xQ(r.then)}`:""}`}function xQ(r){return`${r.type} ${eg(r.chain)}`}function kQ(r){switch(r.type){case"command":return`${r.envs.length>0?`${r.envs.map(e=>XE(e)).join(" ")} `:""}${r.args.map(e=>PQ(e)).join(" ")}`;case"subshell":return`(${$u(r.subshell)})${r.args.length>0?` ${r.args.map(e=>$h(e)).join(" ")}`:""}`;case"group":return`{ ${$u(r.group,{endSemicolon:!0})} }${r.args.length>0?` ${r.args.map(e=>$h(e)).join(" ")}`:""}`;case"envs":return r.envs.map(e=>XE(e)).join(" ");default:throw new Error(`Unsupported command type: "${r.type}"`)}}function XE(r){return`${r.name}=${r.args[0]?uc(r.args[0]):""}`}function PQ(r){switch(r.type){case"redirection":return $h(r);case"argument":return uc(r);default:throw new Error(`Unsupported argument type: "${r.type}"`)}}function $h(r){return`${r.subtype} ${r.args.map(e=>uc(e)).join(" ")}`}function uc(r){return r.segments.map(e=>DQ(e)).join("")}function DQ(r){let e=(i,n)=>n?`"${i}"`:i,t=i=>i===""?'""':i.match(/[(){}<>$|&; \t"']/)?`$'${i.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0")}'`:i;switch(r.type){case"text":return t(r.text);case"glob":return r.pattern;case"shell":return e(`\${${$u(r.shell)}}`,r.quoted);case"variable":return e(typeof r.defaultValue=="undefined"?typeof r.alternativeValue=="undefined"?`\${${r.name}}`:r.alternativeValue.length===0?`\${${r.name}:+}`:`\${${r.name}:+${r.alternativeValue.map(i=>uc(i)).join(" ")}}`:r.defaultValue.length===0?`\${${r.name}:-}`:`\${${r.name}:-${r.defaultValue.map(i=>uc(i)).join(" ")}}`,r.quoted);case"arithmetic":return`$(( ${ZE(r.arithmetic)} ))`;default:throw new Error(`Unsupported argument segment type: "${r.type}"`)}}function ZE(r){let e=n=>{switch(n){case"addition":return"+";case"subtraction":return"-";case"multiplication":return"*";case"division":return"/";default:throw new Error(`Can't extract operator from arithmetic expression of type "${n}"`)}},t=(n,s)=>s?`( ${n} )`:n,i=n=>t(ZE(n),!["number","variable"].includes(n.type));switch(r.type){case"number":return String(r.value);case"variable":return r.name;default:return`${i(r.left)} ${e(r.type)} ${i(r.right)}`}}var ZM=ge(XM());function $E(r){let e=r.match(/^\*{1,2}\/(.*)/);if(e)throw new Error(`The override for '${r}' includes a glob pattern. Glob patterns have been removed since their behaviours don't match what you'd expect. Set the override to '${e[1]}' instead.`);try{return(0,ZM.parse)(r)}catch(t){throw t.location&&(t.message=t.message.replace(/(\.)?$/,` (line ${t.location.start.line}, column ${t.location.start.column})$1`)),t}}function eI(r){let e="";return r.from&&(e+=r.from.fullName,r.from.description&&(e+=`@${r.from.description}`),e+="/"),e+=r.descriptor.fullName,r.descriptor.description&&(e+=`@${r.descriptor.description}`),e}var uI=ge(jK()),qK=ge(YK()),Tpe=/^(?![-?:,\][{}#&*!|>'"%@` \t\r\n]).([ \t]*(?![,\][{}:# \t\r\n]).)*$/,JK=["__metadata","version","resolution","dependencies","peerDependencies","dependenciesMeta","peerDependenciesMeta","binaries"],YQ=class{constructor(e){this.data=e}};function WK(r){return r.match(Tpe)?r:JSON.stringify(r)}function zK(r){return typeof r=="undefined"?!0:typeof r=="object"&&r!==null?Object.keys(r).every(e=>zK(r[e])):!1}function qQ(r,e,t){if(r===null)return`null -`;if(typeof r=="number"||typeof r=="boolean")return`${r.toString()} -`;if(typeof r=="string")return`${WK(r)} -`;if(Array.isArray(r)){if(r.length===0)return`[] -`;let i=" ".repeat(e);return` -${r.map(s=>`${i}- ${qQ(s,e+1,!1)}`).join("")}`}if(typeof r=="object"&&r){let i,n;r instanceof YQ?(i=r.data,n=!1):(i=r,n=!0);let s=" ".repeat(e),o=Object.keys(i);n&&o.sort((l,c)=>{let u=JK.indexOf(l),g=JK.indexOf(c);return u===-1&&g===-1?lc?1:0:u!==-1&&g===-1?-1:u===-1&&g!==-1?1:u-g});let a=o.filter(l=>!zK(i[l])).map((l,c)=>{let u=i[l],g=WK(l),f=qQ(u,e+1,!0),h=c>0||t?s:"",p=g.length>1024?`? ${g} -${h}:`:`${g}:`,m=f.startsWith(` -`)?f:` ${f}`;return`${h}${p}${m}`}).join(e===0?` -`:"")||` -`;return t?` -${a}`:`${a}`}throw new Error(`Unsupported value type (${r})`)}function Ma(r){try{let e=qQ(r,0,!1);return e!==` -`?e:""}catch(e){throw e.location&&(e.message=e.message.replace(/(\.)?$/,` (line ${e.location.start.line}, column ${e.location.start.column})$1`)),e}}Ma.PreserveOrdering=YQ;function Ope(r){return r.endsWith(` -`)||(r+=` -`),(0,qK.parse)(r)}var Mpe=/^(#.*(\r?\n))*?#\s+yarn\s+lockfile\s+v1\r?\n/i;function Kpe(r){if(Mpe.test(r))return Ope(r);let e=(0,uI.safeLoad)(r,{schema:uI.FAILSAFE_SCHEMA,json:!0});if(e==null)return{};if(typeof e!="object")throw new Error(`Expected an indexed object, got a ${typeof e} instead. Does your file follow Yaml's rules?`);if(Array.isArray(e))throw new Error("Expected an indexed object, got an array instead. Does your file follow Yaml's rules?");return e}function Si(r){return Kpe(r)}var T4=ge(VK()),mw=ge(Ic());var Cp={};ft(Cp,{Builtins:()=>oS,Cli:()=>ws,Command:()=>Re,Option:()=>J,UsageError:()=>Pe,formatMarkdownish:()=>Ui});var yc=0,ap=1,tn=2,WQ="",vi="\0",lg=-1,zQ=/^(-h|--help)(?:=([0-9]+))?$/,gI=/^(--[a-z]+(?:-[a-z]+)*|-[a-zA-Z]+)$/,tU=/^-[a-zA-Z]{2,}$/,_Q=/^([^=]+)=([\s\S]*)$/,VQ=process.env.DEBUG_CLI==="1";var Pe=class extends Error{constructor(e){super(e);this.clipanion={type:"usage"},this.name="UsageError"}},Ap=class extends Error{constructor(e,t){super();if(this.input=e,this.candidates=t,this.clipanion={type:"none"},this.name="UnknownSyntaxError",this.candidates.length===0)this.message="Command not found, but we're not sure what's the alternative.";else if(this.candidates.every(i=>i.reason!==null&&i.reason===t[0].reason)){let[{reason:i}]=this.candidates;this.message=`${i} - -${this.candidates.map(({usage:n})=>`$ ${n}`).join(` -`)}`}else if(this.candidates.length===1){let[{usage:i}]=this.candidates;this.message=`Command not found; did you mean: - -$ ${i} -${XQ(e)}`}else this.message=`Command not found; did you mean one of: - -${this.candidates.map(({usage:i},n)=>`${`${n}.`.padStart(4)} ${i}`).join(` -`)} - -${XQ(e)}`}},ZQ=class extends Error{constructor(e,t){super();this.input=e,this.usages=t,this.clipanion={type:"none"},this.name="AmbiguousSyntaxError",this.message=`Cannot find which to pick amongst the following alternatives: - -${this.usages.map((i,n)=>`${`${n}.`.padStart(4)} ${i}`).join(` -`)} - -${XQ(e)}`}},XQ=r=>`While running ${r.filter(e=>e!==vi).map(e=>{let t=JSON.stringify(e);return e.match(/\s/)||e.length===0||t!==`"${e}"`?t:e}).join(" ")}`;var lp=Symbol("clipanion/isOption");function rn(r){return te(N({},r),{[lp]:!0})}function Oo(r,e){return typeof r=="undefined"?[r,e]:typeof r=="object"&&r!==null&&!Array.isArray(r)?[void 0,r]:[r,e]}function fI(r,e=!1){let t=r.replace(/^\.: /,"");return e&&(t=t[0].toLowerCase()+t.slice(1)),t}function cp(r,e){return e.length===1?new Pe(`${r}: ${fI(e[0],!0)}`):new Pe(`${r}: -${e.map(t=>` -- ${fI(t)}`).join("")}`)}function up(r,e,t){if(typeof t=="undefined")return e;let i=[],n=[],s=a=>{let l=e;return e=a,s.bind(null,l)};if(!t(e,{errors:i,coercions:n,coercion:s}))throw cp(`Invalid value for ${r}`,i);for(let[,a]of n)a();return e}var Re=class{constructor(){this.help=!1}static Usage(e){return e}async catch(e){throw e}async validateAndExecute(){let t=this.constructor.schema;if(Array.isArray(t)){let{isDict:n,isUnknown:s,applyCascade:o}=await Promise.resolve().then(()=>(ys(),cg)),a=o(n(s()),t),l=[],c=[];if(!a(this,{errors:l,coercions:c}))throw cp("Invalid option schema",l);for(let[,g]of c)g()}else if(t!=null)throw new Error("Invalid command schema");let i=await this.execute();return typeof i!="undefined"?i:0}};Re.isOption=lp;Re.Default=[];var uU=80,tS=Array(uU).fill("\u2501");for(let r=0;r<=24;++r)tS[tS.length-r]=`[38;5;${232+r}m\u2501`;var rS={header:r=>`\u2501\u2501\u2501 ${r}${r.length`${r}`,error:r=>`${r}`,code:r=>`${r}`},gU={header:r=>r,bold:r=>r,error:r=>r,code:r=>r};function yde(r){let e=r.split(` -`),t=e.filter(n=>n.match(/\S/)),i=t.length>0?t.reduce((n,s)=>Math.min(n,s.length-s.trimStart().length),Number.MAX_VALUE):0;return e.map(n=>n.slice(i).trimRight()).join(` -`)}function Ui(r,{format:e,paragraphs:t}){return r=r.replace(/\r\n?/g,` -`),r=yde(r),r=r.replace(/^\n+|\n+$/g,""),r=r.replace(/^(\s*)-([^\n]*?)\n+/gm,`$1-$2 - -`),r=r.replace(/\n(\n)?\n*/g,"$1"),t&&(r=r.split(/\n/).map(i=>{let n=i.match(/^\s*[*-][\t ]+(.*)/);if(!n)return i.match(/(.{1,80})(?: |$)/g).join(` -`);let s=i.length-i.trimStart().length;return n[1].match(new RegExp(`(.{1,${78-s}})(?: |$)`,"g")).map((o,a)=>" ".repeat(s)+(a===0?"- ":" ")+o).join(` -`)}).join(` - -`)),r=r.replace(/(`+)((?:.|[\n])*?)\1/g,(i,n,s)=>e.code(n+s+n)),r=r.replace(/(\*\*)((?:.|[\n])*?)\1/g,(i,n,s)=>e.bold(n+s+n)),r?`${r} -`:""}var sS=ge(require("tty"));function wn(r){VQ&&console.log(r)}var fU={candidateUsage:null,requiredOptions:[],errorMessage:null,ignoreOptions:!1,path:[],positionals:[],options:[],remainder:null,selectedIndex:lg};function hU(){return{nodes:[sn(),sn(),sn()]}}function Bde(r){let e=hU(),t=[],i=e.nodes.length;for(let n of r){t.push(i);for(let s=0;s{if(e.has(i))return;e.add(i);let n=r.nodes[i];for(let o of Object.values(n.statics))for(let{to:a}of o)t(a);for(let[,{to:o}]of n.dynamics)t(o);for(let{to:o}of n.shortcuts)t(o);let s=new Set(n.shortcuts.map(({to:o})=>o));for(;n.shortcuts.length>0;){let{to:o}=n.shortcuts.shift(),a=r.nodes[o];for(let[l,c]of Object.entries(a.statics)){let u=Object.prototype.hasOwnProperty.call(n.statics,l)?n.statics[l]:n.statics[l]=[];for(let g of c)u.some(({to:f})=>g.to===f)||u.push(g)}for(let[l,c]of a.dynamics)n.dynamics.some(([u,{to:g}])=>l===u&&c.to===g)||n.dynamics.push([l,c]);for(let l of a.shortcuts)s.has(l.to)||(n.shortcuts.push(l),s.add(l.to))}};t(yc)}function Qde(r,{prefix:e=""}={}){if(VQ){wn(`${e}Nodes are:`);for(let t=0;tl!==tn).map(({state:l})=>({usage:l.candidateUsage,reason:null})));if(a.every(({node:l})=>l===tn))throw new Ap(e,a.map(({state:l})=>({usage:l.candidateUsage,reason:l.errorMessage})));i=Sde(a)}if(i.length>0){wn(" Results:");for(let s of i)wn(` - ${s.node} -> ${JSON.stringify(s.state)}`)}else wn(" No results");return i}function vde(r,e){if(e.selectedIndex!==null)return!0;if(Object.prototype.hasOwnProperty.call(r.statics,vi)){for(let{to:t}of r.statics[vi])if(t===ap)return!0}return!1}function kde(r,e,t){let i=t&&e.length>0?[""]:[],n=dU(r,e,t),s=[],o=new Set,a=(l,c,u=!0)=>{let g=[c];for(;g.length>0;){let h=g;g=[];for(let p of h){let m=r.nodes[p],y=Object.keys(m.statics);for(let b of Object.keys(m.statics)){let v=y[0];for(let{to:x,reducer:T}of m.statics[v])T==="pushPath"&&(u||l.push(v),g.push(x))}}u=!1}let f=JSON.stringify(l);o.has(f)||(s.push(l),o.add(f))};for(let{node:l,state:c}of n){if(c.remainder!==null){a([c.remainder],l);continue}let u=r.nodes[l],g=vde(u,c);for(let[f,h]of Object.entries(u.statics))(g&&f!==vi||!f.startsWith("-")&&h.some(({reducer:p})=>p==="pushPath"))&&a([...i,f],l);if(!!g)for(let[f,{to:h}]of u.dynamics){if(h===tn)continue;let p=xde(f,c);if(p!==null)for(let m of p)a([...i,m],l)}}return[...s].sort()}function Dde(r,e){let t=dU(r,[...e,vi]);return Pde(e,t.map(({state:i})=>i))}function Sde(r){let e=0;for(let{state:t}of r)t.path.length>e&&(e=t.path.length);return r.filter(({state:t})=>t.path.length===e)}function Pde(r,e){let t=e.filter(g=>g.selectedIndex!==null);if(t.length===0)throw new Error;let i=t.filter(g=>g.requiredOptions.every(f=>f.some(h=>g.options.find(p=>p.name===h))));if(i.length===0)throw new Ap(r,t.map(g=>({usage:g.candidateUsage,reason:null})));let n=0;for(let g of i)g.path.length>n&&(n=g.path.length);let s=i.filter(g=>g.path.length===n),o=g=>g.positionals.filter(({extra:f})=>!f).length+g.options.length,a=s.map(g=>({state:g,positionalCount:o(g)})),l=0;for(let{positionalCount:g}of a)g>l&&(l=g);let c=a.filter(({positionalCount:g})=>g===l).map(({state:g})=>g),u=Rde(c);if(u.length>1)throw new ZQ(r,u.map(g=>g.candidateUsage));return u[0]}function Rde(r){let e=[],t=[];for(let i of r)i.selectedIndex===lg?t.push(i):e.push(i);return t.length>0&&e.push(te(N({},fU),{path:CU(...t.map(i=>i.path)),options:t.reduce((i,n)=>i.concat(n.options),[])})),e}function CU(r,e,...t){return e===void 0?Array.from(r):CU(r.filter((i,n)=>i===e[n]),...t)}function sn(){return{dynamics:[],shortcuts:[],statics:{}}}function pU(r){return r===ap||r===tn}function nS(r,e=0){return{to:pU(r.to)?r.to:r.to>2?r.to+e-2:r.to+e,reducer:r.reducer}}function wde(r,e=0){let t=sn();for(let[i,n]of r.dynamics)t.dynamics.push([i,nS(n,e)]);for(let i of r.shortcuts)t.shortcuts.push(nS(i,e));for(let[i,n]of Object.entries(r.statics))t.statics[i]=n.map(s=>nS(s,e));return t}function xi(r,e,t,i,n){r.nodes[e].dynamics.push([t,{to:i,reducer:n}])}function ug(r,e,t,i){r.nodes[e].shortcuts.push({to:t,reducer:i})}function Ka(r,e,t,i,n){(Object.prototype.hasOwnProperty.call(r.nodes[e].statics,t)?r.nodes[e].statics[t]:r.nodes[e].statics[t]=[]).push({to:i,reducer:n})}function pI(r,e,t,i){if(Array.isArray(e)){let[n,...s]=e;return r[n](t,i,...s)}else return r[e](t,i)}function xde(r,e){let t=Array.isArray(r)?dI[r[0]]:dI[r];if(typeof t.suggest=="undefined")return null;let i=Array.isArray(r)?r.slice(1):[];return t.suggest(e,...i)}var dI={always:()=>!0,isOptionLike:(r,e)=>!r.ignoreOptions&&e!=="-"&&e.startsWith("-"),isNotOptionLike:(r,e)=>r.ignoreOptions||e==="-"||!e.startsWith("-"),isOption:(r,e,t,i)=>!r.ignoreOptions&&e===t,isBatchOption:(r,e,t)=>!r.ignoreOptions&&tU.test(e)&&[...e.slice(1)].every(i=>t.includes(`-${i}`)),isBoundOption:(r,e,t,i)=>{let n=e.match(_Q);return!r.ignoreOptions&&!!n&&gI.test(n[1])&&t.includes(n[1])&&i.filter(s=>s.names.includes(n[1])).every(s=>s.allowBinding)},isNegatedOption:(r,e,t)=>!r.ignoreOptions&&e===`--no-${t.slice(2)}`,isHelp:(r,e)=>!r.ignoreOptions&&zQ.test(e),isUnsupportedOption:(r,e,t)=>!r.ignoreOptions&&e.startsWith("-")&&gI.test(e)&&!t.includes(e),isInvalidOption:(r,e)=>!r.ignoreOptions&&e.startsWith("-")&&!gI.test(e)};dI.isOption.suggest=(r,e,t=!0)=>t?null:[e];var iS={setCandidateState:(r,e,t)=>N(N({},r),t),setSelectedIndex:(r,e,t)=>te(N({},r),{selectedIndex:t}),pushBatch:(r,e)=>te(N({},r),{options:r.options.concat([...e.slice(1)].map(t=>({name:`-${t}`,value:!0})))}),pushBound:(r,e)=>{let[,t,i]=e.match(_Q);return te(N({},r),{options:r.options.concat({name:t,value:i})})},pushPath:(r,e)=>te(N({},r),{path:r.path.concat(e)}),pushPositional:(r,e)=>te(N({},r),{positionals:r.positionals.concat({value:e,extra:!1})}),pushExtra:(r,e)=>te(N({},r),{positionals:r.positionals.concat({value:e,extra:!0})}),pushExtraNoLimits:(r,e)=>te(N({},r),{positionals:r.positionals.concat({value:e,extra:Zn})}),pushTrue:(r,e,t=e)=>te(N({},r),{options:r.options.concat({name:e,value:!0})}),pushFalse:(r,e,t=e)=>te(N({},r),{options:r.options.concat({name:t,value:!1})}),pushUndefined:(r,e)=>te(N({},r),{options:r.options.concat({name:e,value:void 0})}),pushStringValue:(r,e)=>{var t;let i=te(N({},r),{options:[...r.options]}),n=r.options[r.options.length-1];return n.value=((t=n.value)!==null&&t!==void 0?t:[]).concat([e]),i},setStringValue:(r,e)=>{let t=te(N({},r),{options:[...r.options]}),i=r.options[r.options.length-1];return i.value=e,t},inhibateOptions:r=>te(N({},r),{ignoreOptions:!0}),useHelp:(r,e,t)=>{let[,,i]=e.match(zQ);return typeof i!="undefined"?te(N({},r),{options:[{name:"-c",value:String(t)},{name:"-i",value:i}]}):te(N({},r),{options:[{name:"-c",value:String(t)}]})},setError:(r,e,t)=>e===vi?te(N({},r),{errorMessage:`${t}.`}):te(N({},r),{errorMessage:`${t} ("${e}").`}),setOptionArityError:(r,e)=>{let t=r.options[r.options.length-1];return te(N({},r),{errorMessage:`Not enough arguments to option ${t.name}.`})}},Zn=Symbol(),mU=class{constructor(e,t){this.allOptionNames=[],this.arity={leading:[],trailing:[],extra:[],proxy:!1},this.options=[],this.paths=[],this.cliIndex=e,this.cliOpts=t}addPath(e){this.paths.push(e)}setArity({leading:e=this.arity.leading,trailing:t=this.arity.trailing,extra:i=this.arity.extra,proxy:n=this.arity.proxy}){Object.assign(this.arity,{leading:e,trailing:t,extra:i,proxy:n})}addPositional({name:e="arg",required:t=!0}={}){if(!t&&this.arity.extra===Zn)throw new Error("Optional parameters cannot be declared when using .rest() or .proxy()");if(!t&&this.arity.trailing.length>0)throw new Error("Optional parameters cannot be declared after the required trailing positional arguments");!t&&this.arity.extra!==Zn?this.arity.extra.push(e):this.arity.extra!==Zn&&this.arity.extra.length===0?this.arity.leading.push(e):this.arity.trailing.push(e)}addRest({name:e="arg",required:t=0}={}){if(this.arity.extra===Zn)throw new Error("Infinite lists cannot be declared multiple times in the same command");if(this.arity.trailing.length>0)throw new Error("Infinite lists cannot be declared after the required trailing positional arguments");for(let i=0;i1)throw new Error("The arity cannot be higher than 1 when the option only supports the --arg=value syntax");if(!Number.isInteger(i))throw new Error(`The arity must be an integer, got ${i}`);if(i<0)throw new Error(`The arity must be positive, got ${i}`);this.allOptionNames.push(...e),this.options.push({names:e,description:t,arity:i,hidden:n,required:s,allowBinding:o})}setContext(e){this.context=e}usage({detailed:e=!0,inlineOptions:t=!0}={}){let i=[this.cliOpts.binaryName],n=[];if(this.paths.length>0&&i.push(...this.paths[0]),e){for(let{names:o,arity:a,hidden:l,description:c,required:u}of this.options){if(l)continue;let g=[];for(let h=0;h`:`[${f}]`)}i.push(...this.arity.leading.map(o=>`<${o}>`)),this.arity.extra===Zn?i.push("..."):i.push(...this.arity.extra.map(o=>`[${o}]`)),i.push(...this.arity.trailing.map(o=>`<${o}>`))}return{usage:i.join(" "),options:n}}compile(){if(typeof this.context=="undefined")throw new Error("Assertion failed: No context attached");let e=hU(),t=yc,i=this.usage().usage,n=this.options.filter(a=>a.required).map(a=>a.names);t=so(e,sn()),Ka(e,yc,WQ,t,["setCandidateState",{candidateUsage:i,requiredOptions:n}]);let s=this.arity.proxy?"always":"isNotOptionLike",o=this.paths.length>0?this.paths:[[]];for(let a of o){let l=t;if(a.length>0){let f=so(e,sn());ug(e,l,f),this.registerOptions(e,f),l=f}for(let f=0;f0||!this.arity.proxy){let f=so(e,sn());xi(e,l,"isHelp",f,["useHelp",this.cliIndex]),Ka(e,f,vi,ap,["setSelectedIndex",lg]),this.registerOptions(e,l)}this.arity.leading.length>0&&Ka(e,l,vi,tn,["setError","Not enough positional arguments"]);let c=l;for(let f=0;f0||f+1!==this.arity.leading.length)&&Ka(e,h,vi,tn,["setError","Not enough positional arguments"]),xi(e,c,"isNotOptionLike",h,"pushPositional"),c=h}let u=c;if(this.arity.extra===Zn||this.arity.extra.length>0){let f=so(e,sn());if(ug(e,c,f),this.arity.extra===Zn){let h=so(e,sn());this.arity.proxy||this.registerOptions(e,h),xi(e,c,s,h,"pushExtraNoLimits"),xi(e,h,s,h,"pushExtraNoLimits"),ug(e,h,f)}else for(let h=0;h0&&Ka(e,u,vi,tn,["setError","Not enough positional arguments"]);let g=u;for(let f=0;fo.length>s.length?o:s,"");if(i.arity===0)for(let s of i.names)xi(e,t,["isOption",s,i.hidden||s!==n],t,"pushTrue"),s.startsWith("--")&&!s.startsWith("--no-")&&xi(e,t,["isNegatedOption",s],t,["pushFalse",s]);else{let s=so(e,sn());for(let o of i.names)xi(e,t,["isOption",o,i.hidden||o!==n],s,"pushUndefined");for(let o=0;o=0&&eDde(i,n),suggest:(n,s)=>kde(i,n,s)}}};var dp=class extends Re{constructor(e){super();this.contexts=e,this.commands=[]}static from(e,t){let i=new dp(t);i.path=e.path;for(let n of e.options)switch(n.name){case"-c":i.commands.push(Number(n.value));break;case"-i":i.index=Number(n.value);break}return i}async execute(){let e=this.commands;if(typeof this.index!="undefined"&&this.index>=0&&this.index1){this.context.stdout.write(`Multiple commands match your selection: -`),this.context.stdout.write(` -`);let t=0;for(let i of this.commands)this.context.stdout.write(this.cli.usage(this.contexts[i].commandClass,{prefix:`${t++}. `.padStart(5)}));this.context.stdout.write(` -`),this.context.stdout.write(`Run again with -h= to see the longer details of any of those commands. -`)}}};var EU=Symbol("clipanion/errorCommand");function Fde(){return process.env.FORCE_COLOR==="0"?1:process.env.FORCE_COLOR==="1"||typeof process.stdout!="undefined"&&process.stdout.isTTY?8:1}var ws=class{constructor({binaryLabel:e,binaryName:t="...",binaryVersion:i,enableCapture:n=!1,enableColors:s}={}){this.registrations=new Map,this.builder=new pp({binaryName:t}),this.binaryLabel=e,this.binaryName=t,this.binaryVersion=i,this.enableCapture=n,this.enableColors=s}static from(e,t={}){let i=new ws(t);for(let n of e)i.register(n);return i}register(e){var t;let i=new Map,n=new e;for(let l in n){let c=n[l];typeof c=="object"&&c!==null&&c[Re.isOption]&&i.set(l,c)}let s=this.builder.command(),o=s.cliIndex,a=(t=e.paths)!==null&&t!==void 0?t:n.paths;if(typeof a!="undefined")for(let l of a)s.addPath(l);this.registrations.set(e,{specs:i,builder:s,index:o});for(let[l,{definition:c}]of i.entries())c(s,l);s.setContext({commandClass:e})}process(e){let{contexts:t,process:i}=this.builder.compile(),n=i(e);switch(n.selectedIndex){case lg:return dp.from(n,t);default:{let{commandClass:s}=t[n.selectedIndex],o=this.registrations.get(s);if(typeof o=="undefined")throw new Error("Assertion failed: Expected the command class to have been registered.");let a=new s;a.path=n.path;try{for(let[l,{transformer:c}]of o.specs.entries())a[l]=c(o.builder,l,n);return a}catch(l){throw l[EU]=a,l}}break}}async run(e,t){var i;let n,s=N(N({},ws.defaultContext),t),o=(i=this.enableColors)!==null&&i!==void 0?i:s.colorDepth>1;if(!Array.isArray(e))n=e;else try{n=this.process(e)}catch(c){return s.stdout.write(this.error(c,{colored:o})),1}if(n.help)return s.stdout.write(this.usage(n,{colored:o,detailed:!0})),0;n.context=s,n.cli={binaryLabel:this.binaryLabel,binaryName:this.binaryName,binaryVersion:this.binaryVersion,enableCapture:this.enableCapture,enableColors:this.enableColors,definitions:()=>this.definitions(),error:(c,u)=>this.error(c,u),format:c=>this.format(c),process:c=>this.process(c),run:(c,u)=>this.run(c,N(N({},s),u)),usage:(c,u)=>this.usage(c,u)};let a=this.enableCapture?Nde(s):IU,l;try{l=await a(()=>n.validateAndExecute().catch(c=>n.catch(c).then(()=>0)))}catch(c){return s.stdout.write(this.error(c,{colored:o,command:n})),1}return l}async runExit(e,t){process.exitCode=await this.run(e,t)}suggest(e,t){let{suggest:i}=this.builder.compile();return i(e,t)}definitions({colored:e=!1}={}){let t=[];for(let[i,{index:n}]of this.registrations){if(typeof i.usage=="undefined")continue;let{usage:s}=this.getUsageByIndex(n,{detailed:!1}),{usage:o,options:a}=this.getUsageByIndex(n,{detailed:!0,inlineOptions:!1}),l=typeof i.usage.category!="undefined"?Ui(i.usage.category,{format:this.format(e),paragraphs:!1}):void 0,c=typeof i.usage.description!="undefined"?Ui(i.usage.description,{format:this.format(e),paragraphs:!1}):void 0,u=typeof i.usage.details!="undefined"?Ui(i.usage.details,{format:this.format(e),paragraphs:!0}):void 0,g=typeof i.usage.examples!="undefined"?i.usage.examples.map(([f,h])=>[Ui(f,{format:this.format(e),paragraphs:!1}),h.replace(/\$0/g,this.binaryName)]):void 0;t.push({path:s,usage:o,category:l,description:c,details:u,examples:g,options:a})}return t}usage(e=null,{colored:t,detailed:i=!1,prefix:n="$ "}={}){var s;if(e===null){for(let l of this.registrations.keys()){let c=l.paths,u=typeof l.usage!="undefined";if(!c||c.length===0||c.length===1&&c[0].length===0||((s=c==null?void 0:c.some(h=>h.length===0))!==null&&s!==void 0?s:!1))if(e){e=null;break}else e=l;else if(u){e=null;continue}}e&&(i=!0)}let o=e!==null&&e instanceof Re?e.constructor:e,a="";if(o)if(i){let{description:l="",details:c="",examples:u=[]}=o.usage||{};l!==""&&(a+=Ui(l,{format:this.format(t),paragraphs:!1}).replace(/^./,h=>h.toUpperCase()),a+=` -`),(c!==""||u.length>0)&&(a+=`${this.format(t).header("Usage")} -`,a+=` -`);let{usage:g,options:f}=this.getUsageByRegistration(o,{inlineOptions:!1});if(a+=`${this.format(t).bold(n)}${g} -`,f.length>0){a+=` -`,a+=`${rS.header("Options")} -`;let h=f.reduce((p,m)=>Math.max(p,m.definition.length),0);a+=` -`;for(let{definition:p,description:m}of f)a+=` ${this.format(t).bold(p.padEnd(h))} ${Ui(m,{format:this.format(t),paragraphs:!1})}`}if(c!==""&&(a+=` -`,a+=`${this.format(t).header("Details")} -`,a+=` -`,a+=Ui(c,{format:this.format(t),paragraphs:!0})),u.length>0){a+=` -`,a+=`${this.format(t).header("Examples")} -`;for(let[h,p]of u)a+=` -`,a+=Ui(h,{format:this.format(t),paragraphs:!1}),a+=`${p.replace(/^/m,` ${this.format(t).bold(n)}`).replace(/\$0/g,this.binaryName)} -`}}else{let{usage:l}=this.getUsageByRegistration(o);a+=`${this.format(t).bold(n)}${l} -`}else{let l=new Map;for(let[f,{index:h}]of this.registrations.entries()){if(typeof f.usage=="undefined")continue;let p=typeof f.usage.category!="undefined"?Ui(f.usage.category,{format:this.format(t),paragraphs:!1}):null,m=l.get(p);typeof m=="undefined"&&l.set(p,m=[]);let{usage:y}=this.getUsageByIndex(h);m.push({commandClass:f,usage:y})}let c=Array.from(l.keys()).sort((f,h)=>f===null?-1:h===null?1:f.localeCompare(h,"en",{usage:"sort",caseFirst:"upper"})),u=typeof this.binaryLabel!="undefined",g=typeof this.binaryVersion!="undefined";u||g?(u&&g?a+=`${this.format(t).header(`${this.binaryLabel} - ${this.binaryVersion}`)} - -`:u?a+=`${this.format(t).header(`${this.binaryLabel}`)} -`:a+=`${this.format(t).header(`${this.binaryVersion}`)} -`,a+=` ${this.format(t).bold(n)}${this.binaryName} -`):a+=`${this.format(t).bold(n)}${this.binaryName} -`;for(let f of c){let h=l.get(f).slice().sort((m,y)=>m.usage.localeCompare(y.usage,"en",{usage:"sort",caseFirst:"upper"})),p=f!==null?f.trim():"General commands";a+=` -`,a+=`${this.format(t).header(`${p}`)} -`;for(let{commandClass:m,usage:y}of h){let b=m.usage.description||"undocumented";a+=` -`,a+=` ${this.format(t).bold(y)} -`,a+=` ${Ui(b,{format:this.format(t),paragraphs:!1})}`}}a+=` -`,a+=Ui("You can also print more details about any of these commands by calling them with the `-h,--help` flag right after the command name.",{format:this.format(t),paragraphs:!0})}return a}error(e,t){var i,{colored:n,command:s=(i=e[EU])!==null&&i!==void 0?i:null}=t===void 0?{}:t;e instanceof Error||(e=new Error(`Execution failed with a non-error rejection (rejected value: ${JSON.stringify(e)})`));let o="",a=e.name.replace(/([a-z])([A-Z])/g,"$1 $2");a==="Error"&&(a="Internal Error"),o+=`${this.format(n).error(a)}: ${e.message} -`;let l=e.clipanion;return typeof l!="undefined"?l.type==="usage"&&(o+=` -`,o+=this.usage(s)):e.stack&&(o+=`${e.stack.replace(/^.*\n/,"")} -`),o}format(e){var t;return((t=e!=null?e:this.enableColors)!==null&&t!==void 0?t:ws.defaultContext.colorDepth>1)?rS:gU}getUsageByRegistration(e,t){let i=this.registrations.get(e);if(typeof i=="undefined")throw new Error("Assertion failed: Unregistered command");return this.getUsageByIndex(i.index,t)}getUsageByIndex(e,t){return this.builder.getBuilderByIndex(e).usage(t)}};ws.defaultContext={stdin:process.stdin,stdout:process.stdout,stderr:process.stderr,colorDepth:"getColorDepth"in sS.default.WriteStream.prototype?sS.default.WriteStream.prototype.getColorDepth():Fde()};var yU;function Nde(r){let e=yU;if(typeof e=="undefined"){if(r.stdout===process.stdout&&r.stderr===process.stderr)return IU;let{AsyncLocalStorage:t}=require("async_hooks");e=yU=new t;let i=process.stdout._write;process.stdout._write=function(s,o,a){let l=e.getStore();return typeof l=="undefined"?i.call(this,s,o,a):l.stdout.write(s,o,a)};let n=process.stderr._write;process.stderr._write=function(s,o,a){let l=e.getStore();return typeof l=="undefined"?n.call(this,s,o,a):l.stderr.write(s,o,a)}}return t=>e.run(r,t)}function IU(r){return r()}var oS={};ft(oS,{DefinitionsCommand:()=>CI,HelpCommand:()=>mI,VersionCommand:()=>EI});var CI=class extends Re{async execute(){this.context.stdout.write(`${JSON.stringify(this.cli.definitions(),null,2)} -`)}};CI.paths=[["--clipanion=definitions"]];var mI=class extends Re{async execute(){this.context.stdout.write(this.cli.usage())}};mI.paths=[["-h"],["--help"]];var EI=class extends Re{async execute(){var e;this.context.stdout.write(`${(e=this.cli.binaryVersion)!==null&&e!==void 0?e:""} -`)}};EI.paths=[["-v"],["--version"]];var J={};ft(J,{Array:()=>wU,Boolean:()=>BU,Counter:()=>bU,Proxy:()=>QU,Rest:()=>SU,String:()=>vU,applyValidator:()=>up,cleanValidationError:()=>fI,formatError:()=>cp,isOptionSymbol:()=>lp,makeCommandOption:()=>rn,rerouteArguments:()=>Oo});function wU(r,e,t){let[i,n]=Oo(e,t!=null?t:{}),{arity:s=1}=n,o=r.split(","),a=new Set(o);return rn({definition(l){l.addOption({names:o,arity:s,hidden:n==null?void 0:n.hidden,description:n==null?void 0:n.description,required:n.required})},transformer(l,c,u){let g=typeof i!="undefined"?[...i]:void 0;for(let{name:f,value:h}of u.options)!a.has(f)||(g=g!=null?g:[],g.push(h));return g}})}function BU(r,e,t){let[i,n]=Oo(e,t!=null?t:{}),s=r.split(","),o=new Set(s);return rn({definition(a){a.addOption({names:s,allowBinding:!1,arity:0,hidden:n.hidden,description:n.description,required:n.required})},transformer(a,l,c){let u=i;for(let{name:g,value:f}of c.options)!o.has(g)||(u=f);return u}})}function bU(r,e,t){let[i,n]=Oo(e,t!=null?t:{}),s=r.split(","),o=new Set(s);return rn({definition(a){a.addOption({names:s,allowBinding:!1,arity:0,hidden:n.hidden,description:n.description,required:n.required})},transformer(a,l,c){let u=i;for(let{name:g,value:f}of c.options)!o.has(g)||(u!=null||(u=0),f?u+=1:u=0);return u}})}function QU(r={}){return rn({definition(e,t){var i;e.addProxy({name:(i=r.name)!==null&&i!==void 0?i:t,required:r.required})},transformer(e,t,i){return i.positionals.map(({value:n})=>n)}})}function SU(r={}){return rn({definition(e,t){var i;e.addRest({name:(i=r.name)!==null&&i!==void 0?i:t,required:r.required})},transformer(e,t,i){let n=o=>{let a=i.positionals[o];return a.extra===Zn||a.extra===!1&&oo)}})}function Lde(r,e,t){let[i,n]=Oo(e,t!=null?t:{}),{arity:s=1}=n,o=r.split(","),a=new Set(o);return rn({definition(l){l.addOption({names:o,arity:n.tolerateBoolean?0:s,hidden:n.hidden,description:n.description,required:n.required})},transformer(l,c,u){let g,f=i;for(let{name:h,value:p}of u.options)!a.has(h)||(g=h,f=p);return typeof f=="string"?up(g!=null?g:c,f,n.validator):f}})}function Tde(r={}){let{required:e=!0}=r;return rn({definition(t,i){var n;t.addPositional({name:(n=r.name)!==null&&n!==void 0?n:i,required:r.required})},transformer(t,i,n){var s;for(let o=0;oYW,areIdentsEqual:()=>fd,areLocatorsEqual:()=>hd,areVirtualPackagesEquivalent:()=>aSe,bindDescriptor:()=>sSe,bindLocator:()=>oSe,convertDescriptorToLocator:()=>Aw,convertLocatorToDescriptor:()=>_x,convertPackageToLocator:()=>nSe,convertToIdent:()=>iSe,convertToManifestRange:()=>cSe,copyPackage:()=>cd,devirtualizeDescriptor:()=>ud,devirtualizeLocator:()=>gd,getIdentVendorPath:()=>ek,isPackageCompatible:()=>gw,isVirtualDescriptor:()=>Al,isVirtualLocator:()=>ea,makeDescriptor:()=>rr,makeIdent:()=>$o,makeLocator:()=>cn,makeRange:()=>cw,parseDescriptor:()=>ll,parseFileStyleRange:()=>ASe,parseIdent:()=>An,parseLocator:()=>Yc,parseRange:()=>qg,prettyDependent:()=>Lv,prettyDescriptor:()=>sr,prettyIdent:()=>fi,prettyLocator:()=>It,prettyLocatorNoColors:()=>$x,prettyRange:()=>aw,prettyReference:()=>dd,prettyResolution:()=>Tv,prettyWorkspace:()=>Cd,renamePackage:()=>ld,slugifyIdent:()=>Zx,slugifyLocator:()=>Jg,sortDescriptors:()=>Wg,stringifyDescriptor:()=>Pn,stringifyIdent:()=>Ot,stringifyLocator:()=>Rs,tryParseDescriptor:()=>pd,tryParseIdent:()=>qW,tryParseLocator:()=>lw,virtualizeDescriptor:()=>Vx,virtualizePackage:()=>Xx});var Yg=ge(require("querystring")),HW=ge(ri()),jW=ge(nY());var ae={};ft(ae,{LogLevel:()=>ho,Style:()=>Tc,Type:()=>qe,addLogFilterSupport:()=>nd,applyColor:()=>ns,applyHyperlink:()=>Mg,applyStyle:()=>Ry,json:()=>Oc,jsonOrPretty:()=>KBe,mark:()=>Hv,pretty:()=>tt,prettyField:()=>_o,prettyList:()=>Uv,supportsColor:()=>Py,supportsHyperlinks:()=>Mv,tuple:()=>fo});var rd=ge(uv()),id=ge(Ic());var sJ=ge(is()),oJ=ge(Jq());var Se={};ft(Se,{AsyncActions:()=>$q,BufferStream:()=>Zq,CachingStrategy:()=>Lc,DefaultStream:()=>eJ,allSettledSafe:()=>go,assertNever:()=>Pv,bufferStream:()=>Tg,buildIgnorePattern:()=>LBe,convertMapsToIndexableObjects:()=>ky,dynamicRequire:()=>Og,escapeRegExp:()=>PBe,getArrayWithDefault:()=>Fg,getFactoryWithDefault:()=>_a,getMapWithDefault:()=>Ng,getSetWithDefault:()=>Nc,isIndexableObject:()=>Dv,isPathLike:()=>TBe,isTaggedYarnVersion:()=>kBe,mapAndFilter:()=>zo,mapAndFind:()=>$p,overrideType:()=>kv,parseBoolean:()=>td,parseOptionalBoolean:()=>nJ,prettifyAsyncErrors:()=>Lg,prettifySyncErrors:()=>Rv,releaseAfterUseAsync:()=>RBe,replaceEnvVariables:()=>Fv,sortMap:()=>kn,tryParseOptionalBoolean:()=>Nv,validateEnum:()=>DBe});var Wq=ge(is()),zq=ge(gg()),_q=ge(ri()),xv=ge(require("stream"));function kBe(r){return!!(_q.default.valid(r)&&r.match(/^[^-]+(-rc\.[0-9]+)?$/))}function PBe(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function kv(r){}function Pv(r){throw new Error(`Assertion failed: Unexpected object '${r}'`)}function DBe(r,e){let t=Object.values(r);if(!t.includes(e))throw new Pe(`Invalid value for enumeration: ${JSON.stringify(e)} (expected one of ${t.map(i=>JSON.stringify(i)).join(", ")})`);return e}function zo(r,e){let t=[];for(let i of r){let n=e(i);n!==Vq&&t.push(n)}return t}var Vq=Symbol();zo.skip=Vq;function $p(r,e){for(let t of r){let i=e(t);if(i!==Xq)return i}}var Xq=Symbol();$p.skip=Xq;function Dv(r){return typeof r=="object"&&r!==null}async function go(r){let e=await Promise.allSettled(r),t=[];for(let i of e){if(i.status==="rejected")throw i.reason;t.push(i.value)}return t}function ky(r){if(r instanceof Map&&(r=Object.fromEntries(r)),Dv(r))for(let e of Object.keys(r)){let t=r[e];Dv(t)&&(r[e]=ky(t))}return r}function _a(r,e,t){let i=r.get(e);return typeof i=="undefined"&&r.set(e,i=t()),i}function Fg(r,e){let t=r.get(e);return typeof t=="undefined"&&r.set(e,t=[]),t}function Nc(r,e){let t=r.get(e);return typeof t=="undefined"&&r.set(e,t=new Set),t}function Ng(r,e){let t=r.get(e);return typeof t=="undefined"&&r.set(e,t=new Map),t}async function RBe(r,e){if(e==null)return await r();try{return await r()}finally{await e()}}async function Lg(r,e){try{return await r()}catch(t){throw t.message=e(t.message),t}}function Rv(r,e){try{return r()}catch(t){throw t.message=e(t.message),t}}async function Tg(r){return await new Promise((e,t)=>{let i=[];r.on("error",n=>{t(n)}),r.on("data",n=>{i.push(n)}),r.on("end",()=>{e(Buffer.concat(i))})})}var Zq=class extends xv.Transform{constructor(){super(...arguments);this.chunks=[]}_transform(e,t,i){if(t!=="buffer"||!Buffer.isBuffer(e))throw new Error("Assertion failed: BufferStream only accept buffers");this.chunks.push(e),i(null,null)}_flush(e){e(null,Buffer.concat(this.chunks))}};function FBe(){let r,e;return{promise:new Promise((i,n)=>{r=i,e=n}),resolve:r,reject:e}}var $q=class{constructor(e){this.deferred=new Map;this.promises=new Map;this.limit=(0,zq.default)(e)}set(e,t){let i=this.deferred.get(e);typeof i=="undefined"&&this.deferred.set(e,i=FBe());let n=this.limit(()=>t());return this.promises.set(e,n),n.then(()=>{this.promises.get(e)===n&&i.resolve()},s=>{this.promises.get(e)===n&&i.reject(s)}),i.promise}reduce(e,t){var n;let i=(n=this.promises.get(e))!=null?n:Promise.resolve();this.set(e,()=>t(i))}async wait(){await Promise.all(this.promises.values())}},eJ=class extends xv.Transform{constructor(e=Buffer.alloc(0)){super();this.active=!0;this.ifEmpty=e}_transform(e,t,i){if(t!=="buffer"||!Buffer.isBuffer(e))throw new Error("Assertion failed: DefaultStream only accept buffers");this.active=!1,i(null,e)}_flush(e){this.active&&this.ifEmpty.length>0?e(null,this.ifEmpty):e(null)}},ed=eval("require");function tJ(r){return ed(H.fromPortablePath(r))}function rJ(path){let physicalPath=H.fromPortablePath(path),currentCacheEntry=ed.cache[physicalPath];delete ed.cache[physicalPath];let result;try{result=tJ(physicalPath);let freshCacheEntry=ed.cache[physicalPath],dynamicModule=eval("module"),freshCacheIndex=dynamicModule.children.indexOf(freshCacheEntry);freshCacheIndex!==-1&&dynamicModule.children.splice(freshCacheIndex,1)}finally{ed.cache[physicalPath]=currentCacheEntry}return result}var iJ=new Map;function NBe(r){let e=iJ.get(r),t=K.statSync(r);if((e==null?void 0:e.mtime)===t.mtimeMs)return e.instance;let i=rJ(r);return iJ.set(r,{mtime:t.mtimeMs,instance:i}),i}var Lc;(function(i){i[i.NoCache=0]="NoCache",i[i.FsTime=1]="FsTime",i[i.Node=2]="Node"})(Lc||(Lc={}));function Og(r,{cachingStrategy:e=2}={}){switch(e){case 0:return rJ(r);case 1:return NBe(r);case 2:return tJ(r);default:throw new Error("Unsupported caching strategy")}}function kn(r,e){let t=Array.from(r);Array.isArray(e)||(e=[e]);let i=[];for(let s of e)i.push(t.map(o=>s(o)));let n=t.map((s,o)=>o);return n.sort((s,o)=>{for(let a of i){let l=a[s]a[o]?1:0;if(l!==0)return l}return 0}),n.map(s=>t[s])}function LBe(r){return r.length===0?null:r.map(e=>`(${Wq.default.makeRe(e,{windows:!1,dot:!0}).source})`).join("|")}function Fv(r,{env:e}){let t=/\${(?[\d\w_]+)(?:)?(?:-(?[^}]*))?}/g;return r.replace(t,(...i)=>{let{variableName:n,colon:s,fallback:o}=i[i.length-1],a=Object.prototype.hasOwnProperty.call(e,n),l=e[n];if(l||a&&!s)return l;if(o!=null)return o;throw new Pe(`Environment variable not found (${n})`)})}function td(r){switch(r){case"true":case"1":case 1:case!0:return!0;case"false":case"0":case 0:case!1:return!1;default:throw new Error(`Couldn't parse "${r}" as a boolean`)}}function nJ(r){return typeof r=="undefined"?r:td(r)}function Nv(r){try{return nJ(r)}catch{return null}}function TBe(r){return!!(H.isAbsolute(r)||r.match(/^(\.{1,2}|~)\//))}var Qt;(function(t){t.HARD="HARD",t.SOFT="SOFT"})(Qt||(Qt={}));var wi;(function(i){i.Dependency="Dependency",i.PeerDependency="PeerDependency",i.PeerDependencyMeta="PeerDependencyMeta"})(wi||(wi={}));var qi;(function(i){i.Inactive="inactive",i.Redundant="redundant",i.Active="active"})(qi||(qi={}));var qe={NO_HINT:"NO_HINT",NULL:"NULL",SCOPE:"SCOPE",NAME:"NAME",RANGE:"RANGE",REFERENCE:"REFERENCE",NUMBER:"NUMBER",PATH:"PATH",URL:"URL",ADDED:"ADDED",REMOVED:"REMOVED",CODE:"CODE",DURATION:"DURATION",SIZE:"SIZE",IDENT:"IDENT",DESCRIPTOR:"DESCRIPTOR",LOCATOR:"LOCATOR",RESOLUTION:"RESOLUTION",DEPENDENT:"DEPENDENT",PACKAGE_EXTENSION:"PACKAGE_EXTENSION",SETTING:"SETTING",MARKDOWN:"MARKDOWN"},Tc;(function(e){e[e.BOLD=2]="BOLD"})(Tc||(Tc={}));var Ov=id.default.GITHUB_ACTIONS?{level:2}:rd.default.supportsColor?{level:rd.default.supportsColor.level}:{level:0},Py=Ov.level!==0,Mv=Py&&!id.default.GITHUB_ACTIONS&&!id.default.CIRCLE&&!id.default.GITLAB,Kv=new rd.default.Instance(Ov),OBe=new Map([[qe.NO_HINT,null],[qe.NULL,["#a853b5",129]],[qe.SCOPE,["#d75f00",166]],[qe.NAME,["#d7875f",173]],[qe.RANGE,["#00afaf",37]],[qe.REFERENCE,["#87afff",111]],[qe.NUMBER,["#ffd700",220]],[qe.PATH,["#d75fd7",170]],[qe.URL,["#d75fd7",170]],[qe.ADDED,["#5faf00",70]],[qe.REMOVED,["#d70000",160]],[qe.CODE,["#87afff",111]],[qe.SIZE,["#ffd700",220]]]),Fs=r=>r,Dy={[qe.NUMBER]:Fs({pretty:(r,e)=>`${e}`,json:r=>r}),[qe.IDENT]:Fs({pretty:(r,e)=>fi(r,e),json:r=>Ot(r)}),[qe.LOCATOR]:Fs({pretty:(r,e)=>It(r,e),json:r=>Rs(r)}),[qe.DESCRIPTOR]:Fs({pretty:(r,e)=>sr(r,e),json:r=>Pn(r)}),[qe.RESOLUTION]:Fs({pretty:(r,{descriptor:e,locator:t})=>Tv(r,e,t),json:({descriptor:r,locator:e})=>({descriptor:Pn(r),locator:e!==null?Rs(e):null})}),[qe.DEPENDENT]:Fs({pretty:(r,{locator:e,descriptor:t})=>Lv(r,e,t),json:({locator:r,descriptor:e})=>({locator:Rs(r),descriptor:Pn(e)})}),[qe.PACKAGE_EXTENSION]:Fs({pretty:(r,e)=>{switch(e.type){case wi.Dependency:return`${fi(r,e.parentDescriptor)} \u27A4 ${ns(r,"dependencies",qe.CODE)} \u27A4 ${fi(r,e.descriptor)}`;case wi.PeerDependency:return`${fi(r,e.parentDescriptor)} \u27A4 ${ns(r,"peerDependencies",qe.CODE)} \u27A4 ${fi(r,e.descriptor)}`;case wi.PeerDependencyMeta:return`${fi(r,e.parentDescriptor)} \u27A4 ${ns(r,"peerDependenciesMeta",qe.CODE)} \u27A4 ${fi(r,An(e.selector))} \u27A4 ${ns(r,e.key,qe.CODE)}`;default:throw new Error(`Assertion failed: Unsupported package extension type: ${e.type}`)}},json:r=>{switch(r.type){case wi.Dependency:return`${Ot(r.parentDescriptor)} > ${Ot(r.descriptor)}`;case wi.PeerDependency:return`${Ot(r.parentDescriptor)} >> ${Ot(r.descriptor)}`;case wi.PeerDependencyMeta:return`${Ot(r.parentDescriptor)} >> ${r.selector} / ${r.key}`;default:throw new Error(`Assertion failed: Unsupported package extension type: ${r.type}`)}}}),[qe.SETTING]:Fs({pretty:(r,e)=>(r.get(e),Mg(r,ns(r,e,qe.CODE),`https://yarnpkg.com/configuration/yarnrc#${e}`)),json:r=>r}),[qe.DURATION]:Fs({pretty:(r,e)=>{if(e>1e3*60){let t=Math.floor(e/1e3/60),i=Math.ceil((e-t*60*1e3)/1e3);return i===0?`${t}m`:`${t}m ${i}s`}else{let t=Math.floor(e/1e3),i=e-t*1e3;return i===0?`${t}s`:`${t}s ${i}ms`}},json:r=>r}),[qe.SIZE]:Fs({pretty:(r,e)=>{let t=["KB","MB","GB","TB"],i=t.length;for(;i>1&&e<1024**i;)i-=1;let n=1024**i,s=Math.floor(e*100/n)/100;return ns(r,`${s} ${t[i-1]}`,qe.NUMBER)},json:r=>r}),[qe.PATH]:Fs({pretty:(r,e)=>ns(r,H.fromPortablePath(e),qe.PATH),json:r=>H.fromPortablePath(r)}),[qe.MARKDOWN]:Fs({pretty:(r,{text:e,format:t,paragraphs:i})=>Ui(e,{format:t,paragraphs:i}),json:({text:r})=>r})};function fo(r,e){return[e,r]}function Ry(r,e,t){return r.get("enableColors")&&t&2&&(e=rd.default.bold(e)),e}function ns(r,e,t){if(!r.get("enableColors"))return e;let i=OBe.get(t);if(i===null)return e;let n=typeof i=="undefined"?t:Ov.level>=3?i[0]:i[1],s=typeof n=="number"?Kv.ansi256(n):n.startsWith("#")?Kv.hex(n):Kv[n];if(typeof s!="function")throw new Error(`Invalid format type ${n}`);return s(e)}var MBe=!!process.env.KONSOLE_VERSION;function Mg(r,e,t){return r.get("enableHyperlinks")?MBe?`]8;;${t}\\${e}]8;;\\`:`]8;;${t}\x07${e}]8;;\x07`:e}function tt(r,e,t){if(e===null)return ns(r,"null",qe.NULL);if(Object.prototype.hasOwnProperty.call(Dy,t))return Dy[t].pretty(r,e);if(typeof e!="string")throw new Error(`Assertion failed: Expected the value to be a string, got ${typeof e}`);return ns(r,e,t)}function Uv(r,e,t,{separator:i=", "}={}){return[...e].map(n=>tt(r,n,t)).join(i)}function Oc(r,e){if(r===null)return null;if(Object.prototype.hasOwnProperty.call(Dy,e))return kv(e),Dy[e].json(r);if(typeof r!="string")throw new Error(`Assertion failed: Expected the value to be a string, got ${typeof r}`);return r}function KBe(r,e,[t,i]){return r?Oc(t,i):tt(e,t,i)}function Hv(r){return{Check:ns(r,"\u2713","green"),Cross:ns(r,"\u2718","red"),Question:ns(r,"?","cyan")}}function _o(r,{label:e,value:[t,i]}){return`${tt(r,e,qe.CODE)}: ${tt(r,t,i)}`}var ho;(function(n){n.Error="error",n.Warning="warning",n.Info="info",n.Discard="discard"})(ho||(ho={}));function nd(r,{configuration:e}){let t=e.get("logFilters"),i=new Map,n=new Map,s=[];for(let g of t){let f=g.get("level");if(typeof f=="undefined")continue;let h=g.get("code");typeof h!="undefined"&&i.set(h,f);let p=g.get("text");typeof p!="undefined"&&n.set(p,f);let m=g.get("pattern");typeof m!="undefined"&&s.push([sJ.default.matcher(m,{contains:!0}),f])}s.reverse();let o=(g,f,h)=>{if(g===null||g===X.UNNAMED)return h;let p=n.size>0||s.length>0?(0,oJ.default)(f):f;if(n.size>0){let m=n.get(p);if(typeof m!="undefined")return m!=null?m:h}if(s.length>0){for(let[m,y]of s)if(m(p))return y!=null?y:h}if(i.size>0){let m=i.get(_A(g));if(typeof m!="undefined")return m!=null?m:h}return h},a=r.reportInfo,l=r.reportWarning,c=r.reportError,u=function(g,f,h,p){switch(o(f,h,p)){case ho.Info:a.call(g,f,h);break;case ho.Warning:l.call(g,f!=null?f:X.UNNAMED,h);break;case ho.Error:c.call(g,f!=null?f:X.UNNAMED,h);break}};r.reportInfo=function(...g){return u(this,...g,ho.Info)},r.reportWarning=function(...g){return u(this,...g,ho.Warning)},r.reportError=function(...g){return u(this,...g,ho.Error)}}var Dn={};ft(Dn,{checksumFile:()=>sw,checksumPattern:()=>ow,makeHash:()=>ln});var nw=ge(require("crypto")),zx=ge(Wx());function ln(...r){let e=(0,nw.createHash)("sha512"),t="";for(let i of r)typeof i=="string"?t+=i:i&&(t&&(e.update(t),t=""),e.update(i));return t&&e.update(t),e.digest("hex")}async function sw(r,{baseFs:e,algorithm:t}={baseFs:K,algorithm:"sha512"}){let i=await e.openPromise(r,"r");try{let n=65536,s=Buffer.allocUnsafeSlow(n),o=(0,nw.createHash)(t),a=0;for(;(a=await e.readPromise(i,s,0,n))!==0;)o.update(a===n?s:s.slice(0,a));return o.digest("hex")}finally{await e.closePromise(i)}}async function ow(r,{cwd:e}){let i=(await(0,zx.default)(r,{cwd:H.fromPortablePath(e),expandDirectories:!1,onlyDirectories:!0,unique:!0})).map(a=>`${a}/**/*`),n=await(0,zx.default)([r,...i],{cwd:H.fromPortablePath(e),expandDirectories:!1,onlyFiles:!1,unique:!0});n.sort();let s=await Promise.all(n.map(async a=>{let l=[Buffer.from(a)],c=H.toPortablePath(a),u=await K.lstatPromise(c);return u.isSymbolicLink()?l.push(Buffer.from(await K.readlinkPromise(c))):u.isFile()&&l.push(await K.readFilePromise(c)),l.join("\0")})),o=(0,nw.createHash)("sha512");for(let a of s)o.update(a);return o.digest("hex")}var Ad="virtual:",tSe=5,GW=/(os|cpu|libc)=([a-z0-9_-]+)/,rSe=(0,jW.makeParser)(GW);function $o(r,e){if(r==null?void 0:r.startsWith("@"))throw new Error("Invalid scope: don't prefix it with '@'");return{identHash:ln(r,e),scope:r,name:e}}function rr(r,e){return{identHash:r.identHash,scope:r.scope,name:r.name,descriptorHash:ln(r.identHash,e),range:e}}function cn(r,e){return{identHash:r.identHash,scope:r.scope,name:r.name,locatorHash:ln(r.identHash,e),reference:e}}function iSe(r){return{identHash:r.identHash,scope:r.scope,name:r.name}}function Aw(r){return{identHash:r.identHash,scope:r.scope,name:r.name,locatorHash:r.descriptorHash,reference:r.range}}function _x(r){return{identHash:r.identHash,scope:r.scope,name:r.name,descriptorHash:r.locatorHash,range:r.reference}}function nSe(r){return{identHash:r.identHash,scope:r.scope,name:r.name,locatorHash:r.locatorHash,reference:r.reference}}function ld(r,e){return{identHash:e.identHash,scope:e.scope,name:e.name,locatorHash:e.locatorHash,reference:e.reference,version:r.version,languageName:r.languageName,linkType:r.linkType,conditions:r.conditions,dependencies:new Map(r.dependencies),peerDependencies:new Map(r.peerDependencies),dependenciesMeta:new Map(r.dependenciesMeta),peerDependenciesMeta:new Map(r.peerDependenciesMeta),bin:new Map(r.bin)}}function cd(r){return ld(r,r)}function Vx(r,e){if(e.includes("#"))throw new Error("Invalid entropy");return rr(r,`virtual:${e}#${r.range}`)}function Xx(r,e){if(e.includes("#"))throw new Error("Invalid entropy");return ld(r,cn(r,`virtual:${e}#${r.reference}`))}function Al(r){return r.range.startsWith(Ad)}function ea(r){return r.reference.startsWith(Ad)}function ud(r){if(!Al(r))throw new Error("Not a virtual descriptor");return rr(r,r.range.replace(/^[^#]*#/,""))}function gd(r){if(!ea(r))throw new Error("Not a virtual descriptor");return cn(r,r.reference.replace(/^[^#]*#/,""))}function sSe(r,e){return r.range.includes("::")?r:rr(r,`${r.range}::${Yg.default.stringify(e)}`)}function oSe(r,e){return r.reference.includes("::")?r:cn(r,`${r.reference}::${Yg.default.stringify(e)}`)}function fd(r,e){return r.identHash===e.identHash}function YW(r,e){return r.descriptorHash===e.descriptorHash}function hd(r,e){return r.locatorHash===e.locatorHash}function aSe(r,e){if(!ea(r))throw new Error("Invalid package type");if(!ea(e))throw new Error("Invalid package type");if(!fd(r,e)||r.dependencies.size!==e.dependencies.size)return!1;for(let t of r.dependencies.values()){let i=e.dependencies.get(t.identHash);if(!i||!YW(t,i))return!1}return!0}function An(r){let e=qW(r);if(!e)throw new Error(`Invalid ident (${r})`);return e}function qW(r){let e=r.match(/^(?:@([^/]+?)\/)?([^/]+)$/);if(!e)return null;let[,t,i]=e,n=typeof t!="undefined"?t:null;return $o(n,i)}function ll(r,e=!1){let t=pd(r,e);if(!t)throw new Error(`Invalid descriptor (${r})`);return t}function pd(r,e=!1){let t=e?r.match(/^(?:@([^/]+?)\/)?([^/]+?)(?:@(.+))$/):r.match(/^(?:@([^/]+?)\/)?([^/]+?)(?:@(.+))?$/);if(!t)return null;let[,i,n,s]=t;if(s==="unknown")throw new Error(`Invalid range (${r})`);let o=typeof i!="undefined"?i:null,a=typeof s!="undefined"?s:"unknown";return rr($o(o,n),a)}function Yc(r,e=!1){let t=lw(r,e);if(!t)throw new Error(`Invalid locator (${r})`);return t}function lw(r,e=!1){let t=e?r.match(/^(?:@([^/]+?)\/)?([^/]+?)(?:@(.+))$/):r.match(/^(?:@([^/]+?)\/)?([^/]+?)(?:@(.+))?$/);if(!t)return null;let[,i,n,s]=t;if(s==="unknown")throw new Error(`Invalid reference (${r})`);let o=typeof i!="undefined"?i:null,a=typeof s!="undefined"?s:"unknown";return cn($o(o,n),a)}function qg(r,e){let t=r.match(/^([^#:]*:)?((?:(?!::)[^#])*)(?:#((?:(?!::).)*))?(?:::(.*))?$/);if(t===null)throw new Error(`Invalid range (${r})`);let i=typeof t[1]!="undefined"?t[1]:null;if(typeof(e==null?void 0:e.requireProtocol)=="string"&&i!==e.requireProtocol)throw new Error(`Invalid protocol (${i})`);if((e==null?void 0:e.requireProtocol)&&i===null)throw new Error(`Missing protocol (${i})`);let n=typeof t[3]!="undefined"?decodeURIComponent(t[2]):null;if((e==null?void 0:e.requireSource)&&n===null)throw new Error(`Missing source (${r})`);let s=typeof t[3]!="undefined"?decodeURIComponent(t[3]):decodeURIComponent(t[2]),o=(e==null?void 0:e.parseSelector)?Yg.default.parse(s):s,a=typeof t[4]!="undefined"?Yg.default.parse(t[4]):null;return{protocol:i,source:n,selector:o,params:a}}function ASe(r,{protocol:e}){let{selector:t,params:i}=qg(r,{requireProtocol:e,requireBindings:!0});if(typeof i.locator!="string")throw new Error(`Assertion failed: Invalid bindings for ${r}`);return{parentLocator:Yc(i.locator,!0),path:t}}function JW(r){return r=r.replace(/%/g,"%25"),r=r.replace(/:/g,"%3A"),r=r.replace(/#/g,"%23"),r}function lSe(r){return r===null?!1:Object.entries(r).length>0}function cw({protocol:r,source:e,selector:t,params:i}){let n="";return r!==null&&(n+=`${r}`),e!==null&&(n+=`${JW(e)}#`),n+=JW(t),lSe(i)&&(n+=`::${Yg.default.stringify(i)}`),n}function cSe(r){let{params:e,protocol:t,source:i,selector:n}=qg(r);for(let s in e)s.startsWith("__")&&delete e[s];return cw({protocol:t,source:i,params:e,selector:n})}function Ot(r){return r.scope?`@${r.scope}/${r.name}`:`${r.name}`}function Pn(r){return r.scope?`@${r.scope}/${r.name}@${r.range}`:`${r.name}@${r.range}`}function Rs(r){return r.scope?`@${r.scope}/${r.name}@${r.reference}`:`${r.name}@${r.reference}`}function Zx(r){return r.scope!==null?`@${r.scope}-${r.name}`:r.name}function Jg(r){let{protocol:e,selector:t}=qg(r.reference),i=e!==null?e.replace(/:$/,""):"exotic",n=HW.default.valid(t),s=n!==null?`${i}-${n}`:`${i}`,o=10,a=r.scope?`${Zx(r)}-${s}-${r.locatorHash.slice(0,o)}`:`${Zx(r)}-${s}-${r.locatorHash.slice(0,o)}`;return Jr(a)}function fi(r,e){return e.scope?`${tt(r,`@${e.scope}/`,qe.SCOPE)}${tt(r,e.name,qe.NAME)}`:`${tt(r,e.name,qe.NAME)}`}function uw(r){if(r.startsWith(Ad)){let e=uw(r.substring(r.indexOf("#")+1)),t=r.substring(Ad.length,Ad.length+tSe);return`${e} [${t}]`}else return r.replace(/\?.*/,"?[...]")}function aw(r,e){return`${tt(r,uw(e),qe.RANGE)}`}function sr(r,e){return`${fi(r,e)}${tt(r,"@",qe.RANGE)}${aw(r,e.range)}`}function dd(r,e){return`${tt(r,uw(e),qe.REFERENCE)}`}function It(r,e){return`${fi(r,e)}${tt(r,"@",qe.REFERENCE)}${dd(r,e.reference)}`}function $x(r){return`${Ot(r)}@${uw(r.reference)}`}function Wg(r){return kn(r,[e=>Ot(e),e=>e.range])}function Cd(r,e){return fi(r,e.locator)}function Tv(r,e,t){let i=Al(e)?ud(e):e;return t===null?`${sr(r,i)} \u2192 ${Hv(r).Cross}`:i.identHash===t.identHash?`${sr(r,i)} \u2192 ${dd(r,t.reference)}`:`${sr(r,i)} \u2192 ${It(r,t)}`}function Lv(r,e,t){return t===null?`${It(r,e)}`:`${It(r,e)} (via ${aw(r,t.range)})`}function ek(r){return`node_modules/${Ot(r)}`}function gw(r,e){return r.conditions?rSe(r.conditions,t=>{let[,i,n]=t.match(GW),s=e[i];return s?s.includes(n):!0}):!0}var WW={hooks:{reduceDependency:(r,e,t,i,{resolver:n,resolveOptions:s})=>{for(let{pattern:o,reference:a}of e.topLevelWorkspace.manifest.resolutions){if(o.from&&o.from.fullName!==Ot(t)||o.from&&o.from.description&&o.from.description!==t.reference||o.descriptor.fullName!==Ot(r)||o.descriptor.description&&o.descriptor.description!==r.range)continue;return n.bindDescriptor(rr(r,a),e.topLevelWorkspace.anchoredLocator,s)}return r},validateProject:async(r,e)=>{for(let t of r.workspaces){let i=Cd(r.configuration,t);await r.configuration.triggerHook(n=>n.validateWorkspace,t,{reportWarning:(n,s)=>e.reportWarning(n,`${i}: ${s}`),reportError:(n,s)=>e.reportError(n,`${i}: ${s}`)})}},validateWorkspace:async(r,e)=>{let{manifest:t}=r;t.resolutions.length&&r.cwd!==r.project.cwd&&t.errors.push(new Error("Resolutions field will be ignored"));for(let i of t.errors)e.reportWarning(X.INVALID_MANIFEST,i.message)}}};var XW=ge(ri());var md=class{supportsDescriptor(e,t){return!!(e.range.startsWith(md.protocol)||t.project.tryWorkspaceByDescriptor(e)!==null)}supportsLocator(e,t){return!!e.reference.startsWith(md.protocol)}shouldPersistResolution(e,t){return!1}bindDescriptor(e,t,i){return e}getResolutionDependencies(e,t){return[]}async getCandidates(e,t,i){return[i.project.getWorkspaceByDescriptor(e).anchoredLocator]}async getSatisfying(e,t,i){return null}async resolve(e,t){let i=t.project.getWorkspaceByCwd(e.reference.slice(md.protocol.length));return te(N({},e),{version:i.manifest.version||"0.0.0",languageName:"unknown",linkType:Qt.SOFT,conditions:null,dependencies:new Map([...i.manifest.dependencies,...i.manifest.devDependencies]),peerDependencies:new Map([...i.manifest.peerDependencies]),dependenciesMeta:i.manifest.dependenciesMeta,peerDependenciesMeta:i.manifest.peerDependenciesMeta,bin:i.manifest.bin})}},oi=md;oi.protocol="workspace:";var Wt={};ft(Wt,{SemVer:()=>zW.SemVer,clean:()=>gSe,satisfiesWithPrereleases:()=>qc,validRange:()=>po});var fw=ge(ri()),zW=ge(ri()),_W=new Map;function qc(r,e,t=!1){if(!r)return!1;let i=`${e}${t}`,n=_W.get(i);if(typeof n=="undefined")try{n=new fw.default.Range(e,{includePrerelease:!0,loose:t})}catch{return!1}finally{_W.set(i,n||null)}else if(n===null)return!1;let s;try{s=new fw.default.SemVer(r,n)}catch(o){return!1}return n.test(s)?!0:(s.prerelease&&(s.prerelease=[]),n.set.some(o=>{for(let a of o)a.semver.prerelease&&(a.semver.prerelease=[]);return o.every(a=>a.test(s))}))}var VW=new Map;function po(r){if(r.indexOf(":")!==-1)return null;let e=VW.get(r);if(typeof e!="undefined")return e;try{e=new fw.default.Range(r)}catch{e=null}return VW.set(r,e),e}var uSe=/^(?:[\sv=]*?)((0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\s*)$/;function gSe(r){let e=uSe.exec(r);return e?e[1]:null}var cl=class{constructor(){this.indent=" ";this.name=null;this.version=null;this.os=null;this.cpu=null;this.libc=null;this.type=null;this.packageManager=null;this.private=!1;this.license=null;this.main=null;this.module=null;this.browser=null;this.languageName=null;this.bin=new Map;this.scripts=new Map;this.dependencies=new Map;this.devDependencies=new Map;this.peerDependencies=new Map;this.workspaceDefinitions=[];this.dependenciesMeta=new Map;this.peerDependenciesMeta=new Map;this.resolutions=[];this.files=null;this.publishConfig=null;this.installConfig=null;this.preferUnplugged=null;this.raw={};this.errors=[]}static async tryFind(e,{baseFs:t=new ar}={}){let i=k.join(e,"package.json");try{return await cl.fromFile(i,{baseFs:t})}catch(n){if(n.code==="ENOENT")return null;throw n}}static async find(e,{baseFs:t}={}){let i=await cl.tryFind(e,{baseFs:t});if(i===null)throw new Error("Manifest not found");return i}static async fromFile(e,{baseFs:t=new ar}={}){let i=new cl;return await i.loadFile(e,{baseFs:t}),i}static fromText(e){let t=new cl;return t.loadFromText(e),t}static isManifestFieldCompatible(e,t){if(e===null)return!0;let i=!0,n=!1;for(let s of e)if(s[0]==="!"){if(n=!0,t===s.slice(1))return!1}else if(i=!1,s===t)return!0;return n&&i}loadFromText(e){let t;try{t=JSON.parse($W(e)||"{}")}catch(i){throw i.message+=` (when parsing ${e})`,i}this.load(t),this.indent=ZW(e)}async loadFile(e,{baseFs:t=new ar}){let i=await t.readFilePromise(e,"utf8"),n;try{n=JSON.parse($W(i)||"{}")}catch(s){throw s.message+=` (when parsing ${e})`,s}this.load(n),this.indent=ZW(i)}load(e,{yamlCompatibilityMode:t=!1}={}){if(typeof e!="object"||e===null)throw new Error(`Utterly invalid manifest data (${e})`);this.raw=e;let i=[];if(this.name=null,typeof e.name=="string")try{this.name=An(e.name)}catch(s){i.push(new Error("Parsing failed for the 'name' field"))}if(typeof e.version=="string"?this.version=e.version:this.version=null,Array.isArray(e.os)){let s=[];this.os=s;for(let o of e.os)typeof o!="string"?i.push(new Error("Parsing failed for the 'os' field")):s.push(o)}else this.os=null;if(Array.isArray(e.cpu)){let s=[];this.cpu=s;for(let o of e.cpu)typeof o!="string"?i.push(new Error("Parsing failed for the 'cpu' field")):s.push(o)}else this.cpu=null;if(Array.isArray(e.libc)){let s=[];this.libc=s;for(let o of e.libc)typeof o!="string"?i.push(new Error("Parsing failed for the 'libc' field")):s.push(o)}else this.libc=null;if(typeof e.type=="string"?this.type=e.type:this.type=null,typeof e.packageManager=="string"?this.packageManager=e.packageManager:this.packageManager=null,typeof e.private=="boolean"?this.private=e.private:this.private=!1,typeof e.license=="string"?this.license=e.license:this.license=null,typeof e.languageName=="string"?this.languageName=e.languageName:this.languageName=null,typeof e.main=="string"?this.main=un(e.main):this.main=null,typeof e.module=="string"?this.module=un(e.module):this.module=null,e.browser!=null)if(typeof e.browser=="string")this.browser=un(e.browser);else{this.browser=new Map;for(let[s,o]of Object.entries(e.browser))this.browser.set(un(s),typeof o=="string"?un(o):o)}else this.browser=null;if(this.bin=new Map,typeof e.bin=="string")this.name!==null?this.bin.set(this.name.name,un(e.bin)):i.push(new Error("String bin field, but no attached package name"));else if(typeof e.bin=="object"&&e.bin!==null)for(let[s,o]of Object.entries(e.bin)){if(typeof o!="string"){i.push(new Error(`Invalid bin definition for '${s}'`));continue}let a=An(s);this.bin.set(a.name,un(o))}if(this.scripts=new Map,typeof e.scripts=="object"&&e.scripts!==null)for(let[s,o]of Object.entries(e.scripts)){if(typeof o!="string"){i.push(new Error(`Invalid script definition for '${s}'`));continue}this.scripts.set(s,o)}if(this.dependencies=new Map,typeof e.dependencies=="object"&&e.dependencies!==null)for(let[s,o]of Object.entries(e.dependencies)){if(typeof o!="string"){i.push(new Error(`Invalid dependency range for '${s}'`));continue}let a;try{a=An(s)}catch(c){i.push(new Error(`Parsing failed for the dependency name '${s}'`));continue}let l=rr(a,o);this.dependencies.set(l.identHash,l)}if(this.devDependencies=new Map,typeof e.devDependencies=="object"&&e.devDependencies!==null)for(let[s,o]of Object.entries(e.devDependencies)){if(typeof o!="string"){i.push(new Error(`Invalid dependency range for '${s}'`));continue}let a;try{a=An(s)}catch(c){i.push(new Error(`Parsing failed for the dependency name '${s}'`));continue}let l=rr(a,o);this.devDependencies.set(l.identHash,l)}if(this.peerDependencies=new Map,typeof e.peerDependencies=="object"&&e.peerDependencies!==null)for(let[s,o]of Object.entries(e.peerDependencies)){let a;try{a=An(s)}catch(c){i.push(new Error(`Parsing failed for the dependency name '${s}'`));continue}(typeof o!="string"||!o.startsWith(oi.protocol)&&!po(o))&&(i.push(new Error(`Invalid dependency range for '${s}'`)),o="*");let l=rr(a,o);this.peerDependencies.set(l.identHash,l)}typeof e.workspaces=="object"&&e.workspaces!==null&&e.workspaces.nohoist&&i.push(new Error("'nohoist' is deprecated, please use 'installConfig.hoistingLimits' instead"));let n=Array.isArray(e.workspaces)?e.workspaces:typeof e.workspaces=="object"&&e.workspaces!==null&&Array.isArray(e.workspaces.packages)?e.workspaces.packages:[];this.workspaceDefinitions=[];for(let s of n){if(typeof s!="string"){i.push(new Error(`Invalid workspace definition for '${s}'`));continue}this.workspaceDefinitions.push({pattern:s})}if(this.dependenciesMeta=new Map,typeof e.dependenciesMeta=="object"&&e.dependenciesMeta!==null)for(let[s,o]of Object.entries(e.dependenciesMeta)){if(typeof o!="object"||o===null){i.push(new Error(`Invalid meta field for '${s}`));continue}let a=ll(s),l=this.ensureDependencyMeta(a),c=hw(o.built,{yamlCompatibilityMode:t});if(c===null){i.push(new Error(`Invalid built meta field for '${s}'`));continue}let u=hw(o.optional,{yamlCompatibilityMode:t});if(u===null){i.push(new Error(`Invalid optional meta field for '${s}'`));continue}let g=hw(o.unplugged,{yamlCompatibilityMode:t});if(g===null){i.push(new Error(`Invalid unplugged meta field for '${s}'`));continue}Object.assign(l,{built:c,optional:u,unplugged:g})}if(this.peerDependenciesMeta=new Map,typeof e.peerDependenciesMeta=="object"&&e.peerDependenciesMeta!==null)for(let[s,o]of Object.entries(e.peerDependenciesMeta)){if(typeof o!="object"||o===null){i.push(new Error(`Invalid meta field for '${s}'`));continue}let a=ll(s),l=this.ensurePeerDependencyMeta(a),c=hw(o.optional,{yamlCompatibilityMode:t});if(c===null){i.push(new Error(`Invalid optional meta field for '${s}'`));continue}Object.assign(l,{optional:c})}if(this.resolutions=[],typeof e.resolutions=="object"&&e.resolutions!==null)for(let[s,o]of Object.entries(e.resolutions)){if(typeof o!="string"){i.push(new Error(`Invalid resolution entry for '${s}'`));continue}try{this.resolutions.push({pattern:$E(s),reference:o})}catch(a){i.push(a);continue}}if(Array.isArray(e.files)){this.files=new Set;for(let s of e.files){if(typeof s!="string"){i.push(new Error(`Invalid files entry for '${s}'`));continue}this.files.add(s)}}else this.files=null;if(typeof e.publishConfig=="object"&&e.publishConfig!==null){if(this.publishConfig={},typeof e.publishConfig.access=="string"&&(this.publishConfig.access=e.publishConfig.access),typeof e.publishConfig.main=="string"&&(this.publishConfig.main=un(e.publishConfig.main)),typeof e.publishConfig.module=="string"&&(this.publishConfig.module=un(e.publishConfig.module)),e.publishConfig.browser!=null)if(typeof e.publishConfig.browser=="string")this.publishConfig.browser=un(e.publishConfig.browser);else{this.publishConfig.browser=new Map;for(let[s,o]of Object.entries(e.publishConfig.browser))this.publishConfig.browser.set(un(s),typeof o=="string"?un(o):o)}if(typeof e.publishConfig.registry=="string"&&(this.publishConfig.registry=e.publishConfig.registry),typeof e.publishConfig.bin=="string")this.name!==null?this.publishConfig.bin=new Map([[this.name.name,un(e.publishConfig.bin)]]):i.push(new Error("String bin field, but no attached package name"));else if(typeof e.publishConfig.bin=="object"&&e.publishConfig.bin!==null){this.publishConfig.bin=new Map;for(let[s,o]of Object.entries(e.publishConfig.bin)){if(typeof o!="string"){i.push(new Error(`Invalid bin definition for '${s}'`));continue}this.publishConfig.bin.set(s,un(o))}}if(Array.isArray(e.publishConfig.executableFiles)){this.publishConfig.executableFiles=new Set;for(let s of e.publishConfig.executableFiles){if(typeof s!="string"){i.push(new Error("Invalid executable file definition"));continue}this.publishConfig.executableFiles.add(un(s))}}}else this.publishConfig=null;if(typeof e.installConfig=="object"&&e.installConfig!==null){this.installConfig={};for(let s of Object.keys(e.installConfig))s==="hoistingLimits"?typeof e.installConfig.hoistingLimits=="string"?this.installConfig.hoistingLimits=e.installConfig.hoistingLimits:i.push(new Error("Invalid hoisting limits definition")):s=="selfReferences"?typeof e.installConfig.selfReferences=="boolean"?this.installConfig.selfReferences=e.installConfig.selfReferences:i.push(new Error("Invalid selfReferences definition, must be a boolean value")):i.push(new Error(`Unrecognized installConfig key: ${s}`))}else this.installConfig=null;if(typeof e.optionalDependencies=="object"&&e.optionalDependencies!==null)for(let[s,o]of Object.entries(e.optionalDependencies)){if(typeof o!="string"){i.push(new Error(`Invalid dependency range for '${s}'`));continue}let a;try{a=An(s)}catch(g){i.push(new Error(`Parsing failed for the dependency name '${s}'`));continue}let l=rr(a,o);this.dependencies.set(l.identHash,l);let c=rr(a,"unknown"),u=this.ensureDependencyMeta(c);Object.assign(u,{optional:!0})}typeof e.preferUnplugged=="boolean"?this.preferUnplugged=e.preferUnplugged:this.preferUnplugged=null,this.errors=i}getForScope(e){switch(e){case"dependencies":return this.dependencies;case"devDependencies":return this.devDependencies;case"peerDependencies":return this.peerDependencies;default:throw new Error(`Unsupported value ("${e}")`)}}hasConsumerDependency(e){return!!(this.dependencies.has(e.identHash)||this.peerDependencies.has(e.identHash))}hasHardDependency(e){return!!(this.dependencies.has(e.identHash)||this.devDependencies.has(e.identHash))}hasSoftDependency(e){return!!this.peerDependencies.has(e.identHash)}hasDependency(e){return!!(this.hasHardDependency(e)||this.hasSoftDependency(e))}getConditions(){let e=[];return this.os&&this.os.length>0&&e.push(tk("os",this.os)),this.cpu&&this.cpu.length>0&&e.push(tk("cpu",this.cpu)),this.libc&&this.libc.length>0&&e.push(tk("libc",this.libc)),e.length>0?e.join(" & "):null}isCompatibleWithOS(e){return cl.isManifestFieldCompatible(this.os,e)}isCompatibleWithCPU(e){return cl.isManifestFieldCompatible(this.cpu,e)}ensureDependencyMeta(e){if(e.range!=="unknown"&&!XW.default.valid(e.range))throw new Error(`Invalid meta field range for '${Pn(e)}'`);let t=Ot(e),i=e.range!=="unknown"?e.range:null,n=this.dependenciesMeta.get(t);n||this.dependenciesMeta.set(t,n=new Map);let s=n.get(i);return s||n.set(i,s={}),s}ensurePeerDependencyMeta(e){if(e.range!=="unknown")throw new Error(`Invalid meta field range for '${Pn(e)}'`);let t=Ot(e),i=this.peerDependenciesMeta.get(t);return i||this.peerDependenciesMeta.set(t,i={}),i}setRawField(e,t,{after:i=[]}={}){let n=new Set(i.filter(s=>Object.prototype.hasOwnProperty.call(this.raw,s)));if(n.size===0||Object.prototype.hasOwnProperty.call(this.raw,e))this.raw[e]=t;else{let s=this.raw,o=this.raw={},a=!1;for(let l of Object.keys(s))o[l]=s[l],a||(n.delete(l),n.size===0&&(o[e]=t,a=!0))}}exportTo(e,{compatibilityMode:t=!0}={}){var s;if(Object.assign(e,this.raw),this.name!==null?e.name=Ot(this.name):delete e.name,this.version!==null?e.version=this.version:delete e.version,this.os!==null?e.os=this.os:delete e.os,this.cpu!==null?e.cpu=this.cpu:delete e.cpu,this.type!==null?e.type=this.type:delete e.type,this.packageManager!==null?e.packageManager=this.packageManager:delete e.packageManager,this.private?e.private=!0:delete e.private,this.license!==null?e.license=this.license:delete e.license,this.languageName!==null?e.languageName=this.languageName:delete e.languageName,this.main!==null?e.main=this.main:delete e.main,this.module!==null?e.module=this.module:delete e.module,this.browser!==null){let o=this.browser;typeof o=="string"?e.browser=o:o instanceof Map&&(e.browser=Object.assign({},...Array.from(o.keys()).sort().map(a=>({[a]:o.get(a)}))))}else delete e.browser;this.bin.size===1&&this.name!==null&&this.bin.has(this.name.name)?e.bin=this.bin.get(this.name.name):this.bin.size>0?e.bin=Object.assign({},...Array.from(this.bin.keys()).sort().map(o=>({[o]:this.bin.get(o)}))):delete e.bin,this.workspaceDefinitions.length>0?this.raw.workspaces&&!Array.isArray(this.raw.workspaces)?e.workspaces=te(N({},this.raw.workspaces),{packages:this.workspaceDefinitions.map(({pattern:o})=>o)}):e.workspaces=this.workspaceDefinitions.map(({pattern:o})=>o):this.raw.workspaces&&!Array.isArray(this.raw.workspaces)&&Object.keys(this.raw.workspaces).length>0?e.workspaces=this.raw.workspaces:delete e.workspaces;let i=[],n=[];for(let o of this.dependencies.values()){let a=this.dependenciesMeta.get(Ot(o)),l=!1;if(t&&a){let c=a.get(null);c&&c.optional&&(l=!0)}l?n.push(o):i.push(o)}i.length>0?e.dependencies=Object.assign({},...Wg(i).map(o=>({[Ot(o)]:o.range}))):delete e.dependencies,n.length>0?e.optionalDependencies=Object.assign({},...Wg(n).map(o=>({[Ot(o)]:o.range}))):delete e.optionalDependencies,this.devDependencies.size>0?e.devDependencies=Object.assign({},...Wg(this.devDependencies.values()).map(o=>({[Ot(o)]:o.range}))):delete e.devDependencies,this.peerDependencies.size>0?e.peerDependencies=Object.assign({},...Wg(this.peerDependencies.values()).map(o=>({[Ot(o)]:o.range}))):delete e.peerDependencies,e.dependenciesMeta={};for(let[o,a]of kn(this.dependenciesMeta.entries(),([l,c])=>l))for(let[l,c]of kn(a.entries(),([u,g])=>u!==null?`0${u}`:"1")){let u=l!==null?Pn(rr(An(o),l)):o,g=N({},c);t&&l===null&&delete g.optional,Object.keys(g).length!==0&&(e.dependenciesMeta[u]=g)}if(Object.keys(e.dependenciesMeta).length===0&&delete e.dependenciesMeta,this.peerDependenciesMeta.size>0?e.peerDependenciesMeta=Object.assign({},...kn(this.peerDependenciesMeta.entries(),([o,a])=>o).map(([o,a])=>({[o]:a}))):delete e.peerDependenciesMeta,this.resolutions.length>0?e.resolutions=Object.assign({},...this.resolutions.map(({pattern:o,reference:a})=>({[eI(o)]:a}))):delete e.resolutions,this.files!==null?e.files=Array.from(this.files):delete e.files,this.preferUnplugged!==null?e.preferUnplugged=this.preferUnplugged:delete e.preferUnplugged,this.scripts!==null&&this.scripts.size>0){(s=e.scripts)!=null||(e.scripts={});for(let o of Object.keys(e.scripts))this.scripts.has(o)||delete e.scripts[o];for(let[o,a]of this.scripts.entries())e.scripts[o]=a}else delete e.scripts;return e}},At=cl;At.fileName="package.json",At.allDependencies=["dependencies","devDependencies","peerDependencies"],At.hardDependencies=["dependencies","devDependencies"];function ZW(r){let e=r.match(/^[ \t]+/m);return e?e[0]:" "}function $W(r){return r.charCodeAt(0)===65279?r.slice(1):r}function un(r){return r.replace(/\\/g,"/")}function hw(r,{yamlCompatibilityMode:e}){return e?Nv(r):typeof r=="undefined"||typeof r=="boolean"?r:null}function e4(r,e){let t=e.search(/[^!]/);if(t===-1)return"invalid";let i=t%2==0?"":"!",n=e.slice(t);return`${i}${r}=${n}`}function tk(r,e){return e.length===1?e4(r,e[0]):`(${e.map(t=>e4(r,t)).join(" | ")})`}var D4=ge(P4()),R4=ge(require("stream")),F4=ge(require("string_decoder"));var sve=15,ct=class extends Error{constructor(e,t,i){super(t);this.reportExtra=i;this.reportCode=e}};function ove(r){return typeof r.reportCode!="undefined"}var Ji=class{constructor(){this.reportedInfos=new Set;this.reportedWarnings=new Set;this.reportedErrors=new Set}static progressViaCounter(e){let t=0,i,n=new Promise(l=>{i=l}),s=l=>{let c=i;n=new Promise(u=>{i=u}),t=l,c()},o=(l=0)=>{s(t+1)},a=async function*(){for(;t{t=o}),n=(0,D4.default)(o=>{let a=t;i=new Promise(l=>{t=l}),e=o,a()},1e3/sve),s=async function*(){for(;;)await i,yield{title:e}}();return{[Symbol.asyncIterator](){return s},hasProgress:!1,hasTitle:!0,setTitle:n}}async startProgressPromise(e,t){let i=this.reportProgress(e);try{return await t(e)}finally{i.stop()}}startProgressSync(e,t){let i=this.reportProgress(e);try{return t(e)}finally{i.stop()}}reportInfoOnce(e,t,i){var s;let n=i&&i.key?i.key:t;this.reportedInfos.has(n)||(this.reportedInfos.add(n),this.reportInfo(e,t),(s=i==null?void 0:i.reportExtra)==null||s.call(i,this))}reportWarningOnce(e,t,i){var s;let n=i&&i.key?i.key:t;this.reportedWarnings.has(n)||(this.reportedWarnings.add(n),this.reportWarning(e,t),(s=i==null?void 0:i.reportExtra)==null||s.call(i,this))}reportErrorOnce(e,t,i){var s;let n=i&&i.key?i.key:t;this.reportedErrors.has(n)||(this.reportedErrors.add(n),this.reportError(e,t),(s=i==null?void 0:i.reportExtra)==null||s.call(i,this))}reportExceptionOnce(e){ove(e)?this.reportErrorOnce(e.reportCode,e.message,{key:e,reportExtra:e.reportExtra}):this.reportErrorOnce(X.EXCEPTION,e.stack||e.message,{key:e})}createStreamReporter(e=null){let t=new R4.PassThrough,i=new F4.StringDecoder,n="";return t.on("data",s=>{let o=i.write(s),a;do if(a=o.indexOf(` -`),a!==-1){let l=n+o.substring(0,a);o=o.substring(a+1),n="",e!==null?this.reportInfo(null,`${e} ${l}`):this.reportInfo(null,l)}while(a!==-1);n+=o}),t.on("end",()=>{let s=i.end();s!==""&&(e!==null?this.reportInfo(null,`${e} ${s}`):this.reportInfo(null,s))}),t}};var yd=class{constructor(e){this.fetchers=e}supports(e,t){return!!this.tryFetcher(e,t)}getLocalPath(e,t){return this.getFetcher(e,t).getLocalPath(e,t)}async fetch(e,t){return await this.getFetcher(e,t).fetch(e,t)}tryFetcher(e,t){let i=this.fetchers.find(n=>n.supports(e,t));return i||null}getFetcher(e,t){let i=this.fetchers.find(n=>n.supports(e,t));if(!i)throw new ct(X.FETCHER_NOT_FOUND,`${It(t.project.configuration,e)} isn't supported by any available fetcher`);return i}};var wd=class{constructor(e){this.resolvers=e.filter(t=>t)}supportsDescriptor(e,t){return!!this.tryResolverByDescriptor(e,t)}supportsLocator(e,t){return!!this.tryResolverByLocator(e,t)}shouldPersistResolution(e,t){return this.getResolverByLocator(e,t).shouldPersistResolution(e,t)}bindDescriptor(e,t,i){return this.getResolverByDescriptor(e,i).bindDescriptor(e,t,i)}getResolutionDependencies(e,t){return this.getResolverByDescriptor(e,t).getResolutionDependencies(e,t)}async getCandidates(e,t,i){return await this.getResolverByDescriptor(e,i).getCandidates(e,t,i)}async getSatisfying(e,t,i){return this.getResolverByDescriptor(e,i).getSatisfying(e,t,i)}async resolve(e,t){return await this.getResolverByLocator(e,t).resolve(e,t)}tryResolverByDescriptor(e,t){let i=this.resolvers.find(n=>n.supportsDescriptor(e,t));return i||null}getResolverByDescriptor(e,t){let i=this.resolvers.find(n=>n.supportsDescriptor(e,t));if(!i)throw new Error(`${sr(t.project.configuration,e)} isn't supported by any available resolver`);return i}tryResolverByLocator(e,t){let i=this.resolvers.find(n=>n.supportsLocator(e,t));return i||null}getResolverByLocator(e,t){let i=this.resolvers.find(n=>n.supportsLocator(e,t));if(!i)throw new Error(`${It(t.project.configuration,e)} isn't supported by any available resolver`);return i}};var N4=ge(ri());var zg=/^(?!v)[a-z0-9._-]+$/i,nk=class{supportsDescriptor(e,t){return!!(po(e.range)||zg.test(e.range))}supportsLocator(e,t){return!!(N4.default.valid(e.reference)||zg.test(e.reference))}shouldPersistResolution(e,t){return t.resolver.shouldPersistResolution(this.forwardLocator(e,t),t)}bindDescriptor(e,t,i){return i.resolver.bindDescriptor(this.forwardDescriptor(e,i),t,i)}getResolutionDependencies(e,t){return t.resolver.getResolutionDependencies(this.forwardDescriptor(e,t),t)}async getCandidates(e,t,i){return await i.resolver.getCandidates(this.forwardDescriptor(e,i),t,i)}async getSatisfying(e,t,i){return await i.resolver.getSatisfying(this.forwardDescriptor(e,i),t,i)}async resolve(e,t){let i=await t.resolver.resolve(this.forwardLocator(e,t),t);return ld(i,e)}forwardDescriptor(e,t){return rr(e,`${t.project.configuration.get("defaultProtocol")}${e.range}`)}forwardLocator(e,t){return cn(e,`${t.project.configuration.get("defaultProtocol")}${e.reference}`)}};var Bd=class{supports(e){return!!e.reference.startsWith("virtual:")}getLocalPath(e,t){let i=e.reference.indexOf("#");if(i===-1)throw new Error("Invalid virtual package reference");let n=e.reference.slice(i+1),s=cn(e,n);return t.fetcher.getLocalPath(s,t)}async fetch(e,t){let i=e.reference.indexOf("#");if(i===-1)throw new Error("Invalid virtual package reference");let n=e.reference.slice(i+1),s=cn(e,n),o=await t.fetcher.fetch(s,t);return await this.ensureVirtualLink(e,o,t)}getLocatorFilename(e){return Jg(e)}async ensureVirtualLink(e,t,i){let n=t.packageFs.getRealPath(),s=i.project.configuration.get("virtualFolder"),o=this.getLocatorFilename(e),a=Wr.makeVirtualPath(s,o,n),l=new Na(a,{baseFs:t.packageFs,pathUtils:k});return te(N({},t),{packageFs:l})}};var _g=class{static isVirtualDescriptor(e){return!!e.range.startsWith(_g.protocol)}static isVirtualLocator(e){return!!e.reference.startsWith(_g.protocol)}supportsDescriptor(e,t){return _g.isVirtualDescriptor(e)}supportsLocator(e,t){return _g.isVirtualLocator(e)}shouldPersistResolution(e,t){return!1}bindDescriptor(e,t,i){throw new Error('Assertion failed: calling "bindDescriptor" on a virtual descriptor is unsupported')}getResolutionDependencies(e,t){throw new Error('Assertion failed: calling "getResolutionDependencies" on a virtual descriptor is unsupported')}async getCandidates(e,t,i){throw new Error('Assertion failed: calling "getCandidates" on a virtual descriptor is unsupported')}async getSatisfying(e,t,i){throw new Error('Assertion failed: calling "getSatisfying" on a virtual descriptor is unsupported')}async resolve(e,t){throw new Error('Assertion failed: calling "resolve" on a virtual locator is unsupported')}},pw=_g;pw.protocol="virtual:";var bd=class{supports(e){return!!e.reference.startsWith(oi.protocol)}getLocalPath(e,t){return this.getWorkspace(e,t).cwd}async fetch(e,t){let i=this.getWorkspace(e,t).cwd;return{packageFs:new _t(i),prefixPath:Me.dot,localPath:i}}getWorkspace(e,t){return t.project.getWorkspaceByCwd(e.reference.slice(oi.protocol.length))}};var sk={};ft(sk,{getDefaultGlobalFolder:()=>ak,getHomeFolder:()=>Qd,isFolderInside:()=>Ak});var ok=ge(require("os"));function ak(){if(process.platform==="win32"){let r=H.toPortablePath(process.env.LOCALAPPDATA||H.join((0,ok.homedir)(),"AppData","Local"));return k.resolve(r,"Yarn/Berry")}if(process.env.XDG_DATA_HOME){let r=H.toPortablePath(process.env.XDG_DATA_HOME);return k.resolve(r,"yarn/berry")}return k.resolve(Qd(),".yarn/berry")}function Qd(){return H.toPortablePath((0,ok.homedir)()||"/usr/local/share")}function Ak(r,e){let t=k.relative(e,r);return t&&!t.startsWith("..")&&!k.isAbsolute(t)}var Vg={};ft(Vg,{builtinModules:()=>lk,getArchitecture:()=>Sd,getArchitectureName:()=>Ave,getArchitectureSet:()=>ck});var L4=ge(require("module"));function lk(){return new Set(L4.default.builtinModules||Object.keys(process.binding("natives")))}function ave(){var i,n,s,o;if(process.platform==="win32")return null;let e=(s=((n=(i=process.report)==null?void 0:i.getReport())!=null?n:{}).sharedObjects)!=null?s:[],t=/\/(?:(ld-linux-|[^/]+-linux-gnu\/)|(libc.musl-|ld-musl-))/;return(o=$p(e,a=>{let l=a.match(t);if(!l)return $p.skip;if(l[1])return"glibc";if(l[2])return"musl";throw new Error("Assertion failed: Expected the libc variant to have been detected")}))!=null?o:null}var dw,Cw;function Sd(){return dw=dw!=null?dw:{os:process.platform,cpu:process.arch,libc:ave()}}function Ave(r=Sd()){return r.libc?`${r.os}-${r.cpu}-${r.libc}`:`${r.os}-${r.cpu}`}function ck(){let r=Sd();return Cw=Cw!=null?Cw:{os:[r.os],cpu:[r.cpu],libc:r.libc?[r.libc]:[]}}var lve=new Set(["binFolder","version","flags","profile","gpg","ignoreNode","wrapOutput","home","confDir"]),Ew="yarn_",gk=".yarnrc.yml",fk="yarn.lock",cve="********",Ie;(function(u){u.ANY="ANY",u.BOOLEAN="BOOLEAN",u.ABSOLUTE_PATH="ABSOLUTE_PATH",u.LOCATOR="LOCATOR",u.LOCATOR_LOOSE="LOCATOR_LOOSE",u.NUMBER="NUMBER",u.STRING="STRING",u.SECRET="SECRET",u.SHAPE="SHAPE",u.MAP="MAP"})(Ie||(Ie={}));var Ri=qe,hk={lastUpdateCheck:{description:"Last timestamp we checked whether new Yarn versions were available",type:Ie.STRING,default:null},yarnPath:{description:"Path to the local executable that must be used over the global one",type:Ie.ABSOLUTE_PATH,default:null},ignorePath:{description:"If true, the local executable will be ignored when using the global one",type:Ie.BOOLEAN,default:!1},ignoreCwd:{description:"If true, the `--cwd` flag will be ignored",type:Ie.BOOLEAN,default:!1},cacheKeyOverride:{description:"A global cache key override; used only for test purposes",type:Ie.STRING,default:null},globalFolder:{description:"Folder where all system-global files are stored",type:Ie.ABSOLUTE_PATH,default:ak()},cacheFolder:{description:"Folder where the cache files must be written",type:Ie.ABSOLUTE_PATH,default:"./.yarn/cache"},compressionLevel:{description:"Zip files compression level, from 0 to 9 or mixed (a variant of 9, which stores some files uncompressed, when compression doesn't yield good results)",type:Ie.NUMBER,values:["mixed",0,1,2,3,4,5,6,7,8,9],default:lc},virtualFolder:{description:"Folder where the virtual packages (cf doc) will be mapped on the disk (must be named __virtual__)",type:Ie.ABSOLUTE_PATH,default:"./.yarn/__virtual__"},lockfileFilename:{description:"Name of the files where the Yarn dependency tree entries must be stored",type:Ie.STRING,default:fk},installStatePath:{description:"Path of the file where the install state will be persisted",type:Ie.ABSOLUTE_PATH,default:"./.yarn/install-state.gz"},immutablePatterns:{description:"Array of glob patterns; files matching them won't be allowed to change during immutable installs",type:Ie.STRING,default:[],isArray:!0},rcFilename:{description:"Name of the files where the configuration can be found",type:Ie.STRING,default:Iw()},enableGlobalCache:{description:"If true, the system-wide cache folder will be used regardless of `cache-folder`",type:Ie.BOOLEAN,default:!1},enableColors:{description:"If true, the CLI is allowed to use colors in its output",type:Ie.BOOLEAN,default:Py,defaultText:""},enableHyperlinks:{description:"If true, the CLI is allowed to use hyperlinks in its output",type:Ie.BOOLEAN,default:Mv,defaultText:""},enableInlineBuilds:{description:"If true, the CLI will print the build output on the command line",type:Ie.BOOLEAN,default:mw.isCI,defaultText:""},enableMessageNames:{description:"If true, the CLI will prefix most messages with codes suitable for search engines",type:Ie.BOOLEAN,default:!0},enableProgressBars:{description:"If true, the CLI is allowed to show a progress bar for long-running events",type:Ie.BOOLEAN,default:!mw.isCI,defaultText:""},enableTimers:{description:"If true, the CLI is allowed to print the time spent executing commands",type:Ie.BOOLEAN,default:!0},preferAggregateCacheInfo:{description:"If true, the CLI will only print a one-line report of any cache changes",type:Ie.BOOLEAN,default:mw.isCI},preferInteractive:{description:"If true, the CLI will automatically use the interactive mode when called from a TTY",type:Ie.BOOLEAN,default:!1},preferTruncatedLines:{description:"If true, the CLI will truncate lines that would go beyond the size of the terminal",type:Ie.BOOLEAN,default:!1},progressBarStyle:{description:"Which style of progress bar should be used (only when progress bars are enabled)",type:Ie.STRING,default:void 0,defaultText:""},defaultLanguageName:{description:"Default language mode that should be used when a package doesn't offer any insight",type:Ie.STRING,default:"node"},defaultProtocol:{description:"Default resolution protocol used when resolving pure semver and tag ranges",type:Ie.STRING,default:"npm:"},enableTransparentWorkspaces:{description:"If false, Yarn won't automatically resolve workspace dependencies unless they use the `workspace:` protocol",type:Ie.BOOLEAN,default:!0},supportedArchitectures:{description:"Architectures that Yarn will fetch and inject into the resolver",type:Ie.SHAPE,properties:{os:{description:"Array of supported process.platform strings, or null to target them all",type:Ie.STRING,isArray:!0,isNullable:!0,default:["current"]},cpu:{description:"Array of supported process.arch strings, or null to target them all",type:Ie.STRING,isArray:!0,isNullable:!0,default:["current"]},libc:{description:"Array of supported libc libraries, or null to target them all",type:Ie.STRING,isArray:!0,isNullable:!0,default:["current"]}}},enableMirror:{description:"If true, the downloaded packages will be retrieved and stored in both the local and global folders",type:Ie.BOOLEAN,default:!0},enableNetwork:{description:"If false, the package manager will refuse to use the network if required to",type:Ie.BOOLEAN,default:!0},httpProxy:{description:"URL of the http proxy that must be used for outgoing http requests",type:Ie.STRING,default:null},httpsProxy:{description:"URL of the http proxy that must be used for outgoing https requests",type:Ie.STRING,default:null},unsafeHttpWhitelist:{description:"List of the hostnames for which http queries are allowed (glob patterns are supported)",type:Ie.STRING,default:[],isArray:!0},httpTimeout:{description:"Timeout of each http request in milliseconds",type:Ie.NUMBER,default:6e4},httpRetry:{description:"Retry times on http failure",type:Ie.NUMBER,default:3},networkConcurrency:{description:"Maximal number of concurrent requests",type:Ie.NUMBER,default:50},networkSettings:{description:"Network settings per hostname (glob patterns are supported)",type:Ie.MAP,valueDefinition:{description:"",type:Ie.SHAPE,properties:{caFilePath:{description:"Path to file containing one or multiple Certificate Authority signing certificates",type:Ie.ABSOLUTE_PATH,default:null},enableNetwork:{description:"If false, the package manager will refuse to use the network if required to",type:Ie.BOOLEAN,default:null},httpProxy:{description:"URL of the http proxy that must be used for outgoing http requests",type:Ie.STRING,default:null},httpsProxy:{description:"URL of the http proxy that must be used for outgoing https requests",type:Ie.STRING,default:null},httpsKeyFilePath:{description:"Path to file containing private key in PEM format",type:Ie.ABSOLUTE_PATH,default:null},httpsCertFilePath:{description:"Path to file containing certificate chain in PEM format",type:Ie.ABSOLUTE_PATH,default:null}}}},caFilePath:{description:"A path to a file containing one or multiple Certificate Authority signing certificates",type:Ie.ABSOLUTE_PATH,default:null},httpsKeyFilePath:{description:"Path to file containing private key in PEM format",type:Ie.ABSOLUTE_PATH,default:null},httpsCertFilePath:{description:"Path to file containing certificate chain in PEM format",type:Ie.ABSOLUTE_PATH,default:null},enableStrictSsl:{description:"If false, SSL certificate errors will be ignored",type:Ie.BOOLEAN,default:!0},logFilters:{description:"Overrides for log levels",type:Ie.SHAPE,isArray:!0,concatenateValues:!0,properties:{code:{description:"Code of the messages covered by this override",type:Ie.STRING,default:void 0},text:{description:"Code of the texts covered by this override",type:Ie.STRING,default:void 0},pattern:{description:"Code of the patterns covered by this override",type:Ie.STRING,default:void 0},level:{description:"Log level override, set to null to remove override",type:Ie.STRING,values:Object.values(ho),isNullable:!0,default:void 0}}},enableTelemetry:{description:"If true, telemetry will be periodically sent, following the rules in https://yarnpkg.com/advanced/telemetry",type:Ie.BOOLEAN,default:!0},telemetryInterval:{description:"Minimal amount of time between two telemetry uploads, in days",type:Ie.NUMBER,default:7},telemetryUserId:{description:"If you desire to tell us which project you are, you can set this field. Completely optional and opt-in.",type:Ie.STRING,default:null},enableScripts:{description:"If true, packages are allowed to have install scripts by default",type:Ie.BOOLEAN,default:!0},enableStrictSettings:{description:"If true, unknown settings will cause Yarn to abort",type:Ie.BOOLEAN,default:!0},enableImmutableCache:{description:"If true, the cache is reputed immutable and actions that would modify it will throw",type:Ie.BOOLEAN,default:!1},checksumBehavior:{description:"Enumeration defining what to do when a checksum doesn't match expectations",type:Ie.STRING,default:"throw"},packageExtensions:{description:"Map of package corrections to apply on the dependency tree",type:Ie.MAP,valueDefinition:{description:"The extension that will be applied to any package whose version matches the specified range",type:Ie.SHAPE,properties:{dependencies:{description:"The set of dependencies that must be made available to the current package in order for it to work properly",type:Ie.MAP,valueDefinition:{description:"A range",type:Ie.STRING}},peerDependencies:{description:"Inherited dependencies - the consumer of the package will be tasked to provide them",type:Ie.MAP,valueDefinition:{description:"A semver range",type:Ie.STRING}},peerDependenciesMeta:{description:"Extra information related to the dependencies listed in the peerDependencies field",type:Ie.MAP,valueDefinition:{description:"The peerDependency meta",type:Ie.SHAPE,properties:{optional:{description:"If true, the selected peer dependency will be marked as optional by the package manager and the consumer omitting it won't be reported as an error",type:Ie.BOOLEAN,default:!1}}}}}}}};function dk(r,e,t,i,n){if(i.isArray||i.type===Ie.ANY&&Array.isArray(t))return Array.isArray(t)?t.map((s,o)=>pk(r,`${e}[${o}]`,s,i,n)):String(t).split(/,/).map(s=>pk(r,e,s,i,n));if(Array.isArray(t))throw new Error(`Non-array configuration settings "${e}" cannot be an array`);return pk(r,e,t,i,n)}function pk(r,e,t,i,n){var a;switch(i.type){case Ie.ANY:return t;case Ie.SHAPE:return uve(r,e,t,i,n);case Ie.MAP:return gve(r,e,t,i,n)}if(t===null&&!i.isNullable&&i.default!==null)throw new Error(`Non-nullable configuration settings "${e}" cannot be set to null`);if((a=i.values)==null?void 0:a.includes(t))return t;let o=(()=>{if(i.type===Ie.BOOLEAN&&typeof t!="string")return td(t);if(typeof t!="string")throw new Error(`Expected value (${t}) to be a string`);let l=Fv(t,{env:process.env});switch(i.type){case Ie.ABSOLUTE_PATH:return k.resolve(n,H.toPortablePath(l));case Ie.LOCATOR_LOOSE:return Yc(l,!1);case Ie.NUMBER:return parseInt(l);case Ie.LOCATOR:return Yc(l);case Ie.BOOLEAN:return td(l);default:return l}})();if(i.values&&!i.values.includes(o))throw new Error(`Invalid value, expected one of ${i.values.join(", ")}`);return o}function uve(r,e,t,i,n){if(typeof t!="object"||Array.isArray(t))throw new Pe(`Object configuration settings "${e}" must be an object`);let s=Ck(r,i,{ignoreArrays:!0});if(t===null)return s;for(let[o,a]of Object.entries(t)){let l=`${e}.${o}`;if(!i.properties[o])throw new Pe(`Unrecognized configuration settings found: ${e}.${o} - run "yarn config -v" to see the list of settings supported in Yarn`);s.set(o,dk(r,l,a,i.properties[o],n))}return s}function gve(r,e,t,i,n){let s=new Map;if(typeof t!="object"||Array.isArray(t))throw new Pe(`Map configuration settings "${e}" must be an object`);if(t===null)return s;for(let[o,a]of Object.entries(t)){let l=i.normalizeKeys?i.normalizeKeys(o):o,c=`${e}['${l}']`,u=i.valueDefinition;s.set(l,dk(r,c,a,u,n))}return s}function Ck(r,e,{ignoreArrays:t=!1}={}){switch(e.type){case Ie.SHAPE:{if(e.isArray&&!t)return[];let i=new Map;for(let[n,s]of Object.entries(e.properties))i.set(n,Ck(r,s));return i}break;case Ie.MAP:return e.isArray&&!t?[]:new Map;case Ie.ABSOLUTE_PATH:return e.default===null?null:r.projectCwd===null?k.isAbsolute(e.default)?k.normalize(e.default):e.isNullable?null:void 0:Array.isArray(e.default)?e.default.map(i=>k.resolve(r.projectCwd,i)):k.resolve(r.projectCwd,e.default);default:return e.default}}function yw(r,e,t){if(e.type===Ie.SECRET&&typeof r=="string"&&t.hideSecrets)return cve;if(e.type===Ie.ABSOLUTE_PATH&&typeof r=="string"&&t.getNativePaths)return H.fromPortablePath(r);if(e.isArray&&Array.isArray(r)){let i=[];for(let n of r)i.push(yw(n,e,t));return i}if(e.type===Ie.MAP&&r instanceof Map){let i=new Map;for(let[n,s]of r.entries())i.set(n,yw(s,e.valueDefinition,t));return i}if(e.type===Ie.SHAPE&&r instanceof Map){let i=new Map;for(let[n,s]of r.entries()){let o=e.properties[n];i.set(n,yw(s,o,t))}return i}return r}function fve(){let r={};for(let[e,t]of Object.entries(process.env))e=e.toLowerCase(),!!e.startsWith(Ew)&&(e=(0,T4.default)(e.slice(Ew.length)),r[e]=t);return r}function Iw(){let r=`${Ew}rc_filename`;for(let[e,t]of Object.entries(process.env))if(e.toLowerCase()===r&&typeof t=="string")return t;return gk}var ul;(function(i){i[i.LOCKFILE=0]="LOCKFILE",i[i.MANIFEST=1]="MANIFEST",i[i.NONE=2]="NONE"})(ul||(ul={}));var tA=class{constructor(e){this.projectCwd=null;this.plugins=new Map;this.settings=new Map;this.values=new Map;this.sources=new Map;this.invalid=new Map;this.packageExtensions=new Map;this.limits=new Map;this.startingCwd=e}static create(e,t,i){let n=new tA(e);typeof t!="undefined"&&!(t instanceof Map)&&(n.projectCwd=t),n.importSettings(hk);let s=typeof i!="undefined"?i:t instanceof Map?t:new Map;for(let[o,a]of s)n.activatePlugin(o,a);return n}static async find(e,t,{lookup:i=0,strict:n=!0,usePath:s=!1,useRc:o=!0}={}){let a=fve();delete a.rcFilename;let l=await tA.findRcFiles(e),c=await tA.findHomeRcFile();if(c){let b=l.find(v=>v.path===c.path);b?b.strict=!1:l.push(te(N({},c),{strict:!1}))}let u=({ignoreCwd:b,yarnPath:v,ignorePath:x,lockfileFilename:T})=>({ignoreCwd:b,yarnPath:v,ignorePath:x,lockfileFilename:T}),g=Y=>{var $=Y,{ignoreCwd:b,yarnPath:v,ignorePath:x,lockfileFilename:T}=$,q=Or($,["ignoreCwd","yarnPath","ignorePath","lockfileFilename"]);return q},f=new tA(e);f.importSettings(u(hk)),f.useWithSource("",u(a),e,{strict:!1});for(let{path:b,cwd:v,data:x}of l)f.useWithSource(b,u(x),v,{strict:!1});if(s){let b=f.get("yarnPath"),v=f.get("ignorePath");if(b!==null&&!v)return f}let h=f.get("lockfileFilename"),p;switch(i){case 0:p=await tA.findProjectCwd(e,h);break;case 1:p=await tA.findProjectCwd(e,null);break;case 2:K.existsSync(k.join(e,"package.json"))?p=k.resolve(e):p=null;break}f.startingCwd=e,f.projectCwd=p,f.importSettings(g(hk));let m=new Map([["@@core",WW]]),y=b=>"default"in b?b.default:b;if(t!==null){for(let T of t.plugins.keys())m.set(T,y(t.modules.get(T)));let b=new Map;for(let T of lk())b.set(T,()=>Og(T));for(let[T,q]of t.modules)b.set(T,()=>q);let v=new Set,x=async(T,q)=>{let{factory:Y,name:$}=Og(T);if(v.has($))return;let _=new Map(b),ne=A=>{if(_.has(A))return _.get(A)();throw new Pe(`This plugin cannot access the package referenced via ${A} which is neither a builtin, nor an exposed entry`)},ee=await Lg(async()=>y(await Y(ne)),A=>`${A} (when initializing ${$}, defined in ${q})`);b.set($,()=>ee),v.add($),m.set($,ee)};if(a.plugins)for(let T of a.plugins.split(";")){let q=k.resolve(e,H.toPortablePath(T));await x(q,"")}for(let{path:T,cwd:q,data:Y}of l)if(!!o&&!!Array.isArray(Y.plugins))for(let $ of Y.plugins){let _=typeof $!="string"?$.path:$,ne=k.resolve(q,H.toPortablePath(_));await x(ne,T)}}for(let[b,v]of m)f.activatePlugin(b,v);f.useWithSource("",g(a),e,{strict:n});for(let{path:b,cwd:v,data:x,strict:T}of l)f.useWithSource(b,g(x),v,{strict:T!=null?T:n});return f.get("enableGlobalCache")&&(f.values.set("cacheFolder",`${f.get("globalFolder")}/cache`),f.sources.set("cacheFolder","")),await f.refreshPackageExtensions(),f}static async findRcFiles(e){let t=Iw(),i=[],n=e,s=null;for(;n!==s;){s=n;let o=k.join(s,t);if(K.existsSync(o)){let a=await K.readFilePromise(o,"utf8"),l;try{l=Si(a)}catch(c){let u="";throw a.match(/^\s+(?!-)[^:]+\s+\S+/m)&&(u=" (in particular, make sure you list the colons after each key name)"),new Pe(`Parse error when loading ${o}; please check it's proper Yaml${u}`)}i.push({path:o,cwd:s,data:l})}n=k.dirname(s)}return i}static async findHomeRcFile(){let e=Iw(),t=Qd(),i=k.join(t,e);if(K.existsSync(i)){let n=await K.readFilePromise(i,"utf8"),s=Si(n);return{path:i,cwd:t,data:s}}return null}static async findProjectCwd(e,t){let i=null,n=e,s=null;for(;n!==s;){if(s=n,K.existsSync(k.join(s,"package.json"))&&(i=s),t!==null){if(K.existsSync(k.join(s,t))){i=s;break}}else if(i!==null)break;n=k.dirname(s)}return i}static async updateConfiguration(e,t){let i=Iw(),n=k.join(e,i),s=K.existsSync(n)?Si(await K.readFilePromise(n,"utf8")):{},o=!1,a;if(typeof t=="function"){try{a=t(s)}catch{a=t({})}if(a===s)return}else{a=s;for(let l of Object.keys(t)){let c=s[l],u=t[l],g;if(typeof u=="function")try{g=u(c)}catch{g=u(void 0)}else g=u;c!==g&&(a[l]=g,o=!0)}if(!o)return}await K.changeFilePromise(n,Ma(a),{automaticNewlines:!0})}static async updateHomeConfiguration(e){let t=Qd();return await tA.updateConfiguration(t,e)}activatePlugin(e,t){this.plugins.set(e,t),typeof t.configuration!="undefined"&&this.importSettings(t.configuration)}importSettings(e){for(let[t,i]of Object.entries(e))if(i!=null){if(this.settings.has(t))throw new Error(`Cannot redefine settings "${t}"`);this.settings.set(t,i),this.values.set(t,Ck(this,i))}}useWithSource(e,t,i,n){try{this.use(e,t,i,n)}catch(s){throw s.message+=` (in ${tt(this,e,qe.PATH)})`,s}}use(e,t,i,{strict:n=!0,overwrite:s=!1}={}){n=n&&this.get("enableStrictSettings");for(let o of["enableStrictSettings",...Object.keys(t)]){if(typeof t[o]=="undefined"||o==="plugins"||e===""&&lve.has(o))continue;if(o==="rcFilename")throw new Pe(`The rcFilename settings can only be set via ${`${Ew}RC_FILENAME`.toUpperCase()}, not via a rc file`);let l=this.settings.get(o);if(!l){if(n)throw new Pe(`Unrecognized or legacy configuration settings found: ${o} - run "yarn config -v" to see the list of settings supported in Yarn`);this.invalid.set(o,e);continue}if(this.sources.has(o)&&!(s||l.type===Ie.MAP||l.isArray&&l.concatenateValues))continue;let c;try{c=dk(this,o,t[o],l,i)}catch(u){throw u.message+=` in ${tt(this,e,qe.PATH)}`,u}if(o==="enableStrictSettings"&&e!==""){n=c;continue}if(l.type===Ie.MAP){let u=this.values.get(o);this.values.set(o,new Map(s?[...u,...c]:[...c,...u])),this.sources.set(o,`${this.sources.get(o)}, ${e}`)}else if(l.isArray&&l.concatenateValues){let u=this.values.get(o);this.values.set(o,s?[...u,...c]:[...c,...u]),this.sources.set(o,`${this.sources.get(o)}, ${e}`)}else this.values.set(o,c),this.sources.set(o,e)}}get(e){if(!this.values.has(e))throw new Error(`Invalid configuration key "${e}"`);return this.values.get(e)}getSpecial(e,{hideSecrets:t=!1,getNativePaths:i=!1}){let n=this.get(e),s=this.settings.get(e);if(typeof s=="undefined")throw new Pe(`Couldn't find a configuration settings named "${e}"`);return yw(n,s,{hideSecrets:t,getNativePaths:i})}getSubprocessStreams(e,{header:t,prefix:i,report:n}){let s,o,a=K.createWriteStream(e);if(this.get("enableInlineBuilds")){let l=n.createStreamReporter(`${i} ${tt(this,"STDOUT","green")}`),c=n.createStreamReporter(`${i} ${tt(this,"STDERR","red")}`);s=new uk.PassThrough,s.pipe(l),s.pipe(a),o=new uk.PassThrough,o.pipe(c),o.pipe(a)}else s=a,o=a,typeof t!="undefined"&&s.write(`${t} -`);return{stdout:s,stderr:o}}makeResolver(){let e=[];for(let t of this.plugins.values())for(let i of t.resolvers||[])e.push(new i);return new wd([new pw,new oi,new nk,...e])}makeFetcher(){let e=[];for(let t of this.plugins.values())for(let i of t.fetchers||[])e.push(new i);return new yd([new Bd,new bd,...e])}getLinkers(){let e=[];for(let t of this.plugins.values())for(let i of t.linkers||[])e.push(new i);return e}getSupportedArchitectures(){let e=Sd(),t=this.get("supportedArchitectures"),i=t.get("os");i!==null&&(i=i.map(o=>o==="current"?e.os:o));let n=t.get("cpu");n!==null&&(n=n.map(o=>o==="current"?e.cpu:o));let s=t.get("libc");return s!==null&&(s=zo(s,o=>{var a;return o==="current"?(a=e.libc)!=null?a:zo.skip:o})),{os:i,cpu:n,libc:s}}async refreshPackageExtensions(){this.packageExtensions=new Map;let e=this.packageExtensions,t=(i,n,{userProvided:s=!1}={})=>{if(!po(i.range))throw new Error("Only semver ranges are allowed as keys for the packageExtensions setting");let o=new At;o.load(n,{yamlCompatibilityMode:!0});let a=Fg(e,i.identHash),l=[];a.push([i.range,l]);let c={status:qi.Inactive,userProvided:s,parentDescriptor:i};for(let u of o.dependencies.values())l.push(te(N({},c),{type:wi.Dependency,descriptor:u}));for(let u of o.peerDependencies.values())l.push(te(N({},c),{type:wi.PeerDependency,descriptor:u}));for(let[u,g]of o.peerDependenciesMeta)for(let[f,h]of Object.entries(g))l.push(te(N({},c),{type:wi.PeerDependencyMeta,selector:u,key:f,value:h}))};await this.triggerHook(i=>i.registerPackageExtensions,this,t);for(let[i,n]of this.get("packageExtensions"))t(ll(i,!0),ky(n),{userProvided:!0})}normalizePackage(e){let t=cd(e);if(this.packageExtensions==null)throw new Error("refreshPackageExtensions has to be called before normalizing packages");let i=this.packageExtensions.get(e.identHash);if(typeof i!="undefined"){let s=e.version;if(s!==null){for(let[o,a]of i)if(!!qc(s,o))for(let l of a)switch(l.status===qi.Inactive&&(l.status=qi.Redundant),l.type){case wi.Dependency:typeof t.dependencies.get(l.descriptor.identHash)=="undefined"&&(l.status=qi.Active,t.dependencies.set(l.descriptor.identHash,l.descriptor));break;case wi.PeerDependency:typeof t.peerDependencies.get(l.descriptor.identHash)=="undefined"&&(l.status=qi.Active,t.peerDependencies.set(l.descriptor.identHash,l.descriptor));break;case wi.PeerDependencyMeta:{let c=t.peerDependenciesMeta.get(l.selector);(typeof c=="undefined"||!Object.prototype.hasOwnProperty.call(c,l.key)||c[l.key]!==l.value)&&(l.status=qi.Active,_a(t.peerDependenciesMeta,l.selector,()=>({}))[l.key]=l.value)}break;default:Pv(l);break}}}let n=s=>s.scope?`${s.scope}__${s.name}`:`${s.name}`;for(let s of t.peerDependenciesMeta.keys()){let o=An(s);t.peerDependencies.has(o.identHash)||t.peerDependencies.set(o.identHash,rr(o,"*"))}for(let s of t.peerDependencies.values()){if(s.scope==="types")continue;let o=n(s),a=$o("types",o),l=Ot(a);t.peerDependencies.has(a.identHash)||t.peerDependenciesMeta.has(l)||(t.peerDependencies.set(a.identHash,rr(a,"*")),t.peerDependenciesMeta.set(l,{optional:!0}))}return t.dependencies=new Map(kn(t.dependencies,([,s])=>Pn(s))),t.peerDependencies=new Map(kn(t.peerDependencies,([,s])=>Pn(s))),t}getLimit(e){return _a(this.limits,e,()=>(0,O4.default)(this.get(e)))}async triggerHook(e,...t){for(let i of this.plugins.values()){let n=i.hooks;if(!n)continue;let s=e(n);!s||await s(...t)}}async triggerMultipleHooks(e,t){for(let i of t)await this.triggerHook(e,...i)}async reduceHook(e,t,...i){let n=t;for(let s of this.plugins.values()){let o=s.hooks;if(!o)continue;let a=e(o);!a||(n=await a(n,...i))}return n}async firstHook(e,...t){for(let i of this.plugins.values()){let n=i.hooks;if(!n)continue;let s=e(n);if(!s)continue;let o=await s(...t);if(typeof o!="undefined")return o}return null}},ye=tA;ye.telemetry=null;var ss;(function(i){i[i.Never=0]="Never",i[i.ErrorCode=1]="ErrorCode",i[i.Always=2]="Always"})(ss||(ss={}));var ww=class extends ct{constructor({fileName:e,code:t,signal:i}){let n=ye.create(k.cwd()),s=tt(n,e,qe.PATH);super(X.EXCEPTION,`Child ${s} reported an error`,o=>{hve(t,i,{configuration:n,report:o})});this.code=Ek(t,i)}},Ik=class extends ww{constructor({fileName:e,code:t,signal:i,stdout:n,stderr:s}){super({fileName:e,code:t,signal:i});this.stdout=n,this.stderr=s}};function zc(r){return r!==null&&typeof r.fd=="number"}var _c=new Set;function yk(){}function wk(){for(let r of _c)r.kill()}async function ra(r,e,{cwd:t,env:i=process.env,strict:n=!1,stdin:s=null,stdout:o,stderr:a,end:l=2}){let c=["pipe","pipe","pipe"];s===null?c[0]="ignore":zc(s)&&(c[0]=s),zc(o)&&(c[1]=o),zc(a)&&(c[2]=a);let u=(0,mk.default)(r,e,{cwd:H.fromPortablePath(t),env:te(N({},i),{PWD:H.fromPortablePath(t)}),stdio:c});_c.add(u),_c.size===1&&(process.on("SIGINT",yk),process.on("SIGTERM",wk)),!zc(s)&&s!==null&&s.pipe(u.stdin),zc(o)||u.stdout.pipe(o,{end:!1}),zc(a)||u.stderr.pipe(a,{end:!1});let g=()=>{for(let f of new Set([o,a]))zc(f)||f.end()};return new Promise((f,h)=>{u.on("error",p=>{_c.delete(u),_c.size===0&&(process.off("SIGINT",yk),process.off("SIGTERM",wk)),(l===2||l===1)&&g(),h(p)}),u.on("close",(p,m)=>{_c.delete(u),_c.size===0&&(process.off("SIGINT",yk),process.off("SIGTERM",wk)),(l===2||l===1&&p>0)&&g(),p===0||!n?f({code:Ek(p,m)}):h(new ww({fileName:r,code:p,signal:m}))})})}async function pve(r,e,{cwd:t,env:i=process.env,encoding:n="utf8",strict:s=!1}){let o=["ignore","pipe","pipe"],a=[],l=[],c=H.fromPortablePath(t);typeof i.PWD!="undefined"&&(i=te(N({},i),{PWD:c}));let u=(0,mk.default)(r,e,{cwd:c,env:i,stdio:o});return u.stdout.on("data",g=>{a.push(g)}),u.stderr.on("data",g=>{l.push(g)}),await new Promise((g,f)=>{u.on("error",h=>{let p=ye.create(t),m=tt(p,r,qe.PATH);f(new ct(X.EXCEPTION,`Process ${m} failed to spawn`,y=>{y.reportError(X.EXCEPTION,` ${_o(p,{label:"Thrown Error",value:fo(qe.NO_HINT,h.message)})}`)}))}),u.on("close",(h,p)=>{let m=n==="buffer"?Buffer.concat(a):Buffer.concat(a).toString(n),y=n==="buffer"?Buffer.concat(l):Buffer.concat(l).toString(n);h===0||!s?g({code:Ek(h,p),stdout:m,stderr:y}):f(new Ik({fileName:r,code:h,signal:p,stdout:m,stderr:y}))})})}var dve=new Map([["SIGINT",2],["SIGQUIT",3],["SIGKILL",9],["SIGTERM",15]]);function Ek(r,e){let t=dve.get(e);return typeof t!="undefined"?128+t:r!=null?r:1}function hve(r,e,{configuration:t,report:i}){i.reportError(X.EXCEPTION,` ${_o(t,r!==null?{label:"Exit Code",value:fo(qe.NUMBER,r)}:{label:"Exit Signal",value:fo(qe.CODE,e)})}`)}var ir={};ft(ir,{Method:()=>Cl,RequestError:()=>w5.RequestError,del:()=>xPe,get:()=>SPe,getNetworkSettings:()=>S5,post:()=>HP,put:()=>vPe,request:()=>Od});var E5=ge(Uw()),I5=ge(require("https")),y5=ge(require("http")),MP=ge(is()),KP=ge(m5()),Hw=ge(require("url"));var w5=ge(Uw()),B5=new Map,b5=new Map,wPe=new y5.Agent({keepAlive:!0}),BPe=new I5.Agent({keepAlive:!0});function Q5(r){let e=new Hw.URL(r),t={host:e.hostname,headers:{}};return e.port&&(t.port=Number(e.port)),{proxy:t}}async function UP(r){return _a(b5,r,()=>K.readFilePromise(r).then(e=>(b5.set(r,e),e)))}function bPe({statusCode:r,statusMessage:e},t){let i=tt(t,r,qe.NUMBER),n=`https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/${r}`;return Mg(t,`${i}${e?` (${e})`:""}`,n)}async function jw(r,{configuration:e,customErrorMessage:t}){var i,n;try{return await r}catch(s){if(s.name!=="HTTPError")throw s;let o=(n=t==null?void 0:t(s))!=null?n:(i=s.response.body)==null?void 0:i.error;o==null&&(s.message.startsWith("Response code")?o="The remote server failed to provide the requested resource":o=s.message),s instanceof E5.TimeoutError&&s.event==="socket"&&(o+=`(can be increased via ${tt(e,"httpTimeout",qe.SETTING)})`);let a=new ct(X.NETWORK_ERROR,o,l=>{s.response&&l.reportError(X.NETWORK_ERROR,` ${_o(e,{label:"Response Code",value:fo(qe.NO_HINT,bPe(s.response,e))})}`),s.request&&(l.reportError(X.NETWORK_ERROR,` ${_o(e,{label:"Request Method",value:fo(qe.NO_HINT,s.request.options.method)})}`),l.reportError(X.NETWORK_ERROR,` ${_o(e,{label:"Request URL",value:fo(qe.URL,s.request.requestUrl)})}`)),s.request.redirects.length>0&&l.reportError(X.NETWORK_ERROR,` ${_o(e,{label:"Request Redirects",value:fo(qe.NO_HINT,Uv(e,s.request.redirects,qe.URL))})}`),s.request.retryCount===s.request.options.retry.limit&&l.reportError(X.NETWORK_ERROR,` ${_o(e,{label:"Request Retry Count",value:fo(qe.NO_HINT,`${tt(e,s.request.retryCount,qe.NUMBER)} (can be increased via ${tt(e,"httpRetry",qe.SETTING)})`)})}`)});throw a.originalError=s,a}}function S5(r,e){let t=[...e.configuration.get("networkSettings")].sort(([o],[a])=>a.length-o.length),i={enableNetwork:void 0,caFilePath:void 0,httpProxy:void 0,httpsProxy:void 0,httpsKeyFilePath:void 0,httpsCertFilePath:void 0},n=Object.keys(i),s=typeof r=="string"?new Hw.URL(r):r;for(let[o,a]of t)if(MP.default.isMatch(s.hostname,o))for(let l of n){let c=a.get(l);c!==null&&typeof i[l]=="undefined"&&(i[l]=c)}for(let o of n)typeof i[o]=="undefined"&&(i[o]=e.configuration.get(o));return i}var Cl;(function(n){n.GET="GET",n.PUT="PUT",n.POST="POST",n.DELETE="DELETE"})(Cl||(Cl={}));async function Od(r,e,{configuration:t,headers:i,jsonRequest:n,jsonResponse:s,method:o=Cl.GET}){let a=async()=>await QPe(r,e,{configuration:t,headers:i,jsonRequest:n,jsonResponse:s,method:o});return await(await t.reduceHook(c=>c.wrapNetworkRequest,a,{target:r,body:e,configuration:t,headers:i,jsonRequest:n,jsonResponse:s,method:o}))()}async function SPe(r,n){var s=n,{configuration:e,jsonResponse:t}=s,i=Or(s,["configuration","jsonResponse"]);let o=_a(B5,r,()=>jw(Od(r,null,N({configuration:e},i)),{configuration:e}).then(a=>(B5.set(r,a.body),a.body)));return Buffer.isBuffer(o)===!1&&(o=await o),t?JSON.parse(o.toString()):o}async function vPe(r,e,n){var s=n,{customErrorMessage:t}=s,i=Or(s,["customErrorMessage"]);return(await jw(Od(r,e,te(N({},i),{method:Cl.PUT})),i)).body}async function HP(r,e,n){var s=n,{customErrorMessage:t}=s,i=Or(s,["customErrorMessage"]);return(await jw(Od(r,e,te(N({},i),{method:Cl.POST})),i)).body}async function xPe(r,i){var n=i,{customErrorMessage:e}=n,t=Or(n,["customErrorMessage"]);return(await jw(Od(r,null,te(N({},t),{method:Cl.DELETE})),t)).body}async function QPe(r,e,{configuration:t,headers:i,jsonRequest:n,jsonResponse:s,method:o=Cl.GET}){let a=typeof r=="string"?new Hw.URL(r):r,l=S5(a,{configuration:t});if(l.enableNetwork===!1)throw new Error(`Request to '${a.href}' has been blocked because of your configuration settings`);if(a.protocol==="http:"&&!MP.default.isMatch(a.hostname,t.get("unsafeHttpWhitelist")))throw new Error(`Unsafe http requests must be explicitly whitelisted in your configuration (${a.hostname})`);let u={agent:{http:l.httpProxy?KP.default.httpOverHttp(Q5(l.httpProxy)):wPe,https:l.httpsProxy?KP.default.httpsOverHttp(Q5(l.httpsProxy)):BPe},headers:i,method:o};u.responseType=s?"json":"buffer",e!==null&&(Buffer.isBuffer(e)||!n&&typeof e=="string"?u.body=e:u.json=e);let g=t.get("httpTimeout"),f=t.get("httpRetry"),h=t.get("enableStrictSsl"),p=l.caFilePath,m=l.httpsCertFilePath,y=l.httpsKeyFilePath,{default:b}=await Promise.resolve().then(()=>ge(Uw())),v=p?await UP(p):void 0,x=m?await UP(m):void 0,T=y?await UP(y):void 0,q=b.extend(N({timeout:{socket:g},retry:f,https:{rejectUnauthorized:h,certificateAuthority:v,certificate:x,key:T}},u));return t.getLimit("networkConcurrency")(()=>q(a))}var Zt={};ft(Zt,{PackageManager:()=>hn,detectPackageManager:()=>K9,executePackageAccessibleBinary:()=>Y9,executePackageScript:()=>nB,executePackageShellcode:()=>rD,executeWorkspaceAccessibleBinary:()=>WDe,executeWorkspaceLifecycleScript:()=>G9,executeWorkspaceScript:()=>j9,getPackageAccessibleBinaries:()=>sB,getWorkspaceAccessibleBinaries:()=>H9,hasPackageScript:()=>YDe,hasWorkspaceScript:()=>tD,makeScriptEnv:()=>Yd,maybeExecuteWorkspaceLifecycleScript:()=>JDe,prepareExternalProject:()=>GDe});var Md={};ft(Md,{getLibzipPromise:()=>fn,getLibzipSync:()=>D5});var P5=ge(x5());var ml=["number","number"],YP;(function(L){L[L.ZIP_ER_OK=0]="ZIP_ER_OK",L[L.ZIP_ER_MULTIDISK=1]="ZIP_ER_MULTIDISK",L[L.ZIP_ER_RENAME=2]="ZIP_ER_RENAME",L[L.ZIP_ER_CLOSE=3]="ZIP_ER_CLOSE",L[L.ZIP_ER_SEEK=4]="ZIP_ER_SEEK",L[L.ZIP_ER_READ=5]="ZIP_ER_READ",L[L.ZIP_ER_WRITE=6]="ZIP_ER_WRITE",L[L.ZIP_ER_CRC=7]="ZIP_ER_CRC",L[L.ZIP_ER_ZIPCLOSED=8]="ZIP_ER_ZIPCLOSED",L[L.ZIP_ER_NOENT=9]="ZIP_ER_NOENT",L[L.ZIP_ER_EXISTS=10]="ZIP_ER_EXISTS",L[L.ZIP_ER_OPEN=11]="ZIP_ER_OPEN",L[L.ZIP_ER_TMPOPEN=12]="ZIP_ER_TMPOPEN",L[L.ZIP_ER_ZLIB=13]="ZIP_ER_ZLIB",L[L.ZIP_ER_MEMORY=14]="ZIP_ER_MEMORY",L[L.ZIP_ER_CHANGED=15]="ZIP_ER_CHANGED",L[L.ZIP_ER_COMPNOTSUPP=16]="ZIP_ER_COMPNOTSUPP",L[L.ZIP_ER_EOF=17]="ZIP_ER_EOF",L[L.ZIP_ER_INVAL=18]="ZIP_ER_INVAL",L[L.ZIP_ER_NOZIP=19]="ZIP_ER_NOZIP",L[L.ZIP_ER_INTERNAL=20]="ZIP_ER_INTERNAL",L[L.ZIP_ER_INCONS=21]="ZIP_ER_INCONS",L[L.ZIP_ER_REMOVE=22]="ZIP_ER_REMOVE",L[L.ZIP_ER_DELETED=23]="ZIP_ER_DELETED",L[L.ZIP_ER_ENCRNOTSUPP=24]="ZIP_ER_ENCRNOTSUPP",L[L.ZIP_ER_RDONLY=25]="ZIP_ER_RDONLY",L[L.ZIP_ER_NOPASSWD=26]="ZIP_ER_NOPASSWD",L[L.ZIP_ER_WRONGPASSWD=27]="ZIP_ER_WRONGPASSWD",L[L.ZIP_ER_OPNOTSUPP=28]="ZIP_ER_OPNOTSUPP",L[L.ZIP_ER_INUSE=29]="ZIP_ER_INUSE",L[L.ZIP_ER_TELL=30]="ZIP_ER_TELL",L[L.ZIP_ER_COMPRESSED_DATA=31]="ZIP_ER_COMPRESSED_DATA"})(YP||(YP={}));var k5=r=>({get HEAP8(){return r.HEAP8},get HEAPU8(){return r.HEAPU8},errors:YP,SEEK_SET:0,SEEK_CUR:1,SEEK_END:2,ZIP_CHECKCONS:4,ZIP_CREATE:1,ZIP_EXCL:2,ZIP_TRUNCATE:8,ZIP_RDONLY:16,ZIP_FL_OVERWRITE:8192,ZIP_FL_COMPRESSED:4,ZIP_OPSYS_DOS:0,ZIP_OPSYS_AMIGA:1,ZIP_OPSYS_OPENVMS:2,ZIP_OPSYS_UNIX:3,ZIP_OPSYS_VM_CMS:4,ZIP_OPSYS_ATARI_ST:5,ZIP_OPSYS_OS_2:6,ZIP_OPSYS_MACINTOSH:7,ZIP_OPSYS_Z_SYSTEM:8,ZIP_OPSYS_CPM:9,ZIP_OPSYS_WINDOWS_NTFS:10,ZIP_OPSYS_MVS:11,ZIP_OPSYS_VSE:12,ZIP_OPSYS_ACORN_RISC:13,ZIP_OPSYS_VFAT:14,ZIP_OPSYS_ALTERNATE_MVS:15,ZIP_OPSYS_BEOS:16,ZIP_OPSYS_TANDEM:17,ZIP_OPSYS_OS_400:18,ZIP_OPSYS_OS_X:19,ZIP_CM_DEFAULT:-1,ZIP_CM_STORE:0,ZIP_CM_DEFLATE:8,uint08S:r._malloc(1),uint16S:r._malloc(2),uint32S:r._malloc(4),uint64S:r._malloc(8),malloc:r._malloc,free:r._free,getValue:r.getValue,open:r.cwrap("zip_open","number",["string","number","number"]),openFromSource:r.cwrap("zip_open_from_source","number",["number","number","number"]),close:r.cwrap("zip_close","number",["number"]),discard:r.cwrap("zip_discard",null,["number"]),getError:r.cwrap("zip_get_error","number",["number"]),getName:r.cwrap("zip_get_name","string",["number","number","number"]),getNumEntries:r.cwrap("zip_get_num_entries","number",["number","number"]),delete:r.cwrap("zip_delete","number",["number","number"]),stat:r.cwrap("zip_stat","number",["number","string","number","number"]),statIndex:r.cwrap("zip_stat_index","number",["number",...ml,"number","number"]),fopen:r.cwrap("zip_fopen","number",["number","string","number"]),fopenIndex:r.cwrap("zip_fopen_index","number",["number",...ml,"number"]),fread:r.cwrap("zip_fread","number",["number","number","number","number"]),fclose:r.cwrap("zip_fclose","number",["number"]),dir:{add:r.cwrap("zip_dir_add","number",["number","string"])},file:{add:r.cwrap("zip_file_add","number",["number","string","number","number"]),getError:r.cwrap("zip_file_get_error","number",["number"]),getExternalAttributes:r.cwrap("zip_file_get_external_attributes","number",["number",...ml,"number","number","number"]),setExternalAttributes:r.cwrap("zip_file_set_external_attributes","number",["number",...ml,"number","number","number"]),setMtime:r.cwrap("zip_file_set_mtime","number",["number",...ml,"number","number"]),setCompression:r.cwrap("zip_set_file_compression","number",["number",...ml,"number","number"])},ext:{countSymlinks:r.cwrap("zip_ext_count_symlinks","number",["number"])},error:{initWithCode:r.cwrap("zip_error_init_with_code",null,["number","number"]),strerror:r.cwrap("zip_error_strerror","string",["number"])},name:{locate:r.cwrap("zip_name_locate","number",["number","string","number"])},source:{fromUnattachedBuffer:r.cwrap("zip_source_buffer_create","number",["number","number","number","number"]),fromBuffer:r.cwrap("zip_source_buffer","number",["number","number",...ml,"number"]),free:r.cwrap("zip_source_free",null,["number"]),keep:r.cwrap("zip_source_keep",null,["number"]),open:r.cwrap("zip_source_open","number",["number"]),close:r.cwrap("zip_source_close","number",["number"]),seek:r.cwrap("zip_source_seek","number",["number",...ml,"number"]),tell:r.cwrap("zip_source_tell","number",["number"]),read:r.cwrap("zip_source_read","number",["number","number","number"]),error:r.cwrap("zip_source_error","number",["number"]),setMtime:r.cwrap("zip_source_set_mtime","number",["number","number"])},struct:{stat:r.cwrap("zipstruct_stat","number",[]),statS:r.cwrap("zipstruct_statS","number",[]),statName:r.cwrap("zipstruct_stat_name","string",["number"]),statIndex:r.cwrap("zipstruct_stat_index","number",["number"]),statSize:r.cwrap("zipstruct_stat_size","number",["number"]),statCompSize:r.cwrap("zipstruct_stat_comp_size","number",["number"]),statCompMethod:r.cwrap("zipstruct_stat_comp_method","number",["number"]),statMtime:r.cwrap("zipstruct_stat_mtime","number",["number"]),statCrc:r.cwrap("zipstruct_stat_crc","number",["number"]),error:r.cwrap("zipstruct_error","number",[]),errorS:r.cwrap("zipstruct_errorS","number",[]),errorCodeZip:r.cwrap("zipstruct_error_code_zip","number",["number"])}});var qP=null;function D5(){return qP===null&&(qP=k5((0,P5.default)())),qP}async function fn(){return D5()}var Ud={};ft(Ud,{ShellError:()=>Ms,execute:()=>Xw,globUtils:()=>Yw});var G5=ge(uv()),Y5=ge(require("os")),os=ge(require("stream")),q5=ge(require("util"));var Ms=class extends Error{constructor(e){super(e);this.name="ShellError"}};var Yw={};ft(Yw,{fastGlobOptions:()=>N5,isBraceExpansion:()=>L5,isGlobPattern:()=>kPe,match:()=>PPe,micromatchOptions:()=>Jw});var R5=ge(Zy()),F5=ge(require("fs")),qw=ge(is()),Jw={strictBrackets:!0},N5={onlyDirectories:!1,onlyFiles:!1};function kPe(r){if(!qw.default.scan(r,Jw).isGlob)return!1;try{qw.default.parse(r,Jw)}catch{return!1}return!0}function PPe(r,{cwd:e,baseFs:t}){return(0,R5.default)(r,te(N({},N5),{cwd:H.fromPortablePath(e),fs:WE(F5.default,new Vh(t))}))}function L5(r){return qw.default.scan(r,Jw).isBrace}var T5=ge(SQ()),na=ge(require("stream")),O5=ge(require("string_decoder")),Fn;(function(i){i[i.STDIN=0]="STDIN",i[i.STDOUT=1]="STDOUT",i[i.STDERR=2]="STDERR"})(Fn||(Fn={}));var Xc=new Set;function JP(){}function WP(){for(let r of Xc)r.kill()}function M5(r,e,t,i){return n=>{let s=n[0]instanceof na.Transform?"pipe":n[0],o=n[1]instanceof na.Transform?"pipe":n[1],a=n[2]instanceof na.Transform?"pipe":n[2],l=(0,T5.default)(r,e,te(N({},i),{stdio:[s,o,a]}));return Xc.add(l),Xc.size===1&&(process.on("SIGINT",JP),process.on("SIGTERM",WP)),n[0]instanceof na.Transform&&n[0].pipe(l.stdin),n[1]instanceof na.Transform&&l.stdout.pipe(n[1],{end:!1}),n[2]instanceof na.Transform&&l.stderr.pipe(n[2],{end:!1}),{stdin:l.stdin,promise:new Promise(c=>{l.on("error",u=>{switch(Xc.delete(l),Xc.size===0&&(process.off("SIGINT",JP),process.off("SIGTERM",WP)),u.code){case"ENOENT":n[2].write(`command not found: ${r} -`),c(127);break;case"EACCES":n[2].write(`permission denied: ${r} -`),c(128);break;default:n[2].write(`uncaught error: ${u.message} -`),c(1);break}}),l.on("close",u=>{Xc.delete(l),Xc.size===0&&(process.off("SIGINT",JP),process.off("SIGTERM",WP)),c(u!==null?u:129)})})}}}function K5(r){return e=>{let t=e[0]==="pipe"?new na.PassThrough:e[0];return{stdin:t,promise:Promise.resolve().then(()=>r({stdin:t,stdout:e[1],stderr:e[2]}))}}}var mo=class{constructor(e){this.stream=e}close(){}get(){return this.stream}},U5=class{constructor(){this.stream=null}close(){if(this.stream===null)throw new Error("Assertion failed: No stream attached");this.stream.end()}attach(e){this.stream=e}get(){if(this.stream===null)throw new Error("Assertion failed: No stream attached");return this.stream}},Kd=class{constructor(e,t){this.stdin=null;this.stdout=null;this.stderr=null;this.pipe=null;this.ancestor=e,this.implementation=t}static start(e,{stdin:t,stdout:i,stderr:n}){let s=new Kd(null,e);return s.stdin=t,s.stdout=i,s.stderr=n,s}pipeTo(e,t=1){let i=new Kd(this,e),n=new U5;return i.pipe=n,i.stdout=this.stdout,i.stderr=this.stderr,(t&1)==1?this.stdout=n:this.ancestor!==null&&(this.stderr=this.ancestor.stdout),(t&2)==2?this.stderr=n:this.ancestor!==null&&(this.stderr=this.ancestor.stderr),i}async exec(){let e=["ignore","ignore","ignore"];if(this.pipe)e[0]="pipe";else{if(this.stdin===null)throw new Error("Assertion failed: No input stream registered");e[0]=this.stdin.get()}let t;if(this.stdout===null)throw new Error("Assertion failed: No output stream registered");t=this.stdout,e[1]=t.get();let i;if(this.stderr===null)throw new Error("Assertion failed: No error stream registered");i=this.stderr,e[2]=i.get();let n=this.implementation(e);return this.pipe&&this.pipe.attach(n.stdin),await n.promise.then(s=>(t.close(),i.close(),s))}async run(){let e=[];for(let i=this;i;i=i.ancestor)e.push(i.exec());return(await Promise.all(e))[0]}};function Ww(r,e){return Kd.start(r,e)}function H5(r,e=null){let t=new na.PassThrough,i=new O5.StringDecoder,n="";return t.on("data",s=>{let o=i.write(s),a;do if(a=o.indexOf(` -`),a!==-1){let l=n+o.substring(0,a);o=o.substring(a+1),n="",r(e!==null?`${e} ${l}`:l)}while(a!==-1);n+=o}),t.on("end",()=>{let s=i.end();s!==""&&r(e!==null?`${e} ${s}`:s)}),t}function j5(r,{prefix:e}){return{stdout:H5(t=>r.stdout.write(`${t} -`),r.stdout.isTTY?e:null),stderr:H5(t=>r.stderr.write(`${t} -`),r.stderr.isTTY?e:null)}}var DPe=(0,q5.promisify)(setTimeout);var zi;(function(t){t[t.Readable=1]="Readable",t[t.Writable=2]="Writable"})(zi||(zi={}));function J5(r,e,t){let i=new os.PassThrough({autoDestroy:!0});switch(r){case Fn.STDIN:(e&1)==1&&t.stdin.pipe(i,{end:!1}),(e&2)==2&&t.stdin instanceof os.Writable&&i.pipe(t.stdin,{end:!1});break;case Fn.STDOUT:(e&1)==1&&t.stdout.pipe(i,{end:!1}),(e&2)==2&&i.pipe(t.stdout,{end:!1});break;case Fn.STDERR:(e&1)==1&&t.stderr.pipe(i,{end:!1}),(e&2)==2&&i.pipe(t.stderr,{end:!1});break;default:throw new Ms(`Bad file descriptor: "${r}"`)}return i}function zw(r,e={}){let t=N(N({},r),e);return t.environment=N(N({},r.environment),e.environment),t.variables=N(N({},r.variables),e.variables),t}var RPe=new Map([["cd",async([r=(0,Y5.homedir)(),...e],t,i)=>{let n=k.resolve(i.cwd,H.toPortablePath(r));if(!(await t.baseFs.statPromise(n).catch(o=>{throw o.code==="ENOENT"?new Ms(`cd: no such file or directory: ${r}`):o})).isDirectory())throw new Ms(`cd: not a directory: ${r}`);return i.cwd=n,0}],["pwd",async(r,e,t)=>(t.stdout.write(`${H.fromPortablePath(t.cwd)} -`),0)],[":",async(r,e,t)=>0],["true",async(r,e,t)=>0],["false",async(r,e,t)=>1],["exit",async([r,...e],t,i)=>i.exitCode=parseInt(r!=null?r:i.variables["?"],10)],["echo",async(r,e,t)=>(t.stdout.write(`${r.join(" ")} -`),0)],["sleep",async([r],e,t)=>{if(typeof r=="undefined")throw new Ms("sleep: missing operand");let i=Number(r);if(Number.isNaN(i))throw new Ms(`sleep: invalid time interval '${r}'`);return await DPe(1e3*i,0)}],["__ysh_run_procedure",async(r,e,t)=>{let i=t.procedures[r[0]];return await Ww(i,{stdin:new mo(t.stdin),stdout:new mo(t.stdout),stderr:new mo(t.stderr)}).run()}],["__ysh_set_redirects",async(r,e,t)=>{let i=t.stdin,n=t.stdout,s=t.stderr,o=[],a=[],l=[],c=0;for(;r[c]!=="--";){let g=r[c++],{type:f,fd:h}=JSON.parse(g),p=v=>{switch(h){case null:case 0:o.push(v);break;default:throw new Error(`Unsupported file descriptor: "${h}"`)}},m=v=>{switch(h){case null:case 1:a.push(v);break;case 2:l.push(v);break;default:throw new Error(`Unsupported file descriptor: "${h}"`)}},y=Number(r[c++]),b=c+y;for(let v=c;ve.baseFs.createReadStream(k.resolve(t.cwd,H.toPortablePath(r[v]))));break;case"<<<":p(()=>{let x=new os.PassThrough;return process.nextTick(()=>{x.write(`${r[v]} -`),x.end()}),x});break;case"<&":p(()=>J5(Number(r[v]),1,t));break;case">":case">>":{let x=k.resolve(t.cwd,H.toPortablePath(r[v]));m(x==="/dev/null"?new os.Writable({autoDestroy:!0,emitClose:!0,write(T,q,Y){setImmediate(Y)}}):e.baseFs.createWriteStream(x,f===">>"?{flags:"a"}:void 0))}break;case">&":m(J5(Number(r[v]),2,t));break;default:throw new Error(`Assertion failed: Unsupported redirection type: "${f}"`)}}if(o.length>0){let g=new os.PassThrough;i=g;let f=h=>{if(h===o.length)g.end();else{let p=o[h]();p.pipe(g,{end:!1}),p.on("end",()=>{f(h+1)})}};f(0)}if(a.length>0){let g=new os.PassThrough;n=g;for(let f of a)g.pipe(f)}if(l.length>0){let g=new os.PassThrough;s=g;for(let f of l)g.pipe(f)}let u=await Ww(Hd(r.slice(c+1),e,t),{stdin:new mo(i),stdout:new mo(n),stderr:new mo(s)}).run();return await Promise.all(a.map(g=>new Promise((f,h)=>{g.on("error",p=>{h(p)}),g.on("close",()=>{f()}),g.end()}))),await Promise.all(l.map(g=>new Promise((f,h)=>{g.on("error",p=>{h(p)}),g.on("close",()=>{f()}),g.end()}))),u}]]);async function FPe(r,e,t){let i=[],n=new os.PassThrough;return n.on("data",s=>i.push(s)),await _w(r,e,zw(t,{stdout:n})),Buffer.concat(i).toString().replace(/[\r\n]+$/,"")}async function W5(r,e,t){let i=r.map(async s=>{let o=await aA(s.args,e,t);return{name:s.name,value:o.join(" ")}});return(await Promise.all(i)).reduce((s,o)=>(s[o.name]=o.value,s),{})}function Vw(r){return r.match(/[^ \r\n\t]+/g)||[]}async function z5(r,e,t,i,n=i){switch(r.name){case"$":i(String(process.pid));break;case"#":i(String(e.args.length));break;case"@":if(r.quoted)for(let s of e.args)n(s);else for(let s of e.args){let o=Vw(s);for(let a=0;a=0&&sr+e,subtraction:(r,e)=>r-e,multiplication:(r,e)=>r*e,division:(r,e)=>Math.trunc(r/e)};async function jd(r,e,t){if(r.type==="number"){if(Number.isInteger(r.value))return r.value;throw new Error(`Invalid number: "${r.value}", only integers are allowed`)}else if(r.type==="variable"){let i=[];await z5(te(N({},r),{quoted:!0}),e,t,s=>i.push(s));let n=Number(i.join(" "));return Number.isNaN(n)?jd({type:"variable",name:i.join(" ")},e,t):jd({type:"number",value:n},e,t)}else return NPe[r.type](await jd(r.left,e,t),await jd(r.right,e,t))}async function aA(r,e,t){let i=new Map,n=[],s=[],o=u=>{s.push(u)},a=()=>{s.length>0&&n.push(s.join("")),s=[]},l=u=>{o(u),a()},c=(u,g,f)=>{let h=JSON.stringify({type:u,fd:g}),p=i.get(h);typeof p=="undefined"&&i.set(h,p=[]),p.push(f)};for(let u of r){let g=!1;switch(u.type){case"redirection":{let f=await aA(u.args,e,t);for(let h of f)c(u.subtype,u.fd,h)}break;case"argument":for(let f of u.segments)switch(f.type){case"text":o(f.text);break;case"glob":o(f.pattern),g=!0;break;case"shell":{let h=await FPe(f.shell,e,t);if(f.quoted)o(h);else{let p=Vw(h);for(let m=0;m0){let u=[];for(let[g,f]of i.entries())u.splice(u.length,0,g,String(f.length),...f);n.splice(0,0,"__ysh_set_redirects",...u,"--")}return n}function Hd(r,e,t){e.builtins.has(r[0])||(r=["command",...r]);let i=H.fromPortablePath(t.cwd),n=t.environment;typeof n.PWD!="undefined"&&(n=te(N({},n),{PWD:i}));let[s,...o]=r;if(s==="command")return M5(o[0],o.slice(1),e,{cwd:i,env:n});let a=e.builtins.get(s);if(typeof a=="undefined")throw new Error(`Assertion failed: A builtin should exist for "${s}"`);return K5(async({stdin:l,stdout:c,stderr:u})=>{let{stdin:g,stdout:f,stderr:h}=t;t.stdin=l,t.stdout=c,t.stderr=u;try{return await a(o,e,t)}finally{t.stdin=g,t.stdout=f,t.stderr=h}})}function LPe(r,e,t){return i=>{let n=new os.PassThrough,s=_w(r,e,zw(t,{stdin:n}));return{stdin:n,promise:s}}}function TPe(r,e,t){return i=>{let n=new os.PassThrough,s=_w(r,e,t);return{stdin:n,promise:s}}}function _5(r,e,t,i){if(e.length===0)return r;{let n;do n=String(Math.random());while(Object.prototype.hasOwnProperty.call(i.procedures,n));return i.procedures=N({},i.procedures),i.procedures[n]=r,Hd([...e,"__ysh_run_procedure",n],t,i)}}async function V5(r,e,t){let i=r,n=null,s=null;for(;i;){let o=i.then?N({},t):t,a;switch(i.type){case"command":{let l=await aA(i.args,e,t),c=await W5(i.envs,e,t);a=i.envs.length?Hd(l,e,zw(o,{environment:c})):Hd(l,e,o)}break;case"subshell":{let l=await aA(i.args,e,t),c=LPe(i.subshell,e,o);a=_5(c,l,e,o)}break;case"group":{let l=await aA(i.args,e,t),c=TPe(i.group,e,o);a=_5(c,l,e,o)}break;case"envs":{let l=await W5(i.envs,e,t);o.environment=N(N({},o.environment),l),a=Hd(["true"],e,o)}break}if(typeof a=="undefined")throw new Error("Assertion failed: An action should have been generated");if(n===null)s=Ww(a,{stdin:new mo(o.stdin),stdout:new mo(o.stdout),stderr:new mo(o.stderr)});else{if(s===null)throw new Error("Assertion failed: The execution pipeline should have been setup");switch(n){case"|":s=s.pipeTo(a,Fn.STDOUT);break;case"|&":s=s.pipeTo(a,Fn.STDOUT|Fn.STDERR);break}}i.then?(n=i.then.type,i=i.then.chain):i=null}if(s===null)throw new Error("Assertion failed: The execution pipeline should have been setup");return await s.run()}async function OPe(r,e,t,{background:i=!1}={}){function n(s){let o=["#2E86AB","#A23B72","#F18F01","#C73E1D","#CCE2A3"],a=o[s%o.length];return G5.default.hex(a)}if(i){let s=t.nextBackgroundJobIndex++,o=n(s),a=`[${s}]`,l=o(a),{stdout:c,stderr:u}=j5(t,{prefix:l});return t.backgroundJobs.push(V5(r,e,zw(t,{stdout:c,stderr:u})).catch(g=>u.write(`${g.message} -`)).finally(()=>{t.stdout.isTTY&&t.stdout.write(`Job ${l}, '${o(eg(r))}' has ended -`)})),0}return await V5(r,e,t)}async function MPe(r,e,t,{background:i=!1}={}){let n,s=a=>{n=a,t.variables["?"]=String(a)},o=async a=>{try{return await OPe(a.chain,e,t,{background:i&&typeof a.then=="undefined"})}catch(l){if(!(l instanceof Ms))throw l;return t.stderr.write(`${l.message} -`),1}};for(s(await o(r));r.then;){if(t.exitCode!==null)return t.exitCode;switch(r.then.type){case"&&":n===0&&s(await o(r.then.line));break;case"||":n!==0&&s(await o(r.then.line));break;default:throw new Error(`Assertion failed: Unsupported command type: "${r.then.type}"`)}r=r.then.line}return n}async function _w(r,e,t){let i=t.backgroundJobs;t.backgroundJobs=[];let n=0;for(let{command:s,type:o}of r){if(n=await MPe(s,e,t,{background:o==="&"}),t.exitCode!==null)return t.exitCode;t.variables["?"]=String(n)}return await Promise.all(t.backgroundJobs),t.backgroundJobs=i,n}function X5(r){switch(r.type){case"variable":return r.name==="@"||r.name==="#"||r.name==="*"||Number.isFinite(parseInt(r.name,10))||"defaultValue"in r&&!!r.defaultValue&&r.defaultValue.some(e=>Gd(e))||"alternativeValue"in r&&!!r.alternativeValue&&r.alternativeValue.some(e=>Gd(e));case"arithmetic":return zP(r.arithmetic);case"shell":return _P(r.shell);default:return!1}}function Gd(r){switch(r.type){case"redirection":return r.args.some(e=>Gd(e));case"argument":return r.segments.some(e=>X5(e));default:throw new Error(`Assertion failed: Unsupported argument type: "${r.type}"`)}}function zP(r){switch(r.type){case"variable":return X5(r);case"number":return!1;default:return zP(r.left)||zP(r.right)}}function _P(r){return r.some(({command:e})=>{for(;e;){let t=e.chain;for(;t;){let i;switch(t.type){case"subshell":i=_P(t.subshell);break;case"command":i=t.envs.some(n=>n.args.some(s=>Gd(s)))||t.args.some(n=>Gd(n));break}if(i)return!0;if(!t.then)break;t=t.then.chain}if(!e.then)break;e=e.then.line}return!1})}async function Xw(r,e=[],{baseFs:t=new ar,builtins:i={},cwd:n=H.toPortablePath(process.cwd()),env:s=process.env,stdin:o=process.stdin,stdout:a=process.stdout,stderr:l=process.stderr,variables:c={},glob:u=Yw}={}){let g={};for(let[p,m]of Object.entries(s))typeof m!="undefined"&&(g[p]=m);let f=new Map(RPe);for(let[p,m]of Object.entries(i))f.set(p,m);o===null&&(o=new os.PassThrough,o.end());let h=_E(r,u);if(!_P(h)&&h.length>0&&e.length>0){let{command:p}=h[h.length-1];for(;p.then;)p=p.then.line;let m=p.chain;for(;m.then;)m=m.then.chain;m.type==="command"&&(m.args=m.args.concat(e.map(y=>({type:"argument",segments:[{type:"text",text:y}]}))))}return await _w(h,{args:e,baseFs:t,builtins:f,initialStdin:o,initialStdout:a,initialStderr:l,glob:u},{cwd:n,environment:g,exitCode:null,procedures:{},stdin:o,stdout:a,stderr:l,variables:Object.assign({},c,{["?"]:0}),nextBackgroundJobIndex:1,backgroundJobs:[]})}var O9=ge(Zw()),M9=ge(gg()),El=ge(require("stream"));var R9=ge(D9()),tB=ge(Ic());var F9=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],N9=80,TDe=new Set([X.FETCH_NOT_CACHED,X.UNUSED_CACHE_ENTRY]),ODe=5,rB=tB.default.GITHUB_ACTIONS?{start:r=>`::group::${r} -`,end:r=>`::endgroup:: -`}:tB.default.TRAVIS?{start:r=>`travis_fold:start:${r} -`,end:r=>`travis_fold:end:${r} -`}:tB.default.GITLAB?{start:r=>`section_start:${Math.floor(Date.now()/1e3)}:${r.toLowerCase().replace(/\W+/g,"_")}[collapsed=true]\r${r} -`,end:r=>`section_end:${Math.floor(Date.now()/1e3)}:${r.toLowerCase().replace(/\W+/g,"_")}\r`}:null,L9=new Date,MDe=["iTerm.app","Apple_Terminal"].includes(process.env.TERM_PROGRAM)||!!process.env.WT_SESSION,KDe=r=>r,iB=KDe({patrick:{date:[17,3],chars:["\u{1F340}","\u{1F331}"],size:40},simba:{date:[19,7],chars:["\u{1F981}","\u{1F334}"],size:40},jack:{date:[31,10],chars:["\u{1F383}","\u{1F987}"],size:40},hogsfather:{date:[31,12],chars:["\u{1F389}","\u{1F384}"],size:40},default:{chars:["=","-"],size:80}}),UDe=MDe&&Object.keys(iB).find(r=>{let e=iB[r];return!(e.date&&(e.date[0]!==L9.getDate()||e.date[1]!==L9.getMonth()+1))})||"default";function T9(r,{configuration:e,json:t}){if(!e.get("enableMessageNames"))return"";let n=_A(r===null?0:r);return!t&&r===null?tt(e,n,"grey"):n}function eD(r,{configuration:e,json:t}){let i=T9(r,{configuration:e,json:t});if(!i||r===null||r===X.UNNAMED)return i;let n=X[r],s=`https://yarnpkg.com/advanced/error-codes#${i}---${n}`.toLowerCase();return Mg(e,i,s)}var Je=class extends Ji{constructor({configuration:e,stdout:t,json:i=!1,includeFooter:n=!0,includeLogs:s=!i,includeInfos:o=s,includeWarnings:a=s,forgettableBufferSize:l=ODe,forgettableNames:c=new Set}){super();this.uncommitted=new Set;this.cacheHitCount=0;this.cacheMissCount=0;this.lastCacheMiss=null;this.warningCount=0;this.errorCount=0;this.startTime=Date.now();this.indent=0;this.progress=new Map;this.progressTime=0;this.progressFrame=0;this.progressTimeout=null;this.progressStyle=null;this.progressMaxScaledSize=null;this.forgettableLines=[];if(nd(this,{configuration:e}),this.configuration=e,this.forgettableBufferSize=l,this.forgettableNames=new Set([...c,...TDe]),this.includeFooter=n,this.includeInfos=o,this.includeWarnings=a,this.json=i,this.stdout=t,e.get("enableProgressBars")&&!i&&t.isTTY&&t.columns>22){let u=e.get("progressBarStyle")||UDe;if(!Object.prototype.hasOwnProperty.call(iB,u))throw new Error("Assertion failed: Invalid progress bar style");this.progressStyle=iB[u];let g="\u27A4 YN0000: \u250C ".length,f=Math.max(0,Math.min(t.columns-g,80));this.progressMaxScaledSize=Math.floor(this.progressStyle.size*f/80)}}static async start(e,t){let i=new this(e),n=process.emitWarning;process.emitWarning=(s,o)=>{if(typeof s!="string"){let l=s;s=l.message,o=o!=null?o:l.name}let a=typeof o!="undefined"?`${o}: ${s}`:s;i.reportWarning(X.UNNAMED,a)};try{await t(i)}catch(s){i.reportExceptionOnce(s)}finally{await i.finalize(),process.emitWarning=n}return i}hasErrors(){return this.errorCount>0}exitCode(){return this.hasErrors()?1:0}reportCacheHit(e){this.cacheHitCount+=1}reportCacheMiss(e,t){this.lastCacheMiss=e,this.cacheMissCount+=1,typeof t!="undefined"&&!this.configuration.get("preferAggregateCacheInfo")&&this.reportInfo(X.FETCH_NOT_CACHED,t)}startSectionSync({reportHeader:e,reportFooter:t,skipIfEmpty:i},n){let s={committed:!1,action:()=>{e==null||e()}};i?this.uncommitted.add(s):(s.action(),s.committed=!0);let o=Date.now();try{return n()}catch(a){throw this.reportExceptionOnce(a),a}finally{let a=Date.now();this.uncommitted.delete(s),s.committed&&(t==null||t(a-o))}}async startSectionPromise({reportHeader:e,reportFooter:t,skipIfEmpty:i},n){let s={committed:!1,action:()=>{e==null||e()}};i?this.uncommitted.add(s):(s.action(),s.committed=!0);let o=Date.now();try{return await n()}catch(a){throw this.reportExceptionOnce(a),a}finally{let a=Date.now();this.uncommitted.delete(s),s.committed&&(t==null||t(a-o))}}startTimerImpl(e,t,i){let n=typeof t=="function"?{}:t;return{cb:typeof t=="function"?t:i,reportHeader:()=>{this.reportInfo(null,`\u250C ${e}`),this.indent+=1,rB!==null&&!this.json&&this.includeInfos&&this.stdout.write(rB.start(e))},reportFooter:o=>{this.indent-=1,rB!==null&&!this.json&&this.includeInfos&&this.stdout.write(rB.end(e)),this.configuration.get("enableTimers")&&o>200?this.reportInfo(null,`\u2514 Completed in ${tt(this.configuration,o,qe.DURATION)}`):this.reportInfo(null,"\u2514 Completed")},skipIfEmpty:n.skipIfEmpty}}startTimerSync(e,t,i){let o=this.startTimerImpl(e,t,i),{cb:n}=o,s=Or(o,["cb"]);return this.startSectionSync(s,n)}async startTimerPromise(e,t,i){let o=this.startTimerImpl(e,t,i),{cb:n}=o,s=Or(o,["cb"]);return this.startSectionPromise(s,n)}async startCacheReport(e){let t=this.configuration.get("preferAggregateCacheInfo")?{cacheHitCount:this.cacheHitCount,cacheMissCount:this.cacheMissCount}:null;try{return await e()}catch(i){throw this.reportExceptionOnce(i),i}finally{t!==null&&this.reportCacheChanges(t)}}reportSeparator(){this.indent===0?this.writeLineWithForgettableReset(""):this.reportInfo(null,"")}reportInfo(e,t){if(!this.includeInfos)return;this.commit();let i=this.formatNameWithHyperlink(e),n=i?`${i}: `:"",s=`${tt(this.configuration,"\u27A4","blueBright")} ${n}${this.formatIndent()}${t}`;if(this.json)this.reportJson({type:"info",name:e,displayName:this.formatName(e),indent:this.formatIndent(),data:t});else if(this.forgettableNames.has(e))if(this.forgettableLines.push(s),this.forgettableLines.length>this.forgettableBufferSize){for(;this.forgettableLines.length>this.forgettableBufferSize;)this.forgettableLines.shift();this.writeLines(this.forgettableLines,{truncate:!0})}else this.writeLine(s,{truncate:!0});else this.writeLineWithForgettableReset(s)}reportWarning(e,t){if(this.warningCount+=1,!this.includeWarnings)return;this.commit();let i=this.formatNameWithHyperlink(e),n=i?`${i}: `:"";this.json?this.reportJson({type:"warning",name:e,displayName:this.formatName(e),indent:this.formatIndent(),data:t}):this.writeLineWithForgettableReset(`${tt(this.configuration,"\u27A4","yellowBright")} ${n}${this.formatIndent()}${t}`)}reportError(e,t){this.errorCount+=1,this.commit();let i=this.formatNameWithHyperlink(e),n=i?`${i}: `:"";this.json?this.reportJson({type:"error",name:e,displayName:this.formatName(e),indent:this.formatIndent(),data:t}):this.writeLineWithForgettableReset(`${tt(this.configuration,"\u27A4","redBright")} ${n}${this.formatIndent()}${t}`,{truncate:!1})}reportProgress(e){if(this.progressStyle===null)return te(N({},Promise.resolve()),{stop:()=>{}});if(e.hasProgress&&e.hasTitle)throw new Error("Unimplemented: Progress bars can't have both progress and titles.");let t=!1,i=Promise.resolve().then(async()=>{let s={progress:e.hasProgress?0:void 0,title:e.hasTitle?"":void 0};this.progress.set(e,{definition:s,lastScaledSize:e.hasProgress?-1:void 0,lastTitle:void 0}),this.refreshProgress({delta:-1});for await(let{progress:o,title:a}of e)t||s.progress===o&&s.title===a||(s.progress=o,s.title=a,this.refreshProgress());n()}),n=()=>{t||(t=!0,this.progress.delete(e),this.refreshProgress({delta:1}))};return te(N({},i),{stop:n})}reportJson(e){this.json&&this.writeLineWithForgettableReset(`${JSON.stringify(e)}`)}async finalize(){if(!this.includeFooter)return;let e="";this.errorCount>0?e="Failed with errors":this.warningCount>0?e="Done with warnings":e="Done";let t=tt(this.configuration,Date.now()-this.startTime,qe.DURATION),i=this.configuration.get("enableTimers")?`${e} in ${t}`:e;this.errorCount>0?this.reportError(X.UNNAMED,i):this.warningCount>0?this.reportWarning(X.UNNAMED,i):this.reportInfo(X.UNNAMED,i)}writeLine(e,{truncate:t}={}){this.clearProgress({clear:!0}),this.stdout.write(`${this.truncate(e,{truncate:t})} -`),this.writeProgress()}writeLineWithForgettableReset(e,{truncate:t}={}){this.forgettableLines=[],this.writeLine(e,{truncate:t})}writeLines(e,{truncate:t}={}){this.clearProgress({delta:e.length});for(let i of e)this.stdout.write(`${this.truncate(i,{truncate:t})} -`);this.writeProgress()}reportCacheChanges({cacheHitCount:e,cacheMissCount:t}){let i=this.cacheHitCount-e,n=this.cacheMissCount-t;if(i===0&&n===0)return;let s="";this.cacheHitCount>1?s+=`${this.cacheHitCount} packages were already cached`:this.cacheHitCount===1?s+=" - one package was already cached":s+="No packages were cached",this.cacheHitCount>0?this.cacheMissCount>1?s+=`, ${this.cacheMissCount} had to be fetched`:this.cacheMissCount===1&&(s+=`, one had to be fetched (${It(this.configuration,this.lastCacheMiss)})`):this.cacheMissCount>1?s+=` - ${this.cacheMissCount} packages had to be fetched`:this.cacheMissCount===1&&(s+=` - one package had to be fetched (${It(this.configuration,this.lastCacheMiss)})`),this.reportInfo(X.FETCH_NOT_CACHED,s)}commit(){let e=this.uncommitted;this.uncommitted=new Set;for(let t of e)t.committed=!0,t.action()}clearProgress({delta:e=0,clear:t=!1}){this.progressStyle!==null&&this.progress.size+e>0&&(this.stdout.write(`[${this.progress.size+e}A`),(e>0||t)&&this.stdout.write(""))}writeProgress(){if(this.progressStyle===null||(this.progressTimeout!==null&&clearTimeout(this.progressTimeout),this.progressTimeout=null,this.progress.size===0))return;let e=Date.now();e-this.progressTime>N9&&(this.progressFrame=(this.progressFrame+1)%F9.length,this.progressTime=e);let t=F9[this.progressFrame];for(let i of this.progress.values()){let n="";if(typeof i.lastScaledSize!="undefined"){let l=this.progressStyle.chars[0].repeat(i.lastScaledSize),c=this.progressStyle.chars[1].repeat(this.progressMaxScaledSize-i.lastScaledSize);n=` ${l}${c}`}let s=this.formatName(null),o=s?`${s}: `:"",a=i.definition.title?` ${i.definition.title}`:"";this.stdout.write(`${tt(this.configuration,"\u27A4","blueBright")} ${o}${t}${n}${a} -`)}this.progressTimeout=setTimeout(()=>{this.refreshProgress({force:!0})},N9)}refreshProgress({delta:e=0,force:t=!1}={}){let i=!1,n=!1;if(t||this.progress.size===0)i=!0;else for(let s of this.progress.values()){let o=typeof s.definition.progress!="undefined"?Math.trunc(this.progressMaxScaledSize*s.definition.progress):void 0,a=s.lastScaledSize;s.lastScaledSize=o;let l=s.lastTitle;if(s.lastTitle=s.definition.title,o!==a||(n=l!==s.definition.title)){i=!0;break}}i&&(this.clearProgress({delta:e,clear:n}),this.writeProgress())}truncate(e,{truncate:t}={}){return this.progressStyle===null&&(t=!1),typeof t=="undefined"&&(t=this.configuration.get("preferTruncatedLines")),t&&(e=(0,R9.default)(e,0,this.stdout.columns-1)),e}formatName(e){return T9(e,{configuration:this.configuration,json:this.json})}formatNameWithHyperlink(e){return eD(e,{configuration:this.configuration,json:this.json})}formatIndent(){return"\u2502 ".repeat(this.indent)}};var Ur="3.2.2";var hn;(function(n){n.Yarn1="Yarn Classic",n.Yarn2="Yarn",n.Npm="npm",n.Pnpm="pnpm"})(hn||(hn={}));async function AA(r,e,t,i=[]){if(process.platform==="win32"){let n=`@goto #_undefined_# 2>NUL || @title %COMSPEC% & @setlocal & @"${t}" ${i.map(s=>`"${s.replace('"','""')}"`).join(" ")} %*`;await K.writeFilePromise(k.format({dir:r,name:e,ext:".cmd"}),n)}await K.writeFilePromise(k.join(r,e),`#!/bin/sh -exec "${t}" ${i.map(n=>`'${n.replace(/'/g,`'"'"'`)}'`).join(" ")} "$@" -`,{mode:493})}async function K9(r){let e=await At.tryFind(r);if(e==null?void 0:e.packageManager){let i=lw(e.packageManager);if(i==null?void 0:i.name){let n=`found ${JSON.stringify({packageManager:e.packageManager})} in manifest`,[s]=i.reference.split(".");switch(i.name){case"yarn":return{packageManager:Number(s)===1?hn.Yarn1:hn.Yarn2,reason:n};case"npm":return{packageManager:hn.Npm,reason:n};case"pnpm":return{packageManager:hn.Pnpm,reason:n}}}}let t;try{t=await K.readFilePromise(k.join(r,kt.lockfile),"utf8")}catch{}return t!==void 0?t.match(/^__metadata:$/m)?{packageManager:hn.Yarn2,reason:'"__metadata" key found in yarn.lock'}:{packageManager:hn.Yarn1,reason:'"__metadata" key not found in yarn.lock, must be a Yarn classic lockfile'}:K.existsSync(k.join(r,"package-lock.json"))?{packageManager:hn.Npm,reason:`found npm's "package-lock.json" lockfile`}:K.existsSync(k.join(r,"pnpm-lock.yaml"))?{packageManager:hn.Pnpm,reason:`found pnpm's "pnpm-lock.yaml" lockfile`}:null}async function Yd({project:r,locator:e,binFolder:t,lifecycleScript:i}){var l,c;let n={};for(let[u,g]of Object.entries(process.env))typeof g!="undefined"&&(n[u.toLowerCase()!=="path"?u:"PATH"]=g);let s=H.fromPortablePath(t);n.BERRY_BIN_FOLDER=H.fromPortablePath(s);let o=process.env.COREPACK_ROOT?H.join(process.env.COREPACK_ROOT,"dist/yarn.js"):process.argv[1];if(await Promise.all([AA(t,"node",process.execPath),...Ur!==null?[AA(t,"run",process.execPath,[o,"run"]),AA(t,"yarn",process.execPath,[o]),AA(t,"yarnpkg",process.execPath,[o]),AA(t,"node-gyp",process.execPath,[o,"run","--top-level","node-gyp"])]:[]]),r&&(n.INIT_CWD=H.fromPortablePath(r.configuration.startingCwd),n.PROJECT_CWD=H.fromPortablePath(r.cwd)),n.PATH=n.PATH?`${s}${H.delimiter}${n.PATH}`:`${s}`,n.npm_execpath=`${s}${H.sep}yarn`,n.npm_node_execpath=`${s}${H.sep}node`,e){if(!r)throw new Error("Assertion failed: Missing project");let u=r.tryWorkspaceByLocator(e),g=u?(l=u.manifest.version)!=null?l:"":(c=r.storedPackages.get(e.locatorHash).version)!=null?c:"";n.npm_package_name=Ot(e),n.npm_package_version=g;let f;if(u)f=u.cwd;else{let h=r.storedPackages.get(e.locatorHash);if(!h)throw new Error(`Package for ${It(r.configuration,e)} not found in the project`);let p=r.configuration.getLinkers(),m={project:r,report:new Je({stdout:new El.PassThrough,configuration:r.configuration})},y=p.find(b=>b.supportsPackage(h,m));if(!y)throw new Error(`The package ${It(r.configuration,h)} isn't supported by any of the available linkers`);f=await y.findPackageLocation(h,m)}n.npm_package_json=H.fromPortablePath(k.join(f,kt.manifest))}let a=Ur!==null?`yarn/${Ur}`:`yarn/${Og("@yarnpkg/core").version}-core`;return n.npm_config_user_agent=`${a} npm/? node/${process.version} ${process.platform} ${process.arch}`,i&&(n.npm_lifecycle_event=i),r&&await r.configuration.triggerHook(u=>u.setupScriptEnvironment,r,n,async(u,g,f)=>await AA(t,Jr(u),g,f)),n}var HDe=2,jDe=(0,M9.default)(HDe);async function GDe(r,e,{configuration:t,report:i,workspace:n=null,locator:s=null}){await jDe(async()=>{await K.mktempPromise(async o=>{let a=k.join(o,"pack.log"),l=null,{stdout:c,stderr:u}=t.getSubprocessStreams(a,{prefix:H.fromPortablePath(r),report:i}),g=s&&ea(s)?gd(s):s,f=g?Rs(g):"an external project";c.write(`Packing ${f} from sources -`);let h=await K9(r),p;h!==null?(c.write(`Using ${h.packageManager} for bootstrap. Reason: ${h.reason} - -`),p=h.packageManager):(c.write(`No package manager configuration detected; defaulting to Yarn - -`),p=hn.Yarn2),await K.mktempPromise(async m=>{let y=await Yd({binFolder:m}),v=new Map([[hn.Yarn1,async()=>{let T=n!==null?["workspace",n]:[],q=await ra("yarn",["set","version","classic","--only-if-needed"],{cwd:r,env:y,stdin:l,stdout:c,stderr:u,end:ss.ErrorCode});if(q.code!==0)return q.code;await K.appendFilePromise(k.join(r,".npmignore"),`/.yarn -`),c.write(` -`),delete y.NODE_ENV;let Y=await ra("yarn",["install"],{cwd:r,env:y,stdin:l,stdout:c,stderr:u,end:ss.ErrorCode});if(Y.code!==0)return Y.code;c.write(` -`);let $=await ra("yarn",[...T,"pack","--filename",H.fromPortablePath(e)],{cwd:r,env:y,stdin:l,stdout:c,stderr:u});return $.code!==0?$.code:0}],[hn.Yarn2,async()=>{let T=n!==null?["workspace",n]:[];y.YARN_ENABLE_INLINE_BUILDS="1";let q=k.join(r,kt.lockfile);await K.existsPromise(q)||await K.writeFilePromise(q,"");let Y=await ra("yarn",[...T,"pack","--install-if-needed","--filename",H.fromPortablePath(e)],{cwd:r,env:y,stdin:l,stdout:c,stderr:u});return Y.code!==0?Y.code:0}],[hn.Npm,async()=>{if(n!==null){let A=new El.PassThrough,oe=Tg(A);A.pipe(c,{end:!1});let ce=await ra("npm",["--version"],{cwd:r,env:y,stdin:l,stdout:A,stderr:u,end:ss.Never});if(A.end(),ce.code!==0)return c.end(),u.end(),ce.code;let Z=(await oe).toString().trim();if(!qc(Z,">=7.x")){let O=$o(null,"npm"),L=rr(O,Z),de=rr(O,">=7.x");throw new Error(`Workspaces aren't supported by ${sr(t,L)}; please upgrade to ${sr(t,de)} (npm has been detected as the primary package manager for ${tt(t,r,qe.PATH)})`)}}let T=n!==null?["--workspace",n]:[];delete y.npm_config_user_agent,delete y.npm_config_production,delete y.NPM_CONFIG_PRODUCTION,delete y.NODE_ENV;let q=await ra("npm",["install"],{cwd:r,env:y,stdin:l,stdout:c,stderr:u,end:ss.ErrorCode});if(q.code!==0)return q.code;let Y=new El.PassThrough,$=Tg(Y);Y.pipe(c);let _=await ra("npm",["pack","--silent",...T],{cwd:r,env:y,stdin:l,stdout:Y,stderr:u});if(_.code!==0)return _.code;let ne=(await $).toString().trim().replace(/^.*\n/s,""),ee=k.resolve(r,H.toPortablePath(ne));return await K.renamePromise(ee,e),0}]]).get(p);if(typeof v=="undefined")throw new Error("Assertion failed: Unsupported workflow");let x=await v();if(!(x===0||typeof x=="undefined"))throw K.detachTemp(o),new ct(X.PACKAGE_PREPARATION_FAILED,`Packing the package failed (exit code ${x}, logs can be found here: ${tt(t,a,qe.PATH)})`)})})})}async function YDe(r,e,{project:t}){let i=t.tryWorkspaceByLocator(r);if(i!==null)return tD(i,e);let n=t.storedPackages.get(r.locatorHash);if(!n)throw new Error(`Package for ${It(t.configuration,r)} not found in the project`);return await Is.openPromise(async s=>{let o=t.configuration,a=t.configuration.getLinkers(),l={project:t,report:new Je({stdout:new El.PassThrough,configuration:o})},c=a.find(h=>h.supportsPackage(n,l));if(!c)throw new Error(`The package ${It(t.configuration,n)} isn't supported by any of the available linkers`);let u=await c.findPackageLocation(n,l),g=new _t(u,{baseFs:s});return(await At.find(Me.dot,{baseFs:g})).scripts.has(e)},{libzip:await fn()})}async function nB(r,e,t,{cwd:i,project:n,stdin:s,stdout:o,stderr:a}){return await K.mktempPromise(async l=>{let{manifest:c,env:u,cwd:g}=await U9(r,{project:n,binFolder:l,cwd:i,lifecycleScript:e}),f=c.scripts.get(e);if(typeof f=="undefined")return 1;let h=async()=>await Xw(f,t,{cwd:g,env:u,stdin:s,stdout:o,stderr:a});return await(await n.configuration.reduceHook(m=>m.wrapScriptExecution,h,n,r,e,{script:f,args:t,cwd:g,env:u,stdin:s,stdout:o,stderr:a}))()})}async function rD(r,e,t,{cwd:i,project:n,stdin:s,stdout:o,stderr:a}){return await K.mktempPromise(async l=>{let{env:c,cwd:u}=await U9(r,{project:n,binFolder:l,cwd:i});return await Xw(e,t,{cwd:u,env:c,stdin:s,stdout:o,stderr:a})})}async function qDe(r,{binFolder:e,cwd:t,lifecycleScript:i}){let n=await Yd({project:r.project,locator:r.anchoredLocator,binFolder:e,lifecycleScript:i});return await Promise.all(Array.from(await H9(r),([s,[,o]])=>AA(e,Jr(s),process.execPath,[o]))),typeof t=="undefined"&&(t=k.dirname(await K.realpathPromise(k.join(r.cwd,"package.json")))),{manifest:r.manifest,binFolder:e,env:n,cwd:t}}async function U9(r,{project:e,binFolder:t,cwd:i,lifecycleScript:n}){let s=e.tryWorkspaceByLocator(r);if(s!==null)return qDe(s,{binFolder:t,cwd:i,lifecycleScript:n});let o=e.storedPackages.get(r.locatorHash);if(!o)throw new Error(`Package for ${It(e.configuration,r)} not found in the project`);return await Is.openPromise(async a=>{let l=e.configuration,c=e.configuration.getLinkers(),u={project:e,report:new Je({stdout:new El.PassThrough,configuration:l})},g=c.find(y=>y.supportsPackage(o,u));if(!g)throw new Error(`The package ${It(e.configuration,o)} isn't supported by any of the available linkers`);let f=await Yd({project:e,locator:r,binFolder:t,lifecycleScript:n});await Promise.all(Array.from(await sB(r,{project:e}),([y,[,b]])=>AA(t,Jr(y),process.execPath,[b])));let h=await g.findPackageLocation(o,u),p=new _t(h,{baseFs:a}),m=await At.find(Me.dot,{baseFs:p});return typeof i=="undefined"&&(i=h),{manifest:m,binFolder:t,env:f,cwd:i}},{libzip:await fn()})}async function j9(r,e,t,{cwd:i,stdin:n,stdout:s,stderr:o}){return await nB(r.anchoredLocator,e,t,{cwd:i,project:r.project,stdin:n,stdout:s,stderr:o})}function tD(r,e){return r.manifest.scripts.has(e)}async function G9(r,e,{cwd:t,report:i}){let{configuration:n}=r.project,s=null;await K.mktempPromise(async o=>{let a=k.join(o,`${e}.log`),l=`# This file contains the result of Yarn calling the "${e}" lifecycle script inside a workspace ("${H.fromPortablePath(r.cwd)}") -`,{stdout:c,stderr:u}=n.getSubprocessStreams(a,{report:i,prefix:It(n,r.anchoredLocator),header:l});i.reportInfo(X.LIFECYCLE_SCRIPT,`Calling the "${e}" lifecycle script`);let g=await j9(r,e,[],{cwd:t,stdin:s,stdout:c,stderr:u});if(c.end(),u.end(),g!==0)throw K.detachTemp(o),new ct(X.LIFECYCLE_SCRIPT,`${(0,O9.default)(e)} script failed (exit code ${tt(n,g,qe.NUMBER)}, logs can be found here: ${tt(n,a,qe.PATH)}); run ${tt(n,`yarn ${e}`,qe.CODE)} to investigate`)})}async function JDe(r,e,t){tD(r,e)&&await G9(r,e,t)}async function sB(r,{project:e}){let t=e.configuration,i=new Map,n=e.storedPackages.get(r.locatorHash);if(!n)throw new Error(`Package for ${It(t,r)} not found in the project`);let s=new El.Writable,o=t.getLinkers(),a={project:e,report:new Je({configuration:t,stdout:s})},l=new Set([r.locatorHash]);for(let u of n.dependencies.values()){let g=e.storedResolutions.get(u.descriptorHash);if(!g)throw new Error(`Assertion failed: The resolution (${sr(t,u)}) should have been registered`);l.add(g)}let c=await Promise.all(Array.from(l,async u=>{let g=e.storedPackages.get(u);if(!g)throw new Error(`Assertion failed: The package (${u}) should have been registered`);if(g.bin.size===0)return zo.skip;let f=o.find(p=>p.supportsPackage(g,a));if(!f)return zo.skip;let h=null;try{h=await f.findPackageLocation(g,a)}catch(p){if(p.code==="LOCATOR_NOT_INSTALLED")return zo.skip;throw p}return{dependency:g,packageLocation:h}}));for(let u of c){if(u===zo.skip)continue;let{dependency:g,packageLocation:f}=u;for(let[h,p]of g.bin)i.set(h,[g,H.fromPortablePath(k.resolve(f,p))])}return i}async function H9(r){return await sB(r.anchoredLocator,{project:r.project})}async function Y9(r,e,t,{cwd:i,project:n,stdin:s,stdout:o,stderr:a,nodeArgs:l=[],packageAccessibleBinaries:c}){c!=null||(c=await sB(r,{project:n}));let u=c.get(e);if(!u)throw new Error(`Binary not found (${e}) for ${It(n.configuration,r)}`);return await K.mktempPromise(async g=>{let[,f]=u,h=await Yd({project:n,locator:r,binFolder:g});await Promise.all(Array.from(c,([m,[,y]])=>AA(h.BERRY_BIN_FOLDER,Jr(m),process.execPath,[y])));let p;try{p=await ra(process.execPath,[...l,f,...t],{cwd:i,env:h,stdin:s,stdout:o,stderr:a})}finally{await K.removePromise(h.BERRY_BIN_FOLDER)}return p.code})}async function WDe(r,e,t,{cwd:i,stdin:n,stdout:s,stderr:o,packageAccessibleBinaries:a}){return await Y9(r.anchoredLocator,e,t,{project:r.project,cwd:i,stdin:n,stdout:s,stderr:o,packageAccessibleBinaries:a})}var Bi={};ft(Bi,{convertToZip:()=>iNe,extractArchiveTo:()=>sNe,makeArchiveFromDirectory:()=>rNe});var T6=ge(require("stream")),O6=ge(P6());var D6=ge(require("os")),R6=ge(gg()),F6=ge(require("worker_threads")),Dl=Symbol("kTaskInfo"),pR=class{constructor(e){this.source=e;this.workers=[];this.limit=(0,R6.default)(Math.max(1,(0,D6.cpus)().length));this.cleanupInterval=setInterval(()=>{if(this.limit.pendingCount===0&&this.limit.activeCount===0){let t=this.workers.pop();t?t.terminate():clearInterval(this.cleanupInterval)}},5e3).unref()}createWorker(){this.cleanupInterval.refresh();let e=new F6.Worker(this.source,{eval:!0,execArgv:[...process.execArgv,"--unhandled-rejections=strict"]});return e.on("message",t=>{if(!e[Dl])throw new Error("Assertion failed: Worker sent a result without having a task assigned");e[Dl].resolve(t),e[Dl]=null,e.unref(),this.workers.push(e)}),e.on("error",t=>{var i;(i=e[Dl])==null||i.reject(t),e[Dl]=null}),e.on("exit",t=>{var i;t!==0&&((i=e[Dl])==null||i.reject(new Error(`Worker exited with code ${t}`))),e[Dl]=null}),e}run(e){return this.limit(()=>{var i;let t=(i=this.workers.pop())!=null?i:this.createWorker();return t.ref(),new Promise((n,s)=>{t[Dl]={resolve:n,reject:s},t.postMessage(e)})})}};var M6=ge(L6());async function rNe(r,{baseFs:e=new ar,prefixPath:t=Me.root,compressionLevel:i,inMemory:n=!1}={}){let s=await fn(),o;if(n)o=new li(null,{libzip:s,level:i});else{let l=await K.mktempPromise(),c=k.join(l,"archive.zip");o=new li(c,{create:!0,libzip:s,level:i})}let a=k.resolve(Me.root,t);return await o.copyPromise(a,r,{baseFs:e,stableTime:!0,stableSort:!0}),o}var K6;async function iNe(r,e){let t=await K.mktempPromise(),i=k.join(t,"archive.zip");return K6||(K6=new pR((0,M6.getContent)())),await K6.run({tmpFile:i,tgz:r,opts:e}),new li(i,{libzip:await fn(),level:e.compressionLevel})}async function*nNe(r){let e=new O6.default.Parse,t=new T6.PassThrough({objectMode:!0,autoDestroy:!0,emitClose:!0});e.on("entry",i=>{t.write(i)}),e.on("error",i=>{t.destroy(i)}),e.on("close",()=>{t.destroyed||t.end()}),e.end(r);for await(let i of t){let n=i;yield n,n.resume()}}async function sNe(r,e,{stripComponents:t=0,prefixPath:i=Me.dot}={}){var s,o;function n(a){if(a.path[0]==="/")return!0;let l=a.path.split(/\//g);return!!(l.some(c=>c==="..")||l.length<=t)}for await(let a of nNe(r)){if(n(a))continue;let l=k.normalize(H.toPortablePath(a.path)).replace(/\/$/,"").split(/\//g);if(l.length<=t)continue;let c=l.slice(t).join("/"),u=k.join(i,c),g=420;switch((a.type==="Directory"||(((s=a.mode)!=null?s:0)&73)!=0)&&(g|=73),a.type){case"Directory":e.mkdirpSync(k.dirname(u),{chmod:493,utimes:[Rr.SAFE_TIME,Rr.SAFE_TIME]}),e.mkdirSync(u,{mode:g}),e.utimesSync(u,Rr.SAFE_TIME,Rr.SAFE_TIME);break;case"OldFile":case"File":e.mkdirpSync(k.dirname(u),{chmod:493,utimes:[Rr.SAFE_TIME,Rr.SAFE_TIME]}),e.writeFileSync(u,await Tg(a),{mode:g}),e.utimesSync(u,Rr.SAFE_TIME,Rr.SAFE_TIME);break;case"SymbolicLink":e.mkdirpSync(k.dirname(u),{chmod:493,utimes:[Rr.SAFE_TIME,Rr.SAFE_TIME]}),e.symlinkSync(a.linkpath,u),(o=e.lutimesSync)==null||o.call(e,u,Rr.SAFE_TIME,Rr.SAFE_TIME);break}}return e}var ls={};ft(ls,{emitList:()=>oNe,emitTree:()=>q6,treeNodeToJson:()=>Y6,treeNodeToTreeify:()=>G6});var j6=ge(H6());function G6(r,{configuration:e}){let t={},i=(n,s)=>{let o=Array.isArray(n)?n.entries():Object.entries(n);for(let[a,{label:l,value:c,children:u}]of o){let g=[];typeof l!="undefined"&&g.push(Ry(e,l,Tc.BOLD)),typeof c!="undefined"&&g.push(tt(e,c[0],c[1])),g.length===0&&g.push(Ry(e,`${a}`,Tc.BOLD));let f=g.join(": "),h=s[f]={};typeof u!="undefined"&&i(u,h)}};if(typeof r.children=="undefined")throw new Error("The root node must only contain children");return i(r.children,t),t}function Y6(r){let e=t=>{var s;if(typeof t.children=="undefined"){if(typeof t.value=="undefined")throw new Error("Assertion failed: Expected a value to be set if the children are missing");return Oc(t.value[0],t.value[1])}let i=Array.isArray(t.children)?t.children.entries():Object.entries((s=t.children)!=null?s:{}),n=Array.isArray(t.children)?[]:{};for(let[o,a]of i)n[o]=e(a);return typeof t.value=="undefined"?n:{value:Oc(t.value[0],t.value[1]),children:n}};return e(r)}function oNe(r,{configuration:e,stdout:t,json:i}){let n=r.map(s=>({value:s}));q6({children:n},{configuration:e,stdout:t,json:i})}function q6(r,{configuration:e,stdout:t,json:i,separators:n=0}){var o;if(i){let a=Array.isArray(r.children)?r.children.values():Object.values((o=r.children)!=null?o:{});for(let l of a)t.write(`${JSON.stringify(Y6(l))} -`);return}let s=(0,j6.asTree)(G6(r,{configuration:e}),!1,!1);if(n>=1&&(s=s.replace(/^([├└]─)/gm,`\u2502 -$1`).replace(/^│\n/,"")),n>=2)for(let a=0;a<2;++a)s=s.replace(/^([│ ].{2}[├│ ].{2}[^\n]+\n)(([│ ]).{2}[├└].{2}[^\n]*\n[│ ].{2}[│ ].{2}[├└]─)/gm,`$1$3 \u2502 -$2`).replace(/^│\n/,"");if(n>=3)throw new Error("Only the first two levels are accepted by treeUtils.emitTree");t.write(s)}var J6=ge(require("crypto")),mR=ge(require("fs"));var aNe=8,Nt=class{constructor(e,{configuration:t,immutable:i=t.get("enableImmutableCache"),check:n=!1}){this.markedFiles=new Set;this.mutexes=new Map;this.cacheId=`-${(0,J6.randomBytes)(8).toString("hex")}.tmp`;this.configuration=t,this.cwd=e,this.immutable=i,this.check=n;let s=t.get("cacheKeyOverride");if(s!==null)this.cacheKey=`${s}`;else{let o=t.get("compressionLevel"),a=o!==lc?`c${o}`:"";this.cacheKey=[aNe,a].join("")}}static async find(e,{immutable:t,check:i}={}){let n=new Nt(e.get("cacheFolder"),{configuration:e,immutable:t,check:i});return await n.setup(),n}get mirrorCwd(){if(!this.configuration.get("enableMirror"))return null;let e=`${this.configuration.get("globalFolder")}/cache`;return e!==this.cwd?e:null}getVersionFilename(e){return`${Jg(e)}-${this.cacheKey}.zip`}getChecksumFilename(e,t){let n=ANe(t).slice(0,10);return`${Jg(e)}-${n}.zip`}getLocatorPath(e,t,i={}){var s;return this.mirrorCwd===null||((s=i.unstablePackages)==null?void 0:s.has(e.locatorHash))?k.resolve(this.cwd,this.getVersionFilename(e)):t===null||ER(t)!==this.cacheKey?null:k.resolve(this.cwd,this.getChecksumFilename(e,t))}getLocatorMirrorPath(e){let t=this.mirrorCwd;return t!==null?k.resolve(t,this.getVersionFilename(e)):null}async setup(){if(!this.configuration.get("enableGlobalCache"))if(this.immutable){if(!await K.existsPromise(this.cwd))throw new ct(X.IMMUTABLE_CACHE,"Cache path does not exist.")}else{await K.mkdirPromise(this.cwd,{recursive:!0});let e=k.resolve(this.cwd,".gitignore");await K.changeFilePromise(e,`/.gitignore -*.flock -*.tmp -`)}(this.mirrorCwd||!this.immutable)&&await K.mkdirPromise(this.mirrorCwd||this.cwd,{recursive:!0})}async fetchPackageFromCache(e,t,a){var l=a,{onHit:i,onMiss:n,loader:s}=l,o=Or(l,["onHit","onMiss","loader"]);var A;let c=this.getLocatorMirrorPath(e),u=new ar,g=()=>{let oe=new li(null,{libzip:q}),ce=k.join(Me.root,ek(e));return oe.mkdirSync(ce,{recursive:!0}),oe.writeJsonSync(k.join(ce,kt.manifest),{name:Ot(e),mocked:!0}),oe},f=async(oe,ce=null)=>{var O;if(ce===null&&((O=o.unstablePackages)==null?void 0:O.has(e.locatorHash)))return null;let Z=!o.skipIntegrityCheck||!t?`${this.cacheKey}/${await sw(oe)}`:t;if(ce!==null){let L=!o.skipIntegrityCheck||!t?`${this.cacheKey}/${await sw(ce)}`:t;if(Z!==L)throw new ct(X.CACHE_CHECKSUM_MISMATCH,"The remote archive doesn't match the local checksum - has the local cache been corrupted?")}if(t!==null&&Z!==t){let L;switch(this.check?L="throw":ER(t)!==ER(Z)?L="update":L=this.configuration.get("checksumBehavior"),L){case"ignore":return t;case"update":return Z;default:case"throw":throw new ct(X.CACHE_CHECKSUM_MISMATCH,"The remote archive doesn't match the expected checksum")}}return Z},h=async oe=>{if(!s)throw new Error(`Cache check required but no loader configured for ${It(this.configuration,e)}`);let ce=await s(),Z=ce.getRealPath();return ce.saveAndClose(),await K.chmodPromise(Z,420),await f(oe,Z)},p=async()=>{if(c===null||!await K.existsPromise(c)){let oe=await s(),ce=oe.getRealPath();return oe.saveAndClose(),{source:"loader",path:ce}}return{source:"mirror",path:c}},m=async()=>{if(!s)throw new Error(`Cache entry required but missing for ${It(this.configuration,e)}`);if(this.immutable)throw new ct(X.IMMUTABLE_CACHE,`Cache entry required but missing for ${It(this.configuration,e)}`);let{path:oe,source:ce}=await p(),Z=await f(oe),O=this.getLocatorPath(e,Z,o);if(!O)throw new Error("Assertion failed: Expected the cache path to be available");let L=[];ce!=="mirror"&&c!==null&&L.push(async()=>{let Be=`${c}${this.cacheId}`;await K.copyFilePromise(oe,Be,mR.default.constants.COPYFILE_FICLONE),await K.chmodPromise(Be,420),await K.renamePromise(Be,c)}),(!o.mirrorWriteOnly||c===null)&&L.push(async()=>{let Be=`${O}${this.cacheId}`;await K.copyFilePromise(oe,Be,mR.default.constants.COPYFILE_FICLONE),await K.chmodPromise(Be,420),await K.renamePromise(Be,O)});let de=o.mirrorWriteOnly&&c!=null?c:O;return await Promise.all(L.map(Be=>Be())),[!1,de,Z]},y=async()=>{let ce=(async()=>{var je;let Z=this.getLocatorPath(e,t,o),O=Z!==null?await u.existsPromise(Z):!1,L=!!((je=o.mockedPackages)==null?void 0:je.has(e.locatorHash))&&(!this.check||!O),de=L||O,Be=de?i:n;if(Be&&Be(),de){let re=null,se=Z;return L||(re=this.check?await h(se):await f(se)),[L,se,re]}else return m()})();this.mutexes.set(e.locatorHash,ce);try{return await ce}finally{this.mutexes.delete(e.locatorHash)}};for(let oe;oe=this.mutexes.get(e.locatorHash);)await oe;let[b,v,x]=await y();this.markedFiles.add(v);let T,q=await fn(),Y=b?()=>g():()=>new li(v,{baseFs:u,libzip:q,readOnly:!0}),$=new _h(()=>Rv(()=>T=Y(),oe=>`Failed to open the cache entry for ${It(this.configuration,e)}: ${oe}`),k),_=new Na(v,{baseFs:$,pathUtils:k}),ne=()=>{T==null||T.discardAndClose()},ee=((A=o.unstablePackages)==null?void 0:A.has(e.locatorHash))?null:x;return[_,ne,ee]}};function ER(r){let e=r.indexOf("/");return e!==-1?r.slice(0,e):null}function ANe(r){let e=r.indexOf("/");return e!==-1?r.slice(e+1):r}var cs;(function(t){t[t.SCRIPT=0]="SCRIPT",t[t.SHELLCODE=1]="SHELLCODE"})(cs||(cs={}));var pA=class extends Ji{constructor({configuration:e,stdout:t,suggestInstall:i=!0}){super();this.errorCount=0;nd(this,{configuration:e}),this.configuration=e,this.stdout=t,this.suggestInstall=i}static async start(e,t){let i=new this(e);try{await t(i)}catch(n){i.reportExceptionOnce(n)}finally{await i.finalize()}return i}hasErrors(){return this.errorCount>0}exitCode(){return this.hasErrors()?1:0}reportCacheHit(e){}reportCacheMiss(e){}startSectionSync(e,t){return t()}async startSectionPromise(e,t){return await t()}startTimerSync(e,t,i){return(typeof t=="function"?t:i)()}async startTimerPromise(e,t,i){return await(typeof t=="function"?t:i)()}async startCacheReport(e){return await e()}reportSeparator(){}reportInfo(e,t){}reportWarning(e,t){}reportError(e,t){this.errorCount+=1,this.stdout.write(`${tt(this.configuration,"\u27A4","redBright")} ${this.formatNameWithHyperlink(e)}: ${t} -`)}reportProgress(e){let t=Promise.resolve().then(async()=>{for await(let{}of e);}),i=()=>{};return te(N({},t),{stop:i})}reportJson(e){}async finalize(){this.errorCount>0&&(this.stdout.write(` -`),this.stdout.write(`${tt(this.configuration,"\u27A4","redBright")} Errors happened when preparing the environment required to run this command. -`),this.suggestInstall&&this.stdout.write(`${tt(this.configuration,"\u27A4","redBright")} This might be caused by packages being missing from the lockfile, in which case running "yarn install" might help. -`))}formatNameWithHyperlink(e){return eD(e,{configuration:this.configuration,json:!1})}};var i0=ge(require("crypto"));function dA(){}dA.prototype={diff:function(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=i.callback;typeof i=="function"&&(n=i,i={}),this.options=i;var s=this;function o(m){return n?(setTimeout(function(){n(void 0,m)},0),!0):m}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e)),t=this.removeEmpty(this.tokenize(t));var a=t.length,l=e.length,c=1,u=a+l;i.maxEditLength&&(u=Math.min(u,i.maxEditLength));var g=[{newPos:-1,components:[]}],f=this.extractCommon(g[0],t,e,0);if(g[0].newPos+1>=a&&f+1>=l)return o([{value:this.join(t),count:t.length}]);function h(){for(var m=-1*c;m<=c;m+=2){var y=void 0,b=g[m-1],v=g[m+1],x=(v?v.newPos:0)-m;b&&(g[m-1]=void 0);var T=b&&b.newPos+1=a&&x+1>=l)return o(lNe(s,y.components,t,e,s.useLongestToken));g[m]=y}c++}if(n)(function m(){setTimeout(function(){if(c>u)return n();h()||m()},0)})();else for(;c<=u;){var p=h();if(p)return p}},pushComponent:function(e,t,i){var n=e[e.length-1];n&&n.added===t&&n.removed===i?e[e.length-1]={count:n.count+1,added:t,removed:i}:e.push({count:1,added:t,removed:i})},extractCommon:function(e,t,i,n){for(var s=t.length,o=i.length,a=e.newPos,l=a-n,c=0;a+1h.length?m:h}),c.value=r.join(u)}else c.value=r.join(t.slice(a,a+c.count));a+=c.count,c.added||(l+=c.count)}}var f=e[o-1];return o>1&&typeof f.value=="string"&&(f.added||f.removed)&&r.equals("",f.value)&&(e[o-2].value+=f.value,e.pop()),e}function cNe(r){return{newPos:r.newPos,components:r.components.slice(0)}}var nAt=new dA;var W6=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,z6=/\S/,_6=new dA;_6.equals=function(r,e){return this.options.ignoreCase&&(r=r.toLowerCase(),e=e.toLowerCase()),r===e||this.options.ignoreWhitespace&&!z6.test(r)&&!z6.test(e)};_6.tokenize=function(r){for(var e=r.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),t=0;tr.length)&&(e=r.length);for(var t=0,i=new Array(e);t0?l(Y.lines.slice(-o.context)):[],u-=f.length,g-=f.length)}(q=f).push.apply(q,yR(T.map(function(Z){return(x.added?"+":"-")+Z}))),x.added?p+=T.length:h+=T.length}else{if(u)if(T.length<=o.context*2&&v=a.length-2&&T.length<=o.context){var A=/\n$/.test(t),oe=/\n$/.test(i),ce=T.length==0&&f.length>ee.oldLines;!A&&ce&&t.length>0&&f.splice(ee.oldLines,0,"\\ No newline at end of file"),(!A&&!ce||!oe)&&f.push("\\ No newline at end of file")}c.push(ee),u=0,g=0,f=[]}h+=T.length,p+=T.length}},y=0;y`${t}#commit=${i}`],[/^https:\/\/((?:[^/]+?)@)?codeload\.github\.com\/([^/]+\/[^/]+)\/tar\.gz\/([0-9a-f]+)$/,(r,e,t="",i,n)=>`https://${t}github.com/${i}.git#commit=${n}`],[/^https:\/\/((?:[^/]+?)@)?github\.com\/([^/]+\/[^/]+?)(?:\.git)?#([0-9a-f]+)$/,(r,e,t="",i,n)=>`https://${t}github.com/${i}.git#commit=${n}`],[/^https?:\/\/[^/]+\/(?:[^/]+\/)*(?:@.+(?:\/|(?:%2f)))?([^/]+)\/(?:-|download)\/\1-[^/]+\.tgz(?:#|$)/,r=>`npm:${r}`],[/^https:\/\/npm\.pkg\.github\.com\/download\/(?:@[^/]+)\/(?:[^/]+)\/(?:[^/]+)\/(?:[0-9a-f]+)(?:#|$)/,r=>`npm:${r}`],[/^https:\/\/npm\.fontawesome\.com\/(?:@[^/]+)\/([^/]+)\/-\/([^/]+)\/\1-\2.tgz(?:#|$)/,r=>`npm:${r}`],[/^https?:\/\/(?:[^\\.]+)\.jfrog\.io\/.*\/(@[^/]+)\/([^/]+)\/-\/\1\/\2-(?:[.\d\w-]+)\.tgz(?:#|$)/,(r,e)=>cw({protocol:"npm:",source:null,selector:r,params:{__archiveUrl:e}})],[/^[^/]+\.tgz#[0-9a-f]+$/,r=>`npm:${r}`]],NR=class{constructor(e){this.resolver=e;this.resolutions=null}async setup(e,{report:t}){let i=k.join(e.cwd,e.configuration.get("lockfileFilename"));if(!K.existsSync(i))return;let n=await K.readFilePromise(i,"utf8"),s=Si(n);if(Object.prototype.hasOwnProperty.call(s,"__metadata"))return;let o=this.resolutions=new Map;for(let a of Object.keys(s)){let l=pd(a);if(!l){t.reportWarning(X.YARN_IMPORT_FAILED,`Failed to parse the string "${a}" into a proper descriptor`);continue}po(l.range)&&(l=rr(l,`npm:${l.range}`));let{version:c,resolved:u}=s[a];if(!u)continue;let g;for(let[h,p]of JOe){let m=u.match(h);if(m){g=p(c,...m);break}}if(!g){t.reportWarning(X.YARN_IMPORT_FAILED,`${sr(e.configuration,l)}: Only some patterns can be imported from legacy lockfiles (not "${u}")`);continue}let f=l;try{let h=qg(l.range),p=pd(h.selector,!0);p&&(f=p)}catch{}o.set(l.descriptorHash,cn(f,g))}}supportsDescriptor(e,t){return this.resolutions?this.resolutions.has(e.descriptorHash):!1}supportsLocator(e,t){return!1}shouldPersistResolution(e,t){throw new Error("Assertion failed: This resolver doesn't support resolving locators to packages")}bindDescriptor(e,t,i){return e}getResolutionDependencies(e,t){return[]}async getCandidates(e,t,i){if(!this.resolutions)throw new Error("Assertion failed: The resolution store should have been setup");let n=this.resolutions.get(e.descriptorHash);if(!n)throw new Error("Assertion failed: The resolution should have been registered");return await this.resolver.getCandidates(_x(n),t,i)}async getSatisfying(e,t,i){return null}async resolve(e,t){throw new Error("Assertion failed: This resolver doesn't support resolving locators to packages")}};var LR=class{constructor(e){this.resolver=e}supportsDescriptor(e,t){return!!(t.project.storedResolutions.get(e.descriptorHash)||t.project.originalPackages.has(Aw(e).locatorHash))}supportsLocator(e,t){return!!(t.project.originalPackages.has(e.locatorHash)&&!t.project.lockfileNeedsRefresh)}shouldPersistResolution(e,t){throw new Error("The shouldPersistResolution method shouldn't be called on the lockfile resolver, which would always answer yes")}bindDescriptor(e,t,i){return e}getResolutionDependencies(e,t){return this.resolver.getResolutionDependencies(e,t)}async getCandidates(e,t,i){let n=i.project.originalPackages.get(Aw(e).locatorHash);if(n)return[n];let s=i.project.storedResolutions.get(e.descriptorHash);if(!s)throw new Error("Expected the resolution to have been successful - resolution not found");if(n=i.project.originalPackages.get(s),!n)throw new Error("Expected the resolution to have been successful - package not found");return[n]}async getSatisfying(e,t,i){return null}async resolve(e,t){let i=t.project.originalPackages.get(e.locatorHash);if(!i)throw new Error("The lockfile resolver isn't meant to resolve packages - they should already have been stored into a cache");return i}};var TR=class{constructor(e){this.resolver=e}supportsDescriptor(e,t){return this.resolver.supportsDescriptor(e,t)}supportsLocator(e,t){return this.resolver.supportsLocator(e,t)}shouldPersistResolution(e,t){return this.resolver.shouldPersistResolution(e,t)}bindDescriptor(e,t,i){return this.resolver.bindDescriptor(e,t,i)}getResolutionDependencies(e,t){return this.resolver.getResolutionDependencies(e,t)}async getCandidates(e,t,i){throw new ct(X.MISSING_LOCKFILE_ENTRY,`This package doesn't seem to be present in your lockfile; run "yarn install" to update the lockfile`)}async getSatisfying(e,t,i){throw new ct(X.MISSING_LOCKFILE_ENTRY,`This package doesn't seem to be present in your lockfile; run "yarn install" to update the lockfile`)}async resolve(e,t){throw new ct(X.MISSING_LOCKFILE_ENTRY,`This package doesn't seem to be present in your lockfile; run "yarn install" to update the lockfile`)}};var di=class extends Ji{reportCacheHit(e){}reportCacheMiss(e){}startSectionSync(e,t){return t()}async startSectionPromise(e,t){return await t()}startTimerSync(e,t,i){return(typeof t=="function"?t:i)()}async startTimerPromise(e,t,i){return await(typeof t=="function"?t:i)()}async startCacheReport(e){return await e()}reportSeparator(){}reportInfo(e,t){}reportWarning(e,t){}reportError(e,t){}reportProgress(e){let t=Promise.resolve().then(async()=>{for await(let{}of e);}),i=()=>{};return te(N({},t),{stop:i})}reportJson(e){}async finalize(){}};var iZ=ge(Wx());var CC=class{constructor(e,{project:t}){this.workspacesCwds=new Set;this.dependencies=new Map;this.project=t,this.cwd=e}async setup(){var s;this.manifest=(s=await At.tryFind(this.cwd))!=null?s:new At,this.relativeCwd=k.relative(this.project.cwd,this.cwd)||Me.dot;let e=this.manifest.name?this.manifest.name:$o(null,`${this.computeCandidateName()}-${ln(this.relativeCwd).substring(0,6)}`),t=this.manifest.version?this.manifest.version:"0.0.0";this.locator=cn(e,t),this.anchoredDescriptor=rr(this.locator,`${oi.protocol}${this.relativeCwd}`),this.anchoredLocator=cn(this.locator,`${oi.protocol}${this.relativeCwd}`);let i=this.manifest.workspaceDefinitions.map(({pattern:o})=>o),n=await(0,iZ.default)(i,{cwd:H.fromPortablePath(this.cwd),expandDirectories:!1,onlyDirectories:!0,onlyFiles:!1,ignore:["**/node_modules","**/.git","**/.yarn"]});n.sort();for(let o of n){let a=k.resolve(this.cwd,H.toPortablePath(o));K.existsSync(k.join(a,"package.json"))&&this.workspacesCwds.add(a)}}accepts(e){var o;let t=e.indexOf(":"),i=t!==-1?e.slice(0,t+1):null,n=t!==-1?e.slice(t+1):e;if(i===oi.protocol&&k.normalize(n)===this.relativeCwd||i===oi.protocol&&(n==="*"||n==="^"||n==="~"))return!0;let s=po(n);return s?i===oi.protocol?s.test((o=this.manifest.version)!=null?o:"0.0.0"):this.project.configuration.get("enableTransparentWorkspaces")&&this.manifest.version!==null?s.test(this.manifest.version):!1:!1}computeCandidateName(){return this.cwd===this.project.cwd?"root-workspace":`${k.basename(this.cwd)}`||"unnamed-workspace"}getRecursiveWorkspaceDependencies({dependencies:e=At.hardDependencies}={}){let t=new Set,i=n=>{for(let s of e)for(let o of n.manifest[s].values()){let a=this.project.tryWorkspaceByDescriptor(o);a===null||t.has(a)||(t.add(a),i(a))}};return i(this),t}getRecursiveWorkspaceDependents({dependencies:e=At.hardDependencies}={}){let t=new Set,i=n=>{for(let s of this.project.workspaces)e.some(a=>[...s.manifest[a].values()].some(l=>{let c=this.project.tryWorkspaceByDescriptor(l);return c!==null&&hd(c.anchoredLocator,n.anchoredLocator)}))&&!t.has(s)&&(t.add(s),i(s))};return i(this),t}getRecursiveWorkspaceChildren(){let e=[];for(let t of this.workspacesCwds){let i=this.project.workspacesByCwd.get(t);i&&e.push(i,...i.getRecursiveWorkspaceChildren())}return e}async persistManifest(){let e={};this.manifest.exportTo(e);let t=k.join(this.cwd,At.fileName),i=`${JSON.stringify(e,null,this.manifest.indent)} -`;await K.changeFilePromise(t,i,{automaticNewlines:!0}),this.manifest.raw=e}};var oZ=6,WOe=1,zOe=/ *, */g,aZ=/\/$/,_Oe=32,VOe=(0,OR.promisify)(KR.default.gzip),XOe=(0,OR.promisify)(KR.default.gunzip),Ci;(function(t){t.UpdateLockfile="update-lockfile",t.SkipBuild="skip-build"})(Ci||(Ci={}));var UR={restoreInstallersCustomData:["installersCustomData"],restoreResolutions:["accessibleLocators","conditionalLocators","disabledLocators","optionalBuilds","storedDescriptors","storedResolutions","storedPackages","lockFileChecksum"],restoreBuildState:["storedBuildState"]},AZ=r=>ln(`${WOe}`,r),ze=class{constructor(e,{configuration:t}){this.resolutionAliases=new Map;this.workspaces=[];this.workspacesByCwd=new Map;this.workspacesByIdent=new Map;this.storedResolutions=new Map;this.storedDescriptors=new Map;this.storedPackages=new Map;this.storedChecksums=new Map;this.storedBuildState=new Map;this.accessibleLocators=new Set;this.conditionalLocators=new Set;this.disabledLocators=new Set;this.originalPackages=new Map;this.optionalBuilds=new Set;this.lockfileNeedsRefresh=!1;this.peerRequirements=new Map;this.installersCustomData=new Map;this.lockFileChecksum=null;this.installStateChecksum=null;this.configuration=t,this.cwd=e}static async find(e,t){var p,m,y;if(!e.projectCwd)throw new Pe(`No project found in ${t}`);let i=e.projectCwd,n=t,s=null;for(;s!==e.projectCwd;){if(s=n,K.existsSync(k.join(s,kt.manifest))){i=s;break}n=k.dirname(s)}let o=new ze(e.projectCwd,{configuration:e});(p=ye.telemetry)==null||p.reportProject(o.cwd),await o.setupResolutions(),await o.setupWorkspaces(),(m=ye.telemetry)==null||m.reportWorkspaceCount(o.workspaces.length),(y=ye.telemetry)==null||y.reportDependencyCount(o.workspaces.reduce((b,v)=>b+v.manifest.dependencies.size+v.manifest.devDependencies.size,0));let a=o.tryWorkspaceByCwd(i);if(a)return{project:o,workspace:a,locator:a.anchoredLocator};let l=await o.findLocatorForLocation(`${i}/`,{strict:!0});if(l)return{project:o,locator:l,workspace:null};let c=tt(e,o.cwd,qe.PATH),u=tt(e,k.relative(o.cwd,i),qe.PATH),g=`- If ${c} isn't intended to be a project, remove any yarn.lock and/or package.json file there.`,f=`- If ${c} is intended to be a project, it might be that you forgot to list ${u} in its workspace configuration.`,h=`- Finally, if ${c} is fine and you intend ${u} to be treated as a completely separate project (not even a workspace), create an empty yarn.lock file in it.`;throw new Pe(`The nearest package directory (${tt(e,i,qe.PATH)}) doesn't seem to be part of the project declared in ${tt(e,o.cwd,qe.PATH)}. - -${[g,f,h].join(` -`)}`)}async setupResolutions(){var i;this.storedResolutions=new Map,this.storedDescriptors=new Map,this.storedPackages=new Map,this.lockFileChecksum=null;let e=k.join(this.cwd,this.configuration.get("lockfileFilename")),t=this.configuration.get("defaultLanguageName");if(K.existsSync(e)){let n=await K.readFilePromise(e,"utf8");this.lockFileChecksum=AZ(n);let s=Si(n);if(s.__metadata){let o=s.__metadata.version,a=s.__metadata.cacheKey;this.lockfileNeedsRefresh=o0;){let t=e;e=[];for(let i of t){if(this.workspacesByCwd.has(i))continue;let n=await this.addWorkspace(i),s=this.storedPackages.get(n.anchoredLocator.locatorHash);s&&(n.dependencies=s.dependencies);for(let o of n.workspacesCwds)e.push(o)}}}async addWorkspace(e){let t=new CC(e,{project:this});await t.setup();let i=this.workspacesByIdent.get(t.locator.identHash);if(typeof i!="undefined")throw new Error(`Duplicate workspace name ${fi(this.configuration,t.locator)}: ${H.fromPortablePath(e)} conflicts with ${H.fromPortablePath(i.cwd)}`);return this.workspaces.push(t),this.workspacesByCwd.set(e,t),this.workspacesByIdent.set(t.locator.identHash,t),t}get topLevelWorkspace(){return this.getWorkspaceByCwd(this.cwd)}tryWorkspaceByCwd(e){k.isAbsolute(e)||(e=k.resolve(this.cwd,e)),e=k.normalize(e).replace(/\/+$/,"");let t=this.workspacesByCwd.get(e);return t||null}getWorkspaceByCwd(e){let t=this.tryWorkspaceByCwd(e);if(!t)throw new Error(`Workspace not found (${e})`);return t}tryWorkspaceByFilePath(e){let t=null;for(let i of this.workspaces)k.relative(i.cwd,e).startsWith("../")||t&&t.cwd.length>=i.cwd.length||(t=i);return t||null}getWorkspaceByFilePath(e){let t=this.tryWorkspaceByFilePath(e);if(!t)throw new Error(`Workspace not found (${e})`);return t}tryWorkspaceByIdent(e){let t=this.workspacesByIdent.get(e.identHash);return typeof t=="undefined"?null:t}getWorkspaceByIdent(e){let t=this.tryWorkspaceByIdent(e);if(!t)throw new Error(`Workspace not found (${fi(this.configuration,e)})`);return t}tryWorkspaceByDescriptor(e){let t=this.tryWorkspaceByIdent(e);return t===null||(Al(e)&&(e=ud(e)),!t.accepts(e.range))?null:t}getWorkspaceByDescriptor(e){let t=this.tryWorkspaceByDescriptor(e);if(t===null)throw new Error(`Workspace not found (${sr(this.configuration,e)})`);return t}tryWorkspaceByLocator(e){let t=this.tryWorkspaceByIdent(e);return t===null||(ea(e)&&(e=gd(e)),t.locator.locatorHash!==e.locatorHash&&t.anchoredLocator.locatorHash!==e.locatorHash)?null:t}getWorkspaceByLocator(e){let t=this.tryWorkspaceByLocator(e);if(!t)throw new Error(`Workspace not found (${It(this.configuration,e)})`);return t}refreshWorkspaceDependencies(){for(let e of this.workspaces){let t=this.storedPackages.get(e.anchoredLocator.locatorHash);if(!t)throw new Error(`Assertion failed: Expected workspace ${Cd(this.configuration,e)} (${tt(this.configuration,k.join(e.cwd,kt.manifest),qe.PATH)}) to have been resolved. Run "yarn install" to update the lockfile`);e.dependencies=new Map(t.dependencies)}}forgetResolution(e){let t=n=>{this.storedResolutions.delete(n),this.storedDescriptors.delete(n)},i=n=>{this.originalPackages.delete(n),this.storedPackages.delete(n),this.accessibleLocators.delete(n)};if("descriptorHash"in e){let n=this.storedResolutions.get(e.descriptorHash);t(e.descriptorHash);let s=new Set(this.storedResolutions.values());typeof n!="undefined"&&!s.has(n)&&i(n)}if("locatorHash"in e){i(e.locatorHash);for(let[n,s]of this.storedResolutions)s===e.locatorHash&&t(n)}}forgetTransientResolutions(){let e=this.configuration.makeResolver();for(let t of this.originalPackages.values()){let i;try{i=e.shouldPersistResolution(t,{project:this,resolver:e})}catch{i=!1}i||this.forgetResolution(t)}}forgetVirtualResolutions(){for(let e of this.storedPackages.values())for(let[t,i]of e.dependencies)Al(i)&&e.dependencies.set(t,ud(i))}getDependencyMeta(e,t){let i={},s=this.topLevelWorkspace.manifest.dependenciesMeta.get(Ot(e));if(!s)return i;let o=s.get(null);if(o&&Object.assign(i,o),t===null||!sZ.default.valid(t))return i;for(let[a,l]of s)a!==null&&a===t&&Object.assign(i,l);return i}async findLocatorForLocation(e,{strict:t=!1}={}){let i=new di,n=this.configuration.getLinkers(),s={project:this,report:i};for(let o of n){let a=await o.findPackageLocator(e,s);if(a){if(t&&(await o.findPackageLocation(a,s)).replace(aZ,"")!==e.replace(aZ,""))continue;return a}}return null}async resolveEverything(e){if(!this.workspacesByCwd||!this.workspacesByIdent)throw new Error("Workspaces must have been setup before calling this function");this.forgetVirtualResolutions(),e.lockfileOnly||this.forgetTransientResolutions();let t=e.resolver||this.configuration.makeResolver(),i=new NR(t);await i.setup(this,{report:e.report});let n=e.lockfileOnly?[new TR(t)]:[i,t],s=new wd([new LR(t),...n]),o=this.configuration.makeFetcher(),a=e.lockfileOnly?{project:this,report:e.report,resolver:s}:{project:this,report:e.report,resolver:s,fetchOptions:{project:this,cache:e.cache,checksums:this.storedChecksums,report:e.report,fetcher:o,cacheOptions:{mirrorWriteOnly:!0}}},l=new Map,c=new Map,u=new Map,g=new Map,f=new Map,h=new Map,p=this.topLevelWorkspace.anchoredLocator,m=new Set,y=[],b=ck(),v=this.configuration.getSupportedArchitectures();await e.report.startProgressPromise(Ji.progressViaTitle(),async ne=>{let ee=async O=>{let L=await Lg(async()=>await s.resolve(O,a),je=>`${It(this.configuration,O)}: ${je}`);if(!hd(O,L))throw new Error(`Assertion failed: The locator cannot be changed by the resolver (went from ${It(this.configuration,O)} to ${It(this.configuration,L)})`);g.set(L.locatorHash,L);let de=this.configuration.normalizePackage(L);for(let[je,re]of de.dependencies){let se=await this.configuration.reduceHook(he=>he.reduceDependency,re,this,de,re,{resolver:s,resolveOptions:a});if(!fd(re,se))throw new Error("Assertion failed: The descriptor ident cannot be changed through aliases");let be=s.bindDescriptor(se,O,a);de.dependencies.set(je,be)}let Be=go([...de.dependencies.values()].map(je=>Z(je)));return y.push(Be),Be.catch(()=>{}),c.set(de.locatorHash,de),de},A=async O=>{let L=f.get(O.locatorHash);if(typeof L!="undefined")return L;let de=Promise.resolve().then(()=>ee(O));return f.set(O.locatorHash,de),de},oe=async(O,L)=>{let de=await Z(L);return l.set(O.descriptorHash,O),u.set(O.descriptorHash,de.locatorHash),de},ce=async O=>{ne.setTitle(sr(this.configuration,O));let L=this.resolutionAliases.get(O.descriptorHash);if(typeof L!="undefined")return oe(O,this.storedDescriptors.get(L));let de=s.getResolutionDependencies(O,a),Be=new Map(await go(de.map(async se=>{let be=s.bindDescriptor(se,p,a),he=await Z(be);return m.add(he.locatorHash),[se.descriptorHash,he]}))),re=(await Lg(async()=>await s.getCandidates(O,Be,a),se=>`${sr(this.configuration,O)}: ${se}`))[0];if(typeof re=="undefined")throw new Error(`${sr(this.configuration,O)}: No candidates found`);return l.set(O.descriptorHash,O),u.set(O.descriptorHash,re.locatorHash),A(re)},Z=O=>{let L=h.get(O.descriptorHash);if(typeof L!="undefined")return L;l.set(O.descriptorHash,O);let de=Promise.resolve().then(()=>ce(O));return h.set(O.descriptorHash,de),de};for(let O of this.workspaces){let L=O.anchoredDescriptor;y.push(Z(L))}for(;y.length>0;){let O=[...y];y.length=0,await go(O)}});let x=new Set(this.resolutionAliases.values()),T=new Set(c.keys()),q=new Set,Y=new Map;ZOe({project:this,report:e.report,accessibleLocators:q,volatileDescriptors:x,optionalBuilds:T,peerRequirements:Y,allDescriptors:l,allResolutions:u,allPackages:c});for(let ne of m)T.delete(ne);for(let ne of x)l.delete(ne),u.delete(ne);let $=new Set,_=new Set;for(let ne of c.values())ne.conditions!=null&&(!T.has(ne.locatorHash)||(gw(ne,v)||(gw(ne,b)&&e.report.reportWarningOnce(X.GHOST_ARCHITECTURE,`${It(this.configuration,ne)}: Your current architecture (${process.platform}-${process.arch}) is supported by this package, but is missing from the ${tt(this.configuration,"supportedArchitectures",Ri.SETTING)} setting`),_.add(ne.locatorHash)),$.add(ne.locatorHash)));this.storedResolutions=u,this.storedDescriptors=l,this.storedPackages=c,this.accessibleLocators=q,this.conditionalLocators=$,this.disabledLocators=_,this.originalPackages=g,this.optionalBuilds=T,this.peerRequirements=Y,this.refreshWorkspaceDependencies()}async fetchEverything({cache:e,report:t,fetcher:i,mode:n}){let s={mockedPackages:this.disabledLocators,unstablePackages:this.conditionalLocators},o=i||this.configuration.makeFetcher(),a={checksums:this.storedChecksums,project:this,cache:e,fetcher:o,report:t,cacheOptions:s},l=Array.from(new Set(kn(this.storedResolutions.values(),[f=>{let h=this.storedPackages.get(f);if(!h)throw new Error("Assertion failed: The locator should have been registered");return Rs(h)}])));n===Ci.UpdateLockfile&&(l=l.filter(f=>!this.storedChecksums.has(f)));let c=!1,u=Ji.progressViaCounter(l.length);t.reportProgress(u);let g=(0,nZ.default)(_Oe);if(await t.startCacheReport(async()=>{await go(l.map(f=>g(async()=>{let h=this.storedPackages.get(f);if(!h)throw new Error("Assertion failed: The locator should have been registered");if(ea(h))return;let p;try{p=await o.fetch(h,a)}catch(m){m.message=`${It(this.configuration,h)}: ${m.message}`,t.reportExceptionOnce(m),c=m;return}p.checksum!=null?this.storedChecksums.set(h.locatorHash,p.checksum):this.storedChecksums.delete(h.locatorHash),p.releaseFs&&p.releaseFs()}).finally(()=>{u.tick()})))}),c)throw c}async linkEverything({cache:e,report:t,fetcher:i,mode:n}){var A,oe,ce;let s={mockedPackages:this.disabledLocators,unstablePackages:this.conditionalLocators,skipIntegrityCheck:!0},o=i||this.configuration.makeFetcher(),a={checksums:this.storedChecksums,project:this,cache:e,fetcher:o,report:t,skipIntegrityCheck:!0,cacheOptions:s},l=this.configuration.getLinkers(),c={project:this,report:t},u=new Map(l.map(Z=>{let O=Z.makeInstaller(c),L=O.getCustomDataKey(),de=this.installersCustomData.get(L);return typeof de!="undefined"&&O.attachCustomData(de),[Z,O]})),g=new Map,f=new Map,h=new Map,p=new Map(await go([...this.accessibleLocators].map(async Z=>{let O=this.storedPackages.get(Z);if(!O)throw new Error("Assertion failed: The locator should have been registered");return[Z,await o.fetch(O,a)]}))),m=[];for(let Z of this.accessibleLocators){let O=this.storedPackages.get(Z);if(typeof O=="undefined")throw new Error("Assertion failed: The locator should have been registered");let L=p.get(O.locatorHash);if(typeof L=="undefined")throw new Error("Assertion failed: The fetch result should have been registered");let de=[],Be=re=>{de.push(re)},je=this.tryWorkspaceByLocator(O);if(je!==null){let re=[],{scripts:se}=je.manifest;for(let he of["preinstall","install","postinstall"])se.has(he)&&re.push([cs.SCRIPT,he]);try{for(let[he,Fe]of u)if(he.supportsPackage(O,c)&&(await Fe.installPackage(O,L,{holdFetchResult:Be})).buildDirective!==null)throw new Error("Assertion failed: Linkers can't return build directives for workspaces; this responsibility befalls to the Yarn core")}finally{de.length===0?(A=L.releaseFs)==null||A.call(L):m.push(go(de).catch(()=>{}).then(()=>{var he;(he=L.releaseFs)==null||he.call(L)}))}let be=k.join(L.packageFs.getRealPath(),L.prefixPath);f.set(O.locatorHash,be),!ea(O)&&re.length>0&&h.set(O.locatorHash,{directives:re,buildLocations:[be]})}else{let re=l.find(he=>he.supportsPackage(O,c));if(!re)throw new ct(X.LINKER_NOT_FOUND,`${It(this.configuration,O)} isn't supported by any available linker`);let se=u.get(re);if(!se)throw new Error("Assertion failed: The installer should have been registered");let be;try{be=await se.installPackage(O,L,{holdFetchResult:Be})}finally{de.length===0?(oe=L.releaseFs)==null||oe.call(L):m.push(go(de).then(()=>{}).then(()=>{var he;(he=L.releaseFs)==null||he.call(L)}))}g.set(O.locatorHash,re),f.set(O.locatorHash,be.packageLocation),be.buildDirective&&be.buildDirective.length>0&&be.packageLocation&&h.set(O.locatorHash,{directives:be.buildDirective,buildLocations:[be.packageLocation]})}}let y=new Map;for(let Z of this.accessibleLocators){let O=this.storedPackages.get(Z);if(!O)throw new Error("Assertion failed: The locator should have been registered");let L=this.tryWorkspaceByLocator(O)!==null,de=async(Be,je)=>{let re=f.get(O.locatorHash);if(typeof re=="undefined")throw new Error(`Assertion failed: The package (${It(this.configuration,O)}) should have been registered`);let se=[];for(let be of O.dependencies.values()){let he=this.storedResolutions.get(be.descriptorHash);if(typeof he=="undefined")throw new Error(`Assertion failed: The resolution (${sr(this.configuration,be)}, from ${It(this.configuration,O)})should have been registered`);let Fe=this.storedPackages.get(he);if(typeof Fe=="undefined")throw new Error(`Assertion failed: The package (${he}, resolved from ${sr(this.configuration,be)}) should have been registered`);let Ke=this.tryWorkspaceByLocator(Fe)===null?g.get(he):null;if(typeof Ke=="undefined")throw new Error(`Assertion failed: The package (${he}, resolved from ${sr(this.configuration,be)}) should have been registered`);Ke===Be||Ke===null?f.get(Fe.locatorHash)!==null&&se.push([be,Fe]):!L&&re!==null&&Fg(y,he).push(re)}re!==null&&await je.attachInternalDependencies(O,se)};if(L)for(let[Be,je]of u)Be.supportsPackage(O,c)&&await de(Be,je);else{let Be=g.get(O.locatorHash);if(!Be)throw new Error("Assertion failed: The linker should have been found");let je=u.get(Be);if(!je)throw new Error("Assertion failed: The installer should have been registered");await de(Be,je)}}for(let[Z,O]of y){let L=this.storedPackages.get(Z);if(!L)throw new Error("Assertion failed: The package should have been registered");let de=g.get(L.locatorHash);if(!de)throw new Error("Assertion failed: The linker should have been found");let Be=u.get(de);if(!Be)throw new Error("Assertion failed: The installer should have been registered");await Be.attachExternalDependents(L,O)}let b=new Map;for(let Z of u.values()){let O=await Z.finalizeInstall();for(let L of(ce=O==null?void 0:O.records)!=null?ce:[])h.set(L.locatorHash,{directives:L.buildDirective,buildLocations:L.buildLocations});typeof(O==null?void 0:O.customData)!="undefined"&&b.set(Z.getCustomDataKey(),O.customData)}if(this.installersCustomData=b,await go(m),n===Ci.SkipBuild)return;let v=new Set(this.storedPackages.keys()),x=new Set(h.keys());for(let Z of x)v.delete(Z);let T=(0,i0.createHash)("sha512");T.update(process.versions.node),await this.configuration.triggerHook(Z=>Z.globalHashGeneration,this,Z=>{T.update("\0"),T.update(Z)});let q=T.digest("hex"),Y=new Map,$=Z=>{let O=Y.get(Z.locatorHash);if(typeof O!="undefined")return O;let L=this.storedPackages.get(Z.locatorHash);if(typeof L=="undefined")throw new Error("Assertion failed: The package should have been registered");let de=(0,i0.createHash)("sha512");de.update(Z.locatorHash),Y.set(Z.locatorHash,"");for(let Be of L.dependencies.values()){let je=this.storedResolutions.get(Be.descriptorHash);if(typeof je=="undefined")throw new Error(`Assertion failed: The resolution (${sr(this.configuration,Be)}) should have been registered`);let re=this.storedPackages.get(je);if(typeof re=="undefined")throw new Error("Assertion failed: The package should have been registered");de.update($(re))}return O=de.digest("hex"),Y.set(Z.locatorHash,O),O},_=(Z,O)=>{let L=(0,i0.createHash)("sha512");L.update(q),L.update($(Z));for(let de of O)L.update(de);return L.digest("hex")},ne=new Map,ee=!1;for(;x.size>0;){let Z=x.size,O=[];for(let L of x){let de=this.storedPackages.get(L);if(!de)throw new Error("Assertion failed: The package should have been registered");let Be=!0;for(let se of de.dependencies.values()){let be=this.storedResolutions.get(se.descriptorHash);if(!be)throw new Error(`Assertion failed: The resolution (${sr(this.configuration,se)}) should have been registered`);if(x.has(be)){Be=!1;break}}if(!Be)continue;x.delete(L);let je=h.get(de.locatorHash);if(!je)throw new Error("Assertion failed: The build directive should have been registered");let re=_(de,je.buildLocations);if(this.storedBuildState.get(de.locatorHash)===re){ne.set(de.locatorHash,re);continue}ee||(await this.persistInstallStateFile(),ee=!0),this.storedBuildState.has(de.locatorHash)?t.reportInfo(X.MUST_REBUILD,`${It(this.configuration,de)} must be rebuilt because its dependency tree changed`):t.reportInfo(X.MUST_BUILD,`${It(this.configuration,de)} must be built because it never has been before or the last one failed`);for(let se of je.buildLocations){if(!k.isAbsolute(se))throw new Error(`Assertion failed: Expected the build location to be absolute (not ${se})`);O.push((async()=>{for(let[be,he]of je.directives){let Fe=`# This file contains the result of Yarn building a package (${Rs(de)}) -`;switch(be){case cs.SCRIPT:Fe+=`# Script name: ${he} -`;break;case cs.SHELLCODE:Fe+=`# Script code: ${he} -`;break}let Ke=null;if(!await K.mktempPromise(async ve=>{let pe=k.join(ve,"build.log"),{stdout:V,stderr:Qe}=this.configuration.getSubprocessStreams(pe,{header:Fe,prefix:It(this.configuration,de),report:t}),le;try{switch(be){case cs.SCRIPT:le=await nB(de,he,[],{cwd:se,project:this,stdin:Ke,stdout:V,stderr:Qe});break;case cs.SHELLCODE:le=await rD(de,he,[],{cwd:se,project:this,stdin:Ke,stdout:V,stderr:Qe});break}}catch(gt){Qe.write(gt.stack),le=1}if(V.end(),Qe.end(),le===0)return ne.set(de.locatorHash,re),!0;K.detachTemp(ve);let fe=`${It(this.configuration,de)} couldn't be built successfully (exit code ${tt(this.configuration,le,qe.NUMBER)}, logs can be found here: ${tt(this.configuration,pe,qe.PATH)})`;return this.optionalBuilds.has(de.locatorHash)?(t.reportInfo(X.BUILD_FAILED,fe),ne.set(de.locatorHash,re),!0):(t.reportError(X.BUILD_FAILED,fe),!1)}))return}})())}}if(await go(O),Z===x.size){let L=Array.from(x).map(de=>{let Be=this.storedPackages.get(de);if(!Be)throw new Error("Assertion failed: The package should have been registered");return It(this.configuration,Be)}).join(", ");t.reportError(X.CYCLIC_DEPENDENCIES,`Some packages have circular dependencies that make their build order unsatisfiable - as a result they won't be built (affected packages are: ${L})`);break}}this.storedBuildState=ne}async install(e){var a,l;let t=this.configuration.get("nodeLinker");(a=ye.telemetry)==null||a.reportInstall(t),await e.report.startTimerPromise("Project validation",{skipIfEmpty:!0},async()=>{await this.configuration.triggerHook(c=>c.validateProject,this,{reportWarning:e.report.reportWarning.bind(e.report),reportError:e.report.reportError.bind(e.report)})});for(let c of this.configuration.packageExtensions.values())for(let[,u]of c)for(let g of u)g.status=qi.Inactive;let i=k.join(this.cwd,this.configuration.get("lockfileFilename")),n=null;if(e.immutable)try{n=await K.readFilePromise(i,"utf8")}catch(c){throw c.code==="ENOENT"?new ct(X.FROZEN_LOCKFILE_EXCEPTION,"The lockfile would have been created by this install, which is explicitly forbidden."):c}await e.report.startTimerPromise("Resolution step",async()=>{await this.resolveEverything(e)}),await e.report.startTimerPromise("Post-resolution validation",{skipIfEmpty:!0},async()=>{for(let[,c]of this.configuration.packageExtensions)for(let[,u]of c)for(let g of u)if(g.userProvided){let f=tt(this.configuration,g,qe.PACKAGE_EXTENSION);switch(g.status){case qi.Inactive:e.report.reportWarning(X.UNUSED_PACKAGE_EXTENSION,`${f}: No matching package in the dependency tree; you may not need this rule anymore.`);break;case qi.Redundant:e.report.reportWarning(X.REDUNDANT_PACKAGE_EXTENSION,`${f}: This rule seems redundant when applied on the original package; the extension may have been applied upstream.`);break}}if(n!==null){let c=sc(n,this.generateLockfile());if(c!==n){let u=V6(i,i,n,c,void 0,void 0,{maxEditLength:100});if(u){e.report.reportSeparator();for(let g of u.hunks){e.report.reportInfo(null,`@@ -${g.oldStart},${g.oldLines} +${g.newStart},${g.newLines} @@`);for(let f of g.lines)f.startsWith("+")?e.report.reportError(X.FROZEN_LOCKFILE_EXCEPTION,tt(this.configuration,f,qe.ADDED)):f.startsWith("-")?e.report.reportError(X.FROZEN_LOCKFILE_EXCEPTION,tt(this.configuration,f,qe.REMOVED)):e.report.reportInfo(null,tt(this.configuration,f,"grey"))}e.report.reportSeparator()}throw new ct(X.FROZEN_LOCKFILE_EXCEPTION,"The lockfile would have been modified by this install, which is explicitly forbidden.")}}});for(let c of this.configuration.packageExtensions.values())for(let[,u]of c)for(let g of u)g.userProvided&&g.status===qi.Active&&((l=ye.telemetry)==null||l.reportPackageExtension(Oc(g,qe.PACKAGE_EXTENSION)));await e.report.startTimerPromise("Fetch step",async()=>{await this.fetchEverything(e),(typeof e.persistProject=="undefined"||e.persistProject)&&e.mode!==Ci.UpdateLockfile&&await this.cacheCleanup(e)});let s=e.immutable?[...new Set(this.configuration.get("immutablePatterns"))].sort():[],o=await Promise.all(s.map(async c=>ow(c,{cwd:this.cwd})));(typeof e.persistProject=="undefined"||e.persistProject)&&await this.persist(),await e.report.startTimerPromise("Link step",async()=>{if(e.mode===Ci.UpdateLockfile){e.report.reportWarning(X.UPDATE_LOCKFILE_ONLY_SKIP_LINK,`Skipped due to ${tt(this.configuration,"mode=update-lockfile",qe.CODE)}`);return}await this.linkEverything(e);let c=await Promise.all(s.map(async u=>ow(u,{cwd:this.cwd})));for(let u=0;uc.afterAllInstalled,this,e)}generateLockfile(){let e=new Map;for(let[n,s]of this.storedResolutions.entries()){let o=e.get(s);o||e.set(s,o=new Set),o.add(n)}let t={};t.__metadata={version:oZ,cacheKey:void 0};for(let[n,s]of e.entries()){let o=this.originalPackages.get(n);if(!o)continue;let a=[];for(let f of s){let h=this.storedDescriptors.get(f);if(!h)throw new Error("Assertion failed: The descriptor should have been registered");a.push(h)}let l=a.map(f=>Pn(f)).sort().join(", "),c=new At;c.version=o.linkType===Qt.HARD?o.version:"0.0.0-use.local",c.languageName=o.languageName,c.dependencies=new Map(o.dependencies),c.peerDependencies=new Map(o.peerDependencies),c.dependenciesMeta=new Map(o.dependenciesMeta),c.peerDependenciesMeta=new Map(o.peerDependenciesMeta),c.bin=new Map(o.bin);let u,g=this.storedChecksums.get(o.locatorHash);if(typeof g!="undefined"){let f=g.indexOf("/");if(f===-1)throw new Error("Assertion failed: Expected the checksum to reference its cache key");let h=g.slice(0,f),p=g.slice(f+1);typeof t.__metadata.cacheKey=="undefined"&&(t.__metadata.cacheKey=h),h===t.__metadata.cacheKey?u=p:u=g}t[l]=te(N({},c.exportTo({},{compatibilityMode:!1})),{linkType:o.linkType.toLowerCase(),resolution:Rs(o),checksum:u,conditions:o.conditions||void 0})}return`${[`# This file is generated by running "yarn install" inside your project. -`,`# Manual changes might be lost - proceed with caution! -`].join("")} -`+Ma(t)}async persistLockfile(){let e=k.join(this.cwd,this.configuration.get("lockfileFilename")),t="";try{t=await K.readFilePromise(e,"utf8")}catch(s){}let i=this.generateLockfile(),n=sc(t,i);n!==t&&(await K.writeFilePromise(e,n),this.lockFileChecksum=AZ(n),this.lockfileNeedsRefresh=!1)}async persistInstallStateFile(){let e=[];for(let o of Object.values(UR))e.push(...o);let t=(0,n0.default)(this,e),i=MR.default.serialize(t),n=ln(i);if(this.installStateChecksum===n)return;let s=this.configuration.get("installStatePath");await K.mkdirPromise(k.dirname(s),{recursive:!0}),await K.writeFilePromise(s,await VOe(i)),this.installStateChecksum=n}async restoreInstallState({restoreInstallersCustomData:e=!0,restoreResolutions:t=!0,restoreBuildState:i=!0}={}){let n=this.configuration.get("installStatePath"),s;try{let o=await XOe(await K.readFilePromise(n));s=MR.default.deserialize(o),this.installStateChecksum=ln(o)}catch{t&&await this.applyLightResolution();return}e&&typeof s.installersCustomData!="undefined"&&(this.installersCustomData=s.installersCustomData),i&&Object.assign(this,(0,n0.default)(s,UR.restoreBuildState)),t&&(s.lockFileChecksum===this.lockFileChecksum?(Object.assign(this,(0,n0.default)(s,UR.restoreResolutions)),this.refreshWorkspaceDependencies()):await this.applyLightResolution())}async applyLightResolution(){await this.resolveEverything({lockfileOnly:!0,report:new di}),await this.persistInstallStateFile()}async persist(){await this.persistLockfile();for(let e of this.workspacesByCwd.values())await e.persistManifest()}async cacheCleanup({cache:e,report:t}){if(this.configuration.get("enableGlobalCache"))return;let i=new Set([".gitignore"]);if(!Ak(e.cwd,this.cwd)||!await K.existsPromise(e.cwd))return;let n=this.configuration.get("preferAggregateCacheInfo"),s=0,o=null;for(let a of await K.readdirPromise(e.cwd)){if(i.has(a))continue;let l=k.resolve(e.cwd,a);e.markedFiles.has(l)||(o=a,e.immutable?t.reportError(X.IMMUTABLE_CACHE,`${tt(this.configuration,k.basename(l),"magenta")} appears to be unused and would be marked for deletion, but the cache is immutable`):(n?s+=1:t.reportInfo(X.UNUSED_CACHE_ENTRY,`${tt(this.configuration,k.basename(l),"magenta")} appears to be unused - removing`),await K.removePromise(l)))}n&&s!==0&&t.reportInfo(X.UNUSED_CACHE_ENTRY,s>1?`${s} packages appeared to be unused and were removed`:`${o} appeared to be unused and was removed`),e.markedFiles.clear()}};function ZOe({project:r,allDescriptors:e,allResolutions:t,allPackages:i,accessibleLocators:n=new Set,optionalBuilds:s=new Set,peerRequirements:o=new Map,volatileDescriptors:a=new Set,report:l,tolerateMissingPackages:c=!1}){var ne;let u=new Map,g=[],f=new Map,h=new Map,p=new Map,m=new Map,y=new Map,b=new Map(r.workspaces.map(ee=>{let A=ee.anchoredLocator.locatorHash,oe=i.get(A);if(typeof oe=="undefined"){if(c)return[A,null];throw new Error("Assertion failed: The workspace should have an associated package")}return[A,cd(oe)]})),v=()=>{let ee=K.mktempSync(),A=k.join(ee,"stacktrace.log"),oe=String(g.length+1).length,ce=g.map((Z,O)=>`${`${O+1}.`.padStart(oe," ")} ${Rs(Z)} -`).join("");throw K.writeFileSync(A,ce),K.detachTemp(ee),new ct(X.STACK_OVERFLOW_RESOLUTION,`Encountered a stack overflow when resolving peer dependencies; cf ${H.fromPortablePath(A)}`)},x=ee=>{let A=t.get(ee.descriptorHash);if(typeof A=="undefined")throw new Error("Assertion failed: The resolution should have been registered");let oe=i.get(A);if(!oe)throw new Error("Assertion failed: The package could not be found");return oe},T=(ee,A,oe,{top:ce,optional:Z})=>{g.length>1e3&&v(),g.push(A);let O=q(ee,A,oe,{top:ce,optional:Z});return g.pop(),O},q=(ee,A,oe,{top:ce,optional:Z})=>{if(n.has(A.locatorHash))return;n.add(A.locatorHash),Z||s.delete(A.locatorHash);let O=i.get(A.locatorHash);if(!O){if(c)return;throw new Error(`Assertion failed: The package (${It(r.configuration,A)}) should have been registered`)}let L=[],de=[],Be=[],je=[],re=[];for(let be of Array.from(O.dependencies.values())){if(O.peerDependencies.has(be.identHash)&&O.locatorHash!==ce)continue;if(Al(be))throw new Error("Assertion failed: Virtual packages shouldn't be encountered when virtualizing a branch");a.delete(be.descriptorHash);let he=Z;if(!he){let Qe=O.dependenciesMeta.get(Ot(be));if(typeof Qe!="undefined"){let le=Qe.get(null);typeof le!="undefined"&&le.optional&&(he=!0)}}let Fe=t.get(be.descriptorHash);if(!Fe){if(c)continue;throw new Error(`Assertion failed: The resolution (${sr(r.configuration,be)}) should have been registered`)}let Ke=b.get(Fe)||i.get(Fe);if(!Ke)throw new Error(`Assertion failed: The package (${Fe}, resolved from ${sr(r.configuration,be)}) should have been registered`);if(Ke.peerDependencies.size===0){T(be,Ke,new Map,{top:ce,optional:he});continue}let ke,ve,pe=new Set,V;de.push(()=>{ke=Vx(be,A.locatorHash),ve=Xx(Ke,A.locatorHash),O.dependencies.delete(be.identHash),O.dependencies.set(ke.identHash,ke),t.set(ke.descriptorHash,ve.locatorHash),e.set(ke.descriptorHash,ke),i.set(ve.locatorHash,ve),L.push([Ke,ke,ve])}),Be.push(()=>{var Qe;V=new Map;for(let le of ve.peerDependencies.values()){let fe=O.dependencies.get(le.identHash);if(!fe&&fd(A,le)&&(ee.identHash===A.identHash?fe=ee:(fe=rr(A,ee.range),e.set(fe.descriptorHash,fe),t.set(fe.descriptorHash,A.locatorHash),a.delete(fe.descriptorHash))),(!fe||fe.range==="missing:")&&ve.dependencies.has(le.identHash)){ve.peerDependencies.delete(le.identHash);continue}fe||(fe=rr(le,"missing:")),ve.dependencies.set(fe.identHash,fe),Al(fe)&&Nc(p,fe.descriptorHash).add(ve.locatorHash),f.set(fe.identHash,fe),fe.range==="missing:"&&pe.add(fe.identHash),V.set(le.identHash,(Qe=oe.get(le.identHash))!=null?Qe:ve.locatorHash)}ve.dependencies=new Map(kn(ve.dependencies,([le,fe])=>Ot(fe)))}),je.push(()=>{if(!i.has(ve.locatorHash))return;let Qe=u.get(Ke.locatorHash);typeof Qe=="number"&&Qe>=2&&v();let le=u.get(Ke.locatorHash),fe=typeof le!="undefined"?le+1:1;u.set(Ke.locatorHash,fe),T(ke,ve,V,{top:ce,optional:he}),u.set(Ke.locatorHash,fe-1)}),re.push(()=>{let Qe=O.dependencies.get(be.identHash);if(typeof Qe=="undefined")throw new Error("Assertion failed: Expected the peer dependency to have been turned into a dependency");let le=t.get(Qe.descriptorHash);if(typeof le=="undefined")throw new Error("Assertion failed: Expected the descriptor to be registered");if(Nc(y,le).add(A.locatorHash),!!i.has(ve.locatorHash)){for(let fe of ve.peerDependencies.values()){let gt=V.get(fe.identHash);if(typeof gt=="undefined")throw new Error("Assertion failed: Expected the peer dependency ident to be registered");Fg(Ng(m,gt),Ot(fe)).push(ve.locatorHash)}for(let fe of pe)ve.dependencies.delete(fe)}})}for(let be of[...de,...Be])be();let se;do{se=!0;for(let[be,he,Fe]of L){let Ke=Ng(h,be.locatorHash),ke=ln(...[...Fe.dependencies.values()].map(Qe=>{let le=Qe.range!=="missing:"?t.get(Qe.descriptorHash):"missing:";if(typeof le=="undefined")throw new Error(`Assertion failed: Expected the resolution for ${sr(r.configuration,Qe)} to have been registered`);return le===ce?`${le} (top)`:le}),he.identHash),ve=Ke.get(ke);if(typeof ve=="undefined"){Ke.set(ke,he);continue}if(ve===he)continue;i.delete(Fe.locatorHash),e.delete(he.descriptorHash),t.delete(he.descriptorHash),n.delete(Fe.locatorHash);let pe=p.get(he.descriptorHash)||[],V=[O.locatorHash,...pe];p.delete(he.descriptorHash);for(let Qe of V){let le=i.get(Qe);typeof le!="undefined"&&(le.dependencies.get(he.identHash).descriptorHash!==ve.descriptorHash&&(se=!1),le.dependencies.set(he.identHash,ve))}}}while(!se);for(let be of[...je,...re])be()};for(let ee of r.workspaces){let A=ee.anchoredLocator;a.delete(ee.anchoredDescriptor.descriptorHash),T(ee.anchoredDescriptor,A,new Map,{top:A.locatorHash,optional:!1})}var Y;(function(oe){oe[oe.NotProvided=0]="NotProvided",oe[oe.NotCompatible=1]="NotCompatible"})(Y||(Y={}));let $=[];for(let[ee,A]of y){let oe=i.get(ee);if(typeof oe=="undefined")throw new Error("Assertion failed: Expected the root to be registered");let ce=m.get(ee);if(typeof ce!="undefined")for(let Z of A){let O=i.get(Z);if(typeof O!="undefined")for(let[L,de]of ce){let Be=An(L);if(O.peerDependencies.has(Be.identHash))continue;let je=`p${ln(Z,L,ee).slice(0,5)}`;o.set(je,{subject:Z,requested:Be,rootRequester:ee,allRequesters:de});let re=oe.dependencies.get(Be.identHash);if(typeof re!="undefined"){let se=x(re),be=(ne=se.version)!=null?ne:"0.0.0",he=new Set;for(let Ke of de){let ke=i.get(Ke);if(typeof ke=="undefined")throw new Error("Assertion failed: Expected the link to be registered");let ve=ke.peerDependencies.get(Be.identHash);if(typeof ve=="undefined")throw new Error("Assertion failed: Expected the ident to be registered");he.add(ve.range)}[...he].every(Ke=>{if(Ke.startsWith(oi.protocol)){if(!r.tryWorkspaceByLocator(se))return!1;Ke=Ke.slice(oi.protocol.length),(Ke==="^"||Ke==="~")&&(Ke="*")}return qc(be,Ke)})||$.push({type:1,subject:O,requested:Be,requester:oe,version:be,hash:je,requirementCount:de.length})}else{let se=oe.peerDependenciesMeta.get(L);(se==null?void 0:se.optional)||$.push({type:0,subject:O,requested:Be,requester:oe,hash:je})}}}}let _=[ee=>$x(ee.subject),ee=>Ot(ee.requested),ee=>`${ee.type}`];l==null||l.startSectionSync({reportFooter:()=>{l.reportWarning(X.UNNAMED,`Some peer dependencies are incorrectly met; run ${tt(r.configuration,"yarn explain peer-requirements ",qe.CODE)} for details, where ${tt(r.configuration,"",qe.CODE)} is the six-letter p-prefixed code`)},skipIfEmpty:!0},()=>{for(let ee of kn($,_))switch(ee.type){case 0:l.reportWarning(X.MISSING_PEER_DEPENDENCY,`${It(r.configuration,ee.subject)} doesn't provide ${fi(r.configuration,ee.requested)} (${tt(r.configuration,ee.hash,qe.CODE)}), requested by ${fi(r.configuration,ee.requester)}`);break;case 1:{let A=ee.requirementCount>1?"and some of its descendants request":"requests";l.reportWarning(X.INCOMPATIBLE_PEER_DEPENDENCY,`${It(r.configuration,ee.subject)} provides ${fi(r.configuration,ee.requested)} (${tt(r.configuration,ee.hash,qe.CODE)}) with version ${dd(r.configuration,ee.version)}, which doesn't satisfy what ${fi(r.configuration,ee.requester)} ${A}`)}break}})}var ca;(function(l){l.VERSION="version",l.COMMAND_NAME="commandName",l.PLUGIN_NAME="pluginName",l.INSTALL_COUNT="installCount",l.PROJECT_COUNT="projectCount",l.WORKSPACE_COUNT="workspaceCount",l.DEPENDENCY_COUNT="dependencyCount",l.EXTENSION="packageExtension"})(ca||(ca={}));var mC=class{constructor(e,t){this.values=new Map;this.hits=new Map;this.enumerators=new Map;this.configuration=e;let i=this.getRegistryPath();this.isNew=!K.existsSync(i),this.sendReport(t),this.startBuffer()}reportVersion(e){this.reportValue(ca.VERSION,e.replace(/-git\..*/,"-git"))}reportCommandName(e){this.reportValue(ca.COMMAND_NAME,e||"")}reportPluginName(e){this.reportValue(ca.PLUGIN_NAME,e)}reportProject(e){this.reportEnumerator(ca.PROJECT_COUNT,e)}reportInstall(e){this.reportHit(ca.INSTALL_COUNT,e)}reportPackageExtension(e){this.reportValue(ca.EXTENSION,e)}reportWorkspaceCount(e){this.reportValue(ca.WORKSPACE_COUNT,String(e))}reportDependencyCount(e){this.reportValue(ca.DEPENDENCY_COUNT,String(e))}reportValue(e,t){Nc(this.values,e).add(t)}reportEnumerator(e,t){Nc(this.enumerators,e).add(ln(t))}reportHit(e,t="*"){let i=Ng(this.hits,e),n=_a(i,t,()=>0);i.set(t,n+1)}getRegistryPath(){let e=this.configuration.get("globalFolder");return k.join(e,"telemetry.json")}sendReport(e){var u,g,f;let t=this.getRegistryPath(),i;try{i=K.readJsonSync(t)}catch{i={}}let n=Date.now(),s=this.configuration.get("telemetryInterval")*24*60*60*1e3,a=((u=i.lastUpdate)!=null?u:n+s+Math.floor(s*Math.random()))+s;if(a>n&&i.lastUpdate!=null)return;try{K.mkdirSync(k.dirname(t),{recursive:!0}),K.writeJsonSync(t,{lastUpdate:n})}catch{return}if(a>n||!i.blocks)return;let l=`https://browser-http-intake.logs.datadoghq.eu/v1/input/${e}?ddsource=yarn`,c=h=>HP(l,h,{configuration:this.configuration}).catch(()=>{});for(let[h,p]of Object.entries((g=i.blocks)!=null?g:{})){if(Object.keys(p).length===0)continue;let m=p;m.userId=h,m.reportType="primary";for(let v of Object.keys((f=m.enumerators)!=null?f:{}))m.enumerators[v]=m.enumerators[v].length;c(m);let y=new Map,b=20;for(let[v,x]of Object.entries(m.values))x.length>0&&y.set(v,x.slice(0,b));for(;y.size>0;){let v={};v.userId=h,v.reportType="secondary",v.metrics={};for(let[x,T]of y)v.metrics[x]=T.shift(),T.length===0&&y.delete(x);c(v)}}}applyChanges(){var o,a,l,c,u,g,f,h,p;let e=this.getRegistryPath(),t;try{t=K.readJsonSync(e)}catch{t={}}let i=(o=this.configuration.get("telemetryUserId"))!=null?o:"*",n=t.blocks=(a=t.blocks)!=null?a:{},s=n[i]=(l=n[i])!=null?l:{};for(let m of this.hits.keys()){let y=s.hits=(c=s.hits)!=null?c:{},b=y[m]=(u=y[m])!=null?u:{};for(let[v,x]of this.hits.get(m))b[v]=((g=b[v])!=null?g:0)+x}for(let m of["values","enumerators"])for(let y of this[m].keys()){let b=s[m]=(f=s[m])!=null?f:{};b[y]=[...new Set([...(h=b[y])!=null?h:[],...(p=this[m].get(y))!=null?p:[]])]}K.mkdirSync(k.dirname(e),{recursive:!0}),K.writeJsonSync(e,t)}startBuffer(){process.on("exit",()=>{try{this.applyChanges()}catch{}})}};var HR=ge(require("child_process")),lZ=ge(Ic());var jR=ge(require("fs"));var Lf=new Map([["constraints",[["constraints","query"],["constraints","source"],["constraints"]]],["exec",[]],["interactive-tools",[["search"],["upgrade-interactive"]]],["stage",[["stage"]]],["typescript",[]],["version",[["version","apply"],["version","check"],["version"]]],["workspace-tools",[["workspaces","focus"],["workspaces","foreach"]]]]);function $Oe(r){let e=H.fromPortablePath(r);process.on("SIGINT",()=>{}),e?(0,HR.execFileSync)(process.execPath,[e,...process.argv.slice(2)],{stdio:"inherit",env:te(N({},process.env),{YARN_IGNORE_PATH:"1",YARN_IGNORE_CWD:"1"})}):(0,HR.execFileSync)(e,process.argv.slice(2),{stdio:"inherit",env:te(N({},process.env),{YARN_IGNORE_PATH:"1",YARN_IGNORE_CWD:"1"})})}async function s0({binaryVersion:r,pluginConfiguration:e}){async function t(){let n=new ws({binaryLabel:"Yarn Package Manager",binaryName:"yarn",binaryVersion:r});try{await i(n)}catch(s){process.stdout.write(n.error(s)),process.exitCode=1}}async function i(n){var m,y,b,v,x;let s=process.versions.node,o=">=12 <14 || 14.2 - 14.9 || >14.10.0";if(!Se.parseOptionalBoolean(process.env.YARN_IGNORE_NODE)&&!Wt.satisfiesWithPrereleases(s,o))throw new Pe(`This tool requires a Node version compatible with ${o} (got ${s}). Upgrade Node, or set \`YARN_IGNORE_NODE=1\` in your environment.`);let l=await ye.find(H.toPortablePath(process.cwd()),e,{usePath:!0,strict:!1}),c=l.get("yarnPath"),u=l.get("ignorePath"),g=l.get("ignoreCwd"),f=H.toPortablePath(H.resolve(process.argv[1])),h=T=>K.readFilePromise(T).catch(()=>Buffer.of());if(!u&&!g&&await(async()=>c===f||Buffer.compare(...await Promise.all([h(c),h(f)]))===0)()){process.env.YARN_IGNORE_PATH="1",process.env.YARN_IGNORE_CWD="1",await i(n);return}else if(c!==null&&!u)if(!K.existsSync(c))process.stdout.write(n.error(new Error(`The "yarn-path" option has been set (in ${l.sources.get("yarnPath")}), but the specified location doesn't exist (${c}).`))),process.exitCode=1;else try{$Oe(c)}catch(T){process.exitCode=T.code||1}else{u&&delete process.env.YARN_IGNORE_PATH,l.get("enableTelemetry")&&!lZ.isCI&&process.stdout.isTTY&&(ye.telemetry=new mC(l,"puba9cdc10ec5790a2cf4969dd413a47270")),(m=ye.telemetry)==null||m.reportVersion(r);for(let[$,_]of l.plugins.entries()){Lf.has((b=(y=$.match(/^@yarnpkg\/plugin-(.*)$/))==null?void 0:y[1])!=null?b:"")&&((v=ye.telemetry)==null||v.reportPluginName($));for(let ne of _.commands||[])n.register(ne)}let q=n.process(process.argv.slice(2));q.help||(x=ye.telemetry)==null||x.reportCommandName(q.path.join(" "));let Y=q.cwd;if(typeof Y!="undefined"&&!g){let $=(0,jR.realpathSync)(process.cwd()),_=(0,jR.realpathSync)(Y);if($!==_){process.chdir(Y),await t();return}}await n.runExit(q,{cwd:H.toPortablePath(process.cwd()),plugins:e,quiet:!1,stdin:process.stdin,stdout:process.stdout,stderr:process.stderr})}}return t().catch(n=>{process.stdout.write(n.stack||n.message),process.exitCode=1}).finally(()=>K.rmtempPromise())}function cZ(r){r.Command.Path=(...e)=>t=>{t.paths=t.paths||[],t.paths.push(e)};for(let e of["Array","Boolean","String","Proxy","Rest","Counter"])r.Command[e]=(...t)=>(i,n)=>{let s=r.Option[e](...t);Object.defineProperty(i,`__${n}`,{configurable:!1,enumerable:!0,get(){return s},set(o){this[n]=o}})};return r}var GC={};ft(GC,{BaseCommand:()=>Le,WorkspaceRequiredError:()=>ht,getDynamicLibs:()=>bre,getPluginConfiguration:()=>L0,main:()=>s0,openWorkspace:()=>Wf,pluginCommands:()=>Lf});var Le=class extends Re{constructor(){super(...arguments);this.cwd=J.String("--cwd",{hidden:!0})}};var ht=class extends Pe{constructor(e,t){let i=k.relative(e,t),n=k.join(e,At.fileName);super(`This command can only be run from within a workspace of your project (${i} isn't a workspace of ${n}).`)}};var sGe=ge(ri());ys();var oGe=ge(UF()),bre=()=>new Map([["@yarnpkg/cli",GC],["@yarnpkg/core",EC],["@yarnpkg/fslib",Zh],["@yarnpkg/libzip",Md],["@yarnpkg/parsers",op],["@yarnpkg/shell",Ud],["clipanion",Cp],["semver",sGe],["typanion",cg],["yup",oGe]]);async function Wf(r,e){let{project:t,workspace:i}=await ze.find(r,e);if(!i)throw new ht(t.cwd,e);return i}var Q_e=ge(ri());ys();var S_e=ge(UF());var GN={};ft(GN,{dedupeUtils:()=>wN,default:()=>mWe,suggestUtils:()=>lN});var Sae=ge(Ic());var Fne=ge(WC());ys();var lN={};ft(lN,{Modifier:()=>pa,Strategy:()=>Vr,Target:()=>Hr,WorkspaceModifier:()=>Xf,applyModifier:()=>kne,extractDescriptorFromPath:()=>gN,extractRangeModifier:()=>xne,fetchDescriptorFrom:()=>uN,findProjectDescriptors:()=>Rne,getModifier:()=>zC,getSuggestedDescriptors:()=>_C,makeWorkspaceDescriptor:()=>Dne,toWorkspaceModifier:()=>Pne});var cN=ge(ri()),bYe="workspace:",Hr;(function(i){i.REGULAR="dependencies",i.DEVELOPMENT="devDependencies",i.PEER="peerDependencies"})(Hr||(Hr={}));var pa;(function(i){i.CARET="^",i.TILDE="~",i.EXACT=""})(pa||(pa={}));var Xf;(function(i){i.CARET="^",i.TILDE="~",i.EXACT="*"})(Xf||(Xf={}));var Vr;(function(s){s.KEEP="keep",s.REUSE="reuse",s.PROJECT="project",s.LATEST="latest",s.CACHE="cache"})(Vr||(Vr={}));function zC(r,e){return r.exact?pa.EXACT:r.caret?pa.CARET:r.tilde?pa.TILDE:e.configuration.get("defaultSemverRangePrefix")}var QYe=/^([\^~]?)[0-9]+(?:\.[0-9]+){0,2}(?:-\S+)?$/;function xne(r,{project:e}){let t=r.match(QYe);return t?t[1]:e.configuration.get("defaultSemverRangePrefix")}function kne(r,e){let{protocol:t,source:i,params:n,selector:s}=P.parseRange(r.range);return cN.default.valid(s)&&(s=`${e}${r.range}`),P.makeDescriptor(r,P.makeRange({protocol:t,source:i,params:n,selector:s}))}function Pne(r){switch(r){case pa.CARET:return Xf.CARET;case pa.TILDE:return Xf.TILDE;case pa.EXACT:return Xf.EXACT;default:throw new Error(`Assertion failed: Unknown modifier: "${r}"`)}}function Dne(r,e){return P.makeDescriptor(r.anchoredDescriptor,`${bYe}${Pne(e)}`)}async function Rne(r,{project:e,target:t}){let i=new Map,n=s=>{let o=i.get(s.descriptorHash);return o||i.set(s.descriptorHash,o={descriptor:s,locators:[]}),o};for(let s of e.workspaces)if(t===Hr.PEER){let o=s.manifest.peerDependencies.get(r.identHash);o!==void 0&&n(o).locators.push(s.locator)}else{let o=s.manifest.dependencies.get(r.identHash),a=s.manifest.devDependencies.get(r.identHash);t===Hr.DEVELOPMENT?a!==void 0?n(a).locators.push(s.locator):o!==void 0&&n(o).locators.push(s.locator):o!==void 0?n(o).locators.push(s.locator):a!==void 0&&n(a).locators.push(s.locator)}return i}async function gN(r,{cwd:e,workspace:t}){return await SYe(async i=>{k.isAbsolute(r)||(r=k.relative(t.cwd,k.resolve(e,r)),r.match(/^\.{0,2}\//)||(r=`./${r}`));let{project:n}=t,s=await uN(P.makeIdent(null,"archive"),r,{project:t.project,cache:i,workspace:t});if(!s)throw new Error("Assertion failed: The descriptor should have been found");let o=new di,a=n.configuration.makeResolver(),l=n.configuration.makeFetcher(),c={checksums:n.storedChecksums,project:n,cache:i,fetcher:l,report:o,resolver:a},u=a.bindDescriptor(s,t.anchoredLocator,c),g=P.convertDescriptorToLocator(u),f=await l.fetch(g,c),h=await At.find(f.prefixPath,{baseFs:f.packageFs});if(!h.name)throw new Error("Target path doesn't have a name");return P.makeDescriptor(h.name,r)})}async function _C(r,{project:e,workspace:t,cache:i,target:n,modifier:s,strategies:o,maxResults:a=Infinity}){if(!(a>=0))throw new Error(`Invalid maxResults (${a})`);if(r.range!=="unknown")return{suggestions:[{descriptor:r,name:`Use ${P.prettyDescriptor(e.configuration,r)}`,reason:"(unambiguous explicit request)"}],rejections:[]};let l=typeof t!="undefined"&&t!==null&&t.manifest[n].get(r.identHash)||null,c=[],u=[],g=async f=>{try{await f()}catch(h){u.push(h)}};for(let f of o){if(c.length>=a)break;switch(f){case Vr.KEEP:await g(async()=>{l&&c.push({descriptor:l,name:`Keep ${P.prettyDescriptor(e.configuration,l)}`,reason:"(no changes)"})});break;case Vr.REUSE:await g(async()=>{for(let{descriptor:h,locators:p}of(await Rne(r,{project:e,target:n})).values()){if(p.length===1&&p[0].locatorHash===t.anchoredLocator.locatorHash&&o.includes(Vr.KEEP))continue;let m=`(originally used by ${P.prettyLocator(e.configuration,p[0])}`;m+=p.length>1?` and ${p.length-1} other${p.length>2?"s":""})`:")",c.push({descriptor:h,name:`Reuse ${P.prettyDescriptor(e.configuration,h)}`,reason:m})}});break;case Vr.CACHE:await g(async()=>{for(let h of e.storedDescriptors.values())h.identHash===r.identHash&&c.push({descriptor:h,name:`Reuse ${P.prettyDescriptor(e.configuration,h)}`,reason:"(already used somewhere in the lockfile)"})});break;case Vr.PROJECT:await g(async()=>{if(t.manifest.name!==null&&r.identHash===t.manifest.name.identHash)return;let h=e.tryWorkspaceByIdent(r);if(h===null)return;let p=Dne(h,s);c.push({descriptor:p,name:`Attach ${P.prettyDescriptor(e.configuration,p)}`,reason:`(local workspace at ${ae.pretty(e.configuration,h.relativeCwd,ae.Type.PATH)})`})});break;case Vr.LATEST:await g(async()=>{if(r.range!=="unknown")c.push({descriptor:r,name:`Use ${P.prettyRange(e.configuration,r.range)}`,reason:"(explicit range requested)"});else if(n===Hr.PEER)c.push({descriptor:P.makeDescriptor(r,"*"),name:"Use *",reason:"(catch-all peer dependency pattern)"});else if(!e.configuration.get("enableNetwork"))c.push({descriptor:null,name:"Resolve from latest",reason:ae.pretty(e.configuration,"(unavailable because enableNetwork is toggled off)","grey")});else{let h=await uN(r,"latest",{project:e,cache:i,workspace:t,preserveModifier:!1});h&&(h=kne(h,s),c.push({descriptor:h,name:`Use ${P.prettyDescriptor(e.configuration,h)}`,reason:"(resolved from latest)"}))}});break}}return{suggestions:c.slice(0,a),rejections:u.slice(0,a)}}async function uN(r,e,{project:t,cache:i,workspace:n,preserveModifier:s=!0}){let o=P.makeDescriptor(r,e),a=new di,l=t.configuration.makeFetcher(),c=t.configuration.makeResolver(),u={project:t,fetcher:l,cache:i,checksums:t.storedChecksums,report:a,cacheOptions:{skipIntegrityCheck:!0},skipIntegrityCheck:!0},g=te(N({},u),{resolver:c,fetchOptions:u}),f=c.bindDescriptor(o,n.anchoredLocator,g),h=await c.getCandidates(f,new Map,g);if(h.length===0)return null;let p=h[0],{protocol:m,source:y,params:b,selector:v}=P.parseRange(P.convertToManifestRange(p.reference));if(m===t.configuration.get("defaultProtocol")&&(m=null),cN.default.valid(v)&&s!==!1){let x=typeof s=="string"?s:o.range;v=xne(x,{project:t})+v}return P.makeDescriptor(p,P.makeRange({protocol:m,source:y,params:b,selector:v}))}async function SYe(r){return await K.mktempPromise(async e=>{let t=ye.create(e);return t.useWithSource(e,{enableMirror:!1,compressionLevel:0},e,{overwrite:!0}),await r(new Nt(e,{configuration:t,check:!1,immutable:!1}))})}var VC=class extends Le{constructor(){super(...arguments);this.json=J.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.exact=J.Boolean("-E,--exact",!1,{description:"Don't use any semver modifier on the resolved range"});this.tilde=J.Boolean("-T,--tilde",!1,{description:"Use the `~` semver modifier on the resolved range"});this.caret=J.Boolean("-C,--caret",!1,{description:"Use the `^` semver modifier on the resolved range"});this.dev=J.Boolean("-D,--dev",!1,{description:"Add a package as a dev dependency"});this.peer=J.Boolean("-P,--peer",!1,{description:"Add a package as a peer dependency"});this.optional=J.Boolean("-O,--optional",!1,{description:"Add / upgrade a package to an optional regular / peer dependency"});this.preferDev=J.Boolean("--prefer-dev",!1,{description:"Add / upgrade a package to a dev dependency"});this.interactive=J.Boolean("-i,--interactive",{description:"Reuse the specified package from other workspaces in the project"});this.cached=J.Boolean("--cached",!1,{description:"Reuse the highest version already used somewhere within the project"});this.mode=J.String("--mode",{description:"Change what artifacts installs generate",validator:nn(Ci)});this.silent=J.Boolean("--silent",{hidden:!0});this.packages=J.Rest()}async execute(){var m;let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,workspace:i}=await ze.find(e,this.context.cwd),n=await Nt.find(e);if(!i)throw new ht(t.cwd,this.context.cwd);await t.restoreInstallState({restoreResolutions:!1});let s=(m=this.interactive)!=null?m:e.get("preferInteractive"),o=zC(this,t),a=[...s?[Vr.REUSE]:[],Vr.PROJECT,...this.cached?[Vr.CACHE]:[],Vr.LATEST],l=s?Infinity:1,c=await Promise.all(this.packages.map(async y=>{let b=y.match(/^\.{0,2}\//)?await gN(y,{cwd:this.context.cwd,workspace:i}):P.tryParseDescriptor(y),v=y.match(/^(https?:|git@github)/);if(v)throw new Pe(`It seems you are trying to add a package using a ${ae.pretty(e,`${v[0]}...`,Ri.RANGE)} url; we now require package names to be explicitly specified. -Try running the command again with the package name prefixed: ${ae.pretty(e,"yarn add",Ri.CODE)} ${ae.pretty(e,P.makeDescriptor(P.makeIdent(null,"my-package"),`${v[0]}...`),Ri.DESCRIPTOR)}`);if(!b)throw new Pe(`The ${ae.pretty(e,y,Ri.CODE)} string didn't match the required format (package-name@range). Did you perhaps forget to explicitly reference the package name?`);let x=vYe(i,b,{dev:this.dev,peer:this.peer,preferDev:this.preferDev,optional:this.optional}),T=await _C(b,{project:t,workspace:i,cache:n,target:x,modifier:o,strategies:a,maxResults:l});return[b,T,x]})),u=await pA.start({configuration:e,stdout:this.context.stdout,suggestInstall:!1},async y=>{for(let[b,{suggestions:v,rejections:x}]of c)if(v.filter(q=>q.descriptor!==null).length===0){let[q]=x;if(typeof q=="undefined")throw new Error("Assertion failed: Expected an error to have been set");t.configuration.get("enableNetwork")?y.reportError(X.CANT_SUGGEST_RESOLUTIONS,`${P.prettyDescriptor(e,b)} can't be resolved to a satisfying range`):y.reportError(X.CANT_SUGGEST_RESOLUTIONS,`${P.prettyDescriptor(e,b)} can't be resolved to a satisfying range (note: network resolution has been disabled)`),y.reportSeparator(),y.reportExceptionOnce(q)}});if(u.hasErrors())return u.exitCode();let g=!1,f=[],h=[];for(let[,{suggestions:y},b]of c){let v,x=y.filter($=>$.descriptor!==null),T=x[0].descriptor,q=x.every($=>P.areDescriptorsEqual($.descriptor,T));x.length===1||q?v=T:(g=!0,{answer:v}=await(0,Fne.prompt)({type:"select",name:"answer",message:"Which range do you want to use?",choices:y.map(({descriptor:$,name:_,reason:ne})=>$?{name:_,hint:ne,descriptor:$}:{name:_,hint:ne,disabled:!0}),onCancel:()=>process.exit(130),result($){return this.find($,"descriptor")},stdin:this.context.stdin,stdout:this.context.stdout}));let Y=i.manifest[b].get(v.identHash);(typeof Y=="undefined"||Y.descriptorHash!==v.descriptorHash)&&(i.manifest[b].set(v.identHash,v),this.optional&&(b==="dependencies"?i.manifest.ensureDependencyMeta(te(N({},v),{range:"unknown"})).optional=!0:b==="peerDependencies"&&(i.manifest.ensurePeerDependencyMeta(te(N({},v),{range:"unknown"})).optional=!0)),typeof Y=="undefined"?f.push([i,b,v,a]):h.push([i,b,Y,v]))}return await e.triggerMultipleHooks(y=>y.afterWorkspaceDependencyAddition,f),await e.triggerMultipleHooks(y=>y.afterWorkspaceDependencyReplacement,h),g&&this.context.stdout.write(` -`),(await Je.start({configuration:e,json:this.json,stdout:this.context.stdout,includeLogs:!this.context.quiet},async y=>{await t.install({cache:n,report:y,mode:this.mode})})).exitCode()}};VC.paths=[["add"]],VC.usage=Re.Usage({description:"add dependencies to the project",details:"\n This command adds a package to the package.json for the nearest workspace.\n\n - If it didn't exist before, the package will by default be added to the regular `dependencies` field, but this behavior can be overriden thanks to the `-D,--dev` flag (which will cause the dependency to be added to the `devDependencies` field instead) and the `-P,--peer` flag (which will do the same but for `peerDependencies`).\n\n - If the package was already listed in your dependencies, it will by default be upgraded whether it's part of your `dependencies` or `devDependencies` (it won't ever update `peerDependencies`, though).\n\n - If set, the `--prefer-dev` flag will operate as a more flexible `-D,--dev` in that it will add the package to your `devDependencies` if it isn't already listed in either `dependencies` or `devDependencies`, but it will also happily upgrade your `dependencies` if that's what you already use (whereas `-D,--dev` would throw an exception).\n\n - If set, the `-O,--optional` flag will add the package to the `optionalDependencies` field and, in combination with the `-P,--peer` flag, it will add the package as an optional peer dependency. If the package was already listed in your `dependencies`, it will be upgraded to `optionalDependencies`. If the package was already listed in your `peerDependencies`, in combination with the `-P,--peer` flag, it will be upgraded to an optional peer dependency: `\"peerDependenciesMeta\": { \"\": { \"optional\": true } }`\n\n - If the added package doesn't specify a range at all its `latest` tag will be resolved and the returned version will be used to generate a new semver range (using the `^` modifier by default unless otherwise configured via the `defaultSemverRangePrefix` configuration, or the `~` modifier if `-T,--tilde` is specified, or no modifier at all if `-E,--exact` is specified). Two exceptions to this rule: the first one is that if the package is a workspace then its local version will be used, and the second one is that if you use `-P,--peer` the default range will be `*` and won't be resolved at all.\n\n - If the added package specifies a range (such as `^1.0.0`, `latest`, or `rc`), Yarn will add this range as-is in the resulting package.json entry (in particular, tags such as `rc` will be encoded as-is rather than being converted into a semver range).\n\n If the `--cached` option is used, Yarn will preferably reuse the highest version already used somewhere within the project, even if through a transitive dependency.\n\n If the `-i,--interactive` option is used (or if the `preferInteractive` settings is toggled on) the command will first try to check whether other workspaces in the project use the specified package and, if so, will offer to reuse them.\n\n If the `--mode=` option is set, Yarn will change which artifacts are generated. The modes currently supported are:\n\n - `skip-build` will not run the build scripts at all. Note that this is different from setting `enableScripts` to false because the later will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.\n\n - `update-lockfile` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.\n\n For a compilation of all the supported protocols, please consult the dedicated page from our website: https://yarnpkg.com/features/protocols.\n ",examples:[["Add a regular package to the current workspace","$0 add lodash"],["Add a specific version for a package to the current workspace","$0 add lodash@1.2.3"],["Add a package from a GitHub repository (the master branch) to the current workspace using a URL","$0 add lodash@https://github.com/lodash/lodash"],["Add a package from a GitHub repository (the master branch) to the current workspace using the GitHub protocol","$0 add lodash@github:lodash/lodash"],["Add a package from a GitHub repository (the master branch) to the current workspace using the GitHub protocol (shorthand)","$0 add lodash@lodash/lodash"],["Add a package from a specific branch of a GitHub repository to the current workspace using the GitHub protocol (shorthand)","$0 add lodash-es@lodash/lodash#es"]]});var Nne=VC;function vYe(r,e,{dev:t,peer:i,preferDev:n,optional:s}){let o=r.manifest[Hr.REGULAR].has(e.identHash),a=r.manifest[Hr.DEVELOPMENT].has(e.identHash),l=r.manifest[Hr.PEER].has(e.identHash);if((t||i)&&o)throw new Pe(`Package "${P.prettyIdent(r.project.configuration,e)}" is already listed as a regular dependency - remove the -D,-P flags or remove it from your dependencies first`);if(!t&&!i&&l)throw new Pe(`Package "${P.prettyIdent(r.project.configuration,e)}" is already listed as a peer dependency - use either of -D or -P, or remove it from your peer dependencies first`);if(s&&a)throw new Pe(`Package "${P.prettyIdent(r.project.configuration,e)}" is already listed as a dev dependency - remove the -O flag or remove it from your dev dependencies first`);if(s&&!i&&l)throw new Pe(`Package "${P.prettyIdent(r.project.configuration,e)}" is already listed as a peer dependency - remove the -O flag or add the -P flag or remove it from your peer dependencies first`);if((t||n)&&s)throw new Pe(`Package "${P.prettyIdent(r.project.configuration,e)}" cannot simultaneously be a dev dependency and an optional dependency`);return i?Hr.PEER:t||n?Hr.DEVELOPMENT:o?Hr.REGULAR:a?Hr.DEVELOPMENT:Hr.REGULAR}var XC=class extends Le{constructor(){super(...arguments);this.verbose=J.Boolean("-v,--verbose",!1,{description:"Print both the binary name and the locator of the package that provides the binary"});this.json=J.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.name=J.String({required:!1})}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,locator:i}=await ze.find(e,this.context.cwd);if(await t.restoreInstallState(),this.name){let o=(await Zt.getPackageAccessibleBinaries(i,{project:t})).get(this.name);if(!o)throw new Pe(`Couldn't find a binary named "${this.name}" for package "${P.prettyLocator(e,i)}"`);let[,a]=o;return this.context.stdout.write(`${a} -`),0}return(await Je.start({configuration:e,json:this.json,stdout:this.context.stdout},async s=>{let o=await Zt.getPackageAccessibleBinaries(i,{project:t}),l=Array.from(o.keys()).reduce((c,u)=>Math.max(c,u.length),0);for(let[c,[u,g]]of o)s.reportJson({name:c,source:P.stringifyIdent(u),path:g});if(this.verbose)for(let[c,[u]]of o)s.reportInfo(null,`${c.padEnd(l," ")} ${P.prettyLocator(e,u)}`);else for(let c of o.keys())s.reportInfo(null,c)})).exitCode()}};XC.paths=[["bin"]],XC.usage=Re.Usage({description:"get the path to a binary script",details:` - When used without arguments, this command will print the list of all the binaries available in the current workspace. Adding the \`-v,--verbose\` flag will cause the output to contain both the binary name and the locator of the package that provides the binary. - - When an argument is specified, this command will just print the path to the binary on the standard output and exit. Note that the reported path may be stored within a zip archive. - `,examples:[["List all the available binaries","$0 bin"],["Print the path to a specific binary","$0 bin eslint"]]});var Lne=XC;var ZC=class extends Le{constructor(){super(...arguments);this.mirror=J.Boolean("--mirror",!1,{description:"Remove the global cache files instead of the local cache files"});this.all=J.Boolean("--all",!1,{description:"Remove both the global cache files and the local cache files of the current project"})}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),t=await Nt.find(e);return(await Je.start({configuration:e,stdout:this.context.stdout},async()=>{let n=(this.all||this.mirror)&&t.mirrorCwd!==null,s=!this.mirror;n&&(await K.removePromise(t.mirrorCwd),await e.triggerHook(o=>o.cleanGlobalArtifacts,e)),s&&await K.removePromise(t.cwd)})).exitCode()}};ZC.paths=[["cache","clean"],["cache","clear"]],ZC.usage=Re.Usage({description:"remove the shared cache files",details:` - This command will remove all the files from the cache. - `,examples:[["Remove all the local archives","$0 cache clean"],["Remove all the archives stored in the ~/.yarn directory","$0 cache clean --mirror"]]});var Tne=ZC;var One=ge(C0()),fN=ge(require("util")),$C=class extends Le{constructor(){super(...arguments);this.json=J.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.unsafe=J.Boolean("--no-redacted",!1,{description:"Don't redact secrets (such as tokens) from the output"});this.name=J.String()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),t=this.name.replace(/[.[].*$/,""),i=this.name.replace(/^[^.[]*/,"");if(typeof e.settings.get(t)=="undefined")throw new Pe(`Couldn't find a configuration settings named "${t}"`);let s=e.getSpecial(t,{hideSecrets:!this.unsafe,getNativePaths:!0}),o=Se.convertMapsToIndexableObjects(s),a=i?(0,One.default)(o,i):o,l=await Je.start({configuration:e,includeFooter:!1,json:this.json,stdout:this.context.stdout},async c=>{c.reportJson(a)});if(!this.json){if(typeof a=="string")return this.context.stdout.write(`${a} -`),l.exitCode();fN.inspect.styles.name="cyan",this.context.stdout.write(`${(0,fN.inspect)(a,{depth:Infinity,colors:e.get("enableColors"),compact:!1})} -`)}return l.exitCode()}};$C.paths=[["config","get"]],$C.usage=Re.Usage({description:"read a configuration settings",details:` - This command will print a configuration setting. - - Secrets (such as tokens) will be redacted from the output by default. If this behavior isn't desired, set the \`--no-redacted\` to get the untransformed value. - `,examples:[["Print a simple configuration setting","yarn config get yarnPath"],["Print a complex configuration setting","yarn config get packageExtensions"],["Print a nested field from the configuration",`yarn config get 'npmScopes["my-company"].npmRegistryServer'`],["Print a token from the configuration","yarn config get npmAuthToken --no-redacted"],["Print a configuration setting as JSON","yarn config get packageExtensions --json"]]});var Mne=$C;var Vse=ge(EN()),Xse=ge(C0()),Zse=ge(_se()),IN=ge(require("util")),tm=class extends Le{constructor(){super(...arguments);this.json=J.Boolean("--json",!1,{description:"Set complex configuration settings to JSON values"});this.home=J.Boolean("-H,--home",!1,{description:"Update the home configuration instead of the project configuration"});this.name=J.String();this.value=J.String()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),t=()=>{if(!e.projectCwd)throw new Pe("This command must be run from within a project folder");return e.projectCwd},i=this.name.replace(/[.[].*$/,""),n=this.name.replace(/^[^.[]*\.?/,"");if(typeof e.settings.get(i)=="undefined")throw new Pe(`Couldn't find a configuration settings named "${i}"`);if(i==="enableStrictSettings")throw new Pe("This setting only affects the file it's in, and thus cannot be set from the CLI");let o=this.json?JSON.parse(this.value):this.value;await(this.home?h=>ye.updateHomeConfiguration(h):h=>ye.updateConfiguration(t(),h))(h=>{if(n){let p=(0,Vse.default)(h);return(0,Zse.default)(p,this.name,o),p}else return te(N({},h),{[i]:o})});let c=(await ye.find(this.context.cwd,this.context.plugins)).getSpecial(i,{hideSecrets:!0,getNativePaths:!0}),u=Se.convertMapsToIndexableObjects(c),g=n?(0,Xse.default)(u,n):u;return(await Je.start({configuration:e,includeFooter:!1,stdout:this.context.stdout},async h=>{IN.inspect.styles.name="cyan",h.reportInfo(X.UNNAMED,`Successfully set ${this.name} to ${(0,IN.inspect)(g,{depth:Infinity,colors:e.get("enableColors"),compact:!1})}`)})).exitCode()}};tm.paths=[["config","set"]],tm.usage=Re.Usage({description:"change a configuration settings",details:` - This command will set a configuration setting. - - When used without the \`--json\` flag, it can only set a simple configuration setting (a string, a number, or a boolean). - - When used with the \`--json\` flag, it can set both simple and complex configuration settings, including Arrays and Objects. - `,examples:[["Set a simple configuration setting (a string, a number, or a boolean)","yarn config set initScope myScope"],["Set a simple configuration setting (a string, a number, or a boolean) using the `--json` flag",'yarn config set initScope --json \\"myScope\\"'],["Set a complex configuration setting (an Array) using the `--json` flag",`yarn config set unsafeHttpWhitelist --json '["*.example.com", "example.com"]'`],["Set a complex configuration setting (an Object) using the `--json` flag",`yarn config set packageExtensions --json '{ "@babel/parser@*": { "dependencies": { "@babel/types": "*" } } }'`],["Set a nested configuration setting",'yarn config set npmScopes.company.npmRegistryServer "https://npm.example.com"'],["Set a nested configuration setting using indexed access for non-simple keys",`yarn config set 'npmRegistries["//npm.example.com"].npmAuthToken' "ffffffff-ffff-ffff-ffff-ffffffffffff"`]]});var $se=tm;var Aoe=ge(EN()),loe=ge(yC()),coe=ge(aoe()),rm=class extends Le{constructor(){super(...arguments);this.home=J.Boolean("-H,--home",!1,{description:"Update the home configuration instead of the project configuration"});this.name=J.String()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),t=()=>{if(!e.projectCwd)throw new Pe("This command must be run from within a project folder");return e.projectCwd},i=this.name.replace(/[.[].*$/,""),n=this.name.replace(/^[^.[]*\.?/,"");if(typeof e.settings.get(i)=="undefined")throw new Pe(`Couldn't find a configuration settings named "${i}"`);let o=this.home?l=>ye.updateHomeConfiguration(l):l=>ye.updateConfiguration(t(),l);return(await Je.start({configuration:e,includeFooter:!1,stdout:this.context.stdout},async l=>{let c=!1;await o(u=>{if(!(0,loe.default)(u,this.name))return l.reportWarning(X.UNNAMED,`Configuration doesn't contain setting ${this.name}; there is nothing to unset`),c=!0,u;let g=n?(0,Aoe.default)(u):N({},u);return(0,coe.default)(g,this.name),g}),c||l.reportInfo(X.UNNAMED,`Successfully unset ${this.name}`)})).exitCode()}};rm.paths=[["config","unset"]],rm.usage=Re.Usage({description:"unset a configuration setting",details:` - This command will unset a configuration setting. - `,examples:[["Unset a simple configuration setting","yarn config unset initScope"],["Unset a complex configuration setting","yarn config unset packageExtensions"],["Unset a nested configuration setting","yarn config unset npmScopes.company.npmRegistryServer"]]});var uoe=rm;var yN=ge(require("util")),im=class extends Le{constructor(){super(...arguments);this.verbose=J.Boolean("-v,--verbose",!1,{description:"Print the setting description on top of the regular key/value information"});this.why=J.Boolean("--why",!1,{description:"Print the reason why a setting is set a particular way"});this.json=J.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins,{strict:!1});return(await Je.start({configuration:e,json:this.json,stdout:this.context.stdout},async i=>{if(e.invalid.size>0&&!this.json){for(let[n,s]of e.invalid)i.reportError(X.INVALID_CONFIGURATION_KEY,`Invalid configuration key "${n}" in ${s}`);i.reportSeparator()}if(this.json){let n=Se.sortMap(e.settings.keys(),s=>s);for(let s of n){let o=e.settings.get(s),a=e.getSpecial(s,{hideSecrets:!0,getNativePaths:!0}),l=e.sources.get(s);this.verbose?i.reportJson({key:s,effective:a,source:l}):i.reportJson(N({key:s,effective:a,source:l},o))}}else{let n=Se.sortMap(e.settings.keys(),a=>a),s=n.reduce((a,l)=>Math.max(a,l.length),0),o={breakLength:Infinity,colors:e.get("enableColors"),maxArrayLength:2};if(this.why||this.verbose){let a=n.map(c=>{let u=e.settings.get(c);if(!u)throw new Error(`Assertion failed: This settings ("${c}") should have been registered`);let g=this.why?e.sources.get(c)||"":u.description;return[c,g]}),l=a.reduce((c,[,u])=>Math.max(c,u.length),0);for(let[c,u]of a)i.reportInfo(null,`${c.padEnd(s," ")} ${u.padEnd(l," ")} ${(0,yN.inspect)(e.getSpecial(c,{hideSecrets:!0,getNativePaths:!0}),o)}`)}else for(let a of n)i.reportInfo(null,`${a.padEnd(s," ")} ${(0,yN.inspect)(e.getSpecial(a,{hideSecrets:!0,getNativePaths:!0}),o)}`)}})).exitCode()}};im.paths=[["config"]],im.usage=Re.Usage({description:"display the current configuration",details:` - This command prints the current active configuration settings. - `,examples:[["Print the active configuration settings","$0 config"]]});var goe=im;ys();var wN={};ft(wN,{Strategy:()=>Bu,acceptedStrategies:()=>P3e,dedupe:()=>BN});var foe=ge(is()),Bu;(function(e){e.HIGHEST="highest"})(Bu||(Bu={}));var P3e=new Set(Object.values(Bu)),D3e={highest:async(r,e,{resolver:t,fetcher:i,resolveOptions:n,fetchOptions:s})=>{let o=new Map;for(let[a,l]of r.storedResolutions){let c=r.storedDescriptors.get(a);if(typeof c=="undefined")throw new Error(`Assertion failed: The descriptor (${a}) should have been registered`);Se.getSetWithDefault(o,c.identHash).add(l)}return Array.from(r.storedDescriptors.values(),async a=>{if(e.length&&!foe.default.isMatch(P.stringifyIdent(a),e))return null;let l=r.storedResolutions.get(a.descriptorHash);if(typeof l=="undefined")throw new Error(`Assertion failed: The resolution (${a.descriptorHash}) should have been registered`);let c=r.originalPackages.get(l);if(typeof c=="undefined"||!t.shouldPersistResolution(c,n))return null;let u=o.get(a.identHash);if(typeof u=="undefined")throw new Error(`Assertion failed: The resolutions (${a.identHash}) should have been registered`);if(u.size===1)return null;let g=[...u].map(y=>{let b=r.originalPackages.get(y);if(typeof b=="undefined")throw new Error(`Assertion failed: The package (${y}) should have been registered`);return b.reference}),f=await t.getSatisfying(a,g,n),h=f==null?void 0:f[0];if(typeof h=="undefined")return null;let p=h.locatorHash,m=r.originalPackages.get(p);if(typeof m=="undefined")throw new Error(`Assertion failed: The package (${p}) should have been registered`);return p===l?null:{descriptor:a,currentPackage:c,updatedPackage:m}})}};async function BN(r,{strategy:e,patterns:t,cache:i,report:n}){let{configuration:s}=r,o=new di,a=s.makeResolver(),l=s.makeFetcher(),c={cache:i,checksums:r.storedChecksums,fetcher:l,project:r,report:o,skipIntegrityCheck:!0,cacheOptions:{skipIntegrityCheck:!0}},u={project:r,resolver:a,report:o,fetchOptions:c};return await n.startTimerPromise("Deduplication step",async()=>{let f=await D3e[e](r,t,{resolver:a,resolveOptions:u,fetcher:l,fetchOptions:c}),h=Ji.progressViaCounter(f.length);n.reportProgress(h);let p=0;await Promise.all(f.map(b=>b.then(v=>{if(v===null)return;p++;let{descriptor:x,currentPackage:T,updatedPackage:q}=v;n.reportInfo(X.UNNAMED,`${P.prettyDescriptor(s,x)} can be deduped from ${P.prettyLocator(s,T)} to ${P.prettyLocator(s,q)}`),n.reportJson({descriptor:P.stringifyDescriptor(x),currentResolution:P.stringifyLocator(T),updatedResolution:P.stringifyLocator(q)}),r.storedResolutions.set(x.descriptorHash,q.locatorHash)}).finally(()=>h.tick())));let m;switch(p){case 0:m="No packages";break;case 1:m="One package";break;default:m=`${p} packages`}let y=ae.pretty(s,e,ae.Type.CODE);return n.reportInfo(X.UNNAMED,`${m} can be deduped using the ${y} strategy`),p})}var nm=class extends Le{constructor(){super(...arguments);this.strategy=J.String("-s,--strategy",Bu.HIGHEST,{description:"The strategy to use when deduping dependencies",validator:nn(Bu)});this.check=J.Boolean("-c,--check",!1,{description:"Exit with exit code 1 when duplicates are found, without persisting the dependency tree"});this.json=J.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.mode=J.String("--mode",{description:"Change what artifacts installs generate",validator:nn(Ci)});this.patterns=J.Rest()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t}=await ze.find(e,this.context.cwd),i=await Nt.find(e);await t.restoreInstallState({restoreResolutions:!1});let n=0,s=await Je.start({configuration:e,includeFooter:!1,stdout:this.context.stdout,json:this.json},async o=>{n=await BN(t,{strategy:this.strategy,patterns:this.patterns,cache:i,report:o})});return s.hasErrors()?s.exitCode():this.check?n?1:0:(await Je.start({configuration:e,stdout:this.context.stdout,json:this.json},async a=>{await t.install({cache:i,report:a,mode:this.mode})})).exitCode()}};nm.paths=[["dedupe"]],nm.usage=Re.Usage({description:"deduplicate dependencies with overlapping ranges",details:"\n Duplicates are defined as descriptors with overlapping ranges being resolved and locked to different locators. They are a natural consequence of Yarn's deterministic installs, but they can sometimes pile up and unnecessarily increase the size of your project.\n\n This command dedupes dependencies in the current project using different strategies (only one is implemented at the moment):\n\n - `highest`: Reuses (where possible) the locators with the highest versions. This means that dependencies can only be upgraded, never downgraded. It's also guaranteed that it never takes more than a single pass to dedupe the entire dependency tree.\n\n **Note:** Even though it never produces a wrong dependency tree, this command should be used with caution, as it modifies the dependency tree, which can sometimes cause problems when packages don't strictly follow semver recommendations. Because of this, it is recommended to also review the changes manually.\n\n If set, the `-c,--check` flag will only report the found duplicates, without persisting the modified dependency tree. If changes are found, the command will exit with a non-zero exit code, making it suitable for CI purposes.\n\n If the `--mode=` option is set, Yarn will change which artifacts are generated. The modes currently supported are:\n\n - `skip-build` will not run the build scripts at all. Note that this is different from setting `enableScripts` to false because the later will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.\n\n - `update-lockfile` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.\n\n This command accepts glob patterns as arguments (if valid Idents and supported by [micromatch](https://github.com/micromatch/micromatch)). Make sure to escape the patterns, to prevent your own shell from trying to expand them.\n\n ### In-depth explanation:\n\n Yarn doesn't deduplicate dependencies by default, otherwise installs wouldn't be deterministic and the lockfile would be useless. What it actually does is that it tries to not duplicate dependencies in the first place.\n\n **Example:** If `foo@^2.3.4` (a dependency of a dependency) has already been resolved to `foo@2.3.4`, running `yarn add foo@*`will cause Yarn to reuse `foo@2.3.4`, even if the latest `foo` is actually `foo@2.10.14`, thus preventing unnecessary duplication.\n\n Duplication happens when Yarn can't unlock dependencies that have already been locked inside the lockfile.\n\n **Example:** If `foo@^2.3.4` (a dependency of a dependency) has already been resolved to `foo@2.3.4`, running `yarn add foo@2.10.14` will cause Yarn to install `foo@2.10.14` because the existing resolution doesn't satisfy the range `2.10.14`. This behavior can lead to (sometimes) unwanted duplication, since now the lockfile contains 2 separate resolutions for the 2 `foo` descriptors, even though they have overlapping ranges, which means that the lockfile can be simplified so that both descriptors resolve to `foo@2.10.14`.\n ",examples:[["Dedupe all packages","$0 dedupe"],["Dedupe all packages using a specific strategy","$0 dedupe --strategy highest"],["Dedupe a specific package","$0 dedupe lodash"],["Dedupe all packages with the `@babel/*` scope","$0 dedupe '@babel/*'"],["Check for duplicates (can be used as a CI step)","$0 dedupe --check"]]});var hoe=nm;var J0=class extends Le{async execute(){let{plugins:e}=await ye.find(this.context.cwd,this.context.plugins),t=[];for(let o of e){let{commands:a}=o[1];if(a){let c=ws.from(a).definitions();t.push([o[0],c])}}let i=this.cli.definitions(),n=(o,a)=>o.split(" ").slice(1).join()===a.split(" ").slice(1).join(),s=doe()["@yarnpkg/builder"].bundles.standard;for(let o of t){let a=o[1];for(let l of a)i.find(c=>n(c.path,l.path)).plugin={name:o[0],isDefault:s.includes(o[0])}}this.context.stdout.write(`${JSON.stringify(i,null,2)} -`)}};J0.paths=[["--clipanion=definitions"]];var Coe=J0;var W0=class extends Le{async execute(){this.context.stdout.write(this.cli.usage(null))}};W0.paths=[["help"],["--help"],["-h"]];var moe=W0;var bN=class extends Le{constructor(){super(...arguments);this.leadingArgument=J.String();this.args=J.Proxy()}async execute(){if(this.leadingArgument.match(/[\\/]/)&&!P.tryParseIdent(this.leadingArgument)){let e=k.resolve(this.context.cwd,H.toPortablePath(this.leadingArgument));return await this.cli.run(this.args,{cwd:e})}else return await this.cli.run(["run",this.leadingArgument,...this.args])}},Eoe=bN;var z0=class extends Le{async execute(){this.context.stdout.write(`${Ur||""} -`)}};z0.paths=[["-v"],["--version"]];var Ioe=z0;var sm=class extends Le{constructor(){super(...arguments);this.commandName=J.String();this.args=J.Proxy()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,locator:i}=await ze.find(e,this.context.cwd);return await t.restoreInstallState(),await Zt.executePackageShellcode(i,this.commandName,this.args,{cwd:this.context.cwd,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr,project:t})}};sm.paths=[["exec"]],sm.usage=Re.Usage({description:"execute a shell script",details:` - This command simply executes a shell script within the context of the root directory of the active workspace using the portable shell. - - It also makes sure to call it in a way that's compatible with the current project (for example, on PnP projects the environment will be setup in such a way that PnP will be correctly injected into the environment). - `,examples:[["Execute a single shell command","$0 exec echo Hello World"],["Execute a shell script",'$0 exec "tsc & babel src --out-dir lib"']]});var yoe=sm;ys();var om=class extends Le{constructor(){super(...arguments);this.hash=J.String({required:!1,validator:fp(gp(),[hp(/^p[0-9a-f]{5}$/)])})}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t}=await ze.find(e,this.context.cwd);return await t.restoreInstallState({restoreResolutions:!1}),await t.applyLightResolution(),typeof this.hash!="undefined"?await R3e(this.hash,t,{stdout:this.context.stdout}):(await Je.start({configuration:e,stdout:this.context.stdout,includeFooter:!1},async n=>{var o;let s=[([,a])=>P.stringifyLocator(t.storedPackages.get(a.subject)),([,a])=>P.stringifyIdent(a.requested)];for(let[a,l]of Se.sortMap(t.peerRequirements,s)){let c=t.storedPackages.get(l.subject);if(typeof c=="undefined")throw new Error("Assertion failed: Expected the subject package to have been registered");let u=t.storedPackages.get(l.rootRequester);if(typeof u=="undefined")throw new Error("Assertion failed: Expected the root package to have been registered");let g=(o=c.dependencies.get(l.requested.identHash))!=null?o:null,f=ae.pretty(e,a,ae.Type.CODE),h=P.prettyLocator(e,c),p=P.prettyIdent(e,l.requested),m=P.prettyIdent(e,u),y=l.allRequesters.length-1,b=`descendant${y===1?"":"s"}`,v=y>0?` and ${y} ${b}`:"",x=g!==null?"provides":"doesn't provide";n.reportInfo(null,`${f} \u2192 ${h} ${x} ${p} to ${m}${v}`)}})).exitCode()}};om.paths=[["explain","peer-requirements"]],om.usage=Re.Usage({description:"explain a set of peer requirements",details:` - A set of peer requirements represents all peer requirements that a dependent must satisfy when providing a given peer request to a requester and its descendants. - - When the hash argument is specified, this command prints a detailed explanation of all requirements of the set corresponding to the hash and whether they're satisfied or not. - - When used without arguments, this command lists all sets of peer requirements and the corresponding hash that can be used to get detailed information about a given set. - - **Note:** A hash is a six-letter p-prefixed code that can be obtained from peer dependency warnings or from the list of all peer requirements (\`yarn explain peer-requirements\`). - `,examples:[["Explain the corresponding set of peer requirements for a hash","$0 explain peer-requirements p1a4ed"],["List all sets of peer requirements","$0 explain peer-requirements"]]});var woe=om;async function R3e(r,e,t){let{configuration:i}=e,n=e.peerRequirements.get(r);if(typeof n=="undefined")throw new Error(`No peerDependency requirements found for hash: "${r}"`);return(await Je.start({configuration:i,stdout:t.stdout,includeFooter:!1},async o=>{var b,v;let a=e.storedPackages.get(n.subject);if(typeof a=="undefined")throw new Error("Assertion failed: Expected the subject package to have been registered");let l=e.storedPackages.get(n.rootRequester);if(typeof l=="undefined")throw new Error("Assertion failed: Expected the root package to have been registered");let c=(b=a.dependencies.get(n.requested.identHash))!=null?b:null,u=c!==null?e.storedResolutions.get(c.descriptorHash):null;if(typeof u=="undefined")throw new Error("Assertion failed: Expected the resolution to have been registered");let g=u!==null?e.storedPackages.get(u):null;if(typeof g=="undefined")throw new Error("Assertion failed: Expected the provided package to have been registered");let f=[...n.allRequesters.values()].map(x=>{let T=e.storedPackages.get(x);if(typeof T=="undefined")throw new Error("Assertion failed: Expected the package to be registered");let q=P.devirtualizeLocator(T),Y=e.storedPackages.get(q.locatorHash);if(typeof Y=="undefined")throw new Error("Assertion failed: Expected the package to be registered");let $=Y.peerDependencies.get(n.requested.identHash);if(typeof $=="undefined")throw new Error("Assertion failed: Expected the peer dependency to be registered");return{pkg:T,peerDependency:$}});if(g!==null){let x=f.every(({peerDependency:T})=>Wt.satisfiesWithPrereleases(g.version,T.range));o.reportInfo(X.UNNAMED,`${P.prettyLocator(i,a)} provides ${P.prettyLocator(i,g)} with version ${P.prettyReference(i,(v=g.version)!=null?v:"")}, which ${x?"satisfies":"doesn't satisfy"} the following requirements:`)}else o.reportInfo(X.UNNAMED,`${P.prettyLocator(i,a)} doesn't provide ${P.prettyIdent(i,n.requested)}, breaking the following requirements:`);o.reportSeparator();let h=ae.mark(i),p=[];for(let{pkg:x,peerDependency:T}of Se.sortMap(f,q=>P.stringifyLocator(q.pkg))){let Y=(g!==null?Wt.satisfiesWithPrereleases(g.version,T.range):!1)?h.Check:h.Cross;p.push({stringifiedLocator:P.stringifyLocator(x),prettyLocator:P.prettyLocator(i,x),prettyRange:P.prettyRange(i,T.range),mark:Y})}let m=Math.max(...p.map(({stringifiedLocator:x})=>x.length)),y=Math.max(...p.map(({prettyRange:x})=>x.length));for(let{stringifiedLocator:x,prettyLocator:T,prettyRange:q,mark:Y}of Se.sortMap(p,({stringifiedLocator:$})=>$))o.reportInfo(null,`${T.padEnd(m+(T.length-x.length)," ")} \u2192 ${q.padEnd(y," ")} ${Y}`);p.length>1&&(o.reportSeparator(),o.reportInfo(X.UNNAMED,`Note: these requirements start with ${P.prettyLocator(e.configuration,l)}`))})).exitCode()}ys();var Boe=ge(ri()),am=class extends Le{constructor(){super(...arguments);this.onlyIfNeeded=J.Boolean("--only-if-needed",!1,{description:"Only lock the Yarn version if it isn't already locked"});this.version=J.String()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins);if(e.get("yarnPath")&&this.onlyIfNeeded)return 0;let t=()=>{if(typeof Ur=="undefined")throw new Pe("The --install flag can only be used without explicit version specifier from the Yarn CLI");return`file://${process.argv[1]}`},i;if(this.version==="self")i=t();else if(this.version==="latest"||this.version==="berry"||this.version==="stable")i=`https://repo.yarnpkg.com/${await Am(e,"stable")}/packages/yarnpkg-cli/bin/yarn.js`;else if(this.version==="canary")i=`https://repo.yarnpkg.com/${await Am(e,"canary")}/packages/yarnpkg-cli/bin/yarn.js`;else if(this.version==="classic")i="https://nightly.yarnpkg.com/latest.js";else if(this.version.match(/^https?:/))i=this.version;else if(this.version.match(/^\.{0,2}[\\/]/)||H.isAbsolute(this.version))i=`file://${H.resolve(this.version)}`;else if(Wt.satisfiesWithPrereleases(this.version,">=2.0.0"))i=`https://repo.yarnpkg.com/${this.version}/packages/yarnpkg-cli/bin/yarn.js`;else if(Wt.satisfiesWithPrereleases(this.version,"^0.x || ^1.x"))i=`https://github.com/yarnpkg/yarn/releases/download/v${this.version}/yarn-${this.version}.js`;else if(Wt.validRange(this.version))i=`https://repo.yarnpkg.com/${await F3e(e,this.version)}/packages/yarnpkg-cli/bin/yarn.js`;else throw new Pe(`Invalid version descriptor "${this.version}"`);return(await Je.start({configuration:e,stdout:this.context.stdout,includeLogs:!this.context.quiet},async s=>{let o="file://",a;i.startsWith(o)?(s.reportInfo(X.UNNAMED,`Downloading ${ae.pretty(e,i,Ri.URL)}`),a=await K.readFilePromise(H.toPortablePath(i.slice(o.length)))):(s.reportInfo(X.UNNAMED,`Retrieving ${ae.pretty(e,i,Ri.PATH)}`),a=await ir.get(i,{configuration:e})),await QN(e,null,a,{report:s})})).exitCode()}};am.paths=[["set","version"]],am.usage=Re.Usage({description:"lock the Yarn version used by the project",details:"\n This command will download a specific release of Yarn directly from the Yarn GitHub repository, will store it inside your project, and will change the `yarnPath` settings from your project `.yarnrc.yml` file to point to the new file.\n\n A very good use case for this command is to enforce the version of Yarn used by the any single member of your team inside a same project - by doing this you ensure that you have control on Yarn upgrades and downgrades (including on your deployment servers), and get rid of most of the headaches related to someone using a slightly different version and getting a different behavior than you.\n\n The version specifier can be:\n\n - a tag:\n - `latest` / `berry` / `stable` -> the most recent stable berry (`>=2.0.0`) release\n - `canary` -> the most recent canary (release candidate) berry (`>=2.0.0`) release\n - `classic` -> the most recent classic (`^0.x || ^1.x`) release\n\n - a semver range (e.g. `2.x`) -> the most recent version satisfying the range (limited to berry releases)\n\n - a semver version (e.g. `2.4.1`, `1.22.1`)\n\n - a local file referenced through either a relative or absolute path\n\n - `self` -> the version used to invoke the command\n ",examples:[["Download the latest release from the Yarn repository","$0 set version latest"],["Download the latest canary release from the Yarn repository","$0 set version canary"],["Download the latest classic release from the Yarn repository","$0 set version classic"],["Download the most recent Yarn 3 build","$0 set version 3.x"],["Download a specific Yarn 2 build","$0 set version 2.0.0-rc.30"],["Switch back to a specific Yarn 1 release","$0 set version 1.22.1"],["Use a release from the local filesystem","$0 set version ./yarn.cjs"],["Use a release from a URL","$0 set version https://repo.yarnpkg.com/3.1.0/packages/yarnpkg-cli/bin/yarn.js"],["Download the version used to invoke the command","$0 set version self"]]});var boe=am;async function F3e(r,e){let i=(await ir.get("https://repo.yarnpkg.com/tags",{configuration:r,jsonResponse:!0})).tags.filter(n=>Wt.satisfiesWithPrereleases(n,e));if(i.length===0)throw new Pe(`No matching release found for range ${ae.pretty(r,e,ae.Type.RANGE)}.`);return i[0]}async function Am(r,e){let t=await ir.get("https://repo.yarnpkg.com/tags",{configuration:r,jsonResponse:!0});if(!t.latest[e])throw new Pe(`Tag ${ae.pretty(r,e,ae.Type.RANGE)} not found`);return t.latest[e]}async function QN(r,e,t,{report:i}){var g;e===null&&await K.mktempPromise(async f=>{let h=k.join(f,"yarn.cjs");await K.writeFilePromise(h,t);let{stdout:p}=await Nr.execvp(process.execPath,[H.fromPortablePath(h),"--version"],{cwd:f,env:te(N({},process.env),{YARN_IGNORE_PATH:"1"})});if(e=p.trim(),!Boe.default.valid(e))throw new Error(`Invalid semver version. ${ae.pretty(r,"yarn --version",ae.Type.CODE)} returned: -${e}`)});let n=(g=r.projectCwd)!=null?g:r.startingCwd,s=k.resolve(n,".yarn/releases"),o=k.resolve(s,`yarn-${e}.cjs`),a=k.relative(r.startingCwd,o),l=k.relative(n,o),c=r.get("yarnPath"),u=c===null||c.startsWith(`${s}/`);if(i.reportInfo(X.UNNAMED,`Saving the new release in ${ae.pretty(r,a,"magenta")}`),await K.removePromise(k.dirname(o)),await K.mkdirPromise(k.dirname(o),{recursive:!0}),await K.writeFilePromise(o,t,{mode:493}),u){await ye.updateConfiguration(n,{yarnPath:l});let f=await At.tryFind(n)||new At;f.packageManager=`yarn@${e&&Se.isTaggedYarnVersion(e)?e:await Am(r,"stable")}`;let h={};f.exportTo(h);let p=k.join(n,At.fileName),m=`${JSON.stringify(h,null,f.indent)} -`;await K.changeFilePromise(p,m,{automaticNewlines:!0})}}function Qoe(r){return X[II(r)]}var N3e=/## (?YN[0-9]{4}) - `(?[A-Z_]+)`\n\n(?
(?:.(?!##))+)/gs;async function L3e(r){let t=`https://repo.yarnpkg.com/${Se.isTaggedYarnVersion(Ur)?Ur:await Am(r,"canary")}/packages/gatsby/content/advanced/error-codes.md`,i=await ir.get(t,{configuration:r});return new Map(Array.from(i.toString().matchAll(N3e),({groups:n})=>{if(!n)throw new Error("Assertion failed: Expected the match to have been successful");let s=Qoe(n.code);if(n.name!==s)throw new Error(`Assertion failed: Invalid error code data: Expected "${n.name}" to be named "${s}"`);return[n.code,n.details]}))}var lm=class extends Le{constructor(){super(...arguments);this.code=J.String({required:!1,validator:fp(gp(),[hp(/^YN[0-9]{4}$/)])});this.json=J.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins);if(typeof this.code!="undefined"){let t=Qoe(this.code),i=ae.pretty(e,t,ae.Type.CODE),n=this.cli.format().header(`${this.code} - ${i}`),o=(await L3e(e)).get(this.code),a=typeof o!="undefined"?ae.jsonOrPretty(this.json,e,ae.tuple(ae.Type.MARKDOWN,{text:o,format:this.cli.format(),paragraphs:!0})):`This error code does not have a description. - -You can help us by editing this page on GitHub \u{1F642}: -${ae.jsonOrPretty(this.json,e,ae.tuple(ae.Type.URL,"https://github.com/yarnpkg/berry/blob/master/packages/gatsby/content/advanced/error-codes.md"))} -`;this.json?this.context.stdout.write(`${JSON.stringify({code:this.code,name:t,details:a})} -`):this.context.stdout.write(`${n} - -${a} -`)}else{let t={children:Se.mapAndFilter(Object.entries(X),([i,n])=>Number.isNaN(Number(i))?Se.mapAndFilter.skip:{label:_A(Number(i)),value:ae.tuple(ae.Type.CODE,n)})};ls.emitTree(t,{configuration:e,stdout:this.context.stdout,json:this.json})}}};lm.paths=[["explain"]],lm.usage=Re.Usage({description:"explain an error code",details:` - When the code argument is specified, this command prints its name and its details. - - When used without arguments, this command lists all error codes and their names. - `,examples:[["Explain an error code","$0 explain YN0006"],["List all error codes","$0 explain"]]});var Soe=lm;var voe=ge(is()),cm=class extends Le{constructor(){super(...arguments);this.all=J.Boolean("-A,--all",!1,{description:"Print versions of a package from the whole project"});this.recursive=J.Boolean("-R,--recursive",!1,{description:"Print information for all packages, including transitive dependencies"});this.extra=J.Array("-X,--extra",[],{description:"An array of requests of extra data provided by plugins"});this.cache=J.Boolean("--cache",!1,{description:"Print information about the cache entry of a package (path, size, checksum)"});this.dependents=J.Boolean("--dependents",!1,{description:"Print all dependents for each matching package"});this.manifest=J.Boolean("--manifest",!1,{description:"Print data obtained by looking at the package archive (license, homepage, ...)"});this.nameOnly=J.Boolean("--name-only",!1,{description:"Only print the name for the matching packages"});this.virtuals=J.Boolean("--virtuals",!1,{description:"Print each instance of the virtual packages"});this.json=J.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.patterns=J.Rest()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,workspace:i}=await ze.find(e,this.context.cwd),n=await Nt.find(e);if(!i&&!this.all)throw new ht(t.cwd,this.context.cwd);await t.restoreInstallState();let s=new Set(this.extra);this.cache&&s.add("cache"),this.dependents&&s.add("dependents"),this.manifest&&s.add("manifest");let o=(x,{recursive:T})=>{let q=x.anchoredLocator.locatorHash,Y=new Map,$=[q];for(;$.length>0;){let _=$.shift();if(Y.has(_))continue;let ne=t.storedPackages.get(_);if(typeof ne=="undefined")throw new Error("Assertion failed: Expected the package to be registered");if(Y.set(_,ne),P.isVirtualLocator(ne)&&$.push(P.devirtualizeLocator(ne).locatorHash),!(!T&&_!==q))for(let ee of ne.dependencies.values()){let A=t.storedResolutions.get(ee.descriptorHash);if(typeof A=="undefined")throw new Error("Assertion failed: Expected the resolution to be registered");$.push(A)}}return Y.values()},a=({recursive:x})=>{let T=new Map;for(let q of t.workspaces)for(let Y of o(q,{recursive:x}))T.set(Y.locatorHash,Y);return T.values()},l=({all:x,recursive:T})=>x&&T?t.storedPackages.values():x?a({recursive:T}):o(i,{recursive:T}),c=({all:x,recursive:T})=>{let q=l({all:x,recursive:T}),Y=this.patterns.map(ne=>{let ee=P.parseLocator(ne),A=voe.default.makeRe(P.stringifyIdent(ee)),oe=P.isVirtualLocator(ee),ce=oe?P.devirtualizeLocator(ee):ee;return Z=>{let O=P.stringifyIdent(Z);if(!A.test(O))return!1;if(ee.reference==="unknown")return!0;let L=P.isVirtualLocator(Z),de=L?P.devirtualizeLocator(Z):Z;return!(oe&&L&&ee.reference!==Z.reference||ce.reference!==de.reference)}}),$=Se.sortMap([...q],ne=>P.stringifyLocator(ne));return{selection:$.filter(ne=>Y.length===0||Y.some(ee=>ee(ne))),sortedLookup:$}},{selection:u,sortedLookup:g}=c({all:this.all,recursive:this.recursive});if(u.length===0)throw new Pe("No package matched your request");let f=new Map;if(this.dependents)for(let x of g)for(let T of x.dependencies.values()){let q=t.storedResolutions.get(T.descriptorHash);if(typeof q=="undefined")throw new Error("Assertion failed: Expected the resolution to be registered");Se.getArrayWithDefault(f,q).push(x)}let h=new Map;for(let x of g){if(!P.isVirtualLocator(x))continue;let T=P.devirtualizeLocator(x);Se.getArrayWithDefault(h,T.locatorHash).push(x)}let p={},m={children:p},y=e.makeFetcher(),b={project:t,fetcher:y,cache:n,checksums:t.storedChecksums,report:new di,cacheOptions:{skipIntegrityCheck:!0},skipIntegrityCheck:!0},v=[async(x,T,q)=>{var _,ne;if(!T.has("manifest"))return;let Y=await y.fetch(x,b),$;try{$=await At.find(Y.prefixPath,{baseFs:Y.packageFs})}finally{(_=Y.releaseFs)==null||_.call(Y)}q("Manifest",{License:ae.tuple(ae.Type.NO_HINT,$.license),Homepage:ae.tuple(ae.Type.URL,(ne=$.raw.homepage)!=null?ne:null)})},async(x,T,q)=>{var A;if(!T.has("cache"))return;let Y={mockedPackages:t.disabledLocators,unstablePackages:t.conditionalLocators},$=(A=t.storedChecksums.get(x.locatorHash))!=null?A:null,_=n.getLocatorPath(x,$,Y),ne;if(_!==null)try{ne=K.statSync(_)}catch{}let ee=typeof ne!="undefined"?[ne.size,ae.Type.SIZE]:void 0;q("Cache",{Checksum:ae.tuple(ae.Type.NO_HINT,$),Path:ae.tuple(ae.Type.PATH,_),Size:ee})}];for(let x of u){let T=P.isVirtualLocator(x);if(!this.virtuals&&T)continue;let q={},Y={value:[x,ae.Type.LOCATOR],children:q};if(p[P.stringifyLocator(x)]=Y,this.nameOnly){delete Y.children;continue}let $=h.get(x.locatorHash);typeof $!="undefined"&&(q.Instances={label:"Instances",value:ae.tuple(ae.Type.NUMBER,$.length)}),q.Version={label:"Version",value:ae.tuple(ae.Type.NO_HINT,x.version)};let _=(ee,A)=>{let oe={};if(q[ee]=oe,Array.isArray(A))oe.children=A.map(ce=>({value:ce}));else{let ce={};oe.children=ce;for(let[Z,O]of Object.entries(A))typeof O!="undefined"&&(ce[Z]={label:Z,value:O})}};if(!T){for(let ee of v)await ee(x,s,_);await e.triggerHook(ee=>ee.fetchPackageInfo,x,s,_)}x.bin.size>0&&!T&&_("Exported Binaries",[...x.bin.keys()].map(ee=>ae.tuple(ae.Type.PATH,ee)));let ne=f.get(x.locatorHash);typeof ne!="undefined"&&ne.length>0&&_("Dependents",ne.map(ee=>ae.tuple(ae.Type.LOCATOR,ee))),x.dependencies.size>0&&!T&&_("Dependencies",[...x.dependencies.values()].map(ee=>{var ce;let A=t.storedResolutions.get(ee.descriptorHash),oe=typeof A!="undefined"&&(ce=t.storedPackages.get(A))!=null?ce:null;return ae.tuple(ae.Type.RESOLUTION,{descriptor:ee,locator:oe})})),x.peerDependencies.size>0&&T&&_("Peer dependencies",[...x.peerDependencies.values()].map(ee=>{var Z,O;let A=x.dependencies.get(ee.identHash),oe=typeof A!="undefined"&&(Z=t.storedResolutions.get(A.descriptorHash))!=null?Z:null,ce=oe!==null&&(O=t.storedPackages.get(oe))!=null?O:null;return ae.tuple(ae.Type.RESOLUTION,{descriptor:ee,locator:ce})}))}ls.emitTree(m,{configuration:e,json:this.json,stdout:this.context.stdout,separators:this.nameOnly?0:2})}};cm.paths=[["info"]],cm.usage=Re.Usage({description:"see information related to packages",details:"\n This command prints various information related to the specified packages, accepting glob patterns.\n\n By default, if the locator reference is missing, Yarn will default to print the information about all the matching direct dependencies of the package for the active workspace. To instead print all versions of the package that are direct dependencies of any of your workspaces, use the `-A,--all` flag. Adding the `-R,--recursive` flag will also report transitive dependencies.\n\n Some fields will be hidden by default in order to keep the output readable, but can be selectively displayed by using additional options (`--dependents`, `--manifest`, `--virtuals`, ...) described in the option descriptions.\n\n Note that this command will only print the information directly related to the selected packages - if you wish to know why the package is there in the first place, use `yarn why` which will do just that (it also provides a `-R,--recursive` flag that may be of some help).\n ",examples:[["Show information about Lodash","$0 info lodash"]]});var xoe=cm;var _0=ge(Ic());ys();var um=class extends Le{constructor(){super(...arguments);this.json=J.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.immutable=J.Boolean("--immutable",{description:"Abort with an error exit code if the lockfile was to be modified"});this.immutableCache=J.Boolean("--immutable-cache",{description:"Abort with an error exit code if the cache folder was to be modified"});this.checkCache=J.Boolean("--check-cache",!1,{description:"Always refetch the packages and ensure that their checksums are consistent"});this.inlineBuilds=J.Boolean("--inline-builds",{description:"Verbosely print the output of the build steps of dependencies"});this.mode=J.String("--mode",{description:"Change what artifacts installs generate",validator:nn(Ci)});this.cacheFolder=J.String("--cache-folder",{hidden:!0});this.frozenLockfile=J.Boolean("--frozen-lockfile",{hidden:!0});this.ignoreEngines=J.Boolean("--ignore-engines",{hidden:!0});this.nonInteractive=J.Boolean("--non-interactive",{hidden:!0});this.preferOffline=J.Boolean("--prefer-offline",{hidden:!0});this.production=J.Boolean("--production",{hidden:!0});this.registry=J.String("--registry",{hidden:!0});this.silent=J.Boolean("--silent",{hidden:!0});this.networkTimeout=J.String("--network-timeout",{hidden:!0})}async execute(){var g;let e=await ye.find(this.context.cwd,this.context.plugins);typeof this.inlineBuilds!="undefined"&&e.useWithSource("",{enableInlineBuilds:this.inlineBuilds},e.startingCwd,{overwrite:!0});let t=!!process.env.FUNCTION_TARGET||!!process.env.GOOGLE_RUNTIME,i=async(f,{error:h})=>{let p=await Je.start({configuration:e,stdout:this.context.stdout,includeFooter:!1},async m=>{h?m.reportError(X.DEPRECATED_CLI_SETTINGS,f):m.reportWarning(X.DEPRECATED_CLI_SETTINGS,f)});return p.hasErrors()?p.exitCode():null};if(typeof this.ignoreEngines!="undefined"){let f=await i("The --ignore-engines option is deprecated; engine checking isn't a core feature anymore",{error:!_0.default.VERCEL});if(f!==null)return f}if(typeof this.registry!="undefined"){let f=await i("The --registry option is deprecated; prefer setting npmRegistryServer in your .yarnrc.yml file",{error:!1});if(f!==null)return f}if(typeof this.preferOffline!="undefined"){let f=await i("The --prefer-offline flag is deprecated; use the --cached flag with 'yarn add' instead",{error:!_0.default.VERCEL});if(f!==null)return f}if(typeof this.production!="undefined"){let f=await i("The --production option is deprecated on 'install'; use 'yarn workspaces focus' instead",{error:!0});if(f!==null)return f}if(typeof this.nonInteractive!="undefined"){let f=await i("The --non-interactive option is deprecated",{error:!t});if(f!==null)return f}if(typeof this.frozenLockfile!="undefined"&&(await i("The --frozen-lockfile option is deprecated; use --immutable and/or --immutable-cache instead",{error:!1}),this.immutable=this.frozenLockfile),typeof this.cacheFolder!="undefined"){let f=await i("The cache-folder option has been deprecated; use rc settings instead",{error:!_0.default.NETLIFY});if(f!==null)return f}let n=this.mode===Ci.UpdateLockfile;if(n&&(this.immutable||this.immutableCache))throw new Pe(`${ae.pretty(e,"--immutable",ae.Type.CODE)} and ${ae.pretty(e,"--immutable-cache",ae.Type.CODE)} cannot be used with ${ae.pretty(e,"--mode=update-lockfile",ae.Type.CODE)}`);let s=((g=this.immutable)!=null?g:e.get("enableImmutableInstalls"))&&!n,o=this.immutableCache&&!n;if(e.projectCwd!==null){let f=await Je.start({configuration:e,json:this.json,stdout:this.context.stdout,includeFooter:!1},async h=>{await T3e(e,s)&&(h.reportInfo(X.AUTOMERGE_SUCCESS,"Automatically fixed merge conflicts \u{1F44D}"),h.reportSeparator())});if(f.hasErrors())return f.exitCode()}if(e.projectCwd!==null&&typeof e.sources.get("nodeLinker")=="undefined"){let f=e.projectCwd,h;try{h=await K.readFilePromise(k.join(f,kt.lockfile),"utf8")}catch{}if(h==null?void 0:h.includes("yarn lockfile v1")){let p=await Je.start({configuration:e,json:this.json,stdout:this.context.stdout,includeFooter:!1},async m=>{m.reportInfo(X.AUTO_NM_SUCCESS,"Migrating from Yarn 1; automatically enabling the compatibility node-modules linker \u{1F44D}"),m.reportSeparator(),e.use("",{nodeLinker:"node-modules"},f,{overwrite:!0}),await ye.updateConfiguration(f,{nodeLinker:"node-modules"})});if(p.hasErrors())return p.exitCode()}}if(e.projectCwd!==null){let f=await Je.start({configuration:e,json:this.json,stdout:this.context.stdout,includeFooter:!1},async h=>{var p;((p=ye.telemetry)==null?void 0:p.isNew)&&(h.reportInfo(X.TELEMETRY_NOTICE,"Yarn will periodically gather anonymous telemetry: https://yarnpkg.com/advanced/telemetry"),h.reportInfo(X.TELEMETRY_NOTICE,`Run ${ae.pretty(e,"yarn config set --home enableTelemetry 0",ae.Type.CODE)} to disable`),h.reportSeparator())});if(f.hasErrors())return f.exitCode()}let{project:a,workspace:l}=await ze.find(e,this.context.cwd),c=await Nt.find(e,{immutable:o,check:this.checkCache});if(!l)throw new ht(a.cwd,this.context.cwd);return await a.restoreInstallState({restoreResolutions:!1}),(await Je.start({configuration:e,json:this.json,stdout:this.context.stdout,includeLogs:!0},async f=>{await a.install({cache:c,report:f,immutable:s,mode:this.mode})})).exitCode()}};um.paths=[["install"],Re.Default],um.usage=Re.Usage({description:"install the project dependencies",details:` - This command sets up your project if needed. The installation is split into four different steps that each have their own characteristics: - - - **Resolution:** First the package manager will resolve your dependencies. The exact way a dependency version is privileged over another isn't standardized outside of the regular semver guarantees. If a package doesn't resolve to what you would expect, check that all dependencies are correctly declared (also check our website for more information: ). - - - **Fetch:** Then we download all the dependencies if needed, and make sure that they're all stored within our cache (check the value of \`cacheFolder\` in \`yarn config\` to see where the cache files are stored). - - - **Link:** Then we send the dependency tree information to internal plugins tasked with writing them on the disk in some form (for example by generating the .pnp.cjs file you might know). - - - **Build:** Once the dependency tree has been written on the disk, the package manager will now be free to run the build scripts for all packages that might need it, in a topological order compatible with the way they depend on one another. See https://yarnpkg.com/advanced/lifecycle-scripts for detail. - - Note that running this command is not part of the recommended workflow. Yarn supports zero-installs, which means that as long as you store your cache and your .pnp.cjs file inside your repository, everything will work without requiring any install right after cloning your repository or switching branches. - - If the \`--immutable\` option is set (defaults to true on CI), Yarn will abort with an error exit code if the lockfile was to be modified (other paths can be added using the \`immutablePatterns\` configuration setting). For backward compatibility we offer an alias under the name of \`--frozen-lockfile\`, but it will be removed in a later release. - - If the \`--immutable-cache\` option is set, Yarn will abort with an error exit code if the cache folder was to be modified (either because files would be added, or because they'd be removed). - - If the \`--check-cache\` option is set, Yarn will always refetch the packages and will ensure that their checksum matches what's 1/ described in the lockfile 2/ inside the existing cache files (if present). This is recommended as part of your CI workflow if you're both following the Zero-Installs model and accepting PRs from third-parties, as they'd otherwise have the ability to alter the checked-in packages before submitting them. - - If the \`--inline-builds\` option is set, Yarn will verbosely print the output of the build steps of your dependencies (instead of writing them into individual files). This is likely useful mostly for debug purposes only when using Docker-like environments. - - If the \`--mode=\` option is set, Yarn will change which artifacts are generated. The modes currently supported are: - - - \`skip-build\` will not run the build scripts at all. Note that this is different from setting \`enableScripts\` to false because the later will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run. - - - \`update-lockfile\` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost. - `,examples:[["Install the project","$0 install"],["Validate a project when using Zero-Installs","$0 install --immutable --immutable-cache"],["Validate a project when using Zero-Installs (slightly safer if you accept external PRs)","$0 install --immutable --immutable-cache --check-cache"]]});var koe=um,O3e="|||||||",M3e=">>>>>>>",K3e="=======",Poe="<<<<<<<";async function T3e(r,e){if(!r.projectCwd)return!1;let t=k.join(r.projectCwd,r.get("lockfileFilename"));if(!await K.existsPromise(t))return!1;let i=await K.readFilePromise(t,"utf8");if(!i.includes(Poe))return!1;if(e)throw new ct(X.AUTOMERGE_IMMUTABLE,"Cannot autofix a lockfile when running an immutable install");let[n,s]=U3e(i),o,a;try{o=Si(n),a=Si(s)}catch(c){throw new ct(X.AUTOMERGE_FAILED_TO_PARSE,"The individual variants of the lockfile failed to parse")}let l=N(N({},o),a);for(let[c,u]of Object.entries(l))typeof u=="string"&&delete l[c];return await K.changeFilePromise(t,Ma(l),{automaticNewlines:!0}),!0}function U3e(r){let e=[[],[]],t=r.split(/\r?\n/g),i=!1;for(;t.length>0;){let n=t.shift();if(typeof n=="undefined")throw new Error("Assertion failed: Some lines should remain");if(n.startsWith(Poe)){for(;t.length>0;){let s=t.shift();if(typeof s=="undefined")throw new Error("Assertion failed: Some lines should remain");if(s===K3e){i=!1;break}else if(i||s.startsWith(O3e)){i=!0;continue}else e[0].push(s)}for(;t.length>0;){let s=t.shift();if(typeof s=="undefined")throw new Error("Assertion failed: Some lines should remain");if(s.startsWith(M3e))break;e[1].push(s)}}else e[0].push(n),e[1].push(n)}return[e[0].join(` -`),e[1].join(` -`)]}var gm=class extends Le{constructor(){super(...arguments);this.all=J.Boolean("-A,--all",!1,{description:"Link all workspaces belonging to the target project to the current one"});this.private=J.Boolean("-p,--private",!1,{description:"Also link private workspaces belonging to the target project to the current one"});this.relative=J.Boolean("-r,--relative",!1,{description:"Link workspaces using relative paths instead of absolute paths"});this.destination=J.String()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,workspace:i}=await ze.find(e,this.context.cwd),n=await Nt.find(e);if(!i)throw new ht(t.cwd,this.context.cwd);await t.restoreInstallState({restoreResolutions:!1});let s=k.resolve(this.context.cwd,H.toPortablePath(this.destination)),o=await ye.find(s,this.context.plugins,{useRc:!1,strict:!1}),{project:a,workspace:l}=await ze.find(o,s);if(t.cwd===a.cwd)throw new Pe("Invalid destination; Can't link the project to itself");if(!l)throw new ht(a.cwd,s);let c=t.topLevelWorkspace,u=[];if(this.all){for(let f of a.workspaces)f.manifest.name&&(!f.manifest.private||this.private)&&u.push(f);if(u.length===0)throw new Pe("No workspace found to be linked in the target project")}else{if(!l.manifest.name)throw new Pe("The target workspace doesn't have a name and thus cannot be linked");if(l.manifest.private&&!this.private)throw new Pe("The target workspace is marked private - use the --private flag to link it anyway");u.push(l)}for(let f of u){let h=P.stringifyIdent(f.locator),p=this.relative?k.relative(t.cwd,f.cwd):f.cwd;c.manifest.resolutions.push({pattern:{descriptor:{fullName:h}},reference:`portal:${p}`})}return(await Je.start({configuration:e,stdout:this.context.stdout},async f=>{await t.install({cache:n,report:f})})).exitCode()}};gm.paths=[["link"]],gm.usage=Re.Usage({description:"connect the local project to another one",details:"\n This command will set a new `resolutions` field in the project-level manifest and point it to the workspace at the specified location (even if part of another project).\n ",examples:[["Register a remote workspace for use in the current project","$0 link ~/ts-loader"],["Register all workspaces from a remote project for use in the current project","$0 link ~/jest --all"]]});var Doe=gm;var fm=class extends Le{constructor(){super(...arguments);this.args=J.Proxy()}async execute(){return this.cli.run(["exec","node",...this.args])}};fm.paths=[["node"]],fm.usage=Re.Usage({description:"run node with the hook already setup",details:` - This command simply runs Node. It also makes sure to call it in a way that's compatible with the current project (for example, on PnP projects the environment will be setup in such a way that PnP will be correctly injected into the environment). - - The Node process will use the exact same version of Node as the one used to run Yarn itself, which might be a good way to ensure that your commands always use a consistent Node version. - `,examples:[["Run a Node script","$0 node ./my-script.js"]]});var Roe=fm;var Hoe=ge(require("os"));var Noe=ge(require("os"));var H3e="https://raw.githubusercontent.com/yarnpkg/berry/master/plugins.yml";async function bu(r){let e=await ir.get(H3e,{configuration:r});return Si(e.toString())}var hm=class extends Le{constructor(){super(...arguments);this.json=J.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins);return(await Je.start({configuration:e,json:this.json,stdout:this.context.stdout},async i=>{let n=await bu(e);for(let s of Object.entries(n)){let[l,o]=s,a=o,{experimental:c}=a,u=Or(a,["experimental"]);let g=l;c&&(g+=" [experimental]"),i.reportJson(N({name:l,experimental:c},u)),i.reportInfo(null,g)}})).exitCode()}};hm.paths=[["plugin","list"]],hm.usage=Re.Usage({category:"Plugin-related commands",description:"list the available official plugins",details:"\n This command prints the plugins available directly from the Yarn repository. Only those plugins can be referenced by name in `yarn plugin import`.\n ",examples:[["List the official plugins","$0 plugin list"]]});var Foe=hm;var j3e=/^[0-9]+$/;function Loe(r){return j3e.test(r)?`pull/${r}/head`:r}var G3e=({repository:r,branch:e},t)=>[["git","init",H.fromPortablePath(t)],["git","remote","add","origin",r],["git","fetch","origin","--depth=1",Loe(e)],["git","reset","--hard","FETCH_HEAD"]],Y3e=({branch:r})=>[["git","fetch","origin","--depth=1",Loe(r),"--force"],["git","reset","--hard","FETCH_HEAD"],["git","clean","-dfx"]],q3e=({plugins:r,noMinify:e},t)=>[["yarn","build:cli",...new Array().concat(...r.map(i=>["--plugin",k.resolve(t,i)])),...e?["--no-minify"]:[],"|"]],pm=class extends Le{constructor(){super(...arguments);this.installPath=J.String("--path",{description:"The path where the repository should be cloned to"});this.repository=J.String("--repository","https://github.com/yarnpkg/berry.git",{description:"The repository that should be cloned"});this.branch=J.String("--branch","master",{description:"The branch of the repository that should be cloned"});this.plugins=J.Array("--plugin",[],{description:"An array of additional plugins that should be included in the bundle"});this.noMinify=J.Boolean("--no-minify",!1,{description:"Build a bundle for development (debugging) - non-minified and non-mangled"});this.force=J.Boolean("-f,--force",!1,{description:"Always clone the repository instead of trying to fetch the latest commits"});this.skipPlugins=J.Boolean("--skip-plugins",!1,{description:"Skip updating the contrib plugins"})}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t}=await ze.find(e,this.context.cwd),i=typeof this.installPath!="undefined"?k.resolve(this.context.cwd,H.toPortablePath(this.installPath)):k.resolve(H.toPortablePath((0,Noe.tmpdir)()),"yarnpkg-sources",Dn.makeHash(this.repository).slice(0,6));return(await Je.start({configuration:e,stdout:this.context.stdout},async s=>{await vN(this,{configuration:e,report:s,target:i}),s.reportSeparator(),s.reportInfo(X.UNNAMED,"Building a fresh bundle"),s.reportSeparator(),await dm(q3e(this,i),{configuration:e,context:this.context,target:i}),s.reportSeparator();let o=k.resolve(i,"packages/yarnpkg-cli/bundles/yarn.js"),a=await K.readFilePromise(o);await QN(e,"sources",a,{report:s}),this.skipPlugins||await J3e(this,{project:t,report:s,target:i})})).exitCode()}};pm.paths=[["set","version","from","sources"]],pm.usage=Re.Usage({description:"build Yarn from master",details:` - This command will clone the Yarn repository into a temporary folder, then build it. The resulting bundle will then be copied into the local project. - - By default, it also updates all contrib plugins to the same commit the bundle is built from. This behavior can be disabled by using the \`--skip-plugins\` flag. - `,examples:[["Build Yarn from master","$0 set version from sources"]]});var Toe=pm;async function dm(r,{configuration:e,context:t,target:i}){for(let[n,...s]of r){let o=s[s.length-1]==="|";if(o&&s.pop(),o)await Nr.pipevp(n,s,{cwd:i,stdin:t.stdin,stdout:t.stdout,stderr:t.stderr,strict:!0});else{t.stdout.write(`${ae.pretty(e,` $ ${[n,...s].join(" ")}`,"grey")} -`);try{await Nr.execvp(n,s,{cwd:i,strict:!0})}catch(a){throw t.stdout.write(a.stdout||a.stack),a}}}}async function vN(r,{configuration:e,report:t,target:i}){let n=!1;if(!r.force&&K.existsSync(k.join(i,".git"))){t.reportInfo(X.UNNAMED,"Fetching the latest commits"),t.reportSeparator();try{await dm(Y3e(r),{configuration:e,context:r.context,target:i}),n=!0}catch(s){t.reportSeparator(),t.reportWarning(X.UNNAMED,"Repository update failed; we'll try to regenerate it")}}n||(t.reportInfo(X.UNNAMED,"Cloning the remote repository"),t.reportSeparator(),await K.removePromise(i),await K.mkdirPromise(i,{recursive:!0}),await dm(G3e(r,i),{configuration:e,context:r.context,target:i}))}async function J3e(r,{project:e,report:t,target:i}){let n=await bu(e.configuration),s=new Set(Object.keys(n));for(let o of e.configuration.plugins.keys())!s.has(o)||await SN(o,r,{project:e,report:t,target:i})}var Ooe=ge(ri()),Moe=ge(require("url")),Koe=ge(require("vm"));var Cm=class extends Le{constructor(){super(...arguments);this.name=J.String()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins);return(await Je.start({configuration:e,stdout:this.context.stdout},async i=>{let{project:n}=await ze.find(e,this.context.cwd),s,o;if(this.name.match(/^\.{0,2}[\\/]/)||H.isAbsolute(this.name)){let a=k.resolve(this.context.cwd,H.toPortablePath(this.name));i.reportInfo(X.UNNAMED,`Reading ${ae.pretty(e,a,ae.Type.PATH)}`),s=k.relative(n.cwd,a),o=await K.readFilePromise(a)}else{let a;if(this.name.match(/^https?:/)){try{new Moe.URL(this.name)}catch{throw new ct(X.INVALID_PLUGIN_REFERENCE,`Plugin specifier "${this.name}" is neither a plugin name nor a valid url`)}s=this.name,a=this.name}else{let l=P.parseLocator(this.name.replace(/^((@yarnpkg\/)?plugin-)?/,"@yarnpkg/plugin-"));if(l.reference!=="unknown"&&!Ooe.default.valid(l.reference))throw new ct(X.UNNAMED,"Official plugins only accept strict version references. Use an explicit URL if you wish to download them from another location.");let c=P.stringifyIdent(l),u=await bu(e);if(!Object.prototype.hasOwnProperty.call(u,c))throw new ct(X.PLUGIN_NAME_NOT_FOUND,`Couldn't find a plugin named "${c}" on the remote registry. Note that only the plugins referenced on our website (https://github.com/yarnpkg/berry/blob/master/plugins.yml) can be referenced by their name; any other plugin will have to be referenced through its public url (for example https://github.com/yarnpkg/berry/raw/master/packages/plugin-typescript/bin/%40yarnpkg/plugin-typescript.js).`);s=c,a=u[c].url,l.reference!=="unknown"?a=a.replace(/\/master\//,`/${c}/${l.reference}/`):Ur!==null&&(a=a.replace(/\/master\//,`/@yarnpkg/cli/${Ur}/`))}i.reportInfo(X.UNNAMED,`Downloading ${ae.pretty(e,a,"green")}`),o=await ir.get(a,{configuration:e})}await xN(s,o,{project:n,report:i})})).exitCode()}};Cm.paths=[["plugin","import"]],Cm.usage=Re.Usage({category:"Plugin-related commands",description:"download a plugin",details:` - This command downloads the specified plugin from its remote location and updates the configuration to reference it in further CLI invocations. - - Three types of plugin references are accepted: - - - If the plugin is stored within the Yarn repository, it can be referenced by name. - - Third-party plugins can be referenced directly through their public urls. - - Local plugins can be referenced by their path on the disk. - - Plugins cannot be downloaded from the npm registry, and aren't allowed to have dependencies (they need to be bundled into a single file, possibly thanks to the \`@yarnpkg/builder\` package). - `,examples:[['Download and activate the "@yarnpkg/plugin-exec" plugin',"$0 plugin import @yarnpkg/plugin-exec"],['Download and activate the "@yarnpkg/plugin-exec" plugin (shorthand)',"$0 plugin import exec"],["Download and activate a community plugin","$0 plugin import https://example.org/path/to/plugin.js"],["Activate a local plugin","$0 plugin import ./path/to/plugin.js"]]});var Uoe=Cm;async function xN(r,e,{project:t,report:i}){let{configuration:n}=t,s={},o={exports:s};(0,Koe.runInNewContext)(e.toString(),{module:o,exports:s});let a=o.exports.name,l=`.yarn/plugins/${a}.cjs`,c=k.resolve(t.cwd,l);i.reportInfo(X.UNNAMED,`Saving the new plugin in ${ae.pretty(n,l,"magenta")}`),await K.mkdirPromise(k.dirname(c),{recursive:!0}),await K.writeFilePromise(c,e);let u={path:l,spec:r};await ye.updateConfiguration(t.cwd,g=>{let f=[],h=!1;for(let p of g.plugins||[]){let m=typeof p!="string"?p.path:p,y=k.resolve(t.cwd,H.toPortablePath(m)),{name:b}=Se.dynamicRequire(y);b!==a?f.push(p):(f.push(u),h=!0)}return h||f.push(u),te(N({},g),{plugins:f})})}var W3e=({pluginName:r,noMinify:e},t)=>[["yarn",`build:${r}`,...e?["--no-minify"]:[],"|"]],mm=class extends Le{constructor(){super(...arguments);this.installPath=J.String("--path",{description:"The path where the repository should be cloned to"});this.repository=J.String("--repository","https://github.com/yarnpkg/berry.git",{description:"The repository that should be cloned"});this.branch=J.String("--branch","master",{description:"The branch of the repository that should be cloned"});this.noMinify=J.Boolean("--no-minify",!1,{description:"Build a plugin for development (debugging) - non-minified and non-mangled"});this.force=J.Boolean("-f,--force",!1,{description:"Always clone the repository instead of trying to fetch the latest commits"});this.name=J.String()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),t=typeof this.installPath!="undefined"?k.resolve(this.context.cwd,H.toPortablePath(this.installPath)):k.resolve(H.toPortablePath((0,Hoe.tmpdir)()),"yarnpkg-sources",Dn.makeHash(this.repository).slice(0,6));return(await Je.start({configuration:e,stdout:this.context.stdout},async n=>{let{project:s}=await ze.find(e,this.context.cwd),o=P.parseIdent(this.name.replace(/^((@yarnpkg\/)?plugin-)?/,"@yarnpkg/plugin-")),a=P.stringifyIdent(o),l=await bu(e);if(!Object.prototype.hasOwnProperty.call(l,a))throw new ct(X.PLUGIN_NAME_NOT_FOUND,`Couldn't find a plugin named "${a}" on the remote registry. Note that only the plugins referenced on our website (https://github.com/yarnpkg/berry/blob/master/plugins.yml) can be built and imported from sources.`);let c=a;await vN(this,{configuration:e,report:n,target:t}),await SN(c,this,{project:s,report:n,target:t})})).exitCode()}};mm.paths=[["plugin","import","from","sources"]],mm.usage=Re.Usage({category:"Plugin-related commands",description:"build a plugin from sources",details:` - This command clones the Yarn repository into a temporary folder, builds the specified contrib plugin and updates the configuration to reference it in further CLI invocations. - - The plugins can be referenced by their short name if sourced from the official Yarn repository. - `,examples:[['Build and activate the "@yarnpkg/plugin-exec" plugin',"$0 plugin import from sources @yarnpkg/plugin-exec"],['Build and activate the "@yarnpkg/plugin-exec" plugin (shorthand)',"$0 plugin import from sources exec"]]});var joe=mm;async function SN(r,{context:e,noMinify:t},{project:i,report:n,target:s}){let o=r.replace(/@yarnpkg\//,""),{configuration:a}=i;n.reportSeparator(),n.reportInfo(X.UNNAMED,`Building a fresh ${o}`),n.reportSeparator(),await dm(W3e({pluginName:o,noMinify:t},s),{configuration:a,context:e,target:s}),n.reportSeparator();let l=k.resolve(s,`packages/${o}/bundles/${r}.js`),c=await K.readFilePromise(l);await xN(r,c,{project:i,report:n})}var Em=class extends Le{constructor(){super(...arguments);this.name=J.String()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t}=await ze.find(e,this.context.cwd);return(await Je.start({configuration:e,stdout:this.context.stdout},async n=>{let s=this.name,o=P.parseIdent(s);if(!e.plugins.has(s))throw new Pe(`${P.prettyIdent(e,o)} isn't referenced by the current configuration`);let a=`.yarn/plugins/${s}.cjs`,l=k.resolve(t.cwd,a);K.existsSync(l)&&(n.reportInfo(X.UNNAMED,`Removing ${ae.pretty(e,a,ae.Type.PATH)}...`),await K.removePromise(l)),n.reportInfo(X.UNNAMED,"Updating the configuration..."),await ye.updateConfiguration(t.cwd,c=>{if(!Array.isArray(c.plugins))return c;let u=c.plugins.filter(g=>g.path!==a);return c.plugins.length===u.length?c:te(N({},c),{plugins:u})})})).exitCode()}};Em.paths=[["plugin","remove"]],Em.usage=Re.Usage({category:"Plugin-related commands",description:"remove a plugin",details:` - This command deletes the specified plugin from the .yarn/plugins folder and removes it from the configuration. - - **Note:** The plugins have to be referenced by their name property, which can be obtained using the \`yarn plugin runtime\` command. Shorthands are not allowed. - `,examples:[["Remove a plugin imported from the Yarn repository","$0 plugin remove @yarnpkg/plugin-typescript"],["Remove a plugin imported from a local file","$0 plugin remove my-local-plugin"]]});var Goe=Em;var Im=class extends Le{constructor(){super(...arguments);this.json=J.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins);return(await Je.start({configuration:e,json:this.json,stdout:this.context.stdout},async i=>{for(let n of e.plugins.keys()){let s=this.context.plugins.plugins.has(n),o=n;s&&(o+=" [builtin]"),i.reportJson({name:n,builtin:s}),i.reportInfo(null,`${o}`)}})).exitCode()}};Im.paths=[["plugin","runtime"]],Im.usage=Re.Usage({category:"Plugin-related commands",description:"list the active plugins",details:` - This command prints the currently active plugins. Will be displayed both builtin plugins and external plugins. - `,examples:[["List the currently active plugins","$0 plugin runtime"]]});var Yoe=Im;var ym=class extends Le{constructor(){super(...arguments);this.idents=J.Rest()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,workspace:i}=await ze.find(e,this.context.cwd),n=await Nt.find(e);if(!i)throw new ht(t.cwd,this.context.cwd);let s=new Set;for(let a of this.idents)s.add(P.parseIdent(a).identHash);if(await t.restoreInstallState({restoreResolutions:!1}),await t.resolveEverything({cache:n,report:new di}),s.size>0)for(let a of t.storedPackages.values())s.has(a.identHash)&&t.storedBuildState.delete(a.locatorHash);else t.storedBuildState.clear();return(await Je.start({configuration:e,stdout:this.context.stdout,includeLogs:!this.context.quiet},async a=>{await t.install({cache:n,report:a})})).exitCode()}};ym.paths=[["rebuild"]],ym.usage=Re.Usage({description:"rebuild the project's native packages",details:` - This command will automatically cause Yarn to forget about previous compilations of the given packages and to run them again. - - Note that while Yarn forgets the compilation, the previous artifacts aren't erased from the filesystem and may affect the next builds (in good or bad). To avoid this, you may remove the .yarn/unplugged folder, or any other relevant location where packages might have been stored (Yarn may offer a way to do that automatically in the future). - - By default all packages will be rebuilt, but you can filter the list by specifying the names of the packages you want to clear from memory. - `,examples:[["Rebuild all packages","$0 rebuild"],["Rebuild fsevents only","$0 rebuild fsevents"]]});var qoe=ym;var kN=ge(is());ys();var wm=class extends Le{constructor(){super(...arguments);this.all=J.Boolean("-A,--all",!1,{description:"Apply the operation to all workspaces from the current project"});this.mode=J.String("--mode",{description:"Change what artifacts installs generate",validator:nn(Ci)});this.patterns=J.Rest()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,workspace:i}=await ze.find(e,this.context.cwd),n=await Nt.find(e);if(!i)throw new ht(t.cwd,this.context.cwd);await t.restoreInstallState({restoreResolutions:!1});let s=this.all?t.workspaces:[i],o=[Hr.REGULAR,Hr.DEVELOPMENT,Hr.PEER],a=[],l=!1,c=[];for(let h of this.patterns){let p=!1,m=P.parseIdent(h);for(let y of s){let b=[...y.manifest.peerDependenciesMeta.keys()];for(let v of(0,kN.default)(b,h))y.manifest.peerDependenciesMeta.delete(v),l=!0,p=!0;for(let v of o){let x=y.manifest.getForScope(v),T=[...x.values()].map(q=>P.stringifyIdent(q));for(let q of(0,kN.default)(T,P.stringifyIdent(m))){let{identHash:Y}=P.parseIdent(q),$=x.get(Y);if(typeof $=="undefined")throw new Error("Assertion failed: Expected the descriptor to be registered");y.manifest[v].delete(Y),c.push([y,v,$]),l=!0,p=!0}}}p||a.push(h)}let u=a.length>1?"Patterns":"Pattern",g=a.length>1?"don't":"doesn't",f=this.all?"any":"this";if(a.length>0)throw new Pe(`${u} ${ae.prettyList(e,a,Ri.CODE)} ${g} match any packages referenced by ${f} workspace`);return l?(await e.triggerMultipleHooks(p=>p.afterWorkspaceDependencyRemoval,c),(await Je.start({configuration:e,stdout:this.context.stdout},async p=>{await t.install({cache:n,report:p,mode:this.mode})})).exitCode()):0}};wm.paths=[["remove"]],wm.usage=Re.Usage({description:"remove dependencies from the project",details:` - This command will remove the packages matching the specified patterns from the current workspace. - - If the \`--mode=\` option is set, Yarn will change which artifacts are generated. The modes currently supported are: - - - \`skip-build\` will not run the build scripts at all. Note that this is different from setting \`enableScripts\` to false because the later will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run. - - - \`update-lockfile\` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost. - - This command accepts glob patterns as arguments (if valid Idents and supported by [micromatch](https://github.com/micromatch/micromatch)). Make sure to escape the patterns, to prevent your own shell from trying to expand them. - `,examples:[["Remove a dependency from the current project","$0 remove lodash"],["Remove a dependency from all workspaces at once","$0 remove lodash --all"],["Remove all dependencies starting with `eslint-`","$0 remove 'eslint-*'"],["Remove all dependencies with the `@babel` scope","$0 remove '@babel/*'"],["Remove all dependencies matching `react-dom` or `react-helmet`","$0 remove 'react-{dom,helmet}'"]]});var Joe=wm;var Woe=ge(require("util")),V0=class extends Le{async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,workspace:i}=await ze.find(e,this.context.cwd);if(!i)throw new ht(t.cwd,this.context.cwd);return(await Je.start({configuration:e,stdout:this.context.stdout},async s=>{let o=i.manifest.scripts,a=Se.sortMap(o.keys(),u=>u),l={breakLength:Infinity,colors:e.get("enableColors"),maxArrayLength:2},c=a.reduce((u,g)=>Math.max(u,g.length),0);for(let[u,g]of o.entries())s.reportInfo(null,`${u.padEnd(c," ")} ${(0,Woe.inspect)(g,l)}`)})).exitCode()}};V0.paths=[["run"]];var zoe=V0;var Bm=class extends Le{constructor(){super(...arguments);this.inspect=J.String("--inspect",!1,{tolerateBoolean:!0,description:"Forwarded to the underlying Node process when executing a binary"});this.inspectBrk=J.String("--inspect-brk",!1,{tolerateBoolean:!0,description:"Forwarded to the underlying Node process when executing a binary"});this.topLevel=J.Boolean("-T,--top-level",!1,{description:"Check the root workspace for scripts and/or binaries instead of the current one"});this.binariesOnly=J.Boolean("-B,--binaries-only",!1,{description:"Ignore any user defined scripts and only check for binaries"});this.silent=J.Boolean("--silent",{hidden:!0});this.scriptName=J.String();this.args=J.Proxy()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,workspace:i,locator:n}=await ze.find(e,this.context.cwd);await t.restoreInstallState();let s=this.topLevel?t.topLevelWorkspace.anchoredLocator:n;if(!this.binariesOnly&&await Zt.hasPackageScript(s,this.scriptName,{project:t}))return await Zt.executePackageScript(s,this.scriptName,this.args,{project:t,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr});let o=await Zt.getPackageAccessibleBinaries(s,{project:t});if(o.get(this.scriptName)){let l=[];return this.inspect&&(typeof this.inspect=="string"?l.push(`--inspect=${this.inspect}`):l.push("--inspect")),this.inspectBrk&&(typeof this.inspectBrk=="string"?l.push(`--inspect-brk=${this.inspectBrk}`):l.push("--inspect-brk")),await Zt.executePackageAccessibleBinary(s,this.scriptName,this.args,{cwd:this.context.cwd,project:t,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr,nodeArgs:l,packageAccessibleBinaries:o})}if(!this.topLevel&&!this.binariesOnly&&i&&this.scriptName.includes(":")){let c=(await Promise.all(t.workspaces.map(async u=>u.manifest.scripts.has(this.scriptName)?u:null))).filter(u=>u!==null);if(c.length===1)return await Zt.executeWorkspaceScript(c[0],this.scriptName,this.args,{stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr})}if(this.topLevel)throw this.scriptName==="node-gyp"?new Pe(`Couldn't find a script name "${this.scriptName}" in the top-level (used by ${P.prettyLocator(e,n)}). This typically happens because some package depends on "node-gyp" to build itself, but didn't list it in their dependencies. To fix that, please run "yarn add node-gyp" into your top-level workspace. You also can open an issue on the repository of the specified package to suggest them to use an optional peer dependency.`):new Pe(`Couldn't find a script name "${this.scriptName}" in the top-level (used by ${P.prettyLocator(e,n)}).`);{if(this.scriptName==="global")throw new Pe("The 'yarn global' commands have been removed in 2.x - consider using 'yarn dlx' or a third-party plugin instead");let l=[this.scriptName].concat(this.args);for(let[c,u]of Lf)for(let g of u)if(l.length>=g.length&&JSON.stringify(l.slice(0,g.length))===JSON.stringify(g))throw new Pe(`Couldn't find a script named "${this.scriptName}", but a matching command can be found in the ${c} plugin. You can install it with "yarn plugin import ${c}".`);throw new Pe(`Couldn't find a script named "${this.scriptName}".`)}}};Bm.paths=[["run"]],Bm.usage=Re.Usage({description:"run a script defined in the package.json",details:` - This command will run a tool. The exact tool that will be executed will depend on the current state of your workspace: - - - If the \`scripts\` field from your local package.json contains a matching script name, its definition will get executed. - - - Otherwise, if one of the local workspace's dependencies exposes a binary with a matching name, this binary will get executed. - - - Otherwise, if the specified name contains a colon character and if one of the workspaces in the project contains exactly one script with a matching name, then this script will get executed. - - Whatever happens, the cwd of the spawned process will be the workspace that declares the script (which makes it possible to call commands cross-workspaces using the third syntax). - `,examples:[["Run the tests from the local workspace","$0 run test"],['Same thing, but without the "run" keyword',"$0 test"],["Inspect Webpack while running","$0 run --inspect-brk webpack"]]});var _oe=Bm;var bm=class extends Le{constructor(){super(...arguments);this.save=J.Boolean("-s,--save",!1,{description:"Persist the resolution inside the top-level manifest"});this.descriptor=J.String();this.resolution=J.String()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,workspace:i}=await ze.find(e,this.context.cwd),n=await Nt.find(e);if(await t.restoreInstallState({restoreResolutions:!1}),!i)throw new ht(t.cwd,this.context.cwd);let s=P.parseDescriptor(this.descriptor,!0),o=P.makeDescriptor(s,this.resolution);return t.storedDescriptors.set(s.descriptorHash,s),t.storedDescriptors.set(o.descriptorHash,o),t.resolutionAliases.set(s.descriptorHash,o.descriptorHash),(await Je.start({configuration:e,stdout:this.context.stdout},async l=>{await t.install({cache:n,report:l})})).exitCode()}};bm.paths=[["set","resolution"]],bm.usage=Re.Usage({description:"enforce a package resolution",details:'\n This command updates the resolution table so that `descriptor` is resolved by `resolution`.\n\n Note that by default this command only affect the current resolution table - meaning that this "manual override" will disappear if you remove the lockfile, or if the package disappear from the table. If you wish to make the enforced resolution persist whatever happens, add the `-s,--save` flag which will also edit the `resolutions` field from your top-level manifest.\n\n Note that no attempt is made at validating that `resolution` is a valid resolution entry for `descriptor`.\n ',examples:[["Force all instances of lodash@npm:^1.2.3 to resolve to 1.5.0","$0 set resolution lodash@npm:^1.2.3 1.5.0"]]});var Voe=bm;var Xoe=ge(is()),Qm=class extends Le{constructor(){super(...arguments);this.all=J.Boolean("-A,--all",!1,{description:"Unlink all workspaces belonging to the target project from the current one"});this.leadingArguments=J.Rest()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,workspace:i}=await ze.find(e,this.context.cwd),n=await Nt.find(e);if(!i)throw new ht(t.cwd,this.context.cwd);let s=t.topLevelWorkspace,o=new Set;if(this.leadingArguments.length===0&&this.all)for(let{pattern:l,reference:c}of s.manifest.resolutions)c.startsWith("portal:")&&o.add(l.descriptor.fullName);if(this.leadingArguments.length>0)for(let l of this.leadingArguments){let c=k.resolve(this.context.cwd,H.toPortablePath(l));if(Se.isPathLike(l)){let u=await ye.find(c,this.context.plugins,{useRc:!1,strict:!1}),{project:g,workspace:f}=await ze.find(u,c);if(!f)throw new ht(g.cwd,c);if(this.all){for(let h of g.workspaces)h.manifest.name&&o.add(P.stringifyIdent(h.locator));if(o.size===0)throw new Pe("No workspace found to be unlinked in the target project")}else{if(!f.manifest.name)throw new Pe("The target workspace doesn't have a name and thus cannot be unlinked");o.add(P.stringifyIdent(f.locator))}}else{let u=[...s.manifest.resolutions.map(({pattern:g})=>g.descriptor.fullName)];for(let g of(0,Xoe.default)(u,l))o.add(g)}}return s.manifest.resolutions=s.manifest.resolutions.filter(({pattern:l})=>!o.has(l.descriptor.fullName)),(await Je.start({configuration:e,stdout:this.context.stdout},async l=>{await t.install({cache:n,report:l})})).exitCode()}};Qm.paths=[["unlink"]],Qm.usage=Re.Usage({description:"disconnect the local project from another one",details:` - This command will remove any resolutions in the project-level manifest that would have been added via a yarn link with similar arguments. - `,examples:[["Unregister a remote workspace in the current project","$0 unlink ~/ts-loader"],["Unregister all workspaces from a remote project in the current project","$0 unlink ~/jest --all"],["Unregister all previously linked workspaces","$0 unlink --all"],["Unregister all workspaces matching a glob","$0 unlink '@babel/*' 'pkg-{a,b}'"]]});var Zoe=Qm;var $oe=ge(WC()),PN=ge(is());ys();var th=class extends Le{constructor(){super(...arguments);this.interactive=J.Boolean("-i,--interactive",{description:"Offer various choices, depending on the detected upgrade paths"});this.exact=J.Boolean("-E,--exact",!1,{description:"Don't use any semver modifier on the resolved range"});this.tilde=J.Boolean("-T,--tilde",!1,{description:"Use the `~` semver modifier on the resolved range"});this.caret=J.Boolean("-C,--caret",!1,{description:"Use the `^` semver modifier on the resolved range"});this.recursive=J.Boolean("-R,--recursive",!1,{description:"Resolve again ALL resolutions for those packages"});this.mode=J.String("--mode",{description:"Change what artifacts installs generate",validator:nn(Ci)});this.patterns=J.Rest()}async execute(){return this.recursive?await this.executeUpRecursive():await this.executeUpClassic()}async executeUpRecursive(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,workspace:i}=await ze.find(e,this.context.cwd),n=await Nt.find(e);if(!i)throw new ht(t.cwd,this.context.cwd);await t.restoreInstallState({restoreResolutions:!1});let s=[...t.storedDescriptors.values()],o=s.map(u=>P.stringifyIdent(u)),a=new Set;for(let u of this.patterns){if(P.parseDescriptor(u).range!=="unknown")throw new Pe("Ranges aren't allowed when using --recursive");for(let g of(0,PN.default)(o,u)){let f=P.parseIdent(g);a.add(f.identHash)}}let l=s.filter(u=>a.has(u.identHash));for(let u of l)t.storedDescriptors.delete(u.descriptorHash),t.storedResolutions.delete(u.descriptorHash);return(await Je.start({configuration:e,stdout:this.context.stdout},async u=>{await t.install({cache:n,report:u})})).exitCode()}async executeUpClassic(){var m;let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,workspace:i}=await ze.find(e,this.context.cwd),n=await Nt.find(e);if(!i)throw new ht(t.cwd,this.context.cwd);await t.restoreInstallState({restoreResolutions:!1});let s=(m=this.interactive)!=null?m:e.get("preferInteractive"),o=zC(this,t),a=s?[Vr.KEEP,Vr.REUSE,Vr.PROJECT,Vr.LATEST]:[Vr.PROJECT,Vr.LATEST],l=[],c=[];for(let y of this.patterns){let b=!1,v=P.parseDescriptor(y);for(let x of t.workspaces)for(let T of[Hr.REGULAR,Hr.DEVELOPMENT]){let Y=[...x.manifest.getForScope(T).values()].map($=>P.stringifyIdent($));for(let $ of(0,PN.default)(Y,P.stringifyIdent(v))){let _=P.parseIdent($),ne=x.manifest[T].get(_.identHash);if(typeof ne=="undefined")throw new Error("Assertion failed: Expected the descriptor to be registered");let ee=P.makeDescriptor(_,v.range);l.push(Promise.resolve().then(async()=>[x,T,ne,await _C(ee,{project:t,workspace:x,cache:n,target:T,modifier:o,strategies:a})])),b=!0}}b||c.push(y)}if(c.length>1)throw new Pe(`Patterns ${ae.prettyList(e,c,Ri.CODE)} don't match any packages referenced by any workspace`);if(c.length>0)throw new Pe(`Pattern ${ae.prettyList(e,c,Ri.CODE)} doesn't match any packages referenced by any workspace`);let u=await Promise.all(l),g=await pA.start({configuration:e,stdout:this.context.stdout,suggestInstall:!1},async y=>{for(let[,,b,{suggestions:v,rejections:x}]of u){let T=v.filter(q=>q.descriptor!==null);if(T.length===0){let[q]=x;if(typeof q=="undefined")throw new Error("Assertion failed: Expected an error to have been set");let Y=this.cli.error(q);t.configuration.get("enableNetwork")?y.reportError(X.CANT_SUGGEST_RESOLUTIONS,`${P.prettyDescriptor(e,b)} can't be resolved to a satisfying range - -${Y}`):y.reportError(X.CANT_SUGGEST_RESOLUTIONS,`${P.prettyDescriptor(e,b)} can't be resolved to a satisfying range (note: network resolution has been disabled) - -${Y}`)}else T.length>1&&!s&&y.reportError(X.CANT_SUGGEST_RESOLUTIONS,`${P.prettyDescriptor(e,b)} has multiple possible upgrade strategies; use -i to disambiguate manually`)}});if(g.hasErrors())return g.exitCode();let f=!1,h=[];for(let[y,b,,{suggestions:v}]of u){let x,T=v.filter(_=>_.descriptor!==null),q=T[0].descriptor,Y=T.every(_=>P.areDescriptorsEqual(_.descriptor,q));T.length===1||Y?x=q:(f=!0,{answer:x}=await(0,$oe.prompt)({type:"select",name:"answer",message:`Which range to you want to use in ${P.prettyWorkspace(e,y)} \u276F ${b}?`,choices:v.map(({descriptor:_,name:ne,reason:ee})=>_?{name:ne,hint:ee,descriptor:_}:{name:ne,hint:ee,disabled:!0}),onCancel:()=>process.exit(130),result(_){return this.find(_,"descriptor")},stdin:this.context.stdin,stdout:this.context.stdout}));let $=y.manifest[b].get(x.identHash);if(typeof $=="undefined")throw new Error("Assertion failed: This descriptor should have a matching entry");if($.descriptorHash!==x.descriptorHash)y.manifest[b].set(x.identHash,x),h.push([y,b,$,x]);else{let _=e.makeResolver(),ne={project:t,resolver:_},ee=_.bindDescriptor($,y.anchoredLocator,ne);t.forgetResolution(ee)}}return await e.triggerMultipleHooks(y=>y.afterWorkspaceDependencyReplacement,h),f&&this.context.stdout.write(` -`),(await Je.start({configuration:e,stdout:this.context.stdout},async y=>{await t.install({cache:n,report:y,mode:this.mode})})).exitCode()}};th.paths=[["up"]],th.usage=Re.Usage({description:"upgrade dependencies across the project",details:"\n This command upgrades the packages matching the list of specified patterns to their latest available version across the whole project (regardless of whether they're part of `dependencies` or `devDependencies` - `peerDependencies` won't be affected). This is a project-wide command: all workspaces will be upgraded in the process.\n\n If `-R,--recursive` is set the command will change behavior and no other switch will be allowed. When operating under this mode `yarn up` will force all ranges matching the selected packages to be resolved again (often to the highest available versions) before being stored in the lockfile. It however won't touch your manifests anymore, so depending on your needs you might want to run both `yarn up` and `yarn up -R` to cover all bases.\n\n If `-i,--interactive` is set (or if the `preferInteractive` settings is toggled on) the command will offer various choices, depending on the detected upgrade paths. Some upgrades require this flag in order to resolve ambiguities.\n\n The, `-C,--caret`, `-E,--exact` and `-T,--tilde` options have the same meaning as in the `add` command (they change the modifier used when the range is missing or a tag, and are ignored when the range is explicitly set).\n\n If the `--mode=` option is set, Yarn will change which artifacts are generated. The modes currently supported are:\n\n - `skip-build` will not run the build scripts at all. Note that this is different from setting `enableScripts` to false because the later will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.\n\n - `update-lockfile` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.\n\n Generally you can see `yarn up` as a counterpart to what was `yarn upgrade --latest` in Yarn 1 (ie it ignores the ranges previously listed in your manifests), but unlike `yarn upgrade` which only upgraded dependencies in the current workspace, `yarn up` will upgrade all workspaces at the same time.\n\n This command accepts glob patterns as arguments (if valid Descriptors and supported by [micromatch](https://github.com/micromatch/micromatch)). Make sure to escape the patterns, to prevent your own shell from trying to expand them.\n\n **Note:** The ranges have to be static, only the package scopes and names can contain glob patterns.\n ",examples:[["Upgrade all instances of lodash to the latest release","$0 up lodash"],["Upgrade all instances of lodash to the latest release, but ask confirmation for each","$0 up lodash -i"],["Upgrade all instances of lodash to 1.2.3","$0 up lodash@1.2.3"],["Upgrade all instances of packages with the `@babel` scope to the latest release","$0 up '@babel/*'"],["Upgrade all instances of packages containing the word `jest` to the latest release","$0 up '*jest*'"],["Upgrade all instances of packages with the `@babel` scope to 7.0.0","$0 up '@babel/*@7.0.0'"]]}),th.schema=[eS("recursive",Bc.Forbids,["interactive","exact","tilde","caret"],{ignore:[void 0,!1]})];var eae=th;var Sm=class extends Le{constructor(){super(...arguments);this.recursive=J.Boolean("-R,--recursive",!1,{description:"List, for each workspace, what are all the paths that lead to the dependency"});this.json=J.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.peers=J.Boolean("--peers",!1,{description:"Also print the peer dependencies that match the specified name"});this.package=J.String()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,workspace:i}=await ze.find(e,this.context.cwd);if(!i)throw new ht(t.cwd,this.context.cwd);await t.restoreInstallState();let n=P.parseIdent(this.package).identHash,s=this.recursive?_3e(t,n,{configuration:e,peers:this.peers}):z3e(t,n,{configuration:e,peers:this.peers});ls.emitTree(s,{configuration:e,stdout:this.context.stdout,json:this.json,separators:1})}};Sm.paths=[["why"]],Sm.usage=Re.Usage({description:"display the reason why a package is needed",details:` - This command prints the exact reasons why a package appears in the dependency tree. - - If \`-R,--recursive\` is set, the listing will go in depth and will list, for each workspaces, what are all the paths that lead to the dependency. Note that the display is somewhat optimized in that it will not print the package listing twice for a single package, so if you see a leaf named "Foo" when looking for "Bar", it means that "Foo" already got printed higher in the tree. - `,examples:[["Explain why lodash is used in your project","$0 why lodash"]]});var tae=Sm;function z3e(r,e,{configuration:t,peers:i}){let n=Se.sortMap(r.storedPackages.values(),a=>P.stringifyLocator(a)),s={},o={children:s};for(let a of n){let l={},c=null;for(let u of a.dependencies.values()){if(!i&&a.peerDependencies.has(u.identHash))continue;let g=r.storedResolutions.get(u.descriptorHash);if(!g)throw new Error("Assertion failed: The resolution should have been registered");let f=r.storedPackages.get(g);if(!f)throw new Error("Assertion failed: The package should have been registered");if(f.identHash!==e)continue;if(c===null){let p=P.stringifyLocator(a);s[p]={value:[a,ae.Type.LOCATOR],children:l}}let h=P.stringifyLocator(f);l[h]={value:[{descriptor:u,locator:f},ae.Type.DEPENDENT]}}}return o}function _3e(r,e,{configuration:t,peers:i}){let n=Se.sortMap(r.workspaces,f=>P.stringifyLocator(f.anchoredLocator)),s=new Set,o=new Set,a=f=>{if(s.has(f.locatorHash))return o.has(f.locatorHash);if(s.add(f.locatorHash),f.identHash===e)return o.add(f.locatorHash),!0;let h=!1;f.identHash===e&&(h=!0);for(let p of f.dependencies.values()){if(!i&&f.peerDependencies.has(p.identHash))continue;let m=r.storedResolutions.get(p.descriptorHash);if(!m)throw new Error("Assertion failed: The resolution should have been registered");let y=r.storedPackages.get(m);if(!y)throw new Error("Assertion failed: The package should have been registered");a(y)&&(h=!0)}return h&&o.add(f.locatorHash),h};for(let f of n){let h=r.storedPackages.get(f.anchoredLocator.locatorHash);if(!h)throw new Error("Assertion failed: The package should have been registered");a(h)}let l=new Set,c={},u={children:c},g=(f,h,p)=>{if(!o.has(f.locatorHash))return;let m=p!==null?ae.tuple(ae.Type.DEPENDENT,{locator:f,descriptor:p}):ae.tuple(ae.Type.LOCATOR,f),y={},b={value:m,children:y},v=P.stringifyLocator(f);if(h[v]=b,!l.has(f.locatorHash)&&(l.add(f.locatorHash),!(p!==null&&r.tryWorkspaceByLocator(f))))for(let x of f.dependencies.values()){if(!i&&f.peerDependencies.has(x.identHash))continue;let T=r.storedResolutions.get(x.descriptorHash);if(!T)throw new Error("Assertion failed: The resolution should have been registered");let q=r.storedPackages.get(T);if(!q)throw new Error("Assertion failed: The package should have been registered");g(q,y,x)}};for(let f of n){let h=r.storedPackages.get(f.anchoredLocator.locatorHash);if(!h)throw new Error("Assertion failed: The package should have been registered");g(h,c,null)}return u}var jN={};ft(jN,{default:()=>dWe,gitUtils:()=>Qu});var Qu={};ft(Qu,{TreeishProtocols:()=>On,clone:()=>KN,fetchBase:()=>wae,fetchChangedFiles:()=>Bae,fetchChangedWorkspaces:()=>hWe,fetchRoot:()=>yae,isGitUrl:()=>ih,lsRemote:()=>Iae,normalizeLocator:()=>TN,normalizeRepoUrl:()=>vm,resolveUrl:()=>MN,splitRepoUrl:()=>xm});var NN=ge(dae()),Cae=ge(Zw()),rh=ge(require("querystring")),LN=ge(ri()),mae=ge(require("url"));function Eae(){return te(N({},process.env),{GIT_SSH_COMMAND:process.env.GIT_SSH_COMMAND||`${process.env.GIT_SSH||"ssh"} -o BatchMode=yes`})}var fWe=[/^ssh:/,/^git(?:\+[^:]+)?:/,/^(?:git\+)?https?:[^#]+\/[^#]+(?:\.git)(?:#.*)?$/,/^git@[^#]+\/[^#]+\.git(?:#.*)?$/,/^(?:github:|https:\/\/github\.com\/)?(?!\.{1,2}\/)([a-zA-Z._0-9-]+)\/(?!\.{1,2}(?:#|$))([a-zA-Z._0-9-]+?)(?:\.git)?(?:#.*)?$/,/^https:\/\/github\.com\/(?!\.{1,2}\/)([a-zA-Z0-9._-]+)\/(?!\.{1,2}(?:#|$))([a-zA-Z0-9._-]+?)\/tarball\/(.+)?$/],On;(function(n){n.Commit="commit",n.Head="head",n.Tag="tag",n.Semver="semver"})(On||(On={}));function ih(r){return r?fWe.some(e=>!!r.match(e)):!1}function xm(r){r=vm(r);let e=r.indexOf("#");if(e===-1)return{repo:r,treeish:{protocol:On.Head,request:"HEAD"},extra:{}};let t=r.slice(0,e),i=r.slice(e+1);if(i.match(/^[a-z]+=/)){let n=rh.default.parse(i);for(let[l,c]of Object.entries(n))if(typeof c!="string")throw new Error(`Assertion failed: The ${l} parameter must be a literal string`);let s=Object.values(On).find(l=>Object.prototype.hasOwnProperty.call(n,l)),o,a;typeof s!="undefined"?(o=s,a=n[s]):(o=On.Head,a="HEAD");for(let l of Object.values(On))delete n[l];return{repo:t,treeish:{protocol:o,request:a},extra:n}}else{let n=i.indexOf(":"),s,o;return n===-1?(s=null,o=i):(s=i.slice(0,n),o=i.slice(n+1)),{repo:t,treeish:{protocol:s,request:o},extra:{}}}}function vm(r,{git:e=!1}={}){var t;if(r=r.replace(/^git\+https:/,"https:"),r=r.replace(/^(?:github:|https:\/\/github\.com\/)?(?!\.{1,2}\/)([a-zA-Z0-9._-]+)\/(?!\.{1,2}(?:#|$))([a-zA-Z0-9._-]+?)(?:\.git)?(#.*)?$/,"https://github.com/$1/$2.git$3"),r=r.replace(/^https:\/\/github\.com\/(?!\.{1,2}\/)([a-zA-Z0-9._-]+)\/(?!\.{1,2}(?:#|$))([a-zA-Z0-9._-]+?)\/tarball\/(.+)?$/,"https://github.com/$1/$2.git#$3"),e){r=r.replace(/^git\+([^:]+):/,"$1:");let i;try{i=mae.default.parse(r)}catch{i=null}i&&i.protocol==="ssh:"&&((t=i.path)==null?void 0:t.startsWith("/:"))&&(r=r.replace(/^ssh:\/\//,""))}return r}function TN(r){return P.makeLocator(r,vm(r.reference))}async function Iae(r,e){let t=vm(r,{git:!0});if(!ir.getNetworkSettings(`https://${(0,NN.default)(t).resource}`,{configuration:e}).enableNetwork)throw new Error(`Request to '${t}' has been blocked because of your configuration settings`);let n=await ON("listing refs",["ls-remote",t],{cwd:e.startingCwd,env:Eae()},{configuration:e,normalizedRepoUrl:t}),s=new Map,o=/^([a-f0-9]{40})\t([^\n]+)/gm,a;for(;(a=o.exec(n.stdout))!==null;)s.set(a[2],a[1]);return s}async function MN(r,e){let{repo:t,treeish:{protocol:i,request:n},extra:s}=xm(r),o=await Iae(t,e),a=(c,u)=>{switch(c){case On.Commit:{if(!u.match(/^[a-f0-9]{40}$/))throw new Error("Invalid commit hash");return rh.default.stringify(te(N({},s),{commit:u}))}case On.Head:{let g=o.get(u==="HEAD"?u:`refs/heads/${u}`);if(typeof g=="undefined")throw new Error(`Unknown head ("${u}")`);return rh.default.stringify(te(N({},s),{commit:g}))}case On.Tag:{let g=o.get(`refs/tags/${u}`);if(typeof g=="undefined")throw new Error(`Unknown tag ("${u}")`);return rh.default.stringify(te(N({},s),{commit:g}))}case On.Semver:{let g=Wt.validRange(u);if(!g)throw new Error(`Invalid range ("${u}")`);let f=new Map([...o.entries()].filter(([p])=>p.startsWith("refs/tags/")).map(([p,m])=>[LN.default.parse(p.slice(10)),m]).filter(p=>p[0]!==null)),h=LN.default.maxSatisfying([...f.keys()],g);if(h===null)throw new Error(`No matching range ("${u}")`);return rh.default.stringify(te(N({},s),{commit:f.get(h)}))}case null:{let g;if((g=l(On.Commit,u))!==null||(g=l(On.Tag,u))!==null||(g=l(On.Head,u))!==null)return g;throw u.match(/^[a-f0-9]+$/)?new Error(`Couldn't resolve "${u}" as either a commit, a tag, or a head - if a commit, use the 40-characters commit hash`):new Error(`Couldn't resolve "${u}" as either a commit, a tag, or a head`)}default:throw new Error(`Invalid Git resolution protocol ("${c}")`)}},l=(c,u)=>{try{return a(c,u)}catch(g){return null}};return`${t}#${a(i,n)}`}async function KN(r,e){return await e.getLimit("cloneConcurrency")(async()=>{let{repo:t,treeish:{protocol:i,request:n}}=xm(r);if(i!=="commit")throw new Error("Invalid treeish protocol when cloning");let s=vm(t,{git:!0});if(ir.getNetworkSettings(`https://${(0,NN.default)(s).resource}`,{configuration:e}).enableNetwork===!1)throw new Error(`Request to '${s}' has been blocked because of your configuration settings`);let o=await K.mktempPromise(),a={cwd:o,env:Eae()};return await ON("cloning the repository",["clone","-c core.autocrlf=false",s,H.fromPortablePath(o)],a,{configuration:e,normalizedRepoUrl:s}),await ON("switching branch",["checkout",`${n}`],a,{configuration:e,normalizedRepoUrl:s}),o})}async function yae(r){let e=null,t,i=r;do t=i,await K.existsPromise(k.join(t,".git"))&&(e=t),i=k.dirname(t);while(e===null&&i!==t);return e}async function wae(r,{baseRefs:e}){if(e.length===0)throw new Pe("Can't run this command with zero base refs specified.");let t=[];for(let a of e){let{code:l}=await Nr.execvp("git",["merge-base",a,"HEAD"],{cwd:r});l===0&&t.push(a)}if(t.length===0)throw new Pe(`No ancestor could be found between any of HEAD and ${e.join(", ")}`);let{stdout:i}=await Nr.execvp("git",["merge-base","HEAD",...t],{cwd:r,strict:!0}),n=i.trim(),{stdout:s}=await Nr.execvp("git",["show","--quiet","--pretty=format:%s",n],{cwd:r,strict:!0}),o=s.trim();return{hash:n,title:o}}async function Bae(r,{base:e,project:t}){let i=Se.buildIgnorePattern(t.configuration.get("changesetIgnorePatterns")),{stdout:n}=await Nr.execvp("git",["diff","--name-only",`${e}`],{cwd:r,strict:!0}),s=n.split(/\r\n|\r|\n/).filter(c=>c.length>0).map(c=>k.resolve(r,H.toPortablePath(c))),{stdout:o}=await Nr.execvp("git",["ls-files","--others","--exclude-standard"],{cwd:r,strict:!0}),a=o.split(/\r\n|\r|\n/).filter(c=>c.length>0).map(c=>k.resolve(r,H.toPortablePath(c))),l=[...new Set([...s,...a].sort())];return i?l.filter(c=>!k.relative(t.cwd,c).match(i)):l}async function hWe({ref:r,project:e}){if(e.configuration.projectCwd===null)throw new Pe("This command can only be run from within a Yarn project");let t=[k.resolve(e.cwd,e.configuration.get("cacheFolder")),k.resolve(e.cwd,e.configuration.get("installStatePath")),k.resolve(e.cwd,e.configuration.get("lockfileFilename")),k.resolve(e.cwd,e.configuration.get("virtualFolder"))];await e.configuration.triggerHook(o=>o.populateYarnPaths,e,o=>{o!=null&&t.push(o)});let i=await yae(e.configuration.projectCwd);if(i==null)throw new Pe("This command can only be run on Git repositories");let n=await wae(i,{baseRefs:typeof r=="string"?[r]:e.configuration.get("changesetBaseRefs")}),s=await Bae(i,{base:n.hash,project:e});return new Set(Se.mapAndFilter(s,o=>{let a=e.tryWorkspaceByFilePath(o);return a===null?Se.mapAndFilter.skip:t.some(l=>o.startsWith(l))?Se.mapAndFilter.skip:a}))}async function ON(r,e,t,{configuration:i,normalizedRepoUrl:n}){try{return await Nr.execvp("git",e,te(N({},t),{strict:!0}))}catch(s){if(!(s instanceof Nr.ExecError))throw s;let o=s.reportExtra,a=s.stderr.toString();throw new ct(X.EXCEPTION,`Failed ${r}`,l=>{l.reportError(X.EXCEPTION,` ${ae.prettyField(i,{label:"Repository URL",value:ae.tuple(ae.Type.URL,n)})}`);for(let c of a.matchAll(/^(.+?): (.*)$/gm)){let[,u,g]=c;u=u.toLowerCase();let f=u==="error"?"Error":`${(0,Cae.default)(u)} Error`;l.reportError(X.EXCEPTION,` ${ae.prettyField(i,{label:f,value:ae.tuple(ae.Type.NO_HINT,g)})}`)}o==null||o(l)})}}var UN=class{supports(e,t){return ih(e.reference)}getLocalPath(e,t){return null}async fetch(e,t){let i=t.checksums.get(e.locatorHash)||null,n=TN(e),s=new Map(t.checksums);s.set(n.locatorHash,i);let o=te(N({},t),{checksums:s}),a=await this.downloadHosted(n,o);if(a!==null)return a;let[l,c,u]=await t.cache.fetchPackageFromCache(e,i,N({onHit:()=>t.report.reportCacheHit(e),onMiss:()=>t.report.reportCacheMiss(e,`${P.prettyLocator(t.project.configuration,e)} can't be found in the cache and will be fetched from the remote repository`),loader:()=>this.cloneFromRemote(n,o),skipIntegrityCheck:t.skipIntegrityCheck},t.cacheOptions));return{packageFs:l,releaseFs:c,prefixPath:P.getIdentVendorPath(e),checksum:u}}async downloadHosted(e,t){return t.project.configuration.reduceHook(i=>i.fetchHostedRepository,null,e,t)}async cloneFromRemote(e,t){let i=await KN(e.reference,t.project.configuration),n=xm(e.reference),s=k.join(i,"package.tgz");await Zt.prepareExternalProject(i,s,{configuration:t.project.configuration,report:t.report,workspace:n.extra.workspace,locator:e});let o=await K.readFilePromise(s);return await Se.releaseAfterUseAsync(async()=>await Bi.convertToZip(o,{compressionLevel:t.project.configuration.get("compressionLevel"),prefixPath:P.getIdentVendorPath(e),stripComponents:1}))}};var HN=class{supportsDescriptor(e,t){return ih(e.range)}supportsLocator(e,t){return ih(e.reference)}shouldPersistResolution(e,t){return!0}bindDescriptor(e,t,i){return e}getResolutionDependencies(e,t){return[]}async getCandidates(e,t,i){let n=await MN(e.range,i.project.configuration);return[P.makeLocator(e,n)]}async getSatisfying(e,t,i){return null}async resolve(e,t){if(!t.fetchOptions)throw new Error("Assertion failed: This resolver cannot be used unless a fetcher is configured");let i=await t.fetchOptions.fetcher.fetch(e,t.fetchOptions),n=await Se.releaseAfterUseAsync(async()=>await At.find(i.prefixPath,{baseFs:i.packageFs}),i.releaseFs);return te(N({},e),{version:n.version||"0.0.0",languageName:n.languageName||t.project.configuration.get("defaultLanguageName"),linkType:Qt.HARD,conditions:n.getConditions(),dependencies:n.dependencies,peerDependencies:n.peerDependencies,dependenciesMeta:n.dependenciesMeta,peerDependenciesMeta:n.peerDependenciesMeta,bin:n.bin})}};var pWe={configuration:{changesetBaseRefs:{description:"The base git refs that the current HEAD is compared against when detecting changes. Supports git branches, tags, and commits.",type:Ie.STRING,isArray:!0,isNullable:!1,default:["master","origin/master","upstream/master","main","origin/main","upstream/main"]},changesetIgnorePatterns:{description:"Array of glob patterns; files matching them will be ignored when fetching the changed files",type:Ie.STRING,default:[],isArray:!0},cloneConcurrency:{description:"Maximal number of concurrent clones",type:Ie.NUMBER,default:2}},fetchers:[UN],resolvers:[HN]};var dWe=pWe;var km=class extends Le{constructor(){super(...arguments);this.since=J.String("--since",{description:"Only include workspaces that have been changed since the specified ref.",tolerateBoolean:!0});this.recursive=J.Boolean("-R,--recursive",!1,{description:"Find packages via dependencies/devDependencies instead of using the workspaces field"});this.verbose=J.Boolean("-v,--verbose",!1,{description:"Also return the cross-dependencies between workspaces"});this.json=J.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t}=await ze.find(e,this.context.cwd);return(await Je.start({configuration:e,json:this.json,stdout:this.context.stdout},async n=>{let s=this.since?await Qu.fetchChangedWorkspaces({ref:this.since,project:t}):t.workspaces,o=new Set(s);if(this.recursive)for(let a of[...s].map(l=>l.getRecursiveWorkspaceDependents()))for(let l of a)o.add(l);for(let a of o){let{manifest:l}=a,c;if(this.verbose){let u=new Set,g=new Set;for(let f of At.hardDependencies)for(let[h,p]of l.getForScope(f)){let m=t.tryWorkspaceByDescriptor(p);m===null?t.workspacesByIdent.has(h)&&g.add(p):u.add(m)}c={workspaceDependencies:Array.from(u).map(f=>f.relativeCwd),mismatchedWorkspaceDependencies:Array.from(g).map(f=>P.stringifyDescriptor(f))}}n.reportInfo(null,`${a.relativeCwd}`),n.reportJson(N({location:a.relativeCwd,name:l.name?P.stringifyIdent(l.name):null},c))}})).exitCode()}};km.paths=[["workspaces","list"]],km.usage=Re.Usage({category:"Workspace-related commands",description:"list all available workspaces",details:"\n This command will print the list of all workspaces in the project.\n\n - If `--since` is set, Yarn will only list workspaces that have been modified since the specified ref. By default Yarn will use the refs specified by the `changesetBaseRefs` configuration option.\n\n - If `-R,--recursive` is set, Yarn will find workspaces to run the command on by recursively evaluating `dependencies` and `devDependencies` fields, instead of looking at the `workspaces` fields.\n\n - If both the `-v,--verbose` and `--json` options are set, Yarn will also return the cross-dependencies between each workspaces (useful when you wish to automatically generate Buck / Bazel rules).\n "});var bae=km;var Pm=class extends Le{constructor(){super(...arguments);this.workspaceName=J.String();this.commandName=J.String();this.args=J.Proxy()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,workspace:i}=await ze.find(e,this.context.cwd);if(!i)throw new ht(t.cwd,this.context.cwd);let n=t.workspaces,s=new Map(n.map(a=>{let l=P.convertToIdent(a.locator);return[P.stringifyIdent(l),a]})),o=s.get(this.workspaceName);if(o===void 0){let a=Array.from(s.keys()).sort();throw new Pe(`Workspace '${this.workspaceName}' not found. Did you mean any of the following: - - ${a.join(` - - `)}?`)}return this.cli.run([this.commandName,...this.args],{cwd:o.cwd})}};Pm.paths=[["workspace"]],Pm.usage=Re.Usage({category:"Workspace-related commands",description:"run a command within the specified workspace",details:` - This command will run a given sub-command on a single workspace. - `,examples:[["Add a package to a single workspace","yarn workspace components add -D react"],["Run build script on a single workspace","yarn workspace components run build"]]});var Qae=Pm;var CWe={configuration:{enableImmutableInstalls:{description:"If true (the default on CI), prevents the install command from modifying the lockfile",type:Ie.BOOLEAN,default:Sae.isCI},defaultSemverRangePrefix:{description:"The default save prefix: '^', '~' or ''",type:Ie.STRING,values:["^","~",""],default:pa.CARET}},commands:[Tne,Mne,$se,uoe,Voe,Toe,boe,bae,Coe,moe,Eoe,Ioe,Nne,Lne,goe,hoe,yoe,woe,Soe,xoe,koe,Doe,Zoe,Roe,joe,Uoe,Goe,Foe,Yoe,qoe,Joe,zoe,_oe,eae,tae,Qae]},mWe=CWe;var zN={};ft(zN,{default:()=>IWe});var Ge={optional:!0},YN=[["@tailwindcss/aspect-ratio@<0.2.1",{peerDependencies:{tailwindcss:"^2.0.2"}}],["@tailwindcss/line-clamp@<0.2.1",{peerDependencies:{tailwindcss:"^2.0.2"}}],["@fullhuman/postcss-purgecss@3.1.3 || 3.1.3-alpha.0",{peerDependencies:{postcss:"^8.0.0"}}],["@samverschueren/stream-to-observable@<0.3.1",{peerDependenciesMeta:{rxjs:Ge,zenObservable:Ge}}],["any-observable@<0.5.1",{peerDependenciesMeta:{rxjs:Ge,zenObservable:Ge}}],["@pm2/agent@<1.0.4",{dependencies:{debug:"*"}}],["debug@<4.2.0",{peerDependenciesMeta:{["supports-color"]:Ge}}],["got@<11",{dependencies:{["@types/responselike"]:"^1.0.0",["@types/keyv"]:"^3.1.1"}}],["cacheable-lookup@<4.1.2",{dependencies:{["@types/keyv"]:"^3.1.1"}}],["http-link-dataloader@*",{peerDependencies:{graphql:"^0.13.1 || ^14.0.0"}}],["typescript-language-server@*",{dependencies:{["vscode-jsonrpc"]:"^5.0.1",["vscode-languageserver-protocol"]:"^3.15.0"}}],["postcss-syntax@*",{peerDependenciesMeta:{["postcss-html"]:Ge,["postcss-jsx"]:Ge,["postcss-less"]:Ge,["postcss-markdown"]:Ge,["postcss-scss"]:Ge}}],["jss-plugin-rule-value-function@<=10.1.1",{dependencies:{["tiny-warning"]:"^1.0.2"}}],["ink-select-input@<4.1.0",{peerDependencies:{react:"^16.8.2"}}],["license-webpack-plugin@<2.3.18",{peerDependenciesMeta:{webpack:Ge}}],["snowpack@>=3.3.0",{dependencies:{["node-gyp"]:"^7.1.0"}}],["promise-inflight@*",{peerDependenciesMeta:{bluebird:Ge}}],["reactcss@*",{peerDependencies:{react:"*"}}],["react-color@<=2.19.0",{peerDependencies:{react:"*"}}],["gatsby-plugin-i18n@*",{dependencies:{ramda:"^0.24.1"}}],["useragent@^2.0.0",{dependencies:{request:"^2.88.0",yamlparser:"0.0.x",semver:"5.5.x"}}],["@apollographql/apollo-tools@<=0.5.2",{peerDependencies:{graphql:"^14.2.1 || ^15.0.0"}}],["material-table@^2.0.0",{dependencies:{"@babel/runtime":"^7.11.2"}}],["@babel/parser@*",{dependencies:{"@babel/types":"^7.8.3"}}],["fork-ts-checker-webpack-plugin@<=6.3.4",{peerDependencies:{eslint:">= 6",typescript:">= 2.7",webpack:">= 4","vue-template-compiler":"*"},peerDependenciesMeta:{eslint:Ge,"vue-template-compiler":Ge}}],["rc-animate@<=3.1.1",{peerDependencies:{react:">=16.9.0","react-dom":">=16.9.0"}}],["react-bootstrap-table2-paginator@*",{dependencies:{classnames:"^2.2.6"}}],["react-draggable@<=4.4.3",{peerDependencies:{react:">= 16.3.0","react-dom":">= 16.3.0"}}],["apollo-upload-client@<14",{peerDependencies:{graphql:"14 - 15"}}],["react-instantsearch-core@<=6.7.0",{peerDependencies:{algoliasearch:">= 3.1 < 5"}}],["react-instantsearch-dom@<=6.7.0",{dependencies:{"react-fast-compare":"^3.0.0"}}],["ws@<7.2.1",{peerDependencies:{bufferutil:"^4.0.1","utf-8-validate":"^5.0.2"},peerDependenciesMeta:{bufferutil:Ge,"utf-8-validate":Ge}}],["react-portal@*",{peerDependencies:{"react-dom":"^15.0.0-0 || ^16.0.0-0 || ^17.0.0-0"}}],["react-scripts@<=4.0.1",{peerDependencies:{react:"*"}}],["testcafe@<=1.10.1",{dependencies:{"@babel/plugin-transform-for-of":"^7.12.1","@babel/runtime":"^7.12.5"}}],["testcafe-legacy-api@<=4.2.0",{dependencies:{"testcafe-hammerhead":"^17.0.1","read-file-relative":"^1.2.0"}}],["@google-cloud/firestore@<=4.9.3",{dependencies:{protobufjs:"^6.8.6"}}],["gatsby-source-apiserver@*",{dependencies:{["babel-polyfill"]:"^6.26.0"}}],["@webpack-cli/package-utils@<=1.0.1-alpha.4",{dependencies:{["cross-spawn"]:"^7.0.3"}}],["gatsby-remark-prismjs@<3.3.28",{dependencies:{lodash:"^4"}}],["gatsby-plugin-favicon@*",{peerDependencies:{webpack:"*"}}],["gatsby-plugin-sharp@<=4.6.0-next.3",{dependencies:{debug:"^4.3.1"}}],["gatsby-react-router-scroll@<=5.6.0-next.0",{dependencies:{["prop-types"]:"^15.7.2"}}],["@rebass/forms@*",{dependencies:{["@styled-system/should-forward-prop"]:"^5.0.0"},peerDependencies:{react:"^16.8.6"}}],["rebass@*",{peerDependencies:{react:"^16.8.6"}}],["@ant-design/react-slick@<=0.28.3",{peerDependencies:{react:">=16.0.0"}}],["mqtt@<4.2.7",{dependencies:{duplexify:"^4.1.1"}}],["vue-cli-plugin-vuetify@<=2.0.3",{dependencies:{semver:"^6.3.0"},peerDependenciesMeta:{"sass-loader":Ge,"vuetify-loader":Ge}}],["vue-cli-plugin-vuetify@<=2.0.4",{dependencies:{"null-loader":"^3.0.0"}}],["vue-cli-plugin-vuetify@>=2.4.3",{peerDependencies:{vue:"*"}}],["@vuetify/cli-plugin-utils@<=0.0.4",{dependencies:{semver:"^6.3.0"},peerDependenciesMeta:{"sass-loader":Ge}}],["@vue/cli-plugin-typescript@<=5.0.0-alpha.0",{dependencies:{"babel-loader":"^8.1.0"}}],["@vue/cli-plugin-typescript@<=5.0.0-beta.0",{dependencies:{"@babel/core":"^7.12.16"},peerDependencies:{"vue-template-compiler":"^2.0.0"},peerDependenciesMeta:{"vue-template-compiler":Ge}}],["cordova-ios@<=6.3.0",{dependencies:{underscore:"^1.9.2"}}],["cordova-lib@<=10.0.1",{dependencies:{underscore:"^1.9.2"}}],["git-node-fs@*",{peerDependencies:{"js-git":"^0.7.8"},peerDependenciesMeta:{"js-git":Ge}}],["consolidate@<0.16.0",{peerDependencies:{mustache:"^3.0.0"},peerDependenciesMeta:{mustache:Ge}}],["consolidate@*",{peerDependencies:{velocityjs:"^2.0.1",tinyliquid:"^0.2.34","liquid-node":"^3.0.1",jade:"^1.11.0","then-jade":"*",dust:"^0.3.0","dustjs-helpers":"^1.7.4","dustjs-linkedin":"^2.7.5",swig:"^1.4.2","swig-templates":"^2.0.3","razor-tmpl":"^1.3.1",atpl:">=0.7.6",liquor:"^0.0.5",twig:"^1.15.2",ejs:"^3.1.5",eco:"^1.1.0-rc-3",jazz:"^0.0.18",jqtpl:"~1.1.0",hamljs:"^0.6.2",hamlet:"^0.3.3",whiskers:"^0.4.0","haml-coffee":"^1.14.1","hogan.js":"^3.0.2",templayed:">=0.2.3",handlebars:"^4.7.6",underscore:"^1.11.0",lodash:"^4.17.20",pug:"^3.0.0","then-pug":"*",qejs:"^3.0.5",walrus:"^0.10.1",mustache:"^4.0.1",just:"^0.1.8",ect:"^0.5.9",mote:"^0.2.0",toffee:"^0.3.6",dot:"^1.1.3","bracket-template":"^1.1.5",ractive:"^1.3.12",nunjucks:"^3.2.2",htmling:"^0.0.8","babel-core":"^6.26.3",plates:"~0.4.11","react-dom":"^16.13.1",react:"^16.13.1","arc-templates":"^0.5.3",vash:"^0.13.0",slm:"^2.0.0",marko:"^3.14.4",teacup:"^2.0.0","coffee-script":"^1.12.7",squirrelly:"^5.1.0",twing:"^5.0.2"},peerDependenciesMeta:{velocityjs:Ge,tinyliquid:Ge,"liquid-node":Ge,jade:Ge,"then-jade":Ge,dust:Ge,"dustjs-helpers":Ge,"dustjs-linkedin":Ge,swig:Ge,"swig-templates":Ge,"razor-tmpl":Ge,atpl:Ge,liquor:Ge,twig:Ge,ejs:Ge,eco:Ge,jazz:Ge,jqtpl:Ge,hamljs:Ge,hamlet:Ge,whiskers:Ge,"haml-coffee":Ge,"hogan.js":Ge,templayed:Ge,handlebars:Ge,underscore:Ge,lodash:Ge,pug:Ge,"then-pug":Ge,qejs:Ge,walrus:Ge,mustache:Ge,just:Ge,ect:Ge,mote:Ge,toffee:Ge,dot:Ge,"bracket-template":Ge,ractive:Ge,nunjucks:Ge,htmling:Ge,"babel-core":Ge,plates:Ge,"react-dom":Ge,react:Ge,"arc-templates":Ge,vash:Ge,slm:Ge,marko:Ge,teacup:Ge,"coffee-script":Ge,squirrelly:Ge,twing:Ge}}],["vue-loader@<=16.3.3",{peerDependencies:{"@vue/compiler-sfc":"^3.0.8",webpack:"^4.1.0 || ^5.0.0-0"},peerDependenciesMeta:{"@vue/compiler-sfc":Ge}}],["vue-loader@^16.7.0",{peerDependencies:{"@vue/compiler-sfc":"^3.0.8",vue:"^3.2.13"},peerDependenciesMeta:{"@vue/compiler-sfc":Ge,vue:Ge}}],["scss-parser@*",{dependencies:{lodash:"^4.17.21"}}],["query-ast@*",{dependencies:{lodash:"^4.17.21"}}],["redux-thunk@<=2.3.0",{peerDependencies:{redux:"^4.0.0"}}],["skypack@<=0.3.2",{dependencies:{tar:"^6.1.0"}}],["@npmcli/metavuln-calculator@<2.0.0",{dependencies:{"json-parse-even-better-errors":"^2.3.1"}}],["bin-links@<2.3.0",{dependencies:{"mkdirp-infer-owner":"^1.0.2"}}],["rollup-plugin-polyfill-node@<=0.8.0",{peerDependencies:{rollup:"^1.20.0 || ^2.0.0"}}],["snowpack@<3.8.6",{dependencies:{"magic-string":"^0.25.7"}}],["elm-webpack-loader@*",{dependencies:{temp:"^0.9.4"}}],["winston-transport@<=4.4.0",{dependencies:{logform:"^2.2.0"}}],["jest-vue-preprocessor@*",{dependencies:{"@babel/core":"7.8.7","@babel/template":"7.8.6"},peerDependencies:{pug:"^2.0.4"},peerDependenciesMeta:{pug:Ge}}],["redux-persist@*",{peerDependencies:{react:">=16"},peerDependenciesMeta:{react:Ge}}],["sodium@>=3",{dependencies:{"node-gyp":"^3.8.0"}}],["babel-plugin-graphql-tag@<=3.1.0",{peerDependencies:{graphql:"^14.0.0 || ^15.0.0"}}],["@playwright/test@<=1.14.1",{dependencies:{"jest-matcher-utils":"^26.4.2"}}],...["babel-plugin-remove-graphql-queries@<3.14.0-next.1","babel-preset-gatsby-package@<1.14.0-next.1","create-gatsby@<1.14.0-next.1","gatsby-admin@<0.24.0-next.1","gatsby-cli@<3.14.0-next.1","gatsby-core-utils@<2.14.0-next.1","gatsby-design-tokens@<3.14.0-next.1","gatsby-legacy-polyfills@<1.14.0-next.1","gatsby-plugin-benchmark-reporting@<1.14.0-next.1","gatsby-plugin-graphql-config@<0.23.0-next.1","gatsby-plugin-image@<1.14.0-next.1","gatsby-plugin-mdx@<2.14.0-next.1","gatsby-plugin-netlify-cms@<5.14.0-next.1","gatsby-plugin-no-sourcemaps@<3.14.0-next.1","gatsby-plugin-page-creator@<3.14.0-next.1","gatsby-plugin-preact@<5.14.0-next.1","gatsby-plugin-preload-fonts@<2.14.0-next.1","gatsby-plugin-schema-snapshot@<2.14.0-next.1","gatsby-plugin-styletron@<6.14.0-next.1","gatsby-plugin-subfont@<3.14.0-next.1","gatsby-plugin-utils@<1.14.0-next.1","gatsby-recipes@<0.25.0-next.1","gatsby-source-shopify@<5.6.0-next.1","gatsby-source-wikipedia@<3.14.0-next.1","gatsby-transformer-screenshot@<3.14.0-next.1","gatsby-worker@<0.5.0-next.1"].map(r=>[r,{dependencies:{"@babel/runtime":"^7.14.8"}}]),["gatsby-core-utils@<2.14.0-next.1",{dependencies:{got:"8.3.2"}}],["gatsby-plugin-gatsby-cloud@<=3.1.0-next.0",{dependencies:{"gatsby-core-utils":"^2.13.0-next.0"}}],["gatsby-plugin-gatsby-cloud@<=3.2.0-next.1",{peerDependencies:{webpack:"*"}}],["babel-plugin-remove-graphql-queries@<=3.14.0-next.1",{dependencies:{"gatsby-core-utils":"^2.8.0-next.1"}}],["gatsby-plugin-netlify@3.13.0-next.1",{dependencies:{"gatsby-core-utils":"^2.13.0-next.0"}}],["clipanion-v3-codemod@<=0.2.0",{peerDependencies:{jscodeshift:"^0.11.0"}}],["react-live@*",{peerDependencies:{"react-dom":"*",react:"*"}}],["webpack@<4.44.1",{peerDependenciesMeta:{"webpack-cli":Ge,"webpack-command":Ge}}],["webpack@<5.0.0-beta.23",{peerDependenciesMeta:{"webpack-cli":Ge}}],["webpack-dev-server@<3.10.2",{peerDependenciesMeta:{"webpack-cli":Ge}}],["@docusaurus/responsive-loader@<1.5.0",{peerDependenciesMeta:{sharp:Ge,jimp:Ge}}],["eslint-module-utils@*",{peerDependenciesMeta:{"eslint-import-resolver-node":Ge,"eslint-import-resolver-typescript":Ge,"eslint-import-resolver-webpack":Ge,"@typescript-eslint/parser":Ge}}],["eslint-plugin-import@*",{peerDependenciesMeta:{"@typescript-eslint/parser":Ge}}],["critters-webpack-plugin@<3.0.2",{peerDependenciesMeta:{"html-webpack-plugin":Ge}}],["terser@<=5.10.0",{dependencies:{acorn:"^8.5.0"}}],["babel-preset-react-app@10.0.x",{dependencies:{"@babel/plugin-proposal-private-property-in-object":"^7.16.0"}}],["eslint-config-react-app@*",{peerDependenciesMeta:{typescript:Ge}}],["@vue/eslint-config-typescript@<11.0.0",{peerDependenciesMeta:{typescript:Ge}}],["unplugin-vue2-script-setup@<0.9.1",{peerDependencies:{"@vue/composition-api":"^1.4.3","@vue/runtime-dom":"^3.2.26"}}],["@cypress/snapshot@*",{dependencies:{debug:"^3.2.7"}}],["auto-relay@*",{peerDependencies:{"reflect-metadata":"^0.1.13"}}],["vue-template-babel-compiler@<1.2.0",{peerDependencies:{["vue-template-compiler"]:"^2.6.0"}}],["@parcel/transformer-image@<2.5.0",{peerDependencies:{["@parcel/core"]:"*"}}],["@parcel/transformer-js@<2.5.0",{peerDependencies:{["@parcel/core"]:"*"}}],["parcel@*",{peerDependenciesMeta:{["@parcel/core"]:Ge}}],["react-scripts@*",{peerDependencies:{eslint:"*"}}],["focus-trap-react@^8.0.0",{dependencies:{tabbable:"^5.3.2"}}],["react-rnd@<10.3.7",{peerDependencies:{react:">=16.3.0","react-dom":">=16.3.0"}}],["connect-mongo@*",{peerDependencies:{"express-session":"^1.17.1"}}],["vue-i18n@<9",{peerDependencies:{vue:"^2"}}],["vue-router@<4",{peerDependencies:{vue:"^2"}}],["unified@<10",{dependencies:{"@types/unist":"^2.0.0"}}],["react-github-btn@<=1.3.0",{peerDependencies:{react:">=16.3.0"}}],["react-dev-utils@*",{peerDependencies:{typescript:">=2.7",webpack:">=4"},peerDependenciesMeta:{typescript:{optional:!0}}}],["@asyncapi/react-component@<=1.0.0-next.39",{peerDependencies:{react:">=16.8.0","react-dom":">=16.8.0"}}]];var qN;function vae(){return typeof qN=="undefined"&&(qN=require("zlib").brotliDecompressSync(Buffer.from("G7weAByFTVk3Vs7UfHhq4yykgEM7pbW7TI43SG2S5tvGrwHBAzdz+s/npQ6tgEvobvxisrPIadkXeUAJotBn5bDZ5kAhcRqsIHe3F75Walet5hNalwgFDtxb0BiDUjiUQkjG0yW2hto9HPgiCkm316d6bC0kST72YN7D7rfkhCE9x4J0XwB0yavalxpUu2t9xszHrmtwalOxT7VslsxWcB1qpqZwERUra4psWhTV8BgwWeizurec82Caf1ABL11YMfbf8FJ9JBceZOkgmvrQPbC9DUldX/yMbmX06UQluCEjSwUoyO+EZPIjofr+/oAZUck2enraRD+oWLlnlYnj8xB+gwSo9lmmks4fXv574qSqcWA6z21uYkzMu3EWj+K23RxeQlLqiE35/rC8GcS4CGkKHKKq+zAIQwD9iRDNfiAqueLLpicFFrNsAI4zeTD/eO9MHcnRa5m8UT+M2+V+AkFST4BlKneiAQRSdST8KEAIyFlULt6wa9EBd0Ds28VmpaxquJdVt+nwdEs5xUskI13OVtFyY0UrQIRAlCuvvWivvlSKQfTO+2Q8OyUR1W5RvetaPz4jD27hdtwHFFA1Ptx6Ee/t2cY2rg2G46M1pNDRf2pWhvpy8pqMnuI3++4OF3+7OFIWXGjh+o7Nr2jNvbiYcQdQS1h903/jVFgOpA0yJ78z+x759bFA0rq+6aY5qPB4FzS3oYoLupDUhD9nDz6F6H7hpnlMf18KNKDu4IKjTWwrAnY6MFQw1W6ymOALHlFyCZmQhldg1MQHaMVVQTVgDC60TfaBqG++Y8PEoFhN/PBTZT175KNP/BlHDYGOOBmnBdzqJKplZ/ljiVG0ZBzfqeBRrrUkn6rA54462SgiliKoYVnbeptMdXNfAuaupIEi0bApF10TlgHfmEJAPUVidRVFyDupSem5po5vErPqWKhKbUIp0LozpYsIKK57dM/HKr+nguF+7924IIWMICkQ8JUigs9D+W+c4LnNoRtPPKNRUiCYmP+Jfo2lfKCKw8qpraEeWU3uiNRO6zcyKQoXPR5htmzzLznke7b4YbXW3I1lIRzmgG02Udb58U+7TpwyN7XymCgH+wuPDthZVQvRZuEP+SnLtMicz9m5zASWOBiAcLmkuFlTKuHspSIhCBD0yUPKcxu81A+4YD78rA2vtwsUEday9WNyrShyrl60rWmA+SmbYZkQOwFJWArxRYYc5jGhA5ikxYw1rx3ei4NmeX/lKiwpZ9Ln1tV2Ae7sArvxuVLbJjqJRjW1vFXAyHpvLG+8MJ6T2Ubx5M2KDa2SN6vuIGxJ9WQM9Mk3Q7aCNiZONXllhqq24DmoLbQfW2rYWsOgHWjtOmIQMyMKdiHZDjoyIq5+U700nZ6odJAoYXPQBvFNiQ78d5jaXliBqLTJEqUCwi+LiH2mx92EmNKDsJL74Z613+3lf20pxkV1+erOrjj8pW00vsPaahKUM+05ssd5uwM7K482KWEf3TCwlg/o3e5ngto7qSMz7YteIgCsF1UOcsLk7F7MxWbvrPMY473ew0G+noVL8EPbkmEMftMSeL6HFub/zy+2JQ==","base64")).toString()),qN}var JN;function xae(){return typeof JN=="undefined"&&(JN=require("zlib").brotliDecompressSync(Buffer.from("G8MSIIzURnVBnObTcvb3XE6v2S9Qgc2K801Oa5otNKEtK8BINZNcaQHy+9/vf/WXBimwutXC33P2DPc64pps5rz7NGGWaOKNSPL4Y2KRE8twut2lFOIN+OXPtRmPMRhMTILib2bEQx43az2I5d3YS8Roa5UZpF/ujHb3Djd3GDvYUfvFYSUQ39vb2cmifp/rgB4J/65JK3wRBTvMBoNBmn3mbXC63/gbBkW/2IRPri0O8bcsRBsmarF328pAln04nyJFkwUAvNu934supAqLtyerZZpJ8I8suJHhf/ocMV+scKwa8NOiDKIPXw6Ex/EEZD6TEGaW8N5zvNHYF10l6Lfooj7D5W2k3dgvQSbp2Wv8TGOayS978gxlOLVjTGXs66ozew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ZnrswWjiXy3G+Vbyo1KMopFmmvBwNELgaS8z8dNZchx/Cl/xjddxhMcyqtzFyONb2Zdu90NkI8pAeufe7YlXrp53v8Dj/l8vWeVspRKBGXScBBPI/HinSTGmLDOGGOCIyH0JFdOZx0gWsacNlQLJMIrBhqRxXxHF/5pseWwejlAAvZ3klZSDSYY8mkToaWejXhgNomeGtx1DTLEUFMRkgF5yFB22WYdJnaWN14r1YJj81hGi45+jrADS5nYRhCiSlCJJ1nL8pYX+HDSMhdTEWyRcgHVp/IsUIZYMfT+YYncUQPgcxNGCHfZ88vDdrcUuaGIl6zhAsiaq7R5dfqrqXH/JcBhfjT8D0azayIyEz75Nxp6YkcyDxlJq3EXnJUpqDohJJOysL1t1uNiHESlvsxPb5cpbW0+ICZqJmUZus1BMW0F5IVBODLIo2zHHjA0=","base64")).toString()),JN}var WN;function kae(){return typeof WN=="undefined"&&(WN=require("zlib").brotliDecompressSync(Buffer.from("m/HeG1HktgFU2009LlML2K3wbht8rnXF03SVHSBVb6bUwIJ/X0CPw40xECizvpKcRcKWansp3DpGvMOmCfX1cSwYSTU897x3/dUiIRj6qdVoSiBOoXoNNrhqwKhhnuLKYzT59P10Oq0qXxDajWhLOofkc8GW7/2vYK6AtGTLCpDFavr6bogekTli/vkbZYGLaFta32u59++9nB7UmFK1rcl3I0t0YzBh3+eQxvfLafdcTn9ZSmUtsGfJ4bJLOAGrzby6KLfLDdIzo9AcPu/2LtOjk0IoySWXu+C0WsTK77K5vYzHTWtF0YheJ2TH515eBJNf4L85Udm6MhhVg+kJHVn1Ax96kOVBjhMBVSfCoydTZKtdIHiJpNjCWoXJ3hX0B2Shjur37y/7N53RZwNS9IJQa96AgSBzbi/1PlWn9Jpkq1vSeq3RfECqOlXnNkrvacB/NB8AIgNgEjlJOTdncesBR16OfmTAlQP+NFev3V4Bs6Xsp8zHXMmtEWVh2zOi5bxkZo5pr8w+NDNFlqQqFAutk8nkcPdj9mNS3JQVqQrh+n/TKuk+3YS7c6vab1W1q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mBJczuwKFAhXj41iACLp8VAGQMxuPQkAqIgJcdlqNwDQvUwonupLGr/wDUotd8wAqmpbReCIBoUPGVYzIQBwmY5JrSYuLQjKBY3amgQyNG0LZOgQNhCuhuASE5Zj+3MwEI7eG7Q42d0YmpmER1KpkqfmTOayQKMqC28tT125IQUA0OGuMh/jDMxUSre7DOhkCLrr+rMr3B3d4IC7pyOd4Ny5KlEAgONEOQ4JZSJt1HFuzL46sdivpngAoAjSlVy2u/daWIRNM4//tg/dq5R4FkDTpbZunrzceJG6Hl0ISXWiu1En7TPkqElGl7S8dI2rboPTHQinelsgtdaGAXm0HhGUa0AJAGzGO013A0Ade1X0uVVIcGPuFXfxIe9gCQXdm81qTGyF5hPR73D4ZfCus9vd+BqERE5wCFD1H7ntN4LteLyUPwknevKJMdndmMdoNF5j1WpjDOkA2F5rGIsY6O2pKgUAEHtTVm92KwsYU+HIrmvQcuylbNCgbCZpOOnA7U227cCj7HJt91kuEvu4OpHspzEeAMixJw3Iyz4KzrDv4rjYT8mt2Z/iG4znCn8B","base64")).toString()),WN}var Pae=new Map([[P.makeIdent(null,"fsevents").identHash,vae],[P.makeIdent(null,"resolve").identHash,xae],[P.makeIdent(null,"typescript").identHash,kae]]),EWe={hooks:{registerPackageExtensions:async(r,e)=>{for(let[t,i]of YN)e(P.parseDescriptor(t,!0),i)},getBuiltinPatch:async(r,e)=>{var s;let t="compat/";if(!e.startsWith(t))return;let i=P.parseIdent(e.slice(t.length)),n=(s=Pae.get(i.identHash))==null?void 0:s();return typeof n!="undefined"?n:null},reduceDependency:async(r,e,t,i)=>typeof Pae.get(r.identHash)=="undefined"?r:P.makeDescriptor(r,P.makeRange({protocol:"patch:",source:P.stringifyDescriptor(r),selector:`~builtin`,params:null}))}},IWe=EWe;var _N={};ft(_N,{default:()=>wWe});var X0=class extends Le{constructor(){super(...arguments);this.pkg=J.String("-p,--package",{description:"The package to run the provided command from"});this.quiet=J.Boolean("-q,--quiet",!1,{description:"Only report critical errors instead of printing the full install logs"});this.command=J.String();this.args=J.Proxy()}async execute(){let e=[];this.pkg&&e.push("--package",this.pkg),this.quiet&&e.push("--quiet");let t=P.parseDescriptor(this.command),i;t.scope?i=P.makeIdent(t.scope,`create-${t.name}`):t.name.startsWith("@")?i=P.makeIdent(t.name.substring(1),"create"):i=P.makeIdent(null,`create-${t.name}`);let n=P.stringifyIdent(i);return t.range!=="unknown"&&(n+=`@${t.range}`),this.cli.run(["dlx",...e,n,...this.args])}};X0.paths=[["create"]];var Dae=X0;var Dm=class extends Le{constructor(){super(...arguments);this.packages=J.Array("-p,--package",{description:"The package(s) to install before running the command"});this.quiet=J.Boolean("-q,--quiet",!1,{description:"Only report critical errors instead of printing the full install logs"});this.command=J.String();this.args=J.Proxy()}async execute(){return ye.telemetry=null,await K.mktempPromise(async e=>{var p;let t=k.join(e,`dlx-${process.pid}`);await K.mkdirPromise(t),await K.writeFilePromise(k.join(t,"package.json"),`{} -`),await K.writeFilePromise(k.join(t,"yarn.lock"),"");let i=k.join(t,".yarnrc.yml"),n=await ye.findProjectCwd(this.context.cwd,kt.lockfile),s=!(await ye.find(this.context.cwd,null,{strict:!1})).get("enableGlobalCache"),o=n!==null?k.join(n,".yarnrc.yml"):null;o!==null&&K.existsSync(o)?(await K.copyFilePromise(o,i),await ye.updateConfiguration(t,m=>{let y=te(N({},m),{enableGlobalCache:s,enableTelemetry:!1});return Array.isArray(m.plugins)&&(y.plugins=m.plugins.map(b=>{let v=typeof b=="string"?b:b.path,x=H.isAbsolute(v)?v:H.resolve(H.fromPortablePath(n),v);return typeof b=="string"?x:{path:x,spec:b.spec}})),y})):await K.writeFilePromise(i,`enableGlobalCache: ${s} -enableTelemetry: false -`);let a=(p=this.packages)!=null?p:[this.command],l=P.parseDescriptor(this.command).name,c=await this.cli.run(["add","--",...a],{cwd:t,quiet:this.quiet});if(c!==0)return c;this.quiet||this.context.stdout.write(` -`);let u=await ye.find(t,this.context.plugins),{project:g,workspace:f}=await ze.find(u,t);if(f===null)throw new ht(g.cwd,t);await g.restoreInstallState();let h=await Zt.getWorkspaceAccessibleBinaries(f);return h.has(l)===!1&&h.size===1&&typeof this.packages=="undefined"&&(l=Array.from(h)[0][0]),await Zt.executeWorkspaceAccessibleBinary(f,l,this.args,{packageAccessibleBinaries:h,cwd:this.context.cwd,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr})})}};Dm.paths=[["dlx"]],Dm.usage=Re.Usage({description:"run a package in a temporary environment",details:"\n This command will install a package within a temporary environment, and run its binary script if it contains any. The binary will run within the current cwd.\n\n By default Yarn will download the package named `command`, but this can be changed through the use of the `-p,--package` flag which will instruct Yarn to still run the same command but from a different package.\n\n Using `yarn dlx` as a replacement of `yarn add` isn't recommended, as it makes your project non-deterministic (Yarn doesn't keep track of the packages installed through `dlx` - neither their name, nor their version).\n ",examples:[["Use create-react-app to create a new React app","yarn dlx create-react-app ./my-app"],["Install multiple packages for a single command",`yarn dlx -p typescript -p ts-node ts-node --transpile-only -e "console.log('hello!')"`]]});var Rae=Dm;var yWe={commands:[Dae,Rae]},wWe=yWe;var nL={};ft(nL,{default:()=>QWe,fileUtils:()=>VN});var nh=/^(?:[a-zA-Z]:[\\/]|\.{0,2}\/)/,Rm=/^[^?]*\.(?:tar\.gz|tgz)(?:::.*)?$/,Xr="file:";var VN={};ft(VN,{makeArchiveFromLocator:()=>Z0,makeBufferFromLocator:()=>$N,makeLocator:()=>ZN,makeSpec:()=>Fae,parseSpec:()=>XN});function XN(r){let{params:e,selector:t}=P.parseRange(r),i=H.toPortablePath(t);return{parentLocator:e&&typeof e.locator=="string"?P.parseLocator(e.locator):null,path:i}}function Fae({parentLocator:r,path:e,folderHash:t,protocol:i}){let n=r!==null?{locator:P.stringifyLocator(r)}:{},s=typeof t!="undefined"?{hash:t}:{};return P.makeRange({protocol:i,source:e,selector:e,params:N(N({},s),n)})}function ZN(r,{parentLocator:e,path:t,folderHash:i,protocol:n}){return P.makeLocator(r,Fae({parentLocator:e,path:t,folderHash:i,protocol:n}))}async function Z0(r,{protocol:e,fetchOptions:t,inMemory:i=!1}){let{parentLocator:n,path:s}=P.parseFileStyleRange(r.reference,{protocol:e}),o=k.isAbsolute(s)?{packageFs:new _t(Me.root),prefixPath:Me.dot,localPath:Me.root}:await t.fetcher.fetch(n,t),a=o.localPath?{packageFs:new _t(Me.root),prefixPath:k.relative(Me.root,o.localPath)}:o;o!==a&&o.releaseFs&&o.releaseFs();let l=a.packageFs,c=k.join(a.prefixPath,s);return await Se.releaseAfterUseAsync(async()=>await Bi.makeArchiveFromDirectory(c,{baseFs:l,prefixPath:P.getIdentVendorPath(r),compressionLevel:t.project.configuration.get("compressionLevel"),inMemory:i}),a.releaseFs)}async function $N(r,{protocol:e,fetchOptions:t}){return(await Z0(r,{protocol:e,fetchOptions:t,inMemory:!0})).getBufferAndClose()}var eL=class{supports(e,t){return!!e.reference.startsWith(Xr)}getLocalPath(e,t){let{parentLocator:i,path:n}=P.parseFileStyleRange(e.reference,{protocol:Xr});if(k.isAbsolute(n))return n;let s=t.fetcher.getLocalPath(i,t);return s===null?null:k.resolve(s,n)}async fetch(e,t){let i=t.checksums.get(e.locatorHash)||null,[n,s,o]=await t.cache.fetchPackageFromCache(e,i,N({onHit:()=>t.report.reportCacheHit(e),onMiss:()=>t.report.reportCacheMiss(e,`${P.prettyLocator(t.project.configuration,e)} can't be found in the cache and will be fetched from the disk`),loader:()=>this.fetchFromDisk(e,t),skipIntegrityCheck:t.skipIntegrityCheck},t.cacheOptions));return{packageFs:n,releaseFs:s,prefixPath:P.getIdentVendorPath(e),localPath:this.getLocalPath(e,t),checksum:o}}async fetchFromDisk(e,t){return Z0(e,{protocol:Xr,fetchOptions:t})}};var BWe=2,tL=class{supportsDescriptor(e,t){return e.range.match(nh)?!0:!!e.range.startsWith(Xr)}supportsLocator(e,t){return!!e.reference.startsWith(Xr)}shouldPersistResolution(e,t){return!1}bindDescriptor(e,t,i){return nh.test(e.range)&&(e=P.makeDescriptor(e,`${Xr}${e.range}`)),P.bindDescriptor(e,{locator:P.stringifyLocator(t)})}getResolutionDependencies(e,t){return[]}async getCandidates(e,t,i){if(!i.fetchOptions)throw new Error("Assertion failed: This resolver cannot be used unless a fetcher is configured");let{path:n,parentLocator:s}=XN(e.range);if(s===null)throw new Error("Assertion failed: The descriptor should have been bound");let o=await $N(P.makeLocator(e,P.makeRange({protocol:Xr,source:n,selector:n,params:{locator:P.stringifyLocator(s)}})),{protocol:Xr,fetchOptions:i.fetchOptions}),a=Dn.makeHash(`${BWe}`,o).slice(0,6);return[ZN(e,{parentLocator:s,path:n,folderHash:a,protocol:Xr})]}async getSatisfying(e,t,i){return null}async resolve(e,t){if(!t.fetchOptions)throw new Error("Assertion failed: This resolver cannot be used unless a fetcher is configured");let i=await t.fetchOptions.fetcher.fetch(e,t.fetchOptions),n=await Se.releaseAfterUseAsync(async()=>await At.find(i.prefixPath,{baseFs:i.packageFs}),i.releaseFs);return te(N({},e),{version:n.version||"0.0.0",languageName:n.languageName||t.project.configuration.get("defaultLanguageName"),linkType:Qt.HARD,conditions:n.getConditions(),dependencies:n.dependencies,peerDependencies:n.peerDependencies,dependenciesMeta:n.dependenciesMeta,peerDependenciesMeta:n.peerDependenciesMeta,bin:n.bin})}};var rL=class{supports(e,t){return Rm.test(e.reference)?!!e.reference.startsWith(Xr):!1}getLocalPath(e,t){return null}async fetch(e,t){let i=t.checksums.get(e.locatorHash)||null,[n,s,o]=await t.cache.fetchPackageFromCache(e,i,N({onHit:()=>t.report.reportCacheHit(e),onMiss:()=>t.report.reportCacheMiss(e,`${P.prettyLocator(t.project.configuration,e)} can't be found in the cache and will be fetched from the disk`),loader:()=>this.fetchFromDisk(e,t),skipIntegrityCheck:t.skipIntegrityCheck},t.cacheOptions));return{packageFs:n,releaseFs:s,prefixPath:P.getIdentVendorPath(e),checksum:o}}async fetchFromDisk(e,t){let{parentLocator:i,path:n}=P.parseFileStyleRange(e.reference,{protocol:Xr}),s=k.isAbsolute(n)?{packageFs:new _t(Me.root),prefixPath:Me.dot,localPath:Me.root}:await t.fetcher.fetch(i,t),o=s.localPath?{packageFs:new _t(Me.root),prefixPath:k.relative(Me.root,s.localPath)}:s;s!==o&&s.releaseFs&&s.releaseFs();let a=o.packageFs,l=k.join(o.prefixPath,n),c=await a.readFilePromise(l);return await Se.releaseAfterUseAsync(async()=>await Bi.convertToZip(c,{compressionLevel:t.project.configuration.get("compressionLevel"),prefixPath:P.getIdentVendorPath(e),stripComponents:1}),o.releaseFs)}};var iL=class{supportsDescriptor(e,t){return Rm.test(e.range)?!!(e.range.startsWith(Xr)||nh.test(e.range)):!1}supportsLocator(e,t){return Rm.test(e.reference)?!!e.reference.startsWith(Xr):!1}shouldPersistResolution(e,t){return!0}bindDescriptor(e,t,i){return nh.test(e.range)&&(e=P.makeDescriptor(e,`${Xr}${e.range}`)),P.bindDescriptor(e,{locator:P.stringifyLocator(t)})}getResolutionDependencies(e,t){return[]}async getCandidates(e,t,i){let n=e.range;return n.startsWith(Xr)&&(n=n.slice(Xr.length)),[P.makeLocator(e,`${Xr}${H.toPortablePath(n)}`)]}async getSatisfying(e,t,i){return null}async resolve(e,t){if(!t.fetchOptions)throw new Error("Assertion failed: This resolver cannot be used unless a fetcher is configured");let i=await t.fetchOptions.fetcher.fetch(e,t.fetchOptions),n=await Se.releaseAfterUseAsync(async()=>await At.find(i.prefixPath,{baseFs:i.packageFs}),i.releaseFs);return te(N({},e),{version:n.version||"0.0.0",languageName:n.languageName||t.project.configuration.get("defaultLanguageName"),linkType:Qt.HARD,conditions:n.getConditions(),dependencies:n.dependencies,peerDependencies:n.peerDependencies,dependenciesMeta:n.dependenciesMeta,peerDependenciesMeta:n.peerDependenciesMeta,bin:n.bin})}};var bWe={fetchers:[rL,eL],resolvers:[iL,tL]},QWe=bWe;var oL={};ft(oL,{default:()=>xWe});var Nae=ge(require("querystring")),Lae=[/^https?:\/\/(?:([^/]+?)@)?github.com\/([^/#]+)\/([^/#]+)\/tarball\/([^/#]+)(?:#(.*))?$/,/^https?:\/\/(?:([^/]+?)@)?github.com\/([^/#]+)\/([^/#]+?)(?:\.git)?(?:#(.*))?$/];function Tae(r){return r?Lae.some(e=>!!r.match(e)):!1}function Oae(r){let e;for(let a of Lae)if(e=r.match(a),e)break;if(!e)throw new Error(SWe(r));let[,t,i,n,s="master"]=e,{commit:o}=Nae.default.parse(s);return s=o||s.replace(/[^:]*:/,""),{auth:t,username:i,reponame:n,treeish:s}}function SWe(r){return`Input cannot be parsed as a valid GitHub URL ('${r}').`}var sL=class{supports(e,t){return!!Tae(e.reference)}getLocalPath(e,t){return null}async fetch(e,t){let i=t.checksums.get(e.locatorHash)||null,[n,s,o]=await t.cache.fetchPackageFromCache(e,i,N({onHit:()=>t.report.reportCacheHit(e),onMiss:()=>t.report.reportCacheMiss(e,`${P.prettyLocator(t.project.configuration,e)} can't be found in the cache and will be fetched from GitHub`),loader:()=>this.fetchFromNetwork(e,t),skipIntegrityCheck:t.skipIntegrityCheck},t.cacheOptions));return{packageFs:n,releaseFs:s,prefixPath:P.getIdentVendorPath(e),checksum:o}}async fetchFromNetwork(e,t){let i=await ir.get(this.getLocatorUrl(e,t),{configuration:t.project.configuration});return await K.mktempPromise(async n=>{let s=new _t(n);await Bi.extractArchiveTo(i,s,{stripComponents:1});let o=Qu.splitRepoUrl(e.reference),a=k.join(n,"package.tgz");await Zt.prepareExternalProject(n,a,{configuration:t.project.configuration,report:t.report,workspace:o.extra.workspace,locator:e});let l=await K.readFilePromise(a);return await Bi.convertToZip(l,{compressionLevel:t.project.configuration.get("compressionLevel"),prefixPath:P.getIdentVendorPath(e),stripComponents:1})})}getLocatorUrl(e,t){let{auth:i,username:n,reponame:s,treeish:o}=Oae(e.reference);return`https://${i?`${i}@`:""}github.com/${n}/${s}/archive/${o}.tar.gz`}};var vWe={hooks:{async fetchHostedRepository(r,e,t){if(r!==null)return r;let i=new sL;if(!i.supports(e,t))return null;try{return await i.fetch(e,t)}catch(n){return null}}}},xWe=vWe;var lL={};ft(lL,{default:()=>PWe});var Fm=/^[^?]*\.(?:tar\.gz|tgz)(?:\?.*)?$/,Nm=/^https?:/;var aL=class{supports(e,t){return Fm.test(e.reference)?!!Nm.test(e.reference):!1}getLocalPath(e,t){return null}async fetch(e,t){let i=t.checksums.get(e.locatorHash)||null,[n,s,o]=await t.cache.fetchPackageFromCache(e,i,N({onHit:()=>t.report.reportCacheHit(e),onMiss:()=>t.report.reportCacheMiss(e,`${P.prettyLocator(t.project.configuration,e)} can't be found in the cache and will be fetched from the remote server`),loader:()=>this.fetchFromNetwork(e,t),skipIntegrityCheck:t.skipIntegrityCheck},t.cacheOptions));return{packageFs:n,releaseFs:s,prefixPath:P.getIdentVendorPath(e),checksum:o}}async fetchFromNetwork(e,t){let i=await ir.get(e.reference,{configuration:t.project.configuration});return await Bi.convertToZip(i,{compressionLevel:t.project.configuration.get("compressionLevel"),prefixPath:P.getIdentVendorPath(e),stripComponents:1})}};var AL=class{supportsDescriptor(e,t){return Fm.test(e.range)?!!Nm.test(e.range):!1}supportsLocator(e,t){return Fm.test(e.reference)?!!Nm.test(e.reference):!1}shouldPersistResolution(e,t){return!0}bindDescriptor(e,t,i){return e}getResolutionDependencies(e,t){return[]}async getCandidates(e,t,i){return[P.convertDescriptorToLocator(e)]}async getSatisfying(e,t,i){return null}async resolve(e,t){if(!t.fetchOptions)throw new Error("Assertion failed: This resolver cannot be used unless a fetcher is configured");let i=await t.fetchOptions.fetcher.fetch(e,t.fetchOptions),n=await Se.releaseAfterUseAsync(async()=>await At.find(i.prefixPath,{baseFs:i.packageFs}),i.releaseFs);return te(N({},e),{version:n.version||"0.0.0",languageName:n.languageName||t.project.configuration.get("defaultLanguageName"),linkType:Qt.HARD,conditions:n.getConditions(),dependencies:n.dependencies,peerDependencies:n.peerDependencies,dependenciesMeta:n.dependenciesMeta,peerDependenciesMeta:n.peerDependenciesMeta,bin:n.bin})}};var kWe={fetchers:[aL],resolvers:[AL]},PWe=kWe;var fL={};ft(fL,{default:()=>D4e});var cAe=ge(lAe()),gL=ge(require("util")),Lm=class extends Le{constructor(){super(...arguments);this.private=J.Boolean("-p,--private",!1,{description:"Initialize a private package"});this.workspace=J.Boolean("-w,--workspace",!1,{description:"Initialize a workspace root with a `packages/` directory"});this.install=J.String("-i,--install",!1,{tolerateBoolean:!0,description:"Initialize a package with a specific bundle that will be locked in the project"});this.usev2=J.Boolean("-2",!1,{hidden:!0});this.yes=J.Boolean("-y,--yes",{hidden:!0});this.assumeFreshProject=J.Boolean("--assume-fresh-project",!1,{hidden:!0})}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),t=typeof this.install=="string"?this.install:this.usev2||this.install===!0?"latest":null;return t!==null?await this.executeProxy(e,t):await this.executeRegular(e)}async executeProxy(e,t){if(e.projectCwd!==null&&e.projectCwd!==this.context.cwd)throw new Pe("Cannot use the --install flag from within a project subdirectory");K.existsSync(this.context.cwd)||await K.mkdirPromise(this.context.cwd,{recursive:!0});let i=k.join(this.context.cwd,e.get("lockfileFilename"));K.existsSync(i)||await K.writeFilePromise(i,"");let n=await this.cli.run(["set","version",t],{quiet:!0});if(n!==0)return n;let s=[];return this.private&&s.push("-p"),this.workspace&&s.push("-w"),this.yes&&s.push("-y"),await K.mktempPromise(async o=>{let{code:a}=await Nr.pipevp("yarn",["init",...s],{cwd:this.context.cwd,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr,env:await Zt.makeScriptEnv({binFolder:o})});return a})}async executeRegular(e){var l;let t=null;try{t=(await ze.find(e,this.context.cwd)).project}catch{t=null}K.existsSync(this.context.cwd)||await K.mkdirPromise(this.context.cwd,{recursive:!0});let i=await At.tryFind(this.context.cwd)||new At,n=Object.fromEntries(e.get("initFields").entries());i.load(n),i.name=(l=i.name)!=null?l:P.makeIdent(e.get("initScope"),k.basename(this.context.cwd)),i.packageManager=Ur&&Se.isTaggedYarnVersion(Ur)?`yarn@${Ur}`:null,typeof i.raw.private=="undefined"&&(this.private||this.workspace&&i.workspaceDefinitions.length===0)&&(i.private=!0),this.workspace&&i.workspaceDefinitions.length===0&&(await K.mkdirPromise(k.join(this.context.cwd,"packages"),{recursive:!0}),i.workspaceDefinitions=[{pattern:"packages/*"}]);let s={};i.exportTo(s),gL.inspect.styles.name="cyan",this.context.stdout.write(`${(0,gL.inspect)(s,{depth:Infinity,colors:!0,compact:!1})} -`);let o=k.join(this.context.cwd,At.fileName);await K.changeFilePromise(o,`${JSON.stringify(s,null,2)} -`,{automaticNewlines:!0});let a=k.join(this.context.cwd,"README.md");if(K.existsSync(a)||await K.writeFilePromise(a,`# ${P.stringifyIdent(i.name)} -`),!t||t.cwd===this.context.cwd){let c=k.join(this.context.cwd,kt.lockfile);K.existsSync(c)||await K.writeFilePromise(c,"");let g=[".yarn/*","!.yarn/patches","!.yarn/plugins","!.yarn/releases","!.yarn/sdks","!.yarn/versions","","# Swap the comments on the following lines if you don't wish to use zero-installs","# Documentation here: https://yarnpkg.com/features/zero-installs","!.yarn/cache","#.pnp.*"].map(y=>`${y} -`).join(""),f=k.join(this.context.cwd,".gitignore");K.existsSync(f)||await K.writeFilePromise(f,g);let h={["*"]:{endOfLine:"lf",insertFinalNewline:!0},["*.{js,json,yml}"]:{charset:"utf-8",indentStyle:"space",indentSize:2}};(0,cAe.default)(h,e.get("initEditorConfig"));let p=`root = true -`;for(let[y,b]of Object.entries(h)){p+=` -[${y}] -`;for(let[v,x]of Object.entries(b))p+=`${v.replace(/[A-Z]/g,q=>`_${q.toLowerCase()}`)} = ${x} -`}let m=k.join(this.context.cwd,".editorconfig");K.existsSync(m)||await K.writeFilePromise(m,p),K.existsSync(k.join(this.context.cwd,".git"))||await Nr.execvp("git",["init"],{cwd:this.context.cwd})}}};Lm.paths=[["init"]],Lm.usage=Re.Usage({description:"create a new package",details:"\n This command will setup a new package in your local directory.\n\n If the `-p,--private` or `-w,--workspace` options are set, the package will be private by default.\n\n If the `-w,--workspace` option is set, the package will be configured to accept a set of workspaces in the `packages/` directory.\n\n If the `-i,--install` option is given a value, Yarn will first download it using `yarn set version` and only then forward the init call to the newly downloaded bundle. Without arguments, the downloaded bundle will be `latest`.\n\n The initial settings of the manifest can be changed by using the `initScope` and `initFields` configuration values. Additionally, Yarn will generate an EditorConfig file whose rules can be altered via `initEditorConfig`, and will initialize a Git repository in the current directory.\n ",examples:[["Create a new package in the local directory","yarn init"],["Create a new private package in the local directory","yarn init -p"],["Create a new package and store the Yarn release inside","yarn init -i=latest"],["Create a new private package and defines it as a workspace root","yarn init -w"]]});var uAe=Lm;var P4e={configuration:{initScope:{description:"Scope used when creating packages via the init command",type:Ie.STRING,default:null},initFields:{description:"Additional fields to set when creating packages via the init command",type:Ie.MAP,valueDefinition:{description:"",type:Ie.ANY}},initEditorConfig:{description:"Extra rules to define in the generator editorconfig",type:Ie.MAP,valueDefinition:{description:"",type:Ie.ANY}}},commands:[uAe]},D4e=P4e;var mL={};ft(mL,{default:()=>F4e});var wA="portal:",BA="link:";var hL=class{supports(e,t){return!!e.reference.startsWith(wA)}getLocalPath(e,t){let{parentLocator:i,path:n}=P.parseFileStyleRange(e.reference,{protocol:wA});if(k.isAbsolute(n))return n;let s=t.fetcher.getLocalPath(i,t);return s===null?null:k.resolve(s,n)}async fetch(e,t){var c;let{parentLocator:i,path:n}=P.parseFileStyleRange(e.reference,{protocol:wA}),s=k.isAbsolute(n)?{packageFs:new _t(Me.root),prefixPath:Me.dot,localPath:Me.root}:await t.fetcher.fetch(i,t),o=s.localPath?{packageFs:new _t(Me.root),prefixPath:k.relative(Me.root,s.localPath),localPath:Me.root}:s;s!==o&&s.releaseFs&&s.releaseFs();let a=o.packageFs,l=k.resolve((c=o.localPath)!=null?c:o.packageFs.getRealPath(),o.prefixPath,n);return s.localPath?{packageFs:new _t(l,{baseFs:a}),releaseFs:o.releaseFs,prefixPath:Me.dot,localPath:l}:{packageFs:new La(l,{baseFs:a}),releaseFs:o.releaseFs,prefixPath:Me.dot}}};var pL=class{supportsDescriptor(e,t){return!!e.range.startsWith(wA)}supportsLocator(e,t){return!!e.reference.startsWith(wA)}shouldPersistResolution(e,t){return!1}bindDescriptor(e,t,i){return P.bindDescriptor(e,{locator:P.stringifyLocator(t)})}getResolutionDependencies(e,t){return[]}async getCandidates(e,t,i){let n=e.range.slice(wA.length);return[P.makeLocator(e,`${wA}${H.toPortablePath(n)}`)]}async getSatisfying(e,t,i){return null}async resolve(e,t){if(!t.fetchOptions)throw new Error("Assertion failed: This resolver cannot be used unless a fetcher is configured");let i=await t.fetchOptions.fetcher.fetch(e,t.fetchOptions),n=await Se.releaseAfterUseAsync(async()=>await At.find(i.prefixPath,{baseFs:i.packageFs}),i.releaseFs);return te(N({},e),{version:n.version||"0.0.0",languageName:n.languageName||t.project.configuration.get("defaultLanguageName"),linkType:Qt.SOFT,conditions:n.getConditions(),dependencies:new Map([...n.dependencies]),peerDependencies:n.peerDependencies,dependenciesMeta:n.dependenciesMeta,peerDependenciesMeta:n.peerDependenciesMeta,bin:n.bin})}};var dL=class{supports(e,t){return!!e.reference.startsWith(BA)}getLocalPath(e,t){let{parentLocator:i,path:n}=P.parseFileStyleRange(e.reference,{protocol:BA});if(k.isAbsolute(n))return n;let s=t.fetcher.getLocalPath(i,t);return s===null?null:k.resolve(s,n)}async fetch(e,t){var c;let{parentLocator:i,path:n}=P.parseFileStyleRange(e.reference,{protocol:BA}),s=k.isAbsolute(n)?{packageFs:new _t(Me.root),prefixPath:Me.dot,localPath:Me.root}:await t.fetcher.fetch(i,t),o=s.localPath?{packageFs:new _t(Me.root),prefixPath:k.relative(Me.root,s.localPath),localPath:Me.root}:s;s!==o&&s.releaseFs&&s.releaseFs();let a=o.packageFs,l=k.resolve((c=o.localPath)!=null?c:o.packageFs.getRealPath(),o.prefixPath,n);return s.localPath?{packageFs:new _t(l,{baseFs:a}),releaseFs:o.releaseFs,prefixPath:Me.dot,discardFromLookup:!0,localPath:l}:{packageFs:new La(l,{baseFs:a}),releaseFs:o.releaseFs,prefixPath:Me.dot,discardFromLookup:!0}}};var CL=class{supportsDescriptor(e,t){return!!e.range.startsWith(BA)}supportsLocator(e,t){return!!e.reference.startsWith(BA)}shouldPersistResolution(e,t){return!1}bindDescriptor(e,t,i){return P.bindDescriptor(e,{locator:P.stringifyLocator(t)})}getResolutionDependencies(e,t){return[]}async getCandidates(e,t,i){let n=e.range.slice(BA.length);return[P.makeLocator(e,`${BA}${H.toPortablePath(n)}`)]}async getSatisfying(e,t,i){return null}async resolve(e,t){return te(N({},e),{version:"0.0.0",languageName:t.project.configuration.get("defaultLanguageName"),linkType:Qt.SOFT,conditions:null,dependencies:new Map,peerDependencies:new Map,dependenciesMeta:new Map,peerDependenciesMeta:new Map,bin:new Map})}};var R4e={fetchers:[dL,hL],resolvers:[CL,pL]},F4e=R4e;var JL={};ft(JL,{default:()=>j8e});var Mn;(function(i){i[i.REGULAR=0]="REGULAR",i[i.WORKSPACE=1]="WORKSPACE",i[i.EXTERNAL_SOFT_LINK=2]="EXTERNAL_SOFT_LINK"})(Mn||(Mn={}));var bA;(function(i){i[i.YES=0]="YES",i[i.NO=1]="NO",i[i.DEPENDS=2]="DEPENDS"})(bA||(bA={}));var EL=(r,e)=>`${r}@${e}`,gAe=(r,e)=>{let t=e.indexOf("#"),i=t>=0?e.substring(t+1):e;return EL(r,i)},yo;(function(s){s[s.NONE=-1]="NONE",s[s.PERF=0]="PERF",s[s.CHECK=1]="CHECK",s[s.REASONS=2]="REASONS",s[s.INTENSIVE_CHECK=9]="INTENSIVE_CHECK"})(yo||(yo={}));var hAe=(r,e={})=>{let t=e.debugLevel||Number(process.env.NM_DEBUG_LEVEL||-1),i=e.check||t>=9,n=e.hoistingLimits||new Map,s={check:i,debugLevel:t,hoistingLimits:n,fastLookupPossible:!0},o;s.debugLevel>=0&&(o=Date.now());let a=N4e(r,s),l=!1,c=0;do l=IL(a,[a],new Set([a.locator]),new Map,s).anotherRoundNeeded,s.fastLookupPossible=!1,c++;while(l);if(s.debugLevel>=0&&console.log(`hoist time: ${Date.now()-o}ms, rounds: ${c}`),s.debugLevel>=1){let u=Tm(a);if(IL(a,[a],new Set([a.locator]),new Map,s).isGraphChanged)throw new Error(`The hoisting result is not terminal, prev tree: -${u}, next tree: -${Tm(a)}`);let f=fAe(a);if(f)throw new Error(`${f}, after hoisting finished: -${Tm(a)}`)}return s.debugLevel>=2&&console.log(Tm(a)),L4e(a)},T4e=r=>{let e=r[r.length-1],t=new Map,i=new Set,n=s=>{if(!i.has(s)){i.add(s);for(let o of s.hoistedDependencies.values())t.set(o.name,o);for(let o of s.dependencies.values())s.peerNames.has(o.name)||n(o)}};return n(e),t},O4e=r=>{let e=r[r.length-1],t=new Map,i=new Set,n=new Set,s=(o,a)=>{if(i.has(o))return;i.add(o);for(let c of o.hoistedDependencies.values())if(!a.has(c.name)){let u;for(let g of r)u=g.dependencies.get(c.name),u&&t.set(u.name,u)}let l=new Set;for(let c of o.dependencies.values())l.add(c.name);for(let c of o.dependencies.values())o.peerNames.has(c.name)||s(c,l)};return s(e,n),t},pAe=(r,e)=>{if(e.decoupled)return e;let{name:t,references:i,ident:n,locator:s,dependencies:o,originalDependencies:a,hoistedDependencies:l,peerNames:c,reasons:u,isHoistBorder:g,hoistPriority:f,dependencyKind:h,hoistedFrom:p,hoistedTo:m}=e,y={name:t,references:new Set(i),ident:n,locator:s,dependencies:new Map(o),originalDependencies:new Map(a),hoistedDependencies:new Map(l),peerNames:new Set(c),reasons:new Map(u),decoupled:!0,isHoistBorder:g,hoistPriority:f,dependencyKind:h,hoistedFrom:new Map(p),hoistedTo:new Map(m)},b=y.dependencies.get(t);return b&&b.ident==y.ident&&y.dependencies.set(t,y),r.dependencies.set(y.name,y),y},M4e=(r,e)=>{let t=new Map([[r.name,[r.ident]]]);for(let n of r.dependencies.values())r.peerNames.has(n.name)||t.set(n.name,[n.ident]);let i=Array.from(e.keys());i.sort((n,s)=>{let o=e.get(n),a=e.get(s);return a.hoistPriority!==o.hoistPriority?a.hoistPriority-o.hoistPriority:a.peerDependents.size!==o.peerDependents.size?a.peerDependents.size-o.peerDependents.size:a.dependents.size-o.dependents.size});for(let n of i){let s=n.substring(0,n.indexOf("@",1)),o=n.substring(s.length+1);if(!r.peerNames.has(s)){let a=t.get(s);a||(a=[],t.set(s,a)),a.indexOf(o)<0&&a.push(o)}}return t},yL=r=>{let e=new Set,t=(i,n=new Set)=>{if(!n.has(i)){n.add(i);for(let s of i.peerNames)if(!r.peerNames.has(s)){let o=r.dependencies.get(s);o&&!e.has(o)&&t(o,n)}e.add(i)}};for(let i of r.dependencies.values())r.peerNames.has(i.name)||t(i);return e},IL=(r,e,t,i,n,s=new Set)=>{let o=e[e.length-1];if(s.has(o))return{anotherRoundNeeded:!1,isGraphChanged:!1};s.add(o);let a=U4e(o),l=M4e(o,a),c=r==o?new Map:n.fastLookupPossible?T4e(e):O4e(e),u,g=!1,f=!1,h=new Map(Array.from(l.entries()).map(([m,y])=>[m,y[0]])),p=new Map;do{let m=K4e(r,e,t,c,h,l,i,p,n);m.isGraphChanged&&(f=!0),m.anotherRoundNeeded&&(g=!0),u=!1;for(let[y,b]of l)b.length>1&&!o.dependencies.has(y)&&(h.delete(y),b.shift(),h.set(y,b[0]),u=!0)}while(u);for(let m of o.dependencies.values())if(!o.peerNames.has(m.name)&&!t.has(m.locator)){t.add(m.locator);let y=IL(r,[...e,m],t,p,n);y.isGraphChanged&&(f=!0),y.anotherRoundNeeded&&(g=!0),t.delete(m.locator)}return{anotherRoundNeeded:g,isGraphChanged:f}},H4e=r=>{for(let[e,t]of r.dependencies)if(!r.peerNames.has(e)&&t.ident!==r.ident)return!0;return!1},j4e=(r,e,t,i,n,s,o,a,{outputReason:l,fastLookupPossible:c})=>{let u,g=null,f=new Set;l&&(u=`${Array.from(e).map(y=>Li(y)).join("\u2192")}`);let h=t[t.length-1],m=!(i.ident===h.ident);if(l&&!m&&(g="- self-reference"),m&&(m=i.dependencyKind!==1,l&&!m&&(g="- workspace")),m&&i.dependencyKind===2&&(m=!H4e(i),l&&!m&&(g="- external soft link with unhoisted dependencies")),m&&(m=h.dependencyKind!==1||h.hoistedFrom.has(i.name)||e.size===1,l&&!m&&(g=h.reasons.get(i.name))),m&&(m=!r.peerNames.has(i.name),l&&!m&&(g=`- cannot shadow peer: ${Li(r.originalDependencies.get(i.name).locator)} at ${u}`)),m){let y=!1,b=n.get(i.name);if(y=!b||b.ident===i.ident,l&&!y&&(g=`- filled by: ${Li(b.locator)} at ${u}`),y)for(let v=t.length-1;v>=1;v--){let T=t[v].dependencies.get(i.name);if(T&&T.ident!==i.ident){y=!1;let q=a.get(h);q||(q=new Set,a.set(h,q)),q.add(i.name),l&&(g=`- filled by ${Li(T.locator)} at ${t.slice(0,v).map(Y=>Li(Y.locator)).join("\u2192")}`);break}}m=y}if(m&&(m=s.get(i.name)===i.ident,l&&!m&&(g=`- filled by: ${Li(o.get(i.name)[0])} at ${u}`)),m){let y=!0,b=new Set(i.peerNames);for(let v=t.length-1;v>=1;v--){let x=t[v];for(let T of b){if(x.peerNames.has(T)&&x.originalDependencies.has(T))continue;let q=x.dependencies.get(T);q&&r.dependencies.get(T)!==q&&(v===t.length-1?f.add(q):(f=null,y=!1,l&&(g=`- peer dependency ${Li(q.locator)} from parent ${Li(x.locator)} was not hoisted to ${u}`))),b.delete(T)}if(!y)break}m=y}if(m&&!c)for(let y of i.hoistedDependencies.values()){let b=n.get(y.name)||r.dependencies.get(y.name);if(!b||y.ident!==b.ident){m=!1,l&&(g=`- previously hoisted dependency mismatch, needed: ${Li(y.locator)}, available: ${Li(b==null?void 0:b.locator)}`);break}}return f!==null&&f.size>0?{isHoistable:2,dependsOn:f,reason:g}:{isHoistable:m?0:1,reason:g}},$0=r=>`${r.name}@${r.locator}`,K4e=(r,e,t,i,n,s,o,a,l)=>{let c=e[e.length-1],u=new Set,g=!1,f=!1,h=(b,v,x,T,q)=>{if(u.has(T))return;let Y=[...v,$0(T)],$=[...x,$0(T)],_=new Map,ne=new Map;for(let Z of yL(T)){let O=j4e(c,t,[c,...b,T],Z,i,n,s,a,{outputReason:l.debugLevel>=2,fastLookupPossible:l.fastLookupPossible});if(ne.set(Z,O),O.isHoistable===2)for(let L of O.dependsOn){let de=_.get(L.name)||new Set;de.add(Z.name),_.set(L.name,de)}}let ee=new Set,A=(Z,O,L)=>{if(!ee.has(Z)){ee.add(Z),ne.set(Z,{isHoistable:1,reason:L});for(let de of _.get(Z.name)||[])A(T.dependencies.get(de),O,l.debugLevel>=2?`- peer dependency ${Li(Z.locator)} from parent ${Li(T.locator)} was not hoisted`:"")}};for(let[Z,O]of ne)O.isHoistable===1&&A(Z,O,O.reason);let oe=!1;for(let Z of ne.keys())if(!ee.has(Z)){f=!0;let O=o.get(T);O&&O.has(Z.name)&&(g=!0),oe=!0,T.dependencies.delete(Z.name),T.hoistedDependencies.set(Z.name,Z),T.reasons.delete(Z.name);let L=c.dependencies.get(Z.name);if(l.debugLevel>=2){let de=Array.from(v).concat([T.locator]).map(je=>Li(je)).join("\u2192"),Be=c.hoistedFrom.get(Z.name);Be||(Be=[],c.hoistedFrom.set(Z.name,Be)),Be.push(de),T.hoistedTo.set(Z.name,Array.from(e).map(je=>Li(je.locator)).join("\u2192"))}if(!L)c.ident!==Z.ident&&(c.dependencies.set(Z.name,Z),q.add(Z));else for(let de of Z.references)L.references.add(de)}if(T.dependencyKind===2&&oe&&(g=!0),l.check){let Z=fAe(r);if(Z)throw new Error(`${Z}, after hoisting dependencies of ${[c,...b,T].map(O=>Li(O.locator)).join("\u2192")}: -${Tm(r)}`)}let ce=yL(T);for(let Z of ce)if(ee.has(Z)){let O=ne.get(Z);if((n.get(Z.name)===Z.ident||!T.reasons.has(Z.name))&&O.isHoistable!==0&&T.reasons.set(Z.name,O.reason),!Z.isHoistBorder&&$.indexOf($0(Z))<0){u.add(T);let de=pAe(T,Z);h([...b,T],Y,$,de,m),u.delete(T)}}},p,m=new Set(yL(c)),y=Array.from(e).map(b=>$0(b));do{p=m,m=new Set;for(let b of p){if(b.locator===c.locator||b.isHoistBorder)continue;let v=pAe(c,b);h([],Array.from(t),y,v,m)}}while(m.size>0);return{anotherRoundNeeded:g,isGraphChanged:f}},fAe=r=>{let e=[],t=new Set,i=new Set,n=(s,o,a)=>{if(t.has(s)||(t.add(s),i.has(s)))return;let l=new Map(o);for(let c of s.dependencies.values())s.peerNames.has(c.name)||l.set(c.name,c);for(let c of s.originalDependencies.values()){let u=l.get(c.name),g=()=>`${Array.from(i).concat([s]).map(f=>Li(f.locator)).join("\u2192")}`;if(s.peerNames.has(c.name)){let f=o.get(c.name);(f!==u||!f||f.ident!==c.ident)&&e.push(`${g()} - broken peer promise: expected ${c.ident} but found ${f&&f.ident}`)}else{let f=a.hoistedFrom.get(s.name),h=s.hoistedTo.get(c.name),p=`${f?` hoisted from ${f.join(", ")}`:""}`,m=`${h?` hoisted to ${h}`:""}`,y=`${g()}${p}`;u?u.ident!==c.ident&&e.push(`${y} - broken require promise for ${c.name}${m}: expected ${c.ident}, but found: ${u.ident}`):e.push(`${y} - broken require promise: no required dependency ${c.name}${m} found`)}}i.add(s);for(let c of s.dependencies.values())s.peerNames.has(c.name)||n(c,l,s);i.delete(s)};return n(r,r.dependencies,r),e.join(` -`)},N4e=(r,e)=>{let{identName:t,name:i,reference:n,peerNames:s}=r,o={name:i,references:new Set([n]),locator:EL(t,n),ident:gAe(t,n),dependencies:new Map,originalDependencies:new Map,hoistedDependencies:new Map,peerNames:new Set(s),reasons:new Map,decoupled:!0,isHoistBorder:!0,hoistPriority:0,dependencyKind:1,hoistedFrom:new Map,hoistedTo:new Map},a=new Map([[r,o]]),l=(c,u)=>{let g=a.get(c),f=!!g;if(!g){let{name:h,identName:p,reference:m,peerNames:y,hoistPriority:b,dependencyKind:v}=c,x=e.hoistingLimits.get(u.locator);g={name:h,references:new Set([m]),locator:EL(p,m),ident:gAe(p,m),dependencies:new Map,originalDependencies:new Map,hoistedDependencies:new Map,peerNames:new Set(y),reasons:new Map,decoupled:!0,isHoistBorder:x?x.has(h):!1,hoistPriority:b||0,dependencyKind:v||0,hoistedFrom:new Map,hoistedTo:new Map},a.set(c,g)}if(u.dependencies.set(c.name,g),u.originalDependencies.set(c.name,g),f){let h=new Set,p=m=>{if(!h.has(m)){h.add(m),m.decoupled=!1;for(let y of m.dependencies.values())m.peerNames.has(y.name)||p(y)}};p(g)}else for(let h of c.dependencies)l(h,g)};for(let c of r.dependencies)l(c,o);return o},wL=r=>r.substring(0,r.indexOf("@",1)),L4e=r=>{let e={name:r.name,identName:wL(r.locator),references:new Set(r.references),dependencies:new Set},t=new Set([r]),i=(n,s,o)=>{let a=t.has(n),l;if(s===n)l=o;else{let{name:c,references:u,locator:g}=n;l={name:c,identName:wL(g),references:u,dependencies:new Set}}if(o.dependencies.add(l),!a){t.add(n);for(let c of n.dependencies.values())n.peerNames.has(c.name)||i(c,n,l);t.delete(n)}};for(let n of r.dependencies.values())i(n,r,e);return e},U4e=r=>{let e=new Map,t=new Set([r]),i=o=>`${o.name}@${o.ident}`,n=o=>{let a=i(o),l=e.get(a);return l||(l={dependents:new Set,peerDependents:new Set,hoistPriority:0},e.set(a,l)),l},s=(o,a)=>{let l=!!t.has(a);if(n(a).dependents.add(o.ident),!l){t.add(a);for(let u of a.dependencies.values()){let g=n(u);g.hoistPriority=Math.max(g.hoistPriority,u.hoistPriority),a.peerNames.has(u.name)?g.peerDependents.add(a.ident):s(a,u)}}};for(let o of r.dependencies.values())r.peerNames.has(o.name)||s(r,o);return e},Li=r=>{if(!r)return"none";let e=r.indexOf("@",1),t=r.substring(0,e);t.endsWith("$wsroot$")&&(t=`wh:${t.replace("$wsroot$","")}`);let i=r.substring(e+1);if(i==="workspace:.")return".";if(i){let n=(i.indexOf("#")>0?i.split("#")[1]:i).replace("npm:","");return i.startsWith("virtual")&&(t=`v:${t}`),n.startsWith("workspace")&&(t=`w:${t}`,n=""),`${t}${n?`@${n}`:""}`}else return`${t}`},dAe=5e4,Tm=r=>{let e=0,t=(n,s,o="")=>{if(e>dAe||s.has(n))return"";e++;let a=Array.from(n.dependencies.values()).sort((c,u)=>c.name===u.name?0:c.name>u.name?1:-1),l="";s.add(n);for(let c=0;c":"")+(f!==u.name?`a:${u.name}:`:"")+Li(u.locator)+(g?` ${g}`:"")} -`,l+=t(u,s,`${o}${cdAe?` -Tree is too large, part of the tree has been dunped -`:"")};var wo;(function(t){t.HARD="HARD",t.SOFT="SOFT"})(wo||(wo={}));var Kn;(function(i){i.WORKSPACES="workspaces",i.DEPENDENCIES="dependencies",i.NONE="none"})(Kn||(Kn={}));var CAe="node_modules",Su="$wsroot$";var Om=(r,e)=>{let{packageTree:t,hoistingLimits:i,errors:n,preserveSymlinksRequired:s}=G4e(r,e),o=null;if(n.length===0){let a=hAe(t,{hoistingLimits:i});o=Y4e(r,a,e)}return{tree:o,errors:n,preserveSymlinksRequired:s}},da=r=>`${r.name}@${r.reference}`,BL=r=>{let e=new Map;for(let[t,i]of r.entries())if(!i.dirList){let n=e.get(i.locator);n||(n={target:i.target,linkType:i.linkType,locations:[],aliases:i.aliases},e.set(i.locator,n)),n.locations.push(t)}for(let t of e.values())t.locations=t.locations.sort((i,n)=>{let s=i.split(k.delimiter).length,o=n.split(k.delimiter).length;return n===i?0:s!==o?o-s:n>i?1:-1});return e},mAe=(r,e)=>{let t=P.isVirtualLocator(r)?P.devirtualizeLocator(r):r,i=P.isVirtualLocator(e)?P.devirtualizeLocator(e):e;return P.areLocatorsEqual(t,i)},bL=(r,e,t,i)=>{if(r.linkType!==wo.SOFT)return!1;let n=H.toPortablePath(t.resolveVirtual&&e.reference&&e.reference.startsWith("virtual:")?t.resolveVirtual(r.packageLocation):r.packageLocation);return k.contains(i,n)===null},q4e=r=>{let e=r.getPackageInformation(r.topLevel);if(e===null)throw new Error("Assertion failed: Expected the top-level package to have been registered");if(r.findPackageLocator(e.packageLocation)===null)throw new Error("Assertion failed: Expected the top-level package to have a physical locator");let i=H.toPortablePath(e.packageLocation.slice(0,-1)),n=new Map,s={children:new Map},o=r.getDependencyTreeRoots(),a=new Map,l=new Set,c=(f,h)=>{let p=da(f);if(l.has(p))return;l.add(p);let m=r.getPackageInformation(f);if(m){let y=h?da(h):"";if(da(f)!==y&&m.linkType===wo.SOFT&&!bL(m,f,r,i)){let b=EAe(m,f,r);(!a.get(b)||f.reference.startsWith("workspace:"))&&a.set(b,f)}for(let[b,v]of m.packageDependencies)v!==null&&(m.packagePeers.has(b)||c(r.getLocator(b,v),f))}};for(let f of o)c(f,null);let u=i.split(k.sep);for(let f of a.values()){let h=r.getPackageInformation(f),m=H.toPortablePath(h.packageLocation.slice(0,-1)).split(k.sep).slice(u.length),y=s;for(let b of m){let v=y.children.get(b);v||(v={children:new Map},y.children.set(b,v)),y=v}y.workspaceLocator=f}let g=(f,h)=>{if(f.workspaceLocator){let p=da(h),m=n.get(p);m||(m=new Set,n.set(p,m)),m.add(f.workspaceLocator)}for(let p of f.children.values())g(p,f.workspaceLocator||h)};for(let f of s.children.values())g(f,s.workspaceLocator);return n},G4e=(r,e)=>{let t=[],i=!1,n=new Map,s=q4e(r),o=r.getPackageInformation(r.topLevel);if(o===null)throw new Error("Assertion failed: Expected the top-level package to have been registered");let a=r.findPackageLocator(o.packageLocation);if(a===null)throw new Error("Assertion failed: Expected the top-level package to have a physical locator");let l=H.toPortablePath(o.packageLocation.slice(0,-1)),c={name:a.name,identName:a.name,reference:a.reference,peerNames:o.packagePeers,dependencies:new Set,dependencyKind:Mn.WORKSPACE},u=new Map,g=(h,p)=>`${da(p)}:${h}`,f=(h,p,m,y,b,v,x,T)=>{var Z,O;let q=g(h,m),Y=u.get(q),$=!!Y;!$&&m.name===a.name&&m.reference===a.reference&&(Y=c,u.set(q,c));let _=bL(p,m,r,l);if(!Y){let L=Mn.REGULAR;_?L=Mn.EXTERNAL_SOFT_LINK:p.linkType===wo.SOFT&&m.name.endsWith(Su)&&(L=Mn.WORKSPACE),Y={name:h,identName:m.name,reference:m.reference,dependencies:new Set,peerNames:L===Mn.WORKSPACE?new Set:p.packagePeers,dependencyKind:L},u.set(q,Y)}let ne;if(_?ne=2:b.linkType===wo.SOFT?ne=1:ne=0,Y.hoistPriority=Math.max(Y.hoistPriority||0,ne),T&&!_){let L=da({name:y.identName,reference:y.reference}),de=n.get(L)||new Set;n.set(L,de),de.add(Y.name)}let ee=new Map(p.packageDependencies);if(e.project){let L=e.project.workspacesByCwd.get(H.toPortablePath(p.packageLocation.slice(0,-1)));if(L){let de=new Set([...Array.from(L.manifest.peerDependencies.values(),Be=>P.stringifyIdent(Be)),...Array.from(L.manifest.peerDependenciesMeta.keys())]);for(let Be of de)ee.has(Be)||(ee.set(Be,v.get(Be)||null),Y.peerNames.add(Be))}}let A=da({name:m.name.replace(Su,""),reference:m.reference}),oe=s.get(A);if(oe)for(let L of oe)ee.set(`${L.name}${Su}`,L.reference);(p!==b||p.linkType!==wo.SOFT||!_&&(!e.selfReferencesByCwd||e.selfReferencesByCwd.get(x)))&&y.dependencies.add(Y);let ce=m!==a&&p.linkType===wo.SOFT&&!m.name.endsWith(Su)&&!_;if(!$&&!ce){let L=new Map;for(let[de,Be]of ee)if(Be!==null){let je=r.getLocator(de,Be),re=r.getLocator(de.replace(Su,""),Be),se=r.getPackageInformation(re);if(se===null)throw new Error("Assertion failed: Expected the package to have been registered");let be=bL(se,je,r,l);if(e.validateExternalSoftLinks&&e.project&&be){se.packageDependencies.size>0&&(i=!0);for(let[ve,pe]of se.packageDependencies)if(pe!==null){let V=P.parseLocator(Array.isArray(pe)?`${pe[0]}@${pe[1]}`:`${ve}@${pe}`);if(da(V)!==da(je)){let Qe=ee.get(ve);if(Qe){let le=P.parseLocator(Array.isArray(Qe)?`${Qe[0]}@${Qe[1]}`:`${ve}@${Qe}`);mAe(le,V)||t.push({messageName:X.NM_CANT_INSTALL_EXTERNAL_SOFT_LINK,text:`Cannot link ${P.prettyIdent(e.project.configuration,P.parseIdent(je.name))} into ${P.prettyLocator(e.project.configuration,P.parseLocator(`${m.name}@${m.reference}`))} dependency ${P.prettyLocator(e.project.configuration,V)} conflicts with parent dependency ${P.prettyLocator(e.project.configuration,le)}`})}else{let le=L.get(ve);if(le){let fe=le.target,gt=P.parseLocator(Array.isArray(fe)?`${fe[0]}@${fe[1]}`:`${ve}@${fe}`);mAe(gt,V)||t.push({messageName:X.NM_CANT_INSTALL_EXTERNAL_SOFT_LINK,text:`Cannot link ${P.prettyIdent(e.project.configuration,P.parseIdent(je.name))} into ${P.prettyLocator(e.project.configuration,P.parseLocator(`${m.name}@${m.reference}`))} dependency ${P.prettyLocator(e.project.configuration,V)} conflicts with dependency ${P.prettyLocator(e.project.configuration,gt)} from sibling portal ${P.prettyIdent(e.project.configuration,P.parseIdent(le.portal.name))}`})}else L.set(ve,{target:V.reference,portal:je})}}}}let he=(Z=e.hoistingLimitsByCwd)==null?void 0:Z.get(x),Fe=be?x:k.relative(l,H.toPortablePath(se.packageLocation))||Me.dot,Ke=(O=e.hoistingLimitsByCwd)==null?void 0:O.get(Fe),ke=he===Kn.DEPENDENCIES||Ke===Kn.DEPENDENCIES||Ke===Kn.WORKSPACES;f(de,se,je,Y,p,ee,Fe,ke)}}};return f(a.name,o,a,c,o,o.packageDependencies,Me.dot,!1),{packageTree:c,hoistingLimits:n,errors:t,preserveSymlinksRequired:i}};function EAe(r,e,t){let i=t.resolveVirtual&&e.reference&&e.reference.startsWith("virtual:")?t.resolveVirtual(r.packageLocation):r.packageLocation;return H.toPortablePath(i||r.packageLocation)}function J4e(r,e,t){let i=e.getLocator(r.name.replace(Su,""),r.reference),n=e.getPackageInformation(i);if(n===null)throw new Error("Assertion failed: Expected the package to be registered");let s,o;return t.pnpifyFs?(o=H.toPortablePath(n.packageLocation),s=wo.SOFT):(o=EAe(n,r,e),s=n.linkType),{linkType:s,target:o}}var Y4e=(r,e,t)=>{let i=new Map,n=(u,g,f)=>{let{linkType:h,target:p}=J4e(u,r,t);return{locator:da(u),nodePath:g,target:p,linkType:h,aliases:f}},s=u=>{let[g,f]=u.split("/");return f?{scope:Jr(g),name:Jr(f)}:{scope:null,name:Jr(g)}},o=new Set,a=(u,g,f)=>{if(!o.has(u)){o.add(u);for(let h of u.dependencies){if(h===u)continue;let p=Array.from(h.references).sort(),m={name:h.identName,reference:p[0]},{name:y,scope:b}=s(h.name),v=b?[b,y]:[y],x=k.join(g,CAe),T=k.join(x,...v),q=`${f}/${m.name}`,Y=n(m,f,p.slice(1)),$=!1;if(Y.linkType===wo.SOFT&&t.project){let _=t.project.workspacesByCwd.get(Y.target.slice(0,-1));$=!!(_&&!_.manifest.name)}if(!h.name.endsWith(Su)&&!$){let _=i.get(T);if(_){if(_.dirList)throw new Error(`Assertion failed: ${T} cannot merge dir node with leaf node`);{let oe=P.parseLocator(_.locator),ce=P.parseLocator(Y.locator);if(_.linkType!==Y.linkType)throw new Error(`Assertion failed: ${T} cannot merge nodes with different link types ${_.nodePath}/${P.stringifyLocator(oe)} and ${f}/${P.stringifyLocator(ce)}`);if(oe.identHash!==ce.identHash)throw new Error(`Assertion failed: ${T} cannot merge nodes with different idents ${_.nodePath}/${P.stringifyLocator(oe)} and ${f}/s${P.stringifyLocator(ce)}`);Y.aliases=[...Y.aliases,..._.aliases,P.parseLocator(_.locator).reference]}}i.set(T,Y);let ne=T.split("/"),ee=ne.indexOf(CAe),A=ne.length-1;for(;ee>=0&&A>ee;){let oe=H.toPortablePath(ne.slice(0,A).join(k.sep)),ce=Jr(ne[A]),Z=i.get(oe);if(!Z)i.set(oe,{dirList:new Set([ce])});else if(Z.dirList){if(Z.dirList.has(ce))break;Z.dirList.add(ce)}A--}}a(h,Y.linkType===wo.SOFT?Y.target:T,q)}}},l=n({name:e.name,reference:Array.from(e.references)[0]},"",[]),c=l.target;return i.set(c,l),a(e,c,""),i};var LL={};ft(LL,{PnpInstaller:()=>oh,PnpLinker:()=>xu,default:()=>d8e,getPnpPath:()=>Tl,jsInstallUtils:()=>Ca,pnpUtils:()=>FL,quotePathIfNeeded:()=>GAe});var HAe=ge(ri()),jAe=ge(require("url"));var IAe;(function(t){t.HARD="HARD",t.SOFT="SOFT"})(IAe||(IAe={}));var er;(function(f){f.DEFAULT="DEFAULT",f.TOP_LEVEL="TOP_LEVEL",f.FALLBACK_EXCLUSION_LIST="FALLBACK_EXCLUSION_LIST",f.FALLBACK_EXCLUSION_ENTRIES="FALLBACK_EXCLUSION_ENTRIES",f.FALLBACK_EXCLUSION_DATA="FALLBACK_EXCLUSION_DATA",f.PACKAGE_REGISTRY_DATA="PACKAGE_REGISTRY_DATA",f.PACKAGE_REGISTRY_ENTRIES="PACKAGE_REGISTRY_ENTRIES",f.PACKAGE_STORE_DATA="PACKAGE_STORE_DATA",f.PACKAGE_STORE_ENTRIES="PACKAGE_STORE_ENTRIES",f.PACKAGE_INFORMATION_DATA="PACKAGE_INFORMATION_DATA",f.PACKAGE_DEPENDENCIES="PACKAGE_DEPENDENCIES",f.PACKAGE_DEPENDENCY="PACKAGE_DEPENDENCY"})(er||(er={}));var yAe={[er.DEFAULT]:{collapsed:!1,next:{["*"]:er.DEFAULT}},[er.TOP_LEVEL]:{collapsed:!1,next:{fallbackExclusionList:er.FALLBACK_EXCLUSION_LIST,packageRegistryData:er.PACKAGE_REGISTRY_DATA,["*"]:er.DEFAULT}},[er.FALLBACK_EXCLUSION_LIST]:{collapsed:!1,next:{["*"]:er.FALLBACK_EXCLUSION_ENTRIES}},[er.FALLBACK_EXCLUSION_ENTRIES]:{collapsed:!0,next:{["*"]:er.FALLBACK_EXCLUSION_DATA}},[er.FALLBACK_EXCLUSION_DATA]:{collapsed:!0,next:{["*"]:er.DEFAULT}},[er.PACKAGE_REGISTRY_DATA]:{collapsed:!1,next:{["*"]:er.PACKAGE_REGISTRY_ENTRIES}},[er.PACKAGE_REGISTRY_ENTRIES]:{collapsed:!0,next:{["*"]:er.PACKAGE_STORE_DATA}},[er.PACKAGE_STORE_DATA]:{collapsed:!1,next:{["*"]:er.PACKAGE_STORE_ENTRIES}},[er.PACKAGE_STORE_ENTRIES]:{collapsed:!0,next:{["*"]:er.PACKAGE_INFORMATION_DATA}},[er.PACKAGE_INFORMATION_DATA]:{collapsed:!1,next:{packageDependencies:er.PACKAGE_DEPENDENCIES,["*"]:er.DEFAULT}},[er.PACKAGE_DEPENDENCIES]:{collapsed:!1,next:{["*"]:er.PACKAGE_DEPENDENCY}},[er.PACKAGE_DEPENDENCY]:{collapsed:!0,next:{["*"]:er.DEFAULT}}};function W4e(r,e,t){let i="";i+="[";for(let n=0,s=r.length;ns(o)));let n=t.map((s,o)=>o);return n.sort((s,o)=>{for(let a of i){let l=a[s]a[o]?1:0;if(l!==0)return l}return 0}),n.map(s=>t[s])}function X4e(r){let e=new Map,t=Mm(r.fallbackExclusionList||[],[({name:i,reference:n})=>i,({name:i,reference:n})=>n]);for(let{name:i,reference:n}of t){let s=e.get(i);typeof s=="undefined"&&e.set(i,s=new Set),s.add(n)}return Array.from(e).map(([i,n])=>[i,Array.from(n)])}function Z4e(r){return Mm(r.fallbackPool||[],([e])=>e)}function $4e(r){let e=[];for(let[t,i]of Mm(r.packageRegistry,([n])=>n===null?"0":`1${n}`)){let n=[];e.push([t,n]);for(let[s,{packageLocation:o,packageDependencies:a,packagePeers:l,linkType:c,discardFromLookup:u}]of Mm(i,([g])=>g===null?"0":`1${g}`)){let g=[];t!==null&&s!==null&&!a.has(t)&&g.push([t,s]);for(let[p,m]of Mm(a.entries(),([y])=>y))g.push([p,m]);let f=l&&l.size>0?Array.from(l):void 0,h=u||void 0;n.push([s,{packageLocation:o,packageDependencies:g,packagePeers:f,linkType:c,discardFromLookup:h}])}}return e}function Km(r){return{__info:["This file is automatically generated. Do not touch it, or risk","your modifications being lost. We also recommend you not to read","it either without using the @yarnpkg/pnp package, as the data layout","is entirely unspecified and WILL change from a version to another."],dependencyTreeRoots:r.dependencyTreeRoots,enableTopLevelFallback:r.enableTopLevelFallback||!1,ignorePatternData:r.ignorePattern||null,fallbackExclusionList:X4e(r),fallbackPool:Z4e(r),packageRegistryData:$4e(r)}}var SAe=ge(QAe());function vAe(r,e){return[r?`${r} -`:"",`/* eslint-disable */ - -`,`try { -`,` Object.freeze({}).detectStrictMode = true; -`,`} catch (error) { -`," throw new Error(`The whole PnP file got strict-mode-ified, which is known to break (Emscripten libraries aren't strict mode). This usually happens when the file goes through Babel.`);\n",`} -`,` -`,`function $$SETUP_STATE(hydrateRuntimeState, basePath) { -`,e.replace(/^/gm," "),`} -`,` -`,(0,SAe.default)()].join("")}function e8e(r){return JSON.stringify(r,null,2)}function t8e(r){return`'${r.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,`\\ -`)}'`}function r8e(r){return[`return hydrateRuntimeState(JSON.parse(${t8e(BAe(r))}), {basePath: basePath || __dirname}); -`].join("")}function i8e(r){return[`var path = require('path'); -`,`var dataLocation = path.resolve(__dirname, ${JSON.stringify(r)}); -`,`return hydrateRuntimeState(require(dataLocation), {basePath: basePath || path.dirname(dataLocation)}); -`].join("")}function xAe(r){let e=Km(r),t=r8e(e);return vAe(r.shebang,t)}function kAe(r){let e=Km(r),t=i8e(r.dataLocation),i=vAe(r.shebang,t);return{dataFile:e8e(e),loaderFile:i}}var RAe=ge(require("fs")),l8e=ge(require("path")),FAe=ge(require("util"));function SL(r,{basePath:e}){let t=H.toPortablePath(e),i=k.resolve(t),n=r.ignorePatternData!==null?new RegExp(r.ignorePatternData):null,s=new Map,o=new Map(r.packageRegistryData.map(([g,f])=>[g,new Map(f.map(([h,p])=>{var x;if(g===null!=(h===null))throw new Error("Assertion failed: The name and reference should be null, or neither should");let m=(x=p.discardFromLookup)!=null?x:!1,y={name:g,reference:h},b=s.get(p.packageLocation);b?(b.discardFromLookup=b.discardFromLookup&&m,m||(b.locator=y)):s.set(p.packageLocation,{locator:y,discardFromLookup:m});let v=null;return[h,{packageDependencies:new Map(p.packageDependencies),packagePeers:new Set(p.packagePeers),linkType:p.linkType,discardFromLookup:m,get packageLocation(){return v||(v=k.join(i,p.packageLocation))}}]}))])),a=new Map(r.fallbackExclusionList.map(([g,f])=>[g,new Set(f)])),l=new Map(r.fallbackPool),c=r.dependencyTreeRoots,u=r.enableTopLevelFallback;return{basePath:t,dependencyTreeRoots:c,enableTopLevelFallback:u,fallbackExclusionList:a,fallbackPool:l,ignorePattern:n,packageLocatorsByLocations:s,packageRegistry:o}}var Um=ge(require("module"));function sh(r,e){if(typeof r=="string")return r;if(r){let t,i;if(Array.isArray(r)){for(t=0;t0)return(f=sh(n[g],u))?f.replace("*",c.substring(g.length-1)):vu(i,c,1)}return vu(i,c)}}var vL=ge(require("util"));var ur;(function(c){c.API_ERROR="API_ERROR",c.BUILTIN_NODE_RESOLUTION_FAILED="BUILTIN_NODE_RESOLUTION_FAILED",c.EXPORTS_RESOLUTION_FAILED="EXPORTS_RESOLUTION_FAILED",c.MISSING_DEPENDENCY="MISSING_DEPENDENCY",c.MISSING_PEER_DEPENDENCY="MISSING_PEER_DEPENDENCY",c.QUALIFIED_PATH_RESOLUTION_FAILED="QUALIFIED_PATH_RESOLUTION_FAILED",c.INTERNAL="INTERNAL",c.UNDECLARED_DEPENDENCY="UNDECLARED_DEPENDENCY",c.UNSUPPORTED="UNSUPPORTED"})(ur||(ur={}));var s8e=new Set([ur.BUILTIN_NODE_RESOLUTION_FAILED,ur.MISSING_DEPENDENCY,ur.MISSING_PEER_DEPENDENCY,ur.QUALIFIED_PATH_RESOLUTION_FAILED,ur.UNDECLARED_DEPENDENCY]);function ai(r,e,t={},i){i!=null||(i=s8e.has(r)?"MODULE_NOT_FOUND":r);let n={configurable:!0,writable:!0,enumerable:!1};return Object.defineProperties(new Error(e),{code:te(N({},n),{value:i}),pnpCode:te(N({},n),{value:r}),data:te(N({},n),{value:t})})}function Bo(r){return H.normalize(H.fromPortablePath(r))}var o8e=ge(require("fs")),DAe=ge(require("module")),a8e=ge(require("path")),A8e=new Set(DAe.Module.builtinModules||Object.keys(process.binding("natives"))),tb=r=>r.startsWith("node:")||A8e.has(r);function xL(r,e){let t=Number(process.env.PNP_ALWAYS_WARN_ON_FALLBACK)>0,i=Number(process.env.PNP_DEBUG_LEVEL),n=/^(?![a-zA-Z]:[\\/]|\\\\|\.{0,2}(?:\/|$))((?:node:)?(?:@[^/]+\/)?[^/]+)\/*(.*|)$/,s=/^(\/|\.{1,2}(\/|$))/,o=/\/$/,a=/^\.{0,2}\//,l={name:null,reference:null},c=[],u=new Set;if(r.enableTopLevelFallback===!0&&c.push(l),e.compatibilityMode!==!1)for(let re of["react-scripts","gatsby"]){let se=r.packageRegistry.get(re);if(se)for(let be of se.keys()){if(be===null)throw new Error("Assertion failed: This reference shouldn't be null");c.push({name:re,reference:be})}}let{ignorePattern:g,packageRegistry:f,packageLocatorsByLocations:h}=r;function p(re,se){return{fn:re,args:se,error:null,result:null}}function m(re){var Ke,ke,ve,pe,V,Qe;let se=(ve=(ke=(Ke=process.stderr)==null?void 0:Ke.hasColors)==null?void 0:ke.call(Ke))!=null?ve:process.stdout.isTTY,be=(le,fe)=>`[${le}m${fe}`,he=re.error;console.error(he?be("31;1",`\u2716 ${(pe=re.error)==null?void 0:pe.message.replace(/\n.*/s,"")}`):be("33;1","\u203C Resolution")),re.args.length>0&&console.error();for(let le of re.args)console.error(` ${be("37;1","In \u2190")} ${(0,vL.inspect)(le,{colors:se,compact:!0})}`);re.result&&(console.error(),console.error(` ${be("37;1","Out \u2192")} ${(0,vL.inspect)(re.result,{colors:se,compact:!0})}`));let Fe=(Qe=(V=new Error().stack.match(/(?<=^ +)at.*/gm))==null?void 0:V.slice(2))!=null?Qe:[];if(Fe.length>0){console.error();for(let le of Fe)console.error(` ${be("38;5;244",le)}`)}console.error()}function y(re,se){if(e.allowDebug===!1)return se;if(Number.isFinite(i)){if(i>=2)return(...be)=>{let he=p(re,be);try{return he.result=se(...be)}catch(Fe){throw he.error=Fe}finally{m(he)}};if(i>=1)return(...be)=>{try{return se(...be)}catch(he){let Fe=p(re,be);throw Fe.error=he,m(Fe),he}}}return se}function b(re){let se=A(re);if(!se)throw ai(ur.INTERNAL,"Couldn't find a matching entry in the dependency tree for the specified parent (this is probably an internal error)");return se}function v(re){if(re.name===null)return!0;for(let se of r.dependencyTreeRoots)if(se.name===re.name&&se.reference===re.reference)return!0;return!1}let x=new Set(["default","node","require"]);function T(re,se=x){let be=Z(k.join(re,"internal.js"),{resolveIgnored:!0,includeDiscardFromLookup:!0});if(be===null)throw ai(ur.INTERNAL,`The locator that owns the "${re}" path can't be found inside the dependency tree (this is probably an internal error)`);let{packageLocation:he}=b(be),Fe=k.join(he,kt.manifest);if(!e.fakeFs.existsSync(Fe))return null;let Ke=JSON.parse(e.fakeFs.readFileSync(Fe,"utf8")),ke=k.contains(he,re);if(ke===null)throw ai(ur.INTERNAL,"unqualifiedPath doesn't contain the packageLocation (this is probably an internal error)");a.test(ke)||(ke=`./${ke}`);let ve;try{ve=PAe(Ke,k.normalize(ke),{conditions:se,unsafe:!0})}catch(pe){throw ai(ur.EXPORTS_RESOLUTION_FAILED,pe.message,{unqualifiedPath:Bo(re),locator:be,pkgJson:Ke,subpath:Bo(ke),conditions:se},"ERR_PACKAGE_PATH_NOT_EXPORTED")}return typeof ve=="string"?k.join(he,ve):null}function q(re,se,{extensions:be}){let he;try{se.push(re),he=e.fakeFs.statSync(re)}catch(Fe){}if(he&&!he.isDirectory())return e.fakeFs.realpathSync(re);if(he&&he.isDirectory()){let Fe;try{Fe=JSON.parse(e.fakeFs.readFileSync(k.join(re,kt.manifest),"utf8"))}catch(ke){}let Ke;if(Fe&&Fe.main&&(Ke=k.resolve(re,Fe.main)),Ke&&Ke!==re){let ke=q(Ke,se,{extensions:be});if(ke!==null)return ke}}for(let Fe=0,Ke=be.length;Fe{let ve=JSON.stringify(ke.name);if(he.has(ve))return;he.add(ve);let pe=oe(ke);for(let V of pe)if(b(V).packagePeers.has(re))Fe(V);else{let le=be.get(V.name);typeof le=="undefined"&&be.set(V.name,le=new Set),le.add(V.reference)}};Fe(se);let Ke=[];for(let ke of[...be.keys()].sort())for(let ve of[...be.get(ke)].sort())Ke.push({name:ke,reference:ve});return Ke}function Z(re,{resolveIgnored:se=!1,includeDiscardFromLookup:be=!1}={}){if(_(re)&&!se)return null;let he=k.relative(r.basePath,re);he.match(s)||(he=`./${he}`),he.endsWith("/")||(he=`${he}/`);do{let Fe=h.get(he);if(typeof Fe=="undefined"||Fe.discardFromLookup&&!be){he=he.substring(0,he.lastIndexOf("/",he.length-2)+1);continue}return Fe.locator}while(he!=="");return null}function O(re,se,{considerBuiltins:be=!0}={}){if(re==="pnpapi")return H.toPortablePath(e.pnpapiResolution);if(be&&tb(re))return null;let he=Bo(re),Fe=se&&Bo(se);if(se&&_(se)&&(!k.isAbsolute(re)||Z(re)===null)){let ve=$(re,se);if(ve===!1)throw ai(ur.BUILTIN_NODE_RESOLUTION_FAILED,`The builtin node resolution algorithm was unable to resolve the requested module (it didn't go through the pnp resolver because the issuer was explicitely ignored by the regexp) - -Require request: "${he}" -Required by: ${Fe} -`,{request:he,issuer:Fe});return H.toPortablePath(ve)}let Ke,ke=re.match(n);if(ke){if(!se)throw ai(ur.API_ERROR,"The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute",{request:he,issuer:Fe});let[,ve,pe]=ke,V=Z(se);if(!V){let jt=$(re,se);if(jt===!1)throw ai(ur.BUILTIN_NODE_RESOLUTION_FAILED,`The builtin node resolution algorithm was unable to resolve the requested module (it didn't go through the pnp resolver because the issuer doesn't seem to be part of the Yarn-managed dependency tree). - -Require path: "${he}" -Required by: ${Fe} -`,{request:he,issuer:Fe});return H.toPortablePath(jt)}let le=b(V).packageDependencies.get(ve),fe=null;if(le==null&&V.name!==null){let jt=r.fallbackExclusionList.get(V.name);if(!jt||!jt.has(V.reference)){for(let Oi=0,Xs=c.length;Oiv(Qr))?gt=ai(ur.MISSING_PEER_DEPENDENCY,`${V.name} tried to access ${ve} (a peer dependency) but it isn't provided by your application; this makes the require call ambiguous and unsound. - -Required package: ${ve}${ve!==he?` (via "${he}")`:""} -Required by: ${V.name}@${V.reference} (via ${Fe}) -${jt.map(Qr=>`Ancestor breaking the chain: ${Qr.name}@${Qr.reference} -`).join("")} -`,{request:he,issuer:Fe,issuerLocator:Object.assign({},V),dependencyName:ve,brokenAncestors:jt}):gt=ai(ur.MISSING_PEER_DEPENDENCY,`${V.name} tried to access ${ve} (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound. - -Required package: ${ve}${ve!==he?` (via "${he}")`:""} -Required by: ${V.name}@${V.reference} (via ${Fe}) - -${jt.map(Qr=>`Ancestor breaking the chain: ${Qr.name}@${Qr.reference} -`).join("")} -`,{request:he,issuer:Fe,issuerLocator:Object.assign({},V),dependencyName:ve,brokenAncestors:jt})}else le===void 0&&(!be&&tb(re)?v(V)?gt=ai(ur.UNDECLARED_DEPENDENCY,`Your application tried to access ${ve}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${ve} isn't otherwise declared in your dependencies, this makes the require call ambiguous and unsound. - -Required package: ${ve}${ve!==he?` (via "${he}")`:""} -Required by: ${Fe} -`,{request:he,issuer:Fe,dependencyName:ve}):gt=ai(ur.UNDECLARED_DEPENDENCY,`${V.name} tried to access ${ve}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${ve} isn't otherwise declared in ${V.name}'s dependencies, this makes the require call ambiguous and unsound. - -Required package: ${ve}${ve!==he?` (via "${he}")`:""} -Required by: ${Fe} -`,{request:he,issuer:Fe,issuerLocator:Object.assign({},V),dependencyName:ve}):v(V)?gt=ai(ur.UNDECLARED_DEPENDENCY,`Your application tried to access ${ve}, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound. - -Required package: ${ve}${ve!==he?` (via "${he}")`:""} -Required by: ${Fe} -`,{request:he,issuer:Fe,dependencyName:ve}):gt=ai(ur.UNDECLARED_DEPENDENCY,`${V.name} tried to access ${ve}, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound. - -Required package: ${ve}${ve!==he?` (via "${he}")`:""} -Required by: ${V.name}@${V.reference} (via ${Fe}) -`,{request:he,issuer:Fe,issuerLocator:Object.assign({},V),dependencyName:ve}));if(le==null){if(fe===null||gt===null)throw gt||new Error("Assertion failed: Expected an error to have been set");le=fe;let jt=gt.message.replace(/\n.*/g,"");gt.message=jt,!u.has(jt)&&i!==0&&(u.add(jt),process.emitWarning(gt))}let Ht=Array.isArray(le)?{name:le[0],reference:le[1]}:{name:ve,reference:le},Mt=b(Ht);if(!Mt.packageLocation)throw ai(ur.MISSING_DEPENDENCY,`A dependency seems valid but didn't get installed for some reason. This might be caused by a partial install, such as dev vs prod. - -Required package: ${Ht.name}@${Ht.reference}${Ht.name!==he?` (via "${he}")`:""} -Required by: ${V.name}@${V.reference} (via ${Fe}) -`,{request:he,issuer:Fe,dependencyLocator:Object.assign({},Ht)});let Ei=Mt.packageLocation;pe?Ke=k.join(Ei,pe):Ke=Ei}else if(k.isAbsolute(re))Ke=k.normalize(re);else{if(!se)throw ai(ur.API_ERROR,"The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute",{request:he,issuer:Fe});let ve=k.resolve(se);se.match(o)?Ke=k.normalize(k.join(ve,re)):Ke=k.normalize(k.join(k.dirname(ve),re))}return k.normalize(Ke)}function L(re,se,be=x){if(s.test(re))return se;let he=T(se,be);return he?k.normalize(he):se}function de(re,{extensions:se=Object.keys(Um.Module._extensions)}={}){var Fe,Ke;let be=[],he=q(re,be,{extensions:se});if(he)return k.normalize(he);{let ke=Bo(re),ve=Z(re);if(ve){let{packageLocation:pe}=b(ve),V=!0;try{e.fakeFs.accessSync(pe)}catch(Qe){if((Qe==null?void 0:Qe.code)==="ENOENT")V=!1;else{let le=((Ke=(Fe=Qe==null?void 0:Qe.message)!=null?Fe:Qe)!=null?Ke:"empty exception thrown").replace(/^[A-Z]/,fe=>fe.toLowerCase());throw ai(ur.QUALIFIED_PATH_RESOLUTION_FAILED,`Required package exists but could not be accessed (${le}). - -Missing package: ${ve.name}@${ve.reference} -Expected package location: ${Bo(pe)} -`,{unqualifiedPath:ke,extensions:se})}}if(!V){let Qe=pe.includes("/unplugged/")?"Required unplugged package missing from disk. This may happen when switching branches without running installs (unplugged packages must be fully materialized on disk to work).":"Required package missing from disk. If you keep your packages inside your repository then restarting the Node process may be enough. Otherwise, try to run an install first.";throw ai(ur.QUALIFIED_PATH_RESOLUTION_FAILED,`${Qe} - -Missing package: ${ve.name}@${ve.reference} -Expected package location: ${Bo(pe)} -`,{unqualifiedPath:ke,extensions:se})}}throw ai(ur.QUALIFIED_PATH_RESOLUTION_FAILED,`Qualified path resolution failed: we looked for the following paths, but none could be accessed. - -Source path: ${ke} -${be.map(pe=>`Not found: ${Bo(pe)} -`).join("")}`,{unqualifiedPath:ke,extensions:se})}}function Be(re,se,{considerBuiltins:be,extensions:he,conditions:Fe}={}){try{let Ke=O(re,se,{considerBuiltins:be});if(re==="pnpapi")return Ke;if(Ke===null)return null;let ke=()=>se!==null?_(se):!1,ve=(!be||!tb(re))&&!ke()?L(re,Ke,Fe):Ke;return de(ve,{extensions:he})}catch(Ke){throw Object.prototype.hasOwnProperty.call(Ke,"pnpCode")&&Object.assign(Ke.data,{request:Bo(re),issuer:se&&Bo(se)}),Ke}}function je(re){let se=k.normalize(re),be=Wr.resolveVirtual(se);return be!==se?be:null}return{VERSIONS:ne,topLevel:ee,getLocator:(re,se)=>Array.isArray(se)?{name:se[0],reference:se[1]}:{name:re,reference:se},getDependencyTreeRoots:()=>[...r.dependencyTreeRoots],getAllLocators(){let re=[];for(let[se,be]of f)for(let he of be.keys())se!==null&&he!==null&&re.push({name:se,reference:he});return re},getPackageInformation:re=>{let se=A(re);if(se===null)return null;let be=H.fromPortablePath(se.packageLocation);return te(N({},se),{packageLocation:be})},findPackageLocator:re=>Z(H.toPortablePath(re)),resolveToUnqualified:y("resolveToUnqualified",(re,se,be)=>{let he=se!==null?H.toPortablePath(se):null,Fe=O(H.toPortablePath(re),he,be);return Fe===null?null:H.fromPortablePath(Fe)}),resolveUnqualified:y("resolveUnqualified",(re,se)=>H.fromPortablePath(de(H.toPortablePath(re),se))),resolveRequest:y("resolveRequest",(re,se,be)=>{let he=se!==null?H.toPortablePath(se):null,Fe=Be(H.toPortablePath(re),he,be);return Fe===null?null:H.fromPortablePath(Fe)}),resolveVirtual:y("resolveVirtual",re=>{let se=je(H.toPortablePath(re));return se!==null?H.fromPortablePath(se):null})}}var O0t=(0,FAe.promisify)(RAe.readFile);var NAe=(r,e,t)=>{let i=Km(r),n=SL(i,{basePath:e}),s=H.join(e,kt.pnpCjs);return xL(n,{fakeFs:t,pnpapiResolution:s})};var PL=ge(TAe());var Ca={};ft(Ca,{checkAndReportManifestCompatibility:()=>MAe,checkManifestCompatibility:()=>OAe,extractBuildScripts:()=>rb,getExtractHint:()=>DL,hasBindingGyp:()=>RL});function OAe(r){return P.isPackageCompatible(r,Vg.getArchitectureSet())}function MAe(r,e,{configuration:t,report:i}){return OAe(r)?!0:(i==null||i.reportWarningOnce(X.INCOMPATIBLE_ARCHITECTURE,`${P.prettyLocator(t,r)} The ${Vg.getArchitectureName()} architecture is incompatible with this package, ${e} skipped.`),!1)}function rb(r,e,t,{configuration:i,report:n}){let s=[];for(let a of["preinstall","install","postinstall"])e.manifest.scripts.has(a)&&s.push([cs.SCRIPT,a]);return!e.manifest.scripts.has("install")&&e.misc.hasBindingGyp&&s.push([cs.SHELLCODE,"node-gyp rebuild"]),s.length===0?[]:r.linkType!==Qt.HARD?(n==null||n.reportWarningOnce(X.SOFT_LINK_BUILD,`${P.prettyLocator(i,r)} lists build scripts, but is referenced through a soft link. Soft links don't support build scripts, so they'll be ignored.`),[]):t&&t.built===!1?(n==null||n.reportInfoOnce(X.BUILD_DISABLED,`${P.prettyLocator(i,r)} lists build scripts, but its build has been explicitly disabled through configuration.`),[]):!i.get("enableScripts")&&!t.built?(n==null||n.reportWarningOnce(X.DISABLED_BUILD_SCRIPTS,`${P.prettyLocator(i,r)} lists build scripts, but all build scripts have been disabled.`),[]):MAe(r,"build",{configuration:i,report:n})?s:[]}var c8e=new Set([".exe",".h",".hh",".hpp",".c",".cc",".cpp",".java",".jar",".node"]);function DL(r){return r.packageFs.getExtractHint({relevantExtensions:c8e})}function RL(r){let e=k.join(r.prefixPath,"binding.gyp");return r.packageFs.existsSync(e)}var FL={};ft(FL,{getUnpluggedPath:()=>Hm});function Hm(r,{configuration:e}){return k.resolve(e.get("pnpUnpluggedFolder"),P.slugifyLocator(r))}var u8e=new Set([P.makeIdent(null,"nan").identHash,P.makeIdent(null,"node-gyp").identHash,P.makeIdent(null,"node-pre-gyp").identHash,P.makeIdent(null,"node-addon-api").identHash,P.makeIdent(null,"fsevents").identHash,P.makeIdent(null,"open").identHash,P.makeIdent(null,"opn").identHash]),xu=class{constructor(){this.mode="strict";this.pnpCache=new Map}supportsPackage(e,t){return this.isEnabled(t)}async findPackageLocation(e,t){if(!this.isEnabled(t))throw new Error("Assertion failed: Expected the PnP linker to be enabled");let i=Tl(t.project).cjs;if(!K.existsSync(i))throw new Pe(`The project in ${ae.pretty(t.project.configuration,`${t.project.cwd}/package.json`,ae.Type.PATH)} doesn't seem to have been installed - running an install there might help`);let n=Se.getFactoryWithDefault(this.pnpCache,i,()=>Se.dynamicRequire(i,{cachingStrategy:Se.CachingStrategy.FsTime})),s={name:P.stringifyIdent(e),reference:e.reference},o=n.getPackageInformation(s);if(!o)throw new Pe(`Couldn't find ${P.prettyLocator(t.project.configuration,e)} in the currently installed PnP map - running an install might help`);return H.toPortablePath(o.packageLocation)}async findPackageLocator(e,t){if(!this.isEnabled(t))return null;let i=Tl(t.project).cjs;if(!K.existsSync(i))return null;let s=Se.getFactoryWithDefault(this.pnpCache,i,()=>Se.dynamicRequire(i,{cachingStrategy:Se.CachingStrategy.FsTime})).findPackageLocator(H.fromPortablePath(e));return s?P.makeLocator(P.parseIdent(s.name),s.reference):null}makeInstaller(e){return new oh(e)}isEnabled(e){return!(e.project.configuration.get("nodeLinker")!=="pnp"||e.project.configuration.get("pnpMode")!==this.mode)}},oh=class{constructor(e){this.opts=e;this.mode="strict";this.asyncActions=new Se.AsyncActions(10);this.packageRegistry=new Map;this.virtualTemplates=new Map;this.isESMLoaderRequired=!1;this.customData={store:new Map};this.unpluggedPaths=new Set;this.opts=e}getCustomDataKey(){return JSON.stringify({name:"PnpInstaller",version:2})}attachCustomData(e){this.customData=e}async installPackage(e,t,i){let n=P.stringifyIdent(e),s=e.reference,o=!!this.opts.project.tryWorkspaceByLocator(e),a=P.isVirtualLocator(e),l=e.peerDependencies.size>0&&!a,c=!l&&!o,u=!l&&e.linkType!==Qt.SOFT,g,f;if(c||u){let x=a?P.devirtualizeLocator(e):e;g=this.customData.store.get(x.locatorHash),typeof g=="undefined"&&(g=await g8e(t),e.linkType===Qt.HARD&&this.customData.store.set(x.locatorHash,g)),g.manifest.type==="module"&&(this.isESMLoaderRequired=!0),f=this.opts.project.getDependencyMeta(x,e.version)}let h=c?rb(e,g,f,{configuration:this.opts.project.configuration,report:this.opts.report}):[],p=u?await this.unplugPackageIfNeeded(e,g,t,f,i):t.packageFs;if(k.isAbsolute(t.prefixPath))throw new Error(`Assertion failed: Expected the prefix path (${t.prefixPath}) to be relative to the parent`);let m=k.resolve(p.getRealPath(),t.prefixPath),y=NL(this.opts.project.cwd,m),b=new Map,v=new Set;if(a){for(let x of e.peerDependencies.values())b.set(P.stringifyIdent(x),null),v.add(P.stringifyIdent(x));if(!o){let x=P.devirtualizeLocator(e);this.virtualTemplates.set(x.locatorHash,{location:NL(this.opts.project.cwd,Wr.resolveVirtual(m)),locator:x})}}return Se.getMapWithDefault(this.packageRegistry,n).set(s,{packageLocation:y,packageDependencies:b,packagePeers:v,linkType:e.linkType,discardFromLookup:t.discardFromLookup||!1}),{packageLocation:m,buildDirective:h.length>0?h:null}}async attachInternalDependencies(e,t){let i=this.getPackageInformation(e);for(let[n,s]of t){let o=P.areIdentsEqual(n,s)?s.reference:[P.stringifyIdent(s),s.reference];i.packageDependencies.set(P.stringifyIdent(n),o)}}async attachExternalDependents(e,t){for(let i of t)this.getDiskInformation(i).packageDependencies.set(P.stringifyIdent(e),e.reference)}async finalizeInstall(){if(this.opts.project.configuration.get("pnpMode")!==this.mode)return;let e=Tl(this.opts.project);if(K.existsSync(e.cjsLegacy)&&(this.opts.report.reportWarning(X.UNNAMED,`Removing the old ${ae.pretty(this.opts.project.configuration,kt.pnpJs,ae.Type.PATH)} file. You might need to manually update existing references to reference the new ${ae.pretty(this.opts.project.configuration,kt.pnpCjs,ae.Type.PATH)} file. If you use Editor SDKs, you'll have to rerun ${ae.pretty(this.opts.project.configuration,"yarn sdks",ae.Type.CODE)}.`),await K.removePromise(e.cjsLegacy)),this.isEsmEnabled()||await K.removePromise(e.esmLoader),this.opts.project.configuration.get("nodeLinker")!=="pnp"){await K.removePromise(e.cjs),await K.removePromise(this.opts.project.configuration.get("pnpDataPath")),await K.removePromise(e.esmLoader);return}for(let{locator:u,location:g}of this.virtualTemplates.values())Se.getMapWithDefault(this.packageRegistry,P.stringifyIdent(u)).set(u.reference,{packageLocation:g,packageDependencies:new Map,packagePeers:new Set,linkType:Qt.SOFT,discardFromLookup:!1});this.packageRegistry.set(null,new Map([[null,this.getPackageInformation(this.opts.project.topLevelWorkspace.anchoredLocator)]]));let t=this.opts.project.configuration.get("pnpFallbackMode"),i=this.opts.project.workspaces.map(({anchoredLocator:u})=>({name:P.stringifyIdent(u),reference:u.reference})),n=t!=="none",s=[],o=new Map,a=Se.buildIgnorePattern([".yarn/sdks/**",...this.opts.project.configuration.get("pnpIgnorePatterns")]),l=this.packageRegistry,c=this.opts.project.configuration.get("pnpShebang");if(t==="dependencies-only")for(let u of this.opts.project.storedPackages.values())this.opts.project.tryWorkspaceByLocator(u)&&s.push({name:P.stringifyIdent(u),reference:u.reference});return await this.asyncActions.wait(),await this.finalizeInstallWithPnp({dependencyTreeRoots:i,enableTopLevelFallback:n,fallbackExclusionList:s,fallbackPool:o,ignorePattern:a,packageRegistry:l,shebang:c}),{customData:this.customData}}async transformPnpSettings(e){}isEsmEnabled(){if(this.opts.project.configuration.sources.has("pnpEnableEsmLoader"))return this.opts.project.configuration.get("pnpEnableEsmLoader");if(this.isESMLoaderRequired)return!0;for(let e of this.opts.project.workspaces)if(e.manifest.type==="module")return!0;return!1}async finalizeInstallWithPnp(e){let t=Tl(this.opts.project),i=this.opts.project.configuration.get("pnpDataPath"),n=await this.locateNodeModules(e.ignorePattern);if(n.length>0){this.opts.report.reportWarning(X.DANGEROUS_NODE_MODULES,"One or more node_modules have been detected and will be removed. This operation may take some time.");for(let o of n)await K.removePromise(o)}if(await this.transformPnpSettings(e),this.opts.project.configuration.get("pnpEnableInlining")){let o=xAe(e);await K.changeFilePromise(t.cjs,o,{automaticNewlines:!0,mode:493}),await K.removePromise(i)}else{let o=k.relative(k.dirname(t.cjs),i),{dataFile:a,loaderFile:l}=kAe(te(N({},e),{dataLocation:o}));await K.changeFilePromise(t.cjs,l,{automaticNewlines:!0,mode:493}),await K.changeFilePromise(i,a,{automaticNewlines:!0,mode:420})}this.isEsmEnabled()&&(this.opts.report.reportWarning(X.UNNAMED,"ESM support for PnP uses the experimental loader API and is therefore experimental"),await K.changeFilePromise(t.esmLoader,(0,PL.default)(),{automaticNewlines:!0,mode:420}));let s=this.opts.project.configuration.get("pnpUnpluggedFolder");if(this.unpluggedPaths.size===0)await K.removePromise(s);else for(let o of await K.readdirPromise(s)){let a=k.resolve(s,o);this.unpluggedPaths.has(a)||await K.removePromise(a)}}async locateNodeModules(e){let t=[],i=e?new RegExp(e):null;for(let n of this.opts.project.workspaces){let s=k.join(n.cwd,"node_modules");if(i&&i.test(k.relative(this.opts.project.cwd,n.cwd))||!K.existsSync(s))continue;let o=await K.readdirPromise(s,{withFileTypes:!0}),a=o.filter(l=>!l.isDirectory()||l.name===".bin"||!l.name.startsWith("."));if(a.length===o.length)t.push(s);else for(let l of a)t.push(k.join(s,l.name))}return t}async unplugPackageIfNeeded(e,t,i,n,s){return this.shouldBeUnplugged(e,t,n)?this.unplugPackage(e,i,s):i.packageFs}shouldBeUnplugged(e,t,i){return typeof i.unplugged!="undefined"?i.unplugged:u8e.has(e.identHash)||e.conditions!=null?!0:t.manifest.preferUnplugged!==null?t.manifest.preferUnplugged:!!(rb(e,t,i,{configuration:this.opts.project.configuration}).length>0||t.misc.extractHint)}async unplugPackage(e,t,i){let n=Hm(e,{configuration:this.opts.project.configuration});return this.opts.project.disabledLocators.has(e.locatorHash)?new Na(n,{baseFs:t.packageFs,pathUtils:k}):(this.unpluggedPaths.add(n),i.holdFetchResult(this.asyncActions.set(e.locatorHash,async()=>{let s=k.join(n,t.prefixPath,".ready");await K.existsPromise(s)||(this.opts.project.storedBuildState.delete(e.locatorHash),await K.mkdirPromise(n,{recursive:!0}),await K.copyPromise(n,Me.dot,{baseFs:t.packageFs,overwrite:!1}),await K.writeFilePromise(s,""))})),new _t(n))}getPackageInformation(e){let t=P.stringifyIdent(e),i=e.reference,n=this.packageRegistry.get(t);if(!n)throw new Error(`Assertion failed: The package information store should have been available (for ${P.prettyIdent(this.opts.project.configuration,e)})`);let s=n.get(i);if(!s)throw new Error(`Assertion failed: The package information should have been available (for ${P.prettyLocator(this.opts.project.configuration,e)})`);return s}getDiskInformation(e){let t=Se.getMapWithDefault(this.packageRegistry,"@@disk"),i=NL(this.opts.project.cwd,e);return Se.getFactoryWithDefault(t,i,()=>({packageLocation:i,packageDependencies:new Map,packagePeers:new Set,linkType:Qt.SOFT,discardFromLookup:!1}))}};function NL(r,e){let t=k.relative(r,e);return t.match(/^\.{0,2}\//)||(t=`./${t}`),t.replace(/\/?$/,"/")}async function g8e(r){var i;let e=(i=await At.tryFind(r.prefixPath,{baseFs:r.packageFs}))!=null?i:new At,t=new Set(["preinstall","install","postinstall"]);for(let n of e.scripts.keys())t.has(n)||e.scripts.delete(n);return{manifest:{scripts:e.scripts,preferUnplugged:e.preferUnplugged,type:e.type},misc:{extractHint:DL(r),hasBindingGyp:RL(r)}}}var KAe=ge(is());var jm=class extends Le{constructor(){super(...arguments);this.all=J.Boolean("-A,--all",!1,{description:"Unplug direct dependencies from the entire project"});this.recursive=J.Boolean("-R,--recursive",!1,{description:"Unplug both direct and transitive dependencies"});this.json=J.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.patterns=J.Rest()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,workspace:i}=await ze.find(e,this.context.cwd),n=await Nt.find(e);if(!i)throw new ht(t.cwd,this.context.cwd);if(e.get("nodeLinker")!=="pnp")throw new Pe("This command can only be used if the `nodeLinker` option is set to `pnp`");await t.restoreInstallState();let s=new Set(this.patterns),o=this.patterns.map(f=>{let h=P.parseDescriptor(f),p=h.range!=="unknown"?h:P.makeDescriptor(h,"*");if(!Wt.validRange(p.range))throw new Pe(`The range of the descriptor patterns must be a valid semver range (${P.prettyDescriptor(e,p)})`);return m=>{let y=P.stringifyIdent(m);return!KAe.default.isMatch(y,P.stringifyIdent(p))||m.version&&!Wt.satisfiesWithPrereleases(m.version,p.range)?!1:(s.delete(f),!0)}}),a=()=>{let f=[];for(let h of t.storedPackages.values())!t.tryWorkspaceByLocator(h)&&!P.isVirtualLocator(h)&&o.some(p=>p(h))&&f.push(h);return f},l=f=>{let h=new Set,p=[],m=(y,b)=>{if(!h.has(y.locatorHash)&&(h.add(y.locatorHash),!t.tryWorkspaceByLocator(y)&&o.some(v=>v(y))&&p.push(y),!(b>0&&!this.recursive)))for(let v of y.dependencies.values()){let x=t.storedResolutions.get(v.descriptorHash);if(!x)throw new Error("Assertion failed: The resolution should have been registered");let T=t.storedPackages.get(x);if(!T)throw new Error("Assertion failed: The package should have been registered");m(T,b+1)}};for(let y of f){let b=t.storedPackages.get(y.anchoredLocator.locatorHash);if(!b)throw new Error("Assertion failed: The package should have been registered");m(b,0)}return p},c,u;if(this.all&&this.recursive?(c=a(),u="the project"):this.all?(c=l(t.workspaces),u="any workspace"):(c=l([i]),u="this workspace"),s.size>1)throw new Pe(`Patterns ${ae.prettyList(e,s,ae.Type.CODE)} don't match any packages referenced by ${u}`);if(s.size>0)throw new Pe(`Pattern ${ae.prettyList(e,s,ae.Type.CODE)} doesn't match any packages referenced by ${u}`);return c=Se.sortMap(c,f=>P.stringifyLocator(f)),(await Je.start({configuration:e,stdout:this.context.stdout,json:this.json},async f=>{var h;for(let p of c){let m=(h=p.version)!=null?h:"unknown",y=t.topLevelWorkspace.manifest.ensureDependencyMeta(P.makeDescriptor(p,m));y.unplugged=!0,f.reportInfo(X.UNNAMED,`Will unpack ${P.prettyLocator(e,p)} to ${ae.pretty(e,Hm(p,{configuration:e}),ae.Type.PATH)}`),f.reportJson({locator:P.stringifyLocator(p),version:m})}await t.topLevelWorkspace.persistManifest(),f.reportSeparator(),await t.install({cache:n,report:f})})).exitCode()}};jm.paths=[["unplug"]],jm.usage=Re.Usage({description:"force the unpacking of a list of packages",details:"\n This command will add the selectors matching the specified patterns to the list of packages that must be unplugged when installed.\n\n A package being unplugged means that instead of being referenced directly through its archive, it will be unpacked at install time in the directory configured via `pnpUnpluggedFolder`. Note that unpacking packages this way is generally not recommended because it'll make it harder to store your packages within the repository. However, it's a good approach to quickly and safely debug some packages, and can even sometimes be required depending on the context (for example when the package contains shellscripts).\n\n Running the command will set a persistent flag inside your top-level `package.json`, in the `dependenciesMeta` field. As such, to undo its effects, you'll need to revert the changes made to the manifest and run `yarn install` to apply the modification.\n\n By default, only direct dependencies from the current workspace are affected. If `-A,--all` is set, direct dependencies from the entire project are affected. Using the `-R,--recursive` flag will affect transitive dependencies as well as direct ones.\n\n This command accepts glob patterns inside the scope and name components (not the range). Make sure to escape the patterns to prevent your own shell from trying to expand them.\n ",examples:[["Unplug the lodash dependency from the active workspace","yarn unplug lodash"],["Unplug all instances of lodash referenced by any workspace","yarn unplug lodash -A"],["Unplug all instances of lodash referenced by the active workspace and its dependencies","yarn unplug lodash -R"],["Unplug all instances of lodash, anywhere","yarn unplug lodash -AR"],["Unplug one specific version of lodash","yarn unplug lodash@1.2.3"],["Unplug all packages with the `@babel` scope","yarn unplug '@babel/*'"],["Unplug all packages (only for testing, not recommended)","yarn unplug -R '*'"]]});var UAe=jm;var Tl=r=>({cjs:k.join(r.cwd,kt.pnpCjs),cjsLegacy:k.join(r.cwd,kt.pnpJs),esmLoader:k.join(r.cwd,".pnp.loader.mjs")}),GAe=r=>/\s/.test(r)?JSON.stringify(r):r;async function f8e(r,e,t){let i=Tl(r),n=`--require ${GAe(H.fromPortablePath(i.cjs))}`;if(K.existsSync(i.esmLoader)&&(n=`${n} --experimental-loader ${(0,jAe.pathToFileURL)(H.fromPortablePath(i.esmLoader)).href}`),i.cjs.includes(" ")&&HAe.default.lt(process.versions.node,"12.0.0"))throw new Error(`Expected the build location to not include spaces when using Node < 12.0.0 (${process.versions.node})`);if(K.existsSync(i.cjs)){let s=e.NODE_OPTIONS||"",o=/\s*--require\s+\S*\.pnp\.c?js\s*/g,a=/\s*--experimental-loader\s+\S*\.pnp\.loader\.mjs\s*/;s=s.replace(o," ").replace(a," ").trim(),s=s?`${n} ${s}`:n,e.NODE_OPTIONS=s}}async function h8e(r,e){let t=Tl(r);e(t.cjs),e(t.esmLoader),e(r.configuration.get("pnpDataPath")),e(r.configuration.get("pnpUnpluggedFolder"))}var p8e={hooks:{populateYarnPaths:h8e,setupScriptEnvironment:f8e},configuration:{nodeLinker:{description:'The linker used for installing Node packages, one of: "pnp", "node-modules"',type:Ie.STRING,default:"pnp"},pnpMode:{description:"If 'strict', generates standard PnP maps. If 'loose', merges them with the n_m resolution.",type:Ie.STRING,default:"strict"},pnpShebang:{description:"String to prepend to the generated PnP script",type:Ie.STRING,default:"#!/usr/bin/env node"},pnpIgnorePatterns:{description:"Array of glob patterns; files matching them will use the classic resolution",type:Ie.STRING,default:[],isArray:!0},pnpEnableEsmLoader:{description:"If true, Yarn will generate an ESM loader (`.pnp.loader.mjs`). If this is not explicitly set Yarn tries to automatically detect whether ESM support is required.",type:Ie.BOOLEAN,default:!1},pnpEnableInlining:{description:"If true, the PnP data will be inlined along with the generated loader",type:Ie.BOOLEAN,default:!0},pnpFallbackMode:{description:"If true, the generated PnP loader will follow the top-level fallback rule",type:Ie.STRING,default:"dependencies-only"},pnpUnpluggedFolder:{description:"Folder where the unplugged packages must be stored",type:Ie.ABSOLUTE_PATH,default:"./.yarn/unplugged"},pnpDataPath:{description:"Path of the file where the PnP data (used by the loader) must be written",type:Ie.ABSOLUTE_PATH,default:"./.pnp.data.json"}},linkers:[xu],commands:[UAe]},d8e=p8e;var _Ae=ge(zAe());var UL=ge(require("crypto")),VAe=ge(require("fs")),XAe=1,jr="node_modules",ib=".bin",ZAe=".yarn-state.yml",Ti;(function(i){i.CLASSIC="classic",i.HARDLINKS_LOCAL="hardlinks-local",i.HARDLINKS_GLOBAL="hardlinks-global"})(Ti||(Ti={}));var HL=class{constructor(){this.installStateCache=new Map}supportsPackage(e,t){return this.isEnabled(t)}async findPackageLocation(e,t){if(!this.isEnabled(t))throw new Error("Assertion failed: Expected the node-modules linker to be enabled");let i=t.project.tryWorkspaceByLocator(e);if(i)return i.cwd;let n=await Se.getFactoryWithDefault(this.installStateCache,t.project.cwd,async()=>await jL(t.project,{unrollAliases:!0}));if(n===null)throw new Pe("Couldn't find the node_modules state file - running an install might help (findPackageLocation)");let s=n.locatorMap.get(P.stringifyLocator(e));if(!s){let a=new Pe(`Couldn't find ${P.prettyLocator(t.project.configuration,e)} in the currently installed node_modules map - running an install might help`);throw a.code="LOCATOR_NOT_INSTALLED",a}let o=t.project.configuration.startingCwd;return s.locations.find(a=>k.contains(o,a))||s.locations[0]}async findPackageLocator(e,t){if(!this.isEnabled(t))return null;let i=await Se.getFactoryWithDefault(this.installStateCache,t.project.cwd,async()=>await jL(t.project,{unrollAliases:!0}));if(i===null)return null;let{locationRoot:n,segments:s}=nb(k.resolve(e),{skipPrefix:t.project.cwd}),o=i.locationTree.get(n);if(!o)return null;let a=o.locator;for(let l of s){if(o=o.children.get(l),!o)break;a=o.locator||a}return P.parseLocator(a)}makeInstaller(e){return new $Ae(e)}isEnabled(e){return e.project.configuration.get("nodeLinker")==="node-modules"}},$Ae=class{constructor(e){this.opts=e;this.localStore=new Map;this.realLocatorChecksums=new Map;this.customData={store:new Map}}getCustomDataKey(){return JSON.stringify({name:"NodeModulesInstaller",version:2})}attachCustomData(e){this.customData=e}async installPackage(e,t){var u;let i=k.resolve(t.packageFs.getRealPath(),t.prefixPath),n=this.customData.store.get(e.locatorHash);if(typeof n=="undefined"&&(n=await F8e(e,t),e.linkType===Qt.HARD&&this.customData.store.set(e.locatorHash,n)),!P.isPackageCompatible(e,this.opts.project.configuration.getSupportedArchitectures()))return{packageLocation:null,buildDirective:null};let s=new Map,o=new Set;s.has(P.stringifyIdent(e))||s.set(P.stringifyIdent(e),e.reference);let a=e;if(P.isVirtualLocator(e)){a=P.devirtualizeLocator(e);for(let g of e.peerDependencies.values())s.set(P.stringifyIdent(g),null),o.add(P.stringifyIdent(g))}let l={packageLocation:`${H.fromPortablePath(i)}/`,packageDependencies:s,packagePeers:o,linkType:e.linkType,discardFromLookup:(u=t.discardFromLookup)!=null?u:!1};this.localStore.set(e.locatorHash,{pkg:e,customPackageData:n,dependencyMeta:this.opts.project.getDependencyMeta(e,e.version),pnpNode:l});let c=t.checksum?t.checksum.substring(t.checksum.indexOf("/")+1):null;return this.realLocatorChecksums.set(a.locatorHash,c),{packageLocation:i,buildDirective:null}}async attachInternalDependencies(e,t){let i=this.localStore.get(e.locatorHash);if(typeof i=="undefined")throw new Error("Assertion failed: Expected information object to have been registered");for(let[n,s]of t){let o=P.areIdentsEqual(n,s)?s.reference:[P.stringifyIdent(s),s.reference];i.pnpNode.packageDependencies.set(P.stringifyIdent(n),o)}}async attachExternalDependents(e,t){throw new Error("External dependencies haven't been implemented for the node-modules linker")}async finalizeInstall(){if(this.opts.project.configuration.get("nodeLinker")!=="node-modules")return;let e=new Wr({baseFs:new Is({libzip:await fn(),maxOpenFiles:80,readOnlyArchives:!0})}),t=await jL(this.opts.project),i=this.opts.project.configuration.get("nmMode");(t===null||i!==t.nmMode)&&(this.opts.project.storedBuildState.clear(),t={locatorMap:new Map,binSymlinks:new Map,locationTree:new Map,nmMode:i,mtimeMs:0});let n=new Map(this.opts.project.workspaces.map(f=>{var p,m;let h=this.opts.project.configuration.get("nmHoistingLimits");try{h=Se.validateEnum(Kn,(m=(p=f.manifest.installConfig)==null?void 0:p.hoistingLimits)!=null?m:h)}catch(y){let b=P.prettyWorkspace(this.opts.project.configuration,f);this.opts.report.reportWarning(X.INVALID_MANIFEST,`${b}: Invalid 'installConfig.hoistingLimits' value. Expected one of ${Object.values(Kn).join(", ")}, using default: "${h}"`)}return[f.relativeCwd,h]})),s=new Map(this.opts.project.workspaces.map(f=>{var p,m;let h=this.opts.project.configuration.get("nmSelfReferences");return h=(m=(p=f.manifest.installConfig)==null?void 0:p.selfReferences)!=null?m:h,[f.relativeCwd,h]})),o={VERSIONS:{std:1},topLevel:{name:null,reference:null},getLocator:(f,h)=>Array.isArray(h)?{name:h[0],reference:h[1]}:{name:f,reference:h},getDependencyTreeRoots:()=>this.opts.project.workspaces.map(f=>{let h=f.anchoredLocator;return{name:P.stringifyIdent(f.locator),reference:h.reference}}),getPackageInformation:f=>{let h=f.reference===null?this.opts.project.topLevelWorkspace.anchoredLocator:P.makeLocator(P.parseIdent(f.name),f.reference),p=this.localStore.get(h.locatorHash);if(typeof p=="undefined")throw new Error("Assertion failed: Expected the package reference to have been registered");return p.pnpNode},findPackageLocator:f=>{let h=this.opts.project.tryWorkspaceByCwd(H.toPortablePath(f));if(h!==null){let p=h.anchoredLocator;return{name:P.stringifyIdent(p),reference:p.reference}}throw new Error("Assertion failed: Unimplemented")},resolveToUnqualified:()=>{throw new Error("Assertion failed: Unimplemented")},resolveUnqualified:()=>{throw new Error("Assertion failed: Unimplemented")},resolveRequest:()=>{throw new Error("Assertion failed: Unimplemented")},resolveVirtual:f=>H.fromPortablePath(Wr.resolveVirtual(H.toPortablePath(f)))},{tree:a,errors:l,preserveSymlinksRequired:c}=Om(o,{pnpifyFs:!1,validateExternalSoftLinks:!0,hoistingLimitsByCwd:n,project:this.opts.project,selfReferencesByCwd:s});if(!a){for(let{messageName:f,text:h}of l)this.opts.report.reportError(f,h);return}let u=BL(a);await N8e(t,u,{baseFs:e,project:this.opts.project,report:this.opts.report,realLocatorChecksums:this.realLocatorChecksums,loadManifest:async f=>{let h=P.parseLocator(f),p=this.localStore.get(h.locatorHash);if(typeof p=="undefined")throw new Error("Assertion failed: Expected the slot to exist");return p.customPackageData.manifest}});let g=[];for(let[f,h]of u.entries()){if(ele(f))continue;let p=P.parseLocator(f),m=this.localStore.get(p.locatorHash);if(typeof m=="undefined")throw new Error("Assertion failed: Expected the slot to exist");if(this.opts.project.tryWorkspaceByLocator(m.pkg))continue;let y=Ca.extractBuildScripts(m.pkg,m.customPackageData,m.dependencyMeta,{configuration:this.opts.project.configuration,report:this.opts.report});y.length!==0&&g.push({buildLocations:h.locations,locatorHash:p.locatorHash,buildDirective:y})}return c&&this.opts.report.reportWarning(X.NM_PRESERVE_SYMLINKS_REQUIRED,`The application uses portals and that's why ${ae.pretty(this.opts.project.configuration,"--preserve-symlinks",ae.Type.CODE)} Node option is required for launching it`),{customData:this.customData,records:g}}};async function F8e(r,e){var n;let t=(n=await At.tryFind(e.prefixPath,{baseFs:e.packageFs}))!=null?n:new At,i=new Set(["preinstall","install","postinstall"]);for(let s of t.scripts.keys())i.has(s)||t.scripts.delete(s);return{manifest:{bin:t.bin,scripts:t.scripts},misc:{extractHint:Ca.getExtractHint(e),hasBindingGyp:Ca.hasBindingGyp(e)}}}async function L8e(r,e,t,i,{installChangedByUser:n}){let s="";s+=`# Warning: This file is automatically generated. Removing it is fine, but will -`,s+=`# cause your node_modules installation to become invalidated. -`,s+=` -`,s+=`__metadata: -`,s+=` version: ${XAe} -`,s+=` nmMode: ${i.value} -`;let o=Array.from(e.keys()).sort(),a=P.stringifyLocator(r.topLevelWorkspace.anchoredLocator);for(let u of o){let g=e.get(u);s+=` -`,s+=`${JSON.stringify(u)}: -`,s+=` locations: -`;for(let f of g.locations){let h=k.contains(r.cwd,f);if(h===null)throw new Error(`Assertion failed: Expected the path to be within the project (${f})`);s+=` - ${JSON.stringify(h)} -`}if(g.aliases.length>0){s+=` aliases: -`;for(let f of g.aliases)s+=` - ${JSON.stringify(f)} -`}if(u===a&&t.size>0){s+=` bin: -`;for(let[f,h]of t){let p=k.contains(r.cwd,f);if(p===null)throw new Error(`Assertion failed: Expected the path to be within the project (${f})`);s+=` ${JSON.stringify(p)}: -`;for(let[m,y]of h){let b=k.relative(k.join(f,jr),y);s+=` ${JSON.stringify(m)}: ${JSON.stringify(b)} -`}}}}let l=r.cwd,c=k.join(l,jr,ZAe);n&&await K.removePromise(c),await K.changeFilePromise(c,s,{automaticNewlines:!0})}async function jL(r,{unrollAliases:e=!1}={}){let t=r.cwd,i=k.join(t,jr,ZAe),n;try{n=await K.statPromise(i)}catch(c){}if(!n)return null;let s=Si(await K.readFilePromise(i,"utf8"));if(s.__metadata.version>XAe)return null;let o=s.__metadata.nmMode||Ti.CLASSIC,a=new Map,l=new Map;delete s.__metadata;for(let[c,u]of Object.entries(s)){let g=u.locations.map(h=>k.join(t,h)),f=u.bin;if(f)for(let[h,p]of Object.entries(f)){let m=k.join(t,H.toPortablePath(h)),y=Se.getMapWithDefault(l,m);for(let[b,v]of Object.entries(p))y.set(Jr(b),H.toPortablePath([m,jr,v].join(k.sep)))}if(a.set(c,{target:Me.dot,linkType:Qt.HARD,locations:g,aliases:u.aliases||[]}),e&&u.aliases)for(let h of u.aliases){let{scope:p,name:m}=P.parseLocator(c),y=P.makeLocator(P.makeIdent(p,m),h),b=P.stringifyLocator(y);a.set(b,{target:Me.dot,linkType:Qt.HARD,locations:g,aliases:[]})}}return{locatorMap:a,binSymlinks:l,locationTree:tle(a,{skipPrefix:r.cwd}),nmMode:o,mtimeMs:n.mtimeMs}}var Ah=async(r,e)=>{if(r.split(k.sep).indexOf(jr)<0)throw new Error(`Assertion failed: trying to remove dir that doesn't contain node_modules: ${r}`);try{if(!e.innerLoop){let i=e.allowSymlink?await K.statPromise(r):await K.lstatPromise(r);if(e.allowSymlink&&!i.isDirectory()||!e.allowSymlink&&i.isSymbolicLink()){await K.unlinkPromise(r);return}}let t=await K.readdirPromise(r,{withFileTypes:!0});for(let i of t){let n=k.join(r,Jr(i.name));i.isDirectory()?(i.name!==jr||e&&e.innerLoop)&&await Ah(n,{innerLoop:!0,contentsOnly:!1}):await K.unlinkPromise(n)}e.contentsOnly||await K.rmdirPromise(r)}catch(t){if(t.code!=="ENOENT"&&t.code!=="ENOTEMPTY")throw t}},rle=4,nb=(r,{skipPrefix:e})=>{let t=k.contains(e,r);if(t===null)throw new Error(`Assertion failed: Writing attempt prevented to ${r} which is outside project root: ${e}`);let i=t.split(k.sep).filter(l=>l!==""),n=i.indexOf(jr),s=i.slice(0,n).join(k.sep),o=k.join(e,s),a=i.slice(n);return{locationRoot:o,segments:a}},tle=(r,{skipPrefix:e})=>{let t=new Map;if(r===null)return t;let i=()=>({children:new Map,linkType:Qt.HARD});for(let[n,s]of r.entries()){if(s.linkType===Qt.SOFT&&k.contains(e,s.target)!==null){let a=Se.getFactoryWithDefault(t,s.target,i);a.locator=n,a.linkType=s.linkType}for(let o of s.locations){let{locationRoot:a,segments:l}=nb(o,{skipPrefix:e}),c=Se.getFactoryWithDefault(t,a,i);for(let u=0;u{let t;try{process.platform==="win32"&&(t=await K.lstatPromise(r))}catch(i){}process.platform=="win32"&&(!t||t.isDirectory())?await K.symlinkPromise(r,e,"junction"):await K.symlinkPromise(k.relative(k.dirname(e),r),e)};async function ile(r,e,t){let i=k.join(r,Jr(`${UL.default.randomBytes(16).toString("hex")}.tmp`));try{await K.writeFilePromise(i,t);try{await K.linkPromise(i,e)}catch(n){}}finally{await K.unlinkPromise(i)}}async function T8e({srcPath:r,dstPath:e,srcMode:t,globalHardlinksStore:i,baseFs:n,nmMode:s,digest:o}){if(s.value===Ti.HARDLINKS_GLOBAL&&i&&o){let l=k.join(i,o.substring(0,2),`${o.substring(2)}.dat`),c;try{if(await Dn.checksumFile(l,{baseFs:K,algorithm:"sha1"})!==o){let g=k.join(i,Jr(`${UL.default.randomBytes(16).toString("hex")}.tmp`));await K.renamePromise(l,g);let f=await n.readFilePromise(r);await K.writeFilePromise(g,f);try{await K.linkPromise(g,l),await K.unlinkPromise(g)}catch(h){}}await K.linkPromise(l,e),c=!0}catch(u){c=!1}if(!c){let u=await n.readFilePromise(r);await ile(i,l,u);try{await K.linkPromise(l,e)}catch(g){g&&g.code&&g.code=="EXDEV"&&(s.value=Ti.HARDLINKS_LOCAL,await n.copyFilePromise(r,e))}}}else await n.copyFilePromise(r,e);let a=t&511;a!==420&&await K.chmodPromise(e,a)}var Ol;(function(i){i.FILE="file",i.DIRECTORY="directory",i.SYMLINK="symlink"})(Ol||(Ol={}));var O8e=async(r,e,{baseFs:t,globalHardlinksStore:i,nmMode:n,packageChecksum:s})=>{await K.mkdirPromise(r,{recursive:!0});let o=async(l=Me.dot)=>{let c=k.join(e,l),u=await t.readdirPromise(c,{withFileTypes:!0}),g=new Map;for(let f of u){let h=k.join(l,f.name),p,m=k.join(c,f.name);if(f.isFile()){if(p={kind:Ol.FILE,mode:(await t.lstatPromise(m)).mode},n.value===Ti.HARDLINKS_GLOBAL){let y=await Dn.checksumFile(m,{baseFs:t,algorithm:"sha1"});p.digest=y}}else if(f.isDirectory())p={kind:Ol.DIRECTORY};else if(f.isSymbolicLink())p={kind:Ol.SYMLINK,symlinkTo:await t.readlinkPromise(m)};else throw new Error(`Unsupported file type (file: ${m}, mode: 0o${await t.statSync(m).mode.toString(8).padStart(6,"0")})`);if(g.set(h,p),f.isDirectory()&&h!==jr){let y=await o(h);for(let[b,v]of y)g.set(b,v)}}return g},a;if(n.value===Ti.HARDLINKS_GLOBAL&&i&&s){let l=k.join(i,s.substring(0,2),`${s.substring(2)}.json`);try{a=new Map(Object.entries(JSON.parse(await K.readFilePromise(l,"utf8"))))}catch(c){a=await o(),await ile(i,l,Buffer.from(JSON.stringify(Object.fromEntries(a))))}}else a=await o();for(let[l,c]of a){let u=k.join(e,l),g=k.join(r,l);c.kind===Ol.DIRECTORY?await K.mkdirPromise(g,{recursive:!0}):c.kind===Ol.FILE?await T8e({srcPath:u,dstPath:g,srcMode:c.mode,digest:c.digest,nmMode:n,baseFs:t,globalHardlinksStore:i}):c.kind===Ol.SYMLINK&&await GL(k.resolve(k.dirname(g),c.symlinkTo),g)}};function M8e(r,e,t,i){let n=new Map,s=new Map,o=new Map,a=!1,l=(c,u,g,f,h)=>{let p=!0,m=k.join(c,u),y=new Set;if(u===jr||u.startsWith("@")){let v;try{v=K.statSync(m)}catch(T){}p=!!v,v?v.mtimeMs>t?(a=!0,y=new Set(K.readdirSync(m))):y=new Set(g.children.get(u).children.keys()):a=!0;let x=e.get(c);if(x){let T=k.join(c,jr,ib),q;try{q=K.statSync(T)}catch(Y){}if(!q)a=!0;else if(q.mtimeMs>t){a=!0;let Y=new Set(K.readdirSync(T)),$=new Map;s.set(c,$);for(let[_,ne]of x)Y.has(_)&&$.set(_,ne)}else s.set(c,x)}}else p=h.has(u);let b=g.children.get(u);if(p){let{linkType:v,locator:x}=b,T={children:new Map,linkType:v,locator:x};if(f.children.set(u,T),x){let q=Se.getSetWithDefault(o,x);q.add(m),o.set(x,q)}for(let q of b.children.keys())l(m,q,b,T,y)}else b.locator&&i.storedBuildState.delete(P.parseLocator(b.locator).locatorHash)};for(let[c,u]of r){let{linkType:g,locator:f}=u,h={children:new Map,linkType:g,locator:f};if(n.set(c,h),f){let p=Se.getSetWithDefault(o,u.locator);p.add(c),o.set(u.locator,p)}u.children.has(jr)&&l(c,jr,u,h,new Set)}return{locationTree:n,binSymlinks:s,locatorLocations:o,installChangedByUser:a}}function ele(r){let e=P.parseDescriptor(r);return P.isVirtualDescriptor(e)&&(e=P.devirtualizeDescriptor(e)),e.range.startsWith("link:")}async function K8e(r,e,t,{loadManifest:i}){let n=new Map;for(let[a,{locations:l}]of r){let c=ele(a)?null:await i(a,l[0]),u=new Map;if(c)for(let[g,f]of c.bin){let h=k.join(l[0],f);f!==""&&K.existsSync(h)&&u.set(g,f)}n.set(a,u)}let s=new Map,o=(a,l,c)=>{let u=new Map,g=k.contains(t,a);if(c.locator&&g!==null){let f=n.get(c.locator);for(let[h,p]of f){let m=k.join(a,H.toPortablePath(p));u.set(Jr(h),m)}for(let[h,p]of c.children){let m=k.join(a,h),y=o(m,m,p);y.size>0&&s.set(a,new Map([...s.get(a)||new Map,...y]))}}else for(let[f,h]of c.children){let p=o(k.join(a,f),l,h);for(let[m,y]of p)u.set(m,y)}return u};for(let[a,l]of e){let c=o(a,a,l);c.size>0&&s.set(a,new Map([...s.get(a)||new Map,...c]))}return s}var nle=(r,e)=>{if(!r||!e)return r===e;let t=P.parseLocator(r);P.isVirtualLocator(t)&&(t=P.devirtualizeLocator(t));let i=P.parseLocator(e);return P.isVirtualLocator(i)&&(i=P.devirtualizeLocator(i)),P.areLocatorsEqual(t,i)};function YL(r){return k.join(r.get("globalFolder"),"store")}async function N8e(r,e,{baseFs:t,project:i,report:n,loadManifest:s,realLocatorChecksums:o}){let a=k.join(i.cwd,jr),{locationTree:l,binSymlinks:c,locatorLocations:u,installChangedByUser:g}=M8e(r.locationTree,r.binSymlinks,r.mtimeMs,i),f=tle(e,{skipPrefix:i.cwd}),h=[],p=async({srcDir:_,dstDir:ne,linkType:ee,globalHardlinksStore:A,nmMode:oe,packageChecksum:ce})=>{let Z=(async()=>{try{ee===Qt.SOFT?(await K.mkdirPromise(k.dirname(ne),{recursive:!0}),await GL(k.resolve(_),ne)):await O8e(ne,_,{baseFs:t,globalHardlinksStore:A,nmMode:oe,packageChecksum:ce})}catch(O){throw O.message=`While persisting ${_} -> ${ne} ${O.message}`,O}finally{T.tick()}})().then(()=>h.splice(h.indexOf(Z),1));h.push(Z),h.length>rle&&await Promise.race(h)},m=async(_,ne,ee)=>{let A=(async()=>{let oe=async(ce,Z,O)=>{try{O.innerLoop||await K.mkdirPromise(Z,{recursive:!0});let L=await K.readdirPromise(ce,{withFileTypes:!0});for(let de of L){if(!O.innerLoop&&de.name===ib)continue;let Be=k.join(ce,de.name),je=k.join(Z,de.name);de.isDirectory()?(de.name!==jr||O&&O.innerLoop)&&(await K.mkdirPromise(je,{recursive:!0}),await oe(Be,je,te(N({},O),{innerLoop:!0}))):$.value===Ti.HARDLINKS_LOCAL||$.value===Ti.HARDLINKS_GLOBAL?await K.linkPromise(Be,je):await K.copyFilePromise(Be,je,VAe.default.constants.COPYFILE_FICLONE)}}catch(L){throw O.innerLoop||(L.message=`While cloning ${ce} -> ${Z} ${L.message}`),L}finally{O.innerLoop||T.tick()}};await oe(_,ne,ee)})().then(()=>h.splice(h.indexOf(A),1));h.push(A),h.length>rle&&await Promise.race(h)},y=async(_,ne,ee)=>{if(ee)for(let[A,oe]of ne.children){let ce=ee.children.get(A);await y(k.join(_,A),oe,ce)}else{ne.children.has(jr)&&await Ah(k.join(_,jr),{contentsOnly:!1});let A=k.basename(_)===jr&&f.has(k.join(k.dirname(_),k.sep));await Ah(_,{contentsOnly:_===a,allowSymlink:A})}};for(let[_,ne]of l){let ee=f.get(_);for(let[A,oe]of ne.children){if(A===".")continue;let ce=ee&&ee.children.get(A),Z=k.join(_,A);await y(Z,oe,ce)}}let b=async(_,ne,ee)=>{if(ee){nle(ne.locator,ee.locator)||await Ah(_,{contentsOnly:ne.linkType===Qt.HARD});for(let[A,oe]of ne.children){let ce=ee.children.get(A);await b(k.join(_,A),oe,ce)}}else{ne.children.has(jr)&&await Ah(k.join(_,jr),{contentsOnly:!0});let A=k.basename(_)===jr&&f.has(k.join(k.dirname(_),k.sep));await Ah(_,{contentsOnly:ne.linkType===Qt.HARD,allowSymlink:A})}};for(let[_,ne]of f){let ee=l.get(_);for(let[A,oe]of ne.children){if(A===".")continue;let ce=ee&&ee.children.get(A);await b(k.join(_,A),oe,ce)}}let v=new Map,x=[];for(let[_,ne]of u)for(let ee of ne){let{locationRoot:A,segments:oe}=nb(ee,{skipPrefix:i.cwd}),ce=f.get(A),Z=A;if(ce){for(let O of oe)if(Z=k.join(Z,O),ce=ce.children.get(O),!ce)break;if(ce){let O=nle(ce.locator,_),L=e.get(ce.locator),de=L.target,Be=Z,je=L.linkType;if(O)v.has(de)||v.set(de,Be);else if(de!==Be){let re=P.parseLocator(ce.locator);P.isVirtualLocator(re)&&(re=P.devirtualizeLocator(re)),x.push({srcDir:de,dstDir:Be,linkType:je,realLocatorHash:re.locatorHash})}}}}for(let[_,{locations:ne}]of e.entries())for(let ee of ne){let{locationRoot:A,segments:oe}=nb(ee,{skipPrefix:i.cwd}),ce=l.get(A),Z=f.get(A),O=A,L=e.get(_),de=P.parseLocator(_);P.isVirtualLocator(de)&&(de=P.devirtualizeLocator(de));let Be=de.locatorHash,je=L.target,re=ee;if(je===re)continue;let se=L.linkType;for(let be of oe)Z=Z.children.get(be);if(!ce)x.push({srcDir:je,dstDir:re,linkType:se,realLocatorHash:Be});else for(let be of oe)if(O=k.join(O,be),ce=ce.children.get(be),!ce){x.push({srcDir:je,dstDir:re,linkType:se,realLocatorHash:Be});break}}let T=Ji.progressViaCounter(x.length),q=n.reportProgress(T),Y=i.configuration.get("nmMode"),$={value:Y};try{let _=$.value===Ti.HARDLINKS_GLOBAL?`${YL(i.configuration)}/v1`:null;if(_&&!await K.existsPromise(_)){await K.mkdirpPromise(_);for(let ee=0;ee<256;ee++)await K.mkdirPromise(k.join(_,ee.toString(16).padStart(2,"0")))}for(let ee of x)(ee.linkType===Qt.SOFT||!v.has(ee.srcDir))&&(v.set(ee.srcDir,ee.dstDir),await p(te(N({},ee),{globalHardlinksStore:_,nmMode:$,packageChecksum:o.get(ee.realLocatorHash)||null})));await Promise.all(h),h.length=0;for(let ee of x){let A=v.get(ee.srcDir);ee.linkType!==Qt.SOFT&&ee.dstDir!==A&&await m(A,ee.dstDir,{nmMode:$})}await Promise.all(h),await K.mkdirPromise(a,{recursive:!0});let ne=await K8e(e,f,i.cwd,{loadManifest:s});await U8e(c,ne,i.cwd),await L8e(i,e,ne,$,{installChangedByUser:g}),Y==Ti.HARDLINKS_GLOBAL&&$.value==Ti.HARDLINKS_LOCAL&&n.reportWarningOnce(X.NM_HARDLINKS_MODE_DOWNGRADED,"'nmMode' has been downgraded to 'hardlinks-local' due to global cache and install folder being on different devices")}finally{q.stop()}}async function U8e(r,e,t){for(let i of r.keys()){if(k.contains(t,i)===null)throw new Error(`Assertion failed. Excepted bin symlink location to be inside project dir, instead it was at ${i}`);if(!e.has(i)){let n=k.join(i,jr,ib);await K.removePromise(n)}}for(let[i,n]of e){if(k.contains(t,i)===null)throw new Error(`Assertion failed. Excepted bin symlink location to be inside project dir, instead it was at ${i}`);let s=k.join(i,jr,ib),o=r.get(i)||new Map;await K.mkdirPromise(s,{recursive:!0});for(let a of o.keys())n.has(a)||(await K.removePromise(k.join(s,a)),process.platform==="win32"&&await K.removePromise(k.join(s,Jr(`${a}.cmd`))));for(let[a,l]of n){let c=o.get(a),u=k.join(s,a);c!==l&&(process.platform==="win32"?await(0,_Ae.default)(H.fromPortablePath(l),H.fromPortablePath(u),{createPwshFile:!1}):(await K.removePromise(u),await GL(l,u),k.contains(t,await K.realpathPromise(l))!==null&&await K.chmodPromise(l,493)))}}}var qL=class extends xu{constructor(){super(...arguments);this.mode="loose"}makeInstaller(e){return new sle(e)}},sle=class extends oh{constructor(){super(...arguments);this.mode="loose"}async transformPnpSettings(e){let t=new Wr({baseFs:new Is({libzip:await fn(),maxOpenFiles:80,readOnlyArchives:!0})}),i=NAe(e,this.opts.project.cwd,t),{tree:n,errors:s}=Om(i,{pnpifyFs:!1,project:this.opts.project});if(!n){for(let{messageName:u,text:g}of s)this.opts.report.reportError(u,g);return}let o=new Map;e.fallbackPool=o;let a=(u,g)=>{let f=P.parseLocator(g.locator),h=P.stringifyIdent(f);h===u?o.set(u,f.reference):o.set(u,[h,f.reference])},l=k.join(this.opts.project.cwd,kt.nodeModules),c=n.get(l);if(typeof c!="undefined"){if("target"in c)throw new Error("Assertion failed: Expected the root junction point to be a directory");for(let u of c.dirList){let g=k.join(l,u),f=n.get(g);if(typeof f=="undefined")throw new Error("Assertion failed: Expected the child to have been registered");if("target"in f)a(u,f);else for(let h of f.dirList){let p=k.join(g,h),m=n.get(p);if(typeof m=="undefined")throw new Error("Assertion failed: Expected the subchild to have been registered");if("target"in m)a(`${u}/${h}`,m);else throw new Error("Assertion failed: Expected the leaf junction to be a package")}}}}};var H8e={hooks:{cleanGlobalArtifacts:async r=>{let e=YL(r);await K.removePromise(e)}},configuration:{nmHoistingLimits:{description:"Prevent packages to be hoisted past specific levels",type:Ie.STRING,values:[Kn.WORKSPACES,Kn.DEPENDENCIES,Kn.NONE],default:Kn.NONE},nmMode:{description:'If set to "hardlinks-local" Yarn will utilize hardlinks to reduce disk space consumption inside "node_modules" directories. With "hardlinks-global" Yarn will use global content addressable storage to reduce "node_modules" size across all the projects using this option.',type:Ie.STRING,values:[Ti.CLASSIC,Ti.HARDLINKS_LOCAL,Ti.HARDLINKS_GLOBAL],default:Ti.CLASSIC},nmSelfReferences:{description:"If set to 'false' the workspace will not be allowed to require itself and corresponding self-referencing symlink will not be created",type:Ie.BOOLEAN,default:!0}},linkers:[HL,qL]},j8e=H8e;var qT={};ft(qT,{default:()=>V9e,npmConfigUtils:()=>br,npmHttpUtils:()=>zt,npmPublishUtils:()=>wh});var cle=ge(ri());var Cr="npm:";var zt={};ft(zt,{AuthType:()=>us,customPackageError:()=>q8e,del:()=>z8e,get:()=>bo,getIdentUrl:()=>Kl,handleInvalidAuthenticationError:()=>Ml,post:()=>J8e,put:()=>W8e});var Ale=ge(WC()),lle=ge(require("url"));var br={};ft(br,{RegistryType:()=>QA,getAuditRegistry:()=>G8e,getAuthConfiguration:()=>zL,getDefaultRegistry:()=>sb,getPublishRegistry:()=>ole,getRegistryConfiguration:()=>ale,getScopeConfiguration:()=>WL,getScopeRegistry:()=>SA,normalizeRegistry:()=>ma});var QA;(function(i){i.AUDIT_REGISTRY="npmAuditRegistry",i.FETCH_REGISTRY="npmRegistryServer",i.PUBLISH_REGISTRY="npmPublishRegistry"})(QA||(QA={}));function ma(r){return r.replace(/\/$/,"")}function G8e(r,{configuration:e}){let t=e.get(QA.AUDIT_REGISTRY);return t!==null?ma(t):ole(r,{configuration:e})}function ole(r,{configuration:e}){var t;return((t=r.publishConfig)==null?void 0:t.registry)?ma(r.publishConfig.registry):r.name?SA(r.name.scope,{configuration:e,type:QA.PUBLISH_REGISTRY}):sb({configuration:e,type:QA.PUBLISH_REGISTRY})}function SA(r,{configuration:e,type:t=QA.FETCH_REGISTRY}){let i=WL(r,{configuration:e});if(i===null)return sb({configuration:e,type:t});let n=i.get(t);return n===null?sb({configuration:e,type:t}):ma(n)}function sb({configuration:r,type:e=QA.FETCH_REGISTRY}){let t=r.get(e);return ma(t!==null?t:r.get(QA.FETCH_REGISTRY))}function ale(r,{configuration:e}){let t=e.get("npmRegistries"),i=ma(r),n=t.get(i);if(typeof n!="undefined")return n;let s=t.get(i.replace(/^[a-z]+:/,""));return typeof s!="undefined"?s:null}function WL(r,{configuration:e}){if(r===null)return null;let i=e.get("npmScopes").get(r);return i||null}function zL(r,{configuration:e,ident:t}){let i=t&&WL(t.scope,{configuration:e});return(i==null?void 0:i.get("npmAuthIdent"))||(i==null?void 0:i.get("npmAuthToken"))?i:ale(r,{configuration:e})||e}var us;(function(n){n[n.NO_AUTH=0]="NO_AUTH",n[n.BEST_EFFORT=1]="BEST_EFFORT",n[n.CONFIGURATION=2]="CONFIGURATION",n[n.ALWAYS_AUTH=3]="ALWAYS_AUTH"})(us||(us={}));async function Ml(r,{attemptedAs:e,registry:t,headers:i,configuration:n}){var s,o;if(ob(r))throw new ct(X.AUTHENTICATION_INVALID,"Invalid OTP token");if(((s=r.originalError)==null?void 0:s.name)==="HTTPError"&&((o=r.originalError)==null?void 0:o.response.statusCode)===401)throw new ct(X.AUTHENTICATION_INVALID,`Invalid authentication (${typeof e!="string"?`as ${await Y8e(t,i,{configuration:n})}`:`attempted as ${e}`})`)}function q8e(r){var e;return((e=r.response)==null?void 0:e.statusCode)===404?"Package not found":null}function Kl(r){return r.scope?`/@${r.scope}%2f${r.name}`:`/${r.name}`}async function bo(r,a){var l=a,{configuration:e,headers:t,ident:i,authType:n,registry:s}=l,o=Or(l,["configuration","headers","ident","authType","registry"]);if(i&&typeof s=="undefined"&&(s=SA(i.scope,{configuration:e})),i&&i.scope&&typeof n=="undefined"&&(n=1),typeof s!="string")throw new Error("Assertion failed: The registry should be a string");let c=await ab(s,{authType:n,configuration:e,ident:i});c&&(t=te(N({},t),{authorization:c}));try{return await ir.get(r.charAt(0)==="/"?`${s}${r}`:r,N({configuration:e,headers:t},o))}catch(u){throw await Ml(u,{registry:s,configuration:e,headers:t}),u}}async function J8e(r,e,u){var g=u,{attemptedAs:t,configuration:i,headers:n,ident:s,authType:o=3,registry:a,otp:l}=g,c=Or(g,["attemptedAs","configuration","headers","ident","authType","registry","otp"]);if(s&&typeof a=="undefined"&&(a=SA(s.scope,{configuration:i})),typeof a!="string")throw new Error("Assertion failed: The registry should be a string");let f=await ab(a,{authType:o,configuration:i,ident:s});f&&(n=te(N({},n),{authorization:f})),l&&(n=N(N({},n),lh(l)));try{return await ir.post(a+r,e,N({configuration:i,headers:n},c))}catch(h){if(!ob(h)||l)throw await Ml(h,{attemptedAs:t,registry:a,configuration:i,headers:n}),h;l=await _L();let p=N(N({},n),lh(l));try{return await ir.post(`${a}${r}`,e,N({configuration:i,headers:p},c))}catch(m){throw await Ml(m,{attemptedAs:t,registry:a,configuration:i,headers:n}),m}}}async function W8e(r,e,u){var g=u,{attemptedAs:t,configuration:i,headers:n,ident:s,authType:o=3,registry:a,otp:l}=g,c=Or(g,["attemptedAs","configuration","headers","ident","authType","registry","otp"]);if(s&&typeof a=="undefined"&&(a=SA(s.scope,{configuration:i})),typeof a!="string")throw new Error("Assertion failed: The registry should be a string");let f=await ab(a,{authType:o,configuration:i,ident:s});f&&(n=te(N({},n),{authorization:f})),l&&(n=N(N({},n),lh(l)));try{return await ir.put(a+r,e,N({configuration:i,headers:n},c))}catch(h){if(!ob(h))throw await Ml(h,{attemptedAs:t,registry:a,configuration:i,headers:n}),h;l=await _L();let p=N(N({},n),lh(l));try{return await ir.put(`${a}${r}`,e,N({configuration:i,headers:p},c))}catch(m){throw await Ml(m,{attemptedAs:t,registry:a,configuration:i,headers:n}),m}}}async function z8e(r,c){var u=c,{attemptedAs:e,configuration:t,headers:i,ident:n,authType:s=3,registry:o,otp:a}=u,l=Or(u,["attemptedAs","configuration","headers","ident","authType","registry","otp"]);if(n&&typeof o=="undefined"&&(o=SA(n.scope,{configuration:t})),typeof o!="string")throw new Error("Assertion failed: The registry should be a string");let g=await ab(o,{authType:s,configuration:t,ident:n});g&&(i=te(N({},i),{authorization:g})),a&&(i=N(N({},i),lh(a)));try{return await ir.del(o+r,N({configuration:t,headers:i},l))}catch(f){if(!ob(f)||a)throw await Ml(f,{attemptedAs:e,registry:o,configuration:t,headers:i}),f;a=await _L();let h=N(N({},i),lh(a));try{return await ir.del(`${o}${r}`,N({configuration:t,headers:h},l))}catch(p){throw await Ml(p,{attemptedAs:e,registry:o,configuration:t,headers:i}),p}}}async function ab(r,{authType:e=2,configuration:t,ident:i}){let n=zL(r,{configuration:t,ident:i}),s=_8e(n,e);if(!s)return null;let o=await t.reduceHook(a=>a.getNpmAuthenticationHeader,void 0,r,{configuration:t,ident:i});if(o)return o;if(n.get("npmAuthToken"))return`Bearer ${n.get("npmAuthToken")}`;if(n.get("npmAuthIdent")){let a=n.get("npmAuthIdent");return a.includes(":")?`Basic ${Buffer.from(a).toString("base64")}`:`Basic ${a}`}if(s&&e!==1)throw new ct(X.AUTHENTICATION_NOT_FOUND,"No authentication configured for request");return null}function _8e(r,e){switch(e){case 2:return r.get("npmAlwaysAuth");case 1:case 3:return!0;case 0:return!1;default:throw new Error("Unreachable")}}async function Y8e(r,e,{configuration:t}){var i;if(typeof e=="undefined"||typeof e.authorization=="undefined")return"an anonymous user";try{return(i=(await ir.get(new lle.URL(`${r}/-/whoami`).href,{configuration:t,headers:e,jsonResponse:!0})).username)!=null?i:"an unknown user"}catch{return"an unknown user"}}async function _L(){if(process.env.TEST_ENV)return process.env.TEST_NPM_2FA_TOKEN||"";let{otp:r}=await(0,Ale.prompt)({type:"password",name:"otp",message:"One-time password:",required:!0,onCancel:()=>process.exit(130)});return r}function ob(r){var e,t;if(((e=r.originalError)==null?void 0:e.name)!=="HTTPError")return!1;try{return((t=r.originalError)==null?void 0:t.response.headers["www-authenticate"].split(/,\s*/).map(n=>n.toLowerCase())).includes("otp")}catch(i){return!1}}function lh(r){return{["npm-otp"]:r}}var VL=class{supports(e,t){if(!e.reference.startsWith(Cr))return!1;let{selector:i,params:n}=P.parseRange(e.reference);return!(!cle.default.valid(i)||n===null||typeof n.__archiveUrl!="string")}getLocalPath(e,t){return null}async fetch(e,t){let i=t.checksums.get(e.locatorHash)||null,[n,s,o]=await t.cache.fetchPackageFromCache(e,i,N({onHit:()=>t.report.reportCacheHit(e),onMiss:()=>t.report.reportCacheMiss(e,`${P.prettyLocator(t.project.configuration,e)} can't be found in the cache and will be fetched from the remote server`),loader:()=>this.fetchFromNetwork(e,t),skipIntegrityCheck:t.skipIntegrityCheck},t.cacheOptions));return{packageFs:n,releaseFs:s,prefixPath:P.getIdentVendorPath(e),checksum:o}}async fetchFromNetwork(e,t){let{params:i}=P.parseRange(e.reference);if(i===null||typeof i.__archiveUrl!="string")throw new Error("Assertion failed: The archiveUrl querystring parameter should have been available");let n=await bo(i.__archiveUrl,{configuration:t.project.configuration,ident:e});return await Bi.convertToZip(n,{compressionLevel:t.project.configuration.get("compressionLevel"),prefixPath:P.getIdentVendorPath(e),stripComponents:1})}};var XL=class{supportsDescriptor(e,t){return!(!e.range.startsWith(Cr)||!P.tryParseDescriptor(e.range.slice(Cr.length),!0))}supportsLocator(e,t){return!1}shouldPersistResolution(e,t){throw new Error("Unreachable")}bindDescriptor(e,t,i){return e}getResolutionDependencies(e,t){let i=P.parseDescriptor(e.range.slice(Cr.length),!0);return t.resolver.getResolutionDependencies(i,t)}async getCandidates(e,t,i){let n=P.parseDescriptor(e.range.slice(Cr.length),!0);return await i.resolver.getCandidates(n,t,i)}async getSatisfying(e,t,i){let n=P.parseDescriptor(e.range.slice(Cr.length),!0);return i.resolver.getSatisfying(n,t,i)}resolve(e,t){throw new Error("Unreachable")}};var ule=ge(ri()),gle=ge(require("url"));var Qo=class{supports(e,t){if(!e.reference.startsWith(Cr))return!1;let i=new gle.URL(e.reference);return!(!ule.default.valid(i.pathname)||i.searchParams.has("__archiveUrl"))}getLocalPath(e,t){return null}async fetch(e,t){let i=t.checksums.get(e.locatorHash)||null,[n,s,o]=await t.cache.fetchPackageFromCache(e,i,N({onHit:()=>t.report.reportCacheHit(e),onMiss:()=>t.report.reportCacheMiss(e,`${P.prettyLocator(t.project.configuration,e)} can't be found in the cache and will be fetched from the remote registry`),loader:()=>this.fetchFromNetwork(e,t),skipIntegrityCheck:t.skipIntegrityCheck},t.cacheOptions));return{packageFs:n,releaseFs:s,prefixPath:P.getIdentVendorPath(e),checksum:o}}async fetchFromNetwork(e,t){let i;try{i=await bo(Qo.getLocatorUrl(e),{configuration:t.project.configuration,ident:e})}catch(n){i=await bo(Qo.getLocatorUrl(e).replace(/%2f/g,"/"),{configuration:t.project.configuration,ident:e})}return await Bi.convertToZip(i,{compressionLevel:t.project.configuration.get("compressionLevel"),prefixPath:P.getIdentVendorPath(e),stripComponents:1})}static isConventionalTarballUrl(e,t,{configuration:i}){let n=SA(e.scope,{configuration:i}),s=Qo.getLocatorUrl(e);return t=t.replace(/^https?:(\/\/(?:[^/]+\.)?npmjs.org(?:$|\/))/,"https:$1"),n=n.replace(/^https:\/\/registry\.npmjs\.org($|\/)/,"https://registry.yarnpkg.com$1"),t=t.replace(/^https:\/\/registry\.npmjs\.org($|\/)/,"https://registry.yarnpkg.com$1"),t===n+s||t===n+s.replace(/%2f/g,"/")}static getLocatorUrl(e){let t=Wt.clean(e.reference.slice(Cr.length));if(t===null)throw new ct(X.RESOLVER_NOT_FOUND,"The npm semver resolver got selected, but the version isn't semver");return`${Kl(e)}/-/${e.name}-${t}.tgz`}};var fle=ge(ri());var Ab=P.makeIdent(null,"node-gyp"),V8e=/\b(node-gyp|prebuild-install)\b/,ZL=class{supportsDescriptor(e,t){return e.range.startsWith(Cr)?!!Wt.validRange(e.range.slice(Cr.length)):!1}supportsLocator(e,t){if(!e.reference.startsWith(Cr))return!1;let{selector:i}=P.parseRange(e.reference);return!!fle.default.valid(i)}shouldPersistResolution(e,t){return!0}bindDescriptor(e,t,i){return e}getResolutionDependencies(e,t){return[]}async getCandidates(e,t,i){let n=Wt.validRange(e.range.slice(Cr.length));if(n===null)throw new Error(`Expected a valid range, got ${e.range.slice(Cr.length)}`);let s=await bo(Kl(e),{configuration:i.project.configuration,ident:e,jsonResponse:!0}),o=Se.mapAndFilter(Object.keys(s.versions),c=>{try{let u=new Wt.SemVer(c);if(n.test(u))return u}catch{}return Se.mapAndFilter.skip}),a=o.filter(c=>!s.versions[c.raw].deprecated),l=a.length>0?a:o;return l.sort((c,u)=>-c.compare(u)),l.map(c=>{let u=P.makeLocator(e,`${Cr}${c.raw}`),g=s.versions[c.raw].dist.tarball;return Qo.isConventionalTarballUrl(u,g,{configuration:i.project.configuration})?u:P.bindLocator(u,{__archiveUrl:g})})}async getSatisfying(e,t,i){let n=Wt.validRange(e.range.slice(Cr.length));if(n===null)throw new Error(`Expected a valid range, got ${e.range.slice(Cr.length)}`);return Se.mapAndFilter(t,s=>{try{let{selector:o}=P.parseRange(s,{requireProtocol:Cr}),a=new Wt.SemVer(o);if(n.test(a))return{reference:s,version:a}}catch{}return Se.mapAndFilter.skip}).sort((s,o)=>-s.version.compare(o.version)).map(({reference:s})=>P.makeLocator(e,s))}async resolve(e,t){let{selector:i}=P.parseRange(e.reference),n=Wt.clean(i);if(n===null)throw new ct(X.RESOLVER_NOT_FOUND,"The npm semver resolver got selected, but the version isn't semver");let s=await bo(Kl(e),{configuration:t.project.configuration,ident:e,jsonResponse:!0});if(!Object.prototype.hasOwnProperty.call(s,"versions"))throw new ct(X.REMOTE_INVALID,'Registry returned invalid data for - missing "versions" field');if(!Object.prototype.hasOwnProperty.call(s.versions,n))throw new ct(X.REMOTE_NOT_FOUND,`Registry failed to return reference "${n}"`);let o=new At;if(o.load(s.versions[n]),!o.dependencies.has(Ab.identHash)&&!o.peerDependencies.has(Ab.identHash)){for(let a of o.scripts.values())if(a.match(V8e)){o.dependencies.set(Ab.identHash,P.makeDescriptor(Ab,"latest")),t.report.reportWarningOnce(X.NODE_GYP_INJECTED,`${P.prettyLocator(t.project.configuration,e)}: Implicit dependencies on node-gyp are discouraged`);break}}if(typeof o.raw.deprecated=="string"&&o.raw.deprecated!==""){let a=P.prettyLocator(t.project.configuration,e),l=o.raw.deprecated.match(/\S/)?`${a} is deprecated: ${o.raw.deprecated}`:`${a} is deprecated`;t.report.reportWarningOnce(X.DEPRECATED_PACKAGE,l)}return te(N({},e),{version:n,languageName:"node",linkType:Qt.HARD,conditions:o.getConditions(),dependencies:o.dependencies,peerDependencies:o.peerDependencies,dependenciesMeta:o.dependenciesMeta,peerDependenciesMeta:o.peerDependenciesMeta,bin:o.bin})}};var $L=class{supportsDescriptor(e,t){return!(!e.range.startsWith(Cr)||!zg.test(e.range.slice(Cr.length)))}supportsLocator(e,t){return!1}shouldPersistResolution(e,t){throw new Error("Unreachable")}bindDescriptor(e,t,i){return e}getResolutionDependencies(e,t){return[]}async getCandidates(e,t,i){let n=e.range.slice(Cr.length),s=await bo(Kl(e),{configuration:i.project.configuration,ident:e,jsonResponse:!0});if(!Object.prototype.hasOwnProperty.call(s,"dist-tags"))throw new ct(X.REMOTE_INVALID,'Registry returned invalid data - missing "dist-tags" field');let o=s["dist-tags"];if(!Object.prototype.hasOwnProperty.call(o,n))throw new ct(X.REMOTE_NOT_FOUND,`Registry failed to return tag "${n}"`);let a=o[n],l=P.makeLocator(e,`${Cr}${a}`),c=s.versions[a].dist.tarball;return Qo.isConventionalTarballUrl(l,c,{configuration:i.project.configuration})?[l]:[P.bindLocator(l,{__archiveUrl:c})]}async getSatisfying(e,t,i){return null}async resolve(e,t){throw new Error("Unreachable")}};var wh={};ft(wh,{getGitHead:()=>z9e,makePublishBody:()=>W9e});var HT={};ft(HT,{default:()=>k9e,packUtils:()=>PA});var PA={};ft(PA,{genPackList:()=>Pb,genPackStream:()=>UT,genPackageManifest:()=>Hce,hasPackScripts:()=>MT,prepareForPack:()=>KT});var OT=ge(is()),Kce=ge(Mce()),Uce=ge(require("zlib")),m9e=["/package.json","/readme","/readme.*","/license","/license.*","/licence","/licence.*","/changelog","/changelog.*"],E9e=["/package.tgz",".github",".git",".hg","node_modules",".npmignore",".gitignore",".#*",".DS_Store"];async function MT(r){return!!(Zt.hasWorkspaceScript(r,"prepack")||Zt.hasWorkspaceScript(r,"postpack"))}async function KT(r,{report:e},t){await Zt.maybeExecuteWorkspaceLifecycleScript(r,"prepack",{report:e});try{let i=k.join(r.cwd,At.fileName);await K.existsPromise(i)&&await r.manifest.loadFile(i,{baseFs:K}),await t()}finally{await Zt.maybeExecuteWorkspaceLifecycleScript(r,"postpack",{report:e})}}async function UT(r,e){var s,o;typeof e=="undefined"&&(e=await Pb(r));let t=new Set;for(let a of(o=(s=r.manifest.publishConfig)==null?void 0:s.executableFiles)!=null?o:new Set)t.add(k.normalize(a));for(let a of r.manifest.bin.values())t.add(k.normalize(a));let i=Kce.default.pack();process.nextTick(async()=>{for(let a of e){let l=k.normalize(a),c=k.resolve(r.cwd,l),u=k.join("package",l),g=await K.lstatPromise(c),f={name:u,mtime:new Date(Rr.SAFE_TIME*1e3)},h=t.has(l)?493:420,p,m,y=new Promise((v,x)=>{p=v,m=x}),b=v=>{v?m(v):p()};if(g.isFile()){let v;l==="package.json"?v=Buffer.from(JSON.stringify(await Hce(r),null,2)):v=await K.readFilePromise(c),i.entry(te(N({},f),{mode:h,type:"file"}),v,b)}else g.isSymbolicLink()?i.entry(te(N({},f),{mode:h,type:"symlink",linkname:await K.readlinkPromise(c)}),b):b(new Error(`Unsupported file type ${g.mode} for ${H.fromPortablePath(l)}`));await y}i.finalize()});let n=(0,Uce.createGzip)();return i.pipe(n),n}async function Hce(r){let e=JSON.parse(JSON.stringify(r.manifest.raw));return await r.project.configuration.triggerHook(t=>t.beforeWorkspacePacking,r,e),e}async function Pb(r){var g,f,h,p,m,y,b,v;let e=r.project,t=e.configuration,i={accept:[],reject:[]};for(let x of E9e)i.reject.push(x);for(let x of m9e)i.accept.push(x);i.reject.push(t.get("rcFilename"));let n=x=>{if(x===null||!x.startsWith(`${r.cwd}/`))return;let T=k.relative(r.cwd,x),q=k.resolve(Me.root,T);i.reject.push(q)};n(k.resolve(e.cwd,t.get("lockfileFilename"))),n(t.get("cacheFolder")),n(t.get("globalFolder")),n(t.get("installStatePath")),n(t.get("virtualFolder")),n(t.get("yarnPath")),await t.triggerHook(x=>x.populateYarnPaths,e,x=>{n(x)});for(let x of e.workspaces){let T=k.relative(r.cwd,x.cwd);T!==""&&!T.match(/^(\.\.)?\//)&&i.reject.push(`/${T}`)}let s={accept:[],reject:[]},o=(f=(g=r.manifest.publishConfig)==null?void 0:g.main)!=null?f:r.manifest.main,a=(p=(h=r.manifest.publishConfig)==null?void 0:h.module)!=null?p:r.manifest.module,l=(y=(m=r.manifest.publishConfig)==null?void 0:m.browser)!=null?y:r.manifest.browser,c=(v=(b=r.manifest.publishConfig)==null?void 0:b.bin)!=null?v:r.manifest.bin;o!=null&&s.accept.push(k.resolve(Me.root,o)),a!=null&&s.accept.push(k.resolve(Me.root,a)),typeof l=="string"&&s.accept.push(k.resolve(Me.root,l));for(let x of c.values())s.accept.push(k.resolve(Me.root,x));if(l instanceof Map)for(let[x,T]of l.entries())s.accept.push(k.resolve(Me.root,x)),typeof T=="string"&&s.accept.push(k.resolve(Me.root,T));let u=r.manifest.files!==null;if(u){s.reject.push("/*");for(let x of r.manifest.files)jce(s.accept,x,{cwd:Me.root})}return await I9e(r.cwd,{hasExplicitFileList:u,globalList:i,ignoreList:s})}async function I9e(r,{hasExplicitFileList:e,globalList:t,ignoreList:i}){let n=[],s=new La(r),o=[[Me.root,[i]]];for(;o.length>0;){let[a,l]=o.pop(),c=await s.lstatPromise(a);if(!Yce(a,{globalList:t,ignoreLists:c.isDirectory()?null:l}))if(c.isDirectory()){let u=await s.readdirPromise(a),g=!1,f=!1;if(!e||a!==Me.root)for(let m of u)g=g||m===".gitignore",f=f||m===".npmignore";let h=f?await Gce(s,a,".npmignore"):g?await Gce(s,a,".gitignore"):null,p=h!==null?[h].concat(l):l;Yce(a,{globalList:t,ignoreLists:l})&&(p=[...l,{accept:[],reject:["**/*"]}]);for(let m of u)o.push([k.resolve(a,m),p])}else(c.isFile()||c.isSymbolicLink())&&n.push(k.relative(Me.root,a))}return n.sort()}async function Gce(r,e,t){let i={accept:[],reject:[]},n=await r.readFilePromise(k.join(e,t),"utf8");for(let s of n.split(/\n/g))jce(i.reject,s,{cwd:e});return i}function y9e(r,{cwd:e}){let t=r[0]==="!";return t&&(r=r.slice(1)),r.match(/\.{0,1}\//)&&(r=k.resolve(e,r)),t&&(r=`!${r}`),r}function jce(r,e,{cwd:t}){let i=e.trim();i===""||i[0]==="#"||r.push(y9e(i,{cwd:t}))}var gs;(function(i){i[i.None=0]="None",i[i.Match=1]="Match",i[i.NegatedMatch=2]="NegatedMatch"})(gs||(gs={}));function Yce(r,{globalList:e,ignoreLists:t}){let i=Db(r,e.accept);if(i!==0)return i===2;let n=Db(r,e.reject);if(n!==0)return n===1;if(t!==null)for(let s of t){let o=Db(r,s.accept);if(o!==0)return o===2;let a=Db(r,s.reject);if(a!==0)return a===1}return!1}function Db(r,e){let t=e,i=[];for(let n=0;n{await KT(i,{report:l},async()=>{l.reportJson({base:H.fromPortablePath(i.cwd)});let c=await Pb(i);for(let u of c)l.reportInfo(null,H.fromPortablePath(u)),l.reportJson({location:H.fromPortablePath(u)});if(!this.dryRun){let u=await UT(i,c),g=K.createWriteStream(s);u.pipe(g),await new Promise(f=>{g.on("finish",f)})}}),this.dryRun||(l.reportInfo(X.UNNAMED,`Package archive generated in ${ae.pretty(e,s,ae.Type.PATH)}`),l.reportJson({output:H.fromPortablePath(s)}))})).exitCode()}};rE.paths=[["pack"]],rE.usage=Re.Usage({description:"generate a tarball from the active workspace",details:"\n This command will turn the active workspace into a compressed archive suitable for publishing. The archive will by default be stored at the root of the workspace (`package.tgz`).\n\n If the `-o,---out` is set the archive will be created at the specified path. The `%s` and `%v` variables can be used within the path and will be respectively replaced by the package name and version.\n ",examples:[["Create an archive from the active workspace","yarn pack"],["List the files that would be made part of the workspace's archive","yarn pack --dry-run"],["Name and output the archive in a dedicated folder","yarn pack --out /artifacts/%s-%v.tgz"]]});var Jce=rE;function w9e(r,{workspace:e}){let t=r.replace("%s",B9e(e)).replace("%v",b9e(e));return H.toPortablePath(t)}function B9e(r){return r.manifest.name!==null?P.slugifyIdent(r.manifest.name):"package"}function b9e(r){return r.manifest.version!==null?r.manifest.version:"unknown"}var Q9e=["dependencies","devDependencies","peerDependencies"],S9e="workspace:",v9e=(r,e)=>{var i,n;e.publishConfig&&(e.publishConfig.main&&(e.main=e.publishConfig.main),e.publishConfig.browser&&(e.browser=e.publishConfig.browser),e.publishConfig.module&&(e.module=e.publishConfig.module),e.publishConfig.browser&&(e.browser=e.publishConfig.browser),e.publishConfig.exports&&(e.exports=e.publishConfig.exports),e.publishConfig.bin&&(e.bin=e.publishConfig.bin));let t=r.project;for(let s of Q9e)for(let o of r.manifest.getForScope(s).values()){let a=t.tryWorkspaceByDescriptor(o),l=P.parseRange(o.range);if(l.protocol===S9e)if(a===null){if(t.tryWorkspaceByIdent(o)===null)throw new ct(X.WORKSPACE_NOT_FOUND,`${P.prettyDescriptor(t.configuration,o)}: No local workspace found for this range`)}else{let c;P.areDescriptorsEqual(o,a.anchoredDescriptor)||l.selector==="*"?c=(i=a.manifest.version)!=null?i:"0.0.0":l.selector==="~"||l.selector==="^"?c=`${l.selector}${(n=a.manifest.version)!=null?n:"0.0.0"}`:c=l.selector;let u=s==="dependencies"?P.makeDescriptor(o,"unknown"):null,g=u!==null&&r.manifest.ensureDependencyMeta(u).optional?"optionalDependencies":s;e[g][P.stringifyIdent(o)]=c}}},x9e={hooks:{beforeWorkspacePacking:v9e},commands:[Jce]},k9e=x9e;var tue=ge(require("crypto")),rue=ge(eue()),iue=ge(require("url"));async function W9e(r,e,{access:t,tag:i,registry:n,gitHead:s}){let o=r.project.configuration,a=r.manifest.name,l=r.manifest.version,c=P.stringifyIdent(a),u=(0,tue.createHash)("sha1").update(e).digest("hex"),g=rue.default.fromData(e).toString();typeof t=="undefined"&&(r.manifest.publishConfig&&typeof r.manifest.publishConfig.access=="string"?t=r.manifest.publishConfig.access:o.get("npmPublishAccess")!==null?t=o.get("npmPublishAccess"):a.scope?t="restricted":t="public");let f=await PA.genPackageManifest(r),h=`${c}-${l}.tgz`,p=new iue.URL(`${ma(n)}/${c}/-/${h}`);return{_id:c,_attachments:{[h]:{content_type:"application/octet-stream",data:e.toString("base64"),length:e.length}},name:c,access:t,["dist-tags"]:{[i]:l},versions:{[l]:te(N({},f),{_id:`${c}@${l}`,name:c,version:l,gitHead:s,dist:{shasum:u,integrity:g,tarball:p.toString()}})}}}async function z9e(r){try{let{stdout:e}=await Nr.execvp("git",["rev-parse","--revs-only","HEAD"],{cwd:r});return e.trim()===""?void 0:e.trim()}catch{return}}var JT={npmAlwaysAuth:{description:"URL of the selected npm registry (note: npm enterprise isn't supported)",type:Ie.BOOLEAN,default:!1},npmAuthIdent:{description:"Authentication identity for the npm registry (_auth in npm and yarn v1)",type:Ie.SECRET,default:null},npmAuthToken:{description:"Authentication token for the npm registry (_authToken in npm and yarn v1)",type:Ie.SECRET,default:null}},nue={npmAuditRegistry:{description:"Registry to query for audit reports",type:Ie.STRING,default:null},npmPublishRegistry:{description:"Registry to push packages to",type:Ie.STRING,default:null},npmRegistryServer:{description:"URL of the selected npm registry (note: npm enterprise isn't supported)",type:Ie.STRING,default:"https://registry.yarnpkg.com"}},_9e={configuration:te(N(N({},JT),nue),{npmScopes:{description:"Settings per package scope",type:Ie.MAP,valueDefinition:{description:"",type:Ie.SHAPE,properties:N(N({},JT),nue)}},npmRegistries:{description:"Settings per registry",type:Ie.MAP,normalizeKeys:ma,valueDefinition:{description:"",type:Ie.SHAPE,properties:N({},JT)}}}),fetchers:[VL,Qo],resolvers:[XL,ZL,$L]},V9e=_9e;var VT={};ft(VT,{default:()=>s_e});ys();var Ba;(function(i){i.All="all",i.Production="production",i.Development="development"})(Ba||(Ba={}));var vo;(function(s){s.Info="info",s.Low="low",s.Moderate="moderate",s.High="high",s.Critical="critical"})(vo||(vo={}));var Rb=[vo.Info,vo.Low,vo.Moderate,vo.High,vo.Critical];function sue(r,e){let t=[],i=new Set,n=o=>{i.has(o)||(i.add(o),t.push(o))};for(let o of e)n(o);let s=new Set;for(;t.length>0;){let o=t.shift(),a=r.storedResolutions.get(o);if(typeof a=="undefined")throw new Error("Assertion failed: Expected the resolution to have been registered");let l=r.storedPackages.get(a);if(!!l){s.add(o);for(let c of l.dependencies.values())n(c.descriptorHash)}}return s}function X9e(r,e){return new Set([...r].filter(t=>!e.has(t)))}function Z9e(r,e,{all:t}){let i=t?r.workspaces:[e],n=i.map(f=>f.manifest),s=new Set(n.map(f=>[...f.dependencies].map(([h,p])=>h)).flat()),o=new Set(n.map(f=>[...f.devDependencies].map(([h,p])=>h)).flat()),a=i.map(f=>[...f.dependencies.values()]).flat(),l=a.filter(f=>s.has(f.identHash)).map(f=>f.descriptorHash),c=a.filter(f=>o.has(f.identHash)).map(f=>f.descriptorHash),u=sue(r,l),g=sue(r,c);return X9e(g,u)}function oue(r){let e={};for(let t of r)e[P.stringifyIdent(t)]=P.parseRange(t.range).selector;return e}function aue(r){if(typeof r=="undefined")return new Set;let e=Rb.indexOf(r),t=Rb.slice(e);return new Set(t)}function $9e(r,e){let t=aue(e),i={};for(let n of t)i[n]=r[n];return i}function Aue(r,e){var i;let t=$9e(r,e);for(let n of Object.keys(t))if((i=t[n])!=null?i:0>0)return!0;return!1}function lue(r,e){var s;let t={},i={children:t},n=Object.values(r.advisories);if(e!=null){let o=aue(e);n=n.filter(a=>o.has(a.severity))}for(let o of Se.sortMap(n,a=>a.module_name))t[o.module_name]={label:o.module_name,value:ae.tuple(ae.Type.RANGE,o.findings.map(a=>a.version).join(", ")),children:{Issue:{label:"Issue",value:ae.tuple(ae.Type.NO_HINT,o.title)},URL:{label:"URL",value:ae.tuple(ae.Type.URL,o.url)},Severity:{label:"Severity",value:ae.tuple(ae.Type.NO_HINT,o.severity)},["Vulnerable Versions"]:{label:"Vulnerable Versions",value:ae.tuple(ae.Type.RANGE,o.vulnerable_versions)},["Patched Versions"]:{label:"Patched Versions",value:ae.tuple(ae.Type.RANGE,o.patched_versions)},Via:{label:"Via",value:ae.tuple(ae.Type.NO_HINT,Array.from(new Set(o.findings.map(a=>a.paths).flat().map(a=>a.split(">")[0]))).join(", "))},Recommendation:{label:"Recommendation",value:ae.tuple(ae.Type.NO_HINT,(s=o.recommendation)==null?void 0:s.replace(/\n/g," "))}}};return i}function cue(r,e,{all:t,environment:i}){let n=t?r.workspaces:[e],s=[Ba.All,Ba.Production].includes(i),o=[];if(s)for(let c of n)for(let u of c.manifest.dependencies.values())o.push(u);let a=[Ba.All,Ba.Development].includes(i),l=[];if(a)for(let c of n)for(let u of c.manifest.devDependencies.values())l.push(u);return oue([...o,...l].filter(c=>P.parseRange(c.range).protocol===null))}function uue(r,e,{all:t}){var s;let i=Z9e(r,e,{all:t}),n={};for(let o of r.storedPackages.values())n[P.stringifyIdent(o)]={version:(s=o.version)!=null?s:"0.0.0",integrity:o.identHash,requires:oue(o.dependencies.values()),dev:i.has(P.convertLocatorToDescriptor(o).descriptorHash)};return n}var sE=class extends Le{constructor(){super(...arguments);this.all=J.Boolean("-A,--all",!1,{description:"Audit dependencies from all workspaces"});this.recursive=J.Boolean("-R,--recursive",!1,{description:"Audit transitive dependencies as well"});this.environment=J.String("--environment",Ba.All,{description:"Which environments to cover",validator:nn(Ba)});this.json=J.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.severity=J.String("--severity",vo.Info,{description:"Minimal severity requested for packages to be displayed",validator:nn(vo)})}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,workspace:i}=await ze.find(e,this.context.cwd);if(!i)throw new ht(t.cwd,this.context.cwd);await t.restoreInstallState();let n=cue(t,i,{all:this.all,environment:this.environment}),s=uue(t,i,{all:this.all});if(!this.recursive)for(let f of Object.keys(s))Object.prototype.hasOwnProperty.call(n,f)?s[f].requires={}:delete s[f];let o={requires:n,dependencies:s},a=br.getAuditRegistry(i.manifest,{configuration:e}),l,c=await pA.start({configuration:e,stdout:this.context.stdout},async()=>{l=await zt.post("/-/npm/v1/security/audits/quick",o,{authType:zt.AuthType.BEST_EFFORT,configuration:e,jsonResponse:!0,registry:a})});if(c.hasErrors())return c.exitCode();let u=Aue(l.metadata.vulnerabilities,this.severity);return!this.json&&u?(ls.emitTree(lue(l,this.severity),{configuration:e,json:this.json,stdout:this.context.stdout,separators:2}),1):(await Je.start({configuration:e,includeFooter:!1,json:this.json,stdout:this.context.stdout},async f=>{f.reportJson(l),u||f.reportInfo(X.EXCEPTION,"No audit suggestions")})).exitCode()}};sE.paths=[["npm","audit"]],sE.usage=Re.Usage({description:"perform a vulnerability audit against the installed packages",details:` - This command checks for known security reports on the packages you use. The reports are by default extracted from the npm registry, and may or may not be relevant to your actual program (not all vulnerabilities affect all code paths). - - For consistency with our other commands the default is to only check the direct dependencies for the active workspace. To extend this search to all workspaces, use \`-A,--all\`. To extend this search to both direct and transitive dependencies, use \`-R,--recursive\`. - - Applying the \`--severity\` flag will limit the audit table to vulnerabilities of the corresponding severity and above. Valid values are ${Rb.map(e=>`\`${e}\``).join(", ")}. - - If the \`--json\` flag is set, Yarn will print the output exactly as received from the registry. Regardless of this flag, the process will exit with a non-zero exit code if a report is found for the selected packages. - - To understand the dependency tree requiring vulnerable packages, check the raw report with the \`--json\` flag or use \`yarn why \` to get more information as to who depends on them. - `,examples:[["Checks for known security issues with the installed packages. The output is a list of known issues.","yarn npm audit"],["Audit dependencies in all workspaces","yarn npm audit --all"],["Limit auditing to `dependencies` (excludes `devDependencies`)","yarn npm audit --environment production"],["Show audit report as valid JSON","yarn npm audit --json"],["Audit all direct and transitive dependencies","yarn npm audit --recursive"],["Output moderate (or more severe) vulnerabilities","yarn npm audit --severity moderate"]]});var gue=sE;var WT=ge(ri()),zT=ge(require("util")),oE=class extends Le{constructor(){super(...arguments);this.fields=J.String("-f,--fields",{description:"A comma-separated list of manifest fields that should be displayed"});this.json=J.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.packages=J.Rest()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t}=await ze.find(e,this.context.cwd),i=typeof this.fields!="undefined"?new Set(["name",...this.fields.split(/\s*,\s*/)]):null,n=[],s=!1,o=await Je.start({configuration:e,includeFooter:!1,json:this.json,stdout:this.context.stdout},async a=>{for(let l of this.packages){let c;if(l==="."){let x=t.topLevelWorkspace;if(!x.manifest.name)throw new Pe(`Missing ${ae.pretty(e,"name",ae.Type.CODE)} field in ${H.fromPortablePath(k.join(x.cwd,kt.manifest))}`);c=P.makeDescriptor(x.manifest.name,"unknown")}else c=P.parseDescriptor(l);let u=zt.getIdentUrl(c),g=_T(await zt.get(u,{configuration:e,ident:c,jsonResponse:!0,customErrorMessage:zt.customPackageError})),f=Object.keys(g.versions).sort(WT.default.compareLoose),p=g["dist-tags"].latest||f[f.length-1],m=Wt.validRange(c.range);if(m){let x=WT.default.maxSatisfying(f,m);x!==null?p=x:(a.reportWarning(X.UNNAMED,`Unmet range ${P.prettyRange(e,c.range)}; falling back to the latest version`),s=!0)}else Object.prototype.hasOwnProperty.call(g["dist-tags"],c.range)?p=g["dist-tags"][c.range]:c.range!=="unknown"&&(a.reportWarning(X.UNNAMED,`Unknown tag ${P.prettyRange(e,c.range)}; falling back to the latest version`),s=!0);let y=g.versions[p],b=te(N(N({},g),y),{version:p,versions:f}),v;if(i!==null){v={};for(let x of i){let T=b[x];if(typeof T!="undefined")v[x]=T;else{a.reportWarning(X.EXCEPTION,`The ${ae.pretty(e,x,ae.Type.CODE)} field doesn't exist inside ${P.prettyIdent(e,c)}'s information`),s=!0;continue}}}else this.json||(delete b.dist,delete b.readme,delete b.users),v=b;a.reportJson(v),this.json||n.push(v)}});zT.inspect.styles.name="cyan";for(let a of n)(a!==n[0]||s)&&this.context.stdout.write(` -`),this.context.stdout.write(`${(0,zT.inspect)(a,{depth:Infinity,colors:!0,compact:!1})} -`);return o.exitCode()}};oE.paths=[["npm","info"]],oE.usage=Re.Usage({category:"Npm-related commands",description:"show information about a package",details:"\n This command fetches information about a package from the npm registry and prints it in a tree format.\n\n The package does not have to be installed locally, but needs to have been published (in particular, local changes will be ignored even for workspaces).\n\n Append `@` to the package argument to provide information specific to the latest version that satisfies the range or to the corresponding tagged version. If the range is invalid or if there is no version satisfying the range, the command will print a warning and fall back to the latest version.\n\n If the `-f,--fields` option is set, it's a comma-separated list of fields which will be used to only display part of the package information.\n\n By default, this command won't return the `dist`, `readme`, and `users` fields, since they are often very long. To explicitly request those fields, explicitly list them with the `--fields` flag or request the output in JSON mode.\n ",examples:[["Show all available information about react (except the `dist`, `readme`, and `users` fields)","yarn npm info react"],["Show all available information about react as valid JSON (including the `dist`, `readme`, and `users` fields)","yarn npm info react --json"],["Show all available information about react@16.12.0","yarn npm info react@16.12.0"],["Show all available information about react@next","yarn npm info react@next"],["Show the description of react","yarn npm info react --fields description"],["Show all available versions of react","yarn npm info react --fields versions"],["Show the readme of react","yarn npm info react --fields readme"],["Show a few fields of react","yarn npm info react --fields homepage,repository"]]});var fue=oE;function _T(r){if(Array.isArray(r)){let e=[];for(let t of r)t=_T(t),t&&e.push(t);return e}else if(typeof r=="object"&&r!==null){let e={};for(let t of Object.keys(r)){if(t.startsWith("_"))continue;let i=_T(r[t]);i&&(e[t]=i)}return e}else return r||null}var hue=ge(WC()),aE=class extends Le{constructor(){super(...arguments);this.scope=J.String("-s,--scope",{description:"Login to the registry configured for a given scope"});this.publish=J.Boolean("--publish",!1,{description:"Login to the publish registry"})}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),t=await Fb({configuration:e,cwd:this.context.cwd,publish:this.publish,scope:this.scope});return(await Je.start({configuration:e,stdout:this.context.stdout},async n=>{let s=await t_e({registry:t,report:n,stdin:this.context.stdin,stdout:this.context.stdout}),o=`/-/user/org.couchdb.user:${encodeURIComponent(s.name)}`,a=await zt.put(o,s,{attemptedAs:s.name,configuration:e,registry:t,jsonResponse:!0,authType:zt.AuthType.NO_AUTH});return await e_e(t,a.token,{configuration:e,scope:this.scope}),n.reportInfo(X.UNNAMED,"Successfully logged in")})).exitCode()}};aE.paths=[["npm","login"]],aE.usage=Re.Usage({category:"Npm-related commands",description:"store new login info to access the npm registry",details:"\n This command will ask you for your username, password, and 2FA One-Time-Password (when it applies). It will then modify your local configuration (in your home folder, never in the project itself) to reference the new tokens thus generated.\n\n Adding the `-s,--scope` flag will cause the authentication to be done against whatever registry is configured for the associated scope (see also `npmScopes`).\n\n Adding the `--publish` flag will cause the authentication to be done against the registry used when publishing the package (see also `publishConfig.registry` and `npmPublishRegistry`).\n ",examples:[["Login to the default registry","yarn npm login"],["Login to the registry linked to the @my-scope registry","yarn npm login --scope my-scope"],["Login to the publish registry for the current package","yarn npm login --publish"]]});var pue=aE;async function Fb({scope:r,publish:e,configuration:t,cwd:i}){return r&&e?br.getScopeRegistry(r,{configuration:t,type:br.RegistryType.PUBLISH_REGISTRY}):r?br.getScopeRegistry(r,{configuration:t}):e?br.getPublishRegistry((await Wf(t,i)).manifest,{configuration:t}):br.getDefaultRegistry({configuration:t})}async function e_e(r,e,{configuration:t,scope:i}){let n=o=>a=>{let l=Se.isIndexableObject(a)?a:{},c=l[o],u=Se.isIndexableObject(c)?c:{};return te(N({},l),{[o]:te(N({},u),{npmAuthToken:e})})},s=i?{npmScopes:n(i)}:{npmRegistries:n(r)};return await ye.updateHomeConfiguration(s)}async function t_e({registry:r,report:e,stdin:t,stdout:i}){if(process.env.TEST_ENV)return{name:process.env.TEST_NPM_USER||"",password:process.env.TEST_NPM_PASSWORD||""};e.reportInfo(X.UNNAMED,`Logging in to ${r}`);let n=!1;r.match(/^https:\/\/npm\.pkg\.github\.com(\/|$)/)&&(e.reportInfo(X.UNNAMED,"You seem to be using the GitHub Package Registry. Tokens must be generated with the 'repo', 'write:packages', and 'read:packages' permissions."),n=!0),e.reportSeparator();let{username:s,password:o}=await(0,hue.prompt)([{type:"input",name:"username",message:"Username:",required:!0,onCancel:()=>process.exit(130),stdin:t,stdout:i},{type:"password",name:"password",message:n?"Token:":"Password:",required:!0,onCancel:()=>process.exit(130),stdin:t,stdout:i}]);return e.reportSeparator(),{name:s,password:o}}var Bh=new Set(["npmAuthIdent","npmAuthToken"]),AE=class extends Le{constructor(){super(...arguments);this.scope=J.String("-s,--scope",{description:"Logout of the registry configured for a given scope"});this.publish=J.Boolean("--publish",!1,{description:"Logout of the publish registry"});this.all=J.Boolean("-A,--all",!1,{description:"Logout of all registries"})}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),t=async()=>{var l;let n=await Fb({configuration:e,cwd:this.context.cwd,publish:this.publish,scope:this.scope}),s=await ye.find(this.context.cwd,this.context.plugins),o=P.makeIdent((l=this.scope)!=null?l:null,"pkg");return!br.getAuthConfiguration(n,{configuration:s,ident:o}).get("npmAuthToken")};return(await Je.start({configuration:e,stdout:this.context.stdout},async n=>{if(this.all&&(await r_e(),n.reportInfo(X.UNNAMED,"Successfully logged out from everything")),this.scope){await due("npmScopes",this.scope),await t()?n.reportInfo(X.UNNAMED,`Successfully logged out from ${this.scope}`):n.reportWarning(X.UNNAMED,"Scope authentication settings removed, but some other ones settings still apply to it");return}let s=await Fb({configuration:e,cwd:this.context.cwd,publish:this.publish});await due("npmRegistries",s),await t()?n.reportInfo(X.UNNAMED,`Successfully logged out from ${s}`):n.reportWarning(X.UNNAMED,"Registry authentication settings removed, but some other ones settings still apply to it")})).exitCode()}};AE.paths=[["npm","logout"]],AE.usage=Re.Usage({category:"Npm-related commands",description:"logout of the npm registry",details:"\n This command will log you out by modifying your local configuration (in your home folder, never in the project itself) to delete all credentials linked to a registry.\n\n Adding the `-s,--scope` flag will cause the deletion to be done against whatever registry is configured for the associated scope (see also `npmScopes`).\n\n Adding the `--publish` flag will cause the deletion to be done against the registry used when publishing the package (see also `publishConfig.registry` and `npmPublishRegistry`).\n\n Adding the `-A,--all` flag will cause the deletion to be done against all registries and scopes.\n ",examples:[["Logout of the default registry","yarn npm logout"],["Logout of the @my-scope scope","yarn npm logout --scope my-scope"],["Logout of the publish registry for the current package","yarn npm logout --publish"],["Logout of all registries","yarn npm logout --all"]]});var Cue=AE;function i_e(r,e){let t=r[e];if(!Se.isIndexableObject(t))return!1;let i=new Set(Object.keys(t));if([...Bh].every(s=>!i.has(s)))return!1;for(let s of Bh)i.delete(s);if(i.size===0)return r[e]=void 0,!0;let n=N({},t);for(let s of Bh)delete n[s];return r[e]=n,!0}async function r_e(){let r=e=>{let t=!1,i=Se.isIndexableObject(e)?N({},e):{};i.npmAuthToken&&(delete i.npmAuthToken,t=!0);for(let n of Object.keys(i))i_e(i,n)&&(t=!0);if(Object.keys(i).length!==0)return t?i:e};return await ye.updateHomeConfiguration({npmRegistries:r,npmScopes:r})}async function due(r,e){return await ye.updateHomeConfiguration({[r]:t=>{let i=Se.isIndexableObject(t)?t:{};if(!Object.prototype.hasOwnProperty.call(i,e))return t;let n=i[e],s=Se.isIndexableObject(n)?n:{},o=new Set(Object.keys(s));if([...Bh].every(l=>!o.has(l)))return t;for(let l of Bh)o.delete(l);if(o.size===0)return Object.keys(i).length===1?void 0:te(N({},i),{[e]:void 0});let a={};for(let l of Bh)a[l]=void 0;return te(N({},i),{[e]:N(N({},s),a)})}})}var lE=class extends Le{constructor(){super(...arguments);this.access=J.String("--access",{description:"The access for the published package (public or restricted)"});this.tag=J.String("--tag","latest",{description:"The tag on the registry that the package should be attached to"});this.tolerateRepublish=J.Boolean("--tolerate-republish",!1,{description:"Warn and exit when republishing an already existing version of a package"});this.otp=J.String("--otp",{description:"The OTP token to use with the command"})}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,workspace:i}=await ze.find(e,this.context.cwd);if(!i)throw new ht(t.cwd,this.context.cwd);if(i.manifest.private)throw new Pe("Private workspaces cannot be published");if(i.manifest.name===null||i.manifest.version===null)throw new Pe("Workspaces must have valid names and versions to be published on an external registry");await t.restoreInstallState();let n=i.manifest.name,s=i.manifest.version,o=br.getPublishRegistry(i.manifest,{configuration:e});return(await Je.start({configuration:e,stdout:this.context.stdout},async l=>{var c,u;if(this.tolerateRepublish)try{let g=await zt.get(zt.getIdentUrl(n),{configuration:e,registry:o,ident:n,jsonResponse:!0});if(!Object.prototype.hasOwnProperty.call(g,"versions"))throw new ct(X.REMOTE_INVALID,'Registry returned invalid data for - missing "versions" field');if(Object.prototype.hasOwnProperty.call(g.versions,s)){l.reportWarning(X.UNNAMED,`Registry already knows about version ${s}; skipping.`);return}}catch(g){if(((u=(c=g.originalError)==null?void 0:c.response)==null?void 0:u.statusCode)!==404)throw g}await Zt.maybeExecuteWorkspaceLifecycleScript(i,"prepublish",{report:l}),await PA.prepareForPack(i,{report:l},async()=>{let g=await PA.genPackList(i);for(let y of g)l.reportInfo(null,y);let f=await PA.genPackStream(i,g),h=await Se.bufferStream(f),p=await wh.getGitHead(i.cwd),m=await wh.makePublishBody(i,h,{access:this.access,tag:this.tag,registry:o,gitHead:p});await zt.put(zt.getIdentUrl(n),m,{configuration:e,registry:o,ident:n,otp:this.otp,jsonResponse:!0})}),l.reportInfo(X.UNNAMED,"Package archive published")})).exitCode()}};lE.paths=[["npm","publish"]],lE.usage=Re.Usage({category:"Npm-related commands",description:"publish the active workspace to the npm registry",details:'\n This command will pack the active workspace into a fresh archive and upload it to the npm registry.\n\n The package will by default be attached to the `latest` tag on the registry, but this behavior can be overriden by using the `--tag` option.\n\n Note that for legacy reasons scoped packages are by default published with an access set to `restricted` (aka "private packages"). This requires you to register for a paid npm plan. In case you simply wish to publish a public scoped package to the registry (for free), just add the `--access public` flag. This behavior can be enabled by default through the `npmPublishAccess` settings.\n ',examples:[["Publish the active workspace","yarn npm publish"]]});var mue=lE;var Iue=ge(ri());var cE=class extends Le{constructor(){super(...arguments);this.json=J.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.package=J.String({required:!1})}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,workspace:i}=await ze.find(e,this.context.cwd),n;if(typeof this.package!="undefined")n=P.parseIdent(this.package);else{if(!i)throw new ht(t.cwd,this.context.cwd);if(!i.manifest.name)throw new Pe(`Missing 'name' field in ${H.fromPortablePath(k.join(i.cwd,kt.manifest))}`);n=i.manifest.name}let s=await uE(n,e),a={children:Se.sortMap(Object.entries(s),([l])=>l).map(([l,c])=>({value:ae.tuple(ae.Type.RESOLUTION,{descriptor:P.makeDescriptor(n,l),locator:P.makeLocator(n,c)})}))};return ls.emitTree(a,{configuration:e,json:this.json,stdout:this.context.stdout})}};cE.paths=[["npm","tag","list"]],cE.usage=Re.Usage({category:"Npm-related commands",description:"list all dist-tags of a package",details:` - This command will list all tags of a package from the npm registry. - - If the package is not specified, Yarn will default to the current workspace. - `,examples:[["List all tags of package `my-pkg`","yarn npm tag list my-pkg"]]});var Eue=cE;async function uE(r,e){let t=`/-/package${zt.getIdentUrl(r)}/dist-tags`;return zt.get(t,{configuration:e,ident:r,jsonResponse:!0,customErrorMessage:zt.customPackageError})}var gE=class extends Le{constructor(){super(...arguments);this.package=J.String();this.tag=J.String()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,workspace:i}=await ze.find(e,this.context.cwd);if(!i)throw new ht(t.cwd,this.context.cwd);let n=P.parseDescriptor(this.package,!0),s=n.range;if(!Iue.default.valid(s))throw new Pe(`The range ${ae.pretty(e,n.range,ae.Type.RANGE)} must be a valid semver version`);let o=br.getPublishRegistry(i.manifest,{configuration:e}),a=ae.pretty(e,n,ae.Type.IDENT),l=ae.pretty(e,s,ae.Type.RANGE),c=ae.pretty(e,this.tag,ae.Type.CODE);return(await Je.start({configuration:e,stdout:this.context.stdout},async g=>{let f=await uE(n,e);Object.prototype.hasOwnProperty.call(f,this.tag)&&f[this.tag]===s&&g.reportWarning(X.UNNAMED,`Tag ${c} is already set to version ${l}`);let h=`/-/package${zt.getIdentUrl(n)}/dist-tags/${encodeURIComponent(this.tag)}`;await zt.put(h,s,{configuration:e,registry:o,ident:n,jsonRequest:!0,jsonResponse:!0}),g.reportInfo(X.UNNAMED,`Tag ${c} added to version ${l} of package ${a}`)})).exitCode()}};gE.paths=[["npm","tag","add"]],gE.usage=Re.Usage({category:"Npm-related commands",description:"add a tag for a specific version of a package",details:` - This command will add a tag to the npm registry for a specific version of a package. If the tag already exists, it will be overwritten. - `,examples:[["Add a `beta` tag for version `2.3.4-beta.4` of package `my-pkg`","yarn npm tag add my-pkg@2.3.4-beta.4 beta"]]});var yue=gE;var fE=class extends Le{constructor(){super(...arguments);this.package=J.String();this.tag=J.String()}async execute(){if(this.tag==="latest")throw new Pe("The 'latest' tag cannot be removed.");let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,workspace:i}=await ze.find(e,this.context.cwd);if(!i)throw new ht(t.cwd,this.context.cwd);let n=P.parseIdent(this.package),s=br.getPublishRegistry(i.manifest,{configuration:e}),o=ae.pretty(e,this.tag,ae.Type.CODE),a=ae.pretty(e,n,ae.Type.IDENT),l=await uE(n,e);if(!Object.prototype.hasOwnProperty.call(l,this.tag))throw new Pe(`${o} is not a tag of package ${a}`);return(await Je.start({configuration:e,stdout:this.context.stdout},async u=>{let g=`/-/package${zt.getIdentUrl(n)}/dist-tags/${encodeURIComponent(this.tag)}`;await zt.del(g,{configuration:e,registry:s,ident:n,jsonResponse:!0}),u.reportInfo(X.UNNAMED,`Tag ${o} removed from package ${a}`)})).exitCode()}};fE.paths=[["npm","tag","remove"]],fE.usage=Re.Usage({category:"Npm-related commands",description:"remove a tag from a package",details:` - This command will remove a tag from a package from the npm registry. - `,examples:[["Remove the `beta` tag from package `my-pkg`","yarn npm tag remove my-pkg beta"]]});var wue=fE;var hE=class extends Le{constructor(){super(...arguments);this.scope=J.String("-s,--scope",{description:"Print username for the registry configured for a given scope"});this.publish=J.Boolean("--publish",!1,{description:"Print username for the publish registry"})}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),t;return this.scope&&this.publish?t=br.getScopeRegistry(this.scope,{configuration:e,type:br.RegistryType.PUBLISH_REGISTRY}):this.scope?t=br.getScopeRegistry(this.scope,{configuration:e}):this.publish?t=br.getPublishRegistry((await Wf(e,this.context.cwd)).manifest,{configuration:e}):t=br.getDefaultRegistry({configuration:e}),(await Je.start({configuration:e,stdout:this.context.stdout},async n=>{var o,a;let s;try{s=await zt.get("/-/whoami",{configuration:e,registry:t,authType:zt.AuthType.ALWAYS_AUTH,jsonResponse:!0,ident:this.scope?P.makeIdent(this.scope,""):void 0})}catch(l){if(((o=l.response)==null?void 0:o.statusCode)===401||((a=l.response)==null?void 0:a.statusCode)===403){n.reportError(X.AUTHENTICATION_INVALID,"Authentication failed - your credentials may have expired");return}else throw l}n.reportInfo(X.UNNAMED,s.username)})).exitCode()}};hE.paths=[["npm","whoami"]],hE.usage=Re.Usage({category:"Npm-related commands",description:"display the name of the authenticated user",details:"\n Print the username associated with the current authentication settings to the standard output.\n\n When using `-s,--scope`, the username printed will be the one that matches the authentication settings of the registry associated with the given scope (those settings can be overriden using the `npmRegistries` map, and the registry associated with the scope is configured via the `npmScopes` map).\n\n When using `--publish`, the registry we'll select will by default be the one used when publishing packages (`publishConfig.registry` or `npmPublishRegistry` if available, otherwise we'll fallback to the regular `npmRegistryServer`).\n ",examples:[["Print username for the default registry","yarn npm whoami"],["Print username for the registry on a given scope","yarn npm whoami --scope company"]]});var Bue=hE;var n_e={configuration:{npmPublishAccess:{description:"Default access of the published packages",type:Ie.STRING,default:null}},commands:[gue,fue,pue,Cue,mue,yue,Eue,wue,Bue]},s_e=n_e;var nO={};ft(nO,{default:()=>y_e,patchUtils:()=>XT});var XT={};ft(XT,{applyPatchFile:()=>Tb,diffFolders:()=>tO,extractPackageToDisk:()=>eO,extractPatchFlags:()=>Due,isParentRequired:()=>$T,loadPatchFiles:()=>mE,makeDescriptor:()=>m_e,makeLocator:()=>ZT,parseDescriptor:()=>dE,parseLocator:()=>CE,parsePatchFile:()=>Lb});var pE=class extends Error{constructor(e,t){super(`Cannot apply hunk #${e+1}`);this.hunk=t}};var o_e=/^@@ -(\d+)(,(\d+))? \+(\d+)(,(\d+))? @@.*/;function bh(r){return k.relative(Me.root,k.resolve(Me.root,H.toPortablePath(r)))}function a_e(r){let e=r.trim().match(o_e);if(!e)throw new Error(`Bad header line: '${r}'`);return{original:{start:Math.max(Number(e[1]),1),length:Number(e[3]||1)},patched:{start:Math.max(Number(e[4]),1),length:Number(e[6]||1)}}}var A_e=420,l_e=493,Zr;(function(i){i.Context="context",i.Insertion="insertion",i.Deletion="deletion"})(Zr||(Zr={}));var bue=()=>({semverExclusivity:null,diffLineFromPath:null,diffLineToPath:null,oldMode:null,newMode:null,deletedFileMode:null,newFileMode:null,renameFrom:null,renameTo:null,beforeHash:null,afterHash:null,fromPath:null,toPath:null,hunks:null}),c_e=r=>({header:a_e(r),parts:[]}),u_e={["@"]:"header",["-"]:Zr.Deletion,["+"]:Zr.Insertion,[" "]:Zr.Context,["\\"]:"pragma",undefined:Zr.Context};function f_e(r){let e=[],t=bue(),i="parsing header",n=null,s=null;function o(){n&&(s&&(n.parts.push(s),s=null),t.hunks.push(n),n=null)}function a(){o(),e.push(t),t=bue()}for(let l=0;l0?"patch":"mode change",v=null;switch(b){case"rename":{if(!u||!g)throw new Error("Bad parser state: rename from & to not given");e.push({type:"rename",semverExclusivity:i,fromPath:bh(u),toPath:bh(g)}),v=g}break;case"file deletion":{let x=n||p;if(!x)throw new Error("Bad parse state: no path given for file deletion");e.push({type:"file deletion",semverExclusivity:i,hunk:y&&y[0]||null,path:bh(x),mode:Nb(l),hash:f})}break;case"file creation":{let x=s||m;if(!x)throw new Error("Bad parse state: no path given for file creation");e.push({type:"file creation",semverExclusivity:i,hunk:y&&y[0]||null,path:bh(x),mode:Nb(c),hash:h})}break;case"patch":case"mode change":v=m||s;break;default:Se.assertNever(b);break}v&&o&&a&&o!==a&&e.push({type:"mode change",semverExclusivity:i,path:bh(v),oldMode:Nb(o),newMode:Nb(a)}),v&&y&&y.length&&e.push({type:"patch",semverExclusivity:i,path:bh(v),hunks:y,beforeHash:f,afterHash:h})}if(e.length===0)throw new Error("Unable to parse patch file: No changes found. Make sure the patch is a valid UTF8 encoded string");return e}function Nb(r){let e=parseInt(r,8)&511;if(e!==A_e&&e!==l_e)throw new Error(`Unexpected file mode string: ${r}`);return e}function Lb(r){let e=r.split(/\n/g);return e[e.length-1]===""&&e.pop(),h_e(f_e(e))}function g_e(r){let e=0,t=0;for(let{type:i,lines:n}of r.parts)switch(i){case Zr.Context:t+=n.length,e+=n.length;break;case Zr.Deletion:e+=n.length;break;case Zr.Insertion:t+=n.length;break;default:Se.assertNever(i);break}if(e!==r.header.original.length||t!==r.header.patched.length){let i=n=>n<0?n:`+${n}`;throw new Error(`hunk header integrity check failed (expected @@ ${i(r.header.original.length)} ${i(r.header.patched.length)} @@, got @@ ${i(e)} ${i(t)} @@)`)}}async function Qh(r,e,t){let i=await r.lstatPromise(e),n=await t();if(typeof n!="undefined"&&(e=n),r.lutimesPromise)await r.lutimesPromise(e,i.atime,i.mtime);else if(!i.isSymbolicLink())await r.utimesPromise(e,i.atime,i.mtime);else throw new Error("Cannot preserve the time values of a symlink")}async function Tb(r,{baseFs:e=new ar,dryRun:t=!1,version:i=null}={}){for(let n of r)if(!(n.semverExclusivity!==null&&i!==null&&!Wt.satisfiesWithPrereleases(i,n.semverExclusivity)))switch(n.type){case"file deletion":if(t){if(!e.existsSync(n.path))throw new Error(`Trying to delete a file that doesn't exist: ${n.path}`)}else await Qh(e,k.dirname(n.path),async()=>{await e.unlinkPromise(n.path)});break;case"rename":if(t){if(!e.existsSync(n.fromPath))throw new Error(`Trying to move a file that doesn't exist: ${n.fromPath}`)}else await Qh(e,k.dirname(n.fromPath),async()=>{await Qh(e,k.dirname(n.toPath),async()=>{await Qh(e,n.fromPath,async()=>(await e.movePromise(n.fromPath,n.toPath),n.toPath))})});break;case"file creation":if(t){if(e.existsSync(n.path))throw new Error(`Trying to create a file that already exists: ${n.path}`)}else{let s=n.hunk?n.hunk.parts[0].lines.join(` -`)+(n.hunk.parts[0].noNewlineAtEndOfFile?"":` -`):"";await e.mkdirpPromise(k.dirname(n.path),{chmod:493,utimes:[Rr.SAFE_TIME,Rr.SAFE_TIME]}),await e.writeFilePromise(n.path,s,{mode:n.mode}),await e.utimesPromise(n.path,Rr.SAFE_TIME,Rr.SAFE_TIME)}break;case"patch":await Qh(e,n.path,async()=>{await p_e(n,{baseFs:e,dryRun:t})});break;case"mode change":{let o=(await e.statPromise(n.path)).mode;if(Que(n.newMode)!==Que(o))continue;await Qh(e,n.path,async()=>{await e.chmodPromise(n.path,n.newMode)})}break;default:Se.assertNever(n);break}}function Que(r){return(r&64)>0}function Sue(r){return r.replace(/\s+$/,"")}function d_e(r,e){return Sue(r)===Sue(e)}async function p_e({hunks:r,path:e},{baseFs:t,dryRun:i=!1}){let n=await t.statSync(e).mode,o=(await t.readFileSync(e,"utf8")).split(/\n/),a=[],l=0,c=0;for(let g of r){let f=Math.max(c,g.header.patched.start+l),h=Math.max(0,f-c),p=Math.max(0,o.length-f-g.header.original.length),m=Math.max(h,p),y=0,b=0,v=null;for(;y<=m;){if(y<=h&&(b=f-y,v=vue(g,o,b),v!==null)){y=-y;break}if(y<=p&&(b=f+y,v=vue(g,o,b),v!==null))break;y+=1}if(v===null)throw new pE(r.indexOf(g),g);a.push(v),l+=y,c=b+g.header.original.length}if(i)return;let u=0;for(let g of a)for(let f of g)switch(f.type){case"splice":{let h=f.index+u;o.splice(h,f.numToDelete,...f.linesToInsert),u+=f.linesToInsert.length-f.numToDelete}break;case"pop":o.pop();break;case"push":o.push(f.line);break;default:Se.assertNever(f);break}await t.writeFilePromise(e,o.join(` -`),{mode:n})}function vue(r,e,t){let i=[];for(let n of r.parts)switch(n.type){case Zr.Context:case Zr.Deletion:{for(let s of n.lines){let o=e[t];if(o==null||!d_e(o,s))return null;t+=1}n.type===Zr.Deletion&&(i.push({type:"splice",index:t-n.lines.length,numToDelete:n.lines.length,linesToInsert:[]}),n.noNewlineAtEndOfFile&&i.push({type:"push",line:""}))}break;case Zr.Insertion:i.push({type:"splice",index:t,numToDelete:0,linesToInsert:n.lines}),n.noNewlineAtEndOfFile&&i.push({type:"pop"});break;default:Se.assertNever(n.type);break}return i}var C_e=/^builtin<([^>]+)>$/;function xue(r,e){let{source:t,selector:i,params:n}=P.parseRange(r);if(t===null)throw new Error("Patch locators must explicitly define their source");let s=i?i.split(/&/).map(c=>H.toPortablePath(c)):[],o=n&&typeof n.locator=="string"?P.parseLocator(n.locator):null,a=n&&typeof n.version=="string"?n.version:null,l=e(t);return{parentLocator:o,sourceItem:l,patchPaths:s,sourceVersion:a}}function dE(r){let i=xue(r.range,P.parseDescriptor),{sourceItem:e}=i,t=Or(i,["sourceItem"]);return te(N({},t),{sourceDescriptor:e})}function CE(r){let i=xue(r.reference,P.parseLocator),{sourceItem:e}=i,t=Or(i,["sourceItem"]);return te(N({},t),{sourceLocator:e})}function kue({parentLocator:r,sourceItem:e,patchPaths:t,sourceVersion:i,patchHash:n},s){let o=r!==null?{locator:P.stringifyLocator(r)}:{},a=typeof i!="undefined"?{version:i}:{},l=typeof n!="undefined"?{hash:n}:{};return P.makeRange({protocol:"patch:",source:s(e),selector:t.join("&"),params:N(N(N({},a),l),o)})}function m_e(r,{parentLocator:e,sourceDescriptor:t,patchPaths:i}){return P.makeLocator(r,kue({parentLocator:e,sourceItem:t,patchPaths:i},P.stringifyDescriptor))}function ZT(r,{parentLocator:e,sourcePackage:t,patchPaths:i,patchHash:n}){return P.makeLocator(r,kue({parentLocator:e,sourceItem:t,sourceVersion:t.version,patchPaths:i,patchHash:n},P.stringifyLocator))}function Pue({onAbsolute:r,onRelative:e,onBuiltin:t},i){i.startsWith("~")&&(i=i.slice(1));let s=i.match(C_e);return s!==null?t(s[1]):k.isAbsolute(i)?r(i):e(i)}function Due(r){let e=r.startsWith("~");return e&&(r=r.slice(1)),{optional:e}}function $T(r){return Pue({onAbsolute:()=>!1,onRelative:()=>!0,onBuiltin:()=>!1},r)}async function mE(r,e,t){let i=r!==null?await t.fetcher.fetch(r,t):null,n=i&&i.localPath?{packageFs:new _t(Me.root),prefixPath:k.relative(Me.root,i.localPath)}:i;i&&i!==n&&i.releaseFs&&i.releaseFs();let s=await Se.releaseAfterUseAsync(async()=>await Promise.all(e.map(async o=>{let a=Due(o),l=await Pue({onAbsolute:async()=>await K.readFilePromise(o,"utf8"),onRelative:async()=>{if(n===null)throw new Error("Assertion failed: The parent locator should have been fetched");return await n.packageFs.readFilePromise(k.join(n.prefixPath,o),"utf8")},onBuiltin:async c=>await t.project.configuration.firstHook(u=>u.getBuiltinPatch,t.project,c)},o);return te(N({},a),{source:l})})));for(let o of s)typeof o.source=="string"&&(o.source=o.source.replace(/\r\n?/g,` -`));return s}async function eO(r,{cache:e,project:t}){let i=t.storedPackages.get(r.locatorHash);if(typeof i=="undefined")throw new Error("Assertion failed: Expected the package to be registered");let n=t.storedChecksums,s=new di,o=t.configuration.makeFetcher(),a=await o.fetch(r,{cache:e,project:t,fetcher:o,checksums:n,report:s}),l=await K.mktempPromise(),c=k.join(l,"source"),u=k.join(l,"user"),g=k.join(l,".yarn-patch.json");return await Promise.all([K.copyPromise(c,a.prefixPath,{baseFs:a.packageFs}),K.copyPromise(u,a.prefixPath,{baseFs:a.packageFs}),K.writeJsonPromise(g,{locator:P.stringifyLocator(r),version:i.version})]),K.detachTemp(l),u}async function tO(r,e){let t=H.fromPortablePath(r).replace(/\\/g,"/"),i=H.fromPortablePath(e).replace(/\\/g,"/"),{stdout:n,stderr:s}=await Nr.execvp("git",["-c","core.safecrlf=false","diff","--src-prefix=a/","--dst-prefix=b/","--ignore-cr-at-eol","--full-index","--no-index","--no-renames","--text",t,i],{cwd:H.toPortablePath(process.cwd()),env:te(N({},process.env),{GIT_CONFIG_NOSYSTEM:"1",HOME:"",XDG_CONFIG_HOME:"",USERPROFILE:""})});if(s.length>0)throw new Error(`Unable to diff directories. Make sure you have a recent version of 'git' available in PATH. -The following error was reported by 'git': -${s}`);let o=t.startsWith("/")?a=>a.slice(1):a=>a;return n.replace(new RegExp(`(a|b)(${Se.escapeRegExp(`/${o(t)}/`)})`,"g"),"$1/").replace(new RegExp(`(a|b)${Se.escapeRegExp(`/${o(i)}/`)}`,"g"),"$1/").replace(new RegExp(Se.escapeRegExp(`${t}/`),"g"),"").replace(new RegExp(Se.escapeRegExp(`${i}/`),"g"),"")}function Rue(r,{configuration:e,report:t}){for(let i of r.parts)for(let n of i.lines)switch(i.type){case Zr.Context:t.reportInfo(null,` ${ae.pretty(e,n,"grey")}`);break;case Zr.Deletion:t.reportError(X.FROZEN_LOCKFILE_EXCEPTION,`- ${ae.pretty(e,n,ae.Type.REMOVED)}`);break;case Zr.Insertion:t.reportError(X.FROZEN_LOCKFILE_EXCEPTION,`+ ${ae.pretty(e,n,ae.Type.ADDED)}`);break;default:Se.assertNever(i.type)}}var rO=class{supports(e,t){return!!e.reference.startsWith("patch:")}getLocalPath(e,t){return null}async fetch(e,t){let i=t.checksums.get(e.locatorHash)||null,[n,s,o]=await t.cache.fetchPackageFromCache(e,i,N({onHit:()=>t.report.reportCacheHit(e),onMiss:()=>t.report.reportCacheMiss(e,`${P.prettyLocator(t.project.configuration,e)} can't be found in the cache and will be fetched from the disk`),loader:()=>this.patchPackage(e,t),skipIntegrityCheck:t.skipIntegrityCheck},t.cacheOptions));return{packageFs:n,releaseFs:s,prefixPath:P.getIdentVendorPath(e),localPath:this.getLocalPath(e,t),checksum:o}}async patchPackage(e,t){let{parentLocator:i,sourceLocator:n,sourceVersion:s,patchPaths:o}=CE(e),a=await mE(i,o,t),l=await K.mktempPromise(),c=k.join(l,"current.zip"),u=await t.fetcher.fetch(n,t),g=P.getIdentVendorPath(e),f=await fn(),h=new li(c,{libzip:f,create:!0,level:t.project.configuration.get("compressionLevel")});await Se.releaseAfterUseAsync(async()=>{await h.copyPromise(g,u.prefixPath,{baseFs:u.packageFs,stableSort:!0})},u.releaseFs),h.saveAndClose();for(let{source:p,optional:m}of a){if(p===null)continue;let y=new li(c,{libzip:f,level:t.project.configuration.get("compressionLevel")}),b=new _t(k.resolve(Me.root,g),{baseFs:y});try{await Tb(Lb(p),{baseFs:b,version:s})}catch(v){if(!(v instanceof pE))throw v;let x=t.project.configuration.get("enableInlineHunks"),T=!x&&!m?" (set enableInlineHunks for details)":"",q=`${P.prettyLocator(t.project.configuration,e)}: ${v.message}${T}`,Y=$=>{!x||Rue(v.hunk,{configuration:t.project.configuration,report:$})};if(y.discardAndClose(),m){t.report.reportWarningOnce(X.PATCH_HUNK_FAILED,q,{reportExtra:Y});continue}else throw new ct(X.PATCH_HUNK_FAILED,q,Y)}y.saveAndClose()}return new li(c,{libzip:f,level:t.project.configuration.get("compressionLevel")})}};var E_e=3,iO=class{supportsDescriptor(e,t){return!!e.range.startsWith("patch:")}supportsLocator(e,t){return!!e.reference.startsWith("patch:")}shouldPersistResolution(e,t){return!1}bindDescriptor(e,t,i){let{patchPaths:n}=dE(e);return n.every(s=>!$T(s))?e:P.bindDescriptor(e,{locator:P.stringifyLocator(t)})}getResolutionDependencies(e,t){let{sourceDescriptor:i}=dE(e);return[i]}async getCandidates(e,t,i){if(!i.fetchOptions)throw new Error("Assertion failed: This resolver cannot be used unless a fetcher is configured");let{parentLocator:n,sourceDescriptor:s,patchPaths:o}=dE(e),a=await mE(n,o,i.fetchOptions),l=t.get(s.descriptorHash);if(typeof l=="undefined")throw new Error("Assertion failed: The dependency should have been resolved");let c=Dn.makeHash(`${E_e}`,...a.map(u=>JSON.stringify(u))).slice(0,6);return[ZT(e,{parentLocator:n,sourcePackage:l,patchPaths:o,patchHash:c})]}async getSatisfying(e,t,i){return null}async resolve(e,t){let{sourceLocator:i}=CE(e),n=await t.resolver.resolve(i,t);return N(N({},n),e)}};var EE=class extends Le{constructor(){super(...arguments);this.save=J.Boolean("-s,--save",!1,{description:"Add the patch to your resolution entries"});this.patchFolder=J.String()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,workspace:i}=await ze.find(e,this.context.cwd);if(!i)throw new ht(t.cwd,this.context.cwd);await t.restoreInstallState();let n=k.resolve(this.context.cwd,H.toPortablePath(this.patchFolder)),s=k.join(n,"../source"),o=k.join(n,"../.yarn-patch.json");if(!K.existsSync(s))throw new Pe("The argument folder didn't get created by 'yarn patch'");let a=await tO(s,n),l=await K.readJsonPromise(o),c=P.parseLocator(l.locator,!0);if(!t.storedPackages.has(c.locatorHash))throw new Pe("No package found in the project for the given locator");if(!this.save){this.context.stdout.write(a);return}let u=e.get("patchFolder"),g=k.join(u,`${P.slugifyLocator(c)}.patch`);await K.mkdirPromise(u,{recursive:!0}),await K.writeFilePromise(g,a);let f=k.relative(t.cwd,g);t.topLevelWorkspace.manifest.resolutions.push({pattern:{descriptor:{fullName:P.stringifyIdent(c),description:l.version}},reference:`patch:${P.stringifyLocator(c)}#${f}`}),await t.persist()}};EE.paths=[["patch-commit"]],EE.usage=Re.Usage({description:"generate a patch out of a directory",details:"\n By default, this will print a patchfile on stdout based on the diff between the folder passed in and the original version of the package. Such file is suitable for consumption with the `patch:` protocol.\n\n With the `-s,--save` option set, the patchfile won't be printed on stdout anymore and will instead be stored within a local file (by default kept within `.yarn/patches`, but configurable via the `patchFolder` setting). A `resolutions` entry will also be added to your top-level manifest, referencing the patched package via the `patch:` protocol.\n\n Note that only folders generated by `yarn patch` are accepted as valid input for `yarn patch-commit`.\n "});var Fue=EE;var IE=class extends Le{constructor(){super(...arguments);this.json=J.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.package=J.String()}async execute(){let e=await ye.find(this.context.cwd,this.context.plugins),{project:t,workspace:i}=await ze.find(e,this.context.cwd),n=await Nt.find(e);if(!i)throw new ht(t.cwd,this.context.cwd);await t.restoreInstallState();let s=P.parseLocator(this.package);if(s.reference==="unknown"){let o=Se.mapAndFilter([...t.storedPackages.values()],a=>a.identHash!==s.identHash?Se.mapAndFilter.skip:P.isVirtualLocator(a)?Se.mapAndFilter.skip:a);if(o.length===0)throw new Pe("No package found in the project for the given locator");if(o.length>1)throw new Pe(`Multiple candidate packages found; explicitly choose one of them (use \`yarn why \` to get more information as to who depends on them): -${o.map(a=>` -- ${P.prettyLocator(e,a)}`).join("")}`);s=o[0]}if(!t.storedPackages.has(s.locatorHash))throw new Pe("No package found in the project for the given locator");await Je.start({configuration:e,json:this.json,stdout:this.context.stdout},async o=>{let a=await eO(s,{cache:n,project:t});o.reportJson({locator:P.stringifyLocator(s),path:H.fromPortablePath(a)}),o.reportInfo(X.UNNAMED,`Package ${P.prettyLocator(e,s)} got extracted with success!`),o.reportInfo(X.UNNAMED,`You can now edit the following folder: ${ae.pretty(e,H.fromPortablePath(a),"magenta")}`),o.reportInfo(X.UNNAMED,`Once you are done run ${ae.pretty(e,`yarn patch-commit -s ${process.platform==="win32"?'"':""}${H.fromPortablePath(a)}${process.platform==="win32"?'"':""}`,"cyan")} and Yarn will store a patchfile based on your changes.`)})}};IE.paths=[["patch"]],IE.usage=Re.Usage({description:"prepare a package for patching",details:"\n This command will cause a package to be extracted in a temporary directory intended to be editable at will.\n \n Once you're done with your changes, run `yarn patch-commit -s ` (with `` being the temporary directory you received) to generate a patchfile and register it into your top-level manifest via the `patch:` protocol. Run `yarn patch-commit -h` for more details.\n "});var Nue=IE;var I_e={configuration:{enableInlineHunks:{description:"If true, the installs will print unmatched patch hunks",type:Ie.BOOLEAN,default:!1},patchFolder:{description:"Folder where the patch files must be written",type:Ie.ABSOLUTE_PATH,default:"./.yarn/patches"}},commands:[Fue,Nue],fetchers:[rO],resolvers:[iO]},y_e=I_e;var AO={};ft(AO,{default:()=>b_e});var sO=class{supportsPackage(e,t){return this.isEnabled(t)}async findPackageLocation(e,t){if(!this.isEnabled(t))throw new Error("Assertion failed: Expected the pnpm linker to be enabled");let i=oO(),n=t.project.installersCustomData.get(i);if(!n)throw new Pe(`The project in ${ae.pretty(t.project.configuration,`${t.project.cwd}/package.json`,ae.Type.PATH)} doesn't seem to have been installed - running an install there might help`);let s=n.pathByLocator.get(e.locatorHash);if(typeof s=="undefined")throw new Pe(`Couldn't find ${P.prettyLocator(t.project.configuration,e)} in the currently installed pnpm map - running an install might help`);return s}async findPackageLocator(e,t){if(!this.isEnabled(t))return null;let i=oO(),n=t.project.installersCustomData.get(i);if(!n)throw new Pe(`The project in ${ae.pretty(t.project.configuration,`${t.project.cwd}/package.json`,ae.Type.PATH)} doesn't seem to have been installed - running an install there might help`);let s=e.match(/(^.*\/node_modules\/(@[^/]*\/)?[^/]+)(\/.*$)/);if(s){let l=n.locatorByPath.get(s[1]);if(l)return l}let o=e,a=e;do{a=o,o=k.dirname(a);let l=n.locatorByPath.get(a);if(l)return l}while(o!==a);return null}makeInstaller(e){return new Lue(e)}isEnabled(e){return e.project.configuration.get("nodeLinker")==="pnpm"}},Lue=class{constructor(e){this.opts=e;this.asyncActions=new Se.AsyncActions(10);this.customData={pathByLocator:new Map,locatorByPath:new Map}}getCustomDataKey(){return oO()}attachCustomData(e){}async installPackage(e,t,i){switch(e.linkType){case Qt.SOFT:return this.installPackageSoft(e,t,i);case Qt.HARD:return this.installPackageHard(e,t,i)}throw new Error("Assertion failed: Unsupported package link type")}async installPackageSoft(e,t,i){let n=k.resolve(t.packageFs.getRealPath(),t.prefixPath);return this.customData.pathByLocator.set(e.locatorHash,n),{packageLocation:n,buildDirective:null}}async installPackageHard(e,t,i){var u;let n=w_e(e,{project:this.opts.project});this.customData.locatorByPath.set(n,P.stringifyLocator(e)),this.customData.pathByLocator.set(e.locatorHash,n),i.holdFetchResult(this.asyncActions.set(e.locatorHash,async()=>{await K.mkdirPromise(n,{recursive:!0}),await K.copyPromise(n,t.prefixPath,{baseFs:t.packageFs,overwrite:!1})}));let o=P.isVirtualLocator(e)?P.devirtualizeLocator(e):e,a={manifest:(u=await At.tryFind(t.prefixPath,{baseFs:t.packageFs}))!=null?u:new At,misc:{hasBindingGyp:Ca.hasBindingGyp(t)}},l=this.opts.project.getDependencyMeta(o,e.version),c=Ca.extractBuildScripts(e,a,l,{configuration:this.opts.project.configuration,report:this.opts.report});return{packageLocation:n,buildDirective:c}}async attachInternalDependencies(e,t){this.opts.project.configuration.get("nodeLinker")==="pnpm"&&(!Mue(e,{project:this.opts.project})||this.asyncActions.reduce(e.locatorHash,async i=>{await i;let n=this.customData.pathByLocator.get(e.locatorHash);if(typeof n=="undefined")throw new Error(`Assertion failed: Expected the package to have been registered (${P.stringifyLocator(e)})`);let s=k.join(n,kt.nodeModules),o=[],a=await Kue(s);for(let[l,c]of t){let u=c;Mue(c,{project:this.opts.project})||(this.opts.report.reportWarning(X.UNNAMED,"The pnpm linker doesn't support providing different versions to workspaces' peer dependencies"),u=P.devirtualizeLocator(c));let g=this.customData.pathByLocator.get(u.locatorHash);if(typeof g=="undefined")throw new Error(`Assertion failed: Expected the package to have been registered (${P.stringifyLocator(c)})`);let f=P.stringifyIdent(l),h=k.join(s,f),p=k.relative(k.dirname(h),g),m=a.get(f);a.delete(f),o.push(Promise.resolve().then(async()=>{if(m){if(m.isSymbolicLink()&&await K.readlinkPromise(h)===p)return;await K.removePromise(h)}await K.mkdirpPromise(k.dirname(h)),process.platform=="win32"?await K.symlinkPromise(g,h,"junction"):await K.symlinkPromise(p,h)}))}o.push(Uue(s,a)),await Promise.all(o)}))}async attachExternalDependents(e,t){throw new Error("External dependencies haven't been implemented for the pnpm linker")}async finalizeInstall(){let e=Oue(this.opts.project);if(this.opts.project.configuration.get("nodeLinker")!=="pnpm")await K.removePromise(e);else{let t=[],i=new Set;for(let s of this.customData.pathByLocator.values()){let o=k.contains(e,s);if(o!==null){let[a,,...l]=o.split(k.sep);i.add(a);let c=k.join(e,a);t.push(K.readdirPromise(c).then(u=>Promise.all(u.map(async g=>{let f=k.join(c,g);if(g===kt.nodeModules){let h=await Kue(f);return h.delete(l.join(k.sep)),Uue(f,h)}else return K.removePromise(f)}))).catch(u=>{if(u.code!=="ENOENT")throw u}))}}let n;try{n=await K.readdirPromise(e)}catch{n=[]}for(let s of n)i.has(s)||t.push(K.removePromise(k.join(e,s)));await Promise.all(t)}return await this.asyncActions.wait(),await aO(e),this.opts.project.configuration.get("nodeLinker")!=="node-modules"&&await aO(Tue(this.opts.project)),{customData:this.customData}}};function oO(){return JSON.stringify({name:"PnpmInstaller",version:2})}function Tue(r){return k.join(r.cwd,kt.nodeModules)}function Oue(r){return k.join(Tue(r),".store")}function w_e(r,{project:e}){let t=P.slugifyLocator(r),i=P.getIdentVendorPath(r);return k.join(Oue(e),t,i)}function Mue(r,{project:e}){return!P.isVirtualLocator(r)||!e.tryWorkspaceByLocator(r)}async function Kue(r){let e=new Map,t=[];try{t=await K.readdirPromise(r,{withFileTypes:!0})}catch(i){if(i.code!=="ENOENT")throw i}try{for(let i of t)if(!i.name.startsWith("."))if(i.name.startsWith("@")){let n=await K.readdirPromise(k.join(r,i.name),{withFileTypes:!0});if(n.length===0)e.set(i.name,i);else for(let s of n)e.set(`${i.name}/${s.name}`,s)}else e.set(i.name,i)}catch(i){if(i.code!=="ENOENT")throw i}return e}async function Uue(r,e){var n;let t=[],i=new Set;for(let s of e.keys()){t.push(K.removePromise(k.join(r,s)));let o=(n=P.tryParseIdent(s))==null?void 0:n.scope;o&&i.add(`@${o}`)}return Promise.all(t).then(()=>Promise.all([...i].map(s=>aO(k.join(r,s)))))}async function aO(r){try{await K.rmdirPromise(r)}catch(e){if(e.code!=="ENOENT"&&e.code!=="ENOTEMPTY")throw e}}var B_e={linkers:[sO]},b_e=B_e;var L0=()=>({modules:new Map([["@yarnpkg/cli",GC],["@yarnpkg/core",EC],["@yarnpkg/fslib",Zh],["@yarnpkg/libzip",Md],["@yarnpkg/parsers",op],["@yarnpkg/shell",Ud],["clipanion",cZ(Cp)],["semver",Q_e],["typanion",cg],["yup",S_e],["@yarnpkg/plugin-essentials",GN],["@yarnpkg/plugin-compat",zN],["@yarnpkg/plugin-dlx",_N],["@yarnpkg/plugin-file",nL],["@yarnpkg/plugin-git",jN],["@yarnpkg/plugin-github",oL],["@yarnpkg/plugin-http",lL],["@yarnpkg/plugin-init",fL],["@yarnpkg/plugin-link",mL],["@yarnpkg/plugin-nm",JL],["@yarnpkg/plugin-npm",qT],["@yarnpkg/plugin-npm-cli",VT],["@yarnpkg/plugin-pack",HT],["@yarnpkg/plugin-patch",nO],["@yarnpkg/plugin-pnp",LL],["@yarnpkg/plugin-pnpm",AO]]),plugins:new Set(["@yarnpkg/plugin-essentials","@yarnpkg/plugin-compat","@yarnpkg/plugin-dlx","@yarnpkg/plugin-file","@yarnpkg/plugin-git","@yarnpkg/plugin-github","@yarnpkg/plugin-http","@yarnpkg/plugin-init","@yarnpkg/plugin-link","@yarnpkg/plugin-nm","@yarnpkg/plugin-npm","@yarnpkg/plugin-npm-cli","@yarnpkg/plugin-pack","@yarnpkg/plugin-patch","@yarnpkg/plugin-pnp","@yarnpkg/plugin-pnpm"])});s0({binaryVersion:Ur||"",pluginConfiguration:L0()});})(); -/*! - * buildToken - * Builds OAuth token prefix (helper function) - * - * @name buildToken - * @function - * @param {GitUrl} obj The parsed Git url object. - * @return {String} token prefix - */ -/*! - * fill-range - * - * Copyright (c) 2014-present, Jon Schlinkert. - * Licensed under the MIT License. - */ -/*! - * is-extglob - * - * Copyright (c) 2014-2016, Jon Schlinkert. - * Licensed under the MIT License. - */ -/*! - * is-glob - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */ -/*! - * is-number - * - * Copyright (c) 2014-present, Jon Schlinkert. - * Released under the MIT License. - */ -/*! - * is-windows - * - * Copyright © 2015-2018, Jon Schlinkert. - * Released under the MIT License. - */ -/*! - * to-regex-range - * - * Copyright (c) 2015-present, Jon Schlinkert. - * Released under the MIT License. - */ diff --git a/.yarn/releases/yarn-3.5.0.cjs b/.yarn/releases/yarn-3.5.0.cjs new file mode 100755 index 000000000000..093e64a9fe46 --- /dev/null +++ b/.yarn/releases/yarn-3.5.0.cjs @@ -0,0 +1,873 @@ +#!/usr/bin/env node +/* eslint-disable */ +//prettier-ignore +(()=>{var Qge=Object.create;var AS=Object.defineProperty;var bge=Object.getOwnPropertyDescriptor;var Sge=Object.getOwnPropertyNames;var vge=Object.getPrototypeOf,xge=Object.prototype.hasOwnProperty;var J=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+r+'" is not supported')});var Pge=(r,e)=>()=>(r&&(e=r(r=0)),e);var w=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),ut=(r,e)=>{for(var t in e)AS(r,t,{get:e[t],enumerable:!0})},Dge=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Sge(e))!xge.call(r,n)&&n!==t&&AS(r,n,{get:()=>e[n],enumerable:!(i=bge(e,n))||i.enumerable});return r};var Pe=(r,e,t)=>(t=r!=null?Qge(vge(r)):{},Dge(e||!r||!r.__esModule?AS(t,"default",{value:r,enumerable:!0}):t,r));var QK=w((GXe,BK)=>{BK.exports=wK;wK.sync=Zge;var IK=J("fs");function Xge(r,e){var t=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!t||(t=t.split(";"),t.indexOf("")!==-1))return!0;for(var i=0;i{xK.exports=SK;SK.sync=_ge;var bK=J("fs");function SK(r,e,t){bK.stat(r,function(i,n){t(i,i?!1:vK(n,e))})}function _ge(r,e){return vK(bK.statSync(r),e)}function vK(r,e){return r.isFile()&&$ge(r,e)}function $ge(r,e){var t=r.mode,i=r.uid,n=r.gid,s=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),o=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),l=parseInt("010",8),c=parseInt("001",8),u=a|l,g=t&c||t&l&&n===o||t&a&&i===s||t&u&&s===0;return g}});var kK=w((qXe,DK)=>{var jXe=J("fs"),sI;process.platform==="win32"||global.TESTING_WINDOWS?sI=QK():sI=PK();DK.exports=SS;SS.sync=efe;function SS(r,e,t){if(typeof e=="function"&&(t=e,e={}),!t){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(i,n){SS(r,e||{},function(s,o){s?n(s):i(o)})})}sI(r,e||{},function(i,n){i&&(i.code==="EACCES"||e&&e.ignoreErrors)&&(i=null,n=!1),t(i,n)})}function efe(r,e){try{return sI.sync(r,e||{})}catch(t){if(e&&e.ignoreErrors||t.code==="EACCES")return!1;throw t}}});var MK=w((JXe,OK)=>{var vg=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",RK=J("path"),tfe=vg?";":":",FK=kK(),NK=r=>Object.assign(new Error(`not found: ${r}`),{code:"ENOENT"}),LK=(r,e)=>{let t=e.colon||tfe,i=r.match(/\//)||vg&&r.match(/\\/)?[""]:[...vg?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(t)],n=vg?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=vg?n.split(t):[""];return vg&&r.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:i,pathExt:s,pathExtExe:n}},TK=(r,e,t)=>{typeof e=="function"&&(t=e,e={}),e||(e={});let{pathEnv:i,pathExt:n,pathExtExe:s}=LK(r,e),o=[],a=c=>new Promise((u,g)=>{if(c===i.length)return e.all&&o.length?u(o):g(NK(r));let f=i[c],h=/^".*"$/.test(f)?f.slice(1,-1):f,p=RK.join(h,r),C=!h&&/^\.[\\\/]/.test(r)?r.slice(0,2)+p:p;u(l(C,c,0))}),l=(c,u,g)=>new Promise((f,h)=>{if(g===n.length)return f(a(u+1));let p=n[g];FK(c+p,{pathExt:s},(C,y)=>{if(!C&&y)if(e.all)o.push(c+p);else return f(c+p);return f(l(c,u,g+1))})});return t?a(0).then(c=>t(null,c),t):a(0)},rfe=(r,e)=>{e=e||{};let{pathEnv:t,pathExt:i,pathExtExe:n}=LK(r,e),s=[];for(let o=0;o{"use strict";var KK=(r={})=>{let e=r.env||process.env;return(r.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"};vS.exports=KK;vS.exports.default=KK});var jK=w((zXe,YK)=>{"use strict";var HK=J("path"),ife=MK(),nfe=UK();function GK(r,e){let t=r.options.env||process.env,i=process.cwd(),n=r.options.cwd!=null,s=n&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(r.options.cwd)}catch{}let o;try{o=ife.sync(r.command,{path:t[nfe({env:t})],pathExt:e?HK.delimiter:void 0})}catch{}finally{s&&process.chdir(i)}return o&&(o=HK.resolve(n?r.options.cwd:"",o)),o}function sfe(r){return GK(r)||GK(r,!0)}YK.exports=sfe});var qK=w((VXe,PS)=>{"use strict";var xS=/([()\][%!^"`<>&|;, *?])/g;function ofe(r){return r=r.replace(xS,"^$1"),r}function afe(r,e){return r=`${r}`,r=r.replace(/(\\*)"/g,'$1$1\\"'),r=r.replace(/(\\*)$/,"$1$1"),r=`"${r}"`,r=r.replace(xS,"^$1"),e&&(r=r.replace(xS,"^$1")),r}PS.exports.command=ofe;PS.exports.argument=afe});var WK=w((XXe,JK)=>{"use strict";JK.exports=/^#!(.*)/});var VK=w((ZXe,zK)=>{"use strict";var Afe=WK();zK.exports=(r="")=>{let e=r.match(Afe);if(!e)return null;let[t,i]=e[0].replace(/#! ?/,"").split(" "),n=t.split("/").pop();return n==="env"?i:i?`${n} ${i}`:n}});var ZK=w((_Xe,XK)=>{"use strict";var DS=J("fs"),lfe=VK();function cfe(r){let t=Buffer.alloc(150),i;try{i=DS.openSync(r,"r"),DS.readSync(i,t,0,150,0),DS.closeSync(i)}catch{}return lfe(t.toString())}XK.exports=cfe});var tU=w(($Xe,eU)=>{"use strict";var ufe=J("path"),_K=jK(),$K=qK(),gfe=ZK(),ffe=process.platform==="win32",hfe=/\.(?:com|exe)$/i,pfe=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function dfe(r){r.file=_K(r);let e=r.file&&gfe(r.file);return e?(r.args.unshift(r.file),r.command=e,_K(r)):r.file}function Cfe(r){if(!ffe)return r;let e=dfe(r),t=!hfe.test(e);if(r.options.forceShell||t){let i=pfe.test(e);r.command=ufe.normalize(r.command),r.command=$K.command(r.command),r.args=r.args.map(s=>$K.argument(s,i));let n=[r.command].concat(r.args).join(" ");r.args=["/d","/s","/c",`"${n}"`],r.command=process.env.comspec||"cmd.exe",r.options.windowsVerbatimArguments=!0}return r}function mfe(r,e,t){e&&!Array.isArray(e)&&(t=e,e=null),e=e?e.slice(0):[],t=Object.assign({},t);let i={command:r,args:e,options:t,file:void 0,original:{command:r,args:e}};return t.shell?i:Cfe(i)}eU.exports=mfe});var nU=w((eZe,iU)=>{"use strict";var kS=process.platform==="win32";function RS(r,e){return Object.assign(new Error(`${e} ${r.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${r.command}`,path:r.command,spawnargs:r.args})}function Efe(r,e){if(!kS)return;let t=r.emit;r.emit=function(i,n){if(i==="exit"){let s=rU(n,e,"spawn");if(s)return t.call(r,"error",s)}return t.apply(r,arguments)}}function rU(r,e){return kS&&r===1&&!e.file?RS(e.original,"spawn"):null}function Ife(r,e){return kS&&r===1&&!e.file?RS(e.original,"spawnSync"):null}iU.exports={hookChildProcess:Efe,verifyENOENT:rU,verifyENOENTSync:Ife,notFoundError:RS}});var LS=w((tZe,xg)=>{"use strict";var sU=J("child_process"),FS=tU(),NS=nU();function oU(r,e,t){let i=FS(r,e,t),n=sU.spawn(i.command,i.args,i.options);return NS.hookChildProcess(n,i),n}function yfe(r,e,t){let i=FS(r,e,t),n=sU.spawnSync(i.command,i.args,i.options);return n.error=n.error||NS.verifyENOENTSync(n.status,i),n}xg.exports=oU;xg.exports.spawn=oU;xg.exports.sync=yfe;xg.exports._parse=FS;xg.exports._enoent=NS});var AU=w((rZe,aU)=>{"use strict";function wfe(r,e){function t(){this.constructor=r}t.prototype=e.prototype,r.prototype=new t}function Wl(r,e,t,i){this.message=r,this.expected=e,this.found=t,this.location=i,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Wl)}wfe(Wl,Error);Wl.buildMessage=function(r,e){var t={literal:function(c){return'"'+n(c.text)+'"'},class:function(c){var u="",g;for(g=0;g0){for(g=1,f=1;g>",ie=me(">>",!1),de=">&",_e=me(">&",!1),Pt=">",It=me(">",!1),Or="<<<",ii=me("<<<",!1),gi="<&",hr=me("<&",!1),fi="<",ni=me("<",!1),Os=function(m){return{type:"argument",segments:[].concat(...m)}},pr=function(m){return m},Ii="$'",es=me("$'",!1),ua="'",pA=me("'",!1),ag=function(m){return[{type:"text",text:m}]},ts='""',dA=me('""',!1),ga=function(){return{type:"text",text:""}},yp='"',CA=me('"',!1),mA=function(m){return m},wr=function(m){return{type:"arithmetic",arithmetic:m,quoted:!0}},kl=function(m){return{type:"shell",shell:m,quoted:!0}},Ag=function(m){return{type:"variable",...m,quoted:!0}},Io=function(m){return{type:"text",text:m}},lg=function(m){return{type:"arithmetic",arithmetic:m,quoted:!1}},wp=function(m){return{type:"shell",shell:m,quoted:!1}},Bp=function(m){return{type:"variable",...m,quoted:!1}},vr=function(m){return{type:"glob",pattern:m}},se=/^[^']/,yo=Je(["'"],!0,!1),kn=function(m){return m.join("")},cg=/^[^$"]/,Qt=Je(["$",'"'],!0,!1),Rl=`\\ +`,Rn=me(`\\ +`,!1),rs=function(){return""},is="\\",gt=me("\\",!1),wo=/^[\\$"`]/,At=Je(["\\","$",'"',"`"],!1,!1),an=function(m){return m},S="\\a",Tt=me("\\a",!1),ug=function(){return"a"},Fl="\\b",Qp=me("\\b",!1),bp=function(){return"\b"},Sp=/^[Ee]/,vp=Je(["E","e"],!1,!1),xp=function(){return"\x1B"},G="\\f",yt=me("\\f",!1),EA=function(){return"\f"},Ji="\\n",Nl=me("\\n",!1),Xe=function(){return` +`},fa="\\r",gg=me("\\r",!1),FE=function(){return"\r"},Pp="\\t",NE=me("\\t",!1),ar=function(){return" "},Fn="\\v",Ll=me("\\v",!1),Dp=function(){return"\v"},Ms=/^[\\'"?]/,ha=Je(["\\","'",'"',"?"],!1,!1),An=function(m){return String.fromCharCode(parseInt(m,16))},Te="\\x",fg=me("\\x",!1),Tl="\\u",Ks=me("\\u",!1),Ol="\\U",IA=me("\\U",!1),hg=function(m){return String.fromCodePoint(parseInt(m,16))},pg=/^[0-7]/,pa=Je([["0","7"]],!1,!1),da=/^[0-9a-fA-f]/,rt=Je([["0","9"],["a","f"],["A","f"]],!1,!1),Bo=nt(),yA="-",Ml=me("-",!1),Us="+",Kl=me("+",!1),LE=".",kp=me(".",!1),dg=function(m,b,N){return{type:"number",value:(m==="-"?-1:1)*parseFloat(b.join("")+"."+N.join(""))}},Rp=function(m,b){return{type:"number",value:(m==="-"?-1:1)*parseInt(b.join(""))}},TE=function(m){return{type:"variable",...m}},Ul=function(m){return{type:"variable",name:m}},OE=function(m){return m},Cg="*",wA=me("*",!1),Rr="/",ME=me("/",!1),Hs=function(m,b,N){return{type:b==="*"?"multiplication":"division",right:N}},Gs=function(m,b){return b.reduce((N,U)=>({left:N,...U}),m)},mg=function(m,b,N){return{type:b==="+"?"addition":"subtraction",right:N}},BA="$((",R=me("$((",!1),q="))",Ce=me("))",!1),Ke=function(m){return m},Re="$(",ze=me("$(",!1),dt=function(m){return m},Ft="${",Nn=me("${",!1),qb=":-",S1=me(":-",!1),v1=function(m,b){return{name:m,defaultValue:b}},Jb=":-}",x1=me(":-}",!1),P1=function(m){return{name:m,defaultValue:[]}},Wb=":+",D1=me(":+",!1),k1=function(m,b){return{name:m,alternativeValue:b}},zb=":+}",R1=me(":+}",!1),F1=function(m){return{name:m,alternativeValue:[]}},Vb=function(m){return{name:m}},N1="$",L1=me("$",!1),T1=function(m){return e.isGlobPattern(m)},O1=function(m){return m},Xb=/^[a-zA-Z0-9_]/,Zb=Je([["a","z"],["A","Z"],["0","9"],"_"],!1,!1),_b=function(){return T()},$b=/^[$@*?#a-zA-Z0-9_\-]/,eS=Je(["$","@","*","?","#",["a","z"],["A","Z"],["0","9"],"_","-"],!1,!1),M1=/^[(){}<>$|&; \t"']/,Eg=Je(["(",")","{","}","<",">","$","|","&",";"," "," ",'"',"'"],!1,!1),tS=/^[<>&; \t"']/,rS=Je(["<",">","&",";"," "," ",'"',"'"],!1,!1),KE=/^[ \t]/,UE=Je([" "," "],!1,!1),Q=0,Me=0,QA=[{line:1,column:1}],d=0,E=[],I=0,k;if("startRule"in e){if(!(e.startRule in i))throw new Error(`Can't start parsing from rule "`+e.startRule+'".');n=i[e.startRule]}function T(){return r.substring(Me,Q)}function Z(){return Et(Me,Q)}function te(m,b){throw b=b!==void 0?b:Et(Me,Q),Ri([lt(m)],r.substring(Me,Q),b)}function Be(m,b){throw b=b!==void 0?b:Et(Me,Q),Ln(m,b)}function me(m,b){return{type:"literal",text:m,ignoreCase:b}}function Je(m,b,N){return{type:"class",parts:m,inverted:b,ignoreCase:N}}function nt(){return{type:"any"}}function wt(){return{type:"end"}}function lt(m){return{type:"other",description:m}}function it(m){var b=QA[m],N;if(b)return b;for(N=m-1;!QA[N];)N--;for(b=QA[N],b={line:b.line,column:b.column};Nd&&(d=Q,E=[]),E.push(m))}function Ln(m,b){return new Wl(m,null,null,b)}function Ri(m,b,N){return new Wl(Wl.buildMessage(m,b),m,b,N)}function bA(){var m,b;return m=Q,b=Mr(),b===t&&(b=null),b!==t&&(Me=m,b=s(b)),m=b,m}function Mr(){var m,b,N,U,ce;if(m=Q,b=Kr(),b!==t){for(N=[],U=He();U!==t;)N.push(U),U=He();N!==t?(U=Ca(),U!==t?(ce=ns(),ce===t&&(ce=null),ce!==t?(Me=m,b=o(b,U,ce),m=b):(Q=m,m=t)):(Q=m,m=t)):(Q=m,m=t)}else Q=m,m=t;if(m===t)if(m=Q,b=Kr(),b!==t){for(N=[],U=He();U!==t;)N.push(U),U=He();N!==t?(U=Ca(),U===t&&(U=null),U!==t?(Me=m,b=a(b,U),m=b):(Q=m,m=t)):(Q=m,m=t)}else Q=m,m=t;return m}function ns(){var m,b,N,U,ce;for(m=Q,b=[],N=He();N!==t;)b.push(N),N=He();if(b!==t)if(N=Mr(),N!==t){for(U=[],ce=He();ce!==t;)U.push(ce),ce=He();U!==t?(Me=m,b=l(N),m=b):(Q=m,m=t)}else Q=m,m=t;else Q=m,m=t;return m}function Ca(){var m;return r.charCodeAt(Q)===59?(m=c,Q++):(m=t,I===0&&Qe(u)),m===t&&(r.charCodeAt(Q)===38?(m=g,Q++):(m=t,I===0&&Qe(f))),m}function Kr(){var m,b,N;return m=Q,b=K1(),b!==t?(N=age(),N===t&&(N=null),N!==t?(Me=m,b=h(b,N),m=b):(Q=m,m=t)):(Q=m,m=t),m}function age(){var m,b,N,U,ce,Se,ht;for(m=Q,b=[],N=He();N!==t;)b.push(N),N=He();if(b!==t)if(N=Age(),N!==t){for(U=[],ce=He();ce!==t;)U.push(ce),ce=He();if(U!==t)if(ce=Kr(),ce!==t){for(Se=[],ht=He();ht!==t;)Se.push(ht),ht=He();Se!==t?(Me=m,b=p(N,ce),m=b):(Q=m,m=t)}else Q=m,m=t;else Q=m,m=t}else Q=m,m=t;else Q=m,m=t;return m}function Age(){var m;return r.substr(Q,2)===C?(m=C,Q+=2):(m=t,I===0&&Qe(y)),m===t&&(r.substr(Q,2)===B?(m=B,Q+=2):(m=t,I===0&&Qe(v))),m}function K1(){var m,b,N;return m=Q,b=uge(),b!==t?(N=lge(),N===t&&(N=null),N!==t?(Me=m,b=D(b,N),m=b):(Q=m,m=t)):(Q=m,m=t),m}function lge(){var m,b,N,U,ce,Se,ht;for(m=Q,b=[],N=He();N!==t;)b.push(N),N=He();if(b!==t)if(N=cge(),N!==t){for(U=[],ce=He();ce!==t;)U.push(ce),ce=He();if(U!==t)if(ce=K1(),ce!==t){for(Se=[],ht=He();ht!==t;)Se.push(ht),ht=He();Se!==t?(Me=m,b=L(N,ce),m=b):(Q=m,m=t)}else Q=m,m=t;else Q=m,m=t}else Q=m,m=t;else Q=m,m=t;return m}function cge(){var m;return r.substr(Q,2)===H?(m=H,Q+=2):(m=t,I===0&&Qe(j)),m===t&&(r.charCodeAt(Q)===124?(m=$,Q++):(m=t,I===0&&Qe(V))),m}function HE(){var m,b,N,U,ce,Se;if(m=Q,b=Z1(),b!==t)if(r.charCodeAt(Q)===61?(N=W,Q++):(N=t,I===0&&Qe(_)),N!==t)if(U=G1(),U!==t){for(ce=[],Se=He();Se!==t;)ce.push(Se),Se=He();ce!==t?(Me=m,b=A(b,U),m=b):(Q=m,m=t)}else Q=m,m=t;else Q=m,m=t;else Q=m,m=t;if(m===t)if(m=Q,b=Z1(),b!==t)if(r.charCodeAt(Q)===61?(N=W,Q++):(N=t,I===0&&Qe(_)),N!==t){for(U=[],ce=He();ce!==t;)U.push(ce),ce=He();U!==t?(Me=m,b=ae(b),m=b):(Q=m,m=t)}else Q=m,m=t;else Q=m,m=t;return m}function uge(){var m,b,N,U,ce,Se,ht,Bt,Jr,hi,ss;for(m=Q,b=[],N=He();N!==t;)b.push(N),N=He();if(b!==t)if(r.charCodeAt(Q)===40?(N=ge,Q++):(N=t,I===0&&Qe(re)),N!==t){for(U=[],ce=He();ce!==t;)U.push(ce),ce=He();if(U!==t)if(ce=Mr(),ce!==t){for(Se=[],ht=He();ht!==t;)Se.push(ht),ht=He();if(Se!==t)if(r.charCodeAt(Q)===41?(ht=O,Q++):(ht=t,I===0&&Qe(F)),ht!==t){for(Bt=[],Jr=He();Jr!==t;)Bt.push(Jr),Jr=He();if(Bt!==t){for(Jr=[],hi=Fp();hi!==t;)Jr.push(hi),hi=Fp();if(Jr!==t){for(hi=[],ss=He();ss!==t;)hi.push(ss),ss=He();hi!==t?(Me=m,b=ue(ce,Jr),m=b):(Q=m,m=t)}else Q=m,m=t}else Q=m,m=t}else Q=m,m=t;else Q=m,m=t}else Q=m,m=t;else Q=m,m=t}else Q=m,m=t;else Q=m,m=t;if(m===t){for(m=Q,b=[],N=He();N!==t;)b.push(N),N=He();if(b!==t)if(r.charCodeAt(Q)===123?(N=he,Q++):(N=t,I===0&&Qe(ke)),N!==t){for(U=[],ce=He();ce!==t;)U.push(ce),ce=He();if(U!==t)if(ce=Mr(),ce!==t){for(Se=[],ht=He();ht!==t;)Se.push(ht),ht=He();if(Se!==t)if(r.charCodeAt(Q)===125?(ht=Fe,Q++):(ht=t,I===0&&Qe(Ne)),ht!==t){for(Bt=[],Jr=He();Jr!==t;)Bt.push(Jr),Jr=He();if(Bt!==t){for(Jr=[],hi=Fp();hi!==t;)Jr.push(hi),hi=Fp();if(Jr!==t){for(hi=[],ss=He();ss!==t;)hi.push(ss),ss=He();hi!==t?(Me=m,b=oe(ce,Jr),m=b):(Q=m,m=t)}else Q=m,m=t}else Q=m,m=t}else Q=m,m=t;else Q=m,m=t}else Q=m,m=t;else Q=m,m=t}else Q=m,m=t;else Q=m,m=t;if(m===t){for(m=Q,b=[],N=He();N!==t;)b.push(N),N=He();if(b!==t){for(N=[],U=HE();U!==t;)N.push(U),U=HE();if(N!==t){for(U=[],ce=He();ce!==t;)U.push(ce),ce=He();if(U!==t){if(ce=[],Se=H1(),Se!==t)for(;Se!==t;)ce.push(Se),Se=H1();else ce=t;if(ce!==t){for(Se=[],ht=He();ht!==t;)Se.push(ht),ht=He();Se!==t?(Me=m,b=le(N,ce),m=b):(Q=m,m=t)}else Q=m,m=t}else Q=m,m=t}else Q=m,m=t}else Q=m,m=t;if(m===t){for(m=Q,b=[],N=He();N!==t;)b.push(N),N=He();if(b!==t){if(N=[],U=HE(),U!==t)for(;U!==t;)N.push(U),U=HE();else N=t;if(N!==t){for(U=[],ce=He();ce!==t;)U.push(ce),ce=He();U!==t?(Me=m,b=we(N),m=b):(Q=m,m=t)}else Q=m,m=t}else Q=m,m=t}}}return m}function U1(){var m,b,N,U,ce;for(m=Q,b=[],N=He();N!==t;)b.push(N),N=He();if(b!==t){if(N=[],U=GE(),U!==t)for(;U!==t;)N.push(U),U=GE();else N=t;if(N!==t){for(U=[],ce=He();ce!==t;)U.push(ce),ce=He();U!==t?(Me=m,b=fe(N),m=b):(Q=m,m=t)}else Q=m,m=t}else Q=m,m=t;return m}function H1(){var m,b,N;for(m=Q,b=[],N=He();N!==t;)b.push(N),N=He();if(b!==t?(N=Fp(),N!==t?(Me=m,b=Ae(N),m=b):(Q=m,m=t)):(Q=m,m=t),m===t){for(m=Q,b=[],N=He();N!==t;)b.push(N),N=He();b!==t?(N=GE(),N!==t?(Me=m,b=Ae(N),m=b):(Q=m,m=t)):(Q=m,m=t)}return m}function Fp(){var m,b,N,U,ce;for(m=Q,b=[],N=He();N!==t;)b.push(N),N=He();return b!==t?(qe.test(r.charAt(Q))?(N=r.charAt(Q),Q++):(N=t,I===0&&Qe(ne)),N===t&&(N=null),N!==t?(U=gge(),U!==t?(ce=GE(),ce!==t?(Me=m,b=Y(N,U,ce),m=b):(Q=m,m=t)):(Q=m,m=t)):(Q=m,m=t)):(Q=m,m=t),m}function gge(){var m;return r.substr(Q,2)===pe?(m=pe,Q+=2):(m=t,I===0&&Qe(ie)),m===t&&(r.substr(Q,2)===de?(m=de,Q+=2):(m=t,I===0&&Qe(_e)),m===t&&(r.charCodeAt(Q)===62?(m=Pt,Q++):(m=t,I===0&&Qe(It)),m===t&&(r.substr(Q,3)===Or?(m=Or,Q+=3):(m=t,I===0&&Qe(ii)),m===t&&(r.substr(Q,2)===gi?(m=gi,Q+=2):(m=t,I===0&&Qe(hr)),m===t&&(r.charCodeAt(Q)===60?(m=fi,Q++):(m=t,I===0&&Qe(ni))))))),m}function GE(){var m,b,N;for(m=Q,b=[],N=He();N!==t;)b.push(N),N=He();return b!==t?(N=G1(),N!==t?(Me=m,b=Ae(N),m=b):(Q=m,m=t)):(Q=m,m=t),m}function G1(){var m,b,N;if(m=Q,b=[],N=Y1(),N!==t)for(;N!==t;)b.push(N),N=Y1();else b=t;return b!==t&&(Me=m,b=Os(b)),m=b,m}function Y1(){var m,b;return m=Q,b=fge(),b!==t&&(Me=m,b=pr(b)),m=b,m===t&&(m=Q,b=hge(),b!==t&&(Me=m,b=pr(b)),m=b,m===t&&(m=Q,b=pge(),b!==t&&(Me=m,b=pr(b)),m=b,m===t&&(m=Q,b=dge(),b!==t&&(Me=m,b=pr(b)),m=b))),m}function fge(){var m,b,N,U;return m=Q,r.substr(Q,2)===Ii?(b=Ii,Q+=2):(b=t,I===0&&Qe(es)),b!==t?(N=Ege(),N!==t?(r.charCodeAt(Q)===39?(U=ua,Q++):(U=t,I===0&&Qe(pA)),U!==t?(Me=m,b=ag(N),m=b):(Q=m,m=t)):(Q=m,m=t)):(Q=m,m=t),m}function hge(){var m,b,N,U;return m=Q,r.charCodeAt(Q)===39?(b=ua,Q++):(b=t,I===0&&Qe(pA)),b!==t?(N=Cge(),N!==t?(r.charCodeAt(Q)===39?(U=ua,Q++):(U=t,I===0&&Qe(pA)),U!==t?(Me=m,b=ag(N),m=b):(Q=m,m=t)):(Q=m,m=t)):(Q=m,m=t),m}function pge(){var m,b,N,U;if(m=Q,r.substr(Q,2)===ts?(b=ts,Q+=2):(b=t,I===0&&Qe(dA)),b!==t&&(Me=m,b=ga()),m=b,m===t)if(m=Q,r.charCodeAt(Q)===34?(b=yp,Q++):(b=t,I===0&&Qe(CA)),b!==t){for(N=[],U=j1();U!==t;)N.push(U),U=j1();N!==t?(r.charCodeAt(Q)===34?(U=yp,Q++):(U=t,I===0&&Qe(CA)),U!==t?(Me=m,b=mA(N),m=b):(Q=m,m=t)):(Q=m,m=t)}else Q=m,m=t;return m}function dge(){var m,b,N;if(m=Q,b=[],N=q1(),N!==t)for(;N!==t;)b.push(N),N=q1();else b=t;return b!==t&&(Me=m,b=mA(b)),m=b,m}function j1(){var m,b;return m=Q,b=V1(),b!==t&&(Me=m,b=wr(b)),m=b,m===t&&(m=Q,b=X1(),b!==t&&(Me=m,b=kl(b)),m=b,m===t&&(m=Q,b=oS(),b!==t&&(Me=m,b=Ag(b)),m=b,m===t&&(m=Q,b=mge(),b!==t&&(Me=m,b=Io(b)),m=b))),m}function q1(){var m,b;return m=Q,b=V1(),b!==t&&(Me=m,b=lg(b)),m=b,m===t&&(m=Q,b=X1(),b!==t&&(Me=m,b=wp(b)),m=b,m===t&&(m=Q,b=oS(),b!==t&&(Me=m,b=Bp(b)),m=b,m===t&&(m=Q,b=wge(),b!==t&&(Me=m,b=vr(b)),m=b,m===t&&(m=Q,b=yge(),b!==t&&(Me=m,b=Io(b)),m=b)))),m}function Cge(){var m,b,N;for(m=Q,b=[],se.test(r.charAt(Q))?(N=r.charAt(Q),Q++):(N=t,I===0&&Qe(yo));N!==t;)b.push(N),se.test(r.charAt(Q))?(N=r.charAt(Q),Q++):(N=t,I===0&&Qe(yo));return b!==t&&(Me=m,b=kn(b)),m=b,m}function mge(){var m,b,N;if(m=Q,b=[],N=J1(),N===t&&(cg.test(r.charAt(Q))?(N=r.charAt(Q),Q++):(N=t,I===0&&Qe(Qt))),N!==t)for(;N!==t;)b.push(N),N=J1(),N===t&&(cg.test(r.charAt(Q))?(N=r.charAt(Q),Q++):(N=t,I===0&&Qe(Qt)));else b=t;return b!==t&&(Me=m,b=kn(b)),m=b,m}function J1(){var m,b,N;return m=Q,r.substr(Q,2)===Rl?(b=Rl,Q+=2):(b=t,I===0&&Qe(Rn)),b!==t&&(Me=m,b=rs()),m=b,m===t&&(m=Q,r.charCodeAt(Q)===92?(b=is,Q++):(b=t,I===0&&Qe(gt)),b!==t?(wo.test(r.charAt(Q))?(N=r.charAt(Q),Q++):(N=t,I===0&&Qe(At)),N!==t?(Me=m,b=an(N),m=b):(Q=m,m=t)):(Q=m,m=t)),m}function Ege(){var m,b,N;for(m=Q,b=[],N=W1(),N===t&&(se.test(r.charAt(Q))?(N=r.charAt(Q),Q++):(N=t,I===0&&Qe(yo)));N!==t;)b.push(N),N=W1(),N===t&&(se.test(r.charAt(Q))?(N=r.charAt(Q),Q++):(N=t,I===0&&Qe(yo)));return b!==t&&(Me=m,b=kn(b)),m=b,m}function W1(){var m,b,N;return m=Q,r.substr(Q,2)===S?(b=S,Q+=2):(b=t,I===0&&Qe(Tt)),b!==t&&(Me=m,b=ug()),m=b,m===t&&(m=Q,r.substr(Q,2)===Fl?(b=Fl,Q+=2):(b=t,I===0&&Qe(Qp)),b!==t&&(Me=m,b=bp()),m=b,m===t&&(m=Q,r.charCodeAt(Q)===92?(b=is,Q++):(b=t,I===0&&Qe(gt)),b!==t?(Sp.test(r.charAt(Q))?(N=r.charAt(Q),Q++):(N=t,I===0&&Qe(vp)),N!==t?(Me=m,b=xp(),m=b):(Q=m,m=t)):(Q=m,m=t),m===t&&(m=Q,r.substr(Q,2)===G?(b=G,Q+=2):(b=t,I===0&&Qe(yt)),b!==t&&(Me=m,b=EA()),m=b,m===t&&(m=Q,r.substr(Q,2)===Ji?(b=Ji,Q+=2):(b=t,I===0&&Qe(Nl)),b!==t&&(Me=m,b=Xe()),m=b,m===t&&(m=Q,r.substr(Q,2)===fa?(b=fa,Q+=2):(b=t,I===0&&Qe(gg)),b!==t&&(Me=m,b=FE()),m=b,m===t&&(m=Q,r.substr(Q,2)===Pp?(b=Pp,Q+=2):(b=t,I===0&&Qe(NE)),b!==t&&(Me=m,b=ar()),m=b,m===t&&(m=Q,r.substr(Q,2)===Fn?(b=Fn,Q+=2):(b=t,I===0&&Qe(Ll)),b!==t&&(Me=m,b=Dp()),m=b,m===t&&(m=Q,r.charCodeAt(Q)===92?(b=is,Q++):(b=t,I===0&&Qe(gt)),b!==t?(Ms.test(r.charAt(Q))?(N=r.charAt(Q),Q++):(N=t,I===0&&Qe(ha)),N!==t?(Me=m,b=an(N),m=b):(Q=m,m=t)):(Q=m,m=t),m===t&&(m=Ige()))))))))),m}function Ige(){var m,b,N,U,ce,Se,ht,Bt,Jr,hi,ss,aS;return m=Q,r.charCodeAt(Q)===92?(b=is,Q++):(b=t,I===0&&Qe(gt)),b!==t?(N=iS(),N!==t?(Me=m,b=An(N),m=b):(Q=m,m=t)):(Q=m,m=t),m===t&&(m=Q,r.substr(Q,2)===Te?(b=Te,Q+=2):(b=t,I===0&&Qe(fg)),b!==t?(N=Q,U=Q,ce=iS(),ce!==t?(Se=Tn(),Se!==t?(ce=[ce,Se],U=ce):(Q=U,U=t)):(Q=U,U=t),U===t&&(U=iS()),U!==t?N=r.substring(N,Q):N=U,N!==t?(Me=m,b=An(N),m=b):(Q=m,m=t)):(Q=m,m=t),m===t&&(m=Q,r.substr(Q,2)===Tl?(b=Tl,Q+=2):(b=t,I===0&&Qe(Ks)),b!==t?(N=Q,U=Q,ce=Tn(),ce!==t?(Se=Tn(),Se!==t?(ht=Tn(),ht!==t?(Bt=Tn(),Bt!==t?(ce=[ce,Se,ht,Bt],U=ce):(Q=U,U=t)):(Q=U,U=t)):(Q=U,U=t)):(Q=U,U=t),U!==t?N=r.substring(N,Q):N=U,N!==t?(Me=m,b=An(N),m=b):(Q=m,m=t)):(Q=m,m=t),m===t&&(m=Q,r.substr(Q,2)===Ol?(b=Ol,Q+=2):(b=t,I===0&&Qe(IA)),b!==t?(N=Q,U=Q,ce=Tn(),ce!==t?(Se=Tn(),Se!==t?(ht=Tn(),ht!==t?(Bt=Tn(),Bt!==t?(Jr=Tn(),Jr!==t?(hi=Tn(),hi!==t?(ss=Tn(),ss!==t?(aS=Tn(),aS!==t?(ce=[ce,Se,ht,Bt,Jr,hi,ss,aS],U=ce):(Q=U,U=t)):(Q=U,U=t)):(Q=U,U=t)):(Q=U,U=t)):(Q=U,U=t)):(Q=U,U=t)):(Q=U,U=t)):(Q=U,U=t),U!==t?N=r.substring(N,Q):N=U,N!==t?(Me=m,b=hg(N),m=b):(Q=m,m=t)):(Q=m,m=t)))),m}function iS(){var m;return pg.test(r.charAt(Q))?(m=r.charAt(Q),Q++):(m=t,I===0&&Qe(pa)),m}function Tn(){var m;return da.test(r.charAt(Q))?(m=r.charAt(Q),Q++):(m=t,I===0&&Qe(rt)),m}function yge(){var m,b,N,U,ce;if(m=Q,b=[],N=Q,r.charCodeAt(Q)===92?(U=is,Q++):(U=t,I===0&&Qe(gt)),U!==t?(r.length>Q?(ce=r.charAt(Q),Q++):(ce=t,I===0&&Qe(Bo)),ce!==t?(Me=N,U=an(ce),N=U):(Q=N,N=t)):(Q=N,N=t),N===t&&(N=Q,U=Q,I++,ce=_1(),I--,ce===t?U=void 0:(Q=U,U=t),U!==t?(r.length>Q?(ce=r.charAt(Q),Q++):(ce=t,I===0&&Qe(Bo)),ce!==t?(Me=N,U=an(ce),N=U):(Q=N,N=t)):(Q=N,N=t)),N!==t)for(;N!==t;)b.push(N),N=Q,r.charCodeAt(Q)===92?(U=is,Q++):(U=t,I===0&&Qe(gt)),U!==t?(r.length>Q?(ce=r.charAt(Q),Q++):(ce=t,I===0&&Qe(Bo)),ce!==t?(Me=N,U=an(ce),N=U):(Q=N,N=t)):(Q=N,N=t),N===t&&(N=Q,U=Q,I++,ce=_1(),I--,ce===t?U=void 0:(Q=U,U=t),U!==t?(r.length>Q?(ce=r.charAt(Q),Q++):(ce=t,I===0&&Qe(Bo)),ce!==t?(Me=N,U=an(ce),N=U):(Q=N,N=t)):(Q=N,N=t));else b=t;return b!==t&&(Me=m,b=kn(b)),m=b,m}function nS(){var m,b,N,U,ce,Se;if(m=Q,r.charCodeAt(Q)===45?(b=yA,Q++):(b=t,I===0&&Qe(Ml)),b===t&&(r.charCodeAt(Q)===43?(b=Us,Q++):(b=t,I===0&&Qe(Kl))),b===t&&(b=null),b!==t){if(N=[],qe.test(r.charAt(Q))?(U=r.charAt(Q),Q++):(U=t,I===0&&Qe(ne)),U!==t)for(;U!==t;)N.push(U),qe.test(r.charAt(Q))?(U=r.charAt(Q),Q++):(U=t,I===0&&Qe(ne));else N=t;if(N!==t)if(r.charCodeAt(Q)===46?(U=LE,Q++):(U=t,I===0&&Qe(kp)),U!==t){if(ce=[],qe.test(r.charAt(Q))?(Se=r.charAt(Q),Q++):(Se=t,I===0&&Qe(ne)),Se!==t)for(;Se!==t;)ce.push(Se),qe.test(r.charAt(Q))?(Se=r.charAt(Q),Q++):(Se=t,I===0&&Qe(ne));else ce=t;ce!==t?(Me=m,b=dg(b,N,ce),m=b):(Q=m,m=t)}else Q=m,m=t;else Q=m,m=t}else Q=m,m=t;if(m===t){if(m=Q,r.charCodeAt(Q)===45?(b=yA,Q++):(b=t,I===0&&Qe(Ml)),b===t&&(r.charCodeAt(Q)===43?(b=Us,Q++):(b=t,I===0&&Qe(Kl))),b===t&&(b=null),b!==t){if(N=[],qe.test(r.charAt(Q))?(U=r.charAt(Q),Q++):(U=t,I===0&&Qe(ne)),U!==t)for(;U!==t;)N.push(U),qe.test(r.charAt(Q))?(U=r.charAt(Q),Q++):(U=t,I===0&&Qe(ne));else N=t;N!==t?(Me=m,b=Rp(b,N),m=b):(Q=m,m=t)}else Q=m,m=t;if(m===t&&(m=Q,b=oS(),b!==t&&(Me=m,b=TE(b)),m=b,m===t&&(m=Q,b=Hl(),b!==t&&(Me=m,b=Ul(b)),m=b,m===t)))if(m=Q,r.charCodeAt(Q)===40?(b=ge,Q++):(b=t,I===0&&Qe(re)),b!==t){for(N=[],U=He();U!==t;)N.push(U),U=He();if(N!==t)if(U=z1(),U!==t){for(ce=[],Se=He();Se!==t;)ce.push(Se),Se=He();ce!==t?(r.charCodeAt(Q)===41?(Se=O,Q++):(Se=t,I===0&&Qe(F)),Se!==t?(Me=m,b=OE(U),m=b):(Q=m,m=t)):(Q=m,m=t)}else Q=m,m=t;else Q=m,m=t}else Q=m,m=t}return m}function sS(){var m,b,N,U,ce,Se,ht,Bt;if(m=Q,b=nS(),b!==t){for(N=[],U=Q,ce=[],Se=He();Se!==t;)ce.push(Se),Se=He();if(ce!==t)if(r.charCodeAt(Q)===42?(Se=Cg,Q++):(Se=t,I===0&&Qe(wA)),Se===t&&(r.charCodeAt(Q)===47?(Se=Rr,Q++):(Se=t,I===0&&Qe(ME))),Se!==t){for(ht=[],Bt=He();Bt!==t;)ht.push(Bt),Bt=He();ht!==t?(Bt=nS(),Bt!==t?(Me=U,ce=Hs(b,Se,Bt),U=ce):(Q=U,U=t)):(Q=U,U=t)}else Q=U,U=t;else Q=U,U=t;for(;U!==t;){for(N.push(U),U=Q,ce=[],Se=He();Se!==t;)ce.push(Se),Se=He();if(ce!==t)if(r.charCodeAt(Q)===42?(Se=Cg,Q++):(Se=t,I===0&&Qe(wA)),Se===t&&(r.charCodeAt(Q)===47?(Se=Rr,Q++):(Se=t,I===0&&Qe(ME))),Se!==t){for(ht=[],Bt=He();Bt!==t;)ht.push(Bt),Bt=He();ht!==t?(Bt=nS(),Bt!==t?(Me=U,ce=Hs(b,Se,Bt),U=ce):(Q=U,U=t)):(Q=U,U=t)}else Q=U,U=t;else Q=U,U=t}N!==t?(Me=m,b=Gs(b,N),m=b):(Q=m,m=t)}else Q=m,m=t;return m}function z1(){var m,b,N,U,ce,Se,ht,Bt;if(m=Q,b=sS(),b!==t){for(N=[],U=Q,ce=[],Se=He();Se!==t;)ce.push(Se),Se=He();if(ce!==t)if(r.charCodeAt(Q)===43?(Se=Us,Q++):(Se=t,I===0&&Qe(Kl)),Se===t&&(r.charCodeAt(Q)===45?(Se=yA,Q++):(Se=t,I===0&&Qe(Ml))),Se!==t){for(ht=[],Bt=He();Bt!==t;)ht.push(Bt),Bt=He();ht!==t?(Bt=sS(),Bt!==t?(Me=U,ce=mg(b,Se,Bt),U=ce):(Q=U,U=t)):(Q=U,U=t)}else Q=U,U=t;else Q=U,U=t;for(;U!==t;){for(N.push(U),U=Q,ce=[],Se=He();Se!==t;)ce.push(Se),Se=He();if(ce!==t)if(r.charCodeAt(Q)===43?(Se=Us,Q++):(Se=t,I===0&&Qe(Kl)),Se===t&&(r.charCodeAt(Q)===45?(Se=yA,Q++):(Se=t,I===0&&Qe(Ml))),Se!==t){for(ht=[],Bt=He();Bt!==t;)ht.push(Bt),Bt=He();ht!==t?(Bt=sS(),Bt!==t?(Me=U,ce=mg(b,Se,Bt),U=ce):(Q=U,U=t)):(Q=U,U=t)}else Q=U,U=t;else Q=U,U=t}N!==t?(Me=m,b=Gs(b,N),m=b):(Q=m,m=t)}else Q=m,m=t;return m}function V1(){var m,b,N,U,ce,Se;if(m=Q,r.substr(Q,3)===BA?(b=BA,Q+=3):(b=t,I===0&&Qe(R)),b!==t){for(N=[],U=He();U!==t;)N.push(U),U=He();if(N!==t)if(U=z1(),U!==t){for(ce=[],Se=He();Se!==t;)ce.push(Se),Se=He();ce!==t?(r.substr(Q,2)===q?(Se=q,Q+=2):(Se=t,I===0&&Qe(Ce)),Se!==t?(Me=m,b=Ke(U),m=b):(Q=m,m=t)):(Q=m,m=t)}else Q=m,m=t;else Q=m,m=t}else Q=m,m=t;return m}function X1(){var m,b,N,U;return m=Q,r.substr(Q,2)===Re?(b=Re,Q+=2):(b=t,I===0&&Qe(ze)),b!==t?(N=Mr(),N!==t?(r.charCodeAt(Q)===41?(U=O,Q++):(U=t,I===0&&Qe(F)),U!==t?(Me=m,b=dt(N),m=b):(Q=m,m=t)):(Q=m,m=t)):(Q=m,m=t),m}function oS(){var m,b,N,U,ce,Se;return m=Q,r.substr(Q,2)===Ft?(b=Ft,Q+=2):(b=t,I===0&&Qe(Nn)),b!==t?(N=Hl(),N!==t?(r.substr(Q,2)===qb?(U=qb,Q+=2):(U=t,I===0&&Qe(S1)),U!==t?(ce=U1(),ce!==t?(r.charCodeAt(Q)===125?(Se=Fe,Q++):(Se=t,I===0&&Qe(Ne)),Se!==t?(Me=m,b=v1(N,ce),m=b):(Q=m,m=t)):(Q=m,m=t)):(Q=m,m=t)):(Q=m,m=t)):(Q=m,m=t),m===t&&(m=Q,r.substr(Q,2)===Ft?(b=Ft,Q+=2):(b=t,I===0&&Qe(Nn)),b!==t?(N=Hl(),N!==t?(r.substr(Q,3)===Jb?(U=Jb,Q+=3):(U=t,I===0&&Qe(x1)),U!==t?(Me=m,b=P1(N),m=b):(Q=m,m=t)):(Q=m,m=t)):(Q=m,m=t),m===t&&(m=Q,r.substr(Q,2)===Ft?(b=Ft,Q+=2):(b=t,I===0&&Qe(Nn)),b!==t?(N=Hl(),N!==t?(r.substr(Q,2)===Wb?(U=Wb,Q+=2):(U=t,I===0&&Qe(D1)),U!==t?(ce=U1(),ce!==t?(r.charCodeAt(Q)===125?(Se=Fe,Q++):(Se=t,I===0&&Qe(Ne)),Se!==t?(Me=m,b=k1(N,ce),m=b):(Q=m,m=t)):(Q=m,m=t)):(Q=m,m=t)):(Q=m,m=t)):(Q=m,m=t),m===t&&(m=Q,r.substr(Q,2)===Ft?(b=Ft,Q+=2):(b=t,I===0&&Qe(Nn)),b!==t?(N=Hl(),N!==t?(r.substr(Q,3)===zb?(U=zb,Q+=3):(U=t,I===0&&Qe(R1)),U!==t?(Me=m,b=F1(N),m=b):(Q=m,m=t)):(Q=m,m=t)):(Q=m,m=t),m===t&&(m=Q,r.substr(Q,2)===Ft?(b=Ft,Q+=2):(b=t,I===0&&Qe(Nn)),b!==t?(N=Hl(),N!==t?(r.charCodeAt(Q)===125?(U=Fe,Q++):(U=t,I===0&&Qe(Ne)),U!==t?(Me=m,b=Vb(N),m=b):(Q=m,m=t)):(Q=m,m=t)):(Q=m,m=t),m===t&&(m=Q,r.charCodeAt(Q)===36?(b=N1,Q++):(b=t,I===0&&Qe(L1)),b!==t?(N=Hl(),N!==t?(Me=m,b=Vb(N),m=b):(Q=m,m=t)):(Q=m,m=t)))))),m}function wge(){var m,b,N;return m=Q,b=Bge(),b!==t?(Me=Q,N=T1(b),N?N=void 0:N=t,N!==t?(Me=m,b=O1(b),m=b):(Q=m,m=t)):(Q=m,m=t),m}function Bge(){var m,b,N,U,ce;if(m=Q,b=[],N=Q,U=Q,I++,ce=$1(),I--,ce===t?U=void 0:(Q=U,U=t),U!==t?(r.length>Q?(ce=r.charAt(Q),Q++):(ce=t,I===0&&Qe(Bo)),ce!==t?(Me=N,U=an(ce),N=U):(Q=N,N=t)):(Q=N,N=t),N!==t)for(;N!==t;)b.push(N),N=Q,U=Q,I++,ce=$1(),I--,ce===t?U=void 0:(Q=U,U=t),U!==t?(r.length>Q?(ce=r.charAt(Q),Q++):(ce=t,I===0&&Qe(Bo)),ce!==t?(Me=N,U=an(ce),N=U):(Q=N,N=t)):(Q=N,N=t);else b=t;return b!==t&&(Me=m,b=kn(b)),m=b,m}function Z1(){var m,b,N;if(m=Q,b=[],Xb.test(r.charAt(Q))?(N=r.charAt(Q),Q++):(N=t,I===0&&Qe(Zb)),N!==t)for(;N!==t;)b.push(N),Xb.test(r.charAt(Q))?(N=r.charAt(Q),Q++):(N=t,I===0&&Qe(Zb));else b=t;return b!==t&&(Me=m,b=_b()),m=b,m}function Hl(){var m,b,N;if(m=Q,b=[],$b.test(r.charAt(Q))?(N=r.charAt(Q),Q++):(N=t,I===0&&Qe(eS)),N!==t)for(;N!==t;)b.push(N),$b.test(r.charAt(Q))?(N=r.charAt(Q),Q++):(N=t,I===0&&Qe(eS));else b=t;return b!==t&&(Me=m,b=_b()),m=b,m}function _1(){var m;return M1.test(r.charAt(Q))?(m=r.charAt(Q),Q++):(m=t,I===0&&Qe(Eg)),m}function $1(){var m;return tS.test(r.charAt(Q))?(m=r.charAt(Q),Q++):(m=t,I===0&&Qe(rS)),m}function He(){var m,b;if(m=[],KE.test(r.charAt(Q))?(b=r.charAt(Q),Q++):(b=t,I===0&&Qe(UE)),b!==t)for(;b!==t;)m.push(b),KE.test(r.charAt(Q))?(b=r.charAt(Q),Q++):(b=t,I===0&&Qe(UE));else m=t;return m}if(k=n(),k!==t&&Q===r.length)return k;throw k!==t&&Q{"use strict";function Qfe(r,e){function t(){this.constructor=r}t.prototype=e.prototype,r.prototype=new t}function Vl(r,e,t,i){this.message=r,this.expected=e,this.found=t,this.location=i,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Vl)}Qfe(Vl,Error);Vl.buildMessage=function(r,e){var t={literal:function(c){return'"'+n(c.text)+'"'},class:function(c){var u="",g;for(g=0;g0){for(g=1,f=1;gH&&(H=v,j=[]),j.push(ne))}function Ne(ne,Y){return new Vl(ne,null,null,Y)}function oe(ne,Y,pe){return new Vl(Vl.buildMessage(ne,Y),ne,Y,pe)}function le(){var ne,Y,pe,ie;return ne=v,Y=we(),Y!==t?(r.charCodeAt(v)===47?(pe=s,v++):(pe=t,$===0&&Fe(o)),pe!==t?(ie=we(),ie!==t?(D=ne,Y=a(Y,ie),ne=Y):(v=ne,ne=t)):(v=ne,ne=t)):(v=ne,ne=t),ne===t&&(ne=v,Y=we(),Y!==t&&(D=ne,Y=l(Y)),ne=Y),ne}function we(){var ne,Y,pe,ie;return ne=v,Y=fe(),Y!==t?(r.charCodeAt(v)===64?(pe=c,v++):(pe=t,$===0&&Fe(u)),pe!==t?(ie=qe(),ie!==t?(D=ne,Y=g(Y,ie),ne=Y):(v=ne,ne=t)):(v=ne,ne=t)):(v=ne,ne=t),ne===t&&(ne=v,Y=fe(),Y!==t&&(D=ne,Y=f(Y)),ne=Y),ne}function fe(){var ne,Y,pe,ie,de;return ne=v,r.charCodeAt(v)===64?(Y=c,v++):(Y=t,$===0&&Fe(u)),Y!==t?(pe=Ae(),pe!==t?(r.charCodeAt(v)===47?(ie=s,v++):(ie=t,$===0&&Fe(o)),ie!==t?(de=Ae(),de!==t?(D=ne,Y=h(),ne=Y):(v=ne,ne=t)):(v=ne,ne=t)):(v=ne,ne=t)):(v=ne,ne=t),ne===t&&(ne=v,Y=Ae(),Y!==t&&(D=ne,Y=h()),ne=Y),ne}function Ae(){var ne,Y,pe;if(ne=v,Y=[],p.test(r.charAt(v))?(pe=r.charAt(v),v++):(pe=t,$===0&&Fe(C)),pe!==t)for(;pe!==t;)Y.push(pe),p.test(r.charAt(v))?(pe=r.charAt(v),v++):(pe=t,$===0&&Fe(C));else Y=t;return Y!==t&&(D=ne,Y=h()),ne=Y,ne}function qe(){var ne,Y,pe;if(ne=v,Y=[],y.test(r.charAt(v))?(pe=r.charAt(v),v++):(pe=t,$===0&&Fe(B)),pe!==t)for(;pe!==t;)Y.push(pe),y.test(r.charAt(v))?(pe=r.charAt(v),v++):(pe=t,$===0&&Fe(B));else Y=t;return Y!==t&&(D=ne,Y=h()),ne=Y,ne}if(V=n(),V!==t&&v===r.length)return V;throw V!==t&&v{"use strict";function fU(r){return typeof r>"u"||r===null}function Sfe(r){return typeof r=="object"&&r!==null}function vfe(r){return Array.isArray(r)?r:fU(r)?[]:[r]}function xfe(r,e){var t,i,n,s;if(e)for(s=Object.keys(e),t=0,i=s.length;t{"use strict";function Wp(r,e){Error.call(this),this.name="YAMLException",this.reason=r,this.mark=e,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():""),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Wp.prototype=Object.create(Error.prototype);Wp.prototype.constructor=Wp;Wp.prototype.toString=function(e){var t=this.name+": ";return t+=this.reason||"(unknown reason)",!e&&this.mark&&(t+=" "+this.mark.toString()),t};hU.exports=Wp});var CU=w((IZe,dU)=>{"use strict";var pU=Zl();function HS(r,e,t,i,n){this.name=r,this.buffer=e,this.position=t,this.line=i,this.column=n}HS.prototype.getSnippet=function(e,t){var i,n,s,o,a;if(!this.buffer)return null;for(e=e||4,t=t||75,i="",n=this.position;n>0&&`\0\r +\x85\u2028\u2029`.indexOf(this.buffer.charAt(n-1))===-1;)if(n-=1,this.position-n>t/2-1){i=" ... ",n+=5;break}for(s="",o=this.position;ot/2-1){s=" ... ",o-=5;break}return a=this.buffer.slice(n,o),pU.repeat(" ",e)+i+a+s+` +`+pU.repeat(" ",e+this.position-n+i.length)+"^"};HS.prototype.toString=function(e){var t,i="";return this.name&&(i+='in "'+this.name+'" '),i+="at line "+(this.line+1)+", column "+(this.column+1),e||(t=this.getSnippet(),t&&(i+=`: +`+t)),i};dU.exports=HS});var si=w((yZe,EU)=>{"use strict";var mU=kg(),kfe=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],Rfe=["scalar","sequence","mapping"];function Ffe(r){var e={};return r!==null&&Object.keys(r).forEach(function(t){r[t].forEach(function(i){e[String(i)]=t})}),e}function Nfe(r,e){if(e=e||{},Object.keys(e).forEach(function(t){if(kfe.indexOf(t)===-1)throw new mU('Unknown option "'+t+'" is met in definition of "'+r+'" YAML type.')}),this.tag=r,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(t){return t},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.defaultStyle=e.defaultStyle||null,this.styleAliases=Ffe(e.styleAliases||null),Rfe.indexOf(this.kind)===-1)throw new mU('Unknown kind "'+this.kind+'" is specified for "'+r+'" YAML type.')}EU.exports=Nfe});var _l=w((wZe,yU)=>{"use strict";var IU=Zl(),gI=kg(),Lfe=si();function GS(r,e,t){var i=[];return r.include.forEach(function(n){t=GS(n,e,t)}),r[e].forEach(function(n){t.forEach(function(s,o){s.tag===n.tag&&s.kind===n.kind&&i.push(o)}),t.push(n)}),t.filter(function(n,s){return i.indexOf(s)===-1})}function Tfe(){var r={scalar:{},sequence:{},mapping:{},fallback:{}},e,t;function i(n){r[n.kind][n.tag]=r.fallback[n.tag]=n}for(e=0,t=arguments.length;e{"use strict";var Ofe=si();wU.exports=new Ofe("tag:yaml.org,2002:str",{kind:"scalar",construct:function(r){return r!==null?r:""}})});var bU=w((QZe,QU)=>{"use strict";var Mfe=si();QU.exports=new Mfe("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(r){return r!==null?r:[]}})});var vU=w((bZe,SU)=>{"use strict";var Kfe=si();SU.exports=new Kfe("tag:yaml.org,2002:map",{kind:"mapping",construct:function(r){return r!==null?r:{}}})});var fI=w((SZe,xU)=>{"use strict";var Ufe=_l();xU.exports=new Ufe({explicit:[BU(),bU(),vU()]})});var DU=w((vZe,PU)=>{"use strict";var Hfe=si();function Gfe(r){if(r===null)return!0;var e=r.length;return e===1&&r==="~"||e===4&&(r==="null"||r==="Null"||r==="NULL")}function Yfe(){return null}function jfe(r){return r===null}PU.exports=new Hfe("tag:yaml.org,2002:null",{kind:"scalar",resolve:Gfe,construct:Yfe,predicate:jfe,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})});var RU=w((xZe,kU)=>{"use strict";var qfe=si();function Jfe(r){if(r===null)return!1;var e=r.length;return e===4&&(r==="true"||r==="True"||r==="TRUE")||e===5&&(r==="false"||r==="False"||r==="FALSE")}function Wfe(r){return r==="true"||r==="True"||r==="TRUE"}function zfe(r){return Object.prototype.toString.call(r)==="[object Boolean]"}kU.exports=new qfe("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Jfe,construct:Wfe,predicate:zfe,represent:{lowercase:function(r){return r?"true":"false"},uppercase:function(r){return r?"TRUE":"FALSE"},camelcase:function(r){return r?"True":"False"}},defaultStyle:"lowercase"})});var NU=w((PZe,FU)=>{"use strict";var Vfe=Zl(),Xfe=si();function Zfe(r){return 48<=r&&r<=57||65<=r&&r<=70||97<=r&&r<=102}function _fe(r){return 48<=r&&r<=55}function $fe(r){return 48<=r&&r<=57}function ehe(r){if(r===null)return!1;var e=r.length,t=0,i=!1,n;if(!e)return!1;if(n=r[t],(n==="-"||n==="+")&&(n=r[++t]),n==="0"){if(t+1===e)return!0;if(n=r[++t],n==="b"){for(t++;t=0?"0b"+r.toString(2):"-0b"+r.toString(2).slice(1)},octal:function(r){return r>=0?"0"+r.toString(8):"-0"+r.toString(8).slice(1)},decimal:function(r){return r.toString(10)},hexadecimal:function(r){return r>=0?"0x"+r.toString(16).toUpperCase():"-0x"+r.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})});var OU=w((DZe,TU)=>{"use strict";var LU=Zl(),ihe=si(),nhe=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function she(r){return!(r===null||!nhe.test(r)||r[r.length-1]==="_")}function ohe(r){var e,t,i,n;return e=r.replace(/_/g,"").toLowerCase(),t=e[0]==="-"?-1:1,n=[],"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?t===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:e.indexOf(":")>=0?(e.split(":").forEach(function(s){n.unshift(parseFloat(s,10))}),e=0,i=1,n.forEach(function(s){e+=s*i,i*=60}),t*e):t*parseFloat(e,10)}var ahe=/^[-+]?[0-9]+e/;function Ahe(r,e){var t;if(isNaN(r))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===r)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===r)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(LU.isNegativeZero(r))return"-0.0";return t=r.toString(10),ahe.test(t)?t.replace("e",".e"):t}function lhe(r){return Object.prototype.toString.call(r)==="[object Number]"&&(r%1!==0||LU.isNegativeZero(r))}TU.exports=new ihe("tag:yaml.org,2002:float",{kind:"scalar",resolve:she,construct:ohe,predicate:lhe,represent:Ahe,defaultStyle:"lowercase"})});var YS=w((kZe,MU)=>{"use strict";var che=_l();MU.exports=new che({include:[fI()],implicit:[DU(),RU(),NU(),OU()]})});var jS=w((RZe,KU)=>{"use strict";var uhe=_l();KU.exports=new uhe({include:[YS()]})});var YU=w((FZe,GU)=>{"use strict";var ghe=si(),UU=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),HU=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function fhe(r){return r===null?!1:UU.exec(r)!==null||HU.exec(r)!==null}function hhe(r){var e,t,i,n,s,o,a,l=0,c=null,u,g,f;if(e=UU.exec(r),e===null&&(e=HU.exec(r)),e===null)throw new Error("Date resolve error");if(t=+e[1],i=+e[2]-1,n=+e[3],!e[4])return new Date(Date.UTC(t,i,n));if(s=+e[4],o=+e[5],a=+e[6],e[7]){for(l=e[7].slice(0,3);l.length<3;)l+="0";l=+l}return e[9]&&(u=+e[10],g=+(e[11]||0),c=(u*60+g)*6e4,e[9]==="-"&&(c=-c)),f=new Date(Date.UTC(t,i,n,s,o,a,l)),c&&f.setTime(f.getTime()-c),f}function phe(r){return r.toISOString()}GU.exports=new ghe("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:fhe,construct:hhe,instanceOf:Date,represent:phe})});var qU=w((NZe,jU)=>{"use strict";var dhe=si();function Che(r){return r==="<<"||r===null}jU.exports=new dhe("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Che})});var zU=w((LZe,WU)=>{"use strict";var $l;try{JU=J,$l=JU("buffer").Buffer}catch{}var JU,mhe=si(),qS=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= +\r`;function Ehe(r){if(r===null)return!1;var e,t,i=0,n=r.length,s=qS;for(t=0;t64)){if(e<0)return!1;i+=6}return i%8===0}function Ihe(r){var e,t,i=r.replace(/[\r\n=]/g,""),n=i.length,s=qS,o=0,a=[];for(e=0;e>16&255),a.push(o>>8&255),a.push(o&255)),o=o<<6|s.indexOf(i.charAt(e));return t=n%4*6,t===0?(a.push(o>>16&255),a.push(o>>8&255),a.push(o&255)):t===18?(a.push(o>>10&255),a.push(o>>2&255)):t===12&&a.push(o>>4&255),$l?$l.from?$l.from(a):new $l(a):a}function yhe(r){var e="",t=0,i,n,s=r.length,o=qS;for(i=0;i>18&63],e+=o[t>>12&63],e+=o[t>>6&63],e+=o[t&63]),t=(t<<8)+r[i];return n=s%3,n===0?(e+=o[t>>18&63],e+=o[t>>12&63],e+=o[t>>6&63],e+=o[t&63]):n===2?(e+=o[t>>10&63],e+=o[t>>4&63],e+=o[t<<2&63],e+=o[64]):n===1&&(e+=o[t>>2&63],e+=o[t<<4&63],e+=o[64],e+=o[64]),e}function whe(r){return $l&&$l.isBuffer(r)}WU.exports=new mhe("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Ehe,construct:Ihe,predicate:whe,represent:yhe})});var XU=w((TZe,VU)=>{"use strict";var Bhe=si(),Qhe=Object.prototype.hasOwnProperty,bhe=Object.prototype.toString;function She(r){if(r===null)return!0;var e=[],t,i,n,s,o,a=r;for(t=0,i=a.length;t{"use strict";var xhe=si(),Phe=Object.prototype.toString;function Dhe(r){if(r===null)return!0;var e,t,i,n,s,o=r;for(s=new Array(o.length),e=0,t=o.length;e{"use strict";var Rhe=si(),Fhe=Object.prototype.hasOwnProperty;function Nhe(r){if(r===null)return!0;var e,t=r;for(e in t)if(Fhe.call(t,e)&&t[e]!==null)return!1;return!0}function Lhe(r){return r!==null?r:{}}$U.exports=new Rhe("tag:yaml.org,2002:set",{kind:"mapping",resolve:Nhe,construct:Lhe})});var Fg=w((KZe,t2)=>{"use strict";var The=_l();t2.exports=new The({include:[jS()],implicit:[YU(),qU()],explicit:[zU(),XU(),_U(),e2()]})});var i2=w((UZe,r2)=>{"use strict";var Ohe=si();function Mhe(){return!0}function Khe(){}function Uhe(){return""}function Hhe(r){return typeof r>"u"}r2.exports=new Ohe("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:Mhe,construct:Khe,predicate:Hhe,represent:Uhe})});var s2=w((HZe,n2)=>{"use strict";var Ghe=si();function Yhe(r){if(r===null||r.length===0)return!1;var e=r,t=/\/([gim]*)$/.exec(r),i="";return!(e[0]==="/"&&(t&&(i=t[1]),i.length>3||e[e.length-i.length-1]!=="/"))}function jhe(r){var e=r,t=/\/([gim]*)$/.exec(r),i="";return e[0]==="/"&&(t&&(i=t[1]),e=e.slice(1,e.length-i.length-1)),new RegExp(e,i)}function qhe(r){var e="/"+r.source+"/";return r.global&&(e+="g"),r.multiline&&(e+="m"),r.ignoreCase&&(e+="i"),e}function Jhe(r){return Object.prototype.toString.call(r)==="[object RegExp]"}n2.exports=new Ghe("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:Yhe,construct:jhe,predicate:Jhe,represent:qhe})});var A2=w((GZe,a2)=>{"use strict";var hI;try{o2=J,hI=o2("esprima")}catch{typeof window<"u"&&(hI=window.esprima)}var o2,Whe=si();function zhe(r){if(r===null)return!1;try{var e="("+r+")",t=hI.parse(e,{range:!0});return!(t.type!=="Program"||t.body.length!==1||t.body[0].type!=="ExpressionStatement"||t.body[0].expression.type!=="ArrowFunctionExpression"&&t.body[0].expression.type!=="FunctionExpression")}catch{return!1}}function Vhe(r){var e="("+r+")",t=hI.parse(e,{range:!0}),i=[],n;if(t.type!=="Program"||t.body.length!==1||t.body[0].type!=="ExpressionStatement"||t.body[0].expression.type!=="ArrowFunctionExpression"&&t.body[0].expression.type!=="FunctionExpression")throw new Error("Failed to resolve function");return t.body[0].expression.params.forEach(function(s){i.push(s.name)}),n=t.body[0].expression.body.range,t.body[0].expression.body.type==="BlockStatement"?new Function(i,e.slice(n[0]+1,n[1]-1)):new Function(i,"return "+e.slice(n[0],n[1]))}function Xhe(r){return r.toString()}function Zhe(r){return Object.prototype.toString.call(r)==="[object Function]"}a2.exports=new Whe("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:zhe,construct:Vhe,predicate:Zhe,represent:Xhe})});var zp=w((YZe,c2)=>{"use strict";var l2=_l();c2.exports=l2.DEFAULT=new l2({include:[Fg()],explicit:[i2(),s2(),A2()]})});var P2=w((jZe,Vp)=>{"use strict";var ya=Zl(),C2=kg(),_he=CU(),m2=Fg(),$he=zp(),DA=Object.prototype.hasOwnProperty,pI=1,E2=2,I2=3,dI=4,JS=1,epe=2,u2=3,tpe=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,rpe=/[\x85\u2028\u2029]/,ipe=/[,\[\]\{\}]/,y2=/^(?:!|!!|![a-z\-]+!)$/i,w2=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function g2(r){return Object.prototype.toString.call(r)}function vo(r){return r===10||r===13}function tc(r){return r===9||r===32}function un(r){return r===9||r===32||r===10||r===13}function Ng(r){return r===44||r===91||r===93||r===123||r===125}function npe(r){var e;return 48<=r&&r<=57?r-48:(e=r|32,97<=e&&e<=102?e-97+10:-1)}function spe(r){return r===120?2:r===117?4:r===85?8:0}function ope(r){return 48<=r&&r<=57?r-48:-1}function f2(r){return r===48?"\0":r===97?"\x07":r===98?"\b":r===116||r===9?" ":r===110?` +`:r===118?"\v":r===102?"\f":r===114?"\r":r===101?"\x1B":r===32?" ":r===34?'"':r===47?"/":r===92?"\\":r===78?"\x85":r===95?"\xA0":r===76?"\u2028":r===80?"\u2029":""}function ape(r){return r<=65535?String.fromCharCode(r):String.fromCharCode((r-65536>>10)+55296,(r-65536&1023)+56320)}var B2=new Array(256),Q2=new Array(256);for(ec=0;ec<256;ec++)B2[ec]=f2(ec)?1:0,Q2[ec]=f2(ec);var ec;function Ape(r,e){this.input=r,this.filename=e.filename||null,this.schema=e.schema||$he,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=r.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function b2(r,e){return new C2(e,new _he(r.filename,r.input,r.position,r.line,r.position-r.lineStart))}function ft(r,e){throw b2(r,e)}function CI(r,e){r.onWarning&&r.onWarning.call(null,b2(r,e))}var h2={YAML:function(e,t,i){var n,s,o;e.version!==null&&ft(e,"duplication of %YAML directive"),i.length!==1&&ft(e,"YAML directive accepts exactly one argument"),n=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),n===null&&ft(e,"ill-formed argument of the YAML directive"),s=parseInt(n[1],10),o=parseInt(n[2],10),s!==1&&ft(e,"unacceptable YAML version of the document"),e.version=i[0],e.checkLineBreaks=o<2,o!==1&&o!==2&&CI(e,"unsupported YAML version of the document")},TAG:function(e,t,i){var n,s;i.length!==2&&ft(e,"TAG directive accepts exactly two arguments"),n=i[0],s=i[1],y2.test(n)||ft(e,"ill-formed tag handle (first argument) of the TAG directive"),DA.call(e.tagMap,n)&&ft(e,'there is a previously declared suffix for "'+n+'" tag handle'),w2.test(s)||ft(e,"ill-formed tag prefix (second argument) of the TAG directive"),e.tagMap[n]=s}};function PA(r,e,t,i){var n,s,o,a;if(e1&&(r.result+=ya.repeat(` +`,e-1))}function lpe(r,e,t){var i,n,s,o,a,l,c,u,g=r.kind,f=r.result,h;if(h=r.input.charCodeAt(r.position),un(h)||Ng(h)||h===35||h===38||h===42||h===33||h===124||h===62||h===39||h===34||h===37||h===64||h===96||(h===63||h===45)&&(n=r.input.charCodeAt(r.position+1),un(n)||t&&Ng(n)))return!1;for(r.kind="scalar",r.result="",s=o=r.position,a=!1;h!==0;){if(h===58){if(n=r.input.charCodeAt(r.position+1),un(n)||t&&Ng(n))break}else if(h===35){if(i=r.input.charCodeAt(r.position-1),un(i))break}else{if(r.position===r.lineStart&&mI(r)||t&&Ng(h))break;if(vo(h))if(l=r.line,c=r.lineStart,u=r.lineIndent,zr(r,!1,-1),r.lineIndent>=e){a=!0,h=r.input.charCodeAt(r.position);continue}else{r.position=o,r.line=l,r.lineStart=c,r.lineIndent=u;break}}a&&(PA(r,s,o,!1),zS(r,r.line-l),s=o=r.position,a=!1),tc(h)||(o=r.position+1),h=r.input.charCodeAt(++r.position)}return PA(r,s,o,!1),r.result?!0:(r.kind=g,r.result=f,!1)}function cpe(r,e){var t,i,n;if(t=r.input.charCodeAt(r.position),t!==39)return!1;for(r.kind="scalar",r.result="",r.position++,i=n=r.position;(t=r.input.charCodeAt(r.position))!==0;)if(t===39)if(PA(r,i,r.position,!0),t=r.input.charCodeAt(++r.position),t===39)i=r.position,r.position++,n=r.position;else return!0;else vo(t)?(PA(r,i,n,!0),zS(r,zr(r,!1,e)),i=n=r.position):r.position===r.lineStart&&mI(r)?ft(r,"unexpected end of the document within a single quoted scalar"):(r.position++,n=r.position);ft(r,"unexpected end of the stream within a single quoted scalar")}function upe(r,e){var t,i,n,s,o,a;if(a=r.input.charCodeAt(r.position),a!==34)return!1;for(r.kind="scalar",r.result="",r.position++,t=i=r.position;(a=r.input.charCodeAt(r.position))!==0;){if(a===34)return PA(r,t,r.position,!0),r.position++,!0;if(a===92){if(PA(r,t,r.position,!0),a=r.input.charCodeAt(++r.position),vo(a))zr(r,!1,e);else if(a<256&&B2[a])r.result+=Q2[a],r.position++;else if((o=spe(a))>0){for(n=o,s=0;n>0;n--)a=r.input.charCodeAt(++r.position),(o=npe(a))>=0?s=(s<<4)+o:ft(r,"expected hexadecimal character");r.result+=ape(s),r.position++}else ft(r,"unknown escape sequence");t=i=r.position}else vo(a)?(PA(r,t,i,!0),zS(r,zr(r,!1,e)),t=i=r.position):r.position===r.lineStart&&mI(r)?ft(r,"unexpected end of the document within a double quoted scalar"):(r.position++,i=r.position)}ft(r,"unexpected end of the stream within a double quoted scalar")}function gpe(r,e){var t=!0,i,n=r.tag,s,o=r.anchor,a,l,c,u,g,f={},h,p,C,y;if(y=r.input.charCodeAt(r.position),y===91)l=93,g=!1,s=[];else if(y===123)l=125,g=!0,s={};else return!1;for(r.anchor!==null&&(r.anchorMap[r.anchor]=s),y=r.input.charCodeAt(++r.position);y!==0;){if(zr(r,!0,e),y=r.input.charCodeAt(r.position),y===l)return r.position++,r.tag=n,r.anchor=o,r.kind=g?"mapping":"sequence",r.result=s,!0;t||ft(r,"missed comma between flow collection entries"),p=h=C=null,c=u=!1,y===63&&(a=r.input.charCodeAt(r.position+1),un(a)&&(c=u=!0,r.position++,zr(r,!0,e))),i=r.line,Tg(r,e,pI,!1,!0),p=r.tag,h=r.result,zr(r,!0,e),y=r.input.charCodeAt(r.position),(u||r.line===i)&&y===58&&(c=!0,y=r.input.charCodeAt(++r.position),zr(r,!0,e),Tg(r,e,pI,!1,!0),C=r.result),g?Lg(r,s,f,p,h,C):c?s.push(Lg(r,null,f,p,h,C)):s.push(h),zr(r,!0,e),y=r.input.charCodeAt(r.position),y===44?(t=!0,y=r.input.charCodeAt(++r.position)):t=!1}ft(r,"unexpected end of the stream within a flow collection")}function fpe(r,e){var t,i,n=JS,s=!1,o=!1,a=e,l=0,c=!1,u,g;if(g=r.input.charCodeAt(r.position),g===124)i=!1;else if(g===62)i=!0;else return!1;for(r.kind="scalar",r.result="";g!==0;)if(g=r.input.charCodeAt(++r.position),g===43||g===45)JS===n?n=g===43?u2:epe:ft(r,"repeat of a chomping mode identifier");else if((u=ope(g))>=0)u===0?ft(r,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?ft(r,"repeat of an indentation width identifier"):(a=e+u-1,o=!0);else break;if(tc(g)){do g=r.input.charCodeAt(++r.position);while(tc(g));if(g===35)do g=r.input.charCodeAt(++r.position);while(!vo(g)&&g!==0)}for(;g!==0;){for(WS(r),r.lineIndent=0,g=r.input.charCodeAt(r.position);(!o||r.lineIndenta&&(a=r.lineIndent),vo(g)){l++;continue}if(r.lineIndente)&&l!==0)ft(r,"bad indentation of a sequence entry");else if(r.lineIndente)&&(Tg(r,e,dI,!0,n)&&(p?f=r.result:h=r.result),p||(Lg(r,c,u,g,f,h,s,o),g=f=h=null),zr(r,!0,-1),y=r.input.charCodeAt(r.position)),r.lineIndent>e&&y!==0)ft(r,"bad indentation of a mapping entry");else if(r.lineIndente?l=1:r.lineIndent===e?l=0:r.lineIndente?l=1:r.lineIndent===e?l=0:r.lineIndent tag; it should be "scalar", not "'+r.kind+'"'),g=0,f=r.implicitTypes.length;g tag; it should be "'+h.kind+'", not "'+r.kind+'"'),h.resolve(r.result)?(r.result=h.construct(r.result),r.anchor!==null&&(r.anchorMap[r.anchor]=r.result)):ft(r,"cannot resolve a node with !<"+r.tag+"> explicit tag")):ft(r,"unknown tag !<"+r.tag+">");return r.listener!==null&&r.listener("close",r),r.tag!==null||r.anchor!==null||u}function mpe(r){var e=r.position,t,i,n,s=!1,o;for(r.version=null,r.checkLineBreaks=r.legacy,r.tagMap={},r.anchorMap={};(o=r.input.charCodeAt(r.position))!==0&&(zr(r,!0,-1),o=r.input.charCodeAt(r.position),!(r.lineIndent>0||o!==37));){for(s=!0,o=r.input.charCodeAt(++r.position),t=r.position;o!==0&&!un(o);)o=r.input.charCodeAt(++r.position);for(i=r.input.slice(t,r.position),n=[],i.length<1&&ft(r,"directive name must not be less than one character in length");o!==0;){for(;tc(o);)o=r.input.charCodeAt(++r.position);if(o===35){do o=r.input.charCodeAt(++r.position);while(o!==0&&!vo(o));break}if(vo(o))break;for(t=r.position;o!==0&&!un(o);)o=r.input.charCodeAt(++r.position);n.push(r.input.slice(t,r.position))}o!==0&&WS(r),DA.call(h2,i)?h2[i](r,i,n):CI(r,'unknown document directive "'+i+'"')}if(zr(r,!0,-1),r.lineIndent===0&&r.input.charCodeAt(r.position)===45&&r.input.charCodeAt(r.position+1)===45&&r.input.charCodeAt(r.position+2)===45?(r.position+=3,zr(r,!0,-1)):s&&ft(r,"directives end mark is expected"),Tg(r,r.lineIndent-1,dI,!1,!0),zr(r,!0,-1),r.checkLineBreaks&&rpe.test(r.input.slice(e,r.position))&&CI(r,"non-ASCII line breaks are interpreted as content"),r.documents.push(r.result),r.position===r.lineStart&&mI(r)){r.input.charCodeAt(r.position)===46&&(r.position+=3,zr(r,!0,-1));return}if(r.position"u"&&(t=e,e=null);var i=S2(r,t);if(typeof e!="function")return i;for(var n=0,s=i.length;n"u"&&(t=e,e=null),v2(r,e,ya.extend({schema:m2},t))}function Ipe(r,e){return x2(r,ya.extend({schema:m2},e))}Vp.exports.loadAll=v2;Vp.exports.load=x2;Vp.exports.safeLoadAll=Epe;Vp.exports.safeLoad=Ipe});var _2=w((qZe,_S)=>{"use strict";var Zp=Zl(),_p=kg(),ype=zp(),wpe=Fg(),O2=Object.prototype.toString,M2=Object.prototype.hasOwnProperty,Bpe=9,Xp=10,Qpe=13,bpe=32,Spe=33,vpe=34,K2=35,xpe=37,Ppe=38,Dpe=39,kpe=42,U2=44,Rpe=45,H2=58,Fpe=61,Npe=62,Lpe=63,Tpe=64,G2=91,Y2=93,Ope=96,j2=123,Mpe=124,q2=125,Ni={};Ni[0]="\\0";Ni[7]="\\a";Ni[8]="\\b";Ni[9]="\\t";Ni[10]="\\n";Ni[11]="\\v";Ni[12]="\\f";Ni[13]="\\r";Ni[27]="\\e";Ni[34]='\\"';Ni[92]="\\\\";Ni[133]="\\N";Ni[160]="\\_";Ni[8232]="\\L";Ni[8233]="\\P";var Kpe=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function Upe(r,e){var t,i,n,s,o,a,l;if(e===null)return{};for(t={},i=Object.keys(e),n=0,s=i.length;n0?r.charCodeAt(s-1):null,f=f&&R2(o,a)}else{for(s=0;si&&r[g+1]!==" ",g=s);else if(!Og(o))return EI;a=s>0?r.charCodeAt(s-1):null,f=f&&R2(o,a)}c=c||u&&s-g-1>i&&r[g+1]!==" "}return!l&&!c?f&&!n(r)?W2:z2:t>9&&J2(r)?EI:c?X2:V2}function Jpe(r,e,t,i){r.dump=function(){if(e.length===0)return"''";if(!r.noCompatMode&&Kpe.indexOf(e)!==-1)return"'"+e+"'";var n=r.indent*Math.max(1,t),s=r.lineWidth===-1?-1:Math.max(Math.min(r.lineWidth,40),r.lineWidth-n),o=i||r.flowLevel>-1&&t>=r.flowLevel;function a(l){return Gpe(r,l)}switch(qpe(e,o,r.indent,s,a)){case W2:return e;case z2:return"'"+e.replace(/'/g,"''")+"'";case V2:return"|"+F2(e,r.indent)+N2(k2(e,n));case X2:return">"+F2(e,r.indent)+N2(k2(Wpe(e,s),n));case EI:return'"'+zpe(e,s)+'"';default:throw new _p("impossible error: invalid scalar style")}}()}function F2(r,e){var t=J2(r)?String(e):"",i=r[r.length-1]===` +`,n=i&&(r[r.length-2]===` +`||r===` +`),s=n?"+":i?"":"-";return t+s+` +`}function N2(r){return r[r.length-1]===` +`?r.slice(0,-1):r}function Wpe(r,e){for(var t=/(\n+)([^\n]*)/g,i=function(){var c=r.indexOf(` +`);return c=c!==-1?c:r.length,t.lastIndex=c,L2(r.slice(0,c),e)}(),n=r[0]===` +`||r[0]===" ",s,o;o=t.exec(r);){var a=o[1],l=o[2];s=l[0]===" ",i+=a+(!n&&!s&&l!==""?` +`:"")+L2(l,e),n=s}return i}function L2(r,e){if(r===""||r[0]===" ")return r;for(var t=/ [^ ]/g,i,n=0,s,o=0,a=0,l="";i=t.exec(r);)a=i.index,a-n>e&&(s=o>n?o:a,l+=` +`+r.slice(n,s),n=s+1),o=a;return l+=` +`,r.length-n>e&&o>n?l+=r.slice(n,o)+` +`+r.slice(o+1):l+=r.slice(n),l.slice(1)}function zpe(r){for(var e="",t,i,n,s=0;s=55296&&t<=56319&&(i=r.charCodeAt(s+1),i>=56320&&i<=57343)){e+=D2((t-55296)*1024+i-56320+65536),s++;continue}n=Ni[t],e+=!n&&Og(t)?r[s]:n||D2(t)}return e}function Vpe(r,e,t){var i="",n=r.tag,s,o;for(s=0,o=t.length;s1024&&(u+="? "),u+=r.dump+(r.condenseFlow?'"':"")+":"+(r.condenseFlow?"":" "),rc(r,e,c,!1,!1)&&(u+=r.dump,i+=u));r.tag=n,r.dump="{"+i+"}"}function _pe(r,e,t,i){var n="",s=r.tag,o=Object.keys(t),a,l,c,u,g,f;if(r.sortKeys===!0)o.sort();else if(typeof r.sortKeys=="function")o.sort(r.sortKeys);else if(r.sortKeys)throw new _p("sortKeys must be a boolean or a function");for(a=0,l=o.length;a1024,g&&(r.dump&&Xp===r.dump.charCodeAt(0)?f+="?":f+="? "),f+=r.dump,g&&(f+=VS(r,e)),rc(r,e+1,u,!0,g)&&(r.dump&&Xp===r.dump.charCodeAt(0)?f+=":":f+=": ",f+=r.dump,n+=f));r.tag=s,r.dump=n||"{}"}function T2(r,e,t){var i,n,s,o,a,l;for(n=t?r.explicitTypes:r.implicitTypes,s=0,o=n.length;s tag resolver accepts not "'+l+'" style');r.dump=i}return!0}return!1}function rc(r,e,t,i,n,s){r.tag=null,r.dump=t,T2(r,t,!1)||T2(r,t,!0);var o=O2.call(r.dump);i&&(i=r.flowLevel<0||r.flowLevel>e);var a=o==="[object Object]"||o==="[object Array]",l,c;if(a&&(l=r.duplicates.indexOf(t),c=l!==-1),(r.tag!==null&&r.tag!=="?"||c||r.indent!==2&&e>0)&&(n=!1),c&&r.usedDuplicates[l])r.dump="*ref_"+l;else{if(a&&c&&!r.usedDuplicates[l]&&(r.usedDuplicates[l]=!0),o==="[object Object]")i&&Object.keys(r.dump).length!==0?(_pe(r,e,r.dump,n),c&&(r.dump="&ref_"+l+r.dump)):(Zpe(r,e,r.dump),c&&(r.dump="&ref_"+l+" "+r.dump));else if(o==="[object Array]"){var u=r.noArrayIndent&&e>0?e-1:e;i&&r.dump.length!==0?(Xpe(r,u,r.dump,n),c&&(r.dump="&ref_"+l+r.dump)):(Vpe(r,u,r.dump),c&&(r.dump="&ref_"+l+" "+r.dump))}else if(o==="[object String]")r.tag!=="?"&&Jpe(r,r.dump,e,s);else{if(r.skipInvalid)return!1;throw new _p("unacceptable kind of an object to dump "+o)}r.tag!==null&&r.tag!=="?"&&(r.dump="!<"+r.tag+"> "+r.dump)}return!0}function $pe(r,e){var t=[],i=[],n,s;for(XS(r,t,i),n=0,s=i.length;n{"use strict";var II=P2(),$2=_2();function yI(r){return function(){throw new Error("Function "+r+" is deprecated and cannot be used.")}}Fr.exports.Type=si();Fr.exports.Schema=_l();Fr.exports.FAILSAFE_SCHEMA=fI();Fr.exports.JSON_SCHEMA=YS();Fr.exports.CORE_SCHEMA=jS();Fr.exports.DEFAULT_SAFE_SCHEMA=Fg();Fr.exports.DEFAULT_FULL_SCHEMA=zp();Fr.exports.load=II.load;Fr.exports.loadAll=II.loadAll;Fr.exports.safeLoad=II.safeLoad;Fr.exports.safeLoadAll=II.safeLoadAll;Fr.exports.dump=$2.dump;Fr.exports.safeDump=$2.safeDump;Fr.exports.YAMLException=kg();Fr.exports.MINIMAL_SCHEMA=fI();Fr.exports.SAFE_SCHEMA=Fg();Fr.exports.DEFAULT_SCHEMA=zp();Fr.exports.scan=yI("scan");Fr.exports.parse=yI("parse");Fr.exports.compose=yI("compose");Fr.exports.addConstructor=yI("addConstructor")});var rH=w((WZe,tH)=>{"use strict";var tde=eH();tH.exports=tde});var nH=w((zZe,iH)=>{"use strict";function rde(r,e){function t(){this.constructor=r}t.prototype=e.prototype,r.prototype=new t}function ic(r,e,t,i){this.message=r,this.expected=e,this.found=t,this.location=i,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,ic)}rde(ic,Error);ic.buildMessage=function(r,e){var t={literal:function(c){return'"'+n(c.text)+'"'},class:function(c){var u="",g;for(g=0;g0){for(g=1,f=1;g({[Ke]:Ce})))},H=function(R){return R},j=function(R){return R},$=Ms("correct indentation"),V=" ",W=ar(" ",!1),_=function(R){return R.length===BA*mg},A=function(R){return R.length===(BA+1)*mg},ae=function(){return BA++,!0},ge=function(){return BA--,!0},re=function(){return gg()},O=Ms("pseudostring"),F=/^[^\r\n\t ?:,\][{}#&*!|>'"%@`\-]/,ue=Fn(["\r",` +`," "," ","?",":",",","]","[","{","}","#","&","*","!","|",">","'",'"',"%","@","`","-"],!0,!1),he=/^[^\r\n\t ,\][{}:#"']/,ke=Fn(["\r",` +`," "," ",",","]","[","{","}",":","#",'"',"'"],!0,!1),Fe=function(){return gg().replace(/^ *| *$/g,"")},Ne="--",oe=ar("--",!1),le=/^[a-zA-Z\/0-9]/,we=Fn([["a","z"],["A","Z"],"/",["0","9"]],!1,!1),fe=/^[^\r\n\t :,]/,Ae=Fn(["\r",` +`," "," ",":",","],!0,!1),qe="null",ne=ar("null",!1),Y=function(){return null},pe="true",ie=ar("true",!1),de=function(){return!0},_e="false",Pt=ar("false",!1),It=function(){return!1},Or=Ms("string"),ii='"',gi=ar('"',!1),hr=function(){return""},fi=function(R){return R},ni=function(R){return R.join("")},Os=/^[^"\\\0-\x1F\x7F]/,pr=Fn(['"',"\\",["\0",""],"\x7F"],!0,!1),Ii='\\"',es=ar('\\"',!1),ua=function(){return'"'},pA="\\\\",ag=ar("\\\\",!1),ts=function(){return"\\"},dA="\\/",ga=ar("\\/",!1),yp=function(){return"/"},CA="\\b",mA=ar("\\b",!1),wr=function(){return"\b"},kl="\\f",Ag=ar("\\f",!1),Io=function(){return"\f"},lg="\\n",wp=ar("\\n",!1),Bp=function(){return` +`},vr="\\r",se=ar("\\r",!1),yo=function(){return"\r"},kn="\\t",cg=ar("\\t",!1),Qt=function(){return" "},Rl="\\u",Rn=ar("\\u",!1),rs=function(R,q,Ce,Ke){return String.fromCharCode(parseInt(`0x${R}${q}${Ce}${Ke}`))},is=/^[0-9a-fA-F]/,gt=Fn([["0","9"],["a","f"],["A","F"]],!1,!1),wo=Ms("blank space"),At=/^[ \t]/,an=Fn([" "," "],!1,!1),S=Ms("white space"),Tt=/^[ \t\n\r]/,ug=Fn([" "," ",` +`,"\r"],!1,!1),Fl=`\r +`,Qp=ar(`\r +`,!1),bp=` +`,Sp=ar(` +`,!1),vp="\r",xp=ar("\r",!1),G=0,yt=0,EA=[{line:1,column:1}],Ji=0,Nl=[],Xe=0,fa;if("startRule"in e){if(!(e.startRule in i))throw new Error(`Can't start parsing from rule "`+e.startRule+'".');n=i[e.startRule]}function gg(){return r.substring(yt,G)}function FE(){return An(yt,G)}function Pp(R,q){throw q=q!==void 0?q:An(yt,G),Tl([Ms(R)],r.substring(yt,G),q)}function NE(R,q){throw q=q!==void 0?q:An(yt,G),fg(R,q)}function ar(R,q){return{type:"literal",text:R,ignoreCase:q}}function Fn(R,q,Ce){return{type:"class",parts:R,inverted:q,ignoreCase:Ce}}function Ll(){return{type:"any"}}function Dp(){return{type:"end"}}function Ms(R){return{type:"other",description:R}}function ha(R){var q=EA[R],Ce;if(q)return q;for(Ce=R-1;!EA[Ce];)Ce--;for(q=EA[Ce],q={line:q.line,column:q.column};CeJi&&(Ji=G,Nl=[]),Nl.push(R))}function fg(R,q){return new ic(R,null,null,q)}function Tl(R,q,Ce){return new ic(ic.buildMessage(R,q),R,q,Ce)}function Ks(){var R;return R=hg(),R}function Ol(){var R,q,Ce;for(R=G,q=[],Ce=IA();Ce!==t;)q.push(Ce),Ce=IA();return q!==t&&(yt=R,q=s(q)),R=q,R}function IA(){var R,q,Ce,Ke,Re;return R=G,q=da(),q!==t?(r.charCodeAt(G)===45?(Ce=o,G++):(Ce=t,Xe===0&&Te(a)),Ce!==t?(Ke=Rr(),Ke!==t?(Re=pa(),Re!==t?(yt=R,q=l(Re),R=q):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t),R}function hg(){var R,q,Ce;for(R=G,q=[],Ce=pg();Ce!==t;)q.push(Ce),Ce=pg();return q!==t&&(yt=R,q=c(q)),R=q,R}function pg(){var R,q,Ce,Ke,Re,ze,dt,Ft,Nn;if(R=G,q=Rr(),q===t&&(q=null),q!==t){if(Ce=G,r.charCodeAt(G)===35?(Ke=u,G++):(Ke=t,Xe===0&&Te(g)),Ke!==t){if(Re=[],ze=G,dt=G,Xe++,Ft=Gs(),Xe--,Ft===t?dt=void 0:(G=dt,dt=t),dt!==t?(r.length>G?(Ft=r.charAt(G),G++):(Ft=t,Xe===0&&Te(f)),Ft!==t?(dt=[dt,Ft],ze=dt):(G=ze,ze=t)):(G=ze,ze=t),ze!==t)for(;ze!==t;)Re.push(ze),ze=G,dt=G,Xe++,Ft=Gs(),Xe--,Ft===t?dt=void 0:(G=dt,dt=t),dt!==t?(r.length>G?(Ft=r.charAt(G),G++):(Ft=t,Xe===0&&Te(f)),Ft!==t?(dt=[dt,Ft],ze=dt):(G=ze,ze=t)):(G=ze,ze=t);else Re=t;Re!==t?(Ke=[Ke,Re],Ce=Ke):(G=Ce,Ce=t)}else G=Ce,Ce=t;if(Ce===t&&(Ce=null),Ce!==t){if(Ke=[],Re=Hs(),Re!==t)for(;Re!==t;)Ke.push(Re),Re=Hs();else Ke=t;Ke!==t?(yt=R,q=h(),R=q):(G=R,R=t)}else G=R,R=t}else G=R,R=t;if(R===t&&(R=G,q=da(),q!==t?(Ce=Ml(),Ce!==t?(Ke=Rr(),Ke===t&&(Ke=null),Ke!==t?(r.charCodeAt(G)===58?(Re=p,G++):(Re=t,Xe===0&&Te(C)),Re!==t?(ze=Rr(),ze===t&&(ze=null),ze!==t?(dt=pa(),dt!==t?(yt=R,q=y(Ce,dt),R=q):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t),R===t&&(R=G,q=da(),q!==t?(Ce=Us(),Ce!==t?(Ke=Rr(),Ke===t&&(Ke=null),Ke!==t?(r.charCodeAt(G)===58?(Re=p,G++):(Re=t,Xe===0&&Te(C)),Re!==t?(ze=Rr(),ze===t&&(ze=null),ze!==t?(dt=pa(),dt!==t?(yt=R,q=y(Ce,dt),R=q):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t),R===t))){if(R=G,q=da(),q!==t)if(Ce=Us(),Ce!==t)if(Ke=Rr(),Ke!==t)if(Re=LE(),Re!==t){if(ze=[],dt=Hs(),dt!==t)for(;dt!==t;)ze.push(dt),dt=Hs();else ze=t;ze!==t?(yt=R,q=y(Ce,Re),R=q):(G=R,R=t)}else G=R,R=t;else G=R,R=t;else G=R,R=t;else G=R,R=t;if(R===t)if(R=G,q=da(),q!==t)if(Ce=Us(),Ce!==t){if(Ke=[],Re=G,ze=Rr(),ze===t&&(ze=null),ze!==t?(r.charCodeAt(G)===44?(dt=B,G++):(dt=t,Xe===0&&Te(v)),dt!==t?(Ft=Rr(),Ft===t&&(Ft=null),Ft!==t?(Nn=Us(),Nn!==t?(yt=Re,ze=D(Ce,Nn),Re=ze):(G=Re,Re=t)):(G=Re,Re=t)):(G=Re,Re=t)):(G=Re,Re=t),Re!==t)for(;Re!==t;)Ke.push(Re),Re=G,ze=Rr(),ze===t&&(ze=null),ze!==t?(r.charCodeAt(G)===44?(dt=B,G++):(dt=t,Xe===0&&Te(v)),dt!==t?(Ft=Rr(),Ft===t&&(Ft=null),Ft!==t?(Nn=Us(),Nn!==t?(yt=Re,ze=D(Ce,Nn),Re=ze):(G=Re,Re=t)):(G=Re,Re=t)):(G=Re,Re=t)):(G=Re,Re=t);else Ke=t;Ke!==t?(Re=Rr(),Re===t&&(Re=null),Re!==t?(r.charCodeAt(G)===58?(ze=p,G++):(ze=t,Xe===0&&Te(C)),ze!==t?(dt=Rr(),dt===t&&(dt=null),dt!==t?(Ft=pa(),Ft!==t?(yt=R,q=L(Ce,Ke,Ft),R=q):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)}else G=R,R=t;else G=R,R=t}return R}function pa(){var R,q,Ce,Ke,Re,ze,dt;if(R=G,q=G,Xe++,Ce=G,Ke=Gs(),Ke!==t?(Re=rt(),Re!==t?(r.charCodeAt(G)===45?(ze=o,G++):(ze=t,Xe===0&&Te(a)),ze!==t?(dt=Rr(),dt!==t?(Ke=[Ke,Re,ze,dt],Ce=Ke):(G=Ce,Ce=t)):(G=Ce,Ce=t)):(G=Ce,Ce=t)):(G=Ce,Ce=t),Xe--,Ce!==t?(G=q,q=void 0):q=t,q!==t?(Ce=Hs(),Ce!==t?(Ke=Bo(),Ke!==t?(Re=Ol(),Re!==t?(ze=yA(),ze!==t?(yt=R,q=H(Re),R=q):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t),R===t&&(R=G,q=Gs(),q!==t?(Ce=Bo(),Ce!==t?(Ke=hg(),Ke!==t?(Re=yA(),Re!==t?(yt=R,q=H(Ke),R=q):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t),R===t))if(R=G,q=Kl(),q!==t){if(Ce=[],Ke=Hs(),Ke!==t)for(;Ke!==t;)Ce.push(Ke),Ke=Hs();else Ce=t;Ce!==t?(yt=R,q=j(q),R=q):(G=R,R=t)}else G=R,R=t;return R}function da(){var R,q,Ce;for(Xe++,R=G,q=[],r.charCodeAt(G)===32?(Ce=V,G++):(Ce=t,Xe===0&&Te(W));Ce!==t;)q.push(Ce),r.charCodeAt(G)===32?(Ce=V,G++):(Ce=t,Xe===0&&Te(W));return q!==t?(yt=G,Ce=_(q),Ce?Ce=void 0:Ce=t,Ce!==t?(q=[q,Ce],R=q):(G=R,R=t)):(G=R,R=t),Xe--,R===t&&(q=t,Xe===0&&Te($)),R}function rt(){var R,q,Ce;for(R=G,q=[],r.charCodeAt(G)===32?(Ce=V,G++):(Ce=t,Xe===0&&Te(W));Ce!==t;)q.push(Ce),r.charCodeAt(G)===32?(Ce=V,G++):(Ce=t,Xe===0&&Te(W));return q!==t?(yt=G,Ce=A(q),Ce?Ce=void 0:Ce=t,Ce!==t?(q=[q,Ce],R=q):(G=R,R=t)):(G=R,R=t),R}function Bo(){var R;return yt=G,R=ae(),R?R=void 0:R=t,R}function yA(){var R;return yt=G,R=ge(),R?R=void 0:R=t,R}function Ml(){var R;return R=Ul(),R===t&&(R=kp()),R}function Us(){var R,q,Ce;if(R=Ul(),R===t){if(R=G,q=[],Ce=dg(),Ce!==t)for(;Ce!==t;)q.push(Ce),Ce=dg();else q=t;q!==t&&(yt=R,q=re()),R=q}return R}function Kl(){var R;return R=Rp(),R===t&&(R=TE(),R===t&&(R=Ul(),R===t&&(R=kp()))),R}function LE(){var R;return R=Rp(),R===t&&(R=Ul(),R===t&&(R=dg())),R}function kp(){var R,q,Ce,Ke,Re,ze;if(Xe++,R=G,F.test(r.charAt(G))?(q=r.charAt(G),G++):(q=t,Xe===0&&Te(ue)),q!==t){for(Ce=[],Ke=G,Re=Rr(),Re===t&&(Re=null),Re!==t?(he.test(r.charAt(G))?(ze=r.charAt(G),G++):(ze=t,Xe===0&&Te(ke)),ze!==t?(Re=[Re,ze],Ke=Re):(G=Ke,Ke=t)):(G=Ke,Ke=t);Ke!==t;)Ce.push(Ke),Ke=G,Re=Rr(),Re===t&&(Re=null),Re!==t?(he.test(r.charAt(G))?(ze=r.charAt(G),G++):(ze=t,Xe===0&&Te(ke)),ze!==t?(Re=[Re,ze],Ke=Re):(G=Ke,Ke=t)):(G=Ke,Ke=t);Ce!==t?(yt=R,q=Fe(),R=q):(G=R,R=t)}else G=R,R=t;return Xe--,R===t&&(q=t,Xe===0&&Te(O)),R}function dg(){var R,q,Ce,Ke,Re;if(R=G,r.substr(G,2)===Ne?(q=Ne,G+=2):(q=t,Xe===0&&Te(oe)),q===t&&(q=null),q!==t)if(le.test(r.charAt(G))?(Ce=r.charAt(G),G++):(Ce=t,Xe===0&&Te(we)),Ce!==t){for(Ke=[],fe.test(r.charAt(G))?(Re=r.charAt(G),G++):(Re=t,Xe===0&&Te(Ae));Re!==t;)Ke.push(Re),fe.test(r.charAt(G))?(Re=r.charAt(G),G++):(Re=t,Xe===0&&Te(Ae));Ke!==t?(yt=R,q=Fe(),R=q):(G=R,R=t)}else G=R,R=t;else G=R,R=t;return R}function Rp(){var R,q;return R=G,r.substr(G,4)===qe?(q=qe,G+=4):(q=t,Xe===0&&Te(ne)),q!==t&&(yt=R,q=Y()),R=q,R}function TE(){var R,q;return R=G,r.substr(G,4)===pe?(q=pe,G+=4):(q=t,Xe===0&&Te(ie)),q!==t&&(yt=R,q=de()),R=q,R===t&&(R=G,r.substr(G,5)===_e?(q=_e,G+=5):(q=t,Xe===0&&Te(Pt)),q!==t&&(yt=R,q=It()),R=q),R}function Ul(){var R,q,Ce,Ke;return Xe++,R=G,r.charCodeAt(G)===34?(q=ii,G++):(q=t,Xe===0&&Te(gi)),q!==t?(r.charCodeAt(G)===34?(Ce=ii,G++):(Ce=t,Xe===0&&Te(gi)),Ce!==t?(yt=R,q=hr(),R=q):(G=R,R=t)):(G=R,R=t),R===t&&(R=G,r.charCodeAt(G)===34?(q=ii,G++):(q=t,Xe===0&&Te(gi)),q!==t?(Ce=OE(),Ce!==t?(r.charCodeAt(G)===34?(Ke=ii,G++):(Ke=t,Xe===0&&Te(gi)),Ke!==t?(yt=R,q=fi(Ce),R=q):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)),Xe--,R===t&&(q=t,Xe===0&&Te(Or)),R}function OE(){var R,q,Ce;if(R=G,q=[],Ce=Cg(),Ce!==t)for(;Ce!==t;)q.push(Ce),Ce=Cg();else q=t;return q!==t&&(yt=R,q=ni(q)),R=q,R}function Cg(){var R,q,Ce,Ke,Re,ze;return Os.test(r.charAt(G))?(R=r.charAt(G),G++):(R=t,Xe===0&&Te(pr)),R===t&&(R=G,r.substr(G,2)===Ii?(q=Ii,G+=2):(q=t,Xe===0&&Te(es)),q!==t&&(yt=R,q=ua()),R=q,R===t&&(R=G,r.substr(G,2)===pA?(q=pA,G+=2):(q=t,Xe===0&&Te(ag)),q!==t&&(yt=R,q=ts()),R=q,R===t&&(R=G,r.substr(G,2)===dA?(q=dA,G+=2):(q=t,Xe===0&&Te(ga)),q!==t&&(yt=R,q=yp()),R=q,R===t&&(R=G,r.substr(G,2)===CA?(q=CA,G+=2):(q=t,Xe===0&&Te(mA)),q!==t&&(yt=R,q=wr()),R=q,R===t&&(R=G,r.substr(G,2)===kl?(q=kl,G+=2):(q=t,Xe===0&&Te(Ag)),q!==t&&(yt=R,q=Io()),R=q,R===t&&(R=G,r.substr(G,2)===lg?(q=lg,G+=2):(q=t,Xe===0&&Te(wp)),q!==t&&(yt=R,q=Bp()),R=q,R===t&&(R=G,r.substr(G,2)===vr?(q=vr,G+=2):(q=t,Xe===0&&Te(se)),q!==t&&(yt=R,q=yo()),R=q,R===t&&(R=G,r.substr(G,2)===kn?(q=kn,G+=2):(q=t,Xe===0&&Te(cg)),q!==t&&(yt=R,q=Qt()),R=q,R===t&&(R=G,r.substr(G,2)===Rl?(q=Rl,G+=2):(q=t,Xe===0&&Te(Rn)),q!==t?(Ce=wA(),Ce!==t?(Ke=wA(),Ke!==t?(Re=wA(),Re!==t?(ze=wA(),ze!==t?(yt=R,q=rs(Ce,Ke,Re,ze),R=q):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)):(G=R,R=t)))))))))),R}function wA(){var R;return is.test(r.charAt(G))?(R=r.charAt(G),G++):(R=t,Xe===0&&Te(gt)),R}function Rr(){var R,q;if(Xe++,R=[],At.test(r.charAt(G))?(q=r.charAt(G),G++):(q=t,Xe===0&&Te(an)),q!==t)for(;q!==t;)R.push(q),At.test(r.charAt(G))?(q=r.charAt(G),G++):(q=t,Xe===0&&Te(an));else R=t;return Xe--,R===t&&(q=t,Xe===0&&Te(wo)),R}function ME(){var R,q;if(Xe++,R=[],Tt.test(r.charAt(G))?(q=r.charAt(G),G++):(q=t,Xe===0&&Te(ug)),q!==t)for(;q!==t;)R.push(q),Tt.test(r.charAt(G))?(q=r.charAt(G),G++):(q=t,Xe===0&&Te(ug));else R=t;return Xe--,R===t&&(q=t,Xe===0&&Te(S)),R}function Hs(){var R,q,Ce,Ke,Re,ze;if(R=G,q=Gs(),q!==t){for(Ce=[],Ke=G,Re=Rr(),Re===t&&(Re=null),Re!==t?(ze=Gs(),ze!==t?(Re=[Re,ze],Ke=Re):(G=Ke,Ke=t)):(G=Ke,Ke=t);Ke!==t;)Ce.push(Ke),Ke=G,Re=Rr(),Re===t&&(Re=null),Re!==t?(ze=Gs(),ze!==t?(Re=[Re,ze],Ke=Re):(G=Ke,Ke=t)):(G=Ke,Ke=t);Ce!==t?(q=[q,Ce],R=q):(G=R,R=t)}else G=R,R=t;return R}function Gs(){var R;return r.substr(G,2)===Fl?(R=Fl,G+=2):(R=t,Xe===0&&Te(Qp)),R===t&&(r.charCodeAt(G)===10?(R=bp,G++):(R=t,Xe===0&&Te(Sp)),R===t&&(r.charCodeAt(G)===13?(R=vp,G++):(R=t,Xe===0&&Te(xp)))),R}let mg=2,BA=0;if(fa=n(),fa!==t&&G===r.length)return fa;throw fa!==t&&G{"use strict";var Ade=r=>{let e=!1,t=!1,i=!1;for(let n=0;n{if(!(typeof r=="string"||Array.isArray(r)))throw new TypeError("Expected the input to be `string | string[]`");e=Object.assign({pascalCase:!1},e);let t=n=>e.pascalCase?n.charAt(0).toUpperCase()+n.slice(1):n;return Array.isArray(r)?r=r.map(n=>n.trim()).filter(n=>n.length).join("-"):r=r.trim(),r.length===0?"":r.length===1?e.pascalCase?r.toUpperCase():r.toLowerCase():(r!==r.toLowerCase()&&(r=Ade(r)),r=r.replace(/^[_.\- ]+/,"").toLowerCase().replace(/[_.\- ]+(\w|$)/g,(n,s)=>s.toUpperCase()).replace(/\d+(\w|$)/g,n=>n.toUpperCase()),t(r))};ev.exports=lH;ev.exports.default=lH});var uH=w((e_e,lde)=>{lde.exports=[{name:"AppVeyor",constant:"APPVEYOR",env:"APPVEYOR",pr:"APPVEYOR_PULL_REQUEST_NUMBER"},{name:"Azure Pipelines",constant:"AZURE_PIPELINES",env:"SYSTEM_TEAMFOUNDATIONCOLLECTIONURI",pr:"SYSTEM_PULLREQUEST_PULLREQUESTID"},{name:"Appcircle",constant:"APPCIRCLE",env:"AC_APPCIRCLE"},{name:"Bamboo",constant:"BAMBOO",env:"bamboo_planKey"},{name:"Bitbucket Pipelines",constant:"BITBUCKET",env:"BITBUCKET_COMMIT",pr:"BITBUCKET_PR_ID"},{name:"Bitrise",constant:"BITRISE",env:"BITRISE_IO",pr:"BITRISE_PULL_REQUEST"},{name:"Buddy",constant:"BUDDY",env:"BUDDY_WORKSPACE_ID",pr:"BUDDY_EXECUTION_PULL_REQUEST_ID"},{name:"Buildkite",constant:"BUILDKITE",env:"BUILDKITE",pr:{env:"BUILDKITE_PULL_REQUEST",ne:"false"}},{name:"CircleCI",constant:"CIRCLE",env:"CIRCLECI",pr:"CIRCLE_PULL_REQUEST"},{name:"Cirrus CI",constant:"CIRRUS",env:"CIRRUS_CI",pr:"CIRRUS_PR"},{name:"AWS CodeBuild",constant:"CODEBUILD",env:"CODEBUILD_BUILD_ARN"},{name:"Codefresh",constant:"CODEFRESH",env:"CF_BUILD_ID",pr:{any:["CF_PULL_REQUEST_NUMBER","CF_PULL_REQUEST_ID"]}},{name:"Codeship",constant:"CODESHIP",env:{CI_NAME:"codeship"}},{name:"Drone",constant:"DRONE",env:"DRONE",pr:{DRONE_BUILD_EVENT:"pull_request"}},{name:"dsari",constant:"DSARI",env:"DSARI"},{name:"GitHub Actions",constant:"GITHUB_ACTIONS",env:"GITHUB_ACTIONS",pr:{GITHUB_EVENT_NAME:"pull_request"}},{name:"GitLab CI",constant:"GITLAB",env:"GITLAB_CI",pr:"CI_MERGE_REQUEST_ID"},{name:"GoCD",constant:"GOCD",env:"GO_PIPELINE_LABEL"},{name:"LayerCI",constant:"LAYERCI",env:"LAYERCI",pr:"LAYERCI_PULL_REQUEST"},{name:"Hudson",constant:"HUDSON",env:"HUDSON_URL"},{name:"Jenkins",constant:"JENKINS",env:["JENKINS_URL","BUILD_ID"],pr:{any:["ghprbPullId","CHANGE_ID"]}},{name:"Magnum CI",constant:"MAGNUM",env:"MAGNUM"},{name:"Netlify CI",constant:"NETLIFY",env:"NETLIFY",pr:{env:"PULL_REQUEST",ne:"false"}},{name:"Nevercode",constant:"NEVERCODE",env:"NEVERCODE",pr:{env:"NEVERCODE_PULL_REQUEST",ne:"false"}},{name:"Render",constant:"RENDER",env:"RENDER",pr:{IS_PULL_REQUEST:"true"}},{name:"Sail CI",constant:"SAIL",env:"SAILCI",pr:"SAIL_PULL_REQUEST_NUMBER"},{name:"Semaphore",constant:"SEMAPHORE",env:"SEMAPHORE",pr:"PULL_REQUEST_NUMBER"},{name:"Screwdriver",constant:"SCREWDRIVER",env:"SCREWDRIVER",pr:{env:"SD_PULL_REQUEST",ne:"false"}},{name:"Shippable",constant:"SHIPPABLE",env:"SHIPPABLE",pr:{IS_PULL_REQUEST:"true"}},{name:"Solano CI",constant:"SOLANO",env:"TDDIUM",pr:"TDDIUM_PR_ID"},{name:"Strider CD",constant:"STRIDER",env:"STRIDER"},{name:"TaskCluster",constant:"TASKCLUSTER",env:["TASK_ID","RUN_ID"]},{name:"TeamCity",constant:"TEAMCITY",env:"TEAMCITY_VERSION"},{name:"Travis CI",constant:"TRAVIS",env:"TRAVIS",pr:{env:"TRAVIS_PULL_REQUEST",ne:"false"}},{name:"Vercel",constant:"VERCEL",env:"NOW_BUILDER"},{name:"Visual Studio App Center",constant:"APPCENTER",env:"APPCENTER_BUILD_ID"}]});var nc=w(Mn=>{"use strict";var fH=uH(),xo=process.env;Object.defineProperty(Mn,"_vendors",{value:fH.map(function(r){return r.constant})});Mn.name=null;Mn.isPR=null;fH.forEach(function(r){let t=(Array.isArray(r.env)?r.env:[r.env]).every(function(i){return gH(i)});if(Mn[r.constant]=t,t)switch(Mn.name=r.name,typeof r.pr){case"string":Mn.isPR=!!xo[r.pr];break;case"object":"env"in r.pr?Mn.isPR=r.pr.env in xo&&xo[r.pr.env]!==r.pr.ne:"any"in r.pr?Mn.isPR=r.pr.any.some(function(i){return!!xo[i]}):Mn.isPR=gH(r.pr);break;default:Mn.isPR=null}});Mn.isCI=!!(xo.CI||xo.CONTINUOUS_INTEGRATION||xo.BUILD_NUMBER||xo.RUN_ID||Mn.name);function gH(r){return typeof r=="string"?!!xo[r]:Object.keys(r).every(function(e){return xo[e]===r[e]})}});var gn={};ut(gn,{KeyRelationship:()=>sc,applyCascade:()=>nd,base64RegExp:()=>mH,colorStringAlphaRegExp:()=>CH,colorStringRegExp:()=>dH,computeKey:()=>kA,getPrintable:()=>Vr,hasExactLength:()=>BH,hasForbiddenKeys:()=>Hde,hasKeyRelationship:()=>av,hasMaxLength:()=>Qde,hasMinLength:()=>Bde,hasMutuallyExclusiveKeys:()=>Gde,hasRequiredKeys:()=>Ude,hasUniqueItems:()=>bde,isArray:()=>pde,isAtLeast:()=>xde,isAtMost:()=>Pde,isBase64:()=>Mde,isBoolean:()=>gde,isDate:()=>hde,isDict:()=>Cde,isEnum:()=>Vi,isHexColor:()=>Ode,isISO8601:()=>Tde,isInExclusiveRange:()=>kde,isInInclusiveRange:()=>Dde,isInstanceOf:()=>Ede,isInteger:()=>Rde,isJSON:()=>Kde,isLiteral:()=>cde,isLowerCase:()=>Fde,isNegative:()=>Sde,isNullable:()=>wde,isNumber:()=>fde,isObject:()=>mde,isOneOf:()=>Ide,isOptional:()=>yde,isPositive:()=>vde,isString:()=>id,isTuple:()=>dde,isUUID4:()=>Lde,isUnknown:()=>wH,isUpperCase:()=>Nde,iso8601RegExp:()=>ov,makeCoercionFn:()=>oc,makeSetter:()=>yH,makeTrait:()=>IH,makeValidator:()=>bt,matchesRegExp:()=>sd,plural:()=>vI,pushError:()=>pt,simpleKeyRegExp:()=>pH,uuid4RegExp:()=>EH});function bt({test:r}){return IH(r)()}function Vr(r){return r===null?"null":r===void 0?"undefined":r===""?"an empty string":JSON.stringify(r)}function kA(r,e){var t,i,n;return typeof e=="number"?`${(t=r==null?void 0:r.p)!==null&&t!==void 0?t:"."}[${e}]`:pH.test(e)?`${(i=r==null?void 0:r.p)!==null&&i!==void 0?i:""}.${e}`:`${(n=r==null?void 0:r.p)!==null&&n!==void 0?n:"."}[${JSON.stringify(e)}]`}function oc(r,e){return t=>{let i=r[e];return r[e]=t,oc(r,e).bind(null,i)}}function yH(r,e){return t=>{r[e]=t}}function vI(r,e,t){return r===1?e:t}function pt({errors:r,p:e}={},t){return r==null||r.push(`${e!=null?e:"."}: ${t}`),!1}function cde(r){return bt({test:(e,t)=>e!==r?pt(t,`Expected a literal (got ${Vr(r)})`):!0})}function Vi(r){let e=Array.isArray(r)?r:Object.values(r),t=new Set(e);return bt({test:(i,n)=>t.has(i)?!0:pt(n,`Expected a valid enumeration value (got ${Vr(i)})`)})}var pH,dH,CH,mH,EH,ov,IH,wH,id,ude,gde,fde,hde,pde,dde,Cde,mde,Ede,Ide,nd,yde,wde,Bde,Qde,BH,bde,Sde,vde,xde,Pde,Dde,kde,Rde,sd,Fde,Nde,Lde,Tde,Ode,Mde,Kde,Ude,Hde,Gde,sc,Yde,av,as=Pge(()=>{pH=/^[a-zA-Z_][a-zA-Z0-9_]*$/,dH=/^#[0-9a-f]{6}$/i,CH=/^#[0-9a-f]{6}([0-9a-f]{2})?$/i,mH=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,EH=/^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}$/i,ov=/^(?:[1-9]\d{3}(-?)(?:(?:0[1-9]|1[0-2])\1(?:0[1-9]|1\d|2[0-8])|(?:0[13-9]|1[0-2])\1(?:29|30)|(?:0[13578]|1[02])(?:\1)31|00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[0-5]))|(?:[1-9]\d(?:0[48]|[2468][048]|[13579][26])|(?:[2468][048]|[13579][26])00)(?:(-?)02(?:\2)29|-?366))T(?:[01]\d|2[0-3])(:?)[0-5]\d(?:\3[0-5]\d)?(?:Z|[+-][01]\d(?:\3[0-5]\d)?)$/,IH=r=>()=>r;wH=()=>bt({test:(r,e)=>!0});id=()=>bt({test:(r,e)=>typeof r!="string"?pt(e,`Expected a string (got ${Vr(r)})`):!0});ude=new Map([["true",!0],["True",!0],["1",!0],[1,!0],["false",!1],["False",!1],["0",!1],[0,!1]]),gde=()=>bt({test:(r,e)=>{var t;if(typeof r!="boolean"){if(typeof(e==null?void 0:e.coercions)<"u"){if(typeof(e==null?void 0:e.coercion)>"u")return pt(e,"Unbound coercion result");let i=ude.get(r);if(typeof i<"u")return e.coercions.push([(t=e.p)!==null&&t!==void 0?t:".",e.coercion.bind(null,i)]),!0}return pt(e,`Expected a boolean (got ${Vr(r)})`)}return!0}}),fde=()=>bt({test:(r,e)=>{var t;if(typeof r!="number"){if(typeof(e==null?void 0:e.coercions)<"u"){if(typeof(e==null?void 0:e.coercion)>"u")return pt(e,"Unbound coercion result");let i;if(typeof r=="string"){let n;try{n=JSON.parse(r)}catch{}if(typeof n=="number")if(JSON.stringify(n)===r)i=n;else return pt(e,`Received a number that can't be safely represented by the runtime (${r})`)}if(typeof i<"u")return e.coercions.push([(t=e.p)!==null&&t!==void 0?t:".",e.coercion.bind(null,i)]),!0}return pt(e,`Expected a number (got ${Vr(r)})`)}return!0}}),hde=()=>bt({test:(r,e)=>{var t;if(!(r instanceof Date)){if(typeof(e==null?void 0:e.coercions)<"u"){if(typeof(e==null?void 0:e.coercion)>"u")return pt(e,"Unbound coercion result");let i;if(typeof r=="string"&&ov.test(r))i=new Date(r);else{let n;if(typeof r=="string"){let s;try{s=JSON.parse(r)}catch{}typeof s=="number"&&(n=s)}else typeof r=="number"&&(n=r);if(typeof n<"u")if(Number.isSafeInteger(n)||!Number.isSafeInteger(n*1e3))i=new Date(n*1e3);else return pt(e,`Received a timestamp that can't be safely represented by the runtime (${r})`)}if(typeof i<"u")return e.coercions.push([(t=e.p)!==null&&t!==void 0?t:".",e.coercion.bind(null,i)]),!0}return pt(e,`Expected a date (got ${Vr(r)})`)}return!0}}),pde=(r,{delimiter:e}={})=>bt({test:(t,i)=>{var n;if(typeof t=="string"&&typeof e<"u"&&typeof(i==null?void 0:i.coercions)<"u"){if(typeof(i==null?void 0:i.coercion)>"u")return pt(i,"Unbound coercion result");t=t.split(e),i.coercions.push([(n=i.p)!==null&&n!==void 0?n:".",i.coercion.bind(null,t)])}if(!Array.isArray(t))return pt(i,`Expected an array (got ${Vr(t)})`);let s=!0;for(let o=0,a=t.length;o{let t=BH(r.length);return bt({test:(i,n)=>{var s;if(typeof i=="string"&&typeof e<"u"&&typeof(n==null?void 0:n.coercions)<"u"){if(typeof(n==null?void 0:n.coercion)>"u")return pt(n,"Unbound coercion result");i=i.split(e),n.coercions.push([(s=n.p)!==null&&s!==void 0?s:".",n.coercion.bind(null,i)])}if(!Array.isArray(i))return pt(n,`Expected a tuple (got ${Vr(i)})`);let o=t(i,Object.assign({},n));for(let a=0,l=i.length;abt({test:(t,i)=>{if(typeof t!="object"||t===null)return pt(i,`Expected an object (got ${Vr(t)})`);let n=Object.keys(t),s=!0;for(let o=0,a=n.length;o{let t=Object.keys(r);return bt({test:(i,n)=>{if(typeof i!="object"||i===null)return pt(n,`Expected an object (got ${Vr(i)})`);let s=new Set([...t,...Object.keys(i)]),o={},a=!0;for(let l of s){if(l==="constructor"||l==="__proto__")a=pt(Object.assign(Object.assign({},n),{p:kA(n,l)}),"Unsafe property name");else{let c=Object.prototype.hasOwnProperty.call(r,l)?r[l]:void 0,u=Object.prototype.hasOwnProperty.call(i,l)?i[l]:void 0;typeof c<"u"?a=c(u,Object.assign(Object.assign({},n),{p:kA(n,l),coercion:oc(i,l)}))&&a:e===null?a=pt(Object.assign(Object.assign({},n),{p:kA(n,l)}),`Extraneous property (got ${Vr(u)})`):Object.defineProperty(o,l,{enumerable:!0,get:()=>u,set:yH(i,l)})}if(!a&&(n==null?void 0:n.errors)==null)break}return e!==null&&(a||(n==null?void 0:n.errors)!=null)&&(a=e(o,n)&&a),a}})},Ede=r=>bt({test:(e,t)=>e instanceof r?!0:pt(t,`Expected an instance of ${r.name} (got ${Vr(e)})`)}),Ide=(r,{exclusive:e=!1}={})=>bt({test:(t,i)=>{var n,s,o;let a=[],l=typeof(i==null?void 0:i.errors)<"u"?[]:void 0;for(let c=0,u=r.length;c1?pt(i,`Expected to match exactly a single predicate (matched ${a.join(", ")})`):(o=i==null?void 0:i.errors)===null||o===void 0||o.push(...l),!1}}),nd=(r,e)=>bt({test:(t,i)=>{var n,s;let o={value:t},a=typeof(i==null?void 0:i.coercions)<"u"?oc(o,"value"):void 0,l=typeof(i==null?void 0:i.coercions)<"u"?[]:void 0;if(!r(t,Object.assign(Object.assign({},i),{coercion:a,coercions:l})))return!1;let c=[];if(typeof l<"u")for(let[,u]of l)c.push(u());try{if(typeof(i==null?void 0:i.coercions)<"u"){if(o.value!==t){if(typeof(i==null?void 0:i.coercion)>"u")return pt(i,"Unbound coercion result");i.coercions.push([(n=i.p)!==null&&n!==void 0?n:".",i.coercion.bind(null,o.value)])}(s=i==null?void 0:i.coercions)===null||s===void 0||s.push(...l)}return e.every(u=>u(o.value,i))}finally{for(let u of c)u()}}}),yde=r=>bt({test:(e,t)=>typeof e>"u"?!0:r(e,t)}),wde=r=>bt({test:(e,t)=>e===null?!0:r(e,t)}),Bde=r=>bt({test:(e,t)=>e.length>=r?!0:pt(t,`Expected to have a length of at least ${r} elements (got ${e.length})`)}),Qde=r=>bt({test:(e,t)=>e.length<=r?!0:pt(t,`Expected to have a length of at most ${r} elements (got ${e.length})`)}),BH=r=>bt({test:(e,t)=>e.length!==r?pt(t,`Expected to have a length of exactly ${r} elements (got ${e.length})`):!0}),bde=({map:r}={})=>bt({test:(e,t)=>{let i=new Set,n=new Set;for(let s=0,o=e.length;sbt({test:(r,e)=>r<=0?!0:pt(e,`Expected to be negative (got ${r})`)}),vde=()=>bt({test:(r,e)=>r>=0?!0:pt(e,`Expected to be positive (got ${r})`)}),xde=r=>bt({test:(e,t)=>e>=r?!0:pt(t,`Expected to be at least ${r} (got ${e})`)}),Pde=r=>bt({test:(e,t)=>e<=r?!0:pt(t,`Expected to be at most ${r} (got ${e})`)}),Dde=(r,e)=>bt({test:(t,i)=>t>=r&&t<=e?!0:pt(i,`Expected to be in the [${r}; ${e}] range (got ${t})`)}),kde=(r,e)=>bt({test:(t,i)=>t>=r&&tbt({test:(e,t)=>e!==Math.round(e)?pt(t,`Expected to be an integer (got ${e})`):Number.isSafeInteger(e)?!0:pt(t,`Expected to be a safe integer (got ${e})`)}),sd=r=>bt({test:(e,t)=>r.test(e)?!0:pt(t,`Expected to match the pattern ${r.toString()} (got ${Vr(e)})`)}),Fde=()=>bt({test:(r,e)=>r!==r.toLowerCase()?pt(e,`Expected to be all-lowercase (got ${r})`):!0}),Nde=()=>bt({test:(r,e)=>r!==r.toUpperCase()?pt(e,`Expected to be all-uppercase (got ${r})`):!0}),Lde=()=>bt({test:(r,e)=>EH.test(r)?!0:pt(e,`Expected to be a valid UUID v4 (got ${Vr(r)})`)}),Tde=()=>bt({test:(r,e)=>ov.test(r)?!1:pt(e,`Expected to be a valid ISO 8601 date string (got ${Vr(r)})`)}),Ode=({alpha:r=!1})=>bt({test:(e,t)=>(r?dH.test(e):CH.test(e))?!0:pt(t,`Expected to be a valid hexadecimal color string (got ${Vr(e)})`)}),Mde=()=>bt({test:(r,e)=>mH.test(r)?!0:pt(e,`Expected to be a valid base 64 string (got ${Vr(r)})`)}),Kde=(r=wH())=>bt({test:(e,t)=>{let i;try{i=JSON.parse(e)}catch{return pt(t,`Expected to be a valid JSON string (got ${Vr(e)})`)}return r(i,t)}}),Ude=r=>{let e=new Set(r);return bt({test:(t,i)=>{let n=new Set(Object.keys(t)),s=[];for(let o of e)n.has(o)||s.push(o);return s.length>0?pt(i,`Missing required ${vI(s.length,"property","properties")} ${s.map(o=>`"${o}"`).join(", ")}`):!0}})},Hde=r=>{let e=new Set(r);return bt({test:(t,i)=>{let n=new Set(Object.keys(t)),s=[];for(let o of e)n.has(o)&&s.push(o);return s.length>0?pt(i,`Forbidden ${vI(s.length,"property","properties")} ${s.map(o=>`"${o}"`).join(", ")}`):!0}})},Gde=r=>{let e=new Set(r);return bt({test:(t,i)=>{let n=new Set(Object.keys(t)),s=[];for(let o of e)n.has(o)&&s.push(o);return s.length>1?pt(i,`Mutually exclusive properties ${s.map(o=>`"${o}"`).join(", ")}`):!0}})};(function(r){r.Forbids="Forbids",r.Requires="Requires"})(sc||(sc={}));Yde={[sc.Forbids]:{expect:!1,message:"forbids using"},[sc.Requires]:{expect:!0,message:"requires using"}},av=(r,e,t,{ignore:i=[]}={})=>{let n=new Set(i),s=new Set(t),o=Yde[e];return bt({test:(a,l)=>{let c=new Set(Object.keys(a));if(!c.has(r)||n.has(a[r]))return!0;let u=[];for(let g of s)(c.has(g)&&!n.has(a[g]))!==o.expect&&u.push(g);return u.length>=1?pt(l,`Property "${r}" ${o.message} ${vI(u.length,"property","properties")} ${u.map(g=>`"${g}"`).join(", ")}`):!0}})}});var UH=w((e$e,KH)=>{"use strict";KH.exports=(r,...e)=>new Promise(t=>{t(r(...e))})});var Yg=w((t$e,pv)=>{"use strict";var oCe=UH(),HH=r=>{if(r<1)throw new TypeError("Expected `concurrency` to be a number from 1 and up");let e=[],t=0,i=()=>{t--,e.length>0&&e.shift()()},n=(a,l,...c)=>{t++;let u=oCe(a,...c);l(u),u.then(i,i)},s=(a,l,...c)=>{tnew Promise(c=>s(a,c,...l));return Object.defineProperties(o,{activeCount:{get:()=>t},pendingCount:{get:()=>e.length}}),o};pv.exports=HH;pv.exports.default=HH});var cd=w((i$e,GH)=>{var aCe="2.0.0",ACe=Number.MAX_SAFE_INTEGER||9007199254740991,lCe=16;GH.exports={SEMVER_SPEC_VERSION:aCe,MAX_LENGTH:256,MAX_SAFE_INTEGER:ACe,MAX_SAFE_COMPONENT_LENGTH:lCe}});var ud=w((n$e,YH)=>{var cCe=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{};YH.exports=cCe});var ac=w((FA,jH)=>{var{MAX_SAFE_COMPONENT_LENGTH:dv}=cd(),uCe=ud();FA=jH.exports={};var gCe=FA.re=[],et=FA.src=[],tt=FA.t={},fCe=0,St=(r,e,t)=>{let i=fCe++;uCe(i,e),tt[r]=i,et[i]=e,gCe[i]=new RegExp(e,t?"g":void 0)};St("NUMERICIDENTIFIER","0|[1-9]\\d*");St("NUMERICIDENTIFIERLOOSE","[0-9]+");St("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*");St("MAINVERSION",`(${et[tt.NUMERICIDENTIFIER]})\\.(${et[tt.NUMERICIDENTIFIER]})\\.(${et[tt.NUMERICIDENTIFIER]})`);St("MAINVERSIONLOOSE",`(${et[tt.NUMERICIDENTIFIERLOOSE]})\\.(${et[tt.NUMERICIDENTIFIERLOOSE]})\\.(${et[tt.NUMERICIDENTIFIERLOOSE]})`);St("PRERELEASEIDENTIFIER",`(?:${et[tt.NUMERICIDENTIFIER]}|${et[tt.NONNUMERICIDENTIFIER]})`);St("PRERELEASEIDENTIFIERLOOSE",`(?:${et[tt.NUMERICIDENTIFIERLOOSE]}|${et[tt.NONNUMERICIDENTIFIER]})`);St("PRERELEASE",`(?:-(${et[tt.PRERELEASEIDENTIFIER]}(?:\\.${et[tt.PRERELEASEIDENTIFIER]})*))`);St("PRERELEASELOOSE",`(?:-?(${et[tt.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${et[tt.PRERELEASEIDENTIFIERLOOSE]})*))`);St("BUILDIDENTIFIER","[0-9A-Za-z-]+");St("BUILD",`(?:\\+(${et[tt.BUILDIDENTIFIER]}(?:\\.${et[tt.BUILDIDENTIFIER]})*))`);St("FULLPLAIN",`v?${et[tt.MAINVERSION]}${et[tt.PRERELEASE]}?${et[tt.BUILD]}?`);St("FULL",`^${et[tt.FULLPLAIN]}$`);St("LOOSEPLAIN",`[v=\\s]*${et[tt.MAINVERSIONLOOSE]}${et[tt.PRERELEASELOOSE]}?${et[tt.BUILD]}?`);St("LOOSE",`^${et[tt.LOOSEPLAIN]}$`);St("GTLT","((?:<|>)?=?)");St("XRANGEIDENTIFIERLOOSE",`${et[tt.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);St("XRANGEIDENTIFIER",`${et[tt.NUMERICIDENTIFIER]}|x|X|\\*`);St("XRANGEPLAIN",`[v=\\s]*(${et[tt.XRANGEIDENTIFIER]})(?:\\.(${et[tt.XRANGEIDENTIFIER]})(?:\\.(${et[tt.XRANGEIDENTIFIER]})(?:${et[tt.PRERELEASE]})?${et[tt.BUILD]}?)?)?`);St("XRANGEPLAINLOOSE",`[v=\\s]*(${et[tt.XRANGEIDENTIFIERLOOSE]})(?:\\.(${et[tt.XRANGEIDENTIFIERLOOSE]})(?:\\.(${et[tt.XRANGEIDENTIFIERLOOSE]})(?:${et[tt.PRERELEASELOOSE]})?${et[tt.BUILD]}?)?)?`);St("XRANGE",`^${et[tt.GTLT]}\\s*${et[tt.XRANGEPLAIN]}$`);St("XRANGELOOSE",`^${et[tt.GTLT]}\\s*${et[tt.XRANGEPLAINLOOSE]}$`);St("COERCE",`(^|[^\\d])(\\d{1,${dv}})(?:\\.(\\d{1,${dv}}))?(?:\\.(\\d{1,${dv}}))?(?:$|[^\\d])`);St("COERCERTL",et[tt.COERCE],!0);St("LONETILDE","(?:~>?)");St("TILDETRIM",`(\\s*)${et[tt.LONETILDE]}\\s+`,!0);FA.tildeTrimReplace="$1~";St("TILDE",`^${et[tt.LONETILDE]}${et[tt.XRANGEPLAIN]}$`);St("TILDELOOSE",`^${et[tt.LONETILDE]}${et[tt.XRANGEPLAINLOOSE]}$`);St("LONECARET","(?:\\^)");St("CARETTRIM",`(\\s*)${et[tt.LONECARET]}\\s+`,!0);FA.caretTrimReplace="$1^";St("CARET",`^${et[tt.LONECARET]}${et[tt.XRANGEPLAIN]}$`);St("CARETLOOSE",`^${et[tt.LONECARET]}${et[tt.XRANGEPLAINLOOSE]}$`);St("COMPARATORLOOSE",`^${et[tt.GTLT]}\\s*(${et[tt.LOOSEPLAIN]})$|^$`);St("COMPARATOR",`^${et[tt.GTLT]}\\s*(${et[tt.FULLPLAIN]})$|^$`);St("COMPARATORTRIM",`(\\s*)${et[tt.GTLT]}\\s*(${et[tt.LOOSEPLAIN]}|${et[tt.XRANGEPLAIN]})`,!0);FA.comparatorTrimReplace="$1$2$3";St("HYPHENRANGE",`^\\s*(${et[tt.XRANGEPLAIN]})\\s+-\\s+(${et[tt.XRANGEPLAIN]})\\s*$`);St("HYPHENRANGELOOSE",`^\\s*(${et[tt.XRANGEPLAINLOOSE]})\\s+-\\s+(${et[tt.XRANGEPLAINLOOSE]})\\s*$`);St("STAR","(<|>)?=?\\s*\\*");St("GTE0","^\\s*>=\\s*0.0.0\\s*$");St("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")});var gd=w((s$e,qH)=>{var hCe=["includePrerelease","loose","rtl"],pCe=r=>r?typeof r!="object"?{loose:!0}:hCe.filter(e=>r[e]).reduce((e,t)=>(e[t]=!0,e),{}):{};qH.exports=pCe});var FI=w((o$e,zH)=>{var JH=/^[0-9]+$/,WH=(r,e)=>{let t=JH.test(r),i=JH.test(e);return t&&i&&(r=+r,e=+e),r===e?0:t&&!i?-1:i&&!t?1:rWH(e,r);zH.exports={compareIdentifiers:WH,rcompareIdentifiers:dCe}});var Ti=w((a$e,_H)=>{var NI=ud(),{MAX_LENGTH:VH,MAX_SAFE_INTEGER:LI}=cd(),{re:XH,t:ZH}=ac(),CCe=gd(),{compareIdentifiers:fd}=FI(),Hn=class{constructor(e,t){if(t=CCe(t),e instanceof Hn){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid Version: ${e}`);if(e.length>VH)throw new TypeError(`version is longer than ${VH} characters`);NI("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let i=e.trim().match(t.loose?XH[ZH.LOOSE]:XH[ZH.FULL]);if(!i)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>LI||this.major<0)throw new TypeError("Invalid major version");if(this.minor>LI||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>LI||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map(n=>{if(/^[0-9]+$/.test(n)){let s=+n;if(s>=0&&s=0;)typeof this.prerelease[i]=="number"&&(this.prerelease[i]++,i=-2);i===-1&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error(`invalid increment argument: ${e}`)}return this.format(),this.raw=this.version,this}};_H.exports=Hn});var Ac=w((A$e,rG)=>{var{MAX_LENGTH:mCe}=cd(),{re:$H,t:eG}=ac(),tG=Ti(),ECe=gd(),ICe=(r,e)=>{if(e=ECe(e),r instanceof tG)return r;if(typeof r!="string"||r.length>mCe||!(e.loose?$H[eG.LOOSE]:$H[eG.FULL]).test(r))return null;try{return new tG(r,e)}catch{return null}};rG.exports=ICe});var nG=w((l$e,iG)=>{var yCe=Ac(),wCe=(r,e)=>{let t=yCe(r,e);return t?t.version:null};iG.exports=wCe});var oG=w((c$e,sG)=>{var BCe=Ac(),QCe=(r,e)=>{let t=BCe(r.trim().replace(/^[=v]+/,""),e);return t?t.version:null};sG.exports=QCe});var AG=w((u$e,aG)=>{var bCe=Ti(),SCe=(r,e,t,i)=>{typeof t=="string"&&(i=t,t=void 0);try{return new bCe(r,t).inc(e,i).version}catch{return null}};aG.exports=SCe});var As=w((g$e,cG)=>{var lG=Ti(),vCe=(r,e,t)=>new lG(r,t).compare(new lG(e,t));cG.exports=vCe});var TI=w((f$e,uG)=>{var xCe=As(),PCe=(r,e,t)=>xCe(r,e,t)===0;uG.exports=PCe});var hG=w((h$e,fG)=>{var gG=Ac(),DCe=TI(),kCe=(r,e)=>{if(DCe(r,e))return null;{let t=gG(r),i=gG(e),n=t.prerelease.length||i.prerelease.length,s=n?"pre":"",o=n?"prerelease":"";for(let a in t)if((a==="major"||a==="minor"||a==="patch")&&t[a]!==i[a])return s+a;return o}};fG.exports=kCe});var dG=w((p$e,pG)=>{var RCe=Ti(),FCe=(r,e)=>new RCe(r,e).major;pG.exports=FCe});var mG=w((d$e,CG)=>{var NCe=Ti(),LCe=(r,e)=>new NCe(r,e).minor;CG.exports=LCe});var IG=w((C$e,EG)=>{var TCe=Ti(),OCe=(r,e)=>new TCe(r,e).patch;EG.exports=OCe});var wG=w((m$e,yG)=>{var MCe=Ac(),KCe=(r,e)=>{let t=MCe(r,e);return t&&t.prerelease.length?t.prerelease:null};yG.exports=KCe});var QG=w((E$e,BG)=>{var UCe=As(),HCe=(r,e,t)=>UCe(e,r,t);BG.exports=HCe});var SG=w((I$e,bG)=>{var GCe=As(),YCe=(r,e)=>GCe(r,e,!0);bG.exports=YCe});var OI=w((y$e,xG)=>{var vG=Ti(),jCe=(r,e,t)=>{let i=new vG(r,t),n=new vG(e,t);return i.compare(n)||i.compareBuild(n)};xG.exports=jCe});var DG=w((w$e,PG)=>{var qCe=OI(),JCe=(r,e)=>r.sort((t,i)=>qCe(t,i,e));PG.exports=JCe});var RG=w((B$e,kG)=>{var WCe=OI(),zCe=(r,e)=>r.sort((t,i)=>WCe(i,t,e));kG.exports=zCe});var hd=w((Q$e,FG)=>{var VCe=As(),XCe=(r,e,t)=>VCe(r,e,t)>0;FG.exports=XCe});var MI=w((b$e,NG)=>{var ZCe=As(),_Ce=(r,e,t)=>ZCe(r,e,t)<0;NG.exports=_Ce});var Cv=w((S$e,LG)=>{var $Ce=As(),eme=(r,e,t)=>$Ce(r,e,t)!==0;LG.exports=eme});var KI=w((v$e,TG)=>{var tme=As(),rme=(r,e,t)=>tme(r,e,t)>=0;TG.exports=rme});var UI=w((x$e,OG)=>{var ime=As(),nme=(r,e,t)=>ime(r,e,t)<=0;OG.exports=nme});var mv=w((P$e,MG)=>{var sme=TI(),ome=Cv(),ame=hd(),Ame=KI(),lme=MI(),cme=UI(),ume=(r,e,t,i)=>{switch(e){case"===":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r===t;case"!==":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r!==t;case"":case"=":case"==":return sme(r,t,i);case"!=":return ome(r,t,i);case">":return ame(r,t,i);case">=":return Ame(r,t,i);case"<":return lme(r,t,i);case"<=":return cme(r,t,i);default:throw new TypeError(`Invalid operator: ${e}`)}};MG.exports=ume});var UG=w((D$e,KG)=>{var gme=Ti(),fme=Ac(),{re:HI,t:GI}=ac(),hme=(r,e)=>{if(r instanceof gme)return r;if(typeof r=="number"&&(r=String(r)),typeof r!="string")return null;e=e||{};let t=null;if(!e.rtl)t=r.match(HI[GI.COERCE]);else{let i;for(;(i=HI[GI.COERCERTL].exec(r))&&(!t||t.index+t[0].length!==r.length);)(!t||i.index+i[0].length!==t.index+t[0].length)&&(t=i),HI[GI.COERCERTL].lastIndex=i.index+i[1].length+i[2].length;HI[GI.COERCERTL].lastIndex=-1}return t===null?null:fme(`${t[2]}.${t[3]||"0"}.${t[4]||"0"}`,e)};KG.exports=hme});var GG=w((k$e,HG)=>{"use strict";HG.exports=function(r){r.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}});var YI=w((R$e,YG)=>{"use strict";YG.exports=Ht;Ht.Node=lc;Ht.create=Ht;function Ht(r){var e=this;if(e instanceof Ht||(e=new Ht),e.tail=null,e.head=null,e.length=0,r&&typeof r.forEach=="function")r.forEach(function(n){e.push(n)});else if(arguments.length>0)for(var t=0,i=arguments.length;t1)t=e;else if(this.head)i=this.head.next,t=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var n=0;i!==null;n++)t=r(t,i.value,n),i=i.next;return t};Ht.prototype.reduceReverse=function(r,e){var t,i=this.tail;if(arguments.length>1)t=e;else if(this.tail)i=this.tail.prev,t=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var n=this.length-1;i!==null;n--)t=r(t,i.value,n),i=i.prev;return t};Ht.prototype.toArray=function(){for(var r=new Array(this.length),e=0,t=this.head;t!==null;e++)r[e]=t.value,t=t.next;return r};Ht.prototype.toArrayReverse=function(){for(var r=new Array(this.length),e=0,t=this.tail;t!==null;e++)r[e]=t.value,t=t.prev;return r};Ht.prototype.slice=function(r,e){e=e||this.length,e<0&&(e+=this.length),r=r||0,r<0&&(r+=this.length);var t=new Ht;if(ethis.length&&(e=this.length);for(var i=0,n=this.head;n!==null&&ithis.length&&(e=this.length);for(var i=this.length,n=this.tail;n!==null&&i>e;i--)n=n.prev;for(;n!==null&&i>r;i--,n=n.prev)t.push(n.value);return t};Ht.prototype.splice=function(r,e,...t){r>this.length&&(r=this.length-1),r<0&&(r=this.length+r);for(var i=0,n=this.head;n!==null&&i{"use strict";var mme=YI(),cc=Symbol("max"),ba=Symbol("length"),jg=Symbol("lengthCalculator"),dd=Symbol("allowStale"),uc=Symbol("maxAge"),Qa=Symbol("dispose"),jG=Symbol("noDisposeOnSet"),di=Symbol("lruList"),Vs=Symbol("cache"),JG=Symbol("updateAgeOnGet"),Ev=()=>1,yv=class{constructor(e){if(typeof e=="number"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!="number"||e.max<0))throw new TypeError("max must be a non-negative number");let t=this[cc]=e.max||1/0,i=e.length||Ev;if(this[jg]=typeof i!="function"?Ev:i,this[dd]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[uc]=e.maxAge||0,this[Qa]=e.dispose,this[jG]=e.noDisposeOnSet||!1,this[JG]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!="number"||e<0)throw new TypeError("max must be a non-negative number");this[cc]=e||1/0,pd(this)}get max(){return this[cc]}set allowStale(e){this[dd]=!!e}get allowStale(){return this[dd]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[uc]=e,pd(this)}get maxAge(){return this[uc]}set lengthCalculator(e){typeof e!="function"&&(e=Ev),e!==this[jg]&&(this[jg]=e,this[ba]=0,this[di].forEach(t=>{t.length=this[jg](t.value,t.key),this[ba]+=t.length})),pd(this)}get lengthCalculator(){return this[jg]}get length(){return this[ba]}get itemCount(){return this[di].length}rforEach(e,t){t=t||this;for(let i=this[di].tail;i!==null;){let n=i.prev;qG(this,e,i,t),i=n}}forEach(e,t){t=t||this;for(let i=this[di].head;i!==null;){let n=i.next;qG(this,e,i,t),i=n}}keys(){return this[di].toArray().map(e=>e.key)}values(){return this[di].toArray().map(e=>e.value)}reset(){this[Qa]&&this[di]&&this[di].length&&this[di].forEach(e=>this[Qa](e.key,e.value)),this[Vs]=new Map,this[di]=new mme,this[ba]=0}dump(){return this[di].map(e=>jI(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[di]}set(e,t,i){if(i=i||this[uc],i&&typeof i!="number")throw new TypeError("maxAge must be a number");let n=i?Date.now():0,s=this[jg](t,e);if(this[Vs].has(e)){if(s>this[cc])return qg(this,this[Vs].get(e)),!1;let l=this[Vs].get(e).value;return this[Qa]&&(this[jG]||this[Qa](e,l.value)),l.now=n,l.maxAge=i,l.value=t,this[ba]+=s-l.length,l.length=s,this.get(e),pd(this),!0}let o=new wv(e,t,s,n,i);return o.length>this[cc]?(this[Qa]&&this[Qa](e,t),!1):(this[ba]+=o.length,this[di].unshift(o),this[Vs].set(e,this[di].head),pd(this),!0)}has(e){if(!this[Vs].has(e))return!1;let t=this[Vs].get(e).value;return!jI(this,t)}get(e){return Iv(this,e,!0)}peek(e){return Iv(this,e,!1)}pop(){let e=this[di].tail;return e?(qg(this,e),e.value):null}del(e){qg(this,this[Vs].get(e))}load(e){this.reset();let t=Date.now();for(let i=e.length-1;i>=0;i--){let n=e[i],s=n.e||0;if(s===0)this.set(n.k,n.v);else{let o=s-t;o>0&&this.set(n.k,n.v,o)}}}prune(){this[Vs].forEach((e,t)=>Iv(this,t,!1))}},Iv=(r,e,t)=>{let i=r[Vs].get(e);if(i){let n=i.value;if(jI(r,n)){if(qg(r,i),!r[dd])return}else t&&(r[JG]&&(i.value.now=Date.now()),r[di].unshiftNode(i));return n.value}},jI=(r,e)=>{if(!e||!e.maxAge&&!r[uc])return!1;let t=Date.now()-e.now;return e.maxAge?t>e.maxAge:r[uc]&&t>r[uc]},pd=r=>{if(r[ba]>r[cc])for(let e=r[di].tail;r[ba]>r[cc]&&e!==null;){let t=e.prev;qg(r,e),e=t}},qg=(r,e)=>{if(e){let t=e.value;r[Qa]&&r[Qa](t.key,t.value),r[ba]-=t.length,r[Vs].delete(t.key),r[di].removeNode(e)}},wv=class{constructor(e,t,i,n,s){this.key=e,this.value=t,this.length=i,this.now=n,this.maxAge=s||0}},qG=(r,e,t,i)=>{let n=t.value;jI(r,n)&&(qg(r,t),r[dd]||(n=void 0)),n&&e.call(i,n.value,n.key,r)};WG.exports=yv});var ls=w((N$e,_G)=>{var gc=class{constructor(e,t){if(t=Ime(t),e instanceof gc)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new gc(e.raw,t);if(e instanceof Bv)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(i=>this.parseRange(i.trim())).filter(i=>i.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${e}`);if(this.set.length>1){let i=this.set[0];if(this.set=this.set.filter(n=>!XG(n[0])),this.set.length===0)this.set=[i];else if(this.set.length>1){for(let n of this.set)if(n.length===1&&bme(n[0])){this.set=[n];break}}}this.format()}format(){return this.range=this.set.map(e=>e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){e=e.trim();let i=`parseRange:${Object.keys(this.options).join(",")}:${e}`,n=VG.get(i);if(n)return n;let s=this.options.loose,o=s?Oi[Qi.HYPHENRANGELOOSE]:Oi[Qi.HYPHENRANGE];e=e.replace(o,Lme(this.options.includePrerelease)),Gr("hyphen replace",e),e=e.replace(Oi[Qi.COMPARATORTRIM],wme),Gr("comparator trim",e,Oi[Qi.COMPARATORTRIM]),e=e.replace(Oi[Qi.TILDETRIM],Bme),e=e.replace(Oi[Qi.CARETTRIM],Qme),e=e.split(/\s+/).join(" ");let a=s?Oi[Qi.COMPARATORLOOSE]:Oi[Qi.COMPARATOR],l=e.split(" ").map(f=>Sme(f,this.options)).join(" ").split(/\s+/).map(f=>Nme(f,this.options)).filter(this.options.loose?f=>!!f.match(a):()=>!0).map(f=>new Bv(f,this.options)),c=l.length,u=new Map;for(let f of l){if(XG(f))return[f];u.set(f.value,f)}u.size>1&&u.has("")&&u.delete("");let g=[...u.values()];return VG.set(i,g),g}intersects(e,t){if(!(e instanceof gc))throw new TypeError("a Range is required");return this.set.some(i=>ZG(i,t)&&e.set.some(n=>ZG(n,t)&&i.every(s=>n.every(o=>s.intersects(o,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new yme(e,this.options)}catch{return!1}for(let t=0;tr.value==="<0.0.0-0",bme=r=>r.value==="",ZG=(r,e)=>{let t=!0,i=r.slice(),n=i.pop();for(;t&&i.length;)t=i.every(s=>n.intersects(s,e)),n=i.pop();return t},Sme=(r,e)=>(Gr("comp",r,e),r=Pme(r,e),Gr("caret",r),r=vme(r,e),Gr("tildes",r),r=kme(r,e),Gr("xrange",r),r=Fme(r,e),Gr("stars",r),r),Zi=r=>!r||r.toLowerCase()==="x"||r==="*",vme=(r,e)=>r.trim().split(/\s+/).map(t=>xme(t,e)).join(" "),xme=(r,e)=>{let t=e.loose?Oi[Qi.TILDELOOSE]:Oi[Qi.TILDE];return r.replace(t,(i,n,s,o,a)=>{Gr("tilde",r,i,n,s,o,a);let l;return Zi(n)?l="":Zi(s)?l=`>=${n}.0.0 <${+n+1}.0.0-0`:Zi(o)?l=`>=${n}.${s}.0 <${n}.${+s+1}.0-0`:a?(Gr("replaceTilde pr",a),l=`>=${n}.${s}.${o}-${a} <${n}.${+s+1}.0-0`):l=`>=${n}.${s}.${o} <${n}.${+s+1}.0-0`,Gr("tilde return",l),l})},Pme=(r,e)=>r.trim().split(/\s+/).map(t=>Dme(t,e)).join(" "),Dme=(r,e)=>{Gr("caret",r,e);let t=e.loose?Oi[Qi.CARETLOOSE]:Oi[Qi.CARET],i=e.includePrerelease?"-0":"";return r.replace(t,(n,s,o,a,l)=>{Gr("caret",r,n,s,o,a,l);let c;return Zi(s)?c="":Zi(o)?c=`>=${s}.0.0${i} <${+s+1}.0.0-0`:Zi(a)?s==="0"?c=`>=${s}.${o}.0${i} <${s}.${+o+1}.0-0`:c=`>=${s}.${o}.0${i} <${+s+1}.0.0-0`:l?(Gr("replaceCaret pr",l),s==="0"?o==="0"?c=`>=${s}.${o}.${a}-${l} <${s}.${o}.${+a+1}-0`:c=`>=${s}.${o}.${a}-${l} <${s}.${+o+1}.0-0`:c=`>=${s}.${o}.${a}-${l} <${+s+1}.0.0-0`):(Gr("no pr"),s==="0"?o==="0"?c=`>=${s}.${o}.${a}${i} <${s}.${o}.${+a+1}-0`:c=`>=${s}.${o}.${a}${i} <${s}.${+o+1}.0-0`:c=`>=${s}.${o}.${a} <${+s+1}.0.0-0`),Gr("caret return",c),c})},kme=(r,e)=>(Gr("replaceXRanges",r,e),r.split(/\s+/).map(t=>Rme(t,e)).join(" ")),Rme=(r,e)=>{r=r.trim();let t=e.loose?Oi[Qi.XRANGELOOSE]:Oi[Qi.XRANGE];return r.replace(t,(i,n,s,o,a,l)=>{Gr("xRange",r,i,n,s,o,a,l);let c=Zi(s),u=c||Zi(o),g=u||Zi(a),f=g;return n==="="&&f&&(n=""),l=e.includePrerelease?"-0":"",c?n===">"||n==="<"?i="<0.0.0-0":i="*":n&&f?(u&&(o=0),a=0,n===">"?(n=">=",u?(s=+s+1,o=0,a=0):(o=+o+1,a=0)):n==="<="&&(n="<",u?s=+s+1:o=+o+1),n==="<"&&(l="-0"),i=`${n+s}.${o}.${a}${l}`):u?i=`>=${s}.0.0${l} <${+s+1}.0.0-0`:g&&(i=`>=${s}.${o}.0${l} <${s}.${+o+1}.0-0`),Gr("xRange return",i),i})},Fme=(r,e)=>(Gr("replaceStars",r,e),r.trim().replace(Oi[Qi.STAR],"")),Nme=(r,e)=>(Gr("replaceGTE0",r,e),r.trim().replace(Oi[e.includePrerelease?Qi.GTE0PRE:Qi.GTE0],"")),Lme=r=>(e,t,i,n,s,o,a,l,c,u,g,f,h)=>(Zi(i)?t="":Zi(n)?t=`>=${i}.0.0${r?"-0":""}`:Zi(s)?t=`>=${i}.${n}.0${r?"-0":""}`:o?t=`>=${t}`:t=`>=${t}${r?"-0":""}`,Zi(c)?l="":Zi(u)?l=`<${+c+1}.0.0-0`:Zi(g)?l=`<${c}.${+u+1}.0-0`:f?l=`<=${c}.${u}.${g}-${f}`:r?l=`<${c}.${u}.${+g+1}-0`:l=`<=${l}`,`${t} ${l}`.trim()),Tme=(r,e,t)=>{for(let i=0;i0){let n=r[i].semver;if(n.major===e.major&&n.minor===e.minor&&n.patch===e.patch)return!0}return!1}return!0}});var Cd=w((L$e,iY)=>{var md=Symbol("SemVer ANY"),Jg=class{static get ANY(){return md}constructor(e,t){if(t=Ome(t),e instanceof Jg){if(e.loose===!!t.loose)return e;e=e.value}bv("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===md?this.value="":this.value=this.operator+this.semver.version,bv("comp",this)}parse(e){let t=this.options.loose?$G[eY.COMPARATORLOOSE]:$G[eY.COMPARATOR],i=e.match(t);if(!i)throw new TypeError(`Invalid comparator: ${e}`);this.operator=i[1]!==void 0?i[1]:"",this.operator==="="&&(this.operator=""),i[2]?this.semver=new tY(i[2],this.options.loose):this.semver=md}toString(){return this.value}test(e){if(bv("Comparator.test",e,this.options.loose),this.semver===md||e===md)return!0;if(typeof e=="string")try{e=new tY(e,this.options)}catch{return!1}return Qv(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof Jg))throw new TypeError("a Comparator is required");if((!t||typeof t!="object")&&(t={loose:!!t,includePrerelease:!1}),this.operator==="")return this.value===""?!0:new rY(e.value,t).test(this.value);if(e.operator==="")return e.value===""?!0:new rY(this.value,t).test(e.semver);let i=(this.operator===">="||this.operator===">")&&(e.operator===">="||e.operator===">"),n=(this.operator==="<="||this.operator==="<")&&(e.operator==="<="||e.operator==="<"),s=this.semver.version===e.semver.version,o=(this.operator===">="||this.operator==="<=")&&(e.operator===">="||e.operator==="<="),a=Qv(this.semver,"<",e.semver,t)&&(this.operator===">="||this.operator===">")&&(e.operator==="<="||e.operator==="<"),l=Qv(this.semver,">",e.semver,t)&&(this.operator==="<="||this.operator==="<")&&(e.operator===">="||e.operator===">");return i||n||s&&o||a||l}};iY.exports=Jg;var Ome=gd(),{re:$G,t:eY}=ac(),Qv=mv(),bv=ud(),tY=Ti(),rY=ls()});var Ed=w((T$e,nY)=>{var Mme=ls(),Kme=(r,e,t)=>{try{e=new Mme(e,t)}catch{return!1}return e.test(r)};nY.exports=Kme});var oY=w((O$e,sY)=>{var Ume=ls(),Hme=(r,e)=>new Ume(r,e).set.map(t=>t.map(i=>i.value).join(" ").trim().split(" "));sY.exports=Hme});var AY=w((M$e,aY)=>{var Gme=Ti(),Yme=ls(),jme=(r,e,t)=>{let i=null,n=null,s=null;try{s=new Yme(e,t)}catch{return null}return r.forEach(o=>{s.test(o)&&(!i||n.compare(o)===-1)&&(i=o,n=new Gme(i,t))}),i};aY.exports=jme});var cY=w((K$e,lY)=>{var qme=Ti(),Jme=ls(),Wme=(r,e,t)=>{let i=null,n=null,s=null;try{s=new Jme(e,t)}catch{return null}return r.forEach(o=>{s.test(o)&&(!i||n.compare(o)===1)&&(i=o,n=new qme(i,t))}),i};lY.exports=Wme});var fY=w((U$e,gY)=>{var Sv=Ti(),zme=ls(),uY=hd(),Vme=(r,e)=>{r=new zme(r,e);let t=new Sv("0.0.0");if(r.test(t)||(t=new Sv("0.0.0-0"),r.test(t)))return t;t=null;for(let i=0;i{let a=new Sv(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||uY(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),s&&(!t||uY(t,s))&&(t=s)}return t&&r.test(t)?t:null};gY.exports=Vme});var pY=w((H$e,hY)=>{var Xme=ls(),Zme=(r,e)=>{try{return new Xme(r,e).range||"*"}catch{return null}};hY.exports=Zme});var qI=w((G$e,EY)=>{var _me=Ti(),mY=Cd(),{ANY:$me}=mY,eEe=ls(),tEe=Ed(),dY=hd(),CY=MI(),rEe=UI(),iEe=KI(),nEe=(r,e,t,i)=>{r=new _me(r,i),e=new eEe(e,i);let n,s,o,a,l;switch(t){case">":n=dY,s=rEe,o=CY,a=">",l=">=";break;case"<":n=CY,s=iEe,o=dY,a="<",l="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(tEe(r,e,i))return!1;for(let c=0;c{h.semver===$me&&(h=new mY(">=0.0.0")),g=g||h,f=f||h,n(h.semver,g.semver,i)?g=h:o(h.semver,f.semver,i)&&(f=h)}),g.operator===a||g.operator===l||(!f.operator||f.operator===a)&&s(r,f.semver))return!1;if(f.operator===l&&o(r,f.semver))return!1}return!0};EY.exports=nEe});var yY=w((Y$e,IY)=>{var sEe=qI(),oEe=(r,e,t)=>sEe(r,e,">",t);IY.exports=oEe});var BY=w((j$e,wY)=>{var aEe=qI(),AEe=(r,e,t)=>aEe(r,e,"<",t);wY.exports=AEe});var SY=w((q$e,bY)=>{var QY=ls(),lEe=(r,e,t)=>(r=new QY(r,t),e=new QY(e,t),r.intersects(e));bY.exports=lEe});var xY=w((J$e,vY)=>{var cEe=Ed(),uEe=As();vY.exports=(r,e,t)=>{let i=[],n=null,s=null,o=r.sort((u,g)=>uEe(u,g,t));for(let u of o)cEe(u,e,t)?(s=u,n||(n=u)):(s&&i.push([n,s]),s=null,n=null);n&&i.push([n,null]);let a=[];for(let[u,g]of i)u===g?a.push(u):!g&&u===o[0]?a.push("*"):g?u===o[0]?a.push(`<=${g}`):a.push(`${u} - ${g}`):a.push(`>=${u}`);let l=a.join(" || "),c=typeof e.raw=="string"?e.raw:String(e);return l.length{var PY=ls(),JI=Cd(),{ANY:vv}=JI,Id=Ed(),xv=As(),gEe=(r,e,t={})=>{if(r===e)return!0;r=new PY(r,t),e=new PY(e,t);let i=!1;e:for(let n of r.set){for(let s of e.set){let o=fEe(n,s,t);if(i=i||o!==null,o)continue e}if(i)return!1}return!0},fEe=(r,e,t)=>{if(r===e)return!0;if(r.length===1&&r[0].semver===vv){if(e.length===1&&e[0].semver===vv)return!0;t.includePrerelease?r=[new JI(">=0.0.0-0")]:r=[new JI(">=0.0.0")]}if(e.length===1&&e[0].semver===vv){if(t.includePrerelease)return!0;e=[new JI(">=0.0.0")]}let i=new Set,n,s;for(let h of r)h.operator===">"||h.operator===">="?n=DY(n,h,t):h.operator==="<"||h.operator==="<="?s=kY(s,h,t):i.add(h.semver);if(i.size>1)return null;let o;if(n&&s){if(o=xv(n.semver,s.semver,t),o>0)return null;if(o===0&&(n.operator!==">="||s.operator!=="<="))return null}for(let h of i){if(n&&!Id(h,String(n),t)||s&&!Id(h,String(s),t))return null;for(let p of e)if(!Id(h,String(p),t))return!1;return!0}let a,l,c,u,g=s&&!t.includePrerelease&&s.semver.prerelease.length?s.semver:!1,f=n&&!t.includePrerelease&&n.semver.prerelease.length?n.semver:!1;g&&g.prerelease.length===1&&s.operator==="<"&&g.prerelease[0]===0&&(g=!1);for(let h of e){if(u=u||h.operator===">"||h.operator===">=",c=c||h.operator==="<"||h.operator==="<=",n){if(f&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===f.major&&h.semver.minor===f.minor&&h.semver.patch===f.patch&&(f=!1),h.operator===">"||h.operator===">="){if(a=DY(n,h,t),a===h&&a!==n)return!1}else if(n.operator===">="&&!Id(n.semver,String(h),t))return!1}if(s){if(g&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===g.major&&h.semver.minor===g.minor&&h.semver.patch===g.patch&&(g=!1),h.operator==="<"||h.operator==="<="){if(l=kY(s,h,t),l===h&&l!==s)return!1}else if(s.operator==="<="&&!Id(s.semver,String(h),t))return!1}if(!h.operator&&(s||n)&&o!==0)return!1}return!(n&&c&&!s&&o!==0||s&&u&&!n&&o!==0||f||g)},DY=(r,e,t)=>{if(!r)return e;let i=xv(r.semver,e.semver,t);return i>0?r:i<0||e.operator===">"&&r.operator===">="?e:r},kY=(r,e,t)=>{if(!r)return e;let i=xv(r.semver,e.semver,t);return i<0?r:i>0||e.operator==="<"&&r.operator==="<="?e:r};RY.exports=gEe});var Xr=w((z$e,NY)=>{var Pv=ac();NY.exports={re:Pv.re,src:Pv.src,tokens:Pv.t,SEMVER_SPEC_VERSION:cd().SEMVER_SPEC_VERSION,SemVer:Ti(),compareIdentifiers:FI().compareIdentifiers,rcompareIdentifiers:FI().rcompareIdentifiers,parse:Ac(),valid:nG(),clean:oG(),inc:AG(),diff:hG(),major:dG(),minor:mG(),patch:IG(),prerelease:wG(),compare:As(),rcompare:QG(),compareLoose:SG(),compareBuild:OI(),sort:DG(),rsort:RG(),gt:hd(),lt:MI(),eq:TI(),neq:Cv(),gte:KI(),lte:UI(),cmp:mv(),coerce:UG(),Comparator:Cd(),Range:ls(),satisfies:Ed(),toComparators:oY(),maxSatisfying:AY(),minSatisfying:cY(),minVersion:fY(),validRange:pY(),outside:qI(),gtr:yY(),ltr:BY(),intersects:SY(),simplifyRange:xY(),subset:FY()}});var Dv=w(WI=>{"use strict";Object.defineProperty(WI,"__esModule",{value:!0});WI.VERSION=void 0;WI.VERSION="9.1.0"});var Gt=w((exports,module)=>{"use strict";var __spreadArray=exports&&exports.__spreadArray||function(r,e,t){if(t||arguments.length===2)for(var i=0,n=e.length,s;i{(function(r,e){typeof define=="function"&&define.amd?define([],e):typeof zI=="object"&&zI.exports?zI.exports=e():r.regexpToAst=e()})(typeof self<"u"?self:LY,function(){function r(){}r.prototype.saveState=function(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}},r.prototype.restoreState=function(p){this.idx=p.idx,this.input=p.input,this.groupIdx=p.groupIdx},r.prototype.pattern=function(p){this.idx=0,this.input=p,this.groupIdx=0,this.consumeChar("/");var C=this.disjunction();this.consumeChar("/");for(var y={type:"Flags",loc:{begin:this.idx,end:p.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};this.isRegExpFlag();)switch(this.popChar()){case"g":o(y,"global");break;case"i":o(y,"ignoreCase");break;case"m":o(y,"multiLine");break;case"u":o(y,"unicode");break;case"y":o(y,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:y,value:C,loc:this.loc(0)}},r.prototype.disjunction=function(){var p=[],C=this.idx;for(p.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),p.push(this.alternative());return{type:"Disjunction",value:p,loc:this.loc(C)}},r.prototype.alternative=function(){for(var p=[],C=this.idx;this.isTerm();)p.push(this.term());return{type:"Alternative",value:p,loc:this.loc(C)}},r.prototype.term=function(){return this.isAssertion()?this.assertion():this.atom()},r.prototype.assertion=function(){var p=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(p)};case"$":return{type:"EndAnchor",loc:this.loc(p)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(p)};case"B":return{type:"NonWordBoundary",loc:this.loc(p)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");var C;switch(this.popChar()){case"=":C="Lookahead";break;case"!":C="NegativeLookahead";break}a(C);var y=this.disjunction();return this.consumeChar(")"),{type:C,value:y,loc:this.loc(p)}}l()},r.prototype.quantifier=function(p){var C,y=this.idx;switch(this.popChar()){case"*":C={atLeast:0,atMost:1/0};break;case"+":C={atLeast:1,atMost:1/0};break;case"?":C={atLeast:0,atMost:1};break;case"{":var B=this.integerIncludingZero();switch(this.popChar()){case"}":C={atLeast:B,atMost:B};break;case",":var v;this.isDigit()?(v=this.integerIncludingZero(),C={atLeast:B,atMost:v}):C={atLeast:B,atMost:1/0},this.consumeChar("}");break}if(p===!0&&C===void 0)return;a(C);break}if(!(p===!0&&C===void 0))return a(C),this.peekChar(0)==="?"?(this.consumeChar("?"),C.greedy=!1):C.greedy=!0,C.type="Quantifier",C.loc=this.loc(y),C},r.prototype.atom=function(){var p,C=this.idx;switch(this.peekChar()){case".":p=this.dotAll();break;case"\\":p=this.atomEscape();break;case"[":p=this.characterClass();break;case"(":p=this.group();break}return p===void 0&&this.isPatternCharacter()&&(p=this.patternCharacter()),a(p),p.loc=this.loc(C),this.isQuantifier()&&(p.quantifier=this.quantifier()),p},r.prototype.dotAll=function(){return this.consumeChar("."),{type:"Set",complement:!0,value:[n(` +`),n("\r"),n("\u2028"),n("\u2029")]}},r.prototype.atomEscape=function(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}},r.prototype.decimalEscapeAtom=function(){var p=this.positiveInteger();return{type:"GroupBackReference",value:p}},r.prototype.characterClassEscape=function(){var p,C=!1;switch(this.popChar()){case"d":p=u;break;case"D":p=u,C=!0;break;case"s":p=f;break;case"S":p=f,C=!0;break;case"w":p=g;break;case"W":p=g,C=!0;break}return a(p),{type:"Set",value:p,complement:C}},r.prototype.controlEscapeAtom=function(){var p;switch(this.popChar()){case"f":p=n("\f");break;case"n":p=n(` +`);break;case"r":p=n("\r");break;case"t":p=n(" ");break;case"v":p=n("\v");break}return a(p),{type:"Character",value:p}},r.prototype.controlLetterEscapeAtom=function(){this.consumeChar("c");var p=this.popChar();if(/[a-zA-Z]/.test(p)===!1)throw Error("Invalid ");var C=p.toUpperCase().charCodeAt(0)-64;return{type:"Character",value:C}},r.prototype.nulCharacterAtom=function(){return this.consumeChar("0"),{type:"Character",value:n("\0")}},r.prototype.hexEscapeSequenceAtom=function(){return this.consumeChar("x"),this.parseHexDigits(2)},r.prototype.regExpUnicodeEscapeSequenceAtom=function(){return this.consumeChar("u"),this.parseHexDigits(4)},r.prototype.identityEscapeAtom=function(){var p=this.popChar();return{type:"Character",value:n(p)}},r.prototype.classPatternCharacterAtom=function(){switch(this.peekChar()){case` +`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:var p=this.popChar();return{type:"Character",value:n(p)}}},r.prototype.characterClass=function(){var p=[],C=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),C=!0);this.isClassAtom();){var y=this.classAtom(),B=y.type==="Character";if(B&&this.isRangeDash()){this.consumeChar("-");var v=this.classAtom(),D=v.type==="Character";if(D){if(v.value=this.input.length)throw Error("Unexpected end of input");this.idx++},r.prototype.loc=function(p){return{begin:p,end:this.idx}};var e=/[0-9a-fA-F]/,t=/[0-9]/,i=/[1-9]/;function n(p){return p.charCodeAt(0)}function s(p,C){p.length!==void 0?p.forEach(function(y){C.push(y)}):C.push(p)}function o(p,C){if(p[C]===!0)throw"duplicate flag "+C;p[C]=!0}function a(p){if(p===void 0)throw Error("Internal Error - Should never get here!")}function l(){throw Error("Internal Error - Should never get here!")}var c,u=[];for(c=n("0");c<=n("9");c++)u.push(c);var g=[n("_")].concat(u);for(c=n("a");c<=n("z");c++)g.push(c);for(c=n("A");c<=n("Z");c++)g.push(c);var f=[n(" "),n("\f"),n(` +`),n("\r"),n(" "),n("\v"),n(" "),n("\xA0"),n("\u1680"),n("\u2000"),n("\u2001"),n("\u2002"),n("\u2003"),n("\u2004"),n("\u2005"),n("\u2006"),n("\u2007"),n("\u2008"),n("\u2009"),n("\u200A"),n("\u2028"),n("\u2029"),n("\u202F"),n("\u205F"),n("\u3000"),n("\uFEFF")];function h(){}return h.prototype.visitChildren=function(p){for(var C in p){var y=p[C];p.hasOwnProperty(C)&&(y.type!==void 0?this.visit(y):Array.isArray(y)&&y.forEach(function(B){this.visit(B)},this))}},h.prototype.visit=function(p){switch(p.type){case"Pattern":this.visitPattern(p);break;case"Flags":this.visitFlags(p);break;case"Disjunction":this.visitDisjunction(p);break;case"Alternative":this.visitAlternative(p);break;case"StartAnchor":this.visitStartAnchor(p);break;case"EndAnchor":this.visitEndAnchor(p);break;case"WordBoundary":this.visitWordBoundary(p);break;case"NonWordBoundary":this.visitNonWordBoundary(p);break;case"Lookahead":this.visitLookahead(p);break;case"NegativeLookahead":this.visitNegativeLookahead(p);break;case"Character":this.visitCharacter(p);break;case"Set":this.visitSet(p);break;case"Group":this.visitGroup(p);break;case"GroupBackReference":this.visitGroupBackReference(p);break;case"Quantifier":this.visitQuantifier(p);break}this.visitChildren(p)},h.prototype.visitPattern=function(p){},h.prototype.visitFlags=function(p){},h.prototype.visitDisjunction=function(p){},h.prototype.visitAlternative=function(p){},h.prototype.visitStartAnchor=function(p){},h.prototype.visitEndAnchor=function(p){},h.prototype.visitWordBoundary=function(p){},h.prototype.visitNonWordBoundary=function(p){},h.prototype.visitLookahead=function(p){},h.prototype.visitNegativeLookahead=function(p){},h.prototype.visitCharacter=function(p){},h.prototype.visitSet=function(p){},h.prototype.visitGroup=function(p){},h.prototype.visitGroupBackReference=function(p){},h.prototype.visitQuantifier=function(p){},{RegExpParser:r,BaseRegExpVisitor:h,VERSION:"0.5.0"}})});var ZI=w(Wg=>{"use strict";Object.defineProperty(Wg,"__esModule",{value:!0});Wg.clearRegExpParserCache=Wg.getRegExpAst=void 0;var hEe=VI(),XI={},pEe=new hEe.RegExpParser;function dEe(r){var e=r.toString();if(XI.hasOwnProperty(e))return XI[e];var t=pEe.pattern(e);return XI[e]=t,t}Wg.getRegExpAst=dEe;function CEe(){XI={}}Wg.clearRegExpParserCache=CEe});var UY=w(pn=>{"use strict";var mEe=pn&&pn.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(pn,"__esModule",{value:!0});pn.canMatchCharCode=pn.firstCharOptimizedIndices=pn.getOptimizedStartCodesIndices=pn.failedOptimizationPrefixMsg=void 0;var OY=VI(),cs=Gt(),MY=ZI(),Sa=Rv(),KY="Complement Sets are not supported for first char optimization";pn.failedOptimizationPrefixMsg=`Unable to use "first char" lexer optimizations: +`;function EEe(r,e){e===void 0&&(e=!1);try{var t=(0,MY.getRegExpAst)(r),i=$I(t.value,{},t.flags.ignoreCase);return i}catch(s){if(s.message===KY)e&&(0,cs.PRINT_WARNING)(""+pn.failedOptimizationPrefixMsg+(" Unable to optimize: < "+r.toString()+` > +`)+` Complement Sets cannot be automatically optimized. + This will disable the lexer's first char optimizations. + See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{var n="";e&&(n=` + This will disable the lexer's first char optimizations. + See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),(0,cs.PRINT_ERROR)(pn.failedOptimizationPrefixMsg+` +`+(" Failed parsing: < "+r.toString()+` > +`)+(" Using the regexp-to-ast library version: "+OY.VERSION+` +`)+" Please open an issue at: https://github.com/bd82/regexp-to-ast/issues"+n)}}return[]}pn.getOptimizedStartCodesIndices=EEe;function $I(r,e,t){switch(r.type){case"Disjunction":for(var i=0;i=Sa.minOptimizationVal)for(var f=u.from>=Sa.minOptimizationVal?u.from:Sa.minOptimizationVal,h=u.to,p=(0,Sa.charCodeToOptimizedIndex)(f),C=(0,Sa.charCodeToOptimizedIndex)(h),y=p;y<=C;y++)e[y]=y}}});break;case"Group":$I(o.value,e,t);break;default:throw Error("Non Exhaustive Match")}var a=o.quantifier!==void 0&&o.quantifier.atLeast===0;if(o.type==="Group"&&kv(o)===!1||o.type!=="Group"&&a===!1)break}break;default:throw Error("non exhaustive match!")}return(0,cs.values)(e)}pn.firstCharOptimizedIndices=$I;function _I(r,e,t){var i=(0,Sa.charCodeToOptimizedIndex)(r);e[i]=i,t===!0&&IEe(r,e)}function IEe(r,e){var t=String.fromCharCode(r),i=t.toUpperCase();if(i!==t){var n=(0,Sa.charCodeToOptimizedIndex)(i.charCodeAt(0));e[n]=n}else{var s=t.toLowerCase();if(s!==t){var n=(0,Sa.charCodeToOptimizedIndex)(s.charCodeAt(0));e[n]=n}}}function TY(r,e){return(0,cs.find)(r.value,function(t){if(typeof t=="number")return(0,cs.contains)(e,t);var i=t;return(0,cs.find)(e,function(n){return i.from<=n&&n<=i.to})!==void 0})}function kv(r){return r.quantifier&&r.quantifier.atLeast===0?!0:r.value?(0,cs.isArray)(r.value)?(0,cs.every)(r.value,kv):kv(r.value):!1}var yEe=function(r){mEe(e,r);function e(t){var i=r.call(this)||this;return i.targetCharCodes=t,i.found=!1,i}return e.prototype.visitChildren=function(t){if(this.found!==!0){switch(t.type){case"Lookahead":this.visitLookahead(t);return;case"NegativeLookahead":this.visitNegativeLookahead(t);return}r.prototype.visitChildren.call(this,t)}},e.prototype.visitCharacter=function(t){(0,cs.contains)(this.targetCharCodes,t.value)&&(this.found=!0)},e.prototype.visitSet=function(t){t.complement?TY(t,this.targetCharCodes)===void 0&&(this.found=!0):TY(t,this.targetCharCodes)!==void 0&&(this.found=!0)},e}(OY.BaseRegExpVisitor);function wEe(r,e){if(e instanceof RegExp){var t=(0,MY.getRegExpAst)(e),i=new yEe(r);return i.visit(t),i.found}else return(0,cs.find)(e,function(n){return(0,cs.contains)(r,n.charCodeAt(0))})!==void 0}pn.canMatchCharCode=wEe});var Rv=w(Ve=>{"use strict";var HY=Ve&&Ve.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Ve,"__esModule",{value:!0});Ve.charCodeToOptimizedIndex=Ve.minOptimizationVal=Ve.buildLineBreakIssueMessage=Ve.LineTerminatorOptimizedTester=Ve.isShortPattern=Ve.isCustomPattern=Ve.cloneEmptyGroups=Ve.performWarningRuntimeChecks=Ve.performRuntimeChecks=Ve.addStickyFlag=Ve.addStartOfInput=Ve.findUnreachablePatterns=Ve.findModesThatDoNotExist=Ve.findInvalidGroupType=Ve.findDuplicatePatterns=Ve.findUnsupportedFlags=Ve.findStartOfInputAnchor=Ve.findEmptyMatchRegExps=Ve.findEndOfInputAnchor=Ve.findInvalidPatterns=Ve.findMissingPatterns=Ve.validatePatterns=Ve.analyzeTokenTypes=Ve.enableSticky=Ve.disableSticky=Ve.SUPPORT_STICKY=Ve.MODES=Ve.DEFAULT_MODE=void 0;var GY=VI(),ir=yd(),xe=Gt(),zg=UY(),YY=ZI(),Do="PATTERN";Ve.DEFAULT_MODE="defaultMode";Ve.MODES="modes";Ve.SUPPORT_STICKY=typeof new RegExp("(?:)").sticky=="boolean";function BEe(){Ve.SUPPORT_STICKY=!1}Ve.disableSticky=BEe;function QEe(){Ve.SUPPORT_STICKY=!0}Ve.enableSticky=QEe;function bEe(r,e){e=(0,xe.defaults)(e,{useSticky:Ve.SUPPORT_STICKY,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",` +`],tracer:function(v,D){return D()}});var t=e.tracer;t("initCharCodeToOptimizedIndexMap",function(){LEe()});var i;t("Reject Lexer.NA",function(){i=(0,xe.reject)(r,function(v){return v[Do]===ir.Lexer.NA})});var n=!1,s;t("Transform Patterns",function(){n=!1,s=(0,xe.map)(i,function(v){var D=v[Do];if((0,xe.isRegExp)(D)){var L=D.source;return L.length===1&&L!=="^"&&L!=="$"&&L!=="."&&!D.ignoreCase?L:L.length===2&&L[0]==="\\"&&!(0,xe.contains)(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],L[1])?L[1]:e.useSticky?Lv(D):Nv(D)}else{if((0,xe.isFunction)(D))return n=!0,{exec:D};if((0,xe.has)(D,"exec"))return n=!0,D;if(typeof D=="string"){if(D.length===1)return D;var H=D.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),j=new RegExp(H);return e.useSticky?Lv(j):Nv(j)}else throw Error("non exhaustive match")}})});var o,a,l,c,u;t("misc mapping",function(){o=(0,xe.map)(i,function(v){return v.tokenTypeIdx}),a=(0,xe.map)(i,function(v){var D=v.GROUP;if(D!==ir.Lexer.SKIPPED){if((0,xe.isString)(D))return D;if((0,xe.isUndefined)(D))return!1;throw Error("non exhaustive match")}}),l=(0,xe.map)(i,function(v){var D=v.LONGER_ALT;if(D){var L=(0,xe.isArray)(D)?(0,xe.map)(D,function(H){return(0,xe.indexOf)(i,H)}):[(0,xe.indexOf)(i,D)];return L}}),c=(0,xe.map)(i,function(v){return v.PUSH_MODE}),u=(0,xe.map)(i,function(v){return(0,xe.has)(v,"POP_MODE")})});var g;t("Line Terminator Handling",function(){var v=ij(e.lineTerminatorCharacters);g=(0,xe.map)(i,function(D){return!1}),e.positionTracking!=="onlyOffset"&&(g=(0,xe.map)(i,function(D){if((0,xe.has)(D,"LINE_BREAKS"))return D.LINE_BREAKS;if(tj(D,v)===!1)return(0,zg.canMatchCharCode)(v,D.PATTERN)}))});var f,h,p,C;t("Misc Mapping #2",function(){f=(0,xe.map)(i,Ov),h=(0,xe.map)(s,ej),p=(0,xe.reduce)(i,function(v,D){var L=D.GROUP;return(0,xe.isString)(L)&&L!==ir.Lexer.SKIPPED&&(v[L]=[]),v},{}),C=(0,xe.map)(s,function(v,D){return{pattern:s[D],longerAlt:l[D],canLineTerminator:g[D],isCustom:f[D],short:h[D],group:a[D],push:c[D],pop:u[D],tokenTypeIdx:o[D],tokenType:i[D]}})});var y=!0,B=[];return e.safeMode||t("First Char Optimization",function(){B=(0,xe.reduce)(i,function(v,D,L){if(typeof D.PATTERN=="string"){var H=D.PATTERN.charCodeAt(0),j=Tv(H);Fv(v,j,C[L])}else if((0,xe.isArray)(D.START_CHARS_HINT)){var $;(0,xe.forEach)(D.START_CHARS_HINT,function(W){var _=typeof W=="string"?W.charCodeAt(0):W,A=Tv(_);$!==A&&($=A,Fv(v,A,C[L]))})}else if((0,xe.isRegExp)(D.PATTERN))if(D.PATTERN.unicode)y=!1,e.ensureOptimizations&&(0,xe.PRINT_ERROR)(""+zg.failedOptimizationPrefixMsg+(" Unable to analyze < "+D.PATTERN.toString()+` > pattern. +`)+` The regexp unicode flag is not currently supported by the regexp-to-ast library. + This will disable the lexer's first char optimizations. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{var V=(0,zg.getOptimizedStartCodesIndices)(D.PATTERN,e.ensureOptimizations);(0,xe.isEmpty)(V)&&(y=!1),(0,xe.forEach)(V,function(W){Fv(v,W,C[L])})}else e.ensureOptimizations&&(0,xe.PRINT_ERROR)(""+zg.failedOptimizationPrefixMsg+(" TokenType: <"+D.name+`> is using a custom token pattern without providing parameter. +`)+` This will disable the lexer's first char optimizations. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),y=!1;return v},[])}),t("ArrayPacking",function(){B=(0,xe.packArray)(B)}),{emptyGroups:p,patternIdxToConfig:C,charCodeToPatternIdxToConfig:B,hasCustom:n,canBeOptimized:y}}Ve.analyzeTokenTypes=bEe;function SEe(r,e){var t=[],i=jY(r);t=t.concat(i.errors);var n=qY(i.valid),s=n.valid;return t=t.concat(n.errors),t=t.concat(vEe(s)),t=t.concat(ZY(s)),t=t.concat(_Y(s,e)),t=t.concat($Y(s)),t}Ve.validatePatterns=SEe;function vEe(r){var e=[],t=(0,xe.filter)(r,function(i){return(0,xe.isRegExp)(i[Do])});return e=e.concat(JY(t)),e=e.concat(zY(t)),e=e.concat(VY(t)),e=e.concat(XY(t)),e=e.concat(WY(t)),e}function jY(r){var e=(0,xe.filter)(r,function(n){return!(0,xe.has)(n,Do)}),t=(0,xe.map)(e,function(n){return{message:"Token Type: ->"+n.name+"<- missing static 'PATTERN' property",type:ir.LexerDefinitionErrorType.MISSING_PATTERN,tokenTypes:[n]}}),i=(0,xe.difference)(r,e);return{errors:t,valid:i}}Ve.findMissingPatterns=jY;function qY(r){var e=(0,xe.filter)(r,function(n){var s=n[Do];return!(0,xe.isRegExp)(s)&&!(0,xe.isFunction)(s)&&!(0,xe.has)(s,"exec")&&!(0,xe.isString)(s)}),t=(0,xe.map)(e,function(n){return{message:"Token Type: ->"+n.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:ir.LexerDefinitionErrorType.INVALID_PATTERN,tokenTypes:[n]}}),i=(0,xe.difference)(r,e);return{errors:t,valid:i}}Ve.findInvalidPatterns=qY;var xEe=/[^\\][\$]/;function JY(r){var e=function(n){HY(s,n);function s(){var o=n!==null&&n.apply(this,arguments)||this;return o.found=!1,o}return s.prototype.visitEndAnchor=function(o){this.found=!0},s}(GY.BaseRegExpVisitor),t=(0,xe.filter)(r,function(n){var s=n[Do];try{var o=(0,YY.getRegExpAst)(s),a=new e;return a.visit(o),a.found}catch{return xEe.test(s.source)}}),i=(0,xe.map)(t,function(n){return{message:`Unexpected RegExp Anchor Error: + Token Type: ->`+n.name+`<- static 'PATTERN' cannot contain end of input anchor '$' + See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:ir.LexerDefinitionErrorType.EOI_ANCHOR_FOUND,tokenTypes:[n]}});return i}Ve.findEndOfInputAnchor=JY;function WY(r){var e=(0,xe.filter)(r,function(i){var n=i[Do];return n.test("")}),t=(0,xe.map)(e,function(i){return{message:"Token Type: ->"+i.name+"<- static 'PATTERN' must not match an empty string",type:ir.LexerDefinitionErrorType.EMPTY_MATCH_PATTERN,tokenTypes:[i]}});return t}Ve.findEmptyMatchRegExps=WY;var PEe=/[^\\[][\^]|^\^/;function zY(r){var e=function(n){HY(s,n);function s(){var o=n!==null&&n.apply(this,arguments)||this;return o.found=!1,o}return s.prototype.visitStartAnchor=function(o){this.found=!0},s}(GY.BaseRegExpVisitor),t=(0,xe.filter)(r,function(n){var s=n[Do];try{var o=(0,YY.getRegExpAst)(s),a=new e;return a.visit(o),a.found}catch{return PEe.test(s.source)}}),i=(0,xe.map)(t,function(n){return{message:`Unexpected RegExp Anchor Error: + Token Type: ->`+n.name+`<- static 'PATTERN' cannot contain start of input anchor '^' + See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:ir.LexerDefinitionErrorType.SOI_ANCHOR_FOUND,tokenTypes:[n]}});return i}Ve.findStartOfInputAnchor=zY;function VY(r){var e=(0,xe.filter)(r,function(i){var n=i[Do];return n instanceof RegExp&&(n.multiline||n.global)}),t=(0,xe.map)(e,function(i){return{message:"Token Type: ->"+i.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:ir.LexerDefinitionErrorType.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[i]}});return t}Ve.findUnsupportedFlags=VY;function XY(r){var e=[],t=(0,xe.map)(r,function(s){return(0,xe.reduce)(r,function(o,a){return s.PATTERN.source===a.PATTERN.source&&!(0,xe.contains)(e,a)&&a.PATTERN!==ir.Lexer.NA&&(e.push(a),o.push(a)),o},[])});t=(0,xe.compact)(t);var i=(0,xe.filter)(t,function(s){return s.length>1}),n=(0,xe.map)(i,function(s){var o=(0,xe.map)(s,function(l){return l.name}),a=(0,xe.first)(s).PATTERN;return{message:"The same RegExp pattern ->"+a+"<-"+("has been used in all of the following Token Types: "+o.join(", ")+" <-"),type:ir.LexerDefinitionErrorType.DUPLICATE_PATTERNS_FOUND,tokenTypes:s}});return n}Ve.findDuplicatePatterns=XY;function ZY(r){var e=(0,xe.filter)(r,function(i){if(!(0,xe.has)(i,"GROUP"))return!1;var n=i.GROUP;return n!==ir.Lexer.SKIPPED&&n!==ir.Lexer.NA&&!(0,xe.isString)(n)}),t=(0,xe.map)(e,function(i){return{message:"Token Type: ->"+i.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:ir.LexerDefinitionErrorType.INVALID_GROUP_TYPE_FOUND,tokenTypes:[i]}});return t}Ve.findInvalidGroupType=ZY;function _Y(r,e){var t=(0,xe.filter)(r,function(n){return n.PUSH_MODE!==void 0&&!(0,xe.contains)(e,n.PUSH_MODE)}),i=(0,xe.map)(t,function(n){var s="Token Type: ->"+n.name+"<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->"+n.PUSH_MODE+"<-which does not exist";return{message:s,type:ir.LexerDefinitionErrorType.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[n]}});return i}Ve.findModesThatDoNotExist=_Y;function $Y(r){var e=[],t=(0,xe.reduce)(r,function(i,n,s){var o=n.PATTERN;return o===ir.Lexer.NA||((0,xe.isString)(o)?i.push({str:o,idx:s,tokenType:n}):(0,xe.isRegExp)(o)&&kEe(o)&&i.push({str:o.source,idx:s,tokenType:n})),i},[]);return(0,xe.forEach)(r,function(i,n){(0,xe.forEach)(t,function(s){var o=s.str,a=s.idx,l=s.tokenType;if(n"+i.name+"<-")+`in the lexer's definition. +See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:c,type:ir.LexerDefinitionErrorType.UNREACHABLE_PATTERN,tokenTypes:[i,l]})}})}),e}Ve.findUnreachablePatterns=$Y;function DEe(r,e){if((0,xe.isRegExp)(e)){var t=e.exec(r);return t!==null&&t.index===0}else{if((0,xe.isFunction)(e))return e(r,0,[],{});if((0,xe.has)(e,"exec"))return e.exec(r,0,[],{});if(typeof e=="string")return e===r;throw Error("non exhaustive match")}}function kEe(r){var e=[".","\\","[","]","|","^","$","(",")","?","*","+","{"];return(0,xe.find)(e,function(t){return r.source.indexOf(t)!==-1})===void 0}function Nv(r){var e=r.ignoreCase?"i":"";return new RegExp("^(?:"+r.source+")",e)}Ve.addStartOfInput=Nv;function Lv(r){var e=r.ignoreCase?"iy":"y";return new RegExp(""+r.source,e)}Ve.addStickyFlag=Lv;function REe(r,e,t){var i=[];return(0,xe.has)(r,Ve.DEFAULT_MODE)||i.push({message:"A MultiMode Lexer cannot be initialized without a <"+Ve.DEFAULT_MODE+`> property in its definition +`,type:ir.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),(0,xe.has)(r,Ve.MODES)||i.push({message:"A MultiMode Lexer cannot be initialized without a <"+Ve.MODES+`> property in its definition +`,type:ir.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),(0,xe.has)(r,Ve.MODES)&&(0,xe.has)(r,Ve.DEFAULT_MODE)&&!(0,xe.has)(r.modes,r.defaultMode)&&i.push({message:"A MultiMode Lexer cannot be initialized with a "+Ve.DEFAULT_MODE+": <"+r.defaultMode+`>which does not exist +`,type:ir.LexerDefinitionErrorType.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),(0,xe.has)(r,Ve.MODES)&&(0,xe.forEach)(r.modes,function(n,s){(0,xe.forEach)(n,function(o,a){(0,xe.isUndefined)(o)&&i.push({message:"A Lexer cannot be initialized using an undefined Token Type. Mode:"+("<"+s+"> at index: <"+a+`> +`),type:ir.LexerDefinitionErrorType.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED})})}),i}Ve.performRuntimeChecks=REe;function FEe(r,e,t){var i=[],n=!1,s=(0,xe.compact)((0,xe.flatten)((0,xe.mapValues)(r.modes,function(l){return l}))),o=(0,xe.reject)(s,function(l){return l[Do]===ir.Lexer.NA}),a=ij(t);return e&&(0,xe.forEach)(o,function(l){var c=tj(l,a);if(c!==!1){var u=rj(l,c),g={message:u,type:c.issue,tokenType:l};i.push(g)}else(0,xe.has)(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(n=!0):(0,zg.canMatchCharCode)(a,l.PATTERN)&&(n=!0)}),e&&!n&&i.push({message:`Warning: No LINE_BREAKS Found. + This Lexer has been defined to track line and column information, + But none of the Token Types can be identified as matching a line terminator. + See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS + for details.`,type:ir.LexerDefinitionErrorType.NO_LINE_BREAKS_FLAGS}),i}Ve.performWarningRuntimeChecks=FEe;function NEe(r){var e={},t=(0,xe.keys)(r);return(0,xe.forEach)(t,function(i){var n=r[i];if((0,xe.isArray)(n))e[i]=[];else throw Error("non exhaustive match")}),e}Ve.cloneEmptyGroups=NEe;function Ov(r){var e=r.PATTERN;if((0,xe.isRegExp)(e))return!1;if((0,xe.isFunction)(e))return!0;if((0,xe.has)(e,"exec"))return!0;if((0,xe.isString)(e))return!1;throw Error("non exhaustive match")}Ve.isCustomPattern=Ov;function ej(r){return(0,xe.isString)(r)&&r.length===1?r.charCodeAt(0):!1}Ve.isShortPattern=ej;Ve.LineTerminatorOptimizedTester={test:function(r){for(var e=r.length,t=this.lastIndex;t Token Type +`)+(" Root cause: "+e.errMsg+`. +`)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR";if(e.issue===ir.LexerDefinitionErrorType.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the option. +`+(" The problem is in the <"+r.name+`> Token Type +`)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK";throw Error("non exhaustive match")}Ve.buildLineBreakIssueMessage=rj;function ij(r){var e=(0,xe.map)(r,function(t){return(0,xe.isString)(t)&&t.length>0?t.charCodeAt(0):t});return e}function Fv(r,e,t){r[e]===void 0?r[e]=[t]:r[e].push(t)}Ve.minOptimizationVal=256;var ey=[];function Tv(r){return r255?255+~~(r/255):r}}});var Vg=w(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.isTokenType=Nt.hasExtendingTokensTypesMapProperty=Nt.hasExtendingTokensTypesProperty=Nt.hasCategoriesProperty=Nt.hasShortKeyProperty=Nt.singleAssignCategoriesToksMap=Nt.assignCategoriesMapProp=Nt.assignCategoriesTokensProp=Nt.assignTokenDefaultProps=Nt.expandCategories=Nt.augmentTokenTypes=Nt.tokenIdxToClass=Nt.tokenShortNameIdx=Nt.tokenStructuredMatcherNoCategories=Nt.tokenStructuredMatcher=void 0;var Zr=Gt();function TEe(r,e){var t=r.tokenTypeIdx;return t===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[t]===!0}Nt.tokenStructuredMatcher=TEe;function OEe(r,e){return r.tokenTypeIdx===e.tokenTypeIdx}Nt.tokenStructuredMatcherNoCategories=OEe;Nt.tokenShortNameIdx=1;Nt.tokenIdxToClass={};function MEe(r){var e=nj(r);sj(e),aj(e),oj(e),(0,Zr.forEach)(e,function(t){t.isParent=t.categoryMatches.length>0})}Nt.augmentTokenTypes=MEe;function nj(r){for(var e=(0,Zr.cloneArr)(r),t=r,i=!0;i;){t=(0,Zr.compact)((0,Zr.flatten)((0,Zr.map)(t,function(s){return s.CATEGORIES})));var n=(0,Zr.difference)(t,e);e=e.concat(n),(0,Zr.isEmpty)(n)?i=!1:t=n}return e}Nt.expandCategories=nj;function sj(r){(0,Zr.forEach)(r,function(e){Aj(e)||(Nt.tokenIdxToClass[Nt.tokenShortNameIdx]=e,e.tokenTypeIdx=Nt.tokenShortNameIdx++),Mv(e)&&!(0,Zr.isArray)(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),Mv(e)||(e.CATEGORIES=[]),lj(e)||(e.categoryMatches=[]),cj(e)||(e.categoryMatchesMap={})})}Nt.assignTokenDefaultProps=sj;function oj(r){(0,Zr.forEach)(r,function(e){e.categoryMatches=[],(0,Zr.forEach)(e.categoryMatchesMap,function(t,i){e.categoryMatches.push(Nt.tokenIdxToClass[i].tokenTypeIdx)})})}Nt.assignCategoriesTokensProp=oj;function aj(r){(0,Zr.forEach)(r,function(e){Kv([],e)})}Nt.assignCategoriesMapProp=aj;function Kv(r,e){(0,Zr.forEach)(r,function(t){e.categoryMatchesMap[t.tokenTypeIdx]=!0}),(0,Zr.forEach)(e.CATEGORIES,function(t){var i=r.concat(e);(0,Zr.contains)(i,t)||Kv(i,t)})}Nt.singleAssignCategoriesToksMap=Kv;function Aj(r){return(0,Zr.has)(r,"tokenTypeIdx")}Nt.hasShortKeyProperty=Aj;function Mv(r){return(0,Zr.has)(r,"CATEGORIES")}Nt.hasCategoriesProperty=Mv;function lj(r){return(0,Zr.has)(r,"categoryMatches")}Nt.hasExtendingTokensTypesProperty=lj;function cj(r){return(0,Zr.has)(r,"categoryMatchesMap")}Nt.hasExtendingTokensTypesMapProperty=cj;function KEe(r){return(0,Zr.has)(r,"tokenTypeIdx")}Nt.isTokenType=KEe});var Uv=w(ty=>{"use strict";Object.defineProperty(ty,"__esModule",{value:!0});ty.defaultLexerErrorProvider=void 0;ty.defaultLexerErrorProvider={buildUnableToPopLexerModeMessage:function(r){return"Unable to pop Lexer Mode after encountering Token ->"+r.image+"<- The Mode Stack is empty"},buildUnexpectedCharactersMessage:function(r,e,t,i,n){return"unexpected character: ->"+r.charAt(e)+"<- at offset: "+e+","+(" skipped "+t+" characters.")}}});var yd=w(fc=>{"use strict";Object.defineProperty(fc,"__esModule",{value:!0});fc.Lexer=fc.LexerDefinitionErrorType=void 0;var Xs=Rv(),nr=Gt(),UEe=Vg(),HEe=Uv(),GEe=ZI(),YEe;(function(r){r[r.MISSING_PATTERN=0]="MISSING_PATTERN",r[r.INVALID_PATTERN=1]="INVALID_PATTERN",r[r.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",r[r.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",r[r.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",r[r.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",r[r.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",r[r.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",r[r.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",r[r.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",r[r.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",r[r.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",r[r.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",r[r.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",r[r.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",r[r.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",r[r.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK"})(YEe=fc.LexerDefinitionErrorType||(fc.LexerDefinitionErrorType={}));var wd={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[` +`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:HEe.defaultLexerErrorProvider,traceInitPerf:!1,skipValidations:!1};Object.freeze(wd);var jEe=function(){function r(e,t){var i=this;if(t===void 0&&(t=wd),this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.config=void 0,this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},typeof t=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object. +a boolean 2nd argument is no longer supported`);this.config=(0,nr.merge)(wd,t);var n=this.config.traceInitPerf;n===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof n=="number"&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",function(){var s,o=!0;i.TRACE_INIT("Lexer Config handling",function(){if(i.config.lineTerminatorsPattern===wd.lineTerminatorsPattern)i.config.lineTerminatorsPattern=Xs.LineTerminatorOptimizedTester;else if(i.config.lineTerminatorCharacters===wd.lineTerminatorCharacters)throw Error(`Error: Missing property on the Lexer config. + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(t.safeMode&&t.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');i.trackStartLines=/full|onlyStart/i.test(i.config.positionTracking),i.trackEndLines=/full/i.test(i.config.positionTracking),(0,nr.isArray)(e)?(s={modes:{}},s.modes[Xs.DEFAULT_MODE]=(0,nr.cloneArr)(e),s[Xs.DEFAULT_MODE]=Xs.DEFAULT_MODE):(o=!1,s=(0,nr.cloneObj)(e))}),i.config.skipValidations===!1&&(i.TRACE_INIT("performRuntimeChecks",function(){i.lexerDefinitionErrors=i.lexerDefinitionErrors.concat((0,Xs.performRuntimeChecks)(s,i.trackStartLines,i.config.lineTerminatorCharacters))}),i.TRACE_INIT("performWarningRuntimeChecks",function(){i.lexerDefinitionWarning=i.lexerDefinitionWarning.concat((0,Xs.performWarningRuntimeChecks)(s,i.trackStartLines,i.config.lineTerminatorCharacters))})),s.modes=s.modes?s.modes:{},(0,nr.forEach)(s.modes,function(u,g){s.modes[g]=(0,nr.reject)(u,function(f){return(0,nr.isUndefined)(f)})});var a=(0,nr.keys)(s.modes);if((0,nr.forEach)(s.modes,function(u,g){i.TRACE_INIT("Mode: <"+g+"> processing",function(){if(i.modes.push(g),i.config.skipValidations===!1&&i.TRACE_INIT("validatePatterns",function(){i.lexerDefinitionErrors=i.lexerDefinitionErrors.concat((0,Xs.validatePatterns)(u,a))}),(0,nr.isEmpty)(i.lexerDefinitionErrors)){(0,UEe.augmentTokenTypes)(u);var f;i.TRACE_INIT("analyzeTokenTypes",function(){f=(0,Xs.analyzeTokenTypes)(u,{lineTerminatorCharacters:i.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:i.TRACE_INIT.bind(i)})}),i.patternIdxToConfig[g]=f.patternIdxToConfig,i.charCodeToPatternIdxToConfig[g]=f.charCodeToPatternIdxToConfig,i.emptyGroups=(0,nr.merge)(i.emptyGroups,f.emptyGroups),i.hasCustom=f.hasCustom||i.hasCustom,i.canModeBeOptimized[g]=f.canBeOptimized}})}),i.defaultMode=s.defaultMode,!(0,nr.isEmpty)(i.lexerDefinitionErrors)&&!i.config.deferDefinitionErrorsHandling){var l=(0,nr.map)(i.lexerDefinitionErrors,function(u){return u.message}),c=l.join(`----------------------- +`);throw new Error(`Errors detected in definition of Lexer: +`+c)}(0,nr.forEach)(i.lexerDefinitionWarning,function(u){(0,nr.PRINT_WARNING)(u.message)}),i.TRACE_INIT("Choosing sub-methods implementations",function(){if(Xs.SUPPORT_STICKY?(i.chopInput=nr.IDENTITY,i.match=i.matchWithTest):(i.updateLastIndex=nr.NOOP,i.match=i.matchWithExec),o&&(i.handleModes=nr.NOOP),i.trackStartLines===!1&&(i.computeNewColumn=nr.IDENTITY),i.trackEndLines===!1&&(i.updateTokenEndLineColumnLocation=nr.NOOP),/full/i.test(i.config.positionTracking))i.createTokenInstance=i.createFullToken;else if(/onlyStart/i.test(i.config.positionTracking))i.createTokenInstance=i.createStartOnlyToken;else if(/onlyOffset/i.test(i.config.positionTracking))i.createTokenInstance=i.createOffsetOnlyToken;else throw Error('Invalid config option: "'+i.config.positionTracking+'"');i.hasCustom?(i.addToken=i.addTokenUsingPush,i.handlePayload=i.handlePayloadWithCustom):(i.addToken=i.addTokenUsingMemberAccess,i.handlePayload=i.handlePayloadNoCustom)}),i.TRACE_INIT("Failed Optimization Warnings",function(){var u=(0,nr.reduce)(i.canModeBeOptimized,function(g,f,h){return f===!1&&g.push(h),g},[]);if(t.ensureOptimizations&&!(0,nr.isEmpty)(u))throw Error("Lexer Modes: < "+u.join(", ")+` > cannot be optimized. + Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode. + Or inspect the console log for details on how to resolve these issues.`)}),i.TRACE_INIT("clearRegExpParserCache",function(){(0,GEe.clearRegExpParserCache)()}),i.TRACE_INIT("toFastProperties",function(){(0,nr.toFastProperties)(i)})})}return r.prototype.tokenize=function(e,t){if(t===void 0&&(t=this.defaultMode),!(0,nr.isEmpty)(this.lexerDefinitionErrors)){var i=(0,nr.map)(this.lexerDefinitionErrors,function(o){return o.message}),n=i.join(`----------------------- +`);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer: +`+n)}var s=this.tokenizeInternal(e,t);return s},r.prototype.tokenizeInternal=function(e,t){var i=this,n,s,o,a,l,c,u,g,f,h,p,C,y,B,v,D,L=e,H=L.length,j=0,$=0,V=this.hasCustom?0:Math.floor(e.length/10),W=new Array(V),_=[],A=this.trackStartLines?1:void 0,ae=this.trackStartLines?1:void 0,ge=(0,Xs.cloneEmptyGroups)(this.emptyGroups),re=this.trackStartLines,O=this.config.lineTerminatorsPattern,F=0,ue=[],he=[],ke=[],Fe=[];Object.freeze(Fe);var Ne=void 0;function oe(){return ue}function le(pr){var Ii=(0,Xs.charCodeToOptimizedIndex)(pr),es=he[Ii];return es===void 0?Fe:es}var we=function(pr){if(ke.length===1&&pr.tokenType.PUSH_MODE===void 0){var Ii=i.config.errorMessageProvider.buildUnableToPopLexerModeMessage(pr);_.push({offset:pr.startOffset,line:pr.startLine!==void 0?pr.startLine:void 0,column:pr.startColumn!==void 0?pr.startColumn:void 0,length:pr.image.length,message:Ii})}else{ke.pop();var es=(0,nr.last)(ke);ue=i.patternIdxToConfig[es],he=i.charCodeToPatternIdxToConfig[es],F=ue.length;var ua=i.canModeBeOptimized[es]&&i.config.safeMode===!1;he&&ua?Ne=le:Ne=oe}};function fe(pr){ke.push(pr),he=this.charCodeToPatternIdxToConfig[pr],ue=this.patternIdxToConfig[pr],F=ue.length,F=ue.length;var Ii=this.canModeBeOptimized[pr]&&this.config.safeMode===!1;he&&Ii?Ne=le:Ne=oe}fe.call(this,t);for(var Ae;jc.length){c=a,u=g,Ae=_e;break}}}break}}if(c!==null){if(f=c.length,h=Ae.group,h!==void 0&&(p=Ae.tokenTypeIdx,C=this.createTokenInstance(c,j,p,Ae.tokenType,A,ae,f),this.handlePayload(C,u),h===!1?$=this.addToken(W,$,C):ge[h].push(C)),e=this.chopInput(e,f),j=j+f,ae=this.computeNewColumn(ae,f),re===!0&&Ae.canLineTerminator===!0){var It=0,Or=void 0,ii=void 0;O.lastIndex=0;do Or=O.test(c),Or===!0&&(ii=O.lastIndex-1,It++);while(Or===!0);It!==0&&(A=A+It,ae=f-ii,this.updateTokenEndLineColumnLocation(C,h,ii,It,A,ae,f))}this.handleModes(Ae,we,fe,C)}else{for(var gi=j,hr=A,fi=ae,ni=!1;!ni&&j <"+e+">");var n=(0,nr.timer)(t),s=n.time,o=n.value,a=s>10?console.warn:console.log;return this.traceInitIndent time: "+s+"ms"),this.traceInitIndent--,o}else return t()},r.SKIPPED="This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.",r.NA=/NOT_APPLICABLE/,r}();fc.Lexer=jEe});var NA=w(bi=>{"use strict";Object.defineProperty(bi,"__esModule",{value:!0});bi.tokenMatcher=bi.createTokenInstance=bi.EOF=bi.createToken=bi.hasTokenLabel=bi.tokenName=bi.tokenLabel=void 0;var Zs=Gt(),qEe=yd(),Hv=Vg();function JEe(r){return Ej(r)?r.LABEL:r.name}bi.tokenLabel=JEe;function WEe(r){return r.name}bi.tokenName=WEe;function Ej(r){return(0,Zs.isString)(r.LABEL)&&r.LABEL!==""}bi.hasTokenLabel=Ej;var zEe="parent",uj="categories",gj="label",fj="group",hj="push_mode",pj="pop_mode",dj="longer_alt",Cj="line_breaks",mj="start_chars_hint";function Ij(r){return VEe(r)}bi.createToken=Ij;function VEe(r){var e=r.pattern,t={};if(t.name=r.name,(0,Zs.isUndefined)(e)||(t.PATTERN=e),(0,Zs.has)(r,zEe))throw`The parent property is no longer supported. +See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return(0,Zs.has)(r,uj)&&(t.CATEGORIES=r[uj]),(0,Hv.augmentTokenTypes)([t]),(0,Zs.has)(r,gj)&&(t.LABEL=r[gj]),(0,Zs.has)(r,fj)&&(t.GROUP=r[fj]),(0,Zs.has)(r,pj)&&(t.POP_MODE=r[pj]),(0,Zs.has)(r,hj)&&(t.PUSH_MODE=r[hj]),(0,Zs.has)(r,dj)&&(t.LONGER_ALT=r[dj]),(0,Zs.has)(r,Cj)&&(t.LINE_BREAKS=r[Cj]),(0,Zs.has)(r,mj)&&(t.START_CHARS_HINT=r[mj]),t}bi.EOF=Ij({name:"EOF",pattern:qEe.Lexer.NA});(0,Hv.augmentTokenTypes)([bi.EOF]);function XEe(r,e,t,i,n,s,o,a){return{image:e,startOffset:t,endOffset:i,startLine:n,endLine:s,startColumn:o,endColumn:a,tokenTypeIdx:r.tokenTypeIdx,tokenType:r}}bi.createTokenInstance=XEe;function ZEe(r,e){return(0,Hv.tokenStructuredMatcher)(r,e)}bi.tokenMatcher=ZEe});var dn=w(zt=>{"use strict";var va=zt&&zt.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(zt,"__esModule",{value:!0});zt.serializeProduction=zt.serializeGrammar=zt.Terminal=zt.Alternation=zt.RepetitionWithSeparator=zt.Repetition=zt.RepetitionMandatoryWithSeparator=zt.RepetitionMandatory=zt.Option=zt.Alternative=zt.Rule=zt.NonTerminal=zt.AbstractProduction=void 0;var Ar=Gt(),_Ee=NA(),ko=function(){function r(e){this._definition=e}return Object.defineProperty(r.prototype,"definition",{get:function(){return this._definition},set:function(e){this._definition=e},enumerable:!1,configurable:!0}),r.prototype.accept=function(e){e.visit(this),(0,Ar.forEach)(this.definition,function(t){t.accept(e)})},r}();zt.AbstractProduction=ko;var yj=function(r){va(e,r);function e(t){var i=r.call(this,[])||this;return i.idx=1,(0,Ar.assign)(i,(0,Ar.pick)(t,function(n){return n!==void 0})),i}return Object.defineProperty(e.prototype,"definition",{get:function(){return this.referencedRule!==void 0?this.referencedRule.definition:[]},set:function(t){},enumerable:!1,configurable:!0}),e.prototype.accept=function(t){t.visit(this)},e}(ko);zt.NonTerminal=yj;var wj=function(r){va(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.orgText="",(0,Ar.assign)(i,(0,Ar.pick)(t,function(n){return n!==void 0})),i}return e}(ko);zt.Rule=wj;var Bj=function(r){va(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.ignoreAmbiguities=!1,(0,Ar.assign)(i,(0,Ar.pick)(t,function(n){return n!==void 0})),i}return e}(ko);zt.Alternative=Bj;var Qj=function(r){va(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.idx=1,(0,Ar.assign)(i,(0,Ar.pick)(t,function(n){return n!==void 0})),i}return e}(ko);zt.Option=Qj;var bj=function(r){va(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.idx=1,(0,Ar.assign)(i,(0,Ar.pick)(t,function(n){return n!==void 0})),i}return e}(ko);zt.RepetitionMandatory=bj;var Sj=function(r){va(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.idx=1,(0,Ar.assign)(i,(0,Ar.pick)(t,function(n){return n!==void 0})),i}return e}(ko);zt.RepetitionMandatoryWithSeparator=Sj;var vj=function(r){va(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.idx=1,(0,Ar.assign)(i,(0,Ar.pick)(t,function(n){return n!==void 0})),i}return e}(ko);zt.Repetition=vj;var xj=function(r){va(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.idx=1,(0,Ar.assign)(i,(0,Ar.pick)(t,function(n){return n!==void 0})),i}return e}(ko);zt.RepetitionWithSeparator=xj;var Pj=function(r){va(e,r);function e(t){var i=r.call(this,t.definition)||this;return i.idx=1,i.ignoreAmbiguities=!1,i.hasPredicates=!1,(0,Ar.assign)(i,(0,Ar.pick)(t,function(n){return n!==void 0})),i}return Object.defineProperty(e.prototype,"definition",{get:function(){return this._definition},set:function(t){this._definition=t},enumerable:!1,configurable:!0}),e}(ko);zt.Alternation=Pj;var ry=function(){function r(e){this.idx=1,(0,Ar.assign)(this,(0,Ar.pick)(e,function(t){return t!==void 0}))}return r.prototype.accept=function(e){e.visit(this)},r}();zt.Terminal=ry;function $Ee(r){return(0,Ar.map)(r,Bd)}zt.serializeGrammar=$Ee;function Bd(r){function e(s){return(0,Ar.map)(s,Bd)}if(r instanceof yj){var t={type:"NonTerminal",name:r.nonTerminalName,idx:r.idx};return(0,Ar.isString)(r.label)&&(t.label=r.label),t}else{if(r instanceof Bj)return{type:"Alternative",definition:e(r.definition)};if(r instanceof Qj)return{type:"Option",idx:r.idx,definition:e(r.definition)};if(r instanceof bj)return{type:"RepetitionMandatory",idx:r.idx,definition:e(r.definition)};if(r instanceof Sj)return{type:"RepetitionMandatoryWithSeparator",idx:r.idx,separator:Bd(new ry({terminalType:r.separator})),definition:e(r.definition)};if(r instanceof xj)return{type:"RepetitionWithSeparator",idx:r.idx,separator:Bd(new ry({terminalType:r.separator})),definition:e(r.definition)};if(r instanceof vj)return{type:"Repetition",idx:r.idx,definition:e(r.definition)};if(r instanceof Pj)return{type:"Alternation",idx:r.idx,definition:e(r.definition)};if(r instanceof ry){var i={type:"Terminal",name:r.terminalType.name,label:(0,_Ee.tokenLabel)(r.terminalType),idx:r.idx};(0,Ar.isString)(r.label)&&(i.terminalLabel=r.label);var n=r.terminalType.PATTERN;return r.terminalType.PATTERN&&(i.pattern=(0,Ar.isRegExp)(n)?n.source:n),i}else{if(r instanceof wj)return{type:"Rule",name:r.name,orgText:r.orgText,definition:e(r.definition)};throw Error("non exhaustive match")}}}zt.serializeProduction=Bd});var ny=w(iy=>{"use strict";Object.defineProperty(iy,"__esModule",{value:!0});iy.RestWalker=void 0;var Gv=Gt(),Cn=dn(),eIe=function(){function r(){}return r.prototype.walk=function(e,t){var i=this;t===void 0&&(t=[]),(0,Gv.forEach)(e.definition,function(n,s){var o=(0,Gv.drop)(e.definition,s+1);if(n instanceof Cn.NonTerminal)i.walkProdRef(n,o,t);else if(n instanceof Cn.Terminal)i.walkTerminal(n,o,t);else if(n instanceof Cn.Alternative)i.walkFlat(n,o,t);else if(n instanceof Cn.Option)i.walkOption(n,o,t);else if(n instanceof Cn.RepetitionMandatory)i.walkAtLeastOne(n,o,t);else if(n instanceof Cn.RepetitionMandatoryWithSeparator)i.walkAtLeastOneSep(n,o,t);else if(n instanceof Cn.RepetitionWithSeparator)i.walkManySep(n,o,t);else if(n instanceof Cn.Repetition)i.walkMany(n,o,t);else if(n instanceof Cn.Alternation)i.walkOr(n,o,t);else throw Error("non exhaustive match")})},r.prototype.walkTerminal=function(e,t,i){},r.prototype.walkProdRef=function(e,t,i){},r.prototype.walkFlat=function(e,t,i){var n=t.concat(i);this.walk(e,n)},r.prototype.walkOption=function(e,t,i){var n=t.concat(i);this.walk(e,n)},r.prototype.walkAtLeastOne=function(e,t,i){var n=[new Cn.Option({definition:e.definition})].concat(t,i);this.walk(e,n)},r.prototype.walkAtLeastOneSep=function(e,t,i){var n=Dj(e,t,i);this.walk(e,n)},r.prototype.walkMany=function(e,t,i){var n=[new Cn.Option({definition:e.definition})].concat(t,i);this.walk(e,n)},r.prototype.walkManySep=function(e,t,i){var n=Dj(e,t,i);this.walk(e,n)},r.prototype.walkOr=function(e,t,i){var n=this,s=t.concat(i);(0,Gv.forEach)(e.definition,function(o){var a=new Cn.Alternative({definition:[o]});n.walk(a,s)})},r}();iy.RestWalker=eIe;function Dj(r,e,t){var i=[new Cn.Option({definition:[new Cn.Terminal({terminalType:r.separator})].concat(r.definition)})],n=i.concat(e,t);return n}});var Xg=w(sy=>{"use strict";Object.defineProperty(sy,"__esModule",{value:!0});sy.GAstVisitor=void 0;var Ro=dn(),tIe=function(){function r(){}return r.prototype.visit=function(e){var t=e;switch(t.constructor){case Ro.NonTerminal:return this.visitNonTerminal(t);case Ro.Alternative:return this.visitAlternative(t);case Ro.Option:return this.visitOption(t);case Ro.RepetitionMandatory:return this.visitRepetitionMandatory(t);case Ro.RepetitionMandatoryWithSeparator:return this.visitRepetitionMandatoryWithSeparator(t);case Ro.RepetitionWithSeparator:return this.visitRepetitionWithSeparator(t);case Ro.Repetition:return this.visitRepetition(t);case Ro.Alternation:return this.visitAlternation(t);case Ro.Terminal:return this.visitTerminal(t);case Ro.Rule:return this.visitRule(t);default:throw Error("non exhaustive match")}},r.prototype.visitNonTerminal=function(e){},r.prototype.visitAlternative=function(e){},r.prototype.visitOption=function(e){},r.prototype.visitRepetition=function(e){},r.prototype.visitRepetitionMandatory=function(e){},r.prototype.visitRepetitionMandatoryWithSeparator=function(e){},r.prototype.visitRepetitionWithSeparator=function(e){},r.prototype.visitAlternation=function(e){},r.prototype.visitTerminal=function(e){},r.prototype.visitRule=function(e){},r}();sy.GAstVisitor=tIe});var bd=w(Mi=>{"use strict";var rIe=Mi&&Mi.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Mi,"__esModule",{value:!0});Mi.collectMethods=Mi.DslMethodsCollectorVisitor=Mi.getProductionDslName=Mi.isBranchingProd=Mi.isOptionalProd=Mi.isSequenceProd=void 0;var Qd=Gt(),Qr=dn(),iIe=Xg();function nIe(r){return r instanceof Qr.Alternative||r instanceof Qr.Option||r instanceof Qr.Repetition||r instanceof Qr.RepetitionMandatory||r instanceof Qr.RepetitionMandatoryWithSeparator||r instanceof Qr.RepetitionWithSeparator||r instanceof Qr.Terminal||r instanceof Qr.Rule}Mi.isSequenceProd=nIe;function Yv(r,e){e===void 0&&(e=[]);var t=r instanceof Qr.Option||r instanceof Qr.Repetition||r instanceof Qr.RepetitionWithSeparator;return t?!0:r instanceof Qr.Alternation?(0,Qd.some)(r.definition,function(i){return Yv(i,e)}):r instanceof Qr.NonTerminal&&(0,Qd.contains)(e,r)?!1:r instanceof Qr.AbstractProduction?(r instanceof Qr.NonTerminal&&e.push(r),(0,Qd.every)(r.definition,function(i){return Yv(i,e)})):!1}Mi.isOptionalProd=Yv;function sIe(r){return r instanceof Qr.Alternation}Mi.isBranchingProd=sIe;function oIe(r){if(r instanceof Qr.NonTerminal)return"SUBRULE";if(r instanceof Qr.Option)return"OPTION";if(r instanceof Qr.Alternation)return"OR";if(r instanceof Qr.RepetitionMandatory)return"AT_LEAST_ONE";if(r instanceof Qr.RepetitionMandatoryWithSeparator)return"AT_LEAST_ONE_SEP";if(r instanceof Qr.RepetitionWithSeparator)return"MANY_SEP";if(r instanceof Qr.Repetition)return"MANY";if(r instanceof Qr.Terminal)return"CONSUME";throw Error("non exhaustive match")}Mi.getProductionDslName=oIe;var kj=function(r){rIe(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.separator="-",t.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]},t}return e.prototype.reset=function(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}},e.prototype.visitTerminal=function(t){var i=t.terminalType.name+this.separator+"Terminal";(0,Qd.has)(this.dslMethods,i)||(this.dslMethods[i]=[]),this.dslMethods[i].push(t)},e.prototype.visitNonTerminal=function(t){var i=t.nonTerminalName+this.separator+"Terminal";(0,Qd.has)(this.dslMethods,i)||(this.dslMethods[i]=[]),this.dslMethods[i].push(t)},e.prototype.visitOption=function(t){this.dslMethods.option.push(t)},e.prototype.visitRepetitionWithSeparator=function(t){this.dslMethods.repetitionWithSeparator.push(t)},e.prototype.visitRepetitionMandatory=function(t){this.dslMethods.repetitionMandatory.push(t)},e.prototype.visitRepetitionMandatoryWithSeparator=function(t){this.dslMethods.repetitionMandatoryWithSeparator.push(t)},e.prototype.visitRepetition=function(t){this.dslMethods.repetition.push(t)},e.prototype.visitAlternation=function(t){this.dslMethods.alternation.push(t)},e}(iIe.GAstVisitor);Mi.DslMethodsCollectorVisitor=kj;var oy=new kj;function aIe(r){oy.reset(),r.accept(oy);var e=oy.dslMethods;return oy.reset(),e}Mi.collectMethods=aIe});var qv=w(Fo=>{"use strict";Object.defineProperty(Fo,"__esModule",{value:!0});Fo.firstForTerminal=Fo.firstForBranching=Fo.firstForSequence=Fo.first=void 0;var ay=Gt(),Rj=dn(),jv=bd();function Ay(r){if(r instanceof Rj.NonTerminal)return Ay(r.referencedRule);if(r instanceof Rj.Terminal)return Lj(r);if((0,jv.isSequenceProd)(r))return Fj(r);if((0,jv.isBranchingProd)(r))return Nj(r);throw Error("non exhaustive match")}Fo.first=Ay;function Fj(r){for(var e=[],t=r.definition,i=0,n=t.length>i,s,o=!0;n&&o;)s=t[i],o=(0,jv.isOptionalProd)(s),e=e.concat(Ay(s)),i=i+1,n=t.length>i;return(0,ay.uniq)(e)}Fo.firstForSequence=Fj;function Nj(r){var e=(0,ay.map)(r.definition,function(t){return Ay(t)});return(0,ay.uniq)((0,ay.flatten)(e))}Fo.firstForBranching=Nj;function Lj(r){return[r.terminalType]}Fo.firstForTerminal=Lj});var Jv=w(ly=>{"use strict";Object.defineProperty(ly,"__esModule",{value:!0});ly.IN=void 0;ly.IN="_~IN~_"});var Uj=w(us=>{"use strict";var AIe=us&&us.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(us,"__esModule",{value:!0});us.buildInProdFollowPrefix=us.buildBetweenProdsFollowPrefix=us.computeAllProdsFollows=us.ResyncFollowsWalker=void 0;var lIe=ny(),cIe=qv(),Tj=Gt(),Oj=Jv(),uIe=dn(),Mj=function(r){AIe(e,r);function e(t){var i=r.call(this)||this;return i.topProd=t,i.follows={},i}return e.prototype.startWalking=function(){return this.walk(this.topProd),this.follows},e.prototype.walkTerminal=function(t,i,n){},e.prototype.walkProdRef=function(t,i,n){var s=Kj(t.referencedRule,t.idx)+this.topProd.name,o=i.concat(n),a=new uIe.Alternative({definition:o}),l=(0,cIe.first)(a);this.follows[s]=l},e}(lIe.RestWalker);us.ResyncFollowsWalker=Mj;function gIe(r){var e={};return(0,Tj.forEach)(r,function(t){var i=new Mj(t).startWalking();(0,Tj.assign)(e,i)}),e}us.computeAllProdsFollows=gIe;function Kj(r,e){return r.name+e+Oj.IN}us.buildBetweenProdsFollowPrefix=Kj;function fIe(r){var e=r.terminalType.name;return e+r.idx+Oj.IN}us.buildInProdFollowPrefix=fIe});var Sd=w(xa=>{"use strict";Object.defineProperty(xa,"__esModule",{value:!0});xa.defaultGrammarValidatorErrorProvider=xa.defaultGrammarResolverErrorProvider=xa.defaultParserErrorProvider=void 0;var Zg=NA(),hIe=Gt(),_s=Gt(),Wv=dn(),Hj=bd();xa.defaultParserErrorProvider={buildMismatchTokenMessage:function(r){var e=r.expected,t=r.actual,i=r.previous,n=r.ruleName,s=(0,Zg.hasTokenLabel)(e),o=s?"--> "+(0,Zg.tokenLabel)(e)+" <--":"token of type --> "+e.name+" <--",a="Expecting "+o+" but found --> '"+t.image+"' <--";return a},buildNotAllInputParsedMessage:function(r){var e=r.firstRedundant,t=r.ruleName;return"Redundant input, expecting EOF but found: "+e.image},buildNoViableAltMessage:function(r){var e=r.expectedPathsPerAlt,t=r.actual,i=r.previous,n=r.customUserDescription,s=r.ruleName,o="Expecting: ",a=(0,_s.first)(t).image,l=` +but found: '`+a+"'";if(n)return o+n+l;var c=(0,_s.reduce)(e,function(h,p){return h.concat(p)},[]),u=(0,_s.map)(c,function(h){return"["+(0,_s.map)(h,function(p){return(0,Zg.tokenLabel)(p)}).join(", ")+"]"}),g=(0,_s.map)(u,function(h,p){return" "+(p+1)+". "+h}),f=`one of these possible Token sequences: +`+g.join(` +`);return o+f+l},buildEarlyExitMessage:function(r){var e=r.expectedIterationPaths,t=r.actual,i=r.customUserDescription,n=r.ruleName,s="Expecting: ",o=(0,_s.first)(t).image,a=` +but found: '`+o+"'";if(i)return s+i+a;var l=(0,_s.map)(e,function(u){return"["+(0,_s.map)(u,function(g){return(0,Zg.tokenLabel)(g)}).join(",")+"]"}),c=`expecting at least one iteration which starts with one of these possible Token sequences:: + `+("<"+l.join(" ,")+">");return s+c+a}};Object.freeze(xa.defaultParserErrorProvider);xa.defaultGrammarResolverErrorProvider={buildRuleNotFoundError:function(r,e){var t="Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<- +inside top level rule: ->`+r.name+"<-";return t}};xa.defaultGrammarValidatorErrorProvider={buildDuplicateFoundError:function(r,e){function t(u){return u instanceof Wv.Terminal?u.terminalType.name:u instanceof Wv.NonTerminal?u.nonTerminalName:""}var i=r.name,n=(0,_s.first)(e),s=n.idx,o=(0,Hj.getProductionDslName)(n),a=t(n),l=s>0,c="->"+o+(l?s:"")+"<- "+(a?"with argument: ->"+a+"<-":"")+` + appears more than once (`+e.length+" times) in the top level rule: ->"+i+`<-. + For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES + `;return c=c.replace(/[ \t]+/g," "),c=c.replace(/\s\s+/g,` +`),c},buildNamespaceConflictError:function(r){var e=`Namespace conflict found in grammar. +`+("The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <"+r.name+`>. +`)+`To resolve this make sure each Terminal and Non-Terminal names are unique +This is easy to accomplish by using the convention that Terminal names start with an uppercase letter +and Non-Terminal names start with a lower case letter.`;return e},buildAlternationPrefixAmbiguityError:function(r){var e=(0,_s.map)(r.prefixPath,function(n){return(0,Zg.tokenLabel)(n)}).join(", "),t=r.alternation.idx===0?"":r.alternation.idx,i="Ambiguous alternatives: <"+r.ambiguityIndices.join(" ,")+`> due to common lookahead prefix +`+("in inside <"+r.topLevelRule.name+`> Rule, +`)+("<"+e+`> may appears as a prefix path in all these alternatives. +`)+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX +For Further details.`;return i},buildAlternationAmbiguityError:function(r){var e=(0,_s.map)(r.prefixPath,function(n){return(0,Zg.tokenLabel)(n)}).join(", "),t=r.alternation.idx===0?"":r.alternation.idx,i="Ambiguous Alternatives Detected: <"+r.ambiguityIndices.join(" ,")+"> in "+(" inside <"+r.topLevelRule.name+`> Rule, +`)+("<"+e+`> may appears as a prefix path in all these alternatives. +`);return i=i+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES +For Further details.`,i},buildEmptyRepetitionError:function(r){var e=(0,Hj.getProductionDslName)(r.repetition);r.repetition.idx!==0&&(e+=r.repetition.idx);var t="The repetition <"+e+"> within Rule <"+r.topLevelRule.name+`> can never consume any tokens. +This could lead to an infinite loop.`;return t},buildTokenNameError:function(r){return"deprecated"},buildEmptyAlternationError:function(r){var e="Ambiguous empty alternative: <"+(r.emptyChoiceIdx+1)+">"+(" in inside <"+r.topLevelRule.name+`> Rule. +`)+"Only the last alternative may be an empty alternative.";return e},buildTooManyAlternativesError:function(r){var e=`An Alternation cannot have more than 256 alternatives: +`+(" inside <"+r.topLevelRule.name+`> Rule. + has `+(r.alternation.definition.length+1)+" alternatives.");return e},buildLeftRecursionError:function(r){var e=r.topLevelRule.name,t=hIe.map(r.leftRecursionPath,function(s){return s.name}),i=e+" --> "+t.concat([e]).join(" --> "),n=`Left Recursion found in grammar. +`+("rule: <"+e+`> can be invoked from itself (directly or indirectly) +`)+(`without consuming any Tokens. The grammar path that causes this is: + `+i+` +`)+` To fix this refactor your grammar to remove the left recursion. +see: https://en.wikipedia.org/wiki/LL_parser#Left_Factoring.`;return n},buildInvalidRuleNameError:function(r){return"deprecated"},buildDuplicateRuleNameError:function(r){var e;r.topLevelRule instanceof Wv.Rule?e=r.topLevelRule.name:e=r.topLevelRule;var t="Duplicate definition, rule: ->"+e+"<- is already defined in the grammar: ->"+r.grammarName+"<-";return t}}});var jj=w(LA=>{"use strict";var pIe=LA&&LA.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(LA,"__esModule",{value:!0});LA.GastRefResolverVisitor=LA.resolveGrammar=void 0;var dIe=Gn(),Gj=Gt(),CIe=Xg();function mIe(r,e){var t=new Yj(r,e);return t.resolveRefs(),t.errors}LA.resolveGrammar=mIe;var Yj=function(r){pIe(e,r);function e(t,i){var n=r.call(this)||this;return n.nameToTopRule=t,n.errMsgProvider=i,n.errors=[],n}return e.prototype.resolveRefs=function(){var t=this;(0,Gj.forEach)((0,Gj.values)(this.nameToTopRule),function(i){t.currTopLevel=i,i.accept(t)})},e.prototype.visitNonTerminal=function(t){var i=this.nameToTopRule[t.nonTerminalName];if(i)t.referencedRule=i;else{var n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,t);this.errors.push({message:n,type:dIe.ParserDefinitionErrorType.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:t.nonTerminalName})}},e}(CIe.GAstVisitor);LA.GastRefResolverVisitor=Yj});var xd=w(Nr=>{"use strict";var hc=Nr&&Nr.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Nr,"__esModule",{value:!0});Nr.nextPossibleTokensAfter=Nr.possiblePathsFrom=Nr.NextTerminalAfterAtLeastOneSepWalker=Nr.NextTerminalAfterAtLeastOneWalker=Nr.NextTerminalAfterManySepWalker=Nr.NextTerminalAfterManyWalker=Nr.AbstractNextTerminalAfterProductionWalker=Nr.NextAfterTokenWalker=Nr.AbstractNextPossibleTokensWalker=void 0;var qj=ny(),Kt=Gt(),EIe=qv(),kt=dn(),Jj=function(r){hc(e,r);function e(t,i){var n=r.call(this)||this;return n.topProd=t,n.path=i,n.possibleTokTypes=[],n.nextProductionName="",n.nextProductionOccurrence=0,n.found=!1,n.isAtEndOfPath=!1,n}return e.prototype.startWalking=function(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=(0,Kt.cloneArr)(this.path.ruleStack).reverse(),this.occurrenceStack=(0,Kt.cloneArr)(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes},e.prototype.walk=function(t,i){i===void 0&&(i=[]),this.found||r.prototype.walk.call(this,t,i)},e.prototype.walkProdRef=function(t,i,n){if(t.referencedRule.name===this.nextProductionName&&t.idx===this.nextProductionOccurrence){var s=i.concat(n);this.updateExpectedNext(),this.walk(t.referencedRule,s)}},e.prototype.updateExpectedNext=function(){(0,Kt.isEmpty)(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())},e}(qj.RestWalker);Nr.AbstractNextPossibleTokensWalker=Jj;var IIe=function(r){hc(e,r);function e(t,i){var n=r.call(this,t,i)||this;return n.path=i,n.nextTerminalName="",n.nextTerminalOccurrence=0,n.nextTerminalName=n.path.lastTok.name,n.nextTerminalOccurrence=n.path.lastTokOccurrence,n}return e.prototype.walkTerminal=function(t,i,n){if(this.isAtEndOfPath&&t.terminalType.name===this.nextTerminalName&&t.idx===this.nextTerminalOccurrence&&!this.found){var s=i.concat(n),o=new kt.Alternative({definition:s});this.possibleTokTypes=(0,EIe.first)(o),this.found=!0}},e}(Jj);Nr.NextAfterTokenWalker=IIe;var vd=function(r){hc(e,r);function e(t,i){var n=r.call(this)||this;return n.topRule=t,n.occurrence=i,n.result={token:void 0,occurrence:void 0,isEndOfRule:void 0},n}return e.prototype.startWalking=function(){return this.walk(this.topRule),this.result},e}(qj.RestWalker);Nr.AbstractNextTerminalAfterProductionWalker=vd;var yIe=function(r){hc(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.walkMany=function(t,i,n){if(t.idx===this.occurrence){var s=(0,Kt.first)(i.concat(n));this.result.isEndOfRule=s===void 0,s instanceof kt.Terminal&&(this.result.token=s.terminalType,this.result.occurrence=s.idx)}else r.prototype.walkMany.call(this,t,i,n)},e}(vd);Nr.NextTerminalAfterManyWalker=yIe;var wIe=function(r){hc(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.walkManySep=function(t,i,n){if(t.idx===this.occurrence){var s=(0,Kt.first)(i.concat(n));this.result.isEndOfRule=s===void 0,s instanceof kt.Terminal&&(this.result.token=s.terminalType,this.result.occurrence=s.idx)}else r.prototype.walkManySep.call(this,t,i,n)},e}(vd);Nr.NextTerminalAfterManySepWalker=wIe;var BIe=function(r){hc(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.walkAtLeastOne=function(t,i,n){if(t.idx===this.occurrence){var s=(0,Kt.first)(i.concat(n));this.result.isEndOfRule=s===void 0,s instanceof kt.Terminal&&(this.result.token=s.terminalType,this.result.occurrence=s.idx)}else r.prototype.walkAtLeastOne.call(this,t,i,n)},e}(vd);Nr.NextTerminalAfterAtLeastOneWalker=BIe;var QIe=function(r){hc(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.walkAtLeastOneSep=function(t,i,n){if(t.idx===this.occurrence){var s=(0,Kt.first)(i.concat(n));this.result.isEndOfRule=s===void 0,s instanceof kt.Terminal&&(this.result.token=s.terminalType,this.result.occurrence=s.idx)}else r.prototype.walkAtLeastOneSep.call(this,t,i,n)},e}(vd);Nr.NextTerminalAfterAtLeastOneSepWalker=QIe;function Wj(r,e,t){t===void 0&&(t=[]),t=(0,Kt.cloneArr)(t);var i=[],n=0;function s(c){return c.concat((0,Kt.drop)(r,n+1))}function o(c){var u=Wj(s(c),e,t);return i.concat(u)}for(;t.length=0;ge--){var re=B.definition[ge],O={idx:p,def:re.definition.concat((0,Kt.drop)(h)),ruleStack:C,occurrenceStack:y};g.push(O),g.push(o)}else if(B instanceof kt.Alternative)g.push({idx:p,def:B.definition.concat((0,Kt.drop)(h)),ruleStack:C,occurrenceStack:y});else if(B instanceof kt.Rule)g.push(SIe(B,p,C,y));else throw Error("non exhaustive match")}}return u}Nr.nextPossibleTokensAfter=bIe;function SIe(r,e,t,i){var n=(0,Kt.cloneArr)(t);n.push(r.name);var s=(0,Kt.cloneArr)(i);return s.push(1),{idx:e,def:r.definition,ruleStack:n,occurrenceStack:s}}});var Pd=w(Zt=>{"use strict";var Xj=Zt&&Zt.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Zt,"__esModule",{value:!0});Zt.areTokenCategoriesNotUsed=Zt.isStrictPrefixOfPath=Zt.containsPath=Zt.getLookaheadPathsForOptionalProd=Zt.getLookaheadPathsForOr=Zt.lookAheadSequenceFromAlternatives=Zt.buildSingleAlternativeLookaheadFunction=Zt.buildAlternativesLookAheadFunc=Zt.buildLookaheadFuncForOptionalProd=Zt.buildLookaheadFuncForOr=Zt.getProdType=Zt.PROD_TYPE=void 0;var sr=Gt(),zj=xd(),vIe=ny(),cy=Vg(),TA=dn(),xIe=Xg(),oi;(function(r){r[r.OPTION=0]="OPTION",r[r.REPETITION=1]="REPETITION",r[r.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",r[r.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",r[r.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",r[r.ALTERNATION=5]="ALTERNATION"})(oi=Zt.PROD_TYPE||(Zt.PROD_TYPE={}));function PIe(r){if(r instanceof TA.Option)return oi.OPTION;if(r instanceof TA.Repetition)return oi.REPETITION;if(r instanceof TA.RepetitionMandatory)return oi.REPETITION_MANDATORY;if(r instanceof TA.RepetitionMandatoryWithSeparator)return oi.REPETITION_MANDATORY_WITH_SEPARATOR;if(r instanceof TA.RepetitionWithSeparator)return oi.REPETITION_WITH_SEPARATOR;if(r instanceof TA.Alternation)return oi.ALTERNATION;throw Error("non exhaustive match")}Zt.getProdType=PIe;function DIe(r,e,t,i,n,s){var o=_j(r,e,t),a=Xv(o)?cy.tokenStructuredMatcherNoCategories:cy.tokenStructuredMatcher;return s(o,i,a,n)}Zt.buildLookaheadFuncForOr=DIe;function kIe(r,e,t,i,n,s){var o=$j(r,e,n,t),a=Xv(o)?cy.tokenStructuredMatcherNoCategories:cy.tokenStructuredMatcher;return s(o[0],a,i)}Zt.buildLookaheadFuncForOptionalProd=kIe;function RIe(r,e,t,i){var n=r.length,s=(0,sr.every)(r,function(l){return(0,sr.every)(l,function(c){return c.length===1})});if(e)return function(l){for(var c=(0,sr.map)(l,function(D){return D.GATE}),u=0;u{"use strict";var Zv=Vt&&Vt.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Vt,"__esModule",{value:!0});Vt.checkPrefixAlternativesAmbiguities=Vt.validateSomeNonEmptyLookaheadPath=Vt.validateTooManyAlts=Vt.RepetionCollector=Vt.validateAmbiguousAlternationAlternatives=Vt.validateEmptyOrAlternative=Vt.getFirstNoneTerminal=Vt.validateNoLeftRecursion=Vt.validateRuleIsOverridden=Vt.validateRuleDoesNotAlreadyExist=Vt.OccurrenceValidationCollector=Vt.identifyProductionForDuplicates=Vt.validateGrammar=void 0;var er=Gt(),br=Gt(),No=Gn(),_v=bd(),_g=Pd(),OIe=xd(),$s=dn(),$v=Xg();function MIe(r,e,t,i,n){var s=er.map(r,function(h){return KIe(h,i)}),o=er.map(r,function(h){return ex(h,h,i)}),a=[],l=[],c=[];(0,br.every)(o,br.isEmpty)&&(a=(0,br.map)(r,function(h){return sq(h,i)}),l=(0,br.map)(r,function(h){return oq(h,e,i)}),c=lq(r,e,i));var u=GIe(r,t,i),g=(0,br.map)(r,function(h){return Aq(h,i)}),f=(0,br.map)(r,function(h){return nq(h,r,n,i)});return er.flatten(s.concat(c,o,a,l,u,g,f))}Vt.validateGrammar=MIe;function KIe(r,e){var t=new iq;r.accept(t);var i=t.allProductions,n=er.groupBy(i,tq),s=er.pick(n,function(a){return a.length>1}),o=er.map(er.values(s),function(a){var l=er.first(a),c=e.buildDuplicateFoundError(r,a),u=(0,_v.getProductionDslName)(l),g={message:c,type:No.ParserDefinitionErrorType.DUPLICATE_PRODUCTIONS,ruleName:r.name,dslName:u,occurrence:l.idx},f=rq(l);return f&&(g.parameter=f),g});return o}function tq(r){return(0,_v.getProductionDslName)(r)+"_#_"+r.idx+"_#_"+rq(r)}Vt.identifyProductionForDuplicates=tq;function rq(r){return r instanceof $s.Terminal?r.terminalType.name:r instanceof $s.NonTerminal?r.nonTerminalName:""}var iq=function(r){Zv(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.allProductions=[],t}return e.prototype.visitNonTerminal=function(t){this.allProductions.push(t)},e.prototype.visitOption=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionWithSeparator=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionMandatory=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionMandatoryWithSeparator=function(t){this.allProductions.push(t)},e.prototype.visitRepetition=function(t){this.allProductions.push(t)},e.prototype.visitAlternation=function(t){this.allProductions.push(t)},e.prototype.visitTerminal=function(t){this.allProductions.push(t)},e}($v.GAstVisitor);Vt.OccurrenceValidationCollector=iq;function nq(r,e,t,i){var n=[],s=(0,br.reduce)(e,function(a,l){return l.name===r.name?a+1:a},0);if(s>1){var o=i.buildDuplicateRuleNameError({topLevelRule:r,grammarName:t});n.push({message:o,type:No.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:r.name})}return n}Vt.validateRuleDoesNotAlreadyExist=nq;function UIe(r,e,t){var i=[],n;return er.contains(e,r)||(n="Invalid rule override, rule: ->"+r+"<- cannot be overridden in the grammar: ->"+t+"<-as it is not defined in any of the super grammars ",i.push({message:n,type:No.ParserDefinitionErrorType.INVALID_RULE_OVERRIDE,ruleName:r})),i}Vt.validateRuleIsOverridden=UIe;function ex(r,e,t,i){i===void 0&&(i=[]);var n=[],s=Dd(e.definition);if(er.isEmpty(s))return[];var o=r.name,a=er.contains(s,r);a&&n.push({message:t.buildLeftRecursionError({topLevelRule:r,leftRecursionPath:i}),type:No.ParserDefinitionErrorType.LEFT_RECURSION,ruleName:o});var l=er.difference(s,i.concat([r])),c=er.map(l,function(u){var g=er.cloneArr(i);return g.push(u),ex(r,u,t,g)});return n.concat(er.flatten(c))}Vt.validateNoLeftRecursion=ex;function Dd(r){var e=[];if(er.isEmpty(r))return e;var t=er.first(r);if(t instanceof $s.NonTerminal)e.push(t.referencedRule);else if(t instanceof $s.Alternative||t instanceof $s.Option||t instanceof $s.RepetitionMandatory||t instanceof $s.RepetitionMandatoryWithSeparator||t instanceof $s.RepetitionWithSeparator||t instanceof $s.Repetition)e=e.concat(Dd(t.definition));else if(t instanceof $s.Alternation)e=er.flatten(er.map(t.definition,function(o){return Dd(o.definition)}));else if(!(t instanceof $s.Terminal))throw Error("non exhaustive match");var i=(0,_v.isOptionalProd)(t),n=r.length>1;if(i&&n){var s=er.drop(r);return e.concat(Dd(s))}else return e}Vt.getFirstNoneTerminal=Dd;var tx=function(r){Zv(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.alternations=[],t}return e.prototype.visitAlternation=function(t){this.alternations.push(t)},e}($v.GAstVisitor);function sq(r,e){var t=new tx;r.accept(t);var i=t.alternations,n=er.reduce(i,function(s,o){var a=er.dropRight(o.definition),l=er.map(a,function(c,u){var g=(0,OIe.nextPossibleTokensAfter)([c],[],null,1);return er.isEmpty(g)?{message:e.buildEmptyAlternationError({topLevelRule:r,alternation:o,emptyChoiceIdx:u}),type:No.ParserDefinitionErrorType.NONE_LAST_EMPTY_ALT,ruleName:r.name,occurrence:o.idx,alternative:u+1}:null});return s.concat(er.compact(l))},[]);return n}Vt.validateEmptyOrAlternative=sq;function oq(r,e,t){var i=new tx;r.accept(i);var n=i.alternations;n=(0,br.reject)(n,function(o){return o.ignoreAmbiguities===!0});var s=er.reduce(n,function(o,a){var l=a.idx,c=a.maxLookahead||e,u=(0,_g.getLookaheadPathsForOr)(l,r,c,a),g=HIe(u,a,r,t),f=cq(u,a,r,t);return o.concat(g,f)},[]);return s}Vt.validateAmbiguousAlternationAlternatives=oq;var aq=function(r){Zv(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.allProductions=[],t}return e.prototype.visitRepetitionWithSeparator=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionMandatory=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionMandatoryWithSeparator=function(t){this.allProductions.push(t)},e.prototype.visitRepetition=function(t){this.allProductions.push(t)},e}($v.GAstVisitor);Vt.RepetionCollector=aq;function Aq(r,e){var t=new tx;r.accept(t);var i=t.alternations,n=er.reduce(i,function(s,o){return o.definition.length>255&&s.push({message:e.buildTooManyAlternativesError({topLevelRule:r,alternation:o}),type:No.ParserDefinitionErrorType.TOO_MANY_ALTS,ruleName:r.name,occurrence:o.idx}),s},[]);return n}Vt.validateTooManyAlts=Aq;function lq(r,e,t){var i=[];return(0,br.forEach)(r,function(n){var s=new aq;n.accept(s);var o=s.allProductions;(0,br.forEach)(o,function(a){var l=(0,_g.getProdType)(a),c=a.maxLookahead||e,u=a.idx,g=(0,_g.getLookaheadPathsForOptionalProd)(u,n,l,c),f=g[0];if((0,br.isEmpty)((0,br.flatten)(f))){var h=t.buildEmptyRepetitionError({topLevelRule:n,repetition:a});i.push({message:h,type:No.ParserDefinitionErrorType.NO_NON_EMPTY_LOOKAHEAD,ruleName:n.name})}})}),i}Vt.validateSomeNonEmptyLookaheadPath=lq;function HIe(r,e,t,i){var n=[],s=(0,br.reduce)(r,function(a,l,c){return e.definition[c].ignoreAmbiguities===!0||(0,br.forEach)(l,function(u){var g=[c];(0,br.forEach)(r,function(f,h){c!==h&&(0,_g.containsPath)(f,u)&&e.definition[h].ignoreAmbiguities!==!0&&g.push(h)}),g.length>1&&!(0,_g.containsPath)(n,u)&&(n.push(u),a.push({alts:g,path:u}))}),a},[]),o=er.map(s,function(a){var l=(0,br.map)(a.alts,function(u){return u+1}),c=i.buildAlternationAmbiguityError({topLevelRule:t,alternation:e,ambiguityIndices:l,prefixPath:a.path});return{message:c,type:No.ParserDefinitionErrorType.AMBIGUOUS_ALTS,ruleName:t.name,occurrence:e.idx,alternatives:[a.alts]}});return o}function cq(r,e,t,i){var n=[],s=(0,br.reduce)(r,function(o,a,l){var c=(0,br.map)(a,function(u){return{idx:l,path:u}});return o.concat(c)},[]);return(0,br.forEach)(s,function(o){var a=e.definition[o.idx];if(a.ignoreAmbiguities!==!0){var l=o.idx,c=o.path,u=(0,br.findAll)(s,function(f){return e.definition[f.idx].ignoreAmbiguities!==!0&&f.idx{"use strict";Object.defineProperty($g,"__esModule",{value:!0});$g.validateGrammar=$g.resolveGrammar=void 0;var ix=Gt(),YIe=jj(),jIe=rx(),uq=Sd();function qIe(r){r=(0,ix.defaults)(r,{errMsgProvider:uq.defaultGrammarResolverErrorProvider});var e={};return(0,ix.forEach)(r.rules,function(t){e[t.name]=t}),(0,YIe.resolveGrammar)(e,r.errMsgProvider)}$g.resolveGrammar=qIe;function JIe(r){return r=(0,ix.defaults)(r,{errMsgProvider:uq.defaultGrammarValidatorErrorProvider}),(0,jIe.validateGrammar)(r.rules,r.maxLookahead,r.tokenTypes,r.errMsgProvider,r.grammarName)}$g.validateGrammar=JIe});var ef=w(mn=>{"use strict";var kd=mn&&mn.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(mn,"__esModule",{value:!0});mn.EarlyExitException=mn.NotAllInputParsedException=mn.NoViableAltException=mn.MismatchedTokenException=mn.isRecognitionException=void 0;var WIe=Gt(),fq="MismatchedTokenException",hq="NoViableAltException",pq="EarlyExitException",dq="NotAllInputParsedException",Cq=[fq,hq,pq,dq];Object.freeze(Cq);function zIe(r){return(0,WIe.contains)(Cq,r.name)}mn.isRecognitionException=zIe;var uy=function(r){kd(e,r);function e(t,i){var n=this.constructor,s=r.call(this,t)||this;return s.token=i,s.resyncedTokens=[],Object.setPrototypeOf(s,n.prototype),Error.captureStackTrace&&Error.captureStackTrace(s,s.constructor),s}return e}(Error),VIe=function(r){kd(e,r);function e(t,i,n){var s=r.call(this,t,i)||this;return s.previousToken=n,s.name=fq,s}return e}(uy);mn.MismatchedTokenException=VIe;var XIe=function(r){kd(e,r);function e(t,i,n){var s=r.call(this,t,i)||this;return s.previousToken=n,s.name=hq,s}return e}(uy);mn.NoViableAltException=XIe;var ZIe=function(r){kd(e,r);function e(t,i){var n=r.call(this,t,i)||this;return n.name=dq,n}return e}(uy);mn.NotAllInputParsedException=ZIe;var _Ie=function(r){kd(e,r);function e(t,i,n){var s=r.call(this,t,i)||this;return s.previousToken=n,s.name=pq,s}return e}(uy);mn.EarlyExitException=_Ie});var sx=w(Ki=>{"use strict";Object.defineProperty(Ki,"__esModule",{value:!0});Ki.attemptInRepetitionRecovery=Ki.Recoverable=Ki.InRuleRecoveryException=Ki.IN_RULE_RECOVERY_EXCEPTION=Ki.EOF_FOLLOW_KEY=void 0;var gy=NA(),gs=Gt(),$Ie=ef(),eye=Jv(),tye=Gn();Ki.EOF_FOLLOW_KEY={};Ki.IN_RULE_RECOVERY_EXCEPTION="InRuleRecoveryException";function nx(r){this.name=Ki.IN_RULE_RECOVERY_EXCEPTION,this.message=r}Ki.InRuleRecoveryException=nx;nx.prototype=Error.prototype;var rye=function(){function r(){}return r.prototype.initRecoverable=function(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=(0,gs.has)(e,"recoveryEnabled")?e.recoveryEnabled:tye.DEFAULT_PARSER_CONFIG.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=mq)},r.prototype.getTokenToInsert=function(e){var t=(0,gy.createTokenInstance)(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t},r.prototype.canTokenTypeBeInsertedInRecovery=function(e){return!0},r.prototype.tryInRepetitionRecovery=function(e,t,i,n){for(var s=this,o=this.findReSyncTokenType(),a=this.exportLexerState(),l=[],c=!1,u=this.LA(1),g=this.LA(1),f=function(){var h=s.LA(0),p=s.errorMessageProvider.buildMismatchTokenMessage({expected:n,actual:u,previous:h,ruleName:s.getCurrRuleFullName()}),C=new $Ie.MismatchedTokenException(p,u,s.LA(0));C.resyncedTokens=(0,gs.dropRight)(l),s.SAVE_ERROR(C)};!c;)if(this.tokenMatcher(g,n)){f();return}else if(i.call(this)){f(),e.apply(this,t);return}else this.tokenMatcher(g,o)?c=!0:(g=this.SKIP_TOKEN(),this.addToResyncTokens(g,l));this.importLexerState(a)},r.prototype.shouldInRepetitionRecoveryBeTried=function(e,t,i){return!(i===!1||e===void 0||t===void 0||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t)))},r.prototype.getFollowsForInRuleRecovery=function(e,t){var i=this.getCurrentGrammarPath(e,t),n=this.getNextPossibleTokenTypes(i);return n},r.prototype.tryInRuleRecovery=function(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t)){var i=this.getTokenToInsert(e);return i}if(this.canRecoverWithSingleTokenDeletion(e)){var n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new nx("sad sad panda")},r.prototype.canPerformInRuleRecovery=function(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)},r.prototype.canRecoverWithSingleTokenInsertion=function(e,t){var i=this;if(!this.canTokenTypeBeInsertedInRecovery(e)||(0,gs.isEmpty)(t))return!1;var n=this.LA(1),s=(0,gs.find)(t,function(o){return i.tokenMatcher(n,o)})!==void 0;return s},r.prototype.canRecoverWithSingleTokenDeletion=function(e){var t=this.tokenMatcher(this.LA(2),e);return t},r.prototype.isInCurrentRuleReSyncSet=function(e){var t=this.getCurrFollowKey(),i=this.getFollowSetFromFollowKey(t);return(0,gs.contains)(i,e)},r.prototype.findReSyncTokenType=function(){for(var e=this.flattenFollowSet(),t=this.LA(1),i=2;;){var n=t.tokenType;if((0,gs.contains)(e,n))return n;t=this.LA(i),i++}},r.prototype.getCurrFollowKey=function(){if(this.RULE_STACK.length===1)return Ki.EOF_FOLLOW_KEY;var e=this.getLastExplicitRuleShortName(),t=this.getLastExplicitRuleOccurrenceIndex(),i=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(i)}},r.prototype.buildFullFollowKeyStack=function(){var e=this,t=this.RULE_STACK,i=this.RULE_OCCURRENCE_STACK;return(0,gs.map)(t,function(n,s){return s===0?Ki.EOF_FOLLOW_KEY:{ruleName:e.shortRuleNameToFullName(n),idxInCallingRule:i[s],inRule:e.shortRuleNameToFullName(t[s-1])}})},r.prototype.flattenFollowSet=function(){var e=this,t=(0,gs.map)(this.buildFullFollowKeyStack(),function(i){return e.getFollowSetFromFollowKey(i)});return(0,gs.flatten)(t)},r.prototype.getFollowSetFromFollowKey=function(e){if(e===Ki.EOF_FOLLOW_KEY)return[gy.EOF];var t=e.ruleName+e.idxInCallingRule+eye.IN+e.inRule;return this.resyncFollows[t]},r.prototype.addToResyncTokens=function(e,t){return this.tokenMatcher(e,gy.EOF)||t.push(e),t},r.prototype.reSyncTo=function(e){for(var t=[],i=this.LA(1);this.tokenMatcher(i,e)===!1;)i=this.SKIP_TOKEN(),this.addToResyncTokens(i,t);return(0,gs.dropRight)(t)},r.prototype.attemptInRepetitionRecovery=function(e,t,i,n,s,o,a){},r.prototype.getCurrentGrammarPath=function(e,t){var i=this.getHumanReadableRuleStack(),n=(0,gs.cloneArr)(this.RULE_OCCURRENCE_STACK),s={ruleStack:i,occurrenceStack:n,lastTok:e,lastTokOccurrence:t};return s},r.prototype.getHumanReadableRuleStack=function(){var e=this;return(0,gs.map)(this.RULE_STACK,function(t){return e.shortRuleNameToFullName(t)})},r}();Ki.Recoverable=rye;function mq(r,e,t,i,n,s,o){var a=this.getKeyForAutomaticLookahead(i,n),l=this.firstAfterRepMap[a];if(l===void 0){var c=this.getCurrRuleFullName(),u=this.getGAstProductions()[c],g=new s(u,n);l=g.startWalking(),this.firstAfterRepMap[a]=l}var f=l.token,h=l.occurrence,p=l.isEndOfRule;this.RULE_STACK.length===1&&p&&f===void 0&&(f=gy.EOF,h=1),this.shouldInRepetitionRecoveryBeTried(f,h,o)&&this.tryInRepetitionRecovery(r,e,t,f)}Ki.attemptInRepetitionRecovery=mq});var fy=w(Jt=>{"use strict";Object.defineProperty(Jt,"__esModule",{value:!0});Jt.getKeyForAutomaticLookahead=Jt.AT_LEAST_ONE_SEP_IDX=Jt.MANY_SEP_IDX=Jt.AT_LEAST_ONE_IDX=Jt.MANY_IDX=Jt.OPTION_IDX=Jt.OR_IDX=Jt.BITS_FOR_ALT_IDX=Jt.BITS_FOR_RULE_IDX=Jt.BITS_FOR_OCCURRENCE_IDX=Jt.BITS_FOR_METHOD_TYPE=void 0;Jt.BITS_FOR_METHOD_TYPE=4;Jt.BITS_FOR_OCCURRENCE_IDX=8;Jt.BITS_FOR_RULE_IDX=12;Jt.BITS_FOR_ALT_IDX=8;Jt.OR_IDX=1<{"use strict";Object.defineProperty(hy,"__esModule",{value:!0});hy.LooksAhead=void 0;var Pa=Pd(),eo=Gt(),Eq=Gn(),Da=fy(),pc=bd(),nye=function(){function r(){}return r.prototype.initLooksAhead=function(e){this.dynamicTokensEnabled=(0,eo.has)(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:Eq.DEFAULT_PARSER_CONFIG.dynamicTokensEnabled,this.maxLookahead=(0,eo.has)(e,"maxLookahead")?e.maxLookahead:Eq.DEFAULT_PARSER_CONFIG.maxLookahead,this.lookAheadFuncsCache=(0,eo.isES2015MapSupported)()?new Map:[],(0,eo.isES2015MapSupported)()?(this.getLaFuncFromCache=this.getLaFuncFromMap,this.setLaFuncCache=this.setLaFuncCacheUsingMap):(this.getLaFuncFromCache=this.getLaFuncFromObj,this.setLaFuncCache=this.setLaFuncUsingObj)},r.prototype.preComputeLookaheadFunctions=function(e){var t=this;(0,eo.forEach)(e,function(i){t.TRACE_INIT(i.name+" Rule Lookahead",function(){var n=(0,pc.collectMethods)(i),s=n.alternation,o=n.repetition,a=n.option,l=n.repetitionMandatory,c=n.repetitionMandatoryWithSeparator,u=n.repetitionWithSeparator;(0,eo.forEach)(s,function(g){var f=g.idx===0?"":g.idx;t.TRACE_INIT(""+(0,pc.getProductionDslName)(g)+f,function(){var h=(0,Pa.buildLookaheadFuncForOr)(g.idx,i,g.maxLookahead||t.maxLookahead,g.hasPredicates,t.dynamicTokensEnabled,t.lookAheadBuilderForAlternatives),p=(0,Da.getKeyForAutomaticLookahead)(t.fullRuleNameToShort[i.name],Da.OR_IDX,g.idx);t.setLaFuncCache(p,h)})}),(0,eo.forEach)(o,function(g){t.computeLookaheadFunc(i,g.idx,Da.MANY_IDX,Pa.PROD_TYPE.REPETITION,g.maxLookahead,(0,pc.getProductionDslName)(g))}),(0,eo.forEach)(a,function(g){t.computeLookaheadFunc(i,g.idx,Da.OPTION_IDX,Pa.PROD_TYPE.OPTION,g.maxLookahead,(0,pc.getProductionDslName)(g))}),(0,eo.forEach)(l,function(g){t.computeLookaheadFunc(i,g.idx,Da.AT_LEAST_ONE_IDX,Pa.PROD_TYPE.REPETITION_MANDATORY,g.maxLookahead,(0,pc.getProductionDslName)(g))}),(0,eo.forEach)(c,function(g){t.computeLookaheadFunc(i,g.idx,Da.AT_LEAST_ONE_SEP_IDX,Pa.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,g.maxLookahead,(0,pc.getProductionDslName)(g))}),(0,eo.forEach)(u,function(g){t.computeLookaheadFunc(i,g.idx,Da.MANY_SEP_IDX,Pa.PROD_TYPE.REPETITION_WITH_SEPARATOR,g.maxLookahead,(0,pc.getProductionDslName)(g))})})})},r.prototype.computeLookaheadFunc=function(e,t,i,n,s,o){var a=this;this.TRACE_INIT(""+o+(t===0?"":t),function(){var l=(0,Pa.buildLookaheadFuncForOptionalProd)(t,e,s||a.maxLookahead,a.dynamicTokensEnabled,n,a.lookAheadBuilderForOptional),c=(0,Da.getKeyForAutomaticLookahead)(a.fullRuleNameToShort[e.name],i,t);a.setLaFuncCache(c,l)})},r.prototype.lookAheadBuilderForOptional=function(e,t,i){return(0,Pa.buildSingleAlternativeLookaheadFunction)(e,t,i)},r.prototype.lookAheadBuilderForAlternatives=function(e,t,i,n){return(0,Pa.buildAlternativesLookAheadFunc)(e,t,i,n)},r.prototype.getKeyForAutomaticLookahead=function(e,t){var i=this.getLastExplicitRuleShortName();return(0,Da.getKeyForAutomaticLookahead)(i,e,t)},r.prototype.getLaFuncFromCache=function(e){},r.prototype.getLaFuncFromMap=function(e){return this.lookAheadFuncsCache.get(e)},r.prototype.getLaFuncFromObj=function(e){return this.lookAheadFuncsCache[e]},r.prototype.setLaFuncCache=function(e,t){},r.prototype.setLaFuncCacheUsingMap=function(e,t){this.lookAheadFuncsCache.set(e,t)},r.prototype.setLaFuncUsingObj=function(e,t){this.lookAheadFuncsCache[e]=t},r}();hy.LooksAhead=nye});var yq=w(Lo=>{"use strict";Object.defineProperty(Lo,"__esModule",{value:!0});Lo.addNoneTerminalToCst=Lo.addTerminalToCst=Lo.setNodeLocationFull=Lo.setNodeLocationOnlyOffset=void 0;function sye(r,e){isNaN(r.startOffset)===!0?(r.startOffset=e.startOffset,r.endOffset=e.endOffset):r.endOffset{"use strict";Object.defineProperty(OA,"__esModule",{value:!0});OA.defineNameProp=OA.functionName=OA.classNameFromInstance=void 0;var lye=Gt();function cye(r){return Bq(r.constructor)}OA.classNameFromInstance=cye;var wq="name";function Bq(r){var e=r.name;return e||"anonymous"}OA.functionName=Bq;function uye(r,e){var t=Object.getOwnPropertyDescriptor(r,wq);return(0,lye.isUndefined)(t)||t.configurable?(Object.defineProperty(r,wq,{enumerable:!1,configurable:!0,writable:!1,value:e}),!0):!1}OA.defineNameProp=uye});var xq=w(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.validateRedundantMethods=Si.validateMissingCstMethods=Si.validateVisitor=Si.CstVisitorDefinitionError=Si.createBaseVisitorConstructorWithDefaults=Si.createBaseSemanticVisitorConstructor=Si.defaultVisit=void 0;var fs=Gt(),Rd=ox();function Qq(r,e){for(var t=(0,fs.keys)(r),i=t.length,n=0;n: + `+(""+s.join(` + +`).replace(/\n/g,` + `)))}}};return t.prototype=i,t.prototype.constructor=t,t._RULE_NAMES=e,t}Si.createBaseSemanticVisitorConstructor=gye;function fye(r,e,t){var i=function(){};(0,Rd.defineNameProp)(i,r+"BaseSemanticsWithDefaults");var n=Object.create(t.prototype);return(0,fs.forEach)(e,function(s){n[s]=Qq}),i.prototype=n,i.prototype.constructor=i,i}Si.createBaseVisitorConstructorWithDefaults=fye;var ax;(function(r){r[r.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",r[r.MISSING_METHOD=1]="MISSING_METHOD"})(ax=Si.CstVisitorDefinitionError||(Si.CstVisitorDefinitionError={}));function bq(r,e){var t=Sq(r,e),i=vq(r,e);return t.concat(i)}Si.validateVisitor=bq;function Sq(r,e){var t=(0,fs.map)(e,function(i){if(!(0,fs.isFunction)(r[i]))return{msg:"Missing visitor method: <"+i+"> on "+(0,Rd.functionName)(r.constructor)+" CST Visitor.",type:ax.MISSING_METHOD,methodName:i}});return(0,fs.compact)(t)}Si.validateMissingCstMethods=Sq;var hye=["constructor","visit","validateVisitor"];function vq(r,e){var t=[];for(var i in r)(0,fs.isFunction)(r[i])&&!(0,fs.contains)(hye,i)&&!(0,fs.contains)(e,i)&&t.push({msg:"Redundant visitor method: <"+i+"> on "+(0,Rd.functionName)(r.constructor)+` CST Visitor +There is no Grammar Rule corresponding to this method's name. +`,type:ax.REDUNDANT_METHOD,methodName:i});return t}Si.validateRedundantMethods=vq});var Dq=w(py=>{"use strict";Object.defineProperty(py,"__esModule",{value:!0});py.TreeBuilder=void 0;var tf=yq(),_r=Gt(),Pq=xq(),pye=Gn(),dye=function(){function r(){}return r.prototype.initTreeBuilder=function(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=(0,_r.has)(e,"nodeLocationTracking")?e.nodeLocationTracking:pye.DEFAULT_PARSER_CONFIG.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=_r.NOOP,this.cstFinallyStateUpdate=_r.NOOP,this.cstPostTerminal=_r.NOOP,this.cstPostNonTerminal=_r.NOOP,this.cstPostRule=_r.NOOP;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=tf.setNodeLocationFull,this.setNodeLocationFromNode=tf.setNodeLocationFull,this.cstPostRule=_r.NOOP,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=_r.NOOP,this.setNodeLocationFromNode=_r.NOOP,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=tf.setNodeLocationOnlyOffset,this.setNodeLocationFromNode=tf.setNodeLocationOnlyOffset,this.cstPostRule=_r.NOOP,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=_r.NOOP,this.setNodeLocationFromNode=_r.NOOP,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=_r.NOOP,this.setNodeLocationFromNode=_r.NOOP,this.cstPostRule=_r.NOOP,this.setInitialNodeLocation=_r.NOOP;else throw Error('Invalid config option: "'+e.nodeLocationTracking+'"')},r.prototype.setInitialNodeLocationOnlyOffsetRecovery=function(e){e.location={startOffset:NaN,endOffset:NaN}},r.prototype.setInitialNodeLocationOnlyOffsetRegular=function(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}},r.prototype.setInitialNodeLocationFullRecovery=function(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}},r.prototype.setInitialNodeLocationFullRegular=function(e){var t=this.LA(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}},r.prototype.cstInvocationStateUpdate=function(e,t){var i={name:e,children:{}};this.setInitialNodeLocation(i),this.CST_STACK.push(i)},r.prototype.cstFinallyStateUpdate=function(){this.CST_STACK.pop()},r.prototype.cstPostRuleFull=function(e){var t=this.LA(0),i=e.location;i.startOffset<=t.startOffset?(i.endOffset=t.endOffset,i.endLine=t.endLine,i.endColumn=t.endColumn):(i.startOffset=NaN,i.startLine=NaN,i.startColumn=NaN)},r.prototype.cstPostRuleOnlyOffset=function(e){var t=this.LA(0),i=e.location;i.startOffset<=t.startOffset?i.endOffset=t.endOffset:i.startOffset=NaN},r.prototype.cstPostTerminal=function(e,t){var i=this.CST_STACK[this.CST_STACK.length-1];(0,tf.addTerminalToCst)(i,t,e),this.setNodeLocationFromToken(i.location,t)},r.prototype.cstPostNonTerminal=function(e,t){var i=this.CST_STACK[this.CST_STACK.length-1];(0,tf.addNoneTerminalToCst)(i,t,e),this.setNodeLocationFromNode(i.location,e.location)},r.prototype.getBaseCstVisitorConstructor=function(){if((0,_r.isUndefined)(this.baseCstVisitorConstructor)){var e=(0,Pq.createBaseSemanticVisitorConstructor)(this.className,(0,_r.keys)(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor},r.prototype.getBaseCstVisitorConstructorWithDefaults=function(){if((0,_r.isUndefined)(this.baseCstVisitorWithDefaultsConstructor)){var e=(0,Pq.createBaseVisitorConstructorWithDefaults)(this.className,(0,_r.keys)(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor},r.prototype.getLastExplicitRuleShortName=function(){var e=this.RULE_STACK;return e[e.length-1]},r.prototype.getPreviousExplicitRuleShortName=function(){var e=this.RULE_STACK;return e[e.length-2]},r.prototype.getLastExplicitRuleOccurrenceIndex=function(){var e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]},r}();py.TreeBuilder=dye});var Rq=w(dy=>{"use strict";Object.defineProperty(dy,"__esModule",{value:!0});dy.LexerAdapter=void 0;var kq=Gn(),Cye=function(){function r(){}return r.prototype.initLexerAdapter=function(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1},Object.defineProperty(r.prototype,"input",{get:function(){return this.tokVector},set:function(e){if(this.selfAnalysisDone!==!0)throw Error("Missing invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length},enumerable:!1,configurable:!0}),r.prototype.SKIP_TOKEN=function(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):kq.END_OF_FILE},r.prototype.LA=function(e){var t=this.currIdx+e;return t<0||this.tokVectorLength<=t?kq.END_OF_FILE:this.tokVector[t]},r.prototype.consumeToken=function(){this.currIdx++},r.prototype.exportLexerState=function(){return this.currIdx},r.prototype.importLexerState=function(e){this.currIdx=e},r.prototype.resetLexerState=function(){this.currIdx=-1},r.prototype.moveToTerminatedState=function(){this.currIdx=this.tokVector.length-1},r.prototype.getLexerPosition=function(){return this.exportLexerState()},r}();dy.LexerAdapter=Cye});var Nq=w(Cy=>{"use strict";Object.defineProperty(Cy,"__esModule",{value:!0});Cy.RecognizerApi=void 0;var Fq=Gt(),mye=ef(),Ax=Gn(),Eye=Sd(),Iye=rx(),yye=dn(),wye=function(){function r(){}return r.prototype.ACTION=function(e){return e.call(this)},r.prototype.consume=function(e,t,i){return this.consumeInternal(t,e,i)},r.prototype.subrule=function(e,t,i){return this.subruleInternal(t,e,i)},r.prototype.option=function(e,t){return this.optionInternal(t,e)},r.prototype.or=function(e,t){return this.orInternal(t,e)},r.prototype.many=function(e,t){return this.manyInternal(e,t)},r.prototype.atLeastOne=function(e,t){return this.atLeastOneInternal(e,t)},r.prototype.CONSUME=function(e,t){return this.consumeInternal(e,0,t)},r.prototype.CONSUME1=function(e,t){return this.consumeInternal(e,1,t)},r.prototype.CONSUME2=function(e,t){return this.consumeInternal(e,2,t)},r.prototype.CONSUME3=function(e,t){return this.consumeInternal(e,3,t)},r.prototype.CONSUME4=function(e,t){return this.consumeInternal(e,4,t)},r.prototype.CONSUME5=function(e,t){return this.consumeInternal(e,5,t)},r.prototype.CONSUME6=function(e,t){return this.consumeInternal(e,6,t)},r.prototype.CONSUME7=function(e,t){return this.consumeInternal(e,7,t)},r.prototype.CONSUME8=function(e,t){return this.consumeInternal(e,8,t)},r.prototype.CONSUME9=function(e,t){return this.consumeInternal(e,9,t)},r.prototype.SUBRULE=function(e,t){return this.subruleInternal(e,0,t)},r.prototype.SUBRULE1=function(e,t){return this.subruleInternal(e,1,t)},r.prototype.SUBRULE2=function(e,t){return this.subruleInternal(e,2,t)},r.prototype.SUBRULE3=function(e,t){return this.subruleInternal(e,3,t)},r.prototype.SUBRULE4=function(e,t){return this.subruleInternal(e,4,t)},r.prototype.SUBRULE5=function(e,t){return this.subruleInternal(e,5,t)},r.prototype.SUBRULE6=function(e,t){return this.subruleInternal(e,6,t)},r.prototype.SUBRULE7=function(e,t){return this.subruleInternal(e,7,t)},r.prototype.SUBRULE8=function(e,t){return this.subruleInternal(e,8,t)},r.prototype.SUBRULE9=function(e,t){return this.subruleInternal(e,9,t)},r.prototype.OPTION=function(e){return this.optionInternal(e,0)},r.prototype.OPTION1=function(e){return this.optionInternal(e,1)},r.prototype.OPTION2=function(e){return this.optionInternal(e,2)},r.prototype.OPTION3=function(e){return this.optionInternal(e,3)},r.prototype.OPTION4=function(e){return this.optionInternal(e,4)},r.prototype.OPTION5=function(e){return this.optionInternal(e,5)},r.prototype.OPTION6=function(e){return this.optionInternal(e,6)},r.prototype.OPTION7=function(e){return this.optionInternal(e,7)},r.prototype.OPTION8=function(e){return this.optionInternal(e,8)},r.prototype.OPTION9=function(e){return this.optionInternal(e,9)},r.prototype.OR=function(e){return this.orInternal(e,0)},r.prototype.OR1=function(e){return this.orInternal(e,1)},r.prototype.OR2=function(e){return this.orInternal(e,2)},r.prototype.OR3=function(e){return this.orInternal(e,3)},r.prototype.OR4=function(e){return this.orInternal(e,4)},r.prototype.OR5=function(e){return this.orInternal(e,5)},r.prototype.OR6=function(e){return this.orInternal(e,6)},r.prototype.OR7=function(e){return this.orInternal(e,7)},r.prototype.OR8=function(e){return this.orInternal(e,8)},r.prototype.OR9=function(e){return this.orInternal(e,9)},r.prototype.MANY=function(e){this.manyInternal(0,e)},r.prototype.MANY1=function(e){this.manyInternal(1,e)},r.prototype.MANY2=function(e){this.manyInternal(2,e)},r.prototype.MANY3=function(e){this.manyInternal(3,e)},r.prototype.MANY4=function(e){this.manyInternal(4,e)},r.prototype.MANY5=function(e){this.manyInternal(5,e)},r.prototype.MANY6=function(e){this.manyInternal(6,e)},r.prototype.MANY7=function(e){this.manyInternal(7,e)},r.prototype.MANY8=function(e){this.manyInternal(8,e)},r.prototype.MANY9=function(e){this.manyInternal(9,e)},r.prototype.MANY_SEP=function(e){this.manySepFirstInternal(0,e)},r.prototype.MANY_SEP1=function(e){this.manySepFirstInternal(1,e)},r.prototype.MANY_SEP2=function(e){this.manySepFirstInternal(2,e)},r.prototype.MANY_SEP3=function(e){this.manySepFirstInternal(3,e)},r.prototype.MANY_SEP4=function(e){this.manySepFirstInternal(4,e)},r.prototype.MANY_SEP5=function(e){this.manySepFirstInternal(5,e)},r.prototype.MANY_SEP6=function(e){this.manySepFirstInternal(6,e)},r.prototype.MANY_SEP7=function(e){this.manySepFirstInternal(7,e)},r.prototype.MANY_SEP8=function(e){this.manySepFirstInternal(8,e)},r.prototype.MANY_SEP9=function(e){this.manySepFirstInternal(9,e)},r.prototype.AT_LEAST_ONE=function(e){this.atLeastOneInternal(0,e)},r.prototype.AT_LEAST_ONE1=function(e){return this.atLeastOneInternal(1,e)},r.prototype.AT_LEAST_ONE2=function(e){this.atLeastOneInternal(2,e)},r.prototype.AT_LEAST_ONE3=function(e){this.atLeastOneInternal(3,e)},r.prototype.AT_LEAST_ONE4=function(e){this.atLeastOneInternal(4,e)},r.prototype.AT_LEAST_ONE5=function(e){this.atLeastOneInternal(5,e)},r.prototype.AT_LEAST_ONE6=function(e){this.atLeastOneInternal(6,e)},r.prototype.AT_LEAST_ONE7=function(e){this.atLeastOneInternal(7,e)},r.prototype.AT_LEAST_ONE8=function(e){this.atLeastOneInternal(8,e)},r.prototype.AT_LEAST_ONE9=function(e){this.atLeastOneInternal(9,e)},r.prototype.AT_LEAST_ONE_SEP=function(e){this.atLeastOneSepFirstInternal(0,e)},r.prototype.AT_LEAST_ONE_SEP1=function(e){this.atLeastOneSepFirstInternal(1,e)},r.prototype.AT_LEAST_ONE_SEP2=function(e){this.atLeastOneSepFirstInternal(2,e)},r.prototype.AT_LEAST_ONE_SEP3=function(e){this.atLeastOneSepFirstInternal(3,e)},r.prototype.AT_LEAST_ONE_SEP4=function(e){this.atLeastOneSepFirstInternal(4,e)},r.prototype.AT_LEAST_ONE_SEP5=function(e){this.atLeastOneSepFirstInternal(5,e)},r.prototype.AT_LEAST_ONE_SEP6=function(e){this.atLeastOneSepFirstInternal(6,e)},r.prototype.AT_LEAST_ONE_SEP7=function(e){this.atLeastOneSepFirstInternal(7,e)},r.prototype.AT_LEAST_ONE_SEP8=function(e){this.atLeastOneSepFirstInternal(8,e)},r.prototype.AT_LEAST_ONE_SEP9=function(e){this.atLeastOneSepFirstInternal(9,e)},r.prototype.RULE=function(e,t,i){if(i===void 0&&(i=Ax.DEFAULT_RULE_CONFIG),(0,Fq.contains)(this.definedRulesNames,e)){var n=Eye.defaultGrammarValidatorErrorProvider.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),s={message:n,type:Ax.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(s)}this.definedRulesNames.push(e);var o=this.defineRule(e,t,i);return this[e]=o,o},r.prototype.OVERRIDE_RULE=function(e,t,i){i===void 0&&(i=Ax.DEFAULT_RULE_CONFIG);var n=[];n=n.concat((0,Iye.validateRuleIsOverridden)(e,this.definedRulesNames,this.className)),this.definitionErrors=this.definitionErrors.concat(n);var s=this.defineRule(e,t,i);return this[e]=s,s},r.prototype.BACKTRACK=function(e,t){return function(){this.isBackTrackingStack.push(1);var i=this.saveRecogState();try{return e.apply(this,t),!0}catch(n){if((0,mye.isRecognitionException)(n))return!1;throw n}finally{this.reloadRecogState(i),this.isBackTrackingStack.pop()}}},r.prototype.getGAstProductions=function(){return this.gastProductionsCache},r.prototype.getSerializedGastProductions=function(){return(0,yye.serializeGrammar)((0,Fq.values)(this.gastProductionsCache))},r}();Cy.RecognizerApi=wye});var Mq=w(Ey=>{"use strict";Object.defineProperty(Ey,"__esModule",{value:!0});Ey.RecognizerEngine=void 0;var Pr=Gt(),Yn=fy(),my=ef(),Lq=Pd(),rf=xd(),Tq=Gn(),Bye=sx(),Oq=NA(),Fd=Vg(),Qye=ox(),bye=function(){function r(){}return r.prototype.initRecognizerEngine=function(e,t){if(this.className=(0,Qye.classNameFromInstance)(this),this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=Fd.tokenStructuredMatcherNoCategories,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},(0,Pr.has)(t,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a property. + See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0 + For Further details.`);if((0,Pr.isArray)(e)){if((0,Pr.isEmpty)(e))throw Error(`A Token Vocabulary cannot be empty. + Note that the first argument for the parser constructor + is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument. + See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0 + For Further details.`)}if((0,Pr.isArray)(e))this.tokensMap=(0,Pr.reduce)(e,function(o,a){return o[a.name]=a,o},{});else if((0,Pr.has)(e,"modes")&&(0,Pr.every)((0,Pr.flatten)((0,Pr.values)(e.modes)),Fd.isTokenType)){var i=(0,Pr.flatten)((0,Pr.values)(e.modes)),n=(0,Pr.uniq)(i);this.tokensMap=(0,Pr.reduce)(n,function(o,a){return o[a.name]=a,o},{})}else if((0,Pr.isObject)(e))this.tokensMap=(0,Pr.cloneObj)(e);else throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=Oq.EOF;var s=(0,Pr.every)((0,Pr.values)(e),function(o){return(0,Pr.isEmpty)(o.categoryMatches)});this.tokenMatcher=s?Fd.tokenStructuredMatcherNoCategories:Fd.tokenStructuredMatcher,(0,Fd.augmentTokenTypes)((0,Pr.values)(this.tokensMap))},r.prototype.defineRule=function(e,t,i){if(this.selfAnalysisDone)throw Error("Grammar rule <"+e+`> may not be defined after the 'performSelfAnalysis' method has been called' +Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);var n=(0,Pr.has)(i,"resyncEnabled")?i.resyncEnabled:Tq.DEFAULT_RULE_CONFIG.resyncEnabled,s=(0,Pr.has)(i,"recoveryValueFunc")?i.recoveryValueFunc:Tq.DEFAULT_RULE_CONFIG.recoveryValueFunc,o=this.ruleShortNameIdx<t},r.prototype.orInternal=function(e,t){var i=this.getKeyForAutomaticLookahead(Yn.OR_IDX,t),n=(0,Pr.isArray)(e)?e:e.DEF,s=this.getLaFuncFromCache(i),o=s.call(this,n);if(o!==void 0){var a=n[o];return a.ALT.call(this)}this.raiseNoAltException(t,e.ERR_MSG)},r.prototype.ruleFinallyStateUpdate=function(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){var e=this.LA(1),t=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new my.NotAllInputParsedException(t,e))}},r.prototype.subruleInternal=function(e,t,i){var n;try{var s=i!==void 0?i.ARGS:void 0;return n=e.call(this,t,s),this.cstPostNonTerminal(n,i!==void 0&&i.LABEL!==void 0?i.LABEL:e.ruleName),n}catch(o){this.subruleInternalError(o,i,e.ruleName)}},r.prototype.subruleInternalError=function(e,t,i){throw(0,my.isRecognitionException)(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,t!==void 0&&t.LABEL!==void 0?t.LABEL:i),delete e.partialCstResult),e},r.prototype.consumeInternal=function(e,t,i){var n;try{var s=this.LA(1);this.tokenMatcher(s,e)===!0?(this.consumeToken(),n=s):this.consumeInternalError(e,s,i)}catch(o){n=this.consumeInternalRecovery(e,t,o)}return this.cstPostTerminal(i!==void 0&&i.LABEL!==void 0?i.LABEL:e.name,n),n},r.prototype.consumeInternalError=function(e,t,i){var n,s=this.LA(0);throw i!==void 0&&i.ERR_MSG?n=i.ERR_MSG:n=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:s,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new my.MismatchedTokenException(n,t,s))},r.prototype.consumeInternalRecovery=function(e,t,i){if(this.recoveryEnabled&&i.name==="MismatchedTokenException"&&!this.isBackTracking()){var n=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,n)}catch(s){throw s.name===Bye.IN_RULE_RECOVERY_EXCEPTION?i:s}}else throw i},r.prototype.saveRecogState=function(){var e=this.errors,t=(0,Pr.cloneArr)(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK}},r.prototype.reloadRecogState=function(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK},r.prototype.ruleInvocationStateUpdate=function(e,t,i){this.RULE_OCCURRENCE_STACK.push(i),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(t,e)},r.prototype.isBackTracking=function(){return this.isBackTrackingStack.length!==0},r.prototype.getCurrRuleFullName=function(){var e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]},r.prototype.shortRuleNameToFullName=function(e){return this.shortRuleNameToFull[e]},r.prototype.isAtEndOfInput=function(){return this.tokenMatcher(this.LA(1),Oq.EOF)},r.prototype.reset=function(){this.resetLexerState(),this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]},r}();Ey.RecognizerEngine=bye});var Uq=w(Iy=>{"use strict";Object.defineProperty(Iy,"__esModule",{value:!0});Iy.ErrorHandler=void 0;var lx=ef(),cx=Gt(),Kq=Pd(),Sye=Gn(),vye=function(){function r(){}return r.prototype.initErrorHandler=function(e){this._errors=[],this.errorMessageProvider=(0,cx.has)(e,"errorMessageProvider")?e.errorMessageProvider:Sye.DEFAULT_PARSER_CONFIG.errorMessageProvider},r.prototype.SAVE_ERROR=function(e){if((0,lx.isRecognitionException)(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:(0,cx.cloneArr)(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")},Object.defineProperty(r.prototype,"errors",{get:function(){return(0,cx.cloneArr)(this._errors)},set:function(e){this._errors=e},enumerable:!1,configurable:!0}),r.prototype.raiseEarlyExitException=function(e,t,i){for(var n=this.getCurrRuleFullName(),s=this.getGAstProductions()[n],o=(0,Kq.getLookaheadPathsForOptionalProd)(e,s,t,this.maxLookahead),a=o[0],l=[],c=1;c<=this.maxLookahead;c++)l.push(this.LA(c));var u=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:a,actual:l,previous:this.LA(0),customUserDescription:i,ruleName:n});throw this.SAVE_ERROR(new lx.EarlyExitException(u,this.LA(1),this.LA(0)))},r.prototype.raiseNoAltException=function(e,t){for(var i=this.getCurrRuleFullName(),n=this.getGAstProductions()[i],s=(0,Kq.getLookaheadPathsForOr)(e,n,this.maxLookahead),o=[],a=1;a<=this.maxLookahead;a++)o.push(this.LA(a));var l=this.LA(0),c=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:s,actual:o,previous:l,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new lx.NoViableAltException(c,this.LA(1),l))},r}();Iy.ErrorHandler=vye});var Yq=w(yy=>{"use strict";Object.defineProperty(yy,"__esModule",{value:!0});yy.ContentAssist=void 0;var Hq=xd(),Gq=Gt(),xye=function(){function r(){}return r.prototype.initContentAssist=function(){},r.prototype.computeContentAssist=function(e,t){var i=this.gastProductionsCache[e];if((0,Gq.isUndefined)(i))throw Error("Rule ->"+e+"<- does not exist in this grammar.");return(0,Hq.nextPossibleTokensAfter)([i],t,this.tokenMatcher,this.maxLookahead)},r.prototype.getNextPossibleTokenTypes=function(e){var t=(0,Gq.first)(e.ruleStack),i=this.getGAstProductions(),n=i[t],s=new Hq.NextAfterTokenWalker(n,e).startWalking();return s},r}();yy.ContentAssist=xye});var Zq=w(Qy=>{"use strict";Object.defineProperty(Qy,"__esModule",{value:!0});Qy.GastRecorder=void 0;var En=Gt(),To=dn(),Pye=yd(),Wq=Vg(),zq=NA(),Dye=Gn(),kye=fy(),By={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(By);var jq=!0,qq=Math.pow(2,kye.BITS_FOR_OCCURRENCE_IDX)-1,Vq=(0,zq.createToken)({name:"RECORDING_PHASE_TOKEN",pattern:Pye.Lexer.NA});(0,Wq.augmentTokenTypes)([Vq]);var Xq=(0,zq.createTokenInstance)(Vq,`This IToken indicates the Parser is in Recording Phase + See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(Xq);var Rye={name:`This CSTNode indicates the Parser is in Recording Phase + See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},Fye=function(){function r(){}return r.prototype.initGastRecorder=function(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1},r.prototype.enableRecording=function(){var e=this;this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",function(){for(var t=function(n){var s=n>0?n:"";e["CONSUME"+s]=function(o,a){return this.consumeInternalRecord(o,n,a)},e["SUBRULE"+s]=function(o,a){return this.subruleInternalRecord(o,n,a)},e["OPTION"+s]=function(o){return this.optionInternalRecord(o,n)},e["OR"+s]=function(o){return this.orInternalRecord(o,n)},e["MANY"+s]=function(o){this.manyInternalRecord(n,o)},e["MANY_SEP"+s]=function(o){this.manySepFirstInternalRecord(n,o)},e["AT_LEAST_ONE"+s]=function(o){this.atLeastOneInternalRecord(n,o)},e["AT_LEAST_ONE_SEP"+s]=function(o){this.atLeastOneSepFirstInternalRecord(n,o)}},i=0;i<10;i++)t(i);e.consume=function(n,s,o){return this.consumeInternalRecord(s,n,o)},e.subrule=function(n,s,o){return this.subruleInternalRecord(s,n,o)},e.option=function(n,s){return this.optionInternalRecord(s,n)},e.or=function(n,s){return this.orInternalRecord(s,n)},e.many=function(n,s){this.manyInternalRecord(n,s)},e.atLeastOne=function(n,s){this.atLeastOneInternalRecord(n,s)},e.ACTION=e.ACTION_RECORD,e.BACKTRACK=e.BACKTRACK_RECORD,e.LA=e.LA_RECORD})},r.prototype.disableRecording=function(){var e=this;this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",function(){for(var t=0;t<10;t++){var i=t>0?t:"";delete e["CONSUME"+i],delete e["SUBRULE"+i],delete e["OPTION"+i],delete e["OR"+i],delete e["MANY"+i],delete e["MANY_SEP"+i],delete e["AT_LEAST_ONE"+i],delete e["AT_LEAST_ONE_SEP"+i]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})},r.prototype.ACTION_RECORD=function(e){},r.prototype.BACKTRACK_RECORD=function(e,t){return function(){return!0}},r.prototype.LA_RECORD=function(e){return Dye.END_OF_FILE},r.prototype.topLevelRuleRecord=function(e,t){try{var i=new To.Rule({definition:[],name:e});return i.name=e,this.recordingProdStack.push(i),t.call(this),this.recordingProdStack.pop(),i}catch(n){if(n.KNOWN_RECORDER_ERROR!==!0)try{n.message=n.message+` + This error was thrown during the "grammar recording phase" For more info see: + https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw n}throw n}},r.prototype.optionInternalRecord=function(e,t){return Nd.call(this,To.Option,e,t)},r.prototype.atLeastOneInternalRecord=function(e,t){Nd.call(this,To.RepetitionMandatory,t,e)},r.prototype.atLeastOneSepFirstInternalRecord=function(e,t){Nd.call(this,To.RepetitionMandatoryWithSeparator,t,e,jq)},r.prototype.manyInternalRecord=function(e,t){Nd.call(this,To.Repetition,t,e)},r.prototype.manySepFirstInternalRecord=function(e,t){Nd.call(this,To.RepetitionWithSeparator,t,e,jq)},r.prototype.orInternalRecord=function(e,t){return Nye.call(this,e,t)},r.prototype.subruleInternalRecord=function(e,t,i){if(wy(t),!e||(0,En.has)(e,"ruleName")===!1){var n=new Error(" argument is invalid"+(" expecting a Parser method reference but got: <"+JSON.stringify(e)+">")+(` + inside top level rule: <`+this.recordingProdStack[0].name+">"));throw n.KNOWN_RECORDER_ERROR=!0,n}var s=(0,En.peek)(this.recordingProdStack),o=e.ruleName,a=new To.NonTerminal({idx:t,nonTerminalName:o,label:i==null?void 0:i.LABEL,referencedRule:void 0});return s.definition.push(a),this.outputCst?Rye:By},r.prototype.consumeInternalRecord=function(e,t,i){if(wy(t),!(0,Wq.hasShortKeyProperty)(e)){var n=new Error(" argument is invalid"+(" expecting a TokenType reference but got: <"+JSON.stringify(e)+">")+(` + inside top level rule: <`+this.recordingProdStack[0].name+">"));throw n.KNOWN_RECORDER_ERROR=!0,n}var s=(0,En.peek)(this.recordingProdStack),o=new To.Terminal({idx:t,terminalType:e,label:i==null?void 0:i.LABEL});return s.definition.push(o),Xq},r}();Qy.GastRecorder=Fye;function Nd(r,e,t,i){i===void 0&&(i=!1),wy(t);var n=(0,En.peek)(this.recordingProdStack),s=(0,En.isFunction)(e)?e:e.DEF,o=new r({definition:[],idx:t});return i&&(o.separator=e.SEP),(0,En.has)(e,"MAX_LOOKAHEAD")&&(o.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(o),s.call(this),n.definition.push(o),this.recordingProdStack.pop(),By}function Nye(r,e){var t=this;wy(e);var i=(0,En.peek)(this.recordingProdStack),n=(0,En.isArray)(r)===!1,s=n===!1?r:r.DEF,o=new To.Alternation({definition:[],idx:e,ignoreAmbiguities:n&&r.IGNORE_AMBIGUITIES===!0});(0,En.has)(r,"MAX_LOOKAHEAD")&&(o.maxLookahead=r.MAX_LOOKAHEAD);var a=(0,En.some)(s,function(l){return(0,En.isFunction)(l.GATE)});return o.hasPredicates=a,i.definition.push(o),(0,En.forEach)(s,function(l){var c=new To.Alternative({definition:[]});o.definition.push(c),(0,En.has)(l,"IGNORE_AMBIGUITIES")?c.ignoreAmbiguities=l.IGNORE_AMBIGUITIES:(0,En.has)(l,"GATE")&&(c.ignoreAmbiguities=!0),t.recordingProdStack.push(c),l.ALT.call(t),t.recordingProdStack.pop()}),By}function Jq(r){return r===0?"":""+r}function wy(r){if(r<0||r>qq){var e=new Error("Invalid DSL Method idx value: <"+r+`> + `+("Idx value must be a none negative value smaller than "+(qq+1)));throw e.KNOWN_RECORDER_ERROR=!0,e}}});var $q=w(by=>{"use strict";Object.defineProperty(by,"__esModule",{value:!0});by.PerformanceTracer=void 0;var _q=Gt(),Lye=Gn(),Tye=function(){function r(){}return r.prototype.initPerformanceTracer=function(e){if((0,_q.has)(e,"traceInitPerf")){var t=e.traceInitPerf,i=typeof t=="number";this.traceInitMaxIdent=i?t:1/0,this.traceInitPerf=i?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=Lye.DEFAULT_PARSER_CONFIG.traceInitPerf;this.traceInitIndent=-1},r.prototype.TRACE_INIT=function(e,t){if(this.traceInitPerf===!0){this.traceInitIndent++;var i=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <"+e+">");var n=(0,_q.timer)(t),s=n.time,o=n.value,a=s>10?console.warn:console.log;return this.traceInitIndent time: "+s+"ms"),this.traceInitIndent--,o}else return t()},r}();by.PerformanceTracer=Tye});var eJ=w(Sy=>{"use strict";Object.defineProperty(Sy,"__esModule",{value:!0});Sy.applyMixins=void 0;function Oye(r,e){e.forEach(function(t){var i=t.prototype;Object.getOwnPropertyNames(i).forEach(function(n){if(n!=="constructor"){var s=Object.getOwnPropertyDescriptor(i,n);s&&(s.get||s.set)?Object.defineProperty(r.prototype,n,s):r.prototype[n]=t.prototype[n]}})})}Sy.applyMixins=Oye});var Gn=w(dr=>{"use strict";var iJ=dr&&dr.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(dr,"__esModule",{value:!0});dr.EmbeddedActionsParser=dr.CstParser=dr.Parser=dr.EMPTY_ALT=dr.ParserDefinitionErrorType=dr.DEFAULT_RULE_CONFIG=dr.DEFAULT_PARSER_CONFIG=dr.END_OF_FILE=void 0;var _i=Gt(),Mye=Uj(),tJ=NA(),nJ=Sd(),rJ=gq(),Kye=sx(),Uye=Iq(),Hye=Dq(),Gye=Rq(),Yye=Nq(),jye=Mq(),qye=Uq(),Jye=Yq(),Wye=Zq(),zye=$q(),Vye=eJ();dr.END_OF_FILE=(0,tJ.createTokenInstance)(tJ.EOF,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(dr.END_OF_FILE);dr.DEFAULT_PARSER_CONFIG=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:nJ.defaultParserErrorProvider,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1});dr.DEFAULT_RULE_CONFIG=Object.freeze({recoveryValueFunc:function(){},resyncEnabled:!0});var Xye;(function(r){r[r.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",r[r.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",r[r.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",r[r.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",r[r.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",r[r.LEFT_RECURSION=5]="LEFT_RECURSION",r[r.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",r[r.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",r[r.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",r[r.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",r[r.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",r[r.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",r[r.TOO_MANY_ALTS=12]="TOO_MANY_ALTS"})(Xye=dr.ParserDefinitionErrorType||(dr.ParserDefinitionErrorType={}));function Zye(r){return r===void 0&&(r=void 0),function(){return r}}dr.EMPTY_ALT=Zye;var vy=function(){function r(e,t){this.definitionErrors=[],this.selfAnalysisDone=!1;var i=this;if(i.initErrorHandler(t),i.initLexerAdapter(),i.initLooksAhead(t),i.initRecognizerEngine(e,t),i.initRecoverable(t),i.initTreeBuilder(t),i.initContentAssist(),i.initGastRecorder(t),i.initPerformanceTracer(t),(0,_i.has)(t,"ignoredIssues"))throw new Error(`The IParserConfig property has been deprecated. + Please use the flag on the relevant DSL method instead. + See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES + For further details.`);this.skipValidations=(0,_i.has)(t,"skipValidations")?t.skipValidations:dr.DEFAULT_PARSER_CONFIG.skipValidations}return r.performSelfAnalysis=function(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")},r.prototype.performSelfAnalysis=function(){var e=this;this.TRACE_INIT("performSelfAnalysis",function(){var t;e.selfAnalysisDone=!0;var i=e.className;e.TRACE_INIT("toFastProps",function(){(0,_i.toFastProperties)(e)}),e.TRACE_INIT("Grammar Recording",function(){try{e.enableRecording(),(0,_i.forEach)(e.definedRulesNames,function(s){var o=e[s],a=o.originalGrammarAction,l=void 0;e.TRACE_INIT(s+" Rule",function(){l=e.topLevelRuleRecord(s,a)}),e.gastProductionsCache[s]=l})}finally{e.disableRecording()}});var n=[];if(e.TRACE_INIT("Grammar Resolving",function(){n=(0,rJ.resolveGrammar)({rules:(0,_i.values)(e.gastProductionsCache)}),e.definitionErrors=e.definitionErrors.concat(n)}),e.TRACE_INIT("Grammar Validations",function(){if((0,_i.isEmpty)(n)&&e.skipValidations===!1){var s=(0,rJ.validateGrammar)({rules:(0,_i.values)(e.gastProductionsCache),maxLookahead:e.maxLookahead,tokenTypes:(0,_i.values)(e.tokensMap),errMsgProvider:nJ.defaultGrammarValidatorErrorProvider,grammarName:i});e.definitionErrors=e.definitionErrors.concat(s)}}),(0,_i.isEmpty)(e.definitionErrors)&&(e.recoveryEnabled&&e.TRACE_INIT("computeAllProdsFollows",function(){var s=(0,Mye.computeAllProdsFollows)((0,_i.values)(e.gastProductionsCache));e.resyncFollows=s}),e.TRACE_INIT("ComputeLookaheadFunctions",function(){e.preComputeLookaheadFunctions((0,_i.values)(e.gastProductionsCache))})),!r.DEFER_DEFINITION_ERRORS_HANDLING&&!(0,_i.isEmpty)(e.definitionErrors))throw t=(0,_i.map)(e.definitionErrors,function(s){return s.message}),new Error(`Parser Definition Errors detected: + `+t.join(` +------------------------------- +`))})},r.DEFER_DEFINITION_ERRORS_HANDLING=!1,r}();dr.Parser=vy;(0,Vye.applyMixins)(vy,[Kye.Recoverable,Uye.LooksAhead,Hye.TreeBuilder,Gye.LexerAdapter,jye.RecognizerEngine,Yye.RecognizerApi,qye.ErrorHandler,Jye.ContentAssist,Wye.GastRecorder,zye.PerformanceTracer]);var _ye=function(r){iJ(e,r);function e(t,i){i===void 0&&(i=dr.DEFAULT_PARSER_CONFIG);var n=this,s=(0,_i.cloneObj)(i);return s.outputCst=!0,n=r.call(this,t,s)||this,n}return e}(vy);dr.CstParser=_ye;var $ye=function(r){iJ(e,r);function e(t,i){i===void 0&&(i=dr.DEFAULT_PARSER_CONFIG);var n=this,s=(0,_i.cloneObj)(i);return s.outputCst=!1,n=r.call(this,t,s)||this,n}return e}(vy);dr.EmbeddedActionsParser=$ye});var oJ=w(xy=>{"use strict";Object.defineProperty(xy,"__esModule",{value:!0});xy.createSyntaxDiagramsCode=void 0;var sJ=Dv();function ewe(r,e){var t=e===void 0?{}:e,i=t.resourceBase,n=i===void 0?"https://unpkg.com/chevrotain@"+sJ.VERSION+"/diagrams/":i,s=t.css,o=s===void 0?"https://unpkg.com/chevrotain@"+sJ.VERSION+"/diagrams/diagrams.css":s,a=` + + + + + +`,l=` + +`,c=` +'; - res.end(content, 'utf-8'); -}; - -const casTicket = function (req, token, callback) { - // get configuration - if (!settings.get('CAS_enabled')) { - logger.error('Got ticket validation request, but CAS is not enabled'); - callback(); - } - - // get ticket and validate. - const parsedUrl = url.parse(req.url, true); - const ticketId = parsedUrl.query.ticket; - const baseUrl = settings.get('CAS_base_url'); - const cas_version = parseFloat(settings.get('CAS_version')); - const appUrl = Meteor.absoluteUrl().replace(/\/$/, '') + __meteor_runtime_config__.ROOT_URL_PATH_PREFIX; - logger.debug(`Using CAS_base_url: ${baseUrl}`); - - validate( - { - base_url: baseUrl, - version: cas_version, - service: `${appUrl}/_cas/${token}`, - }, - ticketId, - async (err, status, username, details) => { - if (err) { - logger.error(`error when trying to validate: ${err.message}`); - } else if (status) { - logger.info(`Validated user: ${username}`); - const user_info = { username }; - - // CAS 2.0 attributes handling - if (details && details.attributes) { - _.extend(user_info, { attributes: details.attributes }); - } - await CredentialTokens.create(token, user_info); - } else { - logger.error(`Unable to validate ticket: ${ticketId}`); - } - // logger.debug("Received response: " + JSON.stringify(details, null , 4)); - - callback(); - }, - ); -}; - -const middleware = function (req, res, next) { - // Make sure to catch any exceptions because otherwise we'd crash - // the runner - try { - const barePath = req.url.substring(0, req.url.indexOf('?')); - const splitPath = barePath.split('/'); - - // Any non-cas request will continue down the default - // middlewares. - if (splitPath[1] !== '_cas') { - next(); - return; - } - - // get auth token - const credentialToken = splitPath[2]; - if (!credentialToken) { - closePopup(res); - return; - } - - // validate ticket - casTicket(req, credentialToken, () => { - closePopup(res); - }); - } catch (err) { - logger.error({ msg: 'Unexpected error', err }); - closePopup(res); - } -}; - -// Listen to incoming OAuth http requests -WebApp.connectHandlers.use((req, res, next) => { - middleware(req, res, next); -}); - -/* - * Register a server-side login handle. - * It is call after Accounts.callLoginMethod() is call from client. - * - */ -Accounts.registerLoginHandler('cas', async (options) => { - if (!options.cas) { - return undefined; - } - - // TODO: Sync wrapper due to the chain conversion to async models - const credentials = await CredentialTokens.findOneNotExpiredById(options.cas.credentialToken); - if (credentials === undefined) { - throw new Meteor.Error(Accounts.LoginCancelledError.numericError, 'no matching login attempt found'); - } - - const result = credentials.userInfo; - const syncUserDataFieldMap = settings.get('CAS_Sync_User_Data_FieldMap').trim(); - const cas_version = parseFloat(settings.get('CAS_version')); - const sync_enabled = settings.get('CAS_Sync_User_Data_Enabled'); - const trustUsername = settings.get('CAS_trust_username'); - const verified = settings.get('Accounts_Verify_Email_For_External_Accounts'); - const userCreationEnabled = settings.get('CAS_Creation_User_Enabled'); - - // We have these - const ext_attrs = { - username: result.username, - }; - - // We need these - const int_attrs = { - email: undefined, - name: undefined, - username: undefined, - rooms: undefined, - }; - - // Import response attributes - if (cas_version >= 2.0) { - // Clean & import external attributes - _.each(result.attributes, (value, ext_name) => { - if (value) { - ext_attrs[ext_name] = value[0]; - } - }); - } - - // Source internal attributes - if (syncUserDataFieldMap) { - // Our mapping table: key(int_attr) -> value(ext_attr) - // Spoken: Source this internal attribute from these external attributes - const attr_map = JSON.parse(syncUserDataFieldMap); - - _.each(attr_map, (source, int_name) => { - // Source is our String to interpolate - if (source && typeof source.valueOf() === 'string') { - let replacedValue = source; - _.each(ext_attrs, (value, ext_name) => { - replacedValue = replacedValue.replace(`%${ext_name}%`, ext_attrs[ext_name]); - }); - - if (source !== replacedValue) { - int_attrs[int_name] = replacedValue; - logger.debug(`Sourced internal attribute: ${int_name} = ${replacedValue}`); - } else { - logger.debug(`Sourced internal attribute: ${int_name} skipped.`); - } - } - }); - } - - // Search existing user by its external service id - logger.debug(`Looking up user by id: ${result.username}`); - // First, look for a user that has logged in from CAS with this username before - let user = await Users.findOne({ 'services.cas.external_id': result.username }); - if (!user) { - // If that user was not found, check if there's any Rocket.Chat user with that username - // With this, CAS login will continue to work if the user is renamed on both sides and also if the user is renamed only on Rocket.Chat. - // It'll also allow non-CAS users to switch to CAS based login - if (trustUsername) { - const username = new RegExp(`^${result.username}$`, 'i'); - user = await Users.findOne({ username }); - if (user) { - // Update the user's external_id to reflect this new username. - await Users.updateOne({ _id: user._id }, { $set: { 'services.cas.external_id': result.username } }); - } - } - } - - if (user) { - logger.debug(`Using existing user for '${result.username}' with id: ${user._id}`); - if (sync_enabled) { - logger.debug('Syncing user attributes'); - // Update name - if (int_attrs.name) { - await _setRealName(user._id, int_attrs.name); - } - - // Update email - if (int_attrs.email) { - await Users.updateOne({ _id: user._id }, { $set: { emails: [{ address: int_attrs.email, verified }] } }); - } - } - } else if (userCreationEnabled) { - // Define new user - const newUser = { - username: result.username, - active: true, - globalRoles: ['user'], - emails: [], - services: { - cas: { - external_id: result.username, - version: cas_version, - attrs: int_attrs, - }, - }, - }; - - // Add username - if (int_attrs.username) { - _.extend(newUser, { - username: int_attrs.username, - }); - } - - // Add User.name - if (int_attrs.name) { - _.extend(newUser, { - name: int_attrs.name, - }); - } - - // Add email - if (int_attrs.email) { - _.extend(newUser, { - emails: [{ address: int_attrs.email, verified }], - }); - } - - // Create the user - logger.debug(`User "${result.username}" does not exist yet, creating it`); - const userId = Accounts.insertUserDoc({}, newUser); - - // Fetch and use it - user = await Users.findOneById(userId); - logger.debug(`Created new user for '${result.username}' with id: ${user._id}`); - // logger.debug(JSON.stringify(user, undefined, 4)); - - logger.debug(`Joining user to attribute channels: ${int_attrs.rooms}`); - if (int_attrs.rooms) { - const roomNames = int_attrs.rooms.split(','); - for await (const roomName of roomNames) { - if (roomName) { - let room = await Rooms.findOneByNameAndType(roomName, 'c'); - if (!room) { - room = await createRoom('c', roomName, user); - } - } - } - } - } else { - // Should fail as no user exist and can't be created - logger.debug(`User "${result.username}" does not exist yet, will fail as no user creation is enabled`); - throw new Meteor.Error(Accounts.LoginCancelledError.numericError, 'no matching user account found'); - } - - return { userId: user._id }; -}); diff --git a/apps/meteor/app/cas/server/index.ts b/apps/meteor/app/cas/server/index.ts deleted file mode 100644 index 0ad22d77b198..000000000000 --- a/apps/meteor/app/cas/server/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -import './cas_rocketchat'; -import './cas_server'; diff --git a/apps/meteor/app/channel-settings/server/functions/saveRoomName.ts b/apps/meteor/app/channel-settings/server/functions/saveRoomName.ts index acbcb4c87c37..8aa8dc4578a5 100644 --- a/apps/meteor/app/channel-settings/server/functions/saveRoomName.ts +++ b/apps/meteor/app/channel-settings/server/functions/saveRoomName.ts @@ -55,9 +55,10 @@ export async function saveRoomName( return; } - const slugifiedRoomName = await getValidRoomName(displayName, rid); const isDiscussion = Boolean(room?.prid); + const slugifiedRoomName = isDiscussion ? displayName : await getValidRoomName(displayName, rid); + let update; if (isDiscussion || isRoomFederated(room)) { @@ -70,7 +71,9 @@ export async function saveRoomName( return; } - room.name && (await Integrations.updateRoomName(room.name, slugifiedRoomName)); + if (room.name && !isDiscussion) { + await Integrations.updateRoomName(room.name, slugifiedRoomName); + } if (sendMessage) { await Message.saveSystemMessage('r', rid, displayName, user); } diff --git a/apps/meteor/app/cloud/server/functions/buildRegistrationData.ts b/apps/meteor/app/cloud/server/functions/buildRegistrationData.ts index c2bd91e82dd8..07db80c5cca9 100644 --- a/apps/meteor/app/cloud/server/functions/buildRegistrationData.ts +++ b/apps/meteor/app/cloud/server/functions/buildRegistrationData.ts @@ -1,4 +1,5 @@ -import { Statistics, Users } from '@rocket.chat/models'; +import { LivechatRooms, Statistics, Users } from '@rocket.chat/models'; +import moment from 'moment'; import { settings } from '../../../settings/server'; import { statistics } from '../../../statistics/server'; @@ -30,6 +31,7 @@ export type WorkspaceRegistrationData = { deploymentPlatform: string; version: string; licenseVersion: number; + license?: string; enterpriseReady: boolean; setupComplete: boolean; connectionDisable: boolean; @@ -38,6 +40,7 @@ export type WorkspaceRegistrationData = { MAC: number; // activeContactsBillingMonth: number; // activeContactsYesterday: number; + statsToken?: string; }; export async function buildWorkspaceRegistrationData(contactEmail: T): Promise> { @@ -58,8 +61,17 @@ export async function buildWorkspaceRegistrationData('Country'); + const language = settings.get('Language'); + const organizationType = settings.get('Organization_Type'); + const industry = settings.get('Industry'); + const orgSize = settings.get('Size'); + const workspaceType = settings.get('Server_Type'); + const seats = await Users.getActiveLocalUserCount(); + const [macs] = await LivechatRooms.getMACStatisticsForPeriod(moment.utc().format('YYYY-MM')); + + const license = settings.get('Enterprise_License'); return { uniqueId: stats.uniqueId, @@ -85,12 +97,14 @@ export async function buildWorkspaceRegistrationData => { + try { + await syncWorkspace(); + + const token = await getWorkspaceAccessTokenOrThrow(true, 'workspace:billing', false); + + const subscriptionURL = getURL('admin/subscription', { + full: true, + }); + + const body = { + okCallback: `${subscriptionURL}?subscriptionSuccess=true`, + cancelCallback: subscriptionURL, + }; + + const billingUrl = settings.get('Cloud_Billing_Url'); + + const response = await fetch(`${billingUrl}/api/v2/checkout`, { + method: 'POST', + headers: { + Authorization: `Bearer ${token}`, + }, + body, + }); + + if (!response.ok) { + throw new Error(await response.json()); + } + + return response.json(); + } catch (err: any) { + SystemLogger.error({ + msg: 'Failed to get Checkout URL with Rocket.Chat Billing Service', + url: '/api/v2/checkout', + err, + }); + + return { + url: fallback, + }; + } +}; diff --git a/apps/meteor/app/cloud/server/functions/getConfirmationPoll.ts b/apps/meteor/app/cloud/server/functions/getConfirmationPoll.ts index 2c5d9dec77dc..deda7327a6b9 100644 --- a/apps/meteor/app/cloud/server/functions/getConfirmationPoll.ts +++ b/apps/meteor/app/cloud/server/functions/getConfirmationPoll.ts @@ -5,16 +5,19 @@ import { SystemLogger } from '../../../../server/lib/logger/system'; import { settings } from '../../../settings/server'; export async function getConfirmationPoll(deviceCode: string): Promise { - let payload; try { const cloudUrl = settings.get('Cloud_Url'); const response = await fetch(`${cloudUrl}/api/v2/register/workspace/poll`, { params: { token: deviceCode } }); - if (!response.ok) { - throw new Error((await response.json()).error); - } + try { + if (!response.ok) { + throw new Error((await response.json()).error); + } - payload = await response.json(); + return await response.json(); + } catch (err) { + throw new Error(`Failed to retrieve registration confirmation poll data: ${response.statusText}`); + } } catch (err: any) { SystemLogger.error({ msg: 'Failed to get confirmation poll from Rocket.Chat Cloud', @@ -24,10 +27,4 @@ export async function getConfirmationPoll(deviceCode: string): Promise { +export async function getWorkspaceAccessToken(forceNew = false, scope = '', save = true, throwOnError = false): Promise { const { workspaceRegistered } = await retrieveRegistrationStatus(); if (!workspaceRegistered) { @@ -29,7 +29,7 @@ export async function getWorkspaceAccessToken(forceNew = false, scope = '', save return settings.get('Cloud_Workspace_Access_Token'); } - const accessToken = await getWorkspaceAccessTokenWithScope(scope); + const accessToken = await getWorkspaceAccessTokenWithScope(scope, throwOnError); if (save) { await Promise.all([ @@ -37,7 +37,6 @@ export async function getWorkspaceAccessToken(forceNew = false, scope = '', save Settings.updateValueById('Cloud_Workspace_Access_Token_Expires_At', accessToken.expiresAt), ]); } - return accessToken.token; } @@ -47,11 +46,25 @@ export class CloudWorkspaceAccessTokenError extends Error { } } +export const isAbortError = (error: unknown): error is { type: 'AbortError' } => { + if (typeof error !== 'object' || error === null) { + return false; + } + + return 'type' in error && error.type === 'AbortError'; +}; + +export class CloudWorkspaceAccessTokenEmptyError extends Error { + constructor() { + super('Workspace access token is empty'); + } +} + export async function getWorkspaceAccessTokenOrThrow(forceNew = false, scope = '', save = true): Promise { - const token = await getWorkspaceAccessToken(forceNew, scope, save); + const token = await getWorkspaceAccessToken(forceNew, scope, save, true); if (!token) { - throw new CloudWorkspaceAccessTokenError(); + throw new CloudWorkspaceAccessTokenEmptyError(); } return token; diff --git a/apps/meteor/app/cloud/server/functions/getWorkspaceAccessTokenWithScope.ts b/apps/meteor/app/cloud/server/functions/getWorkspaceAccessTokenWithScope.ts index 88509902cb6d..92ff94a4b8f0 100644 --- a/apps/meteor/app/cloud/server/functions/getWorkspaceAccessTokenWithScope.ts +++ b/apps/meteor/app/cloud/server/functions/getWorkspaceAccessTokenWithScope.ts @@ -4,10 +4,11 @@ import { SystemLogger } from '../../../../server/lib/logger/system'; import { settings } from '../../../settings/server'; import { workspaceScopes } from '../oauthScopes'; import { getRedirectUri } from './getRedirectUri'; +import { CloudWorkspaceAccessTokenError } from './getWorkspaceAccessToken'; import { removeWorkspaceRegistrationInfo } from './removeWorkspaceRegistrationInfo'; import { retrieveRegistrationStatus } from './retrieveRegistrationStatus'; -export async function getWorkspaceAccessTokenWithScope(scope = '') { +export async function getWorkspaceAccessTokenWithScope(scope = '', throwOnError = false) { const { workspaceRegistered } = await retrieveRegistrationStatus(); const tokenResponse = { token: '', expiresAt: new Date() }; @@ -44,30 +45,32 @@ export async function getWorkspaceAccessTokenWithScope(scope = '') { headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, method: 'POST', body, + timeout: 3000, }); + payload = await response.json(); - } catch (err: any) { - SystemLogger.error({ - msg: 'Failed to get Workspace AccessToken from Rocket.Chat Cloud', - url: '/api/oauth/token', - scope, - ...(err.response?.data && { cloudError: err.response.data }), - err, - }); - if (err.response?.data?.error === 'oauth_invalid_client_credentials') { + if (response.status >= 400) { + if (payload.error === 'oauth_invalid_client_credentials') { + throw new CloudWorkspaceAccessTokenError(); + } + } + + const expiresAt = new Date(); + expiresAt.setSeconds(expiresAt.getSeconds() + payload.expires_in); + + return { + token: payload.access_token, + expiresAt, + }; + } catch (err: any) { + if (err instanceof CloudWorkspaceAccessTokenError) { SystemLogger.error('Server has been unregistered from cloud'); void removeWorkspaceRegistrationInfo(); + if (throwOnError) { + throw err; + } } - - return tokenResponse; } - - const expiresAt = new Date(); - expiresAt.setSeconds(expiresAt.getSeconds() + payload.expires_in); - - tokenResponse.expiresAt = expiresAt; - tokenResponse.token = payload.access_token; - return tokenResponse; } diff --git a/apps/meteor/app/cloud/server/functions/getWorkspaceLicense.ts b/apps/meteor/app/cloud/server/functions/getWorkspaceLicense.ts index f9f0cfadc669..f6c62a0ed1ad 100644 --- a/apps/meteor/app/cloud/server/functions/getWorkspaceLicense.ts +++ b/apps/meteor/app/cloud/server/functions/getWorkspaceLicense.ts @@ -49,36 +49,24 @@ const fetchCloudWorkspaceLicensePayload = async ({ token }: { token: string }): return payload; }; -export async function getWorkspaceLicense(): Promise<{ updated: boolean; license: string }> { +export async function getWorkspaceLicense() { const currentLicense = await Settings.findOne('Cloud_Workspace_License'); // it should never happen, since even if the license is not found, it will return an empty settings if (!currentLicense?._updatedAt) { throw new CloudWorkspaceLicenseError('Failed to retrieve current license'); } - const fromCurrentLicense = async () => { - const license = currentLicense?.value as string | undefined; - if (license) { - await callbacks.run('workspaceLicenseChanged', license); - } - - return { updated: false, license: license ?? '' }; - }; - try { const token = await getWorkspaceAccessToken(); if (!token) { - return fromCurrentLicense(); + return; } const payload = await fetchCloudWorkspaceLicensePayload({ token }); if (currentLicense.value && Date.parse(payload.updatedAt) <= currentLicense._updatedAt.getTime()) { - return fromCurrentLicense(); + return; } - - await Settings.updateValueById('Cloud_Workspace_License', payload.license); - await callbacks.run('workspaceLicenseChanged', payload.license); return { updated: true, license: payload.license }; @@ -88,7 +76,5 @@ export async function getWorkspaceLicense(): Promise<{ updated: boolean; license url: '/license', err, }); - - return fromCurrentLicense(); } } diff --git a/apps/meteor/app/cloud/server/functions/reconnectWorkspace.ts b/apps/meteor/app/cloud/server/functions/reconnectWorkspace.ts deleted file mode 100644 index 7ee02a5e5de4..000000000000 --- a/apps/meteor/app/cloud/server/functions/reconnectWorkspace.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Settings } from '@rocket.chat/models'; - -import { retrieveRegistrationStatus } from './retrieveRegistrationStatus'; -import { syncWorkspace } from './syncWorkspace'; - -export async function reconnectWorkspace() { - const { workspaceRegistered } = await retrieveRegistrationStatus(); - if (!workspaceRegistered || process.env.TEST_MODE) { - return false; - } - - await Settings.updateValueById('Register_Server', true); - - await syncWorkspace(); - - return true; -} diff --git a/apps/meteor/app/cloud/server/functions/registerPreIntentWorkspaceWizard.ts b/apps/meteor/app/cloud/server/functions/registerPreIntentWorkspaceWizard.ts index ce415d2aa983..e0865c24156a 100644 --- a/apps/meteor/app/cloud/server/functions/registerPreIntentWorkspaceWizard.ts +++ b/apps/meteor/app/cloud/server/functions/registerPreIntentWorkspaceWizard.ts @@ -21,7 +21,7 @@ export async function registerPreIntentWorkspaceWizard(): Promise { const response = await fetch(`${cloudUrl}/api/v2/register/workspace/pre-intent`, { method: 'POST', body: regInfo, - timeout: 10 * 1000, + timeout: 3 * 1000, }); if (!response.ok) { throw new Error((await response.json()).error); diff --git a/apps/meteor/app/cloud/server/functions/removeLicense.ts b/apps/meteor/app/cloud/server/functions/removeLicense.ts new file mode 100644 index 000000000000..b9afe2ddf09a --- /dev/null +++ b/apps/meteor/app/cloud/server/functions/removeLicense.ts @@ -0,0 +1,52 @@ +import { serverFetch as fetch } from '@rocket.chat/server-fetch'; + +import { callbacks } from '../../../../lib/callbacks'; +import { CloudWorkspaceConnectionError } from '../../../../lib/errors/CloudWorkspaceConnectionError'; +import { CloudWorkspaceRegistrationError } from '../../../../lib/errors/CloudWorkspaceRegistrationError'; +import { settings } from '../../../settings/server'; +import { CloudWorkspaceAccessTokenEmptyError, getWorkspaceAccessToken } from './getWorkspaceAccessToken'; +import { retrieveRegistrationStatus } from './retrieveRegistrationStatus'; +import { syncWorkspace } from './syncWorkspace'; + +export async function removeLicense() { + try { + const { workspaceRegistered } = await retrieveRegistrationStatus(); + if (!workspaceRegistered) { + throw new CloudWorkspaceRegistrationError('Workspace is not registered'); + } + + const token = await getWorkspaceAccessToken(true); + if (!token) { + throw new CloudWorkspaceAccessTokenEmptyError(); + } + + const workspaceRegistrationClientUri = settings.get('Cloud_Workspace_Registration_Client_Uri'); + const response = await fetch(`${workspaceRegistrationClientUri}/client/downgrade`, { + method: 'POST', + headers: { + Authorization: `Bearer ${token}`, + }, + }); + + if (!response.ok) { + try { + const { error } = await response.json(); + throw new CloudWorkspaceConnectionError(`Failed to connect to Rocket.Chat Cloud: ${error}`); + } catch (error) { + throw new CloudWorkspaceConnectionError(`Failed to connect to Rocket.Chat Cloud: ${response.statusText}`); + } + } + + await syncWorkspace(); + } catch (err) { + switch (true) { + case err instanceof CloudWorkspaceConnectionError: + case err instanceof CloudWorkspaceRegistrationError: + case err instanceof CloudWorkspaceAccessTokenEmptyError: + await callbacks.run('workspaceLicenseRemoved'); + break; + default: + throw err; + } + } +} diff --git a/apps/meteor/app/cloud/server/functions/removeWorkspaceRegistrationInfo.ts b/apps/meteor/app/cloud/server/functions/removeWorkspaceRegistrationInfo.ts index 5884a282482b..b4e5362f5ac7 100644 --- a/apps/meteor/app/cloud/server/functions/removeWorkspaceRegistrationInfo.ts +++ b/apps/meteor/app/cloud/server/functions/removeWorkspaceRegistrationInfo.ts @@ -9,14 +9,15 @@ export async function removeWorkspaceRegistrationInfo() { } await Promise.all([ - Settings.updateValueById('Cloud_Workspace_Id', null), - Settings.updateValueById('Cloud_Workspace_Name', null), - Settings.updateValueById('Cloud_Workspace_Client_Id', null), - Settings.updateValueById('Cloud_Workspace_Client_Secret', null), - Settings.updateValueById('Cloud_Workspace_Client_Secret_Expires_At', null), - Settings.updateValueById('Cloud_Workspace_PublicKey', null), - Settings.updateValueById('Cloud_Workspace_Registration_Client_Uri', null), + Settings.resetValueById('Cloud_Workspace_Id', null), + Settings.resetValueById('Cloud_Workspace_Name', null), + Settings.resetValueById('Cloud_Workspace_Client_Id', null), + Settings.resetValueById('Cloud_Workspace_Client_Secret', null), + Settings.resetValueById('Cloud_Workspace_Client_Secret_Expires_At', null), + Settings.resetValueById('Cloud_Workspace_PublicKey', null), + Settings.resetValueById('Cloud_Workspace_Registration_Client_Uri', null), ]); + await Settings.updateValueById('Show_Setup_Wizard', 'in_progress'); return true; } diff --git a/apps/meteor/app/cloud/server/functions/saveRegistrationData.ts b/apps/meteor/app/cloud/server/functions/saveRegistrationData.ts index 8e1e03113af4..d6815a7dcc15 100644 --- a/apps/meteor/app/cloud/server/functions/saveRegistrationData.ts +++ b/apps/meteor/app/cloud/server/functions/saveRegistrationData.ts @@ -1,8 +1,39 @@ import { Settings } from '@rocket.chat/models'; -import { callbacks } from '../../../../lib/callbacks'; +import { applyLicense } from '../../../../ee/app/license/server/applyLicense'; +import { settings } from '../../../settings/server'; +import { syncCloudData } from './syncWorkspace/syncCloudData'; -export function saveRegistrationData({ +export async function saveRegistrationData({ + workspaceId, + client_name, + client_id, + client_secret, + client_secret_expires_at, + publicKey, + registration_client_uri, +}: { + workspaceId: string; + client_name: string; + client_id: string; + client_secret: string; + client_secret_expires_at: number; + publicKey: string; + registration_client_uri: string; +}) { + await saveRegistrationDataBase({ + workspaceId, + client_name, + client_id, + client_secret, + client_secret_expires_at, + publicKey, + registration_client_uri, + }); + + await syncCloudData(); +} +function saveRegistrationDataBase({ workspaceId, client_name, client_id, @@ -10,7 +41,6 @@ export function saveRegistrationData({ client_secret_expires_at, publicKey, registration_client_uri, - licenseData, }: { workspaceId: string; client_name: string; @@ -19,9 +49,6 @@ export function saveRegistrationData({ client_secret_expires_at: number; publicKey: string; registration_client_uri: string; - licenseData: { - license: string; - }; }) { return Promise.all([ Settings.updateValueById('Register_Server', true), @@ -32,9 +59,60 @@ export function saveRegistrationData({ Settings.updateValueById('Cloud_Workspace_Client_Secret_Expires_At', client_secret_expires_at), Settings.updateValueById('Cloud_Workspace_PublicKey', publicKey), Settings.updateValueById('Cloud_Workspace_Registration_Client_Uri', registration_client_uri), - Settings.updateValueById('Cloud_Workspace_License', licenseData.license || ''), ]).then(async (...results) => { - await callbacks.run('workspaceLicenseChanged', licenseData.license); + // wait until all the settings are updated before syncing the data + for await (const retry of Array.from({ length: 10 })) { + if ( + settings.get('Register_Server') === true && + settings.get('Cloud_Workspace_Id') === workspaceId && + settings.get('Cloud_Workspace_Name') === client_name && + settings.get('Cloud_Workspace_Client_Id') === client_id && + settings.get('Cloud_Workspace_Client_Secret') === client_secret && + settings.get('Cloud_Workspace_Client_Secret_Expires_At') === client_secret_expires_at && + settings.get('Cloud_Workspace_PublicKey') === publicKey && + settings.get('Cloud_Workspace_Registration_Client_Uri') === registration_client_uri + ) { + break; + } + + if (retry === 9) { + throw new Error('Failed to save registration data'); + } + await new Promise((resolve) => setTimeout(resolve, 1000)); + } return results; }); } + +export async function saveRegistrationDataManual({ + workspaceId, + client_name, + client_id, + client_secret, + client_secret_expires_at, + publicKey, + registration_client_uri, + licenseData, +}: { + workspaceId: string; + client_name: string; + client_id: string; + client_secret: string; + client_secret_expires_at: number; + publicKey: string; + registration_client_uri: string; + licenseData: { + license: string; + }; +}) { + await saveRegistrationDataBase({ + workspaceId, + client_name, + client_id, + client_secret, + client_secret_expires_at, + publicKey, + registration_client_uri, + }); + await applyLicense(licenseData.license, true); +} diff --git a/apps/meteor/app/cloud/server/functions/supportedVersionsToken/supportedVersionsChooseLatest.ts b/apps/meteor/app/cloud/server/functions/supportedVersionsToken/supportedVersionsChooseLatest.ts index f0683535de6b..3493401144cf 100644 --- a/apps/meteor/app/cloud/server/functions/supportedVersionsToken/supportedVersionsChooseLatest.ts +++ b/apps/meteor/app/cloud/server/functions/supportedVersionsToken/supportedVersionsChooseLatest.ts @@ -1,7 +1,7 @@ import type { SignedSupportedVersions } from '@rocket.chat/server-cloud-communication'; export const supportedVersionsChooseLatest = async (...tokens: (SignedSupportedVersions | undefined)[]) => { - const [token] = (tokens.filter(Boolean) as SignedSupportedVersions[]).sort((a, b) => { + const [token] = (tokens.filter((r) => r?.timestamp != null) as SignedSupportedVersions[]).sort((a, b) => { return new Date(a.timestamp).getTime() - new Date(b.timestamp).getTime(); }); diff --git a/apps/meteor/app/cloud/server/functions/supportedVersionsToken/supportedVersionsToken.ts b/apps/meteor/app/cloud/server/functions/supportedVersionsToken/supportedVersionsToken.ts index 577abd4383d0..dd933107d57c 100644 --- a/apps/meteor/app/cloud/server/functions/supportedVersionsToken/supportedVersionsToken.ts +++ b/apps/meteor/app/cloud/server/functions/supportedVersionsToken/supportedVersionsToken.ts @@ -7,10 +7,12 @@ import { serverFetch as fetch } from '@rocket.chat/server-fetch'; import { SystemLogger } from '../../../../../server/lib/logger/system'; import { settings } from '../../../../settings/server'; +import { supportedVersions as supportedVersionsFromBuild } from '../../../../utils/rocketchat-supported-versions.info'; +import { buildVersionUpdateMessage } from '../../../../version-check/server/functions/buildVersionUpdateMessage'; import { generateWorkspaceBearerHttpHeader } from '../getWorkspaceAccessToken'; import { supportedVersionsChooseLatest } from './supportedVersionsChooseLatest'; -declare module '@rocket.chat/license' { +declare module '@rocket.chat/core-typings' { interface ILicenseV3 { supportedVersions?: SignedSupportedVersions; } @@ -83,7 +85,9 @@ const cacheValueInSettings = ( ); }; -/** CODE */ +const releaseEndpoint = process.env.OVERWRITE_INTERNAL_RELEASE_URL?.trim() + ? process.env.OVERWRITE_INTERNAL_RELEASE_URL.trim() + : 'https://releases.rocket.chat/v2/server/supportedVersions'; const getSupportedVersionsFromCloud = async () => { if (process.env.CLOUD_SUPPORTED_VERSIONS_TOKEN) { @@ -97,15 +101,16 @@ const getSupportedVersionsFromCloud = async () => { const headers = await generateWorkspaceBearerHttpHeader(); const response = await handleResponse( - fetch('https://releases.rocket.chat/v2/server/supportedVersions', { + fetch(releaseEndpoint, { headers, + timeout: 3000, }), ); if (!response.success) { SystemLogger.error({ msg: 'Failed to communicate with Rocket.Chat Cloud', - url: 'https://releases.rocket.chat/v2/server/supportedVersions', + url: releaseEndpoint, err: response.error, }); } @@ -123,8 +128,15 @@ const getSupportedVersionsToken = async () => { const [versionsFromLicense, response] = await Promise.all([License.getLicense(), getSupportedVersionsFromCloud()]); - return (await supportedVersionsChooseLatest(versionsFromLicense?.supportedVersions, (response.success && response.result) || undefined)) - ?.signed; + const supportedVersions = await supportedVersionsChooseLatest( + supportedVersionsFromBuild, + versionsFromLicense?.supportedVersions, + (response.success && response.result) || undefined, + ); + + await buildVersionUpdateMessage(supportedVersions?.versions); + + return supportedVersions?.signed; }; export const getCachedSupportedVersionsToken = cacheValueInSettings('Cloud_Workspace_Supported_Versions_Token', getSupportedVersionsToken); diff --git a/apps/meteor/app/cloud/server/functions/syncWorkspace/announcementSync.ts b/apps/meteor/app/cloud/server/functions/syncWorkspace/announcementSync.ts index f3885c1e95c2..dde631e0485b 100644 --- a/apps/meteor/app/cloud/server/functions/syncWorkspace/announcementSync.ts +++ b/apps/meteor/app/cloud/server/functions/syncWorkspace/announcementSync.ts @@ -2,16 +2,14 @@ import { type Cloud, type Serialized } from '@rocket.chat/core-typings'; import { serverFetch as fetch } from '@rocket.chat/server-fetch'; import { v, compile } from 'suretype'; -import { CloudWorkspaceAccessError } from '../../../../../lib/errors/CloudWorkspaceAccessError'; import { CloudWorkspaceConnectionError } from '../../../../../lib/errors/CloudWorkspaceConnectionError'; import { CloudWorkspaceRegistrationError } from '../../../../../lib/errors/CloudWorkspaceRegistrationError'; import { SystemLogger } from '../../../../../server/lib/logger/system'; import { settings } from '../../../../settings/server'; import { buildWorkspaceRegistrationData } from '../buildRegistrationData'; -import { getWorkspaceAccessToken } from '../getWorkspaceAccessToken'; +import { CloudWorkspaceAccessTokenEmptyError, getWorkspaceAccessToken } from '../getWorkspaceAccessToken'; import { retrieveRegistrationStatus } from '../retrieveRegistrationStatus'; import { handleAnnouncementsOnWorkspaceSync, handleNpsOnWorkspaceSync } from './handleCommsSync'; -import { legacySyncWorkspace } from './legacySyncWorkspace'; const workspaceCommPayloadSchema = v.object({ workspaceId: v.string().required(), @@ -85,7 +83,7 @@ export async function announcementSync() { const token = await getWorkspaceAccessToken(true); if (!token) { - throw new CloudWorkspaceAccessError('Workspace does not have a valid access token'); + throw new CloudWorkspaceAccessTokenEmptyError(); } const workspaceRegistrationData = await buildWorkspaceRegistrationData(undefined); @@ -105,12 +103,25 @@ export async function announcementSync() { return true; } catch (err) { - SystemLogger.error({ - msg: 'Failed to sync with Rocket.Chat Cloud', - url: '/comms/workspace', - err, - }); + switch (true) { + case err instanceof CloudWorkspaceConnectionError: + case err instanceof CloudWorkspaceRegistrationError: + case err instanceof CloudWorkspaceAccessTokenEmptyError: { + SystemLogger.info({ + msg: 'Failed to sync with Rocket.Chat Cloud', + function: 'announcementSync', + err, + }); + break; + } + default: { + SystemLogger.error({ + msg: 'Error during workspace sync', + function: 'announcementSync', + err, + }); + } + } + throw err; } - - await legacySyncWorkspace(); } diff --git a/apps/meteor/app/cloud/server/functions/syncWorkspace/handleCommsSync.ts b/apps/meteor/app/cloud/server/functions/syncWorkspace/handleCommsSync.ts index c8b07f8826cf..9d3934cc0a3c 100644 --- a/apps/meteor/app/cloud/server/functions/syncWorkspace/handleCommsSync.ts +++ b/apps/meteor/app/cloud/server/functions/syncWorkspace/handleCommsSync.ts @@ -1,6 +1,5 @@ import { NPS, Banner } from '@rocket.chat/core-services'; -import { type Cloud, type Serialized } from '@rocket.chat/core-typings'; -import { CloudAnnouncements } from '@rocket.chat/models'; +import type { Cloud, Serialized } from '@rocket.chat/core-typings'; import { getAndCreateNpsSurvey } from '../../../../../server/services/nps/getAndCreateNpsSurvey'; @@ -40,13 +39,18 @@ export const handleBannerOnWorkspaceSync = async (banners: Exclude): Cloud.Announcement => ({ - ...announcement, - _updatedAt: new Date(announcement._updatedAt), - expireAt: new Date(announcement.expireAt), - startAt: new Date(announcement.startAt), - createdAt: new Date(announcement.createdAt), -}); +const deserializeAnnouncement = (announcement: Serialized): Cloud.Announcement => { + const { inactivedAt, _updatedAt, expireAt, startAt, createdAt } = announcement; + + return { + ...announcement, + _updatedAt: new Date(_updatedAt), + expireAt: new Date(expireAt), + startAt: new Date(startAt), + createdAt: new Date(createdAt), + inactivedAt: inactivedAt ? new Date(inactivedAt) : undefined, + }; +}; export const handleAnnouncementsOnWorkspaceSync = async ( announcements: Exclude['announcements'], undefined>, @@ -54,12 +58,21 @@ export const handleAnnouncementsOnWorkspaceSync = async ( const { create, delete: deleteIds } = announcements; if (deleteIds) { - await CloudAnnouncements.deleteMany({ _id: { $in: deleteIds } }); + await Promise.all(deleteIds.map((bannerId) => Banner.disable(bannerId))); } - for await (const announcement of create.map(deserializeAnnouncement)) { - const { _id, ...rest } = announcement; + await Promise.all( + create.map(deserializeAnnouncement).map((announcement) => { + const { view, selector } = announcement; - await CloudAnnouncements.updateOne({ _id }, { $set: rest }, { upsert: true }); - } + return Banner.create({ + ...announcement, + ...(selector?.roles ? { roles: selector.roles } : {}), + view: { + ...view, + appId: 'cloud-announcements-core', + }, + }); + }), + ); }; diff --git a/apps/meteor/app/cloud/server/functions/syncWorkspace/index.ts b/apps/meteor/app/cloud/server/functions/syncWorkspace/index.ts index bdd898b510f7..4c1d78440648 100644 --- a/apps/meteor/app/cloud/server/functions/syncWorkspace/index.ts +++ b/apps/meteor/app/cloud/server/functions/syncWorkspace/index.ts @@ -1,19 +1,56 @@ +import { CloudWorkspaceRegistrationError } from '../../../../../lib/errors/CloudWorkspaceRegistrationError'; import { SystemLogger } from '../../../../../server/lib/logger/system'; -import { CloudWorkspaceAccessTokenError } from '../getWorkspaceAccessToken'; +import { CloudWorkspaceAccessTokenEmptyError, CloudWorkspaceAccessTokenError, isAbortError } from '../getWorkspaceAccessToken'; import { getCachedSupportedVersionsToken } from '../supportedVersionsToken/supportedVersionsToken'; import { announcementSync } from './announcementSync'; +import { legacySyncWorkspace } from './legacySyncWorkspace'; import { syncCloudData } from './syncCloudData'; +/** + * Syncs the workspace with the cloud + * @returns {Promise} + * @throws {Error} - If there is an unexpected error during sync like a network error + */ export async function syncWorkspace() { try { - await syncCloudData(); await announcementSync(); + await syncCloudData(); + await getCachedSupportedVersionsToken.reset(); } catch (err) { - if (err instanceof CloudWorkspaceAccessTokenError) { - // TODO: Remove License if there is no access token + switch (true) { + case err instanceof CloudWorkspaceRegistrationError: + case err instanceof CloudWorkspaceAccessTokenError: { + // There is no access token, so we can't sync + SystemLogger.info('Workspace does not have a valid access token, sync aborted'); + break; + } + default: { + if (!(err instanceof CloudWorkspaceAccessTokenEmptyError) && !isAbortError(err)) { + SystemLogger.error({ msg: 'Error during workspace sync', err }); + } + SystemLogger.info({ + msg: 'Falling back to legacy sync', + function: 'syncCloudData', + }); + try { + await legacySyncWorkspace(); + await getCachedSupportedVersionsToken.reset(); + } catch (err) { + switch (true) { + case err instanceof CloudWorkspaceRegistrationError: + case err instanceof CloudWorkspaceAccessTokenError: { + // There is no access token, so we can't sync + break; + } + default: { + if (!(err instanceof CloudWorkspaceAccessTokenEmptyError) && !isAbortError(err)) { + SystemLogger.error({ msg: 'Error during fallback workspace sync', err }); + } + throw err; + } + } + } + } } - SystemLogger.error({ msg: 'Error during workspace sync', err }); } - - await getCachedSupportedVersionsToken.reset(); } diff --git a/apps/meteor/app/cloud/server/functions/syncWorkspace/legacySyncWorkspace.ts b/apps/meteor/app/cloud/server/functions/syncWorkspace/legacySyncWorkspace.ts index d5f86fad8409..2bff8e1526d2 100644 --- a/apps/meteor/app/cloud/server/functions/syncWorkspace/legacySyncWorkspace.ts +++ b/apps/meteor/app/cloud/server/functions/syncWorkspace/legacySyncWorkspace.ts @@ -3,14 +3,12 @@ import { Settings } from '@rocket.chat/models'; import { serverFetch as fetch } from '@rocket.chat/server-fetch'; import { v, compile } from 'suretype'; -import { CloudWorkspaceAccessError } from '../../../../../lib/errors/CloudWorkspaceAccessError'; import { CloudWorkspaceConnectionError } from '../../../../../lib/errors/CloudWorkspaceConnectionError'; import { CloudWorkspaceRegistrationError } from '../../../../../lib/errors/CloudWorkspaceRegistrationError'; -import { SystemLogger } from '../../../../../server/lib/logger/system'; import { settings } from '../../../../settings/server'; import type { WorkspaceRegistrationData } from '../buildRegistrationData'; import { buildWorkspaceRegistrationData } from '../buildRegistrationData'; -import { getWorkspaceAccessToken } from '../getWorkspaceAccessToken'; +import { CloudWorkspaceAccessTokenEmptyError, getWorkspaceAccessToken } from '../getWorkspaceAccessToken'; import { getWorkspaceLicense } from '../getWorkspaceLicense'; import { retrieveRegistrationStatus } from '../retrieveRegistrationStatus'; import { handleBannerOnWorkspaceSync, handleNpsOnWorkspaceSync } from './handleCommsSync'; @@ -100,6 +98,7 @@ const fetchWorkspaceClientPayload = async ({ Authorization: `Bearer ${token}`, }, body: workspaceRegistrationData, + timeout: 3000, }); if (!response.ok) { @@ -146,37 +145,25 @@ const consumeWorkspaceSyncPayload = async (result: Serialized { } } - setImmediate(() => syncWorkspace()); + setImmediate(async () => { + try { + await syncWorkspace(); + } catch (e: any) { + if (e instanceof CloudWorkspaceAccessTokenEmptyError) { + return; + } + if (e.type && e.type === 'AbortError') { + return; + } + SystemLogger.error('An error occurred syncing workspace.', e.message); + } + }); await cronJobs.add(licenseCronName, '0 */12 * * *', async () => { - await syncWorkspace(); + try { + await syncWorkspace(); + } catch (e: any) { + if (e instanceof CloudWorkspaceAccessTokenEmptyError) { + return; + } + if (e.type && e.type === 'AbortError') { + return; + } + SystemLogger.error('An error occurred syncing workspace.', e.message); + } }); }); diff --git a/apps/meteor/app/cloud/server/license.ts b/apps/meteor/app/cloud/server/license.ts index e9ab8eccf4ab..49c03c564216 100644 --- a/apps/meteor/app/cloud/server/license.ts +++ b/apps/meteor/app/cloud/server/license.ts @@ -1 +1 @@ -export const LICENSE_VERSION = 2 as const; +export const LICENSE_VERSION = 3 as const; diff --git a/apps/meteor/app/cloud/server/methods.ts b/apps/meteor/app/cloud/server/methods.ts index 1d328d0c213e..0e47a8ba8754 100644 --- a/apps/meteor/app/cloud/server/methods.ts +++ b/apps/meteor/app/cloud/server/methods.ts @@ -8,7 +8,6 @@ import { checkUserHasCloudLogin } from './functions/checkUserHasCloudLogin'; import { connectWorkspace } from './functions/connectWorkspace'; import { finishOAuthAuthorization } from './functions/finishOAuthAuthorization'; import { getOAuthAuthorizationUrl } from './functions/getOAuthAuthorizationUrl'; -import { reconnectWorkspace } from './functions/reconnectWorkspace'; import { retrieveRegistrationStatus } from './functions/retrieveRegistrationStatus'; import { startRegisterWorkspace } from './functions/startRegisterWorkspace'; import { syncWorkspace } from './functions/syncWorkspace'; @@ -28,8 +27,6 @@ declare module '@rocket.chat/ui-contexts' { 'cloud:registerWorkspace': () => boolean; 'cloud:syncWorkspace': () => boolean; 'cloud:connectWorkspace': (token: string) => boolean | Error; - 'cloud:reconnectWorkspace': () => boolean; - 'cloud:disconnectWorkspace': () => boolean; 'cloud:getOAuthAuthorizationUrl': () => string; 'cloud:finishOAuthAuthorization': (code: string, state: string) => boolean; 'cloud:checkUserLoggedIn': () => boolean; @@ -137,22 +134,6 @@ Meteor.methods({ return connectWorkspace(token); }, - async 'cloud:reconnectWorkspace'() { - const uid = Meteor.userId(); - if (!uid) { - throw new Meteor.Error('error-invalid-user', 'Invalid user', { - method: 'cloud:reconnectWorkspace', - }); - } - - if (!(await hasPermissionAsync(uid, 'manage-cloud'))) { - throw new Meteor.Error('error-not-authorized', 'Not authorized', { - method: 'cloud:reconnectWorkspace', - }); - } - - return reconnectWorkspace(); - }, // Currently unused but will link local account to Rocket.Chat Cloud account. async 'cloud:getOAuthAuthorizationUrl'() { const uid = Meteor.userId(); diff --git a/apps/meteor/app/cors/server/cors.ts b/apps/meteor/app/cors/server/cors.ts index cb6fa94273a2..b4936d1456bc 100644 --- a/apps/meteor/app/cors/server/cors.ts +++ b/apps/meteor/app/cors/server/cors.ts @@ -16,14 +16,28 @@ type NextFunction = (err?: any) => void; const logger = new Logger('CORS'); +let templatePromise: Promise | void; + +declare module 'meteor/webapp' { + // eslint-disable-next-line @typescript-eslint/no-namespace + namespace WebApp { + function setInlineScriptsAllowed(allowed: boolean): Promise; + } +} + settings.watch( 'Enable_CSP', - Meteor.bindEnvironment((enabled) => { - WebAppInternals.setInlineScriptsAllowed(!enabled); + Meteor.bindEnvironment(async (enabled) => { + templatePromise = WebAppInternals.setInlineScriptsAllowed(!enabled); }), ); -WebApp.rawConnectHandlers.use((_req: http.IncomingMessage, res: http.ServerResponse, next: NextFunction) => { +WebApp.rawConnectHandlers.use(async (_req: http.IncomingMessage, res: http.ServerResponse, next: NextFunction) => { + if (templatePromise) { + await templatePromise; + templatePromise = void 0; + } + // XSS Protection for old browsers (IE) res.setHeader('X-XSS-Protection', '1'); @@ -46,6 +60,8 @@ WebApp.rawConnectHandlers.use((_req: http.IncomingMessage, res: http.ServerRespo const inlineHashes = [ // Hash for `window.close()`, required by the CAS login popup. "'sha256-jqxtvDkBbRAl9Hpqv68WdNOieepg8tJSYu1xIy7zT34='", + // Hash for /apps/meteor/packages/rocketchat-livechat/assets/demo.html:25 + "'sha256-aui5xYk3Lu1dQcnsPlNZI+qDTdfzdUv3fzsw80VLJgw='", ] .filter(Boolean) .join(' '); @@ -88,23 +104,24 @@ declare module 'meteor/webapp' { } } -// These routes already handle cache control on their own -const cacheControlledRoutes: Array = ['/assets', '/custom-sounds', '/emoji-custom', '/avatar', '/file-upload'].map( - (route) => new RegExp(`^${route}`, 'i'), -); +let cachingVersion = ''; +settings.watch('Troubleshoot_Force_Caching_Version', (value) => { + cachingVersion = String(value).trim(); +}); // @ts-expect-error - accessing internal property of webapp WebAppInternals.staticFilesMiddleware = function ( staticFiles: StaticFiles, - req: http.IncomingMessage, - res: http.ServerResponse, + req: http.IncomingMessage & { cookies: Record }, + res: http.ServerResponse & { cookie: (cookie: string, value: string) => void }, next: NextFunction, ) { res.setHeader('Access-Control-Allow-Origin', '*'); const { arch, path, url } = WebApp.categorizeRequest(req); - if (Meteor.isProduction && !cacheControlledRoutes.some((regexp) => regexp.test(path))) { - res.setHeader('Cache-Control', 'public, max-age=31536000'); + if (cachingVersion && req.cookies.cache_version !== cachingVersion) { + res.cookie('cache_version', cachingVersion); + res.setHeader('Clear-Site-Data', '"cache"'); } // Prevent meteor_runtime_config.js to load from a different expected hash possibly causing @@ -126,7 +143,10 @@ WebAppInternals.staticFilesMiddleware = function ( res.writeHead(404); return res.end(); } + + res.setHeader('Cache-Control', 'public, max-age=3600'); } + return _staticFilesMiddleware(staticFiles, req, res, next); }; diff --git a/apps/meteor/app/crowd/client/index.ts b/apps/meteor/app/crowd/client/index.ts deleted file mode 100644 index fecf898e1ae4..000000000000 --- a/apps/meteor/app/crowd/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -import './loginHelper'; diff --git a/apps/meteor/app/crowd/client/loginHelper.js b/apps/meteor/app/crowd/client/loginHelper.js deleted file mode 100644 index a2bb14023b3a..000000000000 --- a/apps/meteor/app/crowd/client/loginHelper.js +++ /dev/null @@ -1,26 +0,0 @@ -import { Accounts } from 'meteor/accounts-base'; -import { Meteor } from 'meteor/meteor'; - -Meteor.loginWithCrowd = function (...args) { - // Pull username and password - const username = args.shift(); - const password = args.shift(); - const callback = args.shift(); - - const loginRequest = { - crowd: true, - username, - crowdPassword: password, - }; - Accounts.callLoginMethod({ - methodArguments: [loginRequest], - userCallback(error) { - if (callback) { - if (error) { - return callback(error); - } - return callback(); - } - }, - }); -}; diff --git a/apps/meteor/app/crowd/server/crowd.ts b/apps/meteor/app/crowd/server/crowd.ts index b6b94f33e566..e43c65c70f91 100644 --- a/apps/meteor/app/crowd/server/crowd.ts +++ b/apps/meteor/app/crowd/server/crowd.ts @@ -68,23 +68,46 @@ export class CROWD { this.crowdClient = new AtlassianCrowd(this.options); } - async checkConnection() { - await this.crowdClient.ping(); + async checkConnection(): Promise { + return new Promise((resolve, reject) => + this.crowdClient.ping((err: any) => { + if (err) { + reject(err); + } + resolve(); + }), + ); } - async fetchCrowdUser(crowdUsername: string) { - const userResponse = await this.crowdClient.user.find(crowdUsername); + async fetchCrowdUser(crowdUsername: string): Promise> { + return new Promise((resolve, reject) => + this.crowdClient.user.find(crowdUsername, (err: any, userResponse: Record) => { + if (err) { + reject(err); + } + resolve({ + displayname: userResponse['display-name'], + username: userResponse.name, + email: userResponse.email, + active: userResponse.active, + crowd_username: crowdUsername, + }); + }), + ); + } - return { - displayname: userResponse['display-name'], - username: userResponse.name, - email: userResponse.email, - active: userResponse.active, - crowd_username: crowdUsername, - }; + async searchForCrowdUserByMail(email?: string): Promise | undefined> { + return new Promise((resolve) => + this.crowdClient.search('user', `email=" ${email} "`, (err: any, response: Record) => { + if (err) { + resolve(undefined); + } + resolve(response); + }), + ); } - async authenticate(username: string, password: string) { + async authenticate(username: string, password: string): Promise | undefined> { if (!username || !password) { logger.error('No username or password'); return; @@ -134,24 +157,30 @@ export class CROWD { logger.debug('New user. User is not synced yet.'); } logger.debug('Going to crowd:', crowdUsername); - const auth = await this.crowdClient.user.authenticate(crowdUsername, password); - - if (!auth) { - return; - } - const crowdUser: Record = await this.fetchCrowdUser(crowdUsername); - - if (user && settings.get('CROWD_Allow_Custom_Username') === true) { - crowdUser.username = user.username; - } + return new Promise((resolve, reject) => + this.crowdClient.user.authenticate(crowdUsername, password, async (err: any, res: Record) => { + if (err) { + reject(err); + } + const user = res; + try { + const crowdUser: Record = await this.fetchCrowdUser(crowdUsername); + if (user && settings.get('CROWD_Allow_Custom_Username') === true) { + crowdUser.username = user.name; + } - if (user) { - crowdUser._id = user._id; - } - crowdUser.password = password; + if (user) { + crowdUser._id = user._id; + } + crowdUser.password = password; - return crowdUser; + resolve(crowdUser); + } catch (err) { + reject(err); + } + }), + ); } async syncDataToUser(crowdUser: Record, id: string) { @@ -219,7 +248,7 @@ export class CROWD { const email = user.emails?.[0].address; logger.info('Attempting to find for user by email', email); - const response = this.crowdClient.searchSync('user', `email=" ${email} "`); + const response = await this.searchForCrowdUserByMail(email); if (!response || response.users.length === 0) { logger.warn('Could not find user in CROWD with username or email:', crowdUsername, email); if (settings.get('CROWD_Remove_Orphaned_Users') === true) { @@ -257,8 +286,15 @@ export class CROWD { } async updateUserCollection(crowdUser: Record) { + const username = crowdUser.crowd_username || crowdUser.username; + const mail = crowdUser.email; + + // If id is not provided, user is linked by crowd_username or email address const userQuery = { - _id: crowdUser._id, + ...(crowdUser._id && { _id: crowdUser._id }), + ...(!crowdUser._id && { + $or: [{ crowd_username: username }, { 'emails.address': mail }], + }), }; // find our existing user if they exist @@ -321,16 +357,17 @@ Accounts.registerLoginHandler('crowd', async function (this: typeof Accounts, lo } if (!user) { - logger.debug(`User ${loginRequest.username} is not allowd to access Rocket.Chat`); + logger.debug(`User ${loginRequest.username} is not allowed to access Rocket.Chat`); return new Meteor.Error('not-authorized', 'User is not authorized by crowd'); } const result = await crowd.updateUserCollection(user); return result; - } catch (err) { + } catch (err: any) { logger.debug({ err }); logger.error('Crowd user not authenticated due to an error'); + throw new Meteor.Error('user-not-found', err.message); } }); diff --git a/apps/meteor/app/crowd/server/methods.ts b/apps/meteor/app/crowd/server/methods.ts index 758ebd1fcb3c..a621e3c8d027 100644 --- a/apps/meteor/app/crowd/server/methods.ts +++ b/apps/meteor/app/crowd/server/methods.ts @@ -38,7 +38,7 @@ Meteor.methods({ await crowd.checkConnection(); return { - message: 'Connection_success' as const, + message: 'Crowd_Connection_successful' as const, params: [], }; } catch (err) { diff --git a/apps/meteor/app/custom-oauth/client/CustomOAuth.ts b/apps/meteor/app/custom-oauth/client/CustomOAuth.ts new file mode 100644 index 000000000000..1d57d1969d93 --- /dev/null +++ b/apps/meteor/app/custom-oauth/client/CustomOAuth.ts @@ -0,0 +1,122 @@ +import type { OAuthConfiguration, OauthConfig } from '@rocket.chat/core-typings'; +import { Random } from '@rocket.chat/random'; +import { capitalize } from '@rocket.chat/string-helpers'; +import { Accounts } from 'meteor/accounts-base'; +import { Match } from 'meteor/check'; +import { Meteor } from 'meteor/meteor'; +import { OAuth } from 'meteor/oauth'; + +import type { IOAuthProvider } from '../../../client/definitions/IOAuthProvider'; +import { overrideLoginMethod, type LoginCallback } from '../../../client/lib/2fa/overrideLoginMethod'; +import { loginServices } from '../../../client/lib/loginServices'; +import { createOAuthTotpLoginMethod } from '../../../client/meteorOverrides/login/oauth'; +import { isURL } from '../../../lib/utils/isURL'; + +// Request custom OAuth credentials for the user +// @param options {optional} +// @param credentialRequestCompleteCallback {Function} Callback function to call on +// completion. Takes one argument, credentialToken on success, or Error on +// error. + +export class CustomOAuth implements IOAuthProvider { + public serverURL: string; + + public authorizePath: string; + + public scope: string; + + public responseType: string; + + constructor(public readonly name: string, options: OauthConfig) { + this.name = name; + if (!Match.test(this.name, String)) { + throw new Meteor.Error('CustomOAuth: Name is required and must be String'); + } + + this.configure(options); + + Accounts.oauth.registerService(this.name); + + this.configureLogin(); + } + + configure(options: OauthConfig) { + if (!Match.test(options, Object)) { + throw new Meteor.Error('CustomOAuth: Options is required and must be Object'); + } + + if (!Match.test(options.serverURL, String)) { + throw new Meteor.Error('CustomOAuth: Options.serverURL is required and must be String'); + } + + if (!Match.test(options.authorizePath, String)) { + options.authorizePath = '/oauth/authorize'; + } + + if (!Match.test(options.scope, String)) { + options.scope = 'openid'; + } + + this.serverURL = options.serverURL; + this.authorizePath = options.authorizePath; + this.scope = options.scope; + this.responseType = options.responseType || 'code'; + + if (!isURL(this.authorizePath)) { + this.authorizePath = this.serverURL + this.authorizePath; + } + } + + configureLogin() { + const loginWithService = `loginWith${capitalize(String(this.name || ''))}` as const; + + const loginWithOAuthTokenAndTOTP = createOAuthTotpLoginMethod(this); + + const loginWithOAuthToken = async (options?: Meteor.LoginWithExternalServiceOptions, callback?: LoginCallback) => { + const credentialRequestCompleteCallback = Accounts.oauth.credentialRequestCompleteHandler(callback); + await this.requestCredential(options, credentialRequestCompleteCallback); + }; + + (Meteor as any)[loginWithService] = (options: Meteor.LoginWithExternalServiceOptions, callback: LoginCallback) => { + overrideLoginMethod(loginWithOAuthToken, [options], callback, loginWithOAuthTokenAndTOTP); + }; + } + + async requestCredential( + options: Meteor.LoginWithExternalServiceOptions = {}, + credentialRequestCompleteCallback: (credentialTokenOrError?: string | Error) => void, + ) { + const config = await loginServices.loadLoginService(this.name); + if (!config) { + if (credentialRequestCompleteCallback) { + credentialRequestCompleteCallback(new Accounts.ConfigError()); + } + return; + } + + const credentialToken = Random.secret(); + const loginStyle = OAuth._loginStyle(this.name, config); + + const separator = this.authorizePath.indexOf('?') !== -1 ? '&' : '?'; + + const loginUrl = + `${this.authorizePath}${separator}client_id=${config.clientId}&redirect_uri=${encodeURIComponent( + OAuth._redirectUri(this.name, config), + )}&response_type=${encodeURIComponent(this.responseType)}` + + `&state=${encodeURIComponent(OAuth._stateParam(loginStyle, credentialToken, options.redirectUrl))}&scope=${encodeURIComponent( + this.scope, + )}`; + + OAuth.launchLogin({ + loginService: this.name, + loginStyle, + loginUrl, + credentialRequestCompleteCallback, + credentialToken, + popupOptions: { + width: 900, + height: 450, + }, + }); + } +} diff --git a/apps/meteor/app/custom-oauth/client/custom_oauth_client.js b/apps/meteor/app/custom-oauth/client/custom_oauth_client.js deleted file mode 100644 index a11277758438..000000000000 --- a/apps/meteor/app/custom-oauth/client/custom_oauth_client.js +++ /dev/null @@ -1,114 +0,0 @@ -import { Random } from '@rocket.chat/random'; -import { capitalize } from '@rocket.chat/string-helpers'; -import { Accounts } from 'meteor/accounts-base'; -import { Match } from 'meteor/check'; -import { Meteor } from 'meteor/meteor'; -import { OAuth } from 'meteor/oauth'; -import { ServiceConfiguration } from 'meteor/service-configuration'; - -import './swapSessionStorage'; -import { isURL } from '../../../lib/utils/isURL'; - -// Request custom OAuth credentials for the user -// @param options {optional} -// @param credentialRequestCompleteCallback {Function} Callback function to call on -// completion. Takes one argument, credentialToken on success, or Error on -// error. - -export class CustomOAuth { - constructor(name, options) { - this.name = name; - if (!Match.test(this.name, String)) { - throw new Meteor.Error('CustomOAuth: Name is required and must be String'); - } - - this.configure(options); - - Accounts.oauth.registerService(this.name); - - this.configureLogin(); - } - - configure(options) { - if (!Match.test(options, Object)) { - throw new Meteor.Error('CustomOAuth: Options is required and must be Object'); - } - - if (!Match.test(options.serverURL, String)) { - throw new Meteor.Error('CustomOAuth: Options.serverURL is required and must be String'); - } - - if (!Match.test(options.authorizePath, String)) { - options.authorizePath = '/oauth/authorize'; - } - - if (!Match.test(options.scope, String)) { - options.scope = 'openid'; - } - - this.serverURL = options.serverURL; - this.authorizePath = options.authorizePath; - this.scope = options.scope; - this.responseType = options.responseType || 'code'; - - if (!isURL(this.authorizePath)) { - this.authorizePath = this.serverURL + this.authorizePath; - } - } - - configureLogin() { - const loginWithService = `loginWith${capitalize(String(this.name || ''))}`; - - Meteor[loginWithService] = async (options, callback) => { - // support a callback without options - if (!callback && typeof options === 'function') { - callback = options; - options = null; - } - - const credentialRequestCompleteCallback = Accounts.oauth.credentialRequestCompleteHandler(callback); - await this.requestCredential(options, credentialRequestCompleteCallback); - }; - } - - async requestCredential(options, credentialRequestCompleteCallback) { - // support both (options, callback) and (callback). - if (!credentialRequestCompleteCallback && typeof options === 'function') { - credentialRequestCompleteCallback = options; - options = {}; - } - - const config = await ServiceConfiguration.configurations.findOneAsync({ service: this.name }); - if (!config) { - if (credentialRequestCompleteCallback) { - credentialRequestCompleteCallback(new ServiceConfiguration.ConfigError()); - } - return; - } - - const credentialToken = Random.secret(); - const loginStyle = OAuth._loginStyle(this.name, config, options); - - const separator = this.authorizePath.indexOf('?') !== -1 ? '&' : '?'; - - const loginUrl = - `${this.authorizePath}${separator}client_id=${config.clientId}&redirect_uri=${encodeURIComponent( - OAuth._redirectUri(this.name, config), - )}&response_type=${encodeURIComponent(this.responseType)}` + - `&state=${encodeURIComponent(OAuth._stateParam(loginStyle, credentialToken, options.redirectUrl))}&scope=${encodeURIComponent( - this.scope, - )}`; - - OAuth.launchLogin({ - loginService: this.name, - loginStyle, - loginUrl, - credentialRequestCompleteCallback, - credentialToken, - popupOptions: { - width: 900, - height: 450, - }, - }); - } -} diff --git a/apps/meteor/app/custom-oauth/client/swapSessionStorage.js b/apps/meteor/app/custom-oauth/client/swapSessionStorage.js deleted file mode 100644 index 83d93310975e..000000000000 --- a/apps/meteor/app/custom-oauth/client/swapSessionStorage.js +++ /dev/null @@ -1,44 +0,0 @@ -import { Meteor } from 'meteor/meteor'; -import { OAuth } from 'meteor/oauth'; -import { Reload } from 'meteor/reload'; - -// TODO: This is a nasty workaround and should be removed as soon as possible -// Firefox is losing the sessionStorage data (v >= 79.0) after the redirect - -if (navigator.userAgent.indexOf('Firefox') !== -1) { - const KEY_NAME = 'Swapped_Storage_Workaround'; - - OAuth.saveDataForRedirect = (loginService, credentialToken) => { - Meteor._localStorage.setItem(KEY_NAME, JSON.stringify({ loginService, credentialToken })); - Reload._migrate(null, { immediateMigration: true }); - }; - - OAuth.getDataAfterRedirect = () => { - let migrationData = Meteor._localStorage.getItem(KEY_NAME); - Meteor._localStorage.removeItem(KEY_NAME); - try { - migrationData = JSON.parse(migrationData); - } catch (error) { - migrationData = null; - } - - if (!(migrationData && migrationData.credentialToken)) { - return null; - } - - const { credentialToken } = migrationData; - const key = OAuth._storageTokenPrefix + credentialToken; - let credentialSecret; - try { - credentialSecret = sessionStorage.getItem(key); - sessionStorage.removeItem(key); - } catch (e) { - Meteor._debug('error retrieving credentialSecret', e); - } - return { - loginService: migrationData.loginService, - credentialToken, - credentialSecret, - }; - }; -} diff --git a/apps/meteor/app/custom-oauth/server/custom_oauth_server.js b/apps/meteor/app/custom-oauth/server/custom_oauth_server.js index bb939febaef8..6b225069734d 100644 --- a/apps/meteor/app/custom-oauth/server/custom_oauth_server.js +++ b/apps/meteor/app/custom-oauth/server/custom_oauth_server.js @@ -106,7 +106,7 @@ export class CustomOAuth { async getAccessToken(query) { const config = await ServiceConfiguration.configurations.findOneAsync({ service: this.name }); if (!config) { - throw new ServiceConfiguration.ConfigError(); + throw new Accounts.ConfigError(); } let response = undefined; diff --git a/apps/meteor/app/custom-sounds/client/index.ts b/apps/meteor/app/custom-sounds/client/index.ts index d1154824c78c..95992988ccfb 100644 --- a/apps/meteor/app/custom-sounds/client/index.ts +++ b/apps/meteor/app/custom-sounds/client/index.ts @@ -1,21 +1 @@ -import { Meteor } from 'meteor/meteor'; - -import { Notifications } from '../../notifications/client'; -import { CachedCollectionManager } from '../../ui-cached-collection/client'; -import { CustomSounds } from './lib/CustomSounds'; - -Meteor.startup(() => { - CachedCollectionManager.onLogin(() => { - Notifications.onAll('public-info', ([key, data]) => { - switch (key) { - case 'updateCustomSound': - CustomSounds.update(data[0].soundData); - break; - case 'deleteCustomSound': - CustomSounds.remove(data[0].soundData); - break; - } - }); - }); -}); export { CustomSounds } from './lib/CustomSounds'; diff --git a/apps/meteor/app/custom-sounds/client/lib/CustomSounds.ts b/apps/meteor/app/custom-sounds/client/lib/CustomSounds.ts index f881c15f9886..f925caf7f809 100644 --- a/apps/meteor/app/custom-sounds/client/lib/CustomSounds.ts +++ b/apps/meteor/app/custom-sounds/client/lib/CustomSounds.ts @@ -1,8 +1,6 @@ import type { ICustomSound } from '@rocket.chat/core-typings'; -import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; -import { CachedCollectionManager } from '../../../ui-cached-collection/client'; import { getURL } from '../../../utils/client'; import { sdk } from '../../../utils/client/lib/SDKClient'; @@ -28,8 +26,11 @@ const defaultSounds = [ class CustomSoundsClass { list: ReactiveVar>; + initialFetchDone: boolean; + constructor() { this.list = new ReactiveVar({}); + this.initialFetchDone = false; defaultSounds.forEach((sound) => this.add(sound)); } @@ -130,15 +131,17 @@ class CustomSoundsClass { return audio && audio.duration > 0 && !audio.paused; }; -} - -export const CustomSounds = new CustomSoundsClass(); -Meteor.startup(() => - CachedCollectionManager.onLogin(async () => { + fetchCustomSoundList = async () => { + if (this.initialFetchDone) { + return; + } const result = await sdk.call('listCustomSounds'); for (const sound of result) { - CustomSounds.add(sound); + this.add(sound); } - }), -); + this.initialFetchDone = true; + }; +} + +export const CustomSounds = new CustomSoundsClass(); diff --git a/apps/meteor/app/discussion/server/hooks/propagateDiscussionMetadata.ts b/apps/meteor/app/discussion/server/hooks/propagateDiscussionMetadata.ts index b6054b6dcccf..0f42f495e962 100644 --- a/apps/meteor/app/discussion/server/hooks/propagateDiscussionMetadata.ts +++ b/apps/meteor/app/discussion/server/hooks/propagateDiscussionMetadata.ts @@ -1,8 +1,21 @@ +import type { IRoom } from '@rocket.chat/core-typings'; import { Messages, Rooms } from '@rocket.chat/models'; import { callbacks } from '../../../../lib/callbacks'; +import { broadcastMessageFromData } from '../../../../server/modules/watchers/lib/messages'; import { deleteRoom } from '../../../lib/server/functions/deleteRoom'; +const updateAndNotifyParentRoomWithParentMessage = async (room: IRoom): Promise => { + const { value: parentMessage } = await Messages.refreshDiscussionMetadata(room); + if (!parentMessage) { + return; + } + void broadcastMessageFromData({ + id: parentMessage._id, + data: parentMessage, + }); +}; + /** * We need to propagate the writing of new message in a discussion to the linking * system message @@ -25,7 +38,7 @@ callbacks.add( return message; } - await Messages.refreshDiscussionMetadata(room); + await updateAndNotifyParentRoomWithParentMessage(room); return message; }, @@ -45,7 +58,7 @@ callbacks.add( }); if (room) { - await Messages.refreshDiscussionMetadata(room); + await updateAndNotifyParentRoomWithParentMessage(room); } } if (message.drid) { diff --git a/apps/meteor/app/discussion/server/methods/createDiscussion.ts b/apps/meteor/app/discussion/server/methods/createDiscussion.ts index c3869f8ff963..18b42ba1a31f 100644 --- a/apps/meteor/app/discussion/server/methods/createDiscussion.ts +++ b/apps/meteor/app/discussion/server/methods/createDiscussion.ts @@ -62,6 +62,7 @@ type CreateDiscussionProperties = { users: Array>; user: IUser; encrypted?: boolean; + topic?: string; }; const create = async ({ @@ -72,6 +73,7 @@ const create = async ({ users, user, encrypted, + topic, }: CreateDiscussionProperties): Promise => { // if you set both, prid and pmid, and the rooms dont match... should throw an error) let message: null | IMessage = null; @@ -145,7 +147,7 @@ const create = async ({ const type = await roomCoordinator.getRoomDirectives(parentRoom.t).getDiscussionType(parentRoom); const description = parentRoom.encrypted ? '' : message?.msg; - const topic = parentRoom.name; + const discussionTopic = topic || parentRoom.name; if (!type) { throw new Meteor.Error('error-invalid-type', 'Cannot define discussion room type', { @@ -163,13 +165,11 @@ const create = async ({ { fname: discussionName, description, // TODO discussions remove - topic, // TODO discussions remove + topic: discussionTopic, prid, encrypted, }, { - // overrides name validation to allow anything, because discussion's name is randomly generated - nameValidationRegex: '.*', creator: user._id, }, ); @@ -186,13 +186,13 @@ const create = async ({ discussionMsg = await createDiscussionMessage(prid, user, discussion._id, discussionName); } - if (discussionMsg) { - callbacks.runAsync('afterSaveMessage', discussionMsg, parentRoom); - } - if (reply) { await sendMessage(user, { msg: reply }, discussion); } + + if (discussionMsg) { + callbacks.runAsync('afterSaveMessage', discussionMsg, parentRoom); + } return discussion; }; @@ -205,7 +205,7 @@ declare module '@rocket.chat/ui-contexts' { export const createDiscussion = async ( userId: string, - { prid, pmid, t_name: discussionName, reply, users, encrypted }: Omit, + { prid, pmid, t_name: discussionName, reply, users, encrypted, topic }: Omit, ): Promise< IRoom & { rid: string; @@ -231,7 +231,7 @@ export const createDiscussion = async ( }); } - return create({ prid, pmid, t_name: discussionName, reply, users, user, encrypted }); + return create({ prid, pmid, t_name: discussionName, reply, users, user, encrypted, topic }); }; Meteor.methods({ diff --git a/apps/meteor/app/dolphin/client/lib.ts b/apps/meteor/app/dolphin/client/lib.ts index c04ee1b7859d..31a767dd5556 100644 --- a/apps/meteor/app/dolphin/client/lib.ts +++ b/apps/meteor/app/dolphin/client/lib.ts @@ -1,7 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; -import { CustomOAuth } from '../../custom-oauth/client/custom_oauth_client'; +import { CustomOAuth } from '../../custom-oauth/client/CustomOAuth'; import { settings } from '../../settings/client'; const config = { diff --git a/apps/meteor/app/drupal/client/lib.ts b/apps/meteor/app/drupal/client/lib.ts index 9edbb560a450..f477a326d706 100644 --- a/apps/meteor/app/drupal/client/lib.ts +++ b/apps/meteor/app/drupal/client/lib.ts @@ -2,7 +2,7 @@ import type { OauthConfig } from '@rocket.chat/core-typings'; import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; -import { CustomOAuth } from '../../custom-oauth/client/custom_oauth_client'; +import { CustomOAuth } from '../../custom-oauth/client/CustomOAuth'; import { settings } from '../../settings/client'; // Drupal Server CallBack URL needs to be http(s)://{rocketchat.server}[:port]/_oauth/drupal diff --git a/apps/meteor/app/e2e/client/rocketchat.e2e.room.js b/apps/meteor/app/e2e/client/rocketchat.e2e.room.js index f64b243e0d88..bd0863d691a9 100644 --- a/apps/meteor/app/e2e/client/rocketchat.e2e.room.js +++ b/apps/meteor/app/e2e/client/rocketchat.e2e.room.js @@ -7,7 +7,6 @@ import { RoomManager } from '../../../client/lib/RoomManager'; import { roomCoordinator } from '../../../client/lib/rooms/roomCoordinator'; import { RoomSettingsEnum } from '../../../definition/IRoomTypeConfig'; import { ChatRoom, Subscriptions, Messages } from '../../models/client'; -import { Notifications } from '../../notifications/client'; import { sdk } from '../../utils/client/lib/SDKClient'; import { E2ERoomState } from './E2ERoomState'; import { @@ -240,7 +239,7 @@ export class E2ERoom extends Emitter { this.setState(E2ERoomState.WAITING_KEYS); this.log('Requesting room key'); - Notifications.notifyUsersOfRoom(this.roomId, 'e2ekeyRequest', this.roomId, room.e2eKeyId); + sdk.publish('notify-room-users', [`${this.roomId}/e2ekeyRequest`, this.roomId, room.e2eKeyId]); } catch (error) { // this.error = error; this.setState(E2ERoomState.ERROR); diff --git a/apps/meteor/app/emoji-custom/client/index.ts b/apps/meteor/app/emoji-custom/client/index.ts index d8a1b75e275d..780a12a3898f 100644 --- a/apps/meteor/app/emoji-custom/client/index.ts +++ b/apps/meteor/app/emoji-custom/client/index.ts @@ -1,3 +1 @@ import './lib/emojiCustom'; -import './notifications/deleteEmojiCustom'; -import './notifications/updateEmojiCustom'; diff --git a/apps/meteor/app/emoji-custom/client/lib/emojiCustom.js b/apps/meteor/app/emoji-custom/client/lib/emojiCustom.js index 1340ead95789..64f1df9bd932 100644 --- a/apps/meteor/app/emoji-custom/client/lib/emojiCustom.js +++ b/apps/meteor/app/emoji-custom/client/lib/emojiCustom.js @@ -1,11 +1,9 @@ import { escapeRegExp } from '@rocket.chat/string-helpers'; -import $ from 'jquery'; import { Meteor } from 'meteor/meteor'; import { Session } from 'meteor/session'; import { emoji, updateRecent } from '../../../emoji/client'; import { CachedCollectionManager } from '../../../ui-cached-collection/client'; -import { LegacyRoomManager } from '../../../ui-utils/client'; import { getURL } from '../../../utils/client'; import { sdk } from '../../../utils/client/lib/SDKClient'; import { isSetNotNull } from './function-isSet'; @@ -45,9 +43,6 @@ export const deleteEmojiCustom = function (emojiData) { }; export const updateEmojiCustom = function (emojiData) { - let key = `emoji_random_${emojiData.name}`; - Session.set(key, Math.round(Math.random() * 1000)); - const previousExists = isSetNotNull(() => emojiData.previousName); const currentAliases = isSetNotNull(() => emojiData.aliases); @@ -88,47 +83,6 @@ export const updateEmojiCustom = function (emojiData) { } } - const url = getEmojiUrlFromName(emojiData.name, emojiData.extension); - - // update in admin interface - if (previousExists && emojiData.name !== emojiData.previousName) { - $(document) - .find(`.emojiAdminPreview-image[data-emoji='${emojiData.previousName}']`) - .css('background-image', `url('${url})'`) - .attr('data-emoji', `${emojiData.name}`); - } else { - $(document).find(`.emojiAdminPreview-image[data-emoji='${emojiData.name}']`).css('background-image', `url('${url}')`); - } - - // update in picker - if (previousExists && emojiData.name !== emojiData.previousName) { - $(document) - .find(`li[data-emoji='${emojiData.previousName}'] span`) - .css('background-image', `url('${url}')`) - .attr('data-emoji', `${emojiData.name}`); - $(document) - .find(`li[data-emoji='${emojiData.previousName}']`) - .attr('data-emoji', `${emojiData.name}`) - .attr('class', `emoji-${emojiData.name}`); - } else { - $(document).find(`li[data-emoji='${emojiData.name}'] span`).css('background-image', `url('${url}')`); - } - - // update in picker and opened rooms - for (key in LegacyRoomManager.openedRooms) { - if (LegacyRoomManager.openedRooms.hasOwnProperty(key)) { - const room = LegacyRoomManager.openedRooms[key]; - if (previousExists && emojiData.name !== emojiData.previousName) { - $(room.dom) - .find(`span[data-emoji='${emojiData.previousName}']`) - .css('background-image', `url('${url}')`) - .attr('data-emoji', `${emojiData.name}`); - } else { - $(room.dom).find(`span[data-emoji='${emojiData.name}']`).css('background-image', `url('${url}')`); - } - } - } - updateRecent('rocket'); }; diff --git a/apps/meteor/app/emoji-custom/client/notifications/deleteEmojiCustom.ts b/apps/meteor/app/emoji-custom/client/notifications/deleteEmojiCustom.ts deleted file mode 100644 index 0ee00976956e..000000000000 --- a/apps/meteor/app/emoji-custom/client/notifications/deleteEmojiCustom.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { Meteor } from 'meteor/meteor'; - -import { Notifications } from '../../../notifications/client'; -import { deleteEmojiCustom } from '../lib/emojiCustom'; - -Meteor.startup(() => Notifications.onLogged('deleteEmojiCustom', (data) => deleteEmojiCustom(data.emojiData))); diff --git a/apps/meteor/app/emoji-custom/client/notifications/updateEmojiCustom.ts b/apps/meteor/app/emoji-custom/client/notifications/updateEmojiCustom.ts deleted file mode 100644 index 326edef0fa6c..000000000000 --- a/apps/meteor/app/emoji-custom/client/notifications/updateEmojiCustom.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { Meteor } from 'meteor/meteor'; - -import { Notifications } from '../../../notifications/client'; -import { updateEmojiCustom } from '../lib/emojiCustom'; - -Meteor.startup(() => Notifications.onLogged('updateEmojiCustom', (data) => updateEmojiCustom(data.emojiData))); diff --git a/apps/meteor/app/federation/server/endpoints/dispatch.js b/apps/meteor/app/federation/server/endpoints/dispatch.js index 59ffcb0f342f..4b3e148bbdad 100644 --- a/apps/meteor/app/federation/server/endpoints/dispatch.js +++ b/apps/meteor/app/federation/server/endpoints/dispatch.js @@ -3,6 +3,7 @@ import { eventTypes } from '@rocket.chat/core-typings'; import { FederationServers, FederationRoomEvents, Rooms, Messages, Subscriptions, Users, ReadReceipts } from '@rocket.chat/models'; import EJSON from 'ejson'; +import { broadcastMessageFromData } from '../../../../server/modules/watchers/lib/messages'; import { API } from '../../../api/server'; import { FileUpload } from '../../../file-upload/server'; import { deleteRoom } from '../../../lib/server/functions/deleteRoom'; @@ -214,11 +215,13 @@ const eventHandlers = { // Check if message exists const persistedMessage = await Messages.findOne({ _id: message._id }); + let messageForNotification; if (persistedMessage) { // Update the federation if (!persistedMessage.federation) { await Messages.updateOne({ _id: persistedMessage._id }, { $set: { federation: message.federation } }); + messageForNotification = { ...persistedMessage, federation: message.federation }; } } else { // Load the room @@ -275,10 +278,17 @@ const eventHandlers = { // Notify users await notifyUsersOnMessage(denormalizedMessage, room); sendAllNotifications(denormalizedMessage, room); + messageForNotification = denormalizedMessage; } catch (err) { serverLogger.debug(`Error on creating message: ${message._id}`); } } + if (messageForNotification) { + void broadcastMessageFromData({ + id: messageForNotification._id, + data: messageForNotification, + }); + } } return eventResult; @@ -305,6 +315,14 @@ const eventHandlers = { } else { // Update the message await Messages.updateOne({ _id: persistedMessage._id }, { $set: { msg: message.msg, federation: message.federation } }); + void broadcastMessageFromData({ + id: persistedMessage._id, + data: { + ...persistedMessage, + msg: message.msg, + federation: message.federation, + }, + }); } } @@ -367,6 +385,16 @@ const eventHandlers = { // Update the property await Messages.updateOne({ _id: messageId }, { $set: { [`reactions.${reaction}`]: reactionObj } }); + void broadcastMessageFromData({ + id: persistedMessage._id, + data: { + ...persistedMessage, + reactions: { + ...persistedMessage.reactions, + [reaction]: reactionObj, + }, + }, + }); } return eventResult; @@ -415,6 +443,16 @@ const eventHandlers = { // Otherwise, update the property await Messages.updateOne({ _id: messageId }, { $set: { [`reactions.${reaction}`]: reactionObj } }); } + void broadcastMessageFromData({ + id: persistedMessage._id, + data: { + ...persistedMessage, + reactions: { + ...persistedMessage.reactions, + [reaction]: reactionObj, + }, + }, + }); } return eventResult; diff --git a/apps/meteor/app/federation/server/lib/getFederationDiscoveryMethod.js b/apps/meteor/app/federation/server/lib/getFederationDiscoveryMethod.js deleted file mode 100644 index 2da490942fdc..000000000000 --- a/apps/meteor/app/federation/server/lib/getFederationDiscoveryMethod.js +++ /dev/null @@ -1,3 +0,0 @@ -import { settings } from '../../../settings/server'; - -export const getFederationDiscoveryMethod = () => settings.get('FEDERATION_Discovery_Method'); diff --git a/apps/meteor/app/federation/server/lib/getFederationDiscoveryMethod.ts b/apps/meteor/app/federation/server/lib/getFederationDiscoveryMethod.ts new file mode 100644 index 000000000000..b8ea8c4f6ce6 --- /dev/null +++ b/apps/meteor/app/federation/server/lib/getFederationDiscoveryMethod.ts @@ -0,0 +1,3 @@ +import { settings } from '../../../settings/server'; + +export const getFederationDiscoveryMethod = () => settings.get('FEDERATION_Discovery_Method'); diff --git a/apps/meteor/app/federation/server/lib/getFederationDomain.js b/apps/meteor/app/federation/server/lib/getFederationDomain.js deleted file mode 100644 index c5e67629db75..000000000000 --- a/apps/meteor/app/federation/server/lib/getFederationDomain.js +++ /dev/null @@ -1,3 +0,0 @@ -import { settings } from '../../../settings/server'; - -export const getFederationDomain = () => settings.get('FEDERATION_Domain').replace('@', ''); diff --git a/apps/meteor/app/federation/server/lib/getFederationDomain.ts b/apps/meteor/app/federation/server/lib/getFederationDomain.ts new file mode 100644 index 000000000000..80f683743f2d --- /dev/null +++ b/apps/meteor/app/federation/server/lib/getFederationDomain.ts @@ -0,0 +1,3 @@ +import { settings } from '../../../settings/server'; + +export const getFederationDomain = () => settings.get('FEDERATION_Domain').replace('@', ''); diff --git a/apps/meteor/app/federation/server/lib/isFederationEnabled.js b/apps/meteor/app/federation/server/lib/isFederationEnabled.js deleted file mode 100644 index 9e46d3004ace..000000000000 --- a/apps/meteor/app/federation/server/lib/isFederationEnabled.js +++ /dev/null @@ -1,3 +0,0 @@ -import { settings } from '../../../settings/server'; - -export const isFederationEnabled = () => settings.get('FEDERATION_Enabled'); diff --git a/apps/meteor/app/federation/server/lib/isFederationEnabled.ts b/apps/meteor/app/federation/server/lib/isFederationEnabled.ts new file mode 100644 index 000000000000..e3edb818e602 --- /dev/null +++ b/apps/meteor/app/federation/server/lib/isFederationEnabled.ts @@ -0,0 +1,3 @@ +import { settings } from '../../../settings/server'; + +export const isFederationEnabled = () => settings.get('FEDERATION_Enabled'); diff --git a/apps/meteor/app/federation/server/lib/logger.js b/apps/meteor/app/federation/server/lib/logger.ts similarity index 100% rename from apps/meteor/app/federation/server/lib/logger.js rename to apps/meteor/app/federation/server/lib/logger.ts diff --git a/apps/meteor/app/file-upload/server/lib/FileUpload.ts b/apps/meteor/app/file-upload/server/lib/FileUpload.ts index e512e5d09bfe..4458f9d61881 100644 --- a/apps/meteor/app/file-upload/server/lib/FileUpload.ts +++ b/apps/meteor/app/file-upload/server/lib/FileUpload.ts @@ -8,6 +8,7 @@ import stream from 'stream'; import URL from 'url'; import { hashLoginToken } from '@rocket.chat/account-utils'; +import { Apps, AppEvents } from '@rocket.chat/apps'; import { AppsEngineException } from '@rocket.chat/apps-engine/definition/exceptions'; import type { IUpload } from '@rocket.chat/core-typings'; import { Users, Avatars, UserDataFiles, Uploads, Settings, Subscriptions, Messages, Rooms } from '@rocket.chat/models'; @@ -21,7 +22,6 @@ import sharp from 'sharp'; import type { WritableStreamBuffer } from 'stream-buffers'; import streamBuffers from 'stream-buffers'; -import { AppEvents, Apps } from '../../../../ee/server/apps'; import { i18n } from '../../../../server/lib/i18n'; import { SystemLogger } from '../../../../server/lib/logger/system'; import { roomCoordinator } from '../../../../server/lib/rooms/roomCoordinator'; @@ -177,7 +177,7 @@ export const FileUpload = { // App IPreFileUpload event hook try { - await Apps.triggerEvent(AppEvents.IPreFileUpload, { file, content: content || Buffer.from([]) }); + await Apps.self?.triggerEvent(AppEvents.IPreFileUpload, { file, content: content || Buffer.from([]) }); } catch (error: any) { if (error.name === AppsEngineException.name) { throw new Meteor.Error('error-app-prevented', error.message); @@ -308,21 +308,36 @@ export const FileUpload = { const store = FileUpload.getStore('Uploads'); const image = await store._store.getReadStream(file._id, file); - const transformer = sharp().resize({ width, height, fit: 'inside' }); + let transformer = sharp().resize({ width, height, fit: 'inside' }); - const result = transformer.toBuffer({ resolveWithObject: true }).then(({ data, info: { width, height } }) => ({ data, width, height })); + if (file.type === 'image/svg+xml') { + transformer = transformer.png(); + } + const result = transformer.toBuffer({ resolveWithObject: true }).then(({ data, info: { width, height, format } }) => ({ + data, + width, + height, + thumbFileType: (mime.lookup(format) as string) || '', + thumbFileName: file?.name as string, + originalFileId: file?._id as string, + })); image.pipe(transformer); return result; }, - async uploadImageThumbnail(file: IUpload, buffer: Buffer, rid: string, userId: string) { + async uploadImageThumbnail( + { thumbFileName, thumbFileType, originalFileId }: { thumbFileName: string; thumbFileType: string; originalFileId: string }, + buffer: Buffer, + rid: string, + userId: string, + ) { const store = FileUpload.getStore('Uploads'); const details = { - name: `thumb-${file.name}`, + name: `thumb-${thumbFileName}`, size: buffer.length, - type: file.type, - originalFileId: file._id, + type: thumbFileType, + originalFileId, typeGroup: 'thumb', uploadedAt: new Date(), _updatedAt: new Date(), @@ -572,15 +587,7 @@ export const FileUpload = { } // eslint-disable-next-line prettier/prettier - const headersToProxy = [ - 'age', - 'cache-control', - 'content-length', - 'content-type', - 'date', - 'expired', - 'last-modified', - ]; + const headersToProxy = ['age', 'cache-control', 'content-length', 'content-type', 'date', 'expired', 'last-modified']; headersToProxy.forEach((header) => { fileRes.headers[header] && res.setHeader(header, String(fileRes.headers[header])); diff --git a/apps/meteor/app/file-upload/server/methods/sendFileMessage.ts b/apps/meteor/app/file-upload/server/methods/sendFileMessage.ts index d922b5adab78..3267e557854f 100644 --- a/apps/meteor/app/file-upload/server/methods/sendFileMessage.ts +++ b/apps/meteor/app/file-upload/server/methods/sendFileMessage.ts @@ -1,4 +1,4 @@ -import type { MessageAttachment, FileAttachmentProps, IUser, IUpload, AtLeast } from '@rocket.chat/core-typings'; +import type { MessageAttachment, FileAttachmentProps, IUser, IUpload, AtLeast, FilesAndAttachments } from '@rocket.chat/core-typings'; import { Rooms, Uploads, Users } from '@rocket.chat/models'; import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Match, check } from 'meteor/check'; @@ -25,7 +25,7 @@ export const parseFileIntoMessageAttachments = async ( file: Partial, roomId: string, user: IUser, -): Promise> => { +): Promise => { validateFileRequiredFields(file); await Uploads.updateFileComplete(file._id, user._id, omit(file, '_id')); @@ -37,8 +37,10 @@ export const parseFileIntoMessageAttachments = async ( const files = [ { _id: file._id, - name: file.name, - type: file.type, + name: file.name || '', + type: file.type || 'file', + size: file.size || 0, + format: file.identify?.format || '', }, ]; @@ -62,8 +64,17 @@ export const parseFileIntoMessageAttachments = async ( attachment.image_preview = await FileUpload.resizeImagePreview(file); const thumbResult = await FileUpload.createImageThumbnail(file); if (thumbResult) { - const { data: thumbBuffer, width, height } = thumbResult; - const thumbnail = await FileUpload.uploadImageThumbnail(file, thumbBuffer, roomId, user._id); + const { data: thumbBuffer, width, height, thumbFileType, thumbFileName, originalFileId } = thumbResult; + const thumbnail = await FileUpload.uploadImageThumbnail( + { + thumbFileName, + thumbFileType, + originalFileId, + }, + thumbBuffer, + roomId, + user._id, + ); const thumbUrl = FileUpload.getPath(`${thumbnail._id}/${encodeURI(file.name || '')}`); attachment.image_url = thumbUrl; attachment.image_type = thumbnail.type; @@ -73,8 +84,10 @@ export const parseFileIntoMessageAttachments = async ( }; files.push({ _id: thumbnail._id, - name: file.name, - type: thumbnail.type, + name: thumbnail.name || '', + type: thumbnail.type || 'file', + size: thumbnail.size || 0, + format: thumbnail.identify?.format || '', }); } } catch (e) { diff --git a/apps/meteor/app/file-upload/ufs/AmazonS3/server.ts b/apps/meteor/app/file-upload/ufs/AmazonS3/server.ts index b9f0807b6112..d6b69faf75fa 100644 --- a/apps/meteor/app/file-upload/ufs/AmazonS3/server.ts +++ b/apps/meteor/app/file-upload/ufs/AmazonS3/server.ts @@ -80,7 +80,7 @@ class AmazonS3Store extends UploadFS.Store { ResponseContentDisposition: `${forceDownload ? 'attachment' : 'inline'}; filename="${encodeURI(file.name || '')}"`, }; - return s3.getSignedUrl('getObject', params); + return s3.getSignedUrlPromise('getObject', params); }; /** diff --git a/apps/meteor/app/github-enterprise/client/lib.ts b/apps/meteor/app/github-enterprise/client/lib.ts index ec03985df0cf..97b9e6867799 100644 --- a/apps/meteor/app/github-enterprise/client/lib.ts +++ b/apps/meteor/app/github-enterprise/client/lib.ts @@ -2,7 +2,7 @@ import type { OauthConfig } from '@rocket.chat/core-typings'; import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; -import { CustomOAuth } from '../../custom-oauth/client/custom_oauth_client'; +import { CustomOAuth } from '../../custom-oauth/client/CustomOAuth'; import { settings } from '../../settings/client'; // GitHub Enterprise Server CallBack URL needs to be http(s)://{rocketchat.server}[:port]/_oauth/github_enterprise diff --git a/apps/meteor/app/gitlab/client/lib.ts b/apps/meteor/app/gitlab/client/lib.ts index a1b2ded0cc1a..518478f91227 100644 --- a/apps/meteor/app/gitlab/client/lib.ts +++ b/apps/meteor/app/gitlab/client/lib.ts @@ -2,7 +2,7 @@ import type { OauthConfig } from '@rocket.chat/core-typings'; import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; -import { CustomOAuth } from '../../custom-oauth/client/custom_oauth_client'; +import { CustomOAuth } from '../../custom-oauth/client/CustomOAuth'; import { settings } from '../../settings/client'; const config: OauthConfig = { diff --git a/apps/meteor/app/importer-csv/client/adder.js b/apps/meteor/app/importer-csv/client/adder.js deleted file mode 100644 index 929a84640be9..000000000000 --- a/apps/meteor/app/importer-csv/client/adder.js +++ /dev/null @@ -1,4 +0,0 @@ -import { Importers } from '../../importer/client'; -import { CsvImporterInfo } from '../lib/info'; - -Importers.add(new CsvImporterInfo()); diff --git a/apps/meteor/app/importer-csv/client/index.ts b/apps/meteor/app/importer-csv/client/index.ts deleted file mode 100644 index 44a1b3bab84c..000000000000 --- a/apps/meteor/app/importer-csv/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -import './adder'; diff --git a/apps/meteor/app/importer-csv/lib/info.js b/apps/meteor/app/importer-csv/lib/info.js deleted file mode 100644 index c4fccdf74991..000000000000 --- a/apps/meteor/app/importer-csv/lib/info.js +++ /dev/null @@ -1,12 +0,0 @@ -import { ImporterInfo } from '../../importer/lib/ImporterInfo'; - -export class CsvImporterInfo extends ImporterInfo { - constructor() { - super('csv', 'CSV', 'application/zip', [ - { - text: 'Importer_CSV_Information', - href: 'https://rocket.chat/docs/administrator-guides/import/csv/', - }, - ]); - } -} diff --git a/apps/meteor/app/importer-csv/server/CsvImporter.ts b/apps/meteor/app/importer-csv/server/CsvImporter.ts new file mode 100644 index 000000000000..302aeb882ac5 --- /dev/null +++ b/apps/meteor/app/importer-csv/server/CsvImporter.ts @@ -0,0 +1,268 @@ +import type { IImport } from '@rocket.chat/core-typings'; +import { Settings, Users } from '@rocket.chat/models'; +import { Random } from '@rocket.chat/random'; +import { parse } from 'csv-parse/lib/sync'; + +import { Importer, ProgressStep, ImporterWebsocket } from '../../importer/server'; +import type { IConverterOptions } from '../../importer/server/classes/ImportDataConverter'; +import type { ImporterProgress } from '../../importer/server/classes/ImporterProgress'; +import type { ImporterInfo } from '../../importer/server/definitions/ImporterInfo'; + +export class CsvImporter extends Importer { + private csvParser: (csv: string) => string[]; + + constructor(info: ImporterInfo, importRecord: IImport, converterOptions: IConverterOptions = {}) { + super(info, importRecord, converterOptions); + + this.csvParser = parse; + } + + async prepareUsingLocalFile(fullFilePath: string): Promise { + this.logger.debug('start preparing import operation'); + await this.converter.clearImportData(); + + const zip = new this.AdmZip(fullFilePath); + const totalEntries = zip.getEntryCount(); + + ImporterWebsocket.progressUpdated({ rate: 0 }); + + let count = 0; + let oldRate = 0; + + const increaseProgressCount = () => { + try { + count++; + const rate = Math.floor((count * 1000) / totalEntries) / 10; + if (rate > oldRate) { + ImporterWebsocket.progressUpdated({ rate }); + oldRate = rate; + } + } catch (e) { + this.logger.error(e); + } + }; + + let messagesCount = 0; + let usersCount = 0; + let channelsCount = 0; + const dmRooms = new Set(); + const roomIds = new Map(); + const usedUsernames = new Set(); + const availableUsernames = new Set(); + + const getRoomId = (roomName: string) => { + const roomId = roomIds.get(roomName); + + if (roomId === undefined) { + const fallbackRoomId = Random.id(); + roomIds.set(roomName, fallbackRoomId); + return fallbackRoomId; + } + + return roomId; + }; + + for await (const entry of zip.getEntries()) { + this.logger.debug(`Entry: ${entry.entryName}`); + + // Ignore anything that has `__MACOSX` in it's name, as sadly these things seem to mess everything up + if (entry.entryName.indexOf('__MACOSX') > -1) { + this.logger.debug(`Ignoring the file: ${entry.entryName}`); + increaseProgressCount(); + continue; + } + + // Directories are ignored, since they are "virtual" in a zip file + if (entry.isDirectory) { + this.logger.debug(`Ignoring the directory entry: ${entry.entryName}`); + increaseProgressCount(); + continue; + } + + // Parse the channels + if (entry.entryName.toLowerCase() === 'channels.csv') { + await super.updateProgress(ProgressStep.PREPARING_CHANNELS); + const parsedChannels = this.csvParser(entry.getData().toString()); + channelsCount = parsedChannels.length; + + for await (const c of parsedChannels) { + const name = c[0].trim(); + const id = getRoomId(name); + const creator = c[1].trim(); + const isPrivate = c[2].trim().toLowerCase() === 'private'; + const members = c[3] + .trim() + .split(';') + .map((m) => m.trim()) + .filter((m) => m); + + await this.converter.addChannel({ + importIds: [id], + u: { + _id: creator, + }, + name, + users: members, + t: isPrivate ? 'p' : 'c', + }); + } + + await super.updateRecord({ 'count.channels': channelsCount }); + increaseProgressCount(); + continue; + } + + // Parse the users + if (entry.entryName.toLowerCase() === 'users.csv') { + await super.updateProgress(ProgressStep.PREPARING_USERS); + const parsedUsers = this.csvParser(entry.getData().toString()); + usersCount = parsedUsers.length; + + for await (const u of parsedUsers) { + const username = u[0].trim(); + availableUsernames.add(username); + + const email = u[1].trim(); + const name = u[2].trim(); + + await this.converter.addUser({ + type: 'user', + importIds: [username], + emails: [email], + username, + name, + }); + } + + await super.updateRecord({ 'count.users': usersCount }); + increaseProgressCount(); + continue; + } + + // Parse the messages + if (entry.entryName.indexOf('/') > -1) { + if (this.progress.step !== ProgressStep.PREPARING_MESSAGES) { + await super.updateProgress(ProgressStep.PREPARING_MESSAGES); + } + + const item = entry.entryName.split('/'); // random/messages.csv + const folderName = item[0]; // random + + let msgs = []; + + try { + msgs = this.csvParser(entry.getData().toString()); + } catch (e) { + this.logger.warn(`The file ${entry.entryName} contains invalid syntax`, e); + increaseProgressCount(); + continue; + } + + let data: { username: string; ts: string; text: string; otherUsername?: string; isDirect?: true }[]; + const msgGroupData = item[1].split('.')[0]; // messages + let isDirect = false; + + if (folderName.toLowerCase() === 'directmessages') { + isDirect = true; + data = msgs.map((m) => ({ + username: m[0], + ts: m[2], + text: m[3], + otherUsername: m[1], + isDirect: true, + })); + } else { + data = msgs.map((m) => ({ username: m[0], ts: m[1], text: m[2] })); + } + + messagesCount += data.length; + const channelName = `${folderName}/${msgGroupData}`; + + await super.updateRecord({ messagesstatus: channelName }); + + if (isDirect) { + for await (const msg of data) { + if (!msg.otherUsername) { + continue; + } + + const sourceId = [msg.username, msg.otherUsername].sort().join('/'); + + if (!dmRooms.has(sourceId)) { + await this.converter.addChannel({ + importIds: [sourceId], + users: [msg.username, msg.otherUsername], + t: 'd', + }); + + dmRooms.add(sourceId); + } + + const newMessage = { + rid: sourceId, + u: { + _id: msg.username, + }, + ts: new Date(parseInt(msg.ts)), + msg: msg.text, + }; + + usedUsernames.add(msg.username); + usedUsernames.add(msg.otherUsername); + await this.converter.addMessage(newMessage); + } + } else { + const rid = getRoomId(folderName); + + for await (const msg of data) { + const newMessage = { + rid, + u: { + _id: msg.username, + }, + ts: new Date(parseInt(msg.ts)), + msg: msg.text, + }; + + usedUsernames.add(msg.username); + await this.converter.addMessage(newMessage); + } + } + + await super.updateRecord({ 'count.messages': messagesCount, 'messagesstatus': null }); + } + + increaseProgressCount(); + } + + if (usersCount) { + await Settings.incrementValueById('CSV_Importer_Count', usersCount); + } + + // Check if any of the message usernames was not in the imported list of users + for await (const username of usedUsernames) { + if (availableUsernames.has(username)) { + continue; + } + + // Check if an user with that username already exists + const user = await Users.findOneByUsername(username); + if (user && !user.importIds?.includes(username)) { + // Add the username to the local user's importIds so it can be found by the import process + // This way we can support importing new messages for existing users + await Users.addImportIds(user._id, username); + } + } + + await super.addCountToTotal(messagesCount + usersCount + channelsCount); + ImporterWebsocket.progressUpdated({ rate: 100 }); + + // Ensure we have at least a single user, channel, or message + if (usersCount === 0 && channelsCount === 0 && messagesCount === 0) { + this.logger.error('No users, channels, or messages found in the import file.'); + await super.updateProgress(ProgressStep.ERROR); + } + + return super.getProgress(); + } +} diff --git a/apps/meteor/app/importer-csv/server/importer.js b/apps/meteor/app/importer-csv/server/importer.js deleted file mode 100644 index c2f20f75615d..000000000000 --- a/apps/meteor/app/importer-csv/server/importer.js +++ /dev/null @@ -1,257 +0,0 @@ -import { Settings, Users } from '@rocket.chat/models'; -import { Random } from '@rocket.chat/random'; - -import { Base, ProgressStep, ImporterWebsocket } from '../../importer/server'; - -export class CsvImporter extends Base { - constructor(info, importRecord, converterOptions = {}) { - super(info, importRecord, converterOptions); - - const { parse } = require('csv-parse/lib/sync'); - - this.csvParser = parse; - } - - async prepareUsingLocalFile(fullFilePath) { - this.logger.debug('start preparing import operation'); - await this.converter.clearImportData(); - - const zip = new this.AdmZip(fullFilePath); - const totalEntries = zip.getEntryCount(); - - ImporterWebsocket.progressUpdated({ rate: 0 }); - - let count = 0; - let oldRate = 0; - - const increaseProgressCount = () => { - try { - count++; - const rate = Math.floor((count * 1000) / totalEntries) / 10; - if (rate > oldRate) { - ImporterWebsocket.progressUpdated({ rate }); - oldRate = rate; - } - } catch (e) { - this.logger.error(e); - } - }; - - let messagesCount = 0; - let usersCount = 0; - let channelsCount = 0; - const dmRooms = new Map(); - const roomIds = new Map(); - const usedUsernames = new Set(); - const availableUsernames = new Set(); - - const getRoomId = (roomName) => { - if (!roomIds.has(roomName)) { - roomIds.set(roomName, Random.id()); - } - - return roomIds.get(roomName); - }; - - for await (const entry of zip.getEntries()) { - this.logger.debug(`Entry: ${entry.entryName}`); - - // Ignore anything that has `__MACOSX` in it's name, as sadly these things seem to mess everything up - if (entry.entryName.indexOf('__MACOSX') > -1) { - this.logger.debug(`Ignoring the file: ${entry.entryName}`); - increaseProgressCount(); - continue; - } - - // Directories are ignored, since they are "virtual" in a zip file - if (entry.isDirectory) { - this.logger.debug(`Ignoring the directory entry: ${entry.entryName}`); - increaseProgressCount(); - continue; - } - - // Parse the channels - if (entry.entryName.toLowerCase() === 'channels.csv') { - await super.updateProgress(ProgressStep.PREPARING_CHANNELS); - const parsedChannels = this.csvParser(entry.getData().toString()); - channelsCount = parsedChannels.length; - - for await (const c of parsedChannels) { - const name = c[0].trim(); - const id = getRoomId(name); - const creator = c[1].trim(); - const isPrivate = c[2].trim().toLowerCase() === 'private'; - const members = c[3] - .trim() - .split(';') - .map((m) => m.trim()) - .filter((m) => m); - - await this.converter.addChannel({ - importIds: [id], - u: { - _id: creator, - }, - name, - users: members, - t: isPrivate ? 'p' : 'c', - }); - } - - await super.updateRecord({ 'count.channels': channelsCount }); - increaseProgressCount(); - continue; - } - - // Parse the users - if (entry.entryName.toLowerCase() === 'users.csv') { - await super.updateProgress(ProgressStep.PREPARING_USERS); - const parsedUsers = this.csvParser(entry.getData().toString()); - usersCount = parsedUsers.length; - - for await (const u of parsedUsers) { - const username = u[0].trim(); - availableUsernames.add(username); - - const email = u[1].trim(); - const name = u[2].trim(); - - await this.converter.addUser({ - type: 'user', - importIds: [username], - emails: [email], - username, - name, - }); - } - - await super.updateRecord({ 'count.users': usersCount }); - increaseProgressCount(); - continue; - } - - // Parse the messages - if (entry.entryName.indexOf('/') > -1) { - if (this.progress.step !== ProgressStep.PREPARING_MESSAGES) { - await super.updateProgress(ProgressStep.PREPARING_MESSAGES); - } - - const item = entry.entryName.split('/'); // random/messages.csv - const folderName = item[0]; // random - - let msgs = []; - - try { - msgs = this.csvParser(entry.getData().toString()); - } catch (e) { - this.logger.warn(`The file ${entry.entryName} contains invalid syntax`, e); - increaseProgressCount(); - continue; - } - - let data; - const msgGroupData = item[1].split('.')[0]; // messages - let isDirect = false; - - if (folderName.toLowerCase() === 'directmessages') { - isDirect = true; - data = msgs.map((m) => ({ - username: m[0], - ts: m[2], - text: m[3], - otherUsername: m[1], - isDirect: true, - })); - } else { - data = msgs.map((m) => ({ username: m[0], ts: m[1], text: m[2] })); - } - - messagesCount += data.length; - const channelName = `${folderName}/${msgGroupData}`; - - await super.updateRecord({ messagesstatus: channelName }); - - if (isDirect) { - for await (const msg of data) { - const sourceId = [msg.username, msg.otherUsername].sort().join('/'); - - if (!dmRooms.has(sourceId)) { - await this.converter.addChannel({ - importIds: [sourceId], - users: [msg.username, msg.otherUsername], - t: 'd', - }); - - dmRooms.set(sourceId, true); - } - - const newMessage = { - rid: sourceId, - u: { - _id: msg.username, - }, - ts: new Date(parseInt(msg.ts)), - msg: msg.text, - }; - - usedUsernames.add(msg.username); - usedUsernames.add(msg.otherUsername); - await this.converter.addMessage(newMessage); - } - } else { - const rid = getRoomId(folderName); - - for await (const msg of data) { - const newMessage = { - rid, - u: { - _id: msg.username, - }, - ts: new Date(parseInt(msg.ts)), - msg: msg.text, - }; - - usedUsernames.add(msg.username); - await this.converter.addMessage(newMessage); - } - } - - await super.updateRecord({ 'count.messages': messagesCount, 'messagesstatus': null }); - increaseProgressCount(); - continue; - } - - increaseProgressCount(); - } - - if (usersCount) { - await Settings.incrementValueById('CSV_Importer_Count', usersCount); - } - - // Check if any of the message usernames was not in the imported list of users - for await (const username of usedUsernames) { - if (availableUsernames.has(username)) { - continue; - } - - // Check if an user with that username already exists - const user = await Users.findOneByUsername(username); - if (user && !user.importIds?.includes(username)) { - // Add the username to the local user's importIds so it can be found by the import process - // This way we can support importing new messages for existing users - await Users.addImportIds(user._id, username); - } - } - - await super.addCountToTotal(messagesCount + usersCount + channelsCount); - ImporterWebsocket.progressUpdated({ rate: 100 }); - - // Ensure we have at least a single user, channel, or message - if (usersCount === 0 && channelsCount === 0 && messagesCount === 0) { - this.logger.error('No users, channels, or messages found in the import file.'); - await super.updateProgress(ProgressStep.ERROR); - } - - return super.getProgress(); - } -} diff --git a/apps/meteor/app/importer-csv/server/index.ts b/apps/meteor/app/importer-csv/server/index.ts index 8ab31878fb7b..2d913f740955 100644 --- a/apps/meteor/app/importer-csv/server/index.ts +++ b/apps/meteor/app/importer-csv/server/index.ts @@ -1,5 +1,8 @@ import { Importers } from '../../importer/server'; -import { CsvImporterInfo } from '../lib/info'; -import { CsvImporter } from './importer'; +import { CsvImporter } from './CsvImporter'; -Importers.add(new CsvImporterInfo(), CsvImporter); +Importers.add({ + key: 'csv', + name: 'CSV', + importer: CsvImporter, +}); diff --git a/apps/meteor/app/importer-hipchat-enterprise/client/adder.ts b/apps/meteor/app/importer-hipchat-enterprise/client/adder.ts deleted file mode 100644 index 2c03c872c7eb..000000000000 --- a/apps/meteor/app/importer-hipchat-enterprise/client/adder.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { Importers } from '../../importer/client'; -import { HipChatEnterpriseImporterInfo } from '../lib/info'; - -Importers.add(new HipChatEnterpriseImporterInfo()); diff --git a/apps/meteor/app/importer-hipchat-enterprise/client/index.ts b/apps/meteor/app/importer-hipchat-enterprise/client/index.ts deleted file mode 100644 index 44a1b3bab84c..000000000000 --- a/apps/meteor/app/importer-hipchat-enterprise/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -import './adder'; diff --git a/apps/meteor/app/importer-hipchat-enterprise/lib/info.ts b/apps/meteor/app/importer-hipchat-enterprise/lib/info.ts deleted file mode 100644 index 71c1f17a72d7..000000000000 --- a/apps/meteor/app/importer-hipchat-enterprise/lib/info.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { ImporterInfo } from '../../importer/lib/ImporterInfo'; - -export class HipChatEnterpriseImporterInfo extends ImporterInfo { - constructor() { - super('hipchatenterprise', 'HipChat (tar.gz)', 'application/gzip', [ - { - text: 'Importer_HipChatEnterprise_Information', - href: 'https://rocket.chat/docs/administrator-guides/import/hipchat/enterprise/', - }, - ]); - } -} diff --git a/apps/meteor/app/importer-hipchat-enterprise/server/HipChatEnterpriseImporter.js b/apps/meteor/app/importer-hipchat-enterprise/server/HipChatEnterpriseImporter.js new file mode 100644 index 000000000000..ac3d278d82ab --- /dev/null +++ b/apps/meteor/app/importer-hipchat-enterprise/server/HipChatEnterpriseImporter.js @@ -0,0 +1,343 @@ +import fs from 'fs'; +import path from 'path'; +import { Readable } from 'stream'; + +import { Settings } from '@rocket.chat/models'; +import { Meteor } from 'meteor/meteor'; + +import { Importer, ProgressStep } from '../../importer/server'; + +/** @deprecated HipChat was discontinued at 2019-02-15 */ +export class HipChatEnterpriseImporter extends Importer { + constructor(info, importRecord, converterOptions = {}) { + super(info, importRecord, converterOptions); + + this.Readable = Readable; + this.zlib = require('zlib'); + this.tarStream = require('tar-stream'); + this.extract = this.tarStream.extract(); + this.path = path; + } + + parseData(data) { + const dataString = data.toString(); + try { + this.logger.debug('parsing file contents'); + return JSON.parse(dataString); + } catch (e) { + this.logger.error(e); + return false; + } + } + + async prepareUsersFile(file) { + await super.updateProgress(ProgressStep.PREPARING_USERS); + let count = 0; + + for (const u of file) { + const newUser = { + emails: [], + importIds: [String(u.User.id)], + username: u.User.mention_name, + name: u.User.name, + avatarUrl: u.User.avatar && `data:image/png;base64,${u.User.avatar.replace(/\n/g, '')}`, + bio: u.User.title || undefined, + deleted: u.User.is_deleted, + type: 'user', + }; + count++; + + if (u.User.email) { + newUser.emails.push(u.User.email); + } + + this.converter.addUser(newUser); + } + + await Settings.incrementValueById('Hipchat_Enterprise_Importer_Count', count); + await super.updateRecord({ 'count.users': count }); + await super.addCountToTotal(count); + } + + async prepareRoomsFile(file) { + await super.updateProgress(ProgressStep.PREPARING_CHANNELS); + let count = 0; + + for await (const r of file) { + await this.converter.addChannel({ + u: { + _id: r.Room.owner, + }, + importIds: [String(r.Room.id)], + name: r.Room.name, + users: r.Room.members, + t: r.Room.privacy === 'private' ? 'p' : 'c', + topic: r.Room.topic, + ts: new Date(r.Room.created), + archived: r.Room.is_archived, + }); + + count++; + } + + await super.updateRecord({ 'count.channels': count }); + await super.addCountToTotal(count); + } + + async prepareUserMessagesFile(file) { + this.logger.debug(`preparing room with ${file.length} messages `); + let count = 0; + const dmRooms = []; + + for await (const m of file) { + if (!m.PrivateUserMessage) { + continue; + } + + // If the message id is already on the list, skip it + if (this.preparedMessages[m.PrivateUserMessage.id] !== undefined) { + continue; + } + this.preparedMessages[m.PrivateUserMessage.id] = true; + + const senderId = String(m.PrivateUserMessage.sender.id); + const receiverId = String(m.PrivateUserMessage.receiver.id); + const users = [senderId, receiverId].sort(); + + if (!dmRooms[receiverId]) { + dmRooms[receiverId] = await this.converter.findDMForImportedUsers(senderId, receiverId); + + if (!dmRooms[receiverId]) { + const room = { + importIds: [users.join('')], + users, + t: 'd', + ts: new Date(m.PrivateUserMessage.timestamp.split(' ')[0]), + }; + await this.converter.addChannel(room); + dmRooms[receiverId] = room; + } + } + + const rid = dmRooms[receiverId].importIds[0]; + const newMessage = this.convertImportedMessage(m.PrivateUserMessage, rid, 'private'); + count++; + await this.converter.addMessage(newMessage); + } + + return count; + } + + async loadTurndownService() { + const TurndownService = (await import('turndown')).default; + + const turndownService = new TurndownService({ + strongDelimiter: '*', + hr: '', + br: '\n', + }); + + turndownService.addRule('strikethrough', { + filter: 'img', + + replacement(content, node) { + const src = node.getAttribute('src') || ''; + const alt = node.alt || node.title || src; + return src ? `[${alt}](${src})` : ''; + }, + }); + + this.turndownService = turndownService; + + return turndownService; + } + + convertImportedMessage(importedMessage, rid, type) { + const idType = type === 'private' ? type : `${rid}-${type}`; + const newId = `hipchatenterprise-${idType}-${importedMessage.id}`; + + const newMessage = { + _id: newId, + rid, + ts: new Date(importedMessage.timestamp.split(' ')[0]), + u: { + _id: String(importedMessage.sender.id), + }, + }; + + const text = importedMessage.message; + + if (importedMessage.message_format === 'html') { + newMessage.msg = this.turndownService.turndown(text); + } else if (text.startsWith('/me ')) { + newMessage.msg = `${text.replace(/\/me /, '_')}_`; + } else { + newMessage.msg = text; + } + + if (importedMessage.attachment?.url) { + const fileId = `${importedMessage.id}-${importedMessage.attachment.name || 'attachment'}`; + + newMessage._importFile = { + downloadUrl: importedMessage.attachment.url, + id: `${fileId}`, + size: importedMessage.attachment.size || 0, + name: importedMessage.attachment.name, + external: false, + source: 'hipchat-enterprise', + original: { + ...importedMessage.attachment, + }, + }; + } + + return newMessage; + } + + async prepareRoomMessagesFile(file, rid) { + this.logger.debug(`preparing room with ${file.length} messages `); + let count = 0; + + await this.loadTurndownService(); + + for await (const m of file) { + if (m.UserMessage) { + const newMessage = this.convertImportedMessage(m.UserMessage, rid, 'user'); + await this.converter.addMessage(newMessage); + count++; + } else if (m.NotificationMessage) { + const newMessage = this.convertImportedMessage(m.NotificationMessage, rid, 'notif'); + newMessage.u._id = 'rocket.cat'; + newMessage.alias = m.NotificationMessage.sender; + + await this.converter.addMessage(newMessage); + count++; + } else if (m.TopicRoomMessage) { + const newMessage = this.convertImportedMessage(m.TopicRoomMessage, rid, 'topic'); + newMessage.t = 'room_changed_topic'; + + await this.converter.addMessage(newMessage); + count++; + } else if (m.ArchiveRoomMessage) { + this.logger.warn('Archived Room Notification was ignored.'); + } else if (m.GuestAccessMessage) { + this.logger.warn('Guess Access Notification was ignored.'); + } else { + this.logger.error({ msg: "HipChat Enterprise importer isn't configured to handle this message:", file: m }); + } + } + + return count; + } + + async prepareMessagesFile(file, info) { + await super.updateProgress(ProgressStep.PREPARING_MESSAGES); + + const [type, id] = info.dir.split('/'); + const roomIdentifier = `${type}/${id}`; + + await super.updateRecord({ messagesstatus: roomIdentifier }); + + switch (type) { + case 'users': + return this.prepareUserMessagesFile(file); + case 'rooms': + return this.prepareRoomMessagesFile(file, id); + default: + this.logger.error(`HipChat Enterprise importer isn't configured to handle "${type}" files (${info.dir}).`); + return 0; + } + } + + async prepareFile(info, data, fileName) { + const file = this.parseData(data); + if (file === false) { + this.logger.error('failed to parse data'); + return false; + } + + switch (info.base) { + case 'users.json': + await this.prepareUsersFile(file); + break; + case 'rooms.json': + await this.prepareRoomsFile(file); + break; + case 'history.json': + return this.prepareMessagesFile(file, info); + case 'emoticons.json': + case 'metadata.json': + break; + default: + this.logger.error(`HipChat Enterprise importer doesn't know what to do with the file "${fileName}"`); + break; + } + + return 0; + } + + async prepareUsingLocalFile(fullFilePath) { + this.logger.debug('start preparing import operation'); + await this.converter.clearImportData(); + + // HipChat duplicates direct messages (one for each user) + // This object will keep track of messages that have already been prepared so it doesn't try to do it twice + this.preparedMessages = {}; + let messageCount = 0; + + const promise = new Promise((resolve, reject) => { + this.extract.on('entry', (header, stream, next) => { + this.logger.debug(`new entry from import file: ${header.name}`); + if (!header.name.endsWith('.json')) { + stream.resume(); + return next(); + } + + const info = this.path.parse(header.name); + let pos = 0; + let data = Buffer.allocUnsafe(header.size); + + stream.on('data', (chunk) => { + data.fill(chunk, pos, pos + chunk.length); + pos += chunk.length; + }); + + stream.on('end', async () => { + this.logger.info(`Processing the file: ${header.name}`); + const newMessageCount = await this.prepareFile(info, data, header.name); + + messageCount += newMessageCount; + await super.updateRecord({ 'count.messages': messageCount }); + await super.addCountToTotal(newMessageCount); + + data = undefined; + + this.logger.debug('next import entry'); + next(); + }); + + stream.on('error', () => next()); + stream.resume(); + }); + + this.extract.on('error', (err) => { + this.logger.error({ msg: 'extract error:', err }); + reject(new Meteor.Error('error-import-file-extract-error')); + }); + + this.extract.on('finish', resolve); + + const rs = fs.createReadStream(fullFilePath); + const gunzip = this.zlib.createGunzip(); + + gunzip.on('error', (err) => { + this.logger.error({ msg: 'extract error:', err }); + reject(new Meteor.Error('error-import-file-extract-error')); + }); + this.logger.debug('start extracting import file'); + rs.pipe(gunzip).pipe(this.extract); + }); + + return promise; + } +} diff --git a/apps/meteor/app/importer-hipchat-enterprise/server/importer.js b/apps/meteor/app/importer-hipchat-enterprise/server/importer.js deleted file mode 100644 index 18fefea074bf..000000000000 --- a/apps/meteor/app/importer-hipchat-enterprise/server/importer.js +++ /dev/null @@ -1,342 +0,0 @@ -import fs from 'fs'; -import path from 'path'; -import { Readable } from 'stream'; - -import { Settings } from '@rocket.chat/models'; -import { Meteor } from 'meteor/meteor'; - -import { Base, ProgressStep } from '../../importer/server'; - -export class HipChatEnterpriseImporter extends Base { - constructor(info, importRecord, converterOptions = {}) { - super(info, importRecord, converterOptions); - - this.Readable = Readable; - this.zlib = require('zlib'); - this.tarStream = require('tar-stream'); - this.extract = this.tarStream.extract(); - this.path = path; - } - - parseData(data) { - const dataString = data.toString(); - try { - this.logger.debug('parsing file contents'); - return JSON.parse(dataString); - } catch (e) { - this.logger.error(e); - return false; - } - } - - async prepareUsersFile(file) { - await super.updateProgress(ProgressStep.PREPARING_USERS); - let count = 0; - - for (const u of file) { - const newUser = { - emails: [], - importIds: [String(u.User.id)], - username: u.User.mention_name, - name: u.User.name, - avatarUrl: u.User.avatar && `data:image/png;base64,${u.User.avatar.replace(/\n/g, '')}`, - bio: u.User.title || undefined, - deleted: u.User.is_deleted, - type: 'user', - }; - count++; - - if (u.User.email) { - newUser.emails.push(u.User.email); - } - - this.converter.addUser(newUser); - } - - await Settings.incrementValueById('Hipchat_Enterprise_Importer_Count', count); - await super.updateRecord({ 'count.users': count }); - await super.addCountToTotal(count); - } - - async prepareRoomsFile(file) { - await super.updateProgress(ProgressStep.PREPARING_CHANNELS); - let count = 0; - - for await (const r of file) { - await this.converter.addChannel({ - u: { - _id: r.Room.owner, - }, - importIds: [String(r.Room.id)], - name: r.Room.name, - users: r.Room.members, - t: r.Room.privacy === 'private' ? 'p' : 'c', - topic: r.Room.topic, - ts: new Date(r.Room.created), - archived: r.Room.is_archived, - }); - - count++; - } - - await super.updateRecord({ 'count.channels': count }); - await super.addCountToTotal(count); - } - - async prepareUserMessagesFile(file) { - this.logger.debug(`preparing room with ${file.length} messages `); - let count = 0; - const dmRooms = []; - - for await (const m of file) { - if (!m.PrivateUserMessage) { - continue; - } - - // If the message id is already on the list, skip it - if (this.preparedMessages[m.PrivateUserMessage.id] !== undefined) { - continue; - } - this.preparedMessages[m.PrivateUserMessage.id] = true; - - const senderId = String(m.PrivateUserMessage.sender.id); - const receiverId = String(m.PrivateUserMessage.receiver.id); - const users = [senderId, receiverId].sort(); - - if (!dmRooms[receiverId]) { - dmRooms[receiverId] = await this.converter.findDMForImportedUsers(senderId, receiverId); - - if (!dmRooms[receiverId]) { - const room = { - importIds: [users.join('')], - users, - t: 'd', - ts: new Date(m.PrivateUserMessage.timestamp.split(' ')[0]), - }; - await this.converter.addChannel(room); - dmRooms[receiverId] = room; - } - } - - const rid = dmRooms[receiverId].importIds[0]; - const newMessage = this.convertImportedMessage(m.PrivateUserMessage, rid, 'private'); - count++; - await this.converter.addMessage(newMessage); - } - - return count; - } - - async loadTurndownService() { - const TurndownService = (await import('turndown')).default; - - const turndownService = new TurndownService({ - strongDelimiter: '*', - hr: '', - br: '\n', - }); - - turndownService.addRule('strikethrough', { - filter: 'img', - - replacement(content, node) { - const src = node.getAttribute('src') || ''; - const alt = node.alt || node.title || src; - return src ? `[${alt}](${src})` : ''; - }, - }); - - this.turndownService = turndownService; - - return turndownService; - } - - convertImportedMessage(importedMessage, rid, type) { - const idType = type === 'private' ? type : `${rid}-${type}`; - const newId = `hipchatenterprise-${idType}-${importedMessage.id}`; - - const newMessage = { - _id: newId, - rid, - ts: new Date(importedMessage.timestamp.split(' ')[0]), - u: { - _id: String(importedMessage.sender.id), - }, - }; - - const text = importedMessage.message; - - if (importedMessage.message_format === 'html') { - newMessage.msg = this.turndownService.turndown(text); - } else if (text.startsWith('/me ')) { - newMessage.msg = `${text.replace(/\/me /, '_')}_`; - } else { - newMessage.msg = text; - } - - if (importedMessage.attachment?.url) { - const fileId = `${importedMessage.id}-${importedMessage.attachment.name || 'attachment'}`; - - newMessage._importFile = { - downloadUrl: importedMessage.attachment.url, - id: `${fileId}`, - size: importedMessage.attachment.size || 0, - name: importedMessage.attachment.name, - external: false, - source: 'hipchat-enterprise', - original: { - ...importedMessage.attachment, - }, - }; - } - - return newMessage; - } - - async prepareRoomMessagesFile(file, rid) { - this.logger.debug(`preparing room with ${file.length} messages `); - let count = 0; - - await this.loadTurndownService(); - - for await (const m of file) { - if (m.UserMessage) { - const newMessage = this.convertImportedMessage(m.UserMessage, rid, 'user'); - await this.converter.addMessage(newMessage); - count++; - } else if (m.NotificationMessage) { - const newMessage = this.convertImportedMessage(m.NotificationMessage, rid, 'notif'); - newMessage.u._id = 'rocket.cat'; - newMessage.alias = m.NotificationMessage.sender; - - await this.converter.addMessage(newMessage); - count++; - } else if (m.TopicRoomMessage) { - const newMessage = this.convertImportedMessage(m.TopicRoomMessage, rid, 'topic'); - newMessage.t = 'room_changed_topic'; - - await this.converter.addMessage(newMessage); - count++; - } else if (m.ArchiveRoomMessage) { - this.logger.warn('Archived Room Notification was ignored.'); - } else if (m.GuestAccessMessage) { - this.logger.warn('Guess Access Notification was ignored.'); - } else { - this.logger.error({ msg: "HipChat Enterprise importer isn't configured to handle this message:", file: m }); - } - } - - return count; - } - - async prepareMessagesFile(file, info) { - await super.updateProgress(ProgressStep.PREPARING_MESSAGES); - - const [type, id] = info.dir.split('/'); - const roomIdentifier = `${type}/${id}`; - - await super.updateRecord({ messagesstatus: roomIdentifier }); - - switch (type) { - case 'users': - return this.prepareUserMessagesFile(file); - case 'rooms': - return this.prepareRoomMessagesFile(file, id); - default: - this.logger.error(`HipChat Enterprise importer isn't configured to handle "${type}" files (${info.dir}).`); - return 0; - } - } - - async prepareFile(info, data, fileName) { - const file = this.parseData(data); - if (file === false) { - this.logger.error('failed to parse data'); - return false; - } - - switch (info.base) { - case 'users.json': - await this.prepareUsersFile(file); - break; - case 'rooms.json': - await this.prepareRoomsFile(file); - break; - case 'history.json': - return this.prepareMessagesFile(file, info); - case 'emoticons.json': - case 'metadata.json': - break; - default: - this.logger.error(`HipChat Enterprise importer doesn't know what to do with the file "${fileName}"`); - break; - } - - return 0; - } - - async prepareUsingLocalFile(fullFilePath) { - this.logger.debug('start preparing import operation'); - await this.converter.clearImportData(); - - // HipChat duplicates direct messages (one for each user) - // This object will keep track of messages that have already been prepared so it doesn't try to do it twice - this.preparedMessages = {}; - let messageCount = 0; - - const promise = new Promise((resolve, reject) => { - this.extract.on('entry', (header, stream, next) => { - this.logger.debug(`new entry from import file: ${header.name}`); - if (!header.name.endsWith('.json')) { - stream.resume(); - return next(); - } - - const info = this.path.parse(header.name); - let pos = 0; - let data = Buffer.allocUnsafe(header.size); - - stream.on('data', (chunk) => { - data.fill(chunk, pos, pos + chunk.length); - pos += chunk.length; - }); - - stream.on('end', async () => { - this.logger.info(`Processing the file: ${header.name}`); - const newMessageCount = await this.prepareFile(info, data, header.name); - - messageCount += newMessageCount; - await super.updateRecord({ 'count.messages': messageCount }); - await super.addCountToTotal(newMessageCount); - - data = undefined; - - this.logger.debug('next import entry'); - next(); - }); - - stream.on('error', () => next()); - stream.resume(); - }); - - this.extract.on('error', (err) => { - this.logger.error({ msg: 'extract error:', err }); - reject(new Meteor.Error('error-import-file-extract-error')); - }); - - this.extract.on('finish', resolve); - - const rs = fs.createReadStream(fullFilePath); - const gunzip = this.zlib.createGunzip(); - - gunzip.on('error', (err) => { - this.logger.error({ msg: 'extract error:', err }); - reject(new Meteor.Error('error-import-file-extract-error')); - }); - this.logger.debug('start extracting import file'); - rs.pipe(gunzip).pipe(this.extract); - }); - - return promise; - } -} diff --git a/apps/meteor/app/importer-hipchat-enterprise/server/index.ts b/apps/meteor/app/importer-hipchat-enterprise/server/index.ts index 097a5071306d..e50a9b9c4bd3 100644 --- a/apps/meteor/app/importer-hipchat-enterprise/server/index.ts +++ b/apps/meteor/app/importer-hipchat-enterprise/server/index.ts @@ -1,5 +1,8 @@ import { Importers } from '../../importer/server'; -import { HipChatEnterpriseImporterInfo } from '../lib/info'; -import { HipChatEnterpriseImporter } from './importer'; +import { HipChatEnterpriseImporter } from './HipChatEnterpriseImporter'; -Importers.add(new HipChatEnterpriseImporterInfo(), HipChatEnterpriseImporter); +Importers.add({ + key: 'hipchatenterprise', + name: 'HipChat (tar.gz)', + importer: HipChatEnterpriseImporter, +}); diff --git a/apps/meteor/app/importer-pending-avatars/server/PendingAvatarImporter.ts b/apps/meteor/app/importer-pending-avatars/server/PendingAvatarImporter.ts new file mode 100644 index 000000000000..0f6c8c7d41df --- /dev/null +++ b/apps/meteor/app/importer-pending-avatars/server/PendingAvatarImporter.ts @@ -0,0 +1,73 @@ +import { Users } from '@rocket.chat/models'; + +import { Importer, ProgressStep, Selection } from '../../importer/server'; +import type { ImporterProgress } from '../../importer/server/classes/ImporterProgress'; +import { setAvatarFromServiceWithValidation } from '../../lib/server/functions/setUserAvatar'; + +export class PendingAvatarImporter extends Importer { + async prepareFileCount() { + this.logger.debug('start preparing import operation'); + await super.updateProgress(ProgressStep.PREPARING_STARTED); + + const users = Users.findAllUsersWithPendingAvatar(); + const fileCount = await users.count(); + + if (fileCount === 0) { + await super.updateProgress(ProgressStep.DONE); + return 0; + } + + await this.updateRecord({ 'count.messages': fileCount, 'messagesstatus': null }); + await this.addCountToTotal(fileCount); + + const fileData = new Selection(this.info.name, [], [], fileCount); + await this.updateRecord({ fileData }); + + await super.updateProgress(ProgressStep.IMPORTING_FILES); + setImmediate(() => { + void this.startImport(fileData); + }); + + return fileCount; + } + + async startImport(importSelection: Selection): Promise { + const pendingFileUserList = Users.findAllUsersWithPendingAvatar(); + try { + for await (const user of pendingFileUserList) { + try { + const { _pendingAvatarUrl: url, name, _id } = user; + + try { + if (!url?.startsWith('http')) { + continue; + } + + try { + await setAvatarFromServiceWithValidation(_id, url, undefined, 'url'); + await Users.updateOne({ _id }, { $unset: { _pendingAvatarUrl: '' } }); + } catch (error) { + this.logger.warn(`Failed to set ${name}'s avatar from url ${url}`); + } + } finally { + await this.addCountCompleted(1); + } + } catch (error) { + this.logger.error(error); + } + } + } catch (error) { + // If the cursor expired, restart the method + if (this.isCursorNotFoundError(error)) { + this.logger.info('CursorNotFound'); + return this.startImport(importSelection); + } + + await super.updateProgress(ProgressStep.ERROR); + throw error; + } + + await super.updateProgress(ProgressStep.DONE); + return this.getProgress(); + } +} diff --git a/apps/meteor/app/importer-pending-avatars/server/importer.js b/apps/meteor/app/importer-pending-avatars/server/importer.js deleted file mode 100644 index a7517285762b..000000000000 --- a/apps/meteor/app/importer-pending-avatars/server/importer.js +++ /dev/null @@ -1,72 +0,0 @@ -import { Users } from '@rocket.chat/models'; - -import { Base, ProgressStep, Selection } from '../../importer/server'; -import { setAvatarFromServiceWithValidation } from '../../lib/server/functions/setUserAvatar'; - -export class PendingAvatarImporter extends Base { - async prepareFileCount() { - this.logger.debug('start preparing import operation'); - await super.updateProgress(ProgressStep.PREPARING_STARTED); - - const users = await Users.findAllUsersWithPendingAvatar(); - const fileCount = await users.count(); - - if (fileCount === 0) { - await super.updateProgress(ProgressStep.DONE); - return 0; - } - - await this.updateRecord({ 'count.messages': fileCount, 'messagesstatus': null }); - await this.addCountToTotal(fileCount); - - const fileData = new Selection(this.name, [], [], fileCount); - await this.updateRecord({ fileData }); - - await super.updateProgress(ProgressStep.IMPORTING_FILES); - setImmediate(() => { - this.startImport(fileData); - }); - - return fileCount; - } - - async startImport() { - const pendingFileUserList = await Users.findAllUsersWithPendingAvatar(); - try { - for await (const user of pendingFileUserList) { - try { - const { _pendingAvatarUrl: url, name, _id } = user; - - try { - if (!url || !url.startsWith('http')) { - continue; - } - - try { - await setAvatarFromServiceWithValidation(_id, url, undefined, 'url'); - await Users.updateOne({ _id }, { $unset: { _pendingAvatarUrl: '' } }); - } catch (error) { - this.logger.warn(`Failed to set ${name}'s avatar from url ${url}`); - } - } finally { - await this.addCountCompleted(1); - } - } catch (error) { - this.logger.error(error); - } - } - } catch (error) { - // If the cursor expired, restart the method - if (error && error.codeName === 'CursorNotFound') { - this.logger.info('CursorNotFound'); - return this.startImport(); - } - - await super.updateProgress(ProgressStep.ERROR); - throw error; - } - - await super.updateProgress(ProgressStep.DONE); - return this.getProgress(); - } -} diff --git a/apps/meteor/app/importer-pending-avatars/server/index.ts b/apps/meteor/app/importer-pending-avatars/server/index.ts index 9c6bc278abee..b69c6de8e745 100644 --- a/apps/meteor/app/importer-pending-avatars/server/index.ts +++ b/apps/meteor/app/importer-pending-avatars/server/index.ts @@ -1,5 +1,9 @@ import { Importers } from '../../importer/server'; -import { PendingAvatarImporter } from './importer'; -import { PendingAvatarImporterInfo } from './info'; +import { PendingAvatarImporter } from './PendingAvatarImporter'; -Importers.add(new PendingAvatarImporterInfo(), PendingAvatarImporter); +Importers.add({ + key: 'pending-avatars', + name: 'Pending Avatars', + visible: false, + importer: PendingAvatarImporter, +}); diff --git a/apps/meteor/app/importer-pending-avatars/server/info.js b/apps/meteor/app/importer-pending-avatars/server/info.js deleted file mode 100644 index 32e8886cb538..000000000000 --- a/apps/meteor/app/importer-pending-avatars/server/info.js +++ /dev/null @@ -1,7 +0,0 @@ -import { ImporterInfo } from '../../importer/lib/ImporterInfo'; - -export class PendingAvatarImporterInfo extends ImporterInfo { - constructor() { - super('pending-avatars', 'Pending Avatars', ''); - } -} diff --git a/apps/meteor/app/importer-pending-files/server/PendingFileImporter.ts b/apps/meteor/app/importer-pending-files/server/PendingFileImporter.ts new file mode 100644 index 000000000000..da85e9b73296 --- /dev/null +++ b/apps/meteor/app/importer-pending-files/server/PendingFileImporter.ts @@ -0,0 +1,212 @@ +import http from 'http'; +import https from 'https'; + +import { api } from '@rocket.chat/core-services'; +import type { IImport, MessageAttachment, IUpload } from '@rocket.chat/core-typings'; +import { Messages } from '@rocket.chat/models'; +import { Random } from '@rocket.chat/random'; + +import { FileUpload } from '../../file-upload/server'; +import { Importer, ProgressStep, Selection } from '../../importer/server'; +import type { IConverterOptions } from '../../importer/server/classes/ImportDataConverter'; +import type { ImporterProgress } from '../../importer/server/classes/ImporterProgress'; +import type { ImporterInfo } from '../../importer/server/definitions/ImporterInfo'; + +export class PendingFileImporter extends Importer { + constructor(info: ImporterInfo, importRecord: IImport, converterOptions: IConverterOptions = {}) { + super(info, importRecord, converterOptions); + } + + async prepareFileCount() { + this.logger.debug('start preparing import operation'); + await super.updateProgress(ProgressStep.PREPARING_STARTED); + + const fileCount = await Messages.countAllImportedMessagesWithFilesToDownload(); + if (fileCount === 0) { + await super.updateProgress(ProgressStep.DONE); + return 0; + } + + await this.updateRecord({ 'count.messages': fileCount, 'messagesstatus': null }); + await this.addCountToTotal(fileCount); + + const fileData = new Selection(this.info.name, [], [], fileCount); + await this.updateRecord({ fileData }); + + await super.updateProgress(ProgressStep.IMPORTING_FILES); + setImmediate(() => { + void this.startImport(fileData); + }); + + return fileCount; + } + + async startImport(importSelection: Selection): Promise { + const downloadedFileIds: string[] = []; + const maxFileCount = 10; + const maxFileSize = 1024 * 1024 * 500; + + let count = 0; + let currentSize = 0; + let nextSize = 0; + + const waitForFiles = async () => { + if (count + 1 < maxFileCount && currentSize + nextSize < maxFileSize) { + return; + } + + return new Promise((resolve) => { + const handler = setInterval(() => { + if (count + 1 >= maxFileCount) { + return; + } + + if (currentSize + nextSize >= maxFileSize && count > 0) { + return; + } + + clearInterval(handler); + resolve(); + }, 1000); + }); + }; + + const completeFile = async (details: { size: number }) => { + await this.addCountCompleted(1); + count--; + currentSize -= details.size; + }; + + const logError = this.logger.error.bind(this.logger); + + try { + const pendingFileMessageList = Messages.findAllImportedMessagesWithFilesToDownload(); + const importedRoomIds = new Set(); + for await (const message of pendingFileMessageList) { + try { + const { _importFile } = message; + + if (!_importFile || _importFile.downloaded || downloadedFileIds.includes(_importFile.id)) { + await this.addCountCompleted(1); + continue; + } + + const url = _importFile.downloadUrl; + if (!url?.startsWith('http')) { + await this.addCountCompleted(1); + continue; + } + + const details: { message_id: string; name: string; size: number; userId: string; rid: string; type?: string } = { + message_id: `${message._id}-file-${_importFile.id}`, + name: _importFile.name || Random.id(), + size: _importFile.size || 0, + userId: message.u._id, + rid: message.rid, + }; + + const requestModule = /https/i.test(url) ? https : http; + const fileStore = FileUpload.getStore('Uploads'); + + nextSize = details.size; + await waitForFiles(); + count++; + currentSize += nextSize; + downloadedFileIds.push(_importFile.id); + + requestModule.get(url, (res) => { + const contentType = res.headers['content-type']; + if (!details.type && contentType) { + details.type = contentType; + } + + const rawData: Uint8Array[] = []; + res.on('data', (chunk) => { + rawData.push(chunk); + + // Update progress more often on large files + this.reportProgress(); + }); + res.on('error', async (error) => { + await completeFile(details); + logError(error); + }); + + res.on('end', async () => { + try { + // Bypass the fileStore filters + const file = await fileStore._doInsert(details, Buffer.concat(rawData)); + + const url = FileUpload.getPath(`${file._id}/${encodeURI(file.name || '')}`); + const attachment = this.getMessageAttachment(file, url); + + await Messages.setImportFileRocketChatAttachment(_importFile.id, url, attachment); + await completeFile(details); + importedRoomIds.add(message.rid); + } catch (error) { + await completeFile(details); + logError(error); + } + }); + }); + } catch (error) { + this.logger.error(error); + } + } + + void api.broadcast('notify.importedMessages', { roomIds: Array.from(importedRoomIds) }); + } catch (error) { + // If the cursor expired, restart the method + if (this.isCursorNotFoundError(error)) { + this.logger.info('CursorNotFound'); + return this.startImport(importSelection); + } + + await super.updateProgress(ProgressStep.ERROR); + throw error; + } + + await super.updateProgress(ProgressStep.DONE); + return this.getProgress(); + } + + getMessageAttachment(file: IUpload, url: string): MessageAttachment { + if (file.type) { + if (/^image\/.+/.test(file.type)) { + return { + title: file.name, + title_link: url, + image_url: url, + image_type: file.type, + image_size: file.size, + image_dimensions: file.identify ? file.identify.size : undefined, + }; + } + + if (/^audio\/.+/.test(file.type)) { + return { + title: file.name, + title_link: url, + audio_url: url, + audio_type: file.type, + audio_size: file.size, + }; + } + + if (/^video\/.+/.test(file.type)) { + return { + title: file.name, + title_link: url, + video_url: url, + video_type: file.type, + video_size: file.size, + }; + } + } + + return { + title: file.name, + title_link: url, + }; + } +} diff --git a/apps/meteor/app/importer-pending-files/server/importer.js b/apps/meteor/app/importer-pending-files/server/importer.js deleted file mode 100644 index 3d8d083c495b..000000000000 --- a/apps/meteor/app/importer-pending-files/server/importer.js +++ /dev/null @@ -1,189 +0,0 @@ -import http from 'http'; -import https from 'https'; - -import { Messages } from '@rocket.chat/models'; -import { Random } from '@rocket.chat/random'; - -import { FileUpload } from '../../file-upload/server'; -import { Base, ProgressStep, Selection } from '../../importer/server'; - -export class PendingFileImporter extends Base { - constructor(info, importRecord) { - super(info, importRecord); - this.userTags = []; - this.bots = {}; - } - - async prepareFileCount() { - this.logger.debug('start preparing import operation'); - await super.updateProgress(ProgressStep.PREPARING_STARTED); - - const fileCount = await Messages.countAllImportedMessagesWithFilesToDownload(); - if (fileCount === 0) { - await super.updateProgress(ProgressStep.DONE); - return 0; - } - - await this.updateRecord({ 'count.messages': fileCount, 'messagesstatus': null }); - await this.addCountToTotal(fileCount); - - const fileData = new Selection(this.name, [], [], fileCount); - await this.updateRecord({ fileData }); - - await super.updateProgress(ProgressStep.IMPORTING_FILES); - setImmediate(() => { - this.startImport(fileData); - }); - - return fileCount; - } - - async startImport() { - const downloadedFileIds = []; - const maxFileCount = 10; - const maxFileSize = 1024 * 1024 * 500; - - let count = 0; - let currentSize = 0; - let nextSize = 0; - - const waitForFiles = async () => { - if (count + 1 < maxFileCount && currentSize + nextSize < maxFileSize) { - return; - } - - return new Promise((resolve) => { - const handler = setInterval(() => { - if (count + 1 >= maxFileCount) { - return; - } - - if (currentSize + nextSize >= maxFileSize && count > 0) { - return; - } - - clearInterval(handler); - resolve(); - }, 1000); - }); - }; - - const completeFile = async (details) => { - await this.addCountCompleted(1); - count--; - currentSize -= details.size; - }; - - const logError = (error) => { - this.logger.error(error); - }; - - try { - const pendingFileMessageList = Messages.findAllImportedMessagesWithFilesToDownload(); - for await (const message of pendingFileMessageList) { - try { - const { _importFile } = message; - - if (!_importFile || _importFile.downloaded || downloadedFileIds.includes(_importFile.id)) { - await this.addCountCompleted(1); - return; - } - - const url = _importFile.downloadUrl; - if (!url || !url.startsWith('http')) { - await this.addCountCompleted(1); - return; - } - - const details = { - message_id: `${message._id}-file-${_importFile.id}`, - name: _importFile.name || Random.id(), - size: _importFile.size || 0, - userId: message.u._id, - rid: message.rid, - }; - - const requestModule = /https/i.test(url) ? https : http; - const fileStore = FileUpload.getStore('Uploads'); - const reportProgress = this.reportProgress.bind(this); - - nextSize = details.size; - await waitForFiles(); - count++; - currentSize += nextSize; - downloadedFileIds.push(_importFile.id); - - requestModule.get(url, (res) => { - const contentType = res.headers['content-type']; - if (!details.type && contentType) { - details.type = contentType; - } - - const rawData = []; - res.on('data', (chunk) => { - rawData.push(chunk); - - // Update progress more often on large files - reportProgress(); - }); - res.on('error', async (error) => { - await completeFile(details); - logError(error); - }); - - res.on('end', async () => { - try { - // Bypass the fileStore filters - const file = await fileStore._doInsert(details, Buffer.concat(rawData)); - - const url = FileUpload.getPath(`${file._id}/${encodeURI(file.name)}`); - const attachment = { - title: file.name, - title_link: url, - }; - - if (/^image\/.+/.test(file.type)) { - attachment.image_url = url; - attachment.image_type = file.type; - attachment.image_size = file.size; - attachment.image_dimensions = file.identify != null ? file.identify.size : undefined; - } - - if (/^audio\/.+/.test(file.type)) { - attachment.audio_url = url; - attachment.audio_type = file.type; - attachment.audio_size = file.size; - } - - if (/^video\/.+/.test(file.type)) { - attachment.video_url = url; - attachment.video_type = file.type; - attachment.video_size = file.size; - } - - await Messages.setImportFileRocketChatAttachment(_importFile.id, url, attachment); - await completeFile(details); - } catch (error) { - await completeFile(details); - logError(error); - } - }); - }); - } catch (error) { - this.logger.error(error); - } - } - } catch (error) { - // If the cursor expired, restart the method - if (error && error.codeName === 'CursorNotFound') { - return this.startImport(); - } - - await super.updateProgress(ProgressStep.ERROR); - throw error; - } - - await super.updateProgress(ProgressStep.DONE); - return this.getProgress(); - } -} diff --git a/apps/meteor/app/importer-pending-files/server/index.ts b/apps/meteor/app/importer-pending-files/server/index.ts index 2486e6b0f0d9..24961551cdb5 100644 --- a/apps/meteor/app/importer-pending-files/server/index.ts +++ b/apps/meteor/app/importer-pending-files/server/index.ts @@ -1,5 +1,9 @@ import { Importers } from '../../importer/server'; -import { PendingFileImporter } from './importer'; -import { PendingFileImporterInfo } from './info'; +import { PendingFileImporter } from './PendingFileImporter'; -Importers.add(new PendingFileImporterInfo(), PendingFileImporter); +Importers.add({ + key: 'pending-files', + name: 'Pending Files', + visible: false, + importer: PendingFileImporter, +}); diff --git a/apps/meteor/app/importer-pending-files/server/info.js b/apps/meteor/app/importer-pending-files/server/info.js deleted file mode 100644 index f12d01a52611..000000000000 --- a/apps/meteor/app/importer-pending-files/server/info.js +++ /dev/null @@ -1,7 +0,0 @@ -import { ImporterInfo } from '../../importer/lib/ImporterInfo'; - -export class PendingFileImporterInfo extends ImporterInfo { - constructor() { - super('pending-files', 'Pending Files', ''); - } -} diff --git a/apps/meteor/app/importer-slack-users/client/adder.js b/apps/meteor/app/importer-slack-users/client/adder.js deleted file mode 100644 index 8c6b0276bfdd..000000000000 --- a/apps/meteor/app/importer-slack-users/client/adder.js +++ /dev/null @@ -1,4 +0,0 @@ -import { Importers } from '../../importer/client'; -import { SlackUsersImporterInfo } from '../lib/info'; - -Importers.add(new SlackUsersImporterInfo()); diff --git a/apps/meteor/app/importer-slack-users/client/index.ts b/apps/meteor/app/importer-slack-users/client/index.ts deleted file mode 100644 index 44a1b3bab84c..000000000000 --- a/apps/meteor/app/importer-slack-users/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -import './adder'; diff --git a/apps/meteor/app/importer-slack-users/lib/info.js b/apps/meteor/app/importer-slack-users/lib/info.js deleted file mode 100644 index 999c5e76cfc9..000000000000 --- a/apps/meteor/app/importer-slack-users/lib/info.js +++ /dev/null @@ -1,12 +0,0 @@ -import { ImporterInfo } from '../../importer/lib/ImporterInfo'; - -export class SlackUsersImporterInfo extends ImporterInfo { - constructor() { - super('slack-users', 'Slack_Users', 'text/csv', [ - { - text: 'Importer_Slack_Users_CSV_Information', - href: 'https://rocket.chat/docs/administrator-guides/import/slack/users', - }, - ]); - } -} diff --git a/apps/meteor/app/importer-slack-users/server/SlackUsersImporter.ts b/apps/meteor/app/importer-slack-users/server/SlackUsersImporter.ts new file mode 100644 index 000000000000..2c26531bd5c4 --- /dev/null +++ b/apps/meteor/app/importer-slack-users/server/SlackUsersImporter.ts @@ -0,0 +1,100 @@ +import fs from 'fs'; + +import type { IImport, IImportUser } from '@rocket.chat/core-typings'; +import { Settings } from '@rocket.chat/models'; +import { parse } from 'csv-parse/lib/sync'; + +import { RocketChatFile } from '../../file/server'; +import { Importer, ProgressStep } from '../../importer/server'; +import type { IConverterOptions } from '../../importer/server/classes/ImportDataConverter'; +import type { ImporterProgress } from '../../importer/server/classes/ImporterProgress'; +import type { ImporterInfo } from '../../importer/server/definitions/ImporterInfo'; + +export class SlackUsersImporter extends Importer { + private csvParser: (csv: string) => string[]; + + constructor(info: ImporterInfo, importRecord: IImport, converterOptions: IConverterOptions = {}) { + super(info, importRecord, converterOptions); + + this.csvParser = parse; + } + + async prepareUsingLocalFile(fullFilePath: string): Promise { + this.logger.debug('start preparing import operation'); + await this.converter.clearImportData(); + + const file = fs.readFileSync(fullFilePath); + const buffer = Buffer.isBuffer(file) ? file : Buffer.from(file); + + const { contentType } = this.importRecord; + const fileName = this.importRecord.file; + + const data = buffer.toString('base64'); + const dataURI = `data:${contentType};base64,${data}`; + + return this.prepare(dataURI, fileName || ''); + } + + async prepare(dataURI: string, fileName: string): Promise { + this.logger.debug('start preparing import operation'); + await this.converter.clearImportData(); + await this.updateRecord({ file: fileName }); + + await super.updateProgress(ProgressStep.PREPARING_USERS); + const uriResult = RocketChatFile.dataURIParse(dataURI); + const buf = Buffer.from(uriResult.image, 'base64'); + const parsed = this.csvParser(buf.toString()); + + let userCount = 0; + for await (const [index, user] of parsed.entries()) { + // Ignore the first column + if (index === 0) { + continue; + } + + const username = user[0]; + const email = user[1]; + if (!email) { + continue; + } + + const name = user[7] || user[8] || username; + + const newUser: IImportUser = { + emails: [email], + importIds: [email], + username, + name, + type: 'user', + }; + + switch (user[2]) { + case 'Admin': + newUser.roles = ['admin']; + break; + case 'Bot': + newUser.roles = ['bot']; + newUser.type = 'bot'; + break; + case 'Deactivated': + newUser.deleted = true; + break; + } + + await this.converter.addUser(newUser); + userCount++; + } + + if (userCount === 0) { + this.logger.error('No users found in the import file.'); + await super.updateProgress(ProgressStep.ERROR); + return super.getProgress(); + } + + await super.updateProgress(ProgressStep.USER_SELECTION); + await super.addCountToTotal(userCount); + await Settings.incrementValueById('Slack_Users_Importer_Count', userCount); + await super.updateRecord({ 'count.users': userCount }); + return super.getProgress(); + } +} diff --git a/apps/meteor/app/importer-slack-users/server/importer.js b/apps/meteor/app/importer-slack-users/server/importer.js deleted file mode 100644 index 177885b7833a..000000000000 --- a/apps/meteor/app/importer-slack-users/server/importer.js +++ /dev/null @@ -1,89 +0,0 @@ -import fs from 'fs'; - -import { Settings } from '@rocket.chat/models'; - -import { RocketChatFile } from '../../file/server'; -import { Base, ProgressStep } from '../../importer/server'; - -export class SlackUsersImporter extends Base { - constructor(info, importRecord, converterOptions = {}) { - super(info, importRecord, converterOptions); - - const { parse } = require('csv-parse/lib/sync'); - - this.csvParser = parse; - } - - async prepareUsingLocalFile(fullFilePath) { - this.logger.debug('start preparing import operation'); - await this.converter.clearImportData(); - - const file = fs.readFileSync(fullFilePath); - const buffer = Buffer.isBuffer(file) ? file : Buffer.from(file); - - const { contentType } = this.importRecord; - const fileName = this.importRecord.file; - - const data = buffer.toString('base64'); - const dataURI = `data:${contentType};base64,${data}`; - - await this.updateRecord({ file: fileName }); - - await super.updateProgress(ProgressStep.PREPARING_USERS); - const uriResult = RocketChatFile.dataURIParse(dataURI); - const buf = Buffer.from(uriResult.image, 'base64'); - const parsed = this.csvParser(buf.toString()); - - let userCount = 0; - for await (const [index, user] of parsed.entries()) { - // Ignore the first column - if (index === 0) { - continue; - } - - const username = user[0]; - const email = user[1]; - if (!email) { - continue; - } - - const name = user[7] || user[8] || username; - - const newUser = { - emails: [email], - importIds: [email], - username, - name, - type: 'user', - }; - - switch (user[2]) { - case 'Admin': - newUser.roles = ['admin']; - break; - case 'Bot': - newUser.roles = ['bot']; - newUser.type = 'bot'; - break; - case 'Deactivated': - newUser.deleted = true; - break; - } - - await this.converter.addUser(newUser); - userCount++; - } - - if (userCount === 0) { - this.logger.error('No users found in the import file.'); - await super.updateProgress(ProgressStep.ERROR); - return super.getProgress(); - } - - await super.updateProgress(ProgressStep.USER_SELECTION); - await super.addCountToTotal(userCount); - await Settings.incrementValueById('Slack_Users_Importer_Count', userCount); - await super.updateRecord({ 'count.users': userCount }); - return super.getProgress(); - } -} diff --git a/apps/meteor/app/importer-slack-users/server/index.ts b/apps/meteor/app/importer-slack-users/server/index.ts index 6d23f6939b13..ab99ede8f912 100644 --- a/apps/meteor/app/importer-slack-users/server/index.ts +++ b/apps/meteor/app/importer-slack-users/server/index.ts @@ -1,5 +1,8 @@ import { Importers } from '../../importer/server'; -import { SlackUsersImporterInfo } from '../lib/info'; -import { SlackUsersImporter } from './importer'; +import { SlackUsersImporter } from './SlackUsersImporter'; -Importers.add(new SlackUsersImporterInfo(), SlackUsersImporter); +Importers.add({ + key: 'slack-users', + name: 'Slack_Users', + importer: SlackUsersImporter, +}); diff --git a/apps/meteor/app/importer-slack/client/adder.js b/apps/meteor/app/importer-slack/client/adder.js deleted file mode 100644 index 06e1941f38df..000000000000 --- a/apps/meteor/app/importer-slack/client/adder.js +++ /dev/null @@ -1,4 +0,0 @@ -import { Importers } from '../../importer/client'; -import { SlackImporterInfo } from '../lib/info'; - -Importers.add(new SlackImporterInfo()); diff --git a/apps/meteor/app/importer-slack/client/index.ts b/apps/meteor/app/importer-slack/client/index.ts deleted file mode 100644 index 44a1b3bab84c..000000000000 --- a/apps/meteor/app/importer-slack/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -import './adder'; diff --git a/apps/meteor/app/importer-slack/lib/info.js b/apps/meteor/app/importer-slack/lib/info.js deleted file mode 100644 index bf431e8f7c58..000000000000 --- a/apps/meteor/app/importer-slack/lib/info.js +++ /dev/null @@ -1,7 +0,0 @@ -import { ImporterInfo } from '../../importer/lib/ImporterInfo'; - -export class SlackImporterInfo extends ImporterInfo { - constructor() { - super('slack', 'Slack', 'application/zip'); - } -} diff --git a/apps/meteor/app/importer-slack/server/SlackImporter.ts b/apps/meteor/app/importer-slack/server/SlackImporter.ts new file mode 100644 index 000000000000..0ef81c69a1e0 --- /dev/null +++ b/apps/meteor/app/importer-slack/server/SlackImporter.ts @@ -0,0 +1,718 @@ +import type { IImportUser, IImportMessage, IImportPendingFile } from '@rocket.chat/core-typings'; +import { Messages, Settings, ImportData } from '@rocket.chat/models'; +import type { IZipEntry } from 'adm-zip'; + +import { Importer, ProgressStep, ImporterWebsocket } from '../../importer/server'; +import type { ImporterProgress } from '../../importer/server/classes/ImporterProgress'; +import { MentionsParser } from '../../mentions/lib/MentionsParser'; +import { settings } from '../../settings/server'; +import { getUserAvatarURL } from '../../utils/server/getUserAvatarURL'; + +type SlackChannel = { + id: string; + name: string; + topic?: { + value: string; + creator: string; + last_set: number; + }; + members: string[]; + purpose?: { + value: string; + creator: string; + last_set: number; + }; + created: number; + creator: string | null; + is_general: boolean; + is_archived: boolean; +}; + +type SlackUser = { + id: string; + name: string; + profile: { + real_name: string; + email: string; + image_512: string; + image_original: string; + status_text: string; + title: string; + }; + tz_offset: number; + deleted: boolean; + is_bot: boolean; +}; + +type SlackFile = { + id: string; + url_private_download: string; + size: number; + name: string; + is_external: boolean; +}; + +type SlackMessage = { + id: string; + ts: string; + user: string; + reactions?: { + name: string; + users: string[]; + }[]; + type: 'message'; + subtype?: string; + files?: SlackFile[]; + text: string; + edited?: { + ts: string; + user: string; + }; + thread_ts?: string; + reply_users?: string[]; + reply_count?: number; + replies?: { + user: string; + }[]; + latest_reply: string; + icons?: { + emoji: string; + }; + attachments?: SlackAttachment[]; +} & ( + | { + subtype: 'channel_purpose' | 'group_purpose'; + purpose: string; + } + | { + subtype: 'channel_join' | 'group_join' | 'channel_leave' | 'group_leave'; + } + | { + subtype: 'channel_topic' | 'group_topic'; + topic: string; + } + | { + subtype: 'channel_name' | 'group_name'; + name: string; + } + | { + subtype: 'pinned_item'; + attachments: SlackAttachment[]; + } + | { + subtype: 'file_share'; + file: SlackFile; + } + | { + subtype: 'me_message'; + } +); + +type SlackAttachment = { + text: string; + title: string; + fallback: string; + author_subname: string; +}; + +export class SlackImporter extends Importer { + private _useUpsert = false; + + async prepareChannelsFile(entry: IZipEntry): Promise { + await super.updateProgress(ProgressStep.PREPARING_CHANNELS); + const data = (JSON.parse(entry.getData().toString()) as SlackChannel[]).filter( + (channel): channel is SlackChannel & { creator: string } => 'creator' in channel && channel.creator != null, + ); + + this.logger.debug(`loaded ${data.length} channels.`); + + await this.addCountToTotal(data.length); + + for await (const channel of data) { + await this.converter.addChannel({ + _id: channel.is_general ? 'general' : undefined, + u: { + _id: this._replaceSlackUserId(channel.creator), + }, + importIds: [channel.id], + name: channel.name, + users: this._replaceSlackUserIds(channel.members), + t: 'c', + topic: channel.topic?.value || undefined, + description: channel.purpose?.value || undefined, + ts: channel.created ? new Date(channel.created * 1000) : undefined, + archived: channel.is_archived, + }); + } + + return data.length; + } + + async prepareGroupsFile(entry: IZipEntry): Promise { + await super.updateProgress(ProgressStep.PREPARING_CHANNELS); + const data = (JSON.parse(entry.getData().toString()) as SlackChannel[]).filter( + (channel): channel is SlackChannel & { creator: string } => 'creator' in channel && channel.creator != null, + ); + + this.logger.debug(`loaded ${data.length} groups.`); + + await this.addCountToTotal(data.length); + + for await (const channel of data) { + await this.converter.addChannel({ + u: { + _id: this._replaceSlackUserId(channel.creator), + }, + importIds: [channel.id], + name: channel.name, + users: this._replaceSlackUserIds(channel.members), + t: 'p', + topic: channel.topic?.value || undefined, + description: channel.purpose?.value || undefined, + ts: channel.created ? new Date(channel.created * 1000) : undefined, + archived: channel.is_archived, + }); + } + + return data.length; + } + + async prepareMpimpsFile(entry: IZipEntry): Promise { + await super.updateProgress(ProgressStep.PREPARING_CHANNELS); + const data = (JSON.parse(entry.getData().toString()) as SlackChannel[]).filter( + (channel): channel is SlackChannel & { creator: string } => 'creator' in channel && channel.creator != null, + ); + + this.logger.debug(`loaded ${data.length} mpims.`); + + await this.addCountToTotal(data.length); + + const maxUsers = settings.get('DirectMesssage_maxUsers') || 1; + + for await (const channel of data) { + await this.converter.addChannel({ + u: { + _id: this._replaceSlackUserId(channel.creator), + }, + importIds: [channel.id], + name: channel.name, + users: this._replaceSlackUserIds(channel.members), + t: channel.members.length > maxUsers ? 'p' : 'd', + topic: channel.topic?.value || undefined, + description: channel.purpose?.value || undefined, + ts: channel.created ? new Date(channel.created * 1000) : undefined, + archived: channel.is_archived, + }); + } + + return data.length; + } + + async prepareDMsFile(entry: IZipEntry): Promise { + await super.updateProgress(ProgressStep.PREPARING_CHANNELS); + const data = JSON.parse(entry.getData().toString()) as SlackChannel[]; + + this.logger.debug(`loaded ${data.length} dms.`); + + await this.addCountToTotal(data.length); + for await (const channel of data) { + await this.converter.addChannel({ + importIds: [channel.id], + users: this._replaceSlackUserIds(channel.members), + t: 'd', + ts: channel.created ? new Date(channel.created * 1000) : undefined, + }); + } + + return data.length; + } + + async prepareUsersFile(entry: IZipEntry): Promise { + await super.updateProgress(ProgressStep.PREPARING_USERS); + const data = JSON.parse(entry.getData().toString()) as SlackUser[]; + + this.logger.debug(`loaded ${data.length} users.`); + + // Insert the users record + await this.updateRecord({ 'count.users': data.length }); + await this.addCountToTotal(data.length); + + for await (const user of data) { + const newUser: IImportUser = { + emails: [], + importIds: [user.id], + username: user.name, + name: user.profile.real_name, + utcOffset: user.tz_offset && user.tz_offset / 3600, + avatarUrl: user.profile.image_original || user.profile.image_512, + deleted: user.deleted, + statusText: user.profile.status_text || undefined, + bio: user.profile.title || undefined, + type: 'user', + }; + + if (user.profile.email) { + newUser.emails.push(user.profile.email); + } + + if (user.is_bot) { + newUser.roles = ['bot']; + newUser.type = 'bot'; + } + + await this.converter.addUser(newUser); + } + + return data.length; + } + + async prepareUsingLocalFile(fullFilePath: string): Promise { + this.logger.debug('start preparing import operation'); + await this.converter.clearImportData(); + + const zip = new this.AdmZip(fullFilePath); + const totalEntries = zip.getEntryCount(); + + let userCount = 0; + let messagesCount = 0; + let channelCount = 0; + let count = 0; + + ImporterWebsocket.progressUpdated({ rate: 0 }); + let oldRate = 0; + + const increaseProgress = () => { + try { + count++; + const rate = Math.floor((count * 1000) / totalEntries) / 10; + if (rate > oldRate) { + ImporterWebsocket.progressUpdated({ rate }); + oldRate = rate; + } + } catch (e) { + this.logger.error(e); + } + }; + + try { + // we need to iterate the zip file twice so that all channels are loaded before the messages + for await (const entry of zip.getEntries()) { + try { + if (entry.entryName === 'channels.json') { + channelCount += await this.prepareChannelsFile(entry); + await this.updateRecord({ 'count.channels': channelCount }); + increaseProgress(); + continue; + } + + if (entry.entryName === 'groups.json') { + channelCount += await this.prepareGroupsFile(entry); + await this.updateRecord({ 'count.channels': channelCount }); + increaseProgress(); + continue; + } + + if (entry.entryName === 'mpims.json') { + channelCount += await this.prepareMpimpsFile(entry); + await this.updateRecord({ 'count.channels': channelCount }); + increaseProgress(); + continue; + } + + if (entry.entryName === 'dms.json') { + channelCount += await this.prepareDMsFile(entry); + await this.updateRecord({ 'count.channels': channelCount }); + increaseProgress(); + continue; + } + + if (entry.entryName === 'users.json') { + userCount = await this.prepareUsersFile(entry); + increaseProgress(); + continue; + } + } catch (e) { + this.logger.error(e); + } + } + + if (userCount) { + await Settings.incrementValueById('Slack_Importer_Count', userCount); + } + + const missedTypes: Record = {}; + // If we have no slack message yet, then we can insert them instead of upserting + this._useUpsert = !(await Messages.findOne({ _id: /slack\-.*/ })); + + for await (const entry of zip.getEntries()) { + try { + if (entry.entryName.includes('__MACOSX') || entry.entryName.includes('.DS_Store')) { + count++; + this.logger.debug(`Ignoring the file: ${entry.entryName}`); + continue; + } + + if (['channels.json', 'groups.json', 'mpims.json', 'dms.json', 'users.json'].includes(entry.entryName)) { + continue; + } + + if (!entry.isDirectory && entry.entryName.includes('/')) { + const item = entry.entryName.split('/'); + + const channel = item[0]; + const date = item[1].split('.')[0]; + + try { + // Insert the messages records + if (this.progress.step !== ProgressStep.PREPARING_MESSAGES) { + await super.updateProgress(ProgressStep.PREPARING_MESSAGES); + } + + const tempMessages = JSON.parse(entry.getData().toString()) as SlackMessage[]; + messagesCount += tempMessages.length; + await this.updateRecord({ messagesstatus: `${channel}/${date}` }); + await this.addCountToTotal(tempMessages.length); + + const slackChannelId = await ImportData.findChannelImportIdByNameOrImportId(channel); + + if (slackChannelId) { + for await (const message of tempMessages) { + await this.prepareMessageObject(message, missedTypes, slackChannelId); + } + } + } catch (error) { + this.logger.warn(`${entry.entryName} is not a valid JSON file! Unable to import it.`); + } + } + } catch (e) { + this.logger.error(e); + } + + increaseProgress(); + } + + if (Object.keys(missedTypes).length > 0) { + this.logger.info('Missed import types:', missedTypes); + } + } catch (e) { + this.logger.error(e); + throw e; + } + + ImporterWebsocket.progressUpdated({ rate: 100 }); + await this.updateRecord({ 'count.messages': messagesCount, 'messagesstatus': null }); + + return this.progress; + } + + parseMentions(newMessage: IImportMessage): void { + const mentionsParser = new MentionsParser({ + pattern: () => '[0-9a-zA-Z]+', + useRealName: () => settings.get('UI_Use_Real_Name'), + me: () => 'me', + }); + + const users = mentionsParser + .getUserMentions(newMessage.msg) + .filter((u: string) => u) + .map((uid: string) => this._replaceSlackUserId(uid.slice(1, uid.length))); + if (users.length) { + if (!newMessage.mentions) { + newMessage.mentions = []; + } + newMessage.mentions.push(...users); + } + + const channels = mentionsParser + .getChannelMentions(newMessage.msg) + .filter((c: string) => c) + .map((name: string) => name.slice(1, name.length)); + if (channels.length) { + if (!newMessage.channels) { + newMessage.channels = []; + } + newMessage.channels.push(...channels); + } + } + + async processMessageSubType( + message: SlackMessage, + slackChannelId: string, + newMessage: IImportMessage, + missedTypes: Record, + ): Promise { + const ignoreTypes: Record = { bot_add: true, file_comment: true, file_mention: true }; + + switch (message.subtype) { + case 'channel_join': + case 'group_join': + newMessage.t = 'uj'; + newMessage.groupable = false; + return true; + case 'channel_leave': + case 'group_leave': + newMessage.t = 'ul'; + newMessage.groupable = false; + return true; + case 'channel_purpose': + case 'group_purpose': + newMessage.t = 'room_changed_description'; + newMessage.groupable = false; + newMessage.msg = message.purpose; + return true; + case 'channel_topic': + case 'group_topic': + newMessage.t = 'room_changed_topic'; + newMessage.groupable = false; + newMessage.msg = message.topic; + return true; + case 'channel_name': + case 'group_name': + newMessage.t = 'r'; + newMessage.msg = message.name; + newMessage.groupable = false; + return true; + case 'pinned_item': + if (message.attachments) { + if (!newMessage.attachments) { + newMessage.attachments = []; + } + newMessage.attachments.push({ + text: this.convertSlackMessageToRocketChat(message.attachments[0].text), + author_name: message.attachments[0].author_subname, + author_icon: getUserAvatarURL(message.attachments[0].author_subname), + }); + newMessage.t = 'message_pinned'; + } + break; + case 'file_share': + if (message.file?.url_private_download) { + const fileId = this.makeSlackMessageId(slackChannelId, message.ts, 'share'); + const fileMessage: IImportMessage = { + _id: fileId, + rid: newMessage.rid, + ts: newMessage.ts, + msg: message.file.url_private_download || '', + _importFile: this.convertSlackFileToPendingFile(message.file), + u: { + _id: newMessage.u._id, + }, + }; + + if (message.thread_ts && message.thread_ts !== message.ts) { + fileMessage.tmid = this.makeSlackMessageId(slackChannelId, message.thread_ts); + } + + await this.converter.addMessage(fileMessage, this._useUpsert); + } + break; + + default: + if (!missedTypes[message.subtype] && !ignoreTypes[message.subtype]) { + missedTypes[message.subtype] = message; + } + break; + } + + return false; + } + + makeSlackMessageId(channelId: string, ts: string, fileIndex?: string): string { + const base = `slack-${channelId}-${ts.replace(/\./g, '-')}`; + + if (fileIndex) { + return `${base}-file${fileIndex}`; + } + + return base; + } + + async prepareMessageObject(message: SlackMessage, missedTypes: Record, slackChannelId: string): Promise { + const id = this.makeSlackMessageId(slackChannelId, message.ts); + const newMessage: IImportMessage = { + _id: id, + rid: slackChannelId, + ts: new Date(parseInt(message.ts.split('.')[0]) * 1000), + msg: '', + u: { + _id: this._replaceSlackUserId(message.user), + }, + }; + + // Process the reactions + if (message.reactions && message.reactions.length > 0) { + newMessage.reactions = message.reactions.reduce((newReactions, reaction) => { + const name = `:${reaction.name}:`; + return { + ...newReactions, + ...(reaction.users?.length ? { name: { name, users: this._replaceSlackUserIds(reaction.users) } } : {}), + }; + }, {} as Required['reactions']); + } + + if (message.type === 'message') { + if (message.files) { + let fileIndex = 0; + const promises = message.files.map(async (file) => { + fileIndex++; + + const fileId = this.makeSlackMessageId(slackChannelId, message.ts, String(fileIndex)); + const fileMessage: IImportMessage = { + _id: fileId, + rid: slackChannelId, + ts: newMessage.ts, + msg: file.url_private_download || '', + _importFile: this.convertSlackFileToPendingFile(file), + u: { + _id: this._replaceSlackUserId(message.user), + }, + }; + + if (message.thread_ts && message.thread_ts !== message.ts) { + fileMessage.tmid = this.makeSlackMessageId(slackChannelId, message.thread_ts); + } + + await this.converter.addMessage(fileMessage, this._useUpsert); + }); + await Promise.all(promises); + } + + const regularTypes = ['me_message', 'thread_broadcast']; + + const isBotMessage = message.subtype && ['bot_message', 'slackbot_response'].includes(message.subtype); + + if (message.subtype && !regularTypes.includes(message.subtype) && !isBotMessage) { + if (await this.processMessageSubType(message, slackChannelId, newMessage, missedTypes)) { + await this.converter.addMessage(newMessage, this._useUpsert); + } + } else { + const text = this.convertSlackMessageToRocketChat(message.text); + + if (isBotMessage) { + newMessage.bot = true; + } + + if (message.subtype === 'me_message') { + newMessage.msg = `_${text}_`; + } else { + newMessage.msg = text; + } + + if (message.thread_ts) { + if (message.thread_ts === message.ts) { + if (message.reply_users) { + const replies = new Set(); + message.reply_users.forEach((item: string) => { + replies.add(this._replaceSlackUserId(item)); + }); + + if (replies.size) { + newMessage.replies = Array.from(replies); + } + } else if (message.replies) { + const replies = new Set(); + message.replies.forEach((item: { user: string }) => { + replies.add(this._replaceSlackUserId(item.user)); + }); + + if (replies.size) { + newMessage.replies = Array.from(replies); + } + } else { + this.logger.warn(`Failed to import the parent comment, message: ${newMessage._id}. Missing replies/reply_users field`); + } + + newMessage.tcount = message.reply_count; + newMessage.tlm = new Date(parseInt(message.latest_reply.split('.')[0]) * 1000); + } else { + newMessage.tmid = this.makeSlackMessageId(slackChannelId, message.thread_ts); + } + } + + if (message.edited) { + newMessage.editedAt = new Date(parseInt(message.edited.ts.split('.')[0]) * 1000); + if (message.edited.user) { + newMessage.editedBy = this._replaceSlackUserId(message.edited.user); + } + } + + if (message.attachments) { + newMessage.attachments = this.convertMessageAttachments(message.attachments); + } + + if (message.icons?.emoji) { + newMessage.emoji = message.icons.emoji; + } + + this.parseMentions(newMessage); + await this.converter.addMessage(newMessage, this._useUpsert); + } + } + } + + _replaceSlackUserId(userId: string): string { + if (userId === 'USLACKBOT') { + return 'rocket.cat'; + } + + return userId; + } + + _replaceSlackUserIds(members: string[]) { + if (!members?.length) { + return []; + } + return members.map((userId) => this._replaceSlackUserId(userId)); + } + + convertSlackMessageToRocketChat(message: string): string { + if (message) { + message = message.replace(//g, '@all'); + message = message.replace(//g, '@all'); + message = message.replace(//g, '@here'); + message = message.replace(/>/g, '>'); + message = message.replace(/</g, '<'); + message = message.replace(/&/g, '&'); + message = message.replace(/:simple_smile:/g, ':smile:'); + message = message.replace(/:memo:/g, ':pencil:'); + message = message.replace(/:piggy:/g, ':pig:'); + message = message.replace(/:uk:/g, ':gb:'); + message = message.replace(/<(http[s]?:[^>|]*)>/g, '$1'); + message = message.replace(/<(http[s]?:[^|]*)\|([^>]*)>/g, '[$2]($1)'); + message = message.replace(/<#([^|]*)\|([^>]*)>/g, '#$2'); + message = message.replace(/<@([^|]*)\|([^>]*)>/g, '@$1'); + message = message.replace(/<@([^|>]*)>/g, '@$1'); + } else { + message = ''; + } + + return message; + } + + convertSlackFileToPendingFile(file: SlackFile): IImportPendingFile { + return { + downloadUrl: file.url_private_download, + id: file.id, + size: file.size, + name: file.name, + external: file.is_external, + source: 'slack', + original: { + ...file, + }, + }; + } + + convertMessageAttachments(attachments: SlackAttachment[]): IImportMessage['attachments'] { + if (!attachments?.length) { + return undefined; + } + + return attachments.map((attachment) => ({ + ...attachment, + text: this.convertSlackMessageToRocketChat(attachment.text), + title: this.convertSlackMessageToRocketChat(attachment.title), + fallback: this.convertSlackMessageToRocketChat(attachment.fallback), + })); + } +} diff --git a/apps/meteor/app/importer-slack/server/importer.js b/apps/meteor/app/importer-slack/server/importer.js deleted file mode 100644 index a5b0da6e549d..000000000000 --- a/apps/meteor/app/importer-slack/server/importer.js +++ /dev/null @@ -1,610 +0,0 @@ -import { Messages, Settings, ImportData } from '@rocket.chat/models'; -import _ from 'underscore'; - -import { Base, ProgressStep, ImporterWebsocket } from '../../importer/server'; -import { MentionsParser } from '../../mentions/lib/MentionsParser'; -import { settings } from '../../settings/server'; -import { getUserAvatarURL } from '../../utils/server/getUserAvatarURL'; - -export class SlackImporter extends Base { - parseData(data) { - const dataString = data.toString(); - try { - this.logger.debug('parsing file contents'); - return JSON.parse(dataString); - } catch (e) { - this.logger.error(e); - return false; - } - } - - async prepareChannelsFile(entry) { - await super.updateProgress(ProgressStep.PREPARING_CHANNELS); - const data = JSON.parse(entry.getData().toString()).filter((channel) => channel.creator != null); - - this.logger.debug(`loaded ${data.length} channels.`); - - await this.addCountToTotal(data.length); - - for await (const channel of data) { - await this.converter.addChannel({ - _id: channel.is_general ? 'general' : undefined, - u: { - _id: this._replaceSlackUserId(channel.creator), - }, - importIds: [channel.id], - name: channel.name, - users: this._replaceSlackUserIds(channel.members), - t: 'c', - topic: channel.topic?.value || undefined, - description: channel.purpose?.value || undefined, - ts: channel.created ? new Date(channel.created * 1000) : undefined, - archived: channel.is_archived, - }); - } - - return data.length; - } - - async prepareGroupsFile(entry) { - await super.updateProgress(ProgressStep.PREPARING_CHANNELS); - const data = JSON.parse(entry.getData().toString()).filter((channel) => channel.creator != null); - - this.logger.debug(`loaded ${data.length} groups.`); - - await this.addCountToTotal(data.length); - - for await (const channel of data) { - await this.converter.addChannel({ - u: { - _id: this._replaceSlackUserId(channel.creator), - }, - importIds: [channel.id], - name: channel.name, - users: this._replaceSlackUserIds(channel.members), - t: 'p', - topic: channel.topic?.value || undefined, - description: channel.purpose?.value || undefined, - ts: channel.created ? new Date(channel.created * 1000) : undefined, - archived: channel.is_archived, - }); - } - - return data.length; - } - - async prepareMpimpsFile(entry) { - await super.updateProgress(ProgressStep.PREPARING_CHANNELS); - const data = JSON.parse(entry.getData().toString()).filter((channel) => channel.creator != null); - - this.logger.debug(`loaded ${data.length} mpims.`); - - await this.addCountToTotal(data.length); - - const maxUsers = settings.get('DirectMesssage_maxUsers') || 1; - - for await (const channel of data) { - await this.converter.addChannel({ - u: { - _id: this._replaceSlackUserId(channel.creator), - }, - importIds: [channel.id], - name: channel.name, - users: this._replaceSlackUserIds(channel.members), - t: channel.members.length > maxUsers ? 'p' : 'd', - topic: channel.topic?.value || undefined, - description: channel.purpose?.value || undefined, - ts: channel.created ? new Date(channel.created * 1000) : undefined, - archived: channel.is_archived, - }); - } - - return data.length; - } - - async prepareDMsFile(entry) { - await super.updateProgress(ProgressStep.PREPARING_CHANNELS); - const data = JSON.parse(entry.getData().toString()); - - this.logger.debug(`loaded ${data.length} dms.`); - - await this.addCountToTotal(data.length); - for await (const channel of data) { - await this.converter.addChannel({ - importIds: [channel.id], - users: this._replaceSlackUserIds(channel.members), - t: 'd', - ts: channel.created ? new Date(channel.created * 1000) : undefined, - }); - } - - return data.length; - } - - async prepareUsersFile(entry) { - await super.updateProgress(ProgressStep.PREPARING_USERS); - const data = JSON.parse(entry.getData().toString()); - - this.logger.debug(`loaded ${data.length} users.`); - - // Insert the users record - await this.updateRecord({ 'count.users': data.length }); - await this.addCountToTotal(data.length); - - for await (const user of data) { - const newUser = { - emails: [], - importIds: [user.id], - username: user.name, - name: user.profile.real_name, - utcOffset: user.tz_offset && user.tz_offset / 3600, - avatarUrl: user.profile.image_original || user.profile.image_512, - deleted: user.deleted, - statusText: user.profile.status_text || undefined, - bio: user.profile.title || undefined, - type: 'user', - }; - - if (user.profile.email) { - newUser.emails.push(user.profile.email); - } - - if (user.is_bot) { - newUser.roles = ['bot']; - newUser.type = 'bot'; - } - - await this.converter.addUser(newUser); - } - - return data.length; - } - - async prepareUsingLocalFile(fullFilePath) { - this.logger.debug('start preparing import operation'); - await this.converter.clearImportData(); - - const zip = new this.AdmZip(fullFilePath); - const totalEntries = zip.getEntryCount(); - - let userCount = 0; - let messagesCount = 0; - let channelCount = 0; - let count = 0; - - ImporterWebsocket.progressUpdated({ rate: 0 }); - let oldRate = 0; - - const increaseProgress = () => { - try { - count++; - const rate = Math.floor((count * 1000) / totalEntries) / 10; - if (rate > oldRate) { - ImporterWebsocket.progressUpdated({ rate }); - oldRate = rate; - } - } catch (e) { - this.logger.error(e); - } - }; - - try { - // we need to iterate the zip file twice so that all channels are loaded before the messages - for await (const entry of zip.getEntries()) { - try { - if (entry.entryName === 'channels.json') { - channelCount += await this.prepareChannelsFile(entry); - await this.updateRecord({ 'count.channels': channelCount }); - increaseProgress(); - continue; - } - - if (entry.entryName === 'groups.json') { - channelCount += await this.prepareGroupsFile(entry); - await this.updateRecord({ 'count.channels': channelCount }); - increaseProgress(); - continue; - } - - if (entry.entryName === 'mpims.json') { - channelCount += await this.prepareMpimpsFile(entry); - await this.updateRecord({ 'count.channels': channelCount }); - increaseProgress(); - continue; - } - - if (entry.entryName === 'dms.json') { - channelCount += await this.prepareDMsFile(entry); - await this.updateRecord({ 'count.channels': channelCount }); - increaseProgress(); - continue; - } - - if (entry.entryName === 'users.json') { - userCount = await this.prepareUsersFile(entry); - increaseProgress(); - continue; - } - } catch (e) { - this.logger.error(e); - } - } - - if (userCount) { - await Settings.incrementValueById('Slack_Importer_Count', userCount); - } - - const missedTypes = {}; - // If we have no slack message yet, then we can insert them instead of upserting - this._useUpsert = !(await Messages.findOne({ _id: /slack\-.*/ })); - - for await (const entry of zip.getEntries()) { - try { - if (entry.entryName.includes('__MACOSX') || entry.entryName.includes('.DS_Store')) { - count++; - this.logger.debug(`Ignoring the file: ${entry.entryName}`); - continue; - } - - if (['channels.json', 'groups.json', 'mpims.json', 'dms.json', 'users.json'].includes(entry.entryName)) { - continue; - } - - if (!entry.isDirectory && entry.entryName.includes('/')) { - const item = entry.entryName.split('/'); - - const channel = item[0]; - const date = item[1].split('.')[0]; - - try { - // Insert the messages records - if (this.progress.step !== ProgressStep.PREPARING_MESSAGES) { - await super.updateProgress(ProgressStep.PREPARING_MESSAGES); - } - - const tempMessages = JSON.parse(entry.getData().toString()); - messagesCount += tempMessages.length; - await this.updateRecord({ messagesstatus: `${channel}/${date}` }); - await this.addCountToTotal(tempMessages.length); - - const slackChannelId = await ImportData.findChannelImportIdByNameOrImportId(channel); - - if (slackChannelId) { - for await (const message of tempMessages) { - await this.prepareMessageObject(message, missedTypes, slackChannelId); - } - } - } catch (error) { - this.logger.warn(`${entry.entryName} is not a valid JSON file! Unable to import it.`); - } - } - } catch (e) { - this.logger.error(e); - } - - increaseProgress(); - } - - if (!_.isEmpty(missedTypes)) { - this.logger.info('Missed import types:', missedTypes); - } - } catch (e) { - this.logger.error(e); - throw e; - } - - ImporterWebsocket.progressUpdated({ rate: 100 }); - await this.updateRecord({ 'count.messages': messagesCount, 'messagesstatus': null }); - - return this.progress; - } - - parseMentions(newMessage) { - const mentionsParser = new MentionsParser({ - pattern: () => '[0-9a-zA-Z]+', - useRealName: () => settings.get('UI_Use_Real_Name'), - me: () => 'me', - }); - - const users = mentionsParser - .getUserMentions(newMessage.msg) - .filter((u) => u) - .map((uid) => this._replaceSlackUserId(uid.slice(1, uid.length))); - if (users.length) { - if (!newMessage.mentions) { - newMessage.mentions = []; - } - newMessage.mentions.push(...users); - } - - const channels = mentionsParser - .getChannelMentions(newMessage.msg) - .filter((c) => c) - .map((name) => name.slice(1, name.length)); - if (channels.length) { - if (!newMessage.channels) { - newMessage.channels = []; - } - newMessage.channels.push(...channels); - } - } - - async processMessageSubType(message, slackChannelId, newMessage, missedTypes) { - const ignoreTypes = { bot_add: true, file_comment: true, file_mention: true }; - - switch (message.subtype) { - case 'channel_join': - case 'group_join': - newMessage.t = 'uj'; - newMessage.groupable = false; - return true; - case 'channel_leave': - case 'group_leave': - newMessage.t = 'ul'; - newMessage.groupable = false; - return true; - case 'channel_purpose': - case 'group_purpose': - newMessage.t = 'room_changed_description'; - newMessage.groupable = false; - newMessage.msg = message.purpose; - return true; - case 'channel_topic': - case 'group_topic': - newMessage.t = 'room_changed_topic'; - newMessage.groupable = false; - newMessage.msg = message.topic; - return true; - case 'channel_name': - case 'group_name': - newMessage.t = 'r'; - newMessage.msg = message.name; - newMessage.groupable = false; - return true; - case 'pinned_item': - if (message.attachments) { - if (!newMessage.attachments) { - newMessage.attachments = []; - } - newMessage.attachments.push({ - text: this.convertSlackMessageToRocketChat(message.attachments[0].text), - author_name: message.attachments[0].author_subname, - author_icon: getUserAvatarURL(message.attachments[0].author_subname), - }); - newMessage.t = 'message_pinned'; - } - break; - case 'file_share': - if (message.file?.url_private_download) { - const fileId = this.makeSlackMessageId(slackChannelId, message.ts, 'share'); - const fileMessage = { - _id: fileId, - rid: newMessage.rid, - ts: newMessage.ts, - msg: message.file.url_private_download || '', - _importFile: this.convertSlackFileToPendingFile(message.file), - u: { - _id: newMessage.u._id, - }, - }; - - if (message.thread_ts && message.thread_ts !== message.ts) { - fileMessage.tmid = this.makeSlackMessageId(slackChannelId, message.thread_ts); - } - - await this.converter.addMessage(fileMessage, this._useUpsert); - } - break; - - default: - if (!missedTypes[message.subtype] && !ignoreTypes[message.subtype]) { - missedTypes[message.subtype] = message; - } - break; - } - - return false; - } - - makeSlackMessageId(channelId, ts, fileIndex = undefined) { - const base = `slack-${channelId}-${ts.replace(/\./g, '-')}`; - - if (fileIndex) { - return `${base}-file${fileIndex}`; - } - - return base; - } - - async prepareMessageObject(message, missedTypes, slackChannelId) { - const id = this.makeSlackMessageId(slackChannelId, message.ts); - const newMessage = { - _id: id, - rid: slackChannelId, - ts: new Date(parseInt(message.ts.split('.')[0]) * 1000), - u: { - _id: this._replaceSlackUserId(message.user), - }, - }; - - // Process the reactions - if (message.reactions && message.reactions.length > 0) { - newMessage.reactions = new Map(); - - message.reactions.forEach((reaction) => { - const name = `:${reaction.name}:`; - if (reaction.users && reaction.users.length) { - newMessage.reactions.set(name, { - name, - users: this._replaceSlackUserIds(reaction.users), - }); - } - }); - } - - if (message.type === 'message') { - if (message.files) { - let fileIndex = 0; - const promises = message.files.map(async (file) => { - fileIndex++; - - const fileId = this.makeSlackMessageId(slackChannelId, message.ts, fileIndex); - const fileMessage = { - _id: fileId, - rid: slackChannelId, - ts: newMessage.ts, - msg: file.url_private_download || '', - _importFile: this.convertSlackFileToPendingFile(file), - u: { - _id: this._replaceSlackUserId(message.user), - }, - }; - - if (message.thread_ts && message.thread_ts !== message.ts) { - fileMessage.tmid = this.makeSlackMessageId(slackChannelId, message.thread_ts); - } - - await this.converter.addMessage(fileMessage, this._useUpsert); - }); - await Promise.all(promises); - } - - const regularTypes = ['me_message', 'thread_broadcast']; - - const isBotMessage = message.subtype && ['bot_message', 'slackbot_response'].includes(message.subtype); - - if (message.subtype && !regularTypes.includes(message.subtype) && !isBotMessage) { - if (await this.processMessageSubType(message, slackChannelId, newMessage, missedTypes)) { - await this.converter.addMessage(newMessage, this._useUpsert); - } - } else { - const text = this.convertSlackMessageToRocketChat(message.text); - - if (isBotMessage) { - newMessage.bot = true; - } - - if (message.subtype === 'me_message') { - newMessage.msg = `_${text}_`; - } else { - newMessage.msg = text; - } - - if (message.thread_ts) { - if (message.thread_ts === message.ts) { - if (message.reply_users) { - const replies = new Set(); - message.reply_users.forEach((item) => { - replies.add(this._replaceSlackUserId(item)); - }); - - if (replies.length) { - newMessage.replies = Array.from(replies); - } - } else if (message.replies) { - const replies = new Set(); - message.repĺies.forEach((item) => { - replies.add(this._replaceSlackUserId(item.user)); - }); - - if (replies.length) { - newMessage.replies = Array.from(replies); - } - } else { - this.logger.warn(`Failed to import the parent comment, message: ${newMessage._id}. Missing replies/reply_users field`); - } - - newMessage.tcount = message.reply_count; - newMessage.tlm = new Date(parseInt(message.latest_reply.split('.')[0]) * 1000); - } else { - newMessage.tmid = this.makeSlackMessageId(slackChannelId, message.thread_ts); - } - } - - if (message.edited) { - newMessage.editedAt = new Date(parseInt(message.edited.ts.split('.')[0]) * 1000); - if (message.edited.user) { - newMessage.editedBy = this._replaceSlackUserId(message.edited.user); - } - } - - if (message.attachments) { - newMessage.attachments = this.convertMessageAttachments(message.attachments); - } - - if (message.icons && message.icons.emoji) { - newMessage.emoji = message.icons.emoji; - } - - this.parseMentions(newMessage); - await this.converter.addMessage(newMessage, this._useUpsert); - } - } - } - - _replaceSlackUserId(userId) { - if (userId === 'USLACKBOT') { - return 'rocket.cat'; - } - - return userId; - } - - _replaceSlackUserIds(members) { - if (!members?.length) { - return []; - } - return members.map((userId) => this._replaceSlackUserId(userId)); - } - - convertSlackMessageToRocketChat(message) { - if (message) { - message = message.replace(//g, '@all'); - message = message.replace(//g, '@all'); - message = message.replace(//g, '@here'); - message = message.replace(/>/g, '>'); - message = message.replace(/</g, '<'); - message = message.replace(/&/g, '&'); - message = message.replace(/:simple_smile:/g, ':smile:'); - message = message.replace(/:memo:/g, ':pencil:'); - message = message.replace(/:piggy:/g, ':pig:'); - message = message.replace(/:uk:/g, ':gb:'); - message = message.replace(/<(http[s]?:[^>|]*)>/g, '$1'); - message = message.replace(/<(http[s]?:[^|]*)\|([^>]*)>/g, '[$2]($1)'); - message = message.replace(/<#([^|]*)\|([^>]*)>/g, '#$2'); - message = message.replace(/<@([^|]*)\|([^>]*)>/g, '@$1'); - message = message.replace(/<@([^|>]*)>/g, '@$1'); - } else { - message = ''; - } - - return message; - } - - convertSlackFileToPendingFile(file) { - return { - downloadUrl: file.url_private_download, - id: file.id, - size: file.size, - name: file.name, - external: file.is_external, - source: 'slack', - original: { - ...file, - }, - }; - } - - convertMessageAttachments(attachments) { - if (!attachments || !attachments.length) { - return attachments; - } - - return attachments.map((attachment) => ({ - ...attachment, - text: this.convertSlackMessageToRocketChat(attachment.text), - title: this.convertSlackMessageToRocketChat(attachment.title), - fallback: this.convertSlackMessageToRocketChat(attachment.fallback), - })); - } -} diff --git a/apps/meteor/app/importer-slack/server/index.ts b/apps/meteor/app/importer-slack/server/index.ts index 6442d31dfa42..b8040d77538a 100644 --- a/apps/meteor/app/importer-slack/server/index.ts +++ b/apps/meteor/app/importer-slack/server/index.ts @@ -1,5 +1,8 @@ import { Importers } from '../../importer/server'; -import { SlackImporterInfo } from '../lib/info'; -import { SlackImporter } from './importer'; +import { SlackImporter } from './SlackImporter'; -Importers.add(new SlackImporterInfo(), SlackImporter); +Importers.add({ + key: 'slack', + name: 'Slack', + importer: SlackImporter, +}); diff --git a/apps/meteor/app/importer/client/index.ts b/apps/meteor/app/importer/client/index.ts deleted file mode 100644 index 7cd9fa3c3440..000000000000 --- a/apps/meteor/app/importer/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { Importers } from '../lib/Importers'; diff --git a/apps/meteor/app/importer/lib/ImporterInfo.js b/apps/meteor/app/importer/lib/ImporterInfo.js deleted file mode 100644 index 627c1d786a28..000000000000 --- a/apps/meteor/app/importer/lib/ImporterInfo.js +++ /dev/null @@ -1,19 +0,0 @@ -export class ImporterInfo { - /** - * Creates a new class which contains information about the importer. - * - * @param {string} key The unique key of this importer. - * @param {string} name The i18n name. - * @param {string} mimeType The type of file it expects. - * @param {{ href: string, text: string }[]} warnings An array of warning objects. `{ href, text }` - */ - constructor(key, name = '', mimeType = '', warnings = []) { - this.key = key; - this.name = name; - this.mimeType = mimeType; - this.warnings = warnings; - - this.importer = undefined; - this.instance = undefined; - } -} diff --git a/apps/meteor/app/importer/lib/ImporterProgressStep.ts b/apps/meteor/app/importer/lib/ImporterProgressStep.ts index da81c050967c..1b5ffe53c93f 100644 --- a/apps/meteor/app/importer/lib/ImporterProgressStep.ts +++ b/apps/meteor/app/importer/lib/ImporterProgressStep.ts @@ -1,3 +1,5 @@ +import type { IImportProgress } from '@rocket.chat/core-typings'; + /** The progress step that an importer is at. */ export const ProgressStep = Object.freeze({ NEW: 'importer_new', @@ -22,20 +24,20 @@ export const ProgressStep = Object.freeze({ DONE: 'importer_done', ERROR: 'importer_import_failed', CANCELLED: 'importer_import_cancelled', -}); +} satisfies Record); -export const ImportWaitingStates = [ProgressStep.NEW, ProgressStep.UPLOADING, ProgressStep.DOWNLOADING_FILE]; +export const ImportWaitingStates: IImportProgress['step'][] = [ProgressStep.NEW, ProgressStep.UPLOADING, ProgressStep.DOWNLOADING_FILE]; -export const ImportFileReadyStates = [ProgressStep.FILE_LOADED]; +export const ImportFileReadyStates: IImportProgress['step'][] = [ProgressStep.FILE_LOADED]; -export const ImportPreparingStartedStates = [ +export const ImportPreparingStartedStates: IImportProgress['step'][] = [ ProgressStep.PREPARING_STARTED, ProgressStep.PREPARING_USERS, ProgressStep.PREPARING_CHANNELS, ProgressStep.PREPARING_MESSAGES, ]; -export const ImportingStartedStates = [ +export const ImportingStartedStates: IImportProgress['step'][] = [ ProgressStep.IMPORTING_STARTED, ProgressStep.IMPORTING_USERS, ProgressStep.IMPORTING_CHANNELS, @@ -44,4 +46,4 @@ export const ImportingStartedStates = [ ProgressStep.FINISHING, ]; -export const ImportingErrorStates = [ProgressStep.ERROR, ProgressStep.CANCELLED]; +export const ImportingErrorStates: IImportProgress['step'][] = [ProgressStep.ERROR, ProgressStep.CANCELLED]; diff --git a/apps/meteor/app/importer/lib/Importers.js b/apps/meteor/app/importer/lib/Importers.js deleted file mode 100644 index 13acf2b616d8..000000000000 --- a/apps/meteor/app/importer/lib/Importers.js +++ /dev/null @@ -1,47 +0,0 @@ -import { ImporterInfo } from './ImporterInfo'; - -/** Container class which holds all of the importer details. */ -class ImportersContainer { - constructor() { - this.importers = new Map(); - } - - /** - * Adds an importer to the import collection. Adding it more than once will - * overwrite the previous one. - * - * @param {ImporterInfo} info The information related to the importer. - * @param {*} [importer] The class for the importer, will be undefined on the client. - */ - add(info, importer) { - if (!(info instanceof ImporterInfo)) { - throw new Error('The importer must be a valid ImporterInfo instance.'); - } - - info.importer = importer; - - this.importers.set(info.key, info); - - return this.importers.get(info.key); - } - - /** - * Gets the importer information that is stored. - * - * @param {string} key The key of the importer. - */ - get(key) { - return this.importers.get(key); - } - - /** - * Gets all of the importers in array format. - * - * @returns {ImporterInfo[]} The array of importer information. - */ - getAll() { - return Array.from(this.importers.values()); - } -} - -export const Importers = new ImportersContainer(); diff --git a/apps/meteor/app/importer/server/classes/ImportDataConverter.ts b/apps/meteor/app/importer/server/classes/ImportDataConverter.ts index 1b596d625d9b..f5315b4f1e6c 100644 --- a/apps/meteor/app/importer/server/classes/ImportDataConverter.ts +++ b/apps/meteor/app/importer/server/classes/ImportDataConverter.ts @@ -60,7 +60,6 @@ export type IConverterOptions = { flagEmailsAsVerified?: boolean; skipExistingUsers?: boolean; skipNewUsers?: boolean; - bindSkippedUsers?: boolean; skipUserCallbacks?: boolean; skipDefaultChannels?: boolean; @@ -100,7 +99,6 @@ export class ImportDataConverter { flagEmailsAsVerified: false, skipExistingUsers: false, skipNewUsers: false, - bindSkippedUsers: false, }; this._userCache = new Map(); this._userDisplayNameCache = new Map(); @@ -396,18 +394,6 @@ export class ImportDataConverter { } async findExistingUser(data: IImportUser): Promise { - // If we're gonna force-bind importIds, we search for them first to ensure they are unique - if (this._options.bindSkippedUsers) { - // #TODO: Use a single operation for multiple IDs - // (Currently there's no existing use case with multiple IDs being passed to this function) - for await (const importId of data.importIds) { - const importedUser = await Users.findOneByImportId(importId, {}); - if (importedUser) { - return importedUser; - } - } - } - if (data.emails.length) { const emailUser = await Users.findOneByEmailAddress(data.emails[0], {}); @@ -488,13 +474,6 @@ export class ImportDataConverter { const existingUser = await this.findExistingUser(data); if (existingUser && this._options.skipExistingUsers) { - if (this._options.bindSkippedUsers) { - const newImportIds = data.importIds.filter((importId) => !(existingUser as IUser).importIds?.includes(importId)); - if (newImportIds.length) { - await Users.addImportIds(existingUser._id, newImportIds); - } - } - await this.skipRecord(_id); skippedCount++; continue; @@ -736,7 +715,12 @@ export class ImportDataConverter { return ImportData.getAllMessages().toArray(); } - async convertMessages({ beforeImportFn, afterImportFn, onErrorFn }: IConversionCallbacks = {}): Promise { + async convertMessages({ + beforeImportFn, + afterImportFn, + onErrorFn, + afterImportAllMessagesFn, + }: IConversionCallbacks & { afterImportAllMessagesFn?: (roomIds: string[]) => Promise }): Promise { const rids: Array = []; const messages = await this.getMessagesToImport(); @@ -761,7 +745,6 @@ export class ImportDataConverter { this._logger.warn(`Imported user not found: ${data.u._id}`); throw new Error('importer-message-unknown-user'); } - const rid = await this.findImportedRoomId(data.rid); if (!rid) { throw new Error('importer-message-unknown-room'); @@ -828,12 +811,15 @@ export class ImportDataConverter { for await (const rid of rids) { try { - await Rooms.resetLastMessageById(rid); + await Rooms.resetLastMessageById(rid, null); } catch (e) { this._logger.warn(`Failed to update last message of room ${rid}`); this._logger.error(e); } } + if (afterImportAllMessagesFn) { + await afterImportAllMessagesFn(rids); + } } async updateRoom(room: IRoom, roomData: IImportChannel, startedByUserId: string): Promise { @@ -1034,13 +1020,13 @@ export class ImportDataConverter { return; } if (roomData.t === 'p') { - const user = await Users.findOneById(startedByUserId); + const user = await Users.findOneById(creatorId); if (!user) { throw new Error('importer-channel-invalid-creator'); } - roomInfo = await createPrivateGroupMethod(user, roomData.name, members, false, {}, {}, true); + roomInfo = await createPrivateGroupMethod(user, roomData.name, members, false, {}, {}); } else { - roomInfo = await createChannelMethod(startedByUserId, roomData.name, members, false, {}, {}, true); + roomInfo = await createChannelMethod(creatorId, roomData.name, members, false, {}, {}); } } diff --git a/apps/meteor/app/importer/server/classes/Importer.ts b/apps/meteor/app/importer/server/classes/Importer.ts new file mode 100644 index 000000000000..68a12513a06c --- /dev/null +++ b/apps/meteor/app/importer/server/classes/Importer.ts @@ -0,0 +1,399 @@ +import { api } from '@rocket.chat/core-services'; +import type { IImport, IImportRecord, IImportChannel, IImportUser, IImportProgress } from '@rocket.chat/core-typings'; +import { Logger } from '@rocket.chat/logger'; +import { Settings, ImportData, Imports } from '@rocket.chat/models'; +import AdmZip from 'adm-zip'; +import type { MatchKeysAndValues, MongoServerError } from 'mongodb'; + +import { Selection, SelectionChannel, SelectionUser } from '..'; +import { callbacks } from '../../../../lib/callbacks'; +import { t } from '../../../utils/lib/i18n'; +import { ProgressStep, ImportPreparingStartedStates } from '../../lib/ImporterProgressStep'; +import type { ImporterInfo } from '../definitions/ImporterInfo'; +import { ImportDataConverter } from './ImportDataConverter'; +import type { IConverterOptions } from './ImportDataConverter'; +import { ImporterProgress } from './ImporterProgress'; +import { ImporterWebsocket } from './ImporterWebsocket'; + +type OldSettings = { + allowedDomainList?: string | null; + allowUsernameChange?: boolean | null; + maxFileSize?: number | null; + mediaTypeWhiteList?: string | null; + mediaTypeBlackList?: string | null; +}; + +/** + * Base class for all of the importers. + */ +export class Importer { + private _reportProgressHandler: ReturnType | undefined; + + protected AdmZip = AdmZip; + + protected converter: ImportDataConverter; + + protected info: ImporterInfo; + + protected logger: Logger; + + protected oldSettings: OldSettings; + + protected _lastProgressReportTotal = 0; + + public importRecord: IImport; + + public progress: ImporterProgress; + + constructor(info: ImporterInfo, importRecord: IImport, converterOptions: IConverterOptions = {}) { + if (!info.key || !info.importer) { + throw new Error('Information passed in must be a valid ImporterInfo instance.'); + } + + this.converter = new ImportDataConverter(converterOptions); + + this.info = info; + + this.logger = new Logger(`${this.info.name} Importer`); + this.converter.setLogger(this.logger); + + this.importRecord = importRecord; + this.progress = new ImporterProgress(this.info.key, this.info.name); + this.oldSettings = {}; + + this.progress.step = this.importRecord.status; + this._lastProgressReportTotal = 0; + this.reloadCount(); + + this.logger.debug(`Constructed a new ${this.info.name} Importer.`); + } + + /** + * Registers the file name and content type on the import operation + */ + async startFileUpload(fileName: string, contentType?: string): Promise { + await this.updateProgress(ProgressStep.UPLOADING); + return this.updateRecord({ file: fileName, ...(contentType ? { contentType } : {}) }); + } + + /** + * Takes the uploaded file and extracts the users, channels, and messages from it. + * + * @param {string} _fullFilePath the full path of the uploaded file + * @returns {ImporterProgress} The progress record of the import. + */ + async prepareUsingLocalFile(_fullFilePath: string): Promise { + return this.updateProgress(ProgressStep.PREPARING_STARTED); + } + + /** + * Starts the import process. The implementing method should defer + * as soon as the selection is set, so the user who started the process + * doesn't end up with a "locked" UI while Meteor waits for a response. + * The returned object should be the progress. + * + * @param {Selection} importSelection The selection data. + * @returns {ImporterProgress} The progress record of the import. + */ + async startImport(importSelection: Selection, startedByUserId: string): Promise { + if (!(importSelection instanceof Selection)) { + throw new Error(`Invalid Selection data provided to the ${this.info.name} importer.`); + } else if (importSelection.users === undefined) { + throw new Error(`Users in the selected data wasn't found, it must but at least an empty array for the ${this.info.name} importer.`); + } else if (importSelection.channels === undefined) { + throw new Error( + `Channels in the selected data wasn't found, it must but at least an empty array for the ${this.info.name} importer.`, + ); + } + if (!startedByUserId) { + throw new Error('You must be logged in to do this.'); + } + + if (!startedByUserId) { + throw new Error('You must be logged in to do this.'); + } + + await this.updateProgress(ProgressStep.IMPORTING_STARTED); + this.reloadCount(); + const started = Date.now(); + + const beforeImportFn = async ({ data, dataType: type }: IImportRecord) => { + if (this.importRecord.valid === false) { + this.converter.aborted = true; + throw new Error('The import operation is no longer valid.'); + } + + switch (type) { + case 'channel': { + if (!importSelection.channels) { + return true; + } + + const channelData = data as IImportChannel; + + const id = channelData.t === 'd' ? '__directMessages__' : channelData.importIds[0]; + for (const channel of importSelection.channels) { + if (channel.channel_id === id) { + return channel.do_import; + } + } + + return false; + } + case 'user': { + // #TODO: Replace this workaround + if (importSelection.users.length === 0 && this.info.key === 'api') { + return true; + } + + const userData = data as IImportUser; + + const id = userData.importIds[0]; + for (const user of importSelection.users) { + if (user.user_id === id) { + return user.do_import; + } + } + + return false; + } + } + + return false; + }; + + const afterImportFn = async () => { + await this.addCountCompleted(1); + + if (this.importRecord.valid === false) { + this.converter.aborted = true; + throw new Error('The import operation is no longer valid.'); + } + }; + + const afterImportAllMessagesFn = async (importedRoomIds: string[]): Promise => + api.broadcast('notify.importedMessages', { roomIds: importedRoomIds }); + + const afterBatchFn = async (successCount: number, errorCount: number) => { + if (successCount) { + await this.addCountCompleted(successCount); + } + if (errorCount) { + await this.addCountError(errorCount); + } + + if (this.importRecord.valid === false) { + this.converter.aborted = true; + throw new Error('The import operation is no longer valid.'); + } + }; + + const onErrorFn = async () => { + await this.addCountCompleted(1); + }; + + process.nextTick(async () => { + await this.backupSettingValues(); + + try { + await this.applySettingValues({}); + + await this.updateProgress(ProgressStep.IMPORTING_USERS); + const usersToImport = importSelection.users.filter((user) => user.do_import); + await callbacks.run('beforeUserImport', { userCount: usersToImport.length }); + await this.converter.convertUsers({ beforeImportFn, afterImportFn, onErrorFn, afterBatchFn }); + + await this.updateProgress(ProgressStep.IMPORTING_CHANNELS); + await this.converter.convertChannels(startedByUserId, { beforeImportFn, afterImportFn, onErrorFn }); + + await this.updateProgress(ProgressStep.IMPORTING_MESSAGES); + await this.converter.convertMessages({ afterImportFn, onErrorFn, afterImportAllMessagesFn }); + + await this.updateProgress(ProgressStep.FINISHING); + + process.nextTick(async () => { + await this.converter.clearSuccessfullyImportedData(); + }); + + await this.updateProgress(ProgressStep.DONE); + } catch (e) { + this.logger.error(e); + await this.updateProgress(ProgressStep.ERROR); + } finally { + await this.applySettingValues(this.oldSettings); + } + + const timeTook = Date.now() - started; + this.logger.log(`Import took ${timeTook} milliseconds.`); + }); + + return this.getProgress(); + } + + async backupSettingValues() { + const allowUsernameChange = (await Settings.findOneById('Accounts_AllowUsernameChange'))?.value as boolean | null; + const maxFileSize = (await Settings.findOneById('FileUpload_MaxFileSize'))?.value as number | null; + const mediaTypeWhiteList = (await Settings.findOneById('FileUpload_MediaTypeWhiteList'))?.value as string | null; + const mediaTypeBlackList = (await Settings.findOneById('FileUpload_MediaTypeBlackList'))?.value as string | null; + + this.oldSettings = { + allowUsernameChange, + maxFileSize, + mediaTypeWhiteList, + mediaTypeBlackList, + }; + } + + async applySettingValues(settingValues: OldSettings) { + await Settings.updateValueById('Accounts_AllowUsernameChange', settingValues.allowUsernameChange ?? true); + await Settings.updateValueById('FileUpload_MaxFileSize', settingValues.maxFileSize ?? -1); + await Settings.updateValueById('FileUpload_MediaTypeWhiteList', settingValues.mediaTypeWhiteList ?? '*'); + await Settings.updateValueById('FileUpload_MediaTypeBlackList', settingValues.mediaTypeBlackList ?? ''); + } + + getProgress(): ImporterProgress { + return this.progress; + } + + /** + * Updates the progress step of this importer. + * It also changes some internal settings at various stages of the import. + * This way the importer can adjust user/room information at will. + * + * @param {ProgressStep} step The progress step which this import is currently at. + * @returns {ImporterProgress} The progress record of the import. + */ + async updateProgress(step: IImportProgress['step']): Promise { + this.progress.step = step; + + this.logger.debug(`${this.info.name} is now at ${step}.`); + await this.updateRecord({ status: this.progress.step }); + + // Do not send the default progress report during the preparing stage - the classes are sending their own report in a different format. + if (!ImportPreparingStartedStates.includes(this.progress.step)) { + this.reportProgress(); + } + + return this.progress; + } + + reloadCount() { + this.progress.count.total = this.importRecord.count?.total || 0; + this.progress.count.completed = this.importRecord.count?.completed || 0; + this.progress.count.error = this.importRecord.count?.error || 0; + } + + /** + * Adds the passed in value to the total amount of items needed to complete. + * + * @param {number} count The amount to add to the total count of items. + * @returns {ImporterProgress} The progress record of the import. + */ + async addCountToTotal(count: number): Promise { + this.progress.count.total += count; + await this.updateRecord({ 'count.total': this.progress.count.total }); + + return this.progress; + } + + /** + * Adds the passed in value to the total amount of items completed. + * + * @param {number} count The amount to add to the total count of finished items. + * @returns {ImporterProgress} The progress record of the import. + */ + async addCountCompleted(count: number): Promise { + this.progress.count.completed += count; + + return this.maybeUpdateRecord(); + } + + async addCountError(count: number): Promise { + this.progress.count.error += count; + + return this.maybeUpdateRecord(); + } + + async maybeUpdateRecord() { + // Only update the database every 500 messages (or 50 for users/channels) + // Or the completed is greater than or equal to the total amount + const count = this.progress.count.completed + this.progress.count.error; + const range = ([ProgressStep.IMPORTING_USERS, ProgressStep.IMPORTING_CHANNELS] as IImportProgress['step'][]).includes( + this.progress.step, + ) + ? 50 + : 500; + + if (count % range === 0 || count >= this.progress.count.total || count - this._lastProgressReportTotal > range) { + this._lastProgressReportTotal = this.progress.count.completed + this.progress.count.error; + await this.updateRecord({ 'count.completed': this.progress.count.completed, 'count.error': this.progress.count.error }); + this.reportProgress(); + } else if (!this._reportProgressHandler) { + this._reportProgressHandler = setTimeout(() => { + this.reportProgress(); + }, 250); + } + + this.logger.log(`${this.progress.count.completed} records imported, ${this.progress.count.error} failed`); + + return this.progress; + } + + /** + * Sends an updated progress to the websocket + */ + reportProgress() { + if (this._reportProgressHandler) { + clearTimeout(this._reportProgressHandler); + this._reportProgressHandler = undefined; + } + ImporterWebsocket.progressUpdated(this.progress); + } + + /** + * Updates the import record with the given fields being `set`. + */ + async updateRecord(fields: MatchKeysAndValues): Promise { + if (!this.importRecord) { + return this.importRecord; + } + + await Imports.update({ _id: this.importRecord._id }, { $set: fields }); + // #TODO: Remove need for the typecast + this.importRecord = (await Imports.findOne(this.importRecord._id)) as IImport; + + return this.importRecord; + } + + async buildSelection(): Promise { + await this.updateProgress(ProgressStep.USER_SELECTION); + + const users = await ImportData.getAllUsersForSelection(); + const channels = await ImportData.getAllChannelsForSelection(); + const hasDM = await ImportData.checkIfDirectMessagesExists(); + + const selectionUsers = users.map( + (u) => + new SelectionUser(u.data.importIds[0], u.data.username, u.data.emails[0], Boolean(u.data.deleted), u.data.type === 'bot', true), + ); + const selectionChannels = channels.map( + (c) => new SelectionChannel(c.data.importIds[0], c.data.name, Boolean(c.data.archived), true, c.data.t === 'p', c.data.t === 'd'), + ); + const selectionMessages = await ImportData.countMessages(); + + if (hasDM) { + selectionChannels.push(new SelectionChannel('__directMessages__', t('Direct_Messages'), false, true, true, true)); + } + + const results = new Selection(this.info.name, selectionUsers, selectionChannels, selectionMessages); + + return results; + } + + /** + * Utility method to check if the passed in error is a `MongoServerError` with the `codeName` of `'CursorNotFound'`. + */ + protected isCursorNotFoundError(error: unknown): error is MongoServerError & { codeName: 'CursorNotFound' } { + return typeof error === 'object' && error !== null && 'codeName' in error && error.codeName === 'CursorNotFound'; + } +} diff --git a/apps/meteor/app/importer/server/classes/ImporterBase.js b/apps/meteor/app/importer/server/classes/ImporterBase.js deleted file mode 100644 index 061644130a66..000000000000 --- a/apps/meteor/app/importer/server/classes/ImporterBase.js +++ /dev/null @@ -1,375 +0,0 @@ -import { Logger } from '@rocket.chat/logger'; -import { Settings, ImportData, Imports } from '@rocket.chat/models'; -import AdmZip from 'adm-zip'; - -import { Selection, SelectionChannel, SelectionUser } from '..'; -import { callbacks } from '../../../../lib/callbacks'; -import { t } from '../../../utils/lib/i18n'; -import { ImporterInfo } from '../../lib/ImporterInfo'; -import { ProgressStep, ImportPreparingStartedStates } from '../../lib/ImporterProgressStep'; -import { ImportDataConverter } from './ImportDataConverter'; -import { Progress } from './ImporterProgress'; -import { ImporterWebsocket } from './ImporterWebsocket'; - -/** - * Base class for all of the importers. - */ -export class Base { - constructor(info, importRecord, converterOptions = {}) { - if (!(info instanceof ImporterInfo)) { - throw new Error('Information passed in must be a valid ImporterInfo instance.'); - } - - this.AdmZip = AdmZip; - this.converter = new ImportDataConverter(converterOptions); - - this.startImport = this.startImport.bind(this); - this.getProgress = this.getProgress.bind(this); - this.updateProgress = this.updateProgress.bind(this); - this.addCountToTotal = this.addCountToTotal.bind(this); - this.addCountCompleted = this.addCountCompleted.bind(this); - this.updateRecord = this.updateRecord.bind(this); - - this.info = info; - - this.logger = new Logger(`${this.info.name} Importer`); - this.converter.setLogger(this.logger); - - this.importRecord = importRecord; - this.progress = new Progress(this.info.key, this.info.name); - this.users = {}; - this.channels = {}; - this.messages = {}; - this.oldSettings = {}; - - this.progress.step = this.importRecord.status; - this._lastProgressReportTotal = 0; - this.reloadCount(); - } - - /** - * Registers the file name and content type on the import operation - * - * @param {string} fileName The name of the uploaded file. - * @param {string} contentType The sent file type. - * @returns {Progress} The progress record of the import. - */ - async startFileUpload(fileName, contentType) { - await this.updateProgress(ProgressStep.UPLOADING); - return this.updateRecord({ file: fileName, contentType }); - } - - /** - * Takes the uploaded file and extracts the users, channels, and messages from it. - * - * @param {string} fullFilePath the full path of the uploaded file - * @returns {Progress} The progress record of the import. - */ - async prepareUsingLocalFile() { - return this.updateProgress(ProgressStep.PREPARING_STARTED); - } - - /** - * Starts the import process. The implementing method should defer - * as soon as the selection is set, so the user who started the process - * doesn't end up with a "locked" UI while Meteor waits for a response. - * The returned object should be the progress. - * - * @param {Selection} importSelection The selection data. - * @returns {Progress} The progress record of the import. - */ - async startImport(importSelection, startedByUserId) { - if (!(importSelection instanceof Selection)) { - throw new Error(`Invalid Selection data provided to the ${this.info.name} importer.`); - } else if (importSelection.users === undefined) { - throw new Error(`Users in the selected data wasn't found, it must but at least an empty array for the ${this.info.name} importer.`); - } else if (importSelection.channels === undefined) { - throw new Error( - `Channels in the selected data wasn't found, it must but at least an empty array for the ${this.info.name} importer.`, - ); - } - - if (!startedByUserId) { - throw new Error('You must be logged in to do this.'); - } - - await this.updateProgress(ProgressStep.IMPORTING_STARTED); - this.reloadCount(); - const started = Date.now(); - - const beforeImportFn = async ({ data, dataType: type }) => { - if (this.importRecord.valid === false) { - this.converter.aborted = true; - throw new Error('The import operation is no longer valid.'); - } - - switch (type) { - case 'channel': { - const id = data.t === 'd' ? '__directMessages__' : data.importIds[0]; - for (const channel of importSelection.channels) { - if (channel.channel_id === id) { - return channel.do_import; - } - } - - return false; - } - case 'user': { - // #TODO: Replace this workaround in the final version of the API importer - if (importSelection.users.length === 0 && this.info.key === 'api') { - return true; - } - - const id = data.importIds[0]; - for (const user of importSelection.users) { - if (user.user_id === id) { - return user.do_import; - } - } - - return false; - } - } - - return false; - }; - - const afterImportFn = async () => { - await this.addCountCompleted(1); - - if (this.importRecord.valid === false) { - this.converter.aborted = true; - throw new Error('The import operation is no longer valid.'); - } - }; - - const afterBatchFn = async (successCount, errorCount) => { - if (successCount) { - await this.addCountCompleted(successCount); - } - if (errorCount) { - await this.addCountError(errorCount); - } - - if (this.importRecord.valid === false) { - this.converter.aborted = true; - throw new Error('The import operation is no longer valid.'); - } - }; - - const onErrorFn = async () => { - await this.addCountCompleted(1); - }; - - process.nextTick(async () => { - await this.backupSettingValues(); - - try { - await this.applySettingValues({}); - - await this.updateProgress(ProgressStep.IMPORTING_USERS); - const usersToImport = importSelection.users.filter((user) => user.do_import); - await callbacks.run('beforeUserImport', { userCount: usersToImport.length }); - await this.converter.convertUsers({ beforeImportFn, afterImportFn, onErrorFn, afterBatchFn }); - - await this.updateProgress(ProgressStep.IMPORTING_CHANNELS); - await this.converter.convertChannels(startedByUserId, { beforeImportFn, afterImportFn, onErrorFn }); - - await this.updateProgress(ProgressStep.IMPORTING_MESSAGES); - await this.converter.convertMessages({ afterImportFn, onErrorFn }); - - await this.updateProgress(ProgressStep.FINISHING); - - process.nextTick(async () => { - await this.converter.clearSuccessfullyImportedData(); - }); - - await this.updateProgress(ProgressStep.DONE); - } catch (e) { - this.logger.error(e); - await this.updateProgress(ProgressStep.ERROR); - } finally { - await this.applySettingValues(this.oldSettings); - } - - const timeTook = Date.now() - started; - this.logger.log(`Import took ${timeTook} milliseconds.`); - }); - - return this.getProgress(); - } - - async backupSettingValues() { - const allowUsernameChange = await Settings.findOneById('Accounts_AllowUsernameChange').value; - const maxFileSize = await Settings.findOneById('FileUpload_MaxFileSize').value; - const mediaTypeWhiteList = await Settings.findOneById('FileUpload_MediaTypeWhiteList').value; - const mediaTypeBlackList = await Settings.findOneById('FileUpload_MediaTypeBlackList').value; - - this.oldSettings = { - allowUsernameChange, - maxFileSize, - mediaTypeWhiteList, - mediaTypeBlackList, - }; - } - - async applySettingValues(settingValues) { - await Settings.updateValueById('Accounts_AllowUsernameChange', settingValues.allowUsernameChange ?? true); - await Settings.updateValueById('FileUpload_MaxFileSize', settingValues.maxFileSize ?? -1); - await Settings.updateValueById('FileUpload_MediaTypeWhiteList', settingValues.mediaTypeWhiteList ?? '*'); - await Settings.updateValueById('FileUpload_MediaTypeBlackList', settingValues.mediaTypeBlackList ?? ''); - } - - /** - * Gets the progress of this import. - * - * @returns {Progress} The progress record of the import. - */ - getProgress() { - return this.progress; - } - - /** - * Updates the progress step of this importer. - * It also changes some internal settings at various stages of the import. - * This way the importer can adjust user/room information at will. - * - * @param {ProgressStep} step The progress step which this import is currently at. - * @returns {Progress} The progress record of the import. - */ - async updateProgress(step) { - this.progress.step = step; - - this.logger.debug(`${this.info.name} is now at ${step}.`); - await this.updateRecord({ status: this.progress.step }); - - // Do not send the default progress report during the preparing stage - the classes are sending their own report in a different format. - if (!ImportPreparingStartedStates.includes(this.progress.step)) { - this.reportProgress(); - } - - return this.progress; - } - - reloadCount() { - if (!this.importRecord.count) { - this.progress.count.total = 0; - this.progress.count.completed = 0; - this.progress.count.error = 0; - } - - this.progress.count.total = this.importRecord.count?.total || 0; - this.progress.count.completed = this.importRecord.count?.completed || 0; - this.progress.count.error = this.importRecord.count?.error || 0; - } - - /** - * Adds the passed in value to the total amount of items needed to complete. - * - * @param {number} count The amount to add to the total count of items. - * @returns {Progress} The progress record of the import. - */ - async addCountToTotal(count) { - this.progress.count.total += count; - await this.updateRecord({ 'count.total': this.progress.count.total }); - - return this.progress; - } - - /** - * Adds the passed in value to the total amount of items completed. - * - * @param {number} count The amount to add to the total count of finished items. - * @returns {Progress} The progress record of the import. - */ - async addCountCompleted(count) { - this.progress.count.completed += count; - - return this.maybeUpdateRecord(); - } - - async addCountError(count) { - this.progress.count.error += count; - - return this.maybeUpdateRecord(); - } - - async maybeUpdateRecord() { - // Only update the database every 500 messages (or 50 for users/channels) - // Or the completed is greater than or equal to the total amount - const count = this.progress.count.completed + this.progress.count.error; - const range = [ProgressStep.IMPORTING_USERS, ProgressStep.IMPORTING_CHANNELS].includes(this.progress.step) ? 50 : 500; - - if (count % range === 0 || count >= this.progress.count.total || count - this._lastProgressReportTotal > range) { - this._lastProgressReportTotal = this.progress.count.completed + this.progress.count.error; - await this.updateRecord({ 'count.completed': this.progress.count.completed, 'count.error': this.progress.count.error }); - this.reportProgress(); - } else if (!this._reportProgressHandler) { - this._reportProgressHandler = setTimeout(() => { - this.reportProgress(); - }, 250); - } - - this.logger.log(`${this.progress.count.completed} records imported, ${this.progress.count.error} failed`); - - return this.progress; - } - - /** - * Sends an updated progress to the websocket - */ - reportProgress() { - if (this._reportProgressHandler) { - clearTimeout(this._reportProgressHandler); - this._reportProgressHandler = undefined; - } - ImporterWebsocket.progressUpdated(this.progress); - } - - /** - * Updates the import record with the given fields being `set`. - * - * @param {any} fields The fields to set, it should be an object with key/values. - * @returns {Imports} The import record. - */ - async updateRecord(fields) { - await Imports.update({ _id: this.importRecord._id }, { $set: fields }); - this.importRecord = await Imports.findOne(this.importRecord._id); - - return this.importRecord; - } - - async buildSelection() { - await this.updateProgress(ProgressStep.USER_SELECTION); - - const users = await ImportData.getAllUsersForSelection(); - const channels = await ImportData.getAllChannelsForSelection(); - const hasDM = await ImportData.checkIfDirectMessagesExists(); - - const selectionUsers = users.map( - (u) => - new SelectionUser(u.data.importIds[0], u.data.username, u.data.emails[0], Boolean(u.data.deleted), u.data.type === 'bot', true), - ); - const selectionChannels = channels.map( - (c) => - new SelectionChannel( - c.data.importIds[0], - c.data.name, - Boolean(c.data.archived), - true, - c.data.t === 'p', - undefined, - c.data.t === 'd', - ), - ); - const selectionMessages = await ImportData.countMessages(); - - if (hasDM) { - selectionChannels.push(new SelectionChannel('__directMessages__', t('Direct_Messages'), false, true, true, undefined, true)); - } - - const results = new Selection(this.info.name, selectionUsers, selectionChannels, selectionMessages); - - return results; - } -} diff --git a/apps/meteor/app/importer/server/classes/ImporterProgress.js b/apps/meteor/app/importer/server/classes/ImporterProgress.js deleted file mode 100644 index 7bb49c50c4c2..000000000000 --- a/apps/meteor/app/importer/server/classes/ImporterProgress.js +++ /dev/null @@ -1,16 +0,0 @@ -import { ProgressStep } from '../../lib/ImporterProgressStep'; - -export class Progress { - /** - * Creates a new progress container for the importer. - * - * @param {string} key The unique key of the importer. - * @param {string} name The name of the importer. - */ - constructor(key, name) { - this.key = key; - this.name = name; - this.step = ProgressStep.NEW; - this.count = { completed: 0, total: 0 }; - } -} diff --git a/apps/meteor/app/importer/server/classes/ImporterProgress.ts b/apps/meteor/app/importer/server/classes/ImporterProgress.ts new file mode 100644 index 000000000000..ff59a5eb20b1 --- /dev/null +++ b/apps/meteor/app/importer/server/classes/ImporterProgress.ts @@ -0,0 +1,30 @@ +import type { IImportProgress } from '@rocket.chat/core-typings'; + +import { ProgressStep } from '../../lib/ImporterProgressStep'; + +export class ImporterProgress implements IImportProgress { + public key: string; + + public name: string; + + public step: IImportProgress['step']; + + public count: { + completed: number; + total: number; + error: number; + }; + + /** + * Creates a new progress container for the importer. + * + * @param {string} key The unique key of the importer. + * @param {string} name The name of the importer. + */ + constructor(key: string, name: string) { + this.key = key; + this.name = name; + this.step = ProgressStep.NEW; + this.count = { completed: 0, total: 0, error: 0 }; + } +} diff --git a/apps/meteor/app/importer/server/classes/ImporterSelection.js b/apps/meteor/app/importer/server/classes/ImporterSelection.js deleted file mode 100644 index f3e055e9fb75..000000000000 --- a/apps/meteor/app/importer/server/classes/ImporterSelection.js +++ /dev/null @@ -1,16 +0,0 @@ -export class Selection { - /** - * Constructs a new importer selection object. - * - * @param {string} name the name of the importer - * @param {SelectionUser[]} users the users which can be selected - * @param {SelectionChannel[]} channels the channels which can be selected - * @param {number} message_count the number of messages - */ - constructor(name, users, channels, message_count) { - this.name = name; - this.users = users; - this.channels = channels; - this.message_count = message_count; - } -} diff --git a/apps/meteor/app/importer/server/classes/ImporterSelection.ts b/apps/meteor/app/importer/server/classes/ImporterSelection.ts new file mode 100644 index 000000000000..107dbbf9c824 --- /dev/null +++ b/apps/meteor/app/importer/server/classes/ImporterSelection.ts @@ -0,0 +1,26 @@ +import type { IImporterSelection, IImporterSelectionChannel, IImporterSelectionUser } from '@rocket.chat/core-typings'; + +export class ImporterSelection implements IImporterSelection { + public name: string; + + public users: IImporterSelectionUser[]; + + public channels: IImporterSelectionChannel[]; + + public message_count: number; + + /** + * Constructs a new importer selection object. + * + * @param name the name of the importer + * @param users the users which can be selected + * @param channels the channels which can be selected + * @param messageCount the number of messages + */ + constructor(name: string, users: IImporterSelectionUser[], channels: IImporterSelectionChannel[], messageCount: number) { + this.name = name; + this.users = users; + this.channels = channels; + this.message_count = messageCount; + } +} diff --git a/apps/meteor/app/importer/server/classes/ImporterSelectionChannel.js b/apps/meteor/app/importer/server/classes/ImporterSelectionChannel.js deleted file mode 100644 index deb23849f108..000000000000 --- a/apps/meteor/app/importer/server/classes/ImporterSelectionChannel.js +++ /dev/null @@ -1,22 +0,0 @@ -export class SelectionChannel { - /** - * Constructs a new selection channel. - * - * @param {string} channel_id the unique identifier of the channel - * @param {string} name the name of the channel - * @param {boolean} is_archived whether the channel was archived or not - * @param {boolean} do_import whether we will be importing the channel or not - * @param {boolean} is_private whether the channel is private or public - * @param {int} creator the id of the channel owner - * @param {boolean} is_direct whether the channel represents direct messages - */ - constructor(channel_id, name, is_archived, do_import, is_private, creator, is_direct) { - this.channel_id = channel_id; - this.name = name; - this.is_archived = is_archived; - this.do_import = do_import; - this.is_private = is_private; - this.creator = creator; - this.is_direct = is_direct; - } -} diff --git a/apps/meteor/app/importer/server/classes/ImporterSelectionChannel.ts b/apps/meteor/app/importer/server/classes/ImporterSelectionChannel.ts new file mode 100644 index 000000000000..359a18de5a6c --- /dev/null +++ b/apps/meteor/app/importer/server/classes/ImporterSelectionChannel.ts @@ -0,0 +1,34 @@ +import type { IImporterSelectionChannel } from '@rocket.chat/core-typings'; + +export class SelectionChannel implements IImporterSelectionChannel { + public channel_id: string; + + public name: string | undefined; + + public is_archived: boolean; + + public do_import: boolean; + + public is_private: boolean; + + public is_direct: boolean; + + public creator: undefined; + + /** + * Constructs a new selection channel. + * + * @param channelId the unique identifier of the channel + * @param name the name of the channel + * @param isArchived whether the channel was archived or not + * @param doImport whether we will be importing the channel or not + */ + constructor(channelId: string, name: string | undefined, isArchived: boolean, doImport: boolean, isPrivate: boolean, isDirect: boolean) { + this.channel_id = channelId; + this.name = name; + this.is_archived = isArchived; + this.do_import = doImport; + this.is_private = isPrivate; + this.is_direct = isDirect; + } +} diff --git a/apps/meteor/app/importer/server/classes/ImporterSelectionUser.js b/apps/meteor/app/importer/server/classes/ImporterSelectionUser.js deleted file mode 100644 index 7d243fde3dde..000000000000 --- a/apps/meteor/app/importer/server/classes/ImporterSelectionUser.js +++ /dev/null @@ -1,22 +0,0 @@ -export class SelectionUser { - /** - * Constructs a new selection user. - * - * @param {string} user_id the unique user identifier - * @param {string} username the user's username - * @param {string} email the user's email - * @param {boolean} is_deleted whether the user was deleted or not - * @param {boolean} is_bot whether the user is a bot or not - * @param {boolean} do_import whether we are going to import this user or not - * @param {boolean} is_email_taken whether there's an existing user with the same email - */ - constructor(user_id, username, email, is_deleted, is_bot, do_import, is_email_taken = false) { - this.user_id = user_id; - this.username = username; - this.email = email; - this.is_deleted = is_deleted; - this.is_bot = is_bot; - this.do_import = do_import; - this.is_email_taken = is_email_taken; - } -} diff --git a/apps/meteor/app/importer/server/classes/ImporterSelectionUser.ts b/apps/meteor/app/importer/server/classes/ImporterSelectionUser.ts new file mode 100644 index 000000000000..5dc9cb91b4c4 --- /dev/null +++ b/apps/meteor/app/importer/server/classes/ImporterSelectionUser.ts @@ -0,0 +1,46 @@ +import type { IImporterSelectionUser } from '@rocket.chat/core-typings'; + +export class SelectionUser implements IImporterSelectionUser { + public user_id: string; + + public username: string | undefined; + + public email: string; + + public is_deleted: boolean; + + public is_bot: boolean; + + public do_import: boolean; + + public is_email_taken: boolean; + + /** + * Constructs a new selection user. + * + * @param userId the unique user identifier + * @param username the user's username + * @param email the user's email + * @param isDeleted whether the user was deleted or not + * @param isBot whether the user is a bot or not + * @param doImport whether we are going to import this user or not + * @param isEmailTaken whether there's an existing user with the same email + */ + constructor( + userId: string, + username: string | undefined, + email: string, + isDeleted: boolean, + isBot: boolean, + doImport: boolean, + isEmailTaken = false, + ) { + this.user_id = userId; + this.username = username; + this.email = email; + this.is_deleted = isDeleted; + this.is_bot = isBot; + this.do_import = doImport; + this.is_email_taken = isEmailTaken; + } +} diff --git a/apps/meteor/app/importer/server/classes/ImporterWebsocket.js b/apps/meteor/app/importer/server/classes/ImporterWebsocket.js deleted file mode 100644 index ba067fda3867..000000000000 --- a/apps/meteor/app/importer/server/classes/ImporterWebsocket.js +++ /dev/null @@ -1,18 +0,0 @@ -import notifications from '../../../notifications/server/lib/Notifications'; - -class ImporterWebsocketDef { - constructor() { - this.streamer = notifications.streamImporters; - } - - /** - * Called when the progress is updated. - * - * @param {Progress} progress The progress of the import. - */ - progressUpdated(progress) { - this.streamer.emit('progress', progress); - } -} - -export const ImporterWebsocket = new ImporterWebsocketDef(); diff --git a/apps/meteor/app/importer/server/classes/ImporterWebsocket.ts b/apps/meteor/app/importer/server/classes/ImporterWebsocket.ts new file mode 100644 index 000000000000..a08e62f8435c --- /dev/null +++ b/apps/meteor/app/importer/server/classes/ImporterWebsocket.ts @@ -0,0 +1,23 @@ +import type { IImportProgress } from '@rocket.chat/core-typings'; +import type { IStreamer } from 'meteor/rocketchat:streamer'; + +import notifications from '../../../notifications/server/lib/Notifications'; + +class ImporterWebsocketDef { + private streamer: IStreamer<'importers'>; + + constructor() { + this.streamer = notifications.streamImporters; + } + + /** + * Called when the progress is updated. + * + * @param {Progress} progress The progress of the import. + */ + progressUpdated(progress: { rate: number } | IImportProgress) { + this.streamer.emit('progress', progress); + } +} + +export const ImporterWebsocket = new ImporterWebsocketDef(); diff --git a/apps/meteor/app/importer/server/classes/ImportersContainer.ts b/apps/meteor/app/importer/server/classes/ImportersContainer.ts new file mode 100644 index 000000000000..97c98701e49e --- /dev/null +++ b/apps/meteor/app/importer/server/classes/ImportersContainer.ts @@ -0,0 +1,27 @@ +import type { ImporterInfo } from '../definitions/ImporterInfo'; + +/** Container class which holds all of the importer details. */ +export class ImportersContainer { + private importers: Map; + + constructor() { + this.importers = new Map(); + } + + add({ key, name, importer, visible }: Omit & { visible?: boolean }) { + this.importers.set(key, { + key, + name, + visible: visible !== false, + importer, + }); + } + + get(key: string): ImporterInfo | undefined { + return this.importers.get(key); + } + + getAllVisible(): ImporterInfo[] { + return Array.from(this.importers.values()).filter(({ visible }) => visible); + } +} diff --git a/apps/meteor/app/importer/server/definitions/ImporterInfo.ts b/apps/meteor/app/importer/server/definitions/ImporterInfo.ts new file mode 100644 index 000000000000..4741b3b70f2d --- /dev/null +++ b/apps/meteor/app/importer/server/definitions/ImporterInfo.ts @@ -0,0 +1,10 @@ +import type { RocketchatI18nKeys } from '@rocket.chat/i18n'; + +import type { Importer } from '../classes/Importer'; + +export type ImporterInfo = { + key: string; + name: RocketchatI18nKeys; + visible: boolean; // Determines if this importer can be selected by the user in the New Import screen. + importer: typeof Importer; +}; diff --git a/apps/meteor/app/importer/server/index.ts b/apps/meteor/app/importer/server/index.ts index 8d7d872455c0..02949733174c 100644 --- a/apps/meteor/app/importer/server/index.ts +++ b/apps/meteor/app/importer/server/index.ts @@ -1,16 +1,21 @@ -import { ImporterInfo } from '../lib/ImporterInfo'; import { ProgressStep } from '../lib/ImporterProgressStep'; -import { Importers } from '../lib/Importers'; -import { Base } from './classes/ImporterBase'; -import { Selection } from './classes/ImporterSelection'; +import { Importer } from './classes/Importer'; +import { ImporterSelection } from './classes/ImporterSelection'; import { SelectionChannel } from './classes/ImporterSelectionChannel'; import { SelectionUser } from './classes/ImporterSelectionUser'; import { ImporterWebsocket } from './classes/ImporterWebsocket'; +import { ImportersContainer } from './classes/ImportersContainer'; import './methods'; import './startup/setImportsToInvalid'; import './startup/store'; -// Adding a link to the base class using the 'api' key. This won't be needed in the new importer structure implemented on the parallel PR -Importers.add(new ImporterInfo('api', 'API', ''), Base); +export { Importer, ImporterWebsocket, ProgressStep, ImporterSelection as Selection, SelectionChannel, SelectionUser }; -export { Base, Importers, ImporterWebsocket, ProgressStep, Selection, SelectionChannel, SelectionUser }; +export const Importers = new ImportersContainer(); + +Importers.add({ + key: 'api', + name: 'API', + visible: false, + importer: Importer, +}); diff --git a/apps/meteor/app/importer/server/methods/downloadPublicImportFile.ts b/apps/meteor/app/importer/server/methods/downloadPublicImportFile.ts index dc92901435ea..81e06ec8eb0f 100644 --- a/apps/meteor/app/importer/server/methods/downloadPublicImportFile.ts +++ b/apps/meteor/app/importer/server/methods/downloadPublicImportFile.ts @@ -35,14 +35,12 @@ export const executeDownloadPublicImportFile = async (userId: IUser['_id'], file ); } // Check if it's a valid url or path before creating a new import record - if (!isUrl) { - if (!fs.existsSync(fileUrl)) { - throw new Meteor.Error('error-import-file-missing', fileUrl, 'downloadPublicImportFile'); - } + if (!isUrl && !fs.existsSync(fileUrl)) { + throw new Meteor.Error('error-import-file-missing', fileUrl, 'downloadPublicImportFile'); } const operation = await Import.newOperation(userId, importer.name, importer.key); - importer.instance = new importer.importer(importer, operation); // eslint-disable-line new-cap + const instance = new importer.importer(importer, operation); // eslint-disable-line new-cap const oldFileName = fileUrl.substring(fileUrl.lastIndexOf('/') + 1).split('?')[0]; const date = new Date(); @@ -50,17 +48,17 @@ export const executeDownloadPublicImportFile = async (userId: IUser['_id'], file const newFileName = `${dateStr}_${userId}_${oldFileName}`; // Store the file name on the imports collection - await importer.instance.startFileUpload(newFileName); - await importer.instance.updateProgress(ProgressStep.DOWNLOADING_FILE); + await instance.startFileUpload(newFileName); + await instance.updateProgress(ProgressStep.DOWNLOADING_FILE); const writeStream = RocketChatImportFileInstance.createWriteStream(newFileName); writeStream.on('error', () => { - void importer.instance.updateProgress(ProgressStep.ERROR); + void instance.updateProgress(ProgressStep.ERROR); }); writeStream.on('end', () => { - void importer.instance.updateProgress(ProgressStep.FILE_LOADED); + void instance.updateProgress(ProgressStep.FILE_LOADED); }); if (isUrl) { @@ -68,8 +66,8 @@ export const executeDownloadPublicImportFile = async (userId: IUser['_id'], file } else { // If the url is actually a folder path on the current machine, skip moving it to the file store if (fs.statSync(fileUrl).isDirectory()) { - await importer.instance.updateRecord({ file: fileUrl }); - await importer.instance.updateProgress(ProgressStep.FILE_LOADED); + await instance.updateRecord({ file: fileUrl }); + await instance.updateProgress(ProgressStep.FILE_LOADED); return; } diff --git a/apps/meteor/app/importer/server/methods/getImportFileData.ts b/apps/meteor/app/importer/server/methods/getImportFileData.ts index cf81e3074da5..03f9a53abe6c 100644 --- a/apps/meteor/app/importer/server/methods/getImportFileData.ts +++ b/apps/meteor/app/importer/server/methods/getImportFileData.ts @@ -1,7 +1,7 @@ import fs from 'fs'; import path from 'path'; -import type { IImportFileData } from '@rocket.chat/core-typings'; +import type { IImportProgress, IImporterSelection } from '@rocket.chat/core-typings'; import { Imports } from '@rocket.chat/models'; import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; @@ -11,7 +11,7 @@ import { hasPermissionAsync } from '../../../authorization/server/functions/hasP import { ProgressStep } from '../../lib/ImporterProgressStep'; import { RocketChatImportFileInstance } from '../startup/store'; -export const executeGetImportFileData = async (): Promise => { +export const executeGetImportFileData = async (): Promise => { const operation = await Imports.findLastImport(); if (!operation) { throw new Meteor.Error('error-operation-not-found', 'Import Operation Not Found', 'getImportFileData'); @@ -24,9 +24,9 @@ export const executeGetImportFileData = async (): Promise= 0) { - if (importer.instance.importRecord?.valid) { + if (waitingSteps.indexOf(instance.progress.step) >= 0) { + if (instance.importRecord?.valid) { return { waiting: true }; } throw new Meteor.Error('error-import-operation-invalid', 'Invalid Import Operation', 'getImportFileData'); } - const readySteps = [ProgressStep.USER_SELECTION, ProgressStep.DONE, ProgressStep.CANCELLED, ProgressStep.ERROR]; + const readySteps: IImportProgress['step'][] = [ + ProgressStep.USER_SELECTION, + ProgressStep.DONE, + ProgressStep.CANCELLED, + ProgressStep.ERROR, + ]; + + if (readySteps.indexOf(instance.progress.step) >= 0) { + return instance.buildSelection(); + } - if (readySteps.indexOf(importer.instance.progress.step) >= 0) { - return importer.instance.buildSelection(); + const fileName = instance.importRecord.file; + if (fileName) { + const fullFilePath = fs.existsSync(fileName) ? fileName : path.join(RocketChatImportFileInstance.absolutePath, fileName); + await instance.prepareUsingLocalFile(fullFilePath); } - const fileName = importer.instance.importRecord.file; - const fullFilePath = fs.existsSync(fileName) ? fileName : path.join(RocketChatImportFileInstance.absolutePath, fileName); - await importer.instance.prepareUsingLocalFile(fullFilePath); - return importer.instance.buildSelection(); + return instance.buildSelection(); }; declare module '@rocket.chat/ui-contexts' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { - getImportFileData(): IImportFileData | { waiting: true }; + getImportFileData(): IImporterSelection | { waiting: true }; } } diff --git a/apps/meteor/app/importer/server/methods/getImportProgress.ts b/apps/meteor/app/importer/server/methods/getImportProgress.ts index cdce1da395d7..c03bc44b056d 100644 --- a/apps/meteor/app/importer/server/methods/getImportProgress.ts +++ b/apps/meteor/app/importer/server/methods/getImportProgress.ts @@ -18,9 +18,9 @@ export const executeGetImportProgress = async (): Promise => { throw new Meteor.Error('error-importer-not-defined', `The importer (${importerKey}) has no import class defined.`, 'getImportProgress'); } - importer.instance = new importer.importer(importer, operation); // eslint-disable-line new-cap + const instance = new importer.importer(importer, operation); // eslint-disable-line new-cap - return importer.instance.getProgress(); + return instance.getProgress(); }; declare module '@rocket.chat/ui-contexts' { diff --git a/apps/meteor/app/importer/server/methods/startImport.ts b/apps/meteor/app/importer/server/methods/startImport.ts index fda135b4fba7..af91295ede29 100644 --- a/apps/meteor/app/importer/server/methods/startImport.ts +++ b/apps/meteor/app/importer/server/methods/startImport.ts @@ -19,25 +19,17 @@ export const executeStartImport = async ({ input }: StartImportParamsPOST, start throw new Meteor.Error('error-importer-not-defined', `The importer (${importerKey}) has no import class defined.`, 'startImport'); } - importer.instance = new importer.importer(importer, operation); // eslint-disable-line new-cap + const instance = new importer.importer(importer, operation); // eslint-disable-line new-cap const usersSelection = input.users.map( (user) => new SelectionUser(user.user_id, user.username, user.email, user.is_deleted, user.is_bot, user.do_import), ); const channelsSelection = input.channels.map( (channel) => - new SelectionChannel( - channel.channel_id, - channel.name, - channel.is_archived, - channel.do_import, - channel.is_private, - channel.creator, - channel.is_direct, - ), + new SelectionChannel(channel.channel_id, channel.name, channel.is_archived, channel.do_import, channel.is_private, channel.is_direct), ); const selection = new Selection(importer.name, usersSelection, channelsSelection, 0); - return importer.instance.startImport(selection, startedByUserId); + await instance.startImport(selection, startedByUserId); }; declare module '@rocket.chat/ui-contexts' { diff --git a/apps/meteor/app/importer/server/methods/uploadImportFile.ts b/apps/meteor/app/importer/server/methods/uploadImportFile.ts index 68955a102b94..d6ded455793b 100644 --- a/apps/meteor/app/importer/server/methods/uploadImportFile.ts +++ b/apps/meteor/app/importer/server/methods/uploadImportFile.ts @@ -23,25 +23,36 @@ export const executeUploadImportFile = async ( const operation = await Import.newOperation(userId, importer.name, importer.key); - importer.instance = new importer.importer(importer, operation); // eslint-disable-line new-cap + const instance = new importer.importer(importer, operation); // eslint-disable-line new-cap const date = new Date(); const dateStr = `${date.getUTCFullYear()}${date.getUTCMonth()}${date.getUTCDate()}${date.getUTCHours()}${date.getUTCMinutes()}${date.getUTCSeconds()}`; const newFileName = `${dateStr}_${userId}_${fileName}`; // Store the file name and content type on the imports collection - await importer.instance.startFileUpload(newFileName, contentType); + await instance.startFileUpload(newFileName, contentType); // Save the file on the File Store const file = Buffer.from(binaryContent, 'base64'); const readStream = RocketChatFile.bufferToStream(file); const writeStream = RocketChatImportFileInstance.createWriteStream(newFileName, contentType); - writeStream.on('end', () => { - importer.instance.updateProgress(ProgressStep.FILE_LOADED); + await new Promise((resolve, reject) => { + try { + writeStream.on('end', () => { + resolve(); + }); + writeStream.on('error', (e: Error) => { + reject(e); + }); + + readStream.pipe(writeStream); + } catch (error) { + reject(error); + } }); - readStream.pipe(writeStream); + await instance.updateProgress(ProgressStep.FILE_LOADED); }; declare module '@rocket.chat/ui-contexts' { diff --git a/apps/meteor/app/integrations/lib/outgoingEvents.ts b/apps/meteor/app/integrations/lib/outgoingEvents.ts index 0beb18d0f092..17da4f89153c 100644 --- a/apps/meteor/app/integrations/lib/outgoingEvents.ts +++ b/apps/meteor/app/integrations/lib/outgoingEvents.ts @@ -1,8 +1,9 @@ import type { OutgoingIntegrationEvent } from '@rocket.chat/core-typings'; +import type { TranslationKey } from '@rocket.chat/ui-contexts'; export const outgoingEvents: Record< OutgoingIntegrationEvent, - { label: string; value: OutgoingIntegrationEvent; use: { channel: boolean; triggerWords: boolean; targetRoom: boolean } } + { label: TranslationKey; value: OutgoingIntegrationEvent; use: { channel: boolean; triggerWords: boolean; targetRoom: boolean } } > = { sendMessage: { label: 'Integrations_Outgoing_Type_SendMessage', diff --git a/apps/meteor/app/integrations/server/lib/triggerHandler.js b/apps/meteor/app/integrations/server/lib/triggerHandler.js index b5050b8c4716..07f7a3d903a2 100644 --- a/apps/meteor/app/integrations/server/lib/triggerHandler.js +++ b/apps/meteor/app/integrations/server/lib/triggerHandler.js @@ -503,6 +503,7 @@ class RocketChatIntegrationHandler { { method: opts.method, headers: opts.headers, + ...(opts.timeout && { timeout: opts.timeout }), ...(opts.data && { body: opts.data }), }, settings.get('Allow_Invalid_SelfSigned_Certs'), diff --git a/apps/meteor/app/integrations/server/lib/updateHistory.ts b/apps/meteor/app/integrations/server/lib/updateHistory.ts index 9f7a3017108d..ed304403e8c7 100644 --- a/apps/meteor/app/integrations/server/lib/updateHistory.ts +++ b/apps/meteor/app/integrations/server/lib/updateHistory.ts @@ -1,4 +1,4 @@ -import type { IIntegrationHistory, IIntegration, IMessage, AtLeast } from '@rocket.chat/core-typings'; +import type { IIntegrationHistory, OutgoingIntegrationEvent, IIntegration, IMessage, AtLeast } from '@rocket.chat/core-typings'; import { IntegrationHistory } from '@rocket.chat/models'; import { Random } from '@rocket.chat/random'; @@ -26,7 +26,7 @@ export const updateHistory = async ({ historyId: IIntegrationHistory['_id']; step: IIntegrationHistory['step']; integration?: IIntegration; - event?: string; + event?: OutgoingIntegrationEvent; triggerWord?: string; ranPrepareScript?: boolean; prepareSentMessage?: { channel: string; message: Partial }[]; diff --git a/apps/meteor/app/lib/client/methods/sendMessage.ts b/apps/meteor/app/lib/client/methods/sendMessage.ts index 65da03ac0e6e..e824c9e491af 100644 --- a/apps/meteor/app/lib/client/methods/sendMessage.ts +++ b/apps/meteor/app/lib/client/methods/sendMessage.ts @@ -41,7 +41,6 @@ Meteor.methods({ return; } - message = await callbacks.run('beforeSaveMessage', message); await onClientMessageReceived(message as IMessage).then((message) => { ChatMessage.insert(message); return callbacks.run('afterSaveMessage', message, room); diff --git a/apps/meteor/app/lib/server/functions/addUserToDefaultChannels.ts b/apps/meteor/app/lib/server/functions/addUserToDefaultChannels.ts index 835f59419ad5..563022ea5a6a 100644 --- a/apps/meteor/app/lib/server/functions/addUserToDefaultChannels.ts +++ b/apps/meteor/app/lib/server/functions/addUserToDefaultChannels.ts @@ -1,15 +1,15 @@ import { Message } from '@rocket.chat/core-services'; import type { IUser } from '@rocket.chat/core-typings'; -import { Subscriptions, Rooms } from '@rocket.chat/models'; +import { Subscriptions } from '@rocket.chat/models'; import { callbacks } from '../../../../lib/callbacks'; import { getSubscriptionAutotranslateDefaultConfig } from '../../../../server/lib/getSubscriptionAutotranslateDefaultConfig'; +import { getDefaultChannels } from './getDefaultChannels'; export const addUserToDefaultChannels = async function (user: IUser, silenced?: boolean): Promise { await callbacks.run('beforeJoinDefaultChannels', user); - const defaultRooms = await Rooms.findByDefaultAndTypes(true, ['c', 'p'], { - projection: { usernames: 0 }, - }).toArray(); + const defaultRooms = await getDefaultChannels(); + for await (const room of defaultRooms) { if (!(await Subscriptions.findOneByRoomIdAndUserId(room._id, user._id, { projection: { _id: 1 } }))) { const autoTranslateConfig = getSubscriptionAutotranslateDefaultConfig(user); diff --git a/apps/meteor/app/lib/server/functions/addUserToRoom.ts b/apps/meteor/app/lib/server/functions/addUserToRoom.ts index 4e29576cf3bb..4506b659bf4d 100644 --- a/apps/meteor/app/lib/server/functions/addUserToRoom.ts +++ b/apps/meteor/app/lib/server/functions/addUserToRoom.ts @@ -1,3 +1,4 @@ +import { Apps, AppEvents } from '@rocket.chat/apps'; import { AppsEngineException } from '@rocket.chat/apps-engine/definition/exceptions'; import { Message, Team } from '@rocket.chat/core-services'; import type { IUser } from '@rocket.chat/core-typings'; @@ -5,7 +6,6 @@ import { Subscriptions, Users, Rooms } from '@rocket.chat/models'; import { Meteor } from 'meteor/meteor'; import { RoomMemberActions } from '../../../../definition/IRoomTypeConfig'; -import { AppEvents, Apps } from '../../../../ee/server/apps'; import { callbacks } from '../../../../lib/callbacks'; import { getSubscriptionAutotranslateDefaultConfig } from '../../../../server/lib/getSubscriptionAutotranslateDefaultConfig'; import { roomCoordinator } from '../../../../server/lib/rooms/roomCoordinator'; @@ -54,7 +54,7 @@ export const addUserToRoom = async function ( } try { - await Apps.triggerEvent(AppEvents.IPreRoomUserJoined, room, userToBeAdded, inviter); + await Apps.self?.triggerEvent(AppEvents.IPreRoomUserJoined, room, userToBeAdded, inviter); } catch (error: any) { if (error.name === AppsEngineException.name) { throw new Meteor.Error('error-app-prevented', error.message); @@ -118,7 +118,7 @@ export const addUserToRoom = async function ( // Keep the current event await callbacks.run('afterJoinRoom', userToBeAdded, room); - void Apps.triggerEvent(AppEvents.IPostRoomUserJoined, room, userToBeAdded, inviter); + void Apps.self?.triggerEvent(AppEvents.IPostRoomUserJoined, room, userToBeAdded, inviter); }); } diff --git a/apps/meteor/app/lib/server/functions/cleanRoomHistory.ts b/apps/meteor/app/lib/server/functions/cleanRoomHistory.ts index 64202ab39dab..133eba555a69 100644 --- a/apps/meteor/app/lib/server/functions/cleanRoomHistory.ts +++ b/apps/meteor/app/lib/server/functions/cleanRoomHistory.ts @@ -111,13 +111,16 @@ export async function cleanRoomHistory({ if (count) { const lastMessage = await Messages.getLastVisibleMessageSentWithNoTypeByRoomId(rid); - await Rooms.resetLastMessageById(rid, lastMessage); + + await Rooms.resetLastMessageById(rid, lastMessage, -count); + void api.broadcast('notify.deleteMessageBulk', rid, { rid, excludePinned, ignoreDiscussion, ts, users: fromUsers, + ids: selectedMessageIds, }); } return count; diff --git a/apps/meteor/app/lib/server/functions/createDirectRoom.ts b/apps/meteor/app/lib/server/functions/createDirectRoom.ts index 92db702dd4ec..c1de81332543 100644 --- a/apps/meteor/app/lib/server/functions/createDirectRoom.ts +++ b/apps/meteor/app/lib/server/functions/createDirectRoom.ts @@ -1,3 +1,4 @@ +import { AppEvents, Apps } from '@rocket.chat/apps'; import { AppsEngineException } from '@rocket.chat/apps-engine/definition/exceptions'; import type { ISubscriptionExtraData } from '@rocket.chat/core-services'; import type { ICreatedRoom, IRoom, ISubscription, IUser } from '@rocket.chat/core-typings'; @@ -6,7 +7,6 @@ import { Random } from '@rocket.chat/random'; import { Meteor } from 'meteor/meteor'; import type { MatchKeysAndValues } from 'mongodb'; -import { Apps } from '../../../../ee/server/apps'; import { callbacks } from '../../../../lib/callbacks'; import { isTruthy } from '../../../../lib/isTruthy'; import { settings } from '../../../settings/server'; @@ -19,6 +19,7 @@ const generateSubscription = ( extra: MatchKeysAndValues, ): MatchKeysAndValues => ({ _id: Random.id(), + ts: new Date(), alert: false, unread: 0, userMentions: 0, @@ -42,14 +43,21 @@ export async function createDirectRoom( members: IUser[] | string[], roomExtraData = {}, options: { - nameValidationRegex?: string; creator?: string; subscriptionExtra?: ISubscriptionExtraData; }, ): Promise { - if (members.length > (settings.get('DirectMesssage_maxUsers') || 1)) { - throw new Error('error-direct-message-max-user-exceeded'); + const maxUsers = settings.get('DirectMesssage_maxUsers') || 1; + if (members.length > maxUsers) { + throw new Meteor.Error( + 'error-direct-message-max-user-exceeded', + `You cannot add more than ${maxUsers} users, including yourself to a direct message`, + { + method: 'createDirectRoom', + }, + ); } + await callbacks.run('beforeCreateDirectRoom', members); const membersUsernames: string[] = members @@ -95,7 +103,7 @@ export async function createDirectRoom( _USERNAMES: usernames, }; - const prevent = await Apps.triggerEvent('IPreRoomCreatePrevent', tmpRoom).catch((error) => { + const prevent = await Apps.self?.triggerEvent(AppEvents.IPreRoomCreatePrevent, tmpRoom).catch((error) => { if (error.name === AppsEngineException.name) { throw new Meteor.Error('error-app-prevented', error.message); } @@ -107,7 +115,10 @@ export async function createDirectRoom( throw new Meteor.Error('error-app-prevented', 'A Rocket.Chat App prevented the room creation.'); } - const result = await Apps.triggerEvent('IPreRoomCreateModify', await Apps.triggerEvent('IPreRoomCreateExtend', tmpRoom)); + const result = await Apps.self?.triggerEvent( + AppEvents.IPreRoomCreateModify, + await Apps.self?.triggerEvent(AppEvents.IPreRoomCreateExtend, tmpRoom), + ); if (typeof result === 'object') { Object.assign(roomInfo, result); @@ -161,7 +172,7 @@ export async function createDirectRoom( await callbacks.run('afterCreateDirectRoom', insertedRoom, { members: roomMembers, creatorId: options?.creator }); - void Apps.triggerEvent('IPostRoomCreate', insertedRoom); + void Apps.self?.triggerEvent(AppEvents.IPostRoomCreate, insertedRoom); } return { diff --git a/apps/meteor/app/lib/server/functions/createRoom.ts b/apps/meteor/app/lib/server/functions/createRoom.ts index 312451f54845..615a0faf8bb3 100644 --- a/apps/meteor/app/lib/server/functions/createRoom.ts +++ b/apps/meteor/app/lib/server/functions/createRoom.ts @@ -1,4 +1,5 @@ /* eslint-disable complexity */ +import { AppEvents, Apps } from '@rocket.chat/apps'; import { AppsEngineException } from '@rocket.chat/apps-engine/definition/exceptions'; import { Message, Team } from '@rocket.chat/core-services'; import type { ICreateRoomParams, ISubscriptionExtraData } from '@rocket.chat/core-services'; @@ -6,7 +7,6 @@ import type { ICreatedRoom, IUser, IRoom, RoomType } from '@rocket.chat/core-typ import { Rooms, Subscriptions, Users } from '@rocket.chat/models'; import { Meteor } from 'meteor/meteor'; -import { Apps } from '../../../../ee/server/apps/orchestrator'; import { callbacks } from '../../../../lib/callbacks'; import { beforeCreateRoomCallback } from '../../../../lib/callbacks/beforeCreateRoomCallback'; import { getSubscriptionAutotranslateDefaultConfig } from '../../../../server/lib/getSubscriptionAutotranslateDefaultConfig'; @@ -39,6 +39,7 @@ async function createUsersSubscriptions({ const extra: Partial = options?.subscriptionExtra || {}; extra.open = true; extra.ls = now; + extra.roles = ['owner']; if (room.prid) { extra.prid = room.prid; @@ -163,15 +164,16 @@ export const createRoom = async ( delete extraData.reactWhenReadOnly; } + // this might not be the best way to check if the room is a discussion, we may need a specific field for that + const isDiscussion = 'prid' in extraData && extraData.prid !== ''; + const now = new Date(); const roomProps: Omit = { fname: name, _updatedAt: now, ...extraData, - name: await getValidRoomName(name.trim(), undefined, { - ...(options?.nameValidationRegex && { nameValidationRegex: options.nameValidationRegex }), - }), + name: isDiscussion ? name : await getValidRoomName(name.trim(), undefined), t: type, msgs: 0, usersCount: 0, @@ -196,7 +198,7 @@ export const createRoom = async ( _USERNAMES: members, }; - const prevent = await Apps.triggerEvent('IPreRoomCreatePrevent', tmp).catch((error) => { + const prevent = await Apps.self?.triggerEvent(AppEvents.IPreRoomCreatePrevent, tmp).catch((error) => { if (error.name === AppsEngineException.name) { throw new Meteor.Error('error-app-prevented', error.message); } @@ -208,7 +210,10 @@ export const createRoom = async ( throw new Meteor.Error('error-app-prevented', 'A Rocket.Chat App prevented the room creation.'); } - const eventResult = await Apps.triggerEvent('IPreRoomCreateModify', await Apps.triggerEvent('IPreRoomCreateExtend', tmp)); + const eventResult = await Apps.self?.triggerEvent( + AppEvents.IPreRoomCreateModify, + await Apps.triggerEvent(AppEvents.IPreRoomCreateExtend, tmp), + ); if (eventResult && typeof eventResult === 'object' && delete eventResult._USERNAMES) { Object.assign(roomProps, eventResult); @@ -240,7 +245,7 @@ export const createRoom = async ( callbacks.runAsync('federation.afterCreateFederatedRoom', room, { owner, originalMemberList: members }); } - void Apps.triggerEvent('IPostRoomCreate', room); + void Apps.self?.triggerEvent(AppEvents.IPostRoomCreate, room); return { rid: room._id, // backwards compatible inserted: true, diff --git a/apps/meteor/app/lib/server/functions/deleteMessage.ts b/apps/meteor/app/lib/server/functions/deleteMessage.ts index 6fddbd719fa9..9368787bf7ea 100644 --- a/apps/meteor/app/lib/server/functions/deleteMessage.ts +++ b/apps/meteor/app/lib/server/functions/deleteMessage.ts @@ -1,10 +1,11 @@ +import { AppEvents, Apps } from '@rocket.chat/apps'; import { api } from '@rocket.chat/core-services'; import type { AtLeast, IMessage, IUser } from '@rocket.chat/core-typings'; import { Messages, Rooms, Uploads, Users, ReadReceipts } from '@rocket.chat/models'; import { Meteor } from 'meteor/meteor'; -import { Apps } from '../../../../ee/server/apps'; import { callbacks } from '../../../../lib/callbacks'; +import { broadcastMessageFromData } from '../../../../server/modules/watchers/lib/messages'; import { canDeleteMessageAsync } from '../../../authorization/server/functions/canDeleteMessage'; import { FileUpload } from '../../../file-upload/server'; import { settings } from '../../../settings/server'; @@ -28,14 +29,14 @@ export const deleteMessageValidatingPermission = async (message: AtLeast { - const deletedMsg = await Messages.findOneById(message._id); + const deletedMsg: IMessage | null = await Messages.findOneById(message._id); const isThread = (deletedMsg?.tcount || 0) > 0; const keepHistory = settings.get('Message_KeepHistory') || isThread; const showDeletedStatus = settings.get('Message_ShowDeletedStatus') || isThread; - const bridges = Apps?.isLoaded() && Apps.getBridges(); + const bridges = Apps.self?.isLoaded() && Apps.getBridges(); if (deletedMsg && bridges) { - const prevent = await bridges.getListenerBridge().messageEvent('IPreMessageDeletePrevent', deletedMsg); + const prevent = await bridges.getListenerBridge().messageEvent(AppEvents.IPreMessageDeletePrevent, deletedMsg); if (prevent) { throw new Meteor.Error('error-app-prevented-deleting', 'A Rocket.Chat App prevented the message deleting.'); } @@ -68,7 +69,6 @@ export async function deleteMessage(message: IMessage, user: IUser): Promise>); @@ -79,19 +79,23 @@ export async function deleteMessage(message: IMessage, user: IUser): Promise { + if (userId === 'rocket.cat') { + throw new Meteor.Error('error-action-not-allowed', 'Deleting the rocket.cat user is not allowed', { + method: 'deleteUser', + action: 'Delete_user', + }); + } + const user = await Users.findOneById(userId, { projection: { username: 1, avatarOrigin: 1, roles: 1, federated: 1 }, }); @@ -41,9 +49,11 @@ export async function deleteUser(userId: string, confirmRelinquish = false, dele // Users without username can't do anything, so there is nothing to remove if (user.username != null) { + let userToReplaceWhenUnlinking: IUser | null = null; + const nameAlias = i18n.t('Removed_User'); await relinquishRoomOwnerships(userId, subscribedRooms); - const messageErasureType = settings.get('Message_ErasureType'); + const messageErasureType = settings.get<'Delete' | 'Unlink' | 'Keep'>('Message_ErasureType'); switch (messageErasureType) { case 'Delete': const store = FileUpload.getStore('Uploads'); @@ -68,12 +78,11 @@ export async function deleteUser(userId: string, confirmRelinquish = false, dele break; case 'Unlink': - const rocketCat = await Users.findOneById('rocket.cat'); - const nameAlias = i18n.t('Removed_User'); - if (!rocketCat?._id || !rocketCat?.username) { + userToReplaceWhenUnlinking = await Users.findOneById('rocket.cat'); + if (!userToReplaceWhenUnlinking?._id || !userToReplaceWhenUnlinking?.username) { break; } - await Messages.unlinkUserId(userId, rocketCat?._id, rocketCat?.username, nameAlias); + await Messages.unlinkUserId(userId, userToReplaceWhenUnlinking?._id, userToReplaceWhenUnlinking?.username, nameAlias); break; } @@ -104,8 +113,16 @@ export async function deleteUser(userId: string, confirmRelinquish = false, dele await Integrations.disableByUserId(userId); // Disables all the integrations which rely on the user being deleted. // Don't broadcast user.deleted for Erasure Type of 'Keep' so that messages don't disappear from logged in sessions - if (messageErasureType !== 'Keep') { - void api.broadcast('user.deleted', user); + if (messageErasureType === 'Delete') { + void api.broadcast('user.deleted', user, { + messageErasureType, + }); + } + if (messageErasureType === 'Unlink' && userToReplaceWhenUnlinking) { + void api.broadcast('user.deleted', user, { + messageErasureType, + replaceByUser: { _id: userToReplaceWhenUnlinking._id, username: userToReplaceWhenUnlinking?.username, alias: nameAlias }, + }); } } @@ -117,4 +134,6 @@ export async function deleteUser(userId: string, confirmRelinquish = false, dele // Refresh the servers list await FederationServers.refreshServers(); + + await callbacks.run('afterDeleteUser', user); } diff --git a/apps/meteor/app/lib/server/functions/getDefaultChannels.ts b/apps/meteor/app/lib/server/functions/getDefaultChannels.ts new file mode 100644 index 000000000000..e47518dd604f --- /dev/null +++ b/apps/meteor/app/lib/server/functions/getDefaultChannels.ts @@ -0,0 +1,25 @@ +import type { IRoom } from '@rocket.chat/core-typings'; +import { Rooms } from '@rocket.chat/models'; + +export async function getDefaultChannels(): Promise { + const defaultRooms = await Rooms.findByDefaultAndTypes(true, ['c', 'p'], { + projection: { usernames: 0 }, + }).toArray(); + const roomsThatAreGoingToBeJoined = new Set(defaultRooms.map((room) => room._id)); + + // If any of those are teams, we need to get all the channels that have the auto-join flag as well + const teamRooms = defaultRooms.filter((room) => room.teamMain && room.teamId); + if (teamRooms.length > 0) { + for await (const teamRoom of teamRooms) { + const defaultTeamRooms = await Rooms.findDefaultRoomsForTeam(teamRoom.teamId).toArray(); + + const defaultTeamRoomsThatWereNotAlreadyAdded = defaultTeamRooms.filter((channel) => !roomsThatAreGoingToBeJoined.has(channel._id)); + + defaultTeamRoomsThatWereNotAlreadyAdded.forEach((channel) => roomsThatAreGoingToBeJoined.add(channel._id)); + // Add the channels to the defaultRooms list + defaultRooms.push(...defaultTeamRoomsThatWereNotAlreadyAdded); + } + } + + return defaultRooms; +} diff --git a/apps/meteor/app/lib/server/functions/notifications/desktop.ts b/apps/meteor/app/lib/server/functions/notifications/desktop.ts index ac43cce997b6..1afac17f9f58 100644 --- a/apps/meteor/app/lib/server/functions/notifications/desktop.ts +++ b/apps/meteor/app/lib/server/functions/notifications/desktop.ts @@ -1,5 +1,5 @@ import { api } from '@rocket.chat/core-services'; -import type { IMessage, IRoom, IUser } from '@rocket.chat/core-typings'; +import type { IMessage, IRoom, IUser, AtLeast } from '@rocket.chat/core-typings'; import { roomCoordinator } from '../../../../../server/lib/rooms/roomCoordinator'; import { metrics } from '../../../../metrics/server'; @@ -24,29 +24,39 @@ export async function notifyDesktopUser({ notificationMessage, }: { userId: string; - user: IUser; - message: IMessage; + user: AtLeast; + message: IMessage | Pick; room: IRoom; - duration: number; + duration?: number; notificationMessage: string; }): Promise { - const { title, text } = await roomCoordinator.getRoomDirectives(room.t).getNotificationDetails(room, user, notificationMessage, userId); + const { title, text, name } = await roomCoordinator + .getRoomDirectives(room.t) + .getNotificationDetails(room, user, notificationMessage, userId); const payload = { title: title || '', text, duration, payload: { - _id: message._id, - rid: message.rid, - tmid: message.tmid, + _id: '', + rid: '', + tmid: '', + ...('_id' in message && { + // TODO: omnichannel is not sending _id, rid, tmid + _id: message._id, + rid: message.rid, + tmid: message.tmid, + }), sender: message.u, type: room.t, - name: room.name, message: { - msg: message.msg, - t: message.t, + msg: 'msg' in message ? message.msg : '', + ...('t' in message && { + t: message.t, + }), }, + name, }, }; @@ -71,7 +81,7 @@ export function shouldNotifyDesktop({ disableAllMessageNotifications: boolean; status: string; statusConnection: string; - desktopNotifications: string; + desktopNotifications: string | undefined; hasMentionToAll: boolean; hasMentionToHere: boolean; isHighlighted: boolean; @@ -80,7 +90,7 @@ export function shouldNotifyDesktop({ roomType: string; isThread: boolean; }): boolean { - if (disableAllMessageNotifications && desktopNotifications == null && !isHighlighted && !hasMentionToUser && !hasReplyToThread) { + if (disableAllMessageNotifications && !desktopNotifications && !isHighlighted && !hasMentionToUser && !hasReplyToThread) { return false; } @@ -103,6 +113,6 @@ export function shouldNotifyDesktop({ isHighlighted || desktopNotifications === 'all' || hasMentionToUser) && - (!isThread || hasReplyToThread) + (isHighlighted || !isThread || hasReplyToThread) ); } diff --git a/apps/meteor/app/lib/server/functions/notifications/email.js b/apps/meteor/app/lib/server/functions/notifications/email.js index b0953293ac73..dfc6a1716703 100644 --- a/apps/meteor/app/lib/server/functions/notifications/email.js +++ b/apps/meteor/app/lib/server/functions/notifications/email.js @@ -224,6 +224,6 @@ export function shouldNotifyEmail({ emailNotifications === 'all' || hasMentionToUser || (!disableAllMessageNotifications && hasMentionToAll)) && - (!isThread || hasReplyToThread) + (isHighlighted || !isThread || hasReplyToThread) ); } diff --git a/apps/meteor/app/lib/server/functions/notifications/index.ts b/apps/meteor/app/lib/server/functions/notifications/index.ts index 11e4418c4510..54b18f502ae7 100644 --- a/apps/meteor/app/lib/server/functions/notifications/index.ts +++ b/apps/meteor/app/lib/server/functions/notifications/index.ts @@ -11,7 +11,11 @@ import { settings } from '../../../../settings/server'; * * @param {object} message the message to be parsed */ -export async function parseMessageTextPerUser(messageText: string, message: IMessage, receiver: IUser): Promise { +export async function parseMessageTextPerUser( + messageText: string, + message: Pick, + receiver: Pick, +): Promise { const lng = receiver.language || settings.get('Language') || 'en'; const firstAttachment = message.attachments?.[0]; @@ -36,9 +40,6 @@ export async function parseMessageTextPerUser(messageText: string, message: IMes * @returns {string} */ export function replaceMentionedUsernamesWithFullNames(message: string, mentions: NonNullable): string { - if (!mentions?.length) { - return message; - } mentions.forEach((mention) => { if (mention.name) { message = message.replace(new RegExp(escapeRegExp(`@${mention.username}`), 'g'), mention.name); @@ -55,7 +56,7 @@ export function replaceMentionedUsernamesWithFullNames(message: string, mentions * * @returns {boolean} */ -export function messageContainsHighlight(message: IMessage, highlights: string[]): boolean { +export function messageContainsHighlight(message: Pick, highlights: string[] | undefined): boolean { if (!highlights || highlights.length === 0) { return false; } diff --git a/apps/meteor/app/lib/server/functions/notifications/mobile.js b/apps/meteor/app/lib/server/functions/notifications/mobile.js index b4139bea6f12..cf8b526a6abc 100644 --- a/apps/meteor/app/lib/server/functions/notifications/mobile.js +++ b/apps/meteor/app/lib/server/functions/notifications/mobile.js @@ -1,6 +1,7 @@ import { Subscriptions } from '@rocket.chat/models'; import { i18n } from '../../../../../server/lib/i18n'; +import { isRoomCompatibleWithVideoConfRinging } from '../../../../../server/lib/isRoomCompatibleWithVideoConfRinging'; import { roomCoordinator } from '../../../../../server/lib/rooms/roomCoordinator'; import { settings } from '../../../../settings/server'; @@ -73,6 +74,9 @@ export function shouldNotifyMobile({ hasReplyToThread, roomType, isThread, + isVideoConf, + userPreferences, + roomUids, }) { if (settings.get('Push_enable') !== true) { return false; @@ -86,6 +90,16 @@ export function shouldNotifyMobile({ return false; } + // If the user is going to receive a ringing push notification, do not send another push for the message generated by that videoconference + if ( + isVideoConf && + settings.get('VideoConf_Mobile_Ringing') && + isRoomCompatibleWithVideoConfRinging(roomType, roomUids) && + (userPreferences?.enableMobileRinging ?? settings.get(`Accounts_Default_User_Preferences_enableMobileRinging`)) + ) { + return false; + } + if (!mobilePushNotifications) { if (settings.get('Accounts_Default_User_Preferences_pushNotifications') === 'all' && (!isThread || hasReplyToThread)) { return true; @@ -101,6 +115,6 @@ export function shouldNotifyMobile({ isHighlighted || mobilePushNotifications === 'all' || hasMentionToUser) && - (!isThread || hasReplyToThread) + (isHighlighted || !isThread || hasReplyToThread) ); } diff --git a/apps/meteor/app/lib/server/functions/parseUrlsInMessage.ts b/apps/meteor/app/lib/server/functions/parseUrlsInMessage.ts index 2a63d024bdd9..ea8bed9f77d4 100644 --- a/apps/meteor/app/lib/server/functions/parseUrlsInMessage.ts +++ b/apps/meteor/app/lib/server/functions/parseUrlsInMessage.ts @@ -4,6 +4,7 @@ import { getMessageUrlRegex } from '../../../../lib/getMessageUrlRegex'; import { Markdown } from '../../../markdown/server'; import { settings } from '../../../settings/server'; +// TODO move this function to message service to be used like a "beforeSaveMessage" hook export const parseUrlsInMessage = (message: AtLeast & { parseUrls?: boolean }, previewUrls?: string[]) => { if (message.parseUrls === false) { return message; diff --git a/apps/meteor/app/lib/server/functions/processWebhookMessage.js b/apps/meteor/app/lib/server/functions/processWebhookMessage.js deleted file mode 100644 index 1e5c34b287bb..000000000000 --- a/apps/meteor/app/lib/server/functions/processWebhookMessage.js +++ /dev/null @@ -1,109 +0,0 @@ -import { Meteor } from 'meteor/meteor'; -import _ from 'underscore'; - -import { trim } from '../../../../lib/utils/stringUtils'; -import { SystemLogger } from '../../../../server/lib/logger/system'; -import { validateRoomMessagePermissionsAsync } from '../../../authorization/server/functions/canSendMessage'; -import { getRoomByNameOrIdWithOptionToJoin } from './getRoomByNameOrIdWithOptionToJoin'; -import { sendMessage } from './sendMessage'; - -export const processWebhookMessage = async function (messageObj, user, defaultValues = { channel: '', alias: '', avatar: '', emoji: '' }) { - const sentData = []; - const channels = [].concat(messageObj.channel || messageObj.roomId || defaultValues.channel); - - for await (const channel of channels) { - const channelType = channel[0]; - - let channelValue = channel.substr(1); - let room; - - switch (channelType) { - case '#': - room = await getRoomByNameOrIdWithOptionToJoin({ - user, - nameOrId: channelValue, - joinChannel: true, - }); - break; - case '@': - room = await getRoomByNameOrIdWithOptionToJoin({ - user, - nameOrId: channelValue, - type: 'd', - }); - break; - default: - channelValue = channelType + channelValue; - - // Try to find the room by id or name if they didn't include the prefix. - room = await getRoomByNameOrIdWithOptionToJoin({ - user, - nameOrId: channelValue, - joinChannel: true, - errorOnEmpty: false, - }); - if (room) { - break; - } - - // We didn't get a room, let's try finding direct messages - room = await getRoomByNameOrIdWithOptionToJoin({ - user, - nameOrId: channelValue, - tryDirectByUserIdOnly: true, - type: 'd', - }); - if (room) { - break; - } - - // No room, so throw an error - throw new Meteor.Error('invalid-channel'); - } - - if (messageObj.attachments && !Array.isArray(messageObj.attachments)) { - SystemLogger.warn({ - msg: 'Attachments should be Array, ignoring value', - attachments: messageObj.attachments, - }); - messageObj.attachments = undefined; - } - - const message = { - alias: messageObj.username || messageObj.alias || defaultValues.alias, - msg: trim(messageObj.text || messageObj.msg || ''), - attachments: messageObj.attachments || [], - parseUrls: messageObj.parseUrls !== undefined ? messageObj.parseUrls : !messageObj.attachments, - bot: messageObj.bot, - groupable: messageObj.groupable !== undefined ? messageObj.groupable : false, - tmid: messageObj.tmid, - }; - - if (!_.isEmpty(messageObj.icon_url) || !_.isEmpty(messageObj.avatar)) { - message.avatar = messageObj.icon_url || messageObj.avatar; - } else if (!_.isEmpty(messageObj.icon_emoji) || !_.isEmpty(messageObj.emoji)) { - message.emoji = messageObj.icon_emoji || messageObj.emoji; - } else if (!_.isEmpty(defaultValues.avatar)) { - message.avatar = defaultValues.avatar; - } else if (!_.isEmpty(defaultValues.emoji)) { - message.emoji = defaultValues.emoji; - } - - if (Array.isArray(message.attachments)) { - for (let i = 0; i < message.attachments.length; i++) { - const attachment = message.attachments[i]; - if (attachment.msg) { - attachment.text = trim(attachment.msg); - delete attachment.msg; - } - } - } - - await validateRoomMessagePermissionsAsync(room, { uid: user._id, ...user }); - - const messageReturn = await sendMessage(user, message, room); - sentData.push({ channel, message: messageReturn }); - } - - return sentData; -}; diff --git a/apps/meteor/app/lib/server/functions/processWebhookMessage.ts b/apps/meteor/app/lib/server/functions/processWebhookMessage.ts new file mode 100644 index 000000000000..4dafc6211015 --- /dev/null +++ b/apps/meteor/app/lib/server/functions/processWebhookMessage.ts @@ -0,0 +1,141 @@ +import type { IMessage, IUser, RequiredField, MessageAttachment } from '@rocket.chat/core-typings'; +import { Meteor } from 'meteor/meteor'; +import _ from 'underscore'; + +import { ensureArray } from '../../../../lib/utils/arrayUtils'; +import { trim } from '../../../../lib/utils/stringUtils'; +import { SystemLogger } from '../../../../server/lib/logger/system'; +import { validateRoomMessagePermissionsAsync } from '../../../authorization/server/functions/canSendMessage'; +import { getRoomByNameOrIdWithOptionToJoin } from './getRoomByNameOrIdWithOptionToJoin'; +import { sendMessage } from './sendMessage'; + +type Payload = { + channel?: string | string[]; + roomId?: string | string[]; + text?: IMessage['msg']; + msg?: IMessage['msg']; // overridden if text is present + username?: IMessage['alias']; + alias?: IMessage['alias']; // overridden if username is present + icon_emoji?: IMessage['emoji']; + emoji?: IMessage['emoji']; // overridden if icon_emoji is present + icon_url?: IMessage['avatar']; + avatar?: IMessage['avatar']; // overridden if icon_url is present + attachments?: IMessage['attachments']; + parseUrls?: boolean; + bot?: IMessage['bot']; + groupable?: IMessage['groupable']; + tmid?: IMessage['tmid']; +}; + +type DefaultValues = { + channel: string | string[]; + alias: string; + avatar: string; + emoji: string; +}; + +export const processWebhookMessage = async function ( + messageObj: Payload, + user: IUser & { username: RequiredField }, + defaultValues: DefaultValues = { channel: '', alias: '', avatar: '', emoji: '' }, +) { + const sentData = []; + + const channels: Array = [...new Set(ensureArray(messageObj.channel || messageObj.roomId || defaultValues.channel))]; + + for await (const channel of channels) { + const channelType = channel[0]; + + let channelValue = channel.substr(1); + let room; + + switch (channelType) { + case '#': + room = await getRoomByNameOrIdWithOptionToJoin({ + user, + nameOrId: channelValue, + joinChannel: true, + }); + break; + case '@': + room = await getRoomByNameOrIdWithOptionToJoin({ + user, + nameOrId: channelValue, + type: 'd', + }); + break; + default: + channelValue = channelType + channelValue; + + // Try to find the room by id or name if they didn't include the prefix. + room = await getRoomByNameOrIdWithOptionToJoin({ + user, + nameOrId: channelValue, + joinChannel: true, + errorOnEmpty: false, + }); + if (room) { + break; + } + + // We didn't get a room, let's try finding direct messages + room = await getRoomByNameOrIdWithOptionToJoin({ + user, + nameOrId: channelValue, + tryDirectByUserIdOnly: true, + type: 'd', + }); + if (room) { + break; + } + + // No room, so throw an error + throw new Meteor.Error('invalid-channel'); + } + + if (messageObj.attachments && !Array.isArray(messageObj.attachments)) { + SystemLogger.warn({ + msg: 'Attachments should be Array, ignoring value', + attachments: messageObj.attachments, + }); + messageObj.attachments = undefined; + } + + const message: Partial & { parseUrls?: boolean } = { + alias: messageObj.username || messageObj.alias || defaultValues.alias, + msg: trim(messageObj.text || messageObj.msg || ''), + attachments: messageObj.attachments || [], + parseUrls: messageObj.parseUrls !== undefined ? messageObj.parseUrls : !messageObj.attachments, + bot: messageObj.bot, + groupable: messageObj.groupable !== undefined ? messageObj.groupable : false, + tmid: messageObj.tmid, + }; + + if (!_.isEmpty(messageObj.icon_url) || !_.isEmpty(messageObj.avatar)) { + message.avatar = messageObj.icon_url || messageObj.avatar; + } else if (!_.isEmpty(messageObj.icon_emoji) || !_.isEmpty(messageObj.emoji)) { + message.emoji = messageObj.icon_emoji || messageObj.emoji; + } else if (!_.isEmpty(defaultValues.avatar)) { + message.avatar = defaultValues.avatar; + } else if (!_.isEmpty(defaultValues.emoji)) { + message.emoji = defaultValues.emoji; + } + + if (Array.isArray(message.attachments)) { + for (let i = 0; i < message.attachments.length; i++) { + const attachment = message.attachments[i] as MessageAttachment & { msg?: string }; + if (attachment.msg) { + attachment.text = trim(attachment.msg); + delete attachment.msg; + } + } + } + + await validateRoomMessagePermissionsAsync(room, { uid: user._id, ...user }); + + const messageReturn = await sendMessage(user, message, room); + sentData.push({ channel, message: messageReturn }); + } + + return sentData; +}; diff --git a/apps/meteor/app/lib/server/functions/removeUserFromRoom.ts b/apps/meteor/app/lib/server/functions/removeUserFromRoom.ts index b2925bfe37f2..1cc8c4ad5432 100644 --- a/apps/meteor/app/lib/server/functions/removeUserFromRoom.ts +++ b/apps/meteor/app/lib/server/functions/removeUserFromRoom.ts @@ -1,10 +1,10 @@ +import { Apps, AppEvents } from '@rocket.chat/apps'; import { AppsEngineException } from '@rocket.chat/apps-engine/definition/exceptions'; import { Message, Team } from '@rocket.chat/core-services'; import type { IUser } from '@rocket.chat/core-typings'; import { Subscriptions, Rooms } from '@rocket.chat/models'; import { Meteor } from 'meteor/meteor'; -import { AppEvents, Apps } from '../../../../ee/server/apps/orchestrator'; import { afterLeaveRoomCallback } from '../../../../lib/callbacks/afterLeaveRoomCallback'; import { beforeLeaveRoomCallback } from '../../../../lib/callbacks/beforeLeaveRoomCallback'; @@ -20,7 +20,7 @@ export const removeUserFromRoom = async function ( } try { - await Apps.triggerEvent(AppEvents.IPreRoomUserLeave, room, user); + await Apps.self?.triggerEvent(AppEvents.IPreRoomUserLeave, room, user); } catch (error: any) { if (error.name === AppsEngineException.name) { throw new Meteor.Error('error-app-prevented', error.message); @@ -67,5 +67,5 @@ export const removeUserFromRoom = async function ( // TODO: CACHE: maybe a queue? await afterLeaveRoomCallback.run(user, room); - await Apps.triggerEvent(AppEvents.IPostRoomUserLeave, room, user); + await Apps.self?.triggerEvent(AppEvents.IPostRoomUserLeave, room, user); }; diff --git a/apps/meteor/app/lib/server/functions/saveUser.js b/apps/meteor/app/lib/server/functions/saveUser.js index 3177a4a0060f..3a2808b4171c 100644 --- a/apps/meteor/app/lib/server/functions/saveUser.js +++ b/apps/meteor/app/lib/server/functions/saveUser.js @@ -1,3 +1,4 @@ +import { Apps, AppEvents } from '@rocket.chat/apps'; import { isUserFederated } from '@rocket.chat/core-typings'; import { Users } from '@rocket.chat/models'; import Gravatar from 'gravatar'; @@ -5,7 +6,6 @@ import { Accounts } from 'meteor/accounts-base'; import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; -import { AppEvents, Apps } from '../../../../ee/server/apps/orchestrator'; import { callbacks } from '../../../../lib/callbacks'; import { trim } from '../../../../lib/utils/stringUtils'; import { getNewUserRoles } from '../../../../server/services/user/lib/getNewUserRoles'; @@ -110,10 +110,6 @@ async function validateUserData(userId, userData) { }); } - if (userData.roles) { - await callbacks.run('validateUserRoles', userData); - } - let nameValidation; try { @@ -337,11 +333,18 @@ const saveNewUser = async function (userData, sendPassword) { }; export const saveUser = async function (userId, userData) { - const oldUserData = await Users.findOneById(userData._id); + const oldUserData = userData._id && (await Users.findOneById(userData._id)); if (oldUserData && isUserFederated(oldUserData)) { throw new Meteor.Error('Edit_Federated_User_Not_Allowed', 'Not possible to edit a federated user'); } + await validateUserData(userId, userData); + + await callbacks.run('beforeSaveUser', { + user: userData, + oldUser: oldUserData, + }); + let sendPassword = false; if (userData.hasOwnProperty('setRandomPassword')) { @@ -432,7 +435,7 @@ export const saveUser = async function (userId, userData) { oldUser: oldUserData, }); - await Apps.triggerEvent(AppEvents.IPostUserUpdated, { + await Apps.self?.triggerEvent(AppEvents.IPostUserUpdated, { user: userUpdated, previousUser: oldUserData, performedBy: await safeGetMeteorUser(), diff --git a/apps/meteor/app/lib/server/functions/sendMessage.js b/apps/meteor/app/lib/server/functions/sendMessage.js deleted file mode 100644 index 72247d4b1870..000000000000 --- a/apps/meteor/app/lib/server/functions/sendMessage.js +++ /dev/null @@ -1,293 +0,0 @@ -import { Message } from '@rocket.chat/core-services'; -import { Messages } from '@rocket.chat/models'; -import { Match, check } from 'meteor/check'; - -import { Apps } from '../../../../ee/server/apps'; -import { callbacks } from '../../../../lib/callbacks'; -import { isRelativeURL } from '../../../../lib/utils/isRelativeURL'; -import { isURL } from '../../../../lib/utils/isURL'; -import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; -import { FileUpload } from '../../../file-upload/server'; -import notifications from '../../../notifications/server/lib/Notifications'; -import { settings } from '../../../settings/server'; -import { parseUrlsInMessage } from './parseUrlsInMessage'; - -/** - * IMPORTANT - * - * This validator prevents malicious href values - * intending to run arbitrary js code in anchor tags. - * You should use it whenever the value you're checking - * is going to be rendered in the href attribute of a - * link. - */ -const validFullURLParam = Match.Where((value) => { - check(value, String); - - if (!isURL(value) && !value.startsWith(FileUpload.getPath())) { - throw new Error('Invalid href value provided'); - } - - if (/^javascript:/i.test(value)) { - throw new Error('Invalid href value provided'); - } - - return true; -}); - -const validPartialURLParam = Match.Where((value) => { - check(value, String); - - if (!isRelativeURL(value) && !isURL(value) && !value.startsWith(FileUpload.getPath())) { - throw new Error('Invalid href value provided'); - } - - if (/^javascript:/i.test(value)) { - throw new Error('Invalid href value provided'); - } - - return true; -}); - -const objectMaybeIncluding = (types) => - Match.Where((value) => { - Object.keys(types).forEach((field) => { - if (value[field] != null) { - try { - check(value[field], types[field]); - } catch (error) { - error.path = field; - throw error; - } - } - }); - - return true; - }); - -const validateAttachmentsFields = (attachmentField) => { - check( - attachmentField, - objectMaybeIncluding({ - short: Boolean, - title: String, - value: Match.OneOf(String, Number, Boolean), - }), - ); - - if (typeof attachmentField.value !== 'undefined') { - attachmentField.value = String(attachmentField.value); - } -}; - -const validateAttachmentsActions = (attachmentActions) => { - check( - attachmentActions, - objectMaybeIncluding({ - type: String, - text: String, - url: validFullURLParam, - image_url: validFullURLParam, - is_webview: Boolean, - webview_height_ratio: String, - msg: String, - msg_in_chat_window: Boolean, - }), - ); -}; - -const validateAttachment = (attachment) => { - check( - attachment, - objectMaybeIncluding({ - color: String, - text: String, - ts: Match.OneOf(String, Number), - thumb_url: validFullURLParam, - button_alignment: String, - actions: [Match.Any], - message_link: validFullURLParam, - collapsed: Boolean, - author_name: String, - author_link: validFullURLParam, - author_icon: validFullURLParam, - title: String, - title_link: validFullURLParam, - title_link_download: Boolean, - image_dimensions: Object, - image_url: validFullURLParam, - image_preview: String, - image_type: String, - image_size: Number, - audio_url: validFullURLParam, - audio_type: String, - audio_size: Number, - video_url: validFullURLParam, - video_type: String, - video_size: Number, - fields: [Match.Any], - }), - ); - - if (attachment.fields?.length) { - attachment.fields.map(validateAttachmentsFields); - } - - if (attachment.actions?.length) { - attachment.actions.map(validateAttachmentsActions); - } -}; - -const validateBodyAttachments = (attachments) => attachments.map(validateAttachment); - -export const validateMessage = async (message, room, user) => { - check( - message, - objectMaybeIncluding({ - _id: String, - msg: String, - text: String, - alias: String, - emoji: String, - tmid: String, - tshow: Boolean, - avatar: validPartialURLParam, - attachments: [Match.Any], - blocks: [Match.Any], - }), - ); - - if (message.alias || message.avatar) { - const isLiveChatGuest = !message.avatar && user.token && user.token === room.v?.token; - - if (!isLiveChatGuest && !(await hasPermissionAsync(user._id, 'message-impersonate', room._id))) { - throw new Error('Not enough permission'); - } - } - - if (Array.isArray(message.attachments) && message.attachments.length) { - validateBodyAttachments(message.attachments); - } -}; - -export const prepareMessageObject = function (message, rid, user) { - if (!message.ts) { - message.ts = new Date(); - } - - if (message.tshow !== true) { - delete message.tshow; - } - - const { _id, username, name } = user; - message.u = { - _id, - username, - name, - }; - message.rid = rid; - - if (!Match.test(message.msg, String)) { - message.msg = ''; - } - - if (message.ts == null) { - message.ts = new Date(); - } -}; - -/** - * Clean up the message object before saving on db - * @param {IMessage} message - */ -function cleanupMessageObject(message) { - ['customClass'].forEach((field) => delete message[field]); -} - -/** - * Validates and sends the message object. - * @param {IUser} user - * @param {AtLeast} message - * @param {IRoom} room - * @param {boolean} [upsert=false] - * @param {string[]} [previewUrls] - * @returns {Promise} - */ -export const sendMessage = async function (user, message, room, upsert = false, previewUrls = undefined) { - if (!user || !message || !room._id) { - return false; - } - - await validateMessage(message, room, user); - prepareMessageObject(message, room._id, user); - - if (settings.get('Message_Read_Receipt_Enabled')) { - message.unread = true; - } - - // For the Rocket.Chat Apps :) - if (Apps && Apps.isLoaded()) { - const prevent = await Apps.getBridges()?.getListenerBridge().messageEvent('IPreMessageSentPrevent', message); - if (prevent) { - return; - } - - let result; - result = await Apps.getBridges()?.getListenerBridge().messageEvent('IPreMessageSentExtend', message); - result = await Apps.getBridges()?.getListenerBridge().messageEvent('IPreMessageSentModify', result); - - if (typeof result === 'object') { - message = Object.assign(message, result); - - // Some app may have inserted malicious/invalid values in the message, let's check it again - await validateMessage(message, room, user); - } - } - - cleanupMessageObject(message); - - parseUrlsInMessage(message, previewUrls); - - message = await Message.beforeSave({ message, room, user }); - - message = await callbacks.run('beforeSaveMessage', message, room); - if (message) { - if (message.t === 'otr') { - const otrStreamer = notifications.streamRoomMessage; - otrStreamer.emit(message.rid, message, user, room); - } else if (message._id && upsert) { - const { _id } = message; - delete message._id; - await Messages.updateOne( - { - _id, - 'u._id': message.u._id, - }, - { $set: message }, - { upsert: true }, - ); - message._id = _id; - } else { - const messageAlreadyExists = message._id && (await Messages.findOneById(message._id, { projection: { _id: 1 } })); - if (messageAlreadyExists) { - return; - } - const result = await Messages.insertOne(message); - message._id = result.insertedId; - } - - if (Apps && Apps.isLoaded()) { - // This returns a promise, but it won't mutate anything about the message - // so, we don't really care if it is successful or fails - void Apps.getBridges()?.getListenerBridge().messageEvent('IPostMessageSent', message); - } - - /* - Defer other updates as their return is not interesting to the user - */ - - // Execute all callbacks - await callbacks.run('afterSaveMessage', message, room); - return message; - } -}; diff --git a/apps/meteor/app/lib/server/functions/sendMessage.ts b/apps/meteor/app/lib/server/functions/sendMessage.ts new file mode 100644 index 000000000000..089d33f98034 --- /dev/null +++ b/apps/meteor/app/lib/server/functions/sendMessage.ts @@ -0,0 +1,292 @@ +import { Apps } from '@rocket.chat/apps'; +import { Message } from '@rocket.chat/core-services'; +import type { IMessage, IRoom } from '@rocket.chat/core-typings'; +import { Messages } from '@rocket.chat/models'; +import { Match, check } from 'meteor/check'; + +import { callbacks } from '../../../../lib/callbacks'; +import { isRelativeURL } from '../../../../lib/utils/isRelativeURL'; +import { isURL } from '../../../../lib/utils/isURL'; +import { broadcastMessageFromData } from '../../../../server/modules/watchers/lib/messages'; +import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; +import { FileUpload } from '../../../file-upload/server'; +import notifications from '../../../notifications/server/lib/Notifications'; +import { settings } from '../../../settings/server'; +import { parseUrlsInMessage } from './parseUrlsInMessage'; + +// TODO: most of the types here are wrong, but I don't want to change them now + +/** + * IMPORTANT + * + * This validator prevents malicious href values + * intending to run arbitrary js code in anchor tags. + * You should use it whenever the value you're checking + * is going to be rendered in the href attribute of a + * link. + */ +const validFullURLParam = Match.Where((value) => { + check(value, String); + + if (!isURL(value) && !value.startsWith(FileUpload.getPath())) { + throw new Error('Invalid href value provided'); + } + + if (/^javascript:/i.test(value)) { + throw new Error('Invalid href value provided'); + } + + return true; +}); + +const validPartialURLParam = Match.Where((value) => { + check(value, String); + + if (!isRelativeURL(value) && !isURL(value) && !value.startsWith(FileUpload.getPath())) { + throw new Error('Invalid href value provided'); + } + + if (/^javascript:/i.test(value)) { + throw new Error('Invalid href value provided'); + } + + return true; +}); + +const objectMaybeIncluding = (types: any) => + Match.Where((value: any) => { + Object.keys(types).forEach((field) => { + if (value[field] != null) { + try { + check(value[field], types[field]); + } catch (error: any) { + error.path = field; + throw error; + } + } + }); + + return true; + }); + +const validateAttachmentsFields = (attachmentField: any) => { + check( + attachmentField, + objectMaybeIncluding({ + short: Boolean, + title: String, + value: Match.OneOf(String, Number, Boolean), + }), + ); + + if (typeof attachmentField.value !== 'undefined') { + attachmentField.value = String(attachmentField.value); + } +}; + +const validateAttachmentsActions = (attachmentActions: any) => { + check( + attachmentActions, + objectMaybeIncluding({ + type: String, + text: String, + url: validFullURLParam, + image_url: validFullURLParam, + is_webview: Boolean, + webview_height_ratio: String, + msg: String, + msg_in_chat_window: Boolean, + }), + ); +}; + +const validateAttachment = (attachment: any) => { + check( + attachment, + objectMaybeIncluding({ + color: String, + text: String, + ts: Match.OneOf(String, Number), + thumb_url: validFullURLParam, + button_alignment: String, + actions: [Match.Any], + message_link: validFullURLParam, + collapsed: Boolean, + author_name: String, + author_link: validFullURLParam, + author_icon: validFullURLParam, + title: String, + title_link: validFullURLParam, + title_link_download: Boolean, + image_dimensions: Object, + image_url: validFullURLParam, + image_preview: String, + image_type: String, + image_size: Number, + audio_url: validFullURLParam, + audio_type: String, + audio_size: Number, + video_url: validFullURLParam, + video_type: String, + video_size: Number, + fields: [Match.Any], + }), + ); + + if (attachment.fields?.length) { + attachment.fields.map(validateAttachmentsFields); + } + + if (attachment.actions?.length) { + attachment.actions.map(validateAttachmentsActions); + } +}; + +const validateBodyAttachments = (attachments: any[]) => attachments.map(validateAttachment); + +export const validateMessage = async (message: any, room: any, user: any) => { + check( + message, + objectMaybeIncluding({ + _id: String, + msg: String, + text: String, + alias: String, + emoji: String, + tmid: String, + tshow: Boolean, + avatar: validPartialURLParam, + attachments: [Match.Any], + blocks: [Match.Any], + }), + ); + + if (message.alias || message.avatar) { + const isLiveChatGuest = !message.avatar && user.token && user.token === room.v?.token; + + if (!isLiveChatGuest && !(await hasPermissionAsync(user._id, 'message-impersonate', room._id))) { + throw new Error('Not enough permission'); + } + } + + if (Array.isArray(message.attachments) && message.attachments.length) { + validateBodyAttachments(message.attachments); + } +}; + +export function prepareMessageObject( + message: Partial, + rid: IRoom['_id'], + user: { _id: string; username?: string; name?: string }, +): asserts message is IMessage { + if (!message.ts) { + message.ts = new Date(); + } + + if (message.tshow !== true) { + delete message.tshow; + } + + const { _id, username, name } = user; + message.u = { + _id, + username: username as string, // FIXME: this is wrong but I don't want to change it now + name, + }; + message.rid = rid; + + if (!Match.test(message.msg, String)) { + message.msg = ''; + } + + if (message.ts == null) { + message.ts = new Date(); + } +} + +/** + * Validates and sends the message object. + */ +export const sendMessage = async function (user: any, message: any, room: any, upsert = false, previewUrls?: string[]) { + if (!user || !message || !room._id) { + return false; + } + + await validateMessage(message, room, user); + prepareMessageObject(message, room._id, user); + + if (message.t === 'otr') { + notifications.streamRoomMessage.emit(message.rid, message, user, room); + return message; + } + + if (settings.get('Message_Read_Receipt_Enabled')) { + message.unread = true; + } + + // For the Rocket.Chat Apps :) + if (Apps.self?.isLoaded()) { + const listenerBridge = Apps.getBridges()?.getListenerBridge(); + + const prevent = await listenerBridge?.messageEvent('IPreMessageSentPrevent', message); + if (prevent) { + return; + } + + const result = await listenerBridge?.messageEvent( + 'IPreMessageSentModify', + await listenerBridge?.messageEvent('IPreMessageSentExtend', message), + ); + + if (typeof result === 'object') { + message = Object.assign(message, result); + + // Some app may have inserted malicious/invalid values in the message, let's check it again + await validateMessage(message, room, user); + } + } + + parseUrlsInMessage(message, previewUrls); + + message = await Message.beforeSave({ message, room, user }); + + if (!message) { + return; + } + + if (message._id && upsert) { + const { _id } = message; + delete message._id; + await Messages.updateOne( + { + _id, + 'u._id': message.u._id, + }, + { $set: message }, + { upsert: true }, + ); + message._id = _id; + } else { + const messageAlreadyExists = message._id && (await Messages.findOneById(message._id, { projection: { _id: 1 } })); + if (messageAlreadyExists) { + return; + } + const { insertedId } = await Messages.insertOne(message); + message._id = insertedId; + } + + if (Apps.self?.isLoaded()) { + // This returns a promise, but it won't mutate anything about the message + // so, we don't really care if it is successful or fails + void Apps.getBridges()?.getListenerBridge().messageEvent('IPostMessageSent', message); + } + + /* Defer other updates as their return is not interesting to the user */ + + // Execute all callbacks + await callbacks.run('afterSaveMessage', message, room); + void broadcastMessageFromData({ + id: message._id, + }); + return message; +}; diff --git a/apps/meteor/app/lib/server/functions/updateMessage.ts b/apps/meteor/app/lib/server/functions/updateMessage.ts index 9c544bd9a333..6b3cb9ef64f5 100644 --- a/apps/meteor/app/lib/server/functions/updateMessage.ts +++ b/apps/meteor/app/lib/server/functions/updateMessage.ts @@ -1,10 +1,11 @@ +import { AppEvents, Apps } from '@rocket.chat/apps'; import { Message } from '@rocket.chat/core-services'; -import type { IEditedMessage, IMessage, IUser, AtLeast } from '@rocket.chat/core-typings'; +import type { IMessage, IUser, AtLeast } from '@rocket.chat/core-typings'; import { Messages, Rooms } from '@rocket.chat/models'; import { Meteor } from 'meteor/meteor'; -import { Apps } from '../../../../ee/server/apps'; import { callbacks } from '../../../../lib/callbacks'; +import { broadcastMessageFromData } from '../../../../server/modules/watchers/lib/messages'; import { settings } from '../../../settings/server'; import { parseUrlsInMessage } from './parseUrlsInMessage'; @@ -15,31 +16,33 @@ export const updateMessage = async function ( previewUrls?: string[], ): Promise { const originalMessage = originalMsg || (await Messages.findOneById(message._id)); + if (!originalMessage) { + throw new Error('Invalid message ID.'); + } - // For the Rocket.Chat Apps :) - if (message && Apps && Apps.isLoaded()) { - const appMessage = Object.assign({}, originalMessage, message); + let messageData: IMessage = Object.assign({}, originalMessage, message); - const prevent = await Apps.getBridges()?.getListenerBridge().messageEvent('IPreMessageUpdatedPrevent', appMessage); + // For the Rocket.Chat Apps :) + if (message && Apps.self && Apps.isLoaded()) { + const prevent = await Apps.getBridges().getListenerBridge().messageEvent(AppEvents.IPreMessageUpdatedPrevent, messageData); if (prevent) { throw new Meteor.Error('error-app-prevented-updating', 'A Rocket.Chat App prevented the message updating.'); } - let result; - result = await Apps.getBridges()?.getListenerBridge().messageEvent('IPreMessageUpdatedExtend', appMessage); - result = await Apps.getBridges()?.getListenerBridge().messageEvent('IPreMessageUpdatedModify', result); + let result = await Apps.getBridges().getListenerBridge().messageEvent(AppEvents.IPreMessageUpdatedExtend, messageData); + result = await Apps.getBridges().getListenerBridge().messageEvent(AppEvents.IPreMessageUpdatedModify, result); if (typeof result === 'object') { - message = Object.assign(appMessage, result); + Object.assign(messageData, result); } } // If we keep history of edits, insert a new message to store history information if (settings.get('Message_KeepHistory')) { - await Messages.cloneAndSaveAsHistoryById(message._id, user as Required>); + await Messages.cloneAndSaveAsHistoryById(messageData._id, user as Required>); } - Object.assign, Omit>(message, { + Object.assign(messageData, { editedAt: new Date(), editedBy: { _id: user._id, @@ -47,19 +50,16 @@ export const updateMessage = async function ( }, }); - parseUrlsInMessage(message, previewUrls); + parseUrlsInMessage(messageData, previewUrls); - const room = await Rooms.findOneById(message.rid); + const room = await Rooms.findOneById(messageData.rid); if (!room) { return; } - // TODO remove type cast - message = await Message.beforeSave({ message: message as IMessage, room, user }); - - message = await callbacks.run('beforeSaveMessage', message); + messageData = await Message.beforeSave({ message: messageData, room, user }); - const { _id, ...editedMessage } = message; + const { _id, ...editedMessage } = messageData; if (!editedMessage.msg) { delete editedMessage.md; @@ -76,16 +76,20 @@ export const updateMessage = async function ( }, ); - if (Apps?.isLoaded()) { + if (Apps.self?.isLoaded()) { // This returns a promise, but it won't mutate anything about the message // so, we don't really care if it is successful or fails - void Apps.getBridges()?.getListenerBridge().messageEvent('IPostMessageUpdated', message); + void Apps.getBridges()?.getListenerBridge().messageEvent(AppEvents.IPostMessageUpdated, messageData); } setImmediate(async () => { const msg = await Messages.findOneById(_id); if (msg) { await callbacks.run('afterSaveMessage', msg, room, user._id); + void broadcastMessageFromData({ + id: msg._id, + data: msg, + }); } }); }; diff --git a/apps/meteor/app/lib/server/index.ts b/apps/meteor/app/lib/server/index.ts index 8fa779ec9644..80aaa2a64a9e 100644 --- a/apps/meteor/app/lib/server/index.ts +++ b/apps/meteor/app/lib/server/index.ts @@ -21,8 +21,7 @@ import './methods/createToken'; import './methods/deleteMessage'; import './methods/deleteUserOwnAccount'; import './methods/executeSlashCommandPreview'; -import './startup/filterATAllTag'; -import './startup/filterATHereTag'; +import './startup/mentionUserNotInChannel'; import './methods/getChannelHistory'; import './methods/getRoomJoinCode'; import './methods/getRoomRoles'; diff --git a/apps/meteor/app/lib/server/lib/RateLimiter.js b/apps/meteor/app/lib/server/lib/RateLimiter.js index b8c069ed290e..126b236426da 100644 --- a/apps/meteor/app/lib/server/lib/RateLimiter.js +++ b/apps/meteor/app/lib/server/lib/RateLimiter.js @@ -7,13 +7,60 @@ export const RateLimiterClass = new (class { if (process.env.TEST_MODE === 'true') { return fn; } - const rateLimiter = new RateLimiter(); + const rateLimiter = new (class extends RateLimiter { + async check(input) { + const reply = { + allowed: true, + timeToReset: 0, + numInvocationsLeft: Infinity, + }; + + const matchedRules = this._findAllMatchingRules(input); + + for await (const rule of matchedRules) { + const ruleResult = await rule.apply(input); + let numInvocations = rule.counters[ruleResult.key]; + + if (ruleResult.timeToNextReset < 0) { + // Reset all the counters since the rule has reset + await rule.resetCounter(); + ruleResult.timeSinceLastReset = new Date().getTime() - rule._lastResetTime; + ruleResult.timeToNextReset = rule.options.intervalTime; + numInvocations = 0; + } + + if (numInvocations > rule.options.numRequestsAllowed) { + // Only update timeToReset if the new time would be longer than the + // previously set time. This is to ensure that if this input triggers + // multiple rules, we return the longest period of time until they can + // successfully make another call + if (reply.timeToReset < ruleResult.timeToNextReset) { + reply.timeToReset = ruleResult.timeToNextReset; + } + reply.allowed = false; + reply.numInvocationsLeft = 0; + reply.ruleId = rule.id; + await rule._executeCallback(reply, input); + } else { + // If this is an allowed attempt and we haven't failed on any of the + // other rules that match, update the reply field. + if (rule.options.numRequestsAllowed - numInvocations < reply.numInvocationsLeft && reply.allowed) { + reply.timeToReset = ruleResult.timeToNextReset; + reply.numInvocationsLeft = rule.options.numRequestsAllowed - numInvocations; + } + reply.ruleId = rule.id; + await rule._executeCallback(reply, input); + } + } + return reply; + } + })(); Object.entries(matchers).forEach(([key, matcher]) => { - matchers[key] = (...args) => Promise.await(matcher(...args)); + matchers[key] = matcher; }); rateLimiter.addRule(matchers, numRequests, timeInterval); - return function (...args) { + return async function (...args) { const match = {}; Object.keys(matchers).forEach((key) => { @@ -21,7 +68,7 @@ export const RateLimiterClass = new (class { }); rateLimiter.increment(match); - const rateLimitResult = rateLimiter.check(match); + const rateLimitResult = await rateLimiter.check(match); if (rateLimitResult.allowed) { return fn.apply(null, args); } diff --git a/apps/meteor/app/lib/server/lib/loginErrorMessageOverride.js b/apps/meteor/app/lib/server/lib/loginErrorMessageOverride.js deleted file mode 100644 index 4e054b81b2cf..000000000000 --- a/apps/meteor/app/lib/server/lib/loginErrorMessageOverride.js +++ /dev/null @@ -1,14 +0,0 @@ -// Do not disclose if user exists when password is invalid -import { Accounts } from 'meteor/accounts-base'; -import { Meteor } from 'meteor/meteor'; - -const { _runLoginHandlers } = Accounts; -Accounts._runLoginHandlers = function (methodInvocation, options) { - const result = _runLoginHandlers.call(Accounts, methodInvocation, options); - - if (result.error && result.error.reason === 'Incorrect password') { - result.error = new Meteor.Error(403, 'User not found'); - } - - return result; -}; diff --git a/apps/meteor/app/lib/server/lib/loginErrorMessageOverride.ts b/apps/meteor/app/lib/server/lib/loginErrorMessageOverride.ts new file mode 100644 index 000000000000..e2a6e0d10581 --- /dev/null +++ b/apps/meteor/app/lib/server/lib/loginErrorMessageOverride.ts @@ -0,0 +1,16 @@ +// Do not disclose if user exists when password is invalid +import { Accounts } from 'meteor/accounts-base'; +import { Meteor } from 'meteor/meteor'; + +const { _runLoginHandlers } = Accounts; + +Accounts._options.ambiguousErrorMessages = true; +Accounts._runLoginHandlers = async function (methodInvocation, options) { + const result = await _runLoginHandlers.call(Accounts, methodInvocation, options); + + if (result.error instanceof Meteor.Error) { + result.error = new Meteor.Error(401, 'User not found'); + } + + return result; +}; diff --git a/apps/meteor/app/lib/server/lib/notifyUsersOnMessage.js b/apps/meteor/app/lib/server/lib/notifyUsersOnMessage.js deleted file mode 100644 index 8c70ee3f9a4f..000000000000 --- a/apps/meteor/app/lib/server/lib/notifyUsersOnMessage.js +++ /dev/null @@ -1,194 +0,0 @@ -import { Subscriptions, Rooms } from '@rocket.chat/models'; -import { escapeRegExp } from '@rocket.chat/string-helpers'; -import moment from 'moment'; - -import { callbacks } from '../../../../lib/callbacks'; -import { settings } from '../../../settings/server'; - -/** - * Chechs if a messages contains a user highlight - * - * @param {string} message - * @param {array|undefined} highlights - * - * @returns {boolean} - */ -function messageContainsHighlight(message, highlights) { - if (!highlights || highlights.length === 0) { - return false; - } - - return highlights.some((highlight) => { - const regexp = new RegExp(escapeRegExp(highlight), 'i'); - return regexp.test(message.msg); - }); -} - -export async function getMentions(message) { - const { - mentions, - u: { _id: senderId }, - } = message; - - if (!mentions) { - return { - toAll: false, - toHere: false, - mentionIds: [], - }; - } - - const toAll = mentions.some(({ _id }) => _id === 'all'); - const toHere = mentions.some(({ _id }) => _id === 'here'); - - const userMentions = mentions.filter((mention) => !mention.type || mention.type === 'user'); - const otherMentions = mentions.filter((mention) => mention?.type !== 'user'); - - const filteredMentions = userMentions.filter(({ _id }) => _id !== senderId && !['all', 'here'].includes(_id)).map(({ _id }) => _id); - - const mentionIds = await callbacks.run('beforeGetMentions', filteredMentions, { - userMentions, - otherMentions, - message, - }); - - return { - toAll, - toHere, - mentionIds, - }; -} - -const incGroupMentions = async (rid, roomType, excludeUserId, unreadCount) => { - const incUnreadByGroup = ['all_messages', 'group_mentions_only', 'user_and_group_mentions_only'].includes(unreadCount); - const incUnread = roomType === 'd' || roomType === 'l' || incUnreadByGroup ? 1 : 0; - - await Subscriptions.incGroupMentionsAndUnreadForRoomIdExcludingUserId(rid, excludeUserId, 1, incUnread); -}; - -const incUserMentions = async (rid, roomType, uids, unreadCount) => { - const incUnreadByUser = ['all_messages', 'user_mentions_only', 'user_and_group_mentions_only'].includes(unreadCount); - const incUnread = roomType === 'd' || roomType === 'l' || incUnreadByUser ? 1 : 0; - - await Subscriptions.incUserMentionsAndUnreadForRoomIdAndUserIds(rid, uids, 1, incUnread); -}; - -const getUserIdsFromHighlights = async (rid, message) => { - const highlightOptions = { projection: { 'userHighlights': 1, 'u._id': 1 } }; - const subs = await Subscriptions.findByRoomWithUserHighlights(rid, highlightOptions).toArray(); - - return subs - .filter( - ({ userHighlights, u: { _id: uid } }) => userHighlights && messageContainsHighlight(message, userHighlights) && uid !== message.u._id, - ) - .map(({ u: { _id: uid } }) => uid); -}; - -/* - * {IRoom['t']} roomType - The type of the room - * @returns {string} - The setting value for unread count - */ -const getUnreadSettingCount = (roomType) => { - let unreadSetting = 'Unread_Count'; - switch (roomType) { - case 'd': { - unreadSetting = 'Unread_Count_DM'; - break; - } - case 'l': { - unreadSetting = 'Unread_Count_Omni'; - break; - } - } - - return settings.get(unreadSetting); -}; - -async function updateUsersSubscriptions(message, room) { - // Don't increase unread counter on thread messages - if (room != null && !message.tmid) { - const { toAll, toHere, mentionIds } = await getMentions(message); - - const userIds = new Set(mentionIds); - - const unreadCount = getUnreadSettingCount(room.t); - - (await getUserIdsFromHighlights(room._id, message)).forEach((uid) => userIds.add(uid)); - - // give priority to user mentions over group mentions - if (userIds.size > 0) { - await incUserMentions(room._id, room.t, [...userIds], unreadCount); - } else if (toAll || toHere) { - await incGroupMentions(room._id, room.t, message.u._id, unreadCount); - } - - // this shouldn't run only if has group mentions because it will already exclude mentioned users from the query - if (!toAll && !toHere && unreadCount === 'all_messages') { - await Subscriptions.incUnreadForRoomIdExcludingUserIds(room._id, [...userIds, message.u._id]); - } - } - - // Update all other subscriptions to alert their owners but without incrementing - // the unread counter, as it is only for mentions and direct messages - // We now set alert and open properties in two separate update commands. This proved to be more efficient on MongoDB - because it uses a more efficient index. - await Promise.all([ - Subscriptions.setAlertForRoomIdExcludingUserId(message.rid, message.u._id), - Subscriptions.setOpenForRoomIdExcludingUserId(message.rid, message.u._id), - ]); -} - -export async function updateThreadUsersSubscriptions(message, room, replies) { - // const unreadCount = settings.get('Unread_Count'); - - // incUserMentions(room._id, room.t, replies, unreadCount); - - await Subscriptions.setAlertForRoomIdAndUserIds(message.rid, replies); - - const repliesPlusSender = [...new Set([message.u._id, ...replies])]; - - await Subscriptions.setOpenForRoomIdAndUserIds(message.rid, repliesPlusSender); - - await Subscriptions.setLastReplyForRoomIdAndUserIds(message.rid, repliesPlusSender, new Date()); -} - -export async function notifyUsersOnMessage(message, room) { - // skips this callback if the message was edited and increments it if the edit was way in the past (aka imported) - if (message.editedAt) { - if (Math.abs(moment(message.editedAt).diff()) > 60000) { - // TODO: Review as I am not sure how else to get around this as the incrementing of the msgs count shouldn't be in this callback - await Rooms.incMsgCountById(message.rid, 1); - return message; - } - - // only updates last message if it was edited (skip rest of callback) - if ( - settings.get('Store_Last_Message') && - (!message.tmid || message.tshow) && - (!room.lastMessage || room.lastMessage._id === message._id) - ) { - await Rooms.setLastMessageById(message.rid, message); - } - - return message; - } - - if (message.ts && Math.abs(moment(message.ts).diff()) > 60000) { - await Rooms.incMsgCountById(message.rid, 1); - return message; - } - - // if message sent ONLY on a thread, skips the rest as it is done on a callback specific to threads - if (message.tmid && !message.tshow) { - await Rooms.incMsgCountById(message.rid, 1); - return message; - } - - // Update all the room activity tracker fields - await Rooms.incMsgCountAndSetLastMessageById(message.rid, 1, message.ts, settings.get('Store_Last_Message') && message); - - await updateUsersSubscriptions(message, room); - - return message; -} - -callbacks.add('afterSaveMessage', (message, room) => notifyUsersOnMessage(message, room), callbacks.priority.LOW, 'notifyUsersOnMessage'); diff --git a/apps/meteor/app/lib/server/lib/notifyUsersOnMessage.ts b/apps/meteor/app/lib/server/lib/notifyUsersOnMessage.ts new file mode 100644 index 000000000000..76a18eba3362 --- /dev/null +++ b/apps/meteor/app/lib/server/lib/notifyUsersOnMessage.ts @@ -0,0 +1,188 @@ +import type { IMessage, IRoom, IUser, RoomType } from '@rocket.chat/core-typings'; +import { isEditedMessage } from '@rocket.chat/core-typings'; +import { Subscriptions, Rooms } from '@rocket.chat/models'; +import { escapeRegExp } from '@rocket.chat/string-helpers'; +import moment from 'moment'; + +import { callbacks } from '../../../../lib/callbacks'; +import { settings } from '../../../settings/server'; + +function messageContainsHighlight(message: IMessage, highlights: string[]): boolean { + if (!highlights || highlights.length === 0) return false; + + return highlights.some((highlight: string) => { + const regexp = new RegExp(escapeRegExp(highlight), 'i'); + return regexp.test(message.msg); + }); +} + +export async function getMentions(message: IMessage): Promise<{ toAll: boolean; toHere: boolean; mentionIds: string[] }> { + const { + mentions, + u: { _id: senderId }, + } = message; + + if (!mentions) { + return { + toAll: false, + toHere: false, + mentionIds: [], + }; + } + + const toAll = mentions.some(({ _id }) => _id === 'all'); + const toHere = mentions.some(({ _id }) => _id === 'here'); + + const teamsMentions = mentions.filter((mention) => mention.type === 'team'); + const filteredMentions = mentions + .filter((mention) => !mention.type || mention.type === 'user') + .filter(({ _id }) => _id !== senderId && !['all', 'here'].includes(_id)) + .map(({ _id }) => _id); + + const mentionIds = await callbacks.run('beforeGetMentions', filteredMentions, teamsMentions); + + return { + toAll, + toHere, + mentionIds, + }; +} + +type UnreadCountType = 'all_messages' | 'user_mentions_only' | 'group_mentions_only' | 'user_and_group_mentions_only'; + +const incGroupMentions = async ( + rid: IRoom['_id'], + roomType: RoomType, + excludeUserId: IUser['_id'], + unreadCount: Exclude, +): Promise => { + const incUnreadByGroup = ['all_messages', 'group_mentions_only', 'user_and_group_mentions_only'].includes(unreadCount); + const incUnread = roomType === 'd' || roomType === 'l' || incUnreadByGroup ? 1 : 0; + await Subscriptions.incGroupMentionsAndUnreadForRoomIdExcludingUserId(rid, excludeUserId, 1, incUnread); +}; + +const incUserMentions = async ( + rid: IRoom['_id'], + roomType: RoomType, + uids: IUser['_id'][], + unreadCount: Exclude, +): Promise => { + const incUnreadByUser = new Set(['all_messages', 'user_mentions_only', 'user_and_group_mentions_only']).has(unreadCount); + const incUnread = roomType === 'd' || roomType === 'l' || incUnreadByUser ? 1 : 0; + await Subscriptions.incUserMentionsAndUnreadForRoomIdAndUserIds(rid, uids, 1, incUnread); +}; + +export const getUserIdsFromHighlights = async (rid: IRoom['_id'], message: IMessage): Promise => { + const highlightOptions = { projection: { 'userHighlights': 1, 'u._id': 1 } }; + const subs = await Subscriptions.findByRoomWithUserHighlights(rid, highlightOptions).toArray(); + + return subs + .filter( + ({ userHighlights, u: { _id: uid } }) => userHighlights && messageContainsHighlight(message, userHighlights) && uid !== message.u._id, + ) + .map(({ u: { _id: uid } }) => uid); +}; + +const getUnreadSettingCount = (roomType: RoomType): UnreadCountType => { + let unreadSetting = 'Unread_Count'; + switch (roomType) { + case 'd': { + unreadSetting = 'Unread_Count_DM'; + break; + } + case 'l': { + unreadSetting = 'Unread_Count_Omni'; + break; + } + } + + return settings.get(unreadSetting); +}; + +async function updateUsersSubscriptions(message: IMessage, room: IRoom): Promise { + // Don't increase unread counter on thread messages + if (room != null && !message.tmid) { + const { toAll, toHere, mentionIds } = await getMentions(message); + + const userIds = new Set(mentionIds); + + const unreadCount = getUnreadSettingCount(room.t); + + (await getUserIdsFromHighlights(room._id, message)).forEach((uid) => userIds.add(uid)); + + // Give priority to user mentions over group mentions + if (userIds.size > 0) { + await incUserMentions(room._id, room.t, [...userIds], unreadCount as Exclude); + } else if (toAll || toHere) { + await incGroupMentions(room._id, room.t, message.u._id, unreadCount as Exclude); + } + + // this shouldn't run only if has group mentions because it will already exclude mentioned users from the query + if (!toAll && !toHere && unreadCount === 'all_messages') { + await Subscriptions.incUnreadForRoomIdExcludingUserIds(room._id, [...userIds, message.u._id], 1); + } + } + + // Update all other subscriptions to alert their owners but without incrementing + // the unread counter, as it is only for mentions and direct messages + // We now set alert and open properties in two separate update commands. This proved to be more efficient on MongoDB - because it uses a more efficient index. + await Promise.all([ + Subscriptions.setAlertForRoomIdExcludingUserId(message.rid, message.u._id), + Subscriptions.setOpenForRoomIdExcludingUserId(message.rid, message.u._id), + ]); +} + +export async function updateThreadUsersSubscriptions(message: IMessage, replies: IUser['_id'][]): Promise { + // Don't increase unread counter on thread messages + + await Subscriptions.setAlertForRoomIdAndUserIds(message.rid, replies); + const repliesPlusSender = [...new Set([message.u._id, ...replies])]; + await Subscriptions.setOpenForRoomIdAndUserIds(message.rid, repliesPlusSender); + await Subscriptions.setLastReplyForRoomIdAndUserIds(message.rid, repliesPlusSender, new Date()); +} + +export async function notifyUsersOnMessage(message: IMessage, room: IRoom): Promise { + // Skips this callback if the message was edited and increments it if the edit was way in the past (aka imported) + if (isEditedMessage(message)) { + if (Math.abs(moment(message.editedAt).diff(Date.now())) > 60000) { + // TODO: Review as I am not sure how else to get around this as the incrementing of the msgs count shouldn't be in this callback + await Rooms.incMsgCountById(message.rid, 1); + return message; + } + + // Only updates last message if it was edited (skip rest of callback) + if ( + settings.get('Store_Last_Message') && + (!message.tmid || message.tshow) && + (!room.lastMessage || room.lastMessage._id === message._id) + ) { + await Rooms.setLastMessageById(message.rid, message); + } + + return message; + } + + if (message.ts && Math.abs(moment(message.ts).diff(Date.now())) > 60000) { + await Rooms.incMsgCountById(message.rid, 1); + return message; + } + + // If message sent ONLY on a thread, skips the rest as it is done on a callback specific to threads + if (message.tmid && !message.tshow) { + await Rooms.incMsgCountById(message.rid, 1); + return message; + } + + // Update all the room activity tracker fields + await Rooms.incMsgCountAndSetLastMessageById(message.rid, 1, message.ts, settings.get('Store_Last_Message') ? message : undefined); + await updateUsersSubscriptions(message, room); + + return message; +} + +callbacks.add( + 'afterSaveMessage', + (message, room) => notifyUsersOnMessage(message, room), + callbacks.priority.MEDIUM, + 'notifyUsersOnMessage', +); diff --git a/apps/meteor/app/lib/server/lib/sendNotificationsOnMessage.js b/apps/meteor/app/lib/server/lib/sendNotificationsOnMessage.js deleted file mode 100644 index ce262e4e6756..000000000000 --- a/apps/meteor/app/lib/server/lib/sendNotificationsOnMessage.js +++ /dev/null @@ -1,408 +0,0 @@ -import { Room } from '@rocket.chat/core-services'; -import { Subscriptions, Users } from '@rocket.chat/models'; -import { Meteor } from 'meteor/meteor'; -import moment from 'moment'; - -import { callbacks } from '../../../../lib/callbacks'; -import { roomCoordinator } from '../../../../server/lib/rooms/roomCoordinator'; -import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; -import { Notification } from '../../../notification-queue/server/NotificationQueue'; -import { settings } from '../../../settings/server'; -import { messageContainsHighlight, parseMessageTextPerUser, replaceMentionedUsernamesWithFullNames } from '../functions/notifications'; -import { notifyDesktopUser, shouldNotifyDesktop } from '../functions/notifications/desktop'; -import { getEmailData, shouldNotifyEmail } from '../functions/notifications/email'; -import { getPushData, shouldNotifyMobile } from '../functions/notifications/mobile'; -import { getMentions } from './notifyUsersOnMessage'; - -let TroubleshootDisableNotifications; - -export const sendNotification = async ({ - subscription, - sender, - hasReplyToThread, - hasMentionToAll, - hasMentionToHere, - message, - notificationMessage, - room, - mentionIds, - disableAllMessageNotifications, -}) => { - if (TroubleshootDisableNotifications === true) { - return; - } - - // don't notify the sender - if (subscription.u._id === sender._id) { - return; - } - - const hasMentionToUser = mentionIds.includes(subscription.u._id); - - // mute group notifications (@here and @all) if not directly mentioned as well - if (!hasMentionToUser && !hasReplyToThread && subscription.muteGroupMentions && (hasMentionToAll || hasMentionToHere)) { - return; - } - - if (!subscription.receiver) { - subscription.receiver = [ - await Users.findOneById(subscription.u._id, { - projection: { - active: 1, - emails: 1, - language: 1, - status: 1, - statusConnection: 1, - username: 1, - }, - }), - ]; - } - - const [receiver] = subscription.receiver; - - const roomType = room.t; - // If the user doesn't have permission to view direct messages, don't send notification of direct messages. - if (roomType === 'd' && !(await hasPermissionAsync(subscription.u._id, 'view-d-room'))) { - return; - } - - const isThread = !!message.tmid && !message.tshow; - - notificationMessage = await parseMessageTextPerUser(notificationMessage, message, receiver); - - const isHighlighted = messageContainsHighlight(message, subscription.userHighlights); - - const { desktopNotifications, mobilePushNotifications, emailNotifications } = subscription; - - // busy users don't receive desktop notification - if ( - shouldNotifyDesktop({ - disableAllMessageNotifications, - status: receiver.status, - statusConnection: receiver.statusConnection, - desktopNotifications, - hasMentionToAll, - hasMentionToHere, - isHighlighted, - hasMentionToUser, - hasReplyToThread, - roomType, - isThread, - }) - ) { - await notifyDesktopUser({ - notificationMessage, - userId: subscription.u._id, - user: sender, - message, - room, - }); - } - - const queueItems = []; - - if ( - shouldNotifyMobile({ - disableAllMessageNotifications, - mobilePushNotifications, - hasMentionToAll, - isHighlighted, - hasMentionToUser, - hasReplyToThread, - roomType, - isThread, - }) - ) { - queueItems.push({ - type: 'push', - data: await getPushData({ - notificationMessage, - room, - message, - userId: subscription.u._id, - senderUsername: sender.username, - senderName: sender.name, - receiver, - }), - }); - } - - if ( - receiver.emails && - shouldNotifyEmail({ - disableAllMessageNotifications, - statusConnection: receiver.statusConnection, - emailNotifications, - isHighlighted, - hasMentionToUser, - hasMentionToAll, - hasReplyToThread, - roomType, - isThread, - }) - ) { - for await (const email of receiver.emails) { - if (email.verified) { - queueItems.push({ - type: 'email', - data: await getEmailData({ - message, - receiver, - sender, - subscription, - room, - emailAddress: email.address, - hasMentionToUser, - }), - }); - - break; - } - } - } - - if (queueItems.length) { - Notification.scheduleItem({ - user: receiver, - uid: subscription.u._id, - rid: room._id, - mid: message._id, - items: queueItems, - }); - } -}; - -const project = { - $project: { - 'desktopNotifications': 1, - 'emailNotifications': 1, - 'mobilePushNotifications': 1, - 'muteGroupMentions': 1, - 'name': 1, - 'rid': 1, - 'userHighlights': 1, - 'u._id': 1, - 'receiver.active': 1, - 'receiver.emails': 1, - 'receiver.language': 1, - 'receiver.status': 1, - 'receiver.statusConnection': 1, - 'receiver.username': 1, - }, -}; - -const filter = { - $match: { - 'receiver.active': true, - }, -}; - -const lookup = { - $lookup: { - from: 'users', - localField: 'u._id', - foreignField: '_id', - as: 'receiver', - }, -}; - -export async function sendMessageNotifications(message, room, usersInThread = []) { - if (TroubleshootDisableNotifications === true) { - return; - } - - const sender = await roomCoordinator.getRoomDirectives(room.t).getMsgSender(message.u._id); - if (!sender) { - return message; - } - - const { toAll: hasMentionToAll, toHere: hasMentionToHere, mentionIds } = await getMentions(message); - - const mentionIdsWithoutGroups = [...mentionIds]; - - // getMentions removes `all` and `here` from mentionIds so we need to add them back for compatibility - if (hasMentionToAll) { - mentionIds.push('all'); - } - if (hasMentionToHere) { - mentionIds.push('here'); - } - - // add users in thread to mentions array because they follow the same rules - mentionIds.push(...usersInThread); - - let notificationMessage = await callbacks.run('beforeSendMessageNotifications', message.msg); - if (mentionIds.length > 0 && settings.get('UI_Use_Real_Name')) { - notificationMessage = replaceMentionedUsernamesWithFullNames(message.msg, message.mentions); - } - - // Don't fetch all users if room exceeds max members - const maxMembersForNotification = settings.get('Notifications_Max_Room_Members'); - const roomMembersCount = await Users.countRoomMembers(room._id); - const disableAllMessageNotifications = roomMembersCount > maxMembersForNotification && maxMembersForNotification !== 0; - - const query = { - rid: room._id, - ignored: { $ne: sender._id }, - disableNotifications: { $ne: true }, - $or: [{ 'userHighlights.0': { $exists: 1 } }, ...(usersInThread.length > 0 ? [{ 'u._id': { $in: usersInThread } }] : [])], - }; - - ['audio', 'desktop', 'mobile', 'email'].forEach((kind) => { - const notificationField = `${kind === 'mobile' ? 'mobilePush' : kind}Notifications`; - - const filter = { [notificationField]: 'all' }; - - if (disableAllMessageNotifications) { - filter[`${kind}PrefOrigin`] = { $ne: 'user' }; - } - - query.$or.push(filter); - - if (mentionIdsWithoutGroups.length > 0) { - query.$or.push({ - [notificationField]: 'mentions', - 'u._id': { $in: mentionIdsWithoutGroups }, - }); - } else if (!disableAllMessageNotifications && (hasMentionToAll || hasMentionToHere)) { - query.$or.push({ - [notificationField]: 'mentions', - }); - } - - const serverField = kind === 'email' ? 'emailNotificationMode' : `${kind}Notifications`; - const serverPreference = settings.get(`Accounts_Default_User_Preferences_${serverField}`); - if ( - (room.t === 'd' && serverPreference !== 'nothing') || - (!disableAllMessageNotifications && (serverPreference === 'all' || hasMentionToAll || hasMentionToHere)) - ) { - query.$or.push({ - [notificationField]: { $exists: false }, - }); - } else if (serverPreference === 'mentions' && mentionIdsWithoutGroups.length > 0) { - query.$or.push({ - [notificationField]: { $exists: false }, - 'u._id': { $in: mentionIdsWithoutGroups }, - }); - } - }); - - // the find below is crucial. All subscription records returned will receive at least one kind of notification. - // the query is defined by the server's default values and Notifications_Max_Room_Members setting. - - const subscriptions = await Subscriptions.col.aggregate([{ $match: query }, lookup, filter, project]).toArray(); - - subscriptions.forEach( - (subscription) => - void sendNotification({ - subscription, - sender, - hasMentionToAll, - hasMentionToHere, - message, - notificationMessage, - room, - mentionIds, - disableAllMessageNotifications, - hasReplyToThread: usersInThread && usersInThread.includes(subscription.u._id), - }), - ); - - return { - sender, - hasMentionToAll, - hasMentionToHere, - notificationMessage, - mentionIds, - mentionIdsWithoutGroups, - }; -} - -export async function sendAllNotifications(message, room) { - if (TroubleshootDisableNotifications === true) { - return message; - } - - // threads - if (message.tmid) { - return message; - } - // skips this callback if the message was edited - if (message.editedAt) { - return message; - } - - if (message.ts && Math.abs(moment(message.ts).diff()) > 60000) { - return message; - } - - if (!room || room.t == null) { - return message; - } - - const { sender, hasMentionToAll, hasMentionToHere, notificationMessage, mentionIds, mentionIdsWithoutGroups } = - await sendMessageNotifications(message, room); - - // on public channels, if a mentioned user is not member of the channel yet, he will first join the channel and then be notified based on his preferences. - if (room.t === 'c') { - // get subscriptions from users already in room (to not send them a notification) - const mentions = [...mentionIdsWithoutGroups]; - const cursor = Subscriptions.findByRoomIdAndUserIds(room._id, mentionIdsWithoutGroups, { - projection: { 'u._id': 1 }, - }); - - for await (const subscription of cursor) { - const index = mentions.indexOf(subscription.u._id); - if (index !== -1) { - mentions.splice(index, 1); - } - } - - const users = await Promise.all( - mentions.map(async (userId) => { - await Room.join({ room, user: { _id: userId } }); - - return userId; - }), - ).catch((error) => { - throw new Meteor.Error(error); - }); - - const subscriptions = await Subscriptions.findByRoomIdAndUserIds(room._id, users).toArray(); - users.forEach((userId) => { - const subscription = subscriptions.find((subscription) => subscription.u._id === userId); - - void sendNotification({ - subscription, - sender, - hasMentionToAll, - hasMentionToHere, - message, - notificationMessage, - room, - mentionIds, - }); - }); - } - - return message; -} - -settings.watch('Troubleshoot_Disable_Notifications', (value) => { - if (TroubleshootDisableNotifications === value) { - return; - } - TroubleshootDisableNotifications = value; - - if (value) { - return callbacks.remove('afterSaveMessage', 'sendNotificationsOnMessage'); - } - - callbacks.add( - 'afterSaveMessage', - (message, room) => sendAllNotifications(message, room), - callbacks.priority.LOW, - 'sendNotificationsOnMessage', - ); -}); diff --git a/apps/meteor/app/lib/server/lib/sendNotificationsOnMessage.ts b/apps/meteor/app/lib/server/lib/sendNotificationsOnMessage.ts new file mode 100644 index 000000000000..44654428ae8f --- /dev/null +++ b/apps/meteor/app/lib/server/lib/sendNotificationsOnMessage.ts @@ -0,0 +1,413 @@ +import { + type IMessage, + type ISubscription, + type IUser, + type IRoom, + type NotificationItem, + isEditedMessage, + type AtLeast, +} from '@rocket.chat/core-typings'; +import { Subscriptions, Users } from '@rocket.chat/models'; +import emojione from 'emojione'; +import moment from 'moment'; +import type { RootFilterOperators } from 'mongodb'; + +import { callbacks } from '../../../../lib/callbacks'; +import { roomCoordinator } from '../../../../server/lib/rooms/roomCoordinator'; +import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; +import { Notification } from '../../../notification-queue/server/NotificationQueue'; +import { settings } from '../../../settings/server'; +import { messageContainsHighlight, parseMessageTextPerUser, replaceMentionedUsernamesWithFullNames } from '../functions/notifications'; +import { notifyDesktopUser, shouldNotifyDesktop } from '../functions/notifications/desktop'; +import { getEmailData, shouldNotifyEmail } from '../functions/notifications/email'; +import { getPushData, shouldNotifyMobile } from '../functions/notifications/mobile'; +import { getMentions } from './notifyUsersOnMessage'; + +type SubscriptionAggregation = { + receiver: [Pick | null]; +} & Pick< + ISubscription, + 'desktopNotifications' | 'emailNotifications' | 'mobilePushNotifications' | 'muteGroupMentions' | 'name' | 'rid' | 'userHighlights' | 'u' +>; + +type WithRequiredProperty = Type & { + [Property in Key]-?: Type[Property]; +}; + +export const sendNotification = async ({ + subscription, + sender, + hasReplyToThread, + hasMentionToAll, + hasMentionToHere, + message, + notificationMessage, + room, + mentionIds, + disableAllMessageNotifications, +}: { + subscription: SubscriptionAggregation; + sender: Pick; + + hasReplyToThread: boolean; + hasMentionToAll: boolean; + hasMentionToHere: boolean; + message: AtLeast; + notificationMessage: string; + room: IRoom; + mentionIds: string[]; + disableAllMessageNotifications: boolean; +}) => { + if (settings.get('Troubleshoot_Disable_Notifications') === true) { + return; + } + + // don't notify the sender + if (subscription.u._id === sender._id) { + return; + } + + const hasMentionToUser = mentionIds.includes(subscription.u._id); + + // mute group notifications (@here and @all) if not directly mentioned as well + if (!hasMentionToUser && !hasReplyToThread && subscription.muteGroupMentions && (hasMentionToAll || hasMentionToHere)) { + return; + } + + if (!subscription.receiver) { + subscription.receiver = [ + await Users.findOneById(subscription.u._id, { + projection: { + 'active': 1, + 'emails': 1, + 'language': 1, + 'status': 1, + 'statusConnection': 1, + 'username': 1, + 'settings.preferences.enableMobileRinging': 1, + }, + }), + ]; + } + + const [receiver] = subscription.receiver; + + if (!receiver) { + throw new Error('receiver not found'); + } + + const roomType = room.t; + // If the user doesn't have permission to view direct messages, don't send notification of direct messages. + if (roomType === 'd' && !(await hasPermissionAsync(subscription.u._id, 'view-d-room'))) { + return; + } + + const isThread = !!message.tmid && !message.tshow; + const isVideoConf = message.t === 'videoconf'; + + notificationMessage = await parseMessageTextPerUser(notificationMessage, message, receiver); + + const isHighlighted = messageContainsHighlight(message, subscription.userHighlights); + + const { desktopNotifications, mobilePushNotifications, emailNotifications } = subscription; + + // busy users don't receive desktop notification + if ( + shouldNotifyDesktop({ + disableAllMessageNotifications, + status: receiver.status ?? 'offline', + statusConnection: receiver.statusConnection ?? 'offline', + desktopNotifications, + hasMentionToAll, + hasMentionToHere, + isHighlighted, + hasMentionToUser, + hasReplyToThread, + roomType, + isThread, + }) + ) { + await notifyDesktopUser({ + notificationMessage, + userId: subscription.u._id, + user: sender, + message, + room, + }); + } + + const queueItems: NotificationItem[] = []; + + if ( + shouldNotifyMobile({ + disableAllMessageNotifications, + mobilePushNotifications, + hasMentionToAll, + isHighlighted, + hasMentionToUser, + hasReplyToThread, + roomType, + isThread, + isVideoConf, + userPreferences: receiver.settings?.preferences, + roomUids: room.uids, + }) + ) { + queueItems.push({ + type: 'push', + data: await getPushData({ + notificationMessage, + room, + message, + userId: subscription.u._id, + senderUsername: sender.username, + senderName: sender.name, + receiver, + }), + }); + } + + if ( + receiver.emails && + shouldNotifyEmail({ + disableAllMessageNotifications, + statusConnection: receiver.statusConnection, + emailNotifications, + isHighlighted, + hasMentionToUser, + hasMentionToAll, + hasReplyToThread, + roomType, + isThread, + }) + ) { + const messageWithUnicode = message.msg ? emojione.shortnameToUnicode(message.msg) : message.msg; + const firstAttachment = message.attachments?.length && message.attachments.shift(); + + if (firstAttachment) { + firstAttachment.description = + typeof firstAttachment.description === 'string' ? emojione.shortnameToUnicode(firstAttachment.description) : undefined; + firstAttachment.text = typeof firstAttachment.text === 'string' ? emojione.shortnameToUnicode(firstAttachment.text) : undefined; + } + + const attachments = firstAttachment ? [firstAttachment, ...(message.attachments ?? [])].filter(Boolean) : []; + for await (const email of receiver.emails) { + if (email.verified) { + queueItems.push({ + type: 'email', + data: await getEmailData({ + message: { + ...message, + msg: messageWithUnicode, + ...(attachments.length > 0 ? { attachments } : {}), + }, + receiver, + sender, + subscription, + room, + emailAddress: email.address, + hasMentionToUser, + }), + }); + + break; + } + } + } + + if (queueItems.length) { + void Notification.scheduleItem({ + user: receiver, + uid: subscription.u._id, + rid: room._id, + mid: message._id, + items: queueItems, + }); + } +}; + +const project = { + $project: { + 'desktopNotifications': 1, + 'emailNotifications': 1, + 'mobilePushNotifications': 1, + 'muteGroupMentions': 1, + 'name': 1, + 'rid': 1, + 'userHighlights': 1, + 'u._id': 1, + 'receiver.active': 1, + 'receiver.emails': 1, + 'receiver.language': 1, + 'receiver.status': 1, + 'receiver.statusConnection': 1, + 'receiver.username': 1, + 'receiver.settings.preferences.enableMobileRinging': 1, + }, +} as const; + +const filter = { + $match: { + 'receiver.active': true, + }, +} as const; + +const lookup = { + $lookup: { + from: 'users', + localField: 'u._id', + foreignField: '_id', + as: 'receiver', + }, +} as const; + +export async function sendMessageNotifications(message: IMessage, room: IRoom, usersInThread: string[] = []) { + if (settings.get('Troubleshoot_Disable_Notifications') === true) { + return; + } + + const sender = await roomCoordinator.getRoomDirectives(room.t).getMsgSender(message.u._id); + if (!sender) { + return message; + } + + const { toAll: hasMentionToAll, toHere: hasMentionToHere, mentionIds } = await getMentions(message); + + const mentionIdsWithoutGroups = [...mentionIds]; + + // getMentions removes `all` and `here` from mentionIds so we need to add them back for compatibility + if (hasMentionToAll) { + mentionIds.push('all'); + } + if (hasMentionToHere) { + mentionIds.push('here'); + } + + // add users in thread to mentions array because they follow the same rules + mentionIds.push(...usersInThread); + + let notificationMessage = await callbacks.run('beforeSendMessageNotifications', message.msg); + if (mentionIds.length > 0 && settings.get('UI_Use_Real_Name')) { + notificationMessage = replaceMentionedUsernamesWithFullNames(message.msg, message.mentions ?? []); + } + + // Don't fetch all users if room exceeds max members + const maxMembersForNotification = settings.get('Notifications_Max_Room_Members'); + const roomMembersCount = await Users.countRoomMembers(room._id); + const disableAllMessageNotifications = roomMembersCount > maxMembersForNotification && maxMembersForNotification !== 0; + + const query: WithRequiredProperty, '$or'> = { + rid: room._id, + ignored: { $ne: sender._id }, + disableNotifications: { $ne: true }, + $or: [{ 'userHighlights.0': { $exists: 1 } }, ...(usersInThread.length > 0 ? [{ 'u._id': { $in: usersInThread } }] : [])], + } as const; + + (['desktop', 'mobile', 'email'] as const).forEach((kind) => { + const notificationField = kind === 'mobile' ? 'mobilePush' : `${kind}Notifications`; + + query.$or.push({ + [notificationField]: 'all', + ...(disableAllMessageNotifications ? { [`${kind}PrefOrigin`]: { $ne: 'user' } } : {}), + }); + + if (disableAllMessageNotifications) { + return; + } + + if (room.t === 'd') { + query.$or.push({ + [notificationField]: 'mentions', + }); + } else if (mentionIdsWithoutGroups.length > 0) { + query.$or.push({ + [notificationField]: 'mentions', + 'u._id': { $in: mentionIdsWithoutGroups }, + }); + } + + const serverField = kind === 'email' ? 'emailNotificationMode' : `${kind}Notifications`; + const serverPreference = settings.get(`Accounts_Default_User_Preferences_${serverField}`); + + if (serverPreference === 'all' || hasMentionToAll || hasMentionToHere || room.t === 'd') { + query.$or.push({ + [notificationField]: { $exists: false }, + }); + } else if (serverPreference === 'mentions' && mentionIdsWithoutGroups.length > 0) { + query.$or.push({ + [notificationField]: { $exists: false }, + 'u._id': { $in: mentionIdsWithoutGroups }, + }); + } + }); + + // the find below is crucial. All subscription records returned will receive at least one kind of notification. + // the query is defined by the server's default values and Notifications_Max_Room_Members setting. + + const subscriptions = await Subscriptions.col.aggregate([{ $match: query }, lookup, filter, project]).toArray(); + + subscriptions.forEach( + (subscription) => + void sendNotification({ + subscription, + sender, + hasMentionToAll, + hasMentionToHere, + message, + notificationMessage, + room, + mentionIds, + disableAllMessageNotifications, + hasReplyToThread: usersInThread?.includes(subscription.u._id), + }), + ); + + return { + sender, + hasMentionToAll, + hasMentionToHere, + notificationMessage, + mentionIds, + mentionIdsWithoutGroups, + }; +} + +export async function sendAllNotifications(message: IMessage, room: IRoom) { + if (settings.get('Troubleshoot_Disable_Notifications') === true) { + return message; + } + + // threads + if (message.tmid) { + return message; + } + // skips this callback if the message was edited + if (isEditedMessage(message)) { + return message; + } + + if (message.ts && Math.abs(moment(message.ts).diff(new Date())) > 60000) { + return message; + } + + if (!room || room.t == null) { + return message; + } + + await sendMessageNotifications(message, room); + + return message; +} + +settings.watch('Troubleshoot_Disable_Notifications', (value) => { + if (value) { + return callbacks.remove('afterSaveMessage', 'sendNotificationsOnMessage'); + } + + callbacks.add( + 'afterSaveMessage', + (message, room) => sendAllNotifications(message, room), + callbacks.priority.LOW, + 'sendNotificationsOnMessage', + ); +}); diff --git a/apps/meteor/app/lib/server/methods/addOAuthService.ts b/apps/meteor/app/lib/server/methods/addOAuthService.ts index abf1b7035af1..05b0e5a7e4e6 100644 --- a/apps/meteor/app/lib/server/methods/addOAuthService.ts +++ b/apps/meteor/app/lib/server/methods/addOAuthService.ts @@ -2,8 +2,8 @@ import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; +import { addOAuthService } from '../../../../server/lib/oauth/addOAuthService'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; -import { addOAuthService } from '../functions/addOAuthService'; declare module '@rocket.chat/ui-contexts' { // eslint-disable-next-line @typescript-eslint/naming-convention diff --git a/apps/meteor/app/lib/server/methods/deleteUserOwnAccount.ts b/apps/meteor/app/lib/server/methods/deleteUserOwnAccount.ts index ed9929622c6d..2d651950da19 100644 --- a/apps/meteor/app/lib/server/methods/deleteUserOwnAccount.ts +++ b/apps/meteor/app/lib/server/methods/deleteUserOwnAccount.ts @@ -1,3 +1,4 @@ +import { Apps, AppEvents } from '@rocket.chat/apps'; import { Users } from '@rocket.chat/models'; import { SHA256 } from '@rocket.chat/sha256'; import type { ServerMethods } from '@rocket.chat/ui-contexts'; @@ -5,7 +6,6 @@ import { Accounts } from 'meteor/accounts-base'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; -import { AppEvents, Apps } from '../../../../ee/server/apps/orchestrator'; import { trim } from '../../../../lib/utils/stringUtils'; import { settings } from '../../../settings/server'; import { deleteUser } from '../functions/deleteUser'; @@ -66,7 +66,7 @@ Meteor.methods({ await deleteUser(uid, confirmRelinquish); // App IPostUserDeleted event hook - await Apps.triggerEvent(AppEvents.IPostUserDeleted, { user }); + await Apps.self?.triggerEvent(AppEvents.IPostUserDeleted, { user }); return true; }, diff --git a/apps/meteor/app/lib/server/methods/insertOrUpdateUser.ts b/apps/meteor/app/lib/server/methods/insertOrUpdateUser.ts index d00f6d30b314..5a8b1c8d1a58 100644 --- a/apps/meteor/app/lib/server/methods/insertOrUpdateUser.ts +++ b/apps/meteor/app/lib/server/methods/insertOrUpdateUser.ts @@ -4,6 +4,7 @@ import { Meteor } from 'meteor/meteor'; import { twoFactorRequired } from '../../../2fa/server/twoFactorRequired'; import { saveUser } from '../functions/saveUser'; +import { methodDeprecationLogger } from '../lib/deprecationWarningLogger'; declare module '@rocket.chat/ui-contexts' { // eslint-disable-next-line @typescript-eslint/naming-convention @@ -14,6 +15,8 @@ declare module '@rocket.chat/ui-contexts' { Meteor.methods({ insertOrUpdateUser: twoFactorRequired(async (userData) => { + methodDeprecationLogger.method('insertOrUpdateUser', '8.0.0'); + check(userData, Object); if (!Meteor.userId()) { diff --git a/apps/meteor/app/lib/server/methods/refreshOAuthService.ts b/apps/meteor/app/lib/server/methods/refreshOAuthService.ts index 9faa67f239a1..e5b1c377a33e 100644 --- a/apps/meteor/app/lib/server/methods/refreshOAuthService.ts +++ b/apps/meteor/app/lib/server/methods/refreshOAuthService.ts @@ -1,8 +1,7 @@ -import { Settings } from '@rocket.chat/models'; import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; -import { ServiceConfiguration } from 'meteor/service-configuration'; +import { refreshLoginServices } from '../../../../server/lib/refreshLoginServices'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; declare module '@rocket.chat/ui-contexts' { @@ -29,8 +28,6 @@ Meteor.methods({ }); } - await ServiceConfiguration.configurations.removeAsync({}); - - await Settings.update({ _id: /^(Accounts_OAuth_|SAML_|CAS_).+/ }, { $set: { _updatedAt: new Date() } }, { multi: true }); + await refreshLoginServices(); }, }); diff --git a/apps/meteor/app/lib/server/methods/saveSettings.ts b/apps/meteor/app/lib/server/methods/saveSettings.ts index 776897ce4a58..6d7c0927c3f8 100644 --- a/apps/meteor/app/lib/server/methods/saveSettings.ts +++ b/apps/meteor/app/lib/server/methods/saveSettings.ts @@ -8,6 +8,7 @@ import { Meteor } from 'meteor/meteor'; import { twoFactorRequired } from '../../../2fa/server/twoFactorRequired'; import { getSettingPermissionId } from '../../../authorization/lib'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; +import { settings } from '../../../settings/server'; declare module '@rocket.chat/ui-contexts' { // eslint-disable-next-line @typescript-eslint/naming-convention @@ -48,6 +49,21 @@ Meteor.methods({ const editPrivilegedSetting = await hasPermissionAsync(uid, 'edit-privileged-setting'); const manageSelectedSettings = await hasPermissionAsync(uid, 'manage-selected-settings'); + // if the id contains Organization_Name then change the Site_Name + const orgName = params.find(({ _id }) => _id === 'Organization_Name'); + + if (orgName) { + // check if the site name is still the default value or ifs the same as organization name + const siteName = await Settings.findOneById('Site_Name'); + + if (siteName?.value === siteName?.packageValue || siteName?.value === settings.get('Organization_Name')) { + params.push({ + _id: 'Site_Name', + value: orgName.value, + }); + } + } + await Promise.all( params.map(async ({ _id, value }) => { // Verify the _id passed in is a string. diff --git a/apps/meteor/app/lib/server/methods/sendMessage.ts b/apps/meteor/app/lib/server/methods/sendMessage.ts index ebdcdfd43d9b..e12ebc2d47e9 100644 --- a/apps/meteor/app/lib/server/methods/sendMessage.ts +++ b/apps/meteor/app/lib/server/methods/sendMessage.ts @@ -82,7 +82,7 @@ export async function executeSendMessage(uid: IUser['_id'], message: AtLeast({ - sendMessage(message, previewUrls) { + async sendMessage(message, previewUrls) { check(message, Object); const uid = Meteor.userId(); @@ -118,7 +118,7 @@ Meteor.methods({ } try { - return executeSendMessage(uid, message, previewUrls); + return await executeSendMessage(uid, message, previewUrls); } catch (error: any) { if ((error.error || error.message) === 'error-not-allowed') { throw new Meteor.Error(error.error || error.message, error.reason, { diff --git a/apps/meteor/app/lib/server/oauth/oauth.js b/apps/meteor/app/lib/server/oauth/oauth.js index 2618a6e7a569..27342416bedb 100644 --- a/apps/meteor/app/lib/server/oauth/oauth.js +++ b/apps/meteor/app/lib/server/oauth/oauth.js @@ -36,7 +36,7 @@ Accounts.registerLoginHandler(async (options) => { // Make sure we're configured if (!(await ServiceConfiguration.configurations.findOneAsync({ service: options.serviceName }))) { - throw new ServiceConfiguration.ConfigError(); + throw new Accounts.ConfigError(); } if (!_.contains(Accounts.oauth.serviceNames(), service.serviceName)) { diff --git a/apps/meteor/app/lib/server/startup/filterATAllTag.ts b/apps/meteor/app/lib/server/startup/filterATAllTag.ts deleted file mode 100644 index dfa3b1b1d84a..000000000000 --- a/apps/meteor/app/lib/server/startup/filterATAllTag.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { api } from '@rocket.chat/core-services'; -import { isEditedMessage } from '@rocket.chat/core-typings'; -import { Users } from '@rocket.chat/models'; -import { Meteor } from 'meteor/meteor'; -import moment from 'moment'; -import _ from 'underscore'; - -import { callbacks } from '../../../../lib/callbacks'; -import { i18n } from '../../../../server/lib/i18n'; -import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; - -callbacks.add( - 'beforeSaveMessage', - async (message) => { - // If the message was edited, or is older than 60 seconds (imported) - // the notifications will be skipped, so we can also skip this validation - if (isEditedMessage(message) || (message.ts && Math.abs(moment(message.ts).diff(moment())) > 60000)) { - return message; - } - - // Test if the message mentions include @all. - if (message.mentions != null && _.pluck(message.mentions, '_id').some((item) => item === 'all')) { - // Check if the user has permissions to use @all in both global and room scopes. - if ( - !(await hasPermissionAsync(message.u._id, 'mention-all')) && - !(await hasPermissionAsync(message.u._id, 'mention-all', message.rid)) - ) { - // Get the language of the user for the error notification. - const { language } = (await Users.findOneById(message.u._id)) || {}; - const action = i18n.t('Notify_all_in_this_room', { lng: language }); - - // Add a notification to the chat, informing the user that this - // action is not allowed. - void api.broadcast('notify.ephemeralMessage', message.u._id, message.rid, { - // TODO: i18n - msg: i18n.t('error-action-not-allowed', { action } as any, language), - }); - - // Also throw to stop propagation of 'sendMessage'. - throw new Meteor.Error('error-action-not-allowed', 'Notify all in this room not allowed', { - method: 'filterATAllTag', - action: 'Notify_all_in_this_room', - }); - } - } - - return message; - }, - callbacks.priority.MEDIUM, - 'filterATAllTag', -); diff --git a/apps/meteor/app/lib/server/startup/filterATHereTag.ts b/apps/meteor/app/lib/server/startup/filterATHereTag.ts deleted file mode 100644 index 305f03455d81..000000000000 --- a/apps/meteor/app/lib/server/startup/filterATHereTag.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { api } from '@rocket.chat/core-services'; -import { isEditedMessage } from '@rocket.chat/core-typings'; -import { Users } from '@rocket.chat/models'; -import { Meteor } from 'meteor/meteor'; -import moment from 'moment'; -import _ from 'underscore'; - -import { callbacks } from '../../../../lib/callbacks'; -import { i18n } from '../../../../server/lib/i18n'; -import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; - -callbacks.add( - 'beforeSaveMessage', - async (message) => { - // If the message was edited, or is older than 60 seconds (imported) - // the notifications will be skipped, so we can also skip this validation - if (isEditedMessage(message) || (message.ts && Math.abs(moment(message.ts).diff(moment())) > 60000)) { - return message; - } - - // Test if the message mentions include @here. - if (message.mentions != null && _.pluck(message.mentions, '_id').some((item) => item === 'here')) { - // Check if the user has permissions to use @here in both global and room scopes. - if ( - !(await hasPermissionAsync(message.u._id, 'mention-here')) && - !(await hasPermissionAsync(message.u._id, 'mention-here', message.rid)) - ) { - // Get the language of the user for the error notification. - const { language } = (await Users.findOneById(message.u._id)) || {}; - const action = i18n.t('Notify_active_in_this_room', { lng: language }); - - // Add a notification to the chat, informing the user that this - // action is not allowed. - void api.broadcast('notify.ephemeralMessage', message.u._id, message.rid, { - // TODO: i18n - msg: i18n.t('error-action-not-allowed', { action } as any, language), - }); - - // Also throw to stop propagation of 'sendMessage'. - throw new Meteor.Error('error-action-not-allowed', 'Notify here in this room not allowed', { - method: 'filterATHereTag', - action: 'Notify_active_in_this_room', - }); - } - } - - return message; - }, - callbacks.priority.MEDIUM, - 'filterATHereTag', -); diff --git a/apps/meteor/app/lib/server/startup/index.ts b/apps/meteor/app/lib/server/startup/index.ts index d4e5183ad7f5..deadb8a44c06 100644 --- a/apps/meteor/app/lib/server/startup/index.ts +++ b/apps/meteor/app/lib/server/startup/index.ts @@ -1,4 +1,3 @@ -import './oAuthServicesUpdate'; import './rateLimiter'; import './robots'; import './settingsOnLoadCdnPrefix'; diff --git a/apps/meteor/app/lib/server/startup/mentionUserNotInChannel.ts b/apps/meteor/app/lib/server/startup/mentionUserNotInChannel.ts new file mode 100644 index 000000000000..160defcb94ed --- /dev/null +++ b/apps/meteor/app/lib/server/startup/mentionUserNotInChannel.ts @@ -0,0 +1,141 @@ +import { api } from '@rocket.chat/core-services'; +import type { IMessage } from '@rocket.chat/core-typings'; +import { isDirectMessageRoom, isEditedMessage, isOmnichannelRoom, isRoomFederated } from '@rocket.chat/core-typings'; +import { Subscriptions, Users } from '@rocket.chat/models'; +import type { ActionsBlock } from '@rocket.chat/ui-kit'; +import moment from 'moment'; + +import { callbacks } from '../../../../lib/callbacks'; +import { getUserDisplayName } from '../../../../lib/getUserDisplayName'; +import { isTruthy } from '../../../../lib/isTruthy'; +import { i18n } from '../../../../server/lib/i18n'; +import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; +import { settings } from '../../../settings/server'; + +const APP_ID = 'mention-core'; +const getBlocks = (mentions: IMessage['mentions'], messageId: string, lng: string | undefined) => { + const stringifiedMentions = JSON.stringify(mentions); + return { + addUsersBlock: { + type: 'button', + appId: APP_ID, + blockId: messageId, + value: stringifiedMentions, + actionId: 'add-users', + text: { + type: 'plain_text', + text: i18n.t('Add_them', undefined, lng), + }, + }, + dismissBlock: { + type: 'button', + appId: APP_ID, + blockId: messageId, + value: stringifiedMentions, + actionId: 'dismiss', + text: { + type: 'plain_text', + text: i18n.t('Do_nothing', undefined, lng), + }, + }, + dmBlock: { + type: 'button', + appId: APP_ID, + value: stringifiedMentions, + blockId: messageId, + actionId: 'share-message', + text: { + type: 'plain_text', + text: i18n.t('Let_them_know', undefined, lng), + }, + }, + } as const; +}; + +callbacks.add( + 'afterSaveMessage', + async (message, room) => { + // TODO: check if I need to test this 60 second rule. + // If the message was edited, or is older than 60 seconds (imported) + // the notifications will be skipped, so we can also skip this validation + if (isEditedMessage(message) || (message.ts && Math.abs(moment(message.ts).diff(moment())) > 60000) || !message.mentions) { + return message; + } + + const mentions = message.mentions.filter(({ _id }) => _id !== 'all' && _id !== 'here'); + if (!mentions.length) { + return message; + } + + if (isDirectMessageRoom(room) || isRoomFederated(room) || isOmnichannelRoom(room)) { + return message; + } + + const subs = await Subscriptions.findByRoomIdAndUserIds( + message.rid, + mentions.map(({ _id }) => _id), + { projection: { u: 1 } }, + ).toArray(); + + // get all users that are mentioned but not in the channel + const mentionsUsersNotInChannel = mentions.filter(({ _id }) => !subs.some((sub) => sub.u._id === _id)); + + if (!mentionsUsersNotInChannel.length) { + return message; + } + + const canAddUsersToThisRoom = await hasPermissionAsync(message.u._id, 'add-user-to-joined-room', message.rid); + const canAddToAnyRoom = await (room.t === 'c' + ? hasPermissionAsync(message.u._id, 'add-user-to-any-c-room') + : hasPermissionAsync(message.u._id, 'add-user-to-any-p-room')); + const canDMUsers = await hasPermissionAsync(message.u._id, 'create-d'); // TODO: Perhaps check if user has DM with mentioned user (might be too expensive) + const canAddUsers = canAddUsersToThisRoom || canAddToAnyRoom; + + const { language } = (await Users.findOneById(message.u._id)) || {}; + + const actionBlocks = getBlocks(mentionsUsersNotInChannel, message._id, language); + const elements: ActionsBlock['elements'] = [ + canAddUsers && actionBlocks.addUsersBlock, + (canAddUsers || canDMUsers) && actionBlocks.dismissBlock, + canDMUsers && actionBlocks.dmBlock, + ].filter(isTruthy); + + const messageLabel = canAddUsers + ? 'You_mentioned___mentions__but_theyre_not_in_this_room' + : 'You_mentioned___mentions__but_theyre_not_in_this_room_You_can_ask_a_room_admin_to_add_them'; + + const useRealName = settings.get('UI_Use_Real_Name'); + + const usernamesOrNames = mentionsUsersNotInChannel.map(({ username, name }) => `*${getUserDisplayName(name, username, useRealName)}*`); + + const mentionsText = usernamesOrNames.join(', '); + + // TODO: Mentions style + void api.broadcast('notify.ephemeralMessage', message.u._id, message.rid, { + msg: '', + mentions: mentionsUsersNotInChannel, + tmid: message.tmid, + blocks: [ + { + appId: APP_ID, + type: 'section', + text: { + type: 'mrkdwn', + text: i18n.t(messageLabel, { mentions: mentionsText }, language), + }, + } as const, + Boolean(elements.length) && + ({ + type: 'actions', + appId: APP_ID, + elements, + } as const), + ].filter(isTruthy), + private: true, + }); + + return message; + }, + callbacks.priority.LOW, + 'mention-user-not-in-channel', +); diff --git a/apps/meteor/app/lib/server/startup/oAuthServicesUpdate.js b/apps/meteor/app/lib/server/startup/oAuthServicesUpdate.js deleted file mode 100644 index b01ef2f9fb0c..000000000000 --- a/apps/meteor/app/lib/server/startup/oAuthServicesUpdate.js +++ /dev/null @@ -1,206 +0,0 @@ -import { Logger } from '@rocket.chat/logger'; -import { ServiceConfiguration } from 'meteor/service-configuration'; -import _ from 'underscore'; - -import { CustomOAuth } from '../../../custom-oauth/server/custom_oauth_server'; -import { settings } from '../../../settings/server'; -import { addOAuthService } from '../functions/addOAuthService'; - -const logger = new Logger('rocketchat:lib'); - -async function _OAuthServicesUpdate() { - const services = settings.getByRegexp(/^(Accounts_OAuth_|Accounts_OAuth_Custom-)[a-z0-9_]+$/i); - const filteredServices = services.filter(([, value]) => typeof value === 'boolean'); - for await (const [key, value] of filteredServices) { - logger.debug({ oauth_updated: key }); - let serviceName = key.replace('Accounts_OAuth_', ''); - if (serviceName === 'Meteor') { - serviceName = 'meteor-developer'; - } - if (/Accounts_OAuth_Custom-/.test(key)) { - serviceName = key.replace('Accounts_OAuth_Custom-', ''); - } - - if (value === true) { - const data = { - clientId: settings.get(`${key}_id`), - secret: settings.get(`${key}_secret`), - }; - - if (/Accounts_OAuth_Custom-/.test(key)) { - data.custom = true; - data.clientId = settings.get(`${key}-id`); - data.secret = settings.get(`${key}-secret`); - data.serverURL = settings.get(`${key}-url`); - data.tokenPath = settings.get(`${key}-token_path`); - data.identityPath = settings.get(`${key}-identity_path`); - data.authorizePath = settings.get(`${key}-authorize_path`); - data.scope = settings.get(`${key}-scope`); - data.accessTokenParam = settings.get(`${key}-access_token_param`); - data.buttonLabelText = settings.get(`${key}-button_label_text`); - data.buttonLabelColor = settings.get(`${key}-button_label_color`); - data.loginStyle = settings.get(`${key}-login_style`); - data.buttonColor = settings.get(`${key}-button_color`); - data.tokenSentVia = settings.get(`${key}-token_sent_via`); - data.identityTokenSentVia = settings.get(`${key}-identity_token_sent_via`); - data.keyField = settings.get(`${key}-key_field`); - data.usernameField = settings.get(`${key}-username_field`); - data.emailField = settings.get(`${key}-email_field`); - data.nameField = settings.get(`${key}-name_field`); - data.avatarField = settings.get(`${key}-avatar_field`); - data.rolesClaim = settings.get(`${key}-roles_claim`); - data.groupsClaim = settings.get(`${key}-groups_claim`); - data.channelsMap = settings.get(`${key}-groups_channel_map`); - data.channelsAdmin = settings.get(`${key}-channels_admin`); - data.mergeUsers = settings.get(`${key}-merge_users`); - data.mergeUsersDistinctServices = settings.get(`${key}-merge_users_distinct_services`); - data.mapChannels = settings.get(`${key}-map_channels`); - data.mergeRoles = settings.get(`${key}-merge_roles`); - data.rolesToSync = settings.get(`${key}-roles_to_sync`); - data.showButton = settings.get(`${key}-show_button`); - - new CustomOAuth(serviceName.toLowerCase(), { - serverURL: data.serverURL, - tokenPath: data.tokenPath, - identityPath: data.identityPath, - authorizePath: data.authorizePath, - scope: data.scope, - loginStyle: data.loginStyle, - tokenSentVia: data.tokenSentVia, - identityTokenSentVia: data.identityTokenSentVia, - keyField: data.keyField, - usernameField: data.usernameField, - emailField: data.emailField, - nameField: data.nameField, - avatarField: data.avatarField, - rolesClaim: data.rolesClaim, - groupsClaim: data.groupsClaim, - mapChannels: data.mapChannels, - channelsMap: data.channelsMap, - channelsAdmin: data.channelsAdmin, - mergeUsers: data.mergeUsers, - mergeUsersDistinctServices: data.mergeUsersDistinctServices, - mergeRoles: data.mergeRoles, - rolesToSync: data.rolesToSync, - accessTokenParam: data.accessTokenParam, - showButton: data.showButton, - }); - } - if (serviceName === 'Facebook') { - data.appId = data.clientId; - delete data.clientId; - } - if (serviceName === 'Twitter') { - data.consumerKey = data.clientId; - delete data.clientId; - } - - if (serviceName === 'Linkedin') { - data.clientConfig = { - requestPermissions: ['openid', 'email', 'profile'], - }; - } - - if (serviceName === 'Nextcloud') { - data.buttonLabelText = settings.get('Accounts_OAuth_Nextcloud_button_label_text'); - data.buttonLabelColor = settings.get('Accounts_OAuth_Nextcloud_button_label_color'); - data.buttonColor = settings.get('Accounts_OAuth_Nextcloud_button_color'); - } - - // If there's no data other than the service name, then put the service name in the data object so the operation won't fail - const keys = Object.keys(data).filter((key) => data[key] !== undefined); - if (!keys.length) { - data.service = serviceName.toLowerCase(); - } - - await ServiceConfiguration.configurations.upsertAsync( - { - service: serviceName.toLowerCase(), - }, - { - $set: data, - }, - ); - } else { - await ServiceConfiguration.configurations.removeAsync({ - service: serviceName.toLowerCase(), - }); - } - } -} - -const OAuthServicesUpdate = _.debounce(_OAuthServicesUpdate, 2000); - -async function OAuthServicesRemove(_id) { - const serviceName = _id.replace('Accounts_OAuth_Custom-', ''); - return ServiceConfiguration.configurations.removeAsync({ - service: serviceName.toLowerCase(), - }); -} - -settings.watchByRegex(/^Accounts_OAuth_.+/, () => { - return OAuthServicesUpdate(); // eslint-disable-line new-cap -}); - -settings.watchByRegex(/^Accounts_OAuth_Custom-[a-z0-9_]+/, (key, value) => { - if (!value) { - return OAuthServicesRemove(key); // eslint-disable-line new-cap - } -}); - -async function customOAuthServicesInit() { - // Add settings for custom OAuth providers to the settings so they get - // automatically added when they are defined in ENV variables - for await (const key of Object.keys(process.env)) { - if (/Accounts_OAuth_Custom_[a-zA-Z0-9_-]+$/.test(key)) { - // Most all shells actually prohibit the usage of - in environment variables - // So this will allow replacing - with _ and translate it back to the setting name - let name = key.replace('Accounts_OAuth_Custom_', ''); - - if (name.indexOf('_') > -1) { - name = name.replace(name.substr(name.indexOf('_')), ''); - } - - const serviceKey = `Accounts_OAuth_Custom_${name}`; - - if (key === serviceKey) { - const values = { - enabled: process.env[`${serviceKey}`] === 'true', - clientId: process.env[`${serviceKey}_id`], - clientSecret: process.env[`${serviceKey}_secret`], - serverURL: process.env[`${serviceKey}_url`], - tokenPath: process.env[`${serviceKey}_token_path`], - identityPath: process.env[`${serviceKey}_identity_path`], - authorizePath: process.env[`${serviceKey}_authorize_path`], - scope: process.env[`${serviceKey}_scope`], - accessTokenParam: process.env[`${serviceKey}_access_token_param`], - buttonLabelText: process.env[`${serviceKey}_button_label_text`], - buttonLabelColor: process.env[`${serviceKey}_button_label_color`], - loginStyle: process.env[`${serviceKey}_login_style`], - buttonColor: process.env[`${serviceKey}_button_color`], - tokenSentVia: process.env[`${serviceKey}_token_sent_via`], - identityTokenSentVia: process.env[`${serviceKey}_identity_token_sent_via`], - keyField: process.env[`${serviceKey}_key_field`], - usernameField: process.env[`${serviceKey}_username_field`], - nameField: process.env[`${serviceKey}_name_field`], - emailField: process.env[`${serviceKey}_email_field`], - rolesClaim: process.env[`${serviceKey}_roles_claim`], - groupsClaim: process.env[`${serviceKey}_groups_claim`], - channelsMap: process.env[`${serviceKey}_groups_channel_map`], - channelsAdmin: process.env[`${serviceKey}_channels_admin`], - mergeUsers: process.env[`${serviceKey}_merge_users`] === 'true', - mergeUsersDistinctServices: process.env[`${serviceKey}_merge_users_distinct_services`] === 'true', - mapChannels: process.env[`${serviceKey}_map_channels`], - mergeRoles: process.env[`${serviceKey}_merge_roles`] === 'true', - rolesToSync: process.env[`${serviceKey}_roles_to_sync`], - showButton: process.env[`${serviceKey}_show_button`] === 'true', - avatarField: process.env[`${serviceKey}_avatar_field`], - }; - - await addOAuthService(name, values); - } - } - } -} - -await customOAuthServicesInit(); diff --git a/apps/meteor/app/lib/server/startup/rateLimiter.js b/apps/meteor/app/lib/server/startup/rateLimiter.js index a1ddfe87886c..5a312f4520d4 100644 --- a/apps/meteor/app/lib/server/startup/rateLimiter.js +++ b/apps/meteor/app/lib/server/startup/rateLimiter.js @@ -123,7 +123,7 @@ const checkNameForStream = (name) => name && !names.has(name) && name.startsWith const ruleIds = {}; -const callback = (msg, name) => (reply, input) => { +const callback = (msg, name) => async (reply, input) => { if (reply.allowed === false) { rateLimiterLog({ msg, reply, input }); metrics.ddpRateLimitExceeded.inc({ @@ -136,7 +136,7 @@ const callback = (msg, name) => (reply, input) => { }); // sleep before sending the error to slow down next requests if (slowDownRate > 0 && reply.numInvocationsExceeded) { - Promise.await(sleep(slowDownRate * reply.numInvocationsExceeded)); + await sleep(slowDownRate * reply.numInvocationsExceeded); } // } else { // console.log('DDP RATE LIMIT:', message); diff --git a/apps/meteor/app/livechat/client/lib/stream/queueManager.ts b/apps/meteor/app/livechat/client/lib/stream/queueManager.ts index 28d09958535a..5ba2cf0d9791 100644 --- a/apps/meteor/app/livechat/client/lib/stream/queueManager.ts +++ b/apps/meteor/app/livechat/client/lib/stream/queueManager.ts @@ -2,28 +2,46 @@ import type { ILivechatDepartment, ILivechatInquiryRecord, IOmnichannelAgent } f import { queryClient } from '../../../../../client/lib/queryClient'; import { callWithErrorHandling } from '../../../../../client/lib/utils/callWithErrorHandling'; +import { settings } from '../../../../settings/client'; import { sdk } from '../../../../utils/client/lib/SDKClient'; import { LivechatInquiry } from '../../collections/LivechatInquiry'; const departments = new Set(); const events = { - added: (inquiry: ILivechatInquiryRecord) => { - departments.has(inquiry.department) && LivechatInquiry.insert({ ...inquiry, alert: true, _updatedAt: new Date(inquiry._updatedAt) }); + added: async (inquiry: ILivechatInquiryRecord) => { + if (!departments.has(inquiry.department)) { + return; + } + + LivechatInquiry.insert({ ...inquiry, alert: true, _updatedAt: new Date(inquiry._updatedAt) }); + await invalidateRoomQueries(inquiry.rid); }, changed: async (inquiry: ILivechatInquiryRecord) => { if (inquiry.status !== 'queued' || (inquiry.department && !departments.has(inquiry.department))) { - return LivechatInquiry.remove(inquiry._id); + return removeInquiry(inquiry); } LivechatInquiry.upsert({ _id: inquiry._id }, { ...inquiry, alert: true, _updatedAt: new Date(inquiry._updatedAt) }); - await queryClient.invalidateQueries(['/v1/rooms.info', inquiry.rid]); + await invalidateRoomQueries(inquiry.rid); }, - removed: (inquiry: ILivechatInquiryRecord) => LivechatInquiry.remove(inquiry._id), + removed: (inquiry: ILivechatInquiryRecord) => removeInquiry(inquiry), +}; + +const invalidateRoomQueries = async (rid: string) => { + await queryClient.invalidateQueries(['rooms', { reference: rid, type: 'l' }]); + await queryClient.removeQueries(['rooms', rid]); + await queryClient.removeQueries(['/v1/rooms.info', rid]); +}; + +const removeInquiry = async (inquiry: ILivechatInquiryRecord) => { + await LivechatInquiry.remove(inquiry._id); + return queryClient.invalidateQueries(['rooms', { reference: inquiry.rid, type: 'l' }]); }; const getInquiriesFromAPI = async () => { - const { inquiries } = await sdk.rest.get('/v1/livechat/inquiries.queuedForUser', {}); + const count = settings.get('Livechat_guest_pool_max_number_incoming_livechats_displayed') ?? 0; + const { inquiries } = await sdk.rest.get('/v1/livechat/inquiries.queuedForUser', { count }); return inquiries; }; @@ -80,9 +98,12 @@ const subscribe = async (userId: IOmnichannelAgent['_id']) => { // Register to all depts + public queue always to match the inquiry list returned by backend const cleanDepartmentListeners = addListenerForeachDepartment(agentDepartments); const globalCleanup = addGlobalListener(); - const inquiriesFromAPI = (await getInquiriesFromAPI()) as unknown as ILivechatInquiryRecord[]; - await updateInquiries(inquiriesFromAPI); + const computation = Tracker.autorun(async () => { + const inquiriesFromAPI = (await getInquiriesFromAPI()) as unknown as ILivechatInquiryRecord[]; + + await updateInquiries(inquiriesFromAPI); + }); return () => { LivechatInquiry.remove({}); @@ -90,14 +111,15 @@ const subscribe = async (userId: IOmnichannelAgent['_id']) => { cleanDepartmentListeners?.(); globalCleanup?.(); departments.clear(); + computation.stop(); }; }; export const initializeLivechatInquiryStream = (() => { let cleanUp: (() => void) | undefined; - return async (...args: any[]) => { + return async (...args: Parameters) => { cleanUp?.(); - cleanUp = await subscribe(...(args as [IOmnichannelAgent['_id']])); + cleanUp = await subscribe(...args); }; })(); diff --git a/apps/meteor/app/livechat/client/startup/notifyUnreadRooms.js b/apps/meteor/app/livechat/client/startup/notifyUnreadRooms.js index 3aaace847f69..a758c72cadd8 100644 --- a/apps/meteor/app/livechat/client/startup/notifyUnreadRooms.js +++ b/apps/meteor/app/livechat/client/startup/notifyUnreadRooms.js @@ -1,9 +1,8 @@ -import { Users } from '@rocket.chat/models'; import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; import { CustomSounds } from '../../../custom-sounds/client'; -import { Subscriptions } from '../../../models/client'; +import { Subscriptions, Users } from '../../../models/client'; import { settings } from '../../../settings/client'; import { getUserPreference } from '../../../utils/client'; @@ -16,17 +15,20 @@ Meteor.startup(() => { return; } - const subs = await Subscriptions.find({ t: 'l', ls: { $exists: 0 }, open: true }).count(); + const subs = await Subscriptions.find({ t: 'l', ls: { $exists: false }, open: true }).count(); if (subs === 0) { audio && audio.pause(); return; } - const user = await Users.findOne(Meteor.userId(), { - projection: { - 'settings.preferences.newRoomNotification': 1, + const user = await Users.findOne( + { _id: Meteor.userId() }, + { + projection: { + 'settings.preferences.newRoomNotification': 1, + }, }, - }); + ); const newRoomNotification = getUserPreference(user, 'newRoomNotification'); diff --git a/apps/meteor/app/livechat/client/ui.js b/apps/meteor/app/livechat/client/ui.ts similarity index 100% rename from apps/meteor/app/livechat/client/ui.js rename to apps/meteor/app/livechat/client/ui.ts diff --git a/apps/meteor/app/livechat/client/views/app/business-hours/BusinessHours.ts b/apps/meteor/app/livechat/client/views/app/business-hours/BusinessHours.ts index 0935ac7554e4..3c723cc46257 100644 --- a/apps/meteor/app/livechat/client/views/app/business-hours/BusinessHours.ts +++ b/apps/meteor/app/livechat/client/views/app/business-hours/BusinessHours.ts @@ -29,10 +29,6 @@ class BusinessHoursManager { showBackButton(): boolean { return this.behavior.showBackButton(); } - - showTimezoneTemplate(): boolean { - return this.behavior.showTimezoneTemplate(); - } } export const businessHourManager = new BusinessHoursManager(new SingleBusinessHourBehavior()); diff --git a/apps/meteor/app/livechat/client/views/app/business-hours/IBusinessHourBehavior.ts b/apps/meteor/app/livechat/client/views/app/business-hours/IBusinessHourBehavior.ts index 10a51fe25e25..1ba6e4a56907 100644 --- a/apps/meteor/app/livechat/client/views/app/business-hours/IBusinessHourBehavior.ts +++ b/apps/meteor/app/livechat/client/views/app/business-hours/IBusinessHourBehavior.ts @@ -4,5 +4,4 @@ export interface IBusinessHourBehavior { getView(): string; showCustomTemplate(businessHourData: ILivechatBusinessHour): boolean; showBackButton(): boolean; - showTimezoneTemplate(): boolean; } diff --git a/apps/meteor/app/livechat/client/views/app/business-hours/Single.ts b/apps/meteor/app/livechat/client/views/app/business-hours/Single.ts index 1ce09a63d79a..9b343264ca54 100644 --- a/apps/meteor/app/livechat/client/views/app/business-hours/Single.ts +++ b/apps/meteor/app/livechat/client/views/app/business-hours/Single.ts @@ -12,8 +12,4 @@ export class SingleBusinessHourBehavior implements IBusinessHourBehavior { showBackButton(): boolean { return false; } - - showTimezoneTemplate(): boolean { - return false; - } } diff --git a/apps/meteor/app/livechat/imports/server/rest/appearance.ts b/apps/meteor/app/livechat/imports/server/rest/appearance.ts index 0fa365be1871..55607551ec3a 100644 --- a/apps/meteor/app/livechat/imports/server/rest/appearance.ts +++ b/apps/meteor/app/livechat/imports/server/rest/appearance.ts @@ -1,6 +1,8 @@ +import type { ISettingSelectOption } from '@rocket.chat/core-typings'; import { Settings } from '@rocket.chat/models'; import { isPOSTLivechatAppearanceParams } from '@rocket.chat/rest-typings'; +import { isTruthy } from '../../../../../lib/isTruthy'; import { API } from '../../../../api/server'; import { findAppearance } from '../../../server/api/lib/appearance'; @@ -44,6 +46,10 @@ API.v1.addRoute( 'Livechat_name_field_registration_form', 'Livechat_email_field_registration_form', 'Livechat_registration_form_message', + 'Livechat_hide_watermark', + 'Livechat_background', + 'Livechat_widget_position', + 'Livechat_hide_system_messages', ]; const valid = settings.every((setting) => validSettingList.includes(setting._id)); @@ -52,8 +58,39 @@ API.v1.addRoute( throw new Error('invalid-setting'); } + const dbSettings = await Settings.findByIds(validSettingList, { projection: { _id: 1, value: 1, type: 1 } }) + .map((dbSetting) => { + const setting = settings.find(({ _id }) => _id === dbSetting._id); + if (!setting || dbSetting.value === setting.value) { + return; + } + + if (dbSetting.type === 'multiSelect' && (!Array.isArray(setting.value) || !validateValues(setting.value, dbSetting.values))) { + return; + } + + switch (dbSetting?.type) { + case 'boolean': + return { + _id: dbSetting._id, + value: setting.value === 'true' || setting.value === true, + }; + case 'int': + return { + _id: dbSetting._id, + value: coerceInt(setting.value), + }; + default: + return { + _id: dbSetting._id, + value: setting?.value, + }; + } + }) + .toArray(); + await Promise.all( - settings.map((setting) => { + dbSettings.filter(isTruthy).map((setting) => { return Settings.updateValueById(setting._id, setting.value); }), ); @@ -62,3 +99,28 @@ API.v1.addRoute( }, }, ); + +function validateValues(values: string[], allowedValues: ISettingSelectOption[] = []): boolean { + return values.every((value) => allowedValues.some((allowedValue) => allowedValue.key === value)); +} + +function coerceInt(value: string | number | boolean | string[]): number { + if (typeof value === 'number') { + return value; + } + + if (typeof value === 'boolean') { + return 0; + } + + if (Array.isArray(value)) { + return 0; + } + + const parsedValue = parseInt(value, 10); + if (Number.isNaN(parsedValue)) { + return 0; + } + + return parsedValue; +} diff --git a/apps/meteor/app/livechat/imports/server/rest/dashboards.ts b/apps/meteor/app/livechat/imports/server/rest/dashboards.ts index 8951854bff84..eb23e85262fd 100644 --- a/apps/meteor/app/livechat/imports/server/rest/dashboards.ts +++ b/apps/meteor/app/livechat/imports/server/rest/dashboards.ts @@ -3,15 +3,15 @@ import { isGETDashboardTotalizerParams, isGETDashboardsAgentStatusParams } from import { API } from '../../../../api/server'; import { - findAllChatsStatusAsync, - getProductivityMetricsAsync, - getConversationsMetricsAsync, - findAllChatMetricsByAgentAsync, - findAllAgentsStatusAsync, - findAllChatMetricsByDepartmentAsync, - findAllResponseTimeMetricsAsync, - getAgentsProductivityMetricsAsync, - getChatsMetricsAsync, + getProductivityMetricsAsyncCached, + getConversationsMetricsAsyncCached, + getAgentsProductivityMetricsAsyncCached, + getChatsMetricsAsyncCached, + findAllChatsStatusAsyncCached, + findAllChatMetricsByAgentAsyncCached, + findAllAgentsStatusAsyncCached, + findAllChatMetricsByDepartmentAsyncCached, + findAllResponseTimeMetricsAsyncCached, } from '../../../server/lib/analytics/dashboards'; API.v1.addRoute( @@ -29,19 +29,17 @@ API.v1.addRoute( if (isNaN(Date.parse(start))) { return API.v1.failure('The "start" query parameter must be a valid date.'); } - const startDate = new Date(start); if (isNaN(Date.parse(end))) { return API.v1.failure('The "end" query parameter must be a valid date.'); } - const endDate = new Date(end); const user = await Users.findOneById(this.userId, { projection: { utcOffset: 1, language: 1 } }); if (!user) { return API.v1.failure('User not found'); } - const totalizers = await getConversationsMetricsAsync({ start: startDate, end: endDate, departmentId, user }); + const totalizers = await getConversationsMetricsAsyncCached({ start, end, departmentId, user }); return API.v1.success(totalizers); }, }, @@ -58,19 +56,17 @@ API.v1.addRoute( if (isNaN(Date.parse(start))) { return API.v1.failure('The "start" query parameter must be a valid date.'); } - const startDate = new Date(start); if (isNaN(Date.parse(end))) { return API.v1.failure('The "end" query parameter must be a valid date.'); } - const endDate = new Date(end); const user = await Users.findOneById(this.userId, { projection: { utcOffset: 1, language: 1 } }); if (!user) { return API.v1.failure('User not found'); } - const totalizers = await getAgentsProductivityMetricsAsync({ start: startDate, end: endDate, departmentId, user }); + const totalizers = await getAgentsProductivityMetricsAsyncCached({ start, end, departmentId, user }); return API.v1.success(totalizers); }, }, @@ -94,7 +90,7 @@ API.v1.addRoute( } const endDate = new Date(end); - const totalizers = await getChatsMetricsAsync({ start: startDate, end: endDate, departmentId }); + const totalizers = await getChatsMetricsAsyncCached({ start: startDate, end: endDate, departmentId }); return API.v1.success(totalizers); }, }, @@ -111,19 +107,17 @@ API.v1.addRoute( if (isNaN(Date.parse(start))) { return API.v1.failure('The "start" query parameter must be a valid date.'); } - const startDate = new Date(start); if (isNaN(Date.parse(end))) { return API.v1.failure('The "end" query parameter must be a valid date.'); } - const endDate = new Date(end); const user = await Users.findOneById(this.userId, { projection: { utcOffset: 1, language: 1 } }); if (!user) { return API.v1.failure('User not found'); } - const totalizers = await getProductivityMetricsAsync({ start: startDate, end: endDate, departmentId, user }); + const totalizers = await getProductivityMetricsAsyncCached({ start, end, departmentId, user }); return API.v1.success(totalizers); }, @@ -148,7 +142,7 @@ API.v1.addRoute( } const endDate = new Date(end); - const result = await findAllChatsStatusAsync({ start: startDate, end: endDate, departmentId }); + const result = await findAllChatsStatusAsyncCached({ start: startDate, end: endDate, departmentId }); return API.v1.success(result); }, @@ -172,7 +166,7 @@ API.v1.addRoute( return API.v1.failure('The "end" query parameter must be a valid date.'); } const endDate = new Date(end); - const result = (await findAllChatMetricsByAgentAsync({ start: startDate, end: endDate, departmentId })) as { + const result = (await findAllChatMetricsByAgentAsyncCached({ start: startDate, end: endDate, departmentId })) as { [k: string]: { open: number; closed: number; onhold: number }; }; @@ -188,7 +182,7 @@ API.v1.addRoute( async get() { const { departmentId } = this.queryParams; - const result = await findAllAgentsStatusAsync({ departmentId }); + const result = await findAllAgentsStatusAsyncCached({ departmentId }); return API.v1.success(result); }, @@ -213,7 +207,7 @@ API.v1.addRoute( } const endDate = new Date(end); - const result = (await findAllChatMetricsByDepartmentAsync({ start: startDate, end: endDate, departmentId })) as { + const result = (await findAllChatMetricsByDepartmentAsyncCached({ start: startDate, end: endDate, departmentId })) as { [k: string]: { open: number; closed: number }; }; @@ -240,7 +234,7 @@ API.v1.addRoute( } const endDate = new Date(end); - const result = await findAllResponseTimeMetricsAsync({ start: startDate, end: endDate, departmentId }); + const result = await findAllResponseTimeMetricsAsyncCached({ start: startDate, end: endDate, departmentId }); return API.v1.success(result); }, diff --git a/apps/meteor/app/livechat/imports/server/rest/departments.ts b/apps/meteor/app/livechat/imports/server/rest/departments.ts index 095baefaa294..816c298f0a05 100644 --- a/apps/meteor/app/livechat/imports/server/rest/departments.ts +++ b/apps/meteor/app/livechat/imports/server/rest/departments.ts @@ -16,7 +16,6 @@ import { findArchivedDepartments, } from '../../../server/api/lib/departments'; import { DepartmentHelper } from '../../../server/lib/Departments'; -import { Livechat } from '../../../server/lib/Livechat'; import { Livechat as LivechatTs } from '../../../server/lib/LivechatTyped'; API.v1.addRoute( @@ -110,10 +109,6 @@ API.v1.addRoute( const permissionToSave = await hasPermissionAsync(this.userId, 'manage-livechat-departments'); const permissionToAddAgents = await hasPermissionAsync(this.userId, 'add-livechat-department-agents'); - check(this.urlParams, { - _id: String, - }); - check(this.bodyParams, { department: Object, agents: Match.Maybe(Array), @@ -122,23 +117,17 @@ API.v1.addRoute( const { _id } = this.urlParams; const { department, agents } = this.bodyParams; - let success; - if (permissionToSave) { - success = await LivechatEnterprise.saveDepartment(_id, department); + if (!permissionToSave) { + throw new Error('error-not-allowed'); } - if (success && agents && permissionToAddAgents) { - success = Livechat.saveDepartmentAgents(_id, { upsert: agents }); - } + const agentParam = permissionToAddAgents && agents ? { upsert: agents } : {}; + await LivechatEnterprise.saveDepartment(_id, department, agentParam); - if (success) { - return API.v1.success({ - department: await LivechatDepartment.findOneById(_id), - agents: await LivechatDepartmentAgents.find({ departmentId: _id }).toArray(), - }); - } - - return API.v1.failure(); + return API.v1.success({ + department: await LivechatDepartment.findOneById(_id), + agents: await LivechatDepartmentAgents.findByDepartmentId(_id).toArray(), + }); }, async delete() { check(this.urlParams, { @@ -266,10 +255,6 @@ API.v1.addRoute( return API.v1.success(agents); }, async post() { - check(this.urlParams, { - _id: String, - }); - check( this.bodyParams, Match.ObjectIncluding({ @@ -277,7 +262,7 @@ API.v1.addRoute( remove: Array, }), ); - await Livechat.saveDepartmentAgents(this.urlParams._id, this.bodyParams); + await LivechatTs.saveDepartmentAgents(this.urlParams._id, this.bodyParams); return API.v1.success(); }, diff --git a/apps/meteor/app/livechat/imports/server/rest/inquiries.ts b/apps/meteor/app/livechat/imports/server/rest/inquiries.ts index d3a9eec7494d..8118f353b167 100644 --- a/apps/meteor/app/livechat/imports/server/rest/inquiries.ts +++ b/apps/meteor/app/livechat/imports/server/rest/inquiries.ts @@ -23,7 +23,7 @@ API.v1.addRoute( const { department } = this.queryParams; const ourQuery: { status: string; department?: string } = { status: 'queued' }; if (department) { - const departmentFromDB = await LivechatDepartment.findOneByIdOrName(department); + const departmentFromDB = await LivechatDepartment.findOneByIdOrName(department, { projection: { _id: 1 } }); if (departmentFromDB) { ourQuery.department = departmentFromDB._id; } diff --git a/apps/meteor/app/livechat/imports/server/rest/sms.js b/apps/meteor/app/livechat/imports/server/rest/sms.js deleted file mode 100644 index 7ecb3b3fc100..000000000000 --- a/apps/meteor/app/livechat/imports/server/rest/sms.js +++ /dev/null @@ -1,208 +0,0 @@ -import { OmnichannelIntegration } from '@rocket.chat/core-services'; -import { OmnichannelSourceType } from '@rocket.chat/core-typings'; -import { LivechatVisitors, LivechatRooms, LivechatDepartment } from '@rocket.chat/models'; -import { Random } from '@rocket.chat/random'; -import { serverFetch as fetch } from '@rocket.chat/server-fetch'; -import { Meteor } from 'meteor/meteor'; - -import { API } from '../../../../api/server'; -import { FileUpload } from '../../../../file-upload/server'; -import { settings } from '../../../../settings/server'; -import { Livechat } from '../../../server/lib/Livechat'; -import { Livechat as LivechatTyped } from '../../../server/lib/LivechatTyped'; - -const getUploadFile = async (details, fileUrl) => { - const response = await fetch(fileUrl); - - const content = Buffer.from(await response.arrayBuffer()); - - const contentSize = content.length; - - if (response.status !== 200 || contentSize === 0) { - throw new Meteor.Error('error-invalid-file-uploaded', 'Invalid file uploaded'); - } - - const fileStore = FileUpload.getStore('Uploads'); - - return fileStore.insert({ ...details, size: contentSize }, content); -}; - -const defineDepartment = async (idOrName) => { - if (!idOrName || idOrName === '') { - return; - } - - const department = await LivechatDepartment.findOneByIdOrName(idOrName); - return department && department._id; -}; - -const defineVisitor = async (smsNumber, targetDepartment) => { - const visitor = await LivechatVisitors.findOneVisitorByPhone(smsNumber); - let data = { - token: (visitor && visitor.token) || Random.id(), - }; - - if (!visitor) { - data = Object.assign(data, { - username: smsNumber.replace(/[^0-9]/g, ''), - phone: { - number: smsNumber, - }, - }); - } - - if (targetDepartment) { - data.department = targetDepartment; - } - - const id = await LivechatTyped.registerGuest(data); - return LivechatVisitors.findOneEnabledById(id); -}; - -const normalizeLocationSharing = (payload) => { - const { extra: { fromLatitude: latitude, fromLongitude: longitude } = {} } = payload; - if (!latitude || !longitude) { - return; - } - - return { - type: 'Point', - coordinates: [parseFloat(longitude), parseFloat(latitude)], - }; -}; - -API.v1.addRoute('livechat/sms-incoming/:service', { - async post() { - if (!(await OmnichannelIntegration.isConfiguredSmsService(this.urlParams.service))) { - return API.v1.failure('Invalid service'); - } - - const smsDepartment = settings.get('SMS_Default_Omnichannel_Department'); - const SMSService = await OmnichannelIntegration.getSmsService(this.urlParams.service); - const sms = SMSService.parse(this.bodyParams); - const { department } = this.queryParams; - let targetDepartment = await defineDepartment(department || smsDepartment); - if (!targetDepartment) { - targetDepartment = await defineDepartment(smsDepartment); - } - - const visitor = await defineVisitor(sms.from, targetDepartment); - const { token } = visitor; - const room = await LivechatRooms.findOneOpenByVisitorTokenAndDepartmentIdAndSource(token, targetDepartment, OmnichannelSourceType.SMS); - const roomExists = !!room; - const location = normalizeLocationSharing(sms); - const rid = (room && room._id) || Random.id(); - - const sendMessage = { - guest: visitor, - roomInfo: { - sms: { - from: sms.to, - }, - source: { - type: OmnichannelSourceType.SMS, - alias: this.urlParams.service, - }, - }, - }; - - // create an empty room first place, so attachments have a place to live - if (!roomExists) { - await LivechatTyped.getRoom(visitor, { rid, token, msg: '' }, sendMessage.roomInfo, undefined); - } - - let file; - let attachments; - - const [media] = sms.media; - if (media) { - const { url: smsUrl, contentType } = media; - const details = { - name: 'Upload File', - type: contentType, - rid, - visitorToken: token, - }; - - let attachment; - try { - const uploadedFile = await getUploadFile(details, smsUrl); - file = { _id: uploadedFile._id, name: uploadedFile.name, type: uploadedFile.type }; - const fileUrl = FileUpload.getPath(`${file._id}/${encodeURI(file.name)}`); - - attachment = { - title: file.name, - type: 'file', - description: file.description, - title_link: fileUrl, - }; - - if (/^image\/.+/.test(file.type)) { - attachment.image_url = fileUrl; - attachment.image_type = file.type; - attachment.image_size = file.size; - attachment.image_dimensions = file.identify != null ? file.identify.size : undefined; - } else if (/^audio\/.+/.test(file.type)) { - attachment.audio_url = fileUrl; - attachment.audio_type = file.type; - attachment.audio_size = file.size; - attachment.title_link_download = true; - } else if (/^video\/.+/.test(file.type)) { - attachment.video_url = fileUrl; - attachment.video_type = file.type; - attachment.video_size = file.size; - attachment.title_link_download = true; - } else { - attachment.title_link_download = true; - } - } catch (err) { - Livechat.logger.error({ msg: 'Attachment upload failed', err }); - attachment = { - fields: [ - { - title: 'User upload failed', - value: 'An attachment was received, but upload to server failed', - short: true, - }, - ], - color: 'yellow', - }; - } - attachments = [attachment]; - } - - sendMessage.message = { - _id: Random.id(), - rid, - token, - msg: sms.body, - ...(location && { location }), - ...(attachments && { attachments }), - ...(file && { file }), - }; - - try { - const msg = SMSService.response.call(this, await Livechat.sendMessage(sendMessage)); - setImmediate(async () => { - if (sms.extra) { - if (sms.extra.fromCountry) { - await Meteor.callAsync('livechat:setCustomField', sendMessage.message.token, 'country', sms.extra.fromCountry); - } - if (sms.extra.fromState) { - await Meteor.callAsync('livechat:setCustomField', sendMessage.message.token, 'state', sms.extra.fromState); - } - if (sms.extra.fromCity) { - await Meteor.callAsync('livechat:setCustomField', sendMessage.message.token, 'city', sms.extra.fromCity); - } - if (sms.extra.toPhone) { - await Meteor.callAsync('livechat:setCustomField', sendMessage.message.token, 'phoneNumber', sms.extra.toPhone); - } - } - }); - - return msg; - } catch (e) { - return SMSService.error.call(this, e); - } - }, -}); diff --git a/apps/meteor/app/livechat/imports/server/rest/sms.ts b/apps/meteor/app/livechat/imports/server/rest/sms.ts new file mode 100644 index 000000000000..2551b79cc425 --- /dev/null +++ b/apps/meteor/app/livechat/imports/server/rest/sms.ts @@ -0,0 +1,269 @@ +import { OmnichannelIntegration } from '@rocket.chat/core-services'; +import type { + ILivechatVisitor, + IOmnichannelRoom, + IUpload, + MessageAttachment, + ServiceData, + FileAttachmentProps, +} from '@rocket.chat/core-typings'; +import { OmnichannelSourceType } from '@rocket.chat/core-typings'; +import { Logger } from '@rocket.chat/logger'; +import { LivechatVisitors, LivechatRooms, LivechatDepartment } from '@rocket.chat/models'; +import { Random } from '@rocket.chat/random'; +import { serverFetch as fetch } from '@rocket.chat/server-fetch'; +import { Meteor } from 'meteor/meteor'; + +import { getFileExtension } from '../../../../../lib/utils/getFileExtension'; +import { API } from '../../../../api/server'; +import { FileUpload } from '../../../../file-upload/server'; +import { settings } from '../../../../settings/server'; +import type { ILivechatMessage } from '../../../server/lib/LivechatTyped'; +import { Livechat as LivechatTyped } from '../../../server/lib/LivechatTyped'; + +const logger = new Logger('SMS'); + +const getUploadFile = async (details: Omit, fileUrl: string) => { + const response = await fetch(fileUrl); + + const content = Buffer.from(await response.arrayBuffer()); + + const contentSize = content.length; + + if (response.status !== 200 || contentSize === 0) { + throw new Meteor.Error('error-invalid-file-uploaded', 'Invalid file uploaded'); + } + + const fileStore = FileUpload.getStore('Uploads'); + + return fileStore.insert({ ...details, size: contentSize }, content); +}; + +const defineDepartment = async (idOrName?: string) => { + if (!idOrName || idOrName === '') { + return; + } + + const department = await LivechatDepartment.findOneByIdOrName(idOrName, { projection: { _id: 1 } }); + return department?._id; +}; + +const defineVisitor = async (smsNumber: string, targetDepartment?: string) => { + const visitor = await LivechatVisitors.findOneVisitorByPhone(smsNumber); + let data: { token: string; department?: string } = { + token: visitor?.token || Random.id(), + }; + + if (!visitor) { + data = Object.assign(data, { + username: smsNumber.replace(/[^0-9]/g, ''), + phone: { + number: smsNumber, + }, + }); + } + + if (targetDepartment) { + data.department = targetDepartment; + } + + const id = await LivechatTyped.registerGuest(data); + return LivechatVisitors.findOneEnabledById(id); +}; + +const normalizeLocationSharing = (payload: ServiceData) => { + const { extra: { fromLatitude: latitude, fromLongitude: longitude } = {} } = payload; + if (!latitude || !longitude) { + return; + } + + return { + type: 'Point', + coordinates: [parseFloat(longitude), parseFloat(latitude)], + }; +}; + +// @ts-expect-error - this is an special endpoint that requires the return to not be wrapped as regular returns +API.v1.addRoute('livechat/sms-incoming/:service', { + async post() { + if (!(await OmnichannelIntegration.isConfiguredSmsService(this.urlParams.service))) { + return API.v1.failure('Invalid service'); + } + + const smsDepartment = settings.get('SMS_Default_Omnichannel_Department'); + const SMSService = await OmnichannelIntegration.getSmsService(this.urlParams.service); + const sms = SMSService.parse(this.bodyParams); + const { department } = this.queryParams; + let targetDepartment = await defineDepartment(department || smsDepartment); + if (!targetDepartment) { + targetDepartment = await defineDepartment(smsDepartment); + } + + const visitor = await defineVisitor(sms.from, targetDepartment); + if (!visitor) { + return API.v1.success(SMSService.error(new Error('Invalid visitor'))); + } + + const { token } = visitor; + const room = await LivechatRooms.findOneOpenByVisitorTokenAndDepartmentIdAndSource(token, targetDepartment, OmnichannelSourceType.SMS); + const roomExists = !!room; + const location = normalizeLocationSharing(sms); + const rid = room?._id || Random.id(); + + const roomInfo = { + sms: { + from: sms.to, + }, + source: { + type: OmnichannelSourceType.SMS, + alias: this.urlParams.service, + }, + }; + + // create an empty room first place, so attachments have a place to live + if (!roomExists) { + await LivechatTyped.getRoom(visitor, { rid, token, msg: '' }, roomInfo, undefined); + } + + let file: ILivechatMessage['file']; + const attachments: (MessageAttachment | undefined)[] = []; + + const [media] = sms?.media || []; + if (media) { + const { url: smsUrl, contentType } = media; + const details = { + name: 'Upload File', + type: contentType, + rid, + visitorToken: token, + }; + + try { + const uploadedFile = await getUploadFile(details, smsUrl); + file = { _id: uploadedFile._id, name: uploadedFile.name || 'file', type: uploadedFile.type }; + const fileUrl = FileUpload.getPath(`${file._id}/${encodeURI(file.name || 'file')}`); + + const fileType = file.type as string; + + if (/^image\/.+/.test(fileType)) { + const attachment: FileAttachmentProps = { + title: file.name, + type: 'file', + description: file.description, + title_link: fileUrl, + image_url: fileUrl, + image_type: fileType, + image_size: file.size, + }; + + if (file.identify?.size) { + attachment.image_dimensions = file?.identify.size; + } + + attachments.push(attachment); + } else if (/^audio\/.+/.test(fileType)) { + const attachment: FileAttachmentProps = { + title: file.name, + type: 'file', + description: file.description, + title_link: fileUrl, + audio_url: fileUrl, + audio_type: fileType, + audio_size: file.size, + title_link_download: true, + }; + + attachments.push(attachment); + } else if (/^video\/.+/.test(fileType)) { + const attachment: FileAttachmentProps = { + title: file.name, + type: 'file', + description: file.description, + title_link: fileUrl, + video_url: fileUrl, + video_type: fileType, + video_size: file.size as number, + title_link_download: true, + }; + + attachments.push(attachment); + } else { + const attachment = { + title: file.name, + type: 'file', + description: file.description, + format: getFileExtension(file.name), + title_link: fileUrl, + title_link_download: true, + size: file.size as number, + }; + + attachments.push(attachment); + } + } catch (err) { + logger.error({ msg: 'Attachment upload failed', err }); + const attachment = { + title: 'Attachment upload failed', + type: 'file', + description: 'An attachment was received, but upload to server failed', + fields: [ + { + title: 'User upload failed', + value: 'An attachment was received, but upload to server failed', + short: true, + }, + ], + color: 'yellow', + }; + + attachments.push(attachment); + } + } + + const sendMessage: { + guest: ILivechatVisitor; + message: ILivechatMessage; + roomInfo: { + source?: IOmnichannelRoom['source']; + [key: string]: unknown; + }; + } = { + guest: visitor, + roomInfo, + message: { + _id: Random.id(), + rid, + token, + msg: sms.body, + ...(location && { location }), + ...(attachments && { attachments: attachments.filter((a: any): a is MessageAttachment => !!a) }), + ...(file && { file }), + }, + }; + + try { + await LivechatTyped.sendMessage(sendMessage); + const msg = SMSService.response(); + setImmediate(async () => { + if (sms.extra) { + if (sms.extra.fromCountry) { + await Meteor.callAsync('livechat:setCustomField', sendMessage.message.token, 'country', sms.extra.fromCountry); + } + if (sms.extra.fromState) { + await Meteor.callAsync('livechat:setCustomField', sendMessage.message.token, 'state', sms.extra.fromState); + } + if (sms.extra.fromCity) { + await Meteor.callAsync('livechat:setCustomField', sendMessage.message.token, 'city', sms.extra.fromCity); + } + if (sms.extra.toPhone) { + await Meteor.callAsync('livechat:setCustomField', sendMessage.message.token, 'phoneNumber', sms.extra.toPhone); + } + } + }); + + return msg; + } catch (e: any) { + return SMSService.error(e); + } + }, +}); diff --git a/apps/meteor/app/livechat/imports/server/rest/users.ts b/apps/meteor/app/livechat/imports/server/rest/users.ts index 680bdc7e80d2..0ed8bf187cd9 100644 --- a/apps/meteor/app/livechat/imports/server/rest/users.ts +++ b/apps/meteor/app/livechat/imports/server/rest/users.ts @@ -7,18 +7,17 @@ import { API } from '../../../../api/server'; import { getPaginationItems } from '../../../../api/server/helpers/getPaginationItems'; import { hasAtLeastOnePermissionAsync } from '../../../../authorization/server/functions/hasPermission'; import { findAgents, findManagers } from '../../../server/api/lib/users'; -import { Livechat } from '../../../server/lib/Livechat'; +import { Livechat } from '../../../server/lib/LivechatTyped'; + +const emptyStringArray: string[] = []; API.v1.addRoute( 'livechat/users/:type', { authRequired: true, permissionsRequired: { - GET: { - permissions: ['manage-livechat-agents'], - operation: 'hasAll', - }, - POST: { permissions: ['view-livechat-manager'], operation: 'hasAll' }, + 'POST': ['view-livechat-manager'], + '*': emptyStringArray, }, validateParams: { GET: isLivechatUsersManagerGETProps, @@ -39,9 +38,13 @@ API.v1.addRoute( return API.v1.unauthorized(); } + const { onlyAvailable, excludeId, showIdleAgents } = this.queryParams; return API.v1.success( await findAgents({ text, + onlyAvailable, + excludeId, + showIdleAgents, pagination: { offset, count, @@ -122,7 +125,7 @@ API.v1.addRoute( async delete() { const user = await Users.findOneById(this.urlParams._id); - if (!user) { + if (!user?.username) { return API.v1.failure(); } diff --git a/apps/meteor/app/livechat/lib/messageTypes.ts b/apps/meteor/app/livechat/lib/messageTypes.ts index ace0d4e65bfa..8a1931a300dc 100644 --- a/apps/meteor/app/livechat/lib/messageTypes.ts +++ b/apps/meteor/app/livechat/lib/messageTypes.ts @@ -108,19 +108,25 @@ MessageTypes.registerType({ MessageTypes.registerType({ id: 'livechat_webrtc_video_call', - render(message) { + message: 'room_changed_type', + data(message) { if (message.msg === 'ended' && message.webRtcCallEndTs && message.ts) { - return t('WebRTC_call_ended_message', { - callDuration: formatDistance(new Date(message.webRtcCallEndTs), new Date(message.ts)), - endTime: moment(message.webRtcCallEndTs).format('h:mm A'), - }); + return { + message: t('WebRTC_call_ended_message', { + callDuration: formatDistance(new Date(message.webRtcCallEndTs), new Date(message.ts)), + endTime: moment(message.webRtcCallEndTs).format('h:mm A'), + }), + }; } if (message.msg === 'declined' && message.webRtcCallEndTs) { - return t('WebRTC_call_declined_message'); + return { + message: t('WebRTC_call_declined_message'), + }; } - return escapeHTML(message.msg); + return { + message: escapeHTML(message.msg), + }; }, - message: 'room_changed_type', }); MessageTypes.registerType({ diff --git a/apps/meteor/app/livechat/server/api.ts b/apps/meteor/app/livechat/server/api.ts index 865b4308b941..9227a8508938 100644 --- a/apps/meteor/app/livechat/server/api.ts +++ b/apps/meteor/app/livechat/server/api.ts @@ -1,6 +1,6 @@ import '../imports/server/rest/agent'; import '../imports/server/rest/departments'; -import '../imports/server/rest/sms.js'; +import '../imports/server/rest/sms'; import '../imports/server/rest/users'; import '../imports/server/rest/upload'; import '../imports/server/rest/inquiries'; diff --git a/apps/meteor/app/livechat/server/api/lib/appearance.ts b/apps/meteor/app/livechat/server/api/lib/appearance.ts index d0a0a3df6b17..785413ead9d1 100644 --- a/apps/meteor/app/livechat/server/api/lib/appearance.ts +++ b/apps/meteor/app/livechat/server/api/lib/appearance.ts @@ -24,6 +24,10 @@ export async function findAppearance(): Promise<{ appearance: ISetting[] }> { 'Livechat_email_field_registration_form', 'Livechat_registration_form_message', 'Livechat_conversation_finished_text', + 'Livechat_hide_watermark', + 'Livechat_background', + 'Livechat_widget_position', + 'Livechat_hide_system_messages', ], }, }; diff --git a/apps/meteor/app/livechat/server/api/lib/livechat.ts b/apps/meteor/app/livechat/server/api/lib/livechat.ts index 7bb608090557..00229dae2de5 100644 --- a/apps/meteor/app/livechat/server/api/lib/livechat.ts +++ b/apps/meteor/app/livechat/server/api/lib/livechat.ts @@ -6,6 +6,7 @@ import type { IOmnichannelRoom, SelectedAgent, } from '@rocket.chat/core-typings'; +import { License } from '@rocket.chat/license'; import { EmojiCustom, LivechatTrigger, LivechatVisitors, LivechatRooms, LivechatDepartment } from '@rocket.chat/models'; import { Random } from '@rocket.chat/random'; import { Meteor } from 'meteor/meteor'; @@ -13,7 +14,6 @@ import { Meteor } from 'meteor/meteor'; import { callbacks } from '../../../../../lib/callbacks'; import { i18n } from '../../../../../server/lib/i18n'; import { normalizeAgent } from '../../lib/Helper'; -import { Livechat } from '../../lib/Livechat'; import { Livechat as LivechatTyped } from '../../lib/LivechatTyped'; export function online(department: string, skipSettingCheck = false, skipFallbackCheck = false): Promise { @@ -22,12 +22,17 @@ export function online(department: string, skipSettingCheck = false, skipFallbac async function findTriggers(): Promise[]> { const triggers = await LivechatTrigger.findEnabled().toArray(); - return triggers.map(({ _id, actions, conditions, runOnce }) => ({ - _id, - actions, - conditions, - runOnce, - })); + const hasLicense = License.hasModule('livechat-enterprise'); + const premiumActions = ['use-external-service']; + + return triggers + .filter(({ actions }) => hasLicense || actions.some((c) => !premiumActions.includes(c.name))) + .map(({ _id, actions, conditions, runOnce }) => ({ + _id, + actions, + conditions, + runOnce, + })); } async function findDepartments( @@ -59,6 +64,7 @@ export function findGuest(token: string): Promise { token: 1, visitorEmails: 1, department: 1, + activity: 1, }, }); } @@ -139,7 +145,7 @@ export function normalizeHttpHeaderData(headers: Record> { // Putting this ugly conversion while we type the livechat service - const initSettings = (await Livechat.getInitSettings()) as unknown as Record; + const initSettings = await LivechatTyped.getInitSettings(); const triggers = await findTriggers(); const departments = await findDepartments(businessUnit); const sound = `${Meteor.absoluteUrl()}sounds/chime.mp3`; @@ -164,12 +170,17 @@ export async function settings({ businessUnit = '' }: { businessUnit?: string } limitTextLength: initSettings.Livechat_enable_message_character_limit && (initSettings.Livechat_message_character_limit || initSettings.Message_MaxAllowedSize), + hiddenSystemMessages: initSettings.Livechat_hide_system_messages, + livechatLogo: initSettings.Assets_livechat_widget_logo, + hideWatermark: initSettings.Livechat_hide_watermark || false, }, theme: { title: initSettings.Livechat_title, color: initSettings.Livechat_title_color, offlineTitle: initSettings.Livechat_offline_title, offlineColor: initSettings.Livechat_offline_title_color, + position: initSettings.Livechat_widget_position || 'right', + background: initSettings.Livechat_background, actionLinks: { webrtc: [ { diff --git a/apps/meteor/app/livechat/server/api/lib/users.ts b/apps/meteor/app/livechat/server/api/lib/users.ts index 948cde0f8bfd..49ac5682a6c0 100644 --- a/apps/meteor/app/livechat/server/api/lib/users.ts +++ b/apps/meteor/app/livechat/server/api/lib/users.ts @@ -1,6 +1,7 @@ import type { ILivechatAgent, IRole } from '@rocket.chat/core-typings'; import { Users } from '@rocket.chat/models'; import { escapeRegExp } from '@rocket.chat/string-helpers'; +import type { FilterOperators } from 'mongodb'; /** * @param {IRole['_id']} role the role id @@ -10,18 +11,39 @@ import { escapeRegExp } from '@rocket.chat/string-helpers'; async function findUsers({ role, text, + onlyAvailable = false, + excludeId, + showIdleAgents = true, pagination: { offset, count, sort }, }: { role: IRole['_id']; text?: string; + onlyAvailable?: boolean; + excludeId?: string; + showIdleAgents?: boolean; pagination: { offset: number; count: number; sort: any }; }): Promise<{ users: ILivechatAgent[]; count: number; offset: number; total: number }> { - const query = {}; + const query: FilterOperators = {}; + const orConditions: FilterOperators['$or'] = []; if (text) { const filterReg = new RegExp(escapeRegExp(text), 'i'); - Object.assign(query, { - $or: [{ username: filterReg }, { name: filterReg }, { 'emails.address': filterReg }], - }); + orConditions.push({ $or: [{ username: filterReg }, { name: filterReg }, { 'emails.address': filterReg }] }); + } + + if (onlyAvailable) { + query.statusLivechat = 'available'; + } + + if (excludeId) { + query._id = { $ne: excludeId }; + } + + if (!showIdleAgents) { + orConditions.push({ $or: [{ status: { $exists: true, $ne: 'offline' }, roles: { $ne: 'bot' } }, { roles: 'bot' }] }); + } + + if (orConditions.length) { + query.$and = orConditions; } const [ @@ -52,14 +74,23 @@ async function findUsers({ } export async function findAgents({ text, + onlyAvailable = false, + excludeId, + showIdleAgents = true, pagination: { offset, count, sort }, }: { text?: string; + onlyAvailable: boolean; + excludeId?: string; + showIdleAgents?: boolean; pagination: { offset: number; count: number; sort: any }; }): Promise> { return findUsers({ role: 'livechat-agent', text, + onlyAvailable, + excludeId, + showIdleAgents, pagination: { offset, count, diff --git a/apps/meteor/app/livechat/server/api/v1/agent.ts b/apps/meteor/app/livechat/server/api/v1/agent.ts index 7a7b70ea7c8b..4c3cad33c130 100644 --- a/apps/meteor/app/livechat/server/api/v1/agent.ts +++ b/apps/meteor/app/livechat/server/api/v1/agent.ts @@ -5,7 +5,6 @@ import { isGETAgentNextToken, isPOSTLivechatAgentStatusProps } from '@rocket.cha import { API } from '../../../../api/server'; import { hasPermissionAsync } from '../../../../authorization/server/functions/hasPermission'; -import { Livechat } from '../../lib/Livechat'; import { Livechat as LivechatTyped } from '../../lib/LivechatTyped'; import { findRoom, findGuest, findAgent, findOpenRoom } from '../lib/livechat'; @@ -95,7 +94,7 @@ API.v1.addRoute( return API.v1.success({ status: agent.statusLivechat }); } - const canChangeStatus = await Livechat.allowAgentChangeServiceStatus(newStatus, agentId); + const canChangeStatus = await LivechatTyped.allowAgentChangeServiceStatus(newStatus, agentId); if (agentId !== this.userId) { if (!(await hasPermissionAsync(this.userId, 'manage-livechat-agents'))) { @@ -106,7 +105,7 @@ API.v1.addRoute( // Next version we'll update this to return an error // And update the FE accordingly if (canChangeStatus) { - await Livechat.setUserStatusLivechat(agentId, newStatus); + await LivechatTyped.setUserStatusLivechat(agentId, newStatus); return API.v1.success({ status: newStatus }); } @@ -117,7 +116,7 @@ API.v1.addRoute( return API.v1.failure('error-business-hours-are-closed'); } - await Livechat.setUserStatusLivechat(agentId, newStatus); + await LivechatTyped.setUserStatusLivechat(agentId, newStatus); return API.v1.success({ status: newStatus }); }, diff --git a/apps/meteor/app/livechat/server/api/v1/config.ts b/apps/meteor/app/livechat/server/api/v1/config.ts index 37264721cb49..79a6132136c5 100644 --- a/apps/meteor/app/livechat/server/api/v1/config.ts +++ b/apps/meteor/app/livechat/server/api/v1/config.ts @@ -5,7 +5,7 @@ import { API } from '../../../../api/server'; import { Livechat } from '../../lib/LivechatTyped'; import { settings, findOpenRoom, getExtraConfigInfo, findAgent } from '../lib/livechat'; -const cachedSettings = mem(settings, { maxAge: 1000, cacheKey: JSON.stringify }); +const cachedSettings = mem(settings, { maxAge: process.env.TEST_MODE === 'true' ? 1 : 1000, cacheKey: JSON.stringify }); API.v1.addRoute( 'livechat/config', diff --git a/apps/meteor/app/livechat/server/api/v1/customField.ts b/apps/meteor/app/livechat/server/api/v1/customField.ts index 15152d2143ff..80fe83bf5509 100644 --- a/apps/meteor/app/livechat/server/api/v1/customField.ts +++ b/apps/meteor/app/livechat/server/api/v1/customField.ts @@ -2,7 +2,7 @@ import { isLivechatCustomFieldsProps, isPOSTLivechatCustomFieldParams, isPOSTLiv import { API } from '../../../../api/server'; import { getPaginationItems } from '../../../../api/server/helpers/getPaginationItems'; -import { Livechat } from '../../lib/Livechat'; +import { Livechat } from '../../lib/LivechatTyped'; import { findLivechatCustomFields, findCustomFieldById } from '../lib/customFields'; import { findGuest } from '../lib/livechat'; diff --git a/apps/meteor/app/livechat/server/api/v1/message.ts b/apps/meteor/app/livechat/server/api/v1/message.ts index 104e2ece94d5..1dcf54e403a6 100644 --- a/apps/meteor/app/livechat/server/api/v1/message.ts +++ b/apps/meteor/app/livechat/server/api/v1/message.ts @@ -17,7 +17,6 @@ import { isWidget } from '../../../../api/server/helpers/isWidget'; import { loadMessageHistory } from '../../../../lib/server/functions/loadMessageHistory'; import { settings } from '../../../../settings/server'; import { normalizeMessageFileUpload } from '../../../../utils/server/functions/normalizeMessageFileUpload'; -import { Livechat } from '../../lib/Livechat'; import { Livechat as LivechatTyped } from '../../lib/LivechatTyped'; import { findGuest, findRoom, normalizeHttpHeaderData } from '../lib/livechat'; @@ -67,7 +66,7 @@ API.v1.addRoute( }, }; - const result = await Livechat.sendMessage(sendMessage); + const result = await LivechatTyped.sendMessage(sendMessage); if (result) { const message = await Messages.findOneById(_id); if (!message) { @@ -134,9 +133,9 @@ API.v1.addRoute( throw new Error('invalid-message'); } - const result = await Livechat.updateMessage({ + const result = await LivechatTyped.updateMessage({ guest, - message: { _id: msg._id, msg: this.bodyParams.msg }, + message: { _id: msg._id, msg: this.bodyParams.msg, rid: msg.rid }, }); if (!result) { return API.v1.failure(); @@ -176,7 +175,7 @@ API.v1.addRoute( throw new Error('invalid-message'); } - const result = await Livechat.deleteMessage({ guest, message }); + const result = await LivechatTyped.deleteMessage({ guest, message }); if (result) { return API.v1.success({ message: { @@ -272,10 +271,15 @@ API.v1.addRoute( visitor = await LivechatVisitors.findOneEnabledById(visitorId); } + const guest = visitor; + if (!guest) { + throw new Error('error-invalid-token'); + } + const sentMessages = await Promise.all( this.bodyParams.messages.map(async (message: { msg: string }): Promise<{ username: string; msg: string; ts: number }> => { const sendMessage = { - guest: visitor, + guest, message: { _id: Random.id(), rid, @@ -288,8 +292,8 @@ API.v1.addRoute( }, }, }; - // @ts-expect-error -- Typings on sendMessage are wrong - const sentMessage = await Livechat.sendMessage(sendMessage); + + const sentMessage = await LivechatTyped.sendMessage(sendMessage); return { username: sentMessage.u.username, msg: sentMessage.msg, diff --git a/apps/meteor/app/livechat/server/api/v1/offlineMessage.ts b/apps/meteor/app/livechat/server/api/v1/offlineMessage.ts index b01e60d2265f..6acd6ab98ea1 100644 --- a/apps/meteor/app/livechat/server/api/v1/offlineMessage.ts +++ b/apps/meteor/app/livechat/server/api/v1/offlineMessage.ts @@ -2,7 +2,7 @@ import { isPOSTLivechatOfflineMessageParams } from '@rocket.chat/rest-typings'; import { i18n } from '../../../../../server/lib/i18n'; import { API } from '../../../../api/server'; -import { Livechat } from '../../lib/Livechat'; +import { Livechat } from '../../lib/LivechatTyped'; API.v1.addRoute( 'livechat/offline.message', diff --git a/apps/meteor/app/livechat/server/api/v1/pageVisited.ts b/apps/meteor/app/livechat/server/api/v1/pageVisited.ts index 9e9434bffe93..e89a3e17f0a1 100644 --- a/apps/meteor/app/livechat/server/api/v1/pageVisited.ts +++ b/apps/meteor/app/livechat/server/api/v1/pageVisited.ts @@ -3,7 +3,7 @@ import { Messages } from '@rocket.chat/models'; import { isPOSTLivechatPageVisitedParams } from '@rocket.chat/rest-typings'; import { API } from '../../../../api/server'; -import { Livechat } from '../../lib/Livechat'; +import { Livechat } from '../../lib/LivechatTyped'; API.v1.addRoute( 'livechat/page.visited', diff --git a/apps/meteor/app/livechat/server/api/v1/room.ts b/apps/meteor/app/livechat/server/api/v1/room.ts index 8f6151797463..f610b9a9d3de 100644 --- a/apps/meteor/app/livechat/server/api/v1/room.ts +++ b/apps/meteor/app/livechat/server/api/v1/room.ts @@ -1,3 +1,4 @@ +import { Omnichannel } from '@rocket.chat/core-services'; import type { ILivechatAgent, IOmnichannelRoom, IUser, SelectedAgent, TransferByData } from '@rocket.chat/core-typings'; import { isOmnichannelRoom, OmnichannelSourceType } from '@rocket.chat/core-typings'; import { LivechatVisitors, Users, LivechatRooms, Subscriptions, Messages } from '@rocket.chat/models'; @@ -23,7 +24,6 @@ import { hasPermissionAsync } from '../../../../authorization/server/functions/h import { addUserToRoom } from '../../../../lib/server/functions/addUserToRoom'; import { settings as rcSettings } from '../../../../settings/server'; import { normalizeTransferredByData } from '../../lib/Helper'; -import { Livechat } from '../../lib/Livechat'; import type { CloseRoomParams } from '../../lib/LivechatTyped'; import { Livechat as LivechatTyped } from '../../lib/LivechatTyped'; import { findGuest, findRoom, getRoom, settings, findAgent, onCheckRoomParams } from '../lib/livechat'; @@ -251,7 +251,7 @@ API.v1.addRoute( const { _id, username, name } = guest; const transferredBy = normalizeTransferredByData({ _id, username, name, userType: 'visitor' }, room); - if (!(await Livechat.transfer(room, guest, { roomId: rid, departmentId: department, transferredBy }))) { + if (!(await LivechatTyped.transfer(room, guest, { departmentId: department, transferredBy }))) { return API.v1.failure(); } @@ -312,10 +312,10 @@ API.v1.addRoute( { authRequired: true, permissionsRequired: ['view-l-room', 'transfer-livechat-guest'], validateParams: isLiveChatRoomForwardProps }, { async post() { - const transferData: typeof this.bodyParams & { - transferredBy?: unknown; + const transferData = this.bodyParams as typeof this.bodyParams & { + transferredBy: TransferByData; transferredTo?: { _id: string; username?: string; name?: string }; - } = this.bodyParams; + }; const room = await LivechatRooms.findOneById(this.bodyParams.roomId); if (!room || room.t !== 'l') { @@ -326,7 +326,15 @@ API.v1.addRoute( throw new Error('This_conversation_is_already_closed'); } + if (!(await Omnichannel.isWithinMACLimit(room))) { + throw new Error('error-mac-limit-reached'); + } + const guest = await LivechatVisitors.findOneEnabledById(room.v?._id); + if (!guest) { + throw new Error('error-invalid-visitor'); + } + const transferedBy = this.user satisfies TransferByData; transferData.transferredBy = normalizeTransferredByData(transferedBy, room); if (transferData.userId) { @@ -340,7 +348,7 @@ API.v1.addRoute( } } - const chatForwardedResult = await Livechat.transfer(room, guest, transferData); + const chatForwardedResult = await LivechatTyped.transfer(room, guest, transferData); if (!chatForwardedResult) { throw new Error('error-forwarding-chat'); } @@ -408,6 +416,14 @@ API.v1.addRoute( throw new Error('error-invalid-room'); } + if (!room.open) { + throw new Error('room-closed'); + } + + if (!(await Omnichannel.isWithinMACLimit(room))) { + throw new Error('error-mac-limit-reached'); + } + if (!(await canAccessRoomAsync(room, user))) { throw new Error('error-not-allowed'); } @@ -442,7 +458,7 @@ API.v1.addRoute( } // We want this both operations to be concurrent, so we have to go with Promise.allSettled - const result = await Promise.allSettled([Livechat.saveGuest(guestData, this.userId), Livechat.saveRoomInfo(roomData)]); + const result = await Promise.allSettled([LivechatTyped.saveGuest(guestData, this.userId), LivechatTyped.saveRoomInfo(roomData)]); const firstError = result.find((item) => item.status === 'rejected'); if (firstError) { diff --git a/apps/meteor/app/livechat/server/api/v1/statistics.ts b/apps/meteor/app/livechat/server/api/v1/statistics.ts index 078f366bb484..2cf30474a7d8 100644 --- a/apps/meteor/app/livechat/server/api/v1/statistics.ts +++ b/apps/meteor/app/livechat/server/api/v1/statistics.ts @@ -3,7 +3,7 @@ import { isLivechatAnalyticsAgentOverviewProps, isLivechatAnalyticsOverviewProps import { API } from '../../../../api/server'; import { settings } from '../../../../settings/server'; -import { Livechat } from '../../lib/Livechat'; +import { getAgentOverviewDataCached, getAnalyticsOverviewDataCached } from '../../lib/AnalyticsTyped'; API.v1.addRoute( 'livechat/analytics/agent-overview', @@ -22,7 +22,7 @@ API.v1.addRoute( const user = await Users.findOneById(this.userId, { projection: { _id: 1, utcOffset: 1 } }); return API.v1.success( - await Livechat.Analytics.getAgentOverviewData({ + await getAgentOverviewDataCached({ departmentId, utcOffset: user?.utcOffset || 0, daterange: { from, to }, @@ -52,7 +52,7 @@ API.v1.addRoute( const language = user?.language || settings.get('Language') || 'en'; return API.v1.success( - await Livechat.Analytics.getAnalyticsOverviewData({ + await getAnalyticsOverviewDataCached({ departmentId, utcOffset: user?.utcOffset || 0, daterange: { from, to }, diff --git a/apps/meteor/app/livechat/server/api/v1/transcript.ts b/apps/meteor/app/livechat/server/api/v1/transcript.ts index 3eaa91c37c7c..b36873a6ac27 100644 --- a/apps/meteor/app/livechat/server/api/v1/transcript.ts +++ b/apps/meteor/app/livechat/server/api/v1/transcript.ts @@ -1,10 +1,10 @@ +import { Omnichannel } from '@rocket.chat/core-services'; import type { IOmnichannelRoom } from '@rocket.chat/core-typings'; import { LivechatRooms, Users } from '@rocket.chat/models'; import { isPOSTLivechatTranscriptParams, isPOSTLivechatTranscriptRequestParams } from '@rocket.chat/rest-typings'; import { i18n } from '../../../../../server/lib/i18n'; import { API } from '../../../../api/server'; -import { Livechat as LivechatJS } from '../../lib/Livechat'; import { Livechat } from '../../lib/LivechatTyped'; API.v1.addRoute( @@ -34,8 +34,8 @@ API.v1.addRoute( { async delete() { const { rid } = this.urlParams; - const room = await LivechatRooms.findOneById>(rid, { - projection: { open: 1, transcriptRequest: 1 }, + const room = await LivechatRooms.findOneById>(rid, { + projection: { open: 1, transcriptRequest: 1, v: 1 }, }); if (!room?.open) { @@ -45,6 +45,10 @@ API.v1.addRoute( throw new Error('error-transcript-not-requested'); } + if (!(await Omnichannel.isWithinMACLimit(room))) { + throw new Error('error-mac-limit-reached'); + } + await LivechatRooms.unsetEmailTranscriptRequestedByRoomId(rid); return API.v1.success(); @@ -57,7 +61,11 @@ API.v1.addRoute( projection: { _id: 1, username: 1, name: 1, utcOffset: 1 }, }); - await LivechatJS.requestTranscript({ rid, email, subject, user }); + if (!user) { + throw new Error('error-invalid-user'); + } + + await Livechat.requestTranscript({ rid, email, subject, user }); return API.v1.success(); }, diff --git a/apps/meteor/app/livechat/server/api/v1/videoCall.ts b/apps/meteor/app/livechat/server/api/v1/videoCall.ts index 52cd8738bec9..94df06ba418c 100644 --- a/apps/meteor/app/livechat/server/api/v1/videoCall.ts +++ b/apps/meteor/app/livechat/server/api/v1/videoCall.ts @@ -1,4 +1,5 @@ -import { Message } from '@rocket.chat/core-services'; +import { Message, Omnichannel } from '@rocket.chat/core-services'; +import type { IOmnichannelRoom } from '@rocket.chat/core-typings'; import { Messages, Settings, Rooms } from '@rocket.chat/models'; import { isGETWebRTCCall, isPUTWebRTCCallId } from '@rocket.chat/rest-typings'; @@ -27,6 +28,10 @@ API.v1.addRoute( throw new Error('invalid-room'); } + if (!(await Omnichannel.isWithinMACLimit(room as IOmnichannelRoom))) { + throw new Error('error-mac-limit-reached'); + } + const webrtcCallingAllowed = rcSettings.get('WebRTC_Enabled') === true && rcSettings.get('Omnichannel_call_provider') === 'WebRTC'; if (!webrtcCallingAllowed) { throw new Error('webRTC calling not enabled'); @@ -79,6 +84,10 @@ API.v1.addRoute( throw new Error('invalid-room'); } + if (!(await Omnichannel.isWithinMACLimit(room as IOmnichannelRoom))) { + throw new Error('error-mac-limit-reached'); + } + const call = await Messages.findOneById(callId); if (!call || call.t !== 'livechat_webrtc_video_call') { throw new Error('invalid-callId'); diff --git a/apps/meteor/app/livechat/server/api/v1/visitor.ts b/apps/meteor/app/livechat/server/api/v1/visitor.ts index 84f7b96e155d..9c19f5bbdec8 100644 --- a/apps/meteor/app/livechat/server/api/v1/visitor.ts +++ b/apps/meteor/app/livechat/server/api/v1/visitor.ts @@ -1,4 +1,4 @@ -import type { IRoom } from '@rocket.chat/core-typings'; +import type { ILivechatCustomField, ILivechatVisitor, IRoom } from '@rocket.chat/core-typings'; import { LivechatVisitors as VisitorsRaw, LivechatCustomField, LivechatRooms } from '@rocket.chat/models'; import { Match, check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -6,7 +6,6 @@ import { Meteor } from 'meteor/meteor'; import { callbacks } from '../../../../../lib/callbacks'; import { API } from '../../../../api/server'; import { settings } from '../../../../settings/server'; -import { Livechat } from '../../lib/Livechat'; import { Livechat as LivechatTyped } from '../../lib/LivechatTyped'; import { findGuest, normalizeHttpHeaderData } from '../lib/livechat'; @@ -31,6 +30,11 @@ API.v1.addRoute('livechat/visitor', { }); const { customFields, id, token, name, email, department, phone, username, connectionData } = this.bodyParams.visitor; + + if (!token?.trim()) { + throw new Meteor.Error('error-invalid-token', 'Token cannot be empty', { method: 'livechat/visitor' }); + } + const guest = { token, ...(id && { id }), @@ -45,24 +49,65 @@ API.v1.addRoute('livechat/visitor', { const visitorId = await LivechatTyped.registerGuest(guest); - let visitor = await VisitorsRaw.findOneEnabledById(visitorId, {}); + let visitor: ILivechatVisitor | null = await VisitorsRaw.findOneEnabledById(visitorId, {}); if (visitor) { const extraQuery = await callbacks.run('livechat.applyRoomRestrictions', {}); // If it's updating an existing visitor, it must also update the roomInfo const rooms = await LivechatRooms.findOpenByVisitorToken(visitor?.token, {}, extraQuery).toArray(); - await Promise.all(rooms.map((room: IRoom) => Livechat.saveRoomInfo(room, visitor))); + await Promise.all( + rooms.map( + (room: IRoom) => + visitor && + LivechatTyped.saveRoomInfo(room, { + _id: visitor._id, + name: visitor.name, + phone: visitor.phone?.[0]?.phoneNumber, + livechatData: visitor.livechatData as { [k: string]: string }, + }), + ), + ); } - if (customFields && Array.isArray(customFields)) { - for await (const field of customFields) { - const customField = await LivechatCustomField.findOneById(field.key); - if (!customField) { - continue; - } - const { key, value, overwrite } = field; - if (customField.scope === 'visitor' && !(await VisitorsRaw.updateLivechatDataByToken(token, key, value, overwrite))) { - return API.v1.failure(); - } + if (customFields && Array.isArray(customFields) && customFields.length > 0) { + const keys = customFields.map((field) => field.key); + const errors: string[] = []; + + const processedKeys = await Promise.all( + await LivechatCustomField.findByIdsAndScope>(keys, 'visitor', { + projection: { _id: 1 }, + }) + .map(async (field) => { + const customField = customFields.find((f) => f.key === field._id); + if (!customField) { + return; + } + + const { key, value, overwrite } = customField; + // TODO: Change this to Bulk update + if (!(await VisitorsRaw.updateLivechatDataByToken(token, key, value, overwrite))) { + errors.push(key); + } + + return key; + }) + .toArray(), + ); + + if (processedKeys.length !== keys.length) { + LivechatTyped.logger.warn({ + msg: 'Some custom fields were not processed', + visitorId, + missingKeys: keys.filter((key) => !processedKeys.includes(key)), + }); + } + + if (errors.length > 0) { + LivechatTyped.logger.error({ + msg: 'Error updating custom fields', + visitorId, + errors, + }); + throw new Error('error-updating-custom-fields'); } visitor = await VisitorsRaw.findOneEnabledById(visitorId, {}); @@ -121,7 +166,7 @@ API.v1.addRoute('livechat/visitor/:token', { } const { _id } = visitor; - const result = await Livechat.removeGuest(_id); + const result = await LivechatTyped.removeGuest(_id); if (!result.modifiedCount) { throw new Meteor.Error('error-removing-visitor', 'An error ocurred while deleting visitor'); } @@ -193,7 +238,7 @@ API.v1.addRoute('livechat/visitor.status', { throw new Meteor.Error('invalid-token'); } - await Livechat.notifyGuestStatusChanged(token, status); + await LivechatTyped.notifyGuestStatusChanged(token, status); return API.v1.success({ token, status }); }, diff --git a/apps/meteor/app/livechat/server/api/v1/webhooks.ts b/apps/meteor/app/livechat/server/api/v1/webhooks.ts index e282e2bd548b..af7c97d5145c 100644 --- a/apps/meteor/app/livechat/server/api/v1/webhooks.ts +++ b/apps/meteor/app/livechat/server/api/v1/webhooks.ts @@ -1,8 +1,10 @@ +import { Logger } from '@rocket.chat/logger'; import { serverFetch as fetch } from '@rocket.chat/server-fetch'; import { API } from '../../../../api/server'; import { settings } from '../../../../settings/server'; -import { Livechat } from '../../lib/Livechat'; + +const logger = new Logger('WebhookTest'); API.v1.addRoute( 'livechat/webhook.test', @@ -70,18 +72,18 @@ API.v1.addRoute( } try { - Livechat.logger.debug(`Testing webhook ${webhookUrl}`); + logger.debug(`Testing webhook ${webhookUrl}`); const request = await fetch(webhookUrl, options); const response = await request.text(); - Livechat.logger.debug({ response }); + logger.debug({ response }); if (request.status === 200) { return API.v1.success(); } throw new Error('Invalid status code'); } catch (error) { - Livechat.logger.error(`Error testing webhook: ${error}`); + logger.error(`Error testing webhook: ${error}`); throw new Error('error-invalid-webhook-response'); } }, diff --git a/apps/meteor/app/livechat/server/business-hour/AbstractBusinessHour.ts b/apps/meteor/app/livechat/server/business-hour/AbstractBusinessHour.ts index 55de5bbf6315..a5f11caaab63 100644 --- a/apps/meteor/app/livechat/server/business-hour/AbstractBusinessHour.ts +++ b/apps/meteor/app/livechat/server/business-hour/AbstractBusinessHour.ts @@ -1,4 +1,4 @@ -import type { ILivechatAgentStatus, ILivechatBusinessHour, ILivechatDepartment } from '@rocket.chat/core-typings'; +import type { AtLeast, ILivechatAgentStatus, ILivechatBusinessHour, ILivechatDepartment } from '@rocket.chat/core-typings'; import type { ILivechatBusinessHoursModel, IUsersModel } from '@rocket.chat/model-typings'; import { LivechatBusinessHours, Users } from '@rocket.chat/models'; import moment from 'moment-timezone'; @@ -14,8 +14,8 @@ export interface IBusinessHourBehavior { onAddAgentToDepartment(options?: { departmentId: string; agentsId: string[] }): Promise; onRemoveAgentFromDepartment(options?: Record): Promise; onRemoveDepartment(options: { department: ILivechatDepartment; agentsIds: string[] }): Promise; - onDepartmentDisabled(department?: ILivechatDepartment): Promise; - onDepartmentArchived(department: Pick): Promise; + onDepartmentDisabled(department?: AtLeast): Promise; + onDepartmentArchived(department: Pick): Promise; onStartBusinessHours(): Promise; afterSaveBusinessHours(businessHourData: ILivechatBusinessHour): Promise; allowAgentChangeServiceStatus(agentId: string): Promise; diff --git a/apps/meteor/app/livechat/server/hooks/afterUserActions.ts b/apps/meteor/app/livechat/server/hooks/afterUserActions.ts index 0419f1d02a1d..2d0120c93c82 100644 --- a/apps/meteor/app/livechat/server/hooks/afterUserActions.ts +++ b/apps/meteor/app/livechat/server/hooks/afterUserActions.ts @@ -2,7 +2,7 @@ import { type IUser } from '@rocket.chat/core-typings'; import { Users } from '@rocket.chat/models'; import { callbacks } from '../../../../lib/callbacks'; -import { Livechat } from '../lib/Livechat'; +import { Livechat as LivechatTyped } from '../lib/LivechatTyped'; type IAfterSaveUserProps = { user: IUser; @@ -16,18 +16,18 @@ const handleAgentUpdated = async (userData: IAfterSaveUserProps) => { const { user: newUser, oldUser } = userData; if (wasAgent(oldUser) && !isAgent(newUser)) { - await Livechat.afterRemoveAgent(newUser); + await LivechatTyped.afterRemoveAgent(newUser); } if (!wasAgent(oldUser) && isAgent(newUser)) { - await Livechat.afterAgentAdded(newUser); + await LivechatTyped.afterAgentAdded(newUser); } }; const handleAgentCreated = async (user: IUser) => { // created === no prev roles :) if (isAgent(user)) { - await Livechat.afterAgentAdded(user); + await LivechatTyped.afterAgentAdded(user); } }; @@ -38,8 +38,8 @@ const handleDeactivateUser = async (user: IUser) => { }; const handleActivateUser = async (user: IUser) => { - if (isAgent(user)) { - await Livechat.addAgent(user.username); + if (isAgent(user) && user.username) { + await LivechatTyped.afterAgentUserActivated(user); } }; diff --git a/apps/meteor/app/livechat/server/hooks/markRoomResponded.ts b/apps/meteor/app/livechat/server/hooks/markRoomResponded.ts index ad68fcf5ce5c..4a37dc4f0abe 100644 --- a/apps/meteor/app/livechat/server/hooks/markRoomResponded.ts +++ b/apps/meteor/app/livechat/server/hooks/markRoomResponded.ts @@ -1,6 +1,6 @@ import type { IOmnichannelRoom } from '@rocket.chat/core-typings'; import { isOmnichannelRoom, isEditedMessage } from '@rocket.chat/core-typings'; -import { LivechatRooms, LivechatVisitors } from '@rocket.chat/models'; +import { LivechatRooms, LivechatVisitors, LivechatInquiry } from '@rocket.chat/models'; import moment from 'moment'; import { callbacks } from '../../../../lib/callbacks'; @@ -30,11 +30,18 @@ callbacks.add( // Return YYYY-MM from moment const monthYear = moment().format('YYYY-MM'); const isVisitorActive = await LivechatVisitors.isVisitorActiveOnPeriod(room.v._id, monthYear); + + // Case: agent answers & visitor is not active, we mark visitor as active if (!isVisitorActive) { await LivechatVisitors.markVisitorActiveForPeriod(room.v._id, monthYear); } - await LivechatRooms.markVisitorActiveForPeriod(room._id, monthYear); + if (!room.v?.activity?.includes(monthYear)) { + await Promise.all([ + LivechatRooms.markVisitorActiveForPeriod(room._id, monthYear), + LivechatInquiry.markInquiryActiveForPeriod(room._id, monthYear), + ]); + } if (room.responseBy) { await LivechatRooms.setAgentLastMessageTs(room._id); diff --git a/apps/meteor/app/livechat/server/hooks/sendToCRM.ts b/apps/meteor/app/livechat/server/hooks/sendToCRM.ts index d435da17e8ec..5c3a2c0b54ab 100644 --- a/apps/meteor/app/livechat/server/hooks/sendToCRM.ts +++ b/apps/meteor/app/livechat/server/hooks/sendToCRM.ts @@ -5,7 +5,6 @@ import { LivechatRooms, Messages } from '@rocket.chat/models'; import { callbacks } from '../../../../lib/callbacks'; import { settings } from '../../../settings/server'; import { normalizeMessageFileUpload } from '../../../utils/server/functions/normalizeMessageFileUpload'; -import { Livechat } from '../lib/Livechat'; import { Livechat as LivechatTyped } from '../lib/LivechatTyped'; type AdditionalFields = @@ -36,18 +35,28 @@ type OmnichannelRoomWithExtraFields = IOmnichannelRoom & { oldDepartmentId?: IOmnichannelRoom['departmentId']; }; +type CRMActions = + | 'LivechatSessionStart' + | 'LivechatSessionQueued' + | 'LivechatSession' + | 'LivechatSessionTaken' + | 'LivechatSessionForwarded' + | 'LivechatEdit' + | 'Message' + | 'LeadCapture'; + const msgNavType = 'livechat_navigation_history'; const msgClosingType = 'livechat-close'; -const isOmnichannelNavigationMessage = (message: IMessage): message is IOmnichannelSystemMessage => { +export const isOmnichannelNavigationMessage = (message: IMessage): message is IOmnichannelSystemMessage => { return message.t === msgNavType; }; -const isOmnichannelClosingMessage = (message: IMessage): message is IOmnichannelSystemMessage => { +export const isOmnichannelClosingMessage = (message: IMessage): message is IOmnichannelSystemMessage => { return message.t === msgClosingType; }; -const sendMessageType = (msgType: string): boolean => { +export const sendMessageType = (msgType: string): boolean => { switch (msgType) { case msgClosingType: return true; @@ -61,10 +70,10 @@ const sendMessageType = (msgType: string): boolean => { } }; -const getAdditionalFieldsByType = (type: string, room: OmnichannelRoomWithExtraFields): AdditionalFields => { +export const getAdditionalFieldsByType = (type: CRMActions, room: OmnichannelRoomWithExtraFields): AdditionalFields => { const { departmentId, servedBy, closedAt, closedBy, closer, oldServedBy, oldDepartmentId } = room; switch (type) { - case 'LivechatSessionStarted': + case 'LivechatSessionStart': case 'LivechatSessionQueued': return { departmentId }; case 'LivechatSession': @@ -79,7 +88,7 @@ const getAdditionalFieldsByType = (type: string, room: OmnichannelRoomWithExtraF }; async function sendToCRM( - type: string, + type: CRMActions, room: OmnichannelRoomWithExtraFields, includeMessages: boolean | IOmnichannelSystemMessage[] = true, ): Promise { @@ -87,12 +96,14 @@ async function sendToCRM( return room; } - const postData: Awaited> & { type: string; messages: IOmnichannelSystemMessage[] } = - { - ...(await Livechat.getLivechatRoomGuestInfo(room)), - type, - messages: [], - }; + const postData: Awaited> & { + type: string; + messages: IOmnichannelSystemMessage[]; + } = { + ...(await LivechatTyped.getLivechatRoomGuestInfo(room)), + type, + messages: [], + }; let messages: IOmnichannelSystemMessage[] | null = null; if (typeof includeMessages === 'boolean' && includeMessages) { @@ -269,7 +280,7 @@ callbacks.add( if (message.token && !settings.get('Livechat_webhook_on_visitor_message')) { return message; } - if (!settings.get('Livechat_webhook_on_agent_message')) { + if (!message.token && !settings.get('Livechat_webhook_on_agent_message')) { return message; } // if the message has a type means it is a special message (like the closing comment), so skips diff --git a/apps/meteor/app/livechat/server/index.ts b/apps/meteor/app/livechat/server/index.ts index 7d9167966953..fc96f2a921a9 100644 --- a/apps/meteor/app/livechat/server/index.ts +++ b/apps/meteor/app/livechat/server/index.ts @@ -64,7 +64,6 @@ import './methods/sendTranscript'; import './methods/getFirstRoomMessage'; import './methods/getTagsList'; import './methods/getDepartmentForwardRestrictions'; -import './lib/Analytics'; import './lib/QueueManager'; import './lib/RoutingManager'; import './lib/routing/External'; @@ -76,5 +75,3 @@ import './api'; import './api/rest'; import './externalFrame'; import './methods/saveBusinessHour'; - -export { Livechat } from './lib/Livechat'; diff --git a/apps/meteor/app/livechat/server/lib/Analytics.js b/apps/meteor/app/livechat/server/lib/Analytics.js deleted file mode 100644 index 28bed221afbf..000000000000 --- a/apps/meteor/app/livechat/server/lib/Analytics.js +++ /dev/null @@ -1,901 +0,0 @@ -import { Logger } from '@rocket.chat/logger'; -import { LivechatRooms } from '@rocket.chat/models'; -import moment from 'moment-timezone'; - -import { callbacks } from '../../../../lib/callbacks'; -import { secondsToHHMMSS } from '../../../../lib/utils/secondsToHHMMSS'; -import { i18n } from '../../../../server/lib/i18n'; -import { getTimezone } from '../../../utils/server/lib/getTimezone'; - -const HOURS_IN_DAY = 24; -const logger = new Logger('OmnichannelAnalytics'); - -async function* dayIterator(from, to) { - const m = moment(from).startOf('day'); - while (m.diff(to, 'days') <= 0) { - yield moment(m); - m.add(1, 'days'); - } -} - -async function* weekIterator(from, to, customDay, timezone) { - const m = moment.tz(from, timezone).day(customDay); - while (m.diff(to, 'weeks') <= 0) { - yield moment(m); - m.add(1, 'weeks'); - } -} - -async function* hourIterator(day) { - const m = moment(day).startOf('day'); - let passedHours = 0; - while (passedHours < HOURS_IN_DAY) { - yield moment(m); - m.add(1, 'hours'); - passedHours++; - } -} - -export const Analytics = { - async getAgentOverviewData(options) { - const { departmentId, utcOffset, daterange: { from: fDate, to: tDate } = {}, chartOptions: { name } = {} } = options; - const timezone = getTimezone({ utcOffset }); - const from = moment.tz(fDate, 'YYYY-MM-DD', timezone).startOf('day').utc(); - const to = moment.tz(tDate, 'YYYY-MM-DD', timezone).endOf('day').utc(); - - if (!(moment(from).isValid() && moment(to).isValid())) { - logger.error('livechat:getAgentOverviewData => Invalid dates'); - return; - } - - if (!this.AgentOverviewData[name]) { - logger.error(`Method RocketChat.Livechat.Analytics.AgentOverviewData.${name} does NOT exist`); - return; - } - - const extraQuery = await callbacks.run('livechat.applyRoomRestrictions', {}); - return this.AgentOverviewData[name](from, to, departmentId, extraQuery); - }, - - async getAnalyticsChartData(options) { - const { - utcOffset, - departmentId, - daterange: { from: fDate, to: tDate } = {}, - chartOptions: { name: chartLabel }, - chartOptions: { name } = {}, - } = options; - - // Check if function exists, prevent server error in case property altered - if (!this.ChartData[name]) { - logger.error(`Method RocketChat.Livechat.Analytics.ChartData.${name} does NOT exist`); - return; - } - - const timezone = getTimezone({ utcOffset }); - const from = moment.tz(fDate, 'YYYY-MM-DD', timezone).startOf('day').utc(); - const to = moment.tz(tDate, 'YYYY-MM-DD', timezone).endOf('day').utc(); - const isSameDay = from.diff(to, 'days') === 0; - - if (!(moment(from).isValid() && moment(to).isValid())) { - logger.error('livechat:getAnalyticsChartData => Invalid dates'); - return; - } - - const data = { - chartLabel, - dataLabels: [], - dataPoints: [], - }; - - const extraQuery = await callbacks.run('livechat.applyRoomRestrictions', {}); - if (isSameDay) { - // data for single day - const m = moment(from); - for await (const currentHour of Array.from({ length: HOURS_IN_DAY }, (_, i) => i)) { - const hour = m.add(currentHour ? 1 : 0, 'hour').format('H'); - const label = { - from: moment.utc().set({ hour }).tz(timezone).format('hA'), - to: moment.utc().set({ hour }).add(1, 'hour').tz(timezone).format('hA'), - }; - data.dataLabels.push(`${label.from}-${label.to}`); - - const date = { - gte: m, - lt: moment(m).add(1, 'hours'), - }; - - data.dataPoints.push(await this.ChartData[name](date, departmentId, extraQuery)); - } - } else { - for await (const m of dayIterator(from, to)) { - data.dataLabels.push(m.format('M/D')); - - const date = { - gte: m, - lt: moment(m).add(1, 'days'), - }; - - data.dataPoints.push(await this.ChartData[name](date, departmentId, extraQuery)); - } - } - - return data; - }, - - async getAnalyticsOverviewData(options) { - const { departmentId, utcOffset = 0, language, daterange: { from: fDate, to: tDate } = {}, analyticsOptions: { name } = {} } = options; - const timezone = getTimezone({ utcOffset }); - const from = moment.tz(fDate, 'YYYY-MM-DD', timezone).startOf('day').utc(); - const to = moment.tz(tDate, 'YYYY-MM-DD', timezone).endOf('day').utc(); - - if (!(moment(from).isValid() && moment(to).isValid())) { - logger.error('livechat:getAnalyticsOverviewData => Invalid dates'); - return; - } - - if (!this.OverviewData[name]) { - logger.error(`Method RocketChat.Livechat.Analytics.OverviewData.${name} does NOT exist`); - return; - } - - const t = (s) => i18n.t(s, { lng: language }); - - const extraQuery = await callbacks.run('livechat.applyRoomRestrictions', {}); - return this.OverviewData[name](from, to, departmentId, timezone, t, extraQuery); - }, - - ChartData: { - /** - * - * @param {Object} date {gte: {Date}, lt: {Date}} - * - * @returns {Integer} - */ - Total_conversations(date, departmentId, extraQuery) { - return LivechatRooms.getTotalConversationsBetweenDate('l', date, { departmentId }, extraQuery); - }, - - async Avg_chat_duration(date, departmentId, extraQuery) { - let total = 0; - let count = 0; - - await LivechatRooms.getAnalyticsMetricsBetweenDate('l', date, { departmentId }, extraQuery).forEach(({ metrics }) => { - if (metrics && metrics.chatDuration) { - total += metrics.chatDuration; - count++; - } - }); - - const avgCD = count ? total / count : 0; - return Math.round(avgCD * 100) / 100; - }, - - async Total_messages(date, departmentId, extraQuery) { - let total = 0; - - // we don't want to count visitor messages - const extraFilter = { $lte: ['$token', null] }; - const allConversations = await LivechatRooms.getAnalyticsMetricsBetweenDateWithMessages( - 'l', - date, - { departmentId }, - extraFilter, - extraQuery, - ).toArray(); - allConversations.map(({ msgs }) => { - if (msgs) { - total += msgs; - } - return null; - }); - - return total; - }, - - /** - * - * @param {Object} date {gte: {Date}, lt: {Date}} - * - * @returns {Double} - */ - async Avg_first_response_time(date, departmentId, extraQuery) { - let frt = 0; - let count = 0; - await LivechatRooms.getAnalyticsMetricsBetweenDate('l', date, { departmentId }, extraQuery).forEach(({ metrics }) => { - if (metrics && metrics.response && metrics.response.ft) { - frt += metrics.response.ft; - count++; - } - }); - - const avgFrt = count ? frt / count : 0; - return Math.round(avgFrt * 100) / 100; - }, - - /** - * - * @param {Object} date {gte: {Date}, lt: {Date}} - * - * @returns {Double} - */ - async Best_first_response_time(date, departmentId, extraQuery) { - let maxFrt; - - await LivechatRooms.getAnalyticsMetricsBetweenDate('l', date, { departmentId }, extraQuery).forEach(({ metrics }) => { - if (metrics && metrics.response && metrics.response.ft) { - maxFrt = maxFrt ? Math.min(maxFrt, metrics.response.ft) : metrics.response.ft; - } - }); - - if (!maxFrt) { - maxFrt = 0; - } - - return Math.round(maxFrt * 100) / 100; - }, - - /** - * - * @param {Object} date {gte: {Date}, lt: {Date}} - * - * @returns {Double} - */ - async Avg_response_time(date, departmentId, extraQuery) { - let art = 0; - let count = 0; - await LivechatRooms.getAnalyticsMetricsBetweenDate('l', date, { departmentId }, extraQuery).forEach(({ metrics }) => { - if (metrics && metrics.response && metrics.response.avg) { - art += metrics.response.avg; - count++; - } - }); - - const avgArt = count ? art / count : 0; - - return Math.round(avgArt * 100) / 100; - }, - - /** - * - * @param {Object} date {gte: {Date}, lt: {Date}} - * - * @returns {Double} - */ - async Avg_reaction_time(date, departmentId, extraQuery) { - let arnt = 0; - let count = 0; - await LivechatRooms.getAnalyticsMetricsBetweenDate('l', date, { departmentId }, extraQuery).forEach(({ metrics }) => { - if (metrics && metrics.reaction && metrics.reaction.ft) { - arnt += metrics.reaction.ft; - count++; - } - }); - - const avgArnt = count ? arnt / count : 0; - - return Math.round(avgArnt * 100) / 100; - }, - }, - - OverviewData: { - /** - * - * @param {Map} map - * - * @return {String} - */ - getKeyHavingMaxValue(map, def) { - let maxValue = 0; - let maxKey = def; // default - - map.forEach((value, key) => { - if (value > maxValue) { - maxValue = value; - maxKey = key; - } - }); - - return maxKey; - }, - - /** - * - * @param {Date} from - * @param {Date} to - * - * @returns {Array[Object]} - */ - async Conversations(from, to, departmentId, timezone, t = (v) => v, extraQuery) { - // TODO: most calls to db here can be done in one single call instead of one per day/hour - let totalConversations = 0; // Total conversations - let openConversations = 0; // open conversations - let totalMessages = 0; // total msgs - const totalMessagesOnWeekday = new Map(); // total messages on weekdays i.e Monday, Tuesday... - const totalMessagesInHour = new Map(); // total messages in hour 0, 1, ... 23 of weekday - const days = to.diff(from, 'days') + 1; // total days - - const summarize = - (m) => - ({ metrics, msgs, onHold = false }) => { - if (metrics && !metrics.chatDuration && !onHold) { - openConversations++; - } - totalMessages += msgs; - - const weekday = m.format('dddd'); // @string: Monday, Tuesday ... - totalMessagesOnWeekday.set(weekday, totalMessagesOnWeekday.has(weekday) ? totalMessagesOnWeekday.get(weekday) + msgs : msgs); - }; - - const m = moment.tz(from, timezone).startOf('day').utc(); - // eslint-disable-next-line no-unused-vars - for await (const _ of Array(days).fill(0)) { - const clonedDate = m.clone(); - const date = { - gte: clonedDate, - lt: m.add(1, 'days'), - }; - // eslint-disable-next-line no-await-in-loop - const result = await LivechatRooms.getAnalyticsBetweenDate(date, { departmentId }, extraQuery).toArray(); - totalConversations += result.length; - - result.forEach(summarize(clonedDate)); - } - - const busiestDay = this.getKeyHavingMaxValue(totalMessagesOnWeekday, '-'); // returns key with max value - - // TODO: this code assumes the busiest day is the same every week, which may not be true - // This means that for periods larger than 1 week, the busiest hour won't be the "busiest hour" - // on the period, but the busiest hour on the busiest day. (sorry for busiest excess) - // iterate through all busiestDay in given date-range and find busiest hour - for await (const m of weekIterator(from, to, timezone)) { - if (m < from) { - continue; - } - - for await (const h of hourIterator(m)) { - const date = { - gte: h.clone(), - lt: h.add(1, 'hours'), - }; - (await LivechatRooms.getAnalyticsBetweenDate(date, { departmentId }, extraQuery).toArray()).forEach(({ msgs }) => { - const dayHour = h.format('H'); // @int : 0, 1, ... 23 - totalMessagesInHour.set(dayHour, totalMessagesInHour.has(dayHour) ? totalMessagesInHour.get(dayHour) + msgs : msgs); - }); - } - } - - const utcBusiestHour = this.getKeyHavingMaxValue(totalMessagesInHour, -1); - const busiestHour = { - to: utcBusiestHour >= 0 ? moment.utc().set({ hour: utcBusiestHour }).tz(timezone).format('hA') : '-', - from: utcBusiestHour >= 0 ? moment.utc().set({ hour: utcBusiestHour }).subtract(1, 'hour').tz(timezone).format('hA') : '', - }; - const onHoldConversations = await LivechatRooms.getOnHoldConversationsBetweenDate(from, to, departmentId, extraQuery); - - return [ - { - title: 'Total_conversations', - value: totalConversations, - }, - { - title: 'Open_conversations', - value: openConversations, - }, - { - title: 'On_Hold_conversations', - value: onHoldConversations, - }, - { - title: 'Total_messages', - value: totalMessages, - }, - { - title: 'Busiest_day', - value: t(busiestDay), - }, - { - title: 'Conversations_per_day', - value: (totalConversations / days).toFixed(2), - }, - { - title: 'Busiest_time', - value: `${busiestHour.from}${busiestHour.to ? `- ${busiestHour.to}` : ''}`, - }, - ]; - }, - - /** - * - * @param {Date} from - * @param {Date} to - * - * @returns {Array[Object]} - */ - async Productivity(from, to, departmentId, extraQuery) { - let avgResponseTime = 0; - let firstResponseTime = 0; - let avgReactionTime = 0; - let count = 0; - - const date = { - gte: from, - lt: to.add(1, 'days'), - }; - - await LivechatRooms.getAnalyticsMetricsBetweenDate('l', date, { departmentId }, extraQuery).forEach(({ metrics }) => { - if (metrics && metrics.response && metrics.reaction) { - avgResponseTime += metrics.response.avg; - firstResponseTime += metrics.response.ft; - avgReactionTime += metrics.reaction.ft; - count++; - } - }); - - if (count) { - avgResponseTime /= count; - firstResponseTime /= count; - avgReactionTime /= count; - } - - const data = [ - { - title: 'Avg_response_time', - value: secondsToHHMMSS(avgResponseTime.toFixed(2)), - }, - { - title: 'Avg_first_response_time', - value: secondsToHHMMSS(firstResponseTime.toFixed(2)), - }, - { - title: 'Avg_reaction_time', - value: secondsToHHMMSS(avgReactionTime.toFixed(2)), - }, - ]; - - return data; - }, - }, - - AgentOverviewData: { - /** - * do operation equivalent to map[key] += value - * - */ - updateMap(map, key, value) { - map.set(key, map.has(key) ? map.get(key) + value : value); - }, - - /** - * Sort array of objects by value property of object - * @param {Array(Object)} data - * @param {Boolean} [inv=false] reverse sort - */ - sortByValue(data, inv = false) { - data.sort((a, b) => { - // sort array - if (parseFloat(a.value) > parseFloat(b.value)) { - return inv ? -1 : 1; // if inv, reverse sort - } - if (parseFloat(a.value) < parseFloat(b.value)) { - return inv ? 1 : -1; - } - return 0; - }); - }, - - /** - * - * @param {Date} from - * @param {Date} to - * - * @returns {Array(Object), Array(Object)} - */ - async Total_conversations(from, to, departmentId, extraQuery) { - let total = 0; - const agentConversations = new Map(); // stores total conversations for each agent - const date = { - gte: from, - lt: to.add(1, 'days'), - }; - - const data = { - head: [ - { - name: 'Agent', - }, - { - name: '%_of_conversations', - }, - ], - data: [], - }; - - const allConversations = await LivechatRooms.getAnalyticsMetricsBetweenDateWithMessages( - 'l', - date, - { - departmentId, - }, - {}, - extraQuery, - ).toArray(); - allConversations.map((room) => { - if (room.servedBy) { - this.updateMap(agentConversations, room.servedBy.username, 1); - total++; - } - return null; - }); - - agentConversations.forEach((value, key) => { - // calculate percentage - const percentage = ((value / total) * 100).toFixed(2); - - data.data.push({ - name: key, - value: percentage, - }); - }); - - this.sortByValue(data.data, true); // reverse sort array - - data.data.forEach((value) => { - value.value = `${value.value}%`; - }); - - return data; - }, - - /** - * - * @param {Date} from - * @param {Date} to - * - * @returns {Array(Object), Array(Object)} - */ - async Avg_chat_duration(from, to, departmentId, extraQuery) { - const agentChatDurations = new Map(); // stores total conversations for each agent - const date = { - gte: from, - lt: to.add(1, 'days'), - }; - - const data = { - head: [ - { - name: 'Agent', - }, - { - name: 'Avg_chat_duration', - }, - ], - data: [], - }; - - await LivechatRooms.getAnalyticsMetricsBetweenDate('l', date, { departmentId }, extraQuery).forEach(({ metrics, servedBy }) => { - if (servedBy && metrics && metrics.chatDuration) { - if (agentChatDurations.has(servedBy.username)) { - agentChatDurations.set(servedBy.username, { - chatDuration: agentChatDurations.get(servedBy.username).chatDuration + metrics.chatDuration, - total: agentChatDurations.get(servedBy.username).total + 1, - }); - } else { - agentChatDurations.set(servedBy.username, { - chatDuration: metrics.chatDuration, - total: 1, - }); - } - } - }); - - agentChatDurations.forEach((obj, key) => { - // calculate percentage - const avg = (obj.chatDuration / obj.total).toFixed(2); - - data.data.push({ - name: key, - value: avg, - }); - }); - - this.sortByValue(data.data, true); // reverse sort array - - data.data.forEach((obj) => { - obj.value = secondsToHHMMSS(obj.value); - }); - - return data; - }, - - /** - * - * @param {Date} from - * @param {Date} to - * - * @returns {Array(Object), Array(Object)} - */ - async Total_messages(from, to, departmentId, extraQuery) { - const agentMessages = new Map(); // stores total conversations for each agent - const date = { - gte: from, - lt: to.add(1, 'days'), - }; - - const data = { - head: [ - { - name: 'Agent', - }, - { - name: 'Total_messages', - }, - ], - data: [], - }; - - // we don't want to count visitor messages - const extraFilter = { $lte: ['$token', null] }; - const allConversations = await LivechatRooms.getAnalyticsMetricsBetweenDateWithMessages( - 'l', - date, - { departmentId }, - extraFilter, - extraQuery, - ).toArray(); - allConversations.map(({ servedBy, msgs }) => { - if (servedBy) { - this.updateMap(agentMessages, servedBy.username, msgs); - } - return null; - }); - - agentMessages.forEach((value, key) => { - // calculate percentage - data.data.push({ - name: key, - value, - }); - }); - - this.sortByValue(data.data, true); // reverse sort array - - return data; - }, - - /** - * - * @param {Date} from - * @param {Date} to - * - * @returns {Array(Object), Array(Object)} - */ - async Avg_first_response_time(from, to, departmentId, extraQuery) { - const agentAvgRespTime = new Map(); // stores avg response time for each agent - const date = { - gte: from, - lt: to.add(1, 'days'), - }; - - const data = { - head: [ - { - name: 'Agent', - }, - { - name: 'Avg_first_response_time', - }, - ], - data: [], - }; - - await LivechatRooms.getAnalyticsMetricsBetweenDate('l', date, { departmentId }, extraQuery).forEach(({ metrics, servedBy }) => { - if (servedBy && metrics && metrics.response && metrics.response.ft) { - if (agentAvgRespTime.has(servedBy.username)) { - agentAvgRespTime.set(servedBy.username, { - frt: agentAvgRespTime.get(servedBy.username).frt + metrics.response.ft, - total: agentAvgRespTime.get(servedBy.username).total + 1, - }); - } else { - agentAvgRespTime.set(servedBy.username, { - frt: metrics.response.ft, - total: 1, - }); - } - } - }); - - agentAvgRespTime.forEach((obj, key) => { - // calculate avg - const avg = obj.frt / obj.total; - - data.data.push({ - name: key, - value: avg.toFixed(2), - }); - }); - - this.sortByValue(data.data, false); // sort array - - data.data.forEach((obj) => { - obj.value = secondsToHHMMSS(obj.value); - }); - - return data; - }, - - /** - * - * @param {Date} from - * @param {Date} to - * - * @returns {Array(Object), Array(Object)} - */ - async Best_first_response_time(from, to, departmentId, extraQuery) { - const agentFirstRespTime = new Map(); // stores avg response time for each agent - const date = { - gte: from, - lt: to.add(1, 'days'), - }; - - const data = { - head: [ - { - name: 'Agent', - }, - { - name: 'Best_first_response_time', - }, - ], - data: [], - }; - - await LivechatRooms.getAnalyticsMetricsBetweenDate('l', date, { departmentId }, extraQuery).forEach(({ metrics, servedBy }) => { - if (servedBy && metrics && metrics.response && metrics.response.ft) { - if (agentFirstRespTime.has(servedBy.username)) { - agentFirstRespTime.set(servedBy.username, Math.min(agentFirstRespTime.get(servedBy.username), metrics.response.ft)); - } else { - agentFirstRespTime.set(servedBy.username, metrics.response.ft); - } - } - }); - - agentFirstRespTime.forEach((value, key) => { - // calculate avg - data.data.push({ - name: key, - value: value.toFixed(2), - }); - }); - - this.sortByValue(data.data, false); // sort array - - data.data.forEach((obj) => { - obj.value = secondsToHHMMSS(obj.value); - }); - - return data; - }, - - /** - * - * @param {Date} from - * @param {Date} to - * - * @returns {Array(Object), Array(Object)} - */ - async Avg_response_time(from, to, departmentId, extraQuery) { - const agentAvgRespTime = new Map(); // stores avg response time for each agent - const date = { - gte: from, - lt: to.add(1, 'days'), - }; - - const data = { - head: [ - { - name: 'Agent', - }, - { - name: 'Avg_response_time', - }, - ], - data: [], - }; - - await LivechatRooms.getAnalyticsMetricsBetweenDate('l', date, { departmentId }, extraQuery).forEach(({ metrics, servedBy }) => { - if (servedBy && metrics && metrics.response && metrics.response.avg) { - if (agentAvgRespTime.has(servedBy.username)) { - agentAvgRespTime.set(servedBy.username, { - avg: agentAvgRespTime.get(servedBy.username).avg + metrics.response.avg, - total: agentAvgRespTime.get(servedBy.username).total + 1, - }); - } else { - agentAvgRespTime.set(servedBy.username, { - avg: metrics.response.avg, - total: 1, - }); - } - } - }); - - agentAvgRespTime.forEach((obj, key) => { - // calculate avg - const avg = obj.avg / obj.total; - - data.data.push({ - name: key, - value: avg.toFixed(2), - }); - }); - - this.sortByValue(data.data, false); // sort array - - data.data.forEach((obj) => { - obj.value = secondsToHHMMSS(obj.value); - }); - - return data; - }, - - /** - * - * @param {Date} from - * @param {Date} to - * - * @returns {Array(Object), Array(Object)} - */ - async Avg_reaction_time(from, to, departmentId, extraQuery) { - const agentAvgReactionTime = new Map(); // stores avg reaction time for each agent - const date = { - gte: from, - lt: to.add(1, 'days'), - }; - - const data = { - head: [ - { - name: 'Agent', - }, - { - name: 'Avg_reaction_time', - }, - ], - data: [], - }; - - await LivechatRooms.getAnalyticsMetricsBetweenDate('l', date, { departmentId }, extraQuery).forEach(({ metrics, servedBy }) => { - if (servedBy && metrics && metrics.reaction && metrics.reaction.ft) { - if (agentAvgReactionTime.has(servedBy.username)) { - agentAvgReactionTime.set(servedBy.username, { - frt: agentAvgReactionTime.get(servedBy.username).frt + metrics.reaction.ft, - total: agentAvgReactionTime.get(servedBy.username).total + 1, - }); - } else { - agentAvgReactionTime.set(servedBy.username, { - frt: metrics.reaction.ft, - total: 1, - }); - } - } - }); - - agentAvgReactionTime.forEach((obj, key) => { - // calculate avg - const avg = obj.frt / obj.total; - - data.data.push({ - name: key, - value: avg.toFixed(2), - }); - }); - - this.sortByValue(data.data, false); // sort array - - data.data.forEach((obj) => { - obj.value = secondsToHHMMSS(obj.value); - }); - - return data; - }, - }, -}; diff --git a/apps/meteor/app/livechat/server/lib/AnalyticsTyped.ts b/apps/meteor/app/livechat/server/lib/AnalyticsTyped.ts new file mode 100644 index 000000000000..3b7c6a3051bf --- /dev/null +++ b/apps/meteor/app/livechat/server/lib/AnalyticsTyped.ts @@ -0,0 +1,14 @@ +import { OmnichannelAnalytics } from '@rocket.chat/core-services'; +import mem from 'mem'; + +export const getAgentOverviewDataCached = mem(OmnichannelAnalytics.getAgentOverviewData, { maxAge: 60000, cacheKey: JSON.stringify }); +// Agent overview data on realtime is cached for 5 seconds +// while the data on the overview page is cached for 1 minute +export const getAnalyticsOverviewDataCached = mem(OmnichannelAnalytics.getAnalyticsOverviewData, { + maxAge: 60000, + cacheKey: JSON.stringify, +}); +export const getAnalyticsOverviewDataCachedForRealtime = mem(OmnichannelAnalytics.getAnalyticsOverviewData, { + maxAge: process.env.TEST_MODE === 'true' ? 1 : 5000, + cacheKey: JSON.stringify, +}); diff --git a/apps/meteor/app/livechat/server/lib/Departments.ts b/apps/meteor/app/livechat/server/lib/Departments.ts index f17015e52e79..ed55a856e0b8 100644 --- a/apps/meteor/app/livechat/server/lib/Departments.ts +++ b/apps/meteor/app/livechat/server/lib/Departments.ts @@ -1,4 +1,4 @@ -import type { ILivechatDepartmentAgents } from '@rocket.chat/core-typings'; +import type { ILivechatDepartment, ILivechatDepartmentAgents } from '@rocket.chat/core-typings'; import { Logger } from '@rocket.chat/logger'; import { LivechatDepartment, LivechatDepartmentAgents, LivechatRooms } from '@rocket.chat/models'; @@ -10,7 +10,9 @@ class DepartmentHelperClass { async removeDepartment(departmentId: string) { this.logger.debug(`Removing department: ${departmentId}`); - const department = await LivechatDepartment.findOneById(departmentId); + const department = await LivechatDepartment.findOneById>(departmentId, { + projection: { _id: 1, businessHourId: 1 }, + }); if (!department) { throw new Error('error-department-not-found'); } @@ -44,9 +46,7 @@ class DepartmentHelperClass { } }); - setImmediate(() => { - void callbacks.run('livechat.afterRemoveDepartment', { department, agentsIds }); - }); + await callbacks.run('livechat.afterRemoveDepartment', { department, agentsIds }); return ret; } diff --git a/apps/meteor/app/livechat/server/lib/Helper.ts b/apps/meteor/app/livechat/server/lib/Helper.ts index 75722e709b17..453869d4425a 100644 --- a/apps/meteor/app/livechat/server/lib/Helper.ts +++ b/apps/meteor/app/livechat/server/lib/Helper.ts @@ -1,5 +1,6 @@ +import { Apps, AppEvents } from '@rocket.chat/apps'; import { LivechatTransferEventType } from '@rocket.chat/apps-engine/definition/livechat'; -import { api, Message } from '@rocket.chat/core-services'; +import { api, Message, Omnichannel } from '@rocket.chat/core-services'; import type { ILivechatVisitor, IOmnichannelRoom, @@ -30,7 +31,6 @@ import { import { Match, check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; -import { Apps, AppEvents } from '../../../../ee/server/apps'; import { callbacks } from '../../../../lib/callbacks'; import { validateEmail as validatorFunc } from '../../../../lib/emailValidator'; import { i18n } from '../../../../server/lib/i18n'; @@ -38,7 +38,6 @@ import { hasRoleAsync } from '../../../authorization/server/functions/hasRole'; import { sendNotification } from '../../../lib/server'; import { sendMessage } from '../../../lib/server/functions/sendMessage'; import { settings } from '../../../settings/server'; -import { Livechat } from './Livechat'; import { Livechat as LivechatTyped } from './LivechatTyped'; import { queueInquiry, saveQueueInquiry } from './QueueManager'; import { RoutingManager } from './RoutingManager'; @@ -77,7 +76,11 @@ export const createLivechatRoom = async ( const { _id, username, token, department: departmentId, status = 'online' } = guest; const newRoomAt = new Date(); - logger.debug(`Creating livechat room for visitor ${_id}`); + const { activity } = guest; + logger.debug({ + msg: `Creating livechat room for visitor ${_id}`, + visitor: { _id, username, departmentId, status, activity }, + }); const room: InsertionModel = Object.assign( { @@ -94,6 +97,7 @@ export const createLivechatRoom = async ( username, token, status, + ...(activity?.length && { activity }), }, cl: false, open: true, @@ -114,7 +118,6 @@ export const createLivechatRoom = async ( const roomId = (await Rooms.insertOne(room)).insertedId; - void Apps.triggerEvent(AppEvents.IPostLivechatRoomStarted, room); await callbacks.run('livechat.newRoom', room); await sendMessage(guest, { t: 'livechat-started', msg: '', groupable: false }, room); @@ -132,7 +135,7 @@ export const createLivechatInquiry = async ({ }: { rid: string; name?: string; - guest?: Pick; + guest?: Pick; message?: Pick; initialStatus?: LivechatInquiryStatus; extraData?: Pick; @@ -146,6 +149,7 @@ export const createLivechatInquiry = async ({ username: String, status: Match.Maybe(String), department: Match.Maybe(String), + activity: Match.Maybe([String]), }), ); check( @@ -157,11 +161,14 @@ export const createLivechatInquiry = async ({ const extraInquiryInfo = await callbacks.run('livechat.beforeInquiry', extraData); - const { _id, username, token, department, status = UserStatus.ONLINE } = guest; + const { _id, username, token, department, status = UserStatus.ONLINE, activity } = guest; const { msg } = message; const ts = new Date(); - logger.debug(`Creating livechat inquiry for visitor ${_id}`); + logger.debug({ + msg: `Creating livechat inquiry for visitor ${_id}`, + visitor: { _id, username, department, status, activity }, + }); const inquiry: InsertionModel = { rid, @@ -175,6 +182,7 @@ export const createLivechatInquiry = async ({ username, token, status, + ...(activity?.length && { activity }), }, t: 'l', priorityWeight: LivechatPriorityWeight.NOT_SPECIFIED, @@ -247,10 +255,8 @@ export const createLivechatSubscription = async ( status, }, ts: new Date(), - lr: new Date(), - ls: new Date(), ...(department && { department }), - }; + } as InsertionModel; return Subscriptions.insertOne(subscriptionData); }; @@ -267,7 +273,7 @@ export const removeAgentFromSubscription = async (rid: string, { _id, username } await Message.saveSystemMessage('ul', rid, username || '', { _id: user._id, username: user.username, name: user.name }); setImmediate(() => { - void Apps.triggerEvent(AppEvents.IPostLivechatAgentUnassigned, { room, user }); + void Apps.self?.triggerEvent(AppEvents.IPostLivechatAgentUnassigned, { room, user }); }); }; @@ -286,7 +292,7 @@ export const parseAgentCustomFields = (customFields?: Record) => { const parseCustomFields = JSON.parse(accountCustomFields); return Object.keys(parseCustomFields).filter((customFieldKey) => parseCustomFields[customFieldKey].sendToIntegrations === true); } catch (error) { - Livechat.logger.error(error); + logger.error(error); return []; } }; @@ -365,7 +371,6 @@ export const dispatchInquiryQueued = async (inquiry: ILivechatInquiryRecord, age // fake a subscription in order to make use of the function defined above subscription: { rid, - t: 'l', u: { _id, }, @@ -379,13 +384,14 @@ export const dispatchInquiryQueued = async (inquiry: ILivechatInquiryRecord, age username, }, ], + name: '', }, sender: v, hasMentionToAll: true, // consider all agents to be in the room hasReplyToThread: false, disableAllMessageNotifications: false, hasMentionToHere: false, - message: Object.assign({}, { u: v }), + message: { _id: '', u: v, msg: '' }, // we should use server's language for this type of messages instead of user's notificationMessage: i18n.t('User_started_a_new_conversation', { username: notificationUserName }, language), room: Object.assign(room, { name: i18n.t('New_chat_in_queue', {}, language) }), @@ -402,6 +408,9 @@ export const forwardRoomToAgent = async (room: IOmnichannelRoom, transferData: T logger.debug(`Forwarding room ${room._id} to agent ${transferData.userId}`); const { userId: agentId, clientAction } = transferData; + if (!agentId) { + throw new Error('error-invalid-agent'); + } const user = await Users.findOneOnlineAgentById(agentId); if (!user) { logger.debug(`Agent ${agentId} is offline. Cannot forward`); @@ -434,7 +443,7 @@ export const forwardRoomToAgent = async (room: IOmnichannelRoom, transferData: T return false; } - await Livechat.saveTransferHistory(room, transferData); + await LivechatTyped.saveTransferHistory(room, transferData); const { servedBy } = roomTaken; if (servedBy) { @@ -443,7 +452,7 @@ export const forwardRoomToAgent = async (room: IOmnichannelRoom, transferData: T } setImmediate(() => { - void Apps.triggerEvent(AppEvents.IPostLivechatRoomTransferred, { + void Apps.self?.triggerEvent(AppEvents.IPostLivechatRoomTransferred, { type: LivechatTransferEventType.AGENT, room: rid, from: oldServedBy?._id, @@ -473,7 +482,7 @@ export const updateChatDepartment = async ({ ]); setImmediate(() => { - void Apps.triggerEvent(AppEvents.IPostLivechatRoomTransferred, { + void Apps.self?.triggerEvent(AppEvents.IPostLivechatRoomTransferred, { type: LivechatTransferEventType.DEPARTMENT, room: rid, from: oldDepartmentId, @@ -530,12 +539,24 @@ export const forwardRoomToDepartment = async (room: IOmnichannelRoom, guest: ILi agent = { agentId, username }; } - if (!RoutingManager.getConfig()?.autoAssignAgent) { - logger.debug( - `Routing algorithm doesn't support auto assignment (using ${RoutingManager.methodName}). Chat will be on department queue`, - ); - await Livechat.saveTransferHistory(room, transferData); - return RoutingManager.unassignAgent(inquiry, departmentId); + const department = await LivechatDepartment.findOneById< + Pick + >(departmentId, { + projection: { + allowReceiveForwardOffline: 1, + fallbackForwardDepartment: 1, + name: 1, + }, + }); + + if ( + !RoutingManager.getConfig()?.autoAssignAgent || + !(await Omnichannel.isWithinMACLimit(room)) || + (department?.allowReceiveForwardOffline && !(await LivechatTyped.checkOnlineAgents(departmentId))) + ) { + logger.debug(`Room ${room._id} will be on department queue`); + await LivechatTyped.saveTransferHistory(room, transferData); + return RoutingManager.unassignAgent(inquiry, departmentId, true); } // Fake the department to forward the inquiry - Case the forward process does not success @@ -552,33 +573,48 @@ export const forwardRoomToDepartment = async (room: IOmnichannelRoom, guest: ILi const { servedBy, chatQueued } = roomTaken; if (!chatQueued && oldServedBy && servedBy && oldServedBy._id === servedBy._id) { - const department = departmentId - ? await LivechatDepartment.findOneById>(departmentId, { - projection: { fallbackForwardDepartment: 1 }, - }) - : null; if (!department?.fallbackForwardDepartment?.length) { logger.debug(`Cannot forward room ${room._id}. Chat assigned to agent ${servedBy._id} (Previous was ${oldServedBy._id})`); throw new Error('error-no-agents-online-in-department'); } + + if (!transferData.originalDepartmentName) { + transferData.originalDepartmentName = department.name; + } // if a chat has a fallback department, attempt to redirect chat to there [EE] - const transferSuccess = !!(await callbacks.run('livechat:onTransferFailure', room, { guest, transferData })); + const transferSuccess = !!(await callbacks.run('livechat:onTransferFailure', room, { guest, transferData, department })); // On CE theres no callback so it will return the room if (typeof transferSuccess !== 'boolean' || !transferSuccess) { logger.debug(`Cannot forward room ${room._id}. Unable to delegate inquiry`); return false; } + + return true; + } + + // Send just 1 message to the room to inform the user that the chat was transferred + if (transferData.usingFallbackDep) { + const { _id, username } = transferData.transferredBy; + await Message.saveSystemMessage( + 'livechat_transfer_history_fallback', + room._id, + '', + { _id, username }, + { + transferData: { + ...transferData, + prevDepartment: transferData.originalDepartmentName, + }, + }, + ); } - await Livechat.saveTransferHistory(room, transferData); + await LivechatTyped.saveTransferHistory(room, transferData); if (oldServedBy) { // if chat is queued then we don't ignore the new servedBy agent bcs at this // point the chat is not assigned to him/her and it is still in the queue await RoutingManager.removeAllRoomSubscriptions(room, !chatQueued ? servedBy : undefined); } - if (!chatQueued && servedBy) { - await Message.saveSystemMessage('uj', rid, servedBy.username || '', servedBy); - } await updateChatDepartment({ rid, newDepartmentId: departmentId, oldDepartmentId }); @@ -597,10 +633,6 @@ export const forwardRoomToDepartment = async (room: IOmnichannelRoom, guest: ILi logger.debug(`Inquiry ${inquiry._id} queued succesfully`); } - const { token } = guest; - await LivechatTyped.setDepartmentForGuest({ token, department: departmentId }); - logger.debug(`Department for visitor with token ${token} was updated to ${departmentId}`); - return true; }; @@ -645,13 +677,24 @@ export const updateDepartmentAgents = async ( departmentEnabled: boolean, ) => { check(departmentId, String); - check( - agents, - Match.ObjectIncluding({ - upsert: Match.Maybe(Array), - remove: Match.Maybe(Array), - }), - ); + check(agents, { + upsert: Match.Maybe([ + Match.ObjectIncluding({ + agentId: String, + username: Match.Maybe(String), + count: Match.Maybe(Match.Integer), + order: Match.Maybe(Match.Integer), + }), + ]), + remove: Match.Maybe([ + Match.ObjectIncluding({ + agentId: String, + username: Match.Maybe(String), + count: Match.Maybe(Match.Integer), + order: Match.Maybe(Match.Integer), + }), + ]), + }); const { upsert = [], remove = [] } = agents; const agentsRemoved = []; diff --git a/apps/meteor/app/livechat/server/lib/Livechat.js b/apps/meteor/app/livechat/server/lib/Livechat.js deleted file mode 100644 index e1d6626c7ddb..000000000000 --- a/apps/meteor/app/livechat/server/lib/Livechat.js +++ /dev/null @@ -1,845 +0,0 @@ -// Note: Please don't add any new methods to this file, since its still in js and we are migrating to ts -// Please add new methods to LivechatTyped.ts - -import dns from 'dns'; -import util from 'util'; - -import { Message } from '@rocket.chat/core-services'; -import { Logger } from '@rocket.chat/logger'; -import { - LivechatVisitors, - LivechatCustomField, - Settings, - LivechatRooms, - LivechatInquiry, - Subscriptions, - Messages, - LivechatDepartment as LivechatDepartmentRaw, - LivechatDepartmentAgents, - Rooms, - Users, - ReadReceipts, -} from '@rocket.chat/models'; -import { Match, check } from 'meteor/check'; -import { Meteor } from 'meteor/meteor'; -import UAParser from 'ua-parser-js'; - -import { Apps, AppEvents } from '../../../../ee/server/apps'; -import { callbacks } from '../../../../lib/callbacks'; -import { trim } from '../../../../lib/utils/stringUtils'; -import { i18n } from '../../../../server/lib/i18n'; -import { addUserRolesAsync } from '../../../../server/lib/roles/addUserRoles'; -import { removeUserFromRolesAsync } from '../../../../server/lib/roles/removeUserFromRoles'; -import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; -import { FileUpload } from '../../../file-upload/server'; -import { deleteMessage } from '../../../lib/server/functions/deleteMessage'; -import { sendMessage } from '../../../lib/server/functions/sendMessage'; -import { updateMessage } from '../../../lib/server/functions/updateMessage'; -import * as Mailer from '../../../mailer/server/api'; -import { settings } from '../../../settings/server'; -import { businessHourManager } from '../business-hour'; -import { Analytics } from './Analytics'; -import { normalizeTransferredByData, parseAgentCustomFields, updateDepartmentAgents } from './Helper'; -import { Livechat as LivechatTyped } from './LivechatTyped'; -import { RoutingManager } from './RoutingManager'; - -const logger = new Logger('Livechat'); - -const dnsResolveMx = util.promisify(dns.resolveMx); - -export const Livechat = { - Analytics, - - logger, - - async sendMessage({ guest, message, roomInfo, agent }) { - const { room, newRoom } = await LivechatTyped.getRoom(guest, message, roomInfo, agent); - if (guest.name) { - message.alias = guest.name; - } - return Object.assign(await sendMessage(guest, message, room), { - newRoom, - showConnecting: this.showConnecting(), - }); - }, - - async updateMessage({ guest, message }) { - check(message, Match.ObjectIncluding({ _id: String })); - - const originalMessage = await Messages.findOneById(message._id); - if (!originalMessage || !originalMessage._id) { - return; - } - - const editAllowed = settings.get('Message_AllowEditing'); - const editOwn = originalMessage.u && originalMessage.u._id === guest._id; - - if (!editAllowed || !editOwn) { - throw new Meteor.Error('error-action-not-allowed', 'Message editing not allowed', { - method: 'livechatUpdateMessage', - }); - } - - await updateMessage(message, guest); - - return true; - }, - - async deleteMessage({ guest, message }) { - Livechat.logger.debug(`Attempting to delete a message by visitor ${guest._id}`); - check(message, Match.ObjectIncluding({ _id: String })); - - const msg = await Messages.findOneById(message._id); - if (!msg || !msg._id) { - return; - } - - const deleteAllowed = settings.get('Message_AllowDeleting'); - const editOwn = msg.u && msg.u._id === guest._id; - - if (!deleteAllowed || !editOwn) { - Livechat.logger.debug('Cannot delete message: not allowed'); - throw new Meteor.Error('error-action-not-allowed', 'Message deleting not allowed', { - method: 'livechatDeleteMessage', - }); - } - - await deleteMessage(message, guest); - - return true; - }, - - async saveGuest(guestData, userId) { - const { _id, name, email, phone, livechatData = {} } = guestData; - Livechat.logger.debug(`Saving data for visitor ${_id}`); - const updateData = {}; - - if (name) { - updateData.name = name; - } - if (email) { - updateData.email = email; - } - if (phone) { - updateData.phone = phone; - } - - const customFields = {}; - - if ((!userId || (await hasPermissionAsync(userId, 'edit-livechat-room-customfields'))) && Object.keys(livechatData).length) { - Livechat.logger.debug(`Saving custom fields for visitor ${_id}`); - const fields = LivechatCustomField.findByScope('visitor'); - for await (const field of fields) { - if (!livechatData.hasOwnProperty(field._id)) { - continue; - } - const value = trim(livechatData[field._id]); - if (value !== '' && field.regexp !== undefined && field.regexp !== '') { - const regexp = new RegExp(field.regexp); - if (!regexp.test(value)) { - throw new Meteor.Error(i18n.t('error-invalid-custom-field-value', { field: field.label })); - } - } - customFields[field._id] = value; - } - updateData.livechatData = customFields; - Livechat.logger.debug(`About to update ${Object.keys(customFields).length} custom fields for visitor ${_id}`); - } - const ret = await LivechatVisitors.saveGuestById(_id, updateData); - - setImmediate(() => { - Apps.triggerEvent(AppEvents.IPostLivechatGuestSaved, _id); - callbacks.run('livechat.saveGuest', updateData); - }); - - return ret; - }, - - async setCustomFields({ token, key, value, overwrite } = {}) { - check(token, String); - check(key, String); - check(value, String); - check(overwrite, Boolean); - Livechat.logger.debug(`Setting custom fields data for visitor with token ${token}`); - - const customField = await LivechatCustomField.findOneById(key); - if (!customField) { - throw new Meteor.Error('invalid-custom-field'); - } - - if (customField.regexp !== undefined && customField.regexp !== '') { - const regexp = new RegExp(customField.regexp); - if (!regexp.test(value)) { - throw new Meteor.Error(i18n.t('error-invalid-custom-field-value', { field: key })); - } - } - - let result; - if (customField.scope === 'room') { - result = await LivechatRooms.updateDataByToken(token, key, value, overwrite); - } else { - result = await LivechatVisitors.updateLivechatDataByToken(token, key, value, overwrite); - } - - if (result) { - return result.modifiedCount; - } - - return 0; - }, - - async getInitSettings() { - const rcSettings = {}; - - await Settings.findNotHiddenPublic([ - 'Livechat_title', - 'Livechat_title_color', - 'Livechat_enable_message_character_limit', - 'Livechat_message_character_limit', - 'Message_MaxAllowedSize', - 'Livechat_enabled', - 'Livechat_registration_form', - 'Livechat_allow_switching_departments', - 'Livechat_offline_title', - 'Livechat_offline_title_color', - 'Livechat_offline_message', - 'Livechat_offline_success_message', - 'Livechat_offline_form_unavailable', - 'Livechat_display_offline_form', - 'Omnichannel_call_provider', - 'Language', - 'Livechat_enable_transcript', - 'Livechat_transcript_message', - 'Livechat_fileupload_enabled', - 'FileUpload_Enabled', - 'Livechat_conversation_finished_message', - 'Livechat_conversation_finished_text', - 'Livechat_name_field_registration_form', - 'Livechat_email_field_registration_form', - 'Livechat_registration_form_message', - 'Livechat_force_accept_data_processing_consent', - 'Livechat_data_processing_consent_text', - 'Livechat_show_agent_info', - 'Livechat_clear_local_storage_when_chat_ended', - ]).forEach((setting) => { - rcSettings[setting._id] = setting.value; - }); - - rcSettings.Livechat_history_monitor_type = settings.get('Livechat_history_monitor_type'); - - rcSettings.Livechat_Show_Connecting = this.showConnecting(); - - return rcSettings; - }, - - async saveRoomInfo(roomData, guestData, userId) { - Livechat.logger.debug(`Saving room information on room ${roomData._id}`); - const { livechatData = {} } = roomData; - const customFields = {}; - - if ((!userId || (await hasPermissionAsync(userId, 'edit-livechat-room-customfields'))) && Object.keys(livechatData).length) { - Livechat.logger.debug(`Updating custom fields on room ${roomData._id}`); - const fields = LivechatCustomField.findByScope('room'); - for await (const field of fields) { - if (!livechatData.hasOwnProperty(field._id)) { - continue; - } - const value = trim(livechatData[field._id]); - if (value !== '' && field.regexp !== undefined && field.regexp !== '') { - const regexp = new RegExp(field.regexp); - if (!regexp.test(value)) { - throw new Meteor.Error(i18n.t('error-invalid-custom-field-value', { field: field.label })); - } - } - customFields[field._id] = value; - } - roomData.livechatData = customFields; - Livechat.logger.debug(`About to update ${Object.keys(customFields).length} custom fields on room ${roomData._id}`); - } - - if (!(await LivechatRooms.saveRoomById(roomData))) { - Livechat.logger.debug(`Failed to save room information on room ${roomData._id}`); - return false; - } - - setImmediate(() => { - Apps.triggerEvent(AppEvents.IPostLivechatRoomSaved, roomData._id); - }); - callbacks.runAsync('livechat.saveRoom', roomData); - - if (guestData?.name?.trim().length) { - const { _id: rid } = roomData; - const { name } = guestData; - return ( - (await Rooms.setFnameById(rid, name)) && - (await LivechatInquiry.setNameByRoomId(rid, name)) && - // This one needs to be the last since the agent may not have the subscription - // when the conversation is in the queue, then the result will be 0(zero) - Subscriptions.updateDisplayNameByRoomId(rid, name) - ); - } - }, - - async closeOpenChats(userId, comment) { - Livechat.logger.debug(`Closing open chats for user ${userId}`); - const user = await Users.findOneById(userId); - - const extraQuery = await callbacks.run('livechat.applyDepartmentRestrictions', {}, { userId }); - const openChats = LivechatRooms.findOpenByAgent(userId, extraQuery); - const promises = []; - await openChats.forEach((room) => { - promises.push(LivechatTyped.closeRoom({ user, room, comment })); - }); - - await Promise.all(promises); - }, - - async forwardOpenChats(userId) { - Livechat.logger.debug(`Transferring open chats for user ${userId}`); - for await (const room of LivechatRooms.findOpenByAgent(userId)) { - const guest = await LivechatVisitors.findOneEnabledById(room.v._id); - const user = await Users.findOneById(userId); - const { _id, username, name } = user; - const transferredBy = normalizeTransferredByData({ _id, username, name }, room); - await this.transfer(room, guest, { - roomId: room._id, - transferredBy, - departmentId: guest.department, - }); - } - }, - - async savePageHistory(token, roomId, pageInfo) { - Livechat.logger.debug(`Saving page movement history for visitor with token ${token}`); - if (pageInfo.change !== settings.get('Livechat_history_monitor_type')) { - return; - } - const user = await Users.findOneById('rocket.cat'); - - const pageTitle = pageInfo.title; - const pageUrl = pageInfo.location.href; - const extraData = { - navigation: { - page: pageInfo, - token, - }, - }; - - if (!roomId) { - // keep history of unregistered visitors for 1 month - const keepHistoryMiliseconds = 2592000000; - extraData.expireAt = new Date().getTime() + keepHistoryMiliseconds; - } - - if (!settings.get('Livechat_Visitor_navigation_as_a_message')) { - extraData._hidden = true; - } - - return Message.saveSystemMessage('livechat_navigation_history', roomId, `${pageTitle} - ${pageUrl}`, user, extraData); - }, - - async saveTransferHistory(room, transferData) { - Livechat.logger.debug(`Saving transfer history for room ${room._id}`); - const { departmentId: previousDepartment } = room; - const { department: nextDepartment, transferredBy, transferredTo, scope, comment } = transferData; - - check( - transferredBy, - Match.ObjectIncluding({ - _id: String, - username: String, - name: Match.Maybe(String), - type: String, - }), - ); - - const { _id, username } = transferredBy; - const scopeData = scope || (nextDepartment ? 'department' : 'agent'); - Livechat.logger.debug(`Storing new chat transfer of ${room._id} [Transfered by: ${_id} to ${scopeData}]`); - - const transfer = { - transferData: { - transferredBy, - ts: new Date(), - scope: scopeData, - comment, - ...(previousDepartment && { previousDepartment }), - ...(nextDepartment && { nextDepartment }), - ...(transferredTo && { transferredTo }), - }, - }; - - const type = 'livechat_transfer_history'; - const transferMessage = { - t: type, - rid: room._id, - ts: new Date(), - msg: '', - u: { - _id, - username, - }, - groupable: false, - }; - - Object.assign(transferMessage, transfer); - - await sendMessage(transferredBy, transferMessage, room); - }, - - async transfer(room, guest, transferData) { - Livechat.logger.debug(`Transfering room ${room._id} [Transfered by: ${transferData?.transferredBy?._id}]`); - if (room.onHold) { - Livechat.logger.debug('Cannot transfer. Room is on hold'); - throw new Error('error-room-onHold'); - } - - if (transferData.departmentId) { - transferData.department = await LivechatDepartmentRaw.findOneById(transferData.departmentId, { - projection: { name: 1 }, - }); - Livechat.logger.debug(`Transfering room ${room._id} to department ${transferData.department?._id}`); - } - - return RoutingManager.transferRoom(room, guest, transferData); - }, - - async returnRoomAsInquiry(rid, departmentId, overrideTransferData = {}) { - Livechat.logger.debug(`Transfering room ${rid} to ${departmentId ? 'department' : ''} queue`); - const room = await LivechatRooms.findOneById(rid); - if (!room) { - throw new Meteor.Error('error-invalid-room', 'Invalid room', { - method: 'livechat:returnRoomAsInquiry', - }); - } - - if (!room.open) { - throw new Meteor.Error('room-closed', 'Room closed', { - method: 'livechat:returnRoomAsInquiry', - }); - } - - if (room.onHold) { - throw new Meteor.Error('error-room-onHold', 'Room On Hold', { - method: 'livechat:returnRoomAsInquiry', - }); - } - - if (!room.servedBy) { - return false; - } - - const user = await Users.findOneById(room.servedBy._id); - if (!user || !user._id) { - throw new Meteor.Error('error-invalid-user', 'Invalid user', { - method: 'livechat:returnRoomAsInquiry', - }); - } - - // find inquiry corresponding to room - const inquiry = await LivechatInquiry.findOne({ rid }); - if (!inquiry) { - return false; - } - - const transferredBy = normalizeTransferredByData(user, room); - Livechat.logger.debug(`Transfering room ${room._id} by user ${transferredBy._id}`); - const transferData = { roomId: rid, scope: 'queue', departmentId, transferredBy, ...overrideTransferData }; - try { - await this.saveTransferHistory(room, transferData); - await RoutingManager.unassignAgent(inquiry, departmentId); - } catch (e) { - this.logger.error(e); - throw new Meteor.Error('error-returning-inquiry', 'Error returning inquiry to the queue', { - method: 'livechat:returnRoomAsInquiry', - }); - } - - callbacks.runAsync('livechat:afterReturnRoomAsInquiry', { room }); - - return true; - }, - - async getLivechatRoomGuestInfo(room) { - const visitor = await LivechatVisitors.findOneEnabledById(room.v._id); - const agent = await Users.findOneById(room.servedBy && room.servedBy._id); - - const ua = new UAParser(); - ua.setUA(visitor.userAgent); - - const postData = { - _id: room._id, - label: room.fname || room.label, // using same field for compatibility - topic: room.topic, - createdAt: room.ts, - lastMessageAt: room.lm, - tags: room.tags, - customFields: room.livechatData, - visitor: { - _id: visitor._id, - token: visitor.token, - name: visitor.name, - username: visitor.username, - email: null, - phone: null, - department: visitor.department, - ip: visitor.ip, - os: ua.getOS().name && `${ua.getOS().name} ${ua.getOS().version}`, - browser: ua.getBrowser().name && `${ua.getBrowser().name} ${ua.getBrowser().version}`, - customFields: visitor.livechatData, - }, - }; - - if (agent) { - const customFields = parseAgentCustomFields(agent.customFields); - - postData.agent = { - _id: agent._id, - username: agent.username, - name: agent.name, - email: null, - ...(customFields && { customFields }), - }; - - if (agent.emails && agent.emails.length > 0) { - postData.agent.email = agent.emails[0].address; - } - } - - if (room.crmData) { - postData.crmData = room.crmData; - } - - if (visitor.visitorEmails && visitor.visitorEmails.length > 0) { - postData.visitor.email = visitor.visitorEmails; - } - if (visitor.phone && visitor.phone.length > 0) { - postData.visitor.phone = visitor.phone; - } - - return postData; - }, - - async afterAgentAdded(user) { - await Users.setOperator(user._id, true); - await this.setUserStatusLivechat(user._id, user.status !== 'offline' ? 'available' : 'not-available'); - - callbacks.runAsync('livechat.onNewAgentCreated', user._id); - - return user; - }, - - async addAgent(username) { - check(username, String); - - const user = await Users.findOneByUsername(username, { projection: { _id: 1, username: 1 } }); - - if (!user) { - throw new Meteor.Error('error-invalid-user', 'Invalid user', { method: 'livechat:addAgent' }); - } - - if (await addUserRolesAsync(user._id, ['livechat-agent'])) { - return this.afterAgentAdded(user); - } - - return false; - }, - - async addManager(username) { - check(username, String); - - const user = await Users.findOneByUsername(username, { projection: { _id: 1, username: 1 } }); - - if (!user) { - throw new Meteor.Error('error-invalid-user', 'Invalid user', { - method: 'livechat:addManager', - }); - } - - if (await addUserRolesAsync(user._id, ['livechat-manager'])) { - return user; - } - - return false; - }, - - async afterRemoveAgent(user) { - await callbacks.run('livechat.afterAgentRemoved', { agent: user }); - return true; - }, - - async removeAgent(username) { - check(username, String); - - const user = await Users.findOneByUsername(username, { projection: { _id: 1, username: 1 } }); - - if (!user) { - throw new Meteor.Error('error-invalid-user', 'Invalid user', { - method: 'livechat:removeAgent', - }); - } - - const { _id } = user; - - if (await removeUserFromRolesAsync(_id, ['livechat-agent'])) { - return this.afterRemoveAgent(user); - } - - return false; - }, - - async removeManager(username) { - check(username, String); - - const user = await Users.findOneByUsername(username, { projection: { _id: 1 } }); - - if (!user) { - throw new Meteor.Error('error-invalid-user', 'Invalid user', { - method: 'livechat:removeManager', - }); - } - - return removeUserFromRolesAsync(user._id, ['livechat-manager']); - }, - - async removeGuest(_id) { - const guest = await LivechatVisitors.findOneEnabledById(_id, { projection: { _id: 1, token: 1 } }); - if (!guest) { - throw new Meteor.Error('error-invalid-guest', 'Invalid guest', { - method: 'livechat:removeGuest', - }); - } - - await this.cleanGuestHistory(guest); - return LivechatVisitors.disableById(_id); - }, - - async setUserStatusLivechat(userId, status) { - const user = await Users.setLivechatStatus(userId, status); - callbacks.runAsync('livechat.setUserStatusLivechat', { userId, status }); - return user; - }, - - async setUserStatusLivechatIf(userId, status, condition, fields) { - const user = await Users.setLivechatStatusIf(userId, status, condition, fields); - callbacks.runAsync('livechat.setUserStatusLivechat', { userId, status }); - return user; - }, - - async cleanGuestHistory(guest) { - const { token } = guest; - - // This shouldn't be possible, but just in case - if (!token) { - throw new Error('error-invalid-guest'); - } - - const extraQuery = await callbacks.run('livechat.applyRoomRestrictions', {}); - const cursor = LivechatRooms.findByVisitorToken(token, extraQuery); - for await (const room of cursor) { - await Promise.all([ - FileUpload.removeFilesByRoomId(room._id), - Messages.removeByRoomId(room._id), - ReadReceipts.removeByRoomId(room._id), - ]); - } - - await Promise.all([ - Subscriptions.removeByVisitorToken(token), - LivechatRooms.removeByVisitorToken(token), - LivechatInquiry.removeByVisitorToken(token), - ]); - }, - - async saveDepartmentAgents(_id, departmentAgents) { - check(_id, String); - check(departmentAgents, { - upsert: Match.Maybe([ - Match.ObjectIncluding({ - agentId: String, - username: String, - count: Match.Maybe(Match.Integer), - order: Match.Maybe(Match.Integer), - }), - ]), - remove: Match.Maybe([ - Match.ObjectIncluding({ - agentId: String, - username: Match.Maybe(String), - count: Match.Maybe(Match.Integer), - order: Match.Maybe(Match.Integer), - }), - ]), - }); - - const department = await LivechatDepartmentRaw.findOneById(_id); - if (!department) { - throw new Meteor.Error('error-department-not-found', 'Department not found', { - method: 'livechat:saveDepartmentAgents', - }); - } - - return updateDepartmentAgents(_id, departmentAgents, department.enabled); - }, - - /* - * @deprecated - Use the equivalent from DepartmentHelpers class - */ - async removeDepartment(_id) { - check(_id, String); - - const departmentRemovalEnabled = settings.get('Omnichannel_enable_department_removal'); - - if (!departmentRemovalEnabled) { - throw new Meteor.Error('department-removal-disabled', 'Department removal is disabled', { - method: 'livechat:removeDepartment', - }); - } - - const department = await LivechatDepartmentRaw.findOneById(_id, { projection: { _id: 1 } }); - - if (!department) { - throw new Meteor.Error('department-not-found', 'Department not found', { - method: 'livechat:removeDepartment', - }); - } - const ret = (await LivechatDepartmentRaw.removeById(_id)).deletedCount; - const agentsIds = (await LivechatDepartmentAgents.findByDepartmentId(_id, { projection: { agentId: 1 } }).toArray()).map( - (agent) => agent.agentId, - ); - await LivechatDepartmentAgents.removeByDepartmentId(_id); - await LivechatDepartmentRaw.unsetFallbackDepartmentByDepartmentId(_id); - if (ret) { - setImmediate(() => { - callbacks.run('livechat.afterRemoveDepartment', { department, agentsIds }); - }); - } - return ret; - }, - - showConnecting() { - const { showConnecting } = RoutingManager.getConfig(); - return showConnecting; - }, - - async sendEmail(from, to, replyTo, subject, html) { - return Mailer.send({ - to, - from, - replyTo, - subject, - html, - }); - }, - - async requestTranscript({ rid, email, subject, user }) { - check(rid, String); - check(email, String); - check(subject, String); - check( - user, - Match.ObjectIncluding({ - _id: String, - username: String, - utcOffset: Number, - name: Match.Maybe(String), - }), - ); - - const room = await LivechatRooms.findOneById(rid, { projection: { _id: 1, open: 1, transcriptRequest: 1 } }); - - if (!room || !room.open) { - throw new Meteor.Error('error-invalid-room', 'Invalid room'); - } - - if (room.transcriptRequest) { - throw new Meteor.Error('error-transcript-already-requested', 'Transcript already requested'); - } - - const { _id, username, name, utcOffset } = user; - const transcriptRequest = { - requestedAt: new Date(), - requestedBy: { - _id, - username, - name, - utcOffset, - }, - email, - subject, - }; - - await LivechatRooms.setEmailTranscriptRequestedByRoomId(rid, transcriptRequest); - return true; - }, - - async notifyGuestStatusChanged(token, status) { - await LivechatInquiry.updateVisitorStatus(token, status); - await LivechatRooms.updateVisitorStatus(token, status); - }, - - async sendOfflineMessage(data = {}) { - if (!settings.get('Livechat_display_offline_form')) { - throw new Error('error-offline-form-disabled'); - } - - const { message, name, email, department, host } = data; - const emailMessage = `${message}`.replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1
$2'); - - let html = '

New livechat message

'; - if (host && host !== '') { - html = html.concat(`

Sent from: ${host}

`); - } - html = html.concat(` -

Visitor name: ${name}

-

Visitor email: ${email}

-

Message:
${emailMessage}

`); - - let fromEmail = settings.get('From_Email').match(/\b[A-Z0-9._%+-]+@(?:[A-Z0-9-]+\.)+[A-Z]{2,4}\b/i); - - if (fromEmail) { - fromEmail = fromEmail[0]; - } else { - fromEmail = settings.get('From_Email'); - } - - if (settings.get('Livechat_validate_offline_email')) { - const emailDomain = email.substr(email.lastIndexOf('@') + 1); - - try { - await dnsResolveMx(emailDomain); - } catch (e) { - throw new Meteor.Error('error-invalid-email-address', 'Invalid email address', { - method: 'livechat:sendOfflineMessage', - }); - } - } - - // TODO Block offline form if Livechat_offline_email is undefined - // (it does not make sense to have an offline form that does nothing) - // `this.sendEmail` will throw an error if the email is invalid - // thus this breaks livechat, since the "to" email is invalid, and that returns an [invalid email] error to the livechat client - let emailTo = settings.get('Livechat_offline_email'); - if (department && department !== '') { - const dep = await LivechatDepartmentRaw.findOneByIdOrName(department); - emailTo = dep.email || emailTo; - } - - const from = `${name} - ${email} <${fromEmail}>`; - const replyTo = `${name} <${email}>`; - const subject = `Livechat offline message from ${name}: ${`${emailMessage}`.substring(0, 20)}`; - await this.sendEmail(from, emailTo, replyTo, subject, html); - - setImmediate(() => { - callbacks.run('livechat.offlineMessage', data); - }); - }, - - async allowAgentChangeServiceStatus(statusLivechat, agentId) { - if (statusLivechat !== 'available') { - return true; - } - - return businessHourManager.allowAgentChangeServiceStatus(agentId); - }, -}; diff --git a/apps/meteor/app/livechat/server/lib/LivechatTyped.ts b/apps/meteor/app/livechat/server/lib/LivechatTyped.ts index afb649488300..dc5aa506f405 100644 --- a/apps/meteor/app/livechat/server/lib/LivechatTyped.ts +++ b/apps/meteor/app/livechat/server/lib/LivechatTyped.ts @@ -1,4 +1,8 @@ -import { Message, VideoConf, api } from '@rocket.chat/core-services'; +import dns from 'dns'; +import * as util from 'util'; + +import { Apps, AppEvents } from '@rocket.chat/apps'; +import { Message, VideoConf, api, Omnichannel } from '@rocket.chat/core-services'; import type { IOmnichannelRoom, IOmnichannelRoomClosingInfo, @@ -10,8 +14,14 @@ import type { ILivechatAgent, IMessage, ILivechatDepartment, + AtLeast, + TransferData, + MessageAttachment, + IMessageInbox, + IOmnichannelAgent, + ILivechatDepartmentAgents, } from '@rocket.chat/core-typings'; -import { UserStatus, isOmnichannelRoom } from '@rocket.chat/core-typings'; +import { ILivechatAgentStatus, UserStatus, isOmnichannelRoom } from '@rocket.chat/core-typings'; import { Logger, type MainLogger } from '@rocket.chat/logger'; import { LivechatDepartment, @@ -24,24 +34,33 @@ import { LivechatDepartmentAgents, ReadReceipts, Rooms, + LivechatCustomField, } from '@rocket.chat/models'; import { Random } from '@rocket.chat/random'; import { serverFetch as fetch } from '@rocket.chat/server-fetch'; +import { Match, check } from 'meteor/check'; import moment from 'moment-timezone'; -import type { FindCursor, UpdateFilter } from 'mongodb'; +import type { Filter, FindCursor, UpdateFilter } from 'mongodb'; +import UAParser from 'ua-parser-js'; -import { Apps, AppEvents } from '../../../../ee/server/apps'; import { callbacks } from '../../../../lib/callbacks'; +import { trim } from '../../../../lib/utils/stringUtils'; import { i18n } from '../../../../server/lib/i18n'; +import { addUserRolesAsync } from '../../../../server/lib/roles/addUserRoles'; +import { removeUserFromRolesAsync } from '../../../../server/lib/roles/removeUserFromRoles'; import { canAccessRoomAsync } from '../../../authorization/server'; +import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { hasRoleAsync } from '../../../authorization/server/functions/hasRole'; +import { FileUpload } from '../../../file-upload/server'; +import { deleteMessage } from '../../../lib/server/functions/deleteMessage'; import { sendMessage } from '../../../lib/server/functions/sendMessage'; import { updateMessage } from '../../../lib/server/functions/updateMessage'; import * as Mailer from '../../../mailer/server/api'; import { metrics } from '../../../metrics/server'; import { settings } from '../../../settings/server'; import { getTimezone } from '../../../utils/server/lib/getTimezone'; -import { updateDepartmentAgents, validateEmail } from './Helper'; +import { businessHourManager } from '../business-hour'; +import { parseAgentCustomFields, updateDepartmentAgents, validateEmail, normalizeTransferredByData } from './Helper'; import { QueueManager } from './QueueManager'; import { RoutingManager } from './RoutingManager'; @@ -75,6 +94,66 @@ export type CloseRoomParamsByVisitor = { export type CloseRoomParams = CloseRoomParamsByUser | CloseRoomParamsByVisitor; +type OfflineMessageData = { + message: string; + name: string; + email: string; + department?: string; + host?: string; +}; + +type UploadedFile = { + _id: string; + name?: string; + type?: string; + size?: number; + description?: string; + identify?: { size: { width: number; height: number } }; + format?: string; +}; + +export interface ILivechatMessage { + token: string; + _id: string; + rid: string; + msg: string; + file?: UploadedFile; + files?: UploadedFile[]; + attachments?: MessageAttachment[]; + alias?: string; + groupable?: boolean; + blocks?: IMessage['blocks']; + email?: IMessageInbox['email']; +} + +type AKeyOf = { + [K in keyof T]?: T[K]; +}; + +type PageInfo = { title: string; location: { href: string }; change: string }; + +type ICRMData = { + _id: string; + label?: string; + topic?: string; + createdAt: Date; + lastMessageAt?: Date; + tags?: string[]; + customFields?: IOmnichannelRoom['livechatData']; + visitor: Pick & { + email?: ILivechatVisitor['visitorEmails']; + os?: string; + browser?: string; + customFields: ILivechatVisitor['livechatData']; + }; + agent?: Pick & { + email?: NonNullable[number]['address']; + }; + crmData?: IOmnichannelRoom['crmData']; +}; + +const dnsResolveMx = util.promisify(dns.resolveMx); + class LivechatClass { logger: Logger; @@ -210,11 +289,17 @@ class LivechatClass { this.logger.debug(`Updating DB for room ${room._id} with close data`); - await Promise.all([ - LivechatRooms.closeRoomById(rid, closeData), - LivechatInquiry.removeByRoomId(rid), - Subscriptions.removeByRoomId(rid), - ]); + const removedInquiry = await LivechatInquiry.removeByRoomId(rid); + if (removedInquiry && removedInquiry.deletedCount !== 1) { + throw new Error('Error removing inquiry'); + } + + const updatedRoom = await LivechatRooms.closeRoomById(rid, closeData); + if (!updatedRoom || updatedRoom.modifiedCount !== 1) { + throw new Error('Error closing room'); + } + + await Subscriptions.removeByRoomId(rid); this.logger.debug(`DB updated for room ${room._id}`); @@ -244,8 +329,8 @@ class LivechatClass { * @deprecated the `AppEvents.ILivechatRoomClosedHandler` event will be removed * in the next major version of the Apps-Engine */ - void Apps.getBridges()?.getListenerBridge().livechatEvent(AppEvents.ILivechatRoomClosedHandler, newRoom); - void Apps.getBridges()?.getListenerBridge().livechatEvent(AppEvents.IPostLivechatRoomClosed, newRoom); + void Apps.self?.getBridges()?.getListenerBridge().livechatEvent(AppEvents.ILivechatRoomClosedHandler, newRoom); + void Apps.self?.getBridges()?.getListenerBridge().livechatEvent(AppEvents.IPostLivechatRoomClosed, newRoom); }); if (process.env.TEST_MODE) { await callbacks.run('livechat.closeRoom', { @@ -282,7 +367,7 @@ class LivechatClass { async getRoom( guest: ILivechatVisitor, - message: Pick, + message: Pick, roomInfo: { source?: IOmnichannelRoom['source']; [key: string]: unknown; @@ -389,7 +474,7 @@ class LivechatClass { }, }; - const dep = await LivechatDepartment.findOneById(department); + const dep = await LivechatDepartment.findOneById>(department, { projection: { _id: 1 } }); if (!dep) { throw new Meteor.Error('invalid-department', 'Provided department does not exists'); } @@ -466,7 +551,7 @@ class LivechatClass { throw new Error('error-invalid-room'); } - const showAgentInfo = settings.get('Livechat_show_agent_info'); + const showAgentInfo = settings.get('Livechat_show_agent_info'); const closingMessage = await Messages.findLivechatClosingMessage(rid, { projection: { ts: 1 } }); const ignoredMessageTypes: MessageTypesValues[] = [ 'livechat_navigation_history', @@ -741,12 +826,15 @@ class LivechatClass { attempts = 10, ) { if (!attempts) { + Livechat.logger.error({ msg: 'Omnichannel webhook call failed. Max attempts reached' }); return; } const timeout = settings.get('Livechat_http_timeout'); const secretToken = settings.get('Livechat_secret_token'); + const webhookUrl = settings.get('Livechat_webhookUrl'); try { - const result = await fetch(settings.get('Livechat_webhookUrl'), { + Livechat.webhookLogger.debug({ msg: 'Sending webhook request', postData }); + const result = await fetch(webhookUrl, { method: 'POST', headers: { ...(secretToken && { 'X-RocketChat-Livechat-Token': secretToken }), @@ -757,17 +845,20 @@ class LivechatClass { if (result.status === 200) { metrics.totalLivechatWebhooksSuccess.inc(); - } else { - metrics.totalLivechatWebhooksFailures.inc(); + return result; } - return result; + + metrics.totalLivechatWebhooksFailures.inc(); + throw new Error(await result.text()); } catch (err) { - Livechat.webhookLogger.error({ msg: `Response error on ${11 - attempts} try ->`, err }); + const retryAfter = timeout * 4; + Livechat.webhookLogger.error({ msg: `Error response on ${11 - attempts} try ->`, err }); // try 10 times after 20 seconds each - attempts - 1 && Livechat.webhookLogger.warn(`Will try again in ${(timeout / 1000) * 4} seconds ...`); + attempts - 1 && + Livechat.webhookLogger.warn({ msg: `Webhook call failed. Retrying`, newAttemptAfterSeconds: retryAfter / 1000, webhookUrl }); setTimeout(async () => { await Livechat.sendRequest(postData, attempts - 1); - }, timeout * 4); + }, retryAfter); } } @@ -895,7 +986,9 @@ class LivechatClass { } async archiveDepartment(_id: string) { - const department = await LivechatDepartment.findOneById(_id, { projection: { _id: 1 } }); + const department = await LivechatDepartment.findOneById>(_id, { + projection: { _id: 1, businessHourId: 1 }, + }); if (!department) { throw new Error('department-not-found'); @@ -917,6 +1010,803 @@ class LivechatClass { await Promise.all([LivechatDepartmentAgents.enableAgentsByDepartmentId(_id), LivechatDepartment.unarchiveDepartment(_id)]); return true; } + + async updateMessage({ guest, message }: { guest: ILivechatVisitor; message: AtLeast }) { + check(message, Match.ObjectIncluding({ _id: String })); + + const originalMessage = await Messages.findOneById>(message._id, { projection: { u: 1 } }); + if (!originalMessage?._id) { + return; + } + + const editAllowed = settings.get('Message_AllowEditing'); + const editOwn = originalMessage.u && originalMessage.u._id === guest._id; + + if (!editAllowed || !editOwn) { + throw new Error('error-action-not-allowed'); + } + + // TODO: Apps sends an `any` object and apparently we just check for _id being present + // while updateMessage expects AtLeast + await updateMessage(message, guest as unknown as IUser); + + return true; + } + + async closeOpenChats(userId: string, comment?: string) { + this.logger.debug(`Closing open chats for user ${userId}`); + const user = await Users.findOneById(userId); + + const extraQuery = await callbacks.run('livechat.applyDepartmentRestrictions', {}, { userId }); + const openChats = LivechatRooms.findOpenByAgent(userId, extraQuery); + const promises: Promise[] = []; + await openChats.forEach((room) => { + promises.push(this.closeRoom({ user, room, comment })); + }); + + await Promise.all(promises); + } + + async transfer(room: IOmnichannelRoom, guest: ILivechatVisitor, transferData: TransferData) { + this.logger.debug(`Transfering room ${room._id} [Transfered by: ${transferData?.transferredBy?._id}]`); + if (room.onHold) { + throw new Error('error-room-onHold'); + } + + if (transferData.departmentId) { + const department = await LivechatDepartment.findOneById>(transferData.departmentId, { + projection: { name: 1 }, + }); + if (!department) { + throw new Error('error-invalid-department'); + } + + transferData.department = department; + this.logger.debug(`Transfering room ${room._id} to department ${transferData.department?._id}`); + } + + return RoutingManager.transferRoom(room, guest, transferData); + } + + async forwardOpenChats(userId: string) { + this.logger.debug(`Transferring open chats for user ${userId}`); + const user = await Users.findOneById(userId); + if (!user) { + throw new Error('error-invalid-user'); + } + + const { _id, username, name } = user; + for await (const room of LivechatRooms.findOpenByAgent(userId)) { + const guest = await LivechatVisitors.findOneEnabledById(room.v._id); + if (!guest) { + continue; + } + + const transferredBy = normalizeTransferredByData({ _id, username, name }, room); + await this.transfer(room, guest, { + transferredBy, + departmentId: guest.department, + }); + } + } + + showConnecting() { + return RoutingManager.getConfig()?.showConnecting || false; + } + + async getInitSettings() { + const validSettings = [ + 'Livechat_title', + 'Livechat_title_color', + 'Livechat_enable_message_character_limit', + 'Livechat_message_character_limit', + 'Message_MaxAllowedSize', + 'Livechat_enabled', + 'Livechat_registration_form', + 'Livechat_allow_switching_departments', + 'Livechat_offline_title', + 'Livechat_offline_title_color', + 'Livechat_offline_message', + 'Livechat_offline_success_message', + 'Livechat_offline_form_unavailable', + 'Livechat_display_offline_form', + 'Omnichannel_call_provider', + 'Language', + 'Livechat_enable_transcript', + 'Livechat_transcript_message', + 'Livechat_fileupload_enabled', + 'FileUpload_Enabled', + 'Livechat_conversation_finished_message', + 'Livechat_conversation_finished_text', + 'Livechat_name_field_registration_form', + 'Livechat_email_field_registration_form', + 'Livechat_registration_form_message', + 'Livechat_force_accept_data_processing_consent', + 'Livechat_data_processing_consent_text', + 'Livechat_show_agent_info', + 'Livechat_clear_local_storage_when_chat_ended', + 'Livechat_history_monitor_type', + 'Livechat_hide_system_messages', + 'Livechat_widget_position', + 'Livechat_background', + 'Assets_livechat_widget_logo', + 'Livechat_hide_watermark', + ] as const; + + type SettingTypes = (typeof validSettings)[number] | 'Livechat_Show_Connecting'; + + const rcSettings = validSettings.reduce>((acc, setting) => { + acc[setting] = settings.get(setting); + return acc; + }, {} as any); + + rcSettings.Livechat_Show_Connecting = this.showConnecting(); + + return rcSettings; + } + + async sendOfflineMessage(data: OfflineMessageData) { + if (!settings.get('Livechat_display_offline_form')) { + throw new Error('error-offline-form-disabled'); + } + + const { message, name, email, department, host } = data; + + if (!email) { + throw new Error('error-invalid-email'); + } + + const emailMessage = `${message}`.replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1
$2'); + + let html = '

New livechat message

'; + if (host && host !== '') { + html = html.concat(`

Sent from: ${host}

`); + } + html = html.concat(` +

Visitor name: ${name}

+

Visitor email: ${email}

+

Message:
${emailMessage}

`); + + const fromEmail = settings.get('From_Email').match(/\b[A-Z0-9._%+-]+@(?:[A-Z0-9-]+\.)+[A-Z]{2,4}\b/i); + + let from: string; + if (fromEmail) { + from = fromEmail[0]; + } else { + from = settings.get('From_Email'); + } + + if (settings.get('Livechat_validate_offline_email')) { + const emailDomain = email.substr(email.lastIndexOf('@') + 1); + + try { + await dnsResolveMx(emailDomain); + } catch (e) { + throw new Meteor.Error('error-invalid-email-address'); + } + } + + // TODO Block offline form if Livechat_offline_email is undefined + // (it does not make sense to have an offline form that does nothing) + // `this.sendEmail` will throw an error if the email is invalid + // thus this breaks livechat, since the "to" email is invalid, and that returns an [invalid email] error to the livechat client + let emailTo = settings.get('Livechat_offline_email'); + if (department && department !== '') { + const dep = await LivechatDepartment.findOneByIdOrName(department, { projection: { email: 1 } }); + if (dep) { + emailTo = dep.email || emailTo; + } + } + + const fromText = `${name} - ${email} <${from}>`; + const replyTo = `${name} <${email}>`; + const subject = `Livechat offline message from ${name}: ${`${emailMessage}`.substring(0, 20)}`; + await this.sendEmail(fromText, emailTo, replyTo, subject, html); + + setImmediate(() => { + void callbacks.run('livechat.offlineMessage', data); + }); + } + + async sendMessage({ + guest, + message, + roomInfo, + agent, + }: { + guest: ILivechatVisitor; + message: ILivechatMessage; + roomInfo: { + source?: IOmnichannelRoom['source']; + [key: string]: unknown; + }; + agent?: SelectedAgent; + }) { + const { room, newRoom } = await this.getRoom(guest, message, roomInfo, agent); + if (guest.name) { + message.alias = guest.name; + } + return Object.assign(await sendMessage(guest, message, room), { + newRoom, + showConnecting: this.showConnecting(), + }); + } + + async removeGuest(_id: string) { + const guest = await LivechatVisitors.findOneEnabledById(_id, { projection: { _id: 1, token: 1 } }); + if (!guest) { + throw new Error('error-invalid-guest'); + } + + await this.cleanGuestHistory(guest); + return LivechatVisitors.disableById(_id); + } + + async cleanGuestHistory(guest: ILivechatVisitor) { + const { token } = guest; + + // This shouldn't be possible, but just in case + if (!token) { + throw new Error('error-invalid-guest'); + } + + const cursor = LivechatRooms.findByVisitorToken(token); + for await (const room of cursor) { + await Promise.all([ + FileUpload.removeFilesByRoomId(room._id), + Messages.removeByRoomId(room._id), + ReadReceipts.removeByRoomId(room._id), + ]); + } + + await Promise.all([ + Subscriptions.removeByVisitorToken(token), + LivechatRooms.removeByVisitorToken(token), + LivechatInquiry.removeByVisitorToken(token), + ]); + } + + async deleteMessage({ guest, message }: { guest: ILivechatVisitor; message: IMessage }) { + const deleteAllowed = settings.get('Message_AllowDeleting'); + const editOwn = message.u && message.u._id === guest._id; + + if (!deleteAllowed || !editOwn) { + throw new Error('error-action-not-allowed'); + } + + await deleteMessage(message, guest as unknown as IUser); + + return true; + } + + async setUserStatusLivechatIf(userId: string, status: ILivechatAgentStatus, condition?: Filter, fields?: AKeyOf) { + const user = await Users.setLivechatStatusIf(userId, status, condition, fields); + callbacks.runAsync('livechat.setUserStatusLivechat', { userId, status }); + return user; + } + + async returnRoomAsInquiry(room: IOmnichannelRoom, departmentId?: string, overrideTransferData: any = {}) { + this.logger.debug({ msg: `Transfering room to ${departmentId ? 'department' : ''} queue`, room }); + if (!room.open) { + throw new Meteor.Error('room-closed'); + } + + if (room.onHold) { + throw new Meteor.Error('error-room-onHold'); + } + + if (!room.servedBy) { + return false; + } + + const user = await Users.findOneById(room.servedBy._id); + if (!user?._id) { + throw new Meteor.Error('error-invalid-user'); + } + + // find inquiry corresponding to room + const inquiry = await LivechatInquiry.findOne({ rid: room._id }); + if (!inquiry) { + return false; + } + + const transferredBy = normalizeTransferredByData(user, room); + this.logger.debug(`Transfering room ${room._id} by user ${transferredBy._id}`); + const transferData = { roomId: room._id, scope: 'queue', departmentId, transferredBy, ...overrideTransferData }; + try { + await this.saveTransferHistory(room, transferData); + await RoutingManager.unassignAgent(inquiry, departmentId); + } catch (e) { + this.logger.error(e); + throw new Meteor.Error('error-returning-inquiry'); + } + + callbacks.runAsync('livechat:afterReturnRoomAsInquiry', { room }); + + return true; + } + + async saveTransferHistory(room: IOmnichannelRoom, transferData: TransferData) { + const { departmentId: previousDepartment } = room; + const { department: nextDepartment, transferredBy, transferredTo, scope, comment } = transferData; + + check( + transferredBy, + Match.ObjectIncluding({ + _id: String, + username: String, + name: Match.Maybe(String), + type: String, + }), + ); + + const { _id, username } = transferredBy; + const scopeData = scope || (nextDepartment ? 'department' : 'agent'); + this.logger.info(`Storing new chat transfer of ${room._id} [Transfered by: ${_id} to ${scopeData}]`); + + const transfer = { + transferData: { + transferredBy, + ts: new Date(), + scope: scopeData, + comment, + ...(previousDepartment && { previousDepartment }), + ...(nextDepartment && { nextDepartment }), + ...(transferredTo && { transferredTo }), + }, + }; + + const type = 'livechat_transfer_history'; + const transferMessage = { + t: type, + rid: room._id, + ts: new Date(), + msg: '', + u: { + _id, + username, + }, + groupable: false, + }; + + Object.assign(transferMessage, transfer); + + await sendMessage(transferredBy, transferMessage, room); + } + + async saveGuest(guestData: Pick & { email?: string; phone?: string }, userId: string) { + const { _id, name, email, phone, livechatData = {} } = guestData; + + const visitor = await LivechatVisitors.findOneById(_id, { projection: { _id: 1 } }); + if (!visitor) { + throw new Error('error-invalid-visitor'); + } + + this.logger.debug({ msg: 'Saving guest', guestData }); + const updateData: { + name?: string | undefined; + username?: string | undefined; + email?: string | undefined; + phone?: string | undefined; + livechatData: { + [k: string]: any; + }; + } = { livechatData: {} }; + + if (name) { + updateData.name = name; + } + if (email) { + updateData.email = email; + } + if (phone) { + updateData.phone = phone; + } + + const customFields: Record = {}; + + if ((!userId || (await hasPermissionAsync(userId, 'edit-livechat-room-customfields'))) && Object.keys(livechatData).length) { + this.logger.debug({ msg: `Saving custom fields for visitor ${_id}`, livechatData }); + for await (const field of LivechatCustomField.findByScope('visitor')) { + if (!livechatData.hasOwnProperty(field._id)) { + continue; + } + const value = trim(livechatData[field._id]); + if (value !== '' && field.regexp !== undefined && field.regexp !== '') { + const regexp = new RegExp(field.regexp); + if (!regexp.test(value)) { + throw new Error(i18n.t('error-invalid-custom-field-value')); + } + } + customFields[field._id] = value; + } + updateData.livechatData = customFields; + Livechat.logger.debug(`About to update ${Object.keys(customFields).length} custom fields for visitor ${_id}`); + } + const ret = await LivechatVisitors.saveGuestById(_id, updateData); + + setImmediate(() => { + void Apps.self?.triggerEvent(AppEvents.IPostLivechatGuestSaved, _id); + }); + + return ret; + } + + async setCustomFields({ token, key, value, overwrite }: { key: string; value: string; overwrite: boolean; token: string }) { + Livechat.logger.debug(`Setting custom fields data for visitor with token ${token}`); + + const customField = await LivechatCustomField.findOneById(key); + if (!customField) { + throw new Error('invalid-custom-field'); + } + + if (customField.regexp !== undefined && customField.regexp !== '') { + const regexp = new RegExp(customField.regexp); + if (!regexp.test(value)) { + throw new Error(i18n.t('error-invalid-custom-field-value', { field: key })); + } + } + + let result; + if (customField.scope === 'room') { + result = await LivechatRooms.updateDataByToken(token, key, value, overwrite); + } else { + result = await LivechatVisitors.updateLivechatDataByToken(token, key, value, overwrite); + } + + if (typeof result === 'boolean') { + // Note: this only happens when !overwrite is passed, in this case we don't do any db update + return 0; + } + + return result.modifiedCount; + } + + async requestTranscript({ + rid, + email, + subject, + user, + }: { + rid: string; + email: string; + subject: string; + user: AtLeast; + }) { + const room = await LivechatRooms.findOneById(rid, { projection: { _id: 1, open: 1, transcriptRequest: 1 } }); + + if (!room?.open) { + throw new Meteor.Error('error-invalid-room', 'Invalid room'); + } + + if (room.transcriptRequest) { + throw new Meteor.Error('error-transcript-already-requested', 'Transcript already requested'); + } + + if (!(await Omnichannel.isWithinMACLimit(room))) { + throw new Error('error-mac-limit-reached'); + } + + const { _id, username, name, utcOffset } = user; + const transcriptRequest = { + requestedAt: new Date(), + requestedBy: { + _id, + username, + name, + utcOffset, + }, + email, + subject, + }; + + await LivechatRooms.setEmailTranscriptRequestedByRoomId(rid, transcriptRequest); + return true; + } + + async savePageHistory(token: string, roomId: string | undefined, pageInfo: PageInfo) { + this.logger.debug({ + msg: `Saving page movement history for visitor with token ${token}`, + pageInfo, + roomId, + }); + + if (pageInfo.change !== settings.get('Livechat_history_monitor_type')) { + return; + } + const user = await Users.findOneById('rocket.cat'); + + if (!user) { + throw new Error('error-invalid-user'); + } + + const pageTitle = pageInfo.title; + const pageUrl = pageInfo.location.href; + const extraData: { + navigation: { + page: PageInfo; + token: string; + }; + expireAt?: number; + _hidden?: boolean; + } = { + navigation: { + page: pageInfo, + token, + }, + }; + + if (!roomId) { + this.logger.warn(`Saving page history without room id for visitor with token ${token}`); + // keep history of unregistered visitors for 1 month + const keepHistoryMiliseconds = 2592000000; + extraData.expireAt = new Date().getTime() + keepHistoryMiliseconds; + } + + if (!settings.get('Livechat_Visitor_navigation_as_a_message')) { + extraData._hidden = true; + } + + // @ts-expect-error: Investigating on which case we won't receive a roomId and where that history is supposed to be stored + return Message.saveSystemMessage('livechat_navigation_history', roomId, `${pageTitle} - ${pageUrl}`, user, extraData); + } + + async afterRemoveAgent(user: AtLeast) { + await callbacks.run('livechat.afterAgentRemoved', { agent: user }); + return true; + } + + async removeAgent(username: string) { + const user = await Users.findOneByUsername(username, { projection: { _id: 1, username: 1 } }); + + if (!user) { + throw new Error('error-invalid-user'); + } + + const { _id } = user; + + if (await removeUserFromRolesAsync(_id, ['livechat-agent'])) { + return this.afterRemoveAgent(user); + } + + return false; + } + + async removeManager(username: string) { + const user = await Users.findOneByUsername(username, { projection: { _id: 1 } }); + + if (!user) { + throw new Error('error-invalid-user'); + } + + return removeUserFromRolesAsync(user._id, ['livechat-manager']); + } + + async getLivechatRoomGuestInfo(room: IOmnichannelRoom) { + const visitor = await LivechatVisitors.findOneEnabledById(room.v._id); + if (!visitor) { + throw new Error('error-invalid-visitor'); + } + + const agent = room.servedBy?._id ? await Users.findOneById(room.servedBy?._id) : null; + + const ua = new UAParser(); + ua.setUA(visitor.userAgent || ''); + + const postData: ICRMData = { + _id: room._id, + label: room.fname || room.label, // using same field for compatibility + topic: room.topic, + createdAt: room.ts, + lastMessageAt: room.lm, + tags: room.tags, + customFields: room.livechatData, + visitor: { + _id: visitor._id, + token: visitor.token, + name: visitor.name, + username: visitor.username, + department: visitor.department, + ip: visitor.ip, + os: ua.getOS().name && `${ua.getOS().name} ${ua.getOS().version}`, + browser: ua.getBrowser().name && `${ua.getBrowser().name} ${ua.getBrowser().version}`, + customFields: visitor.livechatData, + }, + }; + + if (agent) { + const customFields = parseAgentCustomFields(agent.customFields); + + postData.agent = { + _id: agent._id, + username: agent.username, + name: agent.name, + ...(customFields && { customFields }), + }; + + if (agent.emails && agent.emails.length > 0) { + postData.agent.email = agent.emails[0].address; + } + } + + if (room.crmData) { + postData.crmData = room.crmData; + } + + if (visitor.visitorEmails && visitor.visitorEmails.length > 0) { + postData.visitor.email = visitor.visitorEmails; + } + if (visitor.phone && visitor.phone.length > 0) { + postData.visitor.phone = visitor.phone; + } + + return postData; + } + + async allowAgentChangeServiceStatus(statusLivechat: ILivechatAgentStatus, agentId: string) { + if (statusLivechat !== ILivechatAgentStatus.AVAILABLE) { + return true; + } + + return businessHourManager.allowAgentChangeServiceStatus(agentId); + } + + async notifyGuestStatusChanged(token: string, status: UserStatus) { + await LivechatInquiry.updateVisitorStatus(token, status); + await LivechatRooms.updateVisitorStatus(token, status); + } + + async setUserStatusLivechat(userId: string, status: ILivechatAgentStatus) { + const user = await Users.setLivechatStatus(userId, status); + callbacks.runAsync('livechat.setUserStatusLivechat', { userId, status }); + return user; + } + + async afterAgentAdded(user: IUser) { + await Promise.all([ + Users.setOperator(user._id, true), + this.setUserStatusLivechat(user._id, user.status !== 'offline' ? ILivechatAgentStatus.AVAILABLE : ILivechatAgentStatus.NOT_AVAILABLE), + ]); + callbacks.runAsync('livechat.onNewAgentCreated', user._id); + + return user; + } + + async addAgent(username: string) { + check(username, String); + + const user = await Users.findOneByUsername(username, { projection: { _id: 1, username: 1 } }); + + if (!user) { + throw new Meteor.Error('error-invalid-user'); + } + + if (await addUserRolesAsync(user._id, ['livechat-agent'])) { + return this.afterAgentAdded(user); + } + + return false; + } + + async afterAgentUserActivated(user: IUser) { + if (!user.roles.includes('livechat-agent')) { + throw new Error('invalid-user-role'); + } + await Users.setOperator(user._id, true); + callbacks.runAsync('livechat.onNewAgentCreated', user._id); + } + + async addManager(username: string) { + check(username, String); + + const user = await Users.findOneByUsername(username, { projection: { _id: 1, username: 1 } }); + + if (!user) { + throw new Meteor.Error('error-invalid-user'); + } + + if (await addUserRolesAsync(user._id, ['livechat-manager'])) { + return user; + } + + return false; + } + + async saveDepartmentAgents( + _id: string, + departmentAgents: { + upsert?: Pick[]; + remove?: Pick[]; + }, + ) { + check(_id, String); + check(departmentAgents, { + upsert: Match.Maybe([ + Match.ObjectIncluding({ + agentId: String, + username: String, + count: Match.Maybe(Match.Integer), + order: Match.Maybe(Match.Integer), + }), + ]), + remove: Match.Maybe([ + Match.ObjectIncluding({ + agentId: String, + username: Match.Maybe(String), + count: Match.Maybe(Match.Integer), + order: Match.Maybe(Match.Integer), + }), + ]), + }); + + const department = await LivechatDepartment.findOneById>(_id, { projection: { enabled: 1 } }); + if (!department) { + throw new Meteor.Error('error-department-not-found', 'Department not found'); + } + + return updateDepartmentAgents(_id, departmentAgents, department.enabled); + } + + async saveRoomInfo( + roomData: { + _id: string; + topic?: string; + tags?: string[]; + livechatData?: { [k: string]: string }; + // For priority and SLA, if the value is blank (ie ""), then system will remove the priority or SLA from the room + priorityId?: string; + slaId?: string; + }, + guestData?: { + _id: string; + name?: string; + email?: string; + phone?: string; + livechatData?: { [k: string]: string }; + }, + userId?: string, + ) { + this.logger.debug(`Saving room information on room ${roomData._id}`); + const { livechatData = {} } = roomData; + const customFields: Record = {}; + + if ((!userId || (await hasPermissionAsync(userId, 'edit-livechat-room-customfields'))) && Object.keys(livechatData).length) { + const fields = LivechatCustomField.findByScope('room'); + for await (const field of fields) { + if (!livechatData.hasOwnProperty(field._id)) { + continue; + } + const value = trim(livechatData[field._id]); + if (value !== '' && field.regexp !== undefined && field.regexp !== '') { + const regexp = new RegExp(field.regexp); + if (!regexp.test(value)) { + throw new Meteor.Error(i18n.t('error-invalid-custom-field-value', { field: field.label })); + } + } + customFields[field._id] = value; + } + roomData.livechatData = customFields; + Livechat.logger.debug(`About to update ${Object.keys(customFields).length} custom fields on room ${roomData._id}`); + } + + await LivechatRooms.saveRoomById(roomData); + + setImmediate(() => { + void Apps.self?.triggerEvent(AppEvents.IPostLivechatRoomSaved, roomData._id); + }); + + if (guestData?.name?.trim().length) { + const { _id: rid } = roomData; + const { name } = guestData; + await Promise.all([ + Rooms.setFnameById(rid, name), + LivechatInquiry.setNameByRoomId(rid, name), + Subscriptions.updateDisplayNameByRoomId(rid, name), + ]); + + return true; + } + } } export const Livechat = new LivechatClass(); diff --git a/apps/meteor/app/livechat/server/lib/QueueManager.ts b/apps/meteor/app/livechat/server/lib/QueueManager.ts index aed0061e808e..8be71aa4c991 100644 --- a/apps/meteor/app/livechat/server/lib/QueueManager.ts +++ b/apps/meteor/app/livechat/server/lib/QueueManager.ts @@ -1,3 +1,5 @@ +import { Apps, AppEvents } from '@rocket.chat/apps'; +import { Omnichannel } from '@rocket.chat/core-services'; import type { ILivechatInquiryRecord, ILivechatVisitor, IMessage, IOmnichannelRoom, SelectedAgent } from '@rocket.chat/core-typings'; import { Logger } from '@rocket.chat/logger'; import { LivechatInquiry, LivechatRooms, Users } from '@rocket.chat/models'; @@ -20,6 +22,14 @@ export const queueInquiry = async (inquiry: ILivechatInquiryRecord, defaultAgent logger.debug(`Delegating inquiry with id ${inquiry._id} to agent ${defaultAgent?.username}`); await callbacks.run('livechat.beforeRouteChat', inquiry, inquiryAgent); + const room = await LivechatRooms.findOneById(inquiry.rid, { projection: { v: 1 } }); + if (!room || !(await Omnichannel.isWithinMACLimit(room))) { + logger.error({ msg: 'MAC limit reached, not routing inquiry', inquiry }); + // We'll queue these inquiries so when new license is applied, they just start rolling again + // Minimizing disruption + await saveQueueInquiry(inquiry); + return; + } const dbInquiry = await LivechatInquiry.findOneById(inquiry._id); if (!dbInquiry) { @@ -63,6 +73,7 @@ export const QueueManager: queueManager = { status: Match.Maybe(String), department: Match.Maybe(String), name: Match.Maybe(String), + activity: Match.Maybe([String]), }), ); @@ -94,6 +105,7 @@ export const QueueManager: queueManager = { throw new Error('inquiry-not-found'); } + void Apps.self?.triggerEvent(AppEvents.IPostLivechatRoomStarted, room); await LivechatRooms.updateRoomCount(); await queueInquiry(inquiry, agent); diff --git a/apps/meteor/app/livechat/server/lib/RoutingManager.ts b/apps/meteor/app/livechat/server/lib/RoutingManager.ts index f2fd7010eb12..19437d800ee2 100644 --- a/apps/meteor/app/livechat/server/lib/RoutingManager.ts +++ b/apps/meteor/app/livechat/server/lib/RoutingManager.ts @@ -1,3 +1,4 @@ +import { Apps, AppEvents } from '@rocket.chat/apps'; import { Message, Omnichannel } from '@rocket.chat/core-services'; import type { ILivechatInquiryRecord, @@ -10,13 +11,14 @@ import type { InquiryWithAgentInfo, TransferData, } from '@rocket.chat/core-typings'; +import { License } from '@rocket.chat/license'; import { Logger } from '@rocket.chat/logger'; import { LivechatInquiry, LivechatRooms, Subscriptions, Rooms, Users } from '@rocket.chat/models'; import { Match, check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; -import { Apps, AppEvents } from '../../../../ee/server/apps'; import { callbacks } from '../../../../lib/callbacks'; +import { settings } from '../../../settings/server'; import { createLivechatSubscription, dispatchAgentDelegated, @@ -31,11 +33,9 @@ import { const logger = new Logger('RoutingManager'); type Routing = { - methodName: string | null; methods: Record; - startQueue(): void; + startQueue(): Promise; isMethodSet(): boolean; - setMethodNameAndStartQueue(name: string): Promise; registerMethod(name: string, Method: IRoutingMethodConstructor): void; getMethod(): IRoutingMethod; getConfig(): RoutingMethodConfig | undefined; @@ -46,7 +46,7 @@ type Routing = { options?: { clientAction?: boolean; forwardingToDepartment?: { oldDepartmentId?: string; transferData?: any } }, ): Promise<(IOmnichannelRoom & { chatQueued?: boolean }) | null | void>; assignAgent(inquiry: InquiryWithAgentInfo, agent: SelectedAgent): Promise; - unassignAgent(inquiry: ILivechatInquiryRecord, departmentId?: string): Promise; + unassignAgent(inquiry: ILivechatInquiryRecord, departmentId?: string, shouldQueue?: boolean): Promise; takeInquiry( inquiry: Omit< ILivechatInquiryRecord, @@ -61,43 +61,33 @@ type Routing = { }; export const RoutingManager: Routing = { - methodName: null, methods: {}, - startQueue() { - // todo: move to eventemitter or middleware - // queue shouldn't start on CE - }, - - isMethodSet() { - return !!this.methodName; - }, + async startQueue() { + const shouldPreventQueueStart = await License.shouldPreventAction('monthlyActiveContacts'); - async setMethodNameAndStartQueue(name) { - logger.info(`Changing default routing method from ${this.methodName} to ${name}`); - if (!this.methods[name]) { - logger.warn(`Cannot change routing method to ${name}. Selected Routing method does not exists. Defaulting to Manual_Selection`); - this.methodName = 'Manual_Selection'; - } else { - this.methodName = name; + if (shouldPreventQueueStart) { + logger.error('Monthly Active Contacts limit reached. Queue will not start'); + return; } - void (await Omnichannel.getQueueWorker()).shouldStart(); }, + isMethodSet() { + return settings.get('Livechat_Routing_Method') !== ''; + }, + // eslint-disable-next-line @typescript-eslint/naming-convention registerMethod(name, Method) { this.methods[name] = new Method(); }, getMethod() { - if (!this.methodName) { - throw new Meteor.Error('error-routing-method-not-set'); - } - if (!this.methods[this.methodName]) { + const setting = settings.get('Livechat_Routing_Method'); + if (!this.methods[setting]) { throw new Meteor.Error('error-routing-method-not-available'); } - return this.methods[this.methodName]; + return this.methods[setting]; }, getConfig() { @@ -105,7 +95,7 @@ export const RoutingManager: Routing = { }, async getNextAgent(department, ignoreAgentId) { - logger.debug(`Getting next available agent with method ${this.methodName}`); + logger.debug(`Getting next available agent with method ${settings.get('Livechat_Routing_Method')}`); return this.getMethod().getNextAgent(department, ignoreAgentId); }, @@ -156,14 +146,19 @@ export const RoutingManager: Routing = { await Promise.all([Message.saveSystemMessage('command', rid, 'connected', user), Message.saveSystemMessage('uj', rid, '', user)]); } + if (!room) { + logger.debug(`Cannot assign agent to inquiry ${inquiry._id}: Room not found`); + throw new Meteor.Error('error-room-not-found', 'Room not found'); + } + await dispatchAgentDelegated(rid, agent.agentId); logger.debug(`Agent ${agent.agentId} assigned to inquriy ${inquiry._id}. Instances notified`); - void Apps.getBridges()?.getListenerBridge().livechatEvent(AppEvents.IPostLivechatAgentAssigned, { room, user }); + void Apps.self?.getBridges()?.getListenerBridge().livechatEvent(AppEvents.IPostLivechatAgentAssigned, { room, user }); return inquiry; }, - async unassignAgent(inquiry, departmentId) { + async unassignAgent(inquiry, departmentId, shouldQueue = false) { const { rid, department } = inquiry; const room = await LivechatRooms.findOneById(rid); @@ -186,6 +181,10 @@ export const RoutingManager: Routing = { const { servedBy } = room; + if (shouldQueue) { + await LivechatInquiry.queueInquiry(inquiry._id); + } + if (servedBy) { await LivechatRooms.removeAgentByRoomId(rid); await this.removeAllRoomSubscriptions(room); @@ -260,6 +259,7 @@ export const RoutingManager: Routing = { }, async transferRoom(room, guest, transferData) { + logger.debug(`Transfering room ${room._id} by ${transferData.transferredBy._id}`); if (transferData.departmentId) { logger.debug(`Transfering room ${room._id} to department ${transferData.departmentId}`); return forwardRoomToDepartment(room, guest, transferData); diff --git a/apps/meteor/app/livechat/server/lib/analytics/agents.js b/apps/meteor/app/livechat/server/lib/analytics/agents.js deleted file mode 100644 index 5f89a4dc81e2..000000000000 --- a/apps/meteor/app/livechat/server/lib/analytics/agents.js +++ /dev/null @@ -1,56 +0,0 @@ -import { LivechatRooms, LivechatAgentActivity } from '@rocket.chat/models'; - -export const findAllAverageServiceTimeAsync = async ({ start, end, options = {} }) => { - if (!start || !end) { - throw new Error('"start" and "end" must be provided'); - } - const total = await LivechatRooms.findAllAverageServiceTimeByAgents({ - start, - end, - onlyCount: true, - }).toArray(); - return { - agents: await LivechatRooms.findAllAverageServiceTimeByAgents({ - start, - end, - options, - }).toArray(), - total: total.length ? total[0].total : 0, - }; -}; - -export const findAllServiceTimeAsync = async ({ start, end, options = {} }) => { - if (!start || !end) { - throw new Error('"start" and "end" must be provided'); - } - const total = await LivechatRooms.findAllServiceTimeByAgent({ - start, - end, - onlyCount: true, - }).toArray(); - return { - agents: await LivechatRooms.findAllServiceTimeByAgent({ start, end, options }).toArray(), - total: total.length ? total[0].total : 0, - }; -}; - -export const findAvailableServiceTimeHistoryAsync = async ({ start, end, fullReport, options = {} }) => { - if (!start || !end) { - throw new Error('"start" and "end" must be provided'); - } - const total = await LivechatAgentActivity.findAvailableServiceTimeHistory({ - start, - end, - fullReport, - onlyCount: true, - }).toArray(); - return { - agents: await LivechatAgentActivity.findAvailableServiceTimeHistory({ - start, - end, - fullReport, - options, - }).toArray(), - total: total.length ? total[0].total : 0, - }; -}; diff --git a/apps/meteor/app/livechat/server/lib/analytics/agents.ts b/apps/meteor/app/livechat/server/lib/analytics/agents.ts new file mode 100644 index 000000000000..082404bd892e --- /dev/null +++ b/apps/meteor/app/livechat/server/lib/analytics/agents.ts @@ -0,0 +1,72 @@ +import { LivechatRooms, LivechatAgentActivity } from '@rocket.chat/models'; + +type Params = { + start: Date; + end: Date; + options?: any; +}; + +export const findAllAverageServiceTimeAsync = async ({ start, end, options = {} }: Params) => { + if (!start || !end) { + throw new Error('"start" and "end" must be provided'); + } + const total = await LivechatRooms.findAllAverageServiceTimeByAgents({ + start, + end, + onlyCount: true, + }).toArray(); + return { + agents: await LivechatRooms.findAllAverageServiceTimeByAgents({ + start, + end, + options, + }).toArray(), + total: total.length ? total[0].total : 0, + }; +}; + +export const findAllServiceTimeAsync = async ({ start, end, options = {} }: Params) => { + if (!start || !end) { + throw new Error('"start" and "end" must be provided'); + } + const total = await LivechatRooms.findAllServiceTimeByAgent({ + start, + end, + onlyCount: true, + }).toArray(); + return { + agents: await LivechatRooms.findAllServiceTimeByAgent({ start, end, options }).toArray(), + total: total.length ? total[0].total : 0, + }; +}; + +export const findAvailableServiceTimeHistoryAsync = async ({ + start, + end, + fullReport, + options = {}, +}: { + start: string; + end: string; + fullReport: boolean; + options: { sort?: Record; offset?: number; count?: number }; +}) => { + if (!start || !end) { + throw new Error('"start" and "end" must be provided'); + } + const total = await LivechatAgentActivity.findAvailableServiceTimeHistory({ + start, + end, + fullReport, + onlyCount: true, + }).toArray(); + return { + agents: await LivechatAgentActivity.findAvailableServiceTimeHistory({ + start, + end, + fullReport, + options, + }).toArray(), + total: total.length ? total[0].total : 0, + }; +}; diff --git a/apps/meteor/app/livechat/server/lib/analytics/dashboards.ts b/apps/meteor/app/livechat/server/lib/analytics/dashboards.ts index cb7ecbf079f2..dd0d54970065 100644 --- a/apps/meteor/app/livechat/server/lib/analytics/dashboards.ts +++ b/apps/meteor/app/livechat/server/lib/analytics/dashboards.ts @@ -1,10 +1,12 @@ +import { OmnichannelAnalytics } from '@rocket.chat/core-services'; import type { IUser } from '@rocket.chat/core-typings'; import { LivechatRooms, Users, LivechatVisitors, LivechatAgentActivity } from '@rocket.chat/models'; +import mem from 'mem'; import moment from 'moment'; import { secondsToHHMMSS } from '../../../../../lib/utils/secondsToHHMMSS'; import { settings } from '../../../../settings/server'; -import { Livechat } from '../Livechat'; +import { getAnalyticsOverviewDataCachedForRealtime } from '../AnalyticsTyped'; import { findPercentageOfAbandonedRoomsAsync, findAllAverageOfChatDurationTimeAsync, @@ -13,15 +15,7 @@ import { findAllAverageServiceTimeAsync, } from './departments'; -export const findAllChatsStatusAsync = async ({ - start, - end, - departmentId = undefined, -}: { - start: Date; - end: Date; - departmentId?: string; -}) => { +const findAllChatsStatusAsync = async ({ start, end, departmentId = undefined }: { start: Date; end: Date; departmentId?: string }) => { if (!start || !end) { throw new Error('"start" and "end" must be provided'); } @@ -33,35 +27,36 @@ export const findAllChatsStatusAsync = async ({ }; }; -export const getProductivityMetricsAsync = async ({ +const getProductivityMetricsAsync = async ({ start, end, departmentId = undefined, user, }: { - start: Date; - end: Date; + start: string; + end: string; departmentId?: string; user: IUser; }) => { if (!start || !end) { throw new Error('"start" and "end" must be provided'); } - const totalizers = await Livechat.Analytics.getAnalyticsOverviewData({ - daterange: { - from: start, - to: end, - }, - analyticsOptions: { - name: 'Productivity', - }, - departmentId, - utcOffset: user?.utcOffset, - language: user?.language || settings.get('Language') || 'en', - }); + const totalizers = + (await OmnichannelAnalytics.getAnalyticsOverviewData({ + daterange: { + from: start, + to: end, + }, + analyticsOptions: { + name: 'Productivity', + }, + departmentId, + utcOffset: user?.utcOffset, + language: user?.language || settings.get('Language') || 'en', + })) || []; const averageWaitingTime = await findAllAverageWaitingTimeAsync({ - start, - end, + start: new Date(start), + end: new Date(end), departmentId, }); @@ -78,14 +73,14 @@ export const getProductivityMetricsAsync = async ({ }; }; -export const getAgentsProductivityMetricsAsync = async ({ +const getAgentsProductivityMetricsAsync = async ({ start, end, departmentId = undefined, user, }: { - start: Date; - end: Date; + start: string; + end: string; departmentId?: string; user: IUser; }) => { @@ -100,22 +95,23 @@ export const getAgentsProductivityMetricsAsync = async ({ }) )[0]; const averageOfServiceTime = await findAllAverageServiceTimeAsync({ - start, - end, - departmentId, - }); - const totalizers = await Livechat.Analytics.getAnalyticsOverviewData({ - daterange: { - from: start, - to: end, - }, - analyticsOptions: { - name: 'Conversations', - }, + start: new Date(start), + end: new Date(end), departmentId, - utcOffset: user.utcOffset, - language: user.language || settings.get('Language') || 'en', }); + const totalizers = + (await OmnichannelAnalytics.getAnalyticsOverviewData({ + daterange: { + from: start, + to: end, + }, + analyticsOptions: { + name: 'Conversations', + }, + departmentId, + utcOffset: user.utcOffset, + language: user.language || settings.get('Language') || 'en', + })) || []; const totalOfServiceTime = averageOfServiceTime.departments.length; @@ -148,7 +144,7 @@ export const getAgentsProductivityMetricsAsync = async ({ }; }; -export const getChatsMetricsAsync = async ({ start, end, departmentId = undefined }: { start: Date; end: Date; departmentId?: string }) => { +const getChatsMetricsAsync = async ({ start, end, departmentId = undefined }: { start: Date; end: Date; departmentId?: string }) => { if (!start || !end) { throw new Error('"start" and "end" must be provided'); } @@ -223,36 +219,37 @@ export const getChatsMetricsAsync = async ({ start, end, departmentId = undefine }; }; -export const getConversationsMetricsAsync = async ({ +const getConversationsMetricsAsync = async ({ start, end, departmentId, user, }: { - start: Date; - end: Date; + start: string; + end: string; departmentId?: string; user: IUser; }) => { if (!start || !end) { throw new Error('"start" and "end" must be provided'); } - const totalizers = await Livechat.Analytics.getAnalyticsOverviewData({ - daterange: { - from: start, - to: end, - }, - analyticsOptions: { - name: 'Conversations', - }, - ...(departmentId && departmentId !== 'undefined' && { departmentId }), - utcOffset: user.utcOffset, - language: user.language || settings.get('Language') || 'en', - }); + const totalizers = + (await getAnalyticsOverviewDataCachedForRealtime({ + daterange: { + from: start, + to: end, + }, + analyticsOptions: { + name: 'Conversations', + }, + ...(departmentId && departmentId !== 'undefined' && { departmentId }), + utcOffset: user.utcOffset, + language: user.language || settings.get('Language') || 'en', + })) || []; const metrics = ['Total_conversations', 'Open_conversations', 'On_Hold_conversations', 'Total_messages']; const visitorsCount = await LivechatVisitors.getVisitorsBetweenDate({ - start, - end, + start: new Date(start), + end: new Date(end), department: departmentId, }).count(); return { @@ -263,7 +260,7 @@ export const getConversationsMetricsAsync = async ({ }; }; -export const findAllChatMetricsByAgentAsync = async ({ +const findAllChatMetricsByAgentAsync = async ({ start, end, departmentId = undefined, @@ -311,10 +308,10 @@ export const findAllChatMetricsByAgentAsync = async ({ return result; }; -export const findAllAgentsStatusAsync = async ({ departmentId = undefined }: { departmentId?: string }) => +const findAllAgentsStatusAsync = async ({ departmentId = undefined }: { departmentId?: string }) => (await Users.countAllAgentsStatus({ departmentId }))[0]; -export const findAllChatMetricsByDepartmentAsync = async ({ +const findAllChatMetricsByDepartmentAsync = async ({ start, end, departmentId = undefined, @@ -349,7 +346,7 @@ export const findAllChatMetricsByDepartmentAsync = async ({ return result; }; -export const findAllResponseTimeMetricsAsync = async ({ +const findAllResponseTimeMetricsAsync = async ({ start, end, departmentId = undefined, @@ -380,3 +377,16 @@ export const findAllResponseTimeMetricsAsync = async ({ }, }; }; + +export const getConversationsMetricsAsyncCached = mem(getConversationsMetricsAsync, { maxAge: 5000, cacheKey: JSON.stringify }); +export const getAgentsProductivityMetricsAsyncCached = mem(getAgentsProductivityMetricsAsync, { maxAge: 5000, cacheKey: JSON.stringify }); +export const getChatsMetricsAsyncCached = mem(getChatsMetricsAsync, { maxAge: 5000, cacheKey: JSON.stringify }); +export const getProductivityMetricsAsyncCached = mem(getProductivityMetricsAsync, { maxAge: 5000, cacheKey: JSON.stringify }); +export const findAllChatsStatusAsyncCached = mem(findAllChatsStatusAsync, { maxAge: 5000, cacheKey: JSON.stringify }); +export const findAllChatMetricsByAgentAsyncCached = mem(findAllChatMetricsByAgentAsync, { maxAge: 5000, cacheKey: JSON.stringify }); +export const findAllAgentsStatusAsyncCached = mem(findAllAgentsStatusAsync, { maxAge: 5000, cacheKey: JSON.stringify }); +export const findAllChatMetricsByDepartmentAsyncCached = mem(findAllChatMetricsByDepartmentAsync, { + maxAge: 5000, + cacheKey: JSON.stringify, +}); +export const findAllResponseTimeMetricsAsyncCached = mem(findAllResponseTimeMetricsAsync, { maxAge: 5000, cacheKey: JSON.stringify }); diff --git a/apps/meteor/app/livechat/server/lib/analytics/departments.js b/apps/meteor/app/livechat/server/lib/analytics/departments.js deleted file mode 100644 index b8b8802bb85a..000000000000 --- a/apps/meteor/app/livechat/server/lib/analytics/departments.js +++ /dev/null @@ -1,158 +0,0 @@ -import { LivechatRooms, Messages } from '@rocket.chat/models'; - -export const findAllRoomsAsync = async ({ start, end, answered, departmentId, options = {} }) => { - if (!start || !end) { - throw new Error('"start" and "end" must be provided'); - } - const total = await LivechatRooms.findAllRooms({ - start, - answered, - end, - departmentId, - onlyCount: true, - }).toArray(); - return { - departments: await LivechatRooms.findAllRooms({ - start, - answered, - end, - departmentId, - options, - }).toArray(), - total: total.length ? total[0].total : 0, - }; -}; - -export const findAllAverageOfChatDurationTimeAsync = async ({ start, end, departmentId, options = {} }) => { - if (!start || !end) { - throw new Error('"start" and "end" must be provided'); - } - const total = await LivechatRooms.findAllAverageOfChatDurationTime({ - start, - end, - departmentId, - onlyCount: true, - }).toArray(); - return { - departments: await LivechatRooms.findAllAverageOfChatDurationTime({ - start, - end, - departmentId, - options, - }).toArray(), - total: total.length ? total[0].total : 0, - }; -}; - -export const findAllAverageServiceTimeAsync = async ({ start, end, departmentId, options = {} }) => { - if (!start || !end) { - throw new Error('"start" and "end" must be provided'); - } - const total = await LivechatRooms.findAllAverageOfServiceTime({ - start, - end, - departmentId, - onlyCount: true, - }).toArray(); - return { - departments: await LivechatRooms.findAllAverageOfServiceTime({ - start, - end, - departmentId, - options, - }).toArray(), - total: total.length ? total[0].total : 0, - }; -}; - -export const findAllServiceTimeAsync = async ({ start, end, departmentId, options = {} }) => { - if (!start || !end) { - throw new Error('"start" and "end" must be provided'); - } - const total = await LivechatRooms.findAllServiceTime({ - start, - end, - departmentId, - onlyCount: true, - }).toArray(); - return { - departments: await LivechatRooms.findAllServiceTime({ - start, - end, - departmentId, - options, - }).toArray(), - total: total.length ? total[0].total : 0, - }; -}; - -export const findAllAverageWaitingTimeAsync = async ({ start, end, departmentId, options = {} }) => { - if (!start || !end) { - throw new Error('"start" and "end" must be provided'); - } - const total = await LivechatRooms.findAllAverageWaitingTime({ - start, - end, - departmentId, - onlyCount: true, - }).toArray(); - return { - departments: await LivechatRooms.findAllAverageWaitingTime({ - start, - end, - departmentId, - options, - }).toArray(), - total: total.length ? total[0].total : 0, - }; -}; - -export const findAllNumberOfTransferredRoomsAsync = async ({ start, end, departmentId, options = {} }) => { - if (!start || !end) { - throw new Error('"start" and "end" must be provided'); - } - const total = await Messages.findAllNumberOfTransferredRooms({ - start, - end, - departmentId, - onlyCount: true, - }).toArray(); - return { - departments: await Messages.findAllNumberOfTransferredRooms({ - start, - end, - departmentId, - options, - }).toArray(), - total: total.length ? total[0].total : 0, - }; -}; - -export const findAllNumberOfAbandonedRoomsAsync = async ({ start, end, departmentId, options = {} }) => { - if (!start || !end) { - throw new Error('"start" and "end" must be provided'); - } - const total = await (await LivechatRooms.findAllNumberOfAbandonedRooms({ start, end, departmentId, onlyCount: true })).toArray(); - return { - departments: await (await LivechatRooms.findAllNumberOfAbandonedRooms({ start, end, departmentId, options })).toArray(), - total: total.length ? total[0].total : 0, - }; -}; - -export const findPercentageOfAbandonedRoomsAsync = async ({ start, end, departmentId, options = {} }) => { - if (!start || !end) { - throw new Error('"start" and "end" must be provided'); - } - const total = await ( - await LivechatRooms.findPercentageOfAbandonedRooms({ - start, - end, - departmentId, - onlyCount: true, - }) - ).toArray(); - return { - departments: await (await LivechatRooms.findPercentageOfAbandonedRooms({ start, end, departmentId, options })).toArray(), - total: total.length ? total[0].total : 0, - }; -}; diff --git a/apps/meteor/app/livechat/server/lib/analytics/departments.ts b/apps/meteor/app/livechat/server/lib/analytics/departments.ts new file mode 100644 index 000000000000..6d44752f16cf --- /dev/null +++ b/apps/meteor/app/livechat/server/lib/analytics/departments.ts @@ -0,0 +1,165 @@ +import { LivechatRooms, Messages } from '@rocket.chat/models'; + +type Params = { + start: Date; + end: Date; + options?: any; + departmentId?: string; +}; + +export const findAllRoomsAsync = async ({ start, end, answered, departmentId, options = {} }: Params & { answered?: boolean }) => { + if (!start || !end) { + throw new Error('"start" and "end" must be provided'); + } + const total = await LivechatRooms.findAllRooms({ + start, + answered, + end, + departmentId, + onlyCount: true, + }).toArray(); + return { + departments: await LivechatRooms.findAllRooms({ + start, + answered, + end, + departmentId, + options, + }).toArray(), + total: total.length ? total[0].total : 0, + }; +}; + +export const findAllAverageOfChatDurationTimeAsync = async ({ start, end, departmentId, options = {} }: Params) => { + if (!start || !end) { + throw new Error('"start" and "end" must be provided'); + } + const total = await LivechatRooms.findAllAverageOfChatDurationTime({ + start, + end, + departmentId, + onlyCount: true, + }).toArray(); + return { + departments: await LivechatRooms.findAllAverageOfChatDurationTime({ + start, + end, + departmentId, + options, + }).toArray(), + total: total.length ? total[0].total : 0, + }; +}; + +export const findAllAverageServiceTimeAsync = async ({ start, end, departmentId, options = {} }: Params) => { + if (!start || !end) { + throw new Error('"start" and "end" must be provided'); + } + const total = await LivechatRooms.findAllAverageOfServiceTime({ + start, + end, + departmentId, + onlyCount: true, + }).toArray(); + return { + departments: await LivechatRooms.findAllAverageOfServiceTime({ + start, + end, + departmentId, + options, + }).toArray(), + total: total.length ? total[0].total : 0, + }; +}; + +export const findAllServiceTimeAsync = async ({ start, end, departmentId, options = {} }: Params) => { + if (!start || !end) { + throw new Error('"start" and "end" must be provided'); + } + const total = await LivechatRooms.findAllServiceTime({ + start, + end, + departmentId, + onlyCount: true, + }).toArray(); + return { + departments: await LivechatRooms.findAllServiceTime({ + start, + end, + departmentId, + options, + }).toArray(), + total: total.length ? total[0].total : 0, + }; +}; + +export const findAllAverageWaitingTimeAsync = async ({ start, end, departmentId, options = {} }: Params) => { + if (!start || !end) { + throw new Error('"start" and "end" must be provided'); + } + const total = await LivechatRooms.findAllAverageWaitingTime({ + start, + end, + departmentId, + onlyCount: true, + }).toArray(); + return { + departments: await LivechatRooms.findAllAverageWaitingTime({ + start, + end, + departmentId, + options, + }).toArray(), + total: total.length ? total[0].total : 0, + }; +}; + +export const findAllNumberOfTransferredRoomsAsync = async ({ start, end, departmentId, options = {} }: Params) => { + if (!start || !end) { + throw new Error('"start" and "end" must be provided'); + } + const total = await Messages.findAllNumberOfTransferredRooms({ + start, + end, + departmentId, + onlyCount: true, + }).toArray(); + return { + departments: await Messages.findAllNumberOfTransferredRooms({ + start, + end, + departmentId, + options, + }).toArray(), + total: total.length ? total[0].total : 0, + }; +}; + +export const findAllNumberOfAbandonedRoomsAsync = async ({ start, end, departmentId, options = {} }: Params) => { + if (!start || !end) { + throw new Error('"start" and "end" must be provided'); + } + const total = await (await LivechatRooms.findAllNumberOfAbandonedRooms({ start, end, departmentId, onlyCount: true })).toArray(); + return { + departments: await (await LivechatRooms.findAllNumberOfAbandonedRooms({ start, end, departmentId, options })).toArray(), + total: total.length ? total[0].total : 0, + }; +}; + +export const findPercentageOfAbandonedRoomsAsync = async ({ start, end, departmentId, options = {} }: Params) => { + if (!start || !end) { + throw new Error('"start" and "end" must be provided'); + } + const total = await ( + await LivechatRooms.findPercentageOfAbandonedRooms({ + start, + end, + departmentId, + onlyCount: true, + }) + ).toArray(); + return { + departments: await (await LivechatRooms.findPercentageOfAbandonedRooms({ start, end, departmentId, options })).toArray(), + total: total.length ? total[0].total : 0, + }; +}; diff --git a/apps/meteor/app/livechat/server/lib/stream/agentStatus.ts b/apps/meteor/app/livechat/server/lib/stream/agentStatus.ts index bbce5d16efb4..5ddd25e90bd2 100644 --- a/apps/meteor/app/livechat/server/lib/stream/agentStatus.ts +++ b/apps/meteor/app/livechat/server/lib/stream/agentStatus.ts @@ -1,7 +1,7 @@ import { Logger } from '@rocket.chat/logger'; import { settings } from '../../../../settings/server'; -import { Livechat } from '../Livechat'; +import { Livechat } from '../LivechatTyped'; const logger = new Logger('AgentStatusWatcher'); diff --git a/apps/meteor/app/livechat/server/livechat.ts b/apps/meteor/app/livechat/server/livechat.ts index 4a3847fecd9d..795deaba3452 100644 --- a/apps/meteor/app/livechat/server/livechat.ts +++ b/apps/meteor/app/livechat/server/livechat.ts @@ -1,5 +1,7 @@ import url from 'url'; +import jsdom from 'jsdom'; +import mem from 'mem'; import { WebApp } from 'meteor/webapp'; import { settings } from '../../settings/server'; @@ -7,6 +9,37 @@ import { addServerUrlToIndex } from '../lib/Assets'; const indexHtmlWithServerURL = addServerUrlToIndex((await Assets.getTextAsync('livechat/index.html')) || ''); +function parseExtraAttributes(widgetData: string): string { + const liveChatAdditionalScripts = settings.get('Livechat_AdditionalWidgetScripts'); + const additionalClass = settings.get('Livechat_WidgetLayoutClasses'); + + if (liveChatAdditionalScripts == null || additionalClass == null) { + return widgetData; + } + + const domParser = new jsdom.JSDOM(widgetData); + const doc = domParser.window.document; + const head = doc.querySelector('head'); + const body = doc.querySelector('body'); + + liveChatAdditionalScripts.split(',').forEach((script) => { + const scriptElement = doc.createElement('script'); + scriptElement.src = script; + body?.appendChild(scriptElement); + }); + + additionalClass.split(',').forEach((css) => { + const linkElement = doc.createElement('link'); + linkElement.rel = 'stylesheet'; + linkElement.href = css; + head?.appendChild(linkElement); + }); + + return doc.documentElement.innerHTML; +} + +const memoizedParseExtraAttributes = mem(parseExtraAttributes, { maxAge: process.env.TEST_MODE === 'true' ? 1 : 60000 }); + WebApp.connectHandlers.use('/livechat', (req, res, next) => { if (!req.url) { return next(); @@ -18,24 +51,21 @@ WebApp.connectHandlers.use('/livechat', (req, res, next) => { } res.setHeader('content-type', 'text/html; charset=utf-8'); - const domainWhiteListSetting = settings.get('Livechat_AllowedDomainsList'); let domainWhiteList = []; if (req.headers.referer && domainWhiteListSetting.trim()) { domainWhiteList = domainWhiteListSetting.split(',').map((domain) => domain.trim()); - const referer = url.parse(req.headers.referer); if (referer.host && !domainWhiteList.includes(referer.host)) { res.setHeader('Content-Security-Policy', "frame-ancestors 'none'"); return next(); } - res.setHeader('Content-Security-Policy', `frame-ancestors ${referer.protocol}//${referer.host}`); } else { // TODO need to remove inline scripts from this route to be able to enable CSP here as well res.removeHeader('Content-Security-Policy'); } - res.write(indexHtmlWithServerURL); + res.write(memoizedParseExtraAttributes(indexHtmlWithServerURL)); res.end(); }); diff --git a/apps/meteor/app/livechat/server/methods/addAgent.ts b/apps/meteor/app/livechat/server/methods/addAgent.ts index 4c7281d6b830..6160db590ece 100644 --- a/apps/meteor/app/livechat/server/methods/addAgent.ts +++ b/apps/meteor/app/livechat/server/methods/addAgent.ts @@ -4,7 +4,7 @@ import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; -import { Livechat } from '../lib/Livechat'; +import { Livechat } from '../lib/LivechatTyped'; declare module '@rocket.chat/ui-contexts' { // eslint-disable-next-line @typescript-eslint/naming-convention diff --git a/apps/meteor/app/livechat/server/methods/addManager.ts b/apps/meteor/app/livechat/server/methods/addManager.ts index f3078d8ec73d..347c4f07d63f 100644 --- a/apps/meteor/app/livechat/server/methods/addManager.ts +++ b/apps/meteor/app/livechat/server/methods/addManager.ts @@ -4,7 +4,7 @@ import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; -import { Livechat } from '../lib/Livechat'; +import { Livechat } from '../lib/LivechatTyped'; declare module '@rocket.chat/ui-contexts' { // eslint-disable-next-line @typescript-eslint/naming-convention diff --git a/apps/meteor/app/livechat/server/methods/changeLivechatStatus.ts b/apps/meteor/app/livechat/server/methods/changeLivechatStatus.ts index 76392fcdf721..8ccfcd5ec468 100644 --- a/apps/meteor/app/livechat/server/methods/changeLivechatStatus.ts +++ b/apps/meteor/app/livechat/server/methods/changeLivechatStatus.ts @@ -1,15 +1,16 @@ +import { ILivechatAgentStatus } from '@rocket.chat/core-typings'; import { Users } from '@rocket.chat/models'; import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; -import { Livechat } from '../lib/Livechat'; +import { Livechat as LivechatTS } from '../lib/LivechatTyped'; declare module '@rocket.chat/ui-contexts' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { - 'livechat:changeLivechatStatus'(params?: { status?: string; agentId?: string }): unknown; + 'livechat:changeLivechatStatus'(params?: { status?: ILivechatAgentStatus; agentId?: string }): unknown; } } @@ -44,7 +45,9 @@ Meteor.methods({ }); } - const newStatus = status || (agent.statusLivechat === 'available' ? 'not-available' : 'available'); + const newStatus: ILivechatAgentStatus = + status || + (agent.statusLivechat === ILivechatAgentStatus.AVAILABLE ? ILivechatAgentStatus.NOT_AVAILABLE : ILivechatAgentStatus.AVAILABLE); if (newStatus === agent.statusLivechat) { return; @@ -56,15 +59,15 @@ Meteor.methods({ method: 'livechat:changeLivechatStatus', }); } - return Livechat.setUserStatusLivechat(agentId, newStatus); + return LivechatTS.setUserStatusLivechat(agentId, newStatus); } - if (!(await Livechat.allowAgentChangeServiceStatus(newStatus, agentId))) { + if (!(await LivechatTS.allowAgentChangeServiceStatus(newStatus, agentId))) { throw new Meteor.Error('error-business-hours-are-closed', 'Not allowed', { method: 'livechat:changeLivechatStatus', }); } - return Livechat.setUserStatusLivechat(agentId, newStatus); + return LivechatTS.setUserStatusLivechat(agentId, newStatus); }, }); diff --git a/apps/meteor/app/livechat/server/methods/getAgentOverviewData.ts b/apps/meteor/app/livechat/server/methods/getAgentOverviewData.ts index 9cd5de75a0f3..b5ea8dafe92c 100644 --- a/apps/meteor/app/livechat/server/methods/getAgentOverviewData.ts +++ b/apps/meteor/app/livechat/server/methods/getAgentOverviewData.ts @@ -1,18 +1,16 @@ +import type { ConversationData } from '@rocket.chat/core-services'; +import { OmnichannelAnalytics } from '@rocket.chat/core-services'; import { Users } from '@rocket.chat/models'; -import type { ServerMethods, TranslationKey } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; -import { Livechat } from '../lib/Livechat'; declare module '@rocket.chat/ui-contexts' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { - 'livechat:getAgentOverviewData'(options: { chartOptions: { name: string } }): { - head: { name: TranslationKey }[]; - data: { name: string; value: number | string }[]; - }; + 'livechat:getAgentOverviewData'(options: { chartOptions: { name: string } }): ConversationData | void; } } @@ -28,11 +26,10 @@ Meteor.methods({ } if (!options.chartOptions?.name) { - Livechat.logger.warn('Incorrect analytics options'); return; } const user = await Users.findOneById(uid, { projection: { _id: 1, utcOffset: 1 } }); - return Livechat.Analytics.getAgentOverviewData({ ...options, utcOffset: user?.utcOffset || 0 }); + return OmnichannelAnalytics.getAgentOverviewData({ ...options, utcOffset: user?.utcOffset || 0 }); }, }); diff --git a/apps/meteor/app/livechat/server/methods/getAnalyticsChartData.ts b/apps/meteor/app/livechat/server/methods/getAnalyticsChartData.ts index 1250985cd2ef..85c8e033b8f5 100644 --- a/apps/meteor/app/livechat/server/methods/getAnalyticsChartData.ts +++ b/apps/meteor/app/livechat/server/methods/getAnalyticsChartData.ts @@ -1,20 +1,15 @@ +import type { ChartDataResult } from '@rocket.chat/core-services'; +import { OmnichannelAnalytics } from '@rocket.chat/core-services'; import { Users } from '@rocket.chat/models'; import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; -import { Livechat } from '../lib/Livechat'; declare module '@rocket.chat/ui-contexts' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { - 'livechat:getAnalyticsChartData'(options: { chartOptions: { name: string } }): - | { - chartLabel: string; - dataLabels: string[]; - dataPoints: number[]; - } - | undefined; + 'livechat:getAnalyticsChartData'(options: { chartOptions: { name: string } }): ChartDataResult | void; } } @@ -28,12 +23,15 @@ Meteor.methods({ } if (!options.chartOptions?.name) { - Livechat.logger.warn('Incorrect chart options'); return; } const user = await Users.findOneById(userId, { projection: { _id: 1, utcOffset: 1 } }); - return Livechat.Analytics.getAnalyticsChartData({ ...options, utcOffset: user?.utcOffset }); + if (!user) { + return; + } + + return OmnichannelAnalytics.getAnalyticsChartData({ ...options, utcOffset: user?.utcOffset }); }, }); diff --git a/apps/meteor/app/livechat/server/methods/getAnalyticsOverviewData.ts b/apps/meteor/app/livechat/server/methods/getAnalyticsOverviewData.ts index 76b7f276d671..c9bb3d163457 100644 --- a/apps/meteor/app/livechat/server/methods/getAnalyticsOverviewData.ts +++ b/apps/meteor/app/livechat/server/methods/getAnalyticsOverviewData.ts @@ -1,19 +1,17 @@ +import type { AnalyticsOverviewDataResult } from '@rocket.chat/core-services'; +import { OmnichannelAnalytics } from '@rocket.chat/core-services'; import { Users } from '@rocket.chat/models'; -import type { ServerMethods, TranslationKey } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; import { settings } from '../../../settings/server'; -import { Livechat } from '../lib/Livechat'; declare module '@rocket.chat/ui-contexts' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { - 'livechat:getAnalyticsOverviewData'(options: { analyticsOptions: { name: string } }): { - title: TranslationKey; - value: string; - }[]; + 'livechat:getAnalyticsOverviewData'(options: { analyticsOptions: { name: string } }): AnalyticsOverviewDataResult[] | void; } } @@ -28,14 +26,13 @@ Meteor.methods({ } if (!options.analyticsOptions?.name) { - Livechat.logger.error('Incorrect analytics options'); return; } const user = await Users.findOneById(uid, { projection: { _id: 1, utcOffset: 1, language: 1 } }); const language = user?.language || settings.get('Language') || 'en'; - return Livechat.Analytics.getAnalyticsOverviewData({ + return OmnichannelAnalytics.getAnalyticsOverviewData({ ...options, utcOffset: user?.utcOffset || 0, language, diff --git a/apps/meteor/app/livechat/server/methods/pageVisited.ts b/apps/meteor/app/livechat/server/methods/pageVisited.ts index 91cfb4afeef8..c226a91de430 100644 --- a/apps/meteor/app/livechat/server/methods/pageVisited.ts +++ b/apps/meteor/app/livechat/server/methods/pageVisited.ts @@ -2,12 +2,12 @@ import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; -import { Livechat } from '../lib/Livechat'; +import { Livechat } from '../lib/LivechatTyped'; declare module '@rocket.chat/ui-contexts' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { - 'livechat:pageVisited'(token: string, room: string, pageInfo: { title: string; location: string }): void; + 'livechat:pageVisited'(token: string, room: string, pageInfo: { title: string; location: { href: string }; change: string }): void; } } diff --git a/apps/meteor/app/livechat/server/methods/registerGuest.ts b/apps/meteor/app/livechat/server/methods/registerGuest.ts index e35b2693400d..01f720b85a4d 100644 --- a/apps/meteor/app/livechat/server/methods/registerGuest.ts +++ b/apps/meteor/app/livechat/server/methods/registerGuest.ts @@ -5,7 +5,6 @@ import { Meteor } from 'meteor/meteor'; import { callbacks } from '../../../../lib/callbacks'; import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; -import { Livechat } from '../lib/Livechat'; import { Livechat as LivechatTyped } from '../lib/LivechatTyped'; declare module '@rocket.chat/ui-contexts' { @@ -58,10 +57,23 @@ Meteor.methods({ }, }); + if (!visitor) { + throw new Meteor.Error('error-invalid-visitor', 'Invalid visitor', { method: 'livechat:registerGuest' }); + } + const extraQuery = await callbacks.run('livechat.applyRoomRestrictions', {}); // If it's updating an existing visitor, it must also update the roomInfo const rooms: IRoom[] = await LivechatRooms.findOpenByVisitorToken(token, {}, extraQuery).toArray(); - await Promise.all(rooms.map((room) => Livechat.saveRoomInfo(room, visitor))); + await Promise.all( + rooms.map((room) => + LivechatTyped.saveRoomInfo(room, { + _id: visitor._id, + name: visitor.name, + phone: visitor.phone?.[0]?.phoneNumber, + livechatData: visitor.livechatData as { [k: string]: string }, + }), + ), + ); if (customFields && customFields instanceof Array) { for await (const customField of customFields) { diff --git a/apps/meteor/app/livechat/server/methods/removeAgent.ts b/apps/meteor/app/livechat/server/methods/removeAgent.ts index e49c3a21b8e2..643ae696ada0 100644 --- a/apps/meteor/app/livechat/server/methods/removeAgent.ts +++ b/apps/meteor/app/livechat/server/methods/removeAgent.ts @@ -3,7 +3,7 @@ import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; -import { Livechat } from '../lib/Livechat'; +import { Livechat } from '../lib/LivechatTyped'; declare module '@rocket.chat/ui-contexts' { // eslint-disable-next-line @typescript-eslint/naming-convention diff --git a/apps/meteor/app/livechat/server/methods/removeAllClosedRooms.ts b/apps/meteor/app/livechat/server/methods/removeAllClosedRooms.ts index 149cd0a5c5c9..9be699ae05ed 100644 --- a/apps/meteor/app/livechat/server/methods/removeAllClosedRooms.ts +++ b/apps/meteor/app/livechat/server/methods/removeAllClosedRooms.ts @@ -1,4 +1,5 @@ import type { IOmnichannelRoom } from '@rocket.chat/core-typings'; +import { Logger } from '@rocket.chat/logger'; import { LivechatRooms } from '@rocket.chat/models'; import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; @@ -16,6 +17,7 @@ declare module '@rocket.chat/ui-contexts' { Meteor.methods({ async 'livechat:removeAllClosedRooms'(departmentIds) { + const logger = new Logger('livechat:removeAllClosedRooms'); const user = Meteor.userId(); if (!user || !(await hasPermissionAsync(user, 'remove-closed-livechat-rooms'))) { @@ -25,7 +27,7 @@ Meteor.methods({ } // These are not debug logs since we want to know when the action is performed - Livechat.logger.info(`User ${Meteor.userId()} is removing all closed rooms`); + logger.info(`User ${Meteor.userId()} is removing all closed rooms`); const extraQuery = await callbacks.run('livechat.applyRoomRestrictions', {}); const promises: Promise[] = []; @@ -34,7 +36,7 @@ Meteor.methods({ }); await Promise.all(promises); - Livechat.logger.info(`User ${Meteor.userId()} removed ${promises.length} closed rooms`); + logger.info(`User ${Meteor.userId()} removed ${promises.length} closed rooms`); return promises.length; }, }); diff --git a/apps/meteor/app/livechat/server/methods/removeManager.ts b/apps/meteor/app/livechat/server/methods/removeManager.ts index 758bf8130e7f..4c003ff922bc 100644 --- a/apps/meteor/app/livechat/server/methods/removeManager.ts +++ b/apps/meteor/app/livechat/server/methods/removeManager.ts @@ -3,7 +3,7 @@ import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; -import { Livechat } from '../lib/Livechat'; +import { Livechat } from '../lib/LivechatTyped'; declare module '@rocket.chat/ui-contexts' { // eslint-disable-next-line @typescript-eslint/naming-convention diff --git a/apps/meteor/app/livechat/server/methods/requestTranscript.ts b/apps/meteor/app/livechat/server/methods/requestTranscript.ts index 02ac65a48173..5abf6a3b72e3 100644 --- a/apps/meteor/app/livechat/server/methods/requestTranscript.ts +++ b/apps/meteor/app/livechat/server/methods/requestTranscript.ts @@ -5,7 +5,7 @@ import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; -import { Livechat } from '../lib/Livechat'; +import { Livechat } from '../lib/LivechatTyped'; declare module '@rocket.chat/ui-contexts' { // eslint-disable-next-line @typescript-eslint/naming-convention @@ -32,6 +32,12 @@ Meteor.methods({ projection: { _id: 1, username: 1, name: 1, utcOffset: 1 }, }); + if (!user) { + throw new Meteor.Error('error-invalid-user', 'Invalid user', { + method: 'livechat:requestTranscript', + }); + } + await Livechat.requestTranscript({ rid, email, subject, user }); return true; diff --git a/apps/meteor/app/livechat/server/methods/returnAsInquiry.ts b/apps/meteor/app/livechat/server/methods/returnAsInquiry.ts index 57a2b0afa3d5..38b58b9d2d42 100644 --- a/apps/meteor/app/livechat/server/methods/returnAsInquiry.ts +++ b/apps/meteor/app/livechat/server/methods/returnAsInquiry.ts @@ -1,10 +1,11 @@ +import { Omnichannel } from '@rocket.chat/core-services'; import type { ILivechatDepartment, IRoom } from '@rocket.chat/core-typings'; import { LivechatRooms } from '@rocket.chat/models'; import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; -import { Livechat } from '../lib/Livechat'; +import { Livechat } from '../lib/LivechatTyped'; declare module '@rocket.chat/ui-contexts' { // eslint-disable-next-line @typescript-eslint/naming-convention @@ -29,10 +30,14 @@ Meteor.methods({ }); } + if (!(await Omnichannel.isWithinMACLimit(room))) { + throw new Meteor.Error('error-mac-limit-reached', 'MAC limit reached', { method: 'livechat:returnAsInquiry' }); + } + if (!room.open) { throw new Meteor.Error('room-closed', 'Room closed', { method: 'livechat:returnAsInquiry' }); } - return Livechat.returnRoomAsInquiry(rid, departmentId); + return Livechat.returnRoomAsInquiry(room, departmentId); }, }); diff --git a/apps/meteor/app/livechat/server/methods/saveDepartment.ts b/apps/meteor/app/livechat/server/methods/saveDepartment.ts index dd83a294cb0e..45b3b2ec2168 100644 --- a/apps/meteor/app/livechat/server/methods/saveDepartment.ts +++ b/apps/meteor/app/livechat/server/methods/saveDepartment.ts @@ -21,6 +21,7 @@ declare module '@rocket.chat/ui-contexts' { chatClosingTags?: string[]; fallbackForwardDepartment?: string; departmentsAllowedToForward?: string[]; + allowReceiveForwardOffline?: boolean; }, departmentAgents?: | { diff --git a/apps/meteor/app/livechat/server/methods/saveDepartmentAgents.ts b/apps/meteor/app/livechat/server/methods/saveDepartmentAgents.ts index edc15f940322..73a471869926 100644 --- a/apps/meteor/app/livechat/server/methods/saveDepartmentAgents.ts +++ b/apps/meteor/app/livechat/server/methods/saveDepartmentAgents.ts @@ -1,20 +1,17 @@ +import type { ILivechatDepartmentAgents } from '@rocket.chat/core-typings'; import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; -import { Livechat } from '../lib/Livechat'; +import { Livechat } from '../lib/LivechatTyped'; declare module '@rocket.chat/ui-contexts' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:saveDepartmentAgents'( _id: string, - departmentAgents: { - agentId: string; - count?: number; - order?: number; - }[], + departmentAgents: Pick[], ): boolean; } } diff --git a/apps/meteor/app/livechat/server/methods/saveInfo.ts b/apps/meteor/app/livechat/server/methods/saveInfo.ts index 66674376407b..a057706fdc23 100644 --- a/apps/meteor/app/livechat/server/methods/saveInfo.ts +++ b/apps/meteor/app/livechat/server/methods/saveInfo.ts @@ -7,7 +7,7 @@ import { Meteor } from 'meteor/meteor'; import { callbacks } from '../../../../lib/callbacks'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; -import { Livechat } from '../lib/Livechat'; +import { Livechat as LivechatTyped } from '../lib/LivechatTyped'; declare module '@rocket.chat/ui-contexts' { // eslint-disable-next-line @typescript-eslint/naming-convention @@ -77,7 +77,9 @@ Meteor.methods({ delete guestData.phone; } - await Promise.allSettled([Livechat.saveGuest(guestData), Livechat.saveRoomInfo(roomData)]); + // Since the endpoint is going to be deprecated, we can live with this for a while + // @ts-expect-error - type is right, but `check` converts it to something else + await Promise.allSettled([LivechatTyped.saveGuest(guestData as any, userId), LivechatTyped.saveRoomInfo(roomData)]); const user = await Users.findOne({ _id: userId }, { projection: { _id: 1, username: 1 } }); diff --git a/apps/meteor/app/livechat/server/methods/sendFileLivechatMessage.ts b/apps/meteor/app/livechat/server/methods/sendFileLivechatMessage.ts index 7d64763cd634..15577abd76e3 100644 --- a/apps/meteor/app/livechat/server/methods/sendFileLivechatMessage.ts +++ b/apps/meteor/app/livechat/server/methods/sendFileLivechatMessage.ts @@ -1,5 +1,5 @@ import type { - MessageAttachment, + FileAttachmentProps, ImageAttachmentProps, AudioAttachmentProps, VideoAttachmentProps, @@ -56,7 +56,7 @@ export const sendFileLivechatMessage = async ({ roomId, visitorToken, file, msgD const fileUrl = file.name && FileUpload.getPath(`${file._id}/${encodeURI(file.name)}`); - const attachment: MessageAttachment = { + const attachment: Partial = { title: file.name, type: 'file', description: file.description, diff --git a/apps/meteor/app/livechat/server/methods/sendMessageLivechat.ts b/apps/meteor/app/livechat/server/methods/sendMessageLivechat.ts index c7d412ea4a06..516a9bc5081f 100644 --- a/apps/meteor/app/livechat/server/methods/sendMessageLivechat.ts +++ b/apps/meteor/app/livechat/server/methods/sendMessageLivechat.ts @@ -1,36 +1,12 @@ import { OmnichannelSourceType } from '@rocket.chat/core-typings'; -import type { MessageAttachment } from '@rocket.chat/core-typings'; import { LivechatVisitors } from '@rocket.chat/models'; import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Match, check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { settings } from '../../../settings/server'; -import { Livechat } from '../lib/Livechat'; - -interface ILivechatMessage { - token: string; - _id: string; - rid: string; - msg: string; - file?: { - _id: string; - name?: string; - type?: string; - size?: number; - description?: string; - identify?: { size: { width: number; height: number } }; - }; - files?: { - _id: string; - name?: string; - type?: string; - size?: number; - description?: string; - identify?: { size: { width: number; height: number } }; - }[]; - attachments?: MessageAttachment[]; -} +import { Livechat } from '../lib/LivechatTyped'; +import type { ILivechatMessage } from '../lib/LivechatTyped'; interface ILivechatMessageAgent { agentId: string; diff --git a/apps/meteor/app/livechat/server/methods/sendOfflineMessage.ts b/apps/meteor/app/livechat/server/methods/sendOfflineMessage.ts index 9a475de5e32d..c3b5537f31be 100644 --- a/apps/meteor/app/livechat/server/methods/sendOfflineMessage.ts +++ b/apps/meteor/app/livechat/server/methods/sendOfflineMessage.ts @@ -4,7 +4,7 @@ import { DDPRateLimiter } from 'meteor/ddp-rate-limiter'; import { Meteor } from 'meteor/meteor'; import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; -import { Livechat } from '../lib/Livechat'; +import { Livechat } from '../lib/LivechatTyped'; declare module '@rocket.chat/ui-contexts' { // eslint-disable-next-line @typescript-eslint/naming-convention diff --git a/apps/meteor/app/livechat/server/methods/sendTranscript.ts b/apps/meteor/app/livechat/server/methods/sendTranscript.ts index 7456397de7b4..366a73c8bb0a 100644 --- a/apps/meteor/app/livechat/server/methods/sendTranscript.ts +++ b/apps/meteor/app/livechat/server/methods/sendTranscript.ts @@ -1,10 +1,11 @@ -import { Users } from '@rocket.chat/models'; +import { Omnichannel } from '@rocket.chat/core-services'; +import { LivechatRooms, Users } from '@rocket.chat/models'; import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; -import { DDPRateLimiter } from 'meteor/ddp-rate-limiter'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; +import { RateLimiter } from '../../../lib/server'; import { Livechat } from '../lib/LivechatTyped'; declare module '@rocket.chat/ui-contexts' { @@ -29,18 +30,21 @@ Meteor.methods({ const user = await Users.findOneById(uid, { projection: { _id: 1, username: 1, name: 1, utcOffset: 1 }, }); + + const room = await LivechatRooms.findOneById(rid, { projection: { activity: 1 } }); + if (!room) { + throw new Meteor.Error('error-invalid-room', 'Invalid room', { method: 'livechat:sendTranscript' }); + } + if (!(await Omnichannel.isWithinMACLimit(room))) { + throw new Meteor.Error('error-mac-limit-reached', 'MAC limit reached', { method: 'livechat:sendTranscript' }); + } + return Livechat.sendTranscript({ token, rid, email, subject, user }); }, }); -DDPRateLimiter.addRule( - { - type: 'method', - name: 'livechat:sendTranscript', - connectionId() { - return true; - }, +RateLimiter.limitMethod('livechat:sendTranscript', 1, 5000, { + connectionId() { + return true; }, - 1, - 5000, -); +}); diff --git a/apps/meteor/app/livechat/server/methods/setDepartmentForVisitor.ts b/apps/meteor/app/livechat/server/methods/setDepartmentForVisitor.ts index 61e6b21267da..a14933ed8d47 100644 --- a/apps/meteor/app/livechat/server/methods/setDepartmentForVisitor.ts +++ b/apps/meteor/app/livechat/server/methods/setDepartmentForVisitor.ts @@ -5,7 +5,7 @@ import { Meteor } from 'meteor/meteor'; import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; import { normalizeTransferredByData } from '../lib/Helper'; -import { Livechat } from '../lib/Livechat'; +import { Livechat } from '../lib/LivechatTyped'; declare module '@rocket.chat/ui-contexts' { // eslint-disable-next-line @typescript-eslint/naming-convention diff --git a/apps/meteor/app/livechat/server/methods/setUpConnection.ts b/apps/meteor/app/livechat/server/methods/setUpConnection.ts index 658f6249c9b1..788b2384c4d3 100644 --- a/apps/meteor/app/livechat/server/methods/setUpConnection.ts +++ b/apps/meteor/app/livechat/server/methods/setUpConnection.ts @@ -1,8 +1,9 @@ +import { UserStatus } from '@rocket.chat/core-typings'; import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; -import { Livechat } from '../lib/Livechat'; +import { Livechat } from '../lib/LivechatTyped'; declare module '@rocket.chat/ui-contexts' { // eslint-disable-next-line @typescript-eslint/naming-convention @@ -32,7 +33,7 @@ Meteor.methods({ if (this.connection && !this.connection.livechatToken) { this.connection.livechatToken = token; this.connection.onClose(async () => { - await Livechat.notifyGuestStatusChanged(token, 'offline'); + await Livechat.notifyGuestStatusChanged(token, UserStatus.OFFLINE); }); } }, diff --git a/apps/meteor/app/livechat/server/methods/takeInquiry.ts b/apps/meteor/app/livechat/server/methods/takeInquiry.ts index 17007d7da8c2..3433b4a33ae8 100644 --- a/apps/meteor/app/livechat/server/methods/takeInquiry.ts +++ b/apps/meteor/app/livechat/server/methods/takeInquiry.ts @@ -1,4 +1,5 @@ -import { LivechatInquiry, Users } from '@rocket.chat/models'; +import { Omnichannel } from '@rocket.chat/core-services'; +import { LivechatInquiry, LivechatRooms, Users } from '@rocket.chat/models'; import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; @@ -48,6 +49,11 @@ export const takeInquiry = async ( }); } + const room = await LivechatRooms.findOneById(inquiry.rid); + if (!room || !(await Omnichannel.isWithinMACLimit(room))) { + throw new Error('error-mac-limit-reached'); + } + const agent = { agentId: user._id, username: user.username, diff --git a/apps/meteor/app/livechat/server/methods/transfer.ts b/apps/meteor/app/livechat/server/methods/transfer.ts index 3817b10bf42b..64a32c24638c 100644 --- a/apps/meteor/app/livechat/server/methods/transfer.ts +++ b/apps/meteor/app/livechat/server/methods/transfer.ts @@ -1,3 +1,4 @@ +import { Omnichannel } from '@rocket.chat/core-services'; import type { IUser } from '@rocket.chat/core-typings'; import { LivechatVisitors, LivechatRooms, Subscriptions, Users } from '@rocket.chat/models'; import type { ServerMethods } from '@rocket.chat/ui-contexts'; @@ -7,7 +8,7 @@ import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; import { normalizeTransferredByData } from '../lib/Helper'; -import { Livechat } from '../lib/Livechat'; +import { Livechat } from '../lib/LivechatTyped'; declare module '@rocket.chat/ui-contexts' { // eslint-disable-next-line @typescript-eslint/naming-convention @@ -49,6 +50,10 @@ Meteor.methods({ throw new Meteor.Error('room-closed', 'Room closed', { method: 'livechat:transfer' }); } + if (!(await Omnichannel.isWithinMACLimit(room))) { + throw new Meteor.Error('error-mac-limit-reached', 'MAC limit reached', { method: 'livechat:transfer' }); + } + const subscription = await Subscriptions.findOneByRoomIdAndUserId(room._id, uid, { projection: { _id: 1 }, }); @@ -60,6 +65,10 @@ Meteor.methods({ const guest = await LivechatVisitors.findOneEnabledById(room.v?._id); + if (!guest) { + throw new Meteor.Error('error-invalid-visitor', 'Invalid visitor', { method: 'livechat:transfer' }); + } + const user = await Meteor.userAsync(); if (!user) { diff --git a/apps/meteor/app/livechat/server/startup.ts b/apps/meteor/app/livechat/server/startup.ts index f9fce509e39a..aba8578dcea9 100644 --- a/apps/meteor/app/livechat/server/startup.ts +++ b/apps/meteor/app/livechat/server/startup.ts @@ -1,5 +1,6 @@ import type { IUser } from '@rocket.chat/core-typings'; -import { isOmnichannelRoom } from '@rocket.chat/core-typings'; +import { ILivechatAgentStatus, isOmnichannelRoom } from '@rocket.chat/core-typings'; +import { Logger } from '@rocket.chat/logger'; import { LivechatRooms } from '@rocket.chat/models'; import { Accounts } from 'meteor/accounts-base'; import { Meteor } from 'meteor/meteor'; @@ -12,11 +13,13 @@ import { hasPermissionAsync } from '../../authorization/server/functions/hasPerm import { settings } from '../../settings/server'; import { businessHourManager } from './business-hour'; import { createDefaultBusinessHourIfNotExists } from './business-hour/Helper'; -import { Livechat } from './lib/Livechat'; +import { Livechat as LivechatTyped } from './lib/LivechatTyped'; import { RoutingManager } from './lib/RoutingManager'; import { LivechatAgentActivityMonitor } from './statistics/LivechatAgentActivityMonitor'; import './roomAccessValidator.internalService'; +const logger = new Logger('LivechatStartup'); + Meteor.startup(async () => { roomCoordinator.setRoomFind('l', (_id) => LivechatRooms.findOneById(_id)); @@ -62,7 +65,7 @@ Meteor.startup(async () => { await createDefaultBusinessHourIfNotExists(); settings.watch('Livechat_enable_business_hours', async (value) => { - Livechat.logger.info(`Changing business hour type to ${value}`); + logger.debug(`Starting business hour manager ${value}`); if (value) { await businessHourManager.startManager(); return; @@ -70,8 +73,8 @@ Meteor.startup(async () => { await businessHourManager.stopManager(); }); - settings.watch('Livechat_Routing_Method', (value) => { - void RoutingManager.setMethodNameAndStartQueue(value); + settings.watch('Livechat_Routing_Method', () => { + void RoutingManager.startQueue(); }); // Remove when accounts.onLogout is async @@ -79,6 +82,11 @@ Meteor.startup(async () => { ({ user }: { user: IUser }) => user?.roles?.includes('livechat-agent') && !user?.roles?.includes('bot') && - void Livechat.setUserStatusLivechatIf(user._id, 'not-available', {}, { livechatStatusSystemModified: true }).catch(), + void LivechatTyped.setUserStatusLivechatIf( + user._id, + ILivechatAgentStatus.NOT_AVAILABLE, + {}, + { livechatStatusSystemModified: true }, + ).catch(), ); }); diff --git a/apps/meteor/app/livechat/server/statistics/LivechatAgentActivityMonitor.ts b/apps/meteor/app/livechat/server/statistics/LivechatAgentActivityMonitor.ts index 76e9e04f1a24..b82dcc30411d 100644 --- a/apps/meteor/app/livechat/server/statistics/LivechatAgentActivityMonitor.ts +++ b/apps/meteor/app/livechat/server/statistics/LivechatAgentActivityMonitor.ts @@ -52,21 +52,19 @@ export class LivechatAgentActivityMonitor { // TODO use service event socket.connected instead Meteor.onConnection((connection: unknown) => this._handleMeteorConnection(connection as ISocketConnection)); callbacks.add('livechat.agentStatusChanged', this._handleAgentStatusChanged); - callbacks.add('livechat.setUserStatusLivechat', async (...args) => { + callbacks.add('livechat.setUserStatusLivechat', (...args) => { return this._handleUserStatusLivechatChanged(...args); }); this._started = true; } async _startMonitoring(): Promise { - await this.scheduler.add(this._name, '0 0 * * *', async () => this._updateActiveSessions()); + await this.scheduler.add(this._name, '0 0 * * *', () => this._updateActiveSessions()); } async _updateActiveSessions(): Promise { - const openLivechatAgentSessions = await LivechatAgentActivity.findOpenSessions(); - if (!(await openLivechatAgentSessions.count())) { - return; - } + const openLivechatAgentSessions = LivechatAgentActivity.findOpenSessions(); + const today = moment(new Date()); const startedAt = new Date(today.year(), today.month(), today.date()); for await (const session of openLivechatAgentSessions) { @@ -74,15 +72,11 @@ export class LivechatAgentActivityMonitor { const stoppedAt = new Date(startDate.year(), startDate.month(), startDate.date(), 23, 59, 59); const data = { ...formatDate(startDate.toDate()), agentId: session.agentId }; const availableTime = moment(stoppedAt).diff(moment(new Date(session.lastStartedAt)), 'seconds'); - await LivechatAgentActivity.updateLastStoppedAt({ - ...data, - availableTime, - lastStoppedAt: stoppedAt, - }); - await LivechatAgentActivity.updateServiceHistory({ - ...data, - serviceHistory: { startedAt: session.lastStartedAt, stoppedAt }, - }); + + await Promise.all([ + LivechatAgentActivity.updateLastStoppedAt({ ...data, availableTime, lastStoppedAt: stoppedAt }), + LivechatAgentActivity.updateServiceHistory({ ...data, serviceHistory: { startedAt: session.lastStartedAt, stoppedAt } }), + ]); await this._createOrUpdateSession(session.agentId, startedAt); } } @@ -96,7 +90,9 @@ export class LivechatAgentActivityMonitor { if (!session) { return; } - const user = await Users.findOneById(session.userId); + const user = await Users.findOneById>(session.userId, { + projection: { _id: 1, status: 1, statusLivechat: 1 }, + }); if (user && user.status !== 'offline' && user.statusLivechat === 'available') { await this._createOrUpdateSession(user._id); } @@ -112,7 +108,7 @@ export class LivechatAgentActivityMonitor { return; } - const user = await Users.findOneById(userId); + const user = await Users.findOneById>(userId, { projection: { statusLivechat: 1 } }); if (!user || user.statusLivechat !== 'available') { return; } @@ -129,7 +125,7 @@ export class LivechatAgentActivityMonitor { return; } - const user = await Users.findOneById(userId); + const user = await Users.findOneById>(userId, { projection: { status: 1 } }); if (user && user.status === 'offline') { return; } @@ -158,16 +154,13 @@ export class LivechatAgentActivityMonitor { const stoppedAt = new Date(); const availableTime = moment(stoppedAt).diff(moment(new Date(livechatSession.lastStartedAt)), 'seconds'); - await LivechatAgentActivity.updateLastStoppedAt({ - agentId, - date, - availableTime, - lastStoppedAt: stoppedAt, - }); - await LivechatAgentActivity.updateServiceHistory({ - agentId, - date, - serviceHistory: { startedAt: livechatSession.lastStartedAt, stoppedAt }, - }); + await Promise.all([ + LivechatAgentActivity.updateLastStoppedAt({ agentId, date, availableTime, lastStoppedAt: stoppedAt }), + LivechatAgentActivity.updateServiceHistory({ + agentId, + date, + serviceHistory: { startedAt: livechatSession.lastStartedAt, stoppedAt }, + }), + ]); } } diff --git a/apps/meteor/app/mail-messages/server/functions/sendMail.ts b/apps/meteor/app/mail-messages/server/functions/sendMail.ts index ce57fc06b1c8..50435bc24812 100644 --- a/apps/meteor/app/mail-messages/server/functions/sendMail.ts +++ b/apps/meteor/app/mail-messages/server/functions/sendMail.ts @@ -36,33 +36,38 @@ export const sendMail = async function ({ userQuery = { $and: [userQuery, EJSON.parse(query)] }; } - const users = await Users.find(userQuery).toArray(); - if (dryrun) { - for await (const u of users) { - const user: Partial & Pick = u; - const email = `${user.name} <${user.emails?.[0].address}>`; - const html = placeholders.replace(body, { - unsubscribe: Meteor.absoluteUrl( - generatePath('mailer/unsubscribe/:_id/:createdAt', { - _id: user._id, - createdAt: user.createdAt?.getTime().toString() || '', - }), - ), - name: user.name, - email, - }); + const user = await Users.findOneByEmailAddress(from); - SystemLogger.debug(`Sending email to ${email}`); - await Mailer.send({ - to: email, - from, - subject, - html, + if (!user) { + throw new Meteor.Error('error-invalid-user', 'Invalid user', { + function: 'Mailer.sendMail', }); } + + const email = `${user.name} <${user.emails?.[0].address}>`; + const html = placeholders.replace(body, { + unsubscribe: Meteor.absoluteUrl( + generatePath('mailer/unsubscribe/:_id/:createdAt', { + _id: user._id, + createdAt: user.createdAt?.getTime().toString() || '', + }), + ), + name: user.name, + email, + }); + + SystemLogger.debug(`Sending email to ${email}`); + return Mailer.send({ + to: email, + from, + subject, + html, + }); } + const users = await Users.find(userQuery).toArray(); + for await (const u of users) { const user: Partial & Pick = u; if (user?.emails && Array.isArray(user.emails) && user.emails.length) { diff --git a/apps/meteor/app/mailer/server/api.ts b/apps/meteor/app/mailer/server/api.ts index b50fdfd26a2a..e562fc8e7b39 100644 --- a/apps/meteor/app/mailer/server/api.ts +++ b/apps/meteor/app/mailer/server/api.ts @@ -1,3 +1,4 @@ +import { AppEvents, Apps } from '@rocket.chat/apps'; import type { ISetting } from '@rocket.chat/core-typings'; import { Settings } from '@rocket.chat/models'; import { escapeHTML } from '@rocket.chat/string-helpers'; @@ -7,7 +8,6 @@ import { Meteor } from 'meteor/meteor'; import stripHtml from 'string-strip-html'; import _ from 'underscore'; -import { Apps } from '../../../ee/server/apps'; import { validateEmail } from '../../../lib/emailValidator'; import { strLeft, strRightBack } from '../../../lib/utils/stringUtils'; import { i18n } from '../../../server/lib/i18n'; @@ -170,7 +170,7 @@ export const sendNoWrap = async ({ const email = { to, from, replyTo, subject, html, text, headers }; - const eventResult = await Apps.triggerEvent('IPreEmailSent', { email }); + const eventResult = await Apps.self?.triggerEvent(AppEvents.IPreEmailSent, { email }); setImmediate(() => Email.sendAsync(eventResult || email).catch((e) => console.error(e))); }; diff --git a/apps/meteor/app/mentions/lib/MentionsParser.js b/apps/meteor/app/mentions/lib/MentionsParser.js deleted file mode 100644 index 87329ac9f120..000000000000 --- a/apps/meteor/app/mentions/lib/MentionsParser.js +++ /dev/null @@ -1,135 +0,0 @@ -import { escapeHTML } from '@rocket.chat/string-helpers'; - -const userTemplateDefault = ({ prefix, className, mention, title, label, type = 'username' }) => - `${prefix}${label}`; -const roomTemplateDefault = ({ prefix, reference, mention }) => - `${prefix}${`#${mention}`}`; -export class MentionsParser { - constructor({ pattern, useRealName, me, roomTemplate = roomTemplateDefault, userTemplate = userTemplateDefault }) { - this.pattern = pattern; - this.useRealName = useRealName; - this.me = me; - this.userTemplate = userTemplate; - this.roomTemplate = roomTemplate; - } - - set me(m) { - this._me = m; - } - - get me() { - return typeof this._me === 'function' ? this._me() : this._me; - } - - set pattern(p) { - this._pattern = p; - } - - get pattern() { - return typeof this._pattern === 'function' ? this._pattern() : this._pattern; - } - - set useRealName(s) { - this._useRealName = s; - } - - get useRealName() { - return typeof this._useRealName === 'function' ? this._useRealName() : this._useRealName; - } - - get userMentionRegex() { - return new RegExp(`(^|\\s|>)@(${this.pattern}(@(${this.pattern}))?(:([0-9a-zA-Z-_.]+))?)`, 'gm'); - } - - get channelMentionRegex() { - return new RegExp(`(^|\\s|>)#(${this.pattern}(@(${this.pattern}))?)`, 'gm'); - } - - replaceUsers = (msg, { mentions, temp }, me) => - msg.replace(this.userMentionRegex, (match, prefix, mention) => { - const classNames = ['mention-link']; - - if (mention === 'all') { - classNames.push('mention-link--all'); - classNames.push('mention-link--group'); - } else if (mention === 'here') { - classNames.push('mention-link--here'); - classNames.push('mention-link--group'); - } else if (mention === me) { - classNames.push('mention-link--me'); - classNames.push('mention-link--user'); - } else { - classNames.push('mention-link--user'); - } - - const className = classNames.join(' '); - - if (mention === 'all' || mention === 'here') { - return this.userTemplate({ prefix, className, mention, label: mention, type: 'group' }); - } - - const filterUser = ({ username, type }) => (!type || type === 'user') && username === mention; - const filterTeam = ({ name, type }) => type === 'team' && name === mention; - - const [mentionObj] = (mentions || []).filter((m) => filterUser(m) || filterTeam(m)); - - const label = temp - ? mention && escapeHTML(mention) - : mentionObj && escapeHTML(mentionObj.type === 'team' || this.useRealName ? mentionObj.name : mentionObj.username); - - if (!label) { - return match; - } - - return this.userTemplate({ - prefix, - className, - mention, - label, - type: mentionObj?.type === 'team' ? 'team' : 'username', - title: this.useRealName ? mention : label, - }); - }); - - replaceChannels = (msg, { temp, channels }) => - msg.replace(/'/g, "'").replace(this.channelMentionRegex, (match, prefix, mention) => { - if ( - !temp && - !( - channels && - channels.find((c) => { - return c.dname ? c.dname === mention : c.name === mention; - }) - ) - ) { - return match; - } - - const channel = - channels && - channels.find(({ name, dname }) => { - return dname ? dname === mention : name === mention; - }); - const reference = channel ? channel._id : mention; - return this.roomTemplate({ prefix, reference, channel, mention }); - }); - - getUserMentions(str) { - return (str.match(this.userMentionRegex) || []).map((match) => match.trim()); - } - - getChannelMentions(str) { - return (str.match(this.channelMentionRegex) || []).map((match) => match.trim()); - } - - parse(message) { - let msg = (message && message.html) || ''; - if (!msg.trim()) { - return message; - } - msg = this.replaceUsers(msg, message, this.me); - msg = this.replaceChannels(msg, message, this.me); - message.html = msg; - return message; - } -} diff --git a/apps/meteor/app/mentions/lib/MentionsParser.ts b/apps/meteor/app/mentions/lib/MentionsParser.ts new file mode 100644 index 000000000000..c4180eecf845 --- /dev/null +++ b/apps/meteor/app/mentions/lib/MentionsParser.ts @@ -0,0 +1,140 @@ +import type { IMessage } from '@rocket.chat/core-typings'; +import { escapeHTML } from '@rocket.chat/string-helpers'; + +export type MentionsParserArgs = { + pattern: () => string; + useRealName?: () => boolean; + me?: () => string; + roomTemplate?: (args: { prefix: string; reference: string; mention: string; channel?: any }) => string; + userTemplate?: (args: { prefix: string; className: string; mention: string; title?: string; label: string; type?: string }) => string; +}; + +const userTemplateDefault = ({ + prefix, + className, + mention, + title = '', + label, + type = 'username', +}: { + prefix: string; + className: string; + mention: string; + title?: string; + label?: string; + type?: string; +}) => `${prefix}${label}`; + +const roomTemplateDefault = ({ prefix, reference, mention }: { prefix: string; reference: string; mention: string }) => + `${prefix}${`#${mention}`}`; + +export class MentionsParser { + me: () => string; + + pattern: MentionsParserArgs['pattern']; + + userTemplate: (args: { prefix: string; className: string; mention: string; title?: string; label: string; type?: string }) => string; + + roomTemplate: (args: { prefix: string; reference: string; mention: string; channel?: any }) => string; + + useRealName: () => boolean; + + constructor({ pattern, useRealName, me, roomTemplate = roomTemplateDefault, userTemplate = userTemplateDefault }: MentionsParserArgs) { + this.pattern = pattern; + this.useRealName = useRealName || (() => false); + this.me = me || (() => ''); + this.userTemplate = userTemplate; + this.roomTemplate = roomTemplate; + } + + get userMentionRegex() { + return new RegExp(`(^|\\s|>)@(${this.pattern()}(@(${this.pattern()}))?(:([0-9a-zA-Z-_.]+))?)`, 'gm'); + } + + get channelMentionRegex() { + return new RegExp(`(^|\\s|>)#(${this.pattern()}(@(${this.pattern()}))?)`, 'gm'); + } + + replaceUsers = (msg: string, { mentions, temp }: IMessage, me: string) => + msg.replace(this.userMentionRegex, (match, prefix, mention) => { + const classNames = ['mention-link']; + + if (mention === 'all') { + classNames.push('mention-link--all'); + classNames.push('mention-link--group'); + } else if (mention === 'here') { + classNames.push('mention-link--here'); + classNames.push('mention-link--group'); + } else if (mention === me) { + classNames.push('mention-link--me'); + classNames.push('mention-link--user'); + } else { + classNames.push('mention-link--user'); + } + + const className = classNames.join(' '); + + if (mention === 'all' || mention === 'here') { + return this.userTemplate({ prefix, className, mention, label: mention, type: 'group' }); + } + + const filterUser = ({ username, type }: { username?: string; type?: string }) => (!type || type === 'user') && username === mention; + const filterTeam = ({ name, type }: { name?: string; type?: string }) => type === 'team' && name === mention; + + const [mentionObj] = (mentions || []).filter((m) => m && (filterUser(m) || filterTeam(m))); + + const label = temp + ? mention && escapeHTML(mention) + : mentionObj && escapeHTML((mentionObj.type === 'team' || this.useRealName() ? mentionObj.name : mentionObj.username) || ''); + + if (!label) { + return match; + } + + return this.userTemplate({ + prefix, + className, + mention, + label, + type: mentionObj?.type === 'team' ? 'team' : 'username', + title: this.useRealName() ? mention : label, + }); + }); + + replaceChannels = (msg: string, { temp, channels }: IMessage) => + msg.replace(/'/g, "'").replace(this.channelMentionRegex, (match, prefix, mention) => { + if ( + !temp && + !channels?.find((c) => { + return c.name === mention; + }) + ) { + return match; + } + + const channel = channels?.find(({ name }) => { + return name === mention; + }); + const reference = channel ? channel._id : mention; + return this.roomTemplate({ prefix, reference, channel, mention }); + }); + + getUserMentions(str: string) { + return (str.match(this.userMentionRegex) || []).map((match) => match.trim()); + } + + getChannelMentions(str: string) { + return (str.match(this.channelMentionRegex) || []).map((match) => match.trim()); + } + + parse(message: IMessage) { + let msg = message?.html || ''; + if (!msg.trim()) { + return message; + } + msg = this.replaceUsers(msg, message, this.me()); + msg = this.replaceChannels(msg, message); + message.html = msg; + return message; + } +} diff --git a/apps/meteor/app/mentions/server/Mentions.js b/apps/meteor/app/mentions/server/Mentions.js deleted file mode 100644 index 91518fd74855..000000000000 --- a/apps/meteor/app/mentions/server/Mentions.js +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Mentions is a named function that will process Mentions - * @param {Object} message - The message object - */ -import { MentionsParser } from '../lib/MentionsParser'; - -export default class MentionsServer extends MentionsParser { - constructor(args) { - super(args); - this.messageMaxAll = args.messageMaxAll; - this.getChannel = args.getChannel; - this.getChannels = args.getChannels; - this.getUsers = args.getUsers; - this.getUser = args.getUser; - this.getTotalChannelMembers = args.getTotalChannelMembers; - this.onMaxRoomMembersExceeded = args.onMaxRoomMembersExceeded || (() => {}); - } - - set getUsers(m) { - this._getUsers = m; - } - - get getUsers() { - return typeof this._getUsers === 'function' ? this._getUsers : async () => this._getUsers; - } - - set getChannels(m) { - this._getChannels = m; - } - - get getChannels() { - return typeof this._getChannels === 'function' ? this._getChannels : () => this._getChannels; - } - - set getChannel(m) { - this._getChannel = m; - } - - get getChannel() { - return typeof this._getChannel === 'function' ? this._getChannel : () => this._getChannel; - } - - set messageMaxAll(m) { - this._messageMaxAll = m; - } - - get messageMaxAll() { - return typeof this._messageMaxAll === 'function' ? this._messageMaxAll() : this._messageMaxAll; - } - - async getUsersByMentions({ msg, rid, u: sender }) { - let mentions = this.getUserMentions(msg); - const mentionsAll = []; - const userMentions = []; - - for await (const m of mentions) { - const mention = m.trim().substr(1); - if (mention !== 'all' && mention !== 'here') { - userMentions.push(mention); - continue; - } - if (this.messageMaxAll > 0 && (await this.getTotalChannelMembers(rid)) > this.messageMaxAll) { - await this.onMaxRoomMembersExceeded({ sender, rid }); - continue; - } - mentionsAll.push({ - _id: mention, - username: mention, - }); - } - mentions = userMentions.length ? await this.getUsers(userMentions) : []; - return [...mentionsAll, ...mentions]; - } - - async getChannelbyMentions({ msg }) { - const channels = this.getChannelMentions(msg); - return this.getChannels(channels.map((c) => c.trim().substr(1))); - } - - async execute(message) { - const mentionsAll = await this.getUsersByMentions(message); - const channels = await this.getChannelbyMentions(message); - - message.mentions = mentionsAll; - message.channels = channels; - - return message; - } -} diff --git a/apps/meteor/app/mentions/server/Mentions.ts b/apps/meteor/app/mentions/server/Mentions.ts new file mode 100644 index 000000000000..9eda56fea21c --- /dev/null +++ b/apps/meteor/app/mentions/server/Mentions.ts @@ -0,0 +1,84 @@ +/* + * Mentions is a named function that will process Mentions + * @param {Object} message - The message object + */ +import type { IMessage, IRoom, IUser } from '@rocket.chat/core-typings'; + +import { type MentionsParserArgs, MentionsParser } from '../lib/MentionsParser'; + +type MentionsServerArgs = MentionsParserArgs & { + messageMaxAll: () => number; + getChannels: (c: string[]) => Promise[]>; + getUsers: (u: string[]) => Promise<{ type: 'team' | 'user'; _id: string; username?: string; name?: string }[]>; + getUser: (u: string) => Promise; + getTotalChannelMembers: (rid: string) => Promise; + onMaxRoomMembersExceeded: ({ sender, rid }: { sender: IMessage['u']; rid: string }) => Promise; +}; + +export class MentionsServer extends MentionsParser { + messageMaxAll: MentionsServerArgs['messageMaxAll']; + + getChannels: MentionsServerArgs['getChannels']; + + getUsers: MentionsServerArgs['getUsers']; + + getUser: MentionsServerArgs['getUser']; + + getTotalChannelMembers: MentionsServerArgs['getTotalChannelMembers']; + + onMaxRoomMembersExceeded: MentionsServerArgs['onMaxRoomMembersExceeded']; + + constructor(args: MentionsServerArgs) { + super(args); + + this.messageMaxAll = args.messageMaxAll; + this.getChannels = args.getChannels; + this.getUsers = args.getUsers; + this.getUser = args.getUser; + this.getTotalChannelMembers = args.getTotalChannelMembers; + this.onMaxRoomMembersExceeded = + args.onMaxRoomMembersExceeded || + (() => { + /* do nothing */ + }); + } + + async getUsersByMentions({ msg, rid, u: sender }: Pick): Promise { + const mentions = this.getUserMentions(msg); + const mentionsAll: { _id: string; username: string }[] = []; + const userMentions = []; + + for await (const m of mentions) { + const mention = m.trim().substr(1); + if (mention !== 'all' && mention !== 'here') { + userMentions.push(mention); + continue; + } + if (this.messageMaxAll() > 0 && (await this.getTotalChannelMembers(rid)) > this.messageMaxAll()) { + await this.onMaxRoomMembersExceeded({ sender, rid }); + continue; + } + mentionsAll.push({ + _id: mention, + username: mention, + }); + } + + return [...mentionsAll, ...(userMentions.length ? await this.getUsers(userMentions) : [])]; + } + + async getChannelbyMentions({ msg }: Pick) { + const channels = this.getChannelMentions(msg); + return this.getChannels(channels.map((c) => c.trim().substr(1))); + } + + async execute(message: IMessage) { + const mentionsAll = await this.getUsersByMentions(message); + const channels = await this.getChannelbyMentions(message); + + message.mentions = mentionsAll; + message.channels = channels; + + return message; + } +} diff --git a/apps/meteor/app/mentions/server/getMentionedTeamMembers.ts b/apps/meteor/app/mentions/server/getMentionedTeamMembers.ts index b1355c90cb93..8c836e918a8a 100644 --- a/apps/meteor/app/mentions/server/getMentionedTeamMembers.ts +++ b/apps/meteor/app/mentions/server/getMentionedTeamMembers.ts @@ -1,35 +1,23 @@ import { Team } from '@rocket.chat/core-services'; -import type { IMessage } from '@rocket.chat/core-typings'; +import type { MessageMention } from '@rocket.chat/core-typings'; import { callbacks } from '../../../lib/callbacks'; import { settings } from '../../settings/server'; -interface IExtraDataForNotification { - userMentions: any[]; - otherMentions: any[]; - message: IMessage; -} - -const beforeGetMentions = async (mentionIds: string[], extra?: IExtraDataForNotification) => { - const { otherMentions } = extra ?? {}; - - const teamIds = otherMentions?.filter(({ type }) => type === 'team').map(({ _id }) => _id); - - if (!teamIds?.length) { +const beforeGetMentions = async (mentionIds: string[], teamMentions: MessageMention[]): Promise => { + if (!teamMentions.length) { return mentionIds; } - const members = await Team.getMembersByTeamIds(teamIds, { projection: { userId: 1 } }); - mentionIds.push(...new Set(members.map(({ userId }) => userId).filter((userId) => !mentionIds.includes(userId)))); - - return mentionIds; + const teamsIds = teamMentions.map(({ _id }) => _id); + const members = await Team.getMembersByTeamIds(teamsIds, { projection: { userId: 1 } }); + return [...new Set([...mentionIds, ...members.map(({ userId }) => userId)])]; }; settings.watch('Troubleshoot_Disable_Teams_Mention', (value) => { if (value) { callbacks.remove('beforeGetMentions', 'before-get-mentions-get-teams'); - return; + } else { + callbacks.add('beforeGetMentions', beforeGetMentions, callbacks.priority.MEDIUM, 'before-get-mentions-get-teams'); } - - callbacks.add('beforeGetMentions', beforeGetMentions, callbacks.priority.MEDIUM, 'before-get-mentions-get-teams'); }); diff --git a/apps/meteor/app/mentions/server/index.ts b/apps/meteor/app/mentions/server/index.ts index a04af05b9db1..b16d62185a64 100644 --- a/apps/meteor/app/mentions/server/index.ts +++ b/apps/meteor/app/mentions/server/index.ts @@ -1,3 +1,2 @@ import './getMentionedTeamMembers'; import './methods/getUserMentionsByChannel'; -import './server'; diff --git a/apps/meteor/app/mentions/server/server.ts b/apps/meteor/app/mentions/server/server.ts deleted file mode 100644 index 13765e99d856..000000000000 --- a/apps/meteor/app/mentions/server/server.ts +++ /dev/null @@ -1,91 +0,0 @@ -import { api, Team } from '@rocket.chat/core-services'; -import type { IUser, IRoom, ITeam } from '@rocket.chat/core-typings'; -import { Subscriptions, Users, Rooms } from '@rocket.chat/models'; -import { Meteor } from 'meteor/meteor'; - -import { callbacks } from '../../../lib/callbacks'; -import { i18n } from '../../../server/lib/i18n'; -import { settings } from '../../settings/server'; -import MentionsServer from './Mentions'; - -export class MentionQueries { - async getUsers( - usernames: string[], - ): Promise<((Pick & { type: 'user' }) | (Pick & { type: 'team' }))[]> { - const uniqueUsernames = [...new Set(usernames)]; - const teams = await Team.listByNames(uniqueUsernames, { projection: { name: 1 } }); - - const users = await Users.find( - { username: { $in: uniqueUsernames } }, - { projection: { _id: true, username: true, name: 1 } }, - ).toArray(); - - const taggedUsers = users.map((user) => ({ - ...user, - type: 'user' as const, - })); - - if (settings.get('Troubleshoot_Disable_Teams_Mention')) { - return taggedUsers; - } - - const taggedTeams = teams.map((team) => ({ - ...team, - type: 'team' as const, - })); - - return [...taggedUsers, ...taggedTeams]; - } - - async getUser(userId: string): Promise { - return Users.findOneById(userId); - } - - getTotalChannelMembers(rid: string): Promise { - return Subscriptions.countByRoomId(rid); - } - - getChannels(channels: string[]): Promise[]> { - return Rooms.find( - { - $and: [ - { - $or: [ - { $and: [{ $or: [{ federated: { $exists: false } }, { federated: false }], name: { $in: [...new Set(channels)] } }] }, - { federated: true, fname: { $in: [...new Set(channels)] } }, - ], - }, - ], - t: { $in: ['c', 'p'] }, - }, - { projection: { _id: 1, name: 1, fname: 1, federated: 1 } }, - ).toArray(); - } -} - -const queries = new MentionQueries(); - -const mention = new MentionsServer({ - pattern: () => settings.get('UTF8_User_Names_Validation'), - messageMaxAll: () => settings.get('Message_MaxAll'), - getUsers: async (usernames: string[]) => queries.getUsers(usernames), - getUser: async (userId: string) => queries.getUser(userId), - getTotalChannelMembers: (rid: string) => queries.getTotalChannelMembers(rid), - getChannels: (channels: string[]) => queries.getChannels(channels), - async onMaxRoomMembersExceeded({ sender, rid }: { sender: IUser; rid: string }) { - // Get the language of the user for the error notification. - const { language } = await this.getUser(sender._id); - const msg = i18n.t('Group_mentions_disabled_x_members', { total: this.messageMaxAll, lng: language }); - - void api.broadcast('notify.ephemeralMessage', sender._id, rid, { - msg, - }); - - // Also throw to stop propagation of 'sendMessage'. - throw new Meteor.Error('error-action-not-allowed', msg, { - method: 'filterATAllTag', - action: msg, - }); - }, -}); -callbacks.add('beforeSaveMessage', async (message) => mention.execute(message), callbacks.priority.HIGH, 'mentions'); diff --git a/apps/meteor/app/message-pin/server/pinMessage.ts b/apps/meteor/app/message-pin/server/pinMessage.ts index 906f0c98c181..dc17a75a0192 100644 --- a/apps/meteor/app/message-pin/server/pinMessage.ts +++ b/apps/meteor/app/message-pin/server/pinMessage.ts @@ -1,3 +1,4 @@ +import { Apps, AppEvents } from '@rocket.chat/apps'; import { Message } from '@rocket.chat/core-services'; import { isQuoteAttachment, isRegisterUser } from '@rocket.chat/core-typings'; import type { IMessage, MessageAttachment, MessageQuoteAttachment } from '@rocket.chat/core-typings'; @@ -6,9 +7,8 @@ import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; -import { Apps, AppEvents } from '../../../ee/server/apps/orchestrator'; -import { callbacks } from '../../../lib/callbacks'; import { isTruthy } from '../../../lib/isTruthy'; +import { broadcastMessageFromData } from '../../../server/modules/watchers/lib/messages'; import { canAccessRoomAsync, roomAccessAttributes } from '../../authorization/server'; import { hasPermissionAsync } from '../../authorization/server/functions/hasPermission'; import { isTheLastMessage } from '../../lib/server/functions/isTheLastMessage'; @@ -110,8 +110,6 @@ Meteor.methods({ originalMessage = await Message.beforeSave({ message: originalMessage, room, user: me }); - originalMessage = await callbacks.run('beforeSaveMessage', originalMessage); - await Messages.setPinnedByIdAndUserId(originalMessage._id, originalMessage.pinnedBy, originalMessage.pinned); if (settings.get('Message_Read_Receipt_Store_Users')) { await ReadReceipts.setPinnedByMessageId(message._id, originalMessage.pinned); @@ -131,7 +129,7 @@ Meteor.methods({ } // App IPostMessagePinned event hook - await Apps.triggerEvent(AppEvents.IPostMessagePinned, originalMessage, await Meteor.userAsync(), originalMessage.pinned); + await Apps.self?.triggerEvent(AppEvents.IPostMessagePinned, originalMessage, await Meteor.userAsync(), originalMessage.pinned); const msgId = await Message.saveSystemMessage('message_pinned', originalMessage.rid, '', me, { attachments: [ @@ -213,19 +211,20 @@ Meteor.methods({ originalMessage = await Message.beforeSave({ message: originalMessage, room, user: me }); - originalMessage = await callbacks.run('beforeSaveMessage', originalMessage); - if (isTheLastMessage(room, message)) { await Rooms.setLastMessagePinned(room._id, originalMessage.pinnedBy, originalMessage.pinned); } // App IPostMessagePinned event hook - await Apps.triggerEvent(AppEvents.IPostMessagePinned, originalMessage, await Meteor.userAsync(), originalMessage.pinned); + await Apps.self?.triggerEvent(AppEvents.IPostMessagePinned, originalMessage, await Meteor.userAsync(), originalMessage.pinned); await Messages.setPinnedByIdAndUserId(originalMessage._id, originalMessage.pinnedBy, originalMessage.pinned); if (settings.get('Message_Read_Receipt_Store_Users')) { await ReadReceipts.setPinnedByMessageId(originalMessage._id, originalMessage.pinned); } + void broadcastMessageFromData({ + id: message._id, + }); return true; }, diff --git a/apps/meteor/app/message-star/server/starMessage.ts b/apps/meteor/app/message-star/server/starMessage.ts index 006951ad0b72..7ac8fd619d31 100644 --- a/apps/meteor/app/message-star/server/starMessage.ts +++ b/apps/meteor/app/message-star/server/starMessage.ts @@ -1,9 +1,10 @@ +import { Apps, AppEvents } from '@rocket.chat/apps'; import type { IMessage } from '@rocket.chat/core-typings'; import { Messages, Subscriptions, Rooms } from '@rocket.chat/models'; import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; -import { Apps, AppEvents } from '../../../ee/server/apps/orchestrator'; +import { broadcastMessageFromData } from '../../../server/modules/watchers/lib/messages'; import { canAccessRoomAsync, roomAccessAttributes } from '../../authorization/server'; import { isTheLastMessage } from '../../lib/server/functions/isTheLastMessage'; import { settings } from '../../settings/server'; @@ -56,10 +57,14 @@ Meteor.methods({ await Rooms.updateLastMessageStar(room._id, uid, message.starred); } - await Apps.triggerEvent(AppEvents.IPostMessageStarred, message, await Meteor.userAsync(), message.starred); + await Apps.self?.triggerEvent(AppEvents.IPostMessageStarred, message, await Meteor.userAsync(), message.starred); await Messages.updateUserStarById(message._id, uid, message.starred); + void broadcastMessageFromData({ + id: message._id, + }); + return true; }, }); diff --git a/apps/meteor/app/meteor-accounts-saml/client/index.ts b/apps/meteor/app/meteor-accounts-saml/client/index.ts deleted file mode 100644 index 5ca4ae3d5c18..000000000000 --- a/apps/meteor/app/meteor-accounts-saml/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -import './saml_client'; diff --git a/apps/meteor/app/meteor-accounts-saml/client/saml_client.js b/apps/meteor/app/meteor-accounts-saml/client/saml_client.js deleted file mode 100644 index f1f14be530dd..000000000000 --- a/apps/meteor/app/meteor-accounts-saml/client/saml_client.js +++ /dev/null @@ -1,86 +0,0 @@ -import { Random } from '@rocket.chat/random'; -import { Accounts } from 'meteor/accounts-base'; -import { Meteor } from 'meteor/meteor'; -import { ServiceConfiguration } from 'meteor/service-configuration'; - -import { sdk } from '../../utils/client/lib/SDKClient'; - -if (!Accounts.saml) { - Accounts.saml = {}; -} - -// Override the standard logout behaviour. -// -// If we find a samlProvider, and we are using single -// logout we will initiate logout from rocketchat via saml. -// If not using single logout, we just do the standard logout. -// This can be overridden by a configured logout behaviour. -// -// TODO: This may need some work as it is not clear if we are really -// logging out of the idp when doing the standard logout. - -const MeteorLogout = Meteor.logout; -const logoutBehaviour = { - TERMINATE_SAML: 'SAML', - ONLY_RC: 'Local', -}; - -Meteor.logout = async function (...args) { - const samlService = await ServiceConfiguration.configurations.findOneAsync({ service: 'saml' }); - if (samlService) { - const provider = samlService.clientConfig && samlService.clientConfig.provider; - if (provider) { - if (samlService.logoutBehaviour == null || samlService.logoutBehaviour === logoutBehaviour.TERMINATE_SAML) { - if (samlService.idpSLORedirectURL) { - console.info('SAML session terminated via SLO'); - return Meteor.logoutWithSaml({ provider }); - } - } - - if (samlService.logoutBehaviour === logoutBehaviour.ONLY_RC) { - console.info('SAML session not terminated, only the Rocket.Chat session is going to be killed'); - } - } - } - return MeteorLogout.apply(Meteor, args); -}; - -Meteor.loginWithSaml = function (options /* , callback*/) { - options = options || {}; - const credentialToken = `id-${Random.id()}`; - options.credentialToken = credentialToken; - - window.location.href = `_saml/authorize/${options.provider}/${options.credentialToken}`; -}; - -Meteor.logoutWithSaml = function (options /* , callback*/) { - // Accounts.saml.idpInitiatedSLO(options, callback); - sdk - .call('samlLogout', options.provider) - .then((result) => { - if (!result) { - MeteorLogout.apply(Meteor); - return; - } - - // Remove the userId from the client to prevent calls to the server while the logout is processed. - // If the logout fails, the userId will be reloaded on the resume call - Meteor._localStorage.removeItem(Accounts.USER_ID_KEY); - - // A nasty bounce: 'result' has the SAML LogoutRequest but we need a proper 302 to redirected from the server. - window.location.replace(Meteor.absoluteUrl(`_saml/sloRedirect/${options.provider}/?redirect=${encodeURIComponent(result)}`)); - }) - .catch(() => MeteorLogout.apply(Meteor)); -}; - -Meteor.loginWithSamlToken = function (token, userCallback) { - Accounts.callLoginMethod({ - methodArguments: [ - { - saml: true, - credentialToken: token, - }, - ], - userCallback, - }); -}; diff --git a/apps/meteor/app/meteor-accounts-saml/server/lib/settings.ts b/apps/meteor/app/meteor-accounts-saml/server/lib/settings.ts index 31bb8e37cfac..8f6791c36302 100644 --- a/apps/meteor/app/meteor-accounts-saml/server/lib/settings.ts +++ b/apps/meteor/app/meteor-accounts-saml/server/lib/settings.ts @@ -1,5 +1,6 @@ +import type { SAMLConfiguration } from '@rocket.chat/core-typings'; +import { LoginServiceConfiguration } from '@rocket.chat/models'; import { Meteor } from 'meteor/meteor'; -import { ServiceConfiguration } from 'meteor/service-configuration'; import { SystemLogger } from '../../../../server/lib/logger/system'; import { settings, settingsRegistry } from '../../../settings/server'; @@ -17,13 +18,13 @@ import { defaultMetadataCertificateTemplate, } from './constants'; -const getSamlConfigs = function (service: string): Record { - const configs = { +const getSamlConfigs = function (service: string): SAMLConfiguration { + const configs: SAMLConfiguration = { buttonLabelText: settings.get(`${service}_button_label_text`), buttonLabelColor: settings.get(`${service}_button_label_color`), buttonColor: settings.get(`${service}_button_color`), clientConfig: { - provider: settings.get(`${service}_provider`), + provider: settings.get(`${service}_provider`), }, entryPoint: settings.get(`${service}_entry_point`), idpSLORedirectURL: settings.get(`${service}_idp_slo_redirect_url`), @@ -115,19 +116,10 @@ export const loadSamlServiceProviders = async function (): Promise { if (value === true) { const samlConfigs = getSamlConfigs(key); SAMLUtils.log(key); - await ServiceConfiguration.configurations.upsertAsync( - { - service: serviceName.toLowerCase(), - }, - { - $set: samlConfigs, - }, - ); + await LoginServiceConfiguration.createOrUpdateService(serviceName, samlConfigs); return configureSamlService(samlConfigs); } - await ServiceConfiguration.configurations.removeAsync({ - service: serviceName.toLowerCase(), - }); + await LoginServiceConfiguration.removeService(serviceName); return false; }), ) @@ -150,10 +142,12 @@ export const addSettings = async function (name: string): Promise { await this.add(`SAML_Custom_${name}`, false, { type: 'boolean', i18nLabel: 'Accounts_OAuth_Custom_Enable', + public: true, }); await this.add(`SAML_Custom_${name}_provider`, 'provider-name', { type: 'string', i18nLabel: 'SAML_Custom_Provider', + public: true, }); await this.add(`SAML_Custom_${name}_entry_point`, 'https://example.com/simplesaml/saml2/idp/SSOService.php', { type: 'string', @@ -162,6 +156,7 @@ export const addSettings = async function (name: string): Promise { await this.add(`SAML_Custom_${name}_idp_slo_redirect_url`, 'https://example.com/simplesaml/saml2/idp/SingleLogoutService.php', { type: 'string', i18nLabel: 'SAML_Custom_IDP_SLO_Redirect_URL', + public: true, }); await this.add(`SAML_Custom_${name}_issuer`, 'https://your-rocket-chat/_saml/metadata/provider-name', { type: 'string', @@ -262,6 +257,7 @@ export const addSettings = async function (name: string): Promise { { key: 'Local', i18nLabel: 'SAML_Custom_Logout_Behaviour_End_Only_RocketChat' }, ], i18nLabel: 'SAML_Custom_Logout_Behaviour', + public: true, }); await this.add(`SAML_Custom_${name}_channels_update`, false, { type: 'boolean', diff --git a/apps/meteor/app/meteor-accounts-saml/server/methods/samlLogout.ts b/apps/meteor/app/meteor-accounts-saml/server/methods/samlLogout.ts index 2b960059f164..956426082d40 100644 --- a/apps/meteor/app/meteor-accounts-saml/server/methods/samlLogout.ts +++ b/apps/meteor/app/meteor-accounts-saml/server/methods/samlLogout.ts @@ -28,7 +28,7 @@ function getSamlServiceProviderOptions(provider: string): IServiceProviderOption declare module '@rocket.chat/ui-contexts' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { - samlLogout(provider: string): Promise; + samlLogout(provider: string): string | undefined; } } diff --git a/apps/meteor/app/meteor-accounts-saml/server/startup.ts b/apps/meteor/app/meteor-accounts-saml/server/startup.ts index 7a2bf16d3244..556ab7df13e7 100644 --- a/apps/meteor/app/meteor-accounts-saml/server/startup.ts +++ b/apps/meteor/app/meteor-accounts-saml/server/startup.ts @@ -1,4 +1,5 @@ import { Logger } from '@rocket.chat/logger'; +import debounce from 'lodash.debounce'; import { Meteor } from 'meteor/meteor'; import { settings } from '../../settings/server'; @@ -10,5 +11,6 @@ SAMLUtils.setLoggerInstance(logger); Meteor.startup(async () => { await addSettings('Default'); - settings.watchByRegex(/^SAML_.+/, loadSamlServiceProviders); }); + +settings.watchByRegex(/^SAML_.+/, debounce(loadSamlServiceProviders, 2000)); diff --git a/apps/meteor/app/metrics/server/lib/collectMetrics.ts b/apps/meteor/app/metrics/server/lib/collectMetrics.ts index 8213e27ed4f4..136686f49c9e 100644 --- a/apps/meteor/app/metrics/server/lib/collectMetrics.ts +++ b/apps/meteor/app/metrics/server/lib/collectMetrics.ts @@ -175,17 +175,10 @@ const updatePrometheusConfig = async (): Promise => { clearInterval(resetTimer); if (is.resetInterval) { resetTimer = setInterval(() => { - client.register - .getMetricsAsArray() - .then((metrics) => { - metrics.forEach((metric) => { - // @ts-expect-error Property 'hashMap' does not exist on type 'metric'. - metric.hashMap = {}; - }); - }) - .catch((err) => { - SystemLogger.error({ msg: 'Error while collecting metrics', err }); - }); + client.register.getMetricsAsArray().forEach((metric) => { + // @ts-expect-error Property 'hashMap' does not exist on type 'metric'. + metric.hashMap = {}; + }); }, is.resetInterval); } diff --git a/apps/meteor/app/metrics/server/lib/metrics.ts b/apps/meteor/app/metrics/server/lib/metrics.ts index 410a218761a0..00bbedce287d 100644 --- a/apps/meteor/app/metrics/server/lib/metrics.ts +++ b/apps/meteor/app/metrics/server/lib/metrics.ts @@ -1,6 +1,6 @@ import client from 'prom-client'; -const percentiles = [0.01, 0.1, 0.9, 0.99]; +const percentiles = [0.01, 0.1, 0.5, 0.9, 0.95, 0.99, 1]; export const metrics = { deprecations: new client.Counter({ @@ -63,9 +63,13 @@ export const metrics = { labelNames: ['notification_type'], help: 'cumulated number of notifications sent', }), - messageRoundtripTime: new client.Gauge({ - name: 'rocketchat_messages_roundtrip_time', + messageRoundtripTime: new client.Summary({ + name: 'rocketchat_messages_roundtrip_time_summary', help: 'time spent by a message from save to receive back', + percentiles, + maxAgeSeconds: 60, + ageBuckets: 5, + // pruneAgedBuckets: true, // Type not added to prom-client on 14.2 https://github.com/siimon/prom-client/pull/558 }), ddpSessions: new client.Gauge({ diff --git a/apps/meteor/app/models/client/index.ts b/apps/meteor/app/models/client/index.ts index b4c540318a9b..354baa2b71fd 100644 --- a/apps/meteor/app/models/client/index.ts +++ b/apps/meteor/app/models/client/index.ts @@ -14,20 +14,6 @@ import { RoomRoles } from './models/RoomRoles'; import { UserAndRoom } from './models/UserAndRoom'; import { UserRoles } from './models/UserRoles'; import { Users } from './models/Users'; -import { WebdavAccounts } from './models/WebdavAccounts'; - -// overwrite Meteor.users collection so records on it don't get erased whenever the client reconnects to websocket -const meteorUserOverwrite = () => { - const uid = Meteor.userId(); - - if (!uid) { - return null; - } - - return (Users.findOne({ _id: uid }) ?? null) as Meteor.User | null; -}; -Meteor.users = Users as typeof Meteor.users; -Meteor.user = meteorUserOverwrite; export { Base, @@ -43,7 +29,6 @@ export { ChatPermissions, CustomSounds, EmojiCustom, - WebdavAccounts, /** @deprecated */ Users, /** @deprecated */ diff --git a/apps/meteor/app/models/client/models/ChatPermissions.ts b/apps/meteor/app/models/client/models/ChatPermissions.ts index 8f1c7b18c060..e836f58ebb2e 100644 --- a/apps/meteor/app/models/client/models/ChatPermissions.ts +++ b/apps/meteor/app/models/client/models/ChatPermissions.ts @@ -4,7 +4,7 @@ import { CachedCollection } from '../../../ui-cached-collection/client'; export const AuthzCachedCollection = new CachedCollection({ name: 'permissions', - eventType: 'onLogged', + eventType: 'notify-logged', }); export const ChatPermissions = AuthzCachedCollection.collection; diff --git a/apps/meteor/app/models/client/models/WebdavAccounts.ts b/apps/meteor/app/models/client/models/WebdavAccounts.ts deleted file mode 100644 index fbc1092cd86e..000000000000 --- a/apps/meteor/app/models/client/models/WebdavAccounts.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Mongo } from 'meteor/mongo'; - -/** @deprecated */ -export const WebdavAccounts = new Mongo.Collection<{ - _id: string; - name: string; - username: string; - serverURL: string; -}>(null); diff --git a/apps/meteor/app/nextcloud/client/lib.ts b/apps/meteor/app/nextcloud/client/lib.ts index 12a54217691c..fb7f5391bc3a 100644 --- a/apps/meteor/app/nextcloud/client/lib.ts +++ b/apps/meteor/app/nextcloud/client/lib.ts @@ -3,7 +3,7 @@ import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; import _ from 'underscore'; -import { CustomOAuth } from '../../custom-oauth/client/custom_oauth_client'; +import { CustomOAuth } from '../../custom-oauth/client/CustomOAuth'; import { settings } from '../../settings/client'; const config: OauthConfig = { diff --git a/apps/meteor/app/notifications/client/index.ts b/apps/meteor/app/notifications/client/index.ts index 1cb2af14e70e..47c2de413740 100644 --- a/apps/meteor/app/notifications/client/index.ts +++ b/apps/meteor/app/notifications/client/index.ts @@ -1,3 +1 @@ -import Notifications from './lib/Notifications'; - -export { Notifications }; +import './lib/Presence'; diff --git a/apps/meteor/app/notifications/client/lib/Notifications.ts b/apps/meteor/app/notifications/client/lib/Notifications.ts deleted file mode 100644 index 8d77b9e3a0cb..000000000000 --- a/apps/meteor/app/notifications/client/lib/Notifications.ts +++ /dev/null @@ -1,102 +0,0 @@ -import type { StreamKeys, StreamerCallback } from '@rocket.chat/ddp-client/src/types/streams'; -import { Meteor } from 'meteor/meteor'; -import { Tracker } from 'meteor/tracker'; - -import './Presence'; -import { sdk } from '../../../utils/client/lib/SDKClient'; - -type ExtractSecondString = E extends `${string}/${infer X}` ? X : never; - -class Notifications { - private logged: boolean; - - private loginCb: any[]; - - private debug: boolean; - - constructor() { - this.logged = Meteor.userId() !== null; - this.loginCb = []; - Tracker.autorun(() => { - if (Meteor.userId() !== null && this.logged === false) { - this.loginCb.forEach((cb) => cb()); - } - this.logged = Meteor.userId() !== null; - }); - this.debug = false; - } - - onLogged>(eventName: E, callback: StreamerCallback<'notify-logged', E>) { - return this.onLogin(() => sdk.stream('notify-logged', [eventName], callback)); - } - - onAll>(eventName: E, callback: StreamerCallback<'notify-all', E>) { - return sdk.stream('notify-all', [eventName], callback); - } - - onRoom>>( - room: string, - eventName: E, - callback: StreamerCallback<'notify-room', `${string}/${E}`>, - ) { - return sdk.stream('notify-room', [`${room}/${eventName}`], callback); - } - - onUser>>( - eventName: E, - callback: StreamerCallback<'notify-user', `${string}/${E}`>, - ) { - return sdk.stream('notify-user', [`${Meteor.userId()}/${eventName}`], callback); - } - - onVisitor>>( - visitor: string, - eventName: E, - callback: StreamerCallback<'notify-user', `${string}/${E}`>, - ) { - return sdk.stream('notify-user', [`${visitor}/${eventName}`], callback); - } - - unUser>>(eventName: E) { - return sdk.stop('notify-user', `${Meteor.userId()}/${eventName}`); - } - - unRoom>>(room: string, eventName: E) { - return sdk.stop('notify-room', `${room}/${eventName}`); - } - - onLogin(cb: () => void) { - this.loginCb.push(cb); - if (this.logged) { - return cb(); - } - } - - notifyRoom>>(room: string, eventName: E, ...args: any[]) { - args.unshift(`${room}/${eventName}`); - return sdk.publish('notify-room', args); - } - - notifyVisitor>>(visitor: string, eventName: E, ...args: any[]) { - args.unshift(`${visitor}/${eventName}`); - return sdk.publish('notify-user', args); - } - - notifyUser>>(uid: string, eventName: E, ...args: any[]) { - args.unshift(`${uid}/${eventName}`); - return sdk.publish('notify-user', args); - } - - notifyUsersOfRoom>>(room: string, eventName: E, ...args: any[]) { - if (this.debug === true) { - console.log('RocketChat.Notifications: notifyUsersOfRoomExceptSender', [room, eventName, ...args]); - } - args.unshift(`${room}/${eventName}`); - return sdk.publish('notify-room-users', args); - } -} - -/** @deprecated it should be used `sdk`instead both perform the same */ -const ns = new Notifications(); - -export default ns; diff --git a/apps/meteor/app/notifications/client/lib/Presence.ts b/apps/meteor/app/notifications/client/lib/Presence.ts index 69c255aaf1f9..09d0e3be1693 100644 --- a/apps/meteor/app/notifications/client/lib/Presence.ts +++ b/apps/meteor/app/notifications/client/lib/Presence.ts @@ -1,17 +1,17 @@ -import type { StreamerEvents } from '@rocket.chat/ui-contexts'; +import { UserStatus } from '@rocket.chat/core-typings'; import { Meteor } from 'meteor/meteor'; -import { Presence, STATUS_MAP } from '../../../../client/lib/presence'; +import { Presence } from '../../../../client/lib/presence'; // TODO implement API on Streamer to be able to listen to all streamed data // this is a hacky way to listen to all streamed data from user-presence Streamer new Meteor.Streamer('user-presence'); -(Meteor as any).StreamerCentral.on('stream-user-presence', (uid: string, ...args: StreamerEvents['user-presence'][number]['args']) => { - if (!Array.isArray(args)) { - throw new Error('Presence event must be an array'); - } - const [[username, status, statusText]] = args; - Presence.notify({ _id: uid, username, status: STATUS_MAP[status ?? 0], statusText }); +type args = [username: string, statusChanged?: UserStatus, statusText?: string]; + +export const STATUS_MAP = [UserStatus.OFFLINE, UserStatus.ONLINE, UserStatus.AWAY, UserStatus.BUSY, UserStatus.DISABLED]; + +Meteor.StreamerCentral.on('stream-user-presence', (uid: string, [username, statusChanged, statusText]: args) => { + Presence.notify({ _id: uid, username, status: STATUS_MAP[statusChanged as any], statusText }); }); diff --git a/apps/meteor/app/oembed/server/index.ts b/apps/meteor/app/oembed/server/index.ts index 1d33b9ff3842..245f608c6b94 100644 --- a/apps/meteor/app/oembed/server/index.ts +++ b/apps/meteor/app/oembed/server/index.ts @@ -1,3 +1,2 @@ -import './jumpToMessage'; import './providers'; import './server'; diff --git a/apps/meteor/app/oembed/server/jumpToMessage.ts b/apps/meteor/app/oembed/server/jumpToMessage.ts deleted file mode 100644 index 9c5be2639c7c..000000000000 --- a/apps/meteor/app/oembed/server/jumpToMessage.ts +++ /dev/null @@ -1,108 +0,0 @@ -import QueryString from 'querystring'; -import URL from 'url'; - -import type { MessageAttachment, IMessage, IOmnichannelRoom } from '@rocket.chat/core-typings'; -import { isQuoteAttachment } from '@rocket.chat/core-typings'; -import { Messages, Users, Rooms } from '@rocket.chat/models'; - -import { callbacks } from '../../../lib/callbacks'; -import { createQuoteAttachment } from '../../../lib/createQuoteAttachment'; -import { canAccessRoomAsync } from '../../authorization/server/functions/canAccessRoom'; -import { settings } from '../../settings/server'; -import { getUserAvatarURL } from '../../utils/server/getUserAvatarURL'; - -const recursiveRemoveAttachments = (attachments: MessageAttachment, deep = 1, quoteChainLimit: number): MessageAttachment => { - if (attachments && isQuoteAttachment(attachments)) { - if (deep < quoteChainLimit - 1) { - attachments.attachments?.map((msg) => recursiveRemoveAttachments(msg, deep + 1, quoteChainLimit)); - } else { - delete attachments.attachments; - } - } - - return attachments; -}; - -const validateAttachmentDeepness = (message: IMessage): IMessage => { - if (!message?.attachments) { - return message; - } - - const quoteChainLimit = settings.get('Message_QuoteChainLimit'); - if ((message.attachments && quoteChainLimit < 2) || isNaN(quoteChainLimit)) { - delete message.attachments; - } - - message.attachments = message.attachments?.map((attachment) => recursiveRemoveAttachments(attachment, 1, quoteChainLimit)); - - return message; -}; - -callbacks.add( - 'beforeSaveMessage', - async (msg) => { - // if no message is present, or the message doesn't have any URL, skip - if (!msg?.urls?.length) { - return msg; - } - - const currentUser = await Users.findOneById(msg.u._id); - - for await (const item of msg.urls) { - // if the URL doesn't belong to the current server, skip - if (!item.url.includes(settings.get('Site_Url'))) { - continue; - } - - const urlObj = URL.parse(item.url); - - // if the URL doesn't have query params (doesn't reference message) skip - if (!urlObj.query) { - continue; - } - - const { msg: msgId } = QueryString.parse(urlObj.query); - - if (typeof msgId !== 'string') { - continue; - } - - const message = await Messages.findOneById(msgId); - - const jumpToMessage = message && validateAttachmentDeepness(message); - if (!jumpToMessage) { - continue; - } - - // validates if user can see the message - // user has to belong to the room the message was first wrote in - const room = await Rooms.findOneById(jumpToMessage.rid); - if (!room) { - continue; - } - const isLiveChatRoomVisitor = !!msg.token && !!room.v?.token && msg.token === room.v.token; - const canAccessRoomForUser = isLiveChatRoomVisitor || (currentUser && (await canAccessRoomAsync(room, currentUser))); - if (!canAccessRoomForUser) { - continue; - } - - msg.attachments = msg.attachments || []; - // Only QuoteAttachments have "message_link" property - const index = msg.attachments.findIndex((a) => isQuoteAttachment(a) && a.message_link === item.url); - if (index > -1) { - msg.attachments.splice(index, 1); - } - - const useRealName = Boolean(settings.get('UI_Use_Real_Name')); - - msg.attachments.push( - createQuoteAttachment(jumpToMessage, item.url, useRealName, getUserAvatarURL(jumpToMessage.u.username || '') as string), - ); - item.ignoreParse = true; - } - - return msg; - }, - callbacks.priority.LOW, - 'jumpToMessage', -); diff --git a/apps/meteor/app/oembed/server/server.ts b/apps/meteor/app/oembed/server/server.ts index 79de0402043f..1e758b1371e8 100644 --- a/apps/meteor/app/oembed/server/server.ts +++ b/apps/meteor/app/oembed/server/server.ts @@ -1,5 +1,12 @@ -import type { OEmbedUrlContentResult, OEmbedUrlWithMetadata, IMessage, MessageAttachment, OEmbedMeta } from '@rocket.chat/core-typings'; -import { isOEmbedUrlContentResult, isOEmbedUrlWithMetadata } from '@rocket.chat/core-typings'; +import type { + OEmbedUrlContentResult, + OEmbedUrlWithMetadata, + IMessage, + MessageAttachment, + OEmbedMeta, + MessageUrl, +} from '@rocket.chat/core-typings'; +import { isOEmbedUrlWithMetadata } from '@rocket.chat/core-typings'; import { Logger } from '@rocket.chat/logger'; import { Messages, OEmbedCache } from '@rocket.chat/models'; import { serverFetch as fetch } from '@rocket.chat/server-fetch'; @@ -128,6 +135,41 @@ const getUrlContent = async (urlObj: URL, redirectCount = 5): Promise { + const parsedUrlObject: MessageUrl = { url, meta: {} }; + let foundMeta = false; + if (!isURL(url)) { + return { urlPreview: parsedUrlObject, foundMeta }; + } + + const data = await getUrlMetaWithCache(url); + if (!data) { + return { urlPreview: parsedUrlObject, foundMeta }; + } + + if (isOEmbedUrlWithMetadata(data) && data.meta) { + parsedUrlObject.meta = getRelevantMetaTags(data.meta) || {}; + if (parsedUrlObject.meta?.oembedHtml) { + parsedUrlObject.meta.oembedHtml = insertMaxWidthInOembedHtml(parsedUrlObject.meta.oembedHtml) || ''; + } + } + + foundMeta = true; + return { + urlPreview: { + ...parsedUrlObject, + ...((parsedUrlObject.headers || data.headers) && { + headers: { + ...parsedUrlObject.headers, + ...(data.headers?.contentLength && { contentLength: data.headers.contentLength }), + ...(data.headers?.contentType && { contentType: data.headers.contentType }), + }, + }), + }, + foundMeta, + }; +}; + const getUrlMeta = async function ( url: string, withFragment?: boolean, @@ -151,10 +193,6 @@ const getUrlMeta = async function ( return; } - if (content.attachments) { - return content; - } - log.debug('Parsing metadata for URL', url); const metas: { [k: string]: string } = {}; @@ -273,37 +311,10 @@ const rocketUrlParser = async function (message: IMessage): Promise { continue; } - if (!isURL(item.url)) { - continue; - } - - const data = await getUrlMetaWithCache(item.url); - - if (!data) { - continue; - } - - if (isOEmbedUrlContentResult(data) && data.attachments) { - attachments.push(...data.attachments); - break; - } - - if (isOEmbedUrlWithMetadata(data) && data.meta) { - item.meta = getRelevantMetaTags(data.meta) || {}; - if (item.meta?.oembedHtml) { - item.meta.oembedHtml = insertMaxWidthInOembedHtml(item.meta.oembedHtml) || ''; - } - } - - if (data.headers?.contentLength) { - item.headers = { ...item.headers, contentLength: data.headers.contentLength }; - } - - if (data.headers?.contentType) { - item.headers = { ...item.headers, contentType: data.headers.contentType }; - } + const { urlPreview, foundMeta } = await parseUrl(item.url); - changed = true; + Object.assign(item, foundMeta ? urlPreview : {}); + changed = changed || foundMeta; } if (attachments.length) { @@ -321,10 +332,12 @@ const OEmbed: { getUrlMeta: (url: string, withFragment?: boolean) => Promise; getUrlMetaWithCache: (url: string, withFragment?: boolean) => Promise; rocketUrlParser: (message: IMessage) => Promise; + parseUrl: (url: string) => Promise<{ urlPreview: MessageUrl; foundMeta: boolean }>; } = { rocketUrlParser, getUrlMetaWithCache, getUrlMeta, + parseUrl, }; settings.watch('API_Embed', (value) => { diff --git a/apps/meteor/app/otr/client/OTR.ts b/apps/meteor/app/otr/client/OTR.ts index 55e0a1289a67..a855381bd9c0 100644 --- a/apps/meteor/app/otr/client/OTR.ts +++ b/apps/meteor/app/otr/client/OTR.ts @@ -1,51 +1,28 @@ -import { Meteor } from 'meteor/meteor'; -import { ReactiveVar } from 'meteor/reactive-var'; +import type { IRoom, IUser } from '@rocket.chat/core-typings'; -import { Subscriptions } from '../../models/client'; import type { IOTR } from '../lib/IOTR'; import { OTRRoom } from './OTRRoom'; class OTR implements IOTR { - private enabled: ReactiveVar; - private instancesByRoomId: { [rid: string]: OTRRoom }; constructor() { - this.enabled = new ReactiveVar(false); this.instancesByRoomId = {}; } - isEnabled(): boolean { - return this.enabled.get(); - } - - setEnabled(enabled: boolean): void { - this.enabled.set(enabled); - } - - getInstanceByRoomId(roomId: string): OTRRoom | undefined { - const userId = Meteor.userId(); - if (!userId) { - return; - } - if (!this.enabled.get()) { - return; - } - - if (this.instancesByRoomId[roomId]) { - return this.instancesByRoomId[roomId]; + getInstanceByRoomId(uid: IUser['_id'], rid: IRoom['_id']): OTRRoom | undefined { + if (this.instancesByRoomId[rid]) { + return this.instancesByRoomId[rid]; } - const subscription = Subscriptions.findOne({ - rid: roomId, - }); + const otrRoom = OTRRoom.create(uid, rid); - if (!subscription || subscription.t !== 'd') { - return; + if (!otrRoom) { + return undefined; } - this.instancesByRoomId[roomId] = new OTRRoom(userId, roomId); - return this.instancesByRoomId[roomId]; + this.instancesByRoomId[rid] = otrRoom; + return this.instancesByRoomId[rid]; } } diff --git a/apps/meteor/app/otr/client/OTRRoom.ts b/apps/meteor/app/otr/client/OTRRoom.ts index d0d1ae84cd3e..8899de13b190 100644 --- a/apps/meteor/app/otr/client/OTRRoom.ts +++ b/apps/meteor/app/otr/client/OTRRoom.ts @@ -1,4 +1,4 @@ -import type { IMessage } from '@rocket.chat/core-typings'; +import type { IRoom, IMessage, IUser } from '@rocket.chat/core-typings'; import { Random } from '@rocket.chat/random'; import EJSON from 'ejson'; import { Meteor } from 'meteor/meteor'; @@ -11,7 +11,6 @@ import { Presence } from '../../../client/lib/presence'; import { dispatchToastMessage } from '../../../client/lib/toast'; import { getUidDirectMessage } from '../../../client/lib/utils/getUidDirectMessage'; import { goToRoomById } from '../../../client/lib/utils/goToRoomById'; -import { Notifications } from '../../notifications/client'; import { sdk } from '../../utils/client/lib/SDKClient'; import { t } from '../../utils/lib/i18n'; import type { IOnUserStreamData, IOTRAlgorithm, IOTRDecrypt, IOTRRoom } from '../lib/IOTR'; @@ -48,15 +47,25 @@ export class OTRRoom implements IOTRRoom { private isFirstOTR: boolean; - constructor(userId: string, roomId: string) { - this._userId = userId; - this._roomId = roomId; + protected constructor(uid: IUser['_id'], rid: IRoom['_id'], peerId: IUser['_id']) { + this._userId = uid; + this._roomId = rid; this._keyPair = null; this._sessionKey = null; - this.peerId = getUidDirectMessage(roomId) as string; + this.peerId = peerId; this.isFirstOTR = true; } + public static create(uid: IUser['_id'], rid: IRoom['_id']): OTRRoom | undefined { + const peerId = getUidDirectMessage(rid); + + if (!peerId) { + return undefined; + } + + return new OTRRoom(uid, rid, peerId); + } + getPeerId(): string { return this.peerId; } @@ -75,58 +84,71 @@ export class OTRRoom implements IOTRRoom { async handshake(refresh?: boolean): Promise { this.setState(OtrRoomState.ESTABLISHING); - try { - await this.generateKeyPair(); - this.peerId && - Notifications.notifyUser(this.peerId, 'otr', 'handshake', { - roomId: this._roomId, - userId: this._userId, - publicKey: EJSON.stringify(this._exportedPublicKey), - refresh, - }); - if (refresh) { - const user = Meteor.user(); - if (!user) { - return; - } - await sdk.call('sendSystemMessages', this._roomId, user.username, otrSystemMessages.USER_REQUESTED_OTR_KEY_REFRESH); - this.isFirstOTR = false; + + await this.generateKeyPair(); + sdk.publish('notify-user', [ + `${this.peerId}/otr`, + 'handshake', + { + roomId: this._roomId, + userId: this._userId, + publicKey: EJSON.stringify(this._exportedPublicKey), + refresh, + }, + ]); + + if (refresh) { + const user = Meteor.user(); + if (!user) { + return; } - } catch (e) { - throw e; + await sdk.rest.post('/v1/chat.otr', { + roomId: this._roomId, + type: otrSystemMessages.USER_REQUESTED_OTR_KEY_REFRESH, + }); + this.isFirstOTR = false; } } acknowledge(): void { void sdk.rest.post('/v1/statistics.telemetry', { params: [{ eventName: 'otrStats', timestamp: Date.now(), rid: this._roomId }] }); - this.peerId && - Notifications.notifyUser(this.peerId, 'otr', 'acknowledge', { + sdk.publish('notify-user', [ + `${this.peerId}/otr`, + 'acknowledge', + { roomId: this._roomId, userId: this._userId, publicKey: EJSON.stringify(this._exportedPublicKey), - }); + }, + ]); } deny(): void { this.reset(); this.setState(OtrRoomState.DECLINED); - this.peerId && - Notifications.notifyUser(this.peerId, 'otr', 'deny', { + sdk.publish('notify-user', [ + `${this.peerId}/otr`, + 'deny', + { roomId: this._roomId, userId: this._userId, - }); + }, + ]); } end(): void { this.isFirstOTR = true; this.reset(); this.setState(OtrRoomState.NOT_STARTED); - this.peerId && - Notifications.notifyUser(this.peerId, 'otr', 'end', { + sdk.publish('notify-user', [ + `${this.peerId}/otr`, + 'end', + { roomId: this._roomId, userId: this._userId, - }); + }, + ]); } reset(): void { @@ -142,14 +164,14 @@ export class OTRRoom implements IOTRRoom { } this._userOnlineComputation = Tracker.autorun(() => { - const $room = $(`#chat-window-${this._roomId}`); - const $title = $('.rc-header__title', $room); + const $room = document.querySelector(`#chat-window-${this._roomId}`); + const $title = $room?.querySelector('.rc-header__title'); if (this.getState() === OtrRoomState.ESTABLISHED) { - if ($room.length && $title.length && !$('.otr-icon', $title).length) { + if ($room && $title && !$title.querySelector('.otr-icon')) { $title.prepend(""); } - } else if ($title.length) { - $('.otr-icon', $title).remove(); + } else if ($title) { + $title.querySelector('.otr-icon')?.remove(); } }); try { diff --git a/apps/meteor/app/otr/lib/IOTR.ts b/apps/meteor/app/otr/lib/IOTR.ts index 051752ab947f..9e7cd4ca6b8e 100644 --- a/apps/meteor/app/otr/lib/IOTR.ts +++ b/apps/meteor/app/otr/lib/IOTR.ts @@ -36,9 +36,7 @@ export interface IOTRRoom { } export interface IOTR { - isEnabled(): boolean; - setEnabled(enabled: boolean): void; - getInstanceByRoomId(roomId: IRoom['_id']): OTRRoom | undefined; + getInstanceByRoomId(userId: IUser['_id'], roomId: IRoom['_id']): OTRRoom | undefined; } export interface IOTRAlgorithm extends EcKeyAlgorithm, EcdhKeyDeriveParams {} diff --git a/apps/meteor/app/otr/server/methods/updateOTRAck.ts b/apps/meteor/app/otr/server/methods/updateOTRAck.ts index eaba2906ed06..745c70aa4538 100644 --- a/apps/meteor/app/otr/server/methods/updateOTRAck.ts +++ b/apps/meteor/app/otr/server/methods/updateOTRAck.ts @@ -1,3 +1,4 @@ +import type { IOTRMessage } from '@rocket.chat/core-typings'; import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; @@ -6,7 +7,7 @@ import notifications from '../../../notifications/server/lib/Notifications'; declare module '@rocket.chat/ui-contexts' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { - updateOTRAck({ message, ack }: { message: any; ack: any }): void; + updateOTRAck({ message, ack }: { message: IOTRMessage; ack: string }): void; } } @@ -15,7 +16,7 @@ Meteor.methods({ if (!Meteor.userId()) { throw new Meteor.Error('error-invalid-user', 'Invalid user', { method: 'updateOTRAck' }); } - const otrStreamer = notifications.streamRoomMessage; - otrStreamer.emit(message.rid, { ...message, otr: { ack } }); + const acknowlegedMessage: IOTRMessage = { ...message, otrAck: ack }; + notifications.streamRoomMessage.emit(message.rid, acknowlegedMessage); }, }); diff --git a/apps/meteor/app/push/server/apn.ts b/apps/meteor/app/push/server/apn.ts index 1794a2886324..e64bf08c1c78 100644 --- a/apps/meteor/app/push/server/apn.ts +++ b/apps/meteor/app/push/server/apn.ts @@ -65,7 +65,7 @@ export const sendAPN = ({ note.payload.messageFrom = notification.from; note.priority = priority; - note.topic = `${notification.topic}${notification.apn?.topicSuffix || ''}`; + note.topic = notification.topic; note.mutableContent = true; void apnConnection.send(note, userToken).then((response) => { diff --git a/apps/meteor/app/push/server/definition.ts b/apps/meteor/app/push/server/definition.ts index 39ab94de0a36..c849d06c11b8 100644 --- a/apps/meteor/app/push/server/definition.ts +++ b/apps/meteor/app/push/server/definition.ts @@ -26,7 +26,6 @@ export type PendingPushNotification = { notId?: number; apn?: { category?: string; - topicSuffix?: string; }; gcm?: { style?: string; diff --git a/apps/meteor/app/push/server/push.ts b/apps/meteor/app/push/server/push.ts index fe08f7b0a214..2594625155fa 100644 --- a/apps/meteor/app/push/server/push.ts +++ b/apps/meteor/app/push/server/push.ts @@ -201,13 +201,12 @@ class PushClass { } private getGatewayNotificationData(notification: PendingPushNotification): Omit { - // Gateway accepts every attribute from the PendingPushNotification type, except for the priority and apn.topicSuffix - const { priority: _priority, apn, ...notifData } = notification; - const { topicSuffix: _topicSuffix, ...apnData } = apn || ({} as RequiredField['apn']); + // Gateway currently accepts every attribute from the PendingPushNotification type, except for the priority + // If new attributes are added to the PendingPushNotification type, they'll need to be removed here as well. + const { priority: _priority, ...notifData } = notification; return { ...notifData, - ...(notification.apn ? { apn: { ...apnData } } : {}), }; } @@ -221,8 +220,6 @@ class PushClass { return; } - const { topicSuffix = '' } = notification.apn || {}; - const gatewayNotification = this.getGatewayNotificationData(notification); for (const gateway of this.options.gateways) { @@ -230,7 +227,7 @@ class PushClass { if ('apn' in app.token && app.token.apn) { countApn.push(app._id); - return this.sendGatewayPush(gateway, 'apn', app.token.apn, { topic: `${app.appName}${topicSuffix}`, ...gatewayNotification }); + return this.sendGatewayPush(gateway, 'apn', app.token.apn, { topic: app.appName, ...gatewayNotification }); } if ('gcm' in app.token && app.token.gcm) { @@ -286,11 +283,11 @@ class PushClass { logger.debug('GUIDE: The "AppsTokens" is empty - No clients have registered on the server yet...'); } } else if (!countApn.length) { - if ((await AppsTokens.col.countDocuments({ 'token.apn': { $exists: true } })) === 0) { + if ((await AppsTokens.countApnTokens()) === 0) { logger.debug('GUIDE: The "AppsTokens" - No APN clients have registered on the server yet...'); } } else if (!countGcm.length) { - if ((await AppsTokens.col.countDocuments({ 'token.gcm': { $exists: true } })) === 0) { + if ((await AppsTokens.countGcmTokens()) === 0) { logger.debug('GUIDE: The "AppsTokens" - No GCM clients have registered on the server yet...'); } } @@ -318,7 +315,6 @@ class PushClass { contentAvailable: Match.Optional(Match.Integer), apn: Match.Optional({ category: Match.Optional(String), - topicSuffix: Match.Optional(String), }), gcm: Match.Optional({ image: Match.Optional(String), @@ -357,7 +353,7 @@ class PushClass { ...(this.hasApnOptions(options) ? { apn: { - ...pick(options.apn, 'category', 'topicSuffix'), + ...pick(options.apn, 'category'), }, } : {}), diff --git a/apps/meteor/app/reactions/client/init.ts b/apps/meteor/app/reactions/client/init.ts index 24840b9de7cf..1943d7262939 100644 --- a/apps/meteor/app/reactions/client/init.ts +++ b/apps/meteor/app/reactions/client/init.ts @@ -13,8 +13,8 @@ Meteor.startup(() => { context: ['message', 'message-mobile', 'threads', 'federated', 'videoconf', 'videoconf-threads'], action(event, props) { const { message = messageArgs(this).msg, chat } = props; - event.stopPropagation(); - chat?.emojiPicker.open(event.currentTarget! as Element, (emoji) => sdk.call('setReaction', `:${emoji}:`, message._id)); + event?.stopPropagation(); + chat?.emojiPicker.open(event?.currentTarget as Element, (emoji) => sdk.call('setReaction', `:${emoji}:`, message._id)); }, condition({ message, user, room, subscription }) { if (!room) { diff --git a/apps/meteor/app/reactions/server/setReaction.ts b/apps/meteor/app/reactions/server/setReaction.ts index 50ffe76810dc..36eaab695512 100644 --- a/apps/meteor/app/reactions/server/setReaction.ts +++ b/apps/meteor/app/reactions/server/setReaction.ts @@ -1,3 +1,4 @@ +import { Apps, AppEvents } from '@rocket.chat/apps'; import { api } from '@rocket.chat/core-services'; import type { IMessage, IRoom, IUser } from '@rocket.chat/core-typings'; import { Messages, EmojiCustom, Rooms, Users } from '@rocket.chat/models'; @@ -5,9 +6,9 @@ import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; -import { AppEvents, Apps } from '../../../ee/server/apps/orchestrator'; import { callbacks } from '../../../lib/callbacks'; import { i18n } from '../../../server/lib/i18n'; +import { broadcastMessageFromData } from '../../../server/modules/watchers/lib/messages'; import { canAccessRoomAsync } from '../../authorization/server'; import { hasPermissionAsync } from '../../authorization/server/functions/hasPermission'; import { emoji } from '../../emoji/server'; @@ -105,7 +106,11 @@ async function setReaction(room: IRoom, user: IUser, message: IMessage, reaction isReacted = true; } - await Apps.triggerEvent(AppEvents.IPostMessageReacted, message, user, reaction, isReacted); + await Apps.self?.triggerEvent(AppEvents.IPostMessageReacted, message, user, reaction, isReacted); + + void broadcastMessageFromData({ + id: message._id, + }); } export async function executeSetReaction(userId: string, reaction: string, messageId: IMessage['_id'], shouldReact?: boolean) { diff --git a/apps/meteor/app/retention-policy/server/cronPruneMessages.ts b/apps/meteor/app/retention-policy/server/cronPruneMessages.ts index 6ab3ff1de226..fb0e691abd69 100644 --- a/apps/meteor/app/retention-policy/server/cronPruneMessages.ts +++ b/apps/meteor/app/retention-policy/server/cronPruneMessages.ts @@ -24,6 +24,8 @@ async function job(): Promise { const ignoreDiscussion = settings.get('RetentionPolicy_DoNotPruneDiscussion'); const ignoreThreads = settings.get('RetentionPolicy_DoNotPruneThreads'); + const ignoreDiscussionQuery = ignoreDiscussion ? { prid: { $exists: false } } : {}; + // get all rooms with default values for await (const type of types) { const maxAge = maxTimes[type] || 0; @@ -34,6 +36,7 @@ async function job(): Promise { 't': type, '$or': [{ 'retention.enabled': { $eq: true } }, { 'retention.enabled': { $exists: false } }], 'retention.overrideGlobal': { $ne: true }, + ...ignoreDiscussionQuery, }, { projection: { _id: 1 } }, ).toArray(); @@ -56,6 +59,7 @@ async function job(): Promise { 'retention.enabled': { $eq: true }, 'retention.overrideGlobal': { $eq: true }, 'retention.maxAge': { $gte: 0 }, + ...ignoreDiscussionQuery, }, { projection: { _id: 1, retention: 1 } }, ).toArray(); diff --git a/apps/meteor/app/search/server/search.internalService.ts b/apps/meteor/app/search/server/search.internalService.ts index 97de49711284..2fbaa2e1da31 100644 --- a/apps/meteor/app/search/server/search.internalService.ts +++ b/apps/meteor/app/search/server/search.internalService.ts @@ -36,10 +36,10 @@ class Search extends ServiceClassInternal { const service = new Search(); -settings.watch('Search.Provider', () => { +settings.watch('Search.Provider', async () => { if (searchProviderService.activeProvider?.on) { api.registerService(service); } else { - api.destroyService(service); + await api.destroyService(service); } }); diff --git a/apps/meteor/app/slackbridge/server/SlackAPI.js b/apps/meteor/app/slackbridge/server/SlackAPI.js index 63774024dc7e..540aa3b91160 100644 --- a/apps/meteor/app/slackbridge/server/SlackAPI.js +++ b/apps/meteor/app/slackbridge/server/SlackAPI.js @@ -1,15 +1,17 @@ import { serverFetch as fetch } from '@rocket.chat/server-fetch'; export class SlackAPI { - constructor(apiToken) { - this.apiToken = apiToken; + constructor(apiOrBotToken) { + this.token = apiOrBotToken; } async getChannels(cursor = null) { let channels = []; const request = await fetch('https://slack.com/api/conversations.list', { + headers: { + Authorization: `Bearer ${this.token}`, + }, params: { - token: this.apiToken, types: 'public_channel', exclude_archived: true, limit: 1000, @@ -32,8 +34,10 @@ export class SlackAPI { async getGroups(cursor = null) { let groups = []; const request = await fetch('https://slack.com/api/conversations.list', { + headers: { + Authorization: `Bearer ${this.token}`, + }, params: { - token: this.apiToken, types: 'private_channel', exclude_archived: true, limit: 1000, @@ -55,8 +59,10 @@ export class SlackAPI { async getRoomInfo(roomId) { const request = await fetch(`https://slack.com/api/conversations.info`, { + headers: { + Authorization: `Bearer ${this.token}`, + }, params: { - token: this.apiToken, channel: roomId, include_num_members: true, }, @@ -73,8 +79,10 @@ export class SlackAPI { for (let index = 0; index < num_members; index += MAX_MEMBERS_PER_CALL) { // eslint-disable-next-line no-await-in-loop const request = await fetch('https://slack.com/api/conversations.members', { + headers: { + Authorization: `Bearer ${this.token}`, + }, params: { - token: this.apiToken, channel: channelId, limit: MAX_MEMBERS_PER_CALL, ...(currentCursor && { cursor: currentCursor }), @@ -95,6 +103,9 @@ export class SlackAPI { async react(data) { const request = await fetch('https://slack.com/api/reactions.add', { + headers: { + Authorization: `Bearer ${this.token}`, + }, method: 'POST', params: data, }); @@ -104,6 +115,9 @@ export class SlackAPI { async removeReaction(data) { const request = await fetch('https://slack.com/api/reactions.remove', { + headers: { + Authorization: `Bearer ${this.token}`, + }, method: 'POST', params: data, }); @@ -113,6 +127,9 @@ export class SlackAPI { async removeMessage(data) { const request = await fetch('https://slack.com/api/chat.delete', { + headers: { + Authorization: `Bearer ${this.token}`, + }, method: 'POST', params: data, }); @@ -122,6 +139,9 @@ export class SlackAPI { async sendMessage(data) { const request = await fetch('https://slack.com/api/chat.postMessage', { + headers: { + Authorization: `Bearer ${this.token}`, + }, method: 'POST', params: data, }); @@ -130,6 +150,9 @@ export class SlackAPI { async updateMessage(data) { const request = await fetch('https://slack.com/api/chat.update', { + headers: { + Authorization: `Bearer ${this.token}`, + }, method: 'POST', params: data, }); @@ -137,12 +160,12 @@ export class SlackAPI { return response && request.status === 200 && response && request.ok; } - async getHistory(family, options) { - const request = await fetch(`https://slack.com/api/${family}.history`, { - params: { - token: this.apiToken, - ...options, + async getHistory(options) { + const request = await fetch(`https://slack.com/api/conversations.history`, { + headers: { + Authorization: `Bearer ${this.token}`, }, + params: options, }); const response = await request.json(); return response; @@ -150,8 +173,10 @@ export class SlackAPI { async getPins(channelId) { const request = await fetch('https://slack.com/api/pins.list', { + headers: { + Authorization: `Bearer ${this.token}`, + }, params: { - token: this.apiToken, channel: channelId, }, }); @@ -161,12 +186,38 @@ export class SlackAPI { async getUser(userId) { const request = await fetch('https://slack.com/api/users.info', { + headers: { + Authorization: `Bearer ${this.token}`, + }, params: { - token: this.apiToken, user: userId, }, }); const response = await request.json(); return response && response && request.status === 200 && request.ok && response.user; } + + static async verifyToken(token) { + const request = await fetch('https://slack.com/api/auth.test', { + headers: { + Authorization: `Bearer ${token}`, + }, + method: 'POST', + }); + const response = await request.json(); + return response && response && request.status === 200 && request.ok && response.ok; + } + + static async verifyAppCredentials({ botToken, appToken }) { + const request = await fetch('https://slack.com/api/apps.connections.open', { + headers: { + Authorization: `Bearer ${appToken}`, + }, + method: 'POST', + }); + const response = await request.json(); + const isAppTokenOk = response && response && request.status === 200 && request.ok && response.ok; + const isBotTokenOk = await this.verifyToken(botToken); + return isAppTokenOk && isBotTokenOk; + } } diff --git a/apps/meteor/app/slackbridge/server/SlackAdapter.js b/apps/meteor/app/slackbridge/server/SlackAdapter.js index d5379c082507..78d48deb4993 100644 --- a/apps/meteor/app/slackbridge/server/SlackAdapter.js +++ b/apps/meteor/app/slackbridge/server/SlackAdapter.js @@ -4,6 +4,7 @@ import url from 'url'; import { Message } from '@rocket.chat/core-services'; import { Messages, Rooms, Users, ReadReceipts } from '@rocket.chat/models'; +import { App as SlackApp } from '@slack/bolt'; import { RTMClient } from '@slack/rtm-api'; import { Meteor } from 'meteor/meteor'; @@ -28,6 +29,8 @@ export default class SlackAdapter { this.slackBridge = slackBridge; this.rtm = {}; // slack-client Real Time Messaging API this.apiToken = {}; // Slack API Token passed in via Connect + this.slackApp = {}; + this.appCredential = {}; // On Slack, a rocket integration bot will be added to slack channels, this is the list of those channels, key is Rocket Ch ID this.slackChannelRocketBotMembershipMap = new Map(); // Key=RocketChannelID, Value=SlackChannel this.rocket = {}; @@ -37,48 +40,96 @@ export default class SlackAdapter { this.slackAPI = {}; } + async connect({ apiToken, appCredential }) { + try { + const connectResult = await (appCredential ? this.connectApp(appCredential) : this.connectLegacy(apiToken)); + + if (connectResult) { + slackLogger.info('Connected to Slack'); + slackLogger.debug('Slack connection result: ', connectResult); + Meteor.startup(async () => { + try { + await this.populateMembershipChannelMap(); // If run outside of Meteor.startup, HTTP is not defined + } catch (err) { + slackLogger.error({ msg: 'Error attempting to connect to Slack', err }); + if (err.data.error === 'invalid_auth') { + slackLogger.error('The provided token is invalid'); + } + this.slackBridge.disconnect(); + } + }); + } + } catch (err) { + slackLogger.error({ msg: 'Error attempting to connect to Slack', err }); + this.slackBridge.disconnect(); + } + } + + /** + * Connect to the remote Slack server using the passed in app credential and register for Slack events. + * @typedef {Object} AppCredential + * @property {string} botToken + * @property {string} appToken + * @property {string} signingSecret + * @param {AppCredential} appCredential + */ + async connectApp(appCredential) { + this.appCredential = appCredential; + + // Invalid app credentials causes unhandled errors + if (!(await SlackAPI.verifyAppCredentials(appCredential))) { + throw new Error('Invalid app credentials (botToken or appToken) for the slack app'); + } + this.slackAPI = new SlackAPI(this.appCredential.botToken); + + this.slackApp = new SlackApp({ + appToken: this.appCredential.appToken, + signingSecret: this.appCredential.signingSecret, + token: this.appCredential.botToken, + socketMode: true, + }); + + this.registerForEvents(); + + const connectionResult = await this.slackApp.start(); + + return connectionResult; + } + /** - * Connect to the remote Slack server using the passed in token API and register for Slack events + * Connect to the remote Slack server using the passed in token API and register for Slack events. * @param apiToken + * @deprecated */ - async connect(apiToken) { + async connectLegacy(apiToken) { this.apiToken = apiToken; + // Invalid apiToken causes unhandled errors + if (!(await SlackAPI.verifyToken(apiToken))) { + throw new Error('Invalid ApiToken for the slack legacy bot integration'); + } + if (RTMClient != null) { RTMClient.disconnect; } this.slackAPI = new SlackAPI(this.apiToken); this.rtm = new RTMClient(this.apiToken); - await this.rtm - .start() - .then((res) => slackLogger.debug('Connecting to slack', res)) - .catch((err) => { - slackLogger.error({ msg: 'Error attempting to connect to Slack', err }); - if (err.data.error === 'invalid_auth') { - throw new Error('The provided token is invalid'); - } - throw new Error(err); - }); + this.registerForEventsLegacy(); - this.registerForEvents(); + const connectionResult = await this.rtm.start(); - Meteor.startup(async () => { - try { - await this.populateMembershipChannelMap(); // If run outside of Meteor.startup, HTTP is not defined - } catch (err) { - slackLogger.error({ msg: 'Error attempting to connect to Slack', err }); - this.slackBridge.disconnect(); - } - }); + return connectionResult; } /** * Unregister for slack events and disconnect from Slack */ - disconnect() { + async disconnect() { if (this.rtm.connected && this.rtm.disconnect) { - this.rtm.disconnect(); + await this.rtm.disconnect(); + } else if (this.slackApp.stop) { + await this.slackApp.stop(); } } @@ -87,6 +138,119 @@ export default class SlackAdapter { } registerForEvents() { + /** + * message: { + * "client_msg_id": "caab144d-41e7-47cc-87fa-af5d50c02784", + * "type": "message", + * "text": "heyyyyy", + * "user": "U060WD4QW81", + * "ts": "1697054782.214569", + * "blocks": [], + * "team": "T060383CUDV", + * "channel": "C060HSLQPCN", + * "event_ts": "1697054782.214569", + * "channel_type": "channel" + * } + */ + this.slackApp.message(async ({ message }) => { + slackLogger.debug('OnSlackEvent-MESSAGE: ', message); + if (message) { + try { + await this.onMessage(message); + } catch (err) { + slackLogger.error({ msg: 'Unhandled error onMessage', err }); + } + } + }); + + /** + * Event fired when a message is reacted in a channel or group app is added in + * event: { + * "type": "reaction_added", + * "user": "U060WD4QW81", + * "reaction": "telephone_receiver", + * "item": { + * "type": "message", + * "channel": "C06196XMUMN", + * "ts": "1697037020.309679" + * }, + * "item_user": "U060WD4QW81", + * "event_ts": "1697037219.001600" + * } + */ + this.slackApp.event('reaction_added', async ({ event }) => { + slackLogger.debug('OnSlackEvent-REACTION_ADDED: ', event); + try { + slackLogger.error({ event }); + await this.onReactionAdded(event); + } catch (err) { + slackLogger.error({ msg: 'Unhandled error onReactionAdded', err }); + } + }); + + /** + * Event fired when a reaction is removed from a message in a channel or group app is added in. + * event: { + * "type": "reaction_removed", + * "user": "U060WD4QW81", + * "reaction": "raised_hands", + * "item": { + * "type": "message", + * "channel": "C06196XMUMN", + * "ts": "1697028997.057629" + * }, + * "item_user": "U060WD4QW81", + * "event_ts": "1697029220.000600" + * } + */ + this.slackApp.event('reaction_removed', async ({ event }) => { + slackLogger.debug('OnSlackEvent-REACTION_REMOVED: ', event); + try { + await this.onReactionRemoved(event); + } catch (err) { + slackLogger.error({ msg: 'Unhandled error onReactionRemoved', err }); + } + }); + + /** + * Event fired when a members joins a channel + * event: { + * "type": "member_joined_channel", + * "user": "U06039U8WK1", + * "channel": "C060HT033E2", + * "channel_type": "C", + * "team": "T060383CUDV", + * "inviter": "U060WD4QW81", + * "event_ts": "1697042377.000800" + * } + */ + this.slackApp.event('member_joined_channel', async ({ event, context }) => { + slackLogger.debug('OnSlackEvent-CHANNEL_LEFT: ', event); + try { + await this.processMemberJoinChannel(event, context); + } catch (err) { + slackLogger.error({ msg: 'Unhandled error onChannelLeft', err }); + } + }); + + this.slackApp.event('channel_left', async ({ event }) => { + slackLogger.debug('OnSlackEvent-CHANNEL_LEFT: ', event); + try { + this.onChannelLeft(event); + } catch (err) { + slackLogger.error({ msg: 'Unhandled error onChannelLeft', err }); + } + }); + + this.slackApp.error((error) => { + slackLogger.error({ msg: 'Error on SlackApp', error }); + }); + } + + /** + * @deprecated + */ + registerForEventsLegacy() { slackLogger.debug('Register for events'); this.rtm.on('authenticated', () => { slackLogger.info('Connected to Slack'); @@ -586,7 +750,6 @@ export default class SlackAdapter { async postReactionAdded(reaction, slackChannel, slackTS) { if (reaction && slackChannel && slackTS) { const data = { - token: this.apiToken, name: reaction, channel: slackChannel, timestamp: slackTS, @@ -606,7 +769,6 @@ export default class SlackAdapter { async postReactionRemove(reaction, slackChannel, slackTS) { if (reaction && slackChannel && slackTS) { const data = { - token: this.apiToken, name: reaction, channel: slackChannel, timestamp: slackTS, @@ -626,7 +788,6 @@ export default class SlackAdapter { if (slackChannel != null) { const data = { - token: this.apiToken, ts: this.getTimeStamp(rocketMessage), channel: this.getSlackChannel(rocketMessage.rid).id, as_user: true, @@ -681,7 +842,6 @@ export default class SlackAdapter { iconUrl = Meteor.absoluteUrl().replace(/\/$/, '') + iconUrl; } const data = { - token: this.apiToken, text: rocketMessage.msg, channel: slackChannel.id, username: rocketMessage.u && rocketMessage.u.username, @@ -722,7 +882,6 @@ export default class SlackAdapter { async postMessageUpdate(slackChannel, rocketMessage) { if (slackChannel && slackChannel.id) { const data = { - token: this.apiToken, ts: this.getTimeStamp(rocketMessage), channel: slackChannel.id, text: rocketMessage.msg, @@ -736,6 +895,18 @@ export default class SlackAdapter { } } + async processMemberJoinChannel(event, context) { + slackLogger.debug('Member join channel', event.channel); + const rocketCh = await this.rocket.getChannel({ channel: event.channel }); + if (rocketCh != null) { + this.addSlackChannel(rocketCh._id, event.channel); + if (context?.botUserId !== event?.user) { + const rocketChatUser = await this.rocket.getUser(event.user); + await addUserToRoom(rocketCh._id, rocketChatUser); + } + } + } + async processChannelJoin(slackMessage) { slackLogger.debug('Channel join', slackMessage.channel.id); const rocketCh = await this.rocket.addChannel(slackMessage.channel); @@ -998,6 +1169,7 @@ export default class SlackAdapter { async processPinnedItemMessage(rocketChannel, rocketUser, slackMessage, isImporting) { if (slackMessage.attachments && slackMessage.attachments[0] && slackMessage.attachments[0].text) { + // TODO: refactor this logic to use the service to send this system message instead of using sendMessage const rocketMsgObj = { rid: rocketChannel._id, t: 'message_pinned', @@ -1142,9 +1314,9 @@ export default class SlackAdapter { }); } - async importFromHistory(family, options) { + async importFromHistory(options) { slackLogger.debug('Importing messages history'); - const data = await this.slackAPI.getHistory(family, options); + const data = await this.slackAPI.getHistory(options); if (Array.isArray(data.messages) && data.messages.length) { let latest = 0; for await (const message of data.messages.reverse()) { @@ -1209,6 +1381,7 @@ export default class SlackAdapter { for await (const pin of items) { if (pin.message) { const user = await this.rocket.findUser(pin.message.user); + // TODO: send this system message to the room as well (using the service) const msgObj = { rid, t: 'message_pinned', @@ -1245,13 +1418,14 @@ export default class SlackAdapter { await this.copyChannelInfo(rid, this.getSlackChannel(rid)); slackLogger.debug('Importing messages from Slack to Rocket.Chat', this.getSlackChannel(rid), rid); - let results = await this.importFromHistory(this.getSlackChannel(rid).family, { + + let results = await this.importFromHistory({ channel: this.getSlackChannel(rid).id, oldest: 1, }); while (results && results.has_more) { // eslint-disable-next-line no-await-in-loop - results = await this.importFromHistory(this.getSlackChannel(rid).family, { + results = await this.importFromHistory({ channel: this.getSlackChannel(rid).id, oldest: results.ts, }); diff --git a/apps/meteor/app/slackbridge/server/slackbridge.js b/apps/meteor/app/slackbridge/server/slackbridge.js index 3198b750145f..b5983e7fff58 100644 --- a/apps/meteor/app/slackbridge/server/slackbridge.js +++ b/apps/meteor/app/slackbridge/server/slackbridge.js @@ -1,3 +1,5 @@ +import { debounce } from 'lodash'; + import { settings } from '../../settings/server'; import RocketAdapter from './RocketAdapter.js'; import SlackAdapter from './SlackAdapter.js'; @@ -8,6 +10,8 @@ import { classLogger, connLogger } from './logger'; */ class SlackBridgeClass { constructor() { + this.isEnabled = false; + this.isLegacyRTM = true; this.slackAdapters = []; this.rocket = new RocketAdapter(this); this.reactionsMap = new Map(); // Sync object between rocket and slack @@ -17,6 +21,9 @@ class SlackBridgeClass { // Settings that we cache versus looking up at runtime this.apiTokens = false; + this.botTokens = false; + this.appTokens = false; + this.signingSecrets = false; this.aliasFormat = ''; this.excludeBotnames = ''; this.isReactionsEnabled = true; @@ -29,16 +36,43 @@ class SlackBridgeClass { this.slackAdapters = []; this.rocket.clearSlackAdapters(); - const tokenList = this.apiTokens.split('\n'); + if (this.isLegacyRTM) { + const tokenList = this.apiTokens.split('\n'); + + tokenList.forEach((apiToken) => { + const slack = new SlackAdapter(this); + slack.setRocket(this.rocket); + this.rocket.addSlack(slack); + this.slackAdapters.push(slack); - tokenList.forEach((apiToken) => { - const slack = new SlackAdapter(this); - slack.setRocket(this.rocket); - this.rocket.addSlack(slack); - this.slackAdapters.push(slack); + slack.connect({ apiToken }).catch((err) => connLogger.error('error connecting to slack', err)); + }); + } else { + const botTokenList = this.botTokens.split('\n'); // Bot token list + const appTokenList = this.appTokens.split('\n'); // App token list + const signingSecretList = this.signingSecrets.split('\n'); // Signing secret list + + // Check if the number of tokens are the same + if (botTokenList.length !== appTokenList.length || botTokenList.length !== signingSecretList.length) { + connLogger.error('error connecting to slack: number of tokens are not the same'); + return; + } - slack.connect(apiToken).catch((err) => connLogger.error('error connecting to slack', err)); - }); + const appCredentials = botTokenList.map((botToken, i) => ({ + botToken, + appToken: appTokenList[i], + signingSecret: signingSecretList[i], + })); + + appCredentials.forEach((appCredential) => { + const slack = new SlackAdapter(this); + slack.setRocket(this.rocket); + this.rocket.addSlack(slack); + this.slackAdapters.push(slack); + + slack.connect({ appCredential }).catch((err) => connLogger.error('error connecting to slack', err)); + }); + } if (settings.get('SlackBridge_Out_Enabled')) { this.rocket.connect(); @@ -49,27 +83,76 @@ class SlackBridgeClass { } } - disconnect() { - if (this.connected === true) { - this.rocket.disconnect(); - this.slackAdapters.forEach((slack) => { - slack.disconnect(); - }); - this.slackAdapters = []; - this.connected = false; - connLogger.info('Disabled'); + async reconnect() { + await this.disconnect(); + // connect if either apiTokens or appCredentials are set + if (this.isLegacyRTM && this.apiTokens) { + this.connect(); + } else if (!this.isLegacyRTM && this.botTokens && this.appTokens && this.signingSecrets) { + this.connect(); + } + } + + debouncedReconnectIfEnabled = debounce(() => { + if (this.isEnabled) { + this.reconnect(); + } + }, 500); + + async disconnect() { + try { + if (this.connected === true) { + await this.rocket.disconnect(); + await Promise.all(this.slackAdapters.map((slack) => slack.disconnect())); + this.slackAdapters = []; + this.connected = false; + connLogger.info('Slack Bridge Disconnected'); + } + } catch (error) { + connLogger.error('An error occurred during disconnection', error); } } processSettings() { + // Check if legacy realtime api is enabled + settings.watch('SlackBridge_UseLegacy', (value) => { + if (value !== this.isLegacyRTM) { + this.isLegacyRTM = value; + this.debouncedReconnectIfEnabled(); + } + classLogger.debug('Setting: SlackBridge_UseLegacy', value); + }); + + // Slack installtion Bot token + settings.watch('SlackBridge_BotToken', (value) => { + if (value !== this.botTokens) { + this.botTokens = value; + this.debouncedReconnectIfEnabled(); + } + classLogger.debug('Setting: SlackBridge_BotToken', value); + }); + // Slack installtion App token + settings.watch('SlackBridge_AppToken', (value) => { + if (value !== this.appTokens) { + this.appTokens = value; + this.debouncedReconnectIfEnabled(); + } + classLogger.debug('Setting: SlackBridge_AppToken', value); + }); + // Slack installtion Signing token + settings.watch('SlackBridge_SigningSecret', (value) => { + if (value !== this.signingSecrets) { + this.signingSecrets = value; + this.debouncedReconnectIfEnabled(); + } + classLogger.debug('Setting: SlackBridge_SigningSecret', value); + }); + // Slack installation API token settings.watch('SlackBridge_APIToken', (value) => { if (value !== this.apiTokens) { this.apiTokens = value; - if (this.connected) { - this.disconnect(); - this.connect(); - } + this.debouncedReconnectIfEnabled(); } classLogger.debug('Setting: SlackBridge_APIToken', value); @@ -95,10 +178,13 @@ class SlackBridgeClass { // Is this entire SlackBridge enabled settings.watch('SlackBridge_Enabled', (value) => { - if (value && this.apiTokens) { - this.connect(); - } else { - this.disconnect(); + if (this.isEnabled !== value) { + this.isEnabled = value; + if (this.isEnabled) { + this.debouncedReconnectIfEnabled(); + } else { + this.disconnect(); + } } classLogger.debug('Setting: SlackBridge_Enabled', value); }); diff --git a/apps/meteor/app/slashcommands-archiveroom/server/server.ts b/apps/meteor/app/slashcommands-archiveroom/server/server.ts index 46708c667678..99bcec2cd7b3 100644 --- a/apps/meteor/app/slashcommands-archiveroom/server/server.ts +++ b/apps/meteor/app/slashcommands-archiveroom/server/server.ts @@ -4,7 +4,10 @@ import { isRegisterUser } from '@rocket.chat/core-typings'; import { Users, Rooms } from '@rocket.chat/models'; import { Meteor } from 'meteor/meteor'; +import { RoomMemberActions } from '../../../definition/IRoomTypeConfig'; import { i18n } from '../../../server/lib/i18n'; +import { roomCoordinator } from '../../../server/lib/rooms/roomCoordinator'; +import { hasPermissionAsync } from '../../authorization/server/functions/hasPermission'; import { archiveRoom } from '../../lib/server/functions/archiveRoom'; import { settings } from '../../settings/server'; import { slashCommands } from '../../utils/lib/slashCommand'; @@ -25,6 +28,7 @@ slashCommands.add({ channel = channel.replace('#', ''); room = await Rooms.findOneByName(channel); } + if (!userId) { return; } @@ -45,9 +49,12 @@ slashCommands.add({ return; } - // You can not archive direct messages. - if (room.t === 'd') { - return; + if (!(await roomCoordinator.getRoomDirectives(room.t).allowMemberAction(room, RoomMemberActions.ARCHIVE, userId))) { + throw new Meteor.Error('error-room-type-not-archivable', `Room type: ${room.t} can not be archived`); + } + + if (!(await hasPermissionAsync(userId, 'archive-room', room._id))) { + throw new Meteor.Error('error-not-authorized', 'Not authorized'); } if (room.archived) { diff --git a/apps/meteor/app/slashcommands-unarchiveroom/server/server.ts b/apps/meteor/app/slashcommands-unarchiveroom/server/server.ts index 9c6a68b31155..d87981bd65a2 100644 --- a/apps/meteor/app/slashcommands-unarchiveroom/server/server.ts +++ b/apps/meteor/app/slashcommands-unarchiveroom/server/server.ts @@ -7,6 +7,7 @@ import { Meteor } from 'meteor/meteor'; import { RoomMemberActions } from '../../../definition/IRoomTypeConfig'; import { i18n } from '../../../server/lib/i18n'; import { roomCoordinator } from '../../../server/lib/rooms/roomCoordinator'; +import { hasPermissionAsync } from '../../authorization/server/functions/hasPermission'; import { unarchiveRoom } from '../../lib/server/functions/unarchiveRoom'; import { settings } from '../../settings/server'; import { slashCommands } from '../../utils/lib/slashCommand'; @@ -47,9 +48,12 @@ slashCommands.add({ return; } - // You can not archive direct messages. if (!(await roomCoordinator.getRoomDirectives(room.t).allowMemberAction(room, RoomMemberActions.ARCHIVE, userId))) { - return; + throw new Meteor.Error('error-room-type-not-unarchivable', `Room type: ${room.t} can not be unarchived`); + } + + if (!(await hasPermissionAsync(userId, 'unarchive-room', room._id))) { + throw new Meteor.Error('error-not-authorized', 'Not authorized'); } if (!room.archived) { diff --git a/apps/meteor/app/smarsh-connector/server/functions/generateEml.ts b/apps/meteor/app/smarsh-connector/server/functions/generateEml.ts index f2b6ff355730..ce110cbff430 100644 --- a/apps/meteor/app/smarsh-connector/server/functions/generateEml.ts +++ b/apps/meteor/app/smarsh-connector/server/functions/generateEml.ts @@ -90,7 +90,12 @@ export const generateEml = async (): Promise => { if (message.t) { const messageType = MessageTypes.getType(message); if (messageType) { - rows.push(i18n.t(messageType.message, messageType.data ? messageType.data(message) : {}, 'en')); + rows.push( + i18n.t(messageType.message, { + lng: 'en', + replace: messageType.data ? messageType.data(message) : {}, + }), + ); } else { rows.push(`${message.msg} (${message.t})`); } diff --git a/apps/meteor/app/spotify/lib/spotify.ts b/apps/meteor/app/spotify/lib/spotify.ts deleted file mode 100644 index 46683fdba2b4..000000000000 --- a/apps/meteor/app/spotify/lib/spotify.ts +++ /dev/null @@ -1,46 +0,0 @@ -import type { IMessage } from '@rocket.chat/core-typings'; - -const process = ( - message: IMessage, - source: string, - callback: (msg: IMessage, msgParts: string[], index: number, part: string) => void, -): void => { - if (!source?.trim()) { - return; - } - - const msgParts = source.split(/(```\w*[\n ]?[\s\S]*?```+?)|(`(?:[^`]+)`)/); - for (let index = 0; index < msgParts.length; index++) { - const part = msgParts[index]; - if (!/(?:```(\w*)[\n ]?([\s\S]*?)```+?)|(?:`(?:[^`]+)`)/.test(part)) { - callback(message, msgParts, index, part); - } - } -}; - -export const createSpotifyBeforeSaveMessageHandler = - (): ((msg: IMessage) => IMessage) => - (message: IMessage): IMessage => { - const urls = Array.isArray(message.urls) ? message.urls : []; - - let changed = false; - - process(message, message.msg, (_message: IMessage, _msgParts: string[], _index: number, part: string) => { - const re = /(?:^|\s)spotify:([^:\s]+):([^:\s]+)(?::([^:\s]+))?(?::(\S+))?(?:\s|$)/g; - - let match; - while ((match = re.exec(part)) != null) { - const data = match.slice(1).filter(Boolean); - const path = data.map((value) => encodeURI(value)).join('/'); - const url = `https://open.spotify.com/${path}`; - urls.push({ url, source: `spotify:${data.join(':')}`, meta: {} }); - changed = true; - } - }); - - if (changed) { - message.urls = urls; - } - - return message; - }; diff --git a/apps/meteor/app/spotify/server/index.ts b/apps/meteor/app/spotify/server/index.ts deleted file mode 100644 index f12b38c6b38b..000000000000 --- a/apps/meteor/app/spotify/server/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Meteor } from 'meteor/meteor'; - -import { callbacks } from '../../../lib/callbacks'; -import { createSpotifyBeforeSaveMessageHandler } from '../lib/spotify'; - -Meteor.startup(() => { - const beforeSaveMessage = createSpotifyBeforeSaveMessageHandler(); - - callbacks.add('beforeSaveMessage', beforeSaveMessage, callbacks.priority.LOW, 'spotify-save'); -}); diff --git a/apps/meteor/app/statistics/server/lib/SAUMonitor.ts b/apps/meteor/app/statistics/server/lib/SAUMonitor.ts index b3aa68337106..0db63a929491 100644 --- a/apps/meteor/app/statistics/server/lib/SAUMonitor.ts +++ b/apps/meteor/app/statistics/server/lib/SAUMonitor.ts @@ -146,7 +146,7 @@ export class SAUMonitorClass { const searchTerm = this._getSearchTerm(data); - await Sessions.insertOne({ ...data, searchTerm, createdAt: new Date() }); + await Sessions.createOrUpdate({ ...data, searchTerm }); } private async _finishSessionsFromDate(yesterday: Date, today: Date): Promise { diff --git a/apps/meteor/app/statistics/server/lib/getAppsStatistics.js b/apps/meteor/app/statistics/server/lib/getAppsStatistics.js index 6337b287506a..1d84bead3e85 100644 --- a/apps/meteor/app/statistics/server/lib/getAppsStatistics.js +++ b/apps/meteor/app/statistics/server/lib/getAppsStatistics.js @@ -1,17 +1,18 @@ +import { Apps } from '@rocket.chat/apps'; import { AppStatus } from '@rocket.chat/apps-engine/definition/AppStatus'; -import { Apps } from '../../../../ee/server/apps'; import { Info } from '../../../utils/rocketchat.info'; export function getAppsStatistics() { return { engineVersion: Info.marketplaceApiVersion, - totalInstalled: Apps.isInitialized() && Apps.getManager().get().length, - totalActive: Apps.isInitialized() && Apps.getManager().get({ enabled: true }).length, + totalInstalled: (Apps.self?.isInitialized() && Apps.getManager().get().length) ?? 0, + totalActive: (Apps.self?.isInitialized() && Apps.getManager().get({ enabled: true }).length) ?? 0, totalFailed: - Apps.isInitialized() && - Apps.getManager() - .get({ disabled: true }) - .filter(({ app: { status } }) => status !== AppStatus.MANUALLY_DISABLED).length, + (Apps.self?.isInitialized() && + Apps.getManager() + .get({ disabled: true }) + .filter(({ app: { status } }) => status !== AppStatus.MANUALLY_DISABLED).length) ?? + 0, }; } diff --git a/apps/meteor/app/statistics/server/lib/statistics.ts b/apps/meteor/app/statistics/server/lib/statistics.ts index 1d60def846b5..8887f4ce36f2 100644 --- a/apps/meteor/app/statistics/server/lib/statistics.ts +++ b/apps/meteor/app/statistics/server/lib/statistics.ts @@ -305,18 +305,30 @@ export const statistics = { ); // Message statistics - statistics.totalChannelMessages = (await Rooms.findByType('c', { projection: { msgs: 1 } }).toArray()).reduce( - function _countChannelMessages(num: number, room: IRoom) { + const channels = await Rooms.findByType('c', { projection: { msgs: 1, prid: 1 } }).toArray(); + const totalChannelDiscussionsMessages = await channels.reduce(function _countChannelDiscussionsMessages(num: number, room: IRoom) { + return num + (room.prid ? room.msgs : 0); + }, 0); + statistics.totalChannelMessages = + (await channels.reduce(function _countChannelMessages(num: number, room: IRoom) { return num + room.msgs; - }, - 0, - ); - statistics.totalPrivateGroupMessages = (await Rooms.findByType('p', { projection: { msgs: 1 } }).toArray()).reduce( - function _countPrivateGroupMessages(num: number, room: IRoom) { + }, 0)) - totalChannelDiscussionsMessages; + + const privateGroups = await Rooms.findByType('p', { projection: { msgs: 1, prid: 1 } }).toArray(); + const totalPrivateGroupsDiscussionsMessages = await privateGroups.reduce(function _countPrivateGroupsDiscussionsMessages( + num: number, + room: IRoom, + ) { + return num + (room.prid ? room.msgs : 0); + }, + 0); + statistics.totalPrivateGroupMessages = + (await privateGroups.reduce(function _countPrivateGroupMessages(num: number, room: IRoom) { return num + room.msgs; - }, - 0, - ); + }, 0)) - totalPrivateGroupsDiscussionsMessages; + + statistics.totalDiscussionsMessages = totalPrivateGroupsDiscussionsMessages + totalChannelDiscussionsMessages; + statistics.totalDirectMessages = (await Rooms.findByType('d', { projection: { msgs: 1 } }).toArray()).reduce( function _countDirectMessages(num: number, room: IRoom) { return num + room.msgs; @@ -332,6 +344,7 @@ export const statistics = { statistics.totalMessages = statistics.totalChannelMessages + statistics.totalPrivateGroupMessages + + statistics.totalDiscussionsMessages + statistics.totalDirectMessages + statistics.totalLivechatMessages; @@ -542,7 +555,7 @@ export const statistics = { statistics.totalLinkInvitationUses = await Invites.countUses(); statistics.totalEmailInvitation = settings.get('Invitation_Email_Count'); statistics.totalE2ERooms = await Rooms.findByE2E({ readPreference }).count(); - statistics.logoChange = Object.keys(settings.get('Assets_logo')).includes('url'); + statistics.logoChange = Object.keys(settings.get('Assets_logo') || {}).includes('url'); statistics.showHomeButton = settings.get('Layout_Show_Home_Button'); statistics.totalEncryptedMessages = await Messages.countByType('e2e', { readPreference }); statistics.totalManuallyAddedUsers = settings.get('Manual_Entry_User_Count'); @@ -579,7 +592,11 @@ export const statistics = { const defaultLoggedInCustomScript = (await Settings.findOneById('Custom_Script_Logged_In'))?.packageValue; statistics.loggedInCustomScriptChanged = settings.get('Custom_Script_Logged_In') !== defaultLoggedInCustomScript; - statistics.dailyPeakConnections = await Presence.getPeakConnections(true); + try { + statistics.dailyPeakConnections = await Presence.getPeakConnections(true); + } catch { + statistics.dailyPeakConnections = 0; + } const peak = await Statistics.findMonthlyPeakConnections(); statistics.maxMonthlyPeakConnections = Math.max(statistics.dailyPeakConnections, peak?.dailyPeakConnections || 0); @@ -598,7 +615,9 @@ export const statistics = { async save(): Promise { const rcStatistics = await statistics.get(); rcStatistics.createdAt = new Date(); - await Statistics.insertOne(rcStatistics); + const { insertedId } = await Statistics.insertOne(rcStatistics); + rcStatistics._id = insertedId; + return rcStatistics; }, }; diff --git a/apps/meteor/app/theme/client/imports/general/base.css b/apps/meteor/app/theme/client/imports/general/base.css index d1f4b8d11fb6..9aa9b6c5ea9f 100644 --- a/apps/meteor/app/theme/client/imports/general/base.css +++ b/apps/meteor/app/theme/client/imports/general/base.css @@ -34,7 +34,7 @@ body { } :focus { - outline: 0 !important; + outline: 0; outline-style: none; outline-color: transparent; } @@ -50,10 +50,6 @@ body { } } -a { - cursor: pointer; -} - button { padding: 0; diff --git a/apps/meteor/app/theme/client/imports/general/base_old.css b/apps/meteor/app/theme/client/imports/general/base_old.css index 7f1ede6067fc..cead4a2cb584 100644 --- a/apps/meteor/app/theme/client/imports/general/base_old.css +++ b/apps/meteor/app/theme/client/imports/general/base_old.css @@ -86,8 +86,6 @@ font-size: smaller; & a { - text-decoration: underline; - font-weight: bold !important; } } @@ -605,7 +603,7 @@ overflow: hidden; flex-direction: column; - margin: 5px 10px 0; + margin: 8px 10px 0; transition: transform 0.4s ease, visibility 0.3s ease, opacity 0.3s ease; transform: translateY(-10px); diff --git a/apps/meteor/app/theme/client/imports/general/reset.css b/apps/meteor/app/theme/client/imports/general/reset.css index ad5cbd9cddf2..425d9ff98319 100644 --- a/apps/meteor/app/theme/client/imports/general/reset.css +++ b/apps/meteor/app/theme/client/imports/general/reset.css @@ -137,7 +137,3 @@ table { border-collapse: collapse; } - -a { - color: var(--rcx-color-font-info, #095ad2); -} diff --git a/apps/meteor/app/theme/client/main.css b/apps/meteor/app/theme/client/main.css index 6c0a20d844bb..33b7a8f0d290 100644 --- a/apps/meteor/app/theme/client/main.css +++ b/apps/meteor/app/theme/client/main.css @@ -21,7 +21,6 @@ /* Legacy theming */ @import 'imports/general/theme_old.css'; -@import './vendor/photoswipe.css'; @import './vendor/fontello/css/fontello.css'; @import './rocketchat.font.css'; @import './mentionLink.css'; diff --git a/apps/meteor/app/theme/client/vendor/photoswipe.css b/apps/meteor/app/theme/client/vendor/photoswipe.css deleted file mode 100644 index 53f352ff7018..000000000000 --- a/apps/meteor/app/theme/client/vendor/photoswipe.css +++ /dev/null @@ -1,422 +0,0 @@ -.pswp__button { - position: relative; - - display: block; - float: right; - overflow: visible; - - width: 44px; - height: 44px; - margin: 0; - padding: 0; - - cursor: pointer; - transition: opacity 0.2s; - - opacity: 0.75; - border: 0; - background: none; - box-shadow: none; - appearance: none; - - &:focus, - &:hover { - opacity: 1; - } - - &:active { - opacity: 0.9; - outline: none; - } - - &::-moz-focus-inner { - padding: 0; - - border: 0; - } -} - -.pswp__ui--over-close .pswp__button--close { - opacity: 1; -} - -.pswp__button, -.pswp__button--arrow--left::before, -.pswp__button--arrow--right::before { - width: 44px; - height: 44px; - - background: url(/images/gallery-skin.svg) 0 0 no-repeat; - background-size: 264px 88px; -} - -@media (-webkit-min-device-pixel-ratio: 1.1), - (-webkit-min-device-pixel-ratio: 1.09375), - (min-resolution: 105dpi), - (min-resolution: 1.1dppx) { - .pswp--svg .pswp__button--arrow--left, - .pswp--svg .pswp__button--arrow--right { - background: none; - } -} - -.pswp__button--close { - background-position: 0 -44px; -} - -.pswp__button--share { - background-position: -44px -44px; -} - -.pswp__button--fs { - display: none; -} - -.pswp--supports-fs .pswp__button--fs { - display: block; -} - -.pswp--fs .pswp__button--fs { - background-position: -44px 0; -} - -.pswp__button--zoom { - display: none; - - background-position: -88px 0; -} - -.pswp--zoom-allowed .pswp__button--zoom { - display: block; -} - -.pswp--zoomed-in .pswp__button--zoom { - background-position: -132px 0; -} - -.pswp--touch .pswp__button--arrow--left, -.pswp--touch .pswp__button--arrow--right { - visibility: hidden; -} - -.pswp__button--arrow--left, -.pswp__button--arrow--right { - position: absolute; - top: 50%; - - width: 70px; - height: 100px; - margin-top: -50px; - - background: none; -} - -.pswp__button--arrow--left { - left: 0; -} - -.pswp__button--arrow--right { - right: 0; -} - -.pswp__button--arrow--left::before, -.pswp__button--arrow--right::before { - position: absolute; - top: 35px; - - width: 32px; - height: 30px; - - content: ''; - - background-color: rgba(0, 0, 0, 0.3); -} - -.pswp__button--arrow--left::before { - left: 6px; - - background-position: -138px -44px; -} - -.pswp__button--arrow--right::before { - right: 6px; - - background-position: -94px -44px; -} - -/* - - 4. Caption - - */ -.pswp__caption { - position: absolute; - bottom: 0; - left: 0; - - width: 100%; - min-height: 44px; - - & small { - color: #bbbbbb; - - font-size: 11px; - } -} - -.pswp__caption__center { - max-width: 420px; - margin: 0 auto; - padding: 10px; - - text-align: left; - - color: #cccccc; - - font-size: 13px; - line-height: 20px; -} - -.pswp__caption--empty { - display: none; -} - -/* Fake caption element, used to calculate height of next/prev image */ -.pswp__caption--fake { - visibility: hidden; -} - -/* - - 5. Loading indicator (preloader) - - You can play with it here - http://codepen.io/dimsemenov/pen/yyBWoR - - */ -.pswp__preloader { - position: absolute; - top: 0; - left: 50%; - - width: 44px; - height: 44px; - margin-left: -22px; - - transition: opacity 0.25s ease-out; - - opacity: 0; - direction: ltr; - will-change: opacity; -} - -.pswp__preloader__icn { - width: 20px; - height: 20px; - margin: 12px; -} - -.pswp__preloader--active { - opacity: 1; -} - -.pswp--css_animation { - & .pswp__preloader--active { - opacity: 1; - - & .pswp__preloader__icn { - position: absolute; - top: 15px; - left: 15px; - - width: 14px; - height: 14px; - margin: 0; - - animation: clockwise 500ms linear infinite; - - opacity: 0.75; - background: none; - } - - & .pswp__preloader__donut { - position: absolute; - top: 0; - left: 0; - - box-sizing: border-box; - width: 14px; - height: 14px; - margin: 0; - - animation: donut-rotate 1000ms cubic-bezier(0.4, 0, 0.22, 1) infinite; - - border: 1px solid #ffffff; - border-bottom-color: transparent; - border-left-color: transparent; - border-radius: 50%; - background: none; - } - - & .pswp__preloader__cut { - /* - The idea of animating inner circle is based on Polymer ("material") loading indicator - by Keanu Lee https://blog.keanulee.com/2014/10/20/the-tale-of-three-spinners.html - */ - position: relative; - - overflow: hidden; - - width: 7px; - height: 14px; - } - } -} - -@media screen and (max-width: 1024px) { - .pswp__preloader { - position: relative; - top: auto; - left: auto; - - float: right; - - margin: 0; - } -} - -@-webkit-keyframes clockwise { - 0% { - transform: rotate(0deg); - } - - 100% { - transform: rotate(360deg); - } -} - -@keyframes clockwise { - 0% { - transform: rotate(0deg); - } - - 100% { - transform: rotate(360deg); - } -} - -@-webkit-keyframes donut-rotate { - 0% { - transform: rotate(0); - } - - 50% { - transform: rotate(-140deg); - } - - 100% { - transform: rotate(0); - } -} - -@keyframes donut-rotate { - 0% { - transform: rotate(0); - } - - 50% { - transform: rotate(-140deg); - } - - 100% { - transform: rotate(0); - } -} - -/* - - 6. Additional styles - - */ - -/* root element of UI */ -.pswp__ui { - z-index: 1550; - - visibility: visible; - - opacity: 1; - -webkit-font-smoothing: auto; -} - -/* top black bar with buttons and "1 of X" indicator */ -.pswp__top-bar { - position: absolute; - top: 0; - left: 0; - - width: 100%; - height: 44px; -} - -.pswp__caption, -.pswp__top-bar, -.pswp--has_mouse .pswp__button--arrow--left, -.pswp--has_mouse .pswp__button--arrow--right { - transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1); - -webkit-backface-visibility: hidden; - will-change: opacity; -} - -/* pswp--has_mouse class is added only when two subsequent mousemove events occur */ -.pswp--has_mouse .pswp__button--arrow--left, -.pswp--has_mouse .pswp__button--arrow--right { - visibility: visible; -} - -.pswp__top-bar, -.pswp__caption { - background-color: rgba(0, 0, 0, 0.5); -} - -/* pswp__ui--fit class is added when main image "fits" between top bar and bottom bar (caption) */ -.pswp__ui--fit .pswp__top-bar, -.pswp__ui--fit .pswp__caption { - background-color: rgba(0, 0, 0, 0.3); -} - -/* pswp__ui--idle class is added when mouse isn't moving for several seconds (JS option timeToIdle) */ -.pswp__ui--idle .pswp__top-bar { - opacity: 0; -} - -.pswp__ui--idle .pswp__button--arrow--left, -.pswp__ui--idle .pswp__button--arrow--right { - opacity: 0; -} - -/* - pswp__ui--hidden class is added when controls are hidden - e.g. when user taps to toggle visibility of controls -*/ -.pswp__ui--hidden .pswp__top-bar, -.pswp__ui--hidden .pswp__caption, -.pswp__ui--hidden .pswp__button--arrow--left, -.pswp__ui--hidden .pswp__button--arrow--right { - /* Force paint & create composition layer for controls. */ - opacity: 0.001; -} - -/* pswp__ui--one-slide class is added when there is just one item in gallery */ -.pswp__ui--one-slide .pswp__button--arrow--left, -.pswp__ui--one-slide .pswp__button--arrow--right, -.pswp__ui--one-slide .pswp__counter { - display: none; -} - -.pswp__element--disabled { - display: none !important; -} - -.pswp--minimal--dark .pswp__top-bar { - background: none; -} diff --git a/apps/meteor/app/threads/client/lib/normalizeThreadTitle.ts b/apps/meteor/app/threads/client/lib/normalizeThreadTitle.ts index 41a55aefc5cf..70a2a6008e56 100644 --- a/apps/meteor/app/threads/client/lib/normalizeThreadTitle.ts +++ b/apps/meteor/app/threads/client/lib/normalizeThreadTitle.ts @@ -15,7 +15,7 @@ export function normalizeThreadTitle({ ...message }: Readonly) { return filteredMessage; } const uid = Meteor.userId(); - const me = uid && Users.findOne(uid, { fields: { username: 1 } })?.username; + const me = (uid && Users.findOne(uid, { fields: { username: 1 } })?.username) || ''; const pattern = settings.get('UTF8_User_Names_Validation'); const useRealName = settings.get('UI_Use_Real_Name'); diff --git a/apps/meteor/app/threads/client/messageAction/replyInThread.ts b/apps/meteor/app/threads/client/messageAction/replyInThread.ts index 03f6606a2073..01d007e0d953 100644 --- a/apps/meteor/app/threads/client/messageAction/replyInThread.ts +++ b/apps/meteor/app/threads/client/messageAction/replyInThread.ts @@ -19,7 +19,7 @@ Meteor.startup(() => { context: ['message', 'message-mobile', 'federated', 'videoconf'], action(e, props) { const { message = messageArgs(this).msg } = props; - e.stopPropagation(); + e?.stopPropagation(); router.navigate({ name: router.getRouteName()!, params: { diff --git a/apps/meteor/app/threads/server/functions.ts b/apps/meteor/app/threads/server/functions.ts index e79eb72ba0c5..30daef8b8b93 100644 --- a/apps/meteor/app/threads/server/functions.ts +++ b/apps/meteor/app/threads/server/functions.ts @@ -1,8 +1,8 @@ import type { IMessage } from '@rocket.chat/core-typings'; import { isEditedMessage } from '@rocket.chat/core-typings'; -import { Messages, Subscriptions, ReadReceipts } from '@rocket.chat/models'; +import { Messages, Subscriptions, ReadReceipts, NotificationQueue } from '@rocket.chat/models'; -import { getMentions } from '../../lib/server/lib/notifyUsersOnMessage'; +import { getMentions, getUserIdsFromHighlights } from '../../lib/server/lib/notifyUsersOnMessage'; export async function reply({ tmid }: { tmid?: string }, message: IMessage, parentMessage: IMessage, followers: string[]) { const { rid, ts, u } = message; @@ -19,7 +19,9 @@ export async function reply({ tmid }: { tmid?: string }, message: IMessage, pare ...(Array.isArray(parentMessage.replies) && parentMessage.replies.length ? [u._id] : [parentMessage.u._id, u._id]), ]), ]; + const highlightedUserIds = new Set(); + (await getUserIdsFromHighlights(rid, message)).forEach((uid) => highlightedUserIds.add(uid)); await Messages.updateRepliesByThreadId(tmid, addToReplies, ts); await ReadReceipts.setAsThreadById(tmid); @@ -35,9 +37,16 @@ export async function reply({ tmid }: { tmid?: string }, message: IMessage, pare await Subscriptions.addUnreadThreadByRoomIdAndUserIds(rid, repliesFiltered, tmid, {}); } - for await (const userId of mentionIds) { + const mentionedUsers = new Set([...mentionIds, ...highlightedUserIds]); + for await (const userId of mentionedUsers) { await Subscriptions.addUnreadThreadByRoomIdAndUserIds(rid, [userId], tmid, { userMention: true }); } + + const highlightIds = Array.from(highlightedUserIds); + if (highlightIds.length) { + await Subscriptions.setAlertForRoomIdAndUserIds(rid, highlightIds); + await Subscriptions.setOpenForRoomIdAndUserIds(rid, highlightIds); + } } export async function follow({ tmid, uid }: { tmid: string; uid: string }) { @@ -58,12 +67,8 @@ export async function unfollow({ tmid, rid, uid }: { tmid: string; rid: string; await Messages.removeThreadFollowerByThreadId(tmid, uid); } -export const readThread = async ({ userId, rid, tmid }: { userId?: string; rid: string; tmid: string }) => { +export const readThread = async ({ userId, rid, tmid }: { userId: string; rid: string; tmid: string }) => { const projection = { tunread: 1 }; - if (!userId) { - return; - } - const sub = await Subscriptions.findOneByRoomIdAndUserId(rid, userId, { projection }); if (!sub) { return; @@ -72,4 +77,5 @@ export const readThread = async ({ userId, rid, tmid }: { userId?: string; rid: const clearAlert = sub.tunread && sub.tunread?.length <= 1 && sub.tunread.includes(tmid); await Subscriptions.removeUnreadThreadByRoomIdAndUserId(rid, userId, tmid, clearAlert); + await NotificationQueue.clearQueueByUserId(userId); }; diff --git a/apps/meteor/app/threads/server/hooks/aftersavemessage.ts b/apps/meteor/app/threads/server/hooks/aftersavemessage.ts index 6af3b2eedb7e..ab1fa182599b 100644 --- a/apps/meteor/app/threads/server/hooks/aftersavemessage.ts +++ b/apps/meteor/app/threads/server/hooks/aftersavemessage.ts @@ -1,21 +1,22 @@ -import type { IMessage, IRoom } from '@rocket.chat/core-typings'; +import type { IMessage, IRoom, IUser } from '@rocket.chat/core-typings'; import { isEditedMessage } from '@rocket.chat/core-typings'; import { Messages } from '@rocket.chat/models'; import { Meteor } from 'meteor/meteor'; import { callbacks } from '../../../../lib/callbacks'; +import { broadcastMessageFromData } from '../../../../server/modules/watchers/lib/messages'; import { updateThreadUsersSubscriptions, getMentions } from '../../../lib/server/lib/notifyUsersOnMessage'; import { sendMessageNotifications } from '../../../lib/server/lib/sendNotificationsOnMessage'; import { settings } from '../../../settings/server'; import { reply } from '../functions'; -async function notifyUsersOnReply(message: IMessage, replies: string[], room: IRoom) { +async function notifyUsersOnReply(message: IMessage, replies: IUser['_id'][]) { // skips this callback if the message was edited if (isEditedMessage(message)) { return message; } - await updateThreadUsersSubscriptions(message, room, replies); + await updateThreadUsersSubscriptions(message, replies); return message; } @@ -58,9 +59,12 @@ export async function processThreads(message: IMessage, room: IRoom) { ]), ].filter((userId) => userId !== message.u._id); - await notifyUsersOnReply(message, replies, room); + await notifyUsersOnReply(message, replies); await metaData(message, parentMessage, replies); await notification(message, room, replies); + void broadcastMessageFromData({ + id: message.tmid, + }); return message; } diff --git a/apps/meteor/app/threads/server/methods/followMessage.ts b/apps/meteor/app/threads/server/methods/followMessage.ts index cede3dda33a7..05650d0ad2ef 100644 --- a/apps/meteor/app/threads/server/methods/followMessage.ts +++ b/apps/meteor/app/threads/server/methods/followMessage.ts @@ -1,10 +1,10 @@ +import { Apps, AppEvents } from '@rocket.chat/apps'; import type { IMessage } from '@rocket.chat/core-typings'; import { Messages } from '@rocket.chat/models'; import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; -import { Apps, AppEvents } from '../../../../ee/server/apps/orchestrator'; import { canAccessRoomIdAsync } from '../../../authorization/server/functions/canAccessRoom'; import { RateLimiter } from '../../../lib/server'; import { settings } from '../../../settings/server'; @@ -44,7 +44,7 @@ Meteor.methods({ const followResult = await follow({ tmid: message.tmid || message._id, uid }); const isFollowed = true; - await Apps.triggerEvent(AppEvents.IPostMessageFollowed, message, await Meteor.userAsync(), isFollowed); + await Apps.self?.triggerEvent(AppEvents.IPostMessageFollowed, message, await Meteor.userAsync(), isFollowed); return followResult; }, diff --git a/apps/meteor/app/threads/server/methods/unfollowMessage.ts b/apps/meteor/app/threads/server/methods/unfollowMessage.ts index c5dad1233173..afc9206b038f 100644 --- a/apps/meteor/app/threads/server/methods/unfollowMessage.ts +++ b/apps/meteor/app/threads/server/methods/unfollowMessage.ts @@ -1,10 +1,10 @@ +import { Apps, AppEvents } from '@rocket.chat/apps'; import type { IMessage } from '@rocket.chat/core-typings'; import { Messages } from '@rocket.chat/models'; import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; -import { Apps, AppEvents } from '../../../../ee/server/apps/orchestrator'; import { canAccessRoomIdAsync } from '../../../authorization/server/functions/canAccessRoom'; import { RateLimiter } from '../../../lib/server'; import { settings } from '../../../settings/server'; @@ -44,7 +44,7 @@ Meteor.methods({ const unfollowResult = await unfollow({ rid: message.rid, tmid: message.tmid || message._id, uid }); const isFollowed = false; - await Apps.triggerEvent(AppEvents.IPostMessageFollowed, message, await Meteor.userAsync(), isFollowed); + await Apps.self?.triggerEvent(AppEvents.IPostMessageFollowed, message, await Meteor.userAsync(), isFollowed); return unfollowResult; }, diff --git a/apps/meteor/app/tokenpass/client/lib.ts b/apps/meteor/app/tokenpass/client/lib.ts index c8c1daf1cd60..e0b40a9b6de9 100644 --- a/apps/meteor/app/tokenpass/client/lib.ts +++ b/apps/meteor/app/tokenpass/client/lib.ts @@ -2,7 +2,7 @@ import type { OauthConfig } from '@rocket.chat/core-typings'; import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; -import { CustomOAuth } from '../../custom-oauth/client/custom_oauth_client'; +import { CustomOAuth } from '../../custom-oauth/client/CustomOAuth'; import { settings } from '../../settings/client'; const config: OauthConfig = { diff --git a/apps/meteor/app/ui-cached-collection/client/models/CachedCollection.ts b/apps/meteor/app/ui-cached-collection/client/models/CachedCollection.ts index 9c970ccf697b..77190992612a 100644 --- a/apps/meteor/app/ui-cached-collection/client/models/CachedCollection.ts +++ b/apps/meteor/app/ui-cached-collection/client/models/CachedCollection.ts @@ -1,4 +1,5 @@ import { Emitter } from '@rocket.chat/emitter'; +import type { StreamNames } from '@rocket.chat/ui-contexts'; import localforage from 'localforage'; import { Accounts } from 'meteor/accounts-base'; import { Meteor } from 'meteor/meteor'; @@ -10,11 +11,10 @@ import { baseURI } from '../../../../client/lib/baseURI'; import { getConfig } from '../../../../client/lib/utils/getConfig'; import { isTruthy } from '../../../../lib/isTruthy'; import { withDebouncing } from '../../../../lib/utils/highOrderFunctions'; -import Notifications from '../../../notifications/client/lib/Notifications'; import { sdk } from '../../../utils/client/lib/SDKClient'; import { CachedCollectionManager } from './CachedCollectionManager'; -export type EventType = Extract; +export type EventType = 'notify-logged' | 'notify-all' | 'notify-user'; type Name = 'rooms' | 'subscriptions' | 'permissions' | 'public-settings' | 'private-settings'; @@ -48,7 +48,7 @@ export class CachedCollection extends Emitter< public name: Name; - public eventType: EventType; + public eventType: StreamNames; public version = 18; @@ -60,7 +60,7 @@ export class CachedCollection extends Emitter< public timer: ReturnType; - constructor({ name, eventType = 'onUser', userRelated = true }: { name: Name; eventType?: EventType; userRelated?: boolean }) { + constructor({ name, eventType = 'notify-user', userRelated = true }: { name: Name; eventType?: StreamNames; userRelated?: boolean }) { super(); this.collection = new Mongo.Collection(null) as MinimongoCollection; @@ -85,7 +85,10 @@ export class CachedCollection extends Emitter< }); } - protected get eventName(): `${Name}-changed` { + protected get eventName(): `${Name}-changed` | `${string}/${Name}-changed` { + if (this.eventType === 'notify-user') { + return `${Meteor.userId()}/${this.name}-changed`; + } return `${this.name}-changed`; } @@ -232,7 +235,7 @@ export class CachedCollection extends Emitter< } async setupListener() { - (Notifications[this.eventType] as any)(this.eventName, async (action: 'removed' | 'changed', record: any) => { + sdk.stream(this.eventType, [this.eventName], (async (action: 'removed' | 'changed', record: any) => { this.log('record received', action, record); const newRecord = this.handleReceived(record, action); @@ -250,7 +253,7 @@ export class CachedCollection extends Emitter< this.collection.upsert({ _id } as any, newRecord); } await this.save(); - }); + }) as (...args: unknown[]) => void); } trySync(delay = 10) { diff --git a/apps/meteor/app/ui-master/server/index.js b/apps/meteor/app/ui-master/server/index.js index f9e335451d74..2d4f3cc7de56 100644 --- a/apps/meteor/app/ui-master/server/index.js +++ b/apps/meteor/app/ui-master/server/index.js @@ -6,6 +6,7 @@ import { Tracker } from 'meteor/tracker'; import { withDebouncing } from '../../../lib/utils/highOrderFunctions'; import { settings } from '../../settings/server'; +import { getURL } from '../../utils/server/getURL'; import { applyHeadInjections, headInjections, injectIntoBody, injectIntoHead } from './inject'; import './scripts'; @@ -41,14 +42,14 @@ Meteor.startup(() => { settings.watch('Assets_SvgFavicon_Enable', (value) => { const standardFavicons = ` - - `; + + `; if (value) { injectIntoHead( 'Assets_SvgFavicon_Enable', `${standardFavicons} - `, + `, ); } else { injectIntoHead('Assets_SvgFavicon_Enable', standardFavicons); @@ -120,8 +121,6 @@ Meteor.startup(() => { })(__meteor_runtime_config__.ROOT_URL_PATH_PREFIX); injectIntoHead('base', ``); - - injectIntoHead('css-theme', ''); }); const renderDynamicCssList = withDebouncing({ wait: 500 })(async () => { diff --git a/apps/meteor/app/ui-message/client/ActionManager.js b/apps/meteor/app/ui-message/client/ActionManager.js deleted file mode 100644 index ebe9d1aed093..000000000000 --- a/apps/meteor/app/ui-message/client/ActionManager.js +++ /dev/null @@ -1,261 +0,0 @@ -import { UIKitIncomingInteractionType } from '@rocket.chat/apps-engine/definition/uikit'; -import { UIKitInteractionTypes } from '@rocket.chat/core-typings'; -import { Emitter } from '@rocket.chat/emitter'; -import { Random } from '@rocket.chat/random'; -import { lazy } from 'react'; - -import * as banners from '../../../client/lib/banners'; -import { imperativeModal } from '../../../client/lib/imperativeModal'; -import { dispatchToastMessage } from '../../../client/lib/toast'; -import { router } from '../../../client/providers/RouterProvider'; -import { sdk } from '../../utils/client/lib/SDKClient'; -import { t } from '../../utils/lib/i18n'; - -const UiKitModal = lazy(() => import('../../../client/views/modal/uikit/UiKitModal')); - -export const events = new Emitter(); - -export const on = (...args) => { - events.on(...args); -}; - -export const off = (...args) => { - events.off(...args); -}; - -const TRIGGER_TIMEOUT = 5000; - -const TRIGGER_TIMEOUT_ERROR = 'TRIGGER_TIMEOUT_ERROR'; - -const triggersId = new Map(); - -const instances = new Map(); - -const invalidateTriggerId = (id) => { - const appId = triggersId.get(id); - triggersId.delete(id); - return appId; -}; - -export const generateTriggerId = (appId) => { - const triggerId = Random.id(); - triggersId.set(triggerId, appId); - setTimeout(invalidateTriggerId, TRIGGER_TIMEOUT, triggerId); - return triggerId; -}; - -export const handlePayloadUserInteraction = (type, { /* appId,*/ triggerId, ...data }) => { - if (!triggersId.has(triggerId)) { - return; - } - const appId = invalidateTriggerId(triggerId); - if (!appId) { - return; - } - - const { view } = data; - let { viewId } = data; - - if (view && view.id) { - viewId = view.id; - } - - if (!viewId) { - return; - } - - if ([UIKitInteractionTypes.ERRORS].includes(type)) { - events.emit(viewId, { - type, - triggerId, - viewId, - appId, - ...data, - }); - return UIKitInteractionTypes.ERRORS; - } - - if ( - [UIKitInteractionTypes.BANNER_UPDATE, UIKitInteractionTypes.MODAL_UPDATE, UIKitInteractionTypes.CONTEXTUAL_BAR_UPDATE].includes(type) - ) { - events.emit(viewId, { - type, - triggerId, - viewId, - appId, - ...data, - }); - return type; - } - - if ([UIKitInteractionTypes.MODAL_OPEN].includes(type)) { - const instance = imperativeModal.open({ - component: UiKitModal, - props: { - triggerId, - viewId, - appId, - ...data, - }, - }); - - instances.set(viewId, { - close() { - instance.close(); - instances.delete(viewId); - }, - }); - - return UIKitInteractionTypes.MODAL_OPEN; - } - - if ([UIKitInteractionTypes.CONTEXTUAL_BAR_OPEN].includes(type)) { - instances.set(viewId, { - payload: { - type, - triggerId, - appId, - viewId, - ...data, - }, - close() { - instances.delete(viewId); - }, - }); - - router.navigate({ - name: router.getRouteName(), - params: { - ...router.getRouteParameters(), - tab: 'app', - context: viewId, - }, - }); - - return UIKitInteractionTypes.CONTEXTUAL_BAR_OPEN; - } - - if ([UIKitInteractionTypes.BANNER_OPEN].includes(type)) { - banners.open(data); - instances.set(viewId, { - close() { - banners.closeById(viewId); - }, - }); - return UIKitInteractionTypes.BANNER_OPEN; - } - - if ([UIKitIncomingInteractionType.BANNER_CLOSE].includes(type)) { - const instance = instances.get(viewId); - - if (instance) { - instance.close(); - } - return UIKitIncomingInteractionType.BANNER_CLOSE; - } - - if ([UIKitIncomingInteractionType.CONTEXTUAL_BAR_CLOSE].includes(type)) { - const instance = instances.get(viewId); - - if (instance) { - instance.close(); - } - return UIKitIncomingInteractionType.CONTEXTUAL_BAR_CLOSE; - } - - return UIKitInteractionTypes.MODAL_ClOSE; -}; - -export const triggerAction = async ({ type, actionId, appId, rid, mid, viewId, container, tmid, ...rest }) => - new Promise(async (resolve, reject) => { - events.emit('busy', { busy: true }); - - const triggerId = generateTriggerId(appId); - - const payload = rest.payload || rest; - - setTimeout(reject, TRIGGER_TIMEOUT, [TRIGGER_TIMEOUT_ERROR, { triggerId, appId }]); - - const { type: interactionType, ...data } = await (async () => { - try { - return await sdk.rest.post(`/apps/ui.interaction/${appId}`, { - type, - actionId, - payload, - container, - mid, - rid, - tmid, - triggerId, - viewId, - }); - } catch (e) { - reject(e); - return {}; - } finally { - events.emit('busy', { busy: false }); - } - })(); - - return resolve(handlePayloadUserInteraction(interactionType, data)); - }); - -export const triggerBlockAction = (options) => triggerAction({ type: UIKitIncomingInteractionType.BLOCK, ...options }); - -export const triggerActionButtonAction = (options) => - triggerAction({ type: UIKitIncomingInteractionType.ACTION_BUTTON, ...options }).catch(async (reason) => { - if (Array.isArray(reason) && reason[0] === TRIGGER_TIMEOUT_ERROR) { - dispatchToastMessage({ - type: 'error', - message: t('UIKit_Interaction_Timeout'), - }); - } - }); - -export const triggerSubmitView = async ({ viewId, ...options }) => { - const close = () => { - const instance = instances.get(viewId); - - if (instance) { - instance.close(); - } - }; - - try { - const result = await triggerAction({ - type: UIKitIncomingInteractionType.VIEW_SUBMIT, - viewId, - ...options, - }); - if (!result || UIKitInteractionTypes.MODAL_CLOSE === result) { - close(); - } - } catch { - close(); - } -}; - -export const triggerCancel = async ({ view, ...options }) => { - const instance = instances.get(view.id); - try { - await triggerAction({ type: UIKitIncomingInteractionType.VIEW_CLOSED, view, ...options }); - } finally { - if (instance) { - instance.close(); - } - } -}; - -export const getUserInteractionPayloadByViewId = (viewId) => { - if (!viewId) { - throw new Error('No viewId provided when checking for `user interaction payload`'); - } - - const instance = instances.get(viewId); - - if (!instance) { - return {}; - } - - return instance.payload; -}; diff --git a/apps/meteor/app/ui-message/client/ActionManager.ts b/apps/meteor/app/ui-message/client/ActionManager.ts new file mode 100644 index 000000000000..733664affd1f --- /dev/null +++ b/apps/meteor/app/ui-message/client/ActionManager.ts @@ -0,0 +1,274 @@ +import type { DistributiveOmit } from '@rocket.chat/core-typings'; +import { Emitter } from '@rocket.chat/emitter'; +import { Random } from '@rocket.chat/random'; +import type { RouterContext, IActionManager } from '@rocket.chat/ui-contexts'; +import type * as UiKit from '@rocket.chat/ui-kit'; +import type { ContextType } from 'react'; +import { lazy } from 'react'; + +import * as banners from '../../../client/lib/banners'; +import { imperativeModal } from '../../../client/lib/imperativeModal'; +import { sdk } from '../../utils/client/lib/SDKClient'; +import { UiKitTriggerTimeoutError } from './UiKitTriggerTimeoutError'; + +const UiKitModal = lazy(() => import('../../../client/views/modal/uikit/UiKitModal')); + +export class ActionManager implements IActionManager { + protected static TRIGGER_TIMEOUT = 5000; + + protected static TRIGGER_TIMEOUT_ERROR = 'TRIGGER_TIMEOUT_ERROR'; + + protected events = new Emitter<{ busy: { busy: boolean }; [viewId: string]: any }>(); + + protected triggersId = new Map(); + + protected viewInstances = new Map< + string, + { + payload?: { + view: UiKit.ContextualBarView; + }; + close: () => void; + } + >(); + + public constructor(protected router: ContextType) {} + + protected invalidateTriggerId(id: string) { + const appId = this.triggersId.get(id); + this.triggersId.delete(id); + return appId; + } + + public on(viewId: string, listener: (data: any) => void): void; + + public on(eventName: 'busy', listener: ({ busy }: { busy: boolean }) => void): void; + + public on(eventName: string, listener: (data: any) => void) { + return this.events.on(eventName, listener); + } + + public off(viewId: string, listener: (data: any) => any): void; + + public off(eventName: 'busy', listener: ({ busy }: { busy: boolean }) => void): void; + + public off(eventName: string, listener: (data: any) => void) { + return this.events.off(eventName, listener); + } + + public notifyBusy() { + this.events.emit('busy', { busy: true }); + } + + public notifyIdle() { + this.events.emit('busy', { busy: false }); + } + + public generateTriggerId(appId: string | undefined) { + const triggerId = Random.id(); + this.triggersId.set(triggerId, appId); + setTimeout(() => this.invalidateTriggerId(triggerId), ActionManager.TRIGGER_TIMEOUT); + return triggerId; + } + + public async emitInteraction(appId: string, userInteraction: DistributiveOmit) { + this.notifyBusy(); + + const triggerId = this.generateTriggerId(appId); + + let timeout: ReturnType | undefined; + + await Promise.race([ + new Promise((_, reject) => { + timeout = setTimeout(() => reject(new UiKitTriggerTimeoutError('Timeout', { triggerId, appId })), ActionManager.TRIGGER_TIMEOUT); + }), + sdk.rest + .post(`/apps/ui.interaction/${appId}`, { + ...userInteraction, + triggerId, + }) + .then((interaction) => this.handleServerInteraction(interaction)), + ]).finally(() => { + if (timeout) clearTimeout(timeout); + this.notifyIdle(); + }); + } + + public handleServerInteraction(interaction: UiKit.ServerInteraction) { + const { triggerId } = interaction; + + if (!this.triggersId.has(triggerId)) { + return; + } + + const appId = this.invalidateTriggerId(triggerId); + if (!appId) { + return; + } + + switch (interaction.type) { + case 'errors': { + const { type, triggerId, viewId, appId, errors } = interaction; + this.events.emit(interaction.viewId, { + type, + triggerId, + viewId, + appId, + errors, + }); + break; + } + + case 'modal.open': { + const { view } = interaction; + this.openModal(view); + break; + } + + case 'modal.update': + case 'contextual_bar.update': { + const { type, triggerId, appId, view } = interaction; + this.events.emit(view.id, { + type, + triggerId, + viewId: view.id, + appId, + view, + }); + break; + } + + case 'modal.close': { + break; + } + + case 'banner.open': { + const { type, triggerId, ...view } = interaction; + this.openBanner(view); + break; + } + + case 'banner.update': { + const { type, triggerId, appId, view } = interaction; + this.events.emit(view.viewId, { + type, + triggerId, + viewId: view.viewId, + appId, + view, + }); + break; + } + + case 'banner.close': { + const { viewId } = interaction; + this.viewInstances.get(viewId)?.close(); + + break; + } + + case 'contextual_bar.open': { + const { view } = interaction; + this.openContextualBar(view); + break; + } + + case 'contextual_bar.close': { + const { view } = interaction; + this.viewInstances.get(view.id)?.close(); + break; + } + } + + return interaction.type; + } + + public getInteractionPayloadByViewId(viewId: UiKit.ContextualBarView['id']) { + if (!viewId) { + throw new Error('No viewId provided when checking for `user interaction payload`'); + } + + return this.viewInstances.get(viewId)?.payload; + } + + public openView(surface: 'modal', view: UiKit.ModalView): void; + + public openView(surface: 'banner', view: UiKit.BannerView): void; + + public openView(surface: 'contextual_bar', view: UiKit.ContextualBarView): void; + + public openView(surface: string, view: UiKit.View) { + switch (surface) { + case 'modal': + this.openModal(view as UiKit.ModalView); + break; + + case 'banner': + this.openBanner(view as UiKit.BannerView); + break; + + case 'contextual_bar': + this.openContextualBar(view as UiKit.ContextualBarView); + break; + } + } + + private openModal(view: UiKit.ModalView) { + const instance = imperativeModal.open({ + component: UiKitModal, + props: { + key: view.id, + initialView: view, + }, + }); + + this.viewInstances.set(view.id, { + close: () => { + instance.close(); + this.viewInstances.delete(view.id); + }, + }); + } + + private openBanner(view: UiKit.BannerView) { + banners.open(view); + this.viewInstances.set(view.viewId, { + close: () => { + banners.closeById(view.viewId); + }, + }); + } + + private openContextualBar(view: UiKit.ContextualBarView) { + this.viewInstances.set(view.id, { + payload: { + view, + }, + close: () => { + this.viewInstances.delete(view.id); + }, + }); + + const routeName = this.router.getRouteName(); + const routeParams = this.router.getRouteParameters(); + + if (!routeName) { + return; + } + + this.router.navigate({ + name: routeName, + params: { + ...routeParams, + tab: 'app', + context: view.id, + }, + }); + } + + public disposeView(viewId: UiKit.ModalView['id'] | UiKit.BannerView['viewId'] | UiKit.ContextualBarView['id']) { + const instance = this.viewInstances.get(viewId); + instance?.close?.(); + this.viewInstances.delete(viewId); + } +} diff --git a/apps/meteor/app/ui-message/client/UiKitTriggerTimeoutError.ts b/apps/meteor/app/ui-message/client/UiKitTriggerTimeoutError.ts new file mode 100644 index 000000000000..75b035d822a1 --- /dev/null +++ b/apps/meteor/app/ui-message/client/UiKitTriggerTimeoutError.ts @@ -0,0 +1,7 @@ +import { RocketChatError } from '../../../client/lib/errors/RocketChatError'; + +export class UiKitTriggerTimeoutError extends RocketChatError<'trigger-timeout'> { + constructor(message = 'Timeout', details: { triggerId: string; appId: string }) { + super('trigger-timeout', message, details); + } +} diff --git a/apps/meteor/app/ui-message/client/messageBox/AddLinkComposerActionModal.tsx b/apps/meteor/app/ui-message/client/messageBox/AddLinkComposerActionModal.tsx new file mode 100644 index 000000000000..420bf93df66d --- /dev/null +++ b/apps/meteor/app/ui-message/client/messageBox/AddLinkComposerActionModal.tsx @@ -0,0 +1,65 @@ +import { Field, FieldGroup, TextInput, FieldLabel, FieldRow, Box } from '@rocket.chat/fuselage'; +import { useUniqueId } from '@rocket.chat/fuselage-hooks'; +import { useTranslation } from '@rocket.chat/ui-contexts'; +import React, { useEffect } from 'react'; +import { useForm, Controller } from 'react-hook-form'; + +import GenericModal from '../../../../client/components/GenericModal'; + +type AddLinkComposerActionModalProps = { + selectedText?: string; + onConfirm: (url: string, text: string) => void; + onClose: () => void; +}; + +const AddLinkComposerActionModal = ({ selectedText, onClose, onConfirm }: AddLinkComposerActionModalProps) => { + const t = useTranslation(); + const textField = useUniqueId(); + const urlField = useUniqueId(); + + const { handleSubmit, setFocus, control } = useForm({ + mode: 'onBlur', + defaultValues: { + text: selectedText || '', + url: '', + }, + }); + + useEffect(() => { + setFocus(selectedText ? 'url' : 'text'); + }, [selectedText, setFocus]); + + const onClickConfirm = ({ url, text }: { url: string; text: string }) => { + onConfirm(url, text); + }; + + const submit = handleSubmit(onClickConfirm); + + return ( + void submit(e)} {...props} />} + title={t('Add_link')} + > + + + {t('Text')} + + } /> + + + + {t('URL')} + + } /> + + + + + ); +}; + +export default AddLinkComposerActionModal; diff --git a/apps/meteor/app/ui-message/client/messageBox/messageBoxFormatting.ts b/apps/meteor/app/ui-message/client/messageBox/messageBoxFormatting.ts index 8c170f894aa4..84ca6dcc1035 100644 --- a/apps/meteor/app/ui-message/client/messageBox/messageBoxFormatting.ts +++ b/apps/meteor/app/ui-message/client/messageBox/messageBoxFormatting.ts @@ -1,24 +1,34 @@ import type { Keys as IconName } from '@rocket.chat/icons'; import type { TranslationKey } from '@rocket.chat/ui-contexts'; +import type { ComposerAPI } from '../../../../client/lib/chats/ChatAPI'; +import { imperativeModal } from '../../../../client/lib/imperativeModal'; import { settings } from '../../../settings/client'; +import AddLinkComposerActionModal from './AddLinkComposerActionModal'; -export type FormattingButton = - | { - label: TranslationKey; - icon: IconName; - pattern: string; - // text?: () => string | undefined; - command?: string; - link?: string; - condition?: () => boolean; - } - | { - label: TranslationKey; - text: () => string | undefined; - link: string; - condition?: () => boolean; - }; +type FormattingButtonDefault = { label: TranslationKey; condition?: () => boolean }; + +type TextButton = { + text: () => string | undefined; + link: string; +} & FormattingButtonDefault; + +type PatternButton = { + icon: IconName; + pattern: string; + // text?: () => string | undefined; + command?: string; + link?: string; +} & FormattingButtonDefault; + +type PromptButton = { + prompt: (composer: ComposerAPI) => void; + icon: IconName; +} & FormattingButtonDefault; + +export type FormattingButton = PatternButton | PromptButton | TextButton; + +export const isPromptButton = (button: FormattingButton): button is PromptButton => 'prompt' in button; export const formattingButtons: ReadonlyArray = [ { @@ -48,6 +58,28 @@ export const formattingButtons: ReadonlyArray = [ icon: 'multiline', pattern: '```\n{{text}}\n``` ', }, + { + label: 'Link', + icon: 'link', + prompt: (composerApi: ComposerAPI) => { + const { selection } = composerApi; + + const selectedText = composerApi.substring(selection.start, selection.end); + + const onClose = () => { + imperativeModal.close(); + composerApi.focus(); + }; + + const onConfirm = (url: string, text: string) => { + onClose(); + composerApi.replaceText(`[${text}](${url})`, selection); + composerApi.setCursorToEnd(); + }; + + imperativeModal.open({ component: AddLinkComposerActionModal, props: { onConfirm, selectedText, onClose } }); + }, + }, { label: 'KaTeX' as TranslationKey, icon: 'katex', diff --git a/apps/meteor/app/ui-message/client/popup/components/composerBoxPopup/ComposerBoxPopupCannedResponse.tsx b/apps/meteor/app/ui-message/client/popup/components/composerBoxPopup/ComposerBoxPopupCannedResponse.tsx deleted file mode 100644 index 5ce1b4f11e9e..000000000000 --- a/apps/meteor/app/ui-message/client/popup/components/composerBoxPopup/ComposerBoxPopupCannedResponse.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import { OptionColumn, OptionContent } from '@rocket.chat/fuselage'; -import React from 'react'; - -type ComposerBoxPopupCannedResponseProps = { - _id: string; - text: string; - shortcut: string; -}; - -const ComposerPopupCannedResponse = ({ shortcut, text }: ComposerBoxPopupCannedResponseProps) => { - return ( - <> - - {shortcut} - - {text} - - ); -}; - -export default ComposerPopupCannedResponse; diff --git a/apps/meteor/app/ui-message/client/popup/components/composerBoxPopup/ComposerBoxPopupEmoji.tsx b/apps/meteor/app/ui-message/client/popup/components/composerBoxPopup/ComposerBoxPopupEmoji.tsx deleted file mode 100644 index c8586e027040..000000000000 --- a/apps/meteor/app/ui-message/client/popup/components/composerBoxPopup/ComposerBoxPopupEmoji.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import { OptionColumn, OptionContent } from '@rocket.chat/fuselage'; -import React from 'react'; - -import Emoji from '../../../../../../client/components/Emoji'; - -export type ComposerBoxPopupEmojiProps = { - _id: string; -}; - -const ComposerPopupEmoji = ({ _id }: ComposerBoxPopupEmojiProps) => { - return ( - <> - - - - {_id} - - ); -}; - -export default ComposerPopupEmoji; diff --git a/apps/meteor/app/ui-message/client/popup/components/composerBoxPopup/ComposerBoxPopupRoom.tsx b/apps/meteor/app/ui-message/client/popup/components/composerBoxPopup/ComposerBoxPopupRoom.tsx deleted file mode 100644 index 368276e70b98..000000000000 --- a/apps/meteor/app/ui-message/client/popup/components/composerBoxPopup/ComposerBoxPopupRoom.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import type { IRoom } from '@rocket.chat/core-typings'; -import { OptionColumn, OptionContent } from '@rocket.chat/fuselage'; -import React from 'react'; - -import { RoomIcon } from '../../../../../../client/components/RoomIcon'; - -export type ComposerBoxPopupRoomProps = Pick; - -const ComposerBoxPopupRoom = ({ fname, name, ...props }: ComposerBoxPopupRoomProps) => { - return ( - <> - - - - - {fname ?? name} - - - ); -}; - -export default ComposerBoxPopupRoom; diff --git a/apps/meteor/app/ui-message/client/popup/components/composerBoxPopup/ComposerBoxPopupSlashCommand.tsx b/apps/meteor/app/ui-message/client/popup/components/composerBoxPopup/ComposerBoxPopupSlashCommand.tsx deleted file mode 100644 index e24c44c9a1ed..000000000000 --- a/apps/meteor/app/ui-message/client/popup/components/composerBoxPopup/ComposerBoxPopupSlashCommand.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import { OptionColumn, OptionContent, OptionDescription, OptionInput } from '@rocket.chat/fuselage'; -import React from 'react'; - -export type ComposerBoxPopupSlashCommandProps = { - _id: string; - description?: string; - params?: string; -}; - -const ComposerPopupSlashCommand = ({ _id, description, params }: ComposerBoxPopupSlashCommandProps) => { - return ( - <> - - {_id} {params} - - - {description} - - - ); -}; - -export default ComposerPopupSlashCommand; diff --git a/apps/meteor/app/ui-message/client/popup/hooks/useEnablePopupPreview.ts b/apps/meteor/app/ui-message/client/popup/hooks/useEnablePopupPreview.ts deleted file mode 100644 index 14280d310552..000000000000 --- a/apps/meteor/app/ui-message/client/popup/hooks/useEnablePopupPreview.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { ComposerPopupOption } from '../../../../../client/views/room/contexts/ComposerPopupContext'; - -export const useEnablePopupPreview = (filter: unknown, popup?: ComposerPopupOption) => - popup && !popup.preview && (popup?.triggerLength ? typeof filter === 'string' && popup.triggerLength - 1 < filter.length : true); diff --git a/apps/meteor/app/ui-utils/client/lib/LegacyRoomManager.ts b/apps/meteor/app/ui-utils/client/lib/LegacyRoomManager.ts index 85aafa4bb185..91b848ffefde 100644 --- a/apps/meteor/app/ui-utils/client/lib/LegacyRoomManager.ts +++ b/apps/meteor/app/ui-utils/client/lib/LegacyRoomManager.ts @@ -7,10 +7,8 @@ import { RoomManager } from '../../../../client/lib/RoomManager'; import { roomCoordinator } from '../../../../client/lib/rooms/roomCoordinator'; import { fireGlobalEvent } from '../../../../client/lib/utils/fireGlobalEvent'; import { getConfig } from '../../../../client/lib/utils/getConfig'; -import { router } from '../../../../client/providers/RouterProvider'; import { callbacks } from '../../../../lib/callbacks'; -import { CachedChatRoom, ChatMessage, ChatSubscription, CachedChatSubscription, ChatRoom } from '../../../models/client'; -import { Notifications } from '../../../notifications/client'; +import { CachedChatRoom, ChatMessage, ChatSubscription, CachedChatSubscription } from '../../../models/client'; import { sdk } from '../../../utils/client/lib/SDKClient'; import { upsertMessage, RoomHistoryManager } from './RoomHistoryManager'; import { mainReady } from './mainReady'; @@ -38,8 +36,8 @@ function close(typeName: string) { if (openedRooms[typeName]) { if (openedRooms[typeName].rid) { sdk.stop('room-messages', openedRooms[typeName].rid); - Notifications.unRoom(openedRooms[typeName].rid, 'deleteMessage'); - Notifications.unRoom(openedRooms[typeName].rid, 'deleteMessageBulk'); + sdk.stop('notify-room', `${openedRooms[typeName].rid}/deleteMessage`); + sdk.stop('notify-room', `${openedRooms[typeName].rid}/deleteMessageBulk`); } openedRooms[typeName].ready = false; @@ -80,41 +78,6 @@ function getOpenedRoomByRid(rid: IRoom['_id']) { .find((openedRoom) => openedRoom.rid === rid); } -const handleTrackSettingsChange = (msg: IMessage) => { - const openedRoom = RoomManager.opened; - if (openedRoom !== msg.rid) { - return; - } - - void Tracker.nonreactive(async () => { - if (msg.t === 'room_changed_privacy') { - const type = router.getRouteName() === 'channel' ? 'c' : 'p'; - await close(type + router.getRouteParameters().name); - - const subscription = ChatSubscription.findOne({ rid: msg.rid }); - if (!subscription) { - throw new Error('Subscription not found'); - } - router.navigate({ - pattern: subscription.t === 'c' ? '/channel/:name/:tab?/:context?' : '/group/:name/:tab?/:context?', - params: { name: subscription.name }, - search: router.getSearchParameters(), - }); - } - - if (msg.t === 'r') { - const room = ChatRoom.findOne(msg.rid); - if (!room) { - throw new Error('Room not found'); - } - if (room.name !== router.getRouteParameters().name) { - await close(room.t + router.getRouteParameters().name); - roomCoordinator.openRouteLink(room.t, room, router.getSearchParameters()); - } - } - }); -}; - const computation = Tracker.autorun(() => { const ready = CachedChatRoom.ready.get() && mainReady.get(); if (ready !== true) { @@ -152,8 +115,6 @@ const computation = Tracker.autorun(() => { } } - handleTrackSettingsChange({ ...msg }); - await callbacks.run('streamMessage', { ...msg, name: room.name || '' }); fireGlobalEvent('new-message', { @@ -171,24 +132,80 @@ const computation = Tracker.autorun(() => { record.streamActive = true; openedRoomsDependency.changed(); }); - Notifications.onRoom(record.rid, 'deleteMessage', (msg) => { + + // when we receive a messages imported event we just clear the room history and fetch it again + sdk.stream('notify-room', [`${record.rid}/messagesImported`], async () => { + await RoomHistoryManager.clear(record.rid); + await RoomHistoryManager.getMore(record.rid); + }); + + sdk.stream('notify-room', [`${record.rid}/deleteMessage`], (msg) => { ChatMessage.remove({ _id: msg._id }); // remove thread refenrece from deleted message ChatMessage.update({ tmid: msg._id }, { $unset: { tmid: 1 } }, { multi: true }); }); - Notifications.onRoom(record.rid, 'deleteMessageBulk', ({ rid, ts, excludePinned, ignoreDiscussion, users }) => { - const query: Mongo.Selector = { rid, ts }; - if (excludePinned) { - query.pinned = { $ne: true }; - } - if (ignoreDiscussion) { - query.drid = { $exists: false }; - } - if (users?.length) { - query['u.username'] = { $in: users }; + + sdk.stream( + 'notify-room', + [`${record.rid}/deleteMessageBulk`], + ({ rid, ts, excludePinned, ignoreDiscussion, users, ids, showDeletedStatus }) => { + const query: Mongo.Selector = { rid }; + + if (ids) { + query._id = { $in: ids }; + } else { + query.ts = ts; + } + if (excludePinned) { + query.pinned = { $ne: true }; + } + if (ignoreDiscussion) { + query.drid = { $exists: false }; + } + if (users?.length) { + query['u.username'] = { $in: users }; + } + + if (showDeletedStatus) { + return ChatMessage.update( + query, + { $set: { t: 'rm', msg: '', urls: [], mentions: [], attachments: [], reactions: {} } }, + { multi: true }, + ); + } + return ChatMessage.remove(query); + }, + ); + + sdk.stream('notify-room', [`${record.rid}/messagesRead`], ({ tmid, until }) => { + if (tmid) { + return ChatMessage.update( + { + tmid, + unread: true, + }, + { $unset: { unread: 1 } }, + { multi: true }, + ); } - ChatMessage.remove(query); + ChatMessage.update( + { + rid: record.rid, + unread: true, + ts: { $lt: until }, + $or: [ + { + tmid: { $exists: false }, + }, + { + tshow: true, + }, + ], + }, + { $unset: { unread: 1 } }, + { multi: true }, + ); }); } } diff --git a/apps/meteor/app/ui-utils/client/lib/MessageAction.ts b/apps/meteor/app/ui-utils/client/lib/MessageAction.ts index 043dfe87b606..6a3ddd45ca66 100644 --- a/apps/meteor/app/ui-utils/client/lib/MessageAction.ts +++ b/apps/meteor/app/ui-utils/client/lib/MessageAction.ts @@ -48,7 +48,7 @@ export type MessageActionConfig = { context?: MessageActionContext[]; action: ( this: any, - e: Pick, + e: Pick | undefined, { message, tabbar, diff --git a/apps/meteor/app/ui-utils/client/lib/messageActionDefault.ts b/apps/meteor/app/ui-utils/client/lib/messageActionDefault.ts index 5807673188e5..f3cf0be67ca9 100644 --- a/apps/meteor/app/ui-utils/client/lib/messageActionDefault.ts +++ b/apps/meteor/app/ui-utils/client/lib/messageActionDefault.ts @@ -10,7 +10,7 @@ import { dispatchToastMessage } from '../../../../client/lib/toast'; import { messageArgs } from '../../../../client/lib/utils/messageArgs'; import { router } from '../../../../client/providers/RouterProvider'; import ForwardMessageModal from '../../../../client/views/room/modals/ForwardMessageModal/ForwardMessageModal'; -import ReactionList from '../../../../client/views/room/modals/ReactionListModal'; +import ReactionListModal from '../../../../client/views/room/modals/ReactionListModal'; import ReportMessageModal from '../../../../client/views/room/modals/ReportMessageModal'; import { hasAtLeastOnePermission, hasPermission } from '../../../authorization/client'; import { ChatRoom, Subscriptions } from '../../../models/client'; @@ -268,7 +268,7 @@ Meteor.startup(async () => { type: 'interaction', action(this: unknown, _, { message: { reactions = {} } = messageArgs(this).msg }) { imperativeModal.open({ - component: ReactionList, + component: ReactionListModal, props: { reactions, onClose: imperativeModal.close }, }); }, diff --git a/apps/meteor/app/ui-utils/client/lib/messageBox.ts b/apps/meteor/app/ui-utils/client/lib/messageBox.ts index 3f3c545af57e..3418adef1c1c 100644 --- a/apps/meteor/app/ui-utils/client/lib/messageBox.ts +++ b/apps/meteor/app/ui-utils/client/lib/messageBox.ts @@ -1,4 +1,5 @@ import type { IMessage, IRoom } from '@rocket.chat/core-typings'; +import type { Keys as IconName } from '@rocket.chat/icons'; import type { TranslationKey } from '@rocket.chat/ui-contexts'; import type { ChatAPI } from '../../../../client/lib/chats/ChatAPI'; @@ -6,7 +7,7 @@ import type { ChatAPI } from '../../../../client/lib/chats/ChatAPI'; export type MessageBoxAction = { label: TranslationKey; id: string; - icon?: string; + icon: IconName; action: (params: { rid: IRoom['_id']; tmid?: IMessage['_id']; event: Event; chat: ChatAPI }) => void; condition?: () => boolean; }; diff --git a/apps/meteor/app/ui/client/index.ts b/apps/meteor/app/ui/client/index.ts deleted file mode 100644 index 7a2b4aaa89b7..000000000000 --- a/apps/meteor/app/ui/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -import './views/app/photoswipeContent.ts'; // without the *.ts extension, *.html gets loaded first diff --git a/apps/meteor/app/ui/client/lib/ChatMessages.ts b/apps/meteor/app/ui/client/lib/ChatMessages.ts index 4a4b04f11833..5d78fd1e1d98 100644 --- a/apps/meteor/app/ui/client/lib/ChatMessages.ts +++ b/apps/meteor/app/ui/client/lib/ChatMessages.ts @@ -1,6 +1,6 @@ import type { IMessage, IRoom, IUser } from '@rocket.chat/core-typings'; import { isVideoConfMessage } from '@rocket.chat/core-typings'; -import type { UIEvent } from 'react'; +import type { IActionManager } from '@rocket.chat/ui-contexts'; import type { ChatAPI, ComposerAPI, DataAPI, UploadsAPI } from '../../../../client/lib/chats/ChatAPI'; import { createDataAPI } from '../../../../client/lib/chats/data'; @@ -18,7 +18,6 @@ import { setHighlightMessage, clearHighlightMessage, } from '../../../../client/views/room/MessageList/providers/messageHighlightSubscription'; -import * as ActionManager from '../../../ui-message/client/ActionManager'; import { UserAction } from './UserAction'; type DeepWritable = T extends (...args: any) => any @@ -45,8 +44,6 @@ export class ChatMessages implements ChatAPI { public ActionManager: any; - public userCard: { open(username: string): (event: UIEvent) => void; close(): void }; - public emojiPicker: { open(el: Element, cb: (emoji: string) => void): void; close(): void; @@ -144,13 +141,14 @@ export class ChatMessages implements ChatAPI { rid: IRoom['_id']; tmid?: IMessage['_id']; uid: IUser['_id'] | null; + actionManager: IActionManager; }, ) { const { rid, tmid } = params; this.uid = params.uid; this.data = createDataAPI({ rid, tmid }); this.uploads = createUploadsAPI({ rid, tmid }); - this.ActionManager = ActionManager; + this.ActionManager = params.actionManager; const unimplemented = () => { throw new Error('Flow is not implemented'); @@ -158,11 +156,6 @@ export class ChatMessages implements ChatAPI { this.readStateManager = new ReadStateManager(rid); - this.userCard = { - open: unimplemented, - close: unimplemented, - }; - this.emojiPicker = { open: unimplemented, close: unimplemented, diff --git a/apps/meteor/app/ui/client/lib/KonchatNotification.ts b/apps/meteor/app/ui/client/lib/KonchatNotification.ts index 1af8ca18d337..dbffdf2a80a1 100644 --- a/apps/meteor/app/ui/client/lib/KonchatNotification.ts +++ b/apps/meteor/app/ui/client/lib/KonchatNotification.ts @@ -1,4 +1,4 @@ -import type { IMessage, IRoom, IUser, RoomType } from '@rocket.chat/core-typings'; +import type { INotificationDesktop, IRoom, IUser } from '@rocket.chat/core-typings'; import { Random } from '@rocket.chat/random'; import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; @@ -22,25 +22,6 @@ declare global { } } -export type NotificationEvent = { - icon?: string; - title: string; - text: string; - duration?: number; - payload: { - _id?: IMessage['_id']; - rid?: IRoom['_id']; - tmid?: IMessage['_id']; - sender?: Pick; - type?: RoomType; - name?: string; - message?: { - msg: string; - t?: string; - }; - }; -}; - class KonchatNotification { public notificationStatus = new ReactiveVar(undefined); @@ -52,7 +33,7 @@ class KonchatNotification { } } - public async notify(notification: NotificationEvent) { + public async notify(notification: INotificationDesktop) { if (typeof window.Notification === 'undefined' || Notification.permission !== 'granted') { return; } @@ -146,11 +127,20 @@ class KonchatNotification { }, search: { ...router.getSearchParameters(), jump: notification.payload._id }, }); + case 'l': + return router.navigate({ + pattern: '/live/:id/:tab?/:context?', + params: { + id: notification.payload.rid, + tab: 'room-info', + }, + search: { ...router.getSearchParameters(), jump: notification.payload._id }, + }); } }; } - public async showDesktop(notification: NotificationEvent) { + public async showDesktop(notification: INotificationDesktop) { if (!notification.payload.rid) { return; } diff --git a/apps/meteor/app/ui/client/lib/UserAction.ts b/apps/meteor/app/ui/client/lib/UserAction.ts index ab58d641c149..00ff3113e586 100644 --- a/apps/meteor/app/ui/client/lib/UserAction.ts +++ b/apps/meteor/app/ui/client/lib/UserAction.ts @@ -3,8 +3,8 @@ import { debounce } from 'lodash'; import { Meteor } from 'meteor/meteor'; import { ReactiveDict } from 'meteor/reactive-dict'; -import { Notifications } from '../../../notifications/client'; import { settings } from '../../../settings/client'; +import { sdk } from '../../../utils/client/lib/SDKClient'; const TIMEOUT = 15000; const RENEW = TIMEOUT / 3; @@ -38,7 +38,7 @@ const shownName = function (user: IUser | null | undefined): string | undefined const emitActivities = debounce(async (rid: string, extras: IExtras): Promise => { const activities = roomActivities.get(extras?.tmid || rid) || new Set(); - Notifications.notifyRoom(rid, USER_ACTIVITY, shownName(Meteor.user() as unknown as IUser), [...activities], extras); + sdk.publish('notify-room', [`${rid}/${USER_ACTIVITY}`, shownName(Meteor.user() as unknown as IUser), [...activities], extras]); }, 500); function handleStreamAction(rid: string, username: string, activityTypes: string[], extras?: IExtras): void { @@ -65,10 +65,11 @@ function handleStreamAction(rid: string, username: string, activityTypes: string performingUsers.set(rid, roomActivities); } export const UserAction = new (class { - addStream(rid: string): void { + addStream(rid: string): () => void { if (rooms.get(rid)) { - return; + throw new Error('UserAction - addStream should only be called once per room'); } + const handler = function (username: string, activityType: string[], extras?: object): void { const user = Meteor.users.findOne(Meteor.userId() || undefined, { fields: { name: 1, username: 1 }, @@ -79,7 +80,15 @@ export const UserAction = new (class { handleStreamAction(rid, username, activityType, extras); }; rooms.set(rid, handler); - Notifications.onRoom(rid, USER_ACTIVITY, handler); + + const { stop } = sdk.stream('notify-room', [`${rid}/${USER_ACTIVITY}`], handler); + return () => { + if (!rooms.get(rid)) { + return; + } + stop(); + rooms.delete(rid); + }; } performContinuously(rid: string, activityType: string, extras: IExtras = {}): void { @@ -156,15 +165,6 @@ export const UserAction = new (class { void emitActivities(rid, extras); } - cancel(rid: string): void { - if (!rooms.get(rid)) { - return; - } - - Notifications.unRoom(rid, USER_ACTIVITY); - rooms.delete(rid); - } - get(roomId: string): IRoomActivity | undefined { return performingUsers.get(roomId); } diff --git a/apps/meteor/app/ui/client/lib/userCard.tsx b/apps/meteor/app/ui/client/lib/userCard.tsx deleted file mode 100644 index 98bfca9e53fc..000000000000 --- a/apps/meteor/app/ui/client/lib/userCard.tsx +++ /dev/null @@ -1,76 +0,0 @@ -import type { ComponentProps } from 'react'; -import React, { Suspense, createElement, lazy } from 'react'; -import { createPortal } from 'react-dom'; -import { useSyncExternalStore } from 'use-sync-external-store/shim'; - -import { registerPortal } from '../../../../client/lib/portals/portalsSubscription'; -import { queueMicrotask } from '../../../../client/lib/utils/queueMicrotask'; - -const UserCard = lazy(() => import('../../../../client/views/room/UserCard')); - -type UserCardProps = ComponentProps; - -let props: UserCardProps; - -const subscribers = new Set<() => void>(); - -const updateProps = (newProps: Partial) => { - props = { ...props, ...newProps }; - subscribers.forEach((subscriber) => subscriber()); -}; - -const getProps = () => props; - -const subscribeToProps = (callback: () => void) => { - subscribers.add(callback); - - return () => { - subscribers.delete(callback); - }; -}; - -const UserCardWithProps = () => { - const props = useSyncExternalStore(subscribeToProps, getProps); - - return ( - - - - ); -}; - -const createContainer = () => { - const container = document.createElement('div'); - container.id = 'react-user-card'; - document.body.appendChild(container); - - return container; -}; - -let container: HTMLDivElement | undefined; -let unregisterPortal: (() => void) | undefined; - -export const closeUserCard = () => { - queueMicrotask(() => { - if (unregisterPortal) { - unregisterPortal(); - unregisterPortal = undefined; - } - }); -}; - -export const openUserCard = (params: Omit) => { - updateProps({ ...params, onClose: closeUserCard }); - - if (!container) { - container = createContainer(); - } - - if (!unregisterPortal) { - const children = createElement(UserCardWithProps); - const portal = createPortal(children, container); - unregisterPortal = registerPortal(container, portal); - } - - return closeUserCard; -}; diff --git a/apps/meteor/app/ui/client/views/app/photoswipeContent.ts b/apps/meteor/app/ui/client/views/app/photoswipeContent.ts deleted file mode 100644 index 5c76a6b15d18..000000000000 --- a/apps/meteor/app/ui/client/views/app/photoswipeContent.ts +++ /dev/null @@ -1,203 +0,0 @@ -import { escapeHTML } from '@rocket.chat/string-helpers'; -import { Meteor } from 'meteor/meteor'; -import type PhotoSwipe from 'photoswipe'; -import PhotoSwipeUIDefault from 'photoswipe/dist/photoswipe-ui-default'; - -import { createAnchor } from '../../../../../client/lib/utils/createAnchor'; - -const parseLength = (x: unknown): number | undefined => { - const length = typeof x === 'string' ? parseInt(x, 10) : undefined; - return Number.isFinite(length) ? length : undefined; -}; - -const getImageSize = (src: string): Promise<[w: number, h: number]> => - new Promise((resolve, reject) => { - const img = new Image(); - - img.addEventListener('load', () => { - resolve([img.naturalWidth, img.naturalHeight]); - }); - - img.addEventListener('error', (error) => { - reject(error.error); - }); - - img.src = src; - }); - -type Slide = PhotoSwipe.Item & { description?: string; title?: string }; - -const fromElementToSlide = async (element: Element): Promise => { - if (!(element instanceof HTMLElement)) { - return null; - } - - const title = element.dataset.title || element.title; - const { description } = element.dataset; - - if (element instanceof HTMLAnchorElement) { - const src = element.dataset.src || element.href; - let w = parseLength(element.dataset.width); - let h = parseLength(element.dataset.height); - - if (w === undefined || h === undefined) { - [w, h] = await getImageSize(src); - } - - return { src, w, h, title, description }; - } - - if (element instanceof HTMLImageElement) { - let msrc: string | undefined; - let { src } = element; - let w: number | undefined = element.naturalWidth; - let h: number | undefined = element.naturalHeight; - - if (element.dataset.src) { - msrc = element.src; - src = element.dataset.src; - w = parseLength(element.dataset.width); - h = parseLength(element.dataset.height); - - if (w === undefined || h === undefined) { - [w, h] = await getImageSize(src); - } - } - - return { msrc, src, w, h, title, description }; - } - - return null; -}; - -let currentGallery: PhotoSwipe | null = null; - -const initGallery = async (items: Slide[], options: PhotoSwipe.Options): Promise => { - const anchor = createAnchor('photoswipe-root'); - - anchor.innerHTML = ``; - const [{ default: PhotoSwipe }] = await Promise.all([import('photoswipe'), import('photoswipe/dist/photoswipe.css')]); - - if (!currentGallery) { - const container = document.getElementById('pswp'); - - if (!container) { - throw new Error('Photoswipe container element not found'); - } - - currentGallery = new PhotoSwipe(container, PhotoSwipeUIDefault, items, options); - - currentGallery.listen('destroy', () => { - anchor.innerHTML = ''; - currentGallery = null; - }); - - currentGallery.init(); - } -}; - -const defaultGalleryOptions = { - bgOpacity: 0.7, - counterEl: false, - index: 0, - wheelToZoom: true, - padding: { top: 20, bottom: 40, left: 100, right: 100 }, - addCaptionHTMLFn(item: Slide, captionEl: HTMLElement): boolean { - captionEl.children[0].innerHTML = ` - ${escapeHTML(item.title ?? '')}
- ${escapeHTML(item.description ?? '')} - `; - return true; - }, -}; - -const createEventListenerFor = - (className: string) => - (event: Event): void => { - event.preventDefault(); - event.stopPropagation(); - - const { currentTarget } = event; - - const galleryItems = Array.from(document.querySelectorAll(className)); - - const sortedElements = galleryItems.sort((a, b) => { - if (a === currentTarget) { - return -1; - } - - if (b === currentTarget) { - return 1; - } - - return 0; - }); - - const slidePromises = sortedElements.map((element) => fromElementToSlide(element)); - - let hasOpenedGallery = false; - - void slidePromises.reduce( - (p, curr) => - p - .then(() => curr) - .then(async (slide) => { - if (!slide) { - return; - } - - if (!currentGallery) { - // If the gallery doesn't exist and has been opened this run the user closed it before all promises ran. - // This means it shouldn't be opened again. - if (hasOpenedGallery) { - return; - } - hasOpenedGallery = true; - return initGallery([slide], defaultGalleryOptions); - } - - currentGallery.items.push(slide); - currentGallery.invalidateCurrItems(); - currentGallery.updateSize(true); - }), - Promise.resolve(), - ); - }; - -Meteor.startup(() => { - $(document).on('click', '.gallery-item', createEventListenerFor('.gallery-item')); -}); diff --git a/apps/meteor/app/user-status/client/index.ts b/apps/meteor/app/user-status/client/index.ts deleted file mode 100644 index 122887520cc8..000000000000 --- a/apps/meteor/app/user-status/client/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -import './notifications/deleteCustomUserStatus'; -import './notifications/updateCustomUserStatus'; -import './lib/customUserStatus'; - -export { userStatus } from './lib/userStatus'; diff --git a/apps/meteor/app/user-status/client/lib/customUserStatus.js b/apps/meteor/app/user-status/client/lib/customUserStatus.js deleted file mode 100644 index 8d429d22c3ec..000000000000 --- a/apps/meteor/app/user-status/client/lib/customUserStatus.js +++ /dev/null @@ -1,62 +0,0 @@ -import { Meteor } from 'meteor/meteor'; -import { Tracker } from 'meteor/tracker'; - -import { sdk } from '../../../utils/client/lib/SDKClient'; -import { userStatus } from './userStatus'; - -userStatus.packages.customUserStatus = { - list: [], -}; - -export const deleteCustomUserStatus = function (customUserStatusData) { - delete userStatus.list[customUserStatusData._id]; - - const arrayIndex = userStatus.packages.customUserStatus.list.indexOf(customUserStatusData._id); - if (arrayIndex !== -1) { - userStatus.packages.customUserStatusData.list.splice(arrayIndex, 1); - } -}; - -export const updateCustomUserStatus = function (customUserStatusData) { - const newUserStatus = { - name: customUserStatusData.name, - id: customUserStatusData._id, - statusType: customUserStatusData.statusType, - localizeName: false, - }; - - const arrayIndex = userStatus.packages.customUserStatus.list.indexOf(newUserStatus.id); - if (arrayIndex === -1) { - userStatus.packages.customUserStatus.list.push(newUserStatus); - } else { - userStatus.packages.customUserStatus.list[arrayIndex] = newUserStatus; - } - - userStatus.list[newUserStatus.id] = newUserStatus; -}; - -Meteor.startup(() => { - Tracker.autorun(() => { - if (!Meteor.userId()) { - return; - } - - void sdk.call('listCustomUserStatus').then((result) => { - if (!result) { - return; - } - - for (const customStatus of result) { - const newUserStatus = { - name: customStatus.name, - id: customStatus._id, - statusType: customStatus.statusType, - localizeName: false, - }; - - userStatus.packages.customUserStatus.list.push(newUserStatus); - userStatus.list[newUserStatus.id] = newUserStatus; - } - }); - }); -}); diff --git a/apps/meteor/app/user-status/client/lib/userStatus.ts b/apps/meteor/app/user-status/client/lib/userStatus.ts deleted file mode 100644 index eec57acd29f1..000000000000 --- a/apps/meteor/app/user-status/client/lib/userStatus.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { UserStatus } from '@rocket.chat/core-typings'; - -type Status = { - name: string; - localizeName: boolean; - id: string; - statusType: UserStatus; -}; - -type UserStatusTypes = { - packages: any; - list: { - [status: string]: Status; - }; -}; - -export const userStatus: UserStatusTypes = { - packages: { - base: { - render(html: string): string { - return html; - }, - }, - }, - - list: { - online: { - name: UserStatus.ONLINE, - localizeName: true, - id: UserStatus.ONLINE, - statusType: UserStatus.ONLINE, - }, - away: { - name: UserStatus.AWAY, - localizeName: true, - id: UserStatus.AWAY, - statusType: UserStatus.AWAY, - }, - busy: { - name: UserStatus.BUSY, - localizeName: true, - id: UserStatus.BUSY, - statusType: UserStatus.BUSY, - }, - offline: { - name: UserStatus.OFFLINE, - localizeName: true, - id: UserStatus.OFFLINE, - statusType: UserStatus.OFFLINE, - }, - }, -} as const; diff --git a/apps/meteor/app/user-status/client/notifications/deleteCustomUserStatus.js b/apps/meteor/app/user-status/client/notifications/deleteCustomUserStatus.js deleted file mode 100644 index 24d503d57d72..000000000000 --- a/apps/meteor/app/user-status/client/notifications/deleteCustomUserStatus.js +++ /dev/null @@ -1,6 +0,0 @@ -import { Meteor } from 'meteor/meteor'; - -import { Notifications } from '../../../notifications/client'; -import { deleteCustomUserStatus } from '../lib/customUserStatus'; - -Meteor.startup(() => Notifications.onLogged('deleteCustomUserStatus', (data) => deleteCustomUserStatus(data.userStatusData))); diff --git a/apps/meteor/app/user-status/client/notifications/updateCustomUserStatus.js b/apps/meteor/app/user-status/client/notifications/updateCustomUserStatus.js deleted file mode 100644 index f5949b038948..000000000000 --- a/apps/meteor/app/user-status/client/notifications/updateCustomUserStatus.js +++ /dev/null @@ -1,6 +0,0 @@ -import { Meteor } from 'meteor/meteor'; - -import { Notifications } from '../../../notifications/client'; -import { updateCustomUserStatus } from '../lib/customUserStatus'; - -Meteor.startup(() => Notifications.onLogged('updateCustomUserStatus', (data) => updateCustomUserStatus(data.userStatusData))); diff --git a/apps/meteor/app/user-status/server/methods/listCustomUserStatus.ts b/apps/meteor/app/user-status/server/methods/listCustomUserStatus.ts index bb11a1be73bd..3a962121d65c 100644 --- a/apps/meteor/app/user-status/server/methods/listCustomUserStatus.ts +++ b/apps/meteor/app/user-status/server/methods/listCustomUserStatus.ts @@ -6,7 +6,7 @@ import { Meteor } from 'meteor/meteor'; declare module '@rocket.chat/ui-contexts' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { - listCustomUserStatus(): Promise; + listCustomUserStatus(): ICustomUserStatus[]; } } diff --git a/apps/meteor/app/utils/client/lib/SDKClient.ts b/apps/meteor/app/utils/client/lib/SDKClient.ts index e9e20bbe658b..18ff309970df 100644 --- a/apps/meteor/app/utils/client/lib/SDKClient.ts +++ b/apps/meteor/app/utils/client/lib/SDKClient.ts @@ -45,114 +45,166 @@ const isChangedCollectionPayload = ( return true; }; -export const createSDK = (rest: RestClientInterface) => { - const ev = new Emitter(); +type EventMap = StreamKeys> = { + [key in `stream-${N}/${K}`]: StreamerCallbackArgs; +}; + +type StreamMapValue = { + stop: () => void; + onChange: ReturnType['onChange']; + ready: () => Promise; + isReady: boolean; + unsubList: Set<() => void>; +}; + +const createNewMeteorStream = (streamName: StreamNames, key: StreamKeys, args: unknown[]): StreamMapValue => { + const ee = new Emitter(); + const meta = { + ready: false, + }; + const sub = Meteor.connection.subscribe( + `stream-${streamName}`, + key, + { useCollection: false, args }, + { + onReady: (args: any) => { + meta.ready = true; + ee.emit('ready', [undefined, args]); + }, + onError: (err: any) => { + console.error(err); + ee.emit('ready', [err]); + }, + }, + ); + + const onChange: ReturnType['onChange'] = (cb) => { + if (meta.ready) { + cb({ + msg: 'ready', + + subs: [], + }); + return; + } + ee.once('ready', ([error, result]) => { + if (error) { + cb({ + msg: 'nosub', + + id: '', + error, + }); + return; + } - const streams = new Map void>(); + cb(result); + }); + }; + + const ready = () => { + if (meta.ready) { + return Promise.resolve(); + } + return new Promise((r) => { + ee.once('ready', r); + }); + }; + + return { + stop: sub.stop, + onChange, + ready, + get isReady() { + return meta.ready; + }, + unsubList: new Set(), + }; +}; + +const createStreamManager = () => { + // Emitter that replicates stream messages to registered callbacks + const streamProxy = new Emitter(); + + // Collection of unsubscribe callbacks for each stream. + // const proxyUnsubLists = new Map void>>(); + + const streams = new Map(); Meteor.connection._stream.on('message', (rawMsg: string) => { const msg = DDPCommon.parseDDP(rawMsg); if (!isChangedCollectionPayload(msg)) { return; } - ev.emit(`${msg.collection}/${msg.fields.eventName}`, msg.fields.args); + streamProxy.emit(`${msg.collection}/${msg.fields.eventName}` as any, msg.fields.args as any); }); const stream: SDK['stream'] = >( name: N, data: [key: K, ...args: unknown[]], - cb: (...args: StreamerCallbackArgs) => void, + callback: (...args: StreamerCallbackArgs) => void, + _options?: { + retransmit?: boolean | undefined; + retransmitToSelf?: boolean | undefined; + }, ): ReturnType => { const [key, ...args] = data; - const streamName = `stream-${name}`; - const streamKey = `${streamName}/${key}`; - - const ee = new Emitter(); + const eventLiteral = `stream-${name}/${key}` as const; - const meta = { - ready: false, + const proxyCallback = (args?: unknown): void => { + if (!args || !Array.isArray(args)) { + throw new Error('Invalid streamer callback'); + } + callback(...(args as StreamerCallbackArgs)); }; - const sub = Meteor.connection.subscribe( - streamName, - key, - { useCollection: false, args }, - { - onReady: (args: any) => { - meta.ready = true; - ee.emit('ready', [undefined, args]); - }, - onError: (err: any) => { - console.error(err); - ee.emit('ready', [err]); - }, - }, - ); + streamProxy.on(eventLiteral, proxyCallback); - const onChange: ReturnType['onChange'] = (cb) => { - if (meta.ready) { - cb({ - msg: 'ready', + const stop = (): void => { + streamProxy.off(eventLiteral, proxyCallback); - subs: [], - }); + // If someone is still listening, don't unsubscribe + if (streamProxy.has(eventLiteral)) { return; } - ee.once('ready', ([error, result]) => { - if (error) { - cb({ - msg: 'nosub', - - id: '', - error, - }); - return; - } - - cb(result); - }); - }; - const ready = () => { - if (meta.ready) { - return Promise.resolve(); + if (stream) { + stream.stop(); + streams.delete(eventLiteral); } - return new Promise((r) => { - ee.once('ready', r); - }); - }; - - const removeEv = ev.on(`${streamKey}`, (args) => cb(...args)); - - const stop = () => { - streams.delete(`${streamKey}`); - sub.stop(); - removeEv(); }; - streams.set(`${streamKey}`, stop); + const stream = streams.get(eventLiteral) || createNewMeteorStream(name, key, args); + stream.unsubList.add(stop); + if (!streams.has(eventLiteral)) { + streams.set(eventLiteral, stream); + } return { id: '', name, params: data as any, stop, - ready, - onChange, - get isReady() { - return meta.ready; - }, + ready: stream.ready, + onChange: stream.onChange, + isReady: stream.isReady, }; }; - const stop = (name: string, key: string) => { - const streamKey = `stream-${name}/${key}`; - const stop = streams.get(streamKey); - if (stop) { - stop(); + const stopAll = (streamName: string, key: string) => { + const stream = streams.get(`stream-${streamName}/${key}`); + + if (stream) { + stream.unsubList.forEach((stop) => stop()); } }; + return { stream, stopAll }; +}; + +export const createSDK = (rest: RestClientInterface) => { + const { stream, stopAll } = createStreamManager(); + const publish = (name: string, args: unknown[]) => { Meteor.call(`stream-${name}`, ...args); }; @@ -163,7 +215,7 @@ export const createSDK = (rest: RestClientInterface) => { return { rest, - stop, + stop: stopAll, stream, publish, call, diff --git a/apps/meteor/app/utils/lib/getURL.ts b/apps/meteor/app/utils/lib/getURL.ts index fae79d65b1db..3d757abb6c83 100644 --- a/apps/meteor/app/utils/lib/getURL.ts +++ b/apps/meteor/app/utils/lib/getURL.ts @@ -77,7 +77,19 @@ export const _getURL = ( export const getURLWithoutSettings = ( path: string, // eslint-disable-next-line @typescript-eslint/naming-convention - { cdn = true, full = false, cloud = false, cloud_route = '', cloud_params = {} }: Record = {}, + { + cdn = true, + full = false, + cloud = false, + cloud_route = '', + cloud_params = {}, + }: { + cdn?: boolean; + full?: boolean; + cloud?: boolean; + cloud_route?: string; + cloud_params?: Record; + }, cdnPrefix: string, siteUrl: string, cloudDeepLinkUrl?: string, diff --git a/apps/meteor/app/utils/lib/i18n.ts b/apps/meteor/app/utils/lib/i18n.ts index 13d5c667709d..9d3fbc59d245 100644 --- a/apps/meteor/app/utils/lib/i18n.ts +++ b/apps/meteor/app/utils/lib/i18n.ts @@ -1,3 +1,4 @@ +import type { RocketchatI18nKeys } from '@rocket.chat/i18n'; import i18next from 'i18next'; import sprintf from 'i18next-sprintf-postprocessor'; @@ -7,7 +8,11 @@ export const i18n = i18next.use(sprintf); export const addSprinfToI18n = function (t: (typeof i18n)['t']) { return function (key: string, ...replaces: any): string { - if (replaces[0] === undefined || isObject(replaces[0])) { + if (replaces[0] === undefined) { + return t(key, ...replaces); + } + + if (isObject(replaces[0]) && !Array.isArray(replaces[0])) { return t(key, ...replaces); } @@ -19,3 +24,123 @@ export const addSprinfToI18n = function (t: (typeof i18n)['t']) { }; export const t = addSprinfToI18n(i18n.t.bind(i18n)); + +/** + * Extract the translation keys from a flat object and group them by namespace + * + * Example: + * + * ```js + * const source = { + * 'core.key1': 'value1', + * 'core.key2': 'value2', + * 'onboarding.key1': 'value1', + * 'onboarding.key2': 'value2', + * 'registration.key1': 'value1', + * 'registration.key2': 'value2', + * 'cloud.key1': 'value1', + * 'cloud.key2': 'value2', + * 'subscription.key1': 'value1', + * 'subscription.key2': 'value2', + * }; + * + * const result = extractTranslationNamespaces(source); + * + * console.log(result); + * + * // { + * // core: { + * // key1: 'value1', + * // key2: 'value2' + * // }, + * // onboarding: { + * // key1: 'value1', + * // key2: 'value2' + * // }, + * // registration: { + * // key1: 'value1', + * // key2: 'value2' + * // }, + * // cloud: { + * // key1: 'value1', + * // key2: 'value2' + * // }, + * // subscription: { + * // key1: 'value1', + * // key2: 'value2' + * // } + * // } + * ``` + * + * @param source the flat object with the translation keys + */ +export const extractTranslationNamespaces = (source: Record): Record> => { + const result: Record> = { + core: {}, + onboarding: {}, + registration: {}, + cloud: {}, + subscription: {}, + }; + + for (const [key, value] of Object.entries(source)) { + const prefix = availableTranslationNamespaces.find((namespace) => key.startsWith(`${namespace}.`)); + const keyWithoutNamespace = prefix ? key.slice(prefix.length + 1) : key; + const ns = prefix ?? defaultTranslationNamespace; + result[ns][keyWithoutNamespace] = value; + } + + return result; +}; + +/** + * Extract only the translation keys that match the given namespaces + * + * @param source the flat object with the translation keys + * @param namespaces the namespaces to extract + */ +export const extractTranslationKeys = (source: Record, namespaces: string | string[] = []): { [key: string]: any } => { + const all = extractTranslationNamespaces(source); + return Array.isArray(namespaces) + ? (namespaces as TranslationNamespace[]).reduce((result, namespace) => ({ ...result, ...all[namespace] }), {}) + : all[namespaces as TranslationNamespace]; +}; + +export type TranslationNamespace = + | (Extract extends `${infer T}.${string}` ? (T extends Lowercase ? T : never) : never) + | 'core'; + +const namespacesMap: Record = { + core: true, + onboarding: true, + registration: true, + cloud: true, + subscription: true, +}; + +export const availableTranslationNamespaces = Object.keys(namespacesMap) as TranslationNamespace[]; +export const defaultTranslationNamespace: TranslationNamespace = 'core'; + +export const applyCustomTranslations = ( + i18n: typeof i18next, + parsedCustomTranslations: Record>, + { namespaces, languages }: { namespaces?: string[]; languages?: string[] } = {}, +) => { + for (const [lng, translations] of Object.entries(parsedCustomTranslations)) { + if (languages && !languages.includes(lng)) { + continue; + } + + for (const [key, value] of Object.entries(translations)) { + const prefix = availableTranslationNamespaces.find((namespace) => key.startsWith(`${namespace}.`)); + const keyWithoutNamespace = prefix ? key.slice(prefix.length + 1) : key; + const ns = prefix ?? defaultTranslationNamespace; + + if (namespaces && !namespaces.includes(ns)) { + continue; + } + + i18n.addResourceBundle(lng, ns, { [keyWithoutNamespace]: value }, true, true); + } + } +}; diff --git a/apps/meteor/app/utils/lib/mimeTypes.ts b/apps/meteor/app/utils/lib/mimeTypes.ts index dd166f17bed3..f2da185f84ba 100644 --- a/apps/meteor/app/utils/lib/mimeTypes.ts +++ b/apps/meteor/app/utils/lib/mimeTypes.ts @@ -1,6 +1,7 @@ import mime from 'mime-type/with-db'; mime.types.wav = 'audio/wav'; +mime.types.lst = 'text/plain'; mime.define('image/vnd.microsoft.icon', { source: '', extensions: ['ico'] }, mime.dupAppend); mime.define('image/x-icon', { source: '', extensions: ['ico'] }, mime.dupAppend); mime.types.ico = 'image/x-icon'; diff --git a/apps/meteor/app/utils/rocketchat-supported-versions.info b/apps/meteor/app/utils/rocketchat-supported-versions.info new file mode 100644 index 000000000000..2c63c0851048 --- /dev/null +++ b/apps/meteor/app/utils/rocketchat-supported-versions.info @@ -0,0 +1,2 @@ +{ +} diff --git a/apps/meteor/app/utils/rocketchat.info b/apps/meteor/app/utils/rocketchat.info index b9e235456291..34642c087e2e 100644 --- a/apps/meteor/app/utils/rocketchat.info +++ b/apps/meteor/app/utils/rocketchat.info @@ -1,3 +1,3 @@ { - "version": "6.5.0-develop" + "version": "7.0.0-develop" } diff --git a/apps/meteor/app/utils/server/getURL.ts b/apps/meteor/app/utils/server/getURL.ts index 17e0a68efa8e..4703569736ad 100644 --- a/apps/meteor/app/utils/server/getURL.ts +++ b/apps/meteor/app/utils/server/getURL.ts @@ -3,7 +3,13 @@ import { getURLWithoutSettings } from '../lib/getURL'; export const getURL = function ( path: string, // eslint-disable-next-line @typescript-eslint/naming-convention - params: Record = {}, + params: { + cdn?: boolean; + full?: boolean; + cloud?: boolean; + cloud_route?: string; + cloud_params?: Record; + } = {}, cloudDeepLinkUrl?: string, ): string { const cdnPrefix = settings.get('CDN_PREFIX') || ''; diff --git a/apps/meteor/app/utils/server/lib/getValidRoomName.ts b/apps/meteor/app/utils/server/lib/getValidRoomName.ts index 5e4be52b6aec..27575c6c624c 100644 --- a/apps/meteor/app/utils/server/lib/getValidRoomName.ts +++ b/apps/meteor/app/utils/server/lib/getValidRoomName.ts @@ -6,11 +6,7 @@ import { Meteor } from 'meteor/meteor'; import { validateName } from '../../../lib/server/functions/validateName'; import { settings } from '../../../settings/server'; -export const getValidRoomName = async ( - displayName: string, - rid = '', - options: { allowDuplicates?: boolean; nameValidationRegex?: string } = {}, -) => { +export const getValidRoomName = async (displayName: string, rid = '', options: { allowDuplicates?: boolean } = {}) => { let slugifiedName = displayName; if (settings.get('UI_Allow_room_names_with_special_chars')) { @@ -36,14 +32,10 @@ export const getValidRoomName = async ( let nameValidation; - if (options.nameValidationRegex) { - nameValidation = new RegExp(options.nameValidationRegex); - } else { - try { - nameValidation = new RegExp(`^${settings.get('UTF8_Channel_Names_Validation')}$`); - } catch (error) { - nameValidation = new RegExp('^[0-9a-zA-Z-_.]+$'); - } + try { + nameValidation = new RegExp(`^${settings.get('UTF8_Channel_Names_Validation')}$`); + } catch (error) { + nameValidation = new RegExp('^[0-9a-zA-Z-_.]+$'); } if (!nameValidation.test(slugifiedName) || !validateName(slugifiedName)) { diff --git a/apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.ts b/apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.ts new file mode 100644 index 000000000000..f3cb9d2f967e --- /dev/null +++ b/apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.ts @@ -0,0 +1,64 @@ +import { Settings } from '@rocket.chat/models'; +import semver from 'semver'; + +import { i18n } from '../../../../server/lib/i18n'; +import { sendMessagesToAdmins } from '../../../../server/lib/sendMessagesToAdmins'; +import { settings } from '../../../settings/server'; +import { Info } from '../../../utils/rocketchat.info'; + +export const buildVersionUpdateMessage = async ( + versions: { + version: string; + security: boolean; + infoUrl: string; + }[] = [], +) => { + const lastCheckedVersion = settings.get('Update_LatestAvailableVersion'); + + if (!lastCheckedVersion) { + return; + } + + for await (const version of versions) { + // Ignore prerelease versions + if (semver.prerelease(version.version)) { + continue; + } + + if (semver.lte(version.version, lastCheckedVersion)) { + continue; + } + + if (semver.lte(version.version, Info.version)) { + continue; + } + + await Settings.updateValueById('Update_LatestAvailableVersion', version.version); + + await sendMessagesToAdmins({ + msgs: async ({ adminUser }) => [ + { + msg: `*${i18n.t('Update_your_RocketChat', { ...(adminUser.language && { lng: adminUser.language }) })}*\n${i18n.t( + 'New_version_available_(s)', + { + postProcess: 'sprintf', + sprintf: [version.version], + }, + )}\n${version.infoUrl}`, + }, + ], + banners: [ + { + id: `versionUpdate-${version.version}`.replace(/\./g, '_'), + priority: 10, + title: 'Update_your_RocketChat', + text: 'New_version_available_(s)', + textArguments: [version.version], + link: version.infoUrl, + modifiers: [], + }, + ], + }); + break; + } +}; diff --git a/apps/meteor/app/version-check/server/functions/checkVersionUpdate.ts b/apps/meteor/app/version-check/server/functions/checkVersionUpdate.ts index 16a3034c0bd3..ca616950a55b 100644 --- a/apps/meteor/app/version-check/server/functions/checkVersionUpdate.ts +++ b/apps/meteor/app/version-check/server/functions/checkVersionUpdate.ts @@ -1,14 +1,11 @@ import type { IUser } from '@rocket.chat/core-typings'; -import { Settings, Users } from '@rocket.chat/models'; -import semver from 'semver'; +import { Users } from '@rocket.chat/models'; import { i18n } from '../../../../server/lib/i18n'; import { sendMessagesToAdmins } from '../../../../server/lib/sendMessagesToAdmins'; -import { settings } from '../../../settings/server'; -import { Info } from '../../../utils/rocketchat.info'; import logger from '../logger'; +import { buildVersionUpdateMessage } from './buildVersionUpdateMessage'; import { getNewUpdates } from './getNewUpdates'; -// import getNewUpdates from '../sampleUpdateData'; const getMessagesToSendToAdmins = async ( alerts: { @@ -42,67 +39,43 @@ const getMessagesToSendToAdmins = async ( } return msgs; }; - +/** + * @deprecated + */ export const checkVersionUpdate = async () => { logger.info('Checking for version updates'); const { versions, alerts } = await getNewUpdates(); - const lastCheckedVersion = settings.get('Update_LatestAvailableVersion'); - - for await (const version of versions) { - if (!lastCheckedVersion) { - break; - } - if (semver.lte(version.version, lastCheckedVersion)) { - continue; - } + await buildVersionUpdateMessage(versions); - if (semver.lte(version.version, Info.version)) { - continue; - } - - await Settings.updateValueById('Update_LatestAvailableVersion', version.version); - - await sendMessagesToAdmins({ - msgs: async ({ adminUser }) => [ - { - msg: `*${i18n.t('Update_your_RocketChat', { ...(adminUser.language && { lng: adminUser.language }) })}*\n${i18n.t( - 'New_version_available_(s)', - { - postProcess: 'sprintf', - sprintf: [version.version], - }, - )}\n${version.infoUrl}`, - }, - ], - banners: [ - { - id: `versionUpdate-${version.version}`.replace(/\./g, '_'), - priority: 10, - title: 'Update_your_RocketChat', - text: 'New_version_available_(s)', - textArguments: [version.version], - link: version.infoUrl, - modifiers: [], - }, - ], - }); - break; - } + await showAlertsFromCloud(alerts); +}; - if (alerts?.length) { - await sendMessagesToAdmins({ - msgs: async ({ adminUser }) => getMessagesToSendToAdmins(alerts, adminUser), - banners: alerts.map((alert) => ({ - id: `alert-${alert.id}`.replace(/\./g, '_'), - priority: 10, - title: alert.title, - text: alert.text, - textArguments: alert.textArguments, - modifiers: alert.modifiers, - link: alert.infoUrl, - })), - }); +const showAlertsFromCloud = async ( + alerts?: { + id: string; + priority: number; + title: string; + text: string; + textArguments?: string[]; + modifiers: string[]; + infoUrl: string; + }[], +) => { + if (!alerts?.length) { + return; } + return sendMessagesToAdmins({ + msgs: async ({ adminUser }) => getMessagesToSendToAdmins(alerts, adminUser), + banners: alerts.map((alert) => ({ + id: `alert-${alert.id}`.replace(/\./g, '_'), + priority: 10, + title: alert.title, + text: alert.text, + textArguments: alert.textArguments, + modifiers: alert.modifiers, + link: alert.infoUrl, + })), + }); }; diff --git a/apps/meteor/app/version-check/server/functions/getNewUpdates.ts b/apps/meteor/app/version-check/server/functions/getNewUpdates.ts index d17191a09be7..926926253a6c 100644 --- a/apps/meteor/app/version-check/server/functions/getNewUpdates.ts +++ b/apps/meteor/app/version-check/server/functions/getNewUpdates.ts @@ -7,6 +7,8 @@ import { check, Match } from 'meteor/check'; import { getWorkspaceAccessToken } from '../../../cloud/server'; import { Info } from '../../../utils/rocketchat.info'; +/** @deprecated */ + export const getNewUpdates = async () => { try { const uniqueID = await Settings.findOne('uniqueID'); diff --git a/apps/meteor/app/webdav/client/actionButton.ts b/apps/meteor/app/webdav/client/actionButton.ts deleted file mode 100644 index 9a2f8152e5c0..000000000000 --- a/apps/meteor/app/webdav/client/actionButton.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { Meteor } from 'meteor/meteor'; - -import { imperativeModal } from '../../../client/lib/imperativeModal'; -import { messageArgs } from '../../../client/lib/utils/messageArgs'; -import SaveToWebdav from '../../../client/views/room/webdav/SaveToWebdavModal'; -import { WebdavAccounts } from '../../models/client'; -import { settings } from '../../settings/client'; -import { MessageAction } from '../../ui-utils/client'; -import { getURL } from '../../utils/client'; - -Meteor.startup(() => { - MessageAction.addButton({ - id: 'webdav-upload', - icon: 'upload', - label: 'Save_To_Webdav', - condition: ({ message, subscription }) => { - if (subscription == null) { - return false; - } - if (WebdavAccounts.findOne() == null) { - return false; - } - if (!message.file) { - return false; - } - - return settings.get('Webdav_Integration_Enabled'); - }, - action(_, props) { - const { message = messageArgs(this).msg } = props; - const [attachment] = message.attachments || []; - const url = getURL(attachment.title_link as string, { full: true }); - imperativeModal.open({ - component: SaveToWebdav, - props: { - data: { - attachment, - url, - }, - onClose: imperativeModal.close, - }, - }); - }, - order: 100, - group: 'menu', - }); -}); diff --git a/apps/meteor/app/webdav/client/index.js b/apps/meteor/app/webdav/client/index.js deleted file mode 100644 index b4f7aa4ef133..000000000000 --- a/apps/meteor/app/webdav/client/index.js +++ /dev/null @@ -1,15 +0,0 @@ -import { Meteor } from 'meteor/meteor'; -import { Tracker } from 'meteor/tracker'; - -import { settings } from '../../settings/client'; - -Meteor.startup(() => { - Tracker.autorun((c) => { - if (!settings.get('Webdav_Integration_Enabled')) { - return; - } - c.stop(); - import('./startup/sync'); - import('./actionButton'); - }); -}); diff --git a/apps/meteor/app/webdav/client/startup/sync.js b/apps/meteor/app/webdav/client/startup/sync.js deleted file mode 100644 index e048472aad71..000000000000 --- a/apps/meteor/app/webdav/client/startup/sync.js +++ /dev/null @@ -1,20 +0,0 @@ -import { Meteor } from 'meteor/meteor'; -import { Tracker } from 'meteor/tracker'; - -import { WebdavAccounts } from '../../../models/client'; -import { Notifications } from '../../../notifications/client'; -import { sdk } from '../../../utils/client/lib/SDKClient'; - -const events = { - changed: (account) => WebdavAccounts.upsert({ _id: account._id }, account), - removed: ({ _id }) => WebdavAccounts.remove({ _id }), -}; - -Tracker.autorun(async () => { - if (!Meteor.userId()) { - return; - } - const { accounts } = await sdk.rest.get('/v1/webdav.getMyAccounts'); - accounts.forEach((account) => WebdavAccounts.insert(account)); - Notifications.onUser('webdav', ({ type, account }) => events[type](account)); -}); diff --git a/apps/meteor/app/webrtc/client/WebRTCClass.js b/apps/meteor/app/webrtc/client/WebRTCClass.js index 721c7591c647..eb9772966575 100644 --- a/apps/meteor/app/webrtc/client/WebRTCClass.js +++ b/apps/meteor/app/webrtc/client/WebRTCClass.js @@ -7,8 +7,8 @@ import GenericModal from '../../../client/components/GenericModal'; import { imperativeModal } from '../../../client/lib/imperativeModal'; import { goToRoomById } from '../../../client/lib/utils/goToRoomById'; import { ChatSubscription } from '../../models/client'; -import { Notifications } from '../../notifications/client'; import { settings } from '../../settings/client'; +import { sdk } from '../../utils/client/lib/SDKClient'; import { t } from '../../utils/lib/i18n'; import { WEB_RTC_EVENTS } from '../lib/constants'; import { ChromeScreenShare } from './screenShare'; @@ -18,7 +18,7 @@ class WebRTCTransportClass extends Emitter { super(); this.debug = false; this.webrtcInstance = webrtcInstance; - Notifications.onRoom(this.webrtcInstance.room, WEB_RTC_EVENTS.WEB_RTC, (type, data) => { + sdk.stream('notify-room', [`${this.webrtcInstance.room}/${WEB_RTC_EVENTS.WEB_RTC}`], (type, data) => { this.log('WebRTCTransportClass - onRoom', type, data); this.emit(type, data); }); @@ -41,30 +41,42 @@ class WebRTCTransportClass extends Emitter { startCall(data) { this.log('WebRTCTransportClass - startCall', this.webrtcInstance.room, this.webrtcInstance.selfId); - Notifications.notifyUsersOfRoom(this.webrtcInstance.room, WEB_RTC_EVENTS.WEB_RTC, WEB_RTC_EVENTS.CALL, { - from: this.webrtcInstance.selfId, - room: this.webrtcInstance.room, - media: data.media, - monitor: data.monitor, - }); + sdk.publish('notify-room-users', [ + `${this.webrtcInstance.room}/${WEB_RTC_EVENTS.WEB_RTC}`, + WEB_RTC_EVENTS.CALL, + { + from: this.webrtcInstance.selfId, + room: this.webrtcInstance.room, + media: data.media, + monitor: data.monitor, + }, + ]); } joinCall(data) { this.log('WebRTCTransportClass - joinCall', this.webrtcInstance.room, this.webrtcInstance.selfId); if (data.monitor === true) { - Notifications.notifyUser(data.to, WEB_RTC_EVENTS.WEB_RTC, WEB_RTC_EVENTS.JOIN, { - from: this.webrtcInstance.selfId, - room: this.webrtcInstance.room, - media: data.media, - monitor: data.monitor, - }); + sdk.publish('notify-user', [ + `${data.to}/${WEB_RTC_EVENTS.WEB_RTC}`, + WEB_RTC_EVENTS.JOIN, + { + from: this.webrtcInstance.selfId, + room: this.webrtcInstance.room, + media: data.media, + monitor: data.monitor, + }, + ]); } else { - Notifications.notifyUsersOfRoom(this.webrtcInstance.room, WEB_RTC_EVENTS.WEB_RTC, WEB_RTC_EVENTS.JOIN, { - from: this.webrtcInstance.selfId, - room: this.webrtcInstance.room, - media: data.media, - monitor: data.monitor, - }); + sdk.publish('notify-room-users', [ + `${this.webrtcInstance.room}/${WEB_RTC_EVENTS.WEB_RTC}`, + WEB_RTC_EVENTS.JOIN, + { + from: this.webrtcInstance.selfId, + room: this.webrtcInstance.room, + media: data.media, + monitor: data.monitor, + }, + ]); } } @@ -72,20 +84,20 @@ class WebRTCTransportClass extends Emitter { data.from = this.webrtcInstance.selfId; data.room = this.webrtcInstance.room; this.log('WebRTCTransportClass - sendCandidate', data); - Notifications.notifyUser(data.to, WEB_RTC_EVENTS.WEB_RTC, WEB_RTC_EVENTS.CANDIDATE, data); + sdk.publish('notify-user', [`${data.to}/${WEB_RTC_EVENTS.WEB_RTC}`, WEB_RTC_EVENTS.CANDIDATE, data]); } sendDescription(data) { data.from = this.webrtcInstance.selfId; data.room = this.webrtcInstance.room; this.log('WebRTCTransportClass - sendDescription', data); - Notifications.notifyUser(data.to, WEB_RTC_EVENTS.WEB_RTC, WEB_RTC_EVENTS.DESCRIPTION, data); + sdk.publish('notify-user', [`${data.to}/${WEB_RTC_EVENTS.WEB_RTC}`, WEB_RTC_EVENTS.DESCRIPTION, data]); } sendStatus(data) { this.log('WebRTCTransportClass - sendStatus', data, this.webrtcInstance.room); data.from = this.webrtcInstance.selfId; - Notifications.notifyRoom(this.webrtcInstance.room, WEB_RTC_EVENTS.WEB_RTC, WEB_RTC_EVENTS.STATUS, data); + sdk.publish('notify-room', [`${this.webrtcInstance.room}/${WEB_RTC_EVENTS.WEB_RTC}`, WEB_RTC_EVENTS.STATUS, data]); } onRemoteCall(fn) { @@ -969,7 +981,7 @@ const WebRTC = new (class { Meteor.startup(() => { Tracker.autorun(() => { if (Meteor.userId()) { - Notifications.onUser(WEB_RTC_EVENTS.WEB_RTC, (type, data) => { + sdk.stream('notify-user', [`${Meteor.userId()}/${WEB_RTC_EVENTS.WEB_RTC}`], (type, data) => { if (data.room == null) { return; } diff --git a/apps/meteor/app/webrtc/client/actionLink.tsx b/apps/meteor/app/webrtc/client/actionLink.tsx index f9848518b868..d4575f2dd60f 100644 --- a/apps/meteor/app/webrtc/client/actionLink.tsx +++ b/apps/meteor/app/webrtc/client/actionLink.tsx @@ -3,7 +3,6 @@ import type { IMessage } from '@rocket.chat/core-typings'; import { actionLinks } from '../../../client/lib/actionLinks'; import { dispatchToastMessage } from '../../../client/lib/toast'; import { ChatRoom } from '../../models/client'; -import { Notifications } from '../../notifications/client'; import { sdk } from '../../utils/client/lib/SDKClient'; import { t } from '../../utils/lib/i18n'; @@ -31,5 +30,5 @@ actionLinks.register('endLivechatWebRTCCall', async (message: IMessage) => { return; } await sdk.rest.put(`/v1/livechat/webrtc.call/${message._id}`, { rid: _id, status: 'ended' }); - Notifications.notifyRoom(_id, 'webrtc' as any, 'callStatus', { callStatus: 'ended' }); + sdk.publish('notify-room', [`${_id}/webrtc`, 'callStatus', { callStatus: 'ended' }]); }); diff --git a/apps/meteor/app/webrtc/lib/constants.ts b/apps/meteor/app/webrtc/lib/constants.ts index 1beb27756f88..fd3f26933d96 100644 --- a/apps/meteor/app/webrtc/lib/constants.ts +++ b/apps/meteor/app/webrtc/lib/constants.ts @@ -5,4 +5,4 @@ export const WEB_RTC_EVENTS = { JOIN: 'join', CANDIDATE: 'candidate', DESCRIPTION: 'description', -}; +} as const; diff --git a/apps/meteor/app/wordpress/client/lib.ts b/apps/meteor/app/wordpress/client/lib.ts index 7dd5215ccc60..b213d5fb88c2 100644 --- a/apps/meteor/app/wordpress/client/lib.ts +++ b/apps/meteor/app/wordpress/client/lib.ts @@ -3,7 +3,7 @@ import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; import _ from 'underscore'; -import { CustomOAuth } from '../../custom-oauth/client/custom_oauth_client'; +import { CustomOAuth } from '../../custom-oauth/client/CustomOAuth'; import { settings } from '../../settings/client'; const config: OauthConfig = { diff --git a/apps/meteor/client/UIKit/hooks/useUIKitHandleAction.tsx b/apps/meteor/client/UIKit/hooks/useUIKitHandleAction.tsx deleted file mode 100644 index 6a97f18a7936..000000000000 --- a/apps/meteor/client/UIKit/hooks/useUIKitHandleAction.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import { UIKitIncomingInteractionContainerType } from '@rocket.chat/apps-engine/definition/uikit/UIKitIncomingInteractionContainer'; -import type { UiKitPayload, UIKitActionEvent } from '@rocket.chat/core-typings'; -import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; - -import { useUiKitActionManager } from '../../hooks/useUiKitActionManager'; - -const useUIKitHandleAction = (state: S): ((event: UIKitActionEvent) => Promise) => { - const actionManager = useUiKitActionManager(); - return useMutableCallback(async ({ blockId, value, appId, actionId }) => { - if (!appId) { - throw new Error('useUIKitHandleAction - invalid appId'); - } - return actionManager.triggerBlockAction({ - container: { - type: UIKitIncomingInteractionContainerType.VIEW, - id: state.viewId || state.appId, - }, - actionId, - appId, - value, - blockId, - }); - }); -}; - -export { useUIKitHandleAction }; diff --git a/apps/meteor/client/UIKit/hooks/useUIKitHandleClose.tsx b/apps/meteor/client/UIKit/hooks/useUIKitHandleClose.tsx deleted file mode 100644 index 672e1b311b5d..000000000000 --- a/apps/meteor/client/UIKit/hooks/useUIKitHandleClose.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import type { UIKitInteractionType } from '@rocket.chat/apps-engine/definition/uikit'; -import type { UiKitPayload } from '@rocket.chat/core-typings'; -import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; -import { useToastMessageDispatch } from '@rocket.chat/ui-contexts'; - -import { useUiKitActionManager } from '../../hooks/useUiKitActionManager'; - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -const emptyFn = (_error: any, _result: UIKitInteractionType | void): void => undefined; - -const useUIKitHandleClose = (state: S, fn = emptyFn): (() => Promise) => { - const actionManager = useUiKitActionManager(); - const dispatchToastMessage = useToastMessageDispatch(); - return useMutableCallback(() => - actionManager - .triggerCancel({ - appId: state.appId, - viewId: state.viewId, - view: { - ...state, - id: state.viewId, - }, - isCleared: true, - }) - .then((result) => fn(undefined, result)) - .catch((error) => { - dispatchToastMessage({ type: 'error', message: error }); - fn(error, undefined); - return Promise.reject(error); - }), - ); -}; - -export { useUIKitHandleClose }; diff --git a/apps/meteor/client/UIKit/hooks/useUIKitStateManager.tsx b/apps/meteor/client/UIKit/hooks/useUIKitStateManager.tsx deleted file mode 100644 index 26b329f2ea60..000000000000 --- a/apps/meteor/client/UIKit/hooks/useUIKitStateManager.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import type { UIKitUserInteractionResult, UiKitPayload } from '@rocket.chat/core-typings'; -import { isErrorType } from '@rocket.chat/core-typings'; -import { useSafely } from '@rocket.chat/fuselage-hooks'; -import { useEffect, useState } from 'react'; - -import { useUiKitActionManager } from '../../hooks/useUiKitActionManager'; - -const useUIKitStateManager = (initialState: S): S => { - const actionManager = useUiKitActionManager(); - const [state, setState] = useSafely(useState(initialState)); - - const { viewId } = state; - - useEffect(() => { - const handleUpdate = ({ ...data }: UIKitUserInteractionResult): void => { - if (isErrorType(data)) { - const { errors } = data; - setState((state) => ({ ...state, errors })); - return; - } - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const { type, ...rest } = data; - setState(rest as any); - }; - - actionManager.on(viewId, handleUpdate); - - return (): void => { - actionManager.off(viewId, handleUpdate); - }; - }, [setState, viewId]); - - return state; -}; - -export { useUIKitStateManager }; diff --git a/apps/meteor/client/components/ActionManagerBusyState.tsx b/apps/meteor/client/components/ActionManagerBusyState.tsx index 0374254a7de9..1399c045271f 100644 --- a/apps/meteor/client/components/ActionManagerBusyState.tsx +++ b/apps/meteor/client/components/ActionManagerBusyState.tsx @@ -3,7 +3,7 @@ import { Box } from '@rocket.chat/fuselage'; import { useTranslation } from '@rocket.chat/ui-contexts'; import React, { useEffect, useState } from 'react'; -import { useUiKitActionManager } from '../hooks/useUiKitActionManager'; +import { useUiKitActionManager } from '../uikit/hooks/useUiKitActionManager'; const ActionManagerBusyState = () => { const t = useTranslation(); @@ -15,10 +15,12 @@ const ActionManagerBusyState = () => { return; } - actionManager.on('busy', ({ busy }: { busy: boolean }) => setBusy(busy)); + const handleBusyStateChange = ({ busy }: { busy: boolean }) => setBusy(busy); + + actionManager.on('busy', handleBusyStateChange); return () => { - actionManager.off('busy'); + actionManager.off('busy', handleBusyStateChange); }; }, [actionManager]); diff --git a/apps/meteor/client/components/AutoCompleteAgent.tsx b/apps/meteor/client/components/AutoCompleteAgent.tsx index b4e287bcc4ae..059ac4251cc8 100644 --- a/apps/meteor/client/components/AutoCompleteAgent.tsx +++ b/apps/meteor/client/components/AutoCompleteAgent.tsx @@ -11,18 +11,26 @@ type AutoCompleteAgentProps = { value: string; error?: string; placeholder?: string; - onChange: (value: string) => void; haveAll?: boolean; haveNoAgentsSelectedOption?: boolean; + excludeId?: string; + showIdleAgents?: boolean; + onlyAvailable?: boolean; + withTitle?: boolean; + onChange: (value: string) => void; }; const AutoCompleteAgent = ({ value, error, placeholder, - onChange, haveAll = false, haveNoAgentsSelectedOption = false, + excludeId, + showIdleAgents = true, + onlyAvailable = false, + withTitle = false, + onChange, }: AutoCompleteAgentProps): ReactElement => { const [agentsFilter, setAgentsFilter] = useState(''); @@ -30,26 +38,16 @@ const AutoCompleteAgent = ({ const { itemsList: AgentsList, loadMoreItems: loadMoreAgents } = useAgentsList( useMemo( - () => ({ text: debouncedAgentsFilter, haveAll, haveNoAgentsSelectedOption }), - [debouncedAgentsFilter, haveAll, haveNoAgentsSelectedOption], + () => ({ text: debouncedAgentsFilter, onlyAvailable, haveAll, haveNoAgentsSelectedOption, excludeId, showIdleAgents }), + [debouncedAgentsFilter, excludeId, haveAll, haveNoAgentsSelectedOption, onlyAvailable, showIdleAgents], ), ); const { phase: agentsPhase, itemCount: agentsTotal, items: agentsItems } = useRecordList(AgentsList); - const sortedByName = agentsItems.sort((a, b) => { - if (a.label > b.label) { - return 1; - } - if (a.label < b.label) { - return -1; - } - - return 0; - }); - return ( void} - options={sortedByName} + options={agentsItems} data-qa='autocomplete-agent' endReached={ agentsPhase === AsyncStatePhase.LOADING ? (): void => undefined : (start): void => loadMoreAgents(start, Math.min(50, agentsTotal)) diff --git a/apps/meteor/client/components/AutoCompleteDepartment.tsx b/apps/meteor/client/components/AutoCompleteDepartment.tsx index b4017b954eed..4688899890fb 100644 --- a/apps/meteor/client/components/AutoCompleteDepartment.tsx +++ b/apps/meteor/client/components/AutoCompleteDepartment.tsx @@ -1,7 +1,7 @@ import { PaginatedSelectFiltered } from '@rocket.chat/fuselage'; import { useDebouncedValue } from '@rocket.chat/fuselage-hooks'; import { useTranslation } from '@rocket.chat/ui-contexts'; -import type { ReactElement } from 'react'; +import type { ComponentProps, ReactElement } from 'react'; import React, { memo, useMemo, useState } from 'react'; import { useRecordList } from '../hooks/lists/useRecordList'; @@ -16,7 +16,7 @@ type AutoCompleteDepartmentProps = { haveAll?: boolean; haveNone?: boolean; showArchived?: boolean; -}; +} & Omit, 'options' | 'setFilter'>; const AutoCompleteDepartment = ({ value, @@ -26,6 +26,7 @@ const AutoCompleteDepartment = ({ haveAll, haveNone, showArchived = false, + ...props }: AutoCompleteDepartmentProps): ReactElement | null => { const t = useTranslation(); const [departmentsFilter, setDepartmentsFilter] = useState(''); @@ -50,6 +51,7 @@ const AutoCompleteDepartment = ({ return ( , 'options'>; const AutoCompleteDepartmentMultiple = ({ value = [], diff --git a/apps/meteor/client/components/Contextualbar/Contextualbar.tsx b/apps/meteor/client/components/Contextualbar/Contextualbar.tsx deleted file mode 100644 index 9908ce2cdfa6..000000000000 --- a/apps/meteor/client/components/Contextualbar/Contextualbar.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import { Contextualbar as ContextualbarComponent } from '@rocket.chat/fuselage'; -import { useLayoutSizes, useLayoutContextualBarPosition } from '@rocket.chat/ui-contexts'; -import type { FC, ComponentProps } from 'react'; -import React, { memo } from 'react'; - -const Contextualbar: FC> = ({ children, bg = 'room', ...props }) => { - const sizes = useLayoutSizes(); - const position = useLayoutContextualBarPosition(); - - return ( - - {children} - - ); -}; - -export default memo(Contextualbar); diff --git a/apps/meteor/client/components/Contextualbar/ContextualbarDialog.tsx b/apps/meteor/client/components/Contextualbar/ContextualbarDialog.tsx new file mode 100644 index 000000000000..c3421f3fc9d3 --- /dev/null +++ b/apps/meteor/client/components/Contextualbar/ContextualbarDialog.tsx @@ -0,0 +1,57 @@ +import { Contextualbar } from '@rocket.chat/fuselage'; +import { FeaturePreview, FeaturePreviewOff, FeaturePreviewOn } from '@rocket.chat/ui-client'; +import { useLayoutSizes, useLayoutContextualBarPosition } from '@rocket.chat/ui-contexts'; +import type { ComponentProps, KeyboardEvent } from 'react'; +import React, { useCallback, useRef } from 'react'; +import type { AriaDialogProps } from 'react-aria'; +import { FocusScope, useDialog } from 'react-aria'; + +import { useRoomToolbox } from '../../views/room/contexts/RoomToolboxContext'; +import ContextualbarResizable from './ContextualbarResizable'; + +type ContextualbarDialogProps = AriaDialogProps & ComponentProps; + +/** + * TODO: inside administration it should have a mechanism to display the contextualbar programmatically + * @prop closeTab only work inside a room + * */ +const ContextualbarDialog = (props: ContextualbarDialogProps) => { + const ref = useRef(null); + const { dialogProps } = useDialog({ 'aria-labelledby': 'contextualbarTitle', ...props }, ref); + const sizes = useLayoutSizes(); + const position = useLayoutContextualBarPosition(); + const { closeTab } = useRoomToolbox(); + + const callbackRef = useCallback( + (node) => { + if (!node) { + return; + } + + ref.current = node; + node.addEventListener('keydown', (e: KeyboardEvent) => { + if (e.key === 'Escape') { + closeTab(); + } + }); + }, + [closeTab], + ); + + return ( + + + + + + + + + + + + + ); +}; + +export default ContextualbarDialog; diff --git a/apps/meteor/client/components/Contextualbar/ContextualbarResizable.tsx b/apps/meteor/client/components/Contextualbar/ContextualbarResizable.tsx new file mode 100644 index 000000000000..05dd9bf0cf2e --- /dev/null +++ b/apps/meteor/client/components/Contextualbar/ContextualbarResizable.tsx @@ -0,0 +1,40 @@ +import { css } from '@rocket.chat/css-in-js'; +import { Palette, Box } from '@rocket.chat/fuselage'; +import { useLocalStorage } from '@rocket.chat/fuselage-hooks'; +import { Resizable } from 're-resizable'; +import type { ComponentProps } from 'react'; +import React from 'react'; + +type ContextualbarResizableProps = { defaultWidth: string } & ComponentProps; + +const ContextualbarResizable = ({ defaultWidth, children, ...props }: ContextualbarResizableProps) => { + const [contextualbarWidth, setContextualbarWidth] = useLocalStorage('contextualbarWidth', defaultWidth); + const handleStyle = css` + height: 100%; + &:hover { + background-color: ${Palette.stroke['stroke-highlight']}; + } + `; + + return ( + { + setContextualbarWidth(elRef.style.width); + }} + defaultSize={{ + width: contextualbarWidth, + height: '100%', + }} + minWidth={defaultWidth} + maxWidth='50%' + minHeight='100%' + handleStyles={{ left: { width: '3px', zIndex: '5', left: 0 } }} + handleComponent={{ left: }} + > + {children} + + ); +}; + +export default ContextualbarResizable; diff --git a/apps/meteor/client/components/Contextualbar/ContextualbarScrollableContent.tsx b/apps/meteor/client/components/Contextualbar/ContextualbarScrollableContent.tsx index 6be178f86f77..76069d748e92 100644 --- a/apps/meteor/client/components/Contextualbar/ContextualbarScrollableContent.tsx +++ b/apps/meteor/client/components/Contextualbar/ContextualbarScrollableContent.tsx @@ -2,14 +2,14 @@ import { Margins } from '@rocket.chat/fuselage'; import type { ComponentProps } from 'react'; import React, { forwardRef, memo } from 'react'; -import Page from '../Page'; +import { PageScrollableContent } from '../Page'; -const ContextualbarScrollableContent = forwardRef>( +const ContextualbarScrollableContent = forwardRef>( function ContextualbarScrollableContent({ children, ...props }, ref) { return ( - + {children} - + ); }, ); diff --git a/apps/meteor/client/components/Contextualbar/ContextualbarTitle.tsx b/apps/meteor/client/components/Contextualbar/ContextualbarTitle.tsx new file mode 100644 index 000000000000..506be155ce18 --- /dev/null +++ b/apps/meteor/client/components/Contextualbar/ContextualbarTitle.tsx @@ -0,0 +1,9 @@ +import { ContextualbarTitle as ContextualbarTitleComponent } from '@rocket.chat/fuselage'; +import type { ComponentProps } from 'react'; +import React from 'react'; + +const ContextualbarTitle = (props: ComponentProps) => ( + +); + +export default ContextualbarTitle; diff --git a/apps/meteor/client/components/Contextualbar/index.ts b/apps/meteor/client/components/Contextualbar/index.ts index b9413335775f..c370b7f790fc 100644 --- a/apps/meteor/client/components/Contextualbar/index.ts +++ b/apps/meteor/client/components/Contextualbar/index.ts @@ -1,23 +1,25 @@ import { + Contextualbar, ContextualbarAction, ContextualbarActions, ContextualbarContent, ContextualbarSkeleton, ContextualbarIcon, ContextualbarFooter, - ContextualbarTitle, ContextualbarEmptyContent, } from '@rocket.chat/fuselage'; -import Contextualbar from './Contextualbar'; import ContextualbarBack from './ContextualbarBack'; import ContextualbarClose from './ContextualbarClose'; +import ContextualbarDialog from './ContextualbarDialog'; import ContextualbarHeader from './ContextualbarHeader'; import ContextualbarInnerContent from './ContextualbarInnerContent'; import ContextualbarScrollableContent from './ContextualbarScrollableContent'; +import ContextualbarTitle from './ContextualbarTitle'; export { Contextualbar, + ContextualbarDialog, ContextualbarHeader, ContextualbarAction, ContextualbarActions, diff --git a/apps/meteor/client/components/CreateDiscussion/CreateDiscussion.tsx b/apps/meteor/client/components/CreateDiscussion/CreateDiscussion.tsx index 5a0ab9555939..e6bce31b0b87 100644 --- a/apps/meteor/client/components/CreateDiscussion/CreateDiscussion.tsx +++ b/apps/meteor/client/components/CreateDiscussion/CreateDiscussion.tsx @@ -32,6 +32,7 @@ type CreateDiscussionFormValues = { encrypted: boolean; usernames: Array; firstMessage: string; + topic: string; }; type CreateDiscussionProps = { @@ -49,6 +50,7 @@ const CreateDiscussion = ({ onClose, defaultParentRoom, parentMessageId, nameSug handleSubmit, control, watch, + register, } = useForm({ mode: 'onBlur', defaultValues: { @@ -57,6 +59,7 @@ const CreateDiscussion = ({ onClose, defaultParentRoom, parentMessageId, nameSug encrypted: false, usernames: [], firstMessage: '', + topic: '', }, }); @@ -72,21 +75,23 @@ const CreateDiscussion = ({ onClose, defaultParentRoom, parentMessageId, nameSug }, }); - const handleCreate = async ({ name, parentRoom, encrypted, usernames, firstMessage }: CreateDiscussionFormValues) => { + const handleCreate = async ({ name, parentRoom, encrypted, usernames, firstMessage, topic }: CreateDiscussionFormValues) => { createDiscussionMutation.mutate({ prid: defaultParentRoom || parentRoom, t_name: name, users: usernames, reply: encrypted ? undefined : firstMessage, + topic, ...(parentMessageId && { pmid: parentMessageId }), }); }; - const targetChannelField = useUniqueId(); - const encryptedField = useUniqueId(); - const discussionField = useUniqueId(); - const usersField = useUniqueId(); - const firstMessageField = useUniqueId(); + const parentRoomId = useUniqueId(); + const encryptedId = useUniqueId(); + const discussionNameId = useUniqueId(); + const membersId = useUniqueId(); + const firstMessageId = useUniqueId(); + const topicId = useUniqueId(); return ( {t('Discussion_description')} - + {t('Discussion_target_channel')} @@ -123,38 +128,26 @@ const CreateDiscussion = ({ onClose, defaultParentRoom, parentMessageId, nameSug onBlur={onBlur} onChange={onChange} value={value} - id={targetChannelField} - placeholder={t('Discussion_target_channel_description')} + id={parentRoomId} + placeholder={t('Search_options')} disabled={Boolean(defaultParentRoom)} aria-invalid={Boolean(errors.parentRoom)} aria-required='true' - aria-describedby={`${targetChannelField}-error`} + aria-describedby={`${parentRoomId}-error`} /> )} /> )} {errors.parentRoom && ( - + {errors.parentRoom.message} )} - - {t('Encrypted')} - - } - /> - - - - - - {t('Discussion_name')} + + {t('Name')} ( } /> )} /> {errors.name && ( - + {errors.name.message} )} - {t('Invite_Users')} + {t('Topic')} + + + + + {t('Displayed_next_to_name')} + + + + {t('Members')} ( )} /> - {t('Discussion_first_message_title')} + {t('Discussion_first_message_title')} ( )} /> - {encrypted && {t('Discussion_first_message_disabled_due_to_e2e')}} + {encrypted ? ( + {t('Discussion_first_message_disabled_due_to_e2e')} + ) : ( + {t('First_message_hint')} + )} + + + + {t('Encrypted')} + } + /> + + {encrypted ? ( + {t('Encrypted_messages', { roomType: 'discussion' })} + ) : ( + {t('Encrypted_messages_false')} + )} - diff --git a/apps/meteor/client/components/CustomScrollbars/CustomScrollbars.tsx b/apps/meteor/client/components/CustomScrollbars/CustomScrollbars.tsx new file mode 100644 index 000000000000..c98dcb0d7e65 --- /dev/null +++ b/apps/meteor/client/components/CustomScrollbars/CustomScrollbars.tsx @@ -0,0 +1,54 @@ +import type { ScrollValues } from 'rc-scrollbars'; +import { Scrollbars } from 'rc-scrollbars'; +import type { MutableRefObject, CSSProperties, ReactNode, ReactElement } from 'react'; +import React, { memo, forwardRef, useCallback } from 'react'; + +export type CustomScrollbarsProps = { + overflowX?: boolean; + style?: CSSProperties; + children?: ReactNode; + onScroll?: (values: ScrollValues) => void; + renderView?: typeof Scrollbars.defaultProps.renderView; + renderTrackHorizontal?: typeof Scrollbars.defaultProps.renderTrackHorizontal; + autoHide?: boolean; +}; + +const CustomScrollbars = forwardRef(function CustomScrollbars( + { children, onScroll, overflowX, renderView, ...props }, + ref, +) { + const refSetter = useCallback( + (scrollbarRef) => { + if (ref && scrollbarRef) { + if (typeof ref === 'function') { + ref(scrollbarRef.view ?? null); + return; + } + + (ref as MutableRefObject).current = scrollbarRef.view; + } + }, + [ref], + ); + + return ( +
+ } + renderThumbVertical={({ style, ...props }): JSX.Element => ( +
+ )} + children={children} + ref={refSetter} + /> + ); +}); + +export default memo(CustomScrollbars); diff --git a/apps/meteor/client/components/CustomScrollbars/VirtuosoScrollbars.tsx b/apps/meteor/client/components/CustomScrollbars/VirtuosoScrollbars.tsx new file mode 100644 index 000000000000..a7d0371e4ab8 --- /dev/null +++ b/apps/meteor/client/components/CustomScrollbars/VirtuosoScrollbars.tsx @@ -0,0 +1,23 @@ +import type { ComponentProps, ReactElement, Ref } from 'react'; +import React, { forwardRef } from 'react'; + +import CustomScrollbars from './CustomScrollbars'; + +type VirtuosoScrollbarsProps = ComponentProps; + +const VirtuosoScrollbars = forwardRef(function VirtuosoScrollbars( + { style, children, ...props }: VirtuosoScrollbarsProps, + ref: Ref, +): ReactElement { + return ( +
} + > + {children} + + ); +}); + +export default VirtuosoScrollbars; diff --git a/apps/meteor/client/components/CustomScrollbars/index.ts b/apps/meteor/client/components/CustomScrollbars/index.ts new file mode 100644 index 000000000000..176bb6f81657 --- /dev/null +++ b/apps/meteor/client/components/CustomScrollbars/index.ts @@ -0,0 +1,3 @@ +export { default as CustomScrollbars } from './CustomScrollbars'; +export { default as VirtuosoScrollbars } from './VirtuosoScrollbars'; +export * from './CustomScrollbars'; diff --git a/apps/meteor/client/components/GazzodownText.tsx b/apps/meteor/client/components/GazzodownText.tsx index 76868f84e3af..73d55495630c 100644 --- a/apps/meteor/client/components/GazzodownText.tsx +++ b/apps/meteor/client/components/GazzodownText.tsx @@ -1,21 +1,23 @@ import type { IRoom } from '@rocket.chat/core-typings'; +import { useLocalStorage } from '@rocket.chat/fuselage-hooks'; import type { ChannelMention, UserMention } from '@rocket.chat/gazzodown'; import { MarkupInteractionContext } from '@rocket.chat/gazzodown'; import { escapeRegExp } from '@rocket.chat/string-helpers'; +import { useFeaturePreview } from '@rocket.chat/ui-client'; import { useLayout, useRouter, useSetting, useUserPreference, useUserId } from '@rocket.chat/ui-contexts'; import type { UIEvent } from 'react'; import React, { useCallback, memo, useMemo } from 'react'; import { detectEmoji } from '../lib/utils/detectEmoji'; import { fireGlobalEvent } from '../lib/utils/fireGlobalEvent'; -import { useChat } from '../views/room/contexts/ChatContext'; +import { useUserCard } from '../views/room/contexts/UserCardContext'; import { useGoToRoom } from '../views/room/hooks/useGoToRoom'; import { useMessageListHighlights } from './message/list/MessageListContext'; type GazzodownTextProps = { children: JSX.Element; mentions?: { - type: 'user' | 'team'; + type?: 'user' | 'team'; _id: string; username?: string; name?: string; @@ -25,7 +27,12 @@ type GazzodownTextProps = { }; const GazzodownText = ({ mentions, channels, searchText, children }: GazzodownTextProps) => { + const enableTimestamp = useFeaturePreview('enable-timestamp-message-parser'); + const [userLanguage] = useLocalStorage('userLanguage', 'en'); + const highlights = useMessageListHighlights(); + const { triggerProps, openUserCard } = useUserCard(); + const highlightRegex = useMemo(() => { if (!highlights?.length) { return; @@ -51,8 +58,6 @@ const GazzodownText = ({ mentions, channels, searchText, children }: GazzodownTe const ownUserId = useUserId(); const showMentionSymbol = Boolean(useUserPreference('mentionsWithSymbol')); - const chat = useChat(); - const resolveUserMention = useCallback( (mention: string) => { if (mention === 'all' || mention === 'here') { @@ -75,10 +80,10 @@ const GazzodownText = ({ mentions, channels, searchText, children }: GazzodownTe return (event: UIEvent): void => { event.stopPropagation(); - chat?.userCard.open(username)(event); + openUserCard(event, username); }; }, - [chat?.userCard], + [openUserCard], ); const goToRoom = useGoToRoom(); @@ -124,6 +129,9 @@ const GazzodownText = ({ mentions, channels, searchText, children }: GazzodownTe isMobile, ownUserId, showMentionSymbol, + triggerProps, + enableTimestamp, + language: userLanguage, }} > {children} diff --git a/apps/meteor/client/components/GenericCard/GenericCard.tsx b/apps/meteor/client/components/GenericCard/GenericCard.tsx new file mode 100644 index 000000000000..335b8e6be959 --- /dev/null +++ b/apps/meteor/client/components/GenericCard/GenericCard.tsx @@ -0,0 +1,34 @@ +import { Card, CardTitle, CardBody, CardControls, CardHeader, FramedIcon } from '@rocket.chat/fuselage'; +import { useUniqueId } from '@rocket.chat/fuselage-hooks'; +import type { ComponentProps, ReactElement } from 'react'; +import React from 'react'; + +import type { GenericCardButton } from './GenericCardButton'; + +type GenericCardProps = { + title: string; + body: string; + buttons?: ReactElement[]; + icon?: ComponentProps['icon']; + type?: 'info' | 'success' | 'warning' | 'danger' | 'neutral'; +} & ComponentProps; + +export const GenericCard: React.FC = ({ title, body, buttons, icon, type, ...props }) => { + const cardId = useUniqueId(); + const descriptionId = useUniqueId(); + + const iconType = type && { + [type]: true, + }; + + return ( + + + {icon && } + {title} + + {body} + {buttons && {buttons}} + + ); +}; diff --git a/apps/meteor/client/components/GenericCard/GenericCardButton.tsx b/apps/meteor/client/components/GenericCard/GenericCardButton.tsx new file mode 100644 index 000000000000..b89ec26b6e9b --- /dev/null +++ b/apps/meteor/client/components/GenericCard/GenericCardButton.tsx @@ -0,0 +1,5 @@ +import { Button } from '@rocket.chat/fuselage'; +import type { ComponentProps } from 'react'; +import React from 'react'; + +export const GenericCardButton = (props: ComponentProps) => )} {onConfirm && ( )} diff --git a/apps/meteor/client/components/GenericUpsellModal/hooks/useUpsellActions.ts b/apps/meteor/client/components/GenericUpsellModal/hooks/useUpsellActions.ts index 0c3b111630ca..2a51a53b09bf 100644 --- a/apps/meteor/client/components/GenericUpsellModal/hooks/useUpsellActions.ts +++ b/apps/meteor/client/components/GenericUpsellModal/hooks/useUpsellActions.ts @@ -1,13 +1,13 @@ -import { useRouter, useSetModal, useSetting } from '@rocket.chat/ui-contexts'; +import { useSetModal, useSetting } from '@rocket.chat/ui-contexts'; import { useCallback } from 'react'; import { useExternalLink } from '../../../hooks/useExternalLink'; import { useIsEnterprise } from '../../../hooks/useIsEnterprise'; +import { useCheckoutUrl } from '../../../views/admin/subscription/hooks/useCheckoutUrl'; const TALK_TO_SALES_URL = 'https://go.rocket.chat/i/contact-sales'; export const useUpsellActions = (hasLicenseModule = false) => { - const router = useRouter(); const setModal = useSetModal(); const handleOpenLink = useExternalLink(); const cloudWorkspaceHadTrial = useSetting('Cloud_Workspace_Had_Trial'); @@ -15,15 +15,18 @@ export const useUpsellActions = (hasLicenseModule = false) => { const { data } = useIsEnterprise(); const shouldShowUpsell = !data?.isEnterprise || !hasLicenseModule; - const handleGoFullyFeatured = useCallback(() => { - router.navigate('/admin/upgrade/go-fully-featured-registered'); + const openExternalLink = useExternalLink(); + const manageSubscriptionUrl = useCheckoutUrl()({ target: 'upsell-modal', action: 'upgrade' }); + + const handleManageSubscription = useCallback(() => { + openExternalLink(manageSubscriptionUrl); setModal(null); - }, [router, setModal]); + }, [manageSubscriptionUrl, openExternalLink, setModal]); const handleTalkToSales = useCallback(() => { handleOpenLink(TALK_TO_SALES_URL); setModal(null); }, [handleOpenLink, setModal]); - return { shouldShowUpsell, cloudWorkspaceHadTrial, handleGoFullyFeatured, handleTalkToSales }; + return { shouldShowUpsell, cloudWorkspaceHadTrial, handleManageSubscription, handleTalkToSales }; }; diff --git a/apps/meteor/client/components/ImageGallery/ImageGallery.tsx b/apps/meteor/client/components/ImageGallery/ImageGallery.tsx new file mode 100644 index 000000000000..1eb49d5e9580 --- /dev/null +++ b/apps/meteor/client/components/ImageGallery/ImageGallery.tsx @@ -0,0 +1,171 @@ +import type { IUpload } from '@rocket.chat/core-typings'; +import { css } from '@rocket.chat/css-in-js'; +import { Box, ButtonGroup, IconButton, Palette, Throbber } from '@rocket.chat/fuselage'; +import React, { useRef, useState } from 'react'; +import { FocusScope } from 'react-aria'; +import { createPortal } from 'react-dom'; +import { Keyboard, Navigation, Zoom, A11y } from 'swiper'; +import type { SwiperRef } from 'swiper/react'; +import { type SwiperClass, Swiper, SwiperSlide } from 'swiper/react'; + +// Import Swiper styles +import 'swiper/swiper.css'; +import 'swiper/modules/navigation/navigation.min.css'; +import 'swiper/modules/keyboard/keyboard.min.css'; +import 'swiper/modules/zoom/zoom.min.css'; + +import { usePreventPropagation } from '../../hooks/usePreventPropagation'; + +const swiperStyle = css` + .swiper { + width: 100%; + height: 100%; + } + .swiper-container { + position: absolute; + z-index: 99; + top: 0; + + overflow: hidden; + + width: 100%; + height: 100%; + + background-color: var(--rcx-color-surface-overlay, rgba(0, 0, 0, 0.6)); + } + + .rcx-swiper-close-button, + .rcx-swiper-prev-button, + .rcx-swiper-next-button { + color: var(--rcx-color-font-pure-white, #ffffff) !important; + } + + .rcx-swiper-prev-button, + .rcx-swiper-next-button { + position: absolute; + z-index: 10; + top: 50%; + + cursor: pointer; + } + + .rcx-swiper-prev-button.swiper-button-disabled, + .rcx-swiper-next-button.swiper-button-disabled { + cursor: auto; + pointer-events: none; + + opacity: 0.35; + } + + .rcx-swiper-prev-button.swiper-button-hidden, + .rcx-swiper-next-button.swiper-button-hidden { + cursor: auto; + pointer-events: none; + + opacity: 0; + } + + .rcx-swiper-prev-button, + .swiper-rtl .rcx-swiper-next-button { + right: auto; + left: 10px; + } + + .rcx-swiper-next-button, + .swiper-rtl .rcx-swiper-prev-button { + right: 10px; + left: auto; + } + + .rcx-lazy-preloader { + position: absolute; + z-index: -1; + left: 50%; + top: 50%; + + transform: translate(-50%, -50%); + + color: ${Palette.text['font-pure-white']}; + } + + .rcx-swiper-controls { + position: absolute; + top: 0; + right: 0; + padding: 10px; + z-index: 2; + + width: 100%; + display: flex; + justify-content: flex-end; + transition: background-color 0.2s; + &:hover { + background-color: ${Palette.surface['surface-overlay']}; + transition: background-color 0.2s; + } + } +`; + +export const ImageGallery = ({ images, onClose, loadMore }: { images: IUpload[]; onClose: () => void; loadMore?: () => void }) => { + const swiperRef = useRef(null); + const [, setSwiperInst] = useState(); + const [zoomScale, setZoomScale] = useState(1); + + const handleZoom = (ratio: number) => { + if (swiperRef.current?.swiper.zoom) { + const { scale, in: zoomIn } = swiperRef.current?.swiper.zoom; + setZoomScale(scale + ratio); + return zoomIn(scale + ratio); + } + }; + + const handleZoomIn = () => handleZoom(1); + const handleZoomOut = () => handleZoom(-1); + const handleResize = () => handleZoom(-(zoomScale - 1)); + + const preventPropagation = usePreventPropagation(); + + return createPortal( + + +
+ + {zoomScale !== 1 && } + + + + + + + String(keyCode) === '27' && onClose()} + modules={[Navigation, Zoom, Keyboard, A11y]} + onInit={(swiper) => setSwiperInst(swiper)} + onReachEnd={loadMore} + > + {images?.map(({ _id, url }) => ( + +
+ +
+ +
+
+
+ ))} +
+
+
+
, + document.body, + ); +}; diff --git a/apps/meteor/client/components/ImageGallery/ImageGalleryError.tsx b/apps/meteor/client/components/ImageGallery/ImageGalleryError.tsx new file mode 100644 index 000000000000..b0c85ed13572 --- /dev/null +++ b/apps/meteor/client/components/ImageGallery/ImageGalleryError.tsx @@ -0,0 +1,26 @@ +import { css } from '@rocket.chat/css-in-js'; +import { IconButton, ModalBackdrop } from '@rocket.chat/fuselage'; +import { useTranslation } from '@rocket.chat/ui-contexts'; +import React from 'react'; +import { createPortal } from 'react-dom'; + +import GenericError from '../GenericError/GenericError'; + +const closeButtonStyle = css` + position: absolute; + z-index: 10; + top: 10px; + right: 10px; +`; + +export const ImageGalleryError = ({ onClose }: { onClose: () => void }) => { + const t = useTranslation(); + + return createPortal( + + + + , + document.body, + ); +}; diff --git a/apps/meteor/client/components/ImageGallery/ImageGalleryLoading.tsx b/apps/meteor/client/components/ImageGallery/ImageGalleryLoading.tsx new file mode 100644 index 000000000000..6e5f2d0463b8 --- /dev/null +++ b/apps/meteor/client/components/ImageGallery/ImageGalleryLoading.tsx @@ -0,0 +1,20 @@ +import { css } from '@rocket.chat/css-in-js'; +import { IconButton, ModalBackdrop, Throbber } from '@rocket.chat/fuselage'; +import React from 'react'; +import { createPortal } from 'react-dom'; + +const closeButtonStyle = css` + position: absolute; + z-index: 10; + top: 10px; + right: 10px; +`; + +export const ImageGalleryLoading = ({ onClose }: { onClose: () => void }) => + createPortal( + + + + , + document.body, + ); diff --git a/apps/meteor/client/components/ImageGallery/index.ts b/apps/meteor/client/components/ImageGallery/index.ts new file mode 100644 index 000000000000..fb1b333e5e15 --- /dev/null +++ b/apps/meteor/client/components/ImageGallery/index.ts @@ -0,0 +1,3 @@ +export * from './ImageGallery'; +export * from './ImageGalleryError'; +export * from './ImageGalleryLoading'; diff --git a/apps/meteor/client/components/InfoPanel/InfoPanelAction.tsx b/apps/meteor/client/components/InfoPanel/InfoPanelAction.tsx index bd2c7d100b53..0750003063a4 100644 --- a/apps/meteor/client/components/InfoPanel/InfoPanelAction.tsx +++ b/apps/meteor/client/components/InfoPanel/InfoPanelAction.tsx @@ -13,7 +13,6 @@ const InfoPanelAction = ({ label, icon, ...props }: InfoPanelActionProps): React title={typeof label === 'string' ? label : undefined} aria-label={typeof label === 'string' ? label : undefined} {...props} - mi={4} icon={icon} > {label} diff --git a/apps/meteor/client/components/InfoPanel/InfoPanelActionGroup.tsx b/apps/meteor/client/components/InfoPanel/InfoPanelActionGroup.tsx index e8aa992a5dc2..00af64b0fa61 100644 --- a/apps/meteor/client/components/InfoPanel/InfoPanelActionGroup.tsx +++ b/apps/meteor/client/components/InfoPanel/InfoPanelActionGroup.tsx @@ -6,7 +6,7 @@ import Section from './InfoPanelSection'; const InfoPanelActionGroup: FC> = (props) => (
- +
); diff --git a/apps/meteor/client/components/MarkdownText.tsx b/apps/meteor/client/components/MarkdownText.tsx index 23f2968e8582..51e499f91d8f 100644 --- a/apps/meteor/client/components/MarkdownText.tsx +++ b/apps/meteor/client/components/MarkdownText.tsx @@ -1,4 +1,6 @@ import { Box } from '@rocket.chat/fuselage'; +import { isExternal, getBaseURI } from '@rocket.chat/ui-client'; +import { useTranslation } from '@rocket.chat/ui-contexts'; import dompurify from 'dompurify'; import { marked } from 'marked'; import type { ComponentProps, FC } from 'react'; @@ -25,7 +27,7 @@ marked.Lexer.rules.gfm = { }; const linkMarked = (href: string | null, _title: string | null, text: string): string => - `${text} `; + `${text} `; const paragraphMarked = (text: string): string => text; const brMarked = (): string => ' '; const listItemMarked = (text: string): string => { @@ -85,10 +87,10 @@ const MarkdownText: FC> = ({ ...props }) => { const sanitizer = dompurify.sanitize; - + const t = useTranslation(); let markedOptions: marked.MarkedOptions; - const schemes = 'http,https'; + const schemes = 'http,https,notes,ftp,ftps,tel,mailto,sms,cid'; switch (variant) { case 'inline': @@ -120,17 +122,22 @@ const MarkdownText: FC> = ({ } })(); - // Add a hook to make all links open a new window + // Add a hook to make all external links open a new window dompurify.addHook('afterSanitizeAttributes', (node) => { - // set all elements owning target to target=_blank if ('target' in node) { - node.setAttribute('target', '_blank'); + const href = node.getAttribute('href') || ''; + + node.setAttribute('title', `${t('Go_to_href', { href: href.replace(getBaseURI(), '') })}`); node.setAttribute('rel', 'nofollow noopener noreferrer'); + if (isExternal(node.getAttribute('href') || '')) { + node.setAttribute('target', '_blank'); + node.setAttribute('title', href); + } } }); return preserveHtml ? html : html && sanitizer(html, { ADD_ATTR: ['target'], ALLOWED_URI_REGEXP: getRegexp(schemes) }); - }, [preserveHtml, sanitizer, content, variant, markedOptions, parseEmoji, schemes]); + }, [preserveHtml, sanitizer, content, variant, markedOptions, parseEmoji, t]); return __html ? ( { {title} {subtitle} - - {t('Homepage')} - + + + {t('Homepage')} + + ); diff --git a/apps/meteor/client/components/Omnichannel/Tags.tsx b/apps/meteor/client/components/Omnichannel/Tags.tsx index 88f5f1a5c6e7..4d7c41dda439 100644 --- a/apps/meteor/client/components/Omnichannel/Tags.tsx +++ b/apps/meteor/client/components/Omnichannel/Tags.tsx @@ -4,7 +4,7 @@ import { useToastMessageDispatch, useTranslation } from '@rocket.chat/ui-context import type { ChangeEvent, ReactElement } from 'react'; import React, { useMemo, useState } from 'react'; -import { useFormsSubscription } from '../../views/omnichannel/additionalForms'; +import { CurrentChatTags } from '../../views/omnichannel/additionalForms'; import { FormSkeleton } from './Skeleton'; import { useLivechatTags } from './hooks/useLivechatTags'; @@ -18,12 +18,6 @@ type TagsProps = { const Tags = ({ tags = [], handler, error, tagRequired, department }: TagsProps): ReactElement => { const t = useTranslation(); - const forms = useFormsSubscription() as any; - - // TODO: Refactor the formsSubscription to use components instead of hooks (since the only thing the hook does is return a component) - const { useCurrentChatTags } = forms; - // Conditional hook was required since the whole formSubscription uses hooks in an incorrect manner - const EETagsComponent = useCurrentChatTags?.(); const { data: tagsResult, isInitialLoading } = useLivechatTags({ department, @@ -75,9 +69,9 @@ const Tags = ({ tags = [], handler, error, tagRequired, department }: TagsProps) {t('Tags')} - {EETagsComponent && tagsResult?.tags && tagsResult?.tags.length ? ( + {tagsResult?.tags && tagsResult?.tags.length ? ( - { handler(tags.map((tag) => tag.label)); diff --git a/apps/meteor/client/components/Omnichannel/hooks/useAgentsList.ts b/apps/meteor/client/components/Omnichannel/hooks/useAgentsList.ts index b854866184f7..ef00a6c0b81d 100644 --- a/apps/meteor/client/components/Omnichannel/hooks/useAgentsList.ts +++ b/apps/meteor/client/components/Omnichannel/hooks/useAgentsList.ts @@ -9,6 +9,9 @@ type AgentsListOptions = { text: string; haveAll: boolean; haveNoAgentsSelectedOption: boolean; + excludeId?: string; + showIdleAgents?: boolean; + onlyAvailable?: boolean; }; type AgentOption = { value: string; label: string; _updatedAt: Date; _id: string }; @@ -26,6 +29,7 @@ export const useAgentsList = ( const reload = useCallback(() => setItemsList(new RecordList()), []); const getAgents = useEndpoint('GET', '/v1/livechat/users/agent'); + const { text, onlyAvailable = false, showIdleAgents = true, excludeId, haveAll, haveNoAgentsSelectedOption } = options; useComponentDidUpdate(() => { options && reload(); @@ -34,7 +38,10 @@ export const useAgentsList = ( const fetchData = useCallback( async (start, end) => { const { users: agents, total } = await getAgents({ - ...(options.text && { text: options.text }), + ...(text && { text }), + ...(excludeId && { excludeId }), + showIdleAgents, + onlyAvailable, offset: start, count: end + start, sort: `{ "name": 1 }`, @@ -43,14 +50,14 @@ export const useAgentsList = ( const items = agents.map((agent) => { const agentOption = { _updatedAt: new Date(agent._updatedAt), - label: agent.username || agent._id, + label: `${agent.name || agent._id} (@${agent.username})`, value: agent._id, _id: agent._id, }; return agentOption; }); - options.haveAll && + haveAll && items.unshift({ label: t('All'), value: 'all', @@ -58,7 +65,7 @@ export const useAgentsList = ( _id: 'all', }); - options.haveNoAgentsSelectedOption && + haveNoAgentsSelectedOption && items.unshift({ label: t('Empty_no_agent_selected'), value: 'no-agent-selected', @@ -71,7 +78,7 @@ export const useAgentsList = ( itemCount: total + 1, }; }, - [getAgents, options.haveAll, options.haveNoAgentsSelectedOption, options.text, t], + [excludeId, getAgents, haveAll, haveNoAgentsSelectedOption, onlyAvailable, showIdleAgents, t, text], ); const { loadMoreItems, initialItemCount } = useScrollableRecordList(itemsList, fetchData, 25); diff --git a/apps/meteor/client/components/Omnichannel/modals/CloseChatModal.tsx b/apps/meteor/client/components/Omnichannel/modals/CloseChatModal.tsx index 67d650186680..0fd882f2c5cc 100644 --- a/apps/meteor/client/components/Omnichannel/modals/CloseChatModal.tsx +++ b/apps/meteor/client/components/Omnichannel/modals/CloseChatModal.tsx @@ -1,4 +1,4 @@ -import type { ILivechatDepartment } from '@rocket.chat/core-typings'; +import type { ILivechatDepartment, Serialized } from '@rocket.chat/core-typings'; import { Field, FieldGroup, @@ -29,7 +29,7 @@ const CloseChatModal = ({ onCancel, onConfirm, }: { - department?: ILivechatDepartment | null; + department?: Serialized; visitorEmail?: string; onCancel: () => void; onConfirm: ( @@ -136,113 +136,113 @@ const CloseChatModal = ({ } }, [transcriptEmail, setValue, visitorEmail, subject, t]); - return commentRequired || tagRequired || canSendTranscript ? ( - }> - - - {t('Wrap_up_conversation')} - - - - {t('Close_room_description')} - - - {t('Comment')} - - - - {errors.comment?.message} - - - - {errors.tags?.message} - - {canSendTranscript && ( - <> - - - {t('Chat_transcript')} - - {canSendTranscriptPDF && ( - - - - - {t('Omnichannel_transcript_pdf')} - - + if (commentRequired || tagRequired || canSendTranscript) { + return ( + }> + + + {t('Wrap_up_conversation')} + + + + {t('Close_room_description')} + + + {t('Comment')} + + + + {errors.comment?.message} + + + + {errors.tags?.message} + + {canSendTranscript && ( + <> + + + {t('Chat_transcript')} - )} - {canSendTranscriptEmail && ( - <> + {canSendTranscriptPDF && ( - - - {t('Omnichannel_transcript_email')} - + {t('Omnichannel_transcript_pdf')} + - {transcriptEmail && ( - <> - - {t('Contact_email')} - - - - - - {t('Subject')} - - - - {errors.subject?.message} - - - )} - - )} - - - {canSendTranscriptPDF && canSendTranscriptEmail - ? t('These_options_affect_this_conversation_only_To_set_default_selections_go_to_My_Account_Omnichannel') - : t('This_option_affect_this_conversation_only_To_set_default_selection_go_to_My_Account_Omnichannel')} - - - - )} - - - - - - - - - - ) : ( + )} + {canSendTranscriptEmail && ( + <> + + + {t('Omnichannel_transcript_email')} + + + + {transcriptEmail && ( + <> + + {t('Contact_email')} + + + + + + {t('Subject')} + + + + {errors.subject?.message} + + + )} + + )} + + + {canSendTranscriptPDF && canSendTranscriptEmail + ? t('These_options_affect_this_conversation_only_To_set_default_selections_go_to_My_Account_Omnichannel') + : t('This_option_affect_this_conversation_only_To_set_default_selection_go_to_My_Account_Omnichannel')} + + + + )} + + + + + + + + + + ); + } + + return ( + /> ); }; diff --git a/apps/meteor/client/components/Omnichannel/modals/CloseChatModalData.tsx b/apps/meteor/client/components/Omnichannel/modals/CloseChatModalData.tsx index eadaa353c806..0edc7bc7af91 100644 --- a/apps/meteor/client/components/Omnichannel/modals/CloseChatModalData.tsx +++ b/apps/meteor/client/components/Omnichannel/modals/CloseChatModalData.tsx @@ -1,9 +1,8 @@ -import type { ILivechatDepartment, ILivechatDepartmentAgents } from '@rocket.chat/core-typings'; -import type { ReactElement } from 'react'; +import type { ILivechatDepartment } from '@rocket.chat/core-typings'; +import { useEndpoint } from '@rocket.chat/ui-contexts'; +import { useQuery } from '@tanstack/react-query'; import React from 'react'; -import { AsyncStatePhase } from '../../../hooks/useAsyncState'; -import { useEndpointData } from '../../../hooks/useEndpointData'; import { FormSkeleton } from '../Skeleton'; import CloseChatModal from './CloseChatModal'; @@ -21,32 +20,14 @@ const CloseChatModalData = ({ tags?: string[], preferences?: { omnichannelTranscriptPDF: boolean; omnichannelTranscriptEmail: boolean }, ) => Promise; -}): ReactElement => { - const { value: data, phase: state } = useEndpointData('/v1/livechat/department/:_id', { keys: { _id: departmentId } }); +}) => { + const getDepartment = useEndpoint('GET', '/v1/livechat/department/:_id', { _id: departmentId }); + const { data, isLoading } = useQuery(['/v1/livechat/department/:_id', departmentId], () => getDepartment({})); - if ([state].includes(AsyncStatePhase.LOADING)) { + if (isLoading) { return ; } - // TODO: chapter day: fix issue with rest typing - // TODO: This is necessary because of a weird problem - // There is an endpoint livechat/department/${departmentId}/agents - // that is causing the problem. type A | type B | undefined - - return ( - - ); + return ; }; export default CloseChatModalData; diff --git a/apps/meteor/client/components/Omnichannel/modals/EnterpriseDepartmentsModal.tsx b/apps/meteor/client/components/Omnichannel/modals/EnterpriseDepartmentsModal.tsx index 8187776a4192..713dea4a0ed6 100644 --- a/apps/meteor/client/components/Omnichannel/modals/EnterpriseDepartmentsModal.tsx +++ b/apps/meteor/client/components/Omnichannel/modals/EnterpriseDepartmentsModal.tsx @@ -1,43 +1,37 @@ import { Button, Modal, Box } from '@rocket.chat/fuselage'; import { useOutsideClick } from '@rocket.chat/fuselage-hooks'; -import { useRoute, useTranslation } from '@rocket.chat/ui-contexts'; +import { useRouter, useTranslation } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; import React, { useRef } from 'react'; -import { hasPermission } from '../../../../app/authorization/client'; -import { useUpgradeTabParams } from '../../../views/hooks/useUpgradeTabParams'; +import { useExternalLink } from '../../../hooks/useExternalLink'; +import { useCheckoutUrl } from '../../../views/admin/subscription/hooks/useCheckoutUrl'; const EnterpriseDepartmentsModal = ({ closeModal }: { closeModal: () => void }): ReactElement => { const t = useTranslation(); - const upgradeRoute = useRoute('upgrade'); - const departmentsRoute = useRoute('omnichannel-departments'); - const { tabType, trialEndDate } = useUpgradeTabParams(); + const router = useRouter(); const ref = useRef(null); - const upgradeNowClick = (): void => { - tabType && upgradeRoute.push({ type: tabType }, trialEndDate ? { trialEndDate } : undefined); + + const openExternalLink = useExternalLink(); + const manageSubscriptionUrl = useCheckoutUrl()({ target: 'new-departments-page', action: 'upgrade' }); + + const goToManageSubscriptionPage = (): void => { + openExternalLink(manageSubscriptionUrl); closeModal(); }; const onClose = (): void => { - departmentsRoute.push({}); + router.navigate('/omnichannel/departments'); closeModal(); }; - const isTypeUpgradeYourPlan = ['go-fully-featured', 'go-fully-featured-registered'].includes(tabType || ''); - - const talkToExpertLink = - 'https://www.rocket.chat/sales-contact?utm_source=rocketchat_app&utm_medium=multiple_queues&utm_campaign=in_product_ctas'; - - const freeTrialLink = - 'https://www.rocket.chat/trial-saas?utm_source=rocketchat_app&utm_medium=multiple_queues&utm_campaign=in_product_ctas'; - useOutsideClick([ref], onClose); return ( - {t('Enterprise_capability')} + {t('Premium_capability')} {t('Departments')} @@ -45,34 +39,18 @@ const EnterpriseDepartmentsModal = ({ closeModal }: { closeModal: () => void }): - {t('Enterprise_Departments_title')} + {t('Premium_Departments_title')} - {isTypeUpgradeYourPlan ? t('Enterprise_Departments_description_free_trial') : t('Enterprise_Departments_description_upgrade')} + {t('Premium_Departments_description_upgrade')} - {hasPermission('view-statistics') ? ( - - - {isTypeUpgradeYourPlan ? ( - - ) : ( - - )} - - ) : ( - - Talk to your workspace admin about enabling departments. - - - )} + + + + + ); diff --git a/apps/meteor/client/components/Omnichannel/modals/ForwardChatModal.tsx b/apps/meteor/client/components/Omnichannel/modals/ForwardChatModal.tsx index bdbde6b05acd..977e298e638e 100644 --- a/apps/meteor/client/components/Omnichannel/modals/ForwardChatModal.tsx +++ b/apps/meteor/client/components/Omnichannel/modals/ForwardChatModal.tsx @@ -19,7 +19,7 @@ import { useForm } from 'react-hook-form'; import { useRecordList } from '../../../hooks/lists/useRecordList'; import { AsyncStatePhase } from '../../../hooks/useAsyncState'; -import UserAutoComplete from '../../UserAutoComplete'; +import AutoCompleteAgent from '../../AutoCompleteAgent'; import { useDepartmentsList } from '../hooks/useDepartmentsList'; const ForwardChatModal = ({ @@ -36,7 +36,15 @@ const ForwardChatModal = ({ const getUserData = useEndpoint('GET', '/v1/users.info'); const idleAgentsAllowedForForwarding = useSetting('Livechat_enabled_when_agent_idle') as boolean; - const { getValues, handleSubmit, register, setFocus, setValue, watch } = useForm(); + const { + getValues, + handleSubmit, + register, + setFocus, + setValue, + watch, + formState: { isSubmitting }, + } = useForm(); useEffect(() => { setFocus('comment'); @@ -53,28 +61,6 @@ const ForwardChatModal = ({ ); const { phase: departmentsPhase, items: departments, itemCount: departmentsTotal } = useRecordList(departmentsList); - const _id = { $ne: room.servedBy?._id }; - const conditions = { - _id, - ...(!idleAgentsAllowedForForwarding && { - $or: [ - { - status: { - $exists: true, - $ne: 'offline', - }, - roles: { - $ne: 'bot', - }, - }, - { - roles: 'bot', - }, - ], - }), - statusLivechat: 'available', - }; - const endReached = useCallback( (start) => { if (departmentsPhase !== AsyncStatePhase.LOADING) { @@ -93,7 +79,7 @@ const ForwardChatModal = ({ uid = user?._id; } - onForward(departmentId, uid, comment); + await onForward(departmentId, uid, comment); }, [getUserData, onForward], ); @@ -104,7 +90,11 @@ const ForwardChatModal = ({ }, [register]); return ( - } {...props}> + } + {...props} + data-qa-id='forward-chat-modal' + > {t('Forward_chat')} @@ -122,6 +112,7 @@ const ForwardChatModal = ({ options={departments} maxWidth='100%' placeholder={t('Select_an_option')} + data-qa-id='forward-to-department' onChange={(value: string): void => { setValue('department', value); }} @@ -134,13 +125,16 @@ const ForwardChatModal = ({ {t('Forward_to_user')} - { setValue('username', value); }} - value={getValues().username} /> @@ -160,7 +154,7 @@ const ForwardChatModal = ({ - diff --git a/apps/meteor/client/components/Omnichannel/modals/ReturnChatQueueModal.tsx b/apps/meteor/client/components/Omnichannel/modals/ReturnChatQueueModal.tsx index 476368aed970..b4f789618653 100644 --- a/apps/meteor/client/components/Omnichannel/modals/ReturnChatQueueModal.tsx +++ b/apps/meteor/client/components/Omnichannel/modals/ReturnChatQueueModal.tsx @@ -12,7 +12,7 @@ const ReturnChatQueueModal: FC = ({ onCancel, onMoveC const t = useTranslation(); return ( - + {t('Return_to_the_queue')} diff --git a/apps/meteor/client/components/Omnichannel/modals/TranscriptModal.tsx b/apps/meteor/client/components/Omnichannel/modals/TranscriptModal.tsx index 2757b5d9a88b..0b3a94f5b16c 100644 --- a/apps/meteor/client/components/Omnichannel/modals/TranscriptModal.tsx +++ b/apps/meteor/client/components/Omnichannel/modals/TranscriptModal.tsx @@ -31,7 +31,7 @@ const TranscriptModal: FC = ({ setValue, setFocus, watch, - formState: { errors, isValid }, + formState: { errors, isValid, isSubmitting }, } = useForm({ defaultValues: { email: emailDefault || '', subject: t('Transcript_of_your_livechat_conversation') }, }); @@ -112,12 +112,12 @@ const TranscriptModal: FC = ({ )} {roomOpen && !transcriptRequest && ( - )} {!roomOpen && ( - )} diff --git a/apps/meteor/client/components/Page/Page.stories.tsx b/apps/meteor/client/components/Page/Page.stories.tsx index a3e62140fc2d..3171d707480a 100644 --- a/apps/meteor/client/components/Page/Page.stories.tsx +++ b/apps/meteor/client/components/Page/Page.stories.tsx @@ -2,16 +2,16 @@ import { Box, Button, ButtonGroup } from '@rocket.chat/fuselage'; import type { ComponentMeta, ComponentStory } from '@storybook/react'; import React from 'react'; -import Page from '.'; +import { Page, PageContent, PageHeader, PageScrollableContent, PageScrollableContentWithShadow } from '.'; export default { title: 'Components/Page', component: Page, subcomponents: { - 'Page.Content': Page.Content, - 'Page.Header': Page.Header, - 'Page.ScrollableContent': Page.ScrollableContent, - 'Page.ScrollableContentWithShadow': Page.ScrollableContentWithShadow, + PageContent, + PageHeader, + PageScrollableContent, + PageScrollableContentWithShadow, }, parameters: { layout: 'fullscreen', @@ -29,45 +29,45 @@ const DummyContent = ({ rows = 10 }: { rows?: number }) => ( export const Example: ComponentStory = () => ( - - + + Say goodbye to inefficient email threads and managing multiple guest accounts. Enable teams to communicate safely with partners, vendors, and suppliers directly from Rocket.Chat regardless of which collaboration platform they use. - + ); export const WithButtonsAtTheHeader: ComponentStory = () => ( - + - - + + - + ); export const WithScrollableContent: ComponentStory = () => ( - - + + - + ); export const WithScrollableContentWithShadow: ComponentStory = () => ( - - + + - + ); diff --git a/apps/meteor/client/components/Page/PageHeader.tsx b/apps/meteor/client/components/Page/PageHeader.tsx index 6725c2da6f5c..1a2f53739c9a 100644 --- a/apps/meteor/client/components/Page/PageHeader.tsx +++ b/apps/meteor/client/components/Page/PageHeader.tsx @@ -1,6 +1,5 @@ import { Box, IconButton } from '@rocket.chat/fuselage'; -import { useAutoFocus } from '@rocket.chat/fuselage-hooks'; -import { HeaderToolbox } from '@rocket.chat/ui-client'; +import { HeaderToolbar, useDocumentTitle } from '@rocket.chat/ui-client'; import { useLayout, useTranslation } from '@rocket.chat/ui-contexts'; import type { FC, ComponentProps, ReactNode } from 'react'; import React, { useContext } from 'react'; @@ -18,12 +17,11 @@ const PageHeader: FC = ({ children = undefined, title, onClickB const t = useTranslation(); const [border] = useContext(PageContext); const { isMobile } = useLayout(); - const headerAutoFocus = useAutoFocus(); + + useDocumentTitle(typeof title === 'string' ? title : undefined); return ( = ({ children = undefined, title, onClickB > {isMobile && ( - + - + )} {onClickBack && } diff --git a/apps/meteor/client/components/Page/PageScrollableContent.tsx b/apps/meteor/client/components/Page/PageScrollableContent.tsx index 0bd954864d23..b1731f4eb0f6 100644 --- a/apps/meteor/client/components/Page/PageScrollableContent.tsx +++ b/apps/meteor/client/components/Page/PageScrollableContent.tsx @@ -3,8 +3,8 @@ import { Box } from '@rocket.chat/fuselage'; import type { ComponentProps } from 'react'; import React, { forwardRef } from 'react'; -import type { CustomScrollbarsProps } from '../ScrollableContentWrapper'; -import ScrollableContentWrapper from '../ScrollableContentWrapper'; +import type { CustomScrollbarsProps } from '../CustomScrollbars'; +import { CustomScrollbars } from '../CustomScrollbars'; type PageScrollableContentProps = { onScrollContent?: ComponentProps['onScrollContent']; @@ -24,9 +24,9 @@ const PageScrollableContent = forwardRef - + - + ); }); diff --git a/apps/meteor/client/components/Page/index.ts b/apps/meteor/client/components/Page/index.ts index 9aad9332937a..1525eb70186d 100644 --- a/apps/meteor/client/components/Page/index.ts +++ b/apps/meteor/client/components/Page/index.ts @@ -1,14 +1,6 @@ -import Page from './Page'; -import PageContent from './PageContent'; -import PageFooter from './PageFooter'; -import PageHeader from './PageHeader'; -import PageScrollableContent from './PageScrollableContent'; -import PageScrollableContentWithShadow from './PageScrollableContentWithShadow'; - -export default Object.assign(Page, { - Header: PageHeader, - Content: PageContent, - ScrollableContent: PageScrollableContent, - ScrollableContentWithShadow: PageScrollableContentWithShadow, - Footer: PageFooter, -}); +export { default as Page } from './Page'; +export { default as PageContent } from './PageContent'; +export { default as PageFooter } from './PageFooter'; +export { default as PageHeader } from './PageHeader'; +export { default as PageScrollableContent } from './PageScrollableContent'; +export { default as PageScrollableContentWithShadow } from './PageScrollableContentWithShadow'; diff --git a/apps/meteor/client/components/PageSkeleton.tsx b/apps/meteor/client/components/PageSkeleton.tsx index 2c3c588d6c4c..b2413dd97ecc 100644 --- a/apps/meteor/client/components/PageSkeleton.tsx +++ b/apps/meteor/client/components/PageSkeleton.tsx @@ -2,17 +2,16 @@ import { Box, Button, ButtonGroup, Skeleton } from '@rocket.chat/fuselage'; import type { ReactElement } from 'react'; import React from 'react'; -import Page from './Page'; +import { Page, PageHeader, PageContent } from './Page'; const PageSkeleton = (): ReactElement => ( - }> + }> ); }; diff --git a/apps/meteor/client/components/TwoFactorModal/TwoFactorModal.tsx b/apps/meteor/client/components/TwoFactorModal/TwoFactorModal.tsx index 3e9824673bf2..0382b6eab52e 100644 --- a/apps/meteor/client/components/TwoFactorModal/TwoFactorModal.tsx +++ b/apps/meteor/client/components/TwoFactorModal/TwoFactorModal.tsx @@ -1,4 +1,3 @@ -import { useEndpoint } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; import React from 'react'; @@ -29,24 +28,18 @@ type TwoFactorModalProps = { ); const TwoFactorModal = ({ onConfirm, onClose, invalidAttempt, ...props }: TwoFactorModalProps): ReactElement => { - const logoutOtherSessions = useEndpoint('POST', '/v1/users.logoutOtherClients'); - - const confirm = (code: any, method: Method): void => { - onConfirm(code, method); - logoutOtherSessions(); - }; if (props.method === Method.TOTP) { - return ; + return ; } if (props.method === Method.EMAIL) { const { emailOrUsername } = props; - return ; + return ; } if (props.method === Method.PASSWORD) { - return ; + return ; } throw new Error('Invalid Two Factor method'); diff --git a/apps/meteor/client/components/TwoFactorModal/TwoFactorTotpModal.tsx b/apps/meteor/client/components/TwoFactorModal/TwoFactorTotpModal.tsx index 04aa7a4f94f0..6f36c9c8ce26 100644 --- a/apps/meteor/client/components/TwoFactorModal/TwoFactorTotpModal.tsx +++ b/apps/meteor/client/components/TwoFactorModal/TwoFactorTotpModal.tsx @@ -34,19 +34,20 @@ const TwoFactorTotpModal = ({ onConfirm, onClose, invalidAttempt }: TwoFactorTot wrapperFunction={(props) => } onCancel={onClose} confirmText={t('Verify')} - title={t('Two Factor Authentication')} + title={t('Enter_TOTP_password')} onClose={onClose} variant='warning' - icon='info' confirmDisabled={!code} + tagline={t('Two-factor_authentication')} + icon={null} > - {t('Open_your_authentication_app_and_enter_the_code')} + {t('Enter_the_code_provided_by_your_authentication_app_to_continue')} - + {invalidAttempt && {t('Invalid_password')}} diff --git a/apps/meteor/client/components/UserAndRoomAutoCompleteMultiple/UserAndRoomAutoCompleteMultiple.tsx b/apps/meteor/client/components/UserAndRoomAutoCompleteMultiple/UserAndRoomAutoCompleteMultiple.tsx index f96c198865cc..b8ff0b472fa4 100644 --- a/apps/meteor/client/components/UserAndRoomAutoCompleteMultiple/UserAndRoomAutoCompleteMultiple.tsx +++ b/apps/meteor/client/components/UserAndRoomAutoCompleteMultiple/UserAndRoomAutoCompleteMultiple.tsx @@ -2,13 +2,12 @@ import { isDirectMessageRoom } from '@rocket.chat/core-typings'; import { AutoComplete, Box, Option, OptionAvatar, OptionContent, Chip } from '@rocket.chat/fuselage'; import { useDebouncedValue } from '@rocket.chat/fuselage-hooks'; import { escapeRegExp } from '@rocket.chat/string-helpers'; +import { RoomAvatar, UserAvatar } from '@rocket.chat/ui-avatar'; import { useUser, useUserSubscriptions } from '@rocket.chat/ui-contexts'; import type { ComponentProps, ReactElement } from 'react'; import React, { memo, useMemo, useState } from 'react'; import { roomCoordinator } from '../../lib/rooms/roomCoordinator'; -import RoomAvatar from '../avatar/RoomAvatar'; -import UserAvatar from '../avatar/UserAvatar'; type UserAndRoomAutoCompleteMultipleProps = Omit, 'filter'>; diff --git a/apps/meteor/client/components/UserAutoComplete/UserAutoComplete.tsx b/apps/meteor/client/components/UserAutoComplete/UserAutoComplete.tsx index ebe3ecc5ee72..1f12f29ee13b 100644 --- a/apps/meteor/client/components/UserAutoComplete/UserAutoComplete.tsx +++ b/apps/meteor/client/components/UserAutoComplete/UserAutoComplete.tsx @@ -1,12 +1,11 @@ import { AutoComplete, Option, Box, Chip, Options } from '@rocket.chat/fuselage'; import { useDebouncedValue } from '@rocket.chat/fuselage-hooks'; +import { UserAvatar } from '@rocket.chat/ui-avatar'; import { useEndpoint } from '@rocket.chat/ui-contexts'; import { useQuery } from '@tanstack/react-query'; import type { ComponentProps, ReactElement } from 'react'; import React, { memo, useMemo, useState } from 'react'; -import UserAvatar from '../avatar/UserAvatar'; - const query = ( term = '', conditions = {}, diff --git a/apps/meteor/client/components/UserAutoCompleteMultiple/UserAutoCompleteMultiple.tsx b/apps/meteor/client/components/UserAutoCompleteMultiple/UserAutoCompleteMultiple.tsx index 857af5e9c43f..f9887d693ca0 100644 --- a/apps/meteor/client/components/UserAutoCompleteMultiple/UserAutoCompleteMultiple.tsx +++ b/apps/meteor/client/components/UserAutoCompleteMultiple/UserAutoCompleteMultiple.tsx @@ -1,12 +1,11 @@ import { AutoComplete, Box, OptionAvatar, Option, OptionContent, Chip, OptionDescription } from '@rocket.chat/fuselage'; import { useDebouncedValue } from '@rocket.chat/fuselage-hooks'; +import { UserAvatar } from '@rocket.chat/ui-avatar'; import { useEndpoint } from '@rocket.chat/ui-contexts'; import { useQuery } from '@tanstack/react-query'; import type { ComponentProps, ReactElement } from 'react'; import React, { memo, useMemo, useState } from 'react'; -import UserAvatar from '../avatar/UserAvatar'; - const query = ( term = '', ): { diff --git a/apps/meteor/client/components/UserAutoCompleteMultiple/UserAutoCompleteMultipleFederated.tsx b/apps/meteor/client/components/UserAutoCompleteMultiple/UserAutoCompleteMultipleFederated.tsx index 457593e2c5db..5a372ee39dd2 100644 --- a/apps/meteor/client/components/UserAutoCompleteMultiple/UserAutoCompleteMultipleFederated.tsx +++ b/apps/meteor/client/components/UserAutoCompleteMultiple/UserAutoCompleteMultipleFederated.tsx @@ -1,11 +1,11 @@ import { MultiSelectFiltered, Icon, Box, Chip } from '@rocket.chat/fuselage'; import { useDebouncedValue } from '@rocket.chat/fuselage-hooks'; +import { UserAvatar } from '@rocket.chat/ui-avatar'; import { useEndpoint } from '@rocket.chat/ui-contexts'; import { useQuery } from '@tanstack/react-query'; import type { ReactElement, AllHTMLAttributes } from 'react'; import React, { memo, useState, useCallback, useMemo } from 'react'; -import UserAvatar from '../avatar/UserAvatar'; import AutocompleteOptions, { OptionsContext } from './UserAutoCompleteMultipleOptions'; type UserAutoCompleteMultipleFederatedProps = { diff --git a/apps/meteor/client/components/UserAutoCompleteMultiple/UserAutoCompleteMultipleOption.tsx b/apps/meteor/client/components/UserAutoCompleteMultiple/UserAutoCompleteMultipleOption.tsx index e6762c188abd..0dc773af9596 100644 --- a/apps/meteor/client/components/UserAutoCompleteMultiple/UserAutoCompleteMultipleOption.tsx +++ b/apps/meteor/client/components/UserAutoCompleteMultiple/UserAutoCompleteMultipleOption.tsx @@ -1,10 +1,9 @@ import type { IUser } from '@rocket.chat/core-typings'; import { Option, OptionDescription } from '@rocket.chat/fuselage'; +import { UserAvatar } from '@rocket.chat/ui-avatar'; import type { ReactElement } from 'react'; import React from 'react'; -import UserAvatar from '../avatar/UserAvatar'; - type UserAutoCompleteMultipleOptionProps = { label: { _federated?: boolean; diff --git a/apps/meteor/client/components/UserCard/UserCard.stories.tsx b/apps/meteor/client/components/UserCard/UserCard.stories.tsx index b07d4a09cc7d..e3174381d85d 100644 --- a/apps/meteor/client/components/UserCard/UserCard.stories.tsx +++ b/apps/meteor/client/components/UserCard/UserCard.stories.tsx @@ -1,7 +1,7 @@ import type { ComponentMeta, ComponentStory } from '@storybook/react'; import React from 'react'; -import UserCard from '.'; +import { UserCard, UserCardRole, UserCardAction } from '.'; export default { title: 'Components/UserCard', @@ -14,16 +14,16 @@ export default { customStatus: '🛴 currently working on User Card', roles: ( <> - Admin - Rocket.Chat - Team + Admin + Rocket.Chat + Team ), bio: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla tempus, eros convallis vulputate cursus, nisi neque eleifend libero, eget lacinia justo purus nec est. In at sodales ipsum. Sed lacinia quis purus eget pulvinar. Aenean eu pretium nunc, at aliquam magna. Praesent dignissim, tortor sed volutpat mattis, mauris diam pulvinar leo, porta commodo risus est non purus. Mauris in justo vel lorem ullamcorper hendrerit. Nam est metus, viverra a pellentesque vitae, ornare eget odio. Morbi tempor feugiat mattis. Morbi non felis tempor, aliquam justo sed, sagittis nibh. Mauris consequat ex metus. Praesent sodales sit amet nibh a vulputate. Integer commodo, mi vel bibendum sollicitudin, urna lectus accumsan ante, eget faucibus augue ex id neque. Aenean consectetur, orci a pellentesque mattis, tortor tellus fringilla elit, non ullamcorper risus nunc feugiat risus. Fusce sit amet nisi dapibus turpis commodo placerat. In tortor ante, vehicula sit amet augue et, imperdiet porta sem.', actions: ( <> - - + + ), localTime: 'Local Time: 7:44 AM', diff --git a/apps/meteor/client/components/UserCard/UserCard.tsx b/apps/meteor/client/components/UserCard/UserCard.tsx index 83edd9e3d8cb..bf143229cf65 100644 --- a/apps/meteor/client/components/UserCard/UserCard.tsx +++ b/apps/meteor/client/components/UserCard/UserCard.tsx @@ -1,14 +1,15 @@ import { css } from '@rocket.chat/css-in-js'; -import { Box, IconButton, Skeleton } from '@rocket.chat/fuselage'; +import { Box, Button, IconButton } from '@rocket.chat/fuselage'; +import { UserAvatar } from '@rocket.chat/ui-avatar'; import { useTranslation } from '@rocket.chat/ui-contexts'; -import type { ReactNode, ComponentProps, MouseEvent } from 'react'; -import React, { forwardRef } from 'react'; +import type { ReactNode, ComponentProps } from 'react'; +import React from 'react'; import { useEmbeddedLayout } from '../../hooks/useEmbeddedLayout'; import MarkdownText from '../MarkdownText'; import * as Status from '../UserStatus'; -import UserAvatar from '../avatar/UserAvatar'; -import UserCardContainer from './UserCardContainer'; +import UserCardActions from './UserCardActions'; +import UserCardDialog from './UserCardDialog'; import UserCardInfo from './UserCardInfo'; import UserCardRoles from './UserCardRoles'; import UserCardUsername from './UserCardUsername'; @@ -22,9 +23,7 @@ const clampStyle = css` `; type UserCardProps = { - className?: string; - style?: ComponentProps['style']; - open?: (e: MouseEvent) => void; + onOpenUserInfo?: () => void; name?: string; username?: string; etag?: string; @@ -36,61 +35,37 @@ type UserCardProps = { localTime?: ReactNode; onClose?: () => void; nickname?: string; - isLoading?: boolean; -}; +} & ComponentProps; -const UserCard = forwardRef(function UserCard( - { - className, - style, - open, - name, - username, - etag, - customStatus = , - roles = ( - <> - - - - - ), - bio = , - status = , - actions, - localTime = , - onClose, - nickname, - isLoading, - }: UserCardProps, - ref, -) { +const UserCard = ({ + onOpenUserInfo, + name, + username, + etag, + customStatus, + roles, + bio, + status = , + actions, + localTime, + onClose, + nickname, + ...props +}: UserCardProps) => { const t = useTranslation(); const isLayoutEmbedded = useEmbeddedLayout(); return ( - - - {!isLoading && username ? ( - - ) : ( - - )} + +
+ {username && } - {isLoading ? ( - <> - - - - - ) : ( - actions - )} + {actions} - - +
+ - {isLoading ? : } + {nickname && ( ({nickname}) @@ -113,15 +88,17 @@ const UserCard = forwardRef(function UserCard( {typeof bio === 'string' ? : bio} )} - {!isLoading && open && !isLayoutEmbedded && {t('See_full_profile')}} + {onOpenUserInfo && !isLayoutEmbedded && ( +
+ +
+ )}
- {onClose && ( - - - - )} -
+ {onClose && } + ); -}); +}; export default UserCard; diff --git a/apps/meteor/client/components/UserCard/UserCardAction.tsx b/apps/meteor/client/components/UserCard/UserCardAction.tsx index f13e71b601b5..c96e742be94e 100644 --- a/apps/meteor/client/components/UserCard/UserCardAction.tsx +++ b/apps/meteor/client/components/UserCard/UserCardAction.tsx @@ -5,7 +5,7 @@ import React from 'react'; type UserCardActionProps = ComponentProps; const UserCardAction = ({ label, icon, ...props }: UserCardActionProps): ReactElement => ( - + ); export default UserCardAction; diff --git a/apps/meteor/client/components/UserCard/UserCardActions.tsx b/apps/meteor/client/components/UserCard/UserCardActions.tsx new file mode 100644 index 000000000000..6a1258c02997 --- /dev/null +++ b/apps/meteor/client/components/UserCard/UserCardActions.tsx @@ -0,0 +1,15 @@ +import { useToolbar } from '@react-aria/toolbar'; +import { ButtonGroup } from '@rocket.chat/fuselage'; +import type { ReactElement, ComponentProps } from 'react'; +import React, { useRef } from 'react'; + +type UserCardActionsProps = ComponentProps; + +const UserCardActions = (props: UserCardActionsProps): ReactElement => { + const ref = useRef(null); + const { toolbarProps } = useToolbar(props, ref); + + return ; +}; + +export default UserCardActions; diff --git a/apps/meteor/client/components/UserCard/UserCardContainer.tsx b/apps/meteor/client/components/UserCard/UserCardContainer.tsx deleted file mode 100644 index c1279e4ff513..000000000000 --- a/apps/meteor/client/components/UserCard/UserCardContainer.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import { Box } from '@rocket.chat/fuselage'; -import type { ComponentProps } from 'react'; -import React, { forwardRef } from 'react'; - -const UserCardContainer = forwardRef(function UserCardContainer(props: ComponentProps, ref) { - return ; -}); - -export default UserCardContainer; diff --git a/apps/meteor/client/components/UserCard/UserCardDialog.tsx b/apps/meteor/client/components/UserCard/UserCardDialog.tsx new file mode 100644 index 000000000000..0f1c66e4a6e6 --- /dev/null +++ b/apps/meteor/client/components/UserCard/UserCardDialog.tsx @@ -0,0 +1,30 @@ +import { Box } from '@rocket.chat/fuselage'; +import type { ComponentProps } from 'react'; +import React, { useRef } from 'react'; +import type { AriaDialogProps } from 'react-aria'; +import { useDialog } from 'react-aria'; + +type UserCardDialogProps = AriaDialogProps & ComponentProps; + +const UserCardDialog = (props: UserCardDialogProps) => { + const ref = useRef(null); + const { dialogProps } = useDialog(props, ref); + + return ( + + ); +}; + +export default UserCardDialog; diff --git a/apps/meteor/client/components/UserCard/UserCardSkeleton.tsx b/apps/meteor/client/components/UserCard/UserCardSkeleton.tsx new file mode 100644 index 000000000000..b85f672caa12 --- /dev/null +++ b/apps/meteor/client/components/UserCard/UserCardSkeleton.tsx @@ -0,0 +1,34 @@ +import { Box, Skeleton } from '@rocket.chat/fuselage'; +import type { ComponentProps } from 'react'; +import React from 'react'; + +import UserCardDialog from './UserCardDialog'; + +const UserCardSkeleton = (props: ComponentProps) => { + return ( + + + + + {Array.from({ length: 3 }).map((_, i) => ( + + ))} + + + + + + + + {Array.from({ length: 3 }).map((_, i) => ( + + ))} + {Array.from({ length: 2 }).map((_, i) => ( + + ))} + + + ); +}; + +export default UserCardSkeleton; diff --git a/apps/meteor/client/components/UserCard/index.ts b/apps/meteor/client/components/UserCard/index.ts index defc7140be15..75a5ad84cd6c 100644 --- a/apps/meteor/client/components/UserCard/index.ts +++ b/apps/meteor/client/components/UserCard/index.ts @@ -3,12 +3,7 @@ import UserCardAction from './UserCardAction'; import UserCardInfo from './UserCardInfo'; import UserCardRole from './UserCardRole'; import UserCardRoles from './UserCardRoles'; +import UserCardSkeleton from './UserCardSkeleton'; import UserCardUsername from './UserCardUsername'; -export default Object.assign(UserCard, { - Action: UserCardAction, - Role: UserCardRole, - Roles: UserCardRoles, - Info: UserCardInfo, - Username: UserCardUsername, -}); +export { UserCard, UserCardAction, UserCardInfo, UserCardRole, UserCardRoles, UserCardUsername, UserCardSkeleton }; diff --git a/apps/meteor/client/components/UserInfo/UserInfo.tsx b/apps/meteor/client/components/UserInfo/UserInfo.tsx index bdce27d028ad..025889edc7cd 100644 --- a/apps/meteor/client/components/UserInfo/UserInfo.tsx +++ b/apps/meteor/client/components/UserInfo/UserInfo.tsx @@ -12,7 +12,7 @@ import { ContextualbarScrollableContent } from '../Contextualbar'; import InfoPanel from '../InfoPanel'; import MarkdownText from '../MarkdownText'; import UTCClock from '../UTCClock'; -import UserCard from '../UserCard'; +import { UserCardRoles } from '../UserCard'; import UserInfoAvatar from './UserInfoAvatar'; type UserInfoDataProps = Serialized< @@ -75,7 +75,7 @@ const UserInfo = ({ )} - {actions && {actions}} + {actions && {actions}} {userDisplayName && } @@ -90,7 +90,7 @@ const UserInfo = ({ {roles.length !== 0 && ( {t('Roles')} - {roles} + {roles} )} diff --git a/apps/meteor/client/components/UserInfo/UserInfoAvatar.tsx b/apps/meteor/client/components/UserInfo/UserInfoAvatar.tsx index 2fbe4a05ed55..c15992489264 100644 --- a/apps/meteor/client/components/UserInfo/UserInfoAvatar.tsx +++ b/apps/meteor/client/components/UserInfo/UserInfoAvatar.tsx @@ -1,8 +1,7 @@ +import { UserAvatar } from '@rocket.chat/ui-avatar'; import type { ComponentProps, ReactElement } from 'react'; import React from 'react'; -import UserAvatar from '../avatar/UserAvatar'; - const UserInfoAvatar = ({ username, ...props }: ComponentProps): ReactElement => ( ); diff --git a/apps/meteor/client/components/UserInfo/UserInfoUsername.tsx b/apps/meteor/client/components/UserInfo/UserInfoUsername.tsx index 75d2c87a82c0..171c5c68d8c4 100644 --- a/apps/meteor/client/components/UserInfo/UserInfoUsername.tsx +++ b/apps/meteor/client/components/UserInfo/UserInfoUsername.tsx @@ -3,16 +3,15 @@ import type { Box } from '@rocket.chat/fuselage'; import type { ReactElement, ComponentProps } from 'react'; import React from 'react'; -import UserCard from '../UserCard'; +import { UserCardUsername } from '../UserCard'; type UserInfoUsernameProps = { username: IUser['username']; status: ReactElement; } & ComponentProps; -// TODO: Remove UserCard.Username const UserInfoUsername = ({ username, status, ...props }: UserInfoUsernameProps): ReactElement => ( - + ); export default UserInfoUsername; diff --git a/apps/meteor/client/components/avatar/AppAvatar.tsx b/apps/meteor/client/components/avatar/AppAvatar.tsx deleted file mode 100644 index c146eb4b10fc..000000000000 --- a/apps/meteor/client/components/avatar/AppAvatar.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import { Box } from '@rocket.chat/fuselage'; -import type { ComponentProps, ReactElement } from 'react'; -import React from 'react'; - -import BaseAvatar from './BaseAvatar'; - -type AppAvatarProps = { - iconFileContent: string; - iconFileData: string; - size: ComponentProps['size']; -} & ComponentProps; - -export default function AppAvatar({ iconFileContent, size, iconFileData, ...props }: AppAvatarProps): ReactElement { - return ( - - - - ); -} diff --git a/apps/meteor/client/components/avatar/BaseAvatar.tsx b/apps/meteor/client/components/avatar/BaseAvatar.tsx deleted file mode 100644 index f264f841bc8e..000000000000 --- a/apps/meteor/client/components/avatar/BaseAvatar.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import type { AvatarProps } from '@rocket.chat/fuselage'; -import { Avatar, Skeleton } from '@rocket.chat/fuselage'; -import type { FC } from 'react'; -import React, { useState } from 'react'; - -export type BaseAvatarProps = Omit; - -const BaseAvatar: FC = ({ size, ...props }) => { - const [error, setError] = useState(false); - - if (error) { - return ; - } - - return ; -}; - -export default BaseAvatar; diff --git a/apps/meteor/client/components/avatar/RoomAvatar.tsx b/apps/meteor/client/components/avatar/RoomAvatar.tsx deleted file mode 100644 index bf3c96509046..000000000000 --- a/apps/meteor/client/components/avatar/RoomAvatar.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import { useRoomAvatarPath } from '@rocket.chat/ui-contexts'; -import type { ReactElement } from 'react'; -import React, { memo } from 'react'; - -import BaseAvatar from './BaseAvatar'; - -// TODO: frontend chapter day - Remove inline Styling - -type RoomAvatarProps = { - /* @deprecated */ - size?: 'x16' | 'x20' | 'x28' | 'x36' | 'x40' | 'x124' | 'x332'; - /* @deprecated */ - url?: string; - - room: { - _id: string; - type?: string; - t?: string; - avatarETag?: string; - }; -}; - -const RoomAvatar = function RoomAvatar({ room, ...rest }: RoomAvatarProps): ReactElement { - const getRoomPathAvatar = useRoomAvatarPath(); - const { url = getRoomPathAvatar(room), ...props } = rest; - return ; -}; - -export default memo(RoomAvatar); diff --git a/apps/meteor/client/components/avatar/RoomAvatarEditor.tsx b/apps/meteor/client/components/avatar/RoomAvatarEditor.tsx index 04b07e9cd627..de4108d8f866 100644 --- a/apps/meteor/client/components/avatar/RoomAvatarEditor.tsx +++ b/apps/meteor/client/components/avatar/RoomAvatarEditor.tsx @@ -3,14 +3,14 @@ import type { IRoom, RoomAdminFieldsType } from '@rocket.chat/core-typings'; import { css } from '@rocket.chat/css-in-js'; import { Box, Button, ButtonGroup } from '@rocket.chat/fuselage'; import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; +import { RoomAvatar } from '@rocket.chat/ui-avatar'; import { useToastMessageDispatch, useTranslation } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; import React, { useEffect } from 'react'; import { getAvatarURL } from '../../../app/utils/client/getAvatarURL'; -import { useFileInput } from '../../hooks/useFileInput'; +import { useSingleFileInput } from '../../hooks/useSingleFileInput'; import { isValidImageFormat } from '../../lib/utils/isValidImageFormat'; -import RoomAvatar from './RoomAvatar'; type RoomAvatarEditorProps = { room: Pick; @@ -36,7 +36,7 @@ const RoomAvatarEditor = ({ disabled = false, room, roomAvatar, onChangeAvatar } }; }); - const [clickUpload, reset] = useFileInput(handleChangeAvatar); + const [clickUpload, reset] = useSingleFileInput(handleChangeAvatar); const clickReset = useMutableCallback(() => { reset(); onChangeAvatar(null); diff --git a/apps/meteor/client/components/avatar/UserAvatarEditor/UserAvatarEditor.tsx b/apps/meteor/client/components/avatar/UserAvatarEditor/UserAvatarEditor.tsx index 6d6ed93d3929..05d96d9536be 100644 --- a/apps/meteor/client/components/avatar/UserAvatarEditor/UserAvatarEditor.tsx +++ b/apps/meteor/client/components/avatar/UserAvatarEditor/UserAvatarEditor.tsx @@ -1,23 +1,18 @@ import type { IUser, AvatarObject } from '@rocket.chat/core-typings'; -import { Box, Button, TextInput, Margins, Avatar, IconButton } from '@rocket.chat/fuselage'; +import { Box, Button, Avatar, TextInput, IconButton, Label } from '@rocket.chat/fuselage'; +import { useUniqueId } from '@rocket.chat/fuselage-hooks'; +import { UserAvatar } from '@rocket.chat/ui-avatar'; import { useToastMessageDispatch, useSetting, useTranslation } from '@rocket.chat/ui-contexts'; import type { ReactElement, ChangeEvent } from 'react'; import React, { useState, useCallback } from 'react'; -import { useFileInput } from '../../../hooks/useFileInput'; +import { useSingleFileInput } from '../../../hooks/useSingleFileInput'; import { isValidImageFormat } from '../../../lib/utils/isValidImageFormat'; -import UserAvatar from '../UserAvatar'; +import type { UserAvatarSuggestion } from './UserAvatarSuggestion'; import UserAvatarSuggestions from './UserAvatarSuggestions'; +import { readFileAsDataURL } from './readFileAsDataURL'; -const toDataURL = (file: File, callback: (result: FileReader['result']) => void): void => { - const reader = new FileReader(); - reader.onloadend = function (e): void { - callback(e?.target?.result || null); - }; - reader.readAsDataURL(file); -}; - -type UserAvatarEditorType = { +type UserAvatarEditorProps = { currentUsername: IUser['username']; username: IUser['username']; setAvatarObj: (obj: AvatarObject) => void; @@ -25,31 +20,33 @@ type UserAvatarEditorType = { etag: IUser['avatarETag']; }; -function UserAvatarEditor({ currentUsername, username, setAvatarObj, disabled, etag }: UserAvatarEditorType): ReactElement { +function UserAvatarEditor({ currentUsername, username, setAvatarObj, disabled, etag }: UserAvatarEditorProps): ReactElement { const t = useTranslation(); const rotateImages = useSetting('FileUpload_RotateImages'); const [avatarFromUrl, setAvatarFromUrl] = useState(''); const [newAvatarSource, setNewAvatarSource] = useState(); + const imageUrlField = useUniqueId(); const dispatchToastMessage = useToastMessageDispatch(); const setUploadedPreview = useCallback( async (file, avatarObj) => { setAvatarObj(avatarObj); - toDataURL(file, async (dataURL) => { - if (typeof dataURL === 'string' && (await isValidImageFormat(dataURL))) { + try { + const dataURL = await readFileAsDataURL(file); + + if (await isValidImageFormat(dataURL)) { setNewAvatarSource(dataURL); - return; } - + } catch (error) { dispatchToastMessage({ type: 'error', message: t('Avatar_format_invalid') }); - }); + } }, [setAvatarObj, t, dispatchToastMessage], ); - const [clickUpload] = useFileInput(setUploadedPreview); + const [clickUpload] = useSingleFileInput(setUploadedPreview); - const clickUrl = (): void => { + const handleAddUrl = (): void => { setNewAvatarSource(avatarFromUrl); setAvatarObj({ avatarUrl: avatarFromUrl }); }; @@ -65,6 +62,14 @@ function UserAvatarEditor({ currentUsername, username, setAvatarObj, disabled, e setAvatarFromUrl(event.currentTarget.value); }; + const handleSelectSuggestion = useCallback( + (suggestion: UserAvatarSuggestion) => { + setAvatarObj(suggestion as unknown as AvatarObject); + setNewAvatarSource(suggestion.blob); + }, + [setAvatarObj, setNewAvatarSource], + ); + return ( {t('Profile_picture')} @@ -72,41 +77,45 @@ function UserAvatarEditor({ currentUsername, username, setAvatarObj, disabled, e dispatchToastMessage({ type: 'error', message: t('error-invalid-image-url') })} /> - - - - - - - - - {t('Use_url_for_avatar')} - + + + + - + + + + diff --git a/apps/meteor/client/components/avatar/UserAvatarEditor/UserAvatarSuggestion.ts b/apps/meteor/client/components/avatar/UserAvatarEditor/UserAvatarSuggestion.ts new file mode 100644 index 000000000000..e2ac26c6d0f3 --- /dev/null +++ b/apps/meteor/client/components/avatar/UserAvatarEditor/UserAvatarSuggestion.ts @@ -0,0 +1,6 @@ +export type UserAvatarSuggestion = { + blob: string; + contentType: string; + service: string; + url: string; +}; diff --git a/apps/meteor/client/components/avatar/UserAvatarEditor/UserAvatarSuggestions.tsx b/apps/meteor/client/components/avatar/UserAvatarEditor/UserAvatarSuggestions.tsx index 04b0c92acd95..4ccb7d304683 100644 --- a/apps/meteor/client/components/avatar/UserAvatarEditor/UserAvatarSuggestions.tsx +++ b/apps/meteor/client/components/avatar/UserAvatarEditor/UserAvatarSuggestions.tsx @@ -1,43 +1,31 @@ -import type { AvatarObject } from '@rocket.chat/core-typings'; -import { Box, Button, Margins, Avatar } from '@rocket.chat/fuselage'; +import { Button, Avatar } from '@rocket.chat/fuselage'; import React, { useCallback } from 'react'; -import { useAvatarSuggestions } from '../../../hooks/useAvatarSuggestions'; +import type { UserAvatarSuggestion } from './UserAvatarSuggestion'; +import { useUserAvatarSuggestions } from './useUserAvatarSuggestions'; type UserAvatarSuggestionsProps = { - setAvatarObj: (obj: AvatarObject) => void; - setNewAvatarSource: (source: string) => void; disabled?: boolean; + onSelectOne?: (suggestion: UserAvatarSuggestion) => void; }; -const UserAvatarSuggestions = ({ setAvatarObj, setNewAvatarSource, disabled }: UserAvatarSuggestionsProps) => { - const handleClick = useCallback( - (suggestion) => () => { - setAvatarObj(suggestion); - setNewAvatarSource(suggestion.blob); - }, - [setAvatarObj, setNewAvatarSource], - ); +function UserAvatarSuggestions({ disabled, onSelectOne }: UserAvatarSuggestionsProps) { + const { data: suggestions = [] } = useUserAvatarSuggestions(); - const { data } = useAvatarSuggestions(); - const suggestions = Object.values(data?.suggestions || {}); + const handleClick = useCallback((suggestion: UserAvatarSuggestion) => () => onSelectOne?.(suggestion), [onSelectOne]); return ( - - {suggestions && - suggestions.length > 0 && - suggestions.map( - (suggestion) => - suggestion.blob && ( - - ), - )} - + <> + {suggestions.map( + (suggestion) => + suggestion.blob && ( + + ), + )} + ); -}; +} export default UserAvatarSuggestions; diff --git a/apps/meteor/client/components/avatar/UserAvatarEditor/readFileAsDataURL.ts b/apps/meteor/client/components/avatar/UserAvatarEditor/readFileAsDataURL.ts new file mode 100644 index 000000000000..d2bb3f7beed1 --- /dev/null +++ b/apps/meteor/client/components/avatar/UserAvatarEditor/readFileAsDataURL.ts @@ -0,0 +1,16 @@ +export const readFileAsDataURL = (file: File) => + new Promise((resolve, reject) => { + const reader = new FileReader(); + reader.onloadend = (event) => { + const result = event.target?.result; + if (typeof result === 'string') { + resolve(result); + return; + } + reject(new Error('Failed to read file')); + }; + reader.onerror = (event) => { + reject(new Error(`Failed to read file: ${event}`)); + }; + reader.readAsDataURL(file); + }); diff --git a/apps/meteor/client/components/avatar/UserAvatarEditor/useUserAvatarSuggestions.ts b/apps/meteor/client/components/avatar/UserAvatarEditor/useUserAvatarSuggestions.ts new file mode 100644 index 000000000000..42bb09406d3b --- /dev/null +++ b/apps/meteor/client/components/avatar/UserAvatarEditor/useUserAvatarSuggestions.ts @@ -0,0 +1,12 @@ +import { useEndpoint } from '@rocket.chat/ui-contexts'; +import { useQuery } from '@tanstack/react-query'; + +export const useUserAvatarSuggestions = () => { + const getAvatarSuggestions = useEndpoint('GET', '/v1/users.getAvatarSuggestion'); + + return useQuery({ + queryKey: ['account', 'profile', 'avatar-suggestions'], + queryFn: async () => getAvatarSuggestions(), + select: (data) => Object.values(data.suggestions), + }); +}; diff --git a/apps/meteor/client/components/connectionStatus/ConnectionStatusBar.styles.css b/apps/meteor/client/components/connectionStatus/ConnectionStatusBar.styles.css deleted file mode 100644 index f9a363aaa28a..000000000000 --- a/apps/meteor/client/components/connectionStatus/ConnectionStatusBar.styles.css +++ /dev/null @@ -1,18 +0,0 @@ -.ConnectionStatusBar { - position: fixed; - z-index: 1000000; - top: 0; - - width: 100%; - padding: 2px; - - text-align: center; - - color: #916302; - border-bottom-width: 1px; - background-color: #fffdf9; - - &__retry-link { - color: var(--color-blue); - } -} diff --git a/apps/meteor/client/components/connectionStatus/ConnectionStatusBar.tsx b/apps/meteor/client/components/connectionStatus/ConnectionStatusBar.tsx index 2737a6fc4d4a..5a26392b60b9 100644 --- a/apps/meteor/client/components/connectionStatus/ConnectionStatusBar.tsx +++ b/apps/meteor/client/components/connectionStatus/ConnectionStatusBar.tsx @@ -1,82 +1,74 @@ -import { Icon } from '@rocket.chat/fuselage'; -import { useConnectionStatus, useTranslation } from '@rocket.chat/ui-contexts'; -import type { MouseEventHandler, FC } from 'react'; -import React, { useEffect, useRef, useState } from 'react'; - -import './ConnectionStatusBar.styles.css'; - -// TODO: frontend chapter day - fix unknown translation keys - -const getReconnectCountdown = (retryTime: number): number => { - const timeDiff = retryTime - Date.now(); - return (timeDiff > 0 && Math.round(timeDiff / 1000)) || 0; -}; - -const useReconnectCountdown = ( - retryTime: number | undefined, - status: 'connected' | 'connecting' | 'failed' | 'waiting' | 'offline', -): number => { - const reconnectionTimerRef = useRef>(); - const [reconnectCountdown, setReconnectCountdown] = useState(() => (retryTime ? getReconnectCountdown(retryTime) : 0)); - - useEffect(() => { - if (status === 'waiting') { - if (reconnectionTimerRef.current) { - return; - } - - reconnectionTimerRef.current = setInterval(() => { - retryTime && setReconnectCountdown(getReconnectCountdown(retryTime)); - }, 500); - return; - } - - reconnectionTimerRef.current && clearInterval(reconnectionTimerRef.current); - reconnectionTimerRef.current = undefined; - }, [retryTime, status]); - - useEffect( - () => (): void => { - reconnectionTimerRef.current && clearInterval(reconnectionTimerRef.current); - }, - [], - ); - - return reconnectCountdown; -}; - -const ConnectionStatusBar: FC = function ConnectionStatusBar() { +import { css } from '@rocket.chat/css-in-js'; +import { Box, Button, Icon, Palette } from '@rocket.chat/fuselage'; +import { useConnectionStatus } from '@rocket.chat/ui-contexts'; +import React from 'react'; +import { useTranslation } from 'react-i18next'; + +import { useReconnectCountdown } from './useReconnectCountdown'; + +const connectionStatusBarStyle = css` + color: ${Palette.statusColor['status-font-on-warning']}; + background-color: ${Palette.surface['surface-tint']}; + border-color: ${Palette.statusColor['status-font-on-warning']}; + + position: fixed; + z-index: 1000000; + + display: flex; + justify-content: space-between; + align-items: center; + + .rcx-connection-status-bar--wrapper { + display: flex; + align-items: center; + column-gap: 8px; + } + .rcx-connection-status-bar--content { + display: flex; + align-items: center; + column-gap: 8px; + } + .rcx-connection-status-bar--info { + color: ${Palette.text['font-default']}; + } +`; +function ConnectionStatusBar() { const { connected, retryTime, status, reconnect } = useConnectionStatus(); const reconnectCountdown = useReconnectCountdown(retryTime, status); - const t = useTranslation(); + const { t } = useTranslation(); if (connected) { return null; } - const handleRetryClick: MouseEventHandler = (event) => { - event.preventDefault(); - reconnect?.(); - }; - return ( -
- - {t('meteor_status' as Parameters[0], { context: status })} - - - {status === 'waiting' && <> {t('meteor_status_reconnect_in', { count: reconnectCountdown })}} - - {['waiting', 'offline'].includes(status) && ( - <> - {' '} - - {t('meteor_status_try_now' as Parameters[0], { context: status })} - - - )} -
+ + + + + {t('meteor_status', { context: status })} + {['waiting', 'failed', 'offline'].includes(status) && ( + + {status === 'waiting' ? t('meteor_status_reconnect_in', { count: reconnectCountdown }) : t('meteor_status_try_again_later')} + + )} + + + + ); -}; +} export default ConnectionStatusBar; diff --git a/apps/meteor/client/components/connectionStatus/useReconnectCountdown.ts b/apps/meteor/client/components/connectionStatus/useReconnectCountdown.ts new file mode 100644 index 000000000000..7a409e752ce4 --- /dev/null +++ b/apps/meteor/client/components/connectionStatus/useReconnectCountdown.ts @@ -0,0 +1,39 @@ +import { useEffect, useRef, useState } from 'react'; + +const getReconnectCountdown = (retryTime: number): number => { + const timeDiff = retryTime - Date.now(); + return (timeDiff > 0 && Math.round(timeDiff / 1000)) || 0; +}; + +export const useReconnectCountdown = ( + retryTime: number | undefined, + status: 'connected' | 'connecting' | 'failed' | 'waiting' | 'offline', +): number => { + const reconnectionTimerRef = useRef>(); + const [reconnectCountdown, setReconnectCountdown] = useState(() => (retryTime ? getReconnectCountdown(retryTime) : 0)); + + useEffect(() => { + if (status === 'waiting') { + if (reconnectionTimerRef.current) { + return; + } + + reconnectionTimerRef.current = setInterval(() => { + retryTime && setReconnectCountdown(getReconnectCountdown(retryTime)); + }, 500); + return; + } + + reconnectionTimerRef.current && clearInterval(reconnectionTimerRef.current); + reconnectionTimerRef.current = undefined; + }, [retryTime, status]); + + useEffect( + () => (): void => { + reconnectionTimerRef.current && clearInterval(reconnectionTimerRef.current); + }, + [], + ); + + return reconnectCountdown; +}; diff --git a/apps/meteor/client/components/message/IgnoredContent.tsx b/apps/meteor/client/components/message/IgnoredContent.tsx index 31b62639b849..b1973b13178a 100644 --- a/apps/meteor/client/components/message/IgnoredContent.tsx +++ b/apps/meteor/client/components/message/IgnoredContent.tsx @@ -17,7 +17,7 @@ const IgnoredContent = ({ onShowMessageIgnored }: IgnoredContentProps): ReactEle }; return ( - +

{t('Message_Ignored')} diff --git a/apps/meteor/client/components/message/MessageContentBody.tsx b/apps/meteor/client/components/message/MessageContentBody.tsx index 5552e6da0745..b3c612fbe725 100644 --- a/apps/meteor/client/components/message/MessageContentBody.tsx +++ b/apps/meteor/client/components/message/MessageContentBody.tsx @@ -1,5 +1,4 @@ -import { css } from '@rocket.chat/css-in-js'; -import { MessageBody, Box, Palette, Skeleton } from '@rocket.chat/fuselage'; +import { MessageBody, Skeleton } from '@rocket.chat/fuselage'; import { Markup } from '@rocket.chat/gazzodown'; import React, { Suspense } from 'react'; @@ -10,59 +9,14 @@ type MessageContentBodyProps = Pick { - // TODO: this style should go to Fuselage repository - const messageBodyAdditionalStyles = css` - > blockquote { - padding-inline: 8px; - border: 1px solid ${Palette.stroke['stroke-extra-light']}; - border-radius: 2px; - background-color: ${Palette.surface['surface-tint']}; - border-inline-start-color: ${Palette.stroke['stroke-medium']}; - - &:hover, - &:focus { - background-color: ${Palette.surface['surface-hover']}; - border-color: ${Palette.stroke['stroke-light']}; - border-inline-start-color: ${Palette.stroke['stroke-medium']}; - } - } - > ul.task-list { - > li::before { - display: none; - } - - > li > .rcx-check-box > .rcx-check-box__input:focus + .rcx-check-box__fake { - z-index: 1; - } - - list-style: none; - margin-inline-start: 0; - padding-inline-start: 0; - } - a { - color: ${Palette.text['font-info']}; - &:hover { - text-decoration: underline; - } - &:focus { - box-shadow: 0 0 0 2px ${Palette.stroke['stroke-extra-light-highlight']}; - border-radius: 2px; - } - } - `; - - return ( - - - }> - - - - - - - ); -}; +const MessageContentBody = ({ mentions, channels, md, searchText }: MessageContentBodyProps) => ( + + }> + + + + + +); export default MessageContentBody; diff --git a/apps/meteor/client/components/message/MessageHeader.tsx b/apps/meteor/client/components/message/MessageHeader.tsx index 3189aa2972bc..a6ad5feaff96 100644 --- a/apps/meteor/client/components/message/MessageHeader.tsx +++ b/apps/meteor/client/components/message/MessageHeader.tsx @@ -8,7 +8,7 @@ import { MessageNameContainer, } from '@rocket.chat/fuselage'; import { useTranslation } from '@rocket.chat/ui-contexts'; -import type { ReactElement } from 'react'; +import type { KeyboardEvent, ReactElement } from 'react'; import React, { memo } from 'react'; import { getUserDisplayName } from '../../../lib/getUserDisplayName'; @@ -16,7 +16,7 @@ import { useFormatDateAndTime } from '../../hooks/useFormatDateAndTime'; import { useFormatTime } from '../../hooks/useFormatTime'; import { useUserData } from '../../hooks/useUserData'; import type { UserPresence } from '../../lib/presence'; -import { useChat } from '../../views/room/contexts/ChatContext'; +import { useUserCard } from '../../views/room/contexts/UserCardContext'; import StatusIndicators from './StatusIndicators'; import MessageRoles from './header/MessageRoles'; import { useMessageRoles } from './header/hooks/useMessageRoles'; @@ -31,6 +31,7 @@ const MessageHeader = ({ message }: MessageHeaderProps): ReactElement => { const formatTime = useFormatTime(); const formatDateAndTime = useFormatDateAndTime(); + const { triggerProps, openUserCard } = useUserCard(); const showRealName = useMessageListShowRealName(); const user: UserPresence = { ...message.u, roles: [], ...useUserData(message.u._id) }; @@ -41,41 +42,35 @@ const MessageHeader = ({ message }: MessageHeaderProps): ReactElement => { const roles = useMessageRoles(message.u._id, message.rid, showRoles); const shouldShowRolesList = roles.length > 0; - const chat = useChat(); - return ( - + openUserCard(e, message.u.username)} + onKeyDown={(e: KeyboardEvent) => { + (e.code === 'Enter' || e.code === 'Space') && openUserCard(e, message.u.username); + }} + style={{ cursor: 'pointer' }} + {...triggerProps} + > {message.alias || getUserDisplayName(user.name, user.username, showRealName)} {showUsername && ( <> {' '} - + @{user.username} )} - {shouldShowRolesList && } {formatTime(message.ts)} {message.private && {t('Only_you_can_see_this_message')}} diff --git a/apps/meteor/client/components/message/MessageToolbarHolder.tsx b/apps/meteor/client/components/message/MessageToolbarHolder.tsx new file mode 100644 index 000000000000..c5314b198374 --- /dev/null +++ b/apps/meteor/client/components/message/MessageToolbarHolder.tsx @@ -0,0 +1,57 @@ +import type { IMessage } from '@rocket.chat/core-typings'; +import { MessageToolbarWrapper } from '@rocket.chat/fuselage'; +import { useQuery } from '@tanstack/react-query'; +import type { ReactElement } from 'react'; +import React, { Suspense, lazy, memo, useState } from 'react'; + +import type { MessageActionContext } from '../../../app/ui-utils/client/lib/MessageAction'; +import { useChat } from '../../views/room/contexts/ChatContext'; +import { useIsVisible } from '../../views/room/hooks/useIsVisible'; + +type MessageToolbarHolderProps = { + message: IMessage; + context?: MessageActionContext; +}; + +const MessageToolbar = lazy(() => import('./toolbar/MessageToolbar')); + +const MessageToolbarHolder = ({ message, context }: MessageToolbarHolderProps): ReactElement => { + const chat = useChat(); + const [ref, isVisible] = useIsVisible(); + const [isToolbarMenuOpen, setIsToolbarMenuOpen] = useState(false); + + const showToolbar = isVisible || isToolbarMenuOpen; + + const depsQueryResult = useQuery( + ['toolbox', message._id, context], + async () => { + const room = await chat?.data.findRoom(); + const subscription = await chat?.data.findSubscription(); + return { + room, + subscription, + }; + }, + { + enabled: showToolbar, + }, + ); + + return ( + + {showToolbar && depsQueryResult.isSuccess && depsQueryResult.data.room && ( + + + + )} + + ); +}; + +export default memo(MessageToolbarHolder); diff --git a/apps/meteor/client/components/message/MessageToolboxHolder.tsx b/apps/meteor/client/components/message/MessageToolboxHolder.tsx deleted file mode 100644 index 06a9fbf42b77..000000000000 --- a/apps/meteor/client/components/message/MessageToolboxHolder.tsx +++ /dev/null @@ -1,54 +0,0 @@ -import type { IMessage } from '@rocket.chat/core-typings'; -import { MessageToolboxWrapper } from '@rocket.chat/fuselage'; -import { useQuery } from '@tanstack/react-query'; -import type { ReactElement } from 'react'; -import React, { Suspense, lazy, memo, useRef, useState } from 'react'; - -import type { MessageActionContext } from '../../../app/ui-utils/client/lib/MessageAction'; -import { useChat } from '../../views/room/contexts/ChatContext'; -import { useIsVisible } from '../../views/room/hooks/useIsVisible'; - -type MessageToolboxHolderProps = { - message: IMessage; - context?: MessageActionContext; -}; - -const MessageToolbox = lazy(() => import('./toolbox/MessageToolbox')); - -const MessageToolboxHolder = ({ message, context }: MessageToolboxHolderProps): ReactElement => { - const ref = useRef(null); - - const [isVisible] = useIsVisible(ref); - const [kebabOpen, setKebabOpen] = useState(false); - - const showToolbox = isVisible || kebabOpen; - - const chat = useChat(); - - const depsQueryResult = useQuery(['toolbox', message._id, context], async () => { - const room = await chat?.data.findRoom(); - const subscription = await chat?.data.findSubscription(); - return { - room, - subscription, - }; - }); - - return ( - - {showToolbox && depsQueryResult.isSuccess && depsQueryResult.data.room && ( - - - - )} - - ); -}; - -export default memo(MessageToolboxHolder); diff --git a/apps/meteor/client/components/message/StatusIndicators.tsx b/apps/meteor/client/components/message/StatusIndicators.tsx index 48ec47e5e280..f47d25e7c7b2 100644 --- a/apps/meteor/client/components/message/StatusIndicators.tsx +++ b/apps/meteor/client/components/message/StatusIndicators.tsx @@ -1,5 +1,5 @@ import type { IMessage, ITranslatedMessage } from '@rocket.chat/core-typings'; -import { isEditedMessage, isE2EEMessage, isOTRMessage } from '@rocket.chat/core-typings'; +import { isEditedMessage, isE2EEMessage, isOTRMessage, isOTRAckMessage } from '@rocket.chat/core-typings'; import { MessageStatusIndicator, MessageStatusIndicatorItem } from '@rocket.chat/fuselage'; import { useUserId, useTranslation } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; @@ -18,7 +18,7 @@ const StatusIndicators = ({ message }: StatusIndicatorsProps): ReactElement => { const following = useShowFollowing({ message }); const isEncryptedMessage = isE2EEMessage(message); - const isOtrMessage = isOTRMessage(message); + const isOtrMessage = isOTRMessage(message) || isOTRAckMessage(message); const uid = useUserId(); diff --git a/apps/meteor/client/components/message/content/Attachments.tsx b/apps/meteor/client/components/message/content/Attachments.tsx index b08215c94a5f..ea9c03b9e7d3 100644 --- a/apps/meteor/client/components/message/content/Attachments.tsx +++ b/apps/meteor/client/components/message/content/Attachments.tsx @@ -6,14 +6,14 @@ import AttachmentsItem from './attachments/AttachmentsItem'; type AttachmentsProps = { attachments: MessageAttachmentBase[]; - collapsed?: boolean; + id?: string | undefined; }; -const Attachments = ({ attachments, collapsed }: AttachmentsProps): ReactElement => { +const Attachments = ({ attachments, id }: AttachmentsProps): ReactElement => { return ( <> {attachments?.map((attachment, index) => ( - + ))} ); diff --git a/apps/meteor/client/components/message/content/DiscussionMetrics.tsx b/apps/meteor/client/components/message/content/DiscussionMetrics.tsx index 5589d1278905..dc84828e607a 100644 --- a/apps/meteor/client/components/message/content/DiscussionMetrics.tsx +++ b/apps/meteor/client/components/message/content/DiscussionMetrics.tsx @@ -23,7 +23,7 @@ const DiscussionMetrics = ({ lm, count, rid, drid }: DiscussionMetricsProps): Re goToRoom(drid)}> - {count ? t('message_counter', { counter: count, count }) : t('Reply')} + {count ? t('message_counter', { count }) : t('Reply')} diff --git a/apps/meteor/client/components/message/content/Reactions.tsx b/apps/meteor/client/components/message/content/Reactions.tsx index 712504ec7a2c..41daf046c544 100644 --- a/apps/meteor/client/components/message/content/Reactions.tsx +++ b/apps/meteor/client/components/message/content/Reactions.tsx @@ -1,9 +1,9 @@ import type { IMessage } from '@rocket.chat/core-typings'; import { MessageReactions, MessageReactionAction } from '@rocket.chat/fuselage'; import type { ReactElement } from 'react'; -import React from 'react'; +import React, { useContext } from 'react'; -import { useOpenEmojiPicker, useReactionsFilter, useUserHasReacted } from '../list/MessageListContext'; +import { MessageListContext, useOpenEmojiPicker, useUserHasReacted } from '../list/MessageListContext'; import Reaction from './reactions/Reaction'; import { useToggleReactionMutation } from './reactions/useToggleReactionMutation'; @@ -13,9 +13,8 @@ type ReactionsProps = { const Reactions = ({ message }: ReactionsProps): ReactElement => { const hasReacted = useUserHasReacted(message); - const filterReactions = useReactionsFilter(message); const openEmojiPicker = useOpenEmojiPicker(message); - + const { username } = useContext(MessageListContext); const toggleReactionMutation = useToggleReactionMutation(); return ( @@ -27,7 +26,8 @@ const Reactions = ({ message }: ReactionsProps): ReactElement => { counter={reactions.usernames.length} hasReacted={hasReacted} name={name} - names={filterReactions(name)} + names={reactions.usernames.filter((user) => user !== username).map((username) => `@${username}`)} + messageId={message._id} onClick={() => toggleReactionMutation.mutate({ mid: message._id, reaction: name })} /> ))} diff --git a/apps/meteor/client/components/message/content/attachments/AttachmentsItem.tsx b/apps/meteor/client/components/message/content/attachments/AttachmentsItem.tsx index 6ca97fe7ecde..dd4f9bac9d28 100644 --- a/apps/meteor/client/components/message/content/attachments/AttachmentsItem.tsx +++ b/apps/meteor/client/components/message/content/attachments/AttachmentsItem.tsx @@ -4,16 +4,17 @@ import type { ReactElement } from 'react'; import React, { memo } from 'react'; import DefaultAttachment from './DefaultAttachment'; -import { FileAttachment } from './FileAttachment'; +import FileAttachment from './FileAttachment'; import { QuoteAttachment } from './QuoteAttachment'; type AttachmentsItemProps = { attachment: MessageAttachmentBase; + id: string | undefined; }; -const AttachmentsItem = ({ attachment }: AttachmentsItemProps): ReactElement => { +const AttachmentsItem = ({ attachment, id }: AttachmentsItemProps): ReactElement => { if (isFileAttachment(attachment)) { - return ; + return ; } if (isQuoteAttachment(attachment)) { diff --git a/apps/meteor/client/components/message/content/attachments/FileAttachment.tsx b/apps/meteor/client/components/message/content/attachments/FileAttachment.tsx index 423464b72569..f80fa62890ec 100644 --- a/apps/meteor/client/components/message/content/attachments/FileAttachment.tsx +++ b/apps/meteor/client/components/message/content/attachments/FileAttachment.tsx @@ -1,23 +1,25 @@ -import type { FileAttachmentProps } from '@rocket.chat/core-typings'; -import { isFileAudioAttachment, isFileImageAttachment, isFileVideoAttachment } from '@rocket.chat/core-typings'; -import type { FC } from 'react'; +import { type FileAttachmentProps, isFileAudioAttachment, isFileImageAttachment, isFileVideoAttachment } from '@rocket.chat/core-typings'; import React from 'react'; -import { AudioAttachment } from './file/AudioAttachment'; -import { GenericFileAttachment } from './file/GenericFileAttachment'; -import { ImageAttachment } from './file/ImageAttachment'; -import { VideoAttachment } from './file/VideoAttachment'; +import AudioAttachment from './file/AudioAttachment'; +import GenericFileAttachment from './file/GenericFileAttachment'; +import ImageAttachment from './file/ImageAttachment'; +import VideoAttachment from './file/VideoAttachment'; -export const FileAttachment: FC = (attachment) => { +const FileAttachment = (attachment: FileAttachmentProps) => { if (isFileImageAttachment(attachment)) { return ; } + if (isFileAudioAttachment(attachment)) { return ; } + if (isFileVideoAttachment(attachment)) { return ; } - return ; // TODO: fix this + return ; }; + +export default FileAttachment; diff --git a/apps/meteor/client/components/message/content/attachments/QuoteAttachment.tsx b/apps/meteor/client/components/message/content/attachments/QuoteAttachment.tsx index 67232cbd441f..7c2c2011cac9 100644 --- a/apps/meteor/client/components/message/content/attachments/QuoteAttachment.tsx +++ b/apps/meteor/client/components/message/content/attachments/QuoteAttachment.tsx @@ -1,6 +1,7 @@ import type { MessageQuoteAttachment } from '@rocket.chat/core-typings'; import { css } from '@rocket.chat/css-in-js'; import { Box, Palette } from '@rocket.chat/fuselage'; +import { useUserPreference } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; import React from 'react'; @@ -37,6 +38,7 @@ type QuoteAttachmentProps = { export const QuoteAttachment = ({ attachment }: QuoteAttachmentProps): ReactElement => { const formatTime = useTimeAgo(); + const displayAvatarPreference = useUserPreference('displayAvatars'); return ( <> @@ -50,7 +52,7 @@ export const QuoteAttachment = ({ attachment }: QuoteAttachmentProps): ReactElem borderInlineStartColor='light' > - + {displayAvatarPreference && } @@ -68,7 +70,7 @@ export const QuoteAttachment = ({ attachment }: QuoteAttachmentProps): ReactElem {attachment.md ? : attachment.text.substring(attachment.text.indexOf('\n') + 1)} {attachment.attachments && ( - + )} diff --git a/apps/meteor/client/components/message/content/attachments/default/ActionAttachtment.tsx b/apps/meteor/client/components/message/content/attachments/default/ActionAttachtment.tsx index df3b2674b897..99b1f3de7290 100644 --- a/apps/meteor/client/components/message/content/attachments/default/ActionAttachtment.tsx +++ b/apps/meteor/client/components/message/content/attachments/default/ActionAttachtment.tsx @@ -10,27 +10,29 @@ export const ActionAttachment: FC = ({ actions }) => { const handleLinkClick = useExternalLink(); return ( - - {actions - .filter( - ({ type, msg_in_chat_window: msgInChatWindow, url, image_url: image, text }) => - type === 'button' && (image || text) && (url || msgInChatWindow), - ) - .map(({ text, url, msgId, msg, msg_processing_type: processingType = 'sendMessage', image_url: image }, index) => { - const content = image ? : text; - if (url) { + + + {actions + .filter( + ({ type, msg_in_chat_window: msgInChatWindow, url, image_url: image, text }) => + type === 'button' && (image || text) && (url || msgInChatWindow), + ) + .map(({ text, url, msgId, msg, msg_processing_type: processingType = 'sendMessage', image_url: image }, index) => { + const content = image ? : text; + if (url) { + return ( + + ); + } return ( - + ); - } - return ( - - {content} - - ); - })} - + })} + + ); }; diff --git a/apps/meteor/client/components/message/content/attachments/file/AudioAttachment.tsx b/apps/meteor/client/components/message/content/attachments/file/AudioAttachment.tsx index 4dd06de46655..0f2082f96e31 100644 --- a/apps/meteor/client/components/message/content/attachments/file/AudioAttachment.tsx +++ b/apps/meteor/client/components/message/content/attachments/file/AudioAttachment.tsx @@ -1,14 +1,13 @@ import type { AudioAttachmentProps } from '@rocket.chat/core-typings'; import { AudioPlayer } from '@rocket.chat/fuselage'; import { useMediaUrl } from '@rocket.chat/ui-contexts'; -import type { FC } from 'react'; import React from 'react'; import MarkdownText from '../../../../MarkdownText'; import MessageCollapsible from '../../../MessageCollapsible'; import MessageContentBody from '../../../MessageContentBody'; -export const AudioAttachment: FC = ({ +const AudioAttachment = ({ title, audio_url: url, audio_type: type, @@ -18,7 +17,7 @@ export const AudioAttachment: FC = ({ title_link: link, title_link_download: hasDownload, collapsed, -}) => { +}: AudioAttachmentProps) => { const getURL = useMediaUrl(); return ( <> @@ -29,3 +28,5 @@ export const AudioAttachment: FC = ({ ); }; + +export default AudioAttachment; diff --git a/apps/meteor/client/components/message/content/attachments/file/GenericFileAttachment.tsx b/apps/meteor/client/components/message/content/attachments/file/GenericFileAttachment.tsx index cbf1749b9dcd..4301520c6173 100644 --- a/apps/meteor/client/components/message/content/attachments/file/GenericFileAttachment.tsx +++ b/apps/meteor/client/components/message/content/attachments/file/GenericFileAttachment.tsx @@ -7,7 +7,7 @@ import { MessageGenericPreviewDescription, } from '@rocket.chat/fuselage'; import { useMediaUrl } from '@rocket.chat/ui-contexts'; -import type { FC } from 'react'; +import type { UIEvent } from 'react'; import React from 'react'; import { getFileExtension } from '../../../../../../lib/utils/getFileExtension'; @@ -16,7 +16,11 @@ import MessageCollapsible from '../../../MessageCollapsible'; import MessageContentBody from '../../../MessageContentBody'; import AttachmentSize from '../structure/AttachmentSize'; -export const GenericFileAttachment: FC = ({ +const openDocumentViewer = window.RocketChatDesktop?.openDocumentViewer; + +type GenericFileAttachmentProps = MessageAttachmentBase; + +const GenericFileAttachment = ({ title, description, descriptionMd, @@ -25,9 +29,24 @@ export const GenericFileAttachment: FC = ({ size, format, collapsed, -}) => { +}: GenericFileAttachmentProps) => { const getURL = useMediaUrl(); + const handleTitleClick = (event: UIEvent): void => { + if (openDocumentViewer && link && format === 'PDF') { + event.preventDefault(); + openDocumentViewer(getURL(link), format, ''); + } + }; + + const getExternalUrl = () => { + if (!hasDownload || !link) return undefined; + + if (openDocumentViewer) return `${getURL(link)}?download`; + + return getURL(link); + }; + return ( <> {descriptionMd ? : } @@ -36,7 +55,7 @@ export const GenericFileAttachment: FC = ({ } > - + {title} {size && ( @@ -50,3 +69,5 @@ export const GenericFileAttachment: FC = ({ ); }; + +export default GenericFileAttachment; diff --git a/apps/meteor/client/components/message/content/attachments/file/ImageAttachment.tsx b/apps/meteor/client/components/message/content/attachments/file/ImageAttachment.tsx index 70c29fafacb3..a7e4036e1288 100644 --- a/apps/meteor/client/components/message/content/attachments/file/ImageAttachment.tsx +++ b/apps/meteor/client/components/message/content/attachments/file/ImageAttachment.tsx @@ -1,6 +1,5 @@ import type { ImageAttachmentProps } from '@rocket.chat/core-typings'; import { useMediaUrl } from '@rocket.chat/ui-contexts'; -import type { FC } from 'react'; import React from 'react'; import MarkdownText from '../../../../MarkdownText'; @@ -9,7 +8,8 @@ import MessageContentBody from '../../../MessageContentBody'; import AttachmentImage from '../structure/AttachmentImage'; import { useLoadImage } from './hooks/useLoadImage'; -export const ImageAttachment: FC = ({ +const ImageAttachment = ({ + id, title, image_url: url, image_preview: imagePreview, @@ -23,7 +23,7 @@ export const ImageAttachment: FC = ({ title_link: link, title_link_download: hasDownload, collapsed, -}) => { +}: ImageAttachmentProps) => { const [loadImage, setLoadImage] = useLoadImage(); const getURL = useMediaUrl(); @@ -38,8 +38,11 @@ export const ImageAttachment: FC = ({ dataSrc={getURL(link || url)} src={getURL(url)} previewUrl={`data:image/png;base64,${imagePreview}`} + id={id} /> ); }; + +export default ImageAttachment; diff --git a/apps/meteor/client/components/message/content/attachments/file/VideoAttachment.tsx b/apps/meteor/client/components/message/content/attachments/file/VideoAttachment.tsx index dd32db8d8523..5954baf092d0 100644 --- a/apps/meteor/client/components/message/content/attachments/file/VideoAttachment.tsx +++ b/apps/meteor/client/components/message/content/attachments/file/VideoAttachment.tsx @@ -1,7 +1,6 @@ import type { VideoAttachmentProps } from '@rocket.chat/core-typings'; import { Box, MessageGenericPreview } from '@rocket.chat/fuselage'; import { useMediaUrl } from '@rocket.chat/ui-contexts'; -import type { FC } from 'react'; import React from 'react'; import { userAgentMIMETypeFallback } from '../../../../../lib/utils/userAgentMIMETypeFallback'; @@ -9,7 +8,7 @@ import MarkdownText from '../../../../MarkdownText'; import MessageCollapsible from '../../../MessageCollapsible'; import MessageContentBody from '../../../MessageContentBody'; -export const VideoAttachment: FC = ({ +const VideoAttachment = ({ title, video_url: url, video_type: type, @@ -19,7 +18,7 @@ export const VideoAttachment: FC = ({ title_link: link, title_link_download: hasDownload, collapsed, -}) => { +}: VideoAttachmentProps) => { const getURL = useMediaUrl(); return ( @@ -35,3 +34,5 @@ export const VideoAttachment: FC = ({ ); }; + +export default VideoAttachment; diff --git a/apps/meteor/client/components/message/content/attachments/structure/AttachmentAuthorAvatar.tsx b/apps/meteor/client/components/message/content/attachments/structure/AttachmentAuthorAvatar.tsx index 22e1f107b027..fb0b3e448f12 100644 --- a/apps/meteor/client/components/message/content/attachments/structure/AttachmentAuthorAvatar.tsx +++ b/apps/meteor/client/components/message/content/attachments/structure/AttachmentAuthorAvatar.tsx @@ -1,8 +1,7 @@ +import { BaseAvatar } from '@rocket.chat/ui-avatar'; import type { ReactElement } from 'react'; import React from 'react'; -import BaseAvatar from '../../../../avatar/BaseAvatar'; - const AttachmentAuthorAvatar = ({ url }: { url: string }): ReactElement => ; export default AttachmentAuthorAvatar; diff --git a/apps/meteor/client/components/message/content/attachments/structure/AttachmentImage.tsx b/apps/meteor/client/components/message/content/attachments/structure/AttachmentImage.tsx index 00249bb857fc..a82e3a7daa5e 100644 --- a/apps/meteor/client/components/message/content/attachments/structure/AttachmentImage.tsx +++ b/apps/meteor/client/components/message/content/attachments/structure/AttachmentImage.tsx @@ -14,6 +14,7 @@ type AttachmentImageProps = { src: string; loadImage?: boolean; setLoadImage: () => void; + id: string | undefined; } & Dimensions & ({ loadImage: true } | { loadImage: false; setLoadImage: () => void }); @@ -36,7 +37,7 @@ const getDimensions = ( return { width, height, ratio: (height / width) * 100 }; }; -const AttachmentImage: FC = ({ previewUrl, dataSrc, loadImage = true, setLoadImage, src, ...size }) => { +const AttachmentImage: FC = ({ id, previewUrl, dataSrc, loadImage = true, setLoadImage, src, ...size }) => { const limits = useAttachmentDimensions(); const [error, setError] = useState(false); @@ -77,7 +78,14 @@ const AttachmentImage: FC = ({ previewUrl, dataSrc, loadIm right: 0, }} > - + diff --git a/apps/meteor/client/components/message/content/reactions/Reaction.tsx b/apps/meteor/client/components/message/content/reactions/Reaction.tsx index cf68e65b8829..893f6456c8c6 100644 --- a/apps/meteor/client/components/message/content/reactions/Reaction.tsx +++ b/apps/meteor/client/components/message/content/reactions/Reaction.tsx @@ -1,51 +1,30 @@ import { MessageReaction as MessageReactionTemplate, MessageReactionEmoji, MessageReactionCounter } from '@rocket.chat/fuselage'; -import type { TranslationKey } from '@rocket.chat/ui-contexts'; -import { useTooltipClose, useTooltipOpen, useTranslation } from '@rocket.chat/ui-contexts'; +import { useTooltipClose, useTooltipOpen } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; -import React, { useRef } from 'react'; +import React, { useRef, useContext } from 'react'; import { getEmojiClassNameAndDataTitle } from '../../../../lib/utils/renderEmoji'; -import MarkdownText from '../../../MarkdownText'; +import { MessageListContext } from '../../list/MessageListContext'; +import ReactionTooltip from './ReactionTooltip'; // TODO: replace it with proper usage of i18next plurals -const getTranslationKey = (users: string[], mine: boolean): TranslationKey => { - if (users.length === 0) { - if (mine) { - return 'You_reacted_with'; - } - } - - if (users.length > 10) { - if (mine) { - return 'You_users_and_more_Reacted_with'; - } - return 'Users_and_more_reacted_with'; - } - - if (mine) { - return 'You_and_users_Reacted_with'; - } - return 'Users_reacted_with'; -}; - type ReactionProps = { hasReacted: (name: string) => boolean; counter: number; name: string; names: string[]; + messageId: string; onClick: () => void; }; -const Reaction = ({ hasReacted, counter, name, names, ...props }: ReactionProps): ReactElement => { - const t = useTranslation(); +const Reaction = ({ hasReacted, counter, name, names, messageId, ...props }: ReactionProps): ReactElement => { const ref = useRef(null); const openTooltip = useTooltipOpen(); const closeTooltip = useTooltipClose(); + const { showRealName, username } = useContext(MessageListContext); const mine = hasReacted(name); - const key = getTranslationKey(names, mine); - const emojiProps = getEmojiClassNameAndDataTitle(name); return ( @@ -55,18 +34,21 @@ const Reaction = ({ hasReacted, counter, name, names, ...props }: ReactionProps) mine={mine} tabIndex={0} role='button' - onMouseOver={(e): void => { + // if data-tooltip is not set, the tooltip will close on first mouse enter + data-tooltip='' + onMouseEnter={async (e) => { e.stopPropagation(); e.preventDefault(); + ref.current && openTooltip( - 10 ? names.length - 10 : names.length, - users: names.slice(0, 10).join(', '), - emoji: name, - })} - variant='inline' + , ref.current, ); diff --git a/apps/meteor/client/components/message/content/reactions/ReactionTooltip.tsx b/apps/meteor/client/components/message/content/reactions/ReactionTooltip.tsx new file mode 100644 index 000000000000..a71f50a953b6 --- /dev/null +++ b/apps/meteor/client/components/message/content/reactions/ReactionTooltip.tsx @@ -0,0 +1,100 @@ +import { Skeleton } from '@rocket.chat/fuselage'; +import { useTranslation } from '@rocket.chat/ui-contexts'; +import type { TranslationKey } from '@rocket.chat/ui-contexts'; +import { useQuery } from '@tanstack/react-query'; +import React from 'react'; + +import { useGetMessageByID } from '../../../../views/room/contextualBar/Threads/hooks/useGetMessageByID'; +import MarkdownText from '../../../MarkdownText'; + +type ReactionTooltipProps = { + emojiName: string; + usernames: string[]; + username: string | undefined; + mine: boolean; + showRealName: boolean; + messageId: string; +}; + +const getTranslationKey = (users: string[], mine: boolean): TranslationKey => { + if (users.length === 0) { + if (mine) { + return 'You_reacted_with'; + } + } + + if (users.length > 10) { + if (mine) { + return 'You_users_and_more_Reacted_with'; + } + return 'Users_and_more_reacted_with'; + } + + if (mine) { + return 'You_and_users_Reacted_with'; + } + return 'Users_reacted_with'; +}; + +const ReactionTooltip = ({ emojiName, usernames, mine, messageId, showRealName, username }: ReactionTooltipProps) => { + const t = useTranslation(); + + const key = getTranslationKey(usernames, mine); + + const getMessage = useGetMessageByID(); + + const { data: users, isLoading } = useQuery( + ['chat.getMessage', 'reactions', messageId, usernames], + async () => { + // This happens if the only reaction is from the current user + if (!usernames.length) { + return []; + } + + if (!showRealName) { + return usernames; + } + + const data = await getMessage(messageId); + + const { reactions } = data; + + if (!reactions) { + return []; + } + + if (username) { + const index = reactions[emojiName].usernames.indexOf(username); + index >= 0 && reactions[emojiName].names?.splice(index, 1); + return (reactions[emojiName].names || usernames).filter(Boolean); + } + + return reactions[emojiName].names || usernames; + }, + { staleTime: 1000 * 60 * 5 }, + ); + + if (isLoading) { + return ( + <> + + + {usernames.length > 5 && } + {usernames.length > 8 && } + + ); + } + + return ( + 10 ? usernames.length - 10 : usernames.length, + users: users?.slice(0, 10).join(', ') || '', + emoji: emojiName, + })} + variant='inline' + /> + ); +}; + +export default ReactionTooltip; diff --git a/apps/meteor/client/components/message/header/MessageAvatar.tsx b/apps/meteor/client/components/message/header/MessageAvatar.tsx deleted file mode 100644 index a0cf58be4f72..000000000000 --- a/apps/meteor/client/components/message/header/MessageAvatar.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import { AvatarContainer } from '@rocket.chat/fuselage'; -import type { VFC, CSSProperties, ComponentProps, HTMLAttributes } from 'react'; -import React from 'react'; - -import Emoji from '../../Emoji'; -import UserAvatar from '../../avatar/UserAvatar'; - -type MessageAvatarProps = { - emoji?: string; - avatarUrl?: string; - username: string; - onClick?: (e: any) => void; - size?: ComponentProps['size']; - style?: CSSProperties; -} & Omit, 'is'>; - -const MessageAvatar: VFC = ({ emoji, avatarUrl, username, size = 'x36', className, ...props }) => { - if (emoji) { - return ( - - - - ); - } - return ; -}; - -export default MessageAvatar; diff --git a/apps/meteor/client/components/message/hooks/useNormalizedMessage.ts b/apps/meteor/client/components/message/hooks/useNormalizedMessage.ts index e41bf9107722..2ade3deb4926 100644 --- a/apps/meteor/client/components/message/hooks/useNormalizedMessage.ts +++ b/apps/meteor/client/components/message/hooks/useNormalizedMessage.ts @@ -4,7 +4,7 @@ import { useSetting } from '@rocket.chat/ui-contexts'; import { useMemo } from 'react'; import type { MessageWithMdEnforced } from '../../../lib/parseMessageTextToAstMarkdown'; -import { parseMessageTextToAstMarkdown, removePossibleNullMessageValues } from '../../../lib/parseMessageTextToAstMarkdown'; +import { parseMessageTextToAstMarkdown } from '../../../lib/parseMessageTextToAstMarkdown'; import { useAutoLinkDomains } from '../../../views/room/MessageList/hooks/useAutoLinkDomains'; import { useAutoTranslate } from '../../../views/room/MessageList/hooks/useAutoTranslate'; import { useKatex } from '../../../views/room/MessageList/hooks/useKatex'; @@ -30,6 +30,6 @@ export const useNormalizedMessage = (message: TMessag }), }; - return parseMessageTextToAstMarkdown(removePossibleNullMessageValues(message), parseOptions, autoTranslateOptions); + return parseMessageTextToAstMarkdown(message, parseOptions, autoTranslateOptions); }, [showColors, customDomains, katexEnabled, katexDollarSyntaxEnabled, katexParenthesisSyntaxEnabled, message, autoTranslateOptions]); }; diff --git a/apps/meteor/client/components/message/list/MessageListContext.tsx b/apps/meteor/client/components/message/list/MessageListContext.tsx index 156679fe5463..542cca6bfc0a 100644 --- a/apps/meteor/client/components/message/list/MessageListContext.tsx +++ b/apps/meteor/client/components/message/list/MessageListContext.tsx @@ -7,7 +7,6 @@ export type MessageListContextValue = { useShowFollowing: ({ message }: { message: IMessage }) => boolean; useMessageDateFormatter: () => (date: Date) => string; useUserHasReacted: (message: IMessage) => (reaction: string) => boolean; - useReactionsFilter: (message: IMessage) => (reaction: string) => string[]; useOpenEmojiPicker: (message: IMessage) => (event: React.MouseEvent) => void; showRoles: boolean; showRealName: boolean; @@ -25,7 +24,8 @@ export type MessageListContextValue = { autoTranslateLanguage?: string; showColors: boolean; jumpToMessageParam?: string; - scrollMessageList?: (callback: (wrapper: HTMLDivElement | null) => ScrollToOptions | void) => void; + username: string | undefined; + messageListRef?: React.RefObject; }; export const MessageListContext = createContext({ @@ -38,15 +38,12 @@ export const MessageListContext = createContext({ (date: Date): string => date.toString(), useOpenEmojiPicker: () => (): void => undefined, - useReactionsFilter: - (message) => - (reaction: string): string[] => - message.reactions ? message.reactions[reaction]?.usernames || [] : [], showRoles: false, showRealName: false, showUsername: false, showColors: false, - scrollMessageList: () => undefined, + username: undefined, + messageListRef: { current: null }, }); export const useShowTranslated: MessageListContextValue['useShowTranslated'] = (...args) => @@ -63,11 +60,10 @@ export const useMessageListShowUsername = (): MessageListContextValue['showUsern export const useMessageListHighlights = (): MessageListContextValue['highlights'] => useContext(MessageListContext).highlights; export const useMessageListJumpToMessageParam = (): MessageListContextValue['jumpToMessageParam'] => useContext(MessageListContext).jumpToMessageParam; -export const useMessageListScroll = (): MessageListContextValue['scrollMessageList'] => useContext(MessageListContext).scrollMessageList; export const useUserHasReacted: MessageListContextValue['useUserHasReacted'] = (message: IMessage) => useContext(MessageListContext).useUserHasReacted(message); export const useOpenEmojiPicker: MessageListContextValue['useOpenEmojiPicker'] = (...args) => useContext(MessageListContext).useOpenEmojiPicker(...args); -export const useReactionsFilter: MessageListContextValue['useReactionsFilter'] = (message: IMessage) => - useContext(MessageListContext).useReactionsFilter(message); + +export const useMessageListRef = (): MessageListContextValue['messageListRef'] => useContext(MessageListContext).messageListRef; diff --git a/apps/meteor/client/components/message/toolbar/MessageActionMenu.tsx b/apps/meteor/client/components/message/toolbar/MessageActionMenu.tsx new file mode 100644 index 000000000000..8d266fe35d0e --- /dev/null +++ b/apps/meteor/client/components/message/toolbar/MessageActionMenu.tsx @@ -0,0 +1,62 @@ +import { useTranslation } from '@rocket.chat/ui-contexts'; +import type { MouseEvent, ReactElement } from 'react'; +import React from 'react'; + +import type { MessageActionConfig } from '../../../../app/ui-utils/client/lib/MessageAction'; +import GenericMenu from '../../GenericMenu/GenericMenu'; +import type { GenericMenuItemProps } from '../../GenericMenu/GenericMenuItem'; + +type MessageActionConfigOption = Omit & { + action: (e?: MouseEvent) => void; +}; + +type MessageActionSection = { + id: string; + title: string; + items: GenericMenuItemProps[]; +}; + +type MessageActionMenuProps = { + onChangeMenuVisibility: (visible: boolean) => void; + options: MessageActionConfigOption[]; +}; + +const MessageActionMenu = ({ options, onChangeMenuVisibility }: MessageActionMenuProps): ReactElement => { + const t = useTranslation(); + + const groupOptions = options + .map((option) => ({ + variant: option.color === 'alert' ? 'danger' : '', + id: option.id, + icon: option.icon, + content: t(option.label), + onClick: option.action, + type: option.type, + })) + .reduce((acc, option) => { + const group = option.type ? option.type : ''; + const section = acc.find((section: { id: string }) => section.id === group); + if (section) { + section.items.push(option); + return acc; + } + const newSection = { id: group, title: group === 'apps' ? t('Apps') : '', items: [option] }; + acc.push(newSection); + + return acc; + }, [] as unknown as MessageActionSection[]); + + return ( + + ); +}; + +export default MessageActionMenu; diff --git a/apps/meteor/client/components/message/toolbar/MessageToolbar.tsx b/apps/meteor/client/components/message/toolbar/MessageToolbar.tsx new file mode 100644 index 000000000000..a51ca4f3b3d4 --- /dev/null +++ b/apps/meteor/client/components/message/toolbar/MessageToolbar.tsx @@ -0,0 +1,147 @@ +import { useToolbar } from '@react-aria/toolbar'; +import type { IMessage, IRoom, ISubscription, ITranslatedMessage } from '@rocket.chat/core-typings'; +import { isThreadMessage, isRoomFederated, isVideoConfMessage } from '@rocket.chat/core-typings'; +import { MessageToolbar as FuselageMessageToolbar, MessageToolbarItem } from '@rocket.chat/fuselage'; +import { useFeaturePreview } from '@rocket.chat/ui-client'; +import { useUser, useSettings, useTranslation, useMethod, useLayoutHiddenActions } from '@rocket.chat/ui-contexts'; +import { useQuery } from '@tanstack/react-query'; +import type { ComponentProps, ReactElement } from 'react'; +import React, { memo, useMemo, useRef } from 'react'; + +import type { MessageActionContext } from '../../../../app/ui-utils/client/lib/MessageAction'; +import { MessageAction } from '../../../../app/ui-utils/client/lib/MessageAction'; +import { useEmojiPickerData } from '../../../contexts/EmojiPickerContext'; +import { useMessageActionAppsActionButtons } from '../../../hooks/useAppActionButtons'; +import { useEmbeddedLayout } from '../../../hooks/useEmbeddedLayout'; +import EmojiElement from '../../../views/composer/EmojiPicker/EmojiElement'; +import { useIsSelecting } from '../../../views/room/MessageList/contexts/SelectedMessagesContext'; +import { useAutoTranslate } from '../../../views/room/MessageList/hooks/useAutoTranslate'; +import { useChat } from '../../../views/room/contexts/ChatContext'; +import { useRoomToolbox } from '../../../views/room/contexts/RoomToolboxContext'; +import MessageActionMenu from './MessageActionMenu'; +import { useWebDAVMessageAction } from './useWebDAVMessageAction'; + +const getMessageContext = (message: IMessage, room: IRoom, context?: MessageActionContext): MessageActionContext => { + if (context) { + return context; + } + + if (isVideoConfMessage(message)) { + return 'videoconf'; + } + + if (isRoomFederated(room)) { + return 'federated'; + } + + if (isThreadMessage(message)) { + return 'threads'; + } + + return 'message'; +}; + +type MessageToolbarProps = { + message: IMessage & Partial; + messageContext?: MessageActionContext; + room: IRoom; + subscription?: ISubscription; + onChangeMenuVisibility: (visible: boolean) => void; +} & ComponentProps; + +const MessageToolbar = ({ + message, + messageContext, + room, + subscription, + onChangeMenuVisibility, + ...props +}: MessageToolbarProps): ReactElement | null => { + const t = useTranslation(); + const user = useUser() ?? undefined; + const settings = useSettings(); + const isLayoutEmbedded = useEmbeddedLayout(); + + const toolbarRef = useRef(null); + const { toolbarProps } = useToolbar(props, toolbarRef); + + const quickReactionsEnabled = useFeaturePreview('quickReactions'); + + const setReaction = useMethod('setReaction'); + + const context = getMessageContext(message, room, messageContext); + + const mapSettings = useMemo(() => Object.fromEntries(settings.map((setting) => [setting._id, setting.value])), [settings]); + + const chat = useChat(); + const { quickReactions, addRecentEmoji } = useEmojiPickerData(); + + const actionButtonApps = useMessageActionAppsActionButtons(context); + + const { messageToolbox: hiddenActions } = useLayoutHiddenActions(); + + // TODO: move this to another place + useWebDAVMessageAction(); + + const actionsQueryResult = useQuery(['rooms', room._id, 'messages', message._id, 'actions'] as const, async () => { + const props = { message, room, user, subscription, settings: mapSettings, chat }; + + const toolboxItems = await MessageAction.getAll(props, context, 'message'); + const menuItems = await MessageAction.getAll(props, context, 'menu'); + + return { + message: toolboxItems.filter((action) => !hiddenActions.includes(action.id)), + menu: menuItems.filter((action) => !(isLayoutEmbedded && action.id === 'reply-directly') && !hiddenActions.includes(action.id)), + }; + }); + + const toolbox = useRoomToolbox(); + + const selecting = useIsSelecting(); + + const autoTranslateOptions = useAutoTranslate(subscription); + + if (selecting || (!actionsQueryResult.data?.message.length && !actionsQueryResult.data?.menu.length)) { + return null; + } + + const isReactionAllowed = actionsQueryResult.data?.message.find(({ id }) => id === 'reaction-message'); + + const handleSetReaction = (emoji: string) => { + setReaction(`:${emoji}:`, message._id); + addRecentEmoji(emoji); + }; + + return ( + + {quickReactionsEnabled && + isReactionAllowed && + quickReactions.slice(0, 3).map(({ emoji, image }) => { + return handleSetReaction(emoji)} />; + })} + {actionsQueryResult.isSuccess && + actionsQueryResult.data.message.map((action) => ( + action.action(e, { message, tabbar: toolbox, room, chat, autoTranslateOptions })} + key={action.id} + icon={action.icon} + title={t(action.label)} + data-qa-id={action.label} + data-qa-type='message-action-menu' + /> + ))} + {actionsQueryResult.isSuccess && actionsQueryResult.data.menu.length > 0 && ( + ({ + ...action, + action: (e) => action.action(e, { message, tabbar: toolbox, room, chat, autoTranslateOptions }), + }))} + onChangeMenuVisibility={onChangeMenuVisibility} + data-qa-type='message-action-menu-options' + /> + )} + + ); +}; + +export default memo(MessageToolbar); diff --git a/apps/meteor/client/components/message/toolbar/useWebDAVMessageAction.tsx b/apps/meteor/client/components/message/toolbar/useWebDAVMessageAction.tsx new file mode 100644 index 000000000000..a2be70077054 --- /dev/null +++ b/apps/meteor/client/components/message/toolbar/useWebDAVMessageAction.tsx @@ -0,0 +1,44 @@ +import { useSetModal, useSetting } from '@rocket.chat/ui-contexts'; +import React, { useEffect } from 'react'; + +import { MessageAction } from '../../../../app/ui-utils/client/lib/MessageAction'; +import { getURL } from '../../../../app/utils/client'; +import { useWebDAVAccountIntegrationsQuery } from '../../../hooks/webdav/useWebDAVAccountIntegrationsQuery'; +import { messageArgs } from '../../../lib/utils/messageArgs'; +import SaveToWebdavModal from '../../../views/room/webdav/SaveToWebdavModal'; + +export const useWebDAVMessageAction = () => { + const enabled = useSetting('Webdav_Integration_Enabled', false); + + const { data } = useWebDAVAccountIntegrationsQuery({ enabled }); + + const setModal = useSetModal(); + + useEffect(() => { + if (!enabled) { + return; + } + + MessageAction.addButton({ + id: 'webdav-upload', + icon: 'upload', + label: 'Save_To_Webdav', + condition: ({ message, subscription }) => { + return !!subscription && !!data?.length && !!message.file; + }, + action(_, props) { + const { message = messageArgs(this).msg } = props; + const [attachment] = message.attachments || []; + const url = getURL(attachment.title_link as string, { full: true }); + + setModal( setModal(undefined)} />); + }, + order: 100, + group: 'menu', + }); + + return () => { + MessageAction.removeButton('webdav-upload'); + }; + }, [data?.length, enabled, setModal]); +}; diff --git a/apps/meteor/client/components/message/toolbox/DesktopToolboxDropdown.tsx b/apps/meteor/client/components/message/toolbox/DesktopToolboxDropdown.tsx deleted file mode 100644 index 0310cf44c013..000000000000 --- a/apps/meteor/client/components/message/toolbox/DesktopToolboxDropdown.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import { Tile, PositionAnimated } from '@rocket.chat/fuselage'; -import type { ReactNode, Ref, RefObject } from 'react'; -import React, { forwardRef } from 'react'; - -type DesktopToolboxDropdownProps = { - children: ReactNode; - reference: RefObject; -}; - -const DesktopToolboxDropdown = forwardRef(function ToolboxDropdownDesktop( - { reference, children }: DesktopToolboxDropdownProps, - ref: Ref, -) { - return ( - - - {children} - - - ); -}); - -export default DesktopToolboxDropdown; diff --git a/apps/meteor/client/components/message/toolbox/MessageActionMenu.tsx b/apps/meteor/client/components/message/toolbox/MessageActionMenu.tsx deleted file mode 100644 index 54a320ebf3d7..000000000000 --- a/apps/meteor/client/components/message/toolbox/MessageActionMenu.tsx +++ /dev/null @@ -1,117 +0,0 @@ -import { MessageToolboxItem, Option, OptionDivider, OptionTitle } from '@rocket.chat/fuselage'; -import { useTranslation } from '@rocket.chat/ui-contexts'; -import type { ComponentProps, MouseEvent, MouseEventHandler, ReactElement } from 'react'; -import React, { Fragment, useCallback, useRef, useState } from 'react'; - -import type { MessageActionConfig } from '../../../../app/ui-utils/client/lib/MessageAction'; -import { useEmbeddedLayout } from '../../../hooks/useEmbeddedLayout'; -import ToolboxDropdown from './ToolboxDropdown'; - -type MessageActionConfigOption = Omit & { - action: ((event: MouseEvent) => void) & MouseEventHandler; -}; - -type MessageActionMenuProps = { - onChangeMenuVisibility: (visible: boolean) => void; - options: MessageActionConfigOption[]; -}; - -const getSectionOrder = (section: string): number => { - switch (section) { - case 'communication': - return 0; - case 'interaction': - return 1; - case 'duplication': - return 2; - case 'apps': - return 3; - case 'management': - return 4; - default: - return 5; - } -}; - -const MessageActionMenu = ({ options, onChangeMenuVisibility, ...props }: MessageActionMenuProps): ReactElement => { - const buttonRef = useRef(null); - const t = useTranslation(); - const [visible, setVisible] = useState(false); - const isLayoutEmbedded = useEmbeddedLayout(); - - const handleChangeMenuVisibility = useCallback( - (visible: boolean): void => { - setVisible(visible); - onChangeMenuVisibility(visible); - }, - [onChangeMenuVisibility], - ); - - const groupOptions = options.reduce((acc, option) => { - const { type = '' } = option; - - if (option.color === 'alert') { - option.variant = 'danger' as const; - } - - const order = getSectionOrder(type); - - const [sectionType, options] = acc[getSectionOrder(type)] ?? [type, []]; - - if (!(isLayoutEmbedded && option.id === 'reply-directly')) { - options.push(option); - } - - if (options.length === 0) { - return acc; - } - - acc[order] = [sectionType, options]; - - return acc; - }, [] as unknown as [section: string, options: Array][]); - - const handleClose = useCallback(() => { - handleChangeMenuVisibility(false); - }, [handleChangeMenuVisibility]); - return ( - <> - handleChangeMenuVisibility(!visible)} - data-qa-id='menu' - data-qa-type='message-action-menu' - title={t('More')} - /> - {visible && ( - <> - - {groupOptions.map(([section, options], index, arr) => ( - - {section === 'apps' && Apps} - {options.map((option) => ( - - ))} - - - )} - - ); -}; - -export default MessageActionMenu; diff --git a/apps/meteor/client/components/message/toolbox/MessageToolbox.tsx b/apps/meteor/client/components/message/toolbox/MessageToolbox.tsx deleted file mode 100644 index 3b9cdd84c25d..000000000000 --- a/apps/meteor/client/components/message/toolbox/MessageToolbox.tsx +++ /dev/null @@ -1,131 +0,0 @@ -import type { IMessage, IRoom, ISubscription, ITranslatedMessage } from '@rocket.chat/core-typings'; -import { isThreadMessage, isRoomFederated, isVideoConfMessage } from '@rocket.chat/core-typings'; -import { MessageToolbox as FuselageMessageToolbox, MessageToolboxItem } from '@rocket.chat/fuselage'; -import { useFeaturePreview } from '@rocket.chat/ui-client'; -import { useUser, useSettings, useTranslation, useMethod } from '@rocket.chat/ui-contexts'; -import { useQuery } from '@tanstack/react-query'; -import type { ReactElement } from 'react'; -import React, { memo, useMemo } from 'react'; - -import type { MessageActionContext } from '../../../../app/ui-utils/client/lib/MessageAction'; -import { MessageAction } from '../../../../app/ui-utils/client/lib/MessageAction'; -import { useEmojiPickerData } from '../../../contexts/EmojiPickerContext'; -import { useMessageActionAppsActionButtons } from '../../../hooks/useAppActionButtons'; -import EmojiElement from '../../../views/composer/EmojiPicker/EmojiElement'; -import { useIsSelecting } from '../../../views/room/MessageList/contexts/SelectedMessagesContext'; -import { useAutoTranslate } from '../../../views/room/MessageList/hooks/useAutoTranslate'; -import { useChat } from '../../../views/room/contexts/ChatContext'; -import { useRoomToolbox } from '../../../views/room/contexts/RoomToolboxContext'; -import MessageActionMenu from './MessageActionMenu'; - -const getMessageContext = (message: IMessage, room: IRoom, context?: MessageActionContext): MessageActionContext => { - if (context) { - return context; - } - - if (isVideoConfMessage(message)) { - return 'videoconf'; - } - - if (isRoomFederated(room)) { - return 'federated'; - } - - if (isThreadMessage(message)) { - return 'threads'; - } - - return 'message'; -}; - -type MessageToolboxProps = { - message: IMessage & Partial; - messageContext?: MessageActionContext; - room: IRoom; - subscription?: ISubscription; - onChangeMenuVisibility: (visible: boolean) => void; -}; - -const MessageToolbox = ({ - message, - messageContext, - room, - subscription, - onChangeMenuVisibility, -}: MessageToolboxProps): ReactElement | null => { - const t = useTranslation(); - const user = useUser() ?? undefined; - const settings = useSettings(); - - const quickReactionsEnabled = useFeaturePreview('quickReactions'); - - const setReaction = useMethod('setReaction'); - - const context = getMessageContext(message, room, messageContext); - - const mapSettings = useMemo(() => Object.fromEntries(settings.map((setting) => [setting._id, setting.value])), [settings]); - - const chat = useChat(); - const { quickReactions, addRecentEmoji } = useEmojiPickerData(); - - const actionButtonApps = useMessageActionAppsActionButtons(context); - - const actionsQueryResult = useQuery(['rooms', room._id, 'messages', message._id, 'actions'] as const, async () => { - const props = { message, room, user, subscription, settings: mapSettings, chat }; - - const toolboxItems = await MessageAction.getAll(props, context, 'message'); - const menuItems = await MessageAction.getAll(props, context, 'menu'); - - return { message: toolboxItems, menu: menuItems }; - }); - - const toolbox = useRoomToolbox(); - - const selecting = useIsSelecting(); - - const autoTranslateOptions = useAutoTranslate(subscription); - - if (selecting) { - return null; - } - - const isReactionAllowed = actionsQueryResult.data?.message.find(({ id }) => id === 'reaction-message'); - - const handleSetReaction = (emoji: string) => { - setReaction(`:${emoji}:`, message._id); - addRecentEmoji(emoji); - }; - - return ( - - {quickReactionsEnabled && - isReactionAllowed && - quickReactions.slice(0, 3).map(({ emoji, image }) => { - return handleSetReaction(emoji)} />; - })} - {actionsQueryResult.isSuccess && - actionsQueryResult.data.message.map((action) => ( - action.action(e, { message, tabbar: toolbox, room, chat, autoTranslateOptions })} - key={action.id} - icon={action.icon} - title={t(action.label)} - data-qa-id={action.label} - data-qa-type='message-action-menu' - /> - ))} - {actionsQueryResult.isSuccess && actionsQueryResult.data.menu.length > 0 && ( - ({ - ...action, - action: (e): void => action.action(e, { message, tabbar: toolbox, room, chat, autoTranslateOptions }), - }))} - data-qa-type='message-action-menu-options' - /> - )} - - ); -}; - -export default memo(MessageToolbox); diff --git a/apps/meteor/client/components/message/toolbox/MobileToolboxDropdown.tsx b/apps/meteor/client/components/message/toolbox/MobileToolboxDropdown.tsx deleted file mode 100644 index d97d1ff46aee..000000000000 --- a/apps/meteor/client/components/message/toolbox/MobileToolboxDropdown.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import { Tile } from '@rocket.chat/fuselage'; -import type { ReactNode, Ref } from 'react'; -import React, { forwardRef } from 'react'; - -import ScrollableContentWrapper from '../../ScrollableContentWrapper'; - -type MobileToolboxDropdownProps = { - children: ReactNode; -}; - -const MobileToolboxDropdown = forwardRef(function MobileToolboxDropdown( - { children, ...props }: MobileToolboxDropdownProps, - ref: Ref, -) { - return ( - - {children} - - ); -}); - -export default MobileToolboxDropdown; diff --git a/apps/meteor/client/components/message/toolbox/ToolboxDropdown.tsx b/apps/meteor/client/components/message/toolbox/ToolboxDropdown.tsx deleted file mode 100644 index eee619454f77..000000000000 --- a/apps/meteor/client/components/message/toolbox/ToolboxDropdown.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import { Box } from '@rocket.chat/fuselage'; -import { useOutsideClick } from '@rocket.chat/fuselage-hooks'; -import { useLayout } from '@rocket.chat/ui-contexts'; -import type { ReactNode, ReactElement } from 'react'; -import React, { useRef } from 'react'; - -import DesktopToolboxDropdown from './DesktopToolboxDropdown'; -import MobileToolboxDropdown from './MobileToolboxDropdown'; - -type ToolboxDropdownProps = { - children: ReactNode; - reference: React.RefObject; - handleClose: () => void; -}; - -const ToolboxDropdown = ({ - children, - handleClose, - reference, -}: ToolboxDropdownProps): ReactElement => { - const { isMobile } = useLayout(); - const target = useRef(null); - const boxRef = useRef(null); - - const Dropdown = isMobile ? MobileToolboxDropdown : DesktopToolboxDropdown; - - useOutsideClick([boxRef], handleClose); - - return ( - - - {children} - - - ); -}; - -export default ToolboxDropdown; diff --git a/apps/meteor/client/components/message/uikit/UiKitMessageBlock.tsx b/apps/meteor/client/components/message/uikit/UiKitMessageBlock.tsx index d59314ae8198..dbdd8f4e731b 100644 --- a/apps/meteor/client/components/message/uikit/UiKitMessageBlock.tsx +++ b/apps/meteor/client/components/message/uikit/UiKitMessageBlock.tsx @@ -1,104 +1,24 @@ -import { UIKitIncomingInteractionContainerType } from '@rocket.chat/apps-engine/definition/uikit/UIKitIncomingInteractionContainer'; import type { IMessage, IRoom } from '@rocket.chat/core-typings'; import { MessageBlock } from '@rocket.chat/fuselage'; -import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; import { UiKitComponent, UiKitMessage as UiKitMessageSurfaceRender, UiKitContext } from '@rocket.chat/fuselage-ui-kit'; import type { MessageSurfaceLayout } from '@rocket.chat/ui-kit'; -import type { ContextType, ReactElement } from 'react'; import React from 'react'; -import { - useVideoConfDispatchOutgoing, - useVideoConfIsCalling, - useVideoConfIsRinging, - useVideoConfJoinCall, - useVideoConfManager, - useVideoConfSetPreferences, -} from '../../../contexts/VideoConfContext'; -import { useUiKitActionManager } from '../../../hooks/useUiKitActionManager'; -import { useVideoConfWarning } from '../../../views/room/contextualBar/VideoConference/hooks/useVideoConfWarning'; +import { useMessageBlockContextValue } from '../../../uikit/hooks/useMessageBlockContextValue'; import GazzodownText from '../../GazzodownText'; -let patched = false; -const patchMessageParser = () => { - if (patched) { - return; - } - - patched = true; -}; - type UiKitMessageBlockProps = { + rid: IRoom['_id']; mid: IMessage['_id']; blocks: MessageSurfaceLayout; - rid: IRoom['_id']; - appId?: string | boolean; // TODO: this is a hack while the context value is not properly typed }; -const UiKitMessageBlock = ({ mid: _mid, blocks, rid, appId }: UiKitMessageBlockProps): ReactElement => { - const joinCall = useVideoConfJoinCall(); - const setPreferences = useVideoConfSetPreferences(); - const isCalling = useVideoConfIsCalling(); - const isRinging = useVideoConfIsRinging(); - const dispatchWarning = useVideoConfWarning(); - const dispatchPopup = useVideoConfDispatchOutgoing(); - - const videoConfManager = useVideoConfManager(); - - const handleOpenVideoConf = useMutableCallback(async (rid: IRoom['_id']) => { - if (isCalling || isRinging) { - return; - } - - try { - await videoConfManager?.loadCapabilities(); - dispatchPopup({ rid }); - } catch (error: any) { - dispatchWarning(error.error); - } - }); - - const actionManager = useUiKitActionManager(); - - // TODO: this structure is attrociously wrong; we should revisit this - const context: ContextType = { - // @ts-ignore Property 'mid' does not exist on type 'ActionParams'. - action: ({ actionId, value, blockId, mid = _mid, appId }, event) => { - if (appId === 'videoconf-core') { - event.preventDefault(); - setPreferences({ mic: true, cam: false }); - if (actionId === 'join') { - return joinCall(blockId); - } - - if (actionId === 'callBack') { - return handleOpenVideoConf(blockId); - } - } - - actionManager?.triggerBlockAction({ - blockId, - actionId, - value, - mid, - rid, - appId, - container: { - type: UIKitIncomingInteractionContainerType.MESSAGE, - id: mid, - }, - }); - }, - // @ts-ignore Type 'string | boolean | undefined' is not assignable to type 'string'. - appId, - rid, - }; - - patchMessageParser(); // TODO: this is a hack +const UiKitMessageBlock = ({ rid, mid, blocks }: UiKitMessageBlockProps) => { + const contextValue = useMessageBlockContextValue(rid, mid); return ( - + diff --git a/apps/meteor/client/components/message/variants/RoomMessage.tsx b/apps/meteor/client/components/message/variants/RoomMessage.tsx index 2e82753051ae..c17eb89c4596 100644 --- a/apps/meteor/client/components/message/variants/RoomMessage.tsx +++ b/apps/meteor/client/components/message/variants/RoomMessage.tsx @@ -1,9 +1,10 @@ import type { IMessage } from '@rocket.chat/core-typings'; import { Message, MessageLeftContainer, MessageContainer, CheckBox } from '@rocket.chat/fuselage'; import { useToggle } from '@rocket.chat/fuselage-hooks'; +import { MessageAvatar } from '@rocket.chat/ui-avatar'; import { useUserId } from '@rocket.chat/ui-contexts'; -import type { ReactElement } from 'react'; -import React, { useRef, memo } from 'react'; +import type { ComponentProps, ReactElement } from 'react'; +import React, { memo } from 'react'; import type { MessageActionContext } from '../../../../app/ui-utils/client/lib/MessageAction'; import { useIsMessageHighlight } from '../../../views/room/MessageList/contexts/MessageHighlightContext'; @@ -14,12 +15,12 @@ import { useCountSelected, } from '../../../views/room/MessageList/contexts/SelectedMessagesContext'; import { useJumpToMessage } from '../../../views/room/MessageList/hooks/useJumpToMessage'; -import { useChat } from '../../../views/room/contexts/ChatContext'; +import { useUserCard } from '../../../views/room/contexts/UserCardContext'; +import Emoji from '../../Emoji'; import IgnoredContent from '../IgnoredContent'; import MessageHeader from '../MessageHeader'; -import MessageToolboxHolder from '../MessageToolboxHolder'; +import MessageToolbarHolder from '../MessageToolbarHolder'; import StatusIndicators from '../StatusIndicators'; -import MessageAvatar from '../header/MessageAvatar'; import RoomMessageContent from './room/RoomMessageContent'; type RoomMessageProps = { @@ -32,7 +33,7 @@ type RoomMessageProps = { context?: MessageActionContext; ignoredUser?: boolean; searchText?: string; -}; +} & ComponentProps; const RoomMessage = ({ message, @@ -44,13 +45,13 @@ const RoomMessage = ({ context, ignoredUser, searchText, + ...props }: RoomMessageProps): ReactElement => { const uid = useUserId(); const editing = useIsMessageHighlight(message._id); const [displayIgnoredMessage, toggleDisplayIgnoredMessage] = useToggle(false); const ignored = (ignoredUser || message.ignored) && !displayIgnoredMessage; - const chat = useChat(); - const messageRef = useRef(null); + const { openUserCard, triggerProps } = useUserCard(); const selecting = useIsSelecting(); const toggleSelected = useToggleSelect(message._id); @@ -58,11 +59,14 @@ const RoomMessage = ({ useCountSelected(); - useJumpToMessage(message._id, messageRef); + const messageRef = useJumpToMessage(message._id); + return ( {!sequential && message.u.username && !selecting && showUserAvatar && ( : undefined} avatarUrl={message.avatar} username={message.u.username} size='x36' - {...(chat?.userCard && { - onClick: chat?.userCard.open(message.u.username), - style: { cursor: 'pointer' }, - })} + onClick={(e) => openUserCard(e, message.u.username)} + style={{ cursor: 'pointer' }} + role='button' + {...triggerProps} /> )} {selecting && } {sequential && } - {!sequential && } - {ignored ? ( ) : ( )} - {!message.private && } + {!message.private && } ); }; diff --git a/apps/meteor/client/components/message/variants/SystemMessage.tsx b/apps/meteor/client/components/message/variants/SystemMessage.tsx index bef39112bb11..9b1a82a156eb 100644 --- a/apps/meteor/client/components/message/variants/SystemMessage.tsx +++ b/apps/meteor/client/components/message/variants/SystemMessage.tsx @@ -11,9 +11,10 @@ import { MessageUsername, MessageNameContainer, } from '@rocket.chat/fuselage'; +import { UserAvatar } from '@rocket.chat/ui-avatar'; import type { TranslationKey } from '@rocket.chat/ui-contexts'; import { useTranslation } from '@rocket.chat/ui-contexts'; -import type { ReactElement } from 'react'; +import type { ComponentProps, ReactElement, KeyboardEvent } from 'react'; import React, { memo } from 'react'; import { MessageTypes } from '../../../../app/ui-utils/client'; @@ -28,8 +29,7 @@ import { useIsSelectedMessage, useCountSelected, } from '../../../views/room/MessageList/contexts/SelectedMessagesContext'; -import { useChat } from '../../../views/room/contexts/ChatContext'; -import UserAvatar from '../../avatar/UserAvatar'; +import { useUserCard } from '../../../views/room/contexts/UserCardContext'; import Attachments from '../content/Attachments'; import MessageActions from '../content/MessageActions'; import { useMessageListShowRealName, useMessageListShowUsername } from '../list/MessageListContext'; @@ -37,13 +37,13 @@ import { useMessageListShowRealName, useMessageListShowUsername } from '../list/ type SystemMessageProps = { message: IMessage; showUserAvatar: boolean; -}; +} & ComponentProps; -const SystemMessage = ({ message, showUserAvatar }: SystemMessageProps): ReactElement => { +const SystemMessage = ({ message, showUserAvatar, ...props }: SystemMessageProps): ReactElement => { const t = useTranslation(); const formatTime = useFormatTime(); const formatDateAndTime = useFormatDateAndTime(); - const chat = useChat(); + const { triggerProps, openUserCard } = useUserCard(); const showRealName = useMessageListShowRealName(); const user: UserPresence = { ...message.u, roles: [], ...useUserData(message.u._id) }; @@ -59,11 +59,14 @@ const SystemMessage = ({ message, showUserAvatar }: SystemMessageProps): ReactEl return ( {!isSelecting && showUserAvatar && } @@ -71,29 +74,21 @@ const SystemMessage = ({ message, showUserAvatar }: SystemMessageProps): ReactEl - - - {getUserDisplayName(user.name, user.username, showRealName)} - + user.username && openUserCard(e, user.username)} + onKeyDown={(e: KeyboardEvent) => { + (e.code === 'Enter' || e.code === 'Space') && openUserCard(e, message.u.username); + }} + style={{ cursor: 'pointer' }} + {...triggerProps} + > + {getUserDisplayName(user.name, user.username, showRealName)} {showUsername && ( <> {' '} - - @{user.username} - + @{user.username} )} diff --git a/apps/meteor/client/components/message/variants/ThreadMessage.tsx b/apps/meteor/client/components/message/variants/ThreadMessage.tsx index bc39de79e48d..89f9772b1c5d 100644 --- a/apps/meteor/client/components/message/variants/ThreadMessage.tsx +++ b/apps/meteor/client/components/message/variants/ThreadMessage.tsx @@ -1,19 +1,20 @@ import { type IThreadMessage, type IThreadMainMessage, isVideoConfMessage } from '@rocket.chat/core-typings'; import { Message, MessageLeftContainer, MessageContainer } from '@rocket.chat/fuselage'; import { useToggle } from '@rocket.chat/fuselage-hooks'; +import { MessageAvatar } from '@rocket.chat/ui-avatar'; import { useUserId } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; -import React, { memo, useRef } from 'react'; +import React, { memo } from 'react'; import type { MessageActionContext } from '../../../../app/ui-utils/client/lib/MessageAction'; import { useIsMessageHighlight } from '../../../views/room/MessageList/contexts/MessageHighlightContext'; import { useJumpToMessage } from '../../../views/room/MessageList/hooks/useJumpToMessage'; -import { useChat } from '../../../views/room/contexts/ChatContext'; +import { useUserCard } from '../../../views/room/contexts/UserCardContext'; +import Emoji from '../../Emoji'; import IgnoredContent from '../IgnoredContent'; import MessageHeader from '../MessageHeader'; -import MessageToolboxHolder from '../MessageToolboxHolder'; +import MessageToolbarHolder from '../MessageToolbarHolder'; import StatusIndicators from '../StatusIndicators'; -import MessageAvatar from '../header/MessageAvatar'; import ThreadMessageContent from './thread/ThreadMessageContent'; type ThreadMessageProps = { @@ -27,17 +28,17 @@ const ThreadMessage = ({ message, sequential, unread, showUserAvatar }: ThreadMe const uid = useUserId(); const editing = useIsMessageHighlight(message._id); const [ignored, toggleIgnoring] = useToggle((message as { ignored?: boolean }).ignored); - const chat = useChat(); - - const messageRef = useRef(null); + const { openUserCard, triggerProps } = useUserCard(); // Checks if is videoconf message to limit toolbox actions const messageContext: MessageActionContext = isVideoConfMessage(message) ? 'videoconf-threads' : 'threads'; - useJumpToMessage(message._id, messageRef); + const messageRef = useJumpToMessage(message._id); return ( {!sequential && message.u.username && showUserAvatar && ( : undefined} avatarUrl={message.avatar} username={message.u.username} size='x36' - {...(chat?.userCard && { - onClick: chat?.userCard.open(message.u.username), - style: { cursor: 'pointer' }, - })} + onClick={(e) => openUserCard(e, message.u.username)} + style={{ cursor: 'pointer' }} + role='button' + {...triggerProps} /> )} {sequential && } @@ -72,7 +73,7 @@ const ThreadMessage = ({ message, sequential, unread, showUserAvatar }: ThreadMe {ignored ? : } - {!message.private && } + {!message.private && } ); }; diff --git a/apps/meteor/client/components/message/variants/ThreadMessagePreview.tsx b/apps/meteor/client/components/message/variants/ThreadMessagePreview.tsx index eb6fe03d9d0f..dcd9c673d40a 100644 --- a/apps/meteor/client/components/message/variants/ThreadMessagePreview.tsx +++ b/apps/meteor/client/components/message/variants/ThreadMessagePreview.tsx @@ -12,8 +12,9 @@ import { CheckBox, MessageStatusIndicatorItem, } from '@rocket.chat/fuselage'; +import { MessageAvatar } from '@rocket.chat/ui-avatar'; import { useTranslation } from '@rocket.chat/ui-contexts'; -import type { ReactElement } from 'react'; +import type { ComponentProps, ReactElement } from 'react'; import React, { memo } from 'react'; import { MessageTypes } from '../../../../app/ui-utils/client'; @@ -27,7 +28,7 @@ import { useMessageBody } from '../../../views/room/MessageList/hooks/useMessage import { useParentMessage } from '../../../views/room/MessageList/hooks/useParentMessage'; import { isParsedMessage } from '../../../views/room/MessageList/lib/isParsedMessage'; import { useGoToThread } from '../../../views/room/hooks/useGoToThread'; -import MessageAvatar from '../header/MessageAvatar'; +import Emoji from '../../Emoji'; import { useShowTranslated } from '../list/MessageListContext'; import ThreadMessagePreviewBody from './threadPreview/ThreadMessagePreviewBody'; @@ -35,7 +36,7 @@ type ThreadMessagePreviewProps = { message: IThreadMessage; showUserAvatar: boolean; sequential: boolean; -}; +} & ComponentProps; const ThreadMessagePreview = ({ message, showUserAvatar, sequential, ...props }: ThreadMessagePreviewProps): ReactElement => { const parentMessage = useParentMessage(message.tmid); @@ -55,23 +56,30 @@ const ThreadMessagePreview = ({ message, showUserAvatar, sequential, ...props }: const goToThread = useGoToThread(); + const handleThreadClick = () => { + if (!isSelecting) { + if (!sequential) { + return parentMessage.isSuccess && goToThread({ rid: message.rid, tmid: message.tmid, msg: parentMessage.data?._id }); + } + + return goToThread({ rid: message.rid, tmid: message.tmid, msg: message._id }); + } + + return toggleSelected(); + }; + return ( e.code === 'Enter' && handleThreadClick()} isSelected={isSelected} data-qa-selected={isSelected} role='link' + {...props} > {!sequential && ( - goToThread({ rid: message.rid, tmid: message.tmid, msg: parentMessage.data?._id }) - : undefined - } - > + @@ -99,9 +107,15 @@ const ThreadMessagePreview = ({ message, showUserAvatar, sequential, ...props }: )} - goToThread({ rid: message.rid, tmid: message.tmid, msg: message._id }) : undefined}> + - {!isSelecting && showUserAvatar && } + {!isSelecting && showUserAvatar && ( + : undefined} + username={message.u.username} + size='x18' + /> + )} {isSelecting && } diff --git a/apps/meteor/client/components/message/variants/room/RoomMessageContent.tsx b/apps/meteor/client/components/message/variants/room/RoomMessageContent.tsx index 2b54588c6263..7f4cf6694b7a 100644 --- a/apps/meteor/client/components/message/variants/room/RoomMessageContent.tsx +++ b/apps/meteor/client/components/message/variants/room/RoomMessageContent.tsx @@ -61,10 +61,10 @@ const RoomMessageContent = ({ message, unread, all, mention, searchText }: RoomM )} {normalizedMessage.blocks && ( - + )} - {!!normalizedMessage?.attachments?.length && } + {!!normalizedMessage?.attachments?.length && } {oembedEnabled && !!normalizedMessage.urls?.length && } diff --git a/apps/meteor/client/components/message/variants/thread/ThreadMessageContent.tsx b/apps/meteor/client/components/message/variants/thread/ThreadMessageContent.tsx index 655f96639929..8616f1223812 100644 --- a/apps/meteor/client/components/message/variants/thread/ThreadMessageContent.tsx +++ b/apps/meteor/client/components/message/variants/thread/ThreadMessageContent.tsx @@ -49,10 +49,10 @@ const ThreadMessageContent = ({ message }: ThreadMessageContentProps): ReactElem )} {normalizedMessage.blocks && ( - + )} - {normalizedMessage.attachments && } + {normalizedMessage.attachments && } {oembedEnabled && !!normalizedMessage.urls?.length && } diff --git a/apps/meteor/client/components/modal/ModalPortal.tsx b/apps/meteor/client/components/modal/ModalPortal.tsx deleted file mode 100644 index 2b2b198462f5..000000000000 --- a/apps/meteor/client/components/modal/ModalPortal.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import type { ReactElement, ReactNode } from 'react'; -import { memo, useEffect, useState } from 'react'; -import { createPortal } from 'react-dom'; - -import { createAnchor } from '../../lib/utils/createAnchor'; -import { deleteAnchor } from '../../lib/utils/deleteAnchor'; - -type ModalPortalProps = { - children?: ReactNode; -}; - -/** - * @todo: move to portals folder - */ -const ModalPortal = ({ children }: ModalPortalProps): ReactElement => { - const [modalRoot] = useState(() => createAnchor('modal-root')); - useEffect(() => (): void => deleteAnchor(modalRoot), [modalRoot]); - return createPortal(children, modalRoot); -}; - -export default memo(ModalPortal); diff --git a/apps/meteor/client/components/voip/room/VoipRoomForeword.tsx b/apps/meteor/client/components/voip/room/VoipRoomForeword.tsx index 983c5cdc2c4a..615fee8714aa 100644 --- a/apps/meteor/client/components/voip/room/VoipRoomForeword.tsx +++ b/apps/meteor/client/components/voip/room/VoipRoomForeword.tsx @@ -5,7 +5,7 @@ import type { ReactElement } from 'react'; import React from 'react'; import { getUserAvatarURL } from '../../../../app/utils/client'; -import { parseOutboundPhoneNumber } from '../../../../ee/client/lib/voip/parseOutboundPhoneNumber'; +import { parseOutboundPhoneNumber } from '../../../lib/voip/parseOutboundPhoneNumber'; export const VoipRoomForeword = ({ room }: { room: IVoipRoom }): ReactElement => { const t = useTranslation(); diff --git a/apps/meteor/client/contexts/AppsContext.tsx b/apps/meteor/client/contexts/AppsContext.tsx index 769609c733b0..b1732b6444b4 100644 --- a/apps/meteor/client/contexts/AppsContext.tsx +++ b/apps/meteor/client/contexts/AppsContext.tsx @@ -5,9 +5,9 @@ import { AsyncStatePhase } from '../lib/asyncState'; import type { App } from '../views/marketplace/types'; export type AppsContextValue = { - installedApps: AsyncState<{ apps: App[] }>; - marketplaceApps: AsyncState<{ apps: App[] }>; - privateApps: AsyncState<{ apps: App[] }>; + installedApps: Omit, 'error'>; + marketplaceApps: Omit, 'error'>; + privateApps: Omit, 'error'>; reload: () => Promise; }; @@ -15,17 +15,14 @@ export const AppsContext = createContext({ installedApps: { phase: AsyncStatePhase.LOADING, value: undefined, - error: undefined, }, marketplaceApps: { phase: AsyncStatePhase.LOADING, value: undefined, - error: undefined, }, privateApps: { phase: AsyncStatePhase.LOADING, value: undefined, - error: undefined, }, reload: () => Promise.resolve(), }); diff --git a/apps/meteor/client/contexts/ImageGalleryContext.ts b/apps/meteor/client/contexts/ImageGalleryContext.ts new file mode 100644 index 000000000000..2fea5e46a40f --- /dev/null +++ b/apps/meteor/client/contexts/ImageGalleryContext.ts @@ -0,0 +1,13 @@ +import { createContext } from 'react'; + +export type ImageGalleryContextValue = { + imageId: string; + isOpen: boolean; + onClose: () => void; +}; + +export const ImageGalleryContext = createContext({ + imageId: '', + isOpen: false, + onClose: () => undefined, +}); diff --git a/apps/meteor/client/contexts/OmnichannelContext.ts b/apps/meteor/client/contexts/OmnichannelContext.ts index dc3bf7fdceb4..9a2c0c1ea206 100644 --- a/apps/meteor/client/contexts/OmnichannelContext.ts +++ b/apps/meteor/client/contexts/OmnichannelContext.ts @@ -8,6 +8,7 @@ export type OmnichannelContextValue = { agentAvailable: boolean; routeConfig?: OmichannelRoutingConfig; showOmnichannelQueueLink: boolean; + isOverMacLimit: boolean; livechatPriorities: { data: Serialized[]; isLoading: boolean; @@ -22,6 +23,7 @@ export const OmnichannelContext = createContext({ isEnterprise: false, agentAvailable: false, showOmnichannelQueueLink: false, + isOverMacLimit: false, livechatPriorities: { data: [], isLoading: false, diff --git a/apps/meteor/client/definitions/IOAuthProvider.ts b/apps/meteor/client/definitions/IOAuthProvider.ts new file mode 100644 index 000000000000..00bc3be2b040 --- /dev/null +++ b/apps/meteor/client/definitions/IOAuthProvider.ts @@ -0,0 +1,9 @@ +import type { Meteor } from 'meteor/meteor'; + +export interface IOAuthProvider { + readonly name: string; + requestCredential( + options: Meteor.LoginWithExternalServiceOptions | undefined, + credentialRequestCompleteCallback: (credentialTokenOrError?: string | Error) => void, + ): void; +} diff --git a/apps/meteor/client/definitions/IRocketChatDesktop.ts b/apps/meteor/client/definitions/IRocketChatDesktop.ts new file mode 100644 index 000000000000..52bc172d719b --- /dev/null +++ b/apps/meteor/client/definitions/IRocketChatDesktop.ts @@ -0,0 +1,10 @@ +type OutlookEventsResponse = { status: 'success' | 'canceled' }; + +export interface IRocketChatDesktop { + openInternalVideoChatWindow?: (url: string, options: { providerName: string | undefined }) => void; + getOutlookEvents?: (date: Date) => Promise; + setOutlookExchangeUrl?: (url: string, userId: string) => Promise; + hasOutlookCredentials?: () => Promise; + clearOutlookCredentials?: () => void; + openDocumentViewer?: (url: string, format: string, options: any) => void; +} diff --git a/apps/meteor/client/definitions/global.d.ts b/apps/meteor/client/definitions/global.d.ts new file mode 100644 index 000000000000..8b20108e8e48 --- /dev/null +++ b/apps/meteor/client/definitions/global.d.ts @@ -0,0 +1,8 @@ +import type { IRocketChatDesktop } from './IRocketChatDesktop'; + +declare global { + // eslint-disable-next-line @typescript-eslint/naming-convention + interface Window { + RocketChatDesktop?: IRocketChatDesktop; + } +} diff --git a/apps/meteor/client/definitions/info.d.ts b/apps/meteor/client/definitions/info.d.ts index 43fa1fc53414..4db548297770 100644 --- a/apps/meteor/client/definitions/info.d.ts +++ b/apps/meteor/client/definitions/info.d.ts @@ -28,4 +28,8 @@ declare module '*.info' { desktop: string; mobile: string; }; + + import type { SignedSupportedVersions } from '@rocket.chat/server-cloud-communication'; + + export const supportedVersions: SignedSupportedVersions; } diff --git a/apps/meteor/client/hooks/lists/useStreamUpdatesForMessageList.ts b/apps/meteor/client/hooks/lists/useStreamUpdatesForMessageList.ts index c9e287d573d2..a28c4424d313 100644 --- a/apps/meteor/client/hooks/lists/useStreamUpdatesForMessageList.ts +++ b/apps/meteor/client/hooks/lists/useStreamUpdatesForMessageList.ts @@ -12,10 +12,18 @@ type NotifyRoomRidDeleteMessageBulkEvent = { ignoreDiscussion: boolean; ts: FieldExpression; users: string[]; + ids?: string[]; // message ids have priority over ts + showDeletedStatus?: boolean; }; const createDeleteCriteria = (params: NotifyRoomRidDeleteMessageBulkEvent): ((message: IMessage) => boolean) => { - const query: Query = { ts: params.ts }; + const query: Query = {}; + + if (params.ids) { + query._id = { $in: params.ids }; + } else { + query.ts = params.ts; + } if (params.excludePinned) { query.pinned = { $ne: true }; diff --git a/apps/meteor/client/hooks/omnichannel/useIsOverMacLimit.tsx b/apps/meteor/client/hooks/omnichannel/useIsOverMacLimit.tsx new file mode 100644 index 000000000000..e6ced140e1b5 --- /dev/null +++ b/apps/meteor/client/hooks/omnichannel/useIsOverMacLimit.tsx @@ -0,0 +1,6 @@ +import { useOmnichannel } from './useOmnichannel'; + +export const useIsOverMacLimit = (): boolean => { + const { isOverMacLimit } = useOmnichannel(); + return isOverMacLimit; +}; diff --git a/apps/meteor/client/hooks/omnichannel/useIsRoomOverMacLimit.tsx b/apps/meteor/client/hooks/omnichannel/useIsRoomOverMacLimit.tsx new file mode 100644 index 000000000000..bf4e4b1bf957 --- /dev/null +++ b/apps/meteor/client/hooks/omnichannel/useIsRoomOverMacLimit.tsx @@ -0,0 +1,23 @@ +import type { IRoom } from '@rocket.chat/core-typings'; +import { isOmnichannelRoom, type IOmnichannelGenericRoom, isVoipRoom } from '@rocket.chat/core-typings'; + +import { useIsOverMacLimit } from './useIsOverMacLimit'; + +const getPeriod = (date: Date) => `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}`; + +export const useIsRoomOverMacLimit = (room: IRoom) => { + const isOverMacLimit = useIsOverMacLimit(); + + if (!isOmnichannelRoom(room) && !isVoipRoom(room)) { + return false; + } + + if (room.closedAt) { + return false; + } + + const { v: { activity = [] } = {} } = room as IOmnichannelGenericRoom; + + const currentPeriod = getPeriod(new Date()); + return isOverMacLimit && !activity.includes(currentPeriod); +}; diff --git a/apps/meteor/client/hooks/omnichannel/useOmnichannelCloseRoute.ts b/apps/meteor/client/hooks/omnichannel/useOmnichannelCloseRoute.ts new file mode 100644 index 000000000000..746a62bd87e6 --- /dev/null +++ b/apps/meteor/client/hooks/omnichannel/useOmnichannelCloseRoute.ts @@ -0,0 +1,23 @@ +import { useRouter, useUserPreference } from '@rocket.chat/ui-contexts'; +import { useCallback } from 'react'; + +export const useOmnichannelCloseRoute = () => { + const hideConversationAfterClosing = useUserPreference('omnichannelHideConversationAfterClosing') ?? true; + const router = useRouter(); + + const navigateHome = useCallback(() => { + if (!hideConversationAfterClosing) { + return; + } + + const routeName = router.getRouteName(); + + if (routeName === 'omnichannel-current-chats') { + router.navigate({ name: 'omnichannel-current-chats' }); + } else { + router.navigate({ name: 'home' }); + } + }, [hideConversationAfterClosing, router]); + + return { navigateHome }; +}; diff --git a/apps/meteor/client/hooks/roomActions/useOTRRoomAction.ts b/apps/meteor/client/hooks/roomActions/useOTRRoomAction.ts index b199631aa7d5..1a50283c7475 100644 --- a/apps/meteor/client/hooks/roomActions/useOTRRoomAction.ts +++ b/apps/meteor/client/hooks/roomActions/useOTRRoomAction.ts @@ -1,9 +1,8 @@ import { isRoomFederated } from '@rocket.chat/core-typings'; import { useSetting } from '@rocket.chat/ui-contexts'; -import { lazy, useEffect, useMemo } from 'react'; +import { lazy, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; -import otr from '../../../app/otr/client/OTR'; import { useRoom } from '../../views/room/contexts/RoomContext'; import type { RoomToolboxActionConfig } from '../../views/room/contexts/RoomToolboxContext'; @@ -16,10 +15,6 @@ export const useOTRRoomAction = () => { const capable = !!global.crypto; const { t } = useTranslation(); - useEffect(() => { - otr.setEnabled(enabled && capable); - }, [enabled, capable]); - return useMemo((): RoomToolboxActionConfig | undefined => { if (!enabled || !capable) { return undefined; diff --git a/apps/meteor/client/hooks/roomActions/useOmnichannelExternalFrameRoomAction.ts b/apps/meteor/client/hooks/roomActions/useOmnichannelExternalFrameRoomAction.ts index 7f03b369b449..fe1e704f0b1c 100644 --- a/apps/meteor/client/hooks/roomActions/useOmnichannelExternalFrameRoomAction.ts +++ b/apps/meteor/client/hooks/roomActions/useOmnichannelExternalFrameRoomAction.ts @@ -3,7 +3,7 @@ import { lazy, useMemo } from 'react'; import type { RoomToolboxActionConfig } from '../../views/room/contexts/RoomToolboxContext'; -const ExternalFrameContainer = lazy(() => import('../../../app/livechat/client/externalFrame/ExternalFrameContainer')); +const ExternalFrameContainer = lazy(() => import('../../views/omnichannel/ExternalFrameContainer')); export const useOmnichannelExternalFrameRoomAction = () => { const enabled = useSetting('Omnichannel_External_Frame_Enabled', false); diff --git a/apps/meteor/client/hooks/roomActions/useTeamChannelsRoomAction.ts b/apps/meteor/client/hooks/roomActions/useTeamChannelsRoomAction.ts index 5876a88f2985..6fddd89f2dce 100644 --- a/apps/meteor/client/hooks/roomActions/useTeamChannelsRoomAction.ts +++ b/apps/meteor/client/hooks/roomActions/useTeamChannelsRoomAction.ts @@ -2,7 +2,7 @@ import { lazy, useMemo } from 'react'; import type { RoomToolboxActionConfig } from '../../views/room/contexts/RoomToolboxContext'; -const TeamsChannels = lazy(() => import('../../views/teams/contextualBar/channels/TeamsChannels')); +const TeamsChannels = lazy(() => import('../../views/teams/contextualBar/channels')); export const useTeamChannelsRoomAction = () => { return useMemo( diff --git a/apps/meteor/client/hooks/roomActions/useThreadRoomAction.tsx b/apps/meteor/client/hooks/roomActions/useThreadRoomAction.tsx index dc72ef26c66b..92cc93e339fd 100644 --- a/apps/meteor/client/hooks/roomActions/useThreadRoomAction.tsx +++ b/apps/meteor/client/hooks/roomActions/useThreadRoomAction.tsx @@ -1,5 +1,5 @@ import type { BadgeProps } from '@rocket.chat/fuselage'; -import { HeaderToolboxAction, HeaderToolboxActionBadge } from '@rocket.chat/ui-client'; +import { HeaderToolbarAction, HeaderToolbarActionBadge } from '@rocket.chat/ui-client'; import { useSetting } from '@rocket.chat/ui-contexts'; import React, { lazy, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; @@ -46,7 +46,7 @@ export const useThreadRoomAction = () => { tabComponent: Threads, order: 2, renderToolboxItem: ({ id, className, index, icon, title, toolbox: { tab }, action, disabled, tooltip }) => ( - { disabled={disabled} tooltip={tooltip} > - {!!unread && {unread}} - + {!!unread && {unread}} + ), }; }, [enabled, t, unread, variant]); diff --git a/apps/meteor/client/hooks/useAppActionButtons.ts b/apps/meteor/client/hooks/useAppActionButtons.ts index 28d62ef1b75a..5ee20f7772bf 100644 --- a/apps/meteor/client/hooks/useAppActionButtons.ts +++ b/apps/meteor/client/hooks/useAppActionButtons.ts @@ -1,30 +1,39 @@ import type { IUIActionButton, UIActionButtonContext } from '@rocket.chat/apps-engine/definition/ui'; import { useDebouncedCallback } from '@rocket.chat/fuselage-hooks'; -import { useEndpoint, useSingleStream, useUserId } from '@rocket.chat/ui-contexts'; +import { useEndpoint, useStream, useToastMessageDispatch, useUserId } from '@rocket.chat/ui-contexts'; import type { UseQueryResult } from '@tanstack/react-query'; import { useQuery, useQueryClient } from '@tanstack/react-query'; import { useEffect, useMemo } from 'react'; +import { useTranslation } from 'react-i18next'; +import { UiKitTriggerTimeoutError } from '../../app/ui-message/client/UiKitTriggerTimeoutError'; import type { MessageActionConfig, MessageActionContext } from '../../app/ui-utils/client/lib/MessageAction'; import type { MessageBoxAction } from '../../app/ui-utils/client/lib/messageBox'; import { Utilities } from '../../ee/lib/misc/Utilities'; import type { GenericMenuItemProps } from '../components/GenericMenu/GenericMenuItem'; +import { useUiKitActionManager } from '../uikit/hooks/useUiKitActionManager'; import { useApplyButtonFilters, useApplyButtonAuthFilter } from './useApplyButtonFilters'; -import { useUiKitActionManager } from './useUiKitActionManager'; const getIdForActionButton = ({ appId, actionId }: IUIActionButton): string => `${appId}/${actionId}`; -export const useAppActionButtons = (context?: `${UIActionButtonContext}`) => { +export const useAppActionButtons = (context?: TContext) => { const queryClient = useQueryClient(); - const apps = useSingleStream('apps'); + const apps = useStream('apps'); const uid = useUserId(); const getActionButtons = useEndpoint('GET', '/apps/actionButtons'); const result = useQuery(['apps', 'actionButtons'], () => getActionButtons(), { ...(context && { - select: (data) => data.filter((button) => button.context === context), + select: (data) => + data.filter( + ( + button, + ): button is IUIActionButton & { + context: UIActionButtonContext extends infer X ? (X extends TContext ? X : never) : never; + } => button.context === context, + ), }), staleTime: Infinity, }); @@ -55,6 +64,8 @@ export const useAppActionButtons = (context?: `${UIActionButtonContext}`) => { export const useMessageboxAppsActionButtons = () => { const result = useAppActionButtons('messageBoxAction'); const actionManager = useUiKitActionManager(); + const dispatchToastMessage = useToastMessageDispatch(); + const { t } = useTranslation(); const applyButtonFilters = useApplyButtonFilters(); @@ -65,23 +76,35 @@ export const useMessageboxAppsActionButtons = () => { return applyButtonFilters(action); }) .map((action) => { - const item: MessageBoxAction = { + const item: Omit = { id: getIdForActionButton(action), label: Utilities.getI18nKeyForApp(action.labelI18n, action.appId), action: (params) => { - void actionManager.triggerActionButtonAction({ - rid: params.rid, - tmid: params.tmid, - actionId: action.actionId, - appId: action.appId, - payload: { context: action.context, message: params.chat.composer?.text }, - }); + void actionManager + .emitInteraction(action.appId, { + type: 'actionButton', + rid: params.rid, + tmid: params.tmid, + actionId: action.actionId, + payload: { context: action.context, message: params.chat.composer?.text ?? '' }, + }) + .catch(async (reason) => { + if (reason instanceof UiKitTriggerTimeoutError) { + dispatchToastMessage({ + type: 'error', + message: t('UIKit_Interaction_Timeout'), + }); + return; + } + + return reason; + }); }, }; return item; }), - [actionManager, applyButtonFilters, result.data], + [actionManager, applyButtonFilters, dispatchToastMessage, result.data, t], ); return { ...result, @@ -92,6 +115,8 @@ export const useMessageboxAppsActionButtons = () => { export const useUserDropdownAppsActionButtons = () => { const result = useAppActionButtons('userDropdownAction'); const actionManager = useUiKitActionManager(); + const dispatchToastMessage = useToastMessageDispatch(); + const { t } = useTranslation(); const applyButtonFilters = useApplyButtonAuthFilter(); @@ -107,15 +132,27 @@ export const useUserDropdownAppsActionButtons = () => { // icon: action.icon as GenericMenuItemProps['icon'], content: action.labelI18n, onClick: () => { - actionManager.triggerActionButtonAction({ - actionId: action.actionId, - appId: action.appId, - payload: { context: action.context }, - }); + void actionManager + .emitInteraction(action.appId, { + type: 'actionButton', + actionId: action.actionId, + payload: { context: action.context }, + }) + .catch(async (reason) => { + if (reason instanceof UiKitTriggerTimeoutError) { + dispatchToastMessage({ + type: 'error', + message: t('UIKit_Interaction_Timeout'), + }); + return; + } + + return reason; + }); }, }; }), - [actionManager, applyButtonFilters, result.data], + [actionManager, applyButtonFilters, dispatchToastMessage, result.data, t], ); return { ...result, @@ -127,6 +164,8 @@ export const useMessageActionAppsActionButtons = (context?: MessageActionContext const result = useAppActionButtons('messageAction'); const actionManager = useUiKitActionManager(); const applyButtonFilters = useApplyButtonFilters(); + const dispatchToastMessage = useToastMessageDispatch(); + const { t } = useTranslation(); const data = useMemo( () => result.data @@ -148,20 +187,32 @@ export const useMessageActionAppsActionButtons = (context?: MessageActionContext type: 'apps', variant: action.variant, action: (_, params) => { - void actionManager.triggerActionButtonAction({ - rid: params.message.rid, - tmid: params.message.tmid, - mid: params.message._id, - actionId: action.actionId, - appId: action.appId, - payload: { context: action.context }, - }); + void actionManager + .emitInteraction(action.appId, { + type: 'actionButton', + rid: params.message.rid, + tmid: params.message.tmid, + mid: params.message._id, + actionId: action.actionId, + payload: { context: action.context }, + }) + .catch(async (reason) => { + if (reason instanceof UiKitTriggerTimeoutError) { + dispatchToastMessage({ + type: 'error', + message: t('UIKit_Interaction_Timeout'), + }); + return; + } + + return reason; + }); }, }; return item; }), - [actionManager, applyButtonFilters, context, result.data], + [actionManager, applyButtonFilters, context, dispatchToastMessage, result.data, t], ); return { ...result, diff --git a/apps/meteor/client/hooks/useAppSlashCommands.ts b/apps/meteor/client/hooks/useAppSlashCommands.ts index 665e76b0ef9e..c49c629a2a06 100644 --- a/apps/meteor/client/hooks/useAppSlashCommands.ts +++ b/apps/meteor/client/hooks/useAppSlashCommands.ts @@ -1,5 +1,5 @@ import { useDebouncedCallback } from '@rocket.chat/fuselage-hooks'; -import { useEndpoint, useSingleStream, useUserId } from '@rocket.chat/ui-contexts'; +import { useEndpoint, useStream, useUserId } from '@rocket.chat/ui-contexts'; import { useQuery, useQueryClient } from '@tanstack/react-query'; import { useEffect } from 'react'; @@ -8,7 +8,7 @@ import { slashCommands } from '../../app/utils/lib/slashCommand'; export const useAppSlashCommands = () => { const queryClient = useQueryClient(); - const apps = useSingleStream('apps'); + const apps = useStream('apps'); const uid = useUserId(); const invalidate = useDebouncedCallback( diff --git a/apps/meteor/client/hooks/useAppTranslations.ts b/apps/meteor/client/hooks/useAppTranslations.ts deleted file mode 100644 index bf4f83e48d85..000000000000 --- a/apps/meteor/client/hooks/useAppTranslations.ts +++ /dev/null @@ -1,74 +0,0 @@ -import { useDebouncedCallback } from '@rocket.chat/fuselage-hooks'; -import { useEndpoint, useSingleStream, useUserId } from '@rocket.chat/ui-contexts'; -import { useQuery, useQueryClient } from '@tanstack/react-query'; -import { useEffect } from 'react'; - -import { i18n } from '../../app/utils/lib/i18n'; -import { Utilities } from '../../ee/lib/misc/Utilities'; - -export const useAppTranslations = () => { - const queryClient = useQueryClient(); - - const apps = useSingleStream('apps'); - const uid = useUserId(); - - const getAppsLanguages = useEndpoint('GET', '/apps/languages'); - - const result = useQuery(['apps', 'translations'], () => getAppsLanguages(), { - staleTime: Infinity, - }); - - useEffect(() => { - if (result.data) { - result.data.apps.forEach(({ id, languages }) => { - loadAppI18nResources(id, languages); - }); - } - }, [result.data]); - - const invalidate = useDebouncedCallback( - () => { - queryClient.invalidateQueries(['apps', 'translations']); - }, - 100, - [], - ); - - useEffect(() => { - if (!uid) { - return; - } - - return apps('apps', ([key]) => { - if (['app/added'].includes(key)) { - invalidate(); - } - }); - }, [uid, apps, invalidate]); - - const loadAppI18nResources = ( - appId: string, - languages: { - [key: string]: { - Params: string; - Description: string; - Setting_Name: string; - Setting_Description: string; - }; - }, - ) => { - Object.entries(languages).forEach(([language, translations]) => { - const regex = /([a-z]{2,3})-([a-z]{2,4})/; - const match = regex.exec(language); - const normalizedLanguage = match ? `${match[1]}-${match[2].toUpperCase()}` : language; - - // Translations keys must be scoped under app id - const scopedTranslations = Object.entries(translations).reduce>((acc, [key, value]) => { - acc[Utilities.getI18nKeyForApp(key, appId)] = value; - return acc; - }, {}); - - i18n.addResourceBundle(normalizedLanguage, 'core', scopedTranslations); - }); - }; -}; diff --git a/apps/meteor/client/hooks/useAppUiKitInteraction.ts b/apps/meteor/client/hooks/useAppUiKitInteraction.ts index 84849f592a48..55741b1961b4 100644 --- a/apps/meteor/client/hooks/useAppUiKitInteraction.ts +++ b/apps/meteor/client/hooks/useAppUiKitInteraction.ts @@ -1,16 +1,8 @@ -import type { UIKitInteractionType } from '@rocket.chat/apps-engine/definition/uikit'; import { useStream, useUserId } from '@rocket.chat/ui-contexts'; +import type * as UiKit from '@rocket.chat/ui-kit'; import { useEffect } from 'react'; -export const useAppUiKitInteraction = ( - handlePayloadUserInteraction: ( - type: UIKitInteractionType, - data: { - triggerId: string; - appId: string; - }, - ) => void, -) => { +export const useAppUiKitInteraction = (handleServerInteraction: (interaction: UiKit.ServerInteraction) => void) => { const notifyUser = useStream('notify-user'); const uid = useUserId(); @@ -19,8 +11,8 @@ export const useAppUiKitInteraction = ( return; } - return notifyUser(`${uid}/uiInteraction`, ({ type, ...data }) => { - handlePayloadUserInteraction(type, data); + return notifyUser(`${uid}/uiInteraction`, (interaction) => { + handleServerInteraction(interaction); }); - }, [notifyUser, uid, handlePayloadUserInteraction]); + }, [notifyUser, uid, handleServerInteraction]); }; diff --git a/apps/meteor/client/hooks/useAvatarSuggestions.ts b/apps/meteor/client/hooks/useAvatarSuggestions.ts deleted file mode 100644 index 223cab8ca4b4..000000000000 --- a/apps/meteor/client/hooks/useAvatarSuggestions.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { useEndpoint } from '@rocket.chat/ui-contexts'; -import { useQuery } from '@tanstack/react-query'; - -export const useAvatarSuggestions = () => { - const getAvatarSuggestions = useEndpoint('GET', '/v1/users.getAvatarSuggestion'); - - return useQuery(['getAvatarSuggestion'], async () => getAvatarSuggestions()); -}; diff --git a/apps/meteor/client/hooks/useEndpointAction.ts b/apps/meteor/client/hooks/useEndpointAction.ts index 7cc1a68f1020..c7c371a04e1f 100644 --- a/apps/meteor/client/hooks/useEndpointAction.ts +++ b/apps/meteor/client/hooks/useEndpointAction.ts @@ -1,7 +1,7 @@ -import type { Method, OperationParams, PathPattern, UrlParams } from '@rocket.chat/rest-typings'; +import type { Method, PathPattern, UrlParams } from '@rocket.chat/rest-typings'; import type { EndpointFunction } from '@rocket.chat/ui-contexts'; import { useToastMessageDispatch, useEndpoint } from '@rocket.chat/ui-contexts'; -import { useCallback } from 'react'; +import { useMutation } from '@tanstack/react-query'; type UseEndpointActionOptions = (undefined extends UrlParams ? { @@ -16,26 +16,21 @@ export function useEndpointAction = { keys: {} as UrlParams }, -): EndpointFunction { +) { const sendData = useEndpoint(method, pathPattern, options.keys as UrlParams); const dispatchToastMessage = useToastMessageDispatch(); - return useCallback( - async (params: OperationParams | undefined) => { - try { - const data = await sendData(params as OperationParams); - - if (options.successMessage) { - dispatchToastMessage({ type: 'success', message: options.successMessage }); - } - - return data; - } catch (error) { - dispatchToastMessage({ type: 'error', message: error }); - throw error; + const mutation = useMutation(sendData, { + onSuccess: () => { + if (options.successMessage) { + dispatchToastMessage({ type: 'success', message: options.successMessage }); } }, - [dispatchToastMessage, sendData, options.successMessage], - ); + onError: (error) => { + dispatchToastMessage({ type: 'error', message: error }); + }, + }); + + return mutation.mutateAsync as EndpointFunction; } diff --git a/apps/meteor/client/hooks/useFileInput.ts b/apps/meteor/client/hooks/useFileInput.ts index 4bb572318991..c9662b820d8f 100644 --- a/apps/meteor/client/hooks/useFileInput.ts +++ b/apps/meteor/client/hooks/useFileInput.ts @@ -1,17 +1,15 @@ -import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; import { useRef, useEffect } from 'react'; +import type { AllHTMLAttributes } from 'react'; -export const useFileInput = ( - onSetFile: (file: FileList[number], formData: FormData) => void, - fileType = 'image/*', - fileField = 'image', -): [onClick: () => void, reset: () => void] => { +export const useFileInput = (props: AllHTMLAttributes) => { const ref = useRef(); useEffect(() => { const fileInput = document.createElement('input'); - fileInput.setAttribute('type', 'file'); - fileInput.setAttribute('style', 'display: none'); + fileInput.setAttribute('style', 'display: none;'); + Object.entries(props).forEach(([key, value]) => { + fileInput.setAttribute(key, value); + }); document.body.appendChild(fileInput); ref.current = fileInput; @@ -19,44 +17,7 @@ export const useFileInput = ( ref.current = undefined; fileInput.remove(); }; - }, []); + }, [props]); - useEffect(() => { - const fileInput = ref.current; - if (!fileInput) { - return; - } - - fileInput.setAttribute('accept', fileType); - }, [fileType]); - - useEffect(() => { - const fileInput = ref.current; - if (!fileInput) { - return; - } - - const handleFiles = (): void => { - if (!fileInput?.files?.length) { - return; - } - const formData = new FormData(); - formData.append(fileField, fileInput.files[0]); - onSetFile(fileInput.files[0], formData); - }; - - fileInput.addEventListener('change', handleFiles, false); - - return (): void => { - fileInput.removeEventListener('change', handleFiles, false); - }; - }, [fileField, fileType, onSetFile]); - - const onClick = useMutableCallback(() => ref?.current?.click()); - const reset = useMutableCallback(() => { - if (ref.current) { - ref.current.value = ''; - } - }); - return [onClick, reset]; + return ref; }; diff --git a/apps/meteor/client/hooks/useForm.ts b/apps/meteor/client/hooks/useForm.ts deleted file mode 100644 index d84aca63fc06..000000000000 --- a/apps/meteor/client/hooks/useForm.ts +++ /dev/null @@ -1,195 +0,0 @@ -import { capitalize } from '@rocket.chat/string-helpers'; -import type { ChangeEvent } from 'react'; -import { useCallback, useReducer, useMemo } from 'react'; - -type Field = { - name: string; - currentValue: unknown; - initialValue: unknown; - changed: boolean; -}; - -type FormState> = { - fields: Field[]; - values: Values; - hasUnsavedChanges: boolean; -}; - -type FormAction> = { - (prevState: FormState): FormState; -}; - -const reduceForm = >(state: FormState, action: FormAction): FormState => - action(state); - -const initForm = >(initialValues: Values): FormState => { - const fields = []; - - for (const [fieldName, initialValue] of Object.entries(initialValues)) { - fields.push({ - name: fieldName, - currentValue: initialValue, - initialValue, - changed: false, - }); - } - - return { - fields, - values: { ...initialValues }, - hasUnsavedChanges: false, - }; -}; - -const valueChanged = - >(fieldName: string, newValue: unknown): FormAction => - (state: FormState): FormState => { - let { fields } = state; - const field = fields.find(({ name }) => name === fieldName); - - if (!field || field.currentValue === newValue) { - return state; - } - - const newField = { - ...field, - currentValue: newValue, - changed: JSON.stringify(newValue) !== JSON.stringify(field.initialValue), - }; - - fields = state.fields.map((field) => { - if (field.name === fieldName) { - return newField; - } - - return field; - }); - - return { - ...state, - fields, - values: { - ...state.values, - [newField.name]: newField.currentValue, - }, - hasUnsavedChanges: newField.changed || fields.some((field) => field.changed), - }; - }; - -const formCommitted = - >(): FormAction => - (state: FormState): FormState => ({ - ...state, - fields: state.fields.map((field) => ({ - ...field, - initialValue: field.currentValue, - changed: false, - })), - hasUnsavedChanges: false, - }); - -const formReset = - >(): FormAction => - (state: FormState): FormState => ({ - ...state, - fields: state.fields.map((field) => ({ - ...field, - currentValue: field.initialValue, - changed: false, - })), - values: state.fields.reduce( - (values, field) => ({ - ...values, - [field.name]: field.initialValue, - }), - {} as Values, - ), - hasUnsavedChanges: false, - }); - -const isChangeEvent = (x: any): x is ChangeEvent => - (typeof x === 'object' || typeof x === 'function') && typeof x?.currentTarget !== 'undefined'; - -const getValue = (eventOrValue: ChangeEvent | unknown): unknown => { - if (!isChangeEvent(eventOrValue)) { - return eventOrValue; - } - - const target = eventOrValue.currentTarget; - - if (target instanceof HTMLTextAreaElement) { - return target.value; - } - - if (target instanceof HTMLSelectElement) { - return target.value; - } - - if (!(target instanceof HTMLInputElement)) { - return undefined; - } - - if (target.type === 'checkbox' || target.type === 'radio') { - return target.checked; - } - - return target.value; -}; - -/** - * @deprecated prefer react-hook-form's `useForm` - */ -export const useForm = < - Reducer extends ( - state: FormState>, - action: FormAction>, - ) => FormState>, ->( - initialValues: Parameters[0]['values'], - onChange: (...args: unknown[]) => void = (): void => undefined, -): { - values: Parameters[0]['values']; - handlers: Record void>; - hasUnsavedChanges: boolean; - commit: () => void; - reset: () => void; -} => { - const [state, dispatch] = useReducer(reduceForm, initialValues, initForm); - - const commit = useCallback(() => { - dispatch(formCommitted()); - }, []); - - const reset = useCallback(() => { - dispatch(formReset()); - }, []); - - const handlers = useMemo void>>( - () => - state.fields.reduce( - (handlers, { name, initialValue }) => ({ - ...handlers, - [`handle${capitalize(name)}`]: (eventOrValue: ChangeEvent | unknown): void => { - const newValue = getValue(eventOrValue); - dispatch(valueChanged(name, newValue)); - onChange({ - initialValue, - value: newValue, - key: name, - values: state.values, - }); - }, - }), - {}, - ), - [onChange, state.fields, state.values], - ); - - return { - handlers, - values: state.values, - hasUnsavedChanges: state.hasUnsavedChanges, - commit, - reset, - }; -}; diff --git a/apps/meteor/client/hooks/useFormatNumber.ts b/apps/meteor/client/hooks/useFormatNumber.ts new file mode 100644 index 000000000000..2e1041c95dfa --- /dev/null +++ b/apps/meteor/client/hooks/useFormatNumber.ts @@ -0,0 +1,16 @@ +import { useLanguage } from '@rocket.chat/ui-contexts'; +import { useCallback } from 'react'; + +export const useFormatNumber = (options?: Intl.NumberFormatOptions) => { + const language = useLanguage(); + return useCallback( + (value: number) => { + try { + return new Intl.NumberFormat(language, options).format(value); + } catch (_error) { + return value; + } + }, + [language, options], + ); +}; diff --git a/apps/meteor/client/hooks/useIsEnterprise.ts b/apps/meteor/client/hooks/useIsEnterprise.ts index 4be3494ad969..e2622d8b695d 100644 --- a/apps/meteor/client/hooks/useIsEnterprise.ts +++ b/apps/meteor/client/hooks/useIsEnterprise.ts @@ -1,23 +1,8 @@ import type { OperationResult } from '@rocket.chat/rest-typings'; -import { useEndpoint } from '@rocket.chat/ui-contexts'; -import type { UseQueryOptions, UseQueryResult } from '@tanstack/react-query'; -import { useQuery } from '@tanstack/react-query'; +import type { UseQueryResult } from '@tanstack/react-query'; -const queryKey = ['licenses', 'isEnterprise'] as const; +import { useLicenseBase } from './useLicense'; -export const useIsEnterprise = ( - options?: UseQueryOptions< - OperationResult<'GET', '/v1/licenses.isEnterprise'>, - unknown, - OperationResult<'GET', '/v1/licenses.isEnterprise'>, - typeof queryKey - >, -): UseQueryResult> => { - const isEnterpriseEdition = useEndpoint('GET', '/v1/licenses.isEnterprise'); - - return useQuery(queryKey, () => isEnterpriseEdition(), { - keepPreviousData: true, - staleTime: Infinity, - ...options, - }); +export const useIsEnterprise = (): UseQueryResult> => { + return useLicenseBase({ select: (data) => ({ isEnterprise: Boolean(data?.license.license) }) }); }; diff --git a/apps/meteor/client/hooks/useIsSelfHosted.ts b/apps/meteor/client/hooks/useIsSelfHosted.ts new file mode 100644 index 000000000000..eb3620e20ea3 --- /dev/null +++ b/apps/meteor/client/hooks/useIsSelfHosted.ts @@ -0,0 +1,9 @@ +import { useStatistics } from '../views/hooks/useStatistics'; + +export const useIsSelfHosted = (): { isSelfHosted: boolean; isLoading: boolean } => { + const { data, isLoading } = useStatistics(); + + const isSelfHosted = data?.deploy?.platform !== 'rocket-cloud'; + + return { isSelfHosted, isLoading }; +}; diff --git a/apps/meteor/client/hooks/useLicense.ts b/apps/meteor/client/hooks/useLicense.ts index 0f568d9bd5cc..4ec8d29ec49c 100644 --- a/apps/meteor/client/hooks/useLicense.ts +++ b/apps/meteor/client/hooks/useLicense.ts @@ -1,23 +1,66 @@ +import type { Serialized } from '@rocket.chat/core-typings'; import type { OperationResult } from '@rocket.chat/rest-typings'; -import { useEndpoint, usePermission } from '@rocket.chat/ui-contexts'; -import type { UseQueryResult } from '@tanstack/react-query'; -import { useQuery } from '@tanstack/react-query'; - -export const useLicense = (): UseQueryResult> => { - const getLicenses = useEndpoint('GET', '/v1/licenses.get'); - const canViewLicense = usePermission('view-privileged-setting'); - - return useQuery( - ['licenses', 'getLicenses'], - () => { - if (!canViewLicense) { - throw new Error('unauthorized api call'); - } - return getLicenses(); - }, - { - staleTime: Infinity, - keepPreviousData: true, - }, - ); +import { useEndpoint, useStream, useUserId } from '@rocket.chat/ui-contexts'; +import type { QueryClient, UseQueryResult } from '@tanstack/react-query'; +import { useQuery, useQueryClient } from '@tanstack/react-query'; +import { useEffect } from 'react'; + +type LicenseDataType = Serialized>>; + +type LicenseParams = { + loadValues?: boolean; +}; + +const invalidateQueryClientLicenses = (() => { + let timeout: ReturnType | undefined; + + return (queryClient: QueryClient, milliseconds = 5000) => { + clearTimeout(timeout); + timeout = setTimeout(() => { + timeout = undefined; + queryClient.invalidateQueries(['licenses']); + }, milliseconds); + }; +})(); + +export const useLicenseBase = ({ + params, + select, +}: { + params?: LicenseParams; + select: (data: LicenseDataType) => TData; +}) => { + const uid = useUserId(); + + const getLicenses = useEndpoint('GET', '/v1/licenses.info'); + + const invalidateQueries = useInvalidateLicense(); + + const notify = useStream('notify-all'); + + useEffect(() => notify('license', () => invalidateQueries()), [notify, invalidateQueries]); + + return useQuery(['licenses', 'getLicenses', params], () => getLicenses({ ...params }), { + staleTime: Infinity, + keepPreviousData: true, + select, + enabled: !!uid, + }); +}; + +export const useLicense = (params?: LicenseParams) => { + return useLicenseBase({ params, select: (data) => data.license }); +}; + +export const useHasLicense = (): UseQueryResult => { + return useLicenseBase({ select: (data) => Boolean(data.license) }); +}; + +export const useLicenseName = (params?: LicenseParams) => { + return useLicenseBase({ params, select: (data) => data?.license.tags?.map((tag) => tag.name).join(' ') || 'Community' }); +}; + +export const useInvalidateLicense = () => { + const queryClient = useQueryClient(); + return (milliseconds?: number) => invalidateQueryClientLicenses(queryClient, milliseconds); }; diff --git a/apps/meteor/client/hooks/useRegistrationStatus.ts b/apps/meteor/client/hooks/useRegistrationStatus.ts index 9260d672bec5..e400bf88cf20 100644 --- a/apps/meteor/client/hooks/useRegistrationStatus.ts +++ b/apps/meteor/client/hooks/useRegistrationStatus.ts @@ -3,11 +3,15 @@ import { useEndpoint, usePermission } from '@rocket.chat/ui-contexts'; import type { UseQueryResult } from '@tanstack/react-query'; import { useQuery } from '@tanstack/react-query'; -export const useRegistrationStatus = (): UseQueryResult> => { +type useRegistrationStatusReturnType = { + isRegistered?: boolean; +} & UseQueryResult>; + +export const useRegistrationStatus = (): useRegistrationStatusReturnType => { const getRegistrationStatus = useEndpoint('GET', '/v1/cloud.registrationStatus'); const canViewregistrationStatus = usePermission('manage-cloud'); - return useQuery( + const queryResult = useQuery( ['getRegistrationStatus'], () => { if (!canViewregistrationStatus) { @@ -20,4 +24,6 @@ export const useRegistrationStatus = (): UseQueryResult> => { const getRoomInfo = useEndpoint('GET', '/v1/rooms.info'); - return useQuery(['rooms/info', rid], () => getRoomInfo({ roomId: rid }), { + return useQuery(['/v1/rooms.info', rid], () => getRoomInfo({ roomId: rid }), { cacheTime: minutesToMilliseconds(15), staleTime: minutesToMilliseconds(5), retry: (count, error: Meteor.Error) => { diff --git a/apps/meteor/client/hooks/useShouldPreventAction.ts b/apps/meteor/client/hooks/useShouldPreventAction.ts new file mode 100644 index 000000000000..99b831a7928c --- /dev/null +++ b/apps/meteor/client/hooks/useShouldPreventAction.ts @@ -0,0 +1,9 @@ +import type { LicenseLimitKind } from '@rocket.chat/core-typings'; + +import { useLicense } from './useLicense'; + +export const useShouldPreventAction = (action: LicenseLimitKind): boolean => { + const { data: { preventedActions } = {} } = useLicense(); + + return Boolean(preventedActions?.[action]); +}; diff --git a/apps/meteor/client/hooks/useSingleFileInput.ts b/apps/meteor/client/hooks/useSingleFileInput.ts new file mode 100644 index 000000000000..c16b247323fe --- /dev/null +++ b/apps/meteor/client/hooks/useSingleFileInput.ts @@ -0,0 +1,62 @@ +import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; +import { useRef, useEffect } from 'react'; + +export const useSingleFileInput = ( + onSetFile: (file: FileList[number], formData: FormData) => void, + fileType = 'image/*', + fileField = 'image', +): [onClick: () => void, reset: () => void] => { + const ref = useRef(); + + useEffect(() => { + const fileInput = document.createElement('input'); + fileInput.setAttribute('type', 'file'); + fileInput.setAttribute('style', 'display: none'); + document.body.appendChild(fileInput); + ref.current = fileInput; + + return (): void => { + ref.current = undefined; + fileInput.remove(); + }; + }, []); + + useEffect(() => { + const fileInput = ref.current; + if (!fileInput) { + return; + } + + fileInput.setAttribute('accept', fileType); + }, [fileType]); + + useEffect(() => { + const fileInput = ref.current; + if (!fileInput) { + return; + } + + const handleFiles = (): void => { + if (!fileInput?.files?.length) { + return; + } + const formData = new FormData(); + formData.append(fileField, fileInput.files[0]); + onSetFile(fileInput.files[0], formData); + }; + + fileInput.addEventListener('change', handleFiles, false); + + return (): void => { + fileInput.removeEventListener('change', handleFiles, false); + }; + }, [fileField, fileType, onSetFile]); + + const onClick = useMutableCallback(() => ref?.current?.click()); + const reset = useMutableCallback(() => { + if (ref.current) { + ref.current.value = ''; + } + }); + return [onClick, reset]; +}; diff --git a/apps/meteor/client/hooks/useTranslationsForApps.ts b/apps/meteor/client/hooks/useTranslationsForApps.ts new file mode 100644 index 000000000000..56e29c24a193 --- /dev/null +++ b/apps/meteor/client/hooks/useTranslationsForApps.ts @@ -0,0 +1,58 @@ +import { normalizeLanguage } from '@rocket.chat/tools'; +import { useEndpoint, useStream, useUserId } from '@rocket.chat/ui-contexts'; +import { useQuery, useQueryClient } from '@tanstack/react-query'; +import { useEffect } from 'react'; +import { useTranslation } from 'react-i18next'; + +import { withDebouncing } from '../../lib/utils/highOrderFunctions'; + +export const useTranslationsForApps = () => { + const getAppsLanguages = useEndpoint('GET', '/apps/languages'); + + const { isSuccess, data } = useQuery({ + queryKey: ['apps', 'translations'] as const, + queryFn: () => getAppsLanguages(), + staleTime: Infinity, + }); + + const { i18n } = useTranslation(); + + useEffect(() => { + if (!isSuccess) { + return; + } + + data.apps.forEach(({ id: appId, languages }) => { + Object.entries(languages).forEach(([language, translations]) => { + const normalizedLanguage = normalizeLanguage(language); + const namespace = `app-${appId}`; + i18n.addResourceBundle(normalizedLanguage, namespace, translations); + }); + }); + }, [i18n, data, isSuccess]); + + const queryClient = useQueryClient(); + const subscribeToApps = useStream('apps'); + const uid = useUserId(); + + useEffect(() => { + if (!uid) { + return; + } + + const invalidate = withDebouncing({ wait: 100 })(() => { + queryClient.invalidateQueries(['apps', 'translations']); + }); + + const unsubscribe = subscribeToApps('apps', ([key]) => { + if (key === 'app/added') { + invalidate(); + } + }); + + return () => { + unsubscribe(); + invalidate.cancel(); + }; + }, [uid, subscribeToApps, queryClient]); +}; diff --git a/apps/meteor/client/hooks/useWorkspaceInfo.ts b/apps/meteor/client/hooks/useWorkspaceInfo.ts new file mode 100644 index 000000000000..fbc9ba872556 --- /dev/null +++ b/apps/meteor/client/hooks/useWorkspaceInfo.ts @@ -0,0 +1,69 @@ +import type { IStats, IWorkspaceInfo, Serialized } from '@rocket.chat/core-typings'; +import type { IInstance } from '@rocket.chat/rest-typings'; +import { useEndpoint } from '@rocket.chat/ui-contexts'; +import { useMutation, useQueries, useQueryClient } from '@tanstack/react-query'; + +export const useWorkspaceInfo = ({ refreshStatistics }: { refreshStatistics?: boolean } = {}) => { + const getStatistics = useEndpoint('GET', '/v1/statistics'); + const getInstances = useEndpoint('GET', '/v1/instances.get'); + const getServerInfo = useEndpoint('GET', '/info'); + + return useQueries({ + queries: [ + { + queryKey: ['info', 'serverInfo'], + queryFn: async () => { + const data = await getServerInfo(); + + if (!('minimumClientVersions' in data)) { + throw new Error('Invalid server info'); + } + if (!('info' in data)) { + throw new Error('Invalid server info'); + } + if (!('version' in data)) { + throw new Error('Invalid server info'); + } + + return data as IWorkspaceInfo; + }, + staleTime: Infinity, + keepPreviousData: true, + }, + { + queryKey: ['info', 'instances'], + queryFn: () => getInstances(), + staleTime: Infinity, + keepPreviousData: true, + select({ instances }: Serialized<{ instances: IInstance[] }>) { + return instances.map((instance) => ({ + ...instance, + ...(instance.instanceRecord && { + instanceRecord: { + ...instance.instanceRecord, + _createdAt: new Date(instance.instanceRecord._createdAt), + }, + }), + })) as IInstance[]; + }, + }, + { + queryKey: ['info', 'statistics'], + queryFn: () => getStatistics({ refresh: refreshStatistics ? 'true' : 'false' }), + staleTime: Infinity, + keepPreviousData: true, + select: (data: Serialized) => ({ + ...data, + lastMessageSentAt: data.lastMessageSentAt ? new Date(data.lastMessageSentAt) : undefined, + }), + }, + ], + }); +}; + +export const useRefreshStatistics = () => { + const queryClient = useQueryClient(); + return useMutation({ + mutationFn: () => queryClient.invalidateQueries(['info', 'statistics']), + }); +}; diff --git a/apps/meteor/client/hooks/webdav/useWebDAVAccountIntegrationsQuery.ts b/apps/meteor/client/hooks/webdav/useWebDAVAccountIntegrationsQuery.ts new file mode 100644 index 000000000000..171490b33d18 --- /dev/null +++ b/apps/meteor/client/hooks/webdav/useWebDAVAccountIntegrationsQuery.ts @@ -0,0 +1,55 @@ +import type { IWebdavAccountIntegration } from '@rocket.chat/core-typings'; +import { useUserId, useEndpoint, useStream } from '@rocket.chat/ui-contexts'; +import type { UseQueryOptions } from '@tanstack/react-query'; +import { useQuery, useQueryClient } from '@tanstack/react-query'; +import { useEffect, useMemo } from 'react'; + +type UseWebDAVAccountIntegrationsQueryOptions = Omit< + UseQueryOptions, + 'queryKey' | 'queryFn' +>; + +export const useWebDAVAccountIntegrationsQuery = ({ enabled = true, ...options }: UseWebDAVAccountIntegrationsQueryOptions = {}) => { + const uid = useUserId(); + + const queryKey = useMemo(() => ['webdav', 'account-integrations'] as const, []); + + const getMyAccounts = useEndpoint('GET', '/v1/webdav.getMyAccounts'); + + const integrationsQuery = useQuery({ + queryKey, + queryFn: async (): Promise => { + const { accounts } = await getMyAccounts(); + return accounts; + }, + enabled: !!uid && enabled, + staleTime: Infinity, + ...options, + }); + + const queryClient = useQueryClient(); + + const subscribeToNotifyUser = useStream('notify-user'); + + useEffect(() => { + if (!uid || !enabled) { + return; + } + + return subscribeToNotifyUser(`${uid}/webdav`, ({ type, account }) => { + switch (type) { + case 'changed': + queryClient.invalidateQueries(queryKey); + break; + + case 'removed': + queryClient.setQueryData(queryKey, (old = []) => { + return old.filter((oldAccount) => oldAccount._id !== account._id); + }); + break; + } + }); + }, [enabled, queryClient, queryKey, uid, subscribeToNotifyUser]); + + return integrationsQuery; +}; diff --git a/apps/meteor/client/importPackages.ts b/apps/meteor/client/importPackages.ts index 60446388ed9f..ffc81c35a953 100644 --- a/apps/meteor/client/importPackages.ts +++ b/apps/meteor/client/importPackages.ts @@ -1,11 +1,7 @@ import '../app/cors/client'; -import '../app/2fa/client'; import '../app/apple/client'; import '../app/authorization/client'; import '../app/autotranslate/client'; -import '../app/cas/client'; -import '../app/crowd/client'; -import '../app/custom-oauth/client/custom_oauth_client'; import '../app/custom-sounds/client'; import '../app/dolphin/client'; import '../app/drupal/client'; @@ -16,14 +12,10 @@ import '../app/file-upload/client'; import '../app/github-enterprise/client'; import '../app/gitlab/client'; import '../app/iframe-login/client'; -import '../app/importer/client'; -import '../app/importer-csv/client'; -import '../app/importer-hipchat-enterprise/client'; -import '../app/importer-slack/client'; -import '../app/importer-slack-users/client'; import '../app/lib/client'; import '../app/message-mark-as-unread/client'; import '../app/nextcloud/client'; +import '../app/notifications/client'; import '../app/otr/client'; import '../app/slackbridge/client'; import '../app/slashcommands-archiveroom/client'; @@ -38,19 +30,14 @@ import '../app/slashcommands-open/client'; import '../app/slashcommands-topic/client'; import '../app/slashcommands-unarchiveroom/client'; import '../app/tokenpass/client'; -import '../app/ui/client'; -import '../app/webdav/client'; import '../app/webrtc/client'; import '../app/wordpress/client'; -import '../app/meteor-accounts-saml/client'; import '../app/e2e/client'; import '../app/discussion/client'; import '../app/threads/client'; -import '../app/user-status/client'; import '../app/utils/client'; import '../app/settings/client'; import '../app/models/client'; -import '../app/notifications/client'; import '../app/ui-utils/client'; import '../app/ui-cached-collection/client'; import '../app/reactions/client'; diff --git a/apps/meteor/client/lib/2fa/overrideLoginMethod.ts b/apps/meteor/client/lib/2fa/overrideLoginMethod.ts index fcda6907cbcf..7cf01ba3370c 100644 --- a/apps/meteor/client/lib/2fa/overrideLoginMethod.ts +++ b/apps/meteor/client/lib/2fa/overrideLoginMethod.ts @@ -1,46 +1,105 @@ -import { t } from '../../../app/utils/lib/i18n'; -import { dispatchToastMessage } from '../toast'; -import { process2faReturn } from './process2faReturn'; -import { isTotpInvalidError, isTotpRequiredError } from './utils'; - -type LoginCallback = { - (error: unknown): void; - (error: unknown, result: unknown): void; -}; +import { isTotpInvalidError, isTotpMaxAttemptsError, isTotpRequiredError } from './utils'; -type LoginMethod = (...args: [...args: A, cb: LoginCallback]) => void; +type LoginError = globalThis.Error | Meteor.Error | Meteor.TypedError; -type LoginMethodWithTotp = (...args: [...args: A, code: string, cb: LoginCallback]) => void; +export type LoginCallback = (error: LoginError | undefined, result?: unknown) => void; -export const overrideLoginMethod = ( - loginMethod: LoginMethod, - loginArgs: A, - callback: LoginCallback, - loginMethodTOTP: LoginMethodWithTotp, - emailOrUsername: string, -): void => { - loginMethod.call(null, ...loginArgs, async (error: unknown, result?: unknown) => { +export const overrideLoginMethod = ( + loginMethod: (...args: [...args: TArgs, cb: LoginCallback]) => void, + loginArgs: TArgs, + callback: LoginCallback | undefined, + loginMethodTOTP: (...args: [...args: TArgs, code: string, cb: LoginCallback]) => void, +) => { + loginMethod(...loginArgs, async (error: LoginError | undefined, result?: unknown) => { if (!isTotpRequiredError(error)) { - callback(error); + callback?.(error); return; } + const { process2faReturn } = await import('./process2faReturn'); + await process2faReturn({ error, result, - emailOrUsername, + emailOrUsername: typeof loginArgs[0] === 'string' ? loginArgs[0] : undefined, originalCallback: callback, onCode: (code: string) => { - loginMethodTOTP?.call(null, ...loginArgs, code, (error: unknown) => { + loginMethodTOTP(...loginArgs, code, (error: LoginError | undefined, result?: unknown) => { + if (!error) { + callback?.(undefined, result); + return; + } + if (isTotpInvalidError(error)) { - dispatchToastMessage({ type: 'error', message: t('Invalid_two_factor_code') }); - callback(null); + callback?.(error); return; } - callback(error); + Promise.all([import('../../../app/utils/lib/i18n'), import('../toast')]).then(([{ t }, { dispatchToastMessage }]) => { + if (isTotpMaxAttemptsError(error)) { + dispatchToastMessage({ + type: 'error', + message: t('totp-max-attempts'), + }); + callback?.(undefined); + return; + } + + dispatchToastMessage({ type: 'error', message: t('Invalid_two_factor_code') }); + callback?.(undefined); + }); }); }, }); }); }; + +export const handleLogin = Promise>( + login: TLoginFunction, + loginWithTOTP: (...args: [...args: Parameters, code: string]) => ReturnType, +) => { + return (...args: [...loginArgs: Parameters, callback?: LoginCallback]) => { + const loginArgs = args.slice(0, -1) as Parameters; + const callback = args.slice(-1)[0] as LoginCallback | undefined; + + return login(...loginArgs) + .catch(async (error: LoginError | undefined) => { + if (!isTotpRequiredError(error)) { + return Promise.reject(error); + } + + const { process2faAsyncReturn } = await import('./process2faReturn'); + return process2faAsyncReturn({ + emailOrUsername: typeof loginArgs[0] === 'string' ? loginArgs[0] : undefined, + error, + onCode: (code: string) => loginWithTOTP(...loginArgs, code), + }); + }) + .then((result: unknown) => callback?.(undefined, result)) + .catch((error: LoginError | undefined) => { + if (!isTotpInvalidError(error)) { + callback?.(error); + return; + } + + Promise.all([import('../../../app/utils/lib/i18n'), import('../toast')]).then(([{ t }, { dispatchToastMessage }]) => { + dispatchToastMessage({ type: 'error', message: t('Invalid_two_factor_code') }); + callback?.(undefined); + }); + }); + }; +}; + +export const callLoginMethod = (options: Omit) => + new Promise((resolve, reject) => { + Accounts.callLoginMethod({ + ...options, + userCallback: (error) => { + if (error) { + reject(error); + } else { + resolve(); + } + }, + }); + }); diff --git a/apps/meteor/client/lib/2fa/process2faReturn.ts b/apps/meteor/client/lib/2fa/process2faReturn.ts index 95f7f1dcb361..57a8d98b05b0 100644 --- a/apps/meteor/client/lib/2fa/process2faReturn.ts +++ b/apps/meteor/client/lib/2fa/process2faReturn.ts @@ -3,6 +3,7 @@ import { Meteor } from 'meteor/meteor'; import { lazy } from 'react'; import { imperativeModal } from '../imperativeModal'; +import type { LoginCallback } from './overrideLoginMethod'; import { isTotpInvalidError, isTotpRequiredError } from './utils'; const TwoFactorModal = lazy(() => import('../../components/TwoFactorModal')); @@ -35,6 +36,23 @@ function assertModalProps(props: { } } +const getProps = ( + method: 'totp' | 'email' | 'password', + emailOrUsername?: { username: string } | { email: string } | { id: string } | string, +) => { + switch (method) { + case 'totp': + return { method }; + case 'email': + return { + method, + emailOrUsername: typeof emailOrUsername === 'string' ? emailOrUsername : Meteor.user()?.username, + }; + case 'password': + return { method }; + } +}; + export async function process2faReturn({ error, result, @@ -42,23 +60,19 @@ export async function process2faReturn({ onCode, emailOrUsername, }: { - error: unknown; + error: globalThis.Error | Meteor.Error | Meteor.TypedError | undefined; result: unknown; - originalCallback: { - (error: unknown): void; - (error: unknown, result: unknown): void; - }; + originalCallback: LoginCallback | undefined; onCode: (code: string, method: string) => void; - emailOrUsername: string | null | undefined; + emailOrUsername: { username: string } | { email: string } | { id: string } | string | null | undefined; }): Promise { if (!(isTotpRequiredError(error) || isTotpInvalidError(error)) || !hasRequiredTwoFactorMethod(error)) { - originalCallback(error, result); + originalCallback?.(error, result); return; } const props = { - method: error.details.method, - emailOrUsername: emailOrUsername || error.details.emailOrUsername || Meteor.user()?.username, + ...getProps(error.details.method, emailOrUsername || error.details.emailOrUsername), // eslint-disable-next-line no-nested-ternary invalidAttempt: isTotpInvalidError(error), }; @@ -69,7 +83,7 @@ export async function process2faReturn({ onCode(code, props.method); } catch (error) { process2faReturn({ - error, + error: error as globalThis.Error | Meteor.Error | Meteor.TypedError | undefined, result, originalCallback, onCode, diff --git a/apps/meteor/client/lib/2fa/utils.ts b/apps/meteor/client/lib/2fa/utils.ts index 4abd3f436e60..ab2234f2e589 100644 --- a/apps/meteor/client/lib/2fa/utils.ts +++ b/apps/meteor/client/lib/2fa/utils.ts @@ -1,6 +1,3 @@ -import { Accounts } from 'meteor/accounts-base'; -import { Meteor } from 'meteor/meteor'; - export const isTotpRequiredError = ( error: unknown, ): error is Meteor.Error & ({ error: 'totp-required' } | { errorType: 'totp-required' }) => @@ -12,22 +9,8 @@ export const isTotpInvalidError = (error: unknown): error is Meteor.Error & ({ e (error as { error?: unknown } | undefined)?.error === 'totp-invalid' || (error as { errorType?: unknown } | undefined)?.errorType === 'totp-invalid'; -const isLoginCancelledError = (error: unknown): error is Meteor.Error => - error instanceof Meteor.Error && error.error === Accounts.LoginCancelledError.numericError; - -export const reportError = (error: T, callback?: (error?: T) => void): void => { - if (callback) { - callback(error); - return; - } - - throw error; -}; - -export const convertError = (error: T): Accounts.LoginCancelledError | T => { - if (isLoginCancelledError(error)) { - return new Accounts.LoginCancelledError(error.reason); - } - - return error; -}; +export const isTotpMaxAttemptsError = ( + error: unknown, +): error is Meteor.Error & ({ error: 'totp-max-attempts' } | { errorType: 'totp-max-attempts' }) => + (error as { error?: unknown } | undefined)?.error === 'totp-max-attempts' || + (error as { errorType?: unknown } | undefined)?.errorType === 'totp-max-attempts'; diff --git a/apps/meteor/client/lib/VideoConfManager.ts b/apps/meteor/client/lib/VideoConfManager.ts index 42aa92a7be0e..7ae1c04db6df 100644 --- a/apps/meteor/client/lib/VideoConfManager.ts +++ b/apps/meteor/client/lib/VideoConfManager.ts @@ -3,7 +3,6 @@ import { Emitter } from '@rocket.chat/emitter'; import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; -import { Notifications } from '../../app/notifications/client'; import { sdk } from '../../app/utils/client/lib/SDKClient'; import { getConfig } from './utils/getConfig'; @@ -507,14 +506,14 @@ export const VideoConfManager = new (class VideoConfManager extends Emitter { - return Notifications.notifyUser(uid, 'video-conference', { action, params }); + return sdk.publish('notify-user', [`${uid}/video-conference`, { action, params }]); } private async connectUser(userId: string): Promise { debug && console.log(`[VideoConf] connecting user ${userId}`); this.userId = userId; - const { stop, ready } = Notifications.onUser('video-conference', (data) => this.onVideoConfNotification(data)); + const { stop, ready } = sdk.stream('notify-user', [`${userId}/video-conference`], (data) => this.onVideoConfNotification(data)); await ready(); diff --git a/apps/meteor/client/lib/appLayout.tsx b/apps/meteor/client/lib/appLayout.tsx index 1c39e3dece10..3962a0f300cb 100644 --- a/apps/meteor/client/lib/appLayout.tsx +++ b/apps/meteor/client/lib/appLayout.tsx @@ -7,6 +7,7 @@ const BannerRegion = lazy(() => import('../views/banners/BannerRegion')); const PortalsWrapper = lazy(() => import('../views/root/PortalsWrapper')); const ModalRegion = lazy(() => import('../views/modal/ModalRegion')); const ActionManagerBusyState = lazy(() => import('../components/ActionManagerBusyState')); +const CloudAnnouncementsRegion = lazy(() => import('../views/cloud/CloudAnnouncementsRegion')); type AppLayoutDescriptor = ReactElement | null; @@ -23,10 +24,6 @@ class AppLayoutSubscription extends Emitter<{ update: void }> { } render(element: ReactElement): void { - this.setCurrentValue(this.wrap(element)); - } - - renderStandalone(element: ReactElement): void { this.setCurrentValue(element); } @@ -35,6 +32,7 @@ class AppLayoutSubscription extends Emitter<{ update: void }> { <> + {element} diff --git a/apps/meteor/client/lib/banners.ts b/apps/meteor/client/lib/banners.ts index 89310da2e3c7..fb8f51a8f152 100644 --- a/apps/meteor/client/lib/banners.ts +++ b/apps/meteor/client/lib/banners.ts @@ -1,6 +1,6 @@ -import type { UiKitBannerPayload } from '@rocket.chat/core-typings'; import { Emitter } from '@rocket.chat/emitter'; import type { Keys as IconName } from '@rocket.chat/icons'; +import type * as UiKit from '@rocket.chat/ui-kit'; export type LegacyBannerPayload = { id: string; @@ -15,7 +15,7 @@ export type LegacyBannerPayload = { onClose?: () => Promise | void; }; -type BannerPayload = LegacyBannerPayload | UiKitBannerPayload; +type BannerPayload = LegacyBannerPayload | UiKit.BannerView; export const isLegacyPayload = (payload: BannerPayload): payload is LegacyBannerPayload => !('blocks' in payload); @@ -32,10 +32,15 @@ export const firstSubscription = [ export const open = (payload: BannerPayload): void => { let index = queue.findIndex((_payload) => { - if (isLegacyPayload(_payload)) { - return _payload.id === (payload as LegacyBannerPayload).id; + if (isLegacyPayload(_payload) && isLegacyPayload(payload)) { + return _payload.id === payload.id; } - return (_payload as UiKitBannerPayload).viewId === (payload as UiKitBannerPayload).viewId; + + if (!isLegacyPayload(_payload) && !isLegacyPayload(payload)) { + return _payload.viewId === payload.viewId; + } + + return false; }); if (index === -1) { diff --git a/apps/meteor/client/lib/chats/ChatAPI.ts b/apps/meteor/client/lib/chats/ChatAPI.ts index 8242de07d791..ceffab987a64 100644 --- a/apps/meteor/client/lib/chats/ChatAPI.ts +++ b/apps/meteor/client/lib/chats/ChatAPI.ts @@ -1,5 +1,5 @@ import type { IMessage, IRoom, ISubscription } from '@rocket.chat/core-typings'; -import type { UIEvent } from 'react'; +import type { IActionManager } from '@rocket.chat/ui-contexts'; import type { FormattingButton } from '../../../app/ui-message/client/messageBox/messageBoxFormatting'; import type { Subscribable } from '../../definitions/Subscribable'; @@ -125,11 +125,6 @@ export type ChatAPI = { } | undefined; - readonly userCard: { - open(username: string): (event: UIEvent) => void; - close(): void; - }; - readonly emojiPicker: { open(el: Element, cb: (emoji: string) => void): void; close(): void; @@ -141,7 +136,7 @@ export type ChatAPI = { performContinuously(action: 'recording' | 'uploading' | 'playing'): void; }; - ActionManager: any; + ActionManager: IActionManager; readonly flows: { readonly uploadFiles: (files: readonly File[], resetFileInput?: () => void) => Promise; diff --git a/apps/meteor/client/lib/chats/flows/processSlashCommand.ts b/apps/meteor/client/lib/chats/flows/processSlashCommand.ts index 1551f8eb1f57..52fa050c743f 100644 --- a/apps/meteor/client/lib/chats/flows/processSlashCommand.ts +++ b/apps/meteor/client/lib/chats/flows/processSlashCommand.ts @@ -4,7 +4,6 @@ import { escapeHTML } from '@rocket.chat/string-helpers'; import { hasAtLeastOnePermission } from '../../../../app/authorization/client'; import { settings } from '../../../../app/settings/client'; -import { generateTriggerId } from '../../../../app/ui-message/client/ActionManager'; import { slashCommands } from '../../../../app/utils/client'; import { sdk } from '../../../../app/utils/client/lib/SDKClient'; import { t } from '../../../../app/utils/lib/i18n'; @@ -78,7 +77,7 @@ export const processSlashCommand = async (chat: ChatAPI, message: IMessage): Pro params: [{ eventName: 'slashCommandsStats', timestamp: Date.now(), command: commandName }], }); - const triggerId = generateTriggerId(appId); + const triggerId = chat.ActionManager.generateTriggerId(appId); const data = { cmd: commandName, @@ -89,7 +88,7 @@ export const processSlashCommand = async (chat: ChatAPI, message: IMessage): Pro try { if (appId) { - chat.ActionManager.events.emit('busy', { busy: true }); + chat.ActionManager.notifyBusy(); } const result = await sdk.call('slashCommand', { cmd: commandName, params, msg: message, triggerId }); @@ -101,7 +100,7 @@ export const processSlashCommand = async (chat: ChatAPI, message: IMessage): Pro } if (appId) { - chat.ActionManager.events.emit('busy', { busy: false }); + chat.ActionManager.notifyIdle(); } return true; diff --git a/apps/meteor/client/lib/chats/flows/uploadFiles.ts b/apps/meteor/client/lib/chats/flows/uploadFiles.ts index 1411ad5a004e..82572aa2dbf5 100644 --- a/apps/meteor/client/lib/chats/flows/uploadFiles.ts +++ b/apps/meteor/client/lib/chats/flows/uploadFiles.ts @@ -46,7 +46,7 @@ export const uploadFiles = async (chat: ChatAPI, files: readonly File[], resetFi imperativeModal.close(); uploadNextFile(); }, - invalidContentType: Boolean(file.type && !fileUploadIsValidContentType(file.type)), + invalidContentType: !(file.type && fileUploadIsValidContentType(file.type)), }, }); }; diff --git a/apps/meteor/client/lib/constants.ts b/apps/meteor/client/lib/constants.ts index 7e437deb7fd2..89052eea93ac 100644 --- a/apps/meteor/client/lib/constants.ts +++ b/apps/meteor/client/lib/constants.ts @@ -1,4 +1,3 @@ export const USER_STATUS_TEXT_MAX_LENGTH = 120; export const BIO_TEXT_MAX_LENGTH = 260; export const VIDEOCONF_STACK_MAX_USERS = 6; -export const CLOUD_CONSOLE_URL = 'https://cloud.rocket.chat'; diff --git a/apps/meteor/client/lib/imperativeModal.ts b/apps/meteor/client/lib/imperativeModal.ts deleted file mode 100644 index fda71ea5eafb..000000000000 --- a/apps/meteor/client/lib/imperativeModal.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { Emitter } from '@rocket.chat/emitter'; -import type { ComponentType } from 'react'; - -type ReactModalDescriptor = { - component: ComponentType; - props?: TProps; -}; - -type ModalDescriptor = ReactModalDescriptor> | null; - -type ModalInstance = { - close: () => void; - cancel: () => void; -}; - -class ImperativeModalEmmiter extends Emitter<{ update: ModalDescriptor }> { - private modalStack: ModalDescriptor[] = []; - - update(descriptor: ModalDescriptor): void { - this.emit('update', descriptor); - } - - open = (descriptor: ReactModalDescriptor): ModalInstance => { - this.modalStack = [descriptor as ModalDescriptor]; - // There are some TS shenanigans causing errors if this is not asserted - // Since this method is for internal use only, it's ok to use this here - // This will not affect prop types inference when using the method. - this.update(descriptor as ModalDescriptor); - - return { - close: () => { - this.modalStack = this.modalStack.filter((modal) => modal !== this.current); - this.update(this.current); - }, - cancel: this.close, - }; - }; - - push = (descriptor: ReactModalDescriptor): ModalInstance => { - this.modalStack = [...this.modalStack, descriptor as ModalDescriptor]; - this.update(descriptor as ModalDescriptor); - - return { - close: () => { - this.modalStack = this.modalStack.filter((modal) => modal !== this.current); - this.update(this.current); - }, - cancel: this.close, - }; - }; - - close = (): void => { - this.modalStack = this.modalStack.slice(0, -1); - this.update(this.current); - }; - - get current(): ModalDescriptor { - return this.modalStack[this.modalStack.length - 1] ?? null; - } -} - -export const imperativeModal = new ImperativeModalEmmiter(); diff --git a/apps/meteor/client/lib/imperativeModal.tsx b/apps/meteor/client/lib/imperativeModal.tsx new file mode 100644 index 000000000000..29543e539c12 --- /dev/null +++ b/apps/meteor/client/lib/imperativeModal.tsx @@ -0,0 +1,57 @@ +import { Emitter } from '@rocket.chat/emitter'; +import React, { Suspense, createElement } from 'react'; +import type { ComponentType, ReactNode } from 'react'; + +import { modalStore } from '../providers/ModalProvider/ModalStore'; + +type ReactModalDescriptor = { + component: ComponentType; + props?: TProps; +}; + +type ModalDescriptor = ReactModalDescriptor> | null; + +type ModalInstance = { + close: () => void; + cancel: () => void; +}; + +const mapCurrentModal = (descriptor: ModalDescriptor): ReactNode => { + if (descriptor === null) { + return null; + } + + if ('component' in descriptor) { + return ( + }> + {createElement(descriptor.component, { + key: Math.random(), + ...descriptor.props, + })} + + ); + } +}; + +class ImperativeModalEmmiter extends Emitter<{ update: ModalDescriptor }> { + private store: typeof modalStore; + + constructor(store: typeof modalStore) { + super(); + this.store = store; + } + + open = (descriptor: ReactModalDescriptor): ModalInstance => { + return this.store.open(mapCurrentModal(descriptor as ModalDescriptor)); + }; + + push = (descriptor: ReactModalDescriptor): ModalInstance => { + return this.store.push(mapCurrentModal(descriptor as ModalDescriptor)); + }; + + close = () => { + this.store.close(); + }; +} + +export const imperativeModal = new ImperativeModalEmmiter(modalStore); diff --git a/apps/meteor/client/lib/lists/ImagesList.ts b/apps/meteor/client/lib/lists/ImagesList.ts new file mode 100644 index 000000000000..540d5bb1c0f7 --- /dev/null +++ b/apps/meteor/client/lib/lists/ImagesList.ts @@ -0,0 +1,39 @@ +import type { IUpload } from '@rocket.chat/core-typings'; + +import { RecordList } from './RecordList'; + +type FilesMessage = Omit & Required>; + +export type ImagesListOptions = { + roomId: Required['rid']; + startingFromId: string; + count?: number; + offset?: number; +}; + +const isFileMessageInRoom = (upload: IUpload, rid: IUpload['rid']): upload is FilesMessage => upload.rid === rid && 'rid' in upload; + +export class ImagesList extends RecordList { + public constructor(private _options: ImagesListOptions) { + super(); + } + + public get options(): ImagesListOptions { + return this._options; + } + + public updateFilters(options: ImagesListOptions): void { + this._options = options; + this.clear(); + } + + protected filter(message: IUpload): boolean { + const { roomId } = this._options; + + if (!isFileMessageInRoom(message, roomId)) { + return false; + } + + return true; + } +} diff --git a/apps/meteor/client/lib/loginServices.ts b/apps/meteor/client/lib/loginServices.ts new file mode 100644 index 000000000000..ad5ee926ccc7 --- /dev/null +++ b/apps/meteor/client/lib/loginServices.ts @@ -0,0 +1,147 @@ +import type { LoginServiceConfiguration } from '@rocket.chat/core-typings'; +import { Emitter } from '@rocket.chat/emitter'; +import { capitalize } from '@rocket.chat/string-helpers'; +import type { LoginService } from '@rocket.chat/ui-contexts'; + +import { sdk } from '../../app/utils/client/lib/SDKClient'; + +type LoginServicesEvents = { + changed: undefined; + loaded: LoginServiceConfiguration[]; +}; + +type LoadState = 'loaded' | 'loading' | 'error' | 'none'; + +const maxRetries = 3; +const timeout = 10000; + +class LoginServices extends Emitter { + private retries = 0; + + private services: LoginServiceConfiguration[] = []; + + private serviceButtons: LoginService[] = []; + + private state: LoadState = 'none'; + + private config: Record> = { + 'apple': { title: 'Apple', icon: 'apple' }, + 'facebook': { title: 'Facebook', icon: 'facebook' }, + 'twitter': { title: 'Twitter', icon: 'twitter' }, + 'google': { title: 'Google', icon: 'google' }, + 'github': { title: 'Github', icon: 'github' }, + 'github_enterprise': { title: 'Github Enterprise', icon: 'github' }, + 'gitlab': { title: 'Gitlab', icon: 'gitlab' }, + 'dolphin': { title: 'Dolphin', icon: 'dophin' }, + 'drupal': { title: 'Drupal', icon: 'drupal' }, + 'nextcloud': { title: 'Nextcloud', icon: 'nextcloud' }, + 'tokenpass': { title: 'Tokenpass', icon: 'tokenpass' }, + 'meteor-developer': { title: 'Meteor', icon: 'meteor' }, + 'wordpress': { title: 'WordPress', icon: 'wordpress' }, + 'linkedin': { title: 'Linkedin', icon: 'linkedin' }, + }; + + private setServices(state: LoadState, services: LoginServiceConfiguration[]) { + this.services = services; + this.state = state; + + this.generateServiceButtons(); + + if (state === 'loaded') { + this.retries = 0; + this.emit('loaded', services); + } + } + + private generateServiceButtons(): void { + const filtered = this.services.filter((config) => !('showButton' in config) || config.showButton !== false) || []; + const sorted = filtered.sort(({ service: service1 }, { service: service2 }) => service1.localeCompare(service2)); + this.serviceButtons = sorted.map((service) => { + // Remove the appId attribute if present + const { appId: _, ...serviceData } = { + ...service, + appId: undefined, + }; + + // Get the hardcoded title and icon, or fallback to capitalizing the service name + const serviceConfig = this.config[service.service] || { + title: capitalize(service.service), + }; + + return { + ...serviceData, + ...serviceConfig, + }; + }); + + this.emit('changed'); + } + + public getLoginService = LoginServiceConfiguration>(serviceName: string): T | undefined { + if (!this.ready) { + return; + } + + return this.services.find(({ service }) => service === serviceName) as T | undefined; + } + + public async loadLoginService = LoginServiceConfiguration>( + serviceName: string, + ): Promise { + if (this.ready) { + return this.getLoginService(serviceName); + } + + return new Promise((resolve, reject) => { + this.onLoad(() => resolve(this.getLoginService(serviceName))); + + setTimeout(() => reject(new Error('LoadLoginService timeout')), timeout); + }); + } + + public get ready() { + return this.state === 'loaded'; + } + + public getLoginServiceButtons(): LoginService[] { + if (!this.ready) { + if (this.state === 'none') { + void this.loadServices(); + } + } + + return this.serviceButtons; + } + + public onLoad(callback: (services: LoginServiceConfiguration[]) => void) { + if (this.ready) { + return callback(this.services); + } + + void this.loadServices(); + this.once('loaded', callback); + } + + public async loadServices(): Promise { + if (this.state === 'error') { + if (this.retries >= maxRetries) { + return; + } + this.retries++; + } else if (this.state !== 'none') { + return; + } + + try { + this.state = 'loading'; + const { configurations } = await sdk.rest.get('/v1/service.configurations'); + + this.setServices('loaded', configurations); + } catch (e) { + this.setServices('error', []); + throw e; + } + } +} + +export const loginServices = new LoginServices(); diff --git a/apps/meteor/client/lib/meteorCallWrapper.ts b/apps/meteor/client/lib/meteorCallWrapper.ts deleted file mode 100644 index b5a2f8785a69..000000000000 --- a/apps/meteor/client/lib/meteorCallWrapper.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { DDPCommon } from 'meteor/ddp-common'; -import { Meteor } from 'meteor/meteor'; -import { Tracker } from 'meteor/tracker'; - -import { sdk } from '../../app/utils/client/lib/SDKClient'; - -const bypassMethods: string[] = ['setUserStatus', 'logout']; - -function shouldBypass({ method, params }: Meteor.IDDPMessage): boolean { - if (method === 'login' && params[0]?.resume) { - return true; - } - - if (method.startsWith('UserPresence:') || bypassMethods.includes(method)) { - return true; - } - - if (method.startsWith('stream-')) { - return true; - } - - return false; -} - -function wrapMeteorDDPCalls(): void { - const { _send } = Meteor.connection; - - Meteor.connection._send = function _DDPSendOverREST(message): void { - if (message.msg !== 'method' || shouldBypass(message)) { - return _send.call(Meteor.connection, message); - } - - const endpoint = Tracker.nonreactive(() => (!Meteor.userId() ? 'method.callAnon' : 'method.call')); - - const restParams = { - message: DDPCommon.stringifyDDP({ ...message }), - }; - - const processResult = (_message: any): void => { - // Prevent error on reconnections and method retry. - // On those cases the API will be called 2 times but - // the handler will be deleted after the first execution. - if (!Meteor.connection._methodInvokers[message.id]) { - return; - } - Meteor.connection._livedata_data({ - msg: 'updated', - methods: [message.id], - }); - Meteor.connection.onMessage(_message); - }; - const method = encodeURIComponent(message.method.replace(/\//g, ':')); - - sdk.rest - .post(`/v1/${endpoint}/${method}`, restParams) - .then(({ message: _message }) => { - processResult(_message); - if (message.method === 'login') { - const parsedMessage = DDPCommon.parseDDP(_message as any) as { result?: { token?: string } }; - if (parsedMessage.result?.token) { - Meteor.loginWithToken(parsedMessage.result.token); - } - } - }) - .catch((error) => { - console.error(error); - }); - }; -} - -window.USE_REST_FOR_DDP_CALLS && wrapMeteorDDPCalls(); diff --git a/apps/meteor/client/lib/openCASLoginPopup.ts b/apps/meteor/client/lib/openCASLoginPopup.ts new file mode 100644 index 000000000000..d82a48599e4b --- /dev/null +++ b/apps/meteor/client/lib/openCASLoginPopup.ts @@ -0,0 +1,62 @@ +import { Meteor } from 'meteor/meteor'; + +import { settings } from '../../app/settings/client'; + +const openCenteredPopup = (url: string, width: number, height: number) => { + const screenX = window.screenX ?? window.screenLeft; + const screenY = window.screenY ?? window.screenTop; + const outerWidth = window.outerWidth ?? document.body.clientWidth; + const outerHeight = window.outerHeight ?? document.body.clientHeight - 22; + // XXX what is the 22? Probably the height of the title bar. + // Use `outerWidth - width` and `outerHeight - height` for help in + // positioning the popup centered relative to the current window + const left = screenX + (outerWidth - width) / 2; + const top = screenY + (outerHeight - height) / 2; + const features = `width=${width},height=${height},left=${left},top=${top},scrollbars=yes`; + + const newwindow = window.open(url, 'Login', features); + + if (!newwindow) { + throw new Error('Could not open popup'); + } + + newwindow.focus(); + + return newwindow; +}; + +const getPopupUrl = (credentialToken: string): string => { + const loginUrl = settings.get('CAS_login_url'); + + if (!loginUrl) { + throw new Error('CAS_login_url not set'); + } + + const appUrl = Meteor.absoluteUrl().replace(/\/$/, '') + __meteor_runtime_config__.ROOT_URL_PATH_PREFIX; + const serviceUrl = `${appUrl}/_cas/${credentialToken}`; + const url = new URL(loginUrl); + url.searchParams.set('service', serviceUrl); + + return url.href; +}; + +const waitForPopupClose = (popup: Window) => { + return new Promise((resolve) => { + const checkPopupOpen = setInterval(() => { + if (popup.closed || popup.closed === undefined) { + clearInterval(checkPopupOpen); + resolve(); + } + }, 100); + }); +}; + +export const openCASLoginPopup = async (credentialToken: string) => { + const popupWidth = settings.get('CAS_popup_width') || 800; + const popupHeight = settings.get('CAS_popup_height') || 600; + + const popupUrl = getPopupUrl(credentialToken); + const popup = openCenteredPopup(popupUrl, popupWidth, popupHeight); + + await waitForPopupClose(popup); +}; diff --git a/apps/meteor/client/lib/parseMessageTextToAstMarkdown.ts b/apps/meteor/client/lib/parseMessageTextToAstMarkdown.ts index 15a88c847fce..41cbfed95750 100644 --- a/apps/meteor/client/lib/parseMessageTextToAstMarkdown.ts +++ b/apps/meteor/client/lib/parseMessageTextToAstMarkdown.ts @@ -3,6 +3,7 @@ import { isFileAttachment, isE2EEMessage, isOTRMessage, + isOTRAckMessage, isQuoteAttachment, isTranslatedAttachment, isTranslatedMessage, @@ -46,7 +47,7 @@ export const parseMessageTextToAstMarkdown = < return { ...msg, md: - isE2EEMessage(message) || isOTRMessage(message) || translated + isE2EEMessage(message) || isOTRMessage(message) || isOTRAckMessage(message) || translated ? textToMessageToken(text, parseOptions) : msg.md ?? textToMessageToken(text, parseOptions), ...(msg.attachments && { diff --git a/apps/meteor/client/lib/portals/portalsSubscription.ts b/apps/meteor/client/lib/portals/portalsSubscription.ts index 24295d624936..513393eb983a 100644 --- a/apps/meteor/client/lib/portals/portalsSubscription.ts +++ b/apps/meteor/client/lib/portals/portalsSubscription.ts @@ -1,9 +1,9 @@ import { Emitter } from '@rocket.chat/emitter'; import { Random } from '@rocket.chat/random'; -import type { ReactElement } from 'react'; +import type { ReactPortal } from 'react'; type SubscribedPortal = { - portal: ReactElement; + portal: ReactPortal; key: string; }; @@ -11,7 +11,7 @@ type PortalsSubscription = { subscribe: (callback: () => void) => () => void; getSnapshot: () => SubscribedPortal[]; has: (key: unknown) => boolean; - set: (key: unknown, portal: ReactElement) => void; + set: (key: unknown, portal: ReactPortal) => void; delete: (key: unknown) => void; }; @@ -43,7 +43,7 @@ export const unregisterPortal = (key: unknown): void => { portalsSubscription.delete(key); }; -export const registerPortal = (key: unknown, portal: ReactElement): (() => void) => { +export const registerPortal = (key: unknown, portal: ReactPortal): (() => void) => { portalsSubscription.set(key, portal); return (): void => { unregisterPortal(key); diff --git a/apps/meteor/client/lib/presence.ts b/apps/meteor/client/lib/presence.ts index 8cb367bf1e52..dbaddcbe405b 100644 --- a/apps/meteor/client/lib/presence.ts +++ b/apps/meteor/client/lib/presence.ts @@ -6,8 +6,6 @@ import { Meteor } from 'meteor/meteor'; import { sdk } from '../../app/utils/client/lib/SDKClient'; -export const STATUS_MAP = [UserStatus.OFFLINE, UserStatus.ONLINE, UserStatus.AWAY, UserStatus.BUSY, UserStatus.DISABLED]; - type InternalEvents = { remove: IUser['_id']; reset: undefined; diff --git a/apps/meteor/client/lib/settings/PrivateSettingsCachedCollection.ts b/apps/meteor/client/lib/settings/PrivateSettingsCachedCollection.ts index 560d604534ed..b0276e753922 100644 --- a/apps/meteor/client/lib/settings/PrivateSettingsCachedCollection.ts +++ b/apps/meteor/client/lib/settings/PrivateSettingsCachedCollection.ts @@ -1,18 +1,18 @@ import type { ISetting } from '@rocket.chat/core-typings'; -import { Notifications } from '../../../app/notifications/client'; import { CachedCollection } from '../../../app/ui-cached-collection/client'; +import { sdk } from '../../../app/utils/client/lib/SDKClient'; class PrivateSettingsCachedCollection extends CachedCollection { constructor() { super({ name: 'private-settings', - eventType: 'onLogged', + eventType: 'notify-logged', }); } async setupListener(): Promise { - Notifications.onLogged(this.eventName as 'private-settings-changed', async (t: string, { _id, ...record }: { _id: string }) => { + sdk.stream('notify-logged', [this.eventName as 'private-settings-changed'], async (t: string, { _id, ...record }: { _id: string }) => { this.log('record received', t, { _id, ...record }); this.collection.upsert({ _id }, record); this.sync(); diff --git a/apps/meteor/client/lib/settings/PublicSettingsCachedCollection.ts b/apps/meteor/client/lib/settings/PublicSettingsCachedCollection.ts index 7eab4b1dc7a9..c01523252f85 100644 --- a/apps/meteor/client/lib/settings/PublicSettingsCachedCollection.ts +++ b/apps/meteor/client/lib/settings/PublicSettingsCachedCollection.ts @@ -6,7 +6,7 @@ class PublicSettingsCachedCollection extends CachedCollection { constructor() { super({ name: 'public-settings', - eventType: 'onAll', + eventType: 'notify-all', userRelated: false, }); } diff --git a/apps/meteor/client/lib/userData.ts b/apps/meteor/client/lib/userData.ts index 9e67f4034b1d..ee90f493a30c 100644 --- a/apps/meteor/client/lib/userData.ts +++ b/apps/meteor/client/lib/userData.ts @@ -2,7 +2,6 @@ import type { ILivechatAgent, IUser, Serialized } from '@rocket.chat/core-typing import { ReactiveVar } from 'meteor/reactive-var'; import { Users } from '../../app/models/client'; -import { Notifications } from '../../app/notifications/client'; import { sdk } from '../../app/utils/client/lib/SDKClient'; export const isSyncReady = new ReactiveVar(false); @@ -60,7 +59,7 @@ export const synchronizeUserData = async (uid: IUser['_id']): Promise { + const result = sdk.stream('notify-user', [`${uid}/userData`], (data) => { switch (data.type) { case 'inserted': // eslint-disable-next-line @typescript-eslint/no-unused-vars @@ -122,7 +121,7 @@ export const synchronizeUserData = async (uid: IUser['_id']): Promise ({ expire: new Date(expire), ...data })) || [], + ...(emailCode ? { ...emailCode, expire: new Date(emailCode.expire) } : {}), ...(email2fa ? { email2fa: { ...email2fa, changedAt: new Date(email2fa.changedAt) } } : {}), ...(email?.verificationTokens && { email: { diff --git a/apps/meteor/client/lib/userStatuses.ts b/apps/meteor/client/lib/userStatuses.ts new file mode 100644 index 000000000000..631c1d1ea044 --- /dev/null +++ b/apps/meteor/client/lib/userStatuses.ts @@ -0,0 +1,90 @@ +import { UserStatus } from '@rocket.chat/core-typings'; +import type { ICustomUserStatus } from '@rocket.chat/core-typings'; + +import { sdk } from '../../app/utils/client/lib/SDKClient'; + +export type UserStatusDescriptor = { + id: string; + name: string; + statusType: UserStatus; + localizeName: boolean; +}; + +export class UserStatuses implements Iterable { + public invisibleAllowed = true; + + private store: Map = new Map( + [UserStatus.ONLINE, UserStatus.AWAY, UserStatus.BUSY, UserStatus.OFFLINE].map((status) => [ + status, + { + id: status, + name: status, + statusType: status, + localizeName: true, + }, + ]), + ); + + public delete(id: string): void { + this.store.delete(id); + } + + public put(customUserStatus: UserStatusDescriptor): void { + this.store.set(customUserStatus.id, customUserStatus); + } + + public createFromCustom(customUserStatus: ICustomUserStatus): UserStatusDescriptor { + if (!this.isValidType(customUserStatus.statusType)) { + throw new Error('Invalid user status type'); + } + + return { + name: customUserStatus.name, + id: customUserStatus._id, + statusType: customUserStatus.statusType as UserStatus, + localizeName: false, + }; + } + + public isValidType(type: string): type is UserStatus { + return (Object.values(UserStatus) as string[]).includes(type); + } + + public *[Symbol.iterator]() { + for (const value of this.store.values()) { + if (this.invisibleAllowed || value.statusType !== UserStatus.OFFLINE) { + yield value; + } + } + } + + public async sync() { + const result = await sdk.call('listCustomUserStatus'); + if (!result) { + return; + } + + for (const customStatus of result) { + this.put(this.createFromCustom(customStatus)); + } + } + + public watch(cb?: () => void) { + const updateSubscription = sdk.stream('notify-logged', ['updateCustomUserStatus'], (data) => { + this.put(this.createFromCustom(data.userStatusData)); + cb?.(); + }); + + const deleteSubscription = sdk.stream('notify-logged', ['deleteCustomUserStatus'], (data) => { + this.delete(data.userStatusData._id); + cb?.(); + }); + + return () => { + updateSubscription.stop(); + deleteSubscription.stop(); + }; + } +} + +export const userStatuses = new UserStatuses(); diff --git a/apps/meteor/client/lib/utils/applyCustomTranslations.ts b/apps/meteor/client/lib/utils/applyCustomTranslations.ts deleted file mode 100644 index f629ed1aaace..000000000000 --- a/apps/meteor/client/lib/utils/applyCustomTranslations.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { settings } from '../../../app/settings/client'; -import { i18n } from '../../../app/utils/lib/i18n'; - -const parseToJSON = (customTranslations: string) => { - try { - return JSON.parse(customTranslations); - } catch (e) { - return false; - } -}; - -export const applyCustomTranslations = (): void => { - const customTranslations: string | undefined = settings.get('Custom_Translations'); - - if (!customTranslations || !parseToJSON(customTranslations)) { - return; - } - - try { - const parsedCustomTranslations: Record = JSON.parse(customTranslations); - - for (const [lang, translations] of Object.entries(parsedCustomTranslations)) { - i18n.addResourceBundle(lang, 'core', translations); - } - } catch (e) { - console.error('Invalid setting Custom_Translations', e); - } -}; diff --git a/apps/meteor/client/lib/utils/filterLanguage.ts b/apps/meteor/client/lib/utils/filterLanguage.ts deleted file mode 100644 index 0f6bc9b67d9a..000000000000 --- a/apps/meteor/client/lib/utils/filterLanguage.ts +++ /dev/null @@ -1,10 +0,0 @@ -export const filterLanguage = (language: string): string => { - // Fix browsers having all-lowercase language settings eg. pt-br, en-us - const regex = /([a-z]{2,3})-([a-z]{2,4})/; - const matches = regex.exec(language); - if (matches) { - return `${matches[1]}-${matches[2].toUpperCase()}`; - } - - return language; -}; diff --git a/apps/meteor/client/lib/utils/getUidDirectMessage.ts b/apps/meteor/client/lib/utils/getUidDirectMessage.ts index cb5ef83c825f..761b849f7883 100644 --- a/apps/meteor/client/lib/utils/getUidDirectMessage.ts +++ b/apps/meteor/client/lib/utils/getUidDirectMessage.ts @@ -3,12 +3,12 @@ import { Meteor } from 'meteor/meteor'; import { ChatRoom } from '../../../app/models/client'; -export const getUidDirectMessage = (rid: IRoom['_id'], userId: IUser['_id'] | null = Meteor.userId()): string | undefined => { - const room = ChatRoom.findOne({ _id: rid }, { fields: { uids: 1 } }); +export const getUidDirectMessage = (rid: IRoom['_id'], uid: IUser['_id'] | null = Meteor.userId()): string | undefined => { + const room = ChatRoom.findOne({ _id: rid }, { fields: { t: 1, uids: 1 } }); - if (!room?.uids || room.uids.length > 2) { + if (!room || room.t !== 'd' || !room.uids || room.uids.length > 2) { return undefined; } - return room.uids.filter((uid) => uid !== userId)[0]; + return room.uids.filter((_uid) => _uid !== uid)[0]; }; diff --git a/apps/meteor/client/lib/utils/isOverLicenseLimits.ts b/apps/meteor/client/lib/utils/isOverLicenseLimits.ts new file mode 100644 index 000000000000..957500c1ac30 --- /dev/null +++ b/apps/meteor/client/lib/utils/isOverLicenseLimits.ts @@ -0,0 +1,12 @@ +import type { LicenseLimitKind } from '@rocket.chat/core-typings'; + +type Limits = Record< + LicenseLimitKind, + { + max: number; + value?: number; + } +>; + +export const isOverLicenseLimits = (limits: Limits): boolean => + Object.values(limits).some((limit) => limit.value !== undefined && limit.max > 0 && limit.value > limit.max); diff --git a/apps/meteor/client/lib/utils/preventSyntheticEvent.ts b/apps/meteor/client/lib/utils/preventSyntheticEvent.ts new file mode 100644 index 000000000000..773b53a1a88c --- /dev/null +++ b/apps/meteor/client/lib/utils/preventSyntheticEvent.ts @@ -0,0 +1,9 @@ +import type { SyntheticEvent } from 'react'; + +export const preventSyntheticEvent = (e: SyntheticEvent): void => { + if (e) { + (e.nativeEvent || e).stopImmediatePropagation(); + e.stopPropagation(); + e.preventDefault(); + } +}; diff --git a/apps/meteor/client/lib/utils/setMessageJumpQueryStringParameter.ts b/apps/meteor/client/lib/utils/setMessageJumpQueryStringParameter.ts index 74055930ef3b..6e94fe790235 100644 --- a/apps/meteor/client/lib/utils/setMessageJumpQueryStringParameter.ts +++ b/apps/meteor/client/lib/utils/setMessageJumpQueryStringParameter.ts @@ -1,13 +1,15 @@ import type { IMessage } from '@rocket.chat/core-typings'; +import type { LocationPathname } from '@rocket.chat/ui-contexts'; import { router } from '../../providers/RouterProvider'; export const setMessageJumpQueryStringParameter = async (msg: IMessage['_id'] | null) => { const { msg: _, ...search } = router.getSearchParameters(); + const locationPathname = new URL(window.location.href).pathname as LocationPathname; router.navigate( { - pathname: router.getLocationPathname(), + pathname: locationPathname, search: msg ? { ...search, msg } : search, }, { replace: true }, diff --git a/apps/meteor/client/lib/utils/window.RocketChatDesktop.d.ts b/apps/meteor/client/lib/utils/window.RocketChatDesktop.d.ts deleted file mode 100644 index a7f625fc0705..000000000000 --- a/apps/meteor/client/lib/utils/window.RocketChatDesktop.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -type OutlookEventsResponse = { status: 'success' | 'canceled' }; - -// eslint-disable-next-line @typescript-eslint/naming-convention -interface Window { - RocketChatDesktop: - | { - openInternalVideoChatWindow?: (url: string, options: { providerName: string | undefined }) => void; - getOutlookEvents?: (date: Date) => Promise; - setOutlookExchangeUrl?: (url: string, userId: string) => Promise; - hasOutlookCredentials?: () => Promise; - clearOutlookCredentials?: () => void; - } - | undefined; -} diff --git a/apps/meteor/ee/client/lib/voip/parseOutboundPhoneNumber.ts b/apps/meteor/client/lib/voip/parseOutboundPhoneNumber.ts similarity index 100% rename from apps/meteor/ee/client/lib/voip/parseOutboundPhoneNumber.ts rename to apps/meteor/client/lib/voip/parseOutboundPhoneNumber.ts diff --git a/apps/meteor/client/lib/wrapRequestCredentialFn.ts b/apps/meteor/client/lib/wrapRequestCredentialFn.ts new file mode 100644 index 000000000000..12102187de30 --- /dev/null +++ b/apps/meteor/client/lib/wrapRequestCredentialFn.ts @@ -0,0 +1,52 @@ +import type { OAuthConfiguration } from '@rocket.chat/core-typings'; +import { Accounts } from 'meteor/accounts-base'; +import type { Meteor } from 'meteor/meteor'; +import { OAuth } from 'meteor/oauth'; + +import { loginServices } from './loginServices'; + +type RequestCredentialOptions = Meteor.LoginWithExternalServiceOptions; +type RequestCredentialCallback = (credentialTokenOrError?: string | Error) => void; + +type RequestCredentialConfig> = { + config: T; + loginStyle: string; + options: RequestCredentialOptions; + credentialRequestCompleteCallback?: RequestCredentialCallback; +}; + +export function wrapRequestCredentialFn>( + serviceName: string, + fn: (params: RequestCredentialConfig) => void, +) { + const wrapped = async ( + options: RequestCredentialOptions, + credentialRequestCompleteCallback?: RequestCredentialCallback, + ): Promise => { + const config = await loginServices.loadLoginService(serviceName); + if (!config) { + credentialRequestCompleteCallback?.(new Accounts.ConfigError()); + return; + } + + const loginStyle = OAuth._loginStyle(serviceName, config, options); + fn({ + config, + loginStyle, + options, + credentialRequestCompleteCallback, + }); + }; + + return ( + options?: RequestCredentialOptions | RequestCredentialCallback, + credentialRequestCompleteCallback?: RequestCredentialCallback, + ) => { + if (!credentialRequestCompleteCallback && typeof options === 'function') { + void wrapped({}, options); + return; + } + + void wrapped(options as RequestCredentialOptions, credentialRequestCompleteCallback); + }; +} diff --git a/apps/meteor/client/main.ts b/apps/meteor/client/main.ts index 334515980787..0a35c44a10be 100644 --- a/apps/meteor/client/main.ts +++ b/apps/meteor/client/main.ts @@ -1,3 +1,5 @@ +import './startup/accounts'; + import { FlowRouter } from 'meteor/kadira:flow-router'; FlowRouter.wait(); @@ -7,7 +9,7 @@ FlowRouter.notFound = { }; import('./polyfills') - .then(() => Promise.all([import('./lib/meteorCallWrapper'), import('../lib/oauthRedirectUriClient')])) + .then(() => import('./meteorOverrides')) .then(() => import('../ee/client/ecdh')) .then(() => import('./importPackages')) .then(() => Promise.all([import('./methods'), import('./startup')])) diff --git a/apps/meteor/client/meteorOverrides/ddpOverREST.ts b/apps/meteor/client/meteorOverrides/ddpOverREST.ts new file mode 100644 index 000000000000..9bd2021ec027 --- /dev/null +++ b/apps/meteor/client/meteorOverrides/ddpOverREST.ts @@ -0,0 +1,76 @@ +import { DDPCommon } from 'meteor/ddp-common'; +import { Meteor } from 'meteor/meteor'; +import { Tracker } from 'meteor/tracker'; + +import { sdk } from '../../app/utils/client/lib/SDKClient'; + +const bypassMethods: string[] = ['setUserStatus', 'logout']; + +const shouldBypass = ({ msg, method, params }: Meteor.IDDPMessage): boolean => { + if (msg !== 'method') { + return true; + } + + if (method === 'login' && params[0]?.resume) { + return true; + } + + if (method.startsWith('UserPresence:') || bypassMethods.includes(method)) { + return true; + } + + if (method.startsWith('stream-')) { + return true; + } + + return false; +}; + +const withDDPOverREST = (_send: (this: Meteor.IMeteorConnection, message: Meteor.IDDPMessage) => void) => { + return function _sendOverREST(this: Meteor.IMeteorConnection, message: Meteor.IDDPMessage): void { + if (shouldBypass(message)) { + return _send.call(this, message); + } + + const endpoint = Tracker.nonreactive(() => (!Meteor.userId() ? 'method.callAnon' : 'method.call')); + + const restParams = { + message: DDPCommon.stringifyDDP({ ...message }), + }; + + const processResult = (_message: string): void => { + // Prevent error on reconnections and method retry. + // On those cases the API will be called 2 times but + // the handler will be deleted after the first execution. + if (!this._methodInvokers[message.id]) { + return; + } + this._livedata_data({ + msg: 'updated', + methods: [message.id], + }); + this.onMessage(_message); + }; + + const method = encodeURIComponent(message.method.replace(/\//g, ':')); + + sdk.rest + .post(`/v1/${endpoint}/${method}`, restParams) + .then(({ message: _message }) => { + processResult(_message); + if (message.method === 'login') { + const parsedMessage = DDPCommon.parseDDP(_message) as { result?: { token?: string } }; + if (parsedMessage.result?.token) { + Meteor.loginWithToken(parsedMessage.result.token); + } + } + }) + .catch((error) => { + console.error(error); + }); + }; +}; + +if (window.USE_REST_FOR_DDP_CALLS) { + Meteor.connection._send = withDDPOverREST(Meteor.connection._send); +} diff --git a/apps/meteor/client/meteorOverrides/index.ts b/apps/meteor/client/meteorOverrides/index.ts new file mode 100644 index 000000000000..9a1b0eb1f7be --- /dev/null +++ b/apps/meteor/client/meteorOverrides/index.ts @@ -0,0 +1,16 @@ +import './ddpOverREST'; +import './totpOnCall'; +import './oauthRedirectUri'; +import './userAndUsers'; +import './login/cas'; +import './login/crowd'; +import './login/facebook'; +import './login/github'; +import './login/google'; +import './login/ldap'; +import './login/linkedin'; +import './login/meteorDeveloperAccount'; +import './login/oauth'; +import './login/password'; +import './login/saml'; +import './login/twitter'; diff --git a/apps/meteor/client/meteorOverrides/login/cas.ts b/apps/meteor/client/meteorOverrides/login/cas.ts new file mode 100644 index 000000000000..93a9f1d5b236 --- /dev/null +++ b/apps/meteor/client/meteorOverrides/login/cas.ts @@ -0,0 +1,20 @@ +import { Random } from '@rocket.chat/random'; +import { Meteor } from 'meteor/meteor'; + +import { callLoginMethod } from '../../lib/2fa/overrideLoginMethod'; + +declare module 'meteor/meteor' { + // eslint-disable-next-line @typescript-eslint/no-namespace + namespace Meteor { + function loginWithCas(_?: unknown, callback?: (err?: any) => void): void; + } +} + +Meteor.loginWithCas = (_, callback) => { + const credentialToken = Random.id(); + import('../../lib/openCASLoginPopup') + .then(({ openCASLoginPopup }) => openCASLoginPopup(credentialToken)) + .then(() => callLoginMethod({ methodArguments: [{ cas: { credentialToken } }] })) + .then(() => callback?.()) + .catch(callback); +}; diff --git a/apps/meteor/client/meteorOverrides/login/crowd.ts b/apps/meteor/client/meteorOverrides/login/crowd.ts new file mode 100644 index 000000000000..9b1d4b83d402 --- /dev/null +++ b/apps/meteor/client/meteorOverrides/login/crowd.ts @@ -0,0 +1,49 @@ +import { Meteor } from 'meteor/meteor'; + +import { callLoginMethod, handleLogin, type LoginCallback } from '../../lib/2fa/overrideLoginMethod'; + +declare module 'meteor/meteor' { + // eslint-disable-next-line @typescript-eslint/no-namespace + namespace Meteor { + function loginWithCrowd( + userDescriptor: { username: string } | { email: string } | { id: string } | string, + password: string, + callback?: LoginCallback, + ): void; + } +} + +const loginWithCrowd = (userDescriptor: { username: string } | { email: string } | { id: string } | string, password: string) => { + const loginRequest = { + crowd: true, + username: userDescriptor, + crowdPassword: password, + }; + + return callLoginMethod({ methodArguments: [loginRequest] }); +}; + +const loginWithCrowdAndTOTP = ( + userDescriptor: { username: string } | { email: string } | { id: string } | string, + password: string, + code: string, +) => { + const loginRequest = { + crowd: true, + username: userDescriptor, + crowdPassword: password, + }; + + return callLoginMethod({ + methodArguments: [ + { + totp: { + login: loginRequest, + code, + }, + }, + ], + }); +}; + +Meteor.loginWithCrowd = handleLogin(loginWithCrowd, loginWithCrowdAndTOTP); diff --git a/apps/meteor/client/meteorOverrides/login/facebook.ts b/apps/meteor/client/meteorOverrides/login/facebook.ts new file mode 100644 index 000000000000..72a91775818e --- /dev/null +++ b/apps/meteor/client/meteorOverrides/login/facebook.ts @@ -0,0 +1,56 @@ +import type { FacebookOAuthConfiguration } from '@rocket.chat/core-typings'; +import { Random } from '@rocket.chat/random'; +import { Facebook } from 'meteor/facebook-oauth'; +import { Meteor } from 'meteor/meteor'; +import { OAuth } from 'meteor/oauth'; + +import { overrideLoginMethod } from '../../lib/2fa/overrideLoginMethod'; +import { wrapRequestCredentialFn } from '../../lib/wrapRequestCredentialFn'; +import { createOAuthTotpLoginMethod } from './oauth'; + +const { loginWithFacebook } = Meteor; +const loginWithFacebookAndTOTP = createOAuthTotpLoginMethod(Facebook); +Meteor.loginWithFacebook = (options, callback) => { + overrideLoginMethod(loginWithFacebook, [options], callback, loginWithFacebookAndTOTP); +}; + +Facebook.requestCredential = wrapRequestCredentialFn( + 'facebook', + ({ config, loginStyle, options: requestOptions, credentialRequestCompleteCallback }) => { + const options = requestOptions as Meteor.LoginWithExternalServiceOptions & { + absoluteUrlOptions?: Record; + params?: Record; + auth_type?: string; + }; + + const credentialToken = Random.secret(); + const mobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|Windows Phone/i.test(navigator.userAgent); + const display = mobile ? 'touch' : 'popup'; + + const scope = options?.requestPermissions ? options.requestPermissions.join(',') : 'email'; + + const API_VERSION = Meteor.settings?.public?.packages?.['facebook-oauth']?.apiVersion || '17.0'; + + const loginUrlParameters: Record = { + client_id: config.appId, + redirect_uri: OAuth._redirectUri('facebook', config, options.params, options.absoluteUrlOptions), + display, + scope, + state: OAuth._stateParam(loginStyle, credentialToken, options?.redirectUrl), + // Handle authentication type (e.g. for force login you need auth_type: "reauthenticate") + ...(options.auth_type && { auth_type: options.auth_type }), + }; + + const loginUrl = `https://www.facebook.com/v${API_VERSION}/dialog/oauth?${Object.keys(loginUrlParameters) + .map((param) => `${encodeURIComponent(param)}=${encodeURIComponent(loginUrlParameters[param])}`) + .join('&')}`; + + OAuth.launchLogin({ + loginService: 'facebook', + loginStyle, + loginUrl, + credentialRequestCompleteCallback, + credentialToken, + }); + }, +); diff --git a/apps/meteor/client/meteorOverrides/login/github.ts b/apps/meteor/client/meteorOverrides/login/github.ts new file mode 100644 index 000000000000..2a1aa3903317 --- /dev/null +++ b/apps/meteor/client/meteorOverrides/login/github.ts @@ -0,0 +1,42 @@ +import { Random } from '@rocket.chat/random'; +import { Accounts } from 'meteor/accounts-base'; +import { Github } from 'meteor/github-oauth'; +import { Meteor } from 'meteor/meteor'; +import { OAuth } from 'meteor/oauth'; + +import { overrideLoginMethod } from '../../lib/2fa/overrideLoginMethod'; +import { wrapRequestCredentialFn } from '../../lib/wrapRequestCredentialFn'; +import { createOAuthTotpLoginMethod } from './oauth'; + +const { loginWithGithub } = Meteor; +const loginWithGithubAndTOTP = createOAuthTotpLoginMethod(Github); +Meteor.loginWithGithub = (options, callback) => { + overrideLoginMethod(loginWithGithub, [options], callback, loginWithGithubAndTOTP); +}; + +Github.requestCredential = wrapRequestCredentialFn('github', ({ config, loginStyle, options, credentialRequestCompleteCallback }) => { + const credentialToken = Random.secret(); + const scope = options?.requestPermissions || ['user:email']; + const flatScope = scope.map(encodeURIComponent).join('+'); + + let allowSignup = ''; + if (Accounts._options?.forbidClientAccountCreation) { + allowSignup = '&allow_signup=false'; + } + + const loginUrl = + `https://github.com/login/oauth/authorize` + + `?client_id=${config.clientId}` + + `&scope=${flatScope}` + + `&redirect_uri=${OAuth._redirectUri('github', config)}` + + `&state=${OAuth._stateParam(loginStyle, credentialToken, options.redirectUrl)}${allowSignup}`; + + OAuth.launchLogin({ + loginService: 'github', + loginStyle, + loginUrl, + credentialRequestCompleteCallback, + credentialToken, + popupOptions: { width: 900, height: 450 }, + }); +}); diff --git a/apps/meteor/client/meteorOverrides/login/google.ts b/apps/meteor/client/meteorOverrides/login/google.ts new file mode 100644 index 000000000000..4e99ac3a281b --- /dev/null +++ b/apps/meteor/client/meteorOverrides/login/google.ts @@ -0,0 +1,116 @@ +import { Random } from '@rocket.chat/random'; +import { Accounts } from 'meteor/accounts-base'; +import { Google } from 'meteor/google-oauth'; +import { Meteor } from 'meteor/meteor'; +import { OAuth } from 'meteor/oauth'; + +import { overrideLoginMethod, type LoginCallback } from '../../lib/2fa/overrideLoginMethod'; +import { wrapRequestCredentialFn } from '../../lib/wrapRequestCredentialFn'; +import { createOAuthTotpLoginMethod } from './oauth'; + +declare module 'meteor/meteor' { + // eslint-disable-next-line @typescript-eslint/no-namespace + namespace Meteor { + function loginWithGoogle( + options?: + | Meteor.LoginWithExternalServiceOptions & { + loginUrlParameters?: { + include_granted_scopes?: boolean; + hd?: string; + }; + }, + callback?: LoginCallback, + ): void; + } +} + +const { loginWithGoogle } = Meteor; + +const innerLoginWithGoogleAndTOTP = createOAuthTotpLoginMethod(Google); + +const loginWithGoogleAndTOTP = ( + options: + | (Meteor.LoginWithExternalServiceOptions & { + loginUrlParameters?: { + include_granted_scopes?: boolean; + hd?: string; + }; + }) + | undefined, + code: string, + callback?: LoginCallback, +) => { + if (Meteor.isCordova && Google.signIn) { + // After 20 April 2017, Google OAuth login will no longer work from + // a WebView, so Cordova apps must use Google Sign-In instead. + // https://github.com/meteor/meteor/issues/8253 + Google.signIn(options, callback); + return; + } // Use Google's domain-specific login page if we want to restrict creation to + + // a particular email domain. (Don't use it if restrictCreationByEmailDomain + // is a function.) Note that all this does is change Google's UI --- + // accounts-base/accounts_server.js still checks server-side that the server + // has the proper email address after the OAuth conversation. + if (typeof Accounts._options.restrictCreationByEmailDomain === 'string') { + options = Object.assign({}, options || {}); + options.loginUrlParameters = Object.assign({}, options.loginUrlParameters || {}); + options.loginUrlParameters.hd = Accounts._options.restrictCreationByEmailDomain; + } + + innerLoginWithGoogleAndTOTP(options, code, callback); +}; + +Meteor.loginWithGoogle = (options, callback) => { + overrideLoginMethod(loginWithGoogle, [options], callback, loginWithGoogleAndTOTP); +}; + +Google.requestCredential = wrapRequestCredentialFn( + 'google', + ({ config, loginStyle, options: requestOptions, credentialRequestCompleteCallback }) => { + const credentialToken = Random.secret(); + const options = requestOptions as Meteor.LoginWithExternalServiceOptions & { + loginUrlParameters?: { + include_granted_scopes?: boolean; + hd?: string; + }; + prompt?: string; + }; + + const scope = ['email', ...(options.requestPermissions || ['profile'])].join(' '); + + const loginUrlParameters: Record = { + ...options.loginUrlParameters, + ...(options.requestOfflineToken !== undefined && { + access_type: options.requestOfflineToken ? 'offline' : 'online', + }), + ...((options.prompt || options.forceApprovalPrompt) && { prompt: options.prompt || 'consent' }), + ...(options.loginHint && { login_hint: options.loginHint }), + response_type: 'code', + client_id: config.clientId, + scope, + redirect_uri: OAuth._redirectUri('google', config), + state: OAuth._stateParam(loginStyle, credentialToken, options.redirectUrl), + }; + + Object.assign(loginUrlParameters, { + response_type: 'code', + client_id: config.clientId, + scope, + redirect_uri: OAuth._redirectUri('google', config), + state: OAuth._stateParam(loginStyle, credentialToken, options.redirectUrl), + }); + const loginUrl = `https://accounts.google.com/o/oauth2/auth?${Object.keys(loginUrlParameters) + .map((param) => `${encodeURIComponent(param)}=${encodeURIComponent(loginUrlParameters[param])}`) + .join('&')}`; + + OAuth.launchLogin({ + loginService: 'google', + loginStyle, + loginUrl, + credentialRequestCompleteCallback, + credentialToken, + popupOptions: { height: 600 }, + }); + }, +); diff --git a/apps/meteor/client/meteorOverrides/login/ldap.ts b/apps/meteor/client/meteorOverrides/login/ldap.ts new file mode 100644 index 000000000000..77a16ce3675d --- /dev/null +++ b/apps/meteor/client/meteorOverrides/login/ldap.ts @@ -0,0 +1,52 @@ +import { Meteor } from 'meteor/meteor'; + +import { callLoginMethod, handleLogin, type LoginCallback } from '../../lib/2fa/overrideLoginMethod'; + +declare module 'meteor/meteor' { + // eslint-disable-next-line @typescript-eslint/no-namespace + namespace Meteor { + function loginWithLDAP( + username: string | { username: string } | { email: string } | { id: string }, + ldapPass: string, + callback?: LoginCallback, + ): void; + } +} + +const loginWithLDAP = (username: string | { username: string } | { email: string } | { id: string }, ldapPass: string) => + callLoginMethod({ + methodArguments: [ + { + ldap: true, + username, + ldapPass, + ldapOptions: {}, + }, + ], + }); + +const loginWithLDAPAndTOTP = ( + username: string | { username: string } | { email: string } | { id: string }, + ldapPass: string, + code: string, +) => { + const loginRequest = { + ldap: true, + username, + ldapPass, + ldapOptions: {}, + }; + + return callLoginMethod({ + methodArguments: [ + { + totp: { + login: loginRequest, + code, + }, + }, + ], + }); +}; + +Meteor.loginWithLDAP = handleLogin(loginWithLDAP, loginWithLDAPAndTOTP); diff --git a/apps/meteor/client/meteorOverrides/login/linkedin.ts b/apps/meteor/client/meteorOverrides/login/linkedin.ts new file mode 100644 index 000000000000..a10b8182feec --- /dev/null +++ b/apps/meteor/client/meteorOverrides/login/linkedin.ts @@ -0,0 +1,48 @@ +import type { LinkedinOAuthConfiguration } from '@rocket.chat/core-typings'; +import { Random } from '@rocket.chat/random'; +import { Meteor } from 'meteor/meteor'; +import { OAuth } from 'meteor/oauth'; +import { Linkedin } from 'meteor/pauli:linkedin-oauth'; + +import type { LoginCallback } from '../../lib/2fa/overrideLoginMethod'; +import { overrideLoginMethod } from '../../lib/2fa/overrideLoginMethod'; +import { wrapRequestCredentialFn } from '../../lib/wrapRequestCredentialFn'; +import { createOAuthTotpLoginMethod } from './oauth'; + +declare module 'meteor/meteor' { + // eslint-disable-next-line @typescript-eslint/no-namespace + namespace Meteor { + function loginWithLinkedin(options?: Meteor.LoginWithExternalServiceOptions, callback?: LoginCallback): void; + } +} +const { loginWithLinkedin } = Meteor; +const loginWithLinkedinAndTOTP = createOAuthTotpLoginMethod(Linkedin); +Meteor.loginWithLinkedin = (options, callback) => { + overrideLoginMethod(loginWithLinkedin, [options], callback, loginWithLinkedinAndTOTP); +}; + +Linkedin.requestCredential = wrapRequestCredentialFn( + 'linkedin', + ({ options, credentialRequestCompleteCallback, config, loginStyle }) => { + const credentialToken = Random.secret(); + + const { requestPermissions } = options; + const scope = (requestPermissions || ['openid', 'email', 'profile']).join('+'); + + const loginUrl = `https://www.linkedin.com/uas/oauth2/authorization?response_type=code&client_id=${ + config.clientId + }&redirect_uri=${OAuth._redirectUri('linkedin', config)}&state=${OAuth._stateParam(loginStyle, credentialToken)}&scope=${scope}`; + + OAuth.launchLogin({ + credentialRequestCompleteCallback, + credentialToken, + loginService: 'linkedin', + loginStyle, + loginUrl, + popupOptions: { + width: 390, + height: 628, + }, + }); + }, +); diff --git a/apps/meteor/client/meteorOverrides/login/meteorDeveloperAccount.ts b/apps/meteor/client/meteorOverrides/login/meteorDeveloperAccount.ts new file mode 100644 index 000000000000..56823fee6b6a --- /dev/null +++ b/apps/meteor/client/meteorOverrides/login/meteorDeveloperAccount.ts @@ -0,0 +1,43 @@ +import { Meteor } from 'meteor/meteor'; +import { MeteorDeveloperAccounts } from 'meteor/meteor-developer-oauth'; +import { OAuth } from 'meteor/oauth'; + +import { overrideLoginMethod } from '../../lib/2fa/overrideLoginMethod'; +import { wrapRequestCredentialFn } from '../../lib/wrapRequestCredentialFn'; +import { createOAuthTotpLoginMethod } from './oauth'; + +const { loginWithMeteorDeveloperAccount } = Meteor; +const loginWithMeteorDeveloperAccountAndTOTP = createOAuthTotpLoginMethod(MeteorDeveloperAccounts); +Meteor.loginWithMeteorDeveloperAccount = (options, callback) => { + overrideLoginMethod(loginWithMeteorDeveloperAccount, [options], callback, loginWithMeteorDeveloperAccountAndTOTP); +}; + +MeteorDeveloperAccounts.requestCredential = wrapRequestCredentialFn( + 'meteor-developer', + ({ config, loginStyle, options: requestOptions, credentialRequestCompleteCallback }) => { + const options = requestOptions as Record; + + const credentialToken = Random.secret(); + + let loginUrl = + `${MeteorDeveloperAccounts._server}/oauth2/authorize?` + + `state=${OAuth._stateParam(loginStyle, credentialToken, options.redirectUrl)}` + + `&response_type=code&` + + `client_id=${config.clientId}${options.details ? `&details=${options.details}` : ''}`; + + if (options.loginHint) { + loginUrl += `&user_email=${encodeURIComponent(options.loginHint)}`; + } + + loginUrl += `&redirect_uri=${OAuth._redirectUri('meteor-developer', config)}`; + + OAuth.launchLogin({ + loginService: 'meteor-developer', + loginStyle, + loginUrl, + credentialRequestCompleteCallback, + credentialToken, + popupOptions: { width: 497, height: 749 }, + }); + }, +); diff --git a/apps/meteor/client/meteorOverrides/login/oauth.ts b/apps/meteor/client/meteorOverrides/login/oauth.ts new file mode 100644 index 000000000000..a3f9d72c9cbf --- /dev/null +++ b/apps/meteor/client/meteorOverrides/login/oauth.ts @@ -0,0 +1,127 @@ +import { Accounts } from 'meteor/accounts-base'; +import { Meteor } from 'meteor/meteor'; +import { OAuth } from 'meteor/oauth'; + +import type { IOAuthProvider } from '../../definitions/IOAuthProvider'; +import type { LoginCallback } from '../../lib/2fa/overrideLoginMethod'; + +const isLoginCancelledError = (error: unknown): error is Meteor.Error => + error instanceof Meteor.Error && error.error === Accounts.LoginCancelledError.numericError; + +export const convertError = (error: T): Accounts.LoginCancelledError | T => { + if (isLoginCancelledError(error)) { + return new Accounts.LoginCancelledError(error.reason); + } + + return error; +}; + +let lastCredentialToken: string | null = null; +let lastCredentialSecret: string | null | undefined = null; + +const meteorOAuthRetrieveCredentialSecret = OAuth._retrieveCredentialSecret; +OAuth._retrieveCredentialSecret = (credentialToken: string): string | null => { + let secret = meteorOAuthRetrieveCredentialSecret.call(OAuth, credentialToken); + if (!secret) { + const localStorageKey = `${OAuth._storageTokenPrefix}${credentialToken}`; + secret = localStorage.getItem(localStorageKey); + localStorage.removeItem(localStorageKey); + } + + return secret; +}; + +const tryLoginAfterPopupClosed = ( + credentialToken: string, + callback?: (error?: globalThis.Error | Meteor.Error | Meteor.TypedError) => void, + totpCode?: string, + credentialSecret?: string | null, +) => { + credentialSecret = credentialSecret || OAuth._retrieveCredentialSecret(credentialToken) || null; + const methodArgument = { + oauth: { + credentialToken, + credentialSecret, + }, + ...(typeof totpCode === 'string' && + !!totpCode && { + totp: { + code: totpCode, + }, + }), + }; + + lastCredentialToken = credentialToken; + lastCredentialSecret = credentialSecret; + + if (typeof totpCode === 'string' && !!totpCode) { + methodArgument.totp = { + code: totpCode, + }; + } + + Accounts.callLoginMethod({ + methodArguments: [methodArgument], + userCallback: (err) => { + callback?.(convertError(err)); + }, + }); +}; + +const credentialRequestCompleteHandler = + (callback?: (error?: globalThis.Error | Meteor.Error | Meteor.TypedError) => void, totpCode?: string) => + (credentialTokenOrError?: string | globalThis.Error | Meteor.Error | Meteor.TypedError) => { + if (!credentialTokenOrError) { + callback?.(new Meteor.Error('No credential token passed')); + return; + } + + if (credentialTokenOrError instanceof Error) { + callback?.(credentialTokenOrError); + return; + } + + tryLoginAfterPopupClosed(credentialTokenOrError, callback, totpCode); + }; + +export const createOAuthTotpLoginMethod = + (provider: IOAuthProvider) => (options: Meteor.LoginWithExternalServiceOptions | undefined, code: string, callback?: LoginCallback) => { + if (lastCredentialToken && lastCredentialSecret) { + tryLoginAfterPopupClosed(lastCredentialToken, callback, code, lastCredentialSecret); + } else { + const credentialRequestCompleteCallback = credentialRequestCompleteHandler(callback, code); + provider.requestCredential(options, credentialRequestCompleteCallback); + } + + lastCredentialToken = null; + lastCredentialSecret = null; + }; + +Accounts.oauth.credentialRequestCompleteHandler = credentialRequestCompleteHandler; + +Accounts.onPageLoadLogin(async (loginAttempt: any) => { + if (loginAttempt?.error?.error !== 'totp-required') { + return; + } + + const { methodArguments } = loginAttempt; + if (!methodArguments?.length) { + return; + } + + const oAuthArgs = methodArguments.find((arg: any) => arg.oauth); + const { credentialToken, credentialSecret } = oAuthArgs.oauth; + const cb = loginAttempt.userCallback; + + const { process2faReturn } = await import('../../lib/2fa/process2faReturn'); + + await process2faReturn({ + error: loginAttempt.error, + originalCallback: cb, + onCode: (code) => { + tryLoginAfterPopupClosed(credentialToken, cb, code, credentialSecret); + }, + emailOrUsername: undefined, + result: undefined, + }); +}); diff --git a/apps/meteor/client/meteorOverrides/login/password.ts b/apps/meteor/client/meteorOverrides/login/password.ts new file mode 100644 index 000000000000..f1c6e32f2282 --- /dev/null +++ b/apps/meteor/client/meteorOverrides/login/password.ts @@ -0,0 +1,67 @@ +import { Accounts } from 'meteor/accounts-base'; +import { Meteor } from 'meteor/meteor'; + +import { overrideLoginMethod, type LoginCallback } from '../../lib/2fa/overrideLoginMethod'; + +declare module 'meteor/meteor' { + // eslint-disable-next-line @typescript-eslint/no-namespace + namespace Meteor { + function loginWithPassword( + userDescriptor: { username: string } | { email: string } | { id: string } | string, + password: string, + callback?: LoginCallback, + ): void; + } +} + +const loginWithPasswordAndTOTP = ( + userDescriptor: { username: string } | { email: string } | { id: string } | string, + password: string, + code: string, + callback?: LoginCallback, +) => { + if (typeof userDescriptor === 'string') { + if (userDescriptor.indexOf('@') === -1) { + userDescriptor = { username: userDescriptor }; + } else { + userDescriptor = { email: userDescriptor }; + } + } + + Accounts.callLoginMethod({ + methodArguments: [ + { + totp: { + login: { + user: userDescriptor, + password: Accounts._hashPassword(password), + }, + code, + }, + }, + ], + userCallback(error) { + if (!error) { + callback?.(undefined); + return; + } + + if (callback) { + callback(error); + return; + } + + throw error; + }, + }); +}; + +const { loginWithPassword } = Meteor; + +Meteor.loginWithPassword = ( + userDescriptor: { username: string } | { email: string } | { id: string } | string, + password: string, + callback?: LoginCallback, +) => { + overrideLoginMethod(loginWithPassword, [userDescriptor, password], callback, loginWithPasswordAndTOTP); +}; diff --git a/apps/meteor/client/meteorOverrides/login/saml.ts b/apps/meteor/client/meteorOverrides/login/saml.ts new file mode 100644 index 000000000000..f3ff7a8d45dd --- /dev/null +++ b/apps/meteor/client/meteorOverrides/login/saml.ts @@ -0,0 +1,114 @@ +import { Random } from '@rocket.chat/random'; +import { Accounts } from 'meteor/accounts-base'; +import { Meteor } from 'meteor/meteor'; + +import { settings } from '../../../app/settings/client'; +import { type LoginCallback, callLoginMethod, handleLogin } from '../../lib/2fa/overrideLoginMethod'; + +declare module 'meteor/meteor' { + // eslint-disable-next-line @typescript-eslint/no-namespace + namespace Meteor { + function loginWithSamlToken(credentialToken: string, callback?: LoginCallback): void; + + function loginWithSaml(options: { provider: string; credentialToken?: string }): void; + } +} + +declare module 'meteor/accounts-base' { + // eslint-disable-next-line @typescript-eslint/no-namespace + namespace Accounts { + export let saml: { + credentialToken?: string; + credentialSecret?: string; + }; + } +} + +declare module 'meteor/service-configuration' { + // eslint-disable-next-line @typescript-eslint/naming-convention + interface Configuration { + logoutBehaviour?: 'SAML' | 'Local'; + idpSLORedirectURL?: string; + } +} + +if (!Accounts.saml) { + Accounts.saml = {}; +} + +const { logout } = Meteor; + +Meteor.logout = async function (...args) { + const standardLogout = () => logout.apply(Meteor, args); + + if (!settings.get('SAML_Custom_Default')) { + return standardLogout(); + } + + if (settings.get('SAML_Custom_Default_logout_behaviour') === 'Local') { + console.info('SAML session not terminated, only the Rocket.Chat session is going to be killed'); + return standardLogout(); + } + + const provider = settings.get('SAML_Custom_Default_provider'); + + if (provider && settings.get('SAML_Custom_Default_idp_slo_redirect_url')) { + console.info('SAML session terminated via SLO'); + + const { sdk } = await import('../../../app/utils/client/lib/SDKClient'); + sdk + .call('samlLogout', provider) + .then((result) => { + if (!result) { + logout.apply(Meteor); + return; + } + + // Remove the userId from the client to prevent calls to the server while the logout is processed. + // If the logout fails, the userId will be reloaded on the resume call + Meteor._localStorage.removeItem(Accounts.USER_ID_KEY); + + // A nasty bounce: 'result' has the SAML LogoutRequest but we need a proper 302 to redirected from the server. + window.location.replace(Meteor.absoluteUrl(`_saml/sloRedirect/${provider}/?redirect=${encodeURIComponent(result)}`)); + }) + .catch(() => logout.apply(Meteor)); + return; + } + + return standardLogout(); +}; + +Meteor.loginWithSaml = (options) => { + options = options || {}; + const credentialToken = `id-${Random.id()}`; + options.credentialToken = credentialToken; + + window.location.href = `_saml/authorize/${options.provider}/${options.credentialToken}`; +}; + +const loginWithSamlToken = (credentialToken: string) => + callLoginMethod({ + methodArguments: [ + { + saml: true, + credentialToken, + }, + ], + }); + +const loginWithSamlTokenAndTOTP = (credentialToken: string, code: string) => + callLoginMethod({ + methodArguments: [ + { + totp: { + login: { + saml: true, + credentialToken, + }, + code, + }, + }, + ], + }); + +Meteor.loginWithSamlToken = handleLogin(loginWithSamlToken, loginWithSamlTokenAndTOTP); diff --git a/apps/meteor/client/meteorOverrides/login/twitter.ts b/apps/meteor/client/meteorOverrides/login/twitter.ts new file mode 100644 index 000000000000..e19ce234e5e9 --- /dev/null +++ b/apps/meteor/client/meteorOverrides/login/twitter.ts @@ -0,0 +1,56 @@ +import type { TwitterOAuthConfiguration } from '@rocket.chat/core-typings'; +import { Random } from '@rocket.chat/random'; +import { Meteor } from 'meteor/meteor'; +import { OAuth } from 'meteor/oauth'; +import { Twitter } from 'meteor/twitter-oauth'; + +import { overrideLoginMethod } from '../../lib/2fa/overrideLoginMethod'; +import { wrapRequestCredentialFn } from '../../lib/wrapRequestCredentialFn'; +import { createOAuthTotpLoginMethod } from './oauth'; + +const { loginWithTwitter } = Meteor; +const loginWithTwitterAndTOTP = createOAuthTotpLoginMethod(Twitter); +Meteor.loginWithTwitter = (options, callback) => { + overrideLoginMethod(loginWithTwitter, [options], callback, loginWithTwitterAndTOTP); +}; + +Twitter.requestCredential = wrapRequestCredentialFn( + 'twitter', + ({ loginStyle, options: requestOptions, credentialRequestCompleteCallback }) => { + const options = requestOptions as Record; + const credentialToken = Random.secret(); + + let loginPath = `_oauth/twitter/?requestTokenAndRedirect=true&state=${OAuth._stateParam( + loginStyle, + credentialToken, + options?.redirectUrl, + )}`; + + if (Meteor.isCordova) { + loginPath += '&cordova=true'; + if (/Android/i.test(navigator.userAgent)) { + loginPath += '&android=true'; + } + } + + // Support additional, permitted parameters + if (options) { + const hasOwn = Object.prototype.hasOwnProperty; + Twitter.validParamsAuthenticate.forEach((param: string) => { + if (hasOwn.call(options, param)) { + loginPath += `&${param}=${encodeURIComponent(options[param])}`; + } + }); + } + + const loginUrl = Meteor.absoluteUrl(loginPath); + + OAuth.launchLogin({ + loginService: 'twitter', + loginStyle, + loginUrl, + credentialRequestCompleteCallback, + credentialToken, + }); + }, +); diff --git a/apps/meteor/client/meteorOverrides/oauthRedirectUri.ts b/apps/meteor/client/meteorOverrides/oauthRedirectUri.ts new file mode 100644 index 000000000000..23f53acfe1d7 --- /dev/null +++ b/apps/meteor/client/meteorOverrides/oauthRedirectUri.ts @@ -0,0 +1,27 @@ +import { OAuth } from 'meteor/oauth'; + +declare module 'meteor/oauth' { + // eslint-disable-next-line @typescript-eslint/no-namespace + namespace OAuth { + function _redirectUri(serviceName: string, config: any, params: any, absoluteUrlOptions: any): string; + } +} + +const { _redirectUri } = OAuth; + +OAuth._redirectUri = (serviceName: string, config: any, params: unknown, absoluteUrlOptions: unknown): string => { + const ret = _redirectUri(serviceName, config, params, absoluteUrlOptions); + + // DEPRECATED: Remove in v5.0.0 + // Meteor 2.3 removed ?close from redirect uri so we need to add it back to not break old oauth clients + // https://github.com/meteor/meteor/commit/b5b7306bedc3e8eb241e64efb1e281925aa75dd3#diff-59244f4e0176cb1beed2e287924e97dc7ae2c0cc51494ce121a85d8937d116a5L11 + if (!config?.loginStyle && !ret.includes('close')) { + console.warn( + `Automatically added ?close to 'redirect_uri' for ${serviceName}, this behavior will be removed in v5.0.0.\n` + + "Please update your OAuth config to accept both with and without ?close as the 'redirect_uri'.", + ); + return `${ret + (ret.includes('?') ? '&' : '?')}close`; + } + + return ret; +}; diff --git a/apps/meteor/client/meteorOverrides/totpOnCall.ts b/apps/meteor/client/meteorOverrides/totpOnCall.ts new file mode 100644 index 000000000000..247b3897842f --- /dev/null +++ b/apps/meteor/client/meteorOverrides/totpOnCall.ts @@ -0,0 +1,63 @@ +import { Meteor } from 'meteor/meteor'; + +import { t } from '../../app/utils/lib/i18n'; +import type { LoginCallback } from '../lib/2fa/overrideLoginMethod'; +import { process2faReturn, process2faAsyncReturn } from '../lib/2fa/process2faReturn'; +import { isTotpInvalidError } from '../lib/2fa/utils'; + +const withSyncTOTP = (call: (name: string, ...args: any[]) => any) => { + const callWithTotp = + (methodName: string, args: unknown[], callback: LoginCallback) => + (twoFactorCode: string, twoFactorMethod: string): unknown => + call( + methodName, + ...args, + { twoFactorCode, twoFactorMethod }, + (error: globalThis.Error | Meteor.Error | Meteor.TypedError | undefined, result: unknown): void => { + if (isTotpInvalidError(error)) { + callback(new Error(twoFactorMethod === 'password' ? t('Invalid_password') : t('Invalid_two_factor_code'))); + return; + } + + callback(error, result); + }, + ); + + const callWithoutTotp = (methodName: string, args: unknown[], callback: LoginCallback) => (): unknown => + call( + methodName, + ...args, + async (error: globalThis.Error | Meteor.Error | Meteor.TypedError | undefined, result: unknown): Promise => { + await process2faReturn({ + error, + result, + onCode: callWithTotp(methodName, args, callback), + originalCallback: callback, + emailOrUsername: undefined, + }); + }, + ); + + return function (methodName: string, ...args: unknown[]): unknown { + const callback = args.length > 0 && typeof args[args.length - 1] === 'function' ? (args.pop() as LoginCallback) : (): void => undefined; + + return callWithoutTotp(methodName, args, callback)(); + }; +}; + +const withAsyncTOTP = (callAsync: (name: string, ...args: any[]) => Promise) => { + return async function callAsyncWithTOTP(methodName: string, ...args: unknown[]): Promise { + try { + return await callAsync(methodName, ...args); + } catch (error: unknown) { + return process2faAsyncReturn({ + error, + onCode: (twoFactorCode, twoFactorMethod) => Meteor.callAsync(methodName, ...args, { twoFactorCode, twoFactorMethod }), + emailOrUsername: undefined, + }); + } + }; +}; + +Meteor.call = withSyncTOTP(Meteor.call); +Meteor.callAsync = withAsyncTOTP(Meteor.callAsync); diff --git a/apps/meteor/client/meteorOverrides/userAndUsers.ts b/apps/meteor/client/meteorOverrides/userAndUsers.ts new file mode 100644 index 000000000000..84bd85ff38d2 --- /dev/null +++ b/apps/meteor/client/meteorOverrides/userAndUsers.ts @@ -0,0 +1,14 @@ +import { Users } from '../../app/models/client/models/Users'; + +Meteor.users = Users as typeof Meteor.users; + +// overwrite Meteor.users collection so records on it don't get erased whenever the client reconnects to websocket +Meteor.user = function user(): Meteor.User | null { + const uid = Meteor.userId(); + + if (!uid) { + return null; + } + + return (Users.findOne({ _id: uid }) ?? null) as Meteor.User | null; +}; diff --git a/apps/meteor/client/methods/updateMessage.ts b/apps/meteor/client/methods/updateMessage.ts index 27489d281f4e..deb2878072c5 100644 --- a/apps/meteor/client/methods/updateMessage.ts +++ b/apps/meteor/client/methods/updateMessage.ts @@ -8,7 +8,6 @@ import { hasAtLeastOnePermission, hasPermission } from '../../app/authorization/ import { ChatMessage } from '../../app/models/client'; import { settings } from '../../app/settings/client'; import { t } from '../../app/utils/lib/i18n'; -import { callbacks } from '../../lib/callbacks'; import { dispatchToastMessage } from '../lib/toast'; Meteor.methods({ @@ -74,7 +73,6 @@ Meteor.methods({ username: me.username, }; - message = (await callbacks.run('beforeSaveMessage', message)) as IEditedMessage; const messageObject: Partial = { editedAt: message.editedAt, editedBy: message.editedBy, diff --git a/apps/meteor/client/polyfills/index.ts b/apps/meteor/client/polyfills/index.ts index f07d828a4602..bc91265b04ba 100644 --- a/apps/meteor/client/polyfills/index.ts +++ b/apps/meteor/client/polyfills/index.ts @@ -4,3 +4,4 @@ import './childNodeRemove'; import './cssVars'; import './customEventPolyfill'; import './hoverTouchClick'; +import './promiseFinally'; diff --git a/apps/meteor/client/polyfills/promiseFinally.ts b/apps/meteor/client/polyfills/promiseFinally.ts new file mode 100644 index 000000000000..ab826c2bd0ba --- /dev/null +++ b/apps/meteor/client/polyfills/promiseFinally.ts @@ -0,0 +1,16 @@ +if (!Promise.prototype.finally) { + // eslint-disable-next-line no-extend-native + Promise.prototype.finally = function (callback) { + if (typeof callback !== 'function') { + return this.then(callback, callback); + } + const P = (this.constructor as PromiseConstructor) || Promise; + return this.then( + (value) => P.resolve(callback()).then(() => value), + (err) => + P.resolve(callback()).then(() => { + throw err; + }), + ); + }; +} diff --git a/apps/meteor/client/portals/ModalPortal.tsx b/apps/meteor/client/portals/ModalPortal.tsx new file mode 100644 index 000000000000..d7c9ae9caa2d --- /dev/null +++ b/apps/meteor/client/portals/ModalPortal.tsx @@ -0,0 +1,18 @@ +import type { ReactElement, ReactNode } from 'react'; +import React, { memo, useEffect, useState } from 'react'; +import { createPortal } from 'react-dom'; + +import { createAnchor } from '../lib/utils/createAnchor'; +import { deleteAnchor } from '../lib/utils/deleteAnchor'; + +type ModalPortalProps = { + children?: ReactNode; +}; + +const ModalPortal = ({ children }: ModalPortalProps): ReactElement => { + const [modalRoot] = useState(() => createAnchor('modal-root')); + useEffect(() => (): void => deleteAnchor(modalRoot), [modalRoot]); + return <>{createPortal(children, modalRoot)}; +}; + +export default memo(ModalPortal); diff --git a/apps/meteor/client/portals/TooltipPortal.tsx b/apps/meteor/client/portals/TooltipPortal.tsx new file mode 100644 index 000000000000..2ee0830313c4 --- /dev/null +++ b/apps/meteor/client/portals/TooltipPortal.tsx @@ -0,0 +1,14 @@ +import type { FC } from 'react'; +import React, { memo, useEffect, useState } from 'react'; +import { createPortal } from 'react-dom'; + +import { createAnchor } from '../lib/utils/createAnchor'; +import { deleteAnchor } from '../lib/utils/deleteAnchor'; + +const TooltipPortal: FC = ({ children }) => { + const [tooltipRoot] = useState(() => createAnchor('tooltip-root')); + useEffect(() => (): void => deleteAnchor(tooltipRoot), [tooltipRoot]); + return <>{createPortal(children, tooltipRoot)}; +}; + +export default memo(TooltipPortal); diff --git a/apps/meteor/client/portals/VideoConfPopupPortal.ts b/apps/meteor/client/portals/VideoConfPopupPortal.ts deleted file mode 100644 index 5e4f22612c62..000000000000 --- a/apps/meteor/client/portals/VideoConfPopupPortal.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { ReactElement, ReactNode } from 'react'; -import { memo, useEffect, useState } from 'react'; -import { createPortal } from 'react-dom'; - -import { createAnchor } from '../lib/utils/createAnchor'; -import { deleteAnchor } from '../lib/utils/deleteAnchor'; - -type VideoConfPortalProps = { - children?: ReactNode; -}; - -const VideoConfPortal = ({ children }: VideoConfPortalProps): ReactElement => { - const [videoConfRoot] = useState(() => createAnchor('video-conf-root')); - useEffect(() => (): void => deleteAnchor(videoConfRoot), [videoConfRoot]); - return createPortal(children, videoConfRoot); -}; - -export default memo(VideoConfPortal); diff --git a/apps/meteor/client/portals/VideoConfPopupPortal.tsx b/apps/meteor/client/portals/VideoConfPopupPortal.tsx new file mode 100644 index 000000000000..b1c0746e93e2 --- /dev/null +++ b/apps/meteor/client/portals/VideoConfPopupPortal.tsx @@ -0,0 +1,18 @@ +import type { ReactElement, ReactNode } from 'react'; +import React, { memo, useEffect, useState } from 'react'; +import { createPortal } from 'react-dom'; + +import { createAnchor } from '../lib/utils/createAnchor'; +import { deleteAnchor } from '../lib/utils/deleteAnchor'; + +type VideoConfPortalProps = { + children?: ReactNode; +}; + +const VideoConfPortal = ({ children }: VideoConfPortalProps): ReactElement => { + const [videoConfRoot] = useState(() => createAnchor('video-conf-root')); + useEffect(() => (): void => deleteAnchor(videoConfRoot), [videoConfRoot]); + return <>{createPortal(children, videoConfRoot)}; +}; + +export default memo(VideoConfPortal); diff --git a/apps/meteor/client/providers/ActionManagerProvider.tsx b/apps/meteor/client/providers/ActionManagerProvider.tsx index 8faa55260f13..7305a4b1a674 100644 --- a/apps/meteor/client/providers/ActionManagerProvider.tsx +++ b/apps/meteor/client/providers/ActionManagerProvider.tsx @@ -1,24 +1,27 @@ -import { ActionManagerContext } from '@rocket.chat/ui-contexts'; +import { ActionManagerContext, useRouter } from '@rocket.chat/ui-contexts'; import type { ReactNode, ReactElement } from 'react'; import React from 'react'; -import * as ActionManager from '../../app/ui-message/client/ActionManager'; +import { ActionManager } from '../../app/ui-message/client/ActionManager'; import { useAppActionButtons } from '../hooks/useAppActionButtons'; import { useAppSlashCommands } from '../hooks/useAppSlashCommands'; -import { useAppTranslations } from '../hooks/useAppTranslations'; import { useAppUiKitInteraction } from '../hooks/useAppUiKitInteraction'; +import { useTranslationsForApps } from '../hooks/useTranslationsForApps'; +import { useInstance } from '../views/room/providers/hooks/useInstance'; type ActionManagerProviderProps = { children?: ReactNode; }; const ActionManagerProvider = ({ children }: ActionManagerProviderProps): ReactElement => { - useAppTranslations(); + const router = useRouter(); + const actionManager = useInstance(() => [new ActionManager(router)], [router]); + useTranslationsForApps(); useAppActionButtons(); useAppSlashCommands(); - useAppUiKitInteraction(ActionManager.handlePayloadUserInteraction); + useAppUiKitInteraction(actionManager.handleServerInteraction.bind(actionManager)); - return {children}; + return {children}; }; export default ActionManagerProvider; diff --git a/apps/meteor/client/providers/AppsProvider.tsx b/apps/meteor/client/providers/AppsProvider.tsx index 042ce8365474..61baaefc4a49 100644 --- a/apps/meteor/client/providers/AppsProvider.tsx +++ b/apps/meteor/client/providers/AppsProvider.tsx @@ -1,26 +1,45 @@ import { useDebouncedCallback } from '@rocket.chat/fuselage-hooks'; -import { usePermission, useSingleStream } from '@rocket.chat/ui-contexts'; +import { usePermission, useStream } from '@rocket.chat/ui-contexts'; import { useQuery, useQueryClient } from '@tanstack/react-query'; import type { FC } from 'react'; import React, { useEffect } from 'react'; import { AppClientOrchestratorInstance } from '../../ee/client/apps/orchestrator'; -import PageSkeleton from '../components/PageSkeleton'; import { AppsContext } from '../contexts/AppsContext'; +import { useIsEnterprise } from '../hooks/useIsEnterprise'; +import { useInvalidateLicense } from '../hooks/useLicense'; +import type { AsyncState } from '../lib/asyncState'; import { AsyncStatePhase } from '../lib/asyncState'; import { useInvalidateAppsCountQueryCallback } from '../views/marketplace/hooks/useAppsCountQuery'; import type { App } from '../views/marketplace/types'; const sortByName = (apps: App[]): App[] => apps.sort((a, b) => (a.name.toLowerCase() > b.name.toLowerCase() ? 1 : -1)); +const getAppState = ( + loading: boolean, + apps: App[] | undefined, +): Omit< + AsyncState<{ + apps: App[]; + }>, + 'error' +> => ({ + phase: loading ? AsyncStatePhase.LOADING : AsyncStatePhase.RESOLVED, + value: { apps: apps || [] }, +}); + const AppsProvider: FC = ({ children }) => { const isAdminUser = usePermission('manage-apps'); const queryClient = useQueryClient(); + const { data } = useIsEnterprise(); + const isEnterprise = !!data?.isEnterprise; + const invalidateAppsCountQuery = useInvalidateAppsCountQueryCallback(); + const invalidateLicenseQuery = useInvalidateLicense(); - const stream = useSingleStream('apps'); + const stream = useStream('apps'); const invalidate = useDebouncedCallback( () => { @@ -36,8 +55,11 @@ const AppsProvider: FC = ({ children }) => { if (['app/added', 'app/removed', 'app/updated', 'app/statusUpdate', 'app/settingUpdated'].includes(key)) { invalidate(); } + if (['app/added', 'app/removed'].includes(key) && !isEnterprise) { + invalidateLicenseQuery(); + } }); - }, [invalidate, stream]); + }, [invalidate, invalidateLicenseQuery, isEnterprise, stream]); const marketplace = useQuery( ['marketplace', 'apps-marketplace', isAdminUser], @@ -66,24 +88,23 @@ const AppsProvider: FC = ({ children }) => { }, { staleTime: Infinity, - keepPreviousData: true, onSettled: () => queryClient.invalidateQueries(['marketplace', 'apps-stored']), }, ); const store = useQuery( - ['marketplace', 'apps-stored', isAdminUser], + ['marketplace', 'apps-stored', instance.data, marketplace.data], () => { - if (!marketplace.isSuccess || !instance.isSuccess) { + if (!marketplace.isFetched && !instance.isFetched) { throw new Error('Apps not loaded'); } const marketplaceApps: App[] = []; const installedApps: App[] = []; const privateApps: App[] = []; - const clonedData = [...instance.data]; + const clonedData = [...(instance.data || [])]; - sortByName(marketplace.data).forEach((app) => { + sortByName(marketplace.data || []).forEach((app) => { const appIndex = clonedData.findIndex(({ id }) => id === app.id); const [installedApp] = appIndex > -1 ? clonedData.splice(appIndex, 1) : []; @@ -102,7 +123,11 @@ const AppsProvider: FC = ({ children }) => { }; if (installedApp) { - installedApps.push(record); + if (installedApp.private) { + privateApps.push(record); + } else { + installedApps.push(record); + } } marketplaceApps.push(record); @@ -117,22 +142,21 @@ const AppsProvider: FC = ({ children }) => { return [marketplaceApps, installedApps, privateApps]; }, { - enabled: marketplace.isSuccess && instance.isSuccess && !instance.isRefetching, + enabled: marketplace.isFetched && instance.isFetched, keepPreviousData: true, }, ); - if (!store.isSuccess) { - return ; - } + const [marketplaceAppsData, installedAppsData, privateAppsData] = store.data || []; + const { isLoading } = store; return ( { await Promise.all([queryClient.invalidateQueries(['marketplace'])]); }, diff --git a/apps/meteor/client/providers/AuthenticationProvider/AuthenticationProvider.tsx b/apps/meteor/client/providers/AuthenticationProvider/AuthenticationProvider.tsx new file mode 100644 index 000000000000..c76f06bcd3b4 --- /dev/null +++ b/apps/meteor/client/providers/AuthenticationProvider/AuthenticationProvider.tsx @@ -0,0 +1,86 @@ +import type { LoginServiceConfiguration } from '@rocket.chat/core-typings'; +import { capitalize } from '@rocket.chat/string-helpers'; +import { AuthenticationContext, useSetting } from '@rocket.chat/ui-contexts'; +import { Meteor } from 'meteor/meteor'; +import type { ContextType, ReactElement, ReactNode } from 'react'; +import React, { useMemo } from 'react'; + +import { loginServices } from '../../lib/loginServices'; +import { useLDAPAndCrowdCollisionWarning } from './hooks/useLDAPAndCrowdCollisionWarning'; + +export type LoginMethods = keyof typeof Meteor extends infer T ? (T extends `loginWith${string}` ? T : never) : never; + +type AuthenticationProviderProps = { + children: ReactNode; +}; + +const AuthenticationProvider = ({ children }: AuthenticationProviderProps): ReactElement => { + const isLdapEnabled = useSetting('LDAP_Enable'); + const isCrowdEnabled = useSetting('CROWD_Enable'); + + const loginMethod: LoginMethods = (isLdapEnabled && 'loginWithLDAP') || (isCrowdEnabled && 'loginWithCrowd') || 'loginWithPassword'; + + useLDAPAndCrowdCollisionWarning(); + + const contextValue = useMemo( + (): ContextType => ({ + loginWithToken: (token: string): Promise => + new Promise((resolve, reject) => + Meteor.loginWithToken(token, (err) => { + if (err) { + return reject(err); + } + resolve(undefined); + }), + ), + loginWithPassword: (user: string | { username: string } | { email: string } | { id: string }, password: string): Promise => + new Promise((resolve, reject) => { + Meteor[loginMethod](user, password, (error) => { + if (error) { + reject(error); + return; + } + + resolve(); + }); + }), + loginWithService: (serviceConfig: T): (() => Promise) => { + const loginMethods: Record = { + 'meteor-developer': 'MeteorDeveloperAccount', + }; + + const { service: serviceName } = serviceConfig; + const clientConfig = ('clientConfig' in serviceConfig && serviceConfig.clientConfig) || {}; + + const loginWithService = `loginWith${loginMethods[serviceName] || capitalize(String(serviceName || ''))}`; + + const method: (config: unknown, cb: (error: any) => void) => Promise = (Meteor as any)[loginWithService] as any; + + if (!method) { + return () => Promise.reject(new Error('Login method not found')); + } + + return () => + new Promise((resolve, reject) => { + method(clientConfig, (error: any): void => { + if (!error) { + resolve(true); + return; + } + reject(error); + }); + }); + }, + + queryLoginServices: { + getCurrentValue: () => loginServices.getLoginServiceButtons(), + subscribe: (onStoreChange: () => void) => loginServices.on('changed', onStoreChange), + }, + }), + [loginMethod], + ); + + return ; +}; + +export default AuthenticationProvider; diff --git a/apps/meteor/client/providers/UserProvider/hooks/useLDAPAndCrowdCollisionWarning.tsx b/apps/meteor/client/providers/AuthenticationProvider/hooks/useLDAPAndCrowdCollisionWarning.tsx similarity index 93% rename from apps/meteor/client/providers/UserProvider/hooks/useLDAPAndCrowdCollisionWarning.tsx rename to apps/meteor/client/providers/AuthenticationProvider/hooks/useLDAPAndCrowdCollisionWarning.tsx index fbcabc2825fb..afb0eea54fda 100644 --- a/apps/meteor/client/providers/UserProvider/hooks/useLDAPAndCrowdCollisionWarning.tsx +++ b/apps/meteor/client/providers/AuthenticationProvider/hooks/useLDAPAndCrowdCollisionWarning.tsx @@ -2,7 +2,7 @@ import { useSetting } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { useEffect } from 'react'; -import type { LoginMethods } from '../UserProvider'; +import type { LoginMethods } from '../AuthenticationProvider'; export function useLDAPAndCrowdCollisionWarning() { const isLdapEnabled = useSetting('LDAP_Enable'); diff --git a/apps/meteor/client/providers/CallProvider/CallProvider.tsx b/apps/meteor/client/providers/CallProvider/CallProvider.tsx index 0de0a3fda0c3..ce0d9385dc64 100644 --- a/apps/meteor/client/providers/CallProvider/CallProvider.tsx +++ b/apps/meteor/client/providers/CallProvider/CallProvider.tsx @@ -29,13 +29,13 @@ import { createPortal } from 'react-dom'; import type { OutgoingByeRequest } from 'sip.js/lib/core'; import { isOutboundClient, useVoipClient } from '../../../ee/client/hooks/useVoipClient'; -import { parseOutboundPhoneNumber } from '../../../ee/client/lib/voip/parseOutboundPhoneNumber'; import { WrapUpCallModal } from '../../../ee/client/voip/components/modals/WrapUpCallModal'; import type { CallContextValue } from '../../contexts/CallContext'; import { CallContext, useIsVoipEnterprise } from '../../contexts/CallContext'; import { useDialModal } from '../../hooks/useDialModal'; import { roomCoordinator } from '../../lib/rooms/roomCoordinator'; import type { QueueAggregator } from '../../lib/voip/QueueAggregator'; +import { parseOutboundPhoneNumber } from '../../lib/voip/parseOutboundPhoneNumber'; import { useVoipSounds } from './hooks/useVoipSounds'; type NetworkState = 'online' | 'offline'; diff --git a/apps/meteor/client/providers/CustomSoundProvider.tsx b/apps/meteor/client/providers/CustomSoundProvider.tsx index b383ad830012..cb2d2933117f 100644 --- a/apps/meteor/client/providers/CustomSoundProvider.tsx +++ b/apps/meteor/client/providers/CustomSoundProvider.tsx @@ -1,10 +1,36 @@ -import { CustomSoundContext } from '@rocket.chat/ui-contexts'; +import { CustomSoundContext, useUserId, useStream } from '@rocket.chat/ui-contexts'; import type { FC } from 'react'; -import React from 'react'; +import React, { useEffect } from 'react'; import { CustomSounds } from '../../app/custom-sounds/client/lib/CustomSounds'; const CustomSoundProvider: FC = ({ children }) => { + const userId = useUserId(); + useEffect(() => { + if (!userId) { + return; + } + void CustomSounds.fetchCustomSoundList(); + }, [userId]); + + const streamAll = useStream('notify-all'); + + useEffect(() => { + if (!userId) { + return; + } + + return streamAll('public-info', ([key, data]) => { + switch (key) { + case 'updateCustomSound': + CustomSounds.update(data[0].soundData); + break; + case 'deleteCustomSound': + CustomSounds.remove(data[0].soundData); + break; + } + }); + }, [userId, streamAll]); return ; }; diff --git a/apps/meteor/client/providers/EmojiPickerProvider.tsx b/apps/meteor/client/providers/EmojiPickerProvider/EmojiPickerProvider.tsx similarity index 92% rename from apps/meteor/client/providers/EmojiPickerProvider.tsx rename to apps/meteor/client/providers/EmojiPickerProvider/EmojiPickerProvider.tsx index f7d14b317d54..35cb32077a84 100644 --- a/apps/meteor/client/providers/EmojiPickerProvider.tsx +++ b/apps/meteor/client/providers/EmojiPickerProvider/EmojiPickerProvider.tsx @@ -2,10 +2,11 @@ import { useDebouncedState, useLocalStorage } from '@rocket.chat/fuselage-hooks' import type { ReactNode, ReactElement, ContextType } from 'react'; import React, { useState, useCallback, useMemo, useEffect } from 'react'; -import type { EmojiByCategory } from '../../app/emoji/client'; -import { emoji, getFrequentEmoji, updateRecent, createEmojiList, createPickerEmojis, CUSTOM_CATEGORY } from '../../app/emoji/client'; -import { EmojiPickerContext } from '../contexts/EmojiPickerContext'; -import EmojiPicker from '../views/composer/EmojiPicker/EmojiPicker'; +import type { EmojiByCategory } from '../../../app/emoji/client'; +import { emoji, getFrequentEmoji, updateRecent, createEmojiList, createPickerEmojis, CUSTOM_CATEGORY } from '../../../app/emoji/client'; +import { EmojiPickerContext } from '../../contexts/EmojiPickerContext'; +import EmojiPicker from '../../views/composer/EmojiPicker/EmojiPicker'; +import { useUpdateCustomEmoji } from './useUpdateCustomEmoji'; const DEFAULT_ITEMS_LIMIT = 90; @@ -23,6 +24,8 @@ const EmojiPickerProvider = ({ children }: { children: ReactNode }): ReactElemen getFrequentEmoji(frequentEmojis.map(([emoji]) => emoji)), ); + useUpdateCustomEmoji(); + const addFrequentEmojis = useCallback( (emoji: string) => { const empty: [string, number][] = frequentEmojis.some(([emojiName]) => emojiName === emoji) ? [] : [[emoji, 0]]; diff --git a/apps/meteor/client/providers/EmojiPickerProvider/index.ts b/apps/meteor/client/providers/EmojiPickerProvider/index.ts new file mode 100644 index 000000000000..4437d6b749d4 --- /dev/null +++ b/apps/meteor/client/providers/EmojiPickerProvider/index.ts @@ -0,0 +1 @@ +export { default } from './EmojiPickerProvider'; diff --git a/apps/meteor/client/providers/EmojiPickerProvider/useUpdateCustomEmoji.ts b/apps/meteor/client/providers/EmojiPickerProvider/useUpdateCustomEmoji.ts new file mode 100644 index 000000000000..a0a0946006db --- /dev/null +++ b/apps/meteor/client/providers/EmojiPickerProvider/useUpdateCustomEmoji.ts @@ -0,0 +1,17 @@ +import { useStream } from '@rocket.chat/ui-contexts'; +import { useEffect } from 'react'; + +import { updateEmojiCustom, deleteEmojiCustom } from '../../../app/emoji-custom/client/lib/emojiCustom'; + +export const useUpdateCustomEmoji = () => { + const notify = useStream('notify-logged'); + useEffect(() => { + const unsubUpdate = notify('updateEmojiCustom', (data) => updateEmojiCustom(data.emojiData)); + const unsubDelete = notify('deleteEmojiCustom', (data) => deleteEmojiCustom(data.emojiData)); + + return () => { + unsubUpdate(); + unsubDelete(); + }; + }, [notify]); +}; diff --git a/apps/meteor/client/providers/ImageGalleryProvider.tsx b/apps/meteor/client/providers/ImageGalleryProvider.tsx new file mode 100644 index 000000000000..1cd07f29882c --- /dev/null +++ b/apps/meteor/client/providers/ImageGalleryProvider.tsx @@ -0,0 +1,50 @@ +import React, { type ReactNode, useEffect, useState } from 'react'; + +import { ImageGallery } from '../components/ImageGallery'; +import { ImageGalleryContext } from '../contexts/ImageGalleryContext'; +import ImageGalleryData from '../views/room/ImageGallery/ImageGalleryData'; + +type ImageGalleryProviderProps = { + children: ReactNode; +}; + +const ImageGalleryProvider = ({ children }: ImageGalleryProviderProps) => { + const [imageId, setImageId] = useState(); + const [quotedImageUrl, setQuotedImageUrl] = useState(); + + useEffect(() => { + const handleImageClick = (event: Event) => { + const target = event?.target as HTMLElement | null; + + if (target?.closest('.rcx-attachment__details')) { + return setQuotedImageUrl(target.dataset.id); + } + if (target?.classList.contains('gallery-item')) { + const id = target.closest('.gallery-item-container')?.getAttribute('data-id') || undefined; + return setImageId(target.dataset.id || id); + } + if (target?.classList.contains('gallery-item-container')) { + return setImageId(target.dataset.id); + } + if (target?.classList.contains('rcx-avatar__element') && target.closest('.gallery-item')) { + const avatarTarget = target.closest('.gallery-item-container')?.getAttribute('data-id') || undefined; + return setImageId(avatarTarget); + } + }; + document.addEventListener('click', handleImageClick); + + return () => document.removeEventListener('click', handleImageClick); + }, []); + + return ( + setImageId(undefined) }}> + {children} + {!!quotedImageUrl && ( + setQuotedImageUrl(undefined)} /> + )} + {!!imageId && } + + ); +}; + +export default ImageGalleryProvider; diff --git a/apps/meteor/client/providers/LayoutProvider.tsx b/apps/meteor/client/providers/LayoutProvider.tsx index 5cc113e172c5..a4f8fa84f9ff 100644 --- a/apps/meteor/client/providers/LayoutProvider.tsx +++ b/apps/meteor/client/providers/LayoutProvider.tsx @@ -3,10 +3,18 @@ import { LayoutContext, useRouter, useSetting } from '@rocket.chat/ui-contexts'; import type { FC } from 'react'; import React, { useMemo, useState, useEffect } from 'react'; +const hiddenActionsDefaultValue = { + roomToolbox: [], + messageToolbox: [], + composerToolbox: [], + userToolbox: [], +}; + const LayoutProvider: FC = ({ children }) => { const showTopNavbarEmbeddedLayout = Boolean(useSetting('UI_Show_top_navbar_embedded_layout')); const [isCollapsed, setIsCollapsed] = useState(false); const breakpoints = useBreakpoints(); // ["xs", "sm", "md", "lg", "xl", xxl"] + const [hiddenActions, setHiddenActions] = useState(hiddenActionsDefaultValue); const router = useRouter(); // Once the layout is embedded, it can't be changed @@ -18,6 +26,18 @@ const LayoutProvider: FC = ({ children }) => { setIsCollapsed(isMobile); }, [isMobile]); + useEffect(() => { + const eventHandler = (event: MessageEvent) => { + if (event.data?.event !== 'overrideUi') { + return; + } + + setHiddenActions({ ...hiddenActionsDefaultValue, ...event.data.hideActions }); + }; + window.addEventListener('message', eventHandler); + return () => window.removeEventListener('message', eventHandler); + }, []); + return ( { contextualBarExpanded: breakpoints.includes('sm'), // eslint-disable-next-line no-nested-ternary contextualBarPosition: breakpoints.includes('sm') ? (breakpoints.includes('lg') ? 'relative' : 'absolute') : 'fixed', + hiddenActions, }), - [isMobile, isEmbedded, showTopNavbarEmbeddedLayout, isCollapsed, breakpoints, router], + [isMobile, isEmbedded, showTopNavbarEmbeddedLayout, isCollapsed, breakpoints, router, hiddenActions], )} /> ); diff --git a/apps/meteor/client/providers/MeteorProvider.tsx b/apps/meteor/client/providers/MeteorProvider.tsx index dadb47caead4..cf6b14e7946b 100644 --- a/apps/meteor/client/providers/MeteorProvider.tsx +++ b/apps/meteor/client/providers/MeteorProvider.tsx @@ -3,6 +3,7 @@ import React from 'react'; import { OmnichannelRoomIconProvider } from '../components/RoomIcon/OmnichannelRoomIcon/provider/OmnichannelRoomIconProvider'; import ActionManagerProvider from './ActionManagerProvider'; +import AuthenticationProvider from './AuthenticationProvider/AuthenticationProvider'; import AuthorizationProvider from './AuthorizationProvider'; import AvatarUrlProvider from './AvatarUrlProvider'; import { CallProvider } from './CallProvider'; @@ -11,7 +12,7 @@ import CustomSoundProvider from './CustomSoundProvider'; import { DeviceProvider } from './DeviceProvider/DeviceProvider'; import EmojiPickerProvider from './EmojiPickerProvider'; import LayoutProvider from './LayoutProvider'; -import ModalProvider from './ModalProvider'; +import ModalProvider from './ModalProvider/ModalProvider'; import OmnichannelProvider from './OmnichannelProvider'; import RouterProvider from './RouterProvider'; import ServerProvider from './ServerProvider'; @@ -35,29 +36,31 @@ const MeteorProvider: FC = ({ children }) => ( - - - - - - - - - - - - {children} - - - - - - - - - - - + + + + + + + + + + + + + {children} + + + + + + + + + + + + diff --git a/apps/meteor/client/providers/ModalProvider.tsx b/apps/meteor/client/providers/ModalProvider.tsx deleted file mode 100644 index 39d36d172c00..000000000000 --- a/apps/meteor/client/providers/ModalProvider.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import { ModalContext } from '@rocket.chat/ui-contexts'; -import type { ReactNode } from 'react'; -import React, { useState, useMemo, memo, Suspense, createElement, useEffect } from 'react'; - -import { imperativeModal } from '../lib/imperativeModal'; - -const mapCurrentModal = (descriptor: typeof imperativeModal.current): ReactNode => { - if (descriptor === null) { - return null; - } - - if ('component' in descriptor) { - return ( - }> - {createElement(descriptor.component, { - key: Math.random(), - ...descriptor.props, - })} - - ); - } -}; - -type ModalProviderProps = { - children?: ReactNode; -}; - -const ModalProvider = ({ children }: ModalProviderProps) => { - const [currentModal, setCurrentModal] = useState(() => mapCurrentModal(imperativeModal.current)); - - const contextValue = useMemo( - () => ({ - modal: { - setModal: setCurrentModal, - }, - currentModal, - }), - [currentModal], - ); - - useEffect( - () => - imperativeModal.on('update', (descriptor) => { - setCurrentModal(mapCurrentModal(descriptor)); - }), - [], - ); - - return ; -}; - -export default memo(ModalProvider); diff --git a/apps/meteor/client/providers/ModalProvider/ModalProvider.spec.tsx b/apps/meteor/client/providers/ModalProvider/ModalProvider.spec.tsx new file mode 100644 index 000000000000..f77933337456 --- /dev/null +++ b/apps/meteor/client/providers/ModalProvider/ModalProvider.spec.tsx @@ -0,0 +1,115 @@ +// import type { IMessage } from '@rocket.chat/core-typings'; +import { Emitter } from '@rocket.chat/emitter'; +import { useSetModal } from '@rocket.chat/ui-contexts'; +import { render, screen } from '@testing-library/react'; +import { expect } from 'chai'; +import type { ReactNode } from 'react'; +import React, { Suspense, createContext, useContext, useEffect } from 'react'; + +import GenericModal from '../../components/GenericModal'; +import { imperativeModal } from '../../lib/imperativeModal'; +import ModalRegion from '../../views/modal/ModalRegion'; +import ModalProvider from './ModalProvider'; +import ModalProviderWithRegion from './ModalProviderWithRegion'; + +const TestContext = createContext({ title: 'default' }); +const emitter = new Emitter(); + +const TestModal = ({ emitterEvent, modalFunc }: { emitterEvent: string; modalFunc?: () => ReactNode }) => { + const setModal = useSetModal(); + const { title } = useContext(TestContext); + + useEffect(() => { + emitter.on(emitterEvent, () => { + setModal(modalFunc || undefined}>); + }); + }, [emitterEvent, setModal, title, modalFunc]); + + return <>; +}; + +describe('Modal Provider', () => { + it('should render a modal', async () => { + render( + + + + + , + ); + emitter.emit('open'); + expect(await screen.findByText('default')).to.exist; + }); + + it('should render a modal that is passed as a function', async () => { + render( + + + undefined} />} /> + + , + ); + emitter.emit('open'); + expect(await screen.findByText('function modal')).to.exist; + }); + + it('should render a modal through imperative modal', () => { + async () => { + render( + + + + + , + ); + + const { close } = imperativeModal.open({ + component: GenericModal, + props: { title: 'imperativeModal' }, + }); + + expect(await screen.findByText('imperativeModal')).to.exist; + + close(); + + expect(screen.queryByText('imperativeModal')).to.not.exist; + }; + }); + + it('should not render a modal if no corresponding region exists', async () => { + // ModalProviderWithRegion will always have a region identifier set + // and imperativeModal will only render modals in the default region (e.g no region identifier) + render( + + + , + ); + + imperativeModal.open({ + component: GenericModal, + props: { title: 'imperativeModal' }, + }); + + expect(screen.queryByText('imperativeModal')).to.not.exist; + }); + + it('should render a modal in another region', () => { + render( + + + + + + + + + + , + ); + + emitter.emit('openModal1'); + expect(screen.getByText('modal1')).to.exist; + emitter.emit('openModal2'); + expect(screen.getByText('modal2')).to.exist; + }); +}); diff --git a/apps/meteor/client/providers/ModalProvider/ModalProvider.tsx b/apps/meteor/client/providers/ModalProvider/ModalProvider.tsx new file mode 100644 index 000000000000..6c3f1026bc51 --- /dev/null +++ b/apps/meteor/client/providers/ModalProvider/ModalProvider.tsx @@ -0,0 +1,42 @@ +import { useEffectEvent } from '@rocket.chat/fuselage-hooks'; +import { ModalContext } from '@rocket.chat/ui-contexts'; +import type { ReactNode } from 'react'; +import React, { useMemo, memo } from 'react'; +import { useSyncExternalStore } from 'use-sync-external-store/shim'; + +import { modalStore } from './ModalStore'; + +type ModalProviderProps = { + children?: ReactNode; + region?: symbol; +}; + +const ModalProvider = ({ children, region }: ModalProviderProps) => { + const currentModal = useSyncExternalStore(modalStore.subscribe, modalStore.getSnapshot); + + const setModal = useEffectEvent((modal: ReactNode | (() => ReactNode)) => { + if (typeof modal === 'function') { + modalStore.open(modal(), region); + return; + } + modalStore.open(modal, region); + }); + + const contextValue = useMemo( + () => ({ + modal: { + setModal, + }, + currentModal: { + component: currentModal?.node, + region: currentModal?.region, + }, + region, + }), + [currentModal, region, setModal], + ); + + return ; +}; + +export default memo(ModalProvider); diff --git a/apps/meteor/client/providers/ModalProvider/ModalProviderWithRegion.tsx b/apps/meteor/client/providers/ModalProvider/ModalProviderWithRegion.tsx new file mode 100644 index 000000000000..e8d1f52bbd9a --- /dev/null +++ b/apps/meteor/client/providers/ModalProvider/ModalProviderWithRegion.tsx @@ -0,0 +1,18 @@ +import type { ReactNode } from 'react'; +import React, { useState } from 'react'; + +import ModalRegion from '../../views/modal/ModalRegion'; +import ModalProvider from './ModalProvider'; + +const ModalProviderWithRegion = ({ children }: { children?: ReactNode }) => { + const [region] = useState(() => Symbol()); + + return ( + + + {children} + + ); +}; + +export default ModalProviderWithRegion; diff --git a/apps/meteor/client/providers/ModalProvider/ModalStore.ts b/apps/meteor/client/providers/ModalProvider/ModalStore.ts new file mode 100644 index 000000000000..256a5614ef21 --- /dev/null +++ b/apps/meteor/client/providers/ModalProvider/ModalStore.ts @@ -0,0 +1,65 @@ +import { Emitter } from '@rocket.chat/emitter'; +import type { ReactNode } from 'react'; + +type ModalInstance = { + close: () => void; + cancel: () => void; +}; + +type ModalWithRegion = { node: ReactNode; region?: symbol }; + +class ModalStore extends Emitter<{ update: void }> { + private modalStack: ModalWithRegion[] = []; + + update(): void { + this.emit('update'); + } + + // open function erases all other modals from the stack + open = (node: ReactNode, region?: symbol): ModalInstance => { + this.modalStack = [{ node, region }]; + this.update(); + + return { + close: () => { + this.modalStack = this.modalStack.filter((modal) => modal !== this.current); + this.update(); + }, + cancel: this.close, + }; + }; + + push = (node: ReactNode, region?: symbol): ModalInstance => { + this.modalStack = [...this.modalStack, { node, region }]; + this.update(); + + return { + close: () => { + this.modalStack = this.modalStack.filter((modal) => modal !== this.current); + this.update(); + }, + cancel: this.close, + }; + }; + + close = (): void => { + this.modalStack = this.modalStack.slice(0, -1); + this.update(); + }; + + subscribe = (cb: () => void): (() => void) => { + this.on('update', cb); + + return () => this.off('update', cb); + }; + + getSnapshot = (): ModalWithRegion | null => { + return this.current; + }; + + get current(): ModalWithRegion | null { + return this.modalStack[this.modalStack.length - 1] ?? null; + } +} + +export const modalStore = new ModalStore(); diff --git a/apps/meteor/client/providers/OmnichannelProvider.tsx b/apps/meteor/client/providers/OmnichannelProvider.tsx index d9eee0ac4b00..47ccb3d39c88 100644 --- a/apps/meteor/client/providers/OmnichannelProvider.tsx +++ b/apps/meteor/client/providers/OmnichannelProvider.tsx @@ -13,13 +13,13 @@ import React, { useState, useEffect, useMemo, useCallback, memo, useRef } from ' import { LivechatInquiry } from '../../app/livechat/client/collections/LivechatInquiry'; import { initializeLivechatInquiryStream } from '../../app/livechat/client/lib/stream/queueManager'; import { getOmniChatSortQuery } from '../../app/livechat/lib/inquiries'; -import { Notifications } from '../../app/notifications/client'; import { KonchatNotification } from '../../app/ui/client/lib/KonchatNotification'; import { useHasLicenseModule } from '../../ee/client/hooks/useHasLicenseModule'; import { ClientLogger } from '../../lib/ClientLogger'; import type { OmnichannelContextValue } from '../contexts/OmnichannelContext'; import { OmnichannelContext } from '../contexts/OmnichannelContext'; import { useReactiveValue } from '../hooks/useReactiveValue'; +import { useShouldPreventAction } from '../hooks/useShouldPreventAction'; const emptyContextValue: OmnichannelContextValue = { inquiries: { enabled: false }, @@ -27,6 +27,7 @@ const emptyContextValue: OmnichannelContextValue = { isEnterprise: false, agentAvailable: false, showOmnichannelQueueLink: false, + isOverMacLimit: false, livechatPriorities: { enabled: false, data: [], @@ -39,7 +40,7 @@ const OmnichannelProvider: FC = ({ children }) => { const omniChannelEnabled = useSetting('Livechat_enabled') as boolean; const omnichannelRouting = useSetting('Livechat_Routing_Method'); const showOmnichannelQueueLink = useSetting('Livechat_show_queue_list_link') as boolean; - const omnichannelPoolMaxIncoming = useSetting('Livechat_guest_pool_max_number_incoming_livechats_displayed') as number; + const omnichannelPoolMaxIncoming = useSetting('Livechat_guest_pool_max_number_incoming_livechats_displayed') ?? 0; const omnichannelSortingMechanism = useSetting('Omnichannel_sorting_mechanism') as OmnichannelSortingMechanismSettingType; const loggerRef = useRef(new ClientLogger('OmnichannelProvider')); @@ -63,6 +64,7 @@ const OmnichannelProvider: FC = ({ children }) => { const subscribe = useStream('notify-logged'); const queryClient = useQueryClient(); const isPrioritiesEnabled = isEnterprise && accessible; + const enabled = accessible && !!user && !!routeConfig; const { data: { priorities = [] } = {}, @@ -73,6 +75,8 @@ const OmnichannelProvider: FC = ({ children }) => { enabled: isPrioritiesEnabled, }); + const isOverMacLimit = useShouldPreventAction('monthlyActiveContacts'); + useEffect(() => { if (!isPrioritiesEnabled) { return; @@ -102,10 +106,10 @@ const OmnichannelProvider: FC = ({ children }) => { } }, [accessible, getRoutingConfig, iceServersSetting, omnichannelRouting, setRouteConfig, voipCallAvailable]); - const enabled = accessible && !!user && !!routeConfig; const manuallySelected = enabled && canViewOmnichannelQueue && !!routeConfig && routeConfig.showQueue && !routeConfig.autoAssignAgent && agentAvailable; + const streamNotifyUser = useStream('notify-user'); useEffect(() => { if (!manuallySelected) { return; @@ -116,8 +120,11 @@ const OmnichannelProvider: FC = ({ children }) => { }; initializeLivechatInquiryStream(user?._id); - return Notifications.onUser('departmentAgentData', handleDepartmentAgentData).stop; - }, [manuallySelected, user?._id]); + if (!user?._id) { + return; + } + return streamNotifyUser(`${user._id}/departmentAgentData`, handleDepartmentAgentData); + }, [manuallySelected, streamNotifyUser, user?._id]); const queue = useReactiveValue( useCallback(() => { @@ -126,16 +133,13 @@ const OmnichannelProvider: FC = ({ children }) => { } return LivechatInquiry.find( - { - status: 'queued', - $or: [{ defaultAgent: { $exists: false } }, { 'defaultAgent.agentId': user?._id }], - }, + { status: 'queued' }, { sort: getOmniChatSortQuery(omnichannelSortingMechanism), limit: omnichannelPoolMaxIncoming, }, ).fetch(); - }, [manuallySelected, omnichannelPoolMaxIncoming, omnichannelSortingMechanism, user?._id]), + }, [manuallySelected, omnichannelPoolMaxIncoming, omnichannelSortingMechanism]), ); queue?.map(({ rid }) => { @@ -167,6 +171,7 @@ const OmnichannelProvider: FC = ({ children }) => { voipCallAvailable, routeConfig, livechatPriorities, + isOverMacLimit, }; } @@ -185,6 +190,7 @@ const OmnichannelProvider: FC = ({ children }) => { : { enabled: false }, showOmnichannelQueueLink: showOmnichannelQueueLink && !!agentAvailable, livechatPriorities, + isOverMacLimit, }; }, [ enabled, @@ -199,6 +205,7 @@ const OmnichannelProvider: FC = ({ children }) => { routeConfig, queue, showOmnichannelQueueLink, + isOverMacLimit, ]); return ; diff --git a/apps/meteor/client/providers/RouterProvider.tsx b/apps/meteor/client/providers/RouterProvider.tsx index 0f146ec83128..4f0aab3a602b 100644 --- a/apps/meteor/client/providers/RouterProvider.tsx +++ b/apps/meteor/client/providers/RouterProvider.tsx @@ -131,7 +131,7 @@ const defineRoutes = (routes: RouteObject[]) => { const flowRoutes = routes.map((route) => { if (route.path === '*') { FlowRouter.notFound = { - action: () => appLayout.renderStandalone(<>{route.element}), + action: () => appLayout.render(<>{route.element}), }; return FlowRouter.notFound; @@ -139,7 +139,7 @@ const defineRoutes = (routes: RouteObject[]) => { return FlowRouter.route(route.path, { name: route.id, - action: () => appLayout.renderStandalone(<>{route.element}), + action: () => appLayout.render(<>{route.element}), }); }); @@ -156,7 +156,7 @@ const defineRoutes = (routes: RouteObject[]) => { delete FlowRouter._routesMap[flowRoute.name]; } else { FlowRouter.notFound = { - action: () => appLayout.renderStandalone(<>), + action: () => appLayout.render(<>), }; } }); diff --git a/apps/meteor/client/providers/ServerProvider.tsx b/apps/meteor/client/providers/ServerProvider.tsx index 8ff767b20933..8eb5e2e37b6b 100644 --- a/apps/meteor/client/providers/ServerProvider.tsx +++ b/apps/meteor/client/providers/ServerProvider.tsx @@ -1,5 +1,4 @@ import type { Serialized } from '@rocket.chat/core-typings'; -import { Emitter } from '@rocket.chat/emitter'; import type { Method, PathFor, OperationParams, OperationResult, UrlParams, PathPattern } from '@rocket.chat/rest-typings'; import type { ServerMethodName, @@ -59,58 +58,16 @@ const callEndpoint = ( const uploadToEndpoint = (endpoint: PathFor<'POST'>, formData: any): Promise => sdk.rest.post(endpoint as any, formData); -const getStream = >( - streamName: N, - _options?: { - retransmit?: boolean | undefined; - retransmitToSelf?: boolean | undefined; - }, -): ((eventName: K, callback: (...args: StreamerCallbackArgs) => void) => () => void) => { - return (eventName, callback): (() => void) => { - return sdk.stream(streamName, [eventName], callback as (...args: any[]) => void).stop; - }; -}; - -const ee = new Emitter>(); - -const events = new Map void>(); - -const getSingleStream = >( - streamName: N, - _options?: { - retransmit?: boolean | undefined; - retransmitToSelf?: boolean | undefined; - }, -): ((eventName: K, callback: (...args: StreamerCallbackArgs) => void) => () => void) => { - const stream = getStream(streamName); - return (eventName, callback): (() => void) => { - ee.on(`${streamName}/${eventName}`, callback); - - const handler = (...args: any[]): void => { - ee.emit(`${streamName}/${eventName}`, ...args); - }; - - const stop = (): void => { - // If someone is still listening, don't unsubscribe - ee.off(`${streamName}/${eventName}`, callback); - - if (ee.has(`${streamName}/${eventName}`)) { - return; - } - - const unsubscribe = events.get(`${streamName}/${eventName}`); - if (unsubscribe) { - unsubscribe(); - events.delete(`${streamName}/${eventName}`); - } - }; - - if (!events.has(`${streamName}/${eventName}`)) { - events.set(`${streamName}/${eventName}`, stream(eventName, handler)); - } - return stop; - }; -}; +const getStream = + ( + streamName: N, + _options?: { + retransmit?: boolean | undefined; + retransmitToSelf?: boolean | undefined; + }, + ) => + >(eventName: K, callback: (...args: StreamerCallbackArgs) => void): (() => void) => + sdk.stream(streamName, [eventName], callback).stop; const contextValue = { info, @@ -119,7 +76,6 @@ const contextValue = { callEndpoint, uploadToEndpoint, getStream, - getSingleStream, }; const ServerProvider: FC = ({ children }) => ; diff --git a/apps/meteor/client/providers/TooltipProvider.tsx b/apps/meteor/client/providers/TooltipProvider.tsx index 0fc7c996b9f3..4cc9aa3a767c 100644 --- a/apps/meteor/client/providers/TooltipProvider.tsx +++ b/apps/meteor/client/providers/TooltipProvider.tsx @@ -4,7 +4,7 @@ import { TooltipContext } from '@rocket.chat/ui-contexts'; import type { FC, ReactNode } from 'react'; import React, { useEffect, useMemo, useRef, memo, useCallback, useState } from 'react'; -import TooltipPortal from '../components/TooltipPortal'; +import TooltipPortal from '../portals/TooltipPortal'; const TooltipProvider: FC = ({ children }) => { const lastAnchor = useRef(); diff --git a/apps/meteor/client/providers/TranslationProvider.tsx b/apps/meteor/client/providers/TranslationProvider.tsx index 2cf47066c4e4..7f98c374f949 100644 --- a/apps/meteor/client/providers/TranslationProvider.tsx +++ b/apps/meteor/client/providers/TranslationProvider.tsx @@ -1,7 +1,8 @@ -import { useLocalStorage, useMutableCallback } from '@rocket.chat/fuselage-hooks'; +import { useLocalStorage } from '@rocket.chat/fuselage-hooks'; import languages from '@rocket.chat/i18n/dist/languages'; import en from '@rocket.chat/i18n/src/locales/en.i18n.json'; -import type { TranslationKey, TranslationContextValue } from '@rocket.chat/ui-contexts'; +import { normalizeLanguage } from '@rocket.chat/tools'; +import type { TranslationContextValue } from '@rocket.chat/ui-contexts'; import { useMethod, useSetting, TranslationContext } from '@rocket.chat/ui-contexts'; import type i18next from 'i18next'; import I18NextHttpBackend from 'i18next-http-backend'; @@ -13,100 +14,73 @@ import { I18nextProvider, initReactI18next, useTranslation } from 'react-i18next import { CachedCollectionManager } from '../../app/ui-cached-collection/client'; import { getURL } from '../../app/utils/client'; -import { i18n, addSprinfToI18n } from '../../app/utils/lib/i18n'; +import { + i18n, + addSprinfToI18n, + extractTranslationKeys, + applyCustomTranslations, + availableTranslationNamespaces, + defaultTranslationNamespace, + extractTranslationNamespaces, +} from '../../app/utils/lib/i18n'; import { AppClientOrchestratorInstance } from '../../ee/client/apps/orchestrator'; -import { applyCustomTranslations } from '../lib/utils/applyCustomTranslations'; -import { filterLanguage } from '../lib/utils/filterLanguage'; import { isRTLScriptLanguage } from '../lib/utils/isRTLScriptLanguage'; i18n.use(I18NextHttpBackend).use(initReactI18next).use(sprintf); -type TranslationNamespace = Extract extends `${infer T}.${string}` - ? T extends Lowercase - ? T - : never - : never; - -const namespacesDefault = ['core', 'onboarding', 'registration', 'cloud'] as TranslationNamespace[]; - -const parseToJSON = (customTranslations: string): Record> | false => { - try { - return JSON.parse(customTranslations); - } catch (e) { - return false; - } -}; - -const localeCache = new Map>(); - -const useI18next = (lng: string): typeof i18next => { +const useCustomTranslations = (i18n: typeof i18next) => { const customTranslations = useSetting('Custom_Translations'); - const parsedCustomTranslations = useMemo(() => { + const parsedCustomTranslations = useMemo((): Record> | undefined => { if (!customTranslations || typeof customTranslations !== 'string') { - return; + return undefined; } - return parseToJSON(customTranslations); + try { + return JSON.parse(customTranslations); + } catch (e) { + console.error(e); + return undefined; + } }, [customTranslations]); - const extractKeys = useMutableCallback( - (source: Record, lngs?: string | string[], namespaces: string | string[] = []): { [key: string]: any } => { - const result: { [key: string]: any } = {}; - - for (const [key, value] of Object.entries(source)) { - const [prefix] = key.split('.'); - - if (prefix && Array.isArray(namespaces) ? namespaces.includes(prefix) : prefix === namespaces) { - result[key.slice(prefix.length + 1)] = value; - continue; - } - - if (Array.isArray(namespaces) ? namespaces.includes('core') : namespaces === 'core') { - result[key] = value; - } - } + useEffect(() => { + if (!parsedCustomTranslations) { + return; + } - if (lngs && parsedCustomTranslations) { - for (const language of Array.isArray(lngs) ? lngs : [lngs]) { - if (!parsedCustomTranslations[language]) { - continue; - } + applyCustomTranslations(i18n, parsedCustomTranslations); - for (const [key, value] of Object.entries(parsedCustomTranslations[language])) { - const prefix = (Array.isArray(namespaces) ? namespaces : [namespaces]).find((namespace) => key.startsWith(`${namespace}.`)); + const handleLanguageChanged = (): void => { + applyCustomTranslations(i18n, parsedCustomTranslations); + }; - if (prefix) { - result[key.slice(prefix.length + 1)] = value; - continue; - } + i18n.on('languageChanged', handleLanguageChanged); - if (Array.isArray(namespaces) ? namespaces.includes('core') : namespaces === 'core') { - result[key] = value; - } - } - } - } + return () => { + i18n.off('languageChanged', handleLanguageChanged); + }; + }, [i18n, parsedCustomTranslations]); +}; - return result; - }, - ); +const localeCache = new Map>(); +const useI18next = (lng: string): typeof i18next => { if (!i18n.isInitialized) { i18n.init({ lng, fallbackLng: 'en', - ns: namespacesDefault, + ns: availableTranslationNamespaces, + defaultNS: defaultTranslationNamespace, nsSeparator: '.', resources: { - en: extractKeys(en), + en: extractTranslationNamespaces(en), }, partialBundledLanguages: true, - defaultNS: 'core', backend: { loadPath: 'i18n/{{lng}}.json', - parse: (data: string, lngs?: string | string[], namespaces: string | string[] = []) => - extractKeys(JSON.parse(data), lngs, namespaces), + parse: (data: string, _lngs?: string | string[], namespaces: string | string[] = []) => + extractTranslationKeys(JSON.parse(data), namespaces), request: (_options, url, _payload, callback) => { const params = url.split('/'); @@ -137,50 +111,15 @@ const useI18next = (lng: string): typeof i18next => { } useEffect(() => { - if (i18n.language !== lng) { - i18n.changeLanguage(lng); - } + i18n.changeLanguage(lng); }, [lng]); - useEffect(() => { - if (!parsedCustomTranslations) { - return; - } - - for (const [ln, translations] of Object.entries(parsedCustomTranslations)) { - if (!translations) { - continue; - } - const namespaces = Object.entries(translations).reduce((acc, [key, value]): Record> => { - const namespace = key.split('.')[0]; - - if (namespacesDefault.includes(namespace as unknown as TranslationNamespace)) { - acc[namespace] = acc[namespace] ?? {}; - acc[namespace][key] = value; - acc[namespace][key.slice(namespace.length + 1)] = value; - return acc; - } - acc.project = acc.project ?? {}; - acc.project[key] = value; - return acc; - }, {} as Record>); - - for (const [namespace, translations] of Object.entries(namespaces)) { - i18n.addResourceBundle(ln, namespace, translations); - } - } - }, [parsedCustomTranslations]); - return i18n; }; -type TranslationProviderProps = { - children: ReactNode; -}; - const useAutoLanguage = () => { const serverLanguage = useSetting('Language'); - const browserLanguage = filterLanguage(window.navigator.userLanguage ?? window.navigator.language); + const browserLanguage = normalizeLanguage(window.navigator.userLanguage ?? window.navigator.language); const defaultUserLanguage = browserLanguage || serverLanguage || 'en'; // if the language is supported, if not remove the region @@ -206,11 +145,17 @@ const getLanguageName = (code: string, lng: string): string => { } }; +type TranslationProviderProps = { + children: ReactNode; +}; + const TranslationProvider = ({ children }: TranslationProviderProps): ReactElement => { const loadLocale = useMethod('loadLocale'); const language = useAutoLanguage(); const i18nextInstance = useI18next(language); + useCustomTranslations(i18nextInstance); + const availableLanguages = useMemo( () => [ { @@ -290,8 +235,8 @@ const TranslationProviderInner = ({ () => ({ language: i18n.language, languages: availableLanguages, - loadLanguage: async (language: string): Promise => { - i18n.changeLanguage(language).then(() => applyCustomTranslations()); + loadLanguage: async (language: string) => { + i18n.changeLanguage(language); }, translate: Object.assign(addSprinfToI18n(t), { has: ((key, options) => key && i18n.exists(key, options)) as TranslationContextValue['translate']['has'], diff --git a/apps/meteor/client/providers/UserProvider/UserProvider.tsx b/apps/meteor/client/providers/UserProvider/UserProvider.tsx index 432a197671f3..62ed7070737d 100644 --- a/apps/meteor/client/providers/UserProvider/UserProvider.tsx +++ b/apps/meteor/client/providers/UserProvider/UserProvider.tsx @@ -1,7 +1,7 @@ import type { IRoom, ISubscription, IUser } from '@rocket.chat/core-typings'; import { useLocalStorage } from '@rocket.chat/fuselage-hooks'; -import type { LoginService, SubscriptionWithRoom } from '@rocket.chat/ui-contexts'; -import { UserContext, useEndpoint, useSetting } from '@rocket.chat/ui-contexts'; +import type { SubscriptionWithRoom } from '@rocket.chat/ui-contexts'; +import { UserContext, useEndpoint } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import type { ContextType, ReactElement, ReactNode } from 'react'; import React, { useEffect, useMemo } from 'react'; @@ -10,36 +10,18 @@ import { Subscriptions, ChatRoom } from '../../../app/models/client'; import { getUserPreference } from '../../../app/utils/client'; import { sdk } from '../../../app/utils/client/lib/SDKClient'; import { afterLogoutCleanUpCallback } from '../../../lib/callbacks/afterLogoutCleanUpCallback'; -import { useIsEnterprise } from '../../hooks/useIsEnterprise'; import { useReactiveValue } from '../../hooks/useReactiveValue'; import { createReactiveSubscriptionFactory } from '../../lib/createReactiveSubscriptionFactory'; import { useCreateFontStyleElement } from '../../views/account/accessibility/hooks/useCreateFontStyleElement'; +import { useClearRemovedRoomsHistory } from './hooks/useClearRemovedRoomsHistory'; +import { useDeleteUser } from './hooks/useDeleteUser'; import { useEmailVerificationWarning } from './hooks/useEmailVerificationWarning'; -import { useLDAPAndCrowdCollisionWarning } from './hooks/useLDAPAndCrowdCollisionWarning'; +import { useUpdateAvatar } from './hooks/useUpdateAvatar'; const getUserId = (): string | null => Meteor.userId(); const getUser = (): IUser | null => Meteor.user() as IUser | null; -const capitalize = (str: string): string => str.charAt(0).toUpperCase() + str.slice(1); - -const config: Record> = { - 'apple': { title: 'Apple', icon: 'apple' }, - 'facebook': { title: 'Facebook', icon: 'facebook' }, - 'twitter': { title: 'Twitter', icon: 'twitter' }, - 'google': { title: 'Google', icon: 'google' }, - 'github': { title: 'Github', icon: 'github' }, - 'github_enterprise': { title: 'Github Enterprise', icon: 'github' }, - 'gitlab': { title: 'Gitlab', icon: 'gitlab' }, - 'dolphin': { title: 'Dolphin', icon: 'dophin' }, - 'drupal': { title: 'Drupal', icon: 'drupal' }, - 'nextcloud': { title: 'Nextcloud', icon: 'nextcloud' }, - 'tokenpass': { title: 'Tokenpass', icon: 'tokenpass' }, - 'meteor-developer': { title: 'Meteor', icon: 'meteor' }, - 'wordpress': { title: 'WordPress', icon: 'wordpress' }, - 'linkedin': { title: 'Linkedin', icon: 'linkedin' }, -}; - const logout = (): Promise => new Promise((resolve, reject) => { const user = getUser(); @@ -54,16 +36,11 @@ const logout = (): Promise => }); }); -export type LoginMethods = keyof typeof Meteor; - type UserProviderProps = { children: ReactNode; }; const UserProvider = ({ children }: UserProviderProps): ReactElement => { - const isLdapEnabled = useSetting('LDAP_Enable'); - const isCrowdEnabled = useSetting('CROWD_Enable'); - const userId = useReactiveValue(getUserId); const user = useReactiveValue(getUser); const [userLanguage, setUserLanguage] = useLocalStorage('userLanguage', ''); @@ -74,10 +51,11 @@ const UserProvider = ({ children }: UserProviderProps): ReactElement => { const createFontStyleElement = useCreateFontStyleElement(); createFontStyleElement(user?.settings?.preferences?.fontSize); - const loginMethod: LoginMethods = (isLdapEnabled && 'loginWithLDAP') || (isCrowdEnabled && 'loginWithCrowd') || 'loginWithPassword'; - - useLDAPAndCrowdCollisionWarning(); useEmailVerificationWarning(user ?? undefined); + useClearRemovedRoomsHistory(userId); + + useDeleteUser(); + useUpdateAvatar(); const contextValue = useMemo( (): ContextType => ({ @@ -97,75 +75,9 @@ const UserProvider = ({ children }: UserProviderProps): ReactElement => { return ChatRoom.find(query, options).fetch(); }), - loginWithToken: (token: string): Promise => - new Promise((resolve, reject) => - Meteor.loginWithToken(token, (err) => { - if (err) { - return reject(err); - } - resolve(undefined); - }), - ), - loginWithPassword: (user: string | { username: string } | { email: string } | { id: string }, password: string): Promise => - new Promise((resolve, reject) => { - Meteor[loginMethod](user, password, (error: Error | Meteor.Error | Meteor.TypedError | undefined) => { - if (error) { - reject(error); - return; - } - - resolve(); - }); - }), logout, - loginWithService: ({ service, clientConfig = {} }: T): (() => Promise) => { - const loginMethods = { - 'meteor-developer': 'MeteorDeveloperAccount', - }; - - const loginWithService = `loginWith${(loginMethods as any)[service] || capitalize(String(service || ''))}`; - - const method: (config: unknown, cb: (error: any) => void) => Promise = (Meteor as any)[loginWithService] as any; - - if (!method) { - return () => Promise.reject(new Error('Login method not found')); - } - - return () => - new Promise((resolve, reject) => { - method(clientConfig, (error: any): void => { - if (!error) { - resolve(true); - return; - } - reject(error); - }); - }); - }, - queryAllServices: createReactiveSubscriptionFactory(() => - ServiceConfiguration.configurations - .find( - { - showButton: { $ne: false }, - }, - { - sort: { - service: 1, - }, - }, - ) - .fetch() - .map( - ({ appId: _, ...service }) => - ({ - title: capitalize(String((service as any).service || '')), - ...service, - ...(config[(service as any).service] ?? {}), - } as any), - ), - ), }), - [userId, user, loginMethod], + [userId, user], ); useEffect(() => { @@ -180,14 +92,6 @@ const UserProvider = ({ children }: UserProviderProps): ReactElement => { } }, [preferedLanguage, setPreferedLanguage, setUserLanguage, user?.language, userLanguage, userId, setUserPreferences]); - const { data: license } = useIsEnterprise({ enabled: !!userId }); - - useEffect(() => { - if (!license?.isEnterprise && user?.settings?.preferences?.themeAppearence === 'high-contrast') { - setUserPreferences({ data: { themeAppearence: 'light' } }); - } - }, [license?.isEnterprise, setUserPreferences, user?.settings?.preferences?.themeAppearence]); - return ; }; diff --git a/apps/meteor/client/providers/UserProvider/hooks/useClearRemovedRoomsHistory.ts b/apps/meteor/client/providers/UserProvider/hooks/useClearRemovedRoomsHistory.ts new file mode 100644 index 000000000000..f48b55986756 --- /dev/null +++ b/apps/meteor/client/providers/UserProvider/hooks/useClearRemovedRoomsHistory.ts @@ -0,0 +1,19 @@ +import { useStream } from '@rocket.chat/ui-contexts'; +import { useEffect } from 'react'; + +import { RoomHistoryManager } from '../../../../app/ui-utils/client'; + +export const useClearRemovedRoomsHistory = (userId: string | null) => { + const subscribeToNotifyUser = useStream('notify-user'); + useEffect(() => { + if (!userId) { + return; + } + + return subscribeToNotifyUser(`${userId}/subscriptions-changed`, (event, data) => { + if (data.t !== 'l' && event === 'removed' && data.rid) { + RoomHistoryManager.clear(data.rid); + } + }); + }, [userId, subscribeToNotifyUser]); +}; diff --git a/apps/meteor/client/providers/UserProvider/hooks/useDeleteUser.ts b/apps/meteor/client/providers/UserProvider/hooks/useDeleteUser.ts new file mode 100644 index 000000000000..e86fe9951a26 --- /dev/null +++ b/apps/meteor/client/providers/UserProvider/hooks/useDeleteUser.ts @@ -0,0 +1,32 @@ +import { useStream } from '@rocket.chat/ui-contexts'; +import { useEffect } from 'react'; + +import { ChatMessage } from '../../../../app/models/client'; + +export const useDeleteUser = () => { + const notify = useStream('notify-logged'); + + useEffect(() => { + return notify('Users:Deleted', ({ userId, messageErasureType, replaceByUser }) => { + if (messageErasureType === 'Unlink' && replaceByUser) { + return ChatMessage.update( + { + 'u._id': userId, + }, + { + $set: { + 'alias': replaceByUser.alias, + 'u._id': replaceByUser._id, + 'u.username': replaceByUser.username, + 'u.name': undefined, + }, + }, + { multi: true }, + ); + } + ChatMessage.remove({ + 'u._id': userId, + }); + }); + }, [notify]); +}; diff --git a/apps/meteor/client/providers/UserProvider/hooks/useUpdateAvatar.ts b/apps/meteor/client/providers/UserProvider/hooks/useUpdateAvatar.ts new file mode 100644 index 000000000000..292880e23da8 --- /dev/null +++ b/apps/meteor/client/providers/UserProvider/hooks/useUpdateAvatar.ts @@ -0,0 +1,15 @@ +import { useStream } from '@rocket.chat/ui-contexts'; +import { Meteor } from 'meteor/meteor'; +import { useEffect } from 'react'; + +export const useUpdateAvatar = () => { + const notify = useStream('notify-logged'); + useEffect(() => { + return notify('updateAvatar', (data) => { + if ('username' in data) { + const { username, etag } = data; + username && Meteor.users.update({ username }, { $set: { avatarETag: etag } }); + } + }); + }, [notify]); +}; diff --git a/apps/meteor/client/sidebar/Item/Condensed.stories.tsx b/apps/meteor/client/sidebar/Item/Condensed.stories.tsx index 61e392e77e2e..f63893a30a81 100644 --- a/apps/meteor/client/sidebar/Item/Condensed.stories.tsx +++ b/apps/meteor/client/sidebar/Item/Condensed.stories.tsx @@ -1,10 +1,10 @@ import { Box, IconButton } from '@rocket.chat/fuselage'; +import { UserAvatar } from '@rocket.chat/ui-avatar'; import { action } from '@storybook/addon-actions'; import type { ComponentMeta, ComponentStory } from '@storybook/react'; import React from 'react'; import * as Status from '../../components/UserStatus'; -import UserAvatar from '../../components/avatar/UserAvatar'; import Condensed from './Condensed'; export default { diff --git a/apps/meteor/client/sidebar/Item/Condensed.tsx b/apps/meteor/client/sidebar/Item/Condensed.tsx index e964958f635f..99222d2e9c70 100644 --- a/apps/meteor/client/sidebar/Item/Condensed.tsx +++ b/apps/meteor/client/sidebar/Item/Condensed.tsx @@ -44,7 +44,7 @@ const Condensed: FC = ({ icon, title = '', avatar, actions, href {badges && {badges}} {menu && ( - {menuVisibility ? menu() : } + {menuVisibility ? menu() : } )} diff --git a/apps/meteor/client/sidebar/Item/Extended.stories.tsx b/apps/meteor/client/sidebar/Item/Extended.stories.tsx index 7e2b79ad1d6f..a6392eae5d61 100644 --- a/apps/meteor/client/sidebar/Item/Extended.stories.tsx +++ b/apps/meteor/client/sidebar/Item/Extended.stories.tsx @@ -1,10 +1,10 @@ import { Box, IconButton, Badge } from '@rocket.chat/fuselage'; +import { UserAvatar } from '@rocket.chat/ui-avatar'; import { action } from '@storybook/addon-actions'; import type { ComponentMeta, ComponentStory } from '@storybook/react'; import React from 'react'; import * as Status from '../../components/UserStatus'; -import UserAvatar from '../../components/avatar/UserAvatar'; import Extended from './Extended'; export default { diff --git a/apps/meteor/client/sidebar/Item/Extended.tsx b/apps/meteor/client/sidebar/Item/Extended.tsx index c997a48b5b4a..73493a4aee8f 100644 --- a/apps/meteor/client/sidebar/Item/Extended.tsx +++ b/apps/meteor/client/sidebar/Item/Extended.tsx @@ -54,7 +54,7 @@ const Extended: VFC = ({ }; return ( - + {avatar && {avatar}} @@ -72,7 +72,7 @@ const Extended: VFC = ({ {badges} {menu && ( - {menuVisibility ? menu() : } + {menuVisibility ? menu() : } )} diff --git a/apps/meteor/client/sidebar/Item/Medium.stories.tsx b/apps/meteor/client/sidebar/Item/Medium.stories.tsx index 823244047c51..0c03cf33c500 100644 --- a/apps/meteor/client/sidebar/Item/Medium.stories.tsx +++ b/apps/meteor/client/sidebar/Item/Medium.stories.tsx @@ -1,10 +1,10 @@ import { Box, IconButton } from '@rocket.chat/fuselage'; +import { UserAvatar } from '@rocket.chat/ui-avatar'; import { action } from '@storybook/addon-actions'; import type { ComponentMeta, ComponentStory } from '@storybook/react'; import React from 'react'; import * as Status from '../../components/UserStatus'; -import UserAvatar from '../../components/avatar/UserAvatar'; import Medium from './Medium'; export default { diff --git a/apps/meteor/client/sidebar/Item/Medium.tsx b/apps/meteor/client/sidebar/Item/Medium.tsx index 2c97b890988f..6feed3071ffc 100644 --- a/apps/meteor/client/sidebar/Item/Medium.tsx +++ b/apps/meteor/client/sidebar/Item/Medium.tsx @@ -42,7 +42,7 @@ const Medium: VFC = ({ icon, title = '', avatar, actions, href, bad {badges && {badges}} {menu && ( - {menuVisibility ? menu() : } + {menuVisibility ? menu() : } )} diff --git a/apps/meteor/client/sidebar/RoomList/RoomList.tsx b/apps/meteor/client/sidebar/RoomList/RoomList.tsx index 42c096c8a175..8dc44dcb73ad 100644 --- a/apps/meteor/client/sidebar/RoomList/RoomList.tsx +++ b/apps/meteor/client/sidebar/RoomList/RoomList.tsx @@ -7,6 +7,7 @@ import type { ReactElement } from 'react'; import React, { useMemo } from 'react'; import { Virtuoso } from 'react-virtuoso'; +import { VirtuosoScrollbars } from '../../components/CustomScrollbars'; import { useOpenedRoom } from '../../lib/RoomManager'; import { useAvatarTemplate } from '../hooks/useAvatarTemplate'; import { usePreventDefault } from '../hooks/usePreventDefault'; @@ -14,7 +15,6 @@ import { useRoomList } from '../hooks/useRoomList'; import { useShortcutOpenMenu } from '../hooks/useShortcutOpenMenu'; import { useTemplateByViewMode } from '../hooks/useTemplateByViewMode'; import RoomListRow from './RoomListRow'; -import ScrollerWithCustomProps from './ScrollerWithCustomProps'; const computeItemKey = (index: number, room: IRoom): IRoom['_id'] | number => room._id || index; @@ -121,7 +121,7 @@ const RoomList = (): ReactElement => { } /> diff --git a/apps/meteor/client/sidebar/RoomList/ScrollerWithCustomProps.tsx b/apps/meteor/client/sidebar/RoomList/ScrollerWithCustomProps.tsx deleted file mode 100644 index 20fc675378e4..000000000000 --- a/apps/meteor/client/sidebar/RoomList/ScrollerWithCustomProps.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import type { ComponentProps, ReactElement, Ref } from 'react'; -import React, { forwardRef } from 'react'; - -import ScrollableContentWrapper from '../../components/ScrollableContentWrapper'; - -type ScrollerWithCustomPropsProps = ComponentProps; - -export default forwardRef(function ScrollerWithCustomProps( - { style, ...props }: ScrollerWithCustomPropsProps, - ref: Ref, -): ReactElement { - return ( -

} - renderTrackHorizontal={(props): ReactElement =>
} - /> - ); -}); diff --git a/apps/meteor/client/sidebar/RoomList/SideBarItemTemplateWithData.tsx b/apps/meteor/client/sidebar/RoomList/SideBarItemTemplateWithData.tsx index f275ff2800d8..4c51b8a3615b 100644 --- a/apps/meteor/client/sidebar/RoomList/SideBarItemTemplateWithData.tsx +++ b/apps/meteor/client/sidebar/RoomList/SideBarItemTemplateWithData.tsx @@ -7,10 +7,10 @@ import type { AllHTMLAttributes, ComponentType, ReactElement, ReactNode } from ' import React, { memo, useMemo } from 'react'; import { useOmnichannelPriorities } from '../../../ee/client/omnichannel/hooks/useOmnichannelPriorities'; -import { PriorityIcon } from '../../../ee/client/omnichannel/priorities/PriorityIcon'; import { RoomIcon } from '../../components/RoomIcon'; import { roomCoordinator } from '../../lib/rooms/roomCoordinator'; import RoomMenu from '../RoomMenu'; +import { OmnichannelBadges } from '../badges/OmnichannelBadges'; import type { useAvatarTemplate } from '../hooks/useAvatarTemplate'; import { normalizeSidebarMessage } from './normalizeSidebarMessage'; @@ -170,7 +170,7 @@ function SideBarItemTemplateWithData({ {unread + tunread?.length} )} - {isOmnichannelRoom(room) && isPriorityEnabled && } + {isOmnichannelRoom(room) && } ); diff --git a/apps/meteor/client/sidebar/Sidebar.stories.tsx b/apps/meteor/client/sidebar/Sidebar.stories.tsx index f147ed86b4e4..d8c5788bae86 100644 --- a/apps/meteor/client/sidebar/Sidebar.stories.tsx +++ b/apps/meteor/client/sidebar/Sidebar.stories.tsx @@ -1,5 +1,5 @@ import type { ISetting } from '@rocket.chat/core-typings'; -import type { LoginService, SubscriptionWithRoom } from '@rocket.chat/ui-contexts'; +import type { SubscriptionWithRoom } from '@rocket.chat/ui-contexts'; import { UserContext, SettingsContext } from '@rocket.chat/ui-contexts'; import type { Meta, Story } from '@storybook/react'; import type { ObjectId } from 'mongodb'; @@ -98,10 +98,6 @@ const userContextValue: ContextType = { querySubscription: () => [() => () => undefined, () => undefined], queryRoom: () => [() => () => undefined, () => undefined], - queryAllServices: () => [() => (): void => undefined, (): LoginService[] => []], - loginWithService: () => () => Promise.reject('loginWithService not implemented'), - loginWithPassword: async () => Promise.reject('loginWithPassword not implemented'), - loginWithToken: async () => Promise.reject('loginWithToken not implemented'), logout: () => Promise.resolve(), }; diff --git a/apps/meteor/client/sidebar/Sidebar.tsx b/apps/meteor/client/sidebar/Sidebar.tsx index 84c63eac01be..19606854d0ed 100644 --- a/apps/meteor/client/sidebar/Sidebar.tsx +++ b/apps/meteor/client/sidebar/Sidebar.tsx @@ -1,5 +1,5 @@ import { css } from '@rocket.chat/css-in-js'; -import { Box, Palette } from '@rocket.chat/fuselage'; +import { Box } from '@rocket.chat/fuselage'; import { useSessionStorage } from '@rocket.chat/fuselage-hooks'; import { useLayout, useSetting, useUserPreference } from '@rocket.chat/ui-contexts'; import React, { memo } from 'react'; @@ -20,8 +20,7 @@ const Sidebar = () => { const [bannerDismissed, setBannerDismissed] = useSessionStorage('presence_cap_notifier', false); const presenceDisabled = useSetting('Presence_broadcast_disabled'); - const sideBarBackground = css` - background-color: ${Palette.surface['surface-tint']}; + const sidebarLink = css` a { text-decoration: none; } @@ -38,7 +37,7 @@ const Sidebar = () => { 'rcx-sidebar--main', `rcx-sidebar rcx-sidebar--${sidebarViewMode}`, sidebarHideAvatar && 'rcx-sidebar--hide-avatar', - sideBarBackground, + sidebarLink, ].filter(Boolean)} role='navigation' data-qa-opened={sidebar.isCollapsed ? 'false' : 'true'} diff --git a/apps/meteor/client/sidebar/SidebarPortal.tsx b/apps/meteor/client/sidebar/SidebarPortal.tsx index 2b6594d11561..59856df71773 100644 --- a/apps/meteor/client/sidebar/SidebarPortal.tsx +++ b/apps/meteor/client/sidebar/SidebarPortal.tsx @@ -10,7 +10,7 @@ const SidebarPortal: FC = ({ children }) => { return null; } - return createPortal({children}, sidebarRoot); + return <>{createPortal({children}, sidebarRoot)}; }; export default memo(SidebarPortal); diff --git a/apps/meteor/client/sidebar/badges/OmnichannelBadges.tsx b/apps/meteor/client/sidebar/badges/OmnichannelBadges.tsx new file mode 100644 index 000000000000..32fff81d7bb3 --- /dev/null +++ b/apps/meteor/client/sidebar/badges/OmnichannelBadges.tsx @@ -0,0 +1,22 @@ +import type { IRoom, ISubscription } from '@rocket.chat/core-typings'; +import { isOmnichannelRoom } from '@rocket.chat/core-typings'; +import React from 'react'; + +import { RoomActivityIcon } from '../../../ee/client/omnichannel/components/RoomActivityIcon'; +import { useOmnichannelPriorities } from '../../../ee/client/omnichannel/hooks/useOmnichannelPriorities'; +import { PriorityIcon } from '../../../ee/client/omnichannel/priorities/PriorityIcon'; + +export const OmnichannelBadges = ({ room }: { room: ISubscription & IRoom }) => { + const { enabled: isPriorityEnabled } = useOmnichannelPriorities(); + + if (!isOmnichannelRoom(room)) { + return null; + } + + return ( + <> + {isPriorityEnabled ? : null} + + + ); +}; diff --git a/apps/meteor/client/sidebar/footer/voip/VoipFooter.tsx b/apps/meteor/client/sidebar/footer/voip/VoipFooter.tsx index b317982b5708..0b5ef3418e01 100644 --- a/apps/meteor/client/sidebar/footer/voip/VoipFooter.tsx +++ b/apps/meteor/client/sidebar/footer/voip/VoipFooter.tsx @@ -68,7 +68,7 @@ export const VoipFooter = ({ const holdTitle = ((): string => { if (!isEnterprise) { - return t('Hold_EE_only'); + return t('Hold_Premium_only'); } return paused ? t('Resume') : t('Hold'); })(); diff --git a/apps/meteor/client/sidebar/footer/voip/hooks/useOmnichannelContactLabel.ts b/apps/meteor/client/sidebar/footer/voip/hooks/useOmnichannelContactLabel.ts index e905f6cf38e6..6b3d59830d1e 100644 --- a/apps/meteor/client/sidebar/footer/voip/hooks/useOmnichannelContactLabel.ts +++ b/apps/meteor/client/sidebar/footer/voip/hooks/useOmnichannelContactLabel.ts @@ -2,7 +2,7 @@ import type { ICallerInfo } from '@rocket.chat/core-typings'; import { useEndpoint } from '@rocket.chat/ui-contexts'; import { useQuery } from '@tanstack/react-query'; -import { parseOutboundPhoneNumber } from '../../../../../ee/client/lib/voip/parseOutboundPhoneNumber'; +import { parseOutboundPhoneNumber } from '../../../../lib/voip/parseOutboundPhoneNumber'; export const useOmnichannelContactLabel = (caller: ICallerInfo): string => { const getContactBy = useEndpoint('GET', '/v1/omnichannel/contact.search'); diff --git a/apps/meteor/client/sidebar/footer/voip/index.tsx b/apps/meteor/client/sidebar/footer/voip/index.tsx index 70ad626044a4..9ae7d91c7c2b 100644 --- a/apps/meteor/client/sidebar/footer/voip/index.tsx +++ b/apps/meteor/client/sidebar/footer/voip/index.tsx @@ -1,7 +1,7 @@ import type { VoIpCallerInfo } from '@rocket.chat/core-typings'; import { useEndpoint, useTranslation } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; -import React, { useCallback, useMemo, useState } from 'react'; +import React, { useCallback, useState } from 'react'; import { useVoipFooterMenu } from '../../../../ee/client/hooks/useVoipFooterMenu'; import { @@ -62,18 +62,6 @@ export const VoipFooter = (): ReactElement | null => { return subtitles[state] || ''; }; - const getCallsInQueueText = useMemo((): string => { - if (queueCounter === 0) { - return t('Calls_in_queue_empty'); - } - - if (queueCounter === 1) { - return t('Calls_in_queue', { calls: queueCounter }); - } - - return t('Calls_in_queue_plural', { calls: queueCounter }); - }, [queueCounter, t]); - if (!('caller' in callerInfo)) { return ; } @@ -91,7 +79,7 @@ export const VoipFooter = (): ReactElement | null => { togglePause={togglePause} createRoom={createRoom} openRoom={openRoom} - callsInQueue={getCallsInQueueText} + callsInQueue={t('Calls_in_queue', { count: queueCounter })} dispatchEvent={dispatchEvent} openedRoomInfo={openedRoomInfo} isEnterprise={isEnterprise} diff --git a/apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.tsx b/apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.tsx index 3f001b158d72..5738798f194e 100644 --- a/apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.tsx +++ b/apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.tsx @@ -30,10 +30,12 @@ import { useForm, Controller } from 'react-hook-form'; import { useHasLicenseModule } from '../../../../ee/client/hooks/useHasLicenseModule'; import UserAutoCompleteMultipleFederated from '../../../components/UserAutoCompleteMultiple/UserAutoCompleteMultipleFederated'; import { goToRoomById } from '../../../lib/utils/goToRoomById'; +import { useEncryptedRoomDescription } from '../hooks/useEncryptedRoomDescription'; type CreateChannelModalProps = { teamId?: string; onClose: () => void; + reload?: () => void; }; type CreateChannelModalPayload = { @@ -49,7 +51,7 @@ type CreateChannelModalPayload = { const getFederationHintKey = (licenseModule: ReturnType, featureToggle: boolean): TranslationKey => { if (licenseModule === 'loading' || !licenseModule) { - return 'error-this-is-an-ee-feature'; + return 'error-this-is-a-premium-feature'; } if (!featureToggle) { return 'Federation_Matrix_Federated_Description_disabled'; @@ -57,7 +59,7 @@ const getFederationHintKey = (licenseModule: ReturnType { +const CreateChannelModal = ({ teamId = '', onClose, reload }: CreateChannelModalProps): ReactElement => { const t = useTranslation(); const canSetReadOnly = usePermissionWithScopedRoles('set-readonly', ['owner']); const e2eEnabled = useSetting('E2E_Enable'); @@ -68,6 +70,7 @@ const CreateChannelModal = ({ teamId = '', onClose }: CreateChannelModalProps): const canCreateChannel = usePermission('create-c'); const canCreatePrivateChannel = usePermission('create-p'); + const getEncryptedHint = useEncryptedRoomDescription('channel'); const channelNameRegex = useMemo(() => new RegExp(`^${namesValidation}$`), [namesValidation]); const federatedModule = useHasLicenseModule('federation'); @@ -110,7 +113,7 @@ const CreateChannelModal = ({ teamId = '', onClose }: CreateChannelModalProps): }, }); - const { isPrivate, broadcast, readOnly, federated } = watch(); + const { isPrivate, broadcast, readOnly, federated, encrypted } = watch(); useEffect(() => { if (!isPrivate) { @@ -137,7 +140,7 @@ const CreateChannelModal = ({ teamId = '', onClose }: CreateChannelModalProps): } if (!allowSpecialNames && !channelNameRegex.test(name)) { - return t('error-invalid-name'); + return t('Name_cannot_have_special_characters'); } const { exists } = await channelNameExists({ roomName: name }); @@ -171,6 +174,7 @@ const CreateChannelModal = ({ teamId = '', onClose }: CreateChannelModalProps): } dispatchToastMessage({ type: 'success', message: t('Room_has_been_created') }); + reload?.(); } catch (error) { dispatchToastMessage({ type: 'error', message: error }); } finally { @@ -209,7 +213,7 @@ const CreateChannelModal = ({ teamId = '', onClose }: CreateChannelModalProps): - {t('Channel_name')} + {t('Name')} } aria-invalid={errors.name ? 'true' : 'false'} - aria-describedby={`${nameId}-error`} + aria-describedby={`${nameId}-error ${nameId}-hint`} aria-required='true' /> @@ -231,22 +235,28 @@ const CreateChannelModal = ({ teamId = '', onClose }: CreateChannelModalProps): {errors.name.message} )} + {!allowSpecialNames && {t('No_spaces')}} {t('Topic')} - {t('Channel_what_is_this_channel_about')} + {t('Displayed_next_to_name')} - - - {t('Private')} - - {isPrivate ? t('Only_invited_users_can_acess_this_channel') : t('Everyone_can_access_this_channel')} - - + {t('Members')} + ( + + )} + /> + + + + {t('Private')} )} /> - + + + {isPrivate ? t('People_can_only_join_by_being_invited') : t('Anyone_can_access')} + - - - {t('Federation_Matrix_Federated')} - {t(getFederationHintKey(federatedModule, federationEnabled))} - + + {t('Federation_Matrix_Federated')} )} /> - + + {t(getFederationHintKey(federatedModule, federationEnabled))} - - - {t('Read_only')} - - {readOnly ? t('Only_authorized_users_can_write_new_messages') : t('All_users_in_the_channel_can_write_new_messages')} - - + + {t('Encrypted')} ( )} /> - + + {getEncryptedHint({ isPrivate, broadcast, encrypted })} - - - {t('Encrypted')} - - {isPrivate ? t('Encrypted_channel_Description') : t('Encrypted_not_available')} - - + + {t('Read_only')} ( )} /> - + + + {readOnly ? t('Read_only_field_hint_enabled', { roomType: 'channel' }) : t('Anyone_can_send_new_messages')} + - - - {t('Broadcast')} - {t('Broadcast_channel_Description')} - + + {t('Broadcast')} )} /> - - - - {t('Add_members')} - ( - - )} - /> + + {broadcast && {t('Broadcast_hint_enabled', { roomType: 'channel' })}} diff --git a/apps/meteor/client/sidebar/header/CreateDirectMessage.tsx b/apps/meteor/client/sidebar/header/CreateDirectMessage.tsx index dd1ce944f423..7c34f7ac01a3 100644 --- a/apps/meteor/client/sidebar/header/CreateDirectMessage.tsx +++ b/apps/meteor/client/sidebar/header/CreateDirectMessage.tsx @@ -1,7 +1,7 @@ import type { IUser } from '@rocket.chat/core-typings'; -import { Box, Modal, Button, FieldGroup, Field, FieldRow, FieldLabel, FieldError } from '@rocket.chat/fuselage'; +import { Box, Modal, Button, FieldGroup, Field, FieldRow, FieldError, FieldHint } from '@rocket.chat/fuselage'; import { useUniqueId } from '@rocket.chat/fuselage-hooks'; -import { useTranslation, useEndpoint, useToastMessageDispatch } from '@rocket.chat/ui-contexts'; +import { useTranslation, useEndpoint, useToastMessageDispatch, useSetting } from '@rocket.chat/ui-contexts'; import { useMutation } from '@tanstack/react-query'; import React, { memo } from 'react'; import { useForm, Controller } from 'react-hook-form'; @@ -11,6 +11,7 @@ import { goToRoomById } from '../../lib/utils/goToRoomById'; const CreateDirectMessage = ({ onClose }: { onClose: () => void }) => { const t = useTranslation(); + const directMaxUsers = useSetting('DirectMesssage_maxUsers') || 1; const membersFieldId = useUniqueId(); const dispatchToastMessage = useToastMessageDispatch(); @@ -19,7 +20,7 @@ const CreateDirectMessage = ({ onClose }: { onClose: () => void }) => { const { control, handleSubmit, - formState: { isDirty, isSubmitting, isValidating, errors }, + formState: { isSubmitting, isValidating, errors }, } = useForm({ mode: 'onBlur', defaultValues: { users: [] } }); const mutateDirectMessage = useMutation({ @@ -46,16 +47,19 @@ const CreateDirectMessage = ({ onClose }: { onClose: () => void }) => { - {t('Direct_message_creation_description')} - - {t('Members')} - + {t('Direct_message_creation_description')} + users.length + 1 > directMaxUsers + ? t('error-direct-message-max-user-exceeded', { maxUsers: directMaxUsers }) + : undefined, + }} control={control} render={({ field: { name, onChange, value, onBlur } }) => ( void }) => { value={value} onBlur={onBlur} id={membersFieldId} - aria-describedby={`${membersFieldId}-error`} + aria-describedby={`${membersFieldId}-hint ${membersFieldId}-error`} aria-required='true' aria-invalid={Boolean(errors.users)} /> @@ -76,13 +80,14 @@ const CreateDirectMessage = ({ onClose }: { onClose: () => void }) => { {errors.users.message} )} + {t('Direct_message_creation_description_hint')} - diff --git a/apps/meteor/client/sidebar/header/CreateTeam/CreateTeamModal.tsx b/apps/meteor/client/sidebar/header/CreateTeam/CreateTeamModal.tsx index e14ef6e77b37..b56bb003aa9e 100644 --- a/apps/meteor/client/sidebar/header/CreateTeam/CreateTeamModal.tsx +++ b/apps/meteor/client/sidebar/header/CreateTeam/CreateTeamModal.tsx @@ -11,6 +11,7 @@ import { FieldRow, FieldError, FieldDescription, + FieldHint, } from '@rocket.chat/fuselage'; import { useUniqueId } from '@rocket.chat/fuselage-hooks'; import { @@ -27,6 +28,7 @@ import { Controller, useForm } from 'react-hook-form'; import UserAutoCompleteMultiple from '../../../components/UserAutoCompleteMultiple'; import { goToRoomById } from '../../../lib/utils/goToRoomById'; +import { useEncryptedRoomDescription } from '../hooks/useEncryptedRoomDescription'; type CreateTeamModalInputs = { name: string; @@ -65,7 +67,7 @@ const CreateTeamModal = ({ onClose }: { onClose: () => void }): ReactElement => } if (teamNameRegex && !teamNameRegex?.test(name)) { - return t('Teams_Errors_team_name', { name }); + return t('Name_cannot_have_special_characters'); } const { exists } = await checkTeamNameExists({ roomName: name }); @@ -80,7 +82,7 @@ const CreateTeamModal = ({ onClose }: { onClose: () => void }): ReactElement => handleSubmit, setValue, watch, - formState: { isDirty, errors }, + formState: { errors, isSubmitting }, } = useForm({ defaultValues: { isPrivate: true, @@ -91,7 +93,7 @@ const CreateTeamModal = ({ onClose }: { onClose: () => void }): ReactElement => }, }); - const { isPrivate, broadcast, readOnly } = watch(); + const { isPrivate, broadcast, readOnly, encrypted } = watch(); useEffect(() => { if (!isPrivate) { @@ -107,7 +109,7 @@ const CreateTeamModal = ({ onClose }: { onClose: () => void }): ReactElement => const canChangeReadOnly = !broadcast; const canChangeEncrypted = isPrivate && !broadcast && e2eEnabled && !e2eEnabledForPrivateByDefault; - const isButtonEnabled = isDirty && canCreateTeam; + const getEncryptedHint = useEncryptedRoomDescription('team'); const handleCreateTeam = async ({ name, @@ -164,6 +166,9 @@ const CreateTeamModal = ({ onClose }: { onClose: () => void }): ReactElement => + + {t('Teams_new_description')} + @@ -177,10 +182,9 @@ const CreateTeamModal = ({ onClose }: { onClose: () => void }): ReactElement => required: t('error-the-field-is-required', { field: t('Name') }), validate: (value) => validateTeamName(value), })} - placeholder={t('Team_Name')} addon={} error={errors.name?.message} - aria-describedby={`${nameId}-error`} + aria-describedby={`${nameId}-error ${nameId}-hint`} aria-required='true' /> @@ -189,31 +193,30 @@ const CreateTeamModal = ({ onClose }: { onClose: () => void }): ReactElement => {errors.name.message} )} + {!allowSpecialNames && {t('No_spaces')}} - - {t('Teams_New_Description_Label')}{' '} - - ({t('optional')}) - - + {t('Topic')} - + + + + {t('Displayed_next_to_name')} - - - {t('Teams_New_Private_Label')} - - {isPrivate ? t('Teams_New_Private_Description_Enabled') : t('Teams_New_Private_Description_Disabled')} - - + {t('Teams_New_Add_members_Label')} + ( + + )} + /> + + + + {t('Teams_New_Private_Label')} void }): ReactElement => )} /> - + + + {isPrivate ? t('People_can_only_join_by_being_invited') : t('Anyone_can_access')} + - - - {t('Teams_New_Read_only_Label')} - - {readOnly ? t('Only_authorized_users_can_write_new_messages') : t('Teams_New_Read_only_Description')} - - + + {t('Teams_New_Read_only_Label')} void }): ReactElement => /> )} /> - + + + {readOnly ? t('Read_only_field_hint_enabled', { roomType: 'team' }) : t('Anyone_can_send_new_messages')} + - - - {t('Teams_New_Encrypted_Label')} - - {isPrivate ? t('Teams_New_Encrypted_Description_Enabled') : t('Teams_New_Encrypted_Description_Disabled')} - - + + {t('Teams_New_Encrypted_Label')} void }): ReactElement => /> )} /> - + + {getEncryptedHint({ isPrivate, broadcast, encrypted })} - - - {t('Teams_New_Broadcast_Label')} - {t('Teams_New_Broadcast_Description')} - + + {t('Teams_New_Broadcast_Label')} void }): ReactElement => )} /> - - - - - {t('Teams_New_Add_members_Label')}{' '} - - ({t('optional')}) - - - } - /> + + {broadcast && {t('Teams_New_Broadcast_Description')}} - diff --git a/apps/meteor/client/sidebar/header/EditStatusModal.tsx b/apps/meteor/client/sidebar/header/EditStatusModal.tsx index 18ee86a19c27..ba250d92707b 100644 --- a/apps/meteor/client/sidebar/header/EditStatusModal.tsx +++ b/apps/meteor/client/sidebar/header/EditStatusModal.tsx @@ -1,6 +1,6 @@ import type { IUser } from '@rocket.chat/core-typings'; import { Field, TextInput, FieldGroup, Modal, Button, Box, FieldLabel, FieldRow, FieldError, FieldHint } from '@rocket.chat/fuselage'; -import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; +import { useLocalStorage, useMutableCallback } from '@rocket.chat/fuselage-hooks'; import { useToastMessageDispatch, useSetting, useTranslation, useEndpoint } from '@rocket.chat/ui-contexts'; import type { ReactElement, ChangeEvent, ComponentProps, FormEvent } from 'react'; import React, { useState, useCallback } from 'react'; @@ -17,9 +17,11 @@ type EditStatusModalProps = { const EditStatusModal = ({ onClose, userStatus, userStatusText }: EditStatusModalProps): ReactElement => { const allowUserStatusMessageChange = useSetting('Accounts_AllowUserStatusMessageChange'); const dispatchToastMessage = useToastMessageDispatch(); + const [customStatus, setCustomStatus] = useLocalStorage('Local_Custom_Status', ''); + const initialStatusText = customStatus || userStatusText; const t = useTranslation(); - const [statusText, setStatusText] = useState(userStatusText); + const [statusText, setStatusText] = useState(initialStatusText); const [statusType, setStatusType] = useState(userStatus); const [statusTextError, setStatusTextError] = useState(); @@ -40,6 +42,7 @@ const EditStatusModal = ({ onClose, userStatus, userStatusText }: EditStatusModa const handleSaveStatus = useCallback(async () => { try { await setUserStatus({ message: statusText, status: statusType }); + setCustomStatus(statusText); dispatchToastMessage({ type: 'success', message: t('StatusMessage_Changed_Successfully') }); } catch (error) { dispatchToastMessage({ type: 'error', message: error }); diff --git a/apps/meteor/client/sidebar/header/Header.tsx b/apps/meteor/client/sidebar/header/Header.tsx index 8b1c838f8d62..b7f00af460ae 100644 --- a/apps/meteor/client/sidebar/header/Header.tsx +++ b/apps/meteor/client/sidebar/header/Header.tsx @@ -1,8 +1,9 @@ import { Sidebar } from '@rocket.chat/fuselage'; -import { useUser, useTranslation } from '@rocket.chat/ui-contexts'; +import { useTranslation, useUser } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; import React, { memo } from 'react'; +import SidebarHeaderToolbar from './SidebarHeaderToolbar'; import UserAvatarWithStatus from './UserAvatarWithStatus'; import UserMenu from './UserMenu'; import Administration from './actions/Administration'; @@ -26,7 +27,7 @@ const Header = (): ReactElement => { return ( {user ? : } - + {user && ( @@ -38,7 +39,7 @@ const Header = (): ReactElement => { )} {!user && } - + ); }; diff --git a/apps/meteor/client/sidebar/header/HeaderUnstable.tsx b/apps/meteor/client/sidebar/header/HeaderUnstable.tsx index 319d3fb25e16..ac6929bf2fb3 100644 --- a/apps/meteor/client/sidebar/header/HeaderUnstable.tsx +++ b/apps/meteor/client/sidebar/header/HeaderUnstable.tsx @@ -3,6 +3,7 @@ import { useUserId, useTranslation } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; import React, { memo } from 'react'; +import SidebarHeaderToolbar from './SidebarHeaderToolbar'; import CreateRoom from './actions/CreateRoom'; import Directory from './actions/Directory'; import Login from './actions/Login'; @@ -15,7 +16,7 @@ const HeaderUnstable = (): ReactElement => { return ( - + {uid && ( <> @@ -25,7 +26,7 @@ const HeaderUnstable = (): ReactElement => { )} {!uid && } - + ); }; diff --git a/apps/meteor/client/sidebar/header/MatrixFederationSearch/FederatedRoomList.tsx b/apps/meteor/client/sidebar/header/MatrixFederationSearch/FederatedRoomList.tsx index 7584733a7022..61984030429d 100644 --- a/apps/meteor/client/sidebar/header/MatrixFederationSearch/FederatedRoomList.tsx +++ b/apps/meteor/client/sidebar/header/MatrixFederationSearch/FederatedRoomList.tsx @@ -6,7 +6,7 @@ import type { VFC } from 'react'; import React from 'react'; import { Virtuoso } from 'react-virtuoso'; -import ScrollableContentWrapper from '../../../components/ScrollableContentWrapper'; +import { VirtuosoScrollbars } from '../../../components/CustomScrollbars'; import { roomCoordinator } from '../../../lib/rooms/roomCoordinator'; import FederatedRoomListEmptyPlaceholder from './FederatedRoomListEmptyPlaceholder'; import FederatedRoomListItem from './FederatedRoomListItem'; @@ -68,7 +68,7 @@ const FederatedRoomList: VFC = ({ serverName, roomName, components={{ // eslint-disable-next-line react/no-multi-comp Footer: () => (isFetchingNextPage ? : null), - Scroller: ScrollableContentWrapper, + Scroller: VirtuosoScrollbars, EmptyPlaceholder: FederatedRoomListEmptyPlaceholder, }} endReached={isLoading || isFetchingNextPage ? () => undefined : () => fetchNextPage()} diff --git a/apps/meteor/client/sidebar/header/MatrixFederationSearch/MatrixFederationManageServerModal.tsx b/apps/meteor/client/sidebar/header/MatrixFederationSearch/MatrixFederationManageServerModal.tsx index 6ea69ce6c037..51021a91549a 100644 --- a/apps/meteor/client/sidebar/header/MatrixFederationSearch/MatrixFederationManageServerModal.tsx +++ b/apps/meteor/client/sidebar/header/MatrixFederationSearch/MatrixFederationManageServerModal.tsx @@ -1,16 +1,4 @@ -import { - Divider, - Modal, - ButtonGroup, - Button, - Field, - TextInput, - Throbber, - FieldLabel, - FieldRow, - FieldError, - FieldHint, -} from '@rocket.chat/fuselage'; +import { Divider, Modal, ButtonGroup, Button, Field, TextInput, FieldLabel, FieldRow, FieldError, FieldHint } from '@rocket.chat/fuselage'; import type { TranslationKey } from '@rocket.chat/ui-contexts'; import { useSetModal, useTranslation, useEndpoint, useToastMessageDispatch } from '@rocket.chat/ui-contexts'; import { useMutation, useQueryClient } from '@tanstack/react-query'; @@ -88,9 +76,8 @@ const MatrixFederationAddServerModal: VFC = }} mie={4} /> - {isError && errorKey && {t(errorKey)}} diff --git a/apps/meteor/client/sidebar/header/SidebarHeaderToolbar.tsx b/apps/meteor/client/sidebar/header/SidebarHeaderToolbar.tsx new file mode 100644 index 000000000000..d897c352072d --- /dev/null +++ b/apps/meteor/client/sidebar/header/SidebarHeaderToolbar.tsx @@ -0,0 +1,13 @@ +import { useToolbar } from '@react-aria/toolbar'; +import { TopBarActions } from '@rocket.chat/fuselage'; +import type { ComponentProps } from 'react'; +import React, { useRef } from 'react'; + +const SidebarHeaderToolbar = (props: ComponentProps) => { + const ref = useRef(null); + const { toolbarProps } = useToolbar(props, ref); + + return ; +}; + +export default SidebarHeaderToolbar; diff --git a/apps/meteor/client/sidebar/header/UserAvatarWithStatus.tsx b/apps/meteor/client/sidebar/header/UserAvatarWithStatus.tsx index f962125f681c..6fa08f5e0253 100644 --- a/apps/meteor/client/sidebar/header/UserAvatarWithStatus.tsx +++ b/apps/meteor/client/sidebar/header/UserAvatarWithStatus.tsx @@ -1,10 +1,10 @@ import { css } from '@rocket.chat/css-in-js'; import { Box } from '@rocket.chat/fuselage'; +import { UserAvatar } from '@rocket.chat/ui-avatar'; import { useSetting, useUser, useTranslation } from '@rocket.chat/ui-contexts'; import React from 'react'; import { UserStatus } from '../../components/UserStatus'; -import UserAvatar from '../../components/avatar/UserAvatar'; const anon = { _id: '', diff --git a/apps/meteor/client/sidebar/header/UserMenuHeader.tsx b/apps/meteor/client/sidebar/header/UserMenuHeader.tsx index 515d4153576d..511b2c2a1e45 100644 --- a/apps/meteor/client/sidebar/header/UserMenuHeader.tsx +++ b/apps/meteor/client/sidebar/header/UserMenuHeader.tsx @@ -1,11 +1,11 @@ import type { IUser } from '@rocket.chat/core-typings'; import { Box, Margins } from '@rocket.chat/fuselage'; +import { UserAvatar } from '@rocket.chat/ui-avatar'; import { useSetting, useTranslation } from '@rocket.chat/ui-contexts'; import React from 'react'; import MarkdownText from '../../components/MarkdownText'; import { UserStatus } from '../../components/UserStatus'; -import UserAvatar from '../../components/avatar/UserAvatar'; import { useUserDisplayName } from '../../hooks/useUserDisplayName'; const UserMenuHeader = ({ user }: { user: IUser }) => { diff --git a/apps/meteor/client/sidebar/header/actions/hooks/useAdministrationItems.spec.tsx b/apps/meteor/client/sidebar/header/actions/hooks/useAdministrationItems.spec.tsx index b0b20972d346..d2a94e3ab501 100644 --- a/apps/meteor/client/sidebar/header/actions/hooks/useAdministrationItems.spec.tsx +++ b/apps/meteor/client/sidebar/header/actions/hooks/useAdministrationItems.spec.tsx @@ -3,71 +3,12 @@ import { renderHook } from '@testing-library/react-hooks'; import { useAdministrationItems } from './useAdministrationItems'; -it('should not show upgrade item if has license and not have trial', async () => { - const { result, waitFor } = renderHook(() => useAdministrationItems(), { - wrapper: mockAppRoot() - .withEndpoint('GET', '/v1/licenses.get', () => ({ - licenses: [ - { - modules: ['testModule'], - meta: { trial: false }, - } as any, - ], - })) - .withEndpoint('GET', '/v1/cloud.registrationStatus', () => ({ - registrationStatus: { - workspaceRegistered: false, - } as any, - })) - .withPermission('view-privileged-setting') - .withPermission('manage-cloud') - .build(), - }); - - await waitFor(() => !!(result.all.length > 1)); - - expect(result.current.length).toEqual(1); -}); - -it('should return an upgrade item if not have license or if have a trial', async () => { - const { result, waitFor } = renderHook(() => useAdministrationItems(), { - wrapper: mockAppRoot() - .withEndpoint('GET', '/v1/licenses.get', () => ({ - licenses: [ - { - modules: [], - } as any, - ], - })) - .withEndpoint('GET', '/v1/cloud.registrationStatus', () => ({ - registrationStatus: { - workspaceRegistered: false, - } as any, - })) - .withPermission('view-privileged-setting') - .withPermission('manage-cloud') - .build(), - }); - - // Workspace admin is also expected to be here - await waitFor(() => result.current.length > 1); - - expect(result.current[0]).toEqual( - expect.objectContaining({ - id: 'showUpgradeItem', - }), - ); -}); - it('should return omnichannel item if has `view-livechat-manager` permission ', async () => { const { result, waitFor } = renderHook(() => useAdministrationItems(), { wrapper: mockAppRoot() - .withEndpoint('GET', '/v1/licenses.get', () => ({ - licenses: [ - { - modules: [], - } as any, - ], + .withEndpoint('GET', '/v1/licenses.info', () => ({ + // @ts-expect-error this is a mock + license: {}, })) .withEndpoint('GET', '/v1/cloud.registrationStatus', () => ({ registrationStatus: { @@ -90,12 +31,9 @@ it('should return omnichannel item if has `view-livechat-manager` permission ', it('should show administration item if has at least one admin permission', async () => { const { result, waitFor } = renderHook(() => useAdministrationItems(), { wrapper: mockAppRoot() - .withEndpoint('GET', '/v1/licenses.get', () => ({ - licenses: [ - { - modules: [], - } as any, - ], + .withEndpoint('GET', '/v1/licenses.info', () => ({ + // @ts-expect-error this is a mock + license: {}, })) .withEndpoint('GET', '/v1/cloud.registrationStatus', () => ({ registrationStatus: { diff --git a/apps/meteor/client/sidebar/header/actions/hooks/useAdministrationItems.tsx b/apps/meteor/client/sidebar/header/actions/hooks/useAdministrationItems.tsx index 531545b20a43..5e802c2d1851 100644 --- a/apps/meteor/client/sidebar/header/actions/hooks/useAdministrationItems.tsx +++ b/apps/meteor/client/sidebar/header/actions/hooks/useAdministrationItems.tsx @@ -1,21 +1,6 @@ -import { - useTranslation, - useRoute, - useSetModal, - useRole, - useRouter, - useAtLeastOnePermission, - usePermission, -} from '@rocket.chat/ui-contexts'; -import React from 'react'; +import { useTranslation, useRoute, useRouter, useAtLeastOnePermission, usePermission } from '@rocket.chat/ui-contexts'; -import type { UpgradeTabVariant } from '../../../../../lib/upgradeTab'; -import { getUpgradeTabLabel, isFullyFeature } from '../../../../../lib/upgradeTab'; -import Emoji from '../../../../components/Emoji'; import type { GenericMenuItemProps } from '../../../../components/GenericMenu/GenericMenuItem'; -import { useRegistrationStatus } from '../../../../hooks/useRegistrationStatus'; -import RegisterWorkspaceModal from '../../../../views/admin/cloud/modals/RegisterWorkspaceModal'; -import { useUpgradeTabParams } from '../../../../views/hooks/useUpgradeTabParams'; const ADMIN_PERMISSIONS = [ 'view-statistics', @@ -57,30 +42,10 @@ export const useAdministrationItems = (): GenericMenuItemProps[] => { const shouldShowAdminMenu = useAtLeastOnePermission(ADMIN_PERMISSIONS); - const { tabType, trialEndDate, isLoading } = useUpgradeTabParams(); - const shouldShowEmoji = isFullyFeature(tabType); - - const label = getUpgradeTabLabel(tabType); - - const isAdmin = useRole('admin'); - const setModal = useSetModal(); - - const { data: registrationStatusData } = useRegistrationStatus(); - const workspaceRegistered = registrationStatusData?.registrationStatus?.workspaceRegistered ?? false; - - const handleRegisterWorkspaceClick = (): void => { - const handleModalClose = (): void => setModal(null); - setModal(); - }; - const adminRoute = useRoute('admin-index'); - const upgradeRoute = useRoute('upgrade'); - const cloudRoute = useRoute('cloud'); const omnichannel = usePermission('view-livechat-manager'); - const showUpgradeItem = !isLoading && tabType; - const omnichannelItem: GenericMenuItemProps = { id: 'omnichannel', content: t('Omnichannel'), @@ -88,30 +53,6 @@ export const useAdministrationItems = (): GenericMenuItemProps[] => { onClick: () => router.navigate('/omnichannel/current'), }; - const upgradeItem: GenericMenuItemProps = { - id: 'showUpgradeItem', - content: ( - <> - {t(label)} {shouldShowEmoji && } - - ), - icon: 'arrow-stack-up', - onClick: () => { - upgradeRoute.push({ type: tabType as UpgradeTabVariant }, trialEndDate ? { trialEndDate } : undefined); - }, - }; - const adminItem: GenericMenuItemProps = { - id: 'registration', - content: workspaceRegistered ? t('Registration') : t('Register'), - icon: 'cloud-plus', - onClick: () => { - if (workspaceRegistered) { - cloudRoute.push({ context: '/' }); - return; - } - handleRegisterWorkspaceClick(); - }, - }; const workspaceItem: GenericMenuItemProps = { id: 'workspace', content: t('Workspace'), @@ -121,10 +62,5 @@ export const useAdministrationItems = (): GenericMenuItemProps[] => { }, }; - return [ - showUpgradeItem && upgradeItem, - shouldShowAdminMenu && workspaceItem, - isAdmin && adminItem, - omnichannel && omnichannelItem, - ].filter(Boolean) as GenericMenuItemProps[]; + return [shouldShowAdminMenu && workspaceItem, omnichannel && omnichannelItem].filter(Boolean) as GenericMenuItemProps[]; }; diff --git a/apps/meteor/client/sidebar/header/actions/hooks/useAuditItems.spec.tsx b/apps/meteor/client/sidebar/header/actions/hooks/useAuditItems.spec.tsx index a5a280262bd4..95d2d219bc14 100644 --- a/apps/meteor/client/sidebar/header/actions/hooks/useAuditItems.spec.tsx +++ b/apps/meteor/client/sidebar/header/actions/hooks/useAuditItems.spec.tsx @@ -6,7 +6,12 @@ import { useAuditItems } from './useAuditItems'; it('should return an empty array if doesn`t have license', async () => { const { result, waitFor } = renderHook(() => useAuditItems(), { wrapper: mockAppRoot() - .withMethod('license:getModules', () => []) + .withEndpoint('GET', '/v1/licenses.info', () => ({ + // @ts-expect-error: just for testing + license: { + activeModules: [], + }, + })) .withJohnDoe() .withPermission('can-audit') .withPermission('can-audit-log') @@ -21,6 +26,16 @@ it('should return an empty array if doesn`t have license', async () => { it('should return an empty array if have license and not have permissions', async () => { const { result, waitFor } = renderHook(() => useAuditItems(), { wrapper: mockAppRoot() + .withEndpoint('GET', '/v1/licenses.info', () => ({ + license: { + license: { + // @ts-expect-error: just for testing + grantedModules: [{ module: 'auditing' }], + }, + // @ts-expect-error: just for testing + activeModules: ['auditing'], + }, + })) .withMethod('license:getModules', () => ['auditing']) .withJohnDoe() .build(), @@ -34,7 +49,16 @@ it('should return an empty array if have license and not have permissions', asyn it('should return auditItems if have license and permissions', async () => { const { result, waitFor } = renderHook(() => useAuditItems(), { wrapper: mockAppRoot() - .withMethod('license:getModules', () => ['auditing']) + .withEndpoint('GET', '/v1/licenses.info', () => ({ + license: { + license: { + // @ts-expect-error: just for testing + grantedModules: [{ module: 'auditing' }], + }, + // @ts-expect-error: just for testing + activeModules: ['auditing'], + }, + })) .withJohnDoe() .withPermission('can-audit') .withPermission('can-audit-log') @@ -59,7 +83,16 @@ it('should return auditItems if have license and permissions', async () => { it('should return auditMessages item if have license and can-audit permission', async () => { const { result, waitFor } = renderHook(() => useAuditItems(), { wrapper: mockAppRoot() - .withMethod('license:getModules', () => ['auditing']) + .withEndpoint('GET', '/v1/licenses.info', () => ({ + license: { + license: { + // @ts-expect-error: just for testing + grantedModules: [{ module: 'auditing' }], + }, + // @ts-expect-error: just for testing + activeModules: ['auditing'], + }, + })) .withJohnDoe() .withPermission('can-audit') .build(), @@ -77,7 +110,16 @@ it('should return auditMessages item if have license and can-audit permission', it('should return audiLogs item if have license and can-audit-log permission', async () => { const { result, waitFor } = renderHook(() => useAuditItems(), { wrapper: mockAppRoot() - .withMethod('license:getModules', () => ['auditing']) + .withEndpoint('GET', '/v1/licenses.info', () => ({ + license: { + license: { + // @ts-expect-error: just for testing + grantedModules: [{ module: 'auditing' }], + }, + // @ts-expect-error: just for testing + activeModules: ['auditing'], + }, + })) .withJohnDoe() .withPermission('can-audit-log') .build(), diff --git a/apps/meteor/client/sidebar/header/actions/hooks/useCreateRoomItems.tsx b/apps/meteor/client/sidebar/header/actions/hooks/useCreateRoomItems.tsx index c6847fbe7d1c..7b2770a60ab5 100644 --- a/apps/meteor/client/sidebar/header/actions/hooks/useCreateRoomItems.tsx +++ b/apps/meteor/client/sidebar/header/actions/hooks/useCreateRoomItems.tsx @@ -44,7 +44,7 @@ export const useCreateRoomItems = (): GenericMenuItemProps[] => { }; const createDirectMessageItem: GenericMenuItemProps = { id: 'direct', - content: t('Direct_Messages'), + content: t('Direct_message'), icon: 'balloon', onClick: () => { createDirectMessage(); @@ -60,9 +60,9 @@ export const useCreateRoomItems = (): GenericMenuItemProps[] => { }; return [ - ...(canCreateChannel ? [createChannelItem] : []), - ...(canCreateTeam ? [createTeamItem] : []), ...(canCreateDirectMessages ? [createDirectMessageItem] : []), ...(canCreateDiscussion && discussionEnabled ? [createDiscussionItem] : []), + ...(canCreateChannel ? [createChannelItem] : []), + ...(canCreateTeam ? [createTeamItem] : []), ]; }; diff --git a/apps/meteor/client/sidebar/header/hooks/useEncryptedRoomDescription.tsx b/apps/meteor/client/sidebar/header/hooks/useEncryptedRoomDescription.tsx new file mode 100644 index 000000000000..09796dd7a6b7 --- /dev/null +++ b/apps/meteor/client/sidebar/header/hooks/useEncryptedRoomDescription.tsx @@ -0,0 +1,23 @@ +import { useSetting, useTranslation } from '@rocket.chat/ui-contexts'; + +export const useEncryptedRoomDescription = (roomType: 'channel' | 'team') => { + const t = useTranslation(); + const e2eEnabled = useSetting('E2E_Enable'); + const e2eEnabledForPrivateByDefault = useSetting('E2E_Enabled_Default_PrivateRooms'); + + return ({ isPrivate, broadcast, encrypted }: { isPrivate: boolean; broadcast: boolean; encrypted: boolean }) => { + if (!e2eEnabled) { + return t('Not_available_for_this_workspace'); + } + if (!isPrivate) { + return t('Encrypted_not_available', { roomType }); + } + if (broadcast) { + return t('Not_available_for_broadcast', { roomType }); + } + if (e2eEnabledForPrivateByDefault || encrypted) { + return t('Encrypted_messages', { roomType }); + } + return t('Encrypted_messages_false'); + }; +}; diff --git a/apps/meteor/client/sidebar/header/hooks/useStatusItems.tsx b/apps/meteor/client/sidebar/header/hooks/useStatusItems.tsx index 217c5c53f573..026f7c80400e 100644 --- a/apps/meteor/client/sidebar/header/hooks/useStatusItems.tsx +++ b/apps/meteor/client/sidebar/header/hooks/useStatusItems.tsx @@ -1,77 +1,87 @@ -import type { IUser, ValueOf } from '@rocket.chat/core-typings'; -import { UserStatus as UserStatusEnum } from '@rocket.chat/core-typings'; import { Box } from '@rocket.chat/fuselage'; -import type { TranslationKey } from '@rocket.chat/ui-contexts'; -import { useEndpoint, useSetting, useTranslation } from '@rocket.chat/ui-contexts'; -import React from 'react'; +import { useEndpoint, useSetting } from '@rocket.chat/ui-contexts'; +import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; +import React, { useEffect } from 'react'; +import { useTranslation } from 'react-i18next'; -import { userStatus } from '../../../../app/user-status/client'; import { callbacks } from '../../../../lib/callbacks'; import type { GenericMenuItemProps } from '../../../components/GenericMenu/GenericMenuItem'; import MarkdownText from '../../../components/MarkdownText'; import { UserStatus } from '../../../components/UserStatus'; +import { userStatuses } from '../../../lib/userStatuses'; +import type { UserStatusDescriptor } from '../../../lib/userStatuses'; import { useStatusDisabledModal } from '../../../views/admin/customUserStatus/hooks/useStatusDisabledModal'; import { useCustomStatusModalHandler } from './useCustomStatusModalHandler'; -const isDefaultStatus = (id: string): boolean => (Object.values(UserStatusEnum) as string[]).includes(id); -const isDefaultStatusName = (_name: string, id: string): _name is UserStatusEnum => isDefaultStatus(id); -const translateStatusName = (t: ReturnType, status: (typeof userStatus.list)['']): string => { - if (isDefaultStatusName(status.name, status.id)) { - return t(status.name as TranslationKey); - } +export const useStatusItems = (): GenericMenuItemProps[] => { + // We should lift this up to somewhere else if we want to use it in other places - return status.name; -}; + userStatuses.invisibleAllowed = useSetting('Accounts_AllowInvisibleStatusOption', true); -export const useStatusItems = (user: IUser): GenericMenuItemProps[] => { - const t = useTranslation(); - const presenceDisabled = useSetting('Presence_broadcast_disabled'); - const setStatus = useEndpoint('POST', '/v1/users.setStatus'); + const queryClient = useQueryClient(); - const setStatusAction = (status: (typeof userStatus.list)['']): void => { - setStatus({ status: status.statusType, message: !isDefaultStatus(status.id) ? status.name : '' }); - void callbacks.run('userStatusManuallySet', status); - }; + useEffect( + () => + userStatuses.watch(() => { + queryClient.setQueryData(['user-statuses'], Array.from(userStatuses)); + }), + [queryClient], + ); - const filterInvisibleStatus = !useSetting('Accounts_AllowInvisibleStatusOption') - ? (status: ValueOf<(typeof userStatus)['list']>): boolean => status.name !== 'invisible' - : (): boolean => true; + const { t } = useTranslation(); - const handleCustomStatus = useCustomStatusModalHandler(); + const setStatus = useEndpoint('POST', '/v1/users.setStatus'); + const setStatusMutation = useMutation({ + mutationFn: async (status: UserStatusDescriptor) => { + void setStatus({ status: status.statusType, message: userStatuses.isValidType(status.id) ? '' : status.name }); + void callbacks.run('userStatusManuallySet', status); + }, + }); - const handleStatusDisabledModal = useStatusDisabledModal(); + const presenceDisabled = useSetting('Presence_broadcast_disabled', false); - const presenceDisabledItem = { - id: 'presence-disabled', - content: ( - - - {t('User_status_disabled')} - - - {t('Learn_more')} - - - ), - }; + const { data: statuses } = useQuery({ + queryKey: ['user-statuses'], + queryFn: async () => { + await userStatuses.sync(); + return Array.from(userStatuses); + }, + staleTime: Infinity, + select: (statuses) => + statuses.map((status): GenericMenuItemProps => { + const content = status.localizeName ? t(status.name) : status.name; + return { + id: status.id, + status: , + content: , + disabled: presenceDisabled, + onClick: () => setStatusMutation.mutate(status), + }; + }), + }); - const statusItems = Object.values(userStatus.list) - .filter(filterInvisibleStatus) - .map((status) => { - const name = status.localizeName ? translateStatusName(t, status) : status.name; - const modifier = status.statusType || user?.status; - return { - id: status.id, - status: , - content: , - onClick: () => setStatusAction(status), - disabled: presenceDisabled, - }; - }); + const handleStatusDisabledModal = useStatusDisabledModal(); + const handleCustomStatus = useCustomStatusModalHandler(); return [ - ...(presenceDisabled ? [presenceDisabledItem] : []), - ...statusItems, + ...(presenceDisabled + ? [ + { + id: 'presence-disabled', + content: ( + + + {t('User_status_disabled')} + + + {t('Learn_more')} + + + ), + }, + ] + : []), + ...(statuses ?? []), { id: 'custom-status', icon: 'emoji', content: t('Custom_Status'), onClick: handleCustomStatus, disabled: presenceDisabled }, ]; }; diff --git a/apps/meteor/client/sidebar/header/hooks/useUserMenu.tsx b/apps/meteor/client/sidebar/header/hooks/useUserMenu.tsx index 111065b0ac46..de43d30306e9 100644 --- a/apps/meteor/client/sidebar/header/hooks/useUserMenu.tsx +++ b/apps/meteor/client/sidebar/header/hooks/useUserMenu.tsx @@ -11,7 +11,7 @@ import { useStatusItems } from './useStatusItems'; export const useUserMenu = (user: IUser) => { const t = useTranslation(); - const statusItems = useStatusItems(user); + const statusItems = useStatusItems(); const accountItems = useAccountItems(); const logout = useLogout(); diff --git a/apps/meteor/client/sidebar/hooks/useAvatarTemplate.tsx b/apps/meteor/client/sidebar/hooks/useAvatarTemplate.tsx index 5bb49da37418..9fd1023a32e7 100644 --- a/apps/meteor/client/sidebar/hooks/useAvatarTemplate.tsx +++ b/apps/meteor/client/sidebar/hooks/useAvatarTemplate.tsx @@ -1,10 +1,9 @@ import type { IRoom } from '@rocket.chat/core-typings'; +import { RoomAvatar } from '@rocket.chat/ui-avatar'; import { useUserPreference } from '@rocket.chat/ui-contexts'; import type { ComponentType } from 'react'; import React, { useMemo } from 'react'; -import RoomAvatar from '../../components/avatar/RoomAvatar'; - export const useAvatarTemplate = ( sidebarViewMode?: 'extended' | 'medium' | 'condensed', sidebarDisplayAvatar?: boolean, diff --git a/apps/meteor/client/sidebar/search/ScrollerWithCustomProps.tsx b/apps/meteor/client/sidebar/search/ScrollerWithCustomProps.tsx deleted file mode 100644 index 176eed7c4f1f..000000000000 --- a/apps/meteor/client/sidebar/search/ScrollerWithCustomProps.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import type { ReactElement } from 'react'; -import React, { forwardRef } from 'react'; - -import ScrollableContentWrapper from '../../components/ScrollableContentWrapper'; - -const ScrollerWithCustomProps = forwardRef(function ScrollerWithCustomProps(props, ref: React.Ref) { - return ( -
} - renderTrackHorizontal={(props): ReactElement =>
} - /> - ); -}); - -export default ScrollerWithCustomProps; diff --git a/apps/meteor/client/sidebar/search/SearchList.tsx b/apps/meteor/client/sidebar/search/SearchList.tsx index 85718146b3e6..d215a77ce4bd 100644 --- a/apps/meteor/client/sidebar/search/SearchList.tsx +++ b/apps/meteor/client/sidebar/search/SearchList.tsx @@ -12,12 +12,12 @@ import type { VirtuosoHandle } from 'react-virtuoso'; import { Virtuoso } from 'react-virtuoso'; import tinykeys from 'tinykeys'; +import { VirtuosoScrollbars } from '../../components/CustomScrollbars'; import { getConfig } from '../../lib/utils/getConfig'; import { useAvatarTemplate } from '../hooks/useAvatarTemplate'; import { usePreventDefault } from '../hooks/usePreventDefault'; import { useTemplateByViewMode } from '../hooks/useTemplateByViewMode'; import Row from './Row'; -import ScrollerWithCustomProps from './ScrollerWithCustomProps'; const mobileCheck = function () { let check = false; @@ -55,7 +55,7 @@ const shortcut = ((): string => { if (window.navigator.platform.toLowerCase().includes('mac')) { return '(\u2318+K)'; } - return '(\u2303+K)'; + return '(Ctrl+K)'; })(); const LIMIT = parseInt(String(getConfig('Sidebar_Search_Spotlight_LIMIT', 20))); @@ -101,7 +101,7 @@ const useSearchItems = (filterText: string): UseQueryResult<(ISubscription & IRo const getSpotlight = useMethod('spotlight'); return useQuery( - ['sidebar/search/spotlight', name, usernamesFromClient, type, localRooms.map(({ _id }) => _id)], + ['sidebar/search/spotlight', name, usernamesFromClient, type, localRooms.map(({ _id, name }) => _id + name)], async () => { if (localRooms.length === LIMIT) { return localRooms; @@ -255,14 +255,14 @@ const SearchList = forwardRef(function SearchList({ onClose }: SearchListProps, }); const resetCursor = useMutableCallback(() => { - itemIndexRef.current = 0; - listRef.current?.scrollToIndex({ index: itemIndexRef.current }); - - selectedElement.current = boxRef.current?.querySelector('a.rcx-sidebar-item'); - - if (selectedElement.current) { - toggleSelectionState(selectedElement.current, undefined, cursorRef?.current || undefined); - } + setTimeout(() => { + itemIndexRef.current = 0; + listRef.current?.scrollToIndex({ index: itemIndexRef.current }); + selectedElement.current = boxRef.current?.querySelector('a.rcx-sidebar-item'); + if (selectedElement.current) { + toggleSelectionState(selectedElement.current, undefined, cursorRef?.current || undefined); + } + }, 0); }); usePreventDefault(boxRef); @@ -303,9 +303,12 @@ const SearchList = forwardRef(function SearchList({ onClose }: SearchListProps, listRef.current?.scrollToIndex({ index: itemIndexRef.current }); selectedElement.current = currentElement; }, - Enter: () => { - if (selectedElement.current) { + Enter: (event) => { + event.preventDefault(); + if (selectedElement.current && items.length > 0) { selectedElement.current.click(); + } else { + onClose(); } }, }); @@ -363,7 +366,7 @@ const SearchList = forwardRef(function SearchList({ onClose }: SearchListProps, style={{ height: '100%', width: '100%' }} totalCount={items.length} data={items} - components={{ Scroller: ScrollerWithCustomProps }} + components={{ Scroller: VirtuosoScrollbars }} computeItemKey={(_, room) => room._id} itemContent={(_, data): ReactElement => } ref={listRef} diff --git a/apps/meteor/client/sidebar/sections/OmnichannelSection.tsx b/apps/meteor/client/sidebar/sections/OmnichannelSection.tsx index e7dec5f3506a..6dd63e6a36d4 100644 --- a/apps/meteor/client/sidebar/sections/OmnichannelSection.tsx +++ b/apps/meteor/client/sidebar/sections/OmnichannelSection.tsx @@ -4,7 +4,10 @@ import { useLayout, useRoute, usePermission, useTranslation } from '@rocket.chat import React, { memo } from 'react'; import { useIsCallEnabled, useIsCallReady } from '../../contexts/CallContext'; +import { useIsOverMacLimit } from '../../hooks/omnichannel/useIsOverMacLimit'; import { useOmnichannelShowQueueLink } from '../../hooks/omnichannel/useOmnichannelShowQueueLink'; +import SidebarHeaderToolbar from '../header/SidebarHeaderToolbar'; +import { OverMacLimitSection } from './OverMacLimitSection'; import { OmniChannelCallDialPad, OmnichannelCallToggle, OmnichannelLivechatToggle } from './actions'; const OmnichannelSection = () => { @@ -16,6 +19,7 @@ const OmnichannelSection = () => { const { sidebar } = useLayout(); const directoryRoute = useRoute('omnichannel-directory'); const queueListRoute = useRoute('livechat-queue'); + const isWorkspaceOverMacLimit = useIsOverMacLimit(); const handleRoute = useMutableCallback((route) => { sidebar.toggle(); @@ -32,25 +36,29 @@ const OmnichannelSection = () => { // The className is a paliative while we make TopBar.ToolBox optional on fuselage return ( - - {t('Omnichannel')} - - {showOmnichannelQueueLink && ( - handleRoute('queue')} /> - )} - {isCallEnabled && } - - {hasPermissionToSeeContactCenter && ( - handleRoute('directory')} - /> - )} - {isCallReady && } - - + <> + {isWorkspaceOverMacLimit && } + + + {t('Omnichannel')} + + {showOmnichannelQueueLink && ( + handleRoute('queue')} /> + )} + {isCallEnabled && } + + {hasPermissionToSeeContactCenter && ( + handleRoute('directory')} + /> + )} + {isCallReady && } + + + ); }; diff --git a/apps/meteor/client/sidebar/sections/OverMacLimitSection.tsx b/apps/meteor/client/sidebar/sections/OverMacLimitSection.tsx new file mode 100644 index 000000000000..53cbd0340339 --- /dev/null +++ b/apps/meteor/client/sidebar/sections/OverMacLimitSection.tsx @@ -0,0 +1,21 @@ +import { Icon, SidebarBanner } from '@rocket.chat/fuselage'; +import { useTranslation } from '@rocket.chat/ui-contexts'; +import type { ReactElement } from 'react'; +import React from 'react'; + +export const OverMacLimitSection = (): ReactElement => { + const t = useTranslation(); + + const handleClick = () => { + window.open('https://rocket.chat/pricing', '_blank'); + }; + + return ( + } + onClick={handleClick} + /> + ); +}; diff --git a/apps/meteor/client/sidebar/sections/actions/OmnichannelCallDialPad.tsx b/apps/meteor/client/sidebar/sections/actions/OmnichannelCallDialPad.tsx index f0755e125583..2cd263630da7 100644 --- a/apps/meteor/client/sidebar/sections/actions/OmnichannelCallDialPad.tsx +++ b/apps/meteor/client/sidebar/sections/actions/OmnichannelCallDialPad.tsx @@ -19,7 +19,7 @@ export const OmniChannelCallDialPad = ({ ...props }): ReactElement => { onClick={(): void => openDialModal()} disabled={!outBoundCallsEnabledForUser} aria-label={t('Open_Dialpad')} - data-tooltip={outBoundCallsAllowed ? t('New_Call') : t('New_Call_Enterprise_Edition_Only')} + data-tooltip={outBoundCallsAllowed ? t('New_Call') : t('New_Call_Premium_Only')} {...props} /> ); diff --git a/apps/meteor/client/startup/UserDeleted.ts b/apps/meteor/client/startup/UserDeleted.ts deleted file mode 100644 index 0e7b75bf4efa..000000000000 --- a/apps/meteor/client/startup/UserDeleted.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Meteor } from 'meteor/meteor'; - -import { ChatMessage } from '../../app/models/client'; -import { Notifications } from '../../app/notifications/client'; - -Meteor.startup(() => { - Notifications.onLogged('Users:Deleted', ({ userId }) => { - ChatMessage.remove({ - 'u._id': userId, - }); - }); -}); diff --git a/apps/meteor/client/startup/accounts.ts b/apps/meteor/client/startup/accounts.ts index ed99ea8238be..3be110bc0a09 100644 --- a/apps/meteor/client/startup/accounts.ts +++ b/apps/meteor/client/startup/accounts.ts @@ -1,18 +1,26 @@ import { Accounts } from 'meteor/accounts-base'; import { Meteor } from 'meteor/meteor'; +import { Tracker } from 'meteor/tracker'; +import { mainReady } from '../../app/ui-utils/client'; import { sdk } from '../../app/utils/client/lib/SDKClient'; import { t } from '../../app/utils/lib/i18n'; import { dispatchToastMessage } from '../lib/toast'; Accounts.onEmailVerificationLink((token: string) => { Accounts.verifyEmail(token, (error) => { - if (error instanceof Meteor.Error && error.error === 'verify-email') { - dispatchToastMessage({ type: 'success', message: t('Email_verified') }); - void sdk.call('afterVerifyEmail'); - return; - } - - dispatchToastMessage({ type: 'error', message: error }); + Tracker.autorun(() => { + if (mainReady.get()) { + if (error) { + dispatchToastMessage({ type: 'error', message: error }); + throw new Meteor.Error('verify-email', 'E-mail not verified'); + } else { + Tracker.nonreactive(() => { + void sdk.call('afterVerifyEmail'); + }); + dispatchToastMessage({ type: 'success', message: t('Email_verified') }); + } + } + }); }); }); diff --git a/apps/meteor/client/startup/actionButtons/index.ts b/apps/meteor/client/startup/actionButtons/index.ts index 18aede35b215..97ccf359d567 100644 --- a/apps/meteor/client/startup/actionButtons/index.ts +++ b/apps/meteor/client/startup/actionButtons/index.ts @@ -5,7 +5,6 @@ import './jumpToStarMessage'; import './permalinkPinned'; import './permalinkStar'; import './pinMessage'; -import './readReceipt'; import './starMessage'; import './unpinMessage'; import './unstarMessage'; diff --git a/apps/meteor/client/startup/actionButtons/pinMessage.ts b/apps/meteor/client/startup/actionButtons/pinMessage.ts deleted file mode 100644 index 970eb28349c0..000000000000 --- a/apps/meteor/client/startup/actionButtons/pinMessage.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { Meteor } from 'meteor/meteor'; - -import { hasAtLeastOnePermission } from '../../../app/authorization/client'; -import { settings } from '../../../app/settings/client'; -import { MessageAction } from '../../../app/ui-utils/client'; -import { sdk } from '../../../app/utils/client/lib/SDKClient'; -import { queryClient } from '../../lib/queryClient'; -import { roomCoordinator } from '../../lib/rooms/roomCoordinator'; -import { dispatchToastMessage } from '../../lib/toast'; -import { messageArgs } from '../../lib/utils/messageArgs'; - -Meteor.startup(() => { - MessageAction.addButton({ - id: 'pin-message', - icon: 'pin', - label: 'Pin', - type: 'interaction', - context: ['pinned', 'message', 'message-mobile', 'threads', 'direct', 'videoconf', 'videoconf-threads'], - async action(_, props) { - const { message = messageArgs(this).msg } = props; - message.pinned = true; - try { - await sdk.call('pinMessage', message); - queryClient.invalidateQueries(['rooms', message.rid, 'pinned-messages']); - } catch (error) { - dispatchToastMessage({ type: 'error', message: error }); - } - }, - condition({ message, subscription, room }) { - if (!settings.get('Message_AllowPinning') || message.pinned || !subscription) { - return false; - } - const isLivechatRoom = roomCoordinator.isLivechatRoom(room.t); - if (isLivechatRoom) { - return false; - } - return hasAtLeastOnePermission('pin-message', message.rid); - }, - order: 2, - group: 'menu', - }); -}); diff --git a/apps/meteor/client/startup/actionButtons/pinMessage.tsx b/apps/meteor/client/startup/actionButtons/pinMessage.tsx new file mode 100644 index 000000000000..b383b4a3c648 --- /dev/null +++ b/apps/meteor/client/startup/actionButtons/pinMessage.tsx @@ -0,0 +1,56 @@ +import { Meteor } from 'meteor/meteor'; + +import { hasAtLeastOnePermission } from '../../../app/authorization/client'; +import { settings } from '../../../app/settings/client'; +import { MessageAction } from '../../../app/ui-utils/client'; +import { sdk } from '../../../app/utils/client/lib/SDKClient'; +import { imperativeModal } from '../../lib/imperativeModal'; +import { queryClient } from '../../lib/queryClient'; +import { roomCoordinator } from '../../lib/rooms/roomCoordinator'; +import { dispatchToastMessage } from '../../lib/toast'; +import { messageArgs } from '../../lib/utils/messageArgs'; +import PinMessageModal from '../../views/room/modals/PinMessageModal'; + +Meteor.startup(() => { + MessageAction.addButton({ + id: 'pin-message', + icon: 'pin', + label: 'Pin', + type: 'interaction', + context: ['pinned', 'message', 'message-mobile', 'threads', 'direct', 'videoconf', 'videoconf-threads'], + async action(_, props) { + const { message = messageArgs(this).msg } = props; + const onConfirm = async () => { + message.pinned = true; + try { + await sdk.call('pinMessage', message); + queryClient.invalidateQueries(['rooms', message.rid, 'pinned-messages']); + } catch (error) { + dispatchToastMessage({ type: 'error', message: error }); + } + imperativeModal.close(); + }; + + imperativeModal.open({ + component: PinMessageModal, + props: { + message, + onConfirm, + onCancel: () => imperativeModal.close(), + }, + }); + }, + condition({ message, subscription, room }) { + if (!settings.get('Message_AllowPinning') || message.pinned || !subscription) { + return false; + } + const isLivechatRoom = roomCoordinator.isLivechatRoom(room.t); + if (isLivechatRoom) { + return false; + } + return hasAtLeastOnePermission('pin-message', message.rid); + }, + order: 2, + group: 'menu', + }); +}); diff --git a/apps/meteor/client/startup/actionButtons/readReceipt.ts b/apps/meteor/client/startup/actionButtons/readReceipt.ts deleted file mode 100644 index cd215c84f107..000000000000 --- a/apps/meteor/client/startup/actionButtons/readReceipt.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { Meteor } from 'meteor/meteor'; -import { Tracker } from 'meteor/tracker'; - -import { settings } from '../../../app/settings/client'; -import { MessageAction } from '../../../app/ui-utils/client'; -import { imperativeModal } from '../../lib/imperativeModal'; -import { messageArgs } from '../../lib/utils/messageArgs'; -import ReadReceiptsModal from '../../views/room/modals/ReadReceiptsModal'; - -Meteor.startup(() => { - Tracker.autorun(() => { - const enabled = settings.get('Message_Read_Receipt_Store_Users'); - - if (!enabled) { - return MessageAction.removeButton('receipt-detail'); - } - - MessageAction.addButton({ - id: 'receipt-detail', - icon: 'info-circled', - label: 'Info', - context: ['starred', 'message', 'message-mobile', 'threads', 'videoconf', 'videoconf-threads'], - type: 'duplication', - action(_, props) { - const { message = messageArgs(this).msg } = props; - imperativeModal.open({ - component: ReadReceiptsModal, - props: { messageId: message._id, onClose: imperativeModal.close }, - }); - }, - order: 10, - group: 'menu', - }); - }); -}); diff --git a/apps/meteor/client/startup/afterLogoutCleanUp/purgeAllDrafts.ts b/apps/meteor/client/startup/afterLogoutCleanUp/purgeAllDrafts.ts index d0c15c93263e..4a3c0ff92811 100644 --- a/apps/meteor/client/startup/afterLogoutCleanUp/purgeAllDrafts.ts +++ b/apps/meteor/client/startup/afterLogoutCleanUp/purgeAllDrafts.ts @@ -5,9 +5,9 @@ import { afterLogoutCleanUpCallback } from '../../../lib/callbacks/afterLogoutCl Meteor.startup(() => { const purgeAllDrafts = (): void => { - Object.keys(Meteor._localStorage) + Object.keys(localStorage) .filter((key) => key.indexOf('messagebox_') === 0) - .forEach((key) => Meteor._localStorage.removeItem(key)); + .forEach((key) => localStorage.removeItem(key)); }; afterLogoutCleanUpCallback.add(purgeAllDrafts, callbacks.priority.MEDIUM, 'chatMessages-after-logout-cleanup'); diff --git a/apps/meteor/client/startup/customOAuth.ts b/apps/meteor/client/startup/customOAuth.ts index 5b0e3dfb4261..5796814444cf 100644 --- a/apps/meteor/client/startup/customOAuth.ts +++ b/apps/meteor/client/startup/customOAuth.ts @@ -1,25 +1,20 @@ import { Meteor } from 'meteor/meteor'; -import { ServiceConfiguration } from 'meteor/service-configuration'; -import { CustomOAuth } from '../../app/custom-oauth/client/custom_oauth_client'; +import { CustomOAuth } from '../../app/custom-oauth/client/CustomOAuth'; +import { loginServices } from '../lib/loginServices'; Meteor.startup(() => { - ServiceConfiguration.configurations - .find({ - custom: true, - }) - .observe({ - async added(record) { - const { isOauthCustomConfiguration } = await import('@rocket.chat/rest-typings'); - if (!isOauthCustomConfiguration(record)) { - return; - } + loginServices.onLoad((services) => { + for (const service of services) { + if (!('custom' in service && service.custom)) { + continue; + } - new CustomOAuth(record.service, { - serverURL: record.serverURL, - authorizePath: record.authorizePath, - scope: record.scope, - }); - }, - }); + new CustomOAuth(service.service, { + serverURL: service.serverURL, + authorizePath: service.authorizePath, + scope: service.scope, + }); + } + }); }); diff --git a/apps/meteor/client/startup/e2e.ts b/apps/meteor/client/startup/e2e.ts index ddfbada67c2a..f9cf156f8d8b 100644 --- a/apps/meteor/client/startup/e2e.ts +++ b/apps/meteor/client/startup/e2e.ts @@ -4,8 +4,8 @@ import { Tracker } from 'meteor/tracker'; import { e2e } from '../../app/e2e/client/rocketchat.e2e'; import { Subscriptions, ChatRoom } from '../../app/models/client'; -import { Notifications } from '../../app/notifications/client'; import { settings } from '../../app/settings/client'; +import { sdk } from '../../app/utils/client/lib/SDKClient'; import { onClientBeforeSendMessage } from '../lib/onClientBeforeSendMessage'; import { onClientMessageReceived } from '../lib/onClientMessageReceived'; import { isLayoutEmbedded } from '../lib/utils/isLayoutEmbedded'; @@ -38,23 +38,25 @@ Meteor.startup(() => { let observable: Meteor.LiveQueryHandle | null = null; let offClientMessageReceived: undefined | (() => void); let offClientBeforeSendMessage: undefined | (() => void); + let unsubNotifyUser: undefined | (() => void); Tracker.autorun(() => { if (!e2e.isReady()) { offClientMessageReceived?.(); - Notifications.unUser('e2ekeyRequest'); + unsubNotifyUser?.(); + unsubNotifyUser = undefined; observable?.stop(); offClientBeforeSendMessage?.(); return; } - Notifications.onUser('e2ekeyRequest', async (roomId, keyId): Promise => { + unsubNotifyUser = sdk.stream('notify-user', [`${Meteor.userId()}/e2ekeyRequest`], async (roomId, keyId): Promise => { const e2eRoom = await e2e.getInstanceByRoomId(roomId); if (!e2eRoom) { return; } e2eRoom.provideKeyToUser(keyId); - }); + }).stop; observable = Subscriptions.find().observe({ changed: async (sub: ISubscription) => { diff --git a/apps/meteor/client/startup/forceLogout.ts b/apps/meteor/client/startup/forceLogout.ts index 9226229ae418..f882354062cd 100644 --- a/apps/meteor/client/startup/forceLogout.ts +++ b/apps/meteor/client/startup/forceLogout.ts @@ -2,7 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { Session } from 'meteor/session'; import { Tracker } from 'meteor/tracker'; -import { Notifications } from '../../app/notifications/client'; +import { sdk } from '../../app/utils/client/lib/SDKClient'; Meteor.startup(() => { Tracker.autorun(() => { @@ -12,7 +12,7 @@ Meteor.startup(() => { return; } Session.set('force_logout', false); - Notifications.onUser('force_logout', () => { + sdk.stream('notify-user', [`${userId}/force_logout`], () => { Session.set('force_logout', true); }); }); diff --git a/apps/meteor/client/startup/iframeCommands.ts b/apps/meteor/client/startup/iframeCommands.ts index cb946ba44176..f0db83ccdcbf 100644 --- a/apps/meteor/client/startup/iframeCommands.ts +++ b/apps/meteor/client/startup/iframeCommands.ts @@ -2,7 +2,6 @@ import type { UserStatus, IUser } from '@rocket.chat/core-typings'; import { escapeRegExp } from '@rocket.chat/string-helpers'; import type { LocationPathname } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; -import { ServiceConfiguration } from 'meteor/service-configuration'; import { settings } from '../../app/settings/client'; import { AccountBox } from '../../app/ui-utils/client/lib/AccountBox'; @@ -10,6 +9,7 @@ import { sdk } from '../../app/utils/client/lib/SDKClient'; import { afterLogoutCleanUpCallback } from '../../lib/callbacks/afterLogoutCleanUpCallback'; import { capitalize, ltrim, rtrim } from '../../lib/utils/stringUtils'; import { baseURI } from '../lib/baseURI'; +import { loginServices } from '../lib/loginServices'; import { router } from '../providers/RouterProvider'; const commands = { @@ -55,7 +55,7 @@ const commands = { } if (typeof data.service === 'string' && window.ServiceConfiguration) { - const customOauth = ServiceConfiguration.configurations.findOne({ service: data.service }); + const customOauth = loginServices.getLoginService(data.service); if (customOauth) { const customLoginWith = (Meteor as any)[`loginWith${capitalize(customOauth.service, true)}`]; diff --git a/apps/meteor/client/startup/incomingMessages.ts b/apps/meteor/client/startup/incomingMessages.ts index 88e83b9cf5e8..e9659cc24724 100644 --- a/apps/meteor/client/startup/incomingMessages.ts +++ b/apps/meteor/client/startup/incomingMessages.ts @@ -2,8 +2,8 @@ import type { IMessage } from '@rocket.chat/core-typings'; import { Meteor } from 'meteor/meteor'; import { ChatMessage } from '../../app/models/client'; -import { Notifications } from '../../app/notifications/client'; import { CachedCollectionManager } from '../../app/ui-cached-collection/client'; +import { sdk } from '../../app/utils/client/lib/SDKClient'; Meteor.startup(() => { Tracker.autorun(() => { @@ -11,7 +11,9 @@ Meteor.startup(() => { return; } - Notifications.onUser('message', (msg: IMessage) => { + // Only event I found triggers this is from ephemeral messages + // Other types of messages come from another stream + sdk.stream('notify-user', [`${Meteor.userId()}/message`], (msg: IMessage) => { msg.u = msg.u || { username: 'rocket.cat' }; msg.private = true; @@ -20,7 +22,7 @@ Meteor.startup(() => { }); CachedCollectionManager.onLogin(() => { - Notifications.onUser('subscriptions-changed', (_action, sub) => { + sdk.stream('notify-user', [`${Meteor.userId()}/subscriptions-changed`], (_action, sub) => { ChatMessage.update( { rid: sub.rid, diff --git a/apps/meteor/client/startup/index.ts b/apps/meteor/client/startup/index.ts index 8d85beb18df8..bf6814617e4a 100644 --- a/apps/meteor/client/startup/index.ts +++ b/apps/meteor/client/startup/index.ts @@ -1,6 +1,5 @@ import '../lib/rooms/roomTypes'; import './absoluteUrl'; -import './accounts'; import './actionButtons'; import './afterLogoutCleanUp'; import './appRoot'; @@ -11,13 +10,11 @@ import './e2e'; import './forceLogout'; import './iframeCommands'; import './incomingMessages'; -import './ldap'; import './loadMissedMessages'; import './loginViaQuery'; import './messageObserve'; import './messageTypes'; import './notifications'; -import './oauth'; import './otr'; import './reloadRoomAfterLogin'; import './roles'; @@ -28,6 +25,5 @@ import './slashCommands'; import './startup'; import './streamMessage'; import './unread'; -import './UserDeleted'; import './userRoles'; import './userStatusManuallySet'; diff --git a/apps/meteor/client/startup/ldap.ts b/apps/meteor/client/startup/ldap.ts deleted file mode 100644 index 13f6048bb2eb..000000000000 --- a/apps/meteor/client/startup/ldap.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Accounts } from 'meteor/accounts-base'; -import { Meteor } from 'meteor/meteor'; - -(Meteor as any).loginWithLDAP = function (username: string, password: string, callback?: (err?: any) => void): void { - Accounts.callLoginMethod({ - methodArguments: [ - { - ldap: true, - username, - ldapPass: password, - ldapOptions: {}, - }, - ], - userCallback: callback, - }); -}; diff --git a/apps/meteor/client/startup/notifications/index.ts b/apps/meteor/client/startup/notifications/index.ts index e94aaacdd783..866dae4d52f3 100644 --- a/apps/meteor/client/startup/notifications/index.ts +++ b/apps/meteor/client/startup/notifications/index.ts @@ -1,4 +1,2 @@ import './konchatNotifications'; import './notification'; -import './updateAvatar'; -import './usersNameChanged'; diff --git a/apps/meteor/client/startup/notifications/konchatNotifications.ts b/apps/meteor/client/startup/notifications/konchatNotifications.ts index 723901b7f70b..cd16d4264479 100644 --- a/apps/meteor/client/startup/notifications/konchatNotifications.ts +++ b/apps/meteor/client/startup/notifications/konchatNotifications.ts @@ -4,10 +4,10 @@ import { Tracker } from 'meteor/tracker'; import { lazy } from 'react'; import { CachedChatSubscription } from '../../../app/models/client'; -import { Notifications } from '../../../app/notifications/client'; import { settings } from '../../../app/settings/client'; import { KonchatNotification } from '../../../app/ui/client/lib/KonchatNotification'; import { getUserPreference } from '../../../app/utils/client'; +import { sdk } from '../../../app/utils/client/lib/SDKClient'; import { RoomManager } from '../../lib/RoomManager'; import { imperativeModal } from '../../lib/imperativeModal'; import { fireGlobalEvent } from '../../lib/utils/fireGlobalEvent'; @@ -71,17 +71,18 @@ Meteor.startup(() => { }; Tracker.autorun(() => { if (!Meteor.userId() || !settings.get('Outlook_Calendar_Enabled')) { - return Notifications.unUser('calendar'); + sdk.stop('notify-user', `${Meteor.userId()}/calendar`); } - Notifications.onUser('calendar', notifyUserCalendar); + sdk.stream('notify-user', [`${Meteor.userId()}/calendar`], notifyUserCalendar); }); Tracker.autorun(() => { if (!Meteor.userId()) { return; } - Notifications.onUser('notification', (notification) => { + + sdk.stream('notify-user', [`${Meteor.userId()}/notification`], (notification) => { const openedRoomId = ['channel', 'group', 'direct'].includes(router.getRouteName()!) ? RoomManager.opened : undefined; // This logic is duplicated in /client/startup/unread.coffee. @@ -111,7 +112,7 @@ Meteor.startup(() => { void notifyNewRoom(sub); }); - Notifications.onUser('subscriptions-changed', (action, sub) => { + sdk.stream('notify-user', [`${Meteor.userId()}/subscriptions-changed`], (action, sub) => { if (action === 'removed') { return; } diff --git a/apps/meteor/client/startup/notifications/updateAvatar.ts b/apps/meteor/client/startup/notifications/updateAvatar.ts deleted file mode 100644 index b26e184aca20..000000000000 --- a/apps/meteor/client/startup/notifications/updateAvatar.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Meteor } from 'meteor/meteor'; - -import { Notifications } from '../../../app/notifications/client'; - -Meteor.startup(() => { - Notifications.onLogged('updateAvatar', (data) => { - if ('username' in data) { - const { username, etag } = data; - username && Meteor.users.update({ username }, { $set: { avatarETag: etag } }); - } - }); -}); diff --git a/apps/meteor/client/startup/notifications/usersNameChanged.ts b/apps/meteor/client/startup/notifications/usersNameChanged.ts deleted file mode 100644 index 9815422ce96a..000000000000 --- a/apps/meteor/client/startup/notifications/usersNameChanged.ts +++ /dev/null @@ -1,55 +0,0 @@ -import type { IUser } from '@rocket.chat/core-typings'; -import { Meteor } from 'meteor/meteor'; - -import { Messages, Subscriptions } from '../../../app/models/client'; -import { Notifications } from '../../../app/notifications/client'; - -type UsersNameChangedEvent = Partial; - -Meteor.startup(() => { - Notifications.onLogged('Users:NameChanged', ({ _id, name, username }: UsersNameChangedEvent) => { - Messages.update( - { - 'u._id': _id, - }, - { - $set: { - 'u.username': username, - 'u.name': name, - }, - }, - { - multi: true, - }, - ); - - Messages.update( - { - mentions: { - $elemMatch: { _id }, - }, - }, - { - $set: { - 'mentions.$.username': username, - 'mentions.$.name': name, - }, - }, - { - multi: true, - }, - ); - - Subscriptions.update( - { - name: username, - t: 'd', - }, - { - $set: { - fname: name, - }, - }, - ); - }); -}); diff --git a/apps/meteor/client/startup/oauth.ts b/apps/meteor/client/startup/oauth.ts deleted file mode 100644 index 23f5ec8246b4..000000000000 --- a/apps/meteor/client/startup/oauth.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { Meteor } from 'meteor/meteor'; -import { OAuth } from 'meteor/oauth'; - -// OAuth._retrieveCredentialSecret is a meteor method modified to also check the global localStorage -// This was necessary because of the "Forget User Session on Window Close" setting. -// The setting changes Meteor._localStorage to use the browser's session storage instead, but that doesn't happen on the Oauth's popup code. - -Meteor.startup(() => { - const meteorOAuthRetrieveCredentialSecret = OAuth._retrieveCredentialSecret; - OAuth._retrieveCredentialSecret = (credentialToken: string): string | null => { - let secret = meteorOAuthRetrieveCredentialSecret.call(OAuth, credentialToken); - if (!secret) { - const localStorageKey = `${OAuth._storageTokenPrefix}${credentialToken}`; - secret = localStorage.getItem(localStorageKey); - localStorage.removeItem(localStorageKey); - } - - return secret; - }; -}); diff --git a/apps/meteor/client/startup/otr.ts b/apps/meteor/client/startup/otr.ts index d0603a8fdfd2..084f4311c499 100644 --- a/apps/meteor/client/startup/otr.ts +++ b/apps/meteor/client/startup/otr.ts @@ -1,8 +1,7 @@ -import type { IMessage, AtLeast } from '@rocket.chat/core-typings'; +import { isOTRMessage } from '@rocket.chat/core-typings'; import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; -import { Notifications } from '../../app/notifications/client'; import OTR from '../../app/otr/client/OTR'; import { OtrRoomState } from '../../app/otr/lib/OtrRoomState'; import { sdk } from '../../app/utils/client/lib/SDKClient'; @@ -12,45 +11,57 @@ import { onClientMessageReceived } from '../lib/onClientMessageReceived'; Meteor.startup(() => { Tracker.autorun(() => { - if (Meteor.userId()) { - Notifications.onUser('otr', (type, data) => { - if (!data.roomId || !data.userId || data.userId === Meteor.userId()) { - return; - } - const instanceByRoomId = OTR.getInstanceByRoomId(data.roomId); - - if (!instanceByRoomId) { - return; - } + const uid = Meteor.userId(); - instanceByRoomId.onUserStream(type, data); - }); + if (!uid) { + return; } + + sdk.stream('notify-user', [`${uid}/otr`], (type, data) => { + if (!data.roomId || !data.userId || data.userId === uid) { + return; + } + + const otrRoom = OTR.getInstanceByRoomId(uid, data.roomId); + otrRoom?.onUserStream(type, data); + }); }); - onClientBeforeSendMessage.use(async (message: AtLeast) => { - const instanceByRoomId = OTR.getInstanceByRoomId(message.rid); + onClientBeforeSendMessage.use(async (message) => { + const uid = Meteor.userId(); + + if (!uid) { + return message; + } - if (message.rid && instanceByRoomId && instanceByRoomId.getState() === OtrRoomState.ESTABLISHED) { - const msg = await instanceByRoomId.encrypt(message); + const otrRoom = OTR.getInstanceByRoomId(uid, message.rid); + + if (otrRoom && otrRoom.getState() === OtrRoomState.ESTABLISHED) { + const msg = await otrRoom.encrypt(message); return { ...message, msg, t: 'otr' }; } return message; }); - onClientMessageReceived.use(async (message: IMessage & { notification?: boolean }) => { - const instanceByRoomId = OTR.getInstanceByRoomId(message.rid); + onClientMessageReceived.use(async (message) => { + const uid = Meteor.userId(); - if (message.rid && instanceByRoomId && instanceByRoomId.getState() === OtrRoomState.ESTABLISHED) { - if (message?.notification) { - message.msg = t('Encrypted_message'); - return message; - } - if (message.t !== 'otr') { - return message; - } + if (!uid) { + return message; + } - const decrypted = await instanceByRoomId.decrypt(message.msg); + if (!isOTRMessage(message)) { + return message; + } + + if ('notification' in message) { + return { ...message, msg: t('Encrypted_message') }; + } + + const otrRoom = OTR.getInstanceByRoomId(uid, message.rid); + + if (otrRoom && otrRoom.getState() === OtrRoomState.ESTABLISHED) { + const decrypted = await otrRoom.decrypt(message.msg); if (typeof decrypted === 'string') { return { ...message, msg: decrypted }; } @@ -59,13 +70,16 @@ Meteor.startup(() => { if (ts) message.ts = ts; if (message.otrAck) { - const otrAck = await instanceByRoomId.decrypt(message.otrAck); + const otrAck = await otrRoom.decrypt(message.otrAck); if (typeof otrAck === 'string') { return { ...message, msg: otrAck }; } - if (ack === otrAck.text) message.t = 'otr-ack'; + + if (ack === otrAck.text) { + return { ...message, _id, t: 'otr-ack', msg }; + } } else if (userId !== Meteor.userId()) { - const encryptedAck = await instanceByRoomId.encryptText(ack); + const encryptedAck = await otrRoom.encryptText(ack); void sdk.call('updateOTRAck', { message, ack: encryptedAck }); } diff --git a/apps/meteor/client/startup/startup.ts b/apps/meteor/client/startup/startup.ts index 6b2b66ec69d7..2541529a1aef 100644 --- a/apps/meteor/client/startup/startup.ts +++ b/apps/meteor/client/startup/startup.ts @@ -5,14 +5,11 @@ import { Session } from 'meteor/session'; import { Tracker } from 'meteor/tracker'; import moment from 'moment'; -import { hasPermission } from '../../app/authorization/client'; import { register } from '../../app/markdown/lib/hljs'; import { settings } from '../../app/settings/client'; import { getUserPreference } from '../../app/utils/client'; import 'hljs9/styles/github.css'; import { sdk } from '../../app/utils/client/lib/SDKClient'; -import { t } from '../../app/utils/lib/i18n'; -import * as banners from '../lib/banners'; import { synchronizeUserData, removeLocalUserData } from '../lib/userData'; import { fireGlobalEvent } from '../lib/utils/fireGlobalEvent'; @@ -60,31 +57,6 @@ Meteor.startup(() => { fireGlobalEvent('status-changed', status); } }); - - Tracker.autorun(async (c) => { - const uid = Meteor.userId(); - if (!uid) { - return; - } - - if (!hasPermission('manage-cloud')) { - return; - } - - const { - registrationStatus: { workspaceRegistered }, - } = await sdk.rest.get('/v1/cloud.registrationStatus'); - c.stop(); - - if (workspaceRegistered !== true) { - banners.open({ - id: 'cloud-registration', - title: () => t('Cloud_registration_pending_title'), - html: () => t('Cloud_registration_pending_html'), - modifiers: ['large', 'danger'], - }); - } - }); }); Meteor.startup(() => { Tracker.autorun(() => { diff --git a/apps/meteor/client/startup/unread.ts b/apps/meteor/client/startup/unread.ts index 6c076e4ba107..d9c2a35efab5 100644 --- a/apps/meteor/client/startup/unread.ts +++ b/apps/meteor/client/startup/unread.ts @@ -5,7 +5,6 @@ import { Session } from 'meteor/session'; import { Tracker } from 'meteor/tracker'; import { ChatSubscription, ChatRoom } from '../../app/models/client'; -import { settings } from '../../app/settings/client'; import { getUserPreference } from '../../app/utils/client'; import { fireGlobalEvent } from '../lib/utils/fireGlobalEvent'; @@ -78,13 +77,9 @@ Meteor.startup(() => { const updateFavicon = manageFavicon(); Tracker.autorun(() => { - const siteName = settings.get('Site_Name') ?? ''; - const unread = Session.get('unread'); fireGlobalEvent('unread-changed', unread); updateFavicon(unread); - - document.title = unread === '' ? siteName : `(${unread}) ${siteName}`; }); }); diff --git a/apps/meteor/client/startup/userRoles.ts b/apps/meteor/client/startup/userRoles.ts index a311148a6563..77ba6978d485 100644 --- a/apps/meteor/client/startup/userRoles.ts +++ b/apps/meteor/client/startup/userRoles.ts @@ -2,7 +2,6 @@ import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; import { UserRoles, ChatMessage } from '../../app/models/client'; -import { Notifications } from '../../app/notifications/client'; import { sdk } from '../../app/utils/client/lib/SDKClient'; import { dispatchToastMessage } from '../lib/toast'; @@ -20,7 +19,7 @@ Meteor.startup(() => { dispatchToastMessage({ type: 'error', message: error }); }); - Notifications.onLogged('roles-change', (role) => { + sdk.stream('notify-logged', ['roles-change'], (role) => { if (role.type === 'added') { if (!role.scope) { if (!role.u) { diff --git a/apps/meteor/client/uikit/hooks/useBannerContextValue.ts b/apps/meteor/client/uikit/hooks/useBannerContextValue.ts new file mode 100644 index 000000000000..35b38e8dee63 --- /dev/null +++ b/apps/meteor/client/uikit/hooks/useBannerContextValue.ts @@ -0,0 +1,46 @@ +import type { UiKitContext } from '@rocket.chat/fuselage-ui-kit'; +import type * as UiKit from '@rocket.chat/ui-kit'; +import { type ContextType } from 'react'; + +import { useUiKitActionManager } from './useUiKitActionManager'; + +type UseBannerContextValueParams = { + view: UiKit.BannerView; + values: { + [actionId: string]: { + value: unknown; + blockId?: string | undefined; + }; + }; +}; +type UseBannerContextValueReturn = ContextType; + +export const useBannerContextValue = ({ view, values }: UseBannerContextValueParams): UseBannerContextValueReturn => { + const actionManager = useUiKitActionManager(); + + return { + action: async ({ appId, viewId, actionId, blockId, value }) => { + if (!appId || !viewId) { + return; + } + + await actionManager.emitInteraction(appId, { + type: 'blockAction', + actionId, + container: { + type: 'view', + id: viewId, + }, + payload: { + blockId, + value, + }, + }); + + actionManager.disposeView(view.viewId); + }, + updateState: (): void => undefined, + appId: view.appId, + values, + }; +}; diff --git a/apps/meteor/client/uikit/hooks/useContextualBarContextValue.ts b/apps/meteor/client/uikit/hooks/useContextualBarContextValue.ts new file mode 100644 index 000000000000..1be1affad71f --- /dev/null +++ b/apps/meteor/client/uikit/hooks/useContextualBarContextValue.ts @@ -0,0 +1,71 @@ +import { useDebouncedCallback } from '@rocket.chat/fuselage-hooks'; +import type { UiKitContext } from '@rocket.chat/fuselage-ui-kit'; +import type * as UiKit from '@rocket.chat/ui-kit'; +import type { Dispatch } from 'react'; +import { useMemo, type ContextType } from 'react'; + +import { useUiKitActionManager } from './useUiKitActionManager'; + +type UseContextualBarContextValueParams = { + view: UiKit.ContextualBarView; + values: { + [actionId: string]: { + value: unknown; + blockId?: string | undefined; + }; + }; + updateValues: Dispatch<{ + actionId: string; + payload: { + value: unknown; + blockId?: string | undefined; + }; + }>; +}; +type UseContextualBarContextValueReturn = ContextType; + +export const useContextualBarContextValue = ({ + view, + values, + updateValues, +}: UseContextualBarContextValueParams): UseContextualBarContextValueReturn => { + const actionManager = useUiKitActionManager(); + + const emitInteraction = useMemo(() => actionManager.emitInteraction.bind(actionManager), [actionManager]); + const debouncedEmitInteraction = useDebouncedCallback(emitInteraction, 700); + + return { + action: async ({ appId, viewId, actionId, dispatchActionConfig, blockId, value }): Promise => { + if (!appId || !viewId) { + return; + } + + const emit = dispatchActionConfig?.includes('on_character_entered') ? debouncedEmitInteraction : emitInteraction; + + await emit(appId, { + type: 'blockAction', + actionId, + container: { + type: 'view', + id: viewId, + }, + payload: { + blockId, + value, + }, + }); + }, + updateState: ({ actionId, value, blockId = 'default' }) => { + updateValues({ + actionId, + payload: { + blockId, + value, + }, + }); + }, + ...view, + values, + viewId: view.id, + }; +}; diff --git a/apps/meteor/client/uikit/hooks/useMessageBlockContextValue.ts b/apps/meteor/client/uikit/hooks/useMessageBlockContextValue.ts new file mode 100644 index 000000000000..2f8fb4933628 --- /dev/null +++ b/apps/meteor/client/uikit/hooks/useMessageBlockContextValue.ts @@ -0,0 +1,74 @@ +import type { IRoom, IMessage } from '@rocket.chat/core-typings'; +import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; +import type { UiKitContext } from '@rocket.chat/fuselage-ui-kit'; +import type { ContextType } from 'react'; + +import { + useVideoConfDispatchOutgoing, + useVideoConfIsCalling, + useVideoConfIsRinging, + useVideoConfJoinCall, + useVideoConfManager, + useVideoConfSetPreferences, +} from '../../contexts/VideoConfContext'; +import { useVideoConfWarning } from '../../views/room/contextualBar/VideoConference/hooks/useVideoConfWarning'; +import { useUiKitActionManager } from './useUiKitActionManager'; + +export const useMessageBlockContextValue = (rid: IRoom['_id'], mid: IMessage['_id']): ContextType => { + const joinCall = useVideoConfJoinCall(); + const setPreferences = useVideoConfSetPreferences(); + const isCalling = useVideoConfIsCalling(); + const isRinging = useVideoConfIsRinging(); + const dispatchWarning = useVideoConfWarning(); + const dispatchPopup = useVideoConfDispatchOutgoing(); + + const videoConfManager = useVideoConfManager(); + + const handleOpenVideoConf = useMutableCallback(async (rid: IRoom['_id']) => { + if (isCalling || isRinging) { + return; + } + + try { + await videoConfManager?.loadCapabilities(); + dispatchPopup({ rid }); + } catch (error: any) { + dispatchWarning(error.error); + } + }); + + const actionManager = useUiKitActionManager(); + + return { + action: ({ appId, actionId, blockId, value }, event) => { + if (appId === 'videoconf-core') { + event.preventDefault(); + setPreferences({ mic: true, cam: false }); + if (actionId === 'join') { + return joinCall(blockId); + } + + if (actionId === 'callBack') { + return handleOpenVideoConf(blockId); + } + } + + actionManager.emitInteraction(appId, { + type: 'blockAction', + actionId, + payload: { + blockId, + value, + }, + container: { + type: 'message', + id: mid, + }, + rid, + mid, + }); + }, + rid, + values: {}, // TODO: this is a hack to make the context work, but it should be removed + }; +}; diff --git a/apps/meteor/client/uikit/hooks/useModalContextValue.ts b/apps/meteor/client/uikit/hooks/useModalContextValue.ts new file mode 100644 index 000000000000..e10a59902b6b --- /dev/null +++ b/apps/meteor/client/uikit/hooks/useModalContextValue.ts @@ -0,0 +1,68 @@ +import { useDebouncedCallback } from '@rocket.chat/fuselage-hooks'; +import type { UiKitContext } from '@rocket.chat/fuselage-ui-kit'; +import type * as UiKit from '@rocket.chat/ui-kit'; +import type { Dispatch } from 'react'; +import { useMemo, type ContextType } from 'react'; + +import { useUiKitActionManager } from './useUiKitActionManager'; + +type UseModalContextValueParams = { + view: UiKit.ModalView; + values: { + [actionId: string]: { + value: unknown; + blockId?: string | undefined; + }; + }; + updateValues: Dispatch<{ + actionId: string; + payload: { + value: unknown; + blockId?: string; + }; + }>; +}; + +type UseModalContextValueReturn = ContextType; + +export const useModalContextValue = ({ view, values, updateValues }: UseModalContextValueParams): UseModalContextValueReturn => { + const actionManager = useUiKitActionManager(); + + const emitInteraction = useMemo(() => actionManager.emitInteraction.bind(actionManager), [actionManager]); + const debouncedEmitInteraction = useDebouncedCallback(emitInteraction, 700); + + return { + action: async ({ actionId, viewId, appId, dispatchActionConfig, blockId, value }) => { + if (!appId || !viewId) { + return; + } + + const emit = dispatchActionConfig?.includes('on_character_entered') ? debouncedEmitInteraction : emitInteraction; + + await emit(appId, { + type: 'blockAction', + actionId, + container: { + type: 'view', + id: viewId, + }, + payload: { + blockId, + value, + }, + }); + }, + updateState: ({ actionId, value, /* ,appId, */ blockId = 'default' }) => { + updateValues({ + actionId, + payload: { + blockId, + value, + }, + }); + }, + ...view, + values, + viewId: view.id, + }; +}; diff --git a/apps/meteor/client/hooks/useUiKitActionManager.ts b/apps/meteor/client/uikit/hooks/useUiKitActionManager.ts similarity index 100% rename from apps/meteor/client/hooks/useUiKitActionManager.ts rename to apps/meteor/client/uikit/hooks/useUiKitActionManager.ts diff --git a/apps/meteor/client/uikit/hooks/useUiKitView.ts b/apps/meteor/client/uikit/hooks/useUiKitView.ts new file mode 100644 index 000000000000..d29b7ace93d6 --- /dev/null +++ b/apps/meteor/client/uikit/hooks/useUiKitView.ts @@ -0,0 +1,93 @@ +import { useSafely } from '@rocket.chat/fuselage-hooks'; +import { extractInitialStateFromLayout } from '@rocket.chat/fuselage-ui-kit'; +import type * as UiKit from '@rocket.chat/ui-kit'; +import type { Dispatch } from 'react'; +import { useEffect, useMemo, useReducer, useState } from 'react'; + +import { useUiKitActionManager } from './useUiKitActionManager'; + +const reduceValues = ( + values: { [actionId: string]: { value: unknown; blockId?: string } }, + { actionId, payload }: { actionId: string; payload: { value: unknown; blockId?: string } }, +): { [actionId: string]: { value: unknown; blockId?: string } } => ({ + ...values, + [actionId]: payload, +}); + +const getViewId = (view: UiKit.View): string => { + if ('id' in view && typeof view.id === 'string') { + return view.id; + } + + if ('viewId' in view && typeof view.viewId === 'string') { + return view.viewId; + } + + throw new Error('Invalid view'); +}; + +const getViewFromInteraction = (interaction: UiKit.ServerInteraction): UiKit.View | undefined => { + if ('view' in interaction && typeof interaction.view === 'object') { + return interaction.view; + } + + if (interaction.type === 'banner.open') { + return interaction; + } + + return undefined; +}; + +type UseUiKitViewReturnType = { + view: TView; + errors?: { [field: string]: string }[]; + values: { [actionId: string]: { value: unknown; blockId?: string } }; + updateValues: Dispatch<{ actionId: string; payload: { value: unknown; blockId?: string } }>; + state: { + [blockId: string]: { + [key: string]: unknown; + }; + }; +}; + +export function useUiKitView(initialView: S): UseUiKitViewReturnType { + const [errors, setErrors] = useSafely(useState<{ [field: string]: string }[] | undefined>()); + const [values, updateValues] = useSafely(useReducer(reduceValues, initialView.blocks, extractInitialStateFromLayout)); + const [view, updateView] = useSafely(useState(initialView)); + const actionManager = useUiKitActionManager(); + + const state = useMemo(() => { + return Object.entries(values).reduce<{ [blockId: string]: { [actionId: string]: unknown } }>((obj, [key, payload]) => { + if (!payload?.blockId) { + return obj; + } + + const { blockId, value } = payload; + obj[blockId] = obj[blockId] || {}; + obj[blockId][key] = value; + + return obj; + }, {}); + }, [values]); + + const viewId = getViewId(view); + + useEffect(() => { + const handleUpdate = (interaction: UiKit.ServerInteraction): void => { + if (interaction.type === 'errors') { + setErrors(interaction.errors); + return; + } + + updateView((view) => ({ ...view, ...getViewFromInteraction(interaction) })); + }; + + actionManager.on(viewId, handleUpdate); + + return (): void => { + actionManager.off(viewId, handleUpdate); + }; + }, [actionManager, setErrors, updateView, viewId]); + + return { view, errors, values, updateValues, state }; +} diff --git a/apps/meteor/client/views/account/accessibility/AccessibilityPage.tsx b/apps/meteor/client/views/account/accessibility/AccessibilityPage.tsx index 657548d5a1b9..9bb4e57317cf 100644 --- a/apps/meteor/client/views/account/accessibility/AccessibilityPage.tsx +++ b/apps/meteor/client/views/account/accessibility/AccessibilityPage.tsx @@ -1,7 +1,6 @@ import { css } from '@rocket.chat/css-in-js'; import type { SelectOption } from '@rocket.chat/fuselage'; import { - Icon, FieldDescription, Accordion, Box, @@ -14,20 +13,17 @@ import { FieldRow, RadioButton, Select, - Tag, ToggleSwitch, } from '@rocket.chat/fuselage'; -import { useLocalStorage, useUniqueId } from '@rocket.chat/fuselage-hooks'; -import { useSetModal, useTranslation, useToastMessageDispatch, useEndpoint, useSetting } from '@rocket.chat/ui-contexts'; +import { useUniqueId } from '@rocket.chat/fuselage-hooks'; +import { ExternalLink } from '@rocket.chat/ui-client'; +import { useTranslation, useToastMessageDispatch, useEndpoint, useSetting } from '@rocket.chat/ui-contexts'; import { useMutation } from '@tanstack/react-query'; import React, { useMemo } from 'react'; import { Controller, useForm } from 'react-hook-form'; -import Page from '../../../components/Page'; -import { useIsEnterprise } from '../../../hooks/useIsEnterprise'; +import { Page, PageHeader, PageScrollableContentWithShadow, PageFooter } from '../../../components/Page'; import { getDirtyFields } from '../../../lib/getDirtyFields'; -import HighContrastUpsellModal from './HighContrastUpsellModal'; -import MentionsWithSymbolUpsellModal from './MentionsWithSymbolUpsellModal'; import { fontSizes } from './fontSizes'; import type { AccessibilityPreferencesData } from './hooks/useAcessibilityPreferencesValues'; import { useAccessiblityPreferencesValues } from './hooks/useAcessibilityPreferencesValues'; @@ -36,14 +32,9 @@ import { themeItems as themes } from './themeItems'; const AccessibilityPage = () => { const t = useTranslation(); - const setModal = useSetModal(); const dispatchToastMessage = useToastMessageDispatch(); const preferencesValues = useAccessiblityPreferencesValues(); - const { data: license } = useIsEnterprise(); - const isEnterprise = license?.isEnterprise; - const { themeAppearence } = preferencesValues; - const [, setPrevTheme] = useLocalStorage('prevTheme', themeAppearence); const createFontStyleElement = useCreateFontStyleElement(); const displayRolesEnabled = useSetting('UI_DisplayRoles'); @@ -56,14 +47,16 @@ const AccessibilityPage = () => { [t], ); + const pageFormId = useUniqueId(); const fontSizeId = useUniqueId(); const mentionsWithSymbolId = useUniqueId(); const clockModeId = useUniqueId(); const hideUsernamesId = useUniqueId(); const hideRolesId = useUniqueId(); + const linkListId = useUniqueId(); const { - formState: { isDirty, dirtyFields }, + formState: { isDirty, dirtyFields, isSubmitting }, handleSubmit, control, reset, @@ -82,7 +75,6 @@ const AccessibilityPage = () => { onError: (error) => dispatchToastMessage({ type: 'error', message: error }), onSettled: (_data, _error, { data: { fontSize } }) => { reset(currentData); - dirtyFields.themeAppearence && setPrevTheme(themeAppearence); dirtyFields.fontSize && fontSize && createFontStyleElement(fontSize); }, }); @@ -94,53 +86,47 @@ const AccessibilityPage = () => { return ( - - - + + + - {t('Accessibility_activation')} + + {t('Accessibility_activation')} + +

{t('Learn_more_about_accessibility')}

+
    +
  • + {t('Accessibility_statement')} +
  • +
  • + {t('Glossary_of_simplified_terms')} +
  • +
  • + + {t('Accessibility_feature_documentation')} + +
  • +
- {themes.map(({ id, title, description, ...item }, index) => { - const showCommunityUpsellTriggers = 'isEEOnly' in item && item.isEEOnly && !isEnterprise; - + {themes.map(({ id, title, description }, index) => { return ( - + - {t.has(title) ? t(title) : title} - {showCommunityUpsellTriggers && ( - - - - {t('Enterprise')} - - - )} + {t(title)} - - { - if (showCommunityUpsellTriggers) { - return ( - setModal( setModal(null)} />)} - checked={false} - /> - ); - } - return onChange(id)} checked={value === id} />; - }} - /> - - + ( + onChange(id)} checked={value === id} /> + )} + /> + - {t.has(description) ? t(description) : description} + {t(description)} ); @@ -164,35 +150,16 @@ const AccessibilityPage = () => { {t('Adjustable_font_size_description')} - - - {t('Mentions_with_@_symbol')} - {!isEnterprise && ( - - - - {t('Enterprise')} - - - )} - - - {isEnterprise ? ( - ( - - )} - /> - ) : ( - setModal( setModal(null)} />)} - checked={false} - /> + + {t('Mentions_with_@_symbol')} + ( + )} - - + /> + { - + {t('Show_usernames')} + ( + onChange(!(e.target as HTMLInputElement).checked)} + /> + )} + /> + + {t('Show_or_hide_the_username_of_message_authors')} + + {displayRolesEnabled && ( + + {t('Show_roles')} ( onChange(!(e.target as HTMLInputElement).checked)} @@ -231,28 +216,6 @@ const AccessibilityPage = () => { )} /> -
- {t('Show_or_hide_the_username_of_message_authors')} - - {displayRolesEnabled && ( - - - {t('Show_roles')} - - ( - onChange(!(e.target as HTMLInputElement).checked)} - /> - )} - /> - - {t('Show_or_hide_the_user_roles_of_message_authors')} )} @@ -260,15 +223,15 @@ const AccessibilityPage = () => {
-
- + + - - +
); }; diff --git a/apps/meteor/client/views/account/accessibility/HighContrastUpsellModal.tsx b/apps/meteor/client/views/account/accessibility/HighContrastUpsellModal.tsx deleted file mode 100644 index bcb28ea587d1..000000000000 --- a/apps/meteor/client/views/account/accessibility/HighContrastUpsellModal.tsx +++ /dev/null @@ -1,41 +0,0 @@ -import { useRole, useTranslation } from '@rocket.chat/ui-contexts'; -import React from 'react'; - -import GenericUpsellModal from '../../../components/GenericUpsellModal'; -import { useUpsellActions } from '../../../components/GenericUpsellModal/hooks'; - -const HighContrastUpsellModal = ({ onClose }: { onClose: () => void }) => { - const t = useTranslation(); - - const isAdmin = useRole('admin'); - const { handleGoFullyFeatured, handleTalkToSales } = useUpsellActions(); - - if (!isAdmin) { - return ( - - ); - } - return ( - - ); -}; -export default HighContrastUpsellModal; diff --git a/apps/meteor/client/views/account/accessibility/MentionsWithSymbolUpsellModal.tsx b/apps/meteor/client/views/account/accessibility/MentionsWithSymbolUpsellModal.tsx deleted file mode 100644 index b92ca74d0f6e..000000000000 --- a/apps/meteor/client/views/account/accessibility/MentionsWithSymbolUpsellModal.tsx +++ /dev/null @@ -1,40 +0,0 @@ -import { useRole, useTranslation } from '@rocket.chat/ui-contexts'; -import React from 'react'; - -import GenericUpsellModal from '../../../components/GenericUpsellModal'; -import { useUpsellActions } from '../../../components/GenericUpsellModal/hooks'; - -const MentionsWithSymbolUpsellModal = ({ onClose }: { onClose: () => void }) => { - const t = useTranslation(); - - const isAdmin = useRole('admin'); - const { handleGoFullyFeatured, handleTalkToSales } = useUpsellActions(); - - if (!isAdmin) { - return ( - - ); - } - return ( - - ); -}; -export default MentionsWithSymbolUpsellModal; diff --git a/apps/meteor/client/views/account/accessibility/themeItems.ts b/apps/meteor/client/views/account/accessibility/themeItems.ts index 62bf3830d952..f16d9128503d 100644 --- a/apps/meteor/client/views/account/accessibility/themeItems.ts +++ b/apps/meteor/client/views/account/accessibility/themeItems.ts @@ -1,4 +1,11 @@ -export const themeItems = [ +import type { TranslationKey } from '@rocket.chat/ui-contexts'; + +type ThemeItem = { + id: string; + title: TranslationKey; + description: TranslationKey; +}; +export const themeItems: ThemeItem[] = [ { id: 'light', title: 'Theme_light', @@ -10,7 +17,6 @@ export const themeItems = [ description: 'Theme_dark_description', }, { - isEEOnly: true, id: 'high-contrast', title: 'Theme_high_contrast', description: 'Theme_high_contrast_description', diff --git a/apps/meteor/client/views/account/featurePreview/AccountFeaturePreviewPage.tsx b/apps/meteor/client/views/account/featurePreview/AccountFeaturePreviewPage.tsx index 29b2a796953e..c8cd7138e5a6 100644 --- a/apps/meteor/client/views/account/featurePreview/AccountFeaturePreviewPage.tsx +++ b/apps/meteor/client/views/account/featurePreview/AccountFeaturePreviewPage.tsx @@ -22,7 +22,7 @@ import type { ChangeEvent } from 'react'; import React, { useEffect, Fragment } from 'react'; import { useForm } from 'react-hook-form'; -import Page from '../../../components/Page'; +import { Page, PageHeader, PageScrollableContentWithShadow, PageFooter } from '../../../components/Page'; const AccountFeaturePreviewPage = () => { const t = useTranslation(); @@ -79,8 +79,8 @@ const AccountFeaturePreviewPage = () => { return ( - - + + {featuresPreview.length === 0 && ( @@ -106,12 +106,10 @@ const AccountFeaturePreviewPage = () => { {features.map((feature) => ( - + {t(feature.i18n)} - - - - + + {feature.description && {t(feature.description)}} {feature.imageUrl && } @@ -124,15 +122,15 @@ const AccountFeaturePreviewPage = () => { )} - - + + - + ); }; diff --git a/apps/meteor/client/views/account/integrations/AccountIntegrationsPage.tsx b/apps/meteor/client/views/account/integrations/AccountIntegrationsPage.tsx index 54806d879aa1..2c11b7a384cd 100644 --- a/apps/meteor/client/views/account/integrations/AccountIntegrationsPage.tsx +++ b/apps/meteor/client/views/account/integrations/AccountIntegrationsPage.tsx @@ -1,49 +1,54 @@ -import type { IWebdavAccountIntegration } from '@rocket.chat/core-typings'; import type { SelectOption } from '@rocket.chat/fuselage'; import { SelectLegacy, Box, Button, Field, FieldLabel, FieldRow } from '@rocket.chat/fuselage'; -import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; -import { useEndpoint, useToastMessageDispatch, useTranslation } from '@rocket.chat/ui-contexts'; -import type { ReactElement } from 'react'; +import { useEffectEvent } from '@rocket.chat/fuselage-hooks'; +import { useToastMessageDispatch, useTranslation } from '@rocket.chat/ui-contexts'; import React, { useMemo } from 'react'; import { useForm, Controller } from 'react-hook-form'; -import { WebdavAccounts } from '../../../../app/models/client'; -import Page from '../../../components/Page'; -import { useReactiveValue } from '../../../hooks/useReactiveValue'; +import { Page, PageHeader, PageScrollableContentWithShadow } from '../../../components/Page'; +import { useWebDAVAccountIntegrationsQuery } from '../../../hooks/webdav/useWebDAVAccountIntegrationsQuery'; import { getWebdavServerName } from '../../../lib/getWebdavServerName'; +import { useRemoveWebDAVAccountIntegrationMutation } from './hooks/useRemoveWebDAVAccountIntegrationMutation'; -const getWebdavAccounts = (): IWebdavAccountIntegration[] => WebdavAccounts.find().fetch(); +const AccountIntegrationsPage = () => { + const { data: webdavAccountIntegrations } = useWebDAVAccountIntegrationsQuery(); -const AccountIntegrationsPage = (): ReactElement => { - const t = useTranslation(); - const { handleSubmit, control } = useForm(); - const dispatchToastMessage = useToastMessageDispatch(); - const accounts = useReactiveValue(getWebdavAccounts); - const removeWebdavAccount = useEndpoint('POST', '/v1/webdav.removeWebdavAccount'); + const { handleSubmit, control } = useForm<{ accountSelected: string }>(); + + const options: SelectOption[] = useMemo( + () => webdavAccountIntegrations?.map(({ _id, ...current }) => [_id, getWebdavServerName(current)]) ?? [], + [webdavAccountIntegrations], + ); - const options: SelectOption[] = useMemo(() => accounts?.map(({ _id, ...current }) => [_id, getWebdavServerName(current)]), [accounts]); + const dispatchToastMessage = useToastMessageDispatch(); + const t = useTranslation(); - const handleClickRemove = useMutableCallback(({ accountSelected }) => { - try { - removeWebdavAccount({ accountId: accountSelected }); + const removeMutation = useRemoveWebDAVAccountIntegrationMutation({ + onSuccess: () => { dispatchToastMessage({ type: 'success', message: t('Webdav_account_removed') }); - } catch (error) { - dispatchToastMessage({ type: 'error', message: error as Error }); - } + }, + onError: (error) => { + dispatchToastMessage({ type: 'error', message: error }); + }, + }); + + const handleSubmitForm = useEffectEvent(({ accountSelected }) => { + removeMutation.mutate({ accountSelected }); }); return ( - - - + + + {t('WebDAV_Accounts')} ( + rules={{ required: true }} + render={({ field: { onChange, value, name, ref } }) => ( { /> )} /> - - + ); }; diff --git a/apps/meteor/client/views/account/integrations/AccountIntegrationsRoute.tsx b/apps/meteor/client/views/account/integrations/AccountIntegrationsRoute.tsx index ba16360b3d36..00121c688345 100644 --- a/apps/meteor/client/views/account/integrations/AccountIntegrationsRoute.tsx +++ b/apps/meteor/client/views/account/integrations/AccountIntegrationsRoute.tsx @@ -6,7 +6,7 @@ import NotAuthorizedPage from '../../notAuthorized/NotAuthorizedPage'; import AccountIntegrationsPage from './AccountIntegrationsPage'; const AccountIntegrationsRoute = (): ReactElement => { - const webdavEnabled = useSetting('Webdav_Integration_Enabled'); + const webdavEnabled = useSetting('Webdav_Integration_Enabled', false); if (!webdavEnabled) { return ; diff --git a/apps/meteor/client/views/account/integrations/hooks/useRemoveWebDAVAccountIntegrationMutation.tsx b/apps/meteor/client/views/account/integrations/hooks/useRemoveWebDAVAccountIntegrationMutation.tsx new file mode 100644 index 000000000000..d0eb6b6f2a12 --- /dev/null +++ b/apps/meteor/client/views/account/integrations/hooks/useRemoveWebDAVAccountIntegrationMutation.tsx @@ -0,0 +1,16 @@ +import { useEndpoint } from '@rocket.chat/ui-contexts'; +import type { UseMutationOptions } from '@tanstack/react-query'; +import { useMutation } from '@tanstack/react-query'; + +type UseRemoveWebDAVAccountIntegrationMutationOptions = Omit, 'mutationFn'>; + +export const useRemoveWebDAVAccountIntegrationMutation = (options?: UseRemoveWebDAVAccountIntegrationMutationOptions) => { + const removeWebdavAccount = useEndpoint('POST', '/v1/webdav.removeWebdavAccount'); + + return useMutation({ + mutationFn: async ({ accountSelected }: { accountSelected: string }) => { + await removeWebdavAccount({ accountId: accountSelected }); + }, + ...options, + }); +}; diff --git a/apps/meteor/client/views/account/omnichannel/OmnichannelPreferencesPage.tsx b/apps/meteor/client/views/account/omnichannel/OmnichannelPreferencesPage.tsx index 515446a154f6..9abec01df1d0 100644 --- a/apps/meteor/client/views/account/omnichannel/OmnichannelPreferencesPage.tsx +++ b/apps/meteor/client/views/account/omnichannel/OmnichannelPreferencesPage.tsx @@ -4,8 +4,9 @@ import type { ReactElement } from 'react'; import React from 'react'; import { useForm, FormProvider } from 'react-hook-form'; -import Page from '../../../components/Page'; +import { Page, PageHeader, PageScrollableContentWithShadow, PageFooter } from '../../../components/Page'; import PreferencesConversationTranscript from './PreferencesConversationTranscript'; +import { PreferencesGeneral } from './PreferencesGeneral'; type FormData = { omnichannelTranscriptPDF: boolean; @@ -18,9 +19,10 @@ const OmnichannelPreferencesPage = (): ReactElement => { const omnichannelTranscriptPDF = useUserPreference('omnichannelTranscriptPDF') ?? false; const omnichannelTranscriptEmail = useUserPreference('omnichannelTranscriptEmail') ?? false; + const omnichannelHideConversationAfterClosing = useUserPreference('omnichannelHideConversationAfterClosing') ?? true; const methods = useForm({ - defaultValues: { omnichannelTranscriptPDF, omnichannelTranscriptEmail }, + defaultValues: { omnichannelTranscriptPDF, omnichannelTranscriptEmail, omnichannelHideConversationAfterClosing }, }); const { @@ -43,24 +45,25 @@ const OmnichannelPreferencesPage = (): ReactElement => { return ( - - + + + - - + + - + ); }; diff --git a/apps/meteor/client/views/account/omnichannel/PreferencesConversationTranscript.tsx b/apps/meteor/client/views/account/omnichannel/PreferencesConversationTranscript.tsx index 9fccaef4593e..8cf34b6a56d4 100644 --- a/apps/meteor/client/views/account/omnichannel/PreferencesConversationTranscript.tsx +++ b/apps/meteor/client/views/account/omnichannel/PreferencesConversationTranscript.tsx @@ -23,24 +23,22 @@ const PreferencesConversationTranscript = () => { - + {t('Omnichannel_transcript_pdf')} - {!hasLicense && {t('Enterprise')}} + {!hasLicense && {t('Premium')}} {!canSendTranscriptPDF && hasLicense && {t('No_permission')}} - - - - + + {t('Accounts_Default_User_Preferences_omnichannelTranscriptPDF_Description')} - + {t('Omnichannel_transcript_email')} @@ -51,14 +49,8 @@ const PreferencesConversationTranscript = () => { )} - - - - + + {t('Accounts_Default_User_Preferences_omnichannelTranscriptEmail_Description')} diff --git a/apps/meteor/client/views/account/omnichannel/PreferencesGeneral.tsx b/apps/meteor/client/views/account/omnichannel/PreferencesGeneral.tsx new file mode 100644 index 000000000000..2f58ed305be4 --- /dev/null +++ b/apps/meteor/client/views/account/omnichannel/PreferencesGeneral.tsx @@ -0,0 +1,24 @@ +import { Field, FieldGroup, FieldHint, FieldLabel, FieldRow, ToggleSwitch } from '@rocket.chat/fuselage'; +import { useUniqueId } from '@rocket.chat/fuselage-hooks'; +import { useTranslation } from '@rocket.chat/ui-contexts'; +import type { ReactElement } from 'react'; +import React from 'react'; +import { useFormContext } from 'react-hook-form'; + +export const PreferencesGeneral = (): ReactElement => { + const t = useTranslation(); + const { register } = useFormContext(); + const omnichannelHideAfterClosing = useUniqueId(); + + return ( + + + + {t('Omnichannel_hide_conversation_after_closing')} + + + {t('Omnichannel_hide_conversation_after_closing_description')} + + + ); +}; diff --git a/apps/meteor/client/views/account/preferences/AccountPreferencesPage.tsx b/apps/meteor/client/views/account/preferences/AccountPreferencesPage.tsx index e3b18cabe759..77997422a21e 100644 --- a/apps/meteor/client/views/account/preferences/AccountPreferencesPage.tsx +++ b/apps/meteor/client/views/account/preferences/AccountPreferencesPage.tsx @@ -6,7 +6,7 @@ import type { ReactElement } from 'react'; import React from 'react'; import { FormProvider, useForm } from 'react-hook-form'; -import Page from '../../../components/Page'; +import { Page, PageHeader, PageScrollableContentWithShadow, PageFooter } from '../../../components/Page'; import { getDirtyFields } from '../../../lib/getDirtyFields'; import PreferencesGlobalSection from './PreferencesGlobalSection'; import PreferencesHighlightsSection from './PreferencesHighlightsSection'; @@ -75,8 +75,8 @@ const AccountPreferencesPage = (): ReactElement => { return ( - - + + @@ -91,15 +91,15 @@ const AccountPreferencesPage = (): ReactElement => { - - + + - + ); }; diff --git a/apps/meteor/client/views/account/preferences/PreferencesMessagesSection.tsx b/apps/meteor/client/views/account/preferences/PreferencesMessagesSection.tsx index 3edfabf23ac5..b8b4366cf4ff 100644 --- a/apps/meteor/client/views/account/preferences/PreferencesMessagesSection.tsx +++ b/apps/meteor/client/views/account/preferences/PreferencesMessagesSection.tsx @@ -1,5 +1,5 @@ import type { SelectOption } from '@rocket.chat/fuselage'; -import { FieldRow, FieldLink, FieldHint, FieldLabel, Accordion, Field, Select, FieldGroup, ToggleSwitch, Box } from '@rocket.chat/fuselage'; +import { FieldRow, FieldLink, FieldHint, FieldLabel, Accordion, Field, Select, FieldGroup, ToggleSwitch } from '@rocket.chat/fuselage'; import { useUniqueId } from '@rocket.chat/fuselage-hooks'; import { useTranslation } from '@rocket.chat/ui-contexts'; import React, { useMemo } from 'react'; @@ -43,38 +43,34 @@ const PreferencesMessagesSection = () => { - + {t('Unread_Tray_Icon_Alert')} - - ( - - )} - /> - - + ( + + )} + /> + - + {t('Always_show_thread_replies_in_main_channel')} - - ( - - )} - /> - - + ( + + )} + /> + {t('Accounts_Default_User_Preferences_showThreadsInMainChannel_Description')} @@ -105,74 +101,64 @@ const PreferencesMessagesSection = () => { {t('Go_to_accessibility_and_appearance')} - + {t('Use_Emojis')} - - ( - - )} - /> - - + ( + + )} + /> + - + {t('Convert_Ascii_Emojis')} - - ( - - )} - /> - - + ( + + )} + /> + - + {t('Auto_Load_Images')} - - ( - - )} - /> - - + ( + + )} + /> + - + {t('Save_Mobile_Bandwidth')} - - ( - - )} - /> - - + ( + + )} + /> + - + {t('Collapse_Embedded_Media_By_Default')} - - ( - - )} - /> - - + ( + + )} + /> + {t('Hide_usernames')} @@ -183,32 +169,28 @@ const PreferencesMessagesSection = () => { {t('Go_to_accessibility_and_appearance')} - + {t('Hide_flextab')} - - ( - - )} - /> - - + ( + + )} + /> + - + {t('Display_avatars')} - - ( - - )} - /> - - + ( + + )} + /> + {t('Enter_Behaviour')} diff --git a/apps/meteor/client/views/account/preferences/PreferencesMyDataSection.tsx b/apps/meteor/client/views/account/preferences/PreferencesMyDataSection.tsx index 0b82d7441323..5fd4540b5e57 100644 --- a/apps/meteor/client/views/account/preferences/PreferencesMyDataSection.tsx +++ b/apps/meteor/client/views/account/preferences/PreferencesMyDataSection.tsx @@ -1,4 +1,4 @@ -import { Accordion, Field, FieldGroup, FieldRow, ButtonGroup, Button, Box } from '@rocket.chat/fuselage'; +import { Accordion, ButtonGroup, Button, Box } from '@rocket.chat/fuselage'; import { useSetModal, useToastMessageDispatch, useMethod, useTranslation } from '@rocket.chat/ui-contexts'; import React, { useCallback } from 'react'; @@ -75,20 +75,14 @@ const PreferencesMyDataSection = () => { return ( - - - - - - - - - - + + + + ); }; diff --git a/apps/meteor/client/views/account/preferences/PreferencesNotificationsSection.tsx b/apps/meteor/client/views/account/preferences/PreferencesNotificationsSection.tsx index 2643eab0ebc7..ddac7fda145b 100644 --- a/apps/meteor/client/views/account/preferences/PreferencesNotificationsSection.tsx +++ b/apps/meteor/client/views/account/preferences/PreferencesNotificationsSection.tsx @@ -1,5 +1,6 @@ +import type { INotificationDesktop } from '@rocket.chat/core-typings'; import type { SelectOption } from '@rocket.chat/fuselage'; -import { Accordion, Field, FieldLabel, FieldRow, FieldHint, Select, FieldGroup, ToggleSwitch, Button, Box } from '@rocket.chat/fuselage'; +import { Accordion, Field, FieldLabel, FieldRow, FieldHint, Select, FieldGroup, ToggleSwitch, Button } from '@rocket.chat/fuselage'; import { useUniqueId } from '@rocket.chat/fuselage-hooks'; import type { TranslationKey } from '@rocket.chat/ui-contexts'; import { useUserPreference, useSetting, useTranslation } from '@rocket.chat/ui-contexts'; @@ -45,7 +46,7 @@ const PreferencesNotificationsSection = () => { const onSendNotification = useCallback(() => { KonchatNotification.notify({ - payload: { sender: { _id: 'rocket.cat', username: 'rocket.cat' } }, + payload: { sender: { _id: 'rocket.cat', username: 'rocket.cat' }, rid: 'GENERAL' } as INotificationDesktop['payload'], title: t('Desktop_Notification_Test'), text: t('This_is_a_desktop_notification'), }); @@ -112,24 +113,22 @@ const PreferencesNotificationsSection = () => { - + {t('Notification_RequireInteraction')} - - ( - - )} - /> - - + ( + + )} + /> + {t('Only_works_with_chrome_version_greater_50')} @@ -181,57 +180,51 @@ const PreferencesNotificationsSection = () => { {showNewLoginEmailPreference && ( - + {t('Receive_Login_Detection_Emails')} - - ( - - )} - /> - - + ( + + )} + /> + {t('Receive_Login_Detection_Emails_Description')} )} {showCalendarPreference && ( - + {t('Notify_Calendar_Events')} - - ( - - )} - /> - - + ( + + )} + /> + )} {showMobileRinging && ( - + {t('VideoConf_Mobile_Ringing')} - - ( - - )} - /> - - + ( + + )} + /> + )} diff --git a/apps/meteor/client/views/account/preferences/PreferencesSoundSection.tsx b/apps/meteor/client/views/account/preferences/PreferencesSoundSection.tsx index 223d67fd7f95..8306e2941b00 100644 --- a/apps/meteor/client/views/account/preferences/PreferencesSoundSection.tsx +++ b/apps/meteor/client/views/account/preferences/PreferencesSoundSection.tsx @@ -62,9 +62,9 @@ const PreferencesSoundSection = () => { /> - - {t('Mute_Focused_Conversations')} + + {t('Mute_Focused_Conversations')} { - + {t('Enable_Auto_Away')} - - ( - - )} - /> - - + ( + + )} + /> + {t('Idle_Time_Limit')} diff --git a/apps/meteor/client/views/account/preferences/useAccountPreferencesValues.ts b/apps/meteor/client/views/account/preferences/useAccountPreferencesValues.ts index b99a2a6c1ebe..a85ef275638e 100644 --- a/apps/meteor/client/views/account/preferences/useAccountPreferencesValues.ts +++ b/apps/meteor/client/views/account/preferences/useAccountPreferencesValues.ts @@ -39,7 +39,7 @@ export type AccountPreferencesData = { }; export const useAccountPreferencesValues = (): AccountPreferencesData => { - const language = useUserPreference('language'); + const language = useUserPreference('language') || ''; const userDontAskAgainList = useUserPreference<{ action: string; label: string }[]>('dontAskAgainList') || []; const dontAskAgainList = userDontAskAgainList.map(({ action }) => action); const enableAutoAway = useUserPreference('enableAutoAway'); diff --git a/apps/meteor/client/views/account/profile/AccountProfileForm.tsx b/apps/meteor/client/views/account/profile/AccountProfileForm.tsx index ed97b95caae8..0de462cd5bd3 100644 --- a/apps/meteor/client/views/account/profile/AccountProfileForm.tsx +++ b/apps/meteor/client/views/account/profile/AccountProfileForm.tsx @@ -60,12 +60,14 @@ const AccountProfileForm = (props: AllHTMLAttributes): ReactEle control, watch, handleSubmit, + reset, formState: { errors }, } = useFormContext(); const { email, avatar, username } = watch(); const previousEmail = user ? getUserEmailAddress(user) : ''; + const previousUsername = user?.username || ''; const isUserVerified = user?.emails?.[0]?.verified ?? false; const mutateConfirmationEmail = useMutation({ @@ -87,6 +89,10 @@ const AccountProfileForm = (props: AllHTMLAttributes): ReactEle return; } + if (username === previousUsername) { + return; + } + if (!namesRegex.test(username)) { return t('error-invalid-username'); } @@ -121,6 +127,8 @@ const AccountProfileForm = (props: AllHTMLAttributes): ReactEle dispatchToastMessage({ type: 'success', message: t('Profile_saved_successfully') }); } catch (error) { dispatchToastMessage({ type: 'error', message: error }); + } finally { + reset({ email, name, username, statusType, statusText, nickname, bio, customFields }); } }; diff --git a/apps/meteor/client/views/account/profile/AccountProfilePage.tsx b/apps/meteor/client/views/account/profile/AccountProfilePage.tsx index ba74c9a8f1ff..df1710b07509 100644 --- a/apps/meteor/client/views/account/profile/AccountProfilePage.tsx +++ b/apps/meteor/client/views/account/profile/AccountProfilePage.tsx @@ -16,7 +16,7 @@ import React, { useState, useCallback } from 'react'; import { FormProvider, useForm } from 'react-hook-form'; import ConfirmOwnerChangeModal from '../../../components/ConfirmOwnerChangeModal'; -import Page from '../../../components/Page'; +import { Page, PageFooter, PageHeader, PageScrollableContentWithShadow } from '../../../components/Page'; import { useAllowPasswordChange } from '../security/useAllowPasswordChange'; import AccountProfileForm from './AccountProfileForm'; import ActionConfirmModal from './ActionConfirmModal'; @@ -43,7 +43,7 @@ const AccountProfilePage = (): ReactElement => { const { reset, - formState: { isDirty }, + formState: { isDirty, isSubmitting }, } = methods; const logoutOtherClients = useEndpoint('POST', '/v1/users.logoutOtherClients'); @@ -113,34 +113,43 @@ const AccountProfilePage = (): ReactElement => { return ( - - + + - - - {allowDeleteOwnAccount && ( - - )} - + {allowDeleteOwnAccount && ( + + )} + + - - + + - - + ); }; diff --git a/apps/meteor/client/views/account/security/AccountSecurityPage.tsx b/apps/meteor/client/views/account/security/AccountSecurityPage.tsx index 1c1023e0a7e3..49ed9594c110 100644 --- a/apps/meteor/client/views/account/security/AccountSecurityPage.tsx +++ b/apps/meteor/client/views/account/security/AccountSecurityPage.tsx @@ -5,7 +5,7 @@ import type { ReactElement } from 'react'; import React from 'react'; import { FormProvider, useForm } from 'react-hook-form'; -import Page from '../../../components/Page'; +import { Page, PageHeader, PageScrollableContentWithShadow, PageFooter } from '../../../components/Page'; import NotAuthorizedPage from '../../notAuthorized/NotAuthorizedPage'; import ChangePassword from './ChangePassword'; import EndToEnd from './EndToEnd'; @@ -39,8 +39,8 @@ const AccountSecurityPage = (): ReactElement => { return ( - - + + @@ -68,15 +68,15 @@ const AccountSecurityPage = (): ReactElement => { )} - - + + - + ); }; diff --git a/apps/meteor/client/views/account/security/TwoFactorTOTP.tsx b/apps/meteor/client/views/account/security/TwoFactorTOTP.tsx index 30cc87861838..a00a64ee991b 100644 --- a/apps/meteor/client/views/account/security/TwoFactorTOTP.tsx +++ b/apps/meteor/client/views/account/security/TwoFactorTOTP.tsx @@ -1,6 +1,6 @@ import { Box, Button, TextInput, Margins } from '@rocket.chat/fuselage'; import { useSafely } from '@rocket.chat/fuselage-hooks'; -import { useSetModal, useToastMessageDispatch, useUser, useMethod, useTranslation, useEndpoint } from '@rocket.chat/ui-contexts'; +import { useSetModal, useToastMessageDispatch, useUser, useMethod, useTranslation } from '@rocket.chat/ui-contexts'; import type { ReactElement, ComponentProps } from 'react'; import React, { useState, useCallback, useEffect } from 'react'; import { useForm } from 'react-hook-form'; @@ -16,7 +16,6 @@ const TwoFactorTOTP = (props: ComponentProps): ReactElement => { const user = useUser(); const setModal = useSetModal(); - const logoutOtherSessions = useEndpoint('POST', '/v1/users.logoutOtherClients'); const enableTotpFn = useMethod('2fa:enable'); const disableTotpFn = useMethod('2fa:disable'); const verifyCodeFn = useMethod('2fa:validateTempToken'); @@ -86,13 +85,12 @@ const TwoFactorTOTP = (props: ComponentProps): ReactElement => { return dispatchToastMessage({ type: 'error', message: t('Invalid_two_factor_code') }); } - logoutOtherSessions(); setModal(); } catch (error) { dispatchToastMessage({ type: 'error', message: error }); } }, - [closeModal, dispatchToastMessage, logoutOtherSessions, setModal, t, verifyCodeFn], + [closeModal, dispatchToastMessage, setModal, t, verifyCodeFn], ); const handleRegenerateCodes = useCallback(() => { @@ -115,7 +113,7 @@ const TwoFactorTOTP = (props: ComponentProps): ReactElement => { return ( - {t('Two-factor_authentication')} + {t('Two-factor_authentication_via_TOTP')} {!totpEnabled && !registeringTotp && ( <> {t('Two-factor_authentication_is_currently_disabled')} diff --git a/apps/meteor/client/views/account/tokens/AccountTokensPage.tsx b/apps/meteor/client/views/account/tokens/AccountTokensPage.tsx index 5e7c46631cf8..9885b0bd3b86 100644 --- a/apps/meteor/client/views/account/tokens/AccountTokensPage.tsx +++ b/apps/meteor/client/views/account/tokens/AccountTokensPage.tsx @@ -2,7 +2,7 @@ import { useTranslation } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; import React from 'react'; -import Page from '../../../components/Page'; +import { Page, PageHeader, PageContent } from '../../../components/Page'; import AccountTokensTable from './AccountTokensTable'; const AccountTokensPage = (): ReactElement => { @@ -10,10 +10,10 @@ const AccountTokensPage = (): ReactElement => { return ( - - + + - + ); }; diff --git a/apps/meteor/client/views/account/tokens/AccountTokensTable/AddToken.tsx b/apps/meteor/client/views/account/tokens/AccountTokensTable/AddToken.tsx index 97d2a8163cab..71fd2933f431 100644 --- a/apps/meteor/client/views/account/tokens/AccountTokensTable/AddToken.tsx +++ b/apps/meteor/client/views/account/tokens/AccountTokensTable/AddToken.tsx @@ -1,33 +1,41 @@ -import { Box, TextInput, Button, Field, FieldGroup, FieldLabel, FieldRow, Margins, CheckBox } from '@rocket.chat/fuselage'; -import { useUniqueId } from '@rocket.chat/fuselage-hooks'; +import type { SelectOption } from '@rocket.chat/fuselage'; +import { Box, TextInput, Button, Margins, Select } from '@rocket.chat/fuselage'; import { useSetModal, useToastMessageDispatch, useUserId, useMethod, useTranslation } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; import React, { useCallback, useMemo, useEffect } from 'react'; -import { useForm } from 'react-hook-form'; +import { Controller, useForm } from 'react-hook-form'; import GenericModal from '../../../../components/GenericModal'; -const AddToken = ({ reload, ...props }: { reload: () => void }): ReactElement => { +const AddToken = ({ reload }: { reload: () => void }): ReactElement => { const t = useTranslation(); const userId = useUserId(); + const setModal = useSetModal(); const createTokenFn = useMethod('personalAccessTokens:generateToken'); const dispatchToastMessage = useToastMessageDispatch(); - const bypassTwoFactorCheckboxId = useUniqueId(); - const setModal = useSetModal(); - const initialValues = useMemo(() => ({ name: '', bypassTwoFactor: false }), []); + const initialValues = useMemo(() => ({ name: '', bypassTwoFactor: 'require' }), []); const { register, resetField, handleSubmit, - formState: { isDirty, isSubmitted, submitCount }, + control, + formState: { isSubmitted, submitCount }, } = useForm({ defaultValues: initialValues }); + const twoFactorAuthOptions: SelectOption[] = useMemo( + () => [ + ['require', t('Require_Two_Factor_Authentication')], + ['bypass', t('Ignore_Two_Factor_Authentication')], + ], + [t], + ); + const handleAddToken = useCallback( - async ({ name: tokenName, bypassTwoFactor }: typeof initialValues) => { + async ({ name: tokenName, bypassTwoFactor }) => { try { - const token = await createTokenFn({ tokenName, bypassTwoFactor }); + const token = await createTokenFn({ tokenName, bypassTwoFactor: bypassTwoFactor === 'bypass' }); setModal( setModal(null)} onClose={() => setModal(null)}> @@ -54,22 +62,23 @@ const AddToken = ({ reload, ...props }: { reload: () => void }): ReactElement => }, [isSubmitted, submitCount, reload, resetField]); return ( - - - - - - - - - - - {t('Ignore_Two_Factor_Authentication')} - - - + + + + + + [key, t(name)])} - /> - - {importer && ( - - {importer.name === 'CSV' - ? t('Importer_From_Description_CSV') - : t('Importer_From_Description', { from: t(importer.name) })} - - )} - - {importer && ( - - - {t('File_Type')} - - - + + {importer && ( + + {importer.key === 'csv' + ? t('Importer_From_Description_CSV') + : t('Importer_From_Description', { from: t(importer.name as TranslationKey) })} + + )} + + {importer && ( + + + {t('File_Type')} + + + - - {t('Script_Engine_Description')} - - ), - [scriptEngine, scriptEngineOptions, handleScriptEngine, t], - )} - {useMemo( - () => ( - - {t('Script')} - - } - /> - - - ), - [t, script, handleScript], - )} - {useMemo( - () => - !extraData._id && ( - <> - - {t('Webhook_URL')} - - } - disabled - /> - - {t('Send_your_JSON_payloads_to_this_URL')} - - - {t('Token')} - - } - disabled - /> - - - - ), - [extraData._id, t], - )} - {useMemo( - () => - extraData._id && ( - <> - - {t('Webhook_URL')} - - } /> - - {t('Send_your_JSON_payloads_to_this_URL')} - - - {t('Token')} - - } /> - - - - ), - [extraData._id, extraData.token, t, url], - )} - {useMemo( - () => ( - - {t('Example_payload')} - - -
-												
-											
-
-
-
- ), - [hilightedExampleJson, t], - )} - {useMemo( - () => - extraData._id && ( - - {t('Curl')} - - } /> - - - ), - [curlData, extraData._id, t], - )} - {append} - - - - - ); -} diff --git a/apps/meteor/client/views/admin/integrations/IntegrationsPage.tsx b/apps/meteor/client/views/admin/integrations/IntegrationsPage.tsx index 65348d41025f..a54c83a12429 100644 --- a/apps/meteor/client/views/admin/integrations/IntegrationsPage.tsx +++ b/apps/meteor/client/views/admin/integrations/IntegrationsPage.tsx @@ -1,60 +1,54 @@ import { Button, ButtonGroup, Tabs } from '@rocket.chat/fuselage'; -import { useRoute, useRouteParameter, useTranslation } from '@rocket.chat/ui-contexts'; +import { useRouteParameter, useRouter, useTranslation } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; -import React, { useCallback } from 'react'; +import React from 'react'; -import Page from '../../../components/Page'; +import { Page, PageHeader, PageContent } from '../../../components/Page'; import IntegrationsTable from './IntegrationsTable'; -import NewBot from './new/NewBot'; -import NewZapier from './new/NewZapier'; +import NewBot from './NewBot'; +import NewZapier from './NewZapier'; const IntegrationsPage = (): ReactElement => { const t = useTranslation(); - const router = useRoute('admin-integrations'); + const router = useRouter(); const context = useRouteParameter('context'); - const showTable = !['zapier', 'bots'].includes(context || ''); - - const handleNewButtonClick = useCallback(() => { - router.push({ context: 'new', type: 'incoming' }); - }, [router]); - const goToAll = useCallback(() => router.push({ context: '' }), [router]); - const goToIncoming = useCallback(() => router.push({ context: 'webhook-incoming' }), [router]); - const goToOutgoing = useCallback(() => router.push({ context: 'webhook-outgoing' }), [router]); - const goToZapier = useCallback(() => router.push({ context: 'zapier' }), [router]); - const goToBots = useCallback(() => router.push({ context: 'bots' }), [router]); + const showTable = !['zapier', 'bots'].includes(context || ''); return ( - + - - + - + router.navigate('/admin/integrations')}> {t('All')} - + router.navigate('/admin/integrations/webhook-incoming')}> {t('Incoming')} - + router.navigate('/admin/integrations/webhook-outgoing')}> {t('Outgoing')} - + router.navigate('/admin/integrations/zapier')}> {t('Zapier')} - + router.navigate('/admin/integrations/bots')}> {t('Bots')} - + {context === 'zapier' && } {context === 'bots' && } {showTable && } - + ); }; diff --git a/apps/meteor/client/views/admin/integrations/IntegrationsRoute.js b/apps/meteor/client/views/admin/integrations/IntegrationsRoute.js deleted file mode 100644 index ad61f761cd46..000000000000 --- a/apps/meteor/client/views/admin/integrations/IntegrationsRoute.js +++ /dev/null @@ -1,44 +0,0 @@ -import { useRouteParameter, useAtLeastOnePermission } from '@rocket.chat/ui-contexts'; -import React, { useMemo } from 'react'; - -import NotAuthorizedPage from '../../notAuthorized/NotAuthorizedPage'; -import IntegrationsPage from './IntegrationsPage'; -import EditIntegrationsPage from './edit/EditIntegrationsPage'; -import OutgoingWebhookHistoryPage from './edit/OutgoingWebhookHistoryPage'; -import NewIntegrationsPage from './new/NewIntegrationsPage'; - -function IntegrationsRoute() { - const canViewIntegrationsPage = useAtLeastOnePermission( - useMemo( - () => [ - 'manage-incoming-integrations', - 'manage-outgoing-integrations', - 'manage-own-incoming-integrations', - 'manage-own-outgoing-integrations', - ], - [], - ), - ); - - const context = useRouteParameter('context'); - - if (!canViewIntegrationsPage) { - return ; - } - - if (context === 'new') { - return ; - } - - if (context === 'edit') { - return ; - } - - if (context === 'history') { - return ; - } - - return ; -} - -export default IntegrationsRoute; diff --git a/apps/meteor/client/views/admin/integrations/IntegrationsRoute.tsx b/apps/meteor/client/views/admin/integrations/IntegrationsRoute.tsx new file mode 100644 index 000000000000..b8520f7063c1 --- /dev/null +++ b/apps/meteor/client/views/admin/integrations/IntegrationsRoute.tsx @@ -0,0 +1,45 @@ +import { useRouteParameter, useAtLeastOnePermission } from '@rocket.chat/ui-contexts'; +import React, { useMemo } from 'react'; + +import NotAuthorizedPage from '../../notAuthorized/NotAuthorizedPage'; +import EditIntegrationsPage from './EditIntegrationsPage'; +import EditIntegrationsPageWithData from './EditIntegrationsPageWithData'; +import IntegrationsPage from './IntegrationsPage'; +import OutgoingWebhookHistoryPage from './outgoing/history/OutgoingWebhookHistoryPage'; + +const IntegrationsRoute = () => { + const context = useRouteParameter('context'); + const integrationId = useRouteParameter('id'); + + const canViewIntegrationsPage = useAtLeastOnePermission( + useMemo( + () => [ + 'manage-incoming-integrations', + 'manage-outgoing-integrations', + 'manage-own-incoming-integrations', + 'manage-own-outgoing-integrations', + ], + [], + ), + ); + + if (!canViewIntegrationsPage) { + return ; + } + + if (context === 'new') { + return ; + } + + if (context === 'edit' && integrationId) { + return ; + } + + if (context === 'history') { + return ; + } + + return ; +}; + +export default IntegrationsRoute; diff --git a/apps/meteor/client/views/admin/integrations/NewBot.tsx b/apps/meteor/client/views/admin/integrations/NewBot.tsx new file mode 100644 index 000000000000..bd4bdbac1303 --- /dev/null +++ b/apps/meteor/client/views/admin/integrations/NewBot.tsx @@ -0,0 +1,11 @@ +import { Box } from '@rocket.chat/fuselage'; +import { useTranslation } from '@rocket.chat/ui-contexts'; +import React from 'react'; + +const NewBot = () => { + const t = useTranslation(); + + return ; +}; + +export default NewBot; diff --git a/apps/meteor/client/views/admin/integrations/NewZapier.tsx b/apps/meteor/client/views/admin/integrations/NewZapier.tsx new file mode 100644 index 000000000000..8313ee4a5029 --- /dev/null +++ b/apps/meteor/client/views/admin/integrations/NewZapier.tsx @@ -0,0 +1,63 @@ +import { Box, Skeleton, Margins, Callout } from '@rocket.chat/fuselage'; +import { useTranslation } from '@rocket.chat/ui-contexts'; +import React, { useEffect, useState } from 'react'; + +const blogSpotStyleScriptImport = (src: string) => + new Promise((resolve) => { + const script = document.createElement('script'); + script.type = 'text/javascript'; + document.body.appendChild(script); + + const resolveFunc = (event: Event) => resolve(event.currentTarget); + + script.addEventListener('readystatechange', (event) => resolveFunc(event)); + script.addEventListener('load', (event) => resolveFunc(event)); + script.src = src; + }); + +const NewZapier = ({ ...props }) => { + const t = useTranslation(); + const [script, setScript] = useState(); + + useEffect(() => { + const importZapier = async () => { + const scriptEl = await blogSpotStyleScriptImport( + 'https://zapier.com/apps/embed/widget.js?services=rocketchat&html_id=zapier-goes-here', + ); + + setScript(scriptEl as HTMLScriptElement); + }; + + if (!script) { + importZapier(); + } + + return () => { + if (script) { + script.parentNode?.removeChild(script); + } + }; + }, [script]); + + return ( + <> + + {t('Install_Zapier_from_marketplace')} + + {!script && ( + + + + + + + + + + )} + + + ); +}; + +export default NewZapier; diff --git a/apps/meteor/client/views/admin/integrations/OutgoiongWebhookForm.js b/apps/meteor/client/views/admin/integrations/OutgoiongWebhookForm.js deleted file mode 100644 index b8d9d8e13a6b..000000000000 --- a/apps/meteor/client/views/admin/integrations/OutgoiongWebhookForm.js +++ /dev/null @@ -1,417 +0,0 @@ -import { Field, TextInput, Box, ToggleSwitch, Icon, TextAreaInput, FieldGroup, Margins, Select, Accordion } from '@rocket.chat/fuselage'; -import { useTranslation } from '@rocket.chat/ui-contexts'; -import React, { useMemo, useCallback } from 'react'; - -import { outgoingEvents } from '../../../../app/integrations/lib/outgoingEvents'; -import Page from '../../../components/Page'; -import { useHighlightedCode } from '../../../hooks/useHighlightedCode'; -import { useExampleData } from './useExampleIncomingData'; - -export default function OutgoingWebhookForm({ formValues, formHandlers, append, ...props }) { - const t = useTranslation(); - - const { - enabled, - impersonateUser, - event, - urls, - triggerWords, - targetRoom, - channel, - username, - name, - alias, - avatar, - emoji, - token, - scriptEnabled, - script, - scriptEngine, - retryFailedCalls, - retryCount, - retryDelay, - triggerWordAnywhere, - runOnEdits, - } = formValues; - - const { - handleEvent, - handleEnabled, - handleName, - handleChannel, - handleTriggerWords, - handleTargetRoom, - handleUrls, - handleImpersonateUser, - handleUsername, - handleAlias, - handleAvatar, - handleEmoji, - handleToken, - handleScriptEnabled, - handleScriptEngine, - handleScript, - handleRetryFailedCalls, - handleRetryCount, - handleRetryDelay, - handleTriggerWordAnywhere, - handleRunOnEdits, - } = formHandlers; - - const retryDelayOptions = useMemo( - () => [ - ['powers-of-ten', t('powers-of-ten')], - ['powers-of-two', t('powers-of-two')], - ['increments-of-two', t('increments-of-two')], - ], - [t], - ); - - const eventOptions = useMemo(() => Object.entries(outgoingEvents).map(([key, val]) => [key, t(val.label)]), [t]); - const scriptEngineOptions = useMemo( - () => [ - ['vm2', t('Script_Engine_vm2')], - ['isolated-vm', t('Script_Engine_isolated_vm')], - ], - [t], - ); - - const showChannel = useMemo(() => outgoingEvents[event].use.channel, [event]); - const showTriggerWords = useMemo(() => outgoingEvents[event].use.triggerWords, [event]); - const showTargetRoom = useMemo(() => outgoingEvents[event].use.targetRoom, [event]); - - const additionalFields = useMemo( - () => ({ - ...(alias && { alias }), - ...(emoji && { emoji }), - ...(avatar && { avatar }), - }), - [alias, avatar, emoji], - ); - - const [exampleData] = useExampleData({ - additionalFields, - url: null, - }); - - const hilightedExampleJson = useHighlightedCode('json', JSON.stringify(exampleData, null, 2)); - - return ( - e.preventDefault(), [])} qa-admin-user-edit='form' {...props}> - - - - - {useMemo( - () => ( - - {t('Event_Trigger')} - - - - {t('Script_Engine_Description')} - - ), - [scriptEngine, scriptEngineOptions, handleScriptEngine, t], - )} - {useMemo( - () => ( - - {t('Script')} - - } - /> - - - ), - [handleScript, script, t], - )} - {useMemo( - () => ( - - {t('Responding')} - {t('Response_description_pre')} - - -
-													
-												
-
-
- {t('Response_description_post')} -
- ), - [hilightedExampleJson, t], - )} -
- - - {useMemo( - () => ( - - - {t('Integration_Retry_Failed_Url_Calls')} - - - {t('Integration_Retry_Failed_Url_Calls_Description')} - - ), - [handleRetryFailedCalls, retryFailedCalls, t], - )} - {useMemo( - () => ( - - {t('Retry_Count')} - - - - {t('Integration_Retry_Count_Description')} - - ), - [handleRetryCount, retryCount, t], - )} - {useMemo( - () => ( - - {t('Integration_Retry_Delay')} - - + )} + /> + + {t('Script_Engine_Description')} + + + {t('Script')} + + ( + } /> + )} + /> + + + + +
+
+ ); +}; + +export default IncomingWebhookForm; diff --git a/apps/meteor/client/views/admin/integrations/new/NewBot.js b/apps/meteor/client/views/admin/integrations/new/NewBot.js deleted file mode 100644 index 982a0e65a2c1..000000000000 --- a/apps/meteor/client/views/admin/integrations/new/NewBot.js +++ /dev/null @@ -1,8 +0,0 @@ -import { Box } from '@rocket.chat/fuselage'; -import { useTranslation } from '@rocket.chat/ui-contexts'; -import React from 'react'; - -export default function NewBot() { - const t = useTranslation(); - return ; -} diff --git a/apps/meteor/client/views/admin/integrations/new/NewIncomingWebhook.js b/apps/meteor/client/views/admin/integrations/new/NewIncomingWebhook.js deleted file mode 100644 index 7b4e0880e57f..000000000000 --- a/apps/meteor/client/views/admin/integrations/new/NewIncomingWebhook.js +++ /dev/null @@ -1,60 +0,0 @@ -import { Field, Box, Margins, Button } from '@rocket.chat/fuselage'; -import { useRoute, useTranslation } from '@rocket.chat/ui-contexts'; -import React, { useCallback, useMemo } from 'react'; - -import { useEndpointAction } from '../../../../hooks/useEndpointAction'; -import { useForm } from '../../../../hooks/useForm'; -import IncomingWebhookForm from '../IncomingWebhookForm'; - -const initialState = { - enabled: false, - channel: '', - username: '', - name: '', - alias: '', - avatar: '', - emoji: '', - scriptEnabled: false, - scriptEngine: 'isolated-vm', - overrideDestinationChannelEnabled: false, - script: '', -}; - -export default function NewIncomingWebhook(props) { - const t = useTranslation(); - - const router = useRoute('admin-integrations'); - - const { values: formValues, handlers: formHandlers, reset } = useForm(initialState); - - const saveAction = useEndpointAction('POST', '/v1/integrations.create', { successMessage: t('Integration_added') }); - - const handleSave = useCallback(async () => { - const result = await saveAction({ ...formValues, type: 'webhook-incoming' }); - if (result.success) { - router.push({ context: 'edit', type: 'incoming', id: result.integration._id }); - } - }, [formValues, router, saveAction]); - - const actionButtons = useMemo( - () => ( - - - - - - - - - - - ), - [handleSave, reset, t], - ); - - return ; -} diff --git a/apps/meteor/client/views/admin/integrations/new/NewIntegrationsPage.js b/apps/meteor/client/views/admin/integrations/new/NewIntegrationsPage.js deleted file mode 100644 index 1279cf29cb74..000000000000 --- a/apps/meteor/client/views/admin/integrations/new/NewIntegrationsPage.js +++ /dev/null @@ -1,47 +0,0 @@ -import { Tabs, Button, ButtonGroup } from '@rocket.chat/fuselage'; -import { useRouteParameter, useRoute, useTranslation } from '@rocket.chat/ui-contexts'; -import React, { useCallback } from 'react'; - -import Page from '../../../../components/Page'; -import NewIncomingWebhook from './NewIncomingWebhook'; -import NewOutgoingWebhook from './NewOutgoingWebhook'; - -export default function NewIntegrationsPage({ ...props }) { - const t = useTranslation(); - - const router = useRoute('admin-integrations'); - - const handleClickTab = useCallback( - (type) => () => { - router.push({ context: 'new', type }); - }, - [router], - ); - - const handleClickReturn = useCallback(() => { - router.push({}); - }, [router]); - - const tab = useRouteParameter('type'); - - return ( - - - - - - - - - {t('Incoming')} - - - {t('Outgoing')} - - - {(tab === 'incoming' && ) || (tab === 'outgoing' && )} - - ); -} diff --git a/apps/meteor/client/views/admin/integrations/new/NewOutgoingWebhook.js b/apps/meteor/client/views/admin/integrations/new/NewOutgoingWebhook.js deleted file mode 100644 index 153dc4c6eb7f..000000000000 --- a/apps/meteor/client/views/admin/integrations/new/NewOutgoingWebhook.js +++ /dev/null @@ -1,70 +0,0 @@ -import { Field, Button } from '@rocket.chat/fuselage'; -import { useUniqueId } from '@rocket.chat/fuselage-hooks'; -import { useRoute, useTranslation } from '@rocket.chat/ui-contexts'; -import React, { useMemo, useCallback } from 'react'; - -import { useEndpointAction } from '../../../../hooks/useEndpointAction'; -import { useForm } from '../../../../hooks/useForm'; -import OutgoingWebhookForm from '../OutgoiongWebhookForm'; -import { triggerWordsToArray } from '../helpers/triggerWords'; - -const defaultData = { - type: 'webhook-outgoing', - enabled: true, - impersonateUser: false, - event: 'sendMessage', - urls: '', - triggerWords: '', - targetRoom: '', - channel: '', - username: '', - name: '', - alias: '', - avatar: '', - emoji: '', - scriptEnabled: false, - scriptEngine: 'isolated-vm', - script: '', - retryFailedCalls: true, - retryCount: 6, - retryDelay: 'powers-of-ten', - triggerWordAnywhere: false, - runOnEdits: true, -}; - -export default function NewOutgoingWebhook({ data = defaultData, onChange, setSaveAction, ...props }) { - const t = useTranslation(); - const router = useRoute('admin-integrations'); - - const { values: formValues, handlers: formHandlers } = useForm({ ...data, token: useUniqueId() }); - - const { urls, triggerWords } = formValues; - - const saveIntegration = useEndpointAction('POST', '/v1/integrations.create', { successMessage: t('Integration_added') }); - - const handleSave = useCallback(async () => { - const result = await saveIntegration({ - ...formValues, - urls: urls.split('\n'), - triggerWords: triggerWordsToArray(triggerWords), - }); - if (result.success) { - router.push({ id: result.integration._id, context: 'edit', type: 'outgoing' }); - } - }, [saveIntegration, formValues, urls, triggerWords, router]); - - const saveButton = useMemo( - () => ( - - - - - - ), - [handleSave, t], - ); - - return ; -} diff --git a/apps/meteor/client/views/admin/integrations/new/NewZapier.js b/apps/meteor/client/views/admin/integrations/new/NewZapier.js deleted file mode 100644 index 5bb46c86ba6f..000000000000 --- a/apps/meteor/client/views/admin/integrations/new/NewZapier.js +++ /dev/null @@ -1,53 +0,0 @@ -import { Box, Skeleton, Margins, Callout } from '@rocket.chat/fuselage'; -import { useTranslation } from '@rocket.chat/ui-contexts'; -import React, { useEffect, useState } from 'react'; - -const blogSpotStyleScriptImport = (src) => - new Promise((resolve) => { - const script = document.createElement('script'); - script.type = 'text/javascript'; - document.body.appendChild(script); - - const resolveFunc = (event) => resolve(event.currentTarget); - - script.onreadystatechange = resolveFunc; - script.onload = resolveFunc; - script.src = src; - }); - -export default function NewZapier({ ...props }) { - const [script, setScript] = useState(); - const t = useTranslation(); - useEffect(() => { - const importZapier = async () => { - const scriptEl = await blogSpotStyleScriptImport( - 'https://zapier.com/apps/embed/widget.js?services=rocketchat&html_id=zapier-goes-here', - ); - setScript(scriptEl); - }; - if (!script) { - importZapier(); - } - return () => script && script.parentNode.removeChild(script); - }, [script]); - - return ( - <> - - {t('Install_Zapier_from_marketplace')} - - {!script && ( - - - - - - - - - - )} - - - ); -} diff --git a/apps/meteor/client/views/admin/integrations/outgoing/EditOutgoingWebhook.tsx b/apps/meteor/client/views/admin/integrations/outgoing/EditOutgoingWebhook.tsx new file mode 100644 index 000000000000..1ca7d1f481cd --- /dev/null +++ b/apps/meteor/client/views/admin/integrations/outgoing/EditOutgoingWebhook.tsx @@ -0,0 +1,144 @@ +import type { IOutgoingIntegration, Serialized } from '@rocket.chat/core-typings'; +import { Button, ButtonGroup, Tabs, TabsItem } from '@rocket.chat/fuselage'; +import { useUniqueId } from '@rocket.chat/fuselage-hooks'; +import { useSetModal, useTranslation, useRouter, useRouteParameter } from '@rocket.chat/ui-contexts'; +import React, { useCallback } from 'react'; +import { FormProvider, useForm } from 'react-hook-form'; + +import GenericModal from '../../../../components/GenericModal'; +import { Page, PageHeader, PageScrollableContentWithShadow, PageFooter } from '../../../../components/Page'; +import { triggerWordsToArray, triggerWordsToString } from '../helpers/triggerWords'; +import { useCreateIntegration } from '../hooks/useCreateIntegration'; +import { useDeleteIntegration } from '../hooks/useDeleteIntegration'; +import { useUpdateIntegration } from '../hooks/useUpdateIntegration'; +import OutgoingWebhookForm from './OutgoingWebhookForm'; + +const getInitialValue = (webhookData: Serialized | undefined, defaultToken: string) => ({ + enabled: webhookData?.enabled ?? true, + impersonateUser: webhookData?.impersonateUser ?? false, + event: webhookData?.event ?? 'sendMessage', + urls: webhookData?.urls?.join('\n') ?? '', + token: webhookData?.token ?? defaultToken, + triggerWords: triggerWordsToString(webhookData?.triggerWords) ?? '', + targetRoom: webhookData?.targetRoom ?? '', + channel: webhookData?.channel.join(', ') ?? '', + username: webhookData?.username ?? '', + name: webhookData?.name ?? '', + alias: webhookData?.alias ?? '', + avatar: webhookData?.avatar ?? '', + emoji: webhookData?.emoji ?? '', + scriptEnabled: webhookData?.scriptEnabled ?? false, + scriptEngine: webhookData?.scriptEngine ?? 'isolated-vm', + script: webhookData?.script ?? '', + retryFailedCalls: webhookData?.retryFailedCalls ?? true, + retryCount: webhookData?.retryCount ?? 6, + retryDelay: webhookData?.retryDelay ?? 'powers-of-ten', + triggerWordAnywhere: webhookData?.triggerWordAnywhere ?? false, + runOnEdits: webhookData?.runOnEdits ?? true, +}); + +const OUTGOING_TYPE = 'webhook-outgoing'; + +const EditOutgoingWebhook = ({ webhookData }: { webhookData?: Serialized }) => { + const t = useTranslation(); + const setModal = useSetModal(); + const router = useRouter(); + + const tab = useRouteParameter('type'); + + const defaultToken = useUniqueId(); + + const methods = useForm({ mode: 'onBlur', values: getInitialValue(webhookData, defaultToken) }); + const { + reset, + handleSubmit, + formState: { isDirty }, + watch, + } = methods; + + const deleteIntegration = useDeleteIntegration(OUTGOING_TYPE); + const createIntegration = useCreateIntegration(OUTGOING_TYPE); + const updateIntegration = useUpdateIntegration(OUTGOING_TYPE); + + const handleDeleteIntegration = useCallback(() => { + const onDelete = async () => { + deleteIntegration.mutate({ type: OUTGOING_TYPE, integrationId: webhookData?._id }); + }; + + setModal( + setModal(null)} confirmText={t('Delete')}> + {t('Integration_Delete_Warning')} + , + ); + }, [webhookData?._id, deleteIntegration, setModal, t]); + + const { urls, triggerWords } = watch(); + + const handleSave = useCallback( + async ({ ...formValues }) => { + if (webhookData?._id) { + return updateIntegration.mutate({ + type: OUTGOING_TYPE, + integrationId: webhookData?._id, + ...formValues, + triggerWords: triggerWordsToArray(triggerWords), + urls: urls.split('\n'), + }); + } + + return createIntegration.mutate({ + type: OUTGOING_TYPE, + ...formValues, + triggerWords: triggerWordsToArray(triggerWords), + urls: urls.split('\n'), + }); + }, + [webhookData?._id, createIntegration, updateIntegration, triggerWords, urls], + ); + + const formId = useUniqueId(); + + return ( + + router.navigate('/admin/integrations/webhook-outgoing')}> + + {webhookData?._id && ( + + )} + {webhookData?._id && ( + + )} + + + {!webhookData?._id && ( + + router.navigate('/admin/integrations/new/incoming')}> + {t('Incoming')} + + router.navigate('/admin/integrations/new/outgoing')}> + {t('Outgoing')} + + + )} + + + + + + + + + + + + + ); +}; + +export default EditOutgoingWebhook; diff --git a/apps/meteor/client/views/admin/integrations/outgoing/OutgoingWebhookForm.tsx b/apps/meteor/client/views/admin/integrations/outgoing/OutgoingWebhookForm.tsx new file mode 100644 index 000000000000..a14cdd2ada46 --- /dev/null +++ b/apps/meteor/client/views/admin/integrations/outgoing/OutgoingWebhookForm.tsx @@ -0,0 +1,529 @@ +import type { IOutgoingIntegration } from '@rocket.chat/core-typings'; +import type { SelectOption } from '@rocket.chat/fuselage'; +import { + FieldError, + AccordionItem, + FieldHint, + FieldLabel, + FieldRow, + Field, + TextInput, + Box, + ToggleSwitch, + Icon, + TextAreaInput, + FieldGroup, + Select, + Accordion, +} from '@rocket.chat/fuselage'; +import { useUniqueId } from '@rocket.chat/fuselage-hooks'; +import type { TranslationKey } from '@rocket.chat/ui-contexts'; +import { useTranslation } from '@rocket.chat/ui-contexts'; +import React, { useMemo } from 'react'; +import { useFormContext, Controller } from 'react-hook-form'; + +import { outgoingEvents } from '../../../../../app/integrations/lib/outgoingEvents'; +import { useHighlightedCode } from '../../../../hooks/useHighlightedCode'; +import { useExampleData } from '../hooks/useExampleIncomingData'; + +type EditOutgoingWebhookPayload = Pick< + IOutgoingIntegration, + | 'enabled' + | 'impersonateUser' + | 'event' + | 'urls' + | 'token' + | 'triggerWords' + | 'targetRoom' + | 'channel' + | 'username' + | 'name' + | 'alias' + | 'avatar' + | 'emoji' + | 'scriptEnabled' + | 'scriptEngine' + | 'script' + | 'retryFailedCalls' + | 'retryCount' + | 'retryDelay' + | 'triggerWordAnywhere' + | 'runOnEdits' +>; + +const OutgoingWebhookForm = () => { + const t = useTranslation(); + + const { + control, + watch, + formState: { errors }, + } = useFormContext(); + const { event, alias, emoji, avatar } = watch(); + + const retryDelayOptions: SelectOption[] = useMemo( + () => [ + ['powers-of-ten', t('powers-of-ten')], + ['powers-of-two', t('powers-of-two')], + ['increments-of-two', t('increments-of-two')], + ], + [t], + ); + + const eventOptions: SelectOption[] = useMemo( + () => Object.entries(outgoingEvents).map(([key, val]) => [key, t(val.label as TranslationKey)]), + [t], + ); + + const scriptEngineOptions: SelectOption[] = useMemo( + () => [ + ['vm2', t('Script_Engine_vm2')], + ['isolated-vm', t('Script_Engine_isolated_vm')], + ], + [t], + ); + + const showChannel = useMemo(() => outgoingEvents[event].use.channel, [event]); + const showTriggerWords = useMemo(() => outgoingEvents[event].use.triggerWords, [event]); + const showTargetRoom = useMemo(() => outgoingEvents[event].use.targetRoom, [event]); + + const additionalFields = useMemo( + () => ({ + ...(alias && { alias }), + ...(emoji && { emoji }), + ...(avatar && { avatar }), + }), + [alias, avatar, emoji], + ); + + const [exampleData] = useExampleData({ + additionalFields, + url: '', + }); + + const hilightedExampleJson = useHighlightedCode('json', JSON.stringify(exampleData, null, 2)); + + const eventField = useUniqueId(); + const enabledField = useUniqueId(); + const nameField = useUniqueId(); + const channelField = useUniqueId(); + const triggerWordsField = useUniqueId(); + const targetRoomField = useUniqueId(); + const urlsField = useUniqueId(); + const impersonateUserField = useUniqueId(); + const usernameField = useUniqueId(); + const aliasField = useUniqueId(); + const avatarField = useUniqueId(); + const emojiField = useUniqueId(); + const tokenField = useUniqueId(); + const scriptEnabledField = useUniqueId(); + const scriptEngineField = useUniqueId(); + const scriptField = useUniqueId(); + const retryFailedCallsField = useUniqueId(); + const retryCountField = useUniqueId(); + const retryDelayField = useUniqueId(); + const triggerWordAnywhereField = useUniqueId(); + const runOnEditsField = useUniqueId(); + + return ( + + + + + + {t('Event_Trigger')} + + ( + + )} + /> + + {t('Script_Engine_Description')} + + + {t('Script')} + + ( + } /> + )} + /> + + + + {t('Responding')} + {t('Response_description_pre')} + + +
+										
+									
+
+
+ {t('Response_description_post')} +
+
+
+ + + + + {t('Integration_Retry_Failed_Url_Calls')} + ( + + )} + /> + + {t('Integration_Retry_Failed_Url_Calls_Description')} + + + {t('Retry_Count')} + + } + /> + + {t('Integration_Retry_Count_Description')} + + + {t('Integration_Retry_Delay')} + + ( +
); }; diff --git a/apps/meteor/client/views/admin/moderation/helpers/ModerationFilter.tsx b/apps/meteor/client/views/admin/moderation/helpers/ModerationFilter.tsx new file mode 100644 index 000000000000..7d72d9d4c392 --- /dev/null +++ b/apps/meteor/client/views/admin/moderation/helpers/ModerationFilter.tsx @@ -0,0 +1,24 @@ +import { useTranslation } from '@rocket.chat/ui-contexts'; +import React, { useCallback } from 'react'; + +import FilterByText from '../../../../components/FilterByText'; +import DateRangePicker from './DateRangePicker'; + +type ModerationFilterProps = { + setText: (text: string) => void; + setDateRange: (dateRange: { start: string; end: string }) => void; +}; + +const ModerationFilter = ({ setText, setDateRange }: ModerationFilterProps) => { + const t = useTranslation(); + + const handleChange = useCallback(({ text }): void => setText(text), [setText]); + + return ( + + + + ); +}; + +export default ModerationFilter; diff --git a/apps/meteor/client/views/admin/moderation/helpers/ReportReason.tsx b/apps/meteor/client/views/admin/moderation/helpers/ReportReason.tsx index bd4af0143b8d..3daa0370b030 100644 --- a/apps/meteor/client/views/admin/moderation/helpers/ReportReason.tsx +++ b/apps/meteor/client/views/admin/moderation/helpers/ReportReason.tsx @@ -8,7 +8,7 @@ const ReportReason = ({ ind, uinfo, msg, ts }: { ind: number; uinfo: string | un return ( Report #{ind} - + {msg} diff --git a/apps/meteor/client/views/admin/moderation/helpers/UserColumn.tsx b/apps/meteor/client/views/admin/moderation/helpers/UserColumn.tsx new file mode 100644 index 000000000000..baaddc1cb6c2 --- /dev/null +++ b/apps/meteor/client/views/admin/moderation/helpers/UserColumn.tsx @@ -0,0 +1,43 @@ +import { Box } from '@rocket.chat/fuselage'; +import { UserAvatar } from '@rocket.chat/ui-avatar'; +import type { ComponentProps } from 'react'; +import React from 'react'; + +type UserColumnProps = { + name?: string; + username?: string; + isDesktopOrLarger?: boolean; + isProfile?: boolean; + size: ComponentProps['size']; + fontSize?: string; +}; + +const UserColumn = ({ name, username, fontSize, size }: UserColumnProps) => { + return ( + + {username && ( + + + + )} + + + + {name && username ? ( + <> + {name}{' '} + + (@{username}) + + + ) : ( + name || username + )}{' '} + + + + + ); +}; + +export default UserColumn; diff --git a/apps/meteor/client/views/admin/moderation/hooks/useDeactivateUserAction.tsx b/apps/meteor/client/views/admin/moderation/hooks/useDeactivateUserAction.tsx index c875408d423e..2ac0eeffe131 100644 --- a/apps/meteor/client/views/admin/moderation/hooks/useDeactivateUserAction.tsx +++ b/apps/meteor/client/views/admin/moderation/hooks/useDeactivateUserAction.tsx @@ -1,19 +1,24 @@ -import { useEndpoint, useRoute, useSetModal, useToastMessageDispatch, useTranslation } from '@rocket.chat/ui-contexts'; +import { useEndpoint, useRouteParameter, useRouter, useSetModal, useToastMessageDispatch } from '@rocket.chat/ui-contexts'; import { useMutation, useQueryClient } from '@tanstack/react-query'; import React from 'react'; +import { useTranslation } from 'react-i18next'; import type { GenericMenuItemProps } from '../../../../components/GenericMenu/GenericMenuItem'; import GenericModal from '../../../../components/GenericModal'; -const useDeactivateUserAction = (userId: string): GenericMenuItemProps => { - const t = useTranslation(); +const useDeactivateUserAction = (userId: string, isUserReport?: boolean): GenericMenuItemProps => { + const { t } = useTranslation(); const setModal = useSetModal(); const dispatchToastMessage = useToastMessageDispatch(); const queryClient = useQueryClient(); const deactiveUser = useEndpoint('POST', '/v1/users.setActiveStatus'); const deleteMessages = useEndpoint('POST', '/v1/moderation.user.deleteReportedMessages'); - const moderationRoute = useRoute('moderation-console'); + const dismissUserReports = useEndpoint('POST', '/v1/moderation.dismissUserReports'); + + const router = useRouter(); + + const tab = useRouteParameter('tab'); const handleDeactivateUser = useMutation({ mutationFn: deactiveUser, @@ -35,12 +40,23 @@ const useDeactivateUserAction = (userId: string): GenericMenuItemProps => { }, }); + const handleDismissUserReports = useMutation({ + mutationFn: dismissUserReports, + onError: (error) => { + dispatchToastMessage({ type: 'error', message: error }); + }, + onSuccess: () => { + dispatchToastMessage({ type: 'success', message: t('Moderation_Reports_dismissed') }); + }, + }); + const onDeactivateUser = async () => { setModal(); - await handleDeleteMessages.mutateAsync({ userId }); + !isUserReport && (await handleDeleteMessages.mutateAsync({ userId })); await handleDeactivateUser.mutateAsync({ userId, activeStatus: false, confirmRelinquish: true }); - queryClient.invalidateQueries({ queryKey: ['moderation.reports'] }); - moderationRoute.push({}); + await handleDismissUserReports.mutateAsync({ userId }); + queryClient.invalidateQueries({ queryKey: ['moderation'] }); + router.navigate(`/admin/moderation/${tab}`); }; const confirmDeactivateUser = (): void => { diff --git a/apps/meteor/client/views/admin/moderation/hooks/useDeleteMessage.tsx b/apps/meteor/client/views/admin/moderation/hooks/useDeleteMessage.tsx index bf54eaf89e19..21d7c3b86c73 100644 --- a/apps/meteor/client/views/admin/moderation/hooks/useDeleteMessage.tsx +++ b/apps/meteor/client/views/admin/moderation/hooks/useDeleteMessage.tsx @@ -33,7 +33,7 @@ const useDeleteMessage = (mid: string, rid: string, onChange: () => void) => { }, onSettled: () => { onChange(); - queryClient.invalidateQueries({ queryKey: ['moderation.reports'] }); + queryClient.invalidateQueries({ queryKey: ['moderation', 'msgReports'] }); setModal(); }, }); diff --git a/apps/meteor/client/views/admin/moderation/hooks/useDeleteMessagesAction.tsx b/apps/meteor/client/views/admin/moderation/hooks/useDeleteMessagesAction.tsx index cebe8d33908d..4d5d5690492d 100644 --- a/apps/meteor/client/views/admin/moderation/hooks/useDeleteMessagesAction.tsx +++ b/apps/meteor/client/views/admin/moderation/hooks/useDeleteMessagesAction.tsx @@ -1,4 +1,4 @@ -import { useEndpoint, useRoute, useSetModal, useToastMessageDispatch, useTranslation } from '@rocket.chat/ui-contexts'; +import { useEndpoint, useRouteParameter, useRouter, useSetModal, useToastMessageDispatch, useTranslation } from '@rocket.chat/ui-contexts'; import { useMutation, useQueryClient } from '@tanstack/react-query'; import React from 'react'; @@ -10,7 +10,8 @@ const useDeleteMessagesAction = (userId: string): GenericMenuItemProps => { const deleteMessages = useEndpoint('POST', '/v1/moderation.user.deleteReportedMessages'); const dispatchToastMessage = useToastMessageDispatch(); const setModal = useSetModal(); - const moderationRoute = useRoute('moderation-console'); + const router = useRouter(); + const tab = useRouteParameter('tab'); const queryClient = useQueryClient(); const handleDeleteMessages = useMutation({ @@ -25,9 +26,9 @@ const useDeleteMessagesAction = (userId: string): GenericMenuItemProps => { const onDeleteAll = async () => { await handleDeleteMessages.mutateAsync({ userId }); - queryClient.invalidateQueries({ queryKey: ['moderation.reports'] }); + queryClient.invalidateQueries({ queryKey: ['moderation', 'msgReports', 'fetchAll'] }); setModal(); - moderationRoute.push({}); + router.navigate(`/admin/moderation/${tab}`); }; const confirmDeletMessages = (): void => { diff --git a/apps/meteor/client/views/admin/moderation/hooks/useDismissMessageAction.tsx b/apps/meteor/client/views/admin/moderation/hooks/useDismissMessageAction.tsx index 824255e57db1..6a7f6867ea74 100644 --- a/apps/meteor/client/views/admin/moderation/hooks/useDismissMessageAction.tsx +++ b/apps/meteor/client/views/admin/moderation/hooks/useDismissMessageAction.tsx @@ -24,7 +24,7 @@ export const useDismissMessageAction = (msgId: string): { action: () => void } = const onDismissMessage = async () => { await handleDismissMessage.mutateAsync({ msgId }); - queryClient.invalidateQueries({ queryKey: ['moderation.userMessages'] }); + queryClient.invalidateQueries({ queryKey: ['moderation', 'msgReports'] }); setModal(); }; diff --git a/apps/meteor/client/views/admin/moderation/hooks/useDismissUserAction.tsx b/apps/meteor/client/views/admin/moderation/hooks/useDismissUserAction.tsx index 560c980df91e..09a30358d737 100644 --- a/apps/meteor/client/views/admin/moderation/hooks/useDismissUserAction.tsx +++ b/apps/meteor/client/views/admin/moderation/hooks/useDismissUserAction.tsx @@ -1,18 +1,24 @@ -import { useEndpoint, useRouter, useSetModal, useToastMessageDispatch, useTranslation } from '@rocket.chat/ui-contexts'; +import { useEndpoint, useRouter, useSetModal, useToastMessageDispatch, useRouteParameter } from '@rocket.chat/ui-contexts'; import { useMutation, useQueryClient } from '@tanstack/react-query'; import React from 'react'; +import { useTranslation } from 'react-i18next'; import type { GenericMenuItemProps } from '../../../../components/GenericMenu/GenericMenuItem'; import GenericModal from '../../../../components/GenericModal'; -const useDismissUserAction = (userId: string): GenericMenuItemProps => { - const t = useTranslation(); +const useDismissUserAction = (userId: string, isUserReport?: boolean): GenericMenuItemProps => { + const { t } = useTranslation(); const setModal = useSetModal(); const dispatchToastMessage = useToastMessageDispatch(); const moderationRoute = useRouter(); + const tab = useRouteParameter('tab'); const queryClient = useQueryClient(); - const dismissUser = useEndpoint('POST', '/v1/moderation.dismissReports'); + const dismissMsgReports = useEndpoint('POST', '/v1/moderation.dismissReports'); + + const dismissUserReports = useEndpoint('POST', '/v1/moderation.dismissUserReports'); + + const dismissUser = isUserReport ? dismissUserReports : dismissMsgReports; const handleDismissUser = useMutation({ mutationFn: dismissUser, @@ -20,15 +26,15 @@ const useDismissUserAction = (userId: string): GenericMenuItemProps => { dispatchToastMessage({ type: 'error', message: error }); }, onSuccess: () => { - dispatchToastMessage({ type: 'success', message: t('Moderation_Reports_dismissed_plural') }); + dispatchToastMessage({ type: 'success', message: t('Moderation_Reports_all_dismissed') }); }, }); const onDismissUser = async () => { await handleDismissUser.mutateAsync({ userId }); - queryClient.invalidateQueries({ queryKey: ['moderation.reports'] }); + queryClient.invalidateQueries({ queryKey: ['moderation', 'userReports'] }); setModal(); - moderationRoute.navigate('/admin/moderation', { replace: true }); + moderationRoute.navigate(`/admin/moderation/${tab}`, { replace: true }); }; const confirmDismissUser = (): void => { diff --git a/apps/meteor/client/views/admin/moderation/hooks/useResetAvatarAction.tsx b/apps/meteor/client/views/admin/moderation/hooks/useResetAvatarAction.tsx index f4abf806c913..377aad97b186 100644 --- a/apps/meteor/client/views/admin/moderation/hooks/useResetAvatarAction.tsx +++ b/apps/meteor/client/views/admin/moderation/hooks/useResetAvatarAction.tsx @@ -25,8 +25,8 @@ const useResetAvatarAction = (userId: string): GenericMenuItemProps => { const onResetAvatar = async () => { setModal(); - handleResetAvatar.mutateAsync({ userId }); - queryClient.invalidateQueries({ queryKey: ['moderation.reports'] }); + await handleResetAvatar.mutateAsync({ userId }); + queryClient.invalidateQueries({ queryKey: ['moderation'] }); }; const confirmResetAvatar = (): void => { diff --git a/apps/meteor/client/views/admin/oauthApps/EditOauthApp.tsx b/apps/meteor/client/views/admin/oauthApps/EditOauthApp.tsx index a5759fde6cc7..19bef201492f 100644 --- a/apps/meteor/client/views/admin/oauthApps/EditOauthApp.tsx +++ b/apps/meteor/client/views/admin/oauthApps/EditOauthApp.tsx @@ -101,15 +101,15 @@ const EditOauthApp = ({ onChange, data, ...props }: EditOauthAppProps): ReactEle - - {t('Active')} + + {t('Active')} } /> - + {t('Application_Name')} @@ -153,7 +153,7 @@ const EditOauthApp = ({ onChange, data, ...props }: EditOauthAppProps): ReactEle - + diff --git a/apps/meteor/client/views/admin/oauthApps/EditOauthAppWithData.tsx b/apps/meteor/client/views/admin/oauthApps/EditOauthAppWithData.tsx index a6bc9fc12acb..f87926429e67 100644 --- a/apps/meteor/client/views/admin/oauthApps/EditOauthAppWithData.tsx +++ b/apps/meteor/client/views/admin/oauthApps/EditOauthAppWithData.tsx @@ -1,9 +1,10 @@ -import { Box, Button, ButtonGroup, Skeleton, Throbber, InputBox } from '@rocket.chat/fuselage'; +import { Box } from '@rocket.chat/fuselage'; import { useEndpoint, useToastMessageDispatch, useTranslation } from '@rocket.chat/ui-contexts'; import { useQuery } from '@tanstack/react-query'; import type { ReactElement } from 'react'; import React, { useCallback } from 'react'; +import { FormSkeleton } from '../../../components/Skeleton'; import EditOauthApp from './EditOauthApp'; const EditOauthAppWithData = ({ _id, ...props }: { _id: string }): ReactElement => { @@ -29,27 +30,7 @@ const EditOauthAppWithData = ({ _id, ...props }: { _id: string }): ReactElement }, [refetch]); if (isLoading) { - return ( - - - - - - - - - - - - - - ); + return ; } if (error || !data || !_id) { diff --git a/apps/meteor/client/views/admin/oauthApps/OAuthAddApp.tsx b/apps/meteor/client/views/admin/oauthApps/OAuthAddApp.tsx index ccb4205b5819..9a66e46e6b39 100644 --- a/apps/meteor/client/views/admin/oauthApps/OAuthAddApp.tsx +++ b/apps/meteor/client/views/admin/oauthApps/OAuthAddApp.tsx @@ -56,15 +56,15 @@ const OAuthAddApp = (): ReactElement => { - - {t('Active')} + + {t('Active')} } /> - + {t('Application_Name')} @@ -84,7 +84,7 @@ const OAuthAddApp = (): ReactElement => { - + - )} + router.navigate('/admin/third-party-login') : undefined}> {!context && ( - + + + )} - - + + {!context && } {id && context === 'edit' && } {context === 'new' && } - + ); diff --git a/apps/meteor/client/views/admin/permissions/CustomRoleUpsellModal.tsx b/apps/meteor/client/views/admin/permissions/CustomRoleUpsellModal.tsx index c3df0587b156..6d03af10c8b4 100644 --- a/apps/meteor/client/views/admin/permissions/CustomRoleUpsellModal.tsx +++ b/apps/meteor/client/views/admin/permissions/CustomRoleUpsellModal.tsx @@ -6,7 +6,7 @@ import { useUpsellActions } from '../../../components/GenericUpsellModal/hooks'; const CustomRoleUpsellModal = ({ onClose }: { onClose: () => void }) => { const t = useTranslation(); - const { cloudWorkspaceHadTrial, handleTalkToSales, handleGoFullyFeatured } = useUpsellActions(); + const { handleManageSubscription } = useUpsellActions(); return ( void }) => { subtitle={t('Custom_roles_upsell_add_custom_roles_workspace')} description={t('Custom_roles_upsell_add_custom_roles_workspace_description')} onClose={onClose} - cancelText={t('Talk_to_an_expert')} - confirmText={cloudWorkspaceHadTrial ? t('Learn_more') : t('Start_a_free_trial')} - onConfirm={handleGoFullyFeatured} - onCancel={handleTalkToSales} + onConfirm={handleManageSubscription} + onCancel={onClose} /> ); }; diff --git a/apps/meteor/client/views/admin/permissions/EditRolePage.tsx b/apps/meteor/client/views/admin/permissions/EditRolePage.tsx index b7948d571254..8980d64d17e8 100644 --- a/apps/meteor/client/views/admin/permissions/EditRolePage.tsx +++ b/apps/meteor/client/views/admin/permissions/EditRolePage.tsx @@ -74,7 +74,7 @@ const EditRolePage = ({ role, isEnterprise }: { role?: IRole; isEnterprise: bool } }; - const deleteRoleMessage = isEnterprise ? t('Delete_Role_Warning') : t('Delete_Role_Warning_Community_Edition'); + const deleteRoleMessage = isEnterprise ? t('Delete_Role_Warning') : t('Delete_Role_Warning_Not_Enterprise'); setModal( {t('error-invalid-role')}; } - if (isLoading || !data) { + if (hasCustomRolesModule === 'loading') { return ; } - return ; + return ; }; export default EditRolePageWithData; diff --git a/apps/meteor/client/views/admin/permissions/PermissionsContextBar.tsx b/apps/meteor/client/views/admin/permissions/PermissionsContextBar.tsx index b472e57d7eae..ca9fefd54163 100644 --- a/apps/meteor/client/views/admin/permissions/PermissionsContextBar.tsx +++ b/apps/meteor/client/views/admin/permissions/PermissionsContextBar.tsx @@ -3,8 +3,14 @@ import { useRouteParameter, useRoute, useTranslation, useSetModal } from '@rocke import type { ReactElement } from 'react'; import React, { useEffect } from 'react'; -import { Contextualbar, ContextualbarHeader, ContextualbarTitle, ContextualbarClose } from '../../../components/Contextualbar'; -import { useIsEnterprise } from '../../../hooks/useIsEnterprise'; +import { useHasLicenseModule } from '../../../../ee/client/hooks/useHasLicenseModule'; +import { + Contextualbar, + ContextualbarHeader, + ContextualbarTitle, + ContextualbarClose, + ContextualbarDialog, +} from '../../../components/Contextualbar'; import CustomRoleUpsellModal from './CustomRoleUpsellModal'; import EditRolePageWithData from './EditRolePageWithData'; @@ -14,31 +20,32 @@ const PermissionsContextBar = (): ReactElement | null => { const context = useRouteParameter('context'); const router = useRoute('admin-permissions'); const setModal = useSetModal(); - const { data } = useIsEnterprise(); - const isEnterprise = !!data?.isEnterprise; + const hasCustomRolesModule = useHasLicenseModule('custom-roles') === true; const handleCloseContextualbar = useMutableCallback(() => { router.push({}); }); useEffect(() => { - if (context !== 'new' || isEnterprise) { + if (context !== 'new' || hasCustomRolesModule) { return; } setModal( setModal(null)} />); handleCloseContextualbar(); - }, [context, isEnterprise, handleCloseContextualbar, setModal]); + }, [context, hasCustomRolesModule, handleCloseContextualbar, setModal]); return ( (context && ( - - - {context === 'edit' ? t('Role_Editing') : t('New_role')} - - - - + + + + {context === 'edit' ? t('Role_Editing') : t('New_role')} + + + + + )) || null ); diff --git a/apps/meteor/client/views/admin/permissions/PermissionsTable/PermissionsTable.tsx b/apps/meteor/client/views/admin/permissions/PermissionsTable/PermissionsTable.tsx index 4b956654cd5e..583f9d237252 100644 --- a/apps/meteor/client/views/admin/permissions/PermissionsTable/PermissionsTable.tsx +++ b/apps/meteor/client/views/admin/permissions/PermissionsTable/PermissionsTable.tsx @@ -1,4 +1,5 @@ -import { Margins, Tabs, Button, Pagination } from '@rocket.chat/fuselage'; +import { css } from '@rocket.chat/css-in-js'; +import { Margins, Tabs, Button, Pagination, Palette } from '@rocket.chat/fuselage'; import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; import { useRoute, usePermission, useMethod, useTranslation, useSetModal } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; @@ -7,7 +8,7 @@ import React, { useState } from 'react'; import GenericNoResults from '../../../../components/GenericNoResults'; import { GenericTable, GenericTableHeader, GenericTableHeaderCell, GenericTableBody } from '../../../../components/GenericTable'; import { usePagination } from '../../../../components/GenericTable/hooks/usePagination'; -import Page from '../../../../components/Page'; +import { Page, PageHeader, PageContent } from '../../../../components/Page'; import CustomRoleUpsellModal from '../CustomRoleUpsellModal'; import PermissionsContextBar from '../PermissionsContextBar'; import { usePermissionsAndRoles } from '../hooks/usePermissionsAndRoles'; @@ -55,14 +56,34 @@ const PermissionsTable = ({ isEnterprise }: { isEnterprise: boolean }): ReactEle }); }); + const fixedColumnStyle = css` + tr > th { + &:first-child { + position: sticky; + left: 0; + background-color: ${Palette.surface['surface-light']}; + z-index: 12; + } + } + tr > td { + &:first-child { + position: sticky; + left: 0; + box-shadow: -1px 0 0 ${Palette.stroke['stroke-light']} inset; + background-color: ${Palette.surface['surface-light']}; + z-index: 11; + } + } + `; + return ( - + - + - + {permissions?.length === 0 && } {permissions?.length > 0 && ( <> - + {t('Name')} {roleList?.map(({ _id, name, description }) => ( @@ -120,7 +141,7 @@ const PermissionsTable = ({ isEnterprise }: { isEnterprise: boolean }): ReactEle )} - + diff --git a/apps/meteor/client/views/admin/permissions/PermissionsTable/RoleHeader.tsx b/apps/meteor/client/views/admin/permissions/PermissionsTable/RoleHeader.tsx index 69f99d67f114..006514ce6b31 100644 --- a/apps/meteor/client/views/admin/permissions/PermissionsTable/RoleHeader.tsx +++ b/apps/meteor/client/views/admin/permissions/PermissionsTable/RoleHeader.tsx @@ -25,7 +25,7 @@ const RoleHeader = ({ _id, name, description }: RoleHeaderProps): ReactElement = return ( - diff --git a/apps/meteor/client/views/admin/permissions/RoleForm.tsx b/apps/meteor/client/views/admin/permissions/RoleForm.tsx index e1517d7721fe..2a063ce7d05a 100644 --- a/apps/meteor/client/views/admin/permissions/RoleForm.tsx +++ b/apps/meteor/client/views/admin/permissions/RoleForm.tsx @@ -1,5 +1,5 @@ import type { SelectOption } from '@rocket.chat/fuselage'; -import { Box, Field, FieldLabel, FieldRow, FieldError, FieldHint, TextInput, Select, ToggleSwitch } from '@rocket.chat/fuselage'; +import { Field, FieldLabel, FieldRow, FieldError, FieldHint, TextInput, Select, ToggleSwitch } from '@rocket.chat/fuselage'; import { useTranslation } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; import React, { useMemo } from 'react'; @@ -57,16 +57,14 @@ const RoleForm = ({ className, editing = false, isProtected = false, isDisabled - + {t('Users must use Two Factor Authentication')} - - } - /> - - + } + /> + ); diff --git a/apps/meteor/client/views/admin/permissions/UsersInRole/UsersInRolePage.tsx b/apps/meteor/client/views/admin/permissions/UsersInRole/UsersInRolePage.tsx index 73de11407686..effb72691f93 100644 --- a/apps/meteor/client/views/admin/permissions/UsersInRole/UsersInRolePage.tsx +++ b/apps/meteor/client/views/admin/permissions/UsersInRole/UsersInRolePage.tsx @@ -6,7 +6,7 @@ import type { ReactElement } from 'react'; import React, { useRef } from 'react'; import { useForm, Controller } from 'react-hook-form'; -import Page from '../../../../components/Page'; +import { Page, PageHeader, PageContent } from '../../../../components/Page'; import RoomAutoComplete from '../../../../components/RoomAutoComplete'; import UserAutoCompleteMultiple from '../../../../components/UserAutoCompleteMultiple'; import UsersInRoleTable from './UsersInRoleTable'; @@ -61,12 +61,12 @@ const UsersInRolePage = ({ role }: { role: IRole }): ReactElement => { return ( - + - - + + {role.scope !== 'Users' && ( @@ -93,11 +93,10 @@ const UsersInRolePage = ({ role }: { role: IRole }): ReactElement => { )} /> - - - + +
@@ -108,7 +107,7 @@ const UsersInRolePage = ({ role }: { role: IRole }): ReactElement => { )} {role.scope !== 'Users' && !rid && {t('Select_a_room')}} - + ); }; diff --git a/apps/meteor/client/views/admin/permissions/UsersInRole/UsersInRoleTable/UsersInRoleTableRow.tsx b/apps/meteor/client/views/admin/permissions/UsersInRole/UsersInRoleTable/UsersInRoleTableRow.tsx index 1fbce402a21b..ea4b999d694e 100644 --- a/apps/meteor/client/views/admin/permissions/UsersInRole/UsersInRoleTable/UsersInRoleTableRow.tsx +++ b/apps/meteor/client/views/admin/permissions/UsersInRole/UsersInRoleTable/UsersInRoleTableRow.tsx @@ -1,12 +1,12 @@ import type { IUserInRole } from '@rocket.chat/core-typings'; import { Box, Button, Icon } from '@rocket.chat/fuselage'; import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; +import { UserAvatar } from '@rocket.chat/ui-avatar'; import type { ReactElement } from 'react'; import React, { memo } from 'react'; import { getUserEmailAddress } from '../../../../../../lib/getUserEmailAddress'; import { GenericTableRow, GenericTableCell } from '../../../../../components/GenericTable'; -import UserAvatar from '../../../../../components/avatar/UserAvatar'; type UsersInRoleTableRowProps = { user: IUserInRole; diff --git a/apps/meteor/client/views/admin/rooms/EditRoom.tsx b/apps/meteor/client/views/admin/rooms/EditRoom.tsx index 8130f2e9ec8b..cc165bca215b 100644 --- a/apps/meteor/client/views/admin/rooms/EditRoom.tsx +++ b/apps/meteor/client/views/admin/rooms/EditRoom.tsx @@ -11,19 +11,20 @@ import { FieldHint, ToggleSwitch, TextAreaInput, + FieldError, } from '@rocket.chat/fuselage'; -import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; -import { useTranslation } from '@rocket.chat/ui-contexts'; -import type { ReactElement } from 'react'; -import React, { useMemo } from 'react'; +import { useEffectEvent, useUniqueId } from '@rocket.chat/fuselage-hooks'; +import { useEndpoint, useRouter, useToastMessageDispatch, useTranslation } from '@rocket.chat/ui-contexts'; +import React from 'react'; +import { useForm, Controller } from 'react-hook-form'; -import { RoomSettingsEnum } from '../../../../definition/IRoomTypeConfig'; import { ContextualbarScrollableContent, ContextualbarFooter } from '../../../components/Contextualbar'; import RoomAvatarEditor from '../../../components/avatar/RoomAvatarEditor'; -import { useEndpointAction } from '../../../hooks/useEndpointAction'; -import { useForm } from '../../../hooks/useForm'; +import { getDirtyFields } from '../../../lib/getDirtyFields'; import { roomCoordinator } from '../../../lib/rooms/roomCoordinator'; +import { useArchiveRoom } from '../../hooks/roomActions/useArchiveRoom'; import { useDeleteRoom } from '../../hooks/roomActions/useDeleteRoom'; +import { useEditAdminRoomPermissions } from './useEditAdminRoomPermissions'; type EditRoomProps = { room: Pick; @@ -61,242 +62,302 @@ const getInitialValues = (room: Pick): EditRoomFormV roomAvatar: undefined, }); -const EditRoom = ({ room, onChange, onDelete }: EditRoomProps): ReactElement => { +const EditRoom = ({ room, onChange, onDelete }: EditRoomProps) => { const t = useTranslation(); - - const { values, handlers, hasUnsavedChanges, reset } = useForm(getInitialValues(room)); - - const [canViewName, canViewTopic, canViewAnnouncement, canViewArchived, canViewDescription, canViewType, canViewReadOnly] = - useMemo(() => { - const isAllowed = roomCoordinator.getRoomDirectives(room.t).allowRoomSettingChange; - return [ - isAllowed?.(room, RoomSettingsEnum.NAME), - isAllowed?.(room, RoomSettingsEnum.TOPIC), - isAllowed?.(room, RoomSettingsEnum.ANNOUNCEMENT), - isAllowed?.(room, RoomSettingsEnum.ARCHIVE_OR_UNARCHIVE), - isAllowed?.(room, RoomSettingsEnum.DESCRIPTION), - isAllowed?.(room, RoomSettingsEnum.TYPE), - isAllowed?.(room, RoomSettingsEnum.READ_ONLY), - isAllowed?.(room, RoomSettingsEnum.REACT_WHEN_READ_ONLY), - ]; - }, [room]); + const router = useRouter(); + const dispatchToastMessage = useToastMessageDispatch(); const { - roomName, - roomType, - readOnly, - reactWhenReadOnly, - archived, - isDefault, - favorite, - featured, - roomTopic, - roomAvatar, - roomDescription, - roomAnnouncement, - } = values as EditRoomFormValues; + control, + watch, + reset, + handleSubmit, + formState: { isDirty, errors, dirtyFields }, + } = useForm({ values: getInitialValues(room) }); const { - handleIsDefault, - handleFavorite, - handleFeatured, - handleRoomName, - handleRoomType, - handleReadOnly, - handleReactWhenReadOnly, - handleArchived, - handleRoomAvatar, - handleRoomTopic, - handleRoomDescription, - handleRoomAnnouncement, - } = handlers; + canViewName, + canViewTopic, + canViewAnnouncement, + canViewArchived, + canViewDescription, + canViewType, + canViewReadOnly, + canViewReactWhenReadOnly, + } = useEditAdminRoomPermissions(room); + + const { roomType, readOnly, archived, isDefault } = watch(); - const changeArchivation = archived !== !!room.archived; + const changeArchiving = archived !== !!room.archived; const { handleDelete, canDeleteRoom, isDeleting } = useDeleteRoom(room, { reload: onDelete }); - const archiveSelector = room.archived ? 'unarchive' : 'archive'; - const archiveMessage = room.archived ? 'Room_has_been_unarchived' : 'Room_has_been_archived'; + const saveAction = useEndpoint('POST', '/v1/rooms.saveRoomSettings'); - const saveAction = useEndpointAction('POST', '/v1/rooms.saveRoomSettings', { - successMessage: t('Room_updated_successfully'), - }); - const archiveAction = useEndpointAction('POST', '/v1/rooms.changeArchivationState', { successMessage: t(archiveMessage) }); + const handleArchive = useArchiveRoom(room); + + const handleUpdateRoomData = useEffectEvent(async ({ isDefault, favorite, ...formData }) => { + const data = getDirtyFields(formData, dirtyFields); + delete data.archived; + delete data.favorite; - const handleSave = useMutableCallback(async () => { - const save = (): Promise<{ success: boolean; rid: string }> => - saveAction({ + try { + await saveAction({ rid: room._id, - roomName: roomType === 'd' ? undefined : roomName, - roomTopic, - roomType, - readOnly, default: isDefault, favorite: { defaultValue: isDefault, favorite }, - featured, - reactWhenReadOnly, - roomDescription, - roomAnnouncement, - roomAvatar, + ...data, }); - const archive = (): Promise<{ success: boolean }> => archiveAction({ rid: room._id, action: archiveSelector }); - - const promises = []; - hasUnsavedChanges && promises.push(save()); - changeArchivation && promises.push(archive()); - await Promise.all(promises); - onChange(); + dispatchToastMessage({ type: 'success', message: t('Room_updated_successfully') }); + onChange(); + router.navigate('/admin/rooms'); + } catch (error) { + dispatchToastMessage({ type: 'error', message: error }); + } }); - const changeRoomType = useMutableCallback(() => { - handleRoomType(roomType === 'p' ? 'c' : 'p'); - }); + const handleSave = useEffectEvent((data) => + Promise.all([isDirty && handleUpdateRoomData(data), changeArchiving && handleArchive()].filter(Boolean)), + ); + + const formId = useUniqueId(); + const roomNameField = useUniqueId(); + const ownerField = useUniqueId(); + const roomDescription = useUniqueId(); + const roomAnnouncement = useUniqueId(); + const roomTopicField = useUniqueId(); + const roomTypeField = useUniqueId(); + const readOnlyField = useUniqueId(); + const reactWhenReadOnly = useUniqueId(); + const archivedField = useUniqueId(); + const isDefaultField = useUniqueId(); + const favoriteField = useUniqueId(); + const featuredField = useUniqueId(); return ( <> - e.preventDefault())}> + {room.t !== 'd' && ( - + ( + + )} + /> )} - {t('Name')} + + {t('Name')} + - + ( + + )} + /> + {errors?.roomName && ( + + {errors.roomName.message} + + )} {room.t !== 'd' && ( <> {room.u && ( - {t('Owner')} + {t('Owner')} - {room.u?.username} + )} {canViewDescription && ( - {t('Description')} + {t('Description')} - ( + + )} /> )} {canViewAnnouncement && ( - {t('Announcement')} + {t('Announcement')} - ( + + )} /> )} {canViewTopic && ( - {t('Topic')} + {t('Topic')} - + } + /> )} {canViewType && ( - - {t('Private')} - - - - - {t('Just_invited_people_can_access_this_channel')} + + {t('Private')} + ( + onChange(value === 'p' ? 'c' : 'p')} + aria-describedby={`${roomTypeField}-hint`} + /> + )} + /> + + {t('Just_invited_people_can_access_this_channel')} )} {canViewReadOnly && ( - - {t('Read_only')} - - - - - {t('Only_authorized_users_can_write_new_messages')} + + {t('Read_only')} + ( + + )} + /> + + {t('Only_authorized_users_can_write_new_messages')} )} - {readOnly && ( + {canViewReactWhenReadOnly && readOnly && ( - - {t('React_when_read_only')} - - - - - {t('React_when_read_only_changed_successfully')} + + {t('React_when_read_only')} + ( + + )} + /> + + {t('React_when_read_only_changed_successfully')} )} {canViewArchived && ( - - {t('Room_archivation_state_true')} - - - - + + {t('Room_archivation_state_true')} + ( + + )} + /> + )} )} - - {t('Default')} - - - - + + {t('Default')} + ( + + )} + /> + - - {t('Favorite')} - - - - + + {t('Favorite')} + ( + + )} + /> + - - {t('Featured')} - - - - + + {t('Featured')} + ( + + )} + /> + - - - - - + + + + + ); diff --git a/apps/meteor/client/views/admin/rooms/EditRoomContextBar.tsx b/apps/meteor/client/views/admin/rooms/EditRoomContextBar.tsx deleted file mode 100644 index e99841c730e3..000000000000 --- a/apps/meteor/client/views/admin/rooms/EditRoomContextBar.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import { usePermission } from '@rocket.chat/ui-contexts'; -import type { ReactElement } from 'react'; -import React from 'react'; - -import NotAuthorizedPage from '../../notAuthorized/NotAuthorizedPage'; -import EditRoomWithData from './EditRoomWithData'; - -const EditRoomContextBar = ({ rid, onReload }: { rid: string | undefined; onReload: () => void }): ReactElement => { - const canViewRoomAdministration = usePermission('view-room-administration'); - return canViewRoomAdministration ? : ; -}; - -export default EditRoomContextBar; diff --git a/apps/meteor/client/views/admin/rooms/EditRoomWithData.tsx b/apps/meteor/client/views/admin/rooms/EditRoomWithData.tsx index a3d959fa4781..6bd487c8218a 100644 --- a/apps/meteor/client/views/admin/rooms/EditRoomWithData.tsx +++ b/apps/meteor/client/views/admin/rooms/EditRoomWithData.tsx @@ -1,16 +1,26 @@ -import { Box, Skeleton } from '@rocket.chat/fuselage'; -import { useEndpoint, useToastMessageDispatch } from '@rocket.chat/ui-contexts'; +import type { IRoom } from '@rocket.chat/core-typings'; +import { useEndpoint, useRouter, useToastMessageDispatch, useTranslation } from '@rocket.chat/ui-contexts'; import { useQuery } from '@tanstack/react-query'; -import type { FC } from 'react'; import React from 'react'; +import { + Contextualbar, + ContextualbarHeader, + ContextualbarTitle, + ContextualbarClose, + ContextualbarSkeleton, +} from '../../../components/Contextualbar'; import EditRoom from './EditRoom'; -const EditRoomWithData: FC<{ rid?: string; onReload: () => void }> = ({ rid, onReload }) => { - const getAdminRooms = useEndpoint('GET', '/v1/rooms.adminRooms.getRoom'); +type EditRoomWithDataProps = { rid?: IRoom['_id']; onReload: () => void }; +const EditRoomWithData = ({ rid, onReload }: EditRoomWithDataProps) => { + const t = useTranslation(); + const router = useRouter(); const dispatchToastMessage = useToastMessageDispatch(); + const getAdminRooms = useEndpoint('GET', '/v1/rooms.adminRooms.getRoom'); + const { data, isLoading, refetch } = useQuery( ['rooms', rid, 'admin'], async () => { @@ -25,16 +35,7 @@ const EditRoomWithData: FC<{ rid?: string; onReload: () => void }> = ({ rid, onR ); if (isLoading) { - return ( - - - - - - - - - ); + return ; } const handleChange = (): void => { @@ -46,7 +47,15 @@ const EditRoomWithData: FC<{ rid?: string; onReload: () => void }> = ({ rid, onR onReload(); }; - return data ? : null; + return data ? ( + + + {t('Room_Info')} + router.navigate('/admin/rooms')} /> + + + + ) : null; }; export default EditRoomWithData; diff --git a/apps/meteor/client/views/admin/rooms/RoomRow.tsx b/apps/meteor/client/views/admin/rooms/RoomRow.tsx index 2c0dbb8c31a6..73a30e647764 100644 --- a/apps/meteor/client/views/admin/rooms/RoomRow.tsx +++ b/apps/meteor/client/views/admin/rooms/RoomRow.tsx @@ -2,11 +2,11 @@ import { isDiscussion } from '@rocket.chat/core-typings'; import type { IRoom, RoomAdminFieldsType } from '@rocket.chat/core-typings'; import { Box, Icon } from '@rocket.chat/fuselage'; import { useMediaQuery } from '@rocket.chat/fuselage-hooks'; +import { RoomAvatar } from '@rocket.chat/ui-avatar'; import { useRouter, useTranslation } from '@rocket.chat/ui-contexts'; import React, { useCallback } from 'react'; import { GenericTableCell, GenericTableRow } from '../../../components/GenericTable'; -import RoomAvatar from '../../../components/avatar/RoomAvatar'; import { roomCoordinator } from '../../../lib/rooms/roomCoordinator'; const roomTypeI18nMap = { diff --git a/apps/meteor/client/views/admin/rooms/RoomsPage.tsx b/apps/meteor/client/views/admin/rooms/RoomsPage.tsx index 08d384325505..0c8425726297 100644 --- a/apps/meteor/client/views/admin/rooms/RoomsPage.tsx +++ b/apps/meteor/client/views/admin/rooms/RoomsPage.tsx @@ -1,42 +1,32 @@ -import { useRouteParameter, useRoute, useTranslation } from '@rocket.chat/ui-contexts'; +import { useRouteParameter, useTranslation } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; import React, { useRef } from 'react'; -import { Contextualbar, ContextualbarHeader, ContextualbarTitle, ContextualbarClose } from '../../../components/Contextualbar'; -import Page from '../../../components/Page'; -import EditRoomContextBar from './EditRoomContextBar'; +import { ContextualbarDialog } from '../../../components/Contextualbar'; +import { Page, PageHeader, PageContent } from '../../../components/Page'; +import EditRoomWithData from './EditRoomWithData'; import RoomsTable from './RoomsTable'; const RoomsPage = (): ReactElement => { const t = useTranslation(); - const context = useRouteParameter('context'); const id = useRouteParameter('id'); - - const roomsRoute = useRoute('admin-rooms'); - - const handleContextualbarCloseButtonClick = (): void => { - roomsRoute.push({}); - }; + const context = useRouteParameter('context'); const reloadRef = useRef(() => null); return ( - - + + - + {context && ( - - - {t('Room_Info')} - - - - + + + )} ); diff --git a/apps/meteor/client/views/admin/rooms/useEditAdminRoomPermissions.ts b/apps/meteor/client/views/admin/rooms/useEditAdminRoomPermissions.ts new file mode 100644 index 000000000000..2f7d6cb7e0b9 --- /dev/null +++ b/apps/meteor/client/views/admin/rooms/useEditAdminRoomPermissions.ts @@ -0,0 +1,41 @@ +import type { IRoom, RoomAdminFieldsType } from '@rocket.chat/core-typings'; +import { useMemo } from 'react'; + +import { RoomSettingsEnum } from '../../../../definition/IRoomTypeConfig'; +import { roomCoordinator } from '../../../lib/rooms/roomCoordinator'; + +export const useEditAdminRoomPermissions = (room: Pick) => { + const [ + canViewName, + canViewTopic, + canViewAnnouncement, + canViewArchived, + canViewDescription, + canViewType, + canViewReadOnly, + canViewReactWhenReadOnly, + ] = useMemo(() => { + const isAllowed = roomCoordinator.getRoomDirectives(room.t).allowRoomSettingChange; + return [ + isAllowed?.(room, RoomSettingsEnum.NAME), + isAllowed?.(room, RoomSettingsEnum.TOPIC), + isAllowed?.(room, RoomSettingsEnum.ANNOUNCEMENT), + isAllowed?.(room, RoomSettingsEnum.ARCHIVE_OR_UNARCHIVE), + isAllowed?.(room, RoomSettingsEnum.DESCRIPTION), + isAllowed?.(room, RoomSettingsEnum.TYPE), + isAllowed?.(room, RoomSettingsEnum.READ_ONLY), + isAllowed?.(room, RoomSettingsEnum.REACT_WHEN_READ_ONLY), + ]; + }, [room]); + + return { + canViewName, + canViewTopic, + canViewAnnouncement, + canViewArchived, + canViewDescription, + canViewType, + canViewReadOnly, + canViewReactWhenReadOnly, + }; +}; diff --git a/apps/meteor/client/views/admin/routes.tsx b/apps/meteor/client/views/admin/routes.tsx index bea10777d66b..db09a6d436d6 100644 --- a/apps/meteor/client/views/admin/routes.tsx +++ b/apps/meteor/client/views/admin/routes.tsx @@ -1,6 +1,5 @@ import { lazy } from 'react'; -import type { UpgradeTabVariant } from '../../../lib/upgradeTab'; import { createRouteGroup } from '../../lib/createRouteGroup'; declare module '@rocket.chat/ui-contexts' { @@ -13,7 +12,11 @@ declare module '@rocket.chat/ui-contexts' { pathname: `/admin/sounds${`/${string}` | ''}${`/${string}` | ''}`; pattern: '/admin/sounds/:context?/:id?'; }; - 'admin-info': { + 'info': { + pathname: '/admin/info'; + pattern: '/admin/info'; + }; + 'workspace': { pathname: '/admin/workspace'; pattern: '/admin/workspace'; }; @@ -65,10 +68,6 @@ declare module '@rocket.chat/ui-contexts' { pathname: '/admin/invites'; pattern: '/admin/invites'; }; - 'cloud': { - pathname: `/admin/registration${`/${string}` | ''}`; - pattern: '/admin/registration/:page?'; - }; 'admin-view-logs': { pathname: '/admin/reports'; pattern: '/admin/reports'; @@ -97,13 +96,13 @@ declare module '@rocket.chat/ui-contexts' { pathname: `/admin/engagement${`/${string}` | ''}`; pattern: '/admin/engagement/:tab?'; }; - 'upgrade': { - pathname: `/admin/upgrade${`/${UpgradeTabVariant}` | ''}`; - pattern: '/admin/upgrade/:type?'; - }; 'moderation-console': { - pathname: `/admin/moderation${`/${string}` | ''}${`/${string}` | ''}`; - pattern: '/admin/moderation/:context?/:id?'; + pathname: `/admin/moderation${`/${string}` | ''}${`/${string}` | ''}${`/${string}` | ''}`; + pattern: '/admin/moderation/:tab?/:context?/:id?'; + }; + 'subscription': { + pathname: `/admin/subscription`; + pattern: '/admin/subscription'; }; } } @@ -119,9 +118,15 @@ registerAdminRoute('/sounds/:context?/:id?', { component: lazy(() => import('./customSounds/CustomSoundsRoute')), }); +/** @deprecated in favor of `/workspace` route, this is a fallback to work in Mobile app, should be removed in the next major */ +registerAdminRoute('/info', { + name: 'info', + component: lazy(() => import('./workspace/WorkspaceRoute')), +}); + registerAdminRoute('/workspace', { - name: 'admin-info', - component: lazy(() => import('./info/InformationRoute')), + name: 'workspace', + component: lazy(() => import('./workspace/WorkspaceRoute')), }); registerAdminRoute('/import', { @@ -188,11 +193,6 @@ registerAdminRoute('/invites', { component: lazy(() => import('./invites/InvitesRoute')), }); -registerAdminRoute('/registration/:page?', { - name: 'cloud', - component: lazy(() => import('./cloud/CloudRoute')), -}); - registerAdminRoute('/reports', { name: 'admin-view-logs', component: lazy(() => import('./viewLogs/ViewLogsRoute')), @@ -218,12 +218,7 @@ registerAdminRoute('/settings/:group?', { component: lazy(() => import('./settings/SettingsRoute')), }); -registerAdminRoute('/upgrade/:type?', { - name: 'upgrade', - component: lazy(() => import('./upgrade/UpgradePage')), -}); - -registerAdminRoute('/moderation/:context?/:id?', { +registerAdminRoute('/moderation/:tab?/:context?/:id?', { name: 'moderation-console', component: lazy(() => import('./moderation/ModerationConsoleRoute')), }); @@ -237,3 +232,8 @@ registerAdminRoute('/device-management/:context?/:id?', { name: 'device-management', component: lazy(() => import('../../../ee/client/views/admin/deviceManagement/DeviceManagementAdminRoute')), }); + +registerAdminRoute('/subscription', { + name: 'subscription', + component: lazy(() => import('./subscription/SubscriptionRoute')), +}); diff --git a/apps/meteor/client/views/admin/settings/GroupPage.tsx b/apps/meteor/client/views/admin/settings/GroupPage.tsx index 62b20b6c5048..9e4ef1fa3ab8 100644 --- a/apps/meteor/client/views/admin/settings/GroupPage.tsx +++ b/apps/meteor/client/views/admin/settings/GroupPage.tsx @@ -14,7 +14,7 @@ import { import type { FC, ReactNode, FormEvent, MouseEvent } from 'react'; import React, { useMemo, memo } from 'react'; -import Page from '../../../components/Page'; +import { Page, PageHeader, PageScrollableContentWithShadow, PageFooter } from '../../../components/Page'; import type { EditableSetting } from '../EditableSettingsContext'; import { useEditableSettingsDispatch, useEditableSettings } from '../EditableSettingsContext'; import GroupPageSkeleton from './GroupPageSkeleton'; @@ -160,14 +160,14 @@ const GroupPage: FC = ({ return ( - + {headerButtons} - + {tabs} {isCustom ? ( children ) : ( - + {i18nDescription && isTranslationKey(i18nDescription) && t.has(i18nDescription) && ( @@ -177,9 +177,9 @@ const GroupPage: FC = ({ {children} - + )} - + {changedEditableSettings.length > 0 && ( - + ) : undefined, [shouldDisableEnterprise, t], ); + const label = useMemo(() => { + if (!shouldDisableEnterprise) { + return labelText; + } + + return ( + <> + + {labelText} + + {t('Premium')} + + ); + }, [labelText, shouldDisableEnterprise, t]); + const hasResetButton = !shouldDisableEnterprise && !readonly && @@ -133,7 +147,7 @@ function Setting({ className = undefined, settingId, sectionChanged }: SettingPr return ( { +const SettingsGroupCard = ({ id, title, description, ...props }: SettingsGroupCardProps): ReactElement => { const t = useTranslation(); const router = useRouter(); + const cardId = useUniqueId(); + const descriptionId = useUniqueId(); return ( - - {t(title)} - - + + {t(title)} + + {description && t.has(description) && } - + - + ); }; diff --git a/apps/meteor/client/views/admin/settings/SettingsPage.tsx b/apps/meteor/client/views/admin/settings/SettingsPage.tsx index f1141c399a56..f82e16ce637c 100644 --- a/apps/meteor/client/views/admin/settings/SettingsPage.tsx +++ b/apps/meteor/client/views/admin/settings/SettingsPage.tsx @@ -1,4 +1,4 @@ -import { Icon, SearchInput, Skeleton, Grid } from '@rocket.chat/fuselage'; +import { Icon, SearchInput, Skeleton, CardGrid } from '@rocket.chat/fuselage'; import { useDebouncedValue } from '@rocket.chat/fuselage-hooks'; import type { TranslationKey } from '@rocket.chat/ui-contexts'; import { useIsSettingsContextLoading, useTranslation } from '@rocket.chat/ui-contexts'; @@ -6,7 +6,7 @@ import type { ReactElement } from 'react'; import React, { useCallback, useState } from 'react'; import GenericNoResults from '../../../components/GenericNoResults'; -import Page from '../../../components/Page'; +import { Page, PageHeader, PageScrollableContentWithShadow } from '../../../components/Page'; import PageBlockWithBorder from '../../../components/Page/PageBlockWithBorder'; import SettingsGroupCard from './SettingsGroupCard'; import { useSettingsGroups } from './hooks/useSettingsGroups'; @@ -21,29 +21,37 @@ const SettingsPage = (): ReactElement => { return ( - - + } /> - + {isLoadingGroups && } - + {!isLoadingGroups && !!groups.length && groups.map((group) => ( - - - + ))} - + + {!isLoadingGroups && !groups.length && } - + ); }; diff --git a/apps/meteor/client/views/admin/settings/groups/VoipGroupPage.tsx b/apps/meteor/client/views/admin/settings/groups/VoipGroupPage.tsx index 601e14d0c37b..82b55a152563 100644 --- a/apps/meteor/client/views/admin/settings/groups/VoipGroupPage.tsx +++ b/apps/meteor/client/views/admin/settings/groups/VoipGroupPage.tsx @@ -5,7 +5,7 @@ import { useSetting, useTranslation } from '@rocket.chat/ui-contexts'; import React, { memo, useMemo, useState } from 'react'; import GenericNoResults from '../../../../components/GenericNoResults'; -import Page from '../../../../components/Page'; +import { PageScrollableContentWithShadow } from '../../../../components/Page'; import { useEditableSettingsGroupSections } from '../../EditableSettingsContext'; import GroupPage from '../GroupPage'; import Section from '../Section'; @@ -50,7 +50,7 @@ function VoipGroupPage({ _id, ...group }: ISetting): JSX.Element { {tab === 'Extensions' ? ( ExtensionsPageComponent ) : ( - + {sections.map((sectionName) => ( @@ -58,7 +58,7 @@ function VoipGroupPage({ _id, ...group }: ISetting): JSX.Element { ))} - + )} ); diff --git a/apps/meteor/client/views/admin/settings/groups/voip/VoipExtensionsPage.tsx b/apps/meteor/client/views/admin/settings/groups/voip/VoipExtensionsPage.tsx index 8841a607fa87..7494a249818c 100644 --- a/apps/meteor/client/views/admin/settings/groups/voip/VoipExtensionsPage.tsx +++ b/apps/meteor/client/views/admin/settings/groups/voip/VoipExtensionsPage.tsx @@ -1,4 +1,5 @@ import { Box, Chip, Button, Pagination } from '@rocket.chat/fuselage'; +import { UserAvatar } from '@rocket.chat/ui-avatar'; import { useSetModal, useTranslation, useEndpoint } from '@rocket.chat/ui-contexts'; import { useQuery } from '@tanstack/react-query'; import React, { useMemo } from 'react'; @@ -14,8 +15,7 @@ import { GenericTableLoadingRow, } from '../../../../../components/GenericTable'; import { usePagination } from '../../../../../components/GenericTable/hooks/usePagination'; -import Page from '../../../../../components/Page'; -import UserAvatar from '../../../../../components/avatar/UserAvatar'; +import { PageContent } from '../../../../../components/Page'; import AssignAgentButton from './AssignAgentButton'; import AssignAgentModal from './AssignAgentModal'; import RemoveAgentButton from './RemoveAgentButton'; @@ -56,7 +56,7 @@ const VoipExtensionsPage = () => { ); return ( - + {data?.total} {t('Extensions')} @@ -134,7 +134,7 @@ const VoipExtensionsPage = () => { /> )} - + ); }; diff --git a/apps/meteor/client/views/admin/settings/inputs/ActionSettingInput.stories.tsx b/apps/meteor/client/views/admin/settings/inputs/ActionSettingInput.stories.tsx index da0e68443dc3..5c8a468eed80 100644 --- a/apps/meteor/client/views/admin/settings/inputs/ActionSettingInput.stories.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/ActionSettingInput.stories.tsx @@ -1,9 +1,8 @@ import { Field } from '@rocket.chat/fuselage'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods, TranslationKey } from '@rocket.chat/ui-contexts'; import type { ComponentMeta, ComponentStory } from '@storybook/react'; import React from 'react'; -import type keys from '../../../../../packages/rocketchat-i18n/i18n/en.i18n.json'; import ActionSettingInput from './ActionSettingInput'; export default { @@ -17,14 +16,14 @@ const Template: ComponentStory = (args) => => { try { - const data: { message: TranslationKey; params: string[] } = await actionMethod(); + const data: { message: TranslationKey; params?: string[] } = await actionMethod(); - dispatchToastMessage({ type: 'success', message: t(data.message, ...data.params) }); + const params = data.params || []; + dispatchToastMessage({ type: 'success', message: t(data.message, ...params) }); } catch (error) { dispatchToastMessage({ type: 'error', message: error }); } diff --git a/apps/meteor/client/views/admin/settings/inputs/AssetSettingInput.tsx b/apps/meteor/client/views/admin/settings/inputs/AssetSettingInput.tsx index f3122a23295b..9ebde75e7316 100644 --- a/apps/meteor/client/views/admin/settings/inputs/AssetSettingInput.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/AssetSettingInput.tsx @@ -1,20 +1,18 @@ -import { Button, FieldLabel, FieldRow, Icon } from '@rocket.chat/fuselage'; +import { Box, Button, Field, FieldLabel, FieldRow, Icon } from '@rocket.chat/fuselage'; import { Random } from '@rocket.chat/random'; import { useToastMessageDispatch, useEndpoint, useTranslation, useUpload } from '@rocket.chat/ui-contexts'; import type { ChangeEventHandler, DragEvent, ReactElement, SyntheticEvent } from 'react'; import React from 'react'; import './AssetSettingInput.styles.css'; +import type { SettingInputProps } from './types'; -type AssetSettingInputProps = { - _id: string; - label: string; - value?: { url: string }; +type AssetSettingInputProps = Omit, 'onChangeValue'> & { asset?: any; fileConstraints?: { extensions: string[] }; }; -function AssetSettingInput({ _id, label, value, asset, fileConstraints }: AssetSettingInputProps): ReactElement { +function AssetSettingInput({ _id, label, value, asset, required, disabled, fileConstraints }: AssetSettingInputProps): ReactElement { const t = useTranslation(); const dispatchToastMessage = useToastMessageDispatch(); @@ -57,8 +55,8 @@ function AssetSettingInput({ _id, label, value, asset, fileConstraints }: AssetS }; return ( - <> - + + {label} @@ -77,24 +75,25 @@ function AssetSettingInput({ _id, label, value, asset, fileConstraints }: AssetS )}
{value?.url ? ( - ) : ( -
+ {t('Select_file')} -
+ )}
- + ); } diff --git a/apps/meteor/client/views/admin/settings/inputs/BooleanSettingInput.tsx b/apps/meteor/client/views/admin/settings/inputs/BooleanSettingInput.tsx index 308e781e8e46..cf18a6f0d1df 100644 --- a/apps/meteor/client/views/admin/settings/inputs/BooleanSettingInput.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/BooleanSettingInput.tsx @@ -1,24 +1,18 @@ -import { FieldLabel, FieldRow, ToggleSwitch } from '@rocket.chat/fuselage'; +import { Box, Field, FieldLabel, FieldRow, ToggleSwitch } from '@rocket.chat/fuselage'; import type { ReactElement, SyntheticEvent } from 'react'; import React from 'react'; import ResetSettingButton from '../ResetSettingButton'; +import type { SettingInputProps } from './types'; + +type BooleanSettingInputProps = SettingInputProps; -type BooleanSettingInputProps = { - _id: string; - label: string; - disabled?: boolean; - readonly?: boolean; - value: boolean; - hasResetButton: boolean; - onChangeValue: (value: boolean) => void; - onResetButtonClick: () => void; -}; function BooleanSettingInput({ _id, label, disabled, readonly, + required, value, hasResetButton, onChangeValue, @@ -30,20 +24,23 @@ function BooleanSettingInput({ }; return ( - - - - {label} - - {hasResetButton && } - + + + + {label} + + + {hasResetButton && } + + + + ); } diff --git a/apps/meteor/client/views/admin/settings/inputs/CodeMirror/CodeMirrorBox.tsx b/apps/meteor/client/views/admin/settings/inputs/CodeMirror/CodeMirrorBox.tsx index a633bbd533c4..ce6d2dfd6000 100644 --- a/apps/meteor/client/views/admin/settings/inputs/CodeMirror/CodeMirrorBox.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/CodeMirror/CodeMirrorBox.tsx @@ -2,10 +2,10 @@ import { css } from '@rocket.chat/css-in-js'; import { Box, Button, ButtonGroup } from '@rocket.chat/fuselage'; import { useToggle } from '@rocket.chat/fuselage-hooks'; import { useTranslation } from '@rocket.chat/ui-contexts'; -import type { ReactElement } from 'react'; +import type { ReactElement, ReactNode } from 'react'; import React from 'react'; -const CodeMirrorBox = ({ label, children }: { label: string; children: ReactElement }) => { +const CodeMirrorBox = ({ label, children }: { label: ReactNode; children: ReactElement }) => { const t = useTranslation(); const [fullScreen, toggleFullScreen] = useToggle(false); @@ -40,11 +40,13 @@ const CodeMirrorBox = ({ label, children }: { label: string; children: ReactElem )} {children} - - - + + + + + ); }; diff --git a/apps/meteor/client/views/admin/settings/inputs/CodeSettingInput.tsx b/apps/meteor/client/views/admin/settings/inputs/CodeSettingInput.tsx index 85698b66e2b7..f019e4742bf4 100644 --- a/apps/meteor/client/views/admin/settings/inputs/CodeSettingInput.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/CodeSettingInput.tsx @@ -1,24 +1,17 @@ -import { Box, FieldLabel, FieldHint, Flex } from '@rocket.chat/fuselage'; +import { FieldLabel, FieldHint, FieldRow, Field } from '@rocket.chat/fuselage'; import type { ReactElement } from 'react'; import React from 'react'; import ResetSettingButton from '../ResetSettingButton'; import CodeMirror from './CodeMirror'; import CodeMirrorBox from './CodeMirror/CodeMirrorBox'; +import type { SettingInputProps } from './types'; -type CodeSettingInputProps = { - _id: string; - label: string; +type CodeSettingInputProps = SettingInputProps & { hint: string; - value?: string; code: string; - placeholder?: string; readonly: boolean; - autocomplete: boolean; disabled: boolean; - hasResetButton: boolean; - onChangeValue: (value: string) => void; - onResetButtonClick: () => void; }; function CodeSettingInput({ @@ -31,6 +24,7 @@ function CodeSettingInput({ readonly, autocomplete, disabled, + required, hasResetButton, onChangeValue, onResetButtonClick, @@ -40,16 +34,14 @@ function CodeSettingInput({ }; return ( - <> - - - - {label} - - {hasResetButton && } - - {hint && {hint}} - + + + + {label} + + {hasResetButton && } + + {hint && {hint}} - + ); } diff --git a/apps/meteor/client/views/admin/settings/inputs/ColorSettingInput.tsx b/apps/meteor/client/views/admin/settings/inputs/ColorSettingInput.tsx index 2b2e463346be..dab9e63f7435 100644 --- a/apps/meteor/client/views/admin/settings/inputs/ColorSettingInput.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/ColorSettingInput.tsx @@ -1,26 +1,18 @@ -import { Box, FieldLabel, FieldRow, FieldHint, Flex, InputBox, Margins, TextInput, Select } from '@rocket.chat/fuselage'; +import { FieldLabel, FieldRow, FieldHint, Flex, InputBox, Margins, TextInput, Select, Field } from '@rocket.chat/fuselage'; import type { TranslationKey } from '@rocket.chat/ui-contexts'; import { useTranslation } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; import React, { useCallback } from 'react'; import ResetSettingButton from '../ResetSettingButton'; +import type { SettingInputProps } from './types'; -type ColorSettingInputProps = { - _id: string; - label: string; +type ColorSettingInputProps = SettingInputProps & { value: string; editor: string; allowedTypes?: TranslationKey[]; - placeholder?: string; - readonly?: boolean; - autocomplete?: boolean; - disabled?: boolean; - hasResetButton?: boolean; - onChangeValue?: (value: string) => void; - onChangeEditor?: (value: string) => void; - onResetButtonClick?: () => void; }; + function ColorSettingInput({ _id, label, @@ -31,6 +23,7 @@ function ColorSettingInput({ readonly, autocomplete, disabled, + required, hasResetButton, onChangeValue, onChangeEditor, @@ -53,15 +46,13 @@ function ColorSettingInput({ ); return ( - <> - - - - {label} - - {hasResetButton && } - - + + + + {label} + + {hasResetButton && } + @@ -107,7 +98,7 @@ function ColorSettingInput({ Variable name: {_id.replace(/theme-color-/, '@')} - + ); } diff --git a/apps/meteor/client/views/admin/settings/inputs/FontSettingInput.tsx b/apps/meteor/client/views/admin/settings/inputs/FontSettingInput.tsx index 35b255b4e756..4508f52222ba 100644 --- a/apps/meteor/client/views/admin/settings/inputs/FontSettingInput.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/FontSettingInput.tsx @@ -1,21 +1,14 @@ -import { Box, FieldLabel, FieldRow, Flex, TextInput } from '@rocket.chat/fuselage'; +import { Field, FieldLabel, FieldRow, TextInput } from '@rocket.chat/fuselage'; import type { FormEventHandler, ReactElement } from 'react'; import React from 'react'; import ResetSettingButton from '../ResetSettingButton'; +import type { SettingInputProps } from './types'; -type FontSettingInputProps = { - _id: string; - label: string; +type FontSettingInputProps = SettingInputProps & { value: string; - placeholder?: string; - readonly?: boolean; - autocomplete?: boolean; - disabled?: boolean; - hasResetButton?: boolean; - onChangeValue?: (value: string) => void; - onResetButtonClick?: () => void; }; + function FontSettingInput({ _id, label, @@ -24,6 +17,7 @@ function FontSettingInput({ readonly, autocomplete, disabled, + required, hasResetButton, onChangeValue, onResetButtonClick, @@ -33,15 +27,13 @@ function FontSettingInput({ }; return ( - <> - - - - {label} - - {hasResetButton && } - - + + + + {label} + + {hasResetButton && } + - + ); } diff --git a/apps/meteor/client/views/admin/settings/inputs/GenericSettingInput.tsx b/apps/meteor/client/views/admin/settings/inputs/GenericSettingInput.tsx index 32425a57c698..8f6c38dbe22e 100644 --- a/apps/meteor/client/views/admin/settings/inputs/GenericSettingInput.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/GenericSettingInput.tsx @@ -1,21 +1,14 @@ -import { Box, FieldLabel, FieldRow, Flex, TextInput } from '@rocket.chat/fuselage'; +import { Field, FieldLabel, FieldRow, TextInput } from '@rocket.chat/fuselage'; import type { FormEventHandler, ReactElement } from 'react'; import React from 'react'; import ResetSettingButton from '../ResetSettingButton'; +import type { SettingInputProps } from './types'; -type GenericSettingInputProps = { - _id: string; - label: string; +type GenericSettingInputProps = SettingInputProps & { value: string; - placeholder?: string; - readonly?: boolean; - autocomplete?: boolean; - disabled?: boolean; - hasResetButton?: boolean; - onChangeValue?: (value: string) => void; - onResetButtonClick?: () => void; }; + function GenericSettingInput({ _id, label, @@ -24,6 +17,7 @@ function GenericSettingInput({ readonly, autocomplete, disabled, + required, hasResetButton, onChangeValue, onResetButtonClick, @@ -33,15 +27,13 @@ function GenericSettingInput({ }; return ( - <> - - - - {label} - - {hasResetButton && } - - + + + + {label} + + {hasResetButton && } + - + ); } diff --git a/apps/meteor/client/views/admin/settings/inputs/IntSettingInput.tsx b/apps/meteor/client/views/admin/settings/inputs/IntSettingInput.tsx index cd5abd54f481..053f00be2f85 100644 --- a/apps/meteor/client/views/admin/settings/inputs/IntSettingInput.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/IntSettingInput.tsx @@ -1,20 +1,12 @@ -import { Box, FieldLabel, FieldRow, Flex, InputBox } from '@rocket.chat/fuselage'; +import { Field, FieldLabel, FieldRow, InputBox } from '@rocket.chat/fuselage'; import type { FormEventHandler, ReactElement } from 'react'; import React from 'react'; import ResetSettingButton from '../ResetSettingButton'; +import type { SettingInputProps } from './types'; -type IntSettingInputProps = { - _id: string; - label: string; +type IntSettingInputProps = SettingInputProps & { value: string; - placeholder?: string; - readonly?: boolean; - autocomplete?: boolean; - disabled?: boolean; - hasResetButton?: boolean; - onChangeValue?: (value: string | number) => void; - onResetButtonClick?: () => void; }; function IntSettingInput({ @@ -25,6 +17,7 @@ function IntSettingInput({ readonly, autocomplete, disabled, + required, onChangeValue, hasResetButton, onResetButtonClick, @@ -34,15 +27,13 @@ function IntSettingInput({ }; return ( - <> - - - - {label} - - {hasResetButton && } - - + + + + {label} + + {hasResetButton && } + - + ); } diff --git a/apps/meteor/client/views/admin/settings/inputs/LanguageSettingInput.tsx b/apps/meteor/client/views/admin/settings/inputs/LanguageSettingInput.tsx index 8bfe977aaf39..6044cc754602 100644 --- a/apps/meteor/client/views/admin/settings/inputs/LanguageSettingInput.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/LanguageSettingInput.tsx @@ -1,22 +1,12 @@ -import { Box, FieldLabel, FieldRow, Flex, Select } from '@rocket.chat/fuselage'; +import { Field, FieldLabel, FieldRow, Select } from '@rocket.chat/fuselage'; import { useLanguages } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; import React from 'react'; import ResetSettingButton from '../ResetSettingButton'; +import type { SettingInputProps } from './types'; -type LanguageSettingInputProps = { - _id: string; - label: string; - value: string; - placeholder?: string; - readonly?: boolean; - autocomplete?: boolean; - disabled?: boolean; - hasResetButton?: boolean; - onChangeValue?: (value: string | number) => void; - onResetButtonClick?: () => void; -}; +type LanguageSettingInputProps = SettingInputProps; function LanguageSettingInput({ _id, @@ -26,6 +16,7 @@ function LanguageSettingInput({ readonly, autocomplete, disabled, + required, hasResetButton, onChangeValue, onResetButtonClick, @@ -37,15 +28,13 @@ function LanguageSettingInput({ }; return ( - <> - - - - {label} - - {hasResetButton && } - - + + + + {label} + + {hasResetButton && } + [key, label])} /> - + ); } diff --git a/apps/meteor/client/views/admin/settings/inputs/MultiSelectSettingInput.stories.tsx b/apps/meteor/client/views/admin/settings/inputs/MultiSelectSettingInput.stories.tsx index 3b4eb1526279..e667c9728ed3 100644 --- a/apps/meteor/client/views/admin/settings/inputs/MultiSelectSettingInput.stories.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/MultiSelectSettingInput.stories.tsx @@ -1,8 +1,8 @@ import { Field } from '@rocket.chat/fuselage'; +import type { TranslationKey } from '@rocket.chat/ui-contexts'; import type { ComponentMeta, ComponentStory } from '@storybook/react'; import React from 'react'; -import type keys from '../../../../../packages/rocketchat-i18n/i18n/en.i18n.json'; import type { valuesOption } from './MultiSelectSettingInput'; import MultiSelectSettingInput from './MultiSelectSettingInput'; @@ -20,9 +20,9 @@ export default { const Template: ComponentStory = (args) => ; const options: valuesOption[] = [ - { key: '1', i18nLabel: '1' as keyof typeof keys }, - { key: '2', i18nLabel: '2' as keyof typeof keys }, - { key: '3', i18nLabel: '3' as keyof typeof keys }, + { key: '1', i18nLabel: '1' as TranslationKey }, + { key: '2', i18nLabel: '2' as TranslationKey }, + { key: '3', i18nLabel: '3' as TranslationKey }, ]; export const Default = Template.bind({}); diff --git a/apps/meteor/client/views/admin/settings/inputs/MultiSelectSettingInput.tsx b/apps/meteor/client/views/admin/settings/inputs/MultiSelectSettingInput.tsx index bc8d8062d8a2..a484dc1133f0 100644 --- a/apps/meteor/client/views/admin/settings/inputs/MultiSelectSettingInput.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/MultiSelectSettingInput.tsx @@ -1,24 +1,15 @@ -import { FieldLabel, Flex, Box, MultiSelectFiltered, MultiSelect } from '@rocket.chat/fuselage'; +import { FieldLabel, MultiSelectFiltered, MultiSelect, Field, FieldRow } from '@rocket.chat/fuselage'; import type { TranslationKey } from '@rocket.chat/ui-contexts'; import { useTranslation } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; import React from 'react'; import ResetSettingButton from '../ResetSettingButton'; +import type { SettingInputProps } from './types'; export type valuesOption = { key: string; i18nLabel: TranslationKey }; -type MultiSelectSettingInputProps = { - _id: string; - label: string; - value?: [string, string]; +type MultiSelectSettingInputProps = SettingInputProps<[string, string], string[]> & { values: valuesOption[]; - placeholder?: string; - readonly?: boolean; - autocomplete?: boolean; - disabled?: boolean; - hasResetButton?: boolean; - onChangeValue?: (value: string[]) => void; - onResetButtonClick?: () => void; }; function MultiSelectSettingInput({ @@ -28,6 +19,7 @@ function MultiSelectSettingInput({ placeholder, readonly, disabled, + required, values = [], hasResetButton, onChangeValue, @@ -42,27 +34,28 @@ function MultiSelectSettingInput({ }; const Component = autocomplete ? MultiSelectFiltered : MultiSelect; return ( - <> - - - - {label} - - {hasResetButton && } - - - [key, t(i18nLabel)])} - /> - + + + + {label} + + {hasResetButton && } + + + [key, t(i18nLabel)])} + /> + + ); } diff --git a/apps/meteor/client/views/admin/settings/inputs/PasswordSettingInput.tsx b/apps/meteor/client/views/admin/settings/inputs/PasswordSettingInput.tsx index b7d2c1d48d47..75743c9f5a6c 100644 --- a/apps/meteor/client/views/admin/settings/inputs/PasswordSettingInput.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/PasswordSettingInput.tsx @@ -1,21 +1,11 @@ -import { Box, FieldLabel, FieldRow, Flex, PasswordInput } from '@rocket.chat/fuselage'; +import { Field, FieldLabel, FieldRow, PasswordInput } from '@rocket.chat/fuselage'; import type { EventHandler, ReactElement, SyntheticEvent } from 'react'; import React from 'react'; import ResetSettingButton from '../ResetSettingButton'; +import type { SettingInputProps } from './types'; -type PasswordSettingInputProps = { - _id: string; - label: string; - value?: string | number | readonly string[] | undefined; - placeholder?: string; - readonly?: boolean; - autocomplete?: boolean; - disabled?: boolean; - hasResetButton?: boolean; - onChangeValue?: (value: string) => void; - onResetButtonClick?: () => void; -}; +type PasswordSettingInputProps = SettingInputProps; function PasswordSettingInput({ _id, @@ -25,6 +15,7 @@ function PasswordSettingInput({ readonly, autocomplete, disabled, + required, hasResetButton, onChangeValue, onResetButtonClick, @@ -34,15 +25,13 @@ function PasswordSettingInput({ }; return ( - <> - - - - {label} - - {hasResetButton && } - - + + + + {label} + + {hasResetButton && } + - + ); } diff --git a/apps/meteor/client/views/admin/settings/inputs/RelativeUrlSettingInput.tsx b/apps/meteor/client/views/admin/settings/inputs/RelativeUrlSettingInput.tsx index b94581706757..ac03596cc273 100644 --- a/apps/meteor/client/views/admin/settings/inputs/RelativeUrlSettingInput.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/RelativeUrlSettingInput.tsx @@ -1,22 +1,12 @@ -import { Box, FieldLabel, Flex, UrlInput } from '@rocket.chat/fuselage'; +import { Field, FieldLabel, FieldRow, UrlInput } from '@rocket.chat/fuselage'; import { useAbsoluteUrl } from '@rocket.chat/ui-contexts'; import type { EventHandler, ReactElement, SyntheticEvent } from 'react'; import React from 'react'; import ResetSettingButton from '../ResetSettingButton'; +import type { SettingInputProps } from './types'; -type RelativeUrlSettingInputProps = { - _id: string; - label: string; - value?: string; - placeholder?: string; - readonly?: boolean; - autocomplete?: boolean; - disabled?: boolean; - hasResetButton?: boolean; - onChangeValue?: (value: string) => void; - onResetButtonClick?: () => void; -}; +type RelativeUrlSettingInputProps = SettingInputProps; function RelativeUrlSettingInput({ _id, @@ -26,6 +16,7 @@ function RelativeUrlSettingInput({ readonly, autocomplete, disabled, + required, hasResetButton, onChangeValue, onResetButtonClick, @@ -37,15 +28,13 @@ function RelativeUrlSettingInput({ }; return ( - <> - - - - {label} - - {hasResetButton && } - - + + + + {label} + + {hasResetButton && } + - + ); } diff --git a/apps/meteor/client/views/admin/settings/inputs/RoomPickSettingInput.tsx b/apps/meteor/client/views/admin/settings/inputs/RoomPickSettingInput.tsx index 15423742ff91..df2a4c1b0688 100644 --- a/apps/meteor/client/views/admin/settings/inputs/RoomPickSettingInput.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/RoomPickSettingInput.tsx @@ -1,22 +1,13 @@ import type { SettingValueRoomPick } from '@rocket.chat/core-typings'; -import { Box, FieldLabel, FieldRow, Flex } from '@rocket.chat/fuselage'; +import { Field, FieldLabel, FieldRow } from '@rocket.chat/fuselage'; import type { ReactElement } from 'react'; import React from 'react'; import RoomAutoCompleteMultiple from '../../../../components/RoomAutoCompleteMultiple'; import ResetSettingButton from '../ResetSettingButton'; +import type { SettingInputProps } from './types'; -type RoomPickSettingInputProps = { - _id: string; - label: string; - value?: SettingValueRoomPick | ''; - placeholder?: string; - readonly?: boolean; - disabled?: boolean; - hasResetButton?: boolean; - onChangeValue: (value: SettingValueRoomPick) => void; - onResetButtonClick?: () => void; -}; +type RoomPickSettingInputProps = SettingInputProps; function RoomPickSettingInput({ _id, @@ -25,6 +16,7 @@ function RoomPickSettingInput({ placeholder, readonly, disabled, + required, hasResetButton, onChangeValue, onResetButtonClick, @@ -39,15 +31,13 @@ function RoomPickSettingInput({ }; return ( - <> - - - - {label} - - {hasResetButton && } - - + + + + {label} + + {hasResetButton && } + - + ); } diff --git a/apps/meteor/client/views/admin/settings/inputs/SelectSettingInput.stories.tsx b/apps/meteor/client/views/admin/settings/inputs/SelectSettingInput.stories.tsx index e08f376be0f7..fc8798351f9e 100644 --- a/apps/meteor/client/views/admin/settings/inputs/SelectSettingInput.stories.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/SelectSettingInput.stories.tsx @@ -1,8 +1,8 @@ import { Field } from '@rocket.chat/fuselage'; +import type { TranslationKey } from '@rocket.chat/ui-contexts'; import type { ComponentMeta, ComponentStory } from '@storybook/react'; import React from 'react'; -import type keys from '../../../../../packages/rocketchat-i18n/i18n/en.i18n.json'; import SelectSettingInput from './SelectSettingInput'; export default { @@ -24,9 +24,9 @@ Default.args = { label: 'Label', placeholder: 'Placeholder', values: [ - { key: '1', i18nLabel: '1' as keyof typeof keys }, - { key: '2', i18nLabel: '2' as keyof typeof keys }, - { key: '3', i18nLabel: '3' as keyof typeof keys }, + { key: '1', i18nLabel: '1' as TranslationKey }, + { key: '2', i18nLabel: '2' as TranslationKey }, + { key: '3', i18nLabel: '3' as TranslationKey }, ], }; @@ -36,9 +36,9 @@ Disabled.args = { label: 'Label', placeholder: 'Placeholder', values: [ - { key: '1', i18nLabel: '1' as keyof typeof keys }, - { key: '2', i18nLabel: '2' as keyof typeof keys }, - { key: '3', i18nLabel: '3' as keyof typeof keys }, + { key: '1', i18nLabel: '1' as TranslationKey }, + { key: '2', i18nLabel: '2' as TranslationKey }, + { key: '3', i18nLabel: '3' as TranslationKey }, ], disabled: true, }; @@ -50,9 +50,9 @@ WithValue.args = { placeholder: 'Placeholder', value: '2', values: [ - { key: '1', i18nLabel: '1' as keyof typeof keys }, - { key: '2', i18nLabel: '2' as keyof typeof keys }, - { key: '3', i18nLabel: '3' as keyof typeof keys }, + { key: '1', i18nLabel: '1' as TranslationKey }, + { key: '2', i18nLabel: '2' as TranslationKey }, + { key: '3', i18nLabel: '3' as TranslationKey }, ], }; @@ -62,9 +62,9 @@ WithResetButton.args = { label: 'Label', placeholder: 'Placeholder', values: [ - { key: '1', i18nLabel: '1' as keyof typeof keys }, - { key: '2', i18nLabel: '2' as keyof typeof keys }, - { key: '3', i18nLabel: '3' as keyof typeof keys }, + { key: '1', i18nLabel: '1' as TranslationKey }, + { key: '2', i18nLabel: '2' as TranslationKey }, + { key: '3', i18nLabel: '3' as TranslationKey }, ], hasResetButton: true, }; diff --git a/apps/meteor/client/views/admin/settings/inputs/SelectSettingInput.tsx b/apps/meteor/client/views/admin/settings/inputs/SelectSettingInput.tsx index a6fa88f7ffe7..2ace88fda2cb 100644 --- a/apps/meteor/client/views/admin/settings/inputs/SelectSettingInput.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/SelectSettingInput.tsx @@ -1,23 +1,14 @@ -import { Box, FieldLabel, FieldRow, Flex, Select } from '@rocket.chat/fuselage'; +import { Field, FieldLabel, FieldRow, Select } from '@rocket.chat/fuselage'; import type { TranslationKey } from '@rocket.chat/ui-contexts'; import { useTranslation } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; import React from 'react'; import ResetSettingButton from '../ResetSettingButton'; +import type { SettingInputProps } from './types'; -type SelectSettingInputProps = { - _id: string; - label: string; - value?: string; +type SelectSettingInputProps = SettingInputProps & { values?: { key: string; i18nLabel: TranslationKey }[]; - placeholder?: string; - readonly?: boolean; - autocomplete?: boolean; - disabled?: boolean; - hasResetButton?: boolean; - onChangeValue?: (value: string) => void; - onResetButtonClick?: () => void; }; function SelectSettingInput({ @@ -28,6 +19,7 @@ function SelectSettingInput({ readonly, autocomplete, disabled, + required, values = [], hasResetButton, onChangeValue, @@ -40,15 +32,13 @@ function SelectSettingInput({ }; return ( - <> - - - - {label} - - {hasResetButton && } - - + + + + {label} + + {hasResetButton && } + [key, key])} /> - + ); } diff --git a/apps/meteor/client/views/admin/settings/inputs/StringSettingInput.tsx b/apps/meteor/client/views/admin/settings/inputs/StringSettingInput.tsx index 3d0ba78a127a..2652fb122162 100644 --- a/apps/meteor/client/views/admin/settings/inputs/StringSettingInput.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/StringSettingInput.tsx @@ -1,23 +1,14 @@ -import { Box, FieldLabel, FieldRow, Flex, TextAreaInput, TextInput } from '@rocket.chat/fuselage'; +import { Field, FieldLabel, FieldRow, TextAreaInput, TextInput } from '@rocket.chat/fuselage'; import type { EventHandler, ReactElement, SyntheticEvent } from 'react'; import React from 'react'; import ResetSettingButton from '../ResetSettingButton'; +import type { SettingInputProps } from './types'; -type StringSettingInputProps = { - _id: string; - label: string; +type StringSettingInputProps = SettingInputProps & { name?: string; - value?: string; multiline?: boolean; - placeholder?: string; - readonly?: boolean; error?: string; - autocomplete?: boolean; - disabled?: boolean; - hasResetButton?: boolean; - onChangeValue?: (value: string) => void; - onResetButtonClick?: () => void; }; function StringSettingInput({ @@ -25,6 +16,7 @@ function StringSettingInput({ label, name, disabled, + required, multiline, placeholder, readonly, @@ -40,15 +32,13 @@ function StringSettingInput({ }; return ( - <> - - - - {label} - - {hasResetButton && } - - + + + + {label} + + {hasResetButton && } + {multiline ? ( )} - + ); } diff --git a/apps/meteor/client/views/admin/settings/inputs/types.ts b/apps/meteor/client/views/admin/settings/inputs/types.ts new file mode 100644 index 000000000000..d978a3ad6b4d --- /dev/null +++ b/apps/meteor/client/views/admin/settings/inputs/types.ts @@ -0,0 +1,18 @@ +import type { ReactNode } from 'react'; + +export type SettingInputProps = { + _id: string; + label: ReactNode; + value?: V; + placeholder?: string; + readonly?: boolean; + autocomplete?: boolean; + disabled: boolean; + required?: boolean; + hint?: string; + editor?: string; + hasResetButton: boolean; + onChangeValue: (value: R) => void; + onResetButtonClick?: () => void; + onChangeEditor?: (value: string | undefined) => void; +}; diff --git a/apps/meteor/client/views/admin/sidebar/AdminSidebarPages.tsx b/apps/meteor/client/views/admin/sidebar/AdminSidebarPages.tsx index 746301c73cd5..7fe848032228 100644 --- a/apps/meteor/client/views/admin/sidebar/AdminSidebarPages.tsx +++ b/apps/meteor/client/views/admin/sidebar/AdminSidebarPages.tsx @@ -4,9 +4,7 @@ import React, { memo } from 'react'; import { useSyncExternalStore } from 'use-sync-external-store/shim'; import SidebarItemsAssembler from '../../../components/Sidebar/SidebarItemsAssembler'; -import { useUpgradeTabParams } from '../../hooks/useUpgradeTabParams'; import { subscribeToAdminSidebarItems, getAdminSidebarItems } from '../sidebarItems'; -import UpgradeTab from './UpgradeTab'; type AdminSidebarPagesProps = { currentPath: string; @@ -15,11 +13,8 @@ type AdminSidebarPagesProps = { const AdminSidebarPages: FC = ({ currentPath }) => { const items = useSyncExternalStore(subscribeToAdminSidebarItems, getAdminSidebarItems); - const { tabType, trialEndDate, isLoading } = useUpgradeTabParams(); - return ( - {!isLoading && tabType && } ); diff --git a/apps/meteor/client/views/admin/sidebar/UpgradeTab.tsx b/apps/meteor/client/views/admin/sidebar/UpgradeTab.tsx deleted file mode 100644 index a676ccbf10f5..000000000000 --- a/apps/meteor/client/views/admin/sidebar/UpgradeTab.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import { Box, Icon } from '@rocket.chat/fuselage'; -import { useRouter, useTranslation } from '@rocket.chat/ui-contexts'; -import type { ReactElement } from 'react'; -import React from 'react'; - -import type { UpgradeTabVariant } from '../../../../lib/upgradeTab'; -import { getUpgradeTabLabel, isFullyFeature } from '../../../../lib/upgradeTab'; -import Emoji from '../../../components/Emoji'; -import Sidebar from '../../../components/Sidebar'; - -type UpgradeTabProps = { type: UpgradeTabVariant; currentPath: string; trialEndDate: string | undefined }; - -const UpgradeTab = ({ type, currentPath, trialEndDate }: UpgradeTabProps): ReactElement => { - const router = useRouter(); - - const path = router.buildRoutePath({ - name: 'upgrade', - params: { type }, - search: trialEndDate ? { trialEndDate } : undefined, - }); - - const t = useTranslation(); - - const label = getUpgradeTabLabel(type); - const displayEmoji = isFullyFeature(type); - - return ( - - - - {t(label)} {displayEmoji && } - - - ); -}; - -export default UpgradeTab; diff --git a/apps/meteor/client/views/admin/sidebarItems.ts b/apps/meteor/client/views/admin/sidebarItems.ts index 2beee76cee02..013206d9e9a8 100644 --- a/apps/meteor/client/views/admin/sidebarItems.ts +++ b/apps/meteor/client/views/admin/sidebarItems.ts @@ -8,15 +8,15 @@ export const { subscribeToSidebarItems: subscribeToAdminSidebarItems, } = createSidebarItems([ { - href: '/admin/workspace', + href: '/admin/info', i18nLabel: 'Workspace', icon: 'info-circled', permissionGranted: (): boolean => hasPermission('view-statistics'), }, { - href: '/admin/registration', - i18nLabel: 'Registration', - icon: 'cloud-plus', + href: '/admin/subscription', + i18nLabel: 'Subscription', + icon: 'card', permissionGranted: (): boolean => hasPermission('manage-cloud'), }, { diff --git a/apps/meteor/client/views/admin/subscription/SubscriptionCalloutLimits.tsx b/apps/meteor/client/views/admin/subscription/SubscriptionCalloutLimits.tsx new file mode 100644 index 000000000000..2adc3d306034 --- /dev/null +++ b/apps/meteor/client/views/admin/subscription/SubscriptionCalloutLimits.tsx @@ -0,0 +1,146 @@ +import type { LicenseBehavior } from '@rocket.chat/core-typings'; +import { Callout } from '@rocket.chat/fuselage'; +import { validateWarnLimit } from '@rocket.chat/license/src/validation/validateLimit'; +import { ExternalLink } from '@rocket.chat/ui-client'; +import React from 'react'; +import { Trans, useTranslation } from 'react-i18next'; + +import { useLicense } from '../../../hooks/useLicense'; +import { useCheckoutUrl } from './hooks/useCheckoutUrl'; + +export const SubscriptionCalloutLimits = () => { + const manageSubscriptionUrl = useCheckoutUrl(); + + const { t } = useTranslation(); + const result = useLicense({ loadValues: true }); + + if (result.isLoading || result.isError) { + return null; + } + + const { license, limits } = result.data; + + if (!license || !limits) { + return null; + } + + const keyLimits = Object.keys(limits) as Array; + + // Get the rule with the highest limit that applies to this key + + const rules = keyLimits + .map((key) => { + const rule = license.limits[key] + ?.filter((limit) => validateWarnLimit(limit.max, limits[key].value ?? 0, limit.behavior)) + .sort((a, b) => b.max - a.max)[0]; + + if (!rule) { + return undefined; + } + + if (rule.max === 0) { + return undefined; + } + + if (rule.max === -1) { + return undefined; + } + + return [key, rule.behavior]; + }) + .filter(Boolean) as Array<[keyof typeof limits, LicenseBehavior]>; + + if (!rules.length) { + return null; + } + + // Group by behavior + const groupedRules = rules.reduce((acc, [key, behavior]) => { + if (!acc[behavior]) { + acc[behavior] = []; + } + + acc[behavior].push(key); + + return acc; + }, {} as Record); + + const { prevent_action, disable_modules, invalidate_license, start_fair_policy } = groupedRules; + + const map = (key: keyof typeof limits) => t(`subscription.callout.${key}`); + + return ( + <> + {start_fair_policy && ( + + + Your workspace reached the <>{{ val: start_fair_policy.map(map) }} limit. + + Manage your subscription + + to increase limits. + + + )} + {prevent_action && ( + + + Your workspace exceeded the <>{{ val: prevent_action.map(map) }} license limit. + + Manage your subscription + + to increase limits. + + + )} + + {disable_modules && ( + + + Your workspace exceeded the <>{{ val: disable_modules.map(map) }} license limit. + + Manage your subscription + + to increase limits. + + + )} + + {invalidate_license && ( + + + Your workspace exceeded the <>{{ val: invalidate_license.map(map) }} license limit. + + Manage your subscription + + to increase limits. + + + )} + + ); +}; diff --git a/apps/meteor/client/views/admin/subscription/SubscriptionPage.tsx b/apps/meteor/client/views/admin/subscription/SubscriptionPage.tsx new file mode 100644 index 000000000000..93792b517dcf --- /dev/null +++ b/apps/meteor/client/views/admin/subscription/SubscriptionPage.tsx @@ -0,0 +1,193 @@ +import { Accordion, Box, Button, ButtonGroup, Callout, Grid } from '@rocket.chat/fuselage'; +import { useDebouncedValue, useSessionStorage } from '@rocket.chat/fuselage-hooks'; +import { useSearchParameter, useRouter } from '@rocket.chat/ui-contexts'; +import { t } from 'i18next'; +import React, { memo, useCallback, useEffect } from 'react'; +import tinykeys from 'tinykeys'; + +import { Page, PageHeader, PageScrollableContentWithShadow } from '../../../components/Page'; +import { useIsEnterprise } from '../../../hooks/useIsEnterprise'; +import { useInvalidateLicense, useLicense } from '../../../hooks/useLicense'; +import { useRegistrationStatus } from '../../../hooks/useRegistrationStatus'; +import { SubscriptionCalloutLimits } from './SubscriptionCalloutLimits'; +import SubscriptionPageSkeleton from './SubscriptionPageSkeleton'; +import UpgradeButton from './components/UpgradeButton'; +import UpgradeToGetMore from './components/UpgradeToGetMore'; +import ActiveSessionsCard from './components/cards/ActiveSessionsCard'; +import ActiveSessionsPeakCard from './components/cards/ActiveSessionsPeakCard'; +import AppsUsageCard from './components/cards/AppsUsageCard'; +import CountMACCard from './components/cards/CountMACCard'; +import CountSeatsCard from './components/cards/CountSeatsCard'; +import FeaturesCard from './components/cards/FeaturesCard'; +import MACCard from './components/cards/MACCard'; +import PlanCard from './components/cards/PlanCard'; +import PlanCardCommunity from './components/cards/PlanCard/PlanCardCommunity'; +import SeatsCard from './components/cards/SeatsCard'; +import { useRemoveLicense } from './hooks/useRemoveLicense'; +import { useWorkspaceSync } from './hooks/useWorkspaceSync'; + +function useShowLicense() { + const [showLicenseTab, setShowLicenseTab] = useSessionStorage('admin:showLicenseTab', false); + + useEffect(() => { + const unsubscribe = tinykeys(window, { + 'ArrowUp ArrowUp ArrowDown ArrowDown ArrowLeft ArrowRight ArrowLeft ArrowRight b a': () => { + setShowLicenseTab((showLicenseTab) => !showLicenseTab); + }, + }); + return () => { + unsubscribe(); + }; + }); + + return showLicenseTab; +} + +const SubscriptionPage = () => { + const showLicense = useShowLicense(); + const router = useRouter(); + const { data: enterpriseData } = useIsEnterprise(); + const { isRegistered } = useRegistrationStatus(); + const { data: licensesData, isLoading: isLicenseLoading } = useLicense({ loadValues: true }); + const syncLicenseUpdate = useWorkspaceSync(); + const invalidateLicenseQuery = useInvalidateLicense(); + + const subscriptionSuccess = useSearchParameter('subscriptionSuccess'); + + const showSubscriptionCallout = useDebouncedValue(subscriptionSuccess || syncLicenseUpdate.isLoading, 10000); + + const { license, limits, activeModules = [] } = licensesData || {}; + const { isEnterprise = true } = enterpriseData || {}; + + const getKeyLimit = (key: 'monthlyActiveContacts' | 'activeUsers') => { + const { max, value } = limits?.[key] || {}; + return { + max: max !== undefined && max !== -1 ? max : Infinity, + value, + }; + }; + + const macLimit = getKeyLimit('monthlyActiveContacts'); + const seatsLimit = getKeyLimit('activeUsers'); + + const handleSyncLicenseUpdate = useCallback(() => { + syncLicenseUpdate.mutate(undefined, { + onSuccess: () => invalidateLicenseQuery(100), + }); + }, [invalidateLicenseQuery, syncLicenseUpdate]); + + useEffect(() => { + if (subscriptionSuccess && syncLicenseUpdate.isIdle) { + handleSyncLicenseUpdate(); + return; + } + + if (subscriptionSuccess) { + router.navigate( + { + name: router.getRouteName()!, + params: Object.fromEntries(Object.entries(router.getSearchParameters()).filter(([key]) => key !== 'subscriptionSuccess')), + }, + { + replace: true, + }, + ); + } + }, [handleSyncLicenseUpdate, router, subscriptionSuccess, syncLicenseUpdate.isIdle]); + + const removeLicense = useRemoveLicense(); + + return ( + + + + {isRegistered && ( + + )} + + {t(isEnterprise ? 'Manage_subscription' : 'Upgrade')} + + + + + {(showSubscriptionCallout || syncLicenseUpdate.isLoading) && ( + + {t('Sync_license_update_Callout')} + + )} + + {isLicenseLoading && } + {!isLicenseLoading && ( + <> + {showLicense && ( + + +
{JSON.stringify(licensesData, null, 2)}
+
+
+ )} + + + + {license && } + {!license && } + + + + + + {seatsLimit.value !== undefined && ( + + {seatsLimit.max !== Infinity ? ( + + ) : ( + + )} + + )} + + {macLimit.value !== undefined && ( + + {macLimit.max !== Infinity ? ( + + ) : ( + + )} + + )} + + {!license && ( + <> + {limits?.marketplaceApps !== undefined && ( + + + + )} + + + + + + + + + )} + + + {Boolean(licensesData?.license?.information.cancellable) && ( + + )} + + + + )} +
+
+ ); +}; + +export default memo(SubscriptionPage); diff --git a/apps/meteor/client/views/admin/subscription/SubscriptionPageSkeleton.tsx b/apps/meteor/client/views/admin/subscription/SubscriptionPageSkeleton.tsx new file mode 100644 index 000000000000..a787f26ecbfa --- /dev/null +++ b/apps/meteor/client/views/admin/subscription/SubscriptionPageSkeleton.tsx @@ -0,0 +1,23 @@ +import { Box, Grid, Skeleton } from '@rocket.chat/fuselage'; +import React, { memo } from 'react'; + +const SubscriptionPageSkeleton = () => ( + + + + + + + + + + + + + + + + +); + +export default memo(SubscriptionPageSkeleton); diff --git a/apps/meteor/client/views/admin/subscription/SubscriptionRoute.tsx b/apps/meteor/client/views/admin/subscription/SubscriptionRoute.tsx new file mode 100644 index 000000000000..99fb216c01ce --- /dev/null +++ b/apps/meteor/client/views/admin/subscription/SubscriptionRoute.tsx @@ -0,0 +1,18 @@ +import { usePermission } from '@rocket.chat/ui-contexts'; +import type { ReactElement } from 'react'; +import React, { memo } from 'react'; + +import NotAuthorizedPage from '../../notAuthorized/NotAuthorizedPage'; +import SubscriptionPage from './SubscriptionPage'; + +const SubscriptionRoute = (): ReactElement => { + const canViewSubscription = usePermission('manage-cloud'); + + if (!canViewSubscription) { + return ; + } + + return ; +}; + +export default memo(SubscriptionRoute); diff --git a/apps/meteor/client/views/admin/subscription/components/FeatureUsageCard.tsx b/apps/meteor/client/views/admin/subscription/components/FeatureUsageCard.tsx new file mode 100644 index 000000000000..3e736062bd7d --- /dev/null +++ b/apps/meteor/client/views/admin/subscription/components/FeatureUsageCard.tsx @@ -0,0 +1,35 @@ +import { Box, Card, CardBody, CardControls, CardTitle } from '@rocket.chat/fuselage'; +import type { ReactElement, ReactNode } from 'react'; +import React, { memo } from 'react'; + +import InfoTextIconModal from './InfoTextIconModal'; + +type FeatureUsageCardProps = { + children?: ReactNode; + card: CardProps; +}; + +export type CardProps = { + title: string; + infoText?: string; + upgradeButton?: ReactNode; +}; + +const FeatureUsageCard = ({ children, card }: FeatureUsageCardProps): ReactElement => { + const { title, infoText, upgradeButton } = card; + return ( + + + {title} {infoText && } + + + + {children} + + + {upgradeButton && {upgradeButton}} + + ); +}; + +export default memo(FeatureUsageCard); diff --git a/apps/meteor/client/views/admin/subscription/components/InfoTextIconModal.tsx b/apps/meteor/client/views/admin/subscription/components/InfoTextIconModal.tsx new file mode 100644 index 000000000000..9316949dcb66 --- /dev/null +++ b/apps/meteor/client/views/admin/subscription/components/InfoTextIconModal.tsx @@ -0,0 +1,33 @@ +import { IconButton } from '@rocket.chat/fuselage'; +import { useSetModal } from '@rocket.chat/ui-contexts'; +import type { ReactElement } from 'react'; +import React, { memo } from 'react'; +import { useTranslation } from 'react-i18next'; + +import GenericModal from '../../../../components/GenericModal'; + +export type InfoTextIconModalProps = { + title: string; + infoText: string; +}; + +const InfoTextIconModal = ({ title, infoText }: InfoTextIconModalProps): ReactElement => { + const setModal = useSetModal(); + const { t } = useTranslation(); + + const handleInfoClick = () => { + if (!infoText) { + setModal(null); + return; + } + setModal( + setModal(null)}> + {infoText} + , + ); + }; + + return handleInfoClick()} />; +}; + +export default memo(InfoTextIconModal); diff --git a/apps/meteor/client/views/admin/subscription/components/UpgradeButton.tsx b/apps/meteor/client/views/admin/subscription/components/UpgradeButton.tsx new file mode 100644 index 000000000000..684cb03d4756 --- /dev/null +++ b/apps/meteor/client/views/admin/subscription/components/UpgradeButton.tsx @@ -0,0 +1,28 @@ +import { Button } from '@rocket.chat/fuselage'; +import type { ButtonProps } from '@rocket.chat/fuselage/dist/components/Button/Button'; +import type { ReactElement } from 'react'; +import React, { memo } from 'react'; + +import { useExternalLink } from '../../../../hooks/useExternalLink'; +import { useCheckoutUrl } from '../hooks/useCheckoutUrl'; + +const UpgradeButton = ({ + children, + target = '_blank', + action, + ...props +}: Partial & { + target: string; + action: string; +}): ReactElement => { + const handleOpenLink = useExternalLink(); + const url = useCheckoutUrl()({ target, action }); + + return ( + + ); +}; + +export default memo(UpgradeButton); diff --git a/apps/meteor/client/views/admin/subscription/components/UpgradeToGetMore.tsx b/apps/meteor/client/views/admin/subscription/components/UpgradeToGetMore.tsx new file mode 100644 index 000000000000..450c58994f62 --- /dev/null +++ b/apps/meteor/client/views/admin/subscription/components/UpgradeToGetMore.tsx @@ -0,0 +1,78 @@ +import { Box, States, StatesIcon, StatesTitle, StatesSubtitle, Button, ButtonGroup, CardGrid } from '@rocket.chat/fuselage'; +import React, { memo } from 'react'; +import { useTranslation } from 'react-i18next'; + +import { GenericCard } from '../../../../components/GenericCard'; +import { useExternalLink } from '../../../../hooks/useExternalLink'; +import { PRICING_LINK } from '../utils/links'; + +type UpgradeToGetMoreProps = { + activeModules: string[]; + isEnterprise: boolean; + children: React.ReactNode; +}; + +const enterpriseModules = [ + 'scalability', + 'accessibility-certification', + 'engagement-dashboard', + 'oauth-enterprise', + 'custom-roles', + 'auditing', +]; + +const UpgradeToGetMore = ({ activeModules, children }: UpgradeToGetMoreProps) => { + const { t } = useTranslation(); + const handleOpenLink = useExternalLink(); + + const upgradeModules = enterpriseModules + .filter((module) => !activeModules.includes(module)) + .map((module) => { + return { + title: t(`UpgradeToGetMore_${module}_Title`), + body: t(`UpgradeToGetMore_${module}_Body`), + }; + }); + + if (upgradeModules?.length === 0) { + return ( + + {children} + + ); + } + + return ( + + + + {t('UpgradeToGetMore_Headline')} + {t('UpgradeToGetMore_Subtitle')} + + + {upgradeModules.map((card, index) => { + return ; + })} + + + + + {children} + + + + ); +}; + +export default memo(UpgradeToGetMore); diff --git a/apps/meteor/client/views/admin/info/UsagePieGraph.stories.tsx b/apps/meteor/client/views/admin/subscription/components/UsagePieGraph.stories.tsx similarity index 85% rename from apps/meteor/client/views/admin/info/UsagePieGraph.stories.tsx rename to apps/meteor/client/views/admin/subscription/components/UsagePieGraph.stories.tsx index 12f211d47c5e..ef1a685a7dee 100644 --- a/apps/meteor/client/views/admin/info/UsagePieGraph.stories.tsx +++ b/apps/meteor/client/views/admin/subscription/components/UsagePieGraph.stories.tsx @@ -3,7 +3,7 @@ import type { ComponentMeta, ComponentStory, Story } from '@storybook/react'; import type { ComponentProps } from 'react'; import React from 'react'; -import { useAutoSequence } from '../../../stories/hooks/useAutoSequence'; +import { useAutoSequence } from '../../../../stories/hooks/useAutoSequence'; import UsagePieGraph from './UsagePieGraph'; export default { @@ -38,27 +38,27 @@ export const Animated: Story, 'size' | { total: 100, used: 0, - color: colorTokens.s500, + color: colorTokens.g500, }, { total: 100, used: 25, - color: colorTokens.p500, + color: colorTokens.b500, }, { total: 100, used: 50, - color: colorTokens.w500, + color: colorTokens.y500, }, { total: 100, used: 75, - color: colorTokens['s1-500'], + color: colorTokens.o500, }, { total: 100, used: 100, - color: colorTokens.d500, + color: colorTokens.r500, }, ]); diff --git a/apps/meteor/client/views/admin/subscription/components/UsagePieGraph.tsx b/apps/meteor/client/views/admin/subscription/components/UsagePieGraph.tsx new file mode 100644 index 000000000000..3e07122adaff --- /dev/null +++ b/apps/meteor/client/views/admin/subscription/components/UsagePieGraph.tsx @@ -0,0 +1,109 @@ +import type { DatumId } from '@nivo/pie'; +import { Pie } from '@nivo/pie'; +import { Box, Palette } from '@rocket.chat/fuselage'; +import type { ReactElement, CSSProperties, ReactNode } from 'react'; +import React, { useMemo, useCallback, memo } from 'react'; +import { useTranslation } from 'react-i18next'; + +import { useLocalePercentage } from '../../../../hooks/useLocalePercentage'; + +type GraphColorsReturn = { [key: string]: string }; + +const graphColors = (color: CSSProperties['color']): GraphColorsReturn => ({ + used: color || Palette.statusColor['status-font-on-success'].toString(), + free: Palette.stroke['stroke-extra-light'].toString(), +}); + +export type UsagePieGraphProps = { + used: number; + total: number; + label?: ReactNode; + color?: string; + size?: number; +}; + +type GraphData = Array<{ + id: string; + label: string; + value: number; +}>; + +const UsagePieGraph = ({ used = 0, total = 0, label, color, size = 140 }: UsagePieGraphProps): ReactElement => { + const { t } = useTranslation(); + const parsedData = useMemo( + (): GraphData => [ + { + id: 'used', + label: 'used', + value: used, + }, + { + id: 'free', + label: 'free', + value: total - used, + }, + ], + [total, used], + ); + + const getColor = useCallback( + (datum: { id: DatumId } | undefined) => { + if (!datum || typeof datum.id !== 'string') { + return ''; + } + return graphColors(color)[datum.id]; + }, + [color], + ); + + const unlimited = total === 0; + + const localePercentage = useLocalePercentage(total, used, 0); + + return ( + + + + + + {unlimited ? '∞' : localePercentage} + + + + + {unlimited && + t('used_limit_infinite', { + used, + })} + {!unlimited && + t('used_limit', { + used, + limit: total, + })} + + {label && ( + + {label} + + )} + + ); +}; + +export default memo(UsagePieGraph); diff --git a/apps/meteor/client/views/admin/subscription/components/cards/ActiveSessionsCard.tsx b/apps/meteor/client/views/admin/subscription/components/cards/ActiveSessionsCard.tsx new file mode 100644 index 000000000000..e42ae7f6b744 --- /dev/null +++ b/apps/meteor/client/views/admin/subscription/components/cards/ActiveSessionsCard.tsx @@ -0,0 +1,68 @@ +import { Box, Skeleton } from '@rocket.chat/fuselage'; +import type { ReactElement } from 'react'; +import React from 'react'; +import { useTranslation } from 'react-i18next'; + +import { useActiveConnections } from '../../../../hooks/useActiveConnections'; +import type { CardProps } from '../FeatureUsageCard'; +import FeatureUsageCard from '../FeatureUsageCard'; +import UpgradeButton from '../UpgradeButton'; + +const getLimits = ({ max, current }: { max: number; current: number }) => { + const total = max || 0; + const used = current || 0; + const available = total - used; + + const exceedLimit = used >= total; + + return { + total, + used, + available, + exceedLimit, + }; +}; + +const ActiveSessionsCard = (): ReactElement => { + const { t } = useTranslation(); + const result = useActiveConnections(); + + const card: CardProps = { + title: t('ActiveSessions'), + infoText: t('ActiveSessions_InfoText'), + }; + + if (result.isLoading || result.isError) { + return ( + + + + ); + } + + const { total, used, available, exceedLimit } = getLimits(result.data); + + return ( + + {t('Upgrade')} + + ), + }), + }} + > + + + {used} / {total} + + {available} {t('ActiveSessions_available')} + + + ); +}; + +export default ActiveSessionsCard; diff --git a/apps/meteor/client/views/admin/subscription/components/cards/ActiveSessionsPeakCard.tsx b/apps/meteor/client/views/admin/subscription/components/cards/ActiveSessionsPeakCard.tsx new file mode 100644 index 000000000000..02ac3eeeb536 --- /dev/null +++ b/apps/meteor/client/views/admin/subscription/components/cards/ActiveSessionsPeakCard.tsx @@ -0,0 +1,56 @@ +import { Box, Skeleton } from '@rocket.chat/fuselage'; +import type { ReactElement } from 'react'; +import React from 'react'; +import { useTranslation } from 'react-i18next'; + +import { useFormatDate } from '../../../../../hooks/useFormatDate'; +import { useStatistics } from '../../../../hooks/useStatistics'; +import type { CardProps } from '../FeatureUsageCard'; +import FeatureUsageCard from '../FeatureUsageCard'; +import UpgradeButton from '../UpgradeButton'; + +const ActiveSessionsPeakCard = (): ReactElement => { + const { t } = useTranslation(); + const { data, isLoading } = useStatistics(); + const formatDate = useFormatDate(); + + const { maxMonthlyPeakConnections } = data || {}; + + const total = 200; + const used = maxMonthlyPeakConnections || 0; + + const exceedLimit = used >= total; + + const card: CardProps = { + title: t('ActiveSessionsPeak'), + infoText: t('ActiveSessionsPeak_InfoText'), + ...(exceedLimit && { + upgradeButton: ( + + {t('Upgrade')} + + ), + }), + }; + + if (isLoading || maxMonthlyPeakConnections === undefined) { + return ( + + + + ); + } + + return ( + + + + {used} / {total} + + {formatDate(new Date())} + + + ); +}; + +export default ActiveSessionsPeakCard; diff --git a/apps/meteor/client/views/admin/subscription/components/cards/AppsUsageCard.tsx b/apps/meteor/client/views/admin/subscription/components/cards/AppsUsageCard.tsx new file mode 100644 index 000000000000..dbd402ef2c7f --- /dev/null +++ b/apps/meteor/client/views/admin/subscription/components/cards/AppsUsageCard.tsx @@ -0,0 +1,71 @@ +import { Box, ProgressBar, Skeleton } from '@rocket.chat/fuselage'; +import type { ReactElement } from 'react'; +import React from 'react'; +import { useTranslation } from 'react-i18next'; + +import type { CardProps } from '../FeatureUsageCard'; +import FeatureUsageCard from '../FeatureUsageCard'; +import UpgradeButton from '../UpgradeButton'; + +type AppsUsageCardProps = { + privateAppsLimit?: { value?: number; max: number }; + marketplaceAppsLimit?: { value?: number; max: number }; +}; + +const AppsUsageCard = ({ privateAppsLimit, marketplaceAppsLimit }: AppsUsageCardProps): ReactElement => { + const { t } = useTranslation(); + + const marketplaceAppsEnabled = marketplaceAppsLimit?.value || 0; + const marketplaceAppsLimitCount = marketplaceAppsLimit?.max || 5; + const marketplaceAppsPercentage = Math.round((marketplaceAppsEnabled / marketplaceAppsLimitCount) * 100); + + const privateAppsEnabled = privateAppsLimit?.value || 0; + const privateAppsLimitCount = privateAppsLimit?.max || 3; + const privateAppsPercentage = Math.round((privateAppsEnabled / privateAppsLimitCount) * 100); + + const card: CardProps = { + title: t('Apps'), + infoText: t('Apps_InfoText'), + ...((marketplaceAppsPercentage || 0) >= 80 && { + upgradeButton: ( + + {t('Upgrade')} + + ), + }), + }; + + if (!privateAppsLimit || !marketplaceAppsLimit) { + return ( + + + + ); + } + + return ( + + + +
{t('Marketplace_apps')}
+ = 80 ? 'font-danger' : 'status-font-on-success'}> + {marketplaceAppsEnabled} / {marketplaceAppsLimitCount} + +
+ + = 80 ? 'danger' : 'success'} /> +
+ + +
{t('Private_apps')}
+ = 80 ? 'font-danger' : 'status-font-on-success'}> + {privateAppsEnabled} / {privateAppsLimitCount} + +
+ + = 80 ? 'danger' : 'success'} /> +
+
+ ); +}; +export default AppsUsageCard; diff --git a/apps/meteor/client/views/admin/subscription/components/cards/CountMACCard.tsx b/apps/meteor/client/views/admin/subscription/components/cards/CountMACCard.tsx new file mode 100644 index 000000000000..862504692d1f --- /dev/null +++ b/apps/meteor/client/views/admin/subscription/components/cards/CountMACCard.tsx @@ -0,0 +1,25 @@ +import { Box, Icon } from '@rocket.chat/fuselage'; +import type { ReactElement } from 'react'; +import React from 'react'; +import { useTranslation } from 'react-i18next'; + +import FeatureUsageCard from '../FeatureUsageCard'; + +const CountMACCard = ({ macsCount }: { macsCount: number }): ReactElement => { + const { t } = useTranslation(); + + return ( + + + + {macsCount} + + + ); +}; +export default CountMACCard; diff --git a/apps/meteor/client/views/admin/subscription/components/cards/CountSeatsCard.tsx b/apps/meteor/client/views/admin/subscription/components/cards/CountSeatsCard.tsx new file mode 100644 index 000000000000..a730c4cdf9fb --- /dev/null +++ b/apps/meteor/client/views/admin/subscription/components/cards/CountSeatsCard.tsx @@ -0,0 +1,25 @@ +import { Box, Icon } from '@rocket.chat/fuselage'; +import type { ReactElement } from 'react'; +import React from 'react'; +import { useTranslation } from 'react-i18next'; + +import FeatureUsageCard from '../FeatureUsageCard'; + +const CountSeatsCard = ({ activeUsers }: { activeUsers: number }): ReactElement => { + const { t } = useTranslation(); + + return ( + + + + {activeUsers} + + + ); +}; +export default CountSeatsCard; diff --git a/apps/meteor/client/views/admin/subscription/components/cards/FeaturesCard.tsx b/apps/meteor/client/views/admin/subscription/components/cards/FeaturesCard.tsx new file mode 100644 index 000000000000..8af99de7d38c --- /dev/null +++ b/apps/meteor/client/views/admin/subscription/components/cards/FeaturesCard.tsx @@ -0,0 +1,92 @@ +import { Box, Card, CardBody, CardControls, CardTitle, FramedIcon } from '@rocket.chat/fuselage'; +import { useMediaQuery } from '@rocket.chat/fuselage-hooks'; +import type { ReactElement } from 'react'; +import React from 'react'; +import { useTranslation } from 'react-i18next'; + +import { PRICING_LINK } from '../../utils/links'; +import InfoTextIconModal from '../InfoTextIconModal'; + +type FeatureSet = { + success?: boolean; + neutral?: boolean; + title: string; + infoText?: string; +}; + +type FeaturesCardProps = { + activeModules: string[]; + isEnterprise: boolean; +}; + +const getFeatureSet = (modules: string[], isEnterprise: boolean): FeatureSet[] => { + const featureSet: FeatureSet[] = [ + { + success: isEnterprise, + title: 'Premium_and_unlimited_apps', + }, + { + success: isEnterprise, + title: 'Premium_omnichannel_capabilities', + }, + { + success: isEnterprise, + title: 'Unlimited_push_notifications', + }, + { + success: modules.includes('videoconference-enterprise'), + title: 'Video_call_manager', + }, + { + success: modules.includes('hide-watermark'), + title: 'Remove_RocketChat_Watermark', + infoText: 'Remove_RocketChat_Watermark_InfoText', + }, + { + success: modules.includes('scalability'), + title: 'High_scalabaility', + }, + { + success: modules.includes('custom-roles'), + title: 'Custom_roles', + }, + { + success: modules.includes('auditing'), + title: 'Message_audit', + }, + ]; + + // eslint-disable-next-line no-nested-ternary + return featureSet.sort(({ success: a }, { success: b }) => (a === b ? 0 : a ? -1 : 1)); +}; + +const FeaturesCard = ({ activeModules, isEnterprise }: FeaturesCardProps): ReactElement => { + const { t } = useTranslation(); + const isSmall = useMediaQuery('(min-width: 1180px)'); + + return ( + + {!isEnterprise ? t('Unlock_premium_capabilities') : t('Includes')} + + + {getFeatureSet(activeModules, isEnterprise).map(({ success, title, infoText }, index) => ( + + + + {t(title)} + + {infoText && } + + ))} + + + +
+ {t('Compare_plans')} + + + + ); +}; + +export default FeaturesCard; diff --git a/apps/meteor/client/views/admin/subscription/components/cards/MACCard.tsx b/apps/meteor/client/views/admin/subscription/components/cards/MACCard.tsx new file mode 100644 index 000000000000..f60292df064b --- /dev/null +++ b/apps/meteor/client/views/admin/subscription/components/cards/MACCard.tsx @@ -0,0 +1,65 @@ +import { Palette } from '@rocket.chat/fuselage'; +import type { ReactElement } from 'react'; +import React from 'react'; +import { useTranslation } from 'react-i18next'; + +import type { CardProps } from '../FeatureUsageCard'; +import FeatureUsageCard from '../FeatureUsageCard'; +import UpgradeButton from '../UpgradeButton'; +import UsagePieGraph from '../UsagePieGraph'; + +const MACCard = ({ + value = 0, + max, + hideManageSubscription, +}: { + value: number; + max: number; + hideManageSubscription?: boolean; +}): ReactElement => { + const { t } = useTranslation(); + + const pieGraph = { + used: value, + total: max, + }; + + const nearLimit = pieGraph && pieGraph.used > 0 && pieGraph.used / pieGraph.total >= 0.8; + + const macLeft = pieGraph.total - pieGraph.used; + + const shouldShowBuyMore = !hideManageSubscription && nearLimit; + const shouldShowUpgrade = hideManageSubscription && nearLimit; + + const card: CardProps = { + title: t('Monthly_active_contacts'), + infoText: t('MAC_InfoText'), + ...(shouldShowBuyMore && { + upgradeButton: ( + + {t('Buy_more')} + + ), + + ...(shouldShowUpgrade && { + upgradeButton: ( + + {t('Upgrade')} + + ), + }), + }), + }; + + const color = nearLimit ? Palette.statusColor['status-font-on-danger'].toString() : undefined; + + const message = macLeft > 0 ? t('MAC_Available', { macLeft }) : undefined; + + return ( + + + + ); +}; + +export default MACCard; diff --git a/apps/meteor/client/views/admin/subscription/components/cards/PlanCard.tsx b/apps/meteor/client/views/admin/subscription/components/cards/PlanCard.tsx new file mode 100644 index 000000000000..5ccc5aeecd18 --- /dev/null +++ b/apps/meteor/client/views/admin/subscription/components/cards/PlanCard.tsx @@ -0,0 +1,27 @@ +import type { ILicenseV3 } from '@rocket.chat/core-typings'; +import type { ReactElement } from 'react'; +import React from 'react'; + +import PlanCardPremium from './PlanCard/PlanCardPremium'; +import PlanCardTrial from './PlanCard/PlanCardTrial'; + +type LicenseLimits = { + activeUsers: { max: number; value?: number }; +}; + +type PlanCardProps = { + licenseInformation: ILicenseV3['information']; + licenseLimits: LicenseLimits; +}; + +const PlanCard = ({ licenseInformation, licenseLimits }: PlanCardProps): ReactElement => { + const isTrial = licenseInformation.trial; + + return isTrial ? ( + + ) : ( + + ); +}; + +export default PlanCard; diff --git a/apps/meteor/client/views/admin/subscription/components/cards/PlanCard/PlanCardCommunity.tsx b/apps/meteor/client/views/admin/subscription/components/cards/PlanCard/PlanCardCommunity.tsx new file mode 100644 index 000000000000..3ce0ee07cabd --- /dev/null +++ b/apps/meteor/client/views/admin/subscription/components/cards/PlanCard/PlanCardCommunity.tsx @@ -0,0 +1,26 @@ +import { Card, CardBody, CardRow, Icon } from '@rocket.chat/fuselage'; +import type { ReactElement } from 'react'; +import React from 'react'; +import { useTranslation } from 'react-i18next'; + +import PlanCardHeader from './PlanCardHeader'; + +const PlanCardCommunity = (): ReactElement => { + const { t } = useTranslation(); + + return ( + + + + + {t('free_per_month_user')} + + + {t('Self_managed_hosting')} + + + + ); +}; + +export default PlanCardCommunity; diff --git a/apps/meteor/client/views/admin/subscription/components/cards/PlanCard/PlanCardHeader.tsx b/apps/meteor/client/views/admin/subscription/components/cards/PlanCard/PlanCardHeader.tsx new file mode 100644 index 000000000000..c550cfd2069f --- /dev/null +++ b/apps/meteor/client/views/admin/subscription/components/cards/PlanCard/PlanCardHeader.tsx @@ -0,0 +1,14 @@ +import { CardTitle, Icon, Palette, CardHeader } from '@rocket.chat/fuselage'; +import type { ReactElement } from 'react'; +import React from 'react'; + +const PlanCardHeader = ({ name }: { name: string }): ReactElement => { + return ( + + + {name} + + ); +}; + +export default PlanCardHeader; diff --git a/apps/meteor/client/views/admin/subscription/components/cards/PlanCard/PlanCardPremium.tsx b/apps/meteor/client/views/admin/subscription/components/cards/PlanCard/PlanCardPremium.tsx new file mode 100644 index 000000000000..ea96adf32a38 --- /dev/null +++ b/apps/meteor/client/views/admin/subscription/components/cards/PlanCard/PlanCardPremium.tsx @@ -0,0 +1,69 @@ +import type { ILicenseV3 } from '@rocket.chat/core-typings'; +import { Box, Card, CardBody, Icon, Skeleton } from '@rocket.chat/fuselage'; +import { ExternalLink } from '@rocket.chat/ui-client'; +import type { ReactElement } from 'react'; +import React from 'react'; +import { Trans, useTranslation } from 'react-i18next'; + +import { useFormatDate } from '../../../../../../hooks/useFormatDate'; +import { useIsSelfHosted } from '../../../../../../hooks/useIsSelfHosted'; +import { useLicenseName } from '../../../../../../hooks/useLicense'; +import { CONTACT_SALES_LINK } from '../../../utils/links'; +import PlanCardHeader from './PlanCardHeader'; + +type LicenseLimits = { + activeUsers: { max: number; value?: number }; +}; + +type PlanCardProps = { + licenseInformation: ILicenseV3['information']; + licenseLimits: LicenseLimits; +}; + +const PlanCardPremium = ({ licenseInformation, licenseLimits }: PlanCardProps): ReactElement => { + const { t } = useTranslation(); + const { isSelfHosted, isLoading } = useIsSelfHosted(); + const formatDate = useFormatDate(); + + const planName = useLicenseName(); + + const isAutoRenew = licenseInformation.autoRenew; + const { visualExpiration } = licenseInformation; + + return ( + + + + {licenseLimits?.activeUsers.max === Infinity && ( + + + {t('Unlimited_seats')} + + )} + {visualExpiration && ( + + + + {isAutoRenew ? ( + t('Renews_DATE', { date: formatDate(visualExpiration || '') }) + ) : ( + + Contact sales to check plan renew date. + + )} + + + )} + {!isLoading ? ( + + {isSelfHosted ? t('Self_managed_hosting') : t('Cloud_hosting')} + + ) : ( + + )} + + + ); +}; + +export default PlanCardPremium; diff --git a/apps/meteor/client/views/admin/subscription/components/cards/PlanCard/PlanCardTrial.tsx b/apps/meteor/client/views/admin/subscription/components/cards/PlanCard/PlanCardTrial.tsx new file mode 100644 index 000000000000..eb6a020894ec --- /dev/null +++ b/apps/meteor/client/views/admin/subscription/components/cards/PlanCard/PlanCardTrial.tsx @@ -0,0 +1,69 @@ +import type { ILicenseV3 } from '@rocket.chat/core-typings'; +import { Box, Card, CardBody, CardControls, CardRow, Tag } from '@rocket.chat/fuselage'; +import { ExternalLink } from '@rocket.chat/ui-client'; +import differenceInDays from 'date-fns/differenceInDays'; +import type { ReactElement } from 'react'; +import React from 'react'; +import { Trans, useTranslation } from 'react-i18next'; + +import { useLicenseName } from '../../../../../../hooks/useLicense'; +import { DOWNGRADE_LINK, TRIAL_LINK } from '../../../utils/links'; +import UpgradeButton from '../../UpgradeButton'; +import PlanCardHeader from './PlanCardHeader'; + +type PlanCardProps = { + licenseInformation: ILicenseV3['information']; +}; + +const PlanCardTrial = ({ licenseInformation }: PlanCardProps): ReactElement => { + const { t } = useTranslation(); + + const planName = useLicenseName(); + const isSalesAssisted = licenseInformation.grantedBy?.method !== 'self-service' || true; + const { visualExpiration } = licenseInformation; + + return ( + + + + {visualExpiration && ( + + + {t('Trial_active')} + + {t('n_days_left', { n: differenceInDays(new Date(visualExpiration), new Date()) })} + + )} + + + + {isSalesAssisted ? ( + + Contact sales to finish your purchase and avoid + downgrade consequences. + + ) : ( + + Finish your purchase to avoid downgrade consequences. + + )} + + + + + + Why has a trial been applied to this workspace? + + + + + + + {isSalesAssisted ? t('Finish_purchase') : t('Contact_sales')} + + + + ); +}; + +export default PlanCardTrial; diff --git a/apps/meteor/client/views/admin/subscription/components/cards/SeatsCard.tsx b/apps/meteor/client/views/admin/subscription/components/cards/SeatsCard.tsx new file mode 100644 index 000000000000..a90f2d1171d0 --- /dev/null +++ b/apps/meteor/client/views/admin/subscription/components/cards/SeatsCard.tsx @@ -0,0 +1,51 @@ +import { Palette } from '@rocket.chat/fuselage'; +import type { ReactElement } from 'react'; +import React from 'react'; +import { useTranslation } from 'react-i18next'; + +import type { CardProps } from '../FeatureUsageCard'; +import FeatureUsageCard from '../FeatureUsageCard'; +import UpgradeButton from '../UpgradeButton'; +import UsagePieGraph from '../UsagePieGraph'; + +type SeatsCardProps = { + value: number; + max: number; + hideManageSubscription?: boolean; +}; + +const SeatsCard = ({ value, max, hideManageSubscription }: SeatsCardProps): ReactElement => { + const { t } = useTranslation(); + + const pieGraph = { + used: value, + total: max, + }; + + const nearLimit = pieGraph && pieGraph.used / pieGraph.total >= 0.8; + + const card: CardProps = { + title: t('Seats'), + infoText: t('Seats_InfoText'), + ...(!hideManageSubscription && + nearLimit && { + upgradeButton: ( + + {t('Buy_more')} + + ), + }), + }; + + const seatsLeft = pieGraph.total - pieGraph.used; + const color = pieGraph.used / pieGraph.total >= 0.8 ? Palette.statusColor['status-font-on-danger'].toString() : undefined; + + const message = seatsLeft > 0 ? t('Seats_Available', { seatsLeft }) : undefined; + return ( + + + + ); +}; + +export default SeatsCard; diff --git a/apps/meteor/client/views/admin/subscription/hooks/useCheckoutUrl.ts b/apps/meteor/client/views/admin/subscription/hooks/useCheckoutUrl.ts new file mode 100644 index 000000000000..9ae07c99ac84 --- /dev/null +++ b/apps/meteor/client/views/admin/subscription/hooks/useCheckoutUrl.ts @@ -0,0 +1,15 @@ +import { useAbsoluteUrl } from '@rocket.chat/ui-contexts'; + +export const useCheckoutUrl = () => { + const absoluteUrl = useAbsoluteUrl()('/links/manage-subscription'); + + return (query?: Record) => { + const url = new URL(absoluteUrl); + if (query) { + Object.entries(query).forEach(([key, value]) => { + url.searchParams.append(key, value.toString()); + }); + } + return url.toString(); + }; +}; diff --git a/apps/meteor/client/views/admin/subscription/hooks/useRemoveLicense.ts b/apps/meteor/client/views/admin/subscription/hooks/useRemoveLicense.ts new file mode 100644 index 000000000000..ac3d64647536 --- /dev/null +++ b/apps/meteor/client/views/admin/subscription/hooks/useRemoveLicense.ts @@ -0,0 +1,30 @@ +import { useEndpoint, useToastMessageDispatch, useTranslation } from '@rocket.chat/ui-contexts'; +import { useMutation } from '@tanstack/react-query'; + +import { useInvalidateLicense } from '../../../../hooks/useLicense'; + +export const useRemoveLicense = () => { + const t = useTranslation(); + const dispatchToastMessage = useToastMessageDispatch(); + + const invalidateLicense = useInvalidateLicense(); + + const removeLicense = useEndpoint('POST', '/v1/cloud.removeLicense'); + + return useMutation({ + mutationFn: () => removeLicense(), + onSuccess: () => { + invalidateLicense(100); + dispatchToastMessage({ + type: 'success', + message: t('Removed'), + }); + }, + onError: (error) => { + dispatchToastMessage({ + type: 'error', + message: error, + }); + }, + }); +}; diff --git a/apps/meteor/client/views/admin/subscription/hooks/useWorkspaceSync.ts b/apps/meteor/client/views/admin/subscription/hooks/useWorkspaceSync.ts new file mode 100644 index 000000000000..88f49470ebfc --- /dev/null +++ b/apps/meteor/client/views/admin/subscription/hooks/useWorkspaceSync.ts @@ -0,0 +1,25 @@ +import { useEndpoint, useToastMessageDispatch } from '@rocket.chat/ui-contexts'; +import { useMutation } from '@tanstack/react-query'; +import { useTranslation } from 'react-i18next'; + +export const useWorkspaceSync = () => { + const { t } = useTranslation(); + const cloudSync = useEndpoint('POST', '/v1/cloud.syncWorkspace'); + const dispatchToastMessage = useToastMessageDispatch(); + + return useMutation({ + mutationFn: () => cloudSync(), + onSuccess: () => { + dispatchToastMessage({ + type: 'success', + message: t('Sync_success'), + }); + }, + onError: (error) => { + dispatchToastMessage({ + type: 'error', + message: error, + }); + }, + }); +}; diff --git a/apps/meteor/client/views/admin/subscription/utils/links.ts b/apps/meteor/client/views/admin/subscription/utils/links.ts new file mode 100644 index 000000000000..3b32bf163412 --- /dev/null +++ b/apps/meteor/client/views/admin/subscription/utils/links.ts @@ -0,0 +1,4 @@ +export const CONTACT_SALES_LINK = 'https://go.rocket.chat/i/contact-sales-product'; +export const PRICING_LINK = 'https://go.rocket.chat/i/pricing-product'; +export const DOWNGRADE_LINK = 'https://go.rocket.chat/i/docs-downgrade'; +export const TRIAL_LINK = 'https://go.rocket.chat/i/docs-trial'; diff --git a/apps/meteor/client/views/admin/upgrade/UpgradePage/UpgradePage.tsx b/apps/meteor/client/views/admin/upgrade/UpgradePage/UpgradePage.tsx deleted file mode 100644 index 57b4f2d3e80e..000000000000 --- a/apps/meteor/client/views/admin/upgrade/UpgradePage/UpgradePage.tsx +++ /dev/null @@ -1,112 +0,0 @@ -import { Throbber, Box } from '@rocket.chat/fuselage'; -import { useLayout, useRouteParameter, useSearchParameter, useAbsoluteUrl, useLanguage } from '@rocket.chat/ui-contexts'; -import type { ReactElement } from 'react'; -import React, { useEffect, useRef, useState } from 'react'; - -import type { UpgradeTabVariant } from '../../../../../lib/upgradeTab'; -import Page from '../../../../components/Page'; -import PageHeader from '../../../../components/Page/PageHeader'; -import UpgradePageError from '../UpgradePageError'; - -const urlMap: Record = { - 'go-fully-featured': 'https://go.rocket.chat/i/upgrade-ce-1-unregistered', - 'go-fully-featured-registered': 'https://go.rocket.chat/i/upgrade-ce-1-registered', - 'trial-enterprise': 'https://go.rocket.chat/i/upgrade-ee-trial', - 'upgrade-your-plan': 'https://go.rocket.chat/i/upgrade-ce-2', -}; - -const getUrl = (type: UpgradeTabVariant, date: string | undefined, language: string): string => { - const urlParams = new URLSearchParams({ lang: language.toLowerCase() }); - if (date) { - urlParams.set('date', date); - } - - return `${urlMap[type]}?${urlParams.toString()}`; -}; - -type NavigationMessage = { goTo: string }; - -const isNavigationMessage = (message: unknown): message is NavigationMessage => { - if (typeof message === 'object' && message !== null) { - return 'goTo' in message; - } - - return false; -}; - -const getWindowMessagePath = (e: MessageEvent): string | undefined => { - let parsedMessage = {}; - - try { - parsedMessage = JSON.parse(e.data); - } catch (error) { - return; - } - - if (isNavigationMessage(parsedMessage)) { - return parsedMessage.goTo; - } -}; - -const UpgradePage = (): ReactElement => { - const [isLoading, setIsLoading] = useState(true); - - const type = useRouteParameter('type') as UpgradeTabVariant; - const trialEndDate = useSearchParameter('trialEndDate'); - const language = useLanguage(); - const pageUrl = getUrl(type, trialEndDate, language); - - const getAbsoluteUrl = useAbsoluteUrl(); - - const { isMobile } = useLayout(); - - const ref = useRef(null); - const hasConnection = navigator.onLine; - - useEffect(() => { - const handleNavigationMessage = (e: MessageEvent): void => { - if (ref?.current?.contentWindow !== e.source) { - return; - } - - const path = getWindowMessagePath(e); - - if (!path) { - return; - } - - window.location.href = getAbsoluteUrl(path); - }; - - window.addEventListener('message', handleNavigationMessage); - - return (): void => { - window.removeEventListener('message', handleNavigationMessage); - }; - }, [getAbsoluteUrl]); - - return ( - - {isMobile && } - {!hasConnection && } - {hasConnection && isLoading && ( - - - - )} - {hasConnection && ( - setIsLoading(false)} - invisible={isLoading} - width='100%' - height='100%' - /> - )} - - ); -}; - -export default UpgradePage; diff --git a/apps/meteor/client/views/admin/upgrade/UpgradePage/index.ts b/apps/meteor/client/views/admin/upgrade/UpgradePage/index.ts deleted file mode 100644 index 7ecfeb7e20fa..000000000000 --- a/apps/meteor/client/views/admin/upgrade/UpgradePage/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default } from './UpgradePage'; diff --git a/apps/meteor/client/views/admin/upgrade/UpgradePageError/UpgradePageError.tsx b/apps/meteor/client/views/admin/upgrade/UpgradePageError/UpgradePageError.tsx deleted file mode 100644 index ecc9925eb619..000000000000 --- a/apps/meteor/client/views/admin/upgrade/UpgradePageError/UpgradePageError.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import { States, StatesIcon, StatesSubtitle, StatesTitle, StatesActions, StatesAction, Box } from '@rocket.chat/fuselage'; -import { useTranslation } from '@rocket.chat/ui-contexts'; -import type { ReactElement } from 'react'; -import React from 'react'; - -const UpgradePageError = (): ReactElement => { - const t = useTranslation(); - const handleReconnect = (): void => window.location.reload(); - - return ( - - - - {t('Connection_error')} - {t('Upgrade_tab_connection_error_description')} - - {t('Upgrade_tab_connection_error_restore')} - - - - {t('Refresh')} - - - - - ); -}; - -export default UpgradePageError; diff --git a/apps/meteor/client/views/admin/upgrade/UpgradePageError/index.ts b/apps/meteor/client/views/admin/upgrade/UpgradePageError/index.ts deleted file mode 100644 index b9e4f5e1b747..000000000000 --- a/apps/meteor/client/views/admin/upgrade/UpgradePageError/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default } from './UpgradePageError'; diff --git a/apps/meteor/client/views/admin/users/AdminUserForm.tsx b/apps/meteor/client/views/admin/users/AdminUserForm.tsx index 1912150b4a48..a85754705090 100644 --- a/apps/meteor/client/views/admin/users/AdminUserForm.tsx +++ b/apps/meteor/client/views/admin/users/AdminUserForm.tsx @@ -263,16 +263,14 @@ const UserForm = ({ userData, onReload, ...props }: AdminUserFormProps) => { )} - + {t('Verified')} - - } - /> - - + } + /> + {t('StatusMessage')} @@ -370,45 +368,41 @@ const UserForm = ({ userData, onReload, ...props }: AdminUserFormProps) => { )} - + {t('Require_password_change')} - - ( - - )} - /> - - + ( + + )} + /> + - + {t('Set_random_password_and_send_by_email')} - - ( - - )} - /> - - + ( + + )} + /> + {!isSmtpEnabled && ( { {errors?.roles && {errors.roles.message}} - + {t('Join_default_channels')} - - ( - - )} - /> - - + ( + + )} + /> + - + {t('Send_welcome_email')} - - ( - - )} - /> - - + ( + + )} + /> + {!isSmtpEnabled && ( void; }; +// TODO: Replace menu const AdminUserInfoActions = ({ username, userId, @@ -131,7 +132,7 @@ const AdminUserInfoActions = ({ }, [actionsDefinition, menu]); return ( - + {actions} ); diff --git a/apps/meteor/client/views/admin/users/AdminUserInfoWithData.tsx b/apps/meteor/client/views/admin/users/AdminUserInfoWithData.tsx index d0580b90c642..f9b8bb01e129 100644 --- a/apps/meteor/client/views/admin/users/AdminUserInfoWithData.tsx +++ b/apps/meteor/client/views/admin/users/AdminUserInfoWithData.tsx @@ -10,7 +10,7 @@ import React, { useMemo } from 'react'; import { getUserEmailAddress } from '../../../../lib/getUserEmailAddress'; import { ContextualbarContent } from '../../../components/Contextualbar'; import { FormSkeleton } from '../../../components/Skeleton'; -import UserCard from '../../../components/UserCard'; +import { UserCardRole } from '../../../components/UserCard'; import UserInfo from '../../../components/UserInfo'; import { UserStatus } from '../../../components/UserStatus'; import { getUserEmailVerified } from '../../../lib/utils/getUserEmailVerified'; @@ -76,7 +76,7 @@ const AdminUserInfoWithData = ({ uid, onReload }: AdminUserInfoWithDataProps): R name, username, lastLogin, - roles: getRoles(roles).map((role, index) => {role}), + roles: getRoles(roles).map((role, index) => {role}), bio, canViewAllInfo, phone, diff --git a/apps/meteor/client/views/admin/users/AdminUserUpgrade.tsx b/apps/meteor/client/views/admin/users/AdminUserUpgrade.tsx new file mode 100644 index 000000000000..6b2baa1e2b9c --- /dev/null +++ b/apps/meteor/client/views/admin/users/AdminUserUpgrade.tsx @@ -0,0 +1,32 @@ +import { Button, ButtonGroup, ContextualbarEmptyContent, ContextualbarFooter } from '@rocket.chat/fuselage'; +import { useRouter, useTranslation } from '@rocket.chat/ui-contexts'; +import React from 'react'; + +import { ContextualbarScrollableContent } from '../../../components/Contextualbar'; +import { useExternalLink } from '../../../hooks/useExternalLink'; +import { useCheckoutUrl } from '../subscription/hooks/useCheckoutUrl'; + +const AdminUserUpgrade = () => { + const t = useTranslation(); + const router = useRouter(); + const manageSubscriptionUrl = useCheckoutUrl()({ target: 'user-page', action: 'buy_more' }); + const openExternalLink = useExternalLink(); + + return ( + <> + + + + + + + + + + + ); +}; + +export default AdminUserUpgrade; diff --git a/apps/meteor/client/views/admin/users/AdminUsersPage.tsx b/apps/meteor/client/views/admin/users/AdminUsersPage.tsx index aae06b177cce..115d4f93f3c5 100644 --- a/apps/meteor/client/views/admin/users/AdminUsersPage.tsx +++ b/apps/meteor/client/views/admin/users/AdminUsersPage.tsx @@ -1,20 +1,29 @@ -import { Button, ButtonGroup } from '@rocket.chat/fuselage'; +import { Button, ButtonGroup, ContextualbarIcon } from '@rocket.chat/fuselage'; import { usePermission, useRouteParameter, useTranslation, useRouter } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; -import React, { useEffect, useRef } from 'react'; +import React, { useRef } from 'react'; import UserPageHeaderContentWithSeatsCap from '../../../../ee/client/views/admin/users/UserPageHeaderContentWithSeatsCap'; import { useSeatsCap } from '../../../../ee/client/views/admin/users/useSeatsCap'; -import { Contextualbar, ContextualbarHeader, ContextualbarTitle, ContextualbarClose } from '../../../components/Contextualbar'; -import Page from '../../../components/Page'; +import { + Contextualbar, + ContextualbarHeader, + ContextualbarTitle, + ContextualbarClose, + ContextualbarDialog, +} from '../../../components/Contextualbar'; +import { Page, PageHeader, PageContent } from '../../../components/Page'; +import { useShouldPreventAction } from '../../../hooks/useShouldPreventAction'; import AdminInviteUsers from './AdminInviteUsers'; import AdminUserForm from './AdminUserForm'; import AdminUserFormWithData from './AdminUserFormWithData'; import AdminUserInfoWithData from './AdminUserInfoWithData'; +import AdminUserUpgrade from './AdminUserUpgrade'; import UsersTable from './UsersTable'; const UsersPage = (): ReactElement => { const t = useTranslation(); + const seatsCap = useSeatsCap(); const reload = useRef(() => null); @@ -25,62 +34,60 @@ const UsersPage = (): ReactElement => { const canCreateUser = usePermission('create-user'); const canBulkCreateUser = usePermission('bulk-register-user'); - useEffect(() => { - if (!context || !seatsCap) { - return; - } - - if (seatsCap.activeUsers >= seatsCap.maxActiveUsers && !['edit', 'info'].includes(context)) { - router.navigate('/admin/users'); - } - }, [router, context, seatsCap]); + const isCreateUserDisabled = useShouldPreventAction('activeUsers'); const handleReload = (): void => { seatsCap?.reload(); reload.current(); }; + const isRoutePrevented = context && ['new', 'invite'].includes(context) && isCreateUserDisabled; + return ( - + {seatsCap && seatsCap.maxActiveUsers < Number.POSITIVE_INFINITY ? ( ) : ( - {canCreateUser && ( - - )} {canBulkCreateUser && ( )} + {canCreateUser && ( + + )} )} - - + + - + {context && ( - - - - {context === 'info' && t('User_Info')} - {context === 'edit' && t('Edit_User')} - {context === 'new' && t('Add_User')} - {context === 'invite' && t('Invite_Users')} - - router.navigate('/admin/users')} /> - - {context === 'info' && id && } - {context === 'edit' && id && } - {context === 'new' && } - {context === 'invite' && } - + + + + {context === 'upgrade' && } + + {context === 'info' && t('User_Info')} + {context === 'edit' && t('Edit_User')} + {context === 'new' && t('Add_User')} + {context === 'invite' && t('Invite_Users')} + + router.navigate('/admin/users')} /> + + {context === 'info' && id && } + {context === 'edit' && id && } + {!isRoutePrevented && context === 'new' && } + {!isRoutePrevented && context === 'invite' && } + {isRoutePrevented && } + + )} ); diff --git a/apps/meteor/client/views/admin/users/UsersTable/UsersTableRow.tsx b/apps/meteor/client/views/admin/users/UsersTable/UsersTableRow.tsx index 2572b7446c42..4010b118e57d 100644 --- a/apps/meteor/client/views/admin/users/UsersTable/UsersTableRow.tsx +++ b/apps/meteor/client/views/admin/users/UsersTable/UsersTableRow.tsx @@ -1,6 +1,7 @@ import type { IRole, IUser } from '@rocket.chat/core-typings'; import { Box } from '@rocket.chat/fuselage'; import { capitalize } from '@rocket.chat/string-helpers'; +import { UserAvatar } from '@rocket.chat/ui-avatar'; import type { TranslationKey } from '@rocket.chat/ui-contexts'; import { useTranslation } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; @@ -8,7 +9,6 @@ import React from 'react'; import { Roles } from '../../../../../app/models/client'; import { GenericTableRow, GenericTableCell } from '../../../../components/GenericTable'; -import UserAvatar from '../../../../components/avatar/UserAvatar'; type UsersTableRowProps = { user: Pick; diff --git a/apps/meteor/client/views/admin/viewLogs/AnalyticsReports.tsx b/apps/meteor/client/views/admin/viewLogs/AnalyticsReports.tsx index 9307a2596a71..efd1846c09d3 100644 --- a/apps/meteor/client/views/admin/viewLogs/AnalyticsReports.tsx +++ b/apps/meteor/client/views/admin/viewLogs/AnalyticsReports.tsx @@ -2,12 +2,12 @@ import { Box, Icon, Skeleton, Scrollable } from '@rocket.chat/fuselage'; import { useTranslation } from '@rocket.chat/ui-contexts'; import React from 'react'; -import { useAnalyticsObject } from './hooks/useAnalyticsObject'; +import { useStatistics } from '../../hooks/useStatistics'; const AnalyticsReports = () => { const t = useTranslation(); - const { data, isLoading, isSuccess, isError } = useAnalyticsObject(); + const { data, isLoading, isSuccess, isError } = useStatistics(); return ( diff --git a/apps/meteor/client/views/admin/viewLogs/ViewLogsPage.tsx b/apps/meteor/client/views/admin/viewLogs/ViewLogsPage.tsx index 8defbb997c36..8d8118679235 100644 --- a/apps/meteor/client/views/admin/viewLogs/ViewLogsPage.tsx +++ b/apps/meteor/client/views/admin/viewLogs/ViewLogsPage.tsx @@ -3,7 +3,7 @@ import { useTranslation } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; import React, { useState } from 'react'; -import Page from '../../../components/Page'; +import { Page, PageHeader, PageContent } from '../../../components/Page'; import AnalyticsReports from './AnalyticsReports'; import ServerLogs from './ServerLogs'; @@ -13,7 +13,7 @@ const ViewLogsPage = (): ReactElement => { return ( - + setTab('Logs')} selected={tab === 'Logs'}> @@ -24,7 +24,7 @@ const ViewLogsPage = (): ReactElement => { - {tab === 'Logs' ? : } + {tab === 'Logs' ? : } ); }; diff --git a/apps/meteor/client/views/admin/viewLogs/hooks/useAnalyticsObject.ts b/apps/meteor/client/views/admin/viewLogs/hooks/useAnalyticsObject.ts deleted file mode 100644 index 8aad0e605964..000000000000 --- a/apps/meteor/client/views/admin/viewLogs/hooks/useAnalyticsObject.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { useEndpoint } from '@rocket.chat/ui-contexts'; -import { useQuery } from '@tanstack/react-query'; - -export const useAnalyticsObject = () => { - const getAnalytics = useEndpoint('GET', '/v1/statistics'); - - return useQuery(['analytics'], () => getAnalytics({}), { staleTime: 10 * 60 * 1000 }); -}; diff --git a/apps/meteor/client/views/admin/info/DeploymentCard.stories.tsx b/apps/meteor/client/views/admin/workspace/DeploymentCard/DeploymentCard.stories.tsx similarity index 99% rename from apps/meteor/client/views/admin/info/DeploymentCard.stories.tsx rename to apps/meteor/client/views/admin/workspace/DeploymentCard/DeploymentCard.stories.tsx index d3242e68ae2c..5fb8b4d146f2 100644 --- a/apps/meteor/client/views/admin/info/DeploymentCard.stories.tsx +++ b/apps/meteor/client/views/admin/workspace/DeploymentCard/DeploymentCard.stories.tsx @@ -61,6 +61,7 @@ export default { totalChannelMessages: 213, totalPrivateGroupMessages: 21, totalDirectMessages: 23, + totalDiscussionsMessages: 32, totalLivechatMessages: 31, // - _id: '', diff --git a/apps/meteor/client/views/admin/workspace/DeploymentCard/DeploymentCard.tsx b/apps/meteor/client/views/admin/workspace/DeploymentCard/DeploymentCard.tsx new file mode 100644 index 000000000000..0b48d0c8cc88 --- /dev/null +++ b/apps/meteor/client/views/admin/workspace/DeploymentCard/DeploymentCard.tsx @@ -0,0 +1,71 @@ +import type { IWorkspaceInfo, IStats } from '@rocket.chat/core-typings'; +import { Button, Card, CardControls } from '@rocket.chat/fuselage'; +import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; +import type { IInstance } from '@rocket.chat/rest-typings'; +import { useSetModal, useTranslation } from '@rocket.chat/ui-contexts'; +import type { ReactElement } from 'react'; +import React, { memo } from 'react'; + +import { useFormatDateAndTime } from '../../../../hooks/useFormatDateAndTime'; +import WorkspaceCardSection from '../components/WorkspaceCardSection'; +import InstancesModal from './components/InstancesModal'; + +type DeploymentCardProps = { + serverInfo: IWorkspaceInfo; + instances: IInstance[]; + statistics: IStats; +}; + +const DeploymentCard = ({ serverInfo: { info }, statistics, instances }: DeploymentCardProps): ReactElement => { + const t = useTranslation(); + const formatDateAndTime = useFormatDateAndTime(); + const setModal = useSetModal(); + + const { commit = {}, marketplaceApiVersion: appsEngineVersion } = info || {}; + + const handleInstancesModal = useMutableCallback(() => { + setModal( setModal()} />); + }); + + return ( + + + + + + {appsEngineVersion && } + + + + + {t('github_HEAD')}: ({commit.hash ? commit.hash.slice(0, 9) : ''})
+ {t('Branch')}: {commit.branch}
+ {commit.subject} + + } + /> + + + {!!instances.length && ( + + + + )} +
+ ); +}; + +export default memo(DeploymentCard); diff --git a/apps/meteor/client/views/admin/info/InstancesModal/DescriptionList.stories.tsx b/apps/meteor/client/views/admin/workspace/DeploymentCard/components/InstancesModal/DescriptionList.stories.tsx similarity index 100% rename from apps/meteor/client/views/admin/info/InstancesModal/DescriptionList.stories.tsx rename to apps/meteor/client/views/admin/workspace/DeploymentCard/components/InstancesModal/DescriptionList.stories.tsx diff --git a/apps/meteor/client/views/admin/info/InstancesModal/DescriptionList.tsx b/apps/meteor/client/views/admin/workspace/DeploymentCard/components/InstancesModal/DescriptionList.tsx similarity index 100% rename from apps/meteor/client/views/admin/info/InstancesModal/DescriptionList.tsx rename to apps/meteor/client/views/admin/workspace/DeploymentCard/components/InstancesModal/DescriptionList.tsx diff --git a/apps/meteor/client/views/admin/info/InstancesModal/DescriptionListEntry.tsx b/apps/meteor/client/views/admin/workspace/DeploymentCard/components/InstancesModal/DescriptionListEntry.tsx similarity index 100% rename from apps/meteor/client/views/admin/info/InstancesModal/DescriptionListEntry.tsx rename to apps/meteor/client/views/admin/workspace/DeploymentCard/components/InstancesModal/DescriptionListEntry.tsx diff --git a/apps/meteor/client/views/admin/info/InstancesModal/InstancesModal.stories.tsx b/apps/meteor/client/views/admin/workspace/DeploymentCard/components/InstancesModal/InstancesModal.stories.tsx similarity index 95% rename from apps/meteor/client/views/admin/info/InstancesModal/InstancesModal.stories.tsx rename to apps/meteor/client/views/admin/workspace/DeploymentCard/components/InstancesModal/InstancesModal.stories.tsx index b8d66526bf78..882cbeb43c6c 100644 --- a/apps/meteor/client/views/admin/info/InstancesModal/InstancesModal.stories.tsx +++ b/apps/meteor/client/views/admin/workspace/DeploymentCard/components/InstancesModal/InstancesModal.stories.tsx @@ -27,8 +27,8 @@ Default.args = { connected: true, }, instanceRecord: { - _updatedAt: '00-00-00', - _createdAt: '00-00-00', + _updatedAt: new Date(), + _createdAt: new Date(), _id: 'instance-id', name: 'instance-name', pid: 123, diff --git a/apps/meteor/client/views/admin/info/InstancesModal/InstancesModal.tsx b/apps/meteor/client/views/admin/workspace/DeploymentCard/components/InstancesModal/InstancesModal.tsx similarity index 91% rename from apps/meteor/client/views/admin/info/InstancesModal/InstancesModal.tsx rename to apps/meteor/client/views/admin/workspace/DeploymentCard/components/InstancesModal/InstancesModal.tsx index 44d9aacc3217..e0b22e35f5f1 100644 --- a/apps/meteor/client/views/admin/info/InstancesModal/InstancesModal.tsx +++ b/apps/meteor/client/views/admin/workspace/DeploymentCard/components/InstancesModal/InstancesModal.tsx @@ -1,16 +1,15 @@ -import type { Serialized } from '@rocket.chat/core-typings'; import { Accordion } from '@rocket.chat/fuselage'; import type { IInstance } from '@rocket.chat/rest-typings'; import { useTranslation } from '@rocket.chat/ui-contexts'; import React from 'react'; -import GenericModal from '../../../../components/GenericModal'; -import { useFormatDateAndTime } from '../../../../hooks/useFormatDateAndTime'; +import GenericModal from '../../../../../../components/GenericModal'; +import { useFormatDateAndTime } from '../../../../../../hooks/useFormatDateAndTime'; import DescriptionList from './DescriptionList'; import DescriptionListEntry from './DescriptionListEntry'; type InstancesModalProps = { - instances: Serialized[]; + instances: IInstance[]; onClose: () => void; }; diff --git a/apps/meteor/client/views/admin/info/InstancesModal/index.ts b/apps/meteor/client/views/admin/workspace/DeploymentCard/components/InstancesModal/index.ts similarity index 100% rename from apps/meteor/client/views/admin/info/InstancesModal/index.ts rename to apps/meteor/client/views/admin/workspace/DeploymentCard/components/InstancesModal/index.ts diff --git a/apps/meteor/client/views/admin/workspace/MessagesRoomsCard/MessagesRoomsCard.stories.tsx b/apps/meteor/client/views/admin/workspace/MessagesRoomsCard/MessagesRoomsCard.stories.tsx new file mode 100644 index 000000000000..53cd89838e2a --- /dev/null +++ b/apps/meteor/client/views/admin/workspace/MessagesRoomsCard/MessagesRoomsCard.stories.tsx @@ -0,0 +1,267 @@ +import type { ComponentMeta, ComponentStory } from '@storybook/react'; +import React from 'react'; + +import MessagesRoomsCard from './MessagesRoomsCard'; + +export default { + title: 'Admin/Info/MessagesRoomsCard', + component: MessagesRoomsCard, + parameters: { + layout: 'centered', + }, + args: { + statistics: { + // Users + totalUsers: 123, + onlineUsers: 23, + awayUsers: 32, + busyUsers: 21, + offlineUsers: 123 - 23 - 32 - 21, + // Types and Distribution + totalConnectedUsers: 32, + activeUsers: 12, + activeGuests: 32 - 12, + nonActiveUsers: 0, + appUsers: 23, + // Uploads + uploadsTotal: 321, + uploadsTotalSize: 123 * 1024 * 1024, + // Rooms + totalRooms: 231, + totalChannels: 12, + totalPrivateGroups: 23, + totalDirect: 21, + totalDiscussions: 32, + totalLivechat: 31, + // Messages + totalMessages: 321, + totalThreads: 123, + totalChannelMessages: 213, + totalPrivateGroupMessages: 21, + totalDirectMessages: 23, + totalDiscussionsMessages: 32, + totalLivechatMessages: 31, + // - + _id: '', + wizard: {}, + uniqueId: '', + deploymentFingerprintHash: '', + deploymentFingerprintVerified: true, + installedAt: '', + version: '', + tag: '', + branch: '', + userLanguages: {}, + teams: { + totalTeams: 0, + totalRoomsInsideTeams: 0, + totalDefaultRoomsInsideTeams: 0, + }, + totalLivechatManagers: 10, + totalCustomFields: 10, + totalTriggers: 1, + isDepartmentRemovalEnabled: false, + archivedDepartments: 0, + totalLivechatVisitors: 0, + totalLivechatAgents: 0, + livechatEnabled: false, + federatedServers: 0, + federatedUsers: 0, + lastLogin: '', + lastMessageSentAt: new Date(), + lastSeenSubscription: '', + os: { + type: '', + platform: 'linux', + arch: '', + release: '', + uptime: 0, + loadavg: [0, 0, 0], + totalmem: 0, + freemem: 0, + cpus: [ + { + model: '', + speed: 0, + times: { + user: 0, + nice: 0, + sys: 0, + idle: 0, + irq: 0, + }, + }, + ], + }, + process: { + nodeVersion: '', + pid: 0, + uptime: 0, + }, + deploy: { + method: '', + platform: '', + }, + enterpriseReady: false, + migration: { + _id: '', + locked: false, + version: 0, + buildAt: '', + lockedAt: '', + }, + instanceCount: 0, + msEnabled: false, + oplogEnabled: false, + mongoVersion: '', + mongoStorageEngine: '', + pushQueue: 0, + omnichannelSources: [{}], + departments: 0, + routingAlgorithm: '', + onHoldEnabled: false, + emailInboxes: 0, + BusinessHours: {}, + lastChattedAgentPreferred: false, + assignNewConversationsToContactManager: false, + visitorAbandonment: '', + chatsOnHold: 0, + voipEnabled: false, + voipCalls: 0, + voipExtensions: 0, + voipSuccessfulCalls: 0, + voipErrorCalls: 0, + voipOnHoldCalls: 0, + webRTCEnabled: false, + webRTCEnabledForOmnichannel: false, + omnichannelWebRTCCalls: 1, + federationOverviewData: { + numberOfEvents: 0, + numberOfFederatedUsers: 0, + numberOfServers: 0, + }, + readReceiptsEnabled: false, + readReceiptsDetailed: false, + uniqueUsersOfLastWeek: { data: [], day: 0, month: 0, year: 0 }, + uniqueUsersOfLastMonth: { data: [], day: 0, month: 0, year: 0 }, + uniqueUsersOfYesterday: { data: [], day: 0, month: 0, year: 0 }, + uniqueDevicesOfYesterday: { data: [], day: 0, month: 0, year: 0 }, + uniqueDevicesOfLastWeek: { data: [], day: 0, month: 0, year: 0 }, + uniqueDevicesOfLastMonth: { data: [], day: 0, month: 0, year: 0 }, + uniqueOSOfYesterday: { data: [], day: 0, month: 0, year: 0 }, + uniqueOSOfLastWeek: { data: [], day: 0, month: 0, year: 0 }, + uniqueOSOfLastMonth: { data: [], day: 0, month: 0, year: 0 }, + omnichannelContactsBySource: { contactsCount: 0, conversationsCount: 0, sources: [] }, + uniqueContactsOfLastMonth: { contactsCount: 0, conversationsCount: 0, sources: [] }, + uniqueContactsOfLastWeek: { contactsCount: 0, conversationsCount: 0, sources: [] }, + uniqueContactsOfYesterday: { contactsCount: 0, conversationsCount: 0, sources: [] }, + apps: { + engineVersion: 'x.y.z', + enabled: false, + totalInstalled: 0, + totalActive: 0, + totalFailed: 0, + }, + services: {}, + importer: {}, + settings: {}, + integrations: { + totalIntegrations: 0, + totalIncoming: 0, + totalIncomingActive: 0, + totalOutgoing: 0, + totalOutgoingActive: 0, + totalWithScriptEnabled: 0, + }, + enterprise: { + modules: [], + tags: [], + seatRequests: 0, + livechatTags: 0, + cannedResponses: 0, + priorities: 0, + businessUnits: 0, + }, + createdAt: new Date(), + showHomeButton: false, + homeTitleChanged: false, + homeBodyChanged: false, + customCSSChanged: false, + onLogoutCustomScriptChanged: false, + loggedOutCustomScriptChanged: false, + loggedInCustomScriptChanged: false, + logoChange: false, + customCSS: 0, + customScript: 0, + tabInvites: 0, + totalEmailInvitation: 0, + totalRoomsWithStarred: 0, + totalRoomsWithPinned: 0, + totalStarred: 0, + totalPinned: 0, + totalE2ERooms: 0, + totalE2EMessages: 0, + totalUserTOTP: 0, + totalUserEmail2fa: 0, + usersCreatedADM: 0, + usersCreatedSlackImport: 0, + usersCreatedSlackUser: 0, + usersCreatedCSVImport: 0, + usersCreatedHiptext: 0, + totalOTR: 0, + totalOTRRooms: 0, + slashCommandsJitsi: 0, + messageAuditApply: 0, + messageAuditLoad: 0, + dashboardCount: 0, + joinJitsiButton: 0, + totalBroadcastRooms: 0, + totalRoomsWithActiveLivestream: 0, + totalTriggeredEmails: 0, + totalLinkInvitation: 0, + roomsInsideTeams: 0, + totalEncryptedMessages: 0, + totalLinkInvitationUses: 0, + totalManuallyAddedUsers: 0, + videoConf: { + videoConference: { + started: 0, + ended: 0, + }, + direct: { + calling: 0, + started: 0, + ended: 0, + }, + livechat: { + started: 0, + ended: 0, + }, + settings: { + provider: '', + dms: false, + channels: false, + groups: false, + teams: false, + }, + }, + totalSubscriptionRoles: 0, + totalUserRoles: 0, + totalCustomRoles: 0, + totalWebRTCCalls: 0, + uncaughtExceptionsCount: 0, + push: 0, + dailyPeakConnections: 0, + maxMonthlyPeakConnections: 0, + matrixFederation: { + enabled: false, + }, + }, + }, +} as ComponentMeta; + +const Template: ComponentStory = (args) => ; + +export const Example = Template.bind({}); + +export const Vertical = Template.bind({}); diff --git a/apps/meteor/client/views/admin/workspace/MessagesRoomsCard/MessagesRoomsCard.tsx b/apps/meteor/client/views/admin/workspace/MessagesRoomsCard/MessagesRoomsCard.tsx new file mode 100644 index 000000000000..4b3ffd819f81 --- /dev/null +++ b/apps/meteor/client/views/admin/workspace/MessagesRoomsCard/MessagesRoomsCard.tsx @@ -0,0 +1,62 @@ +import type { IStats } from '@rocket.chat/core-typings'; +import { Card } from '@rocket.chat/fuselage'; +import { useTranslation } from '@rocket.chat/ui-contexts'; +import type { ReactElement } from 'react'; +import React, { memo } from 'react'; + +import WorkspaceCardSection from '../components/WorkspaceCardSection'; +import WorkspaceCardTextSeparator from '../components/WorkspaceCardTextSeparator'; + +type MessagesRoomsCardProps = { + statistics: IStats; +}; + +const MessagesRoomsCard = ({ statistics }: MessagesRoomsCardProps): ReactElement => { + const t = useTranslation(); + + return ( + + + + + + + + + + } + /> + + + + + + + + + + } + /> + + ); +}; + +export default memo(MessagesRoomsCard); diff --git a/apps/meteor/client/views/admin/workspace/UsersUploadsCard/UsersUploadsCard.tsx b/apps/meteor/client/views/admin/workspace/UsersUploadsCard/UsersUploadsCard.tsx new file mode 100644 index 000000000000..3298f38b0f11 --- /dev/null +++ b/apps/meteor/client/views/admin/workspace/UsersUploadsCard/UsersUploadsCard.tsx @@ -0,0 +1,78 @@ +import type { IStats } from '@rocket.chat/core-typings'; +import { Button, Card, CardBody, CardControls } from '@rocket.chat/fuselage'; +import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; +import { useRouter, useTranslation } from '@rocket.chat/ui-contexts'; +import type { ReactElement } from 'react'; +import React, { memo } from 'react'; + +import { useHasLicenseModule } from '../../../../../ee/client/hooks/useHasLicenseModule'; +import { useFormatMemorySize } from '../../../../hooks/useFormatMemorySize'; +import WorkspaceCardSection from '../components/WorkspaceCardSection'; +import WorkspaceCardTextSeparator from '../components/WorkspaceCardTextSeparator'; + +type UsersUploadsCardProps = { + statistics: IStats; +}; + +const UsersUploadsCard = ({ statistics }: UsersUploadsCardProps): ReactElement => { + const t = useTranslation(); + const formatMemorySize = useFormatMemorySize(); + + const router = useRouter(); + + const handleEngagement = useMutableCallback(() => { + router.navigate('/admin/engagement'); + }); + + const canViewEngagement = useHasLicenseModule('engagement-dashboard'); + + return ( + + + + + + + + + + } + /> + + + + + + + + + } + /> + + + + + + } + /> + + + + + + + ); +}; + +export default memo(UsersUploadsCard); diff --git a/apps/meteor/client/views/admin/workspace/VersionCard/VersionCard.tsx b/apps/meteor/client/views/admin/workspace/VersionCard/VersionCard.tsx new file mode 100644 index 000000000000..868b2ca24e6e --- /dev/null +++ b/apps/meteor/client/views/admin/workspace/VersionCard/VersionCard.tsx @@ -0,0 +1,213 @@ +import type { IWorkspaceInfo } from '@rocket.chat/core-typings'; +import { Box, Card, CardBody, CardCol, CardControls, CardHeader, CardTitle, Icon } from '@rocket.chat/fuselage'; +import { useMediaQuery } from '@rocket.chat/fuselage-hooks'; +import type { SupportedVersions } from '@rocket.chat/server-cloud-communication'; +import { ExternalLink } from '@rocket.chat/ui-client'; +import type { LocationPathname } from '@rocket.chat/ui-contexts'; +import { useSetModal, useMediaUrl } from '@rocket.chat/ui-contexts'; +import type { ReactElement, ReactNode } from 'react'; +import React, { useMemo } from 'react'; +import { Trans, useTranslation } from 'react-i18next'; + +import { useFormatDate } from '../../../../hooks/useFormatDate'; +import { useLicense, useLicenseName } from '../../../../hooks/useLicense'; +import { useRegistrationStatus } from '../../../../hooks/useRegistrationStatus'; +import { isOverLicenseLimits } from '../../../../lib/utils/isOverLicenseLimits'; +import VersionCardActionButton from './components/VersionCardActionButton'; +import type { VersionActionItem } from './components/VersionCardActionItem'; +import VersionCardActionItem from './components/VersionCardActionItem'; +import { VersionCardSkeleton } from './components/VersionCardSkeleton'; +import { VersionTag } from './components/VersionTag'; +import { getVersionStatus } from './getVersionStatus'; +import RegisterWorkspaceModal from './modals/RegisterWorkspaceModal'; + +const SUPPORT_EXTERNAL_LINK = 'https://go.rocket.chat/i/version-support'; +const RELEASES_EXTERNAL_LINK = 'https://go.rocket.chat/i/update-product'; + +type VersionCardProps = { + serverInfo: IWorkspaceInfo; +}; + +const VersionCard = ({ serverInfo }: VersionCardProps): ReactElement => { + const mediaQuery = useMediaQuery('(min-width: 1024px)'); + + const getUrl = useMediaUrl(); + const cardBackground = { + backgroundImage: `url(${getUrl('images/globe.png')})`, + backgroundRepeat: 'no-repeat', + backgroundPosition: 'right 20px center', + backgroundSize: mediaQuery ? 'auto' : 'contain', + }; + + const setModal = useSetModal(); + + const { t } = useTranslation(); + + const formatDate = useFormatDate(); + + const { data: licenseData, isLoading, refetch: refetchLicense } = useLicense({ loadValues: true }); + const { isRegistered } = useRegistrationStatus(); + + const { license, limits } = licenseData || {}; + const isAirgapped = license?.information?.offline; + const licenseName = useLicenseName(); + + const serverVersion = serverInfo.version; + + const { versionStatus, versions } = useMemo(() => { + const supportedVersions = serverInfo?.supportedVersions?.signed ? decodeBase64(serverInfo?.supportedVersions?.signed) : undefined; + + if (!supportedVersions) { + return {}; + } + + const versionStatus = getVersionStatus(serverVersion, supportedVersions?.versions); + + return { + versionStatus, + versions: supportedVersions?.versions, + }; + }, [serverInfo?.supportedVersions?.signed, serverVersion]); + + const isOverLimits = limits && isOverLicenseLimits(limits); + + const actionButton: + | undefined + | { + path: LocationPathname; + label: ReactNode; + } + | { + action: () => void; + label: ReactNode; + } = useMemo(() => { + if (!isRegistered) { + return { + action: () => { + const handleModalClose = (): void => { + setModal(null); + refetchLicense(); + }; + setModal(); + }, + label: t('RegisterWorkspace_Button'), + }; + } + + if (versionStatus?.label === 'outdated') { + return { + action: () => { + window.open(RELEASES_EXTERNAL_LINK, '_blank'); + }, + label: t('Update_version'), + }; + } + + if (isOverLimits) { + return { path: '/admin/subscription', label: t('Manage_subscription') }; + } + }, [isRegistered, versionStatus, isOverLimits, t, setModal, refetchLicense]); + + const actionItems = useMemo(() => { + return ( + [ + isOverLimits + ? { + danger: true, + icon: 'warning', + label: t('Plan_limits_reached'), + } + : { + icon: 'check', + label: t('Operating_withing_plan_limits'), + }, + (isAirgapped || !versions) && { + icon: 'warning', + label: ( + + Check + support + availability + + ), + }, + + versionStatus?.label !== 'outdated' && + versionStatus?.expiration && { + icon: 'check', + label: ( + + Version + supported + until {formatDate(versionStatus?.expiration)} + + ), + }, + versionStatus?.label === 'outdated' && { + danger: true, + icon: 'warning', + label: ( + + Version + not supported + + ), + }, + isRegistered + ? { + icon: 'check', + label: t('Workspace_registered'), + } + : { + danger: true, + icon: 'warning', + label: t('Workspace_not_registered'), + }, + ].filter(Boolean) as VersionActionItem[] + ).sort((a) => (a.danger ? -1 : 1)); + }, [isOverLimits, t, isAirgapped, versions, versionStatus?.label, versionStatus?.expiration, formatDate, isRegistered]); + + if (isLoading && !licenseData) { + return ( + + ; + + ); + } + + return ( + + + + {t('Version_version', { version: serverVersion })} + {!isAirgapped && versions && } + + + + {licenseName.data} + + + + + {actionItems.length > 0 && actionItems.map((item, index) => )} + + + {actionButton && ( + + + + )} + + ); +}; + +export default VersionCard; + +const decodeBase64 = (b64: string): SupportedVersions | undefined => { + const [, bodyEncoded] = b64.split('.'); + if (!bodyEncoded) { + return; + } + + return JSON.parse(atob(bodyEncoded)); +}; diff --git a/apps/meteor/client/views/admin/workspace/VersionCard/components/VersionCardActionButton.tsx b/apps/meteor/client/views/admin/workspace/VersionCard/components/VersionCardActionButton.tsx new file mode 100644 index 000000000000..4796bdee2350 --- /dev/null +++ b/apps/meteor/client/views/admin/workspace/VersionCard/components/VersionCardActionButton.tsx @@ -0,0 +1,38 @@ +import { Button } from '@rocket.chat/fuselage'; +import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; +import type { LocationPathname } from '@rocket.chat/ui-contexts'; +import { useRouter } from '@rocket.chat/ui-contexts'; +import type { ReactElement, ReactNode } from 'react'; +import React, { memo } from 'react'; + +type VersionCardActionButtonProps = + | { + path: LocationPathname; + label: ReactNode; + } + | { + action: () => void; + label: ReactNode; + }; + +export type VersionActionButton = {}; + +const VersionCardActionButton = (item: VersionCardActionButtonProps): ReactElement => { + const router = useRouter(); + + const handleActionButton = useMutableCallback(() => { + if ('action' in item) { + return item.action(); + } + + router.navigate(item.path); + }); + + return ( + + ); +}; + +export default memo(VersionCardActionButton); diff --git a/apps/meteor/client/views/admin/workspace/VersionCard/components/VersionCardActionItem.tsx b/apps/meteor/client/views/admin/workspace/VersionCard/components/VersionCardActionItem.tsx new file mode 100644 index 000000000000..afbbd63fddcd --- /dev/null +++ b/apps/meteor/client/views/admin/workspace/VersionCard/components/VersionCardActionItem.tsx @@ -0,0 +1,23 @@ +import { Box, FramedIcon } from '@rocket.chat/fuselage'; +import type { Keys } from '@rocket.chat/icons'; +import type { ReactElement, ReactNode } from 'react'; +import React from 'react'; + +export type VersionActionItem = { + danger?: boolean; + icon: Keys; + label: ReactNode; +}; + +type VersionCardActionItemProps = VersionActionItem; + +const VersionCardActionItem = ({ icon, label, danger }: VersionCardActionItemProps): ReactElement => { + return ( + + + {label} + + ); +}; + +export default VersionCardActionItem; diff --git a/apps/meteor/client/views/admin/workspace/VersionCard/components/VersionCardSkeleton.tsx b/apps/meteor/client/views/admin/workspace/VersionCard/components/VersionCardSkeleton.tsx new file mode 100644 index 000000000000..19dd498b1bf3 --- /dev/null +++ b/apps/meteor/client/views/admin/workspace/VersionCard/components/VersionCardSkeleton.tsx @@ -0,0 +1,24 @@ +import { Box, Skeleton } from '@rocket.chat/fuselage'; +import React from 'react'; + +export const VersionCardSkeleton = () => { + return ( + <> + + + + + + + + + + + + + + + + + ); +}; diff --git a/apps/meteor/client/views/admin/workspace/VersionCard/components/VersionTag.tsx b/apps/meteor/client/views/admin/workspace/VersionCard/components/VersionTag.tsx new file mode 100644 index 000000000000..4671661352e4 --- /dev/null +++ b/apps/meteor/client/views/admin/workspace/VersionCard/components/VersionTag.tsx @@ -0,0 +1,35 @@ +import { Tag } from '@rocket.chat/fuselage'; +import React from 'react'; +import { useTranslation } from 'react-i18next'; + +export type VersionStatus = 'outdated' | 'latest' | 'available_version' | undefined; + +type VersionTagProps = { + versionStatus: VersionStatus; + title?: string; +}; + +export const VersionTag = ({ versionStatus, title }: VersionTagProps) => { + const { t } = useTranslation(); + if (versionStatus === 'outdated') { + return ( + + {t('Outdated')} + + ); + } + + if (versionStatus === 'latest') { + return ( + + {t('Latest')} + + ); + } + + return ( + + {t('New_version_available')} + + ); +}; diff --git a/apps/meteor/client/views/admin/workspace/VersionCard/getVersionStatus.spec.ts b/apps/meteor/client/views/admin/workspace/VersionCard/getVersionStatus.spec.ts new file mode 100644 index 000000000000..a15af110996b --- /dev/null +++ b/apps/meteor/client/views/admin/workspace/VersionCard/getVersionStatus.spec.ts @@ -0,0 +1,185 @@ +import { getVersionStatus } from './getVersionStatus'; + +describe('if the server version from server and the highest version from cloud are the same', () => { + describe('the expiration date is in the future', () => { + it('should return as latest version', () => { + const status = getVersionStatus('3.0.0', [ + { + version: '3.0.0', + expiration: new Date(new Date().setFullYear(new Date().getFullYear() + 1)), + security: false, + infoUrl: '', + }, + ]); + + expect(status.label).toBe('latest'); + }); + }); + + describe('the expiration date is in the past', () => { + it('should return as outdated version', () => { + const status = getVersionStatus('3.0.0', [ + { + version: '3.0.0', + expiration: new Date('2020-01-01'), + security: false, + infoUrl: '', + }, + ]); + + expect(status.label).toBe('outdated'); + }); + }); +}); + +describe('if the server version is not in the list of supported versions', () => { + it('should return as outdated version', () => { + const status = getVersionStatus('2.0.0', [ + { + version: '3.0.0', + expiration: new Date(), + security: false, + infoUrl: '', + }, + ]); + + expect(status.label).toBe('outdated'); + }); +}); + +describe('if the server version is in the list of supported versions but is not the highest', () => { + describe('the expiration date is in the future', () => { + it('should return as available version', () => { + const status = getVersionStatus('3.0.0', [ + { + version: '3.0.0', + expiration: new Date(new Date().setFullYear(new Date().getFullYear() + 1)), + security: false, + infoUrl: '', + }, + { + version: '4.0.0', + expiration: new Date(new Date().setFullYear(new Date().getFullYear() + 1)), + security: false, + infoUrl: '', + }, + ]); + expect(status.label).toBe('available_version'); + }); + }); + describe('the expiration date is in the past', () => { + it('should return as outdated version', () => { + const status = getVersionStatus('3.0.0', [ + { + version: '3.0.0', + expiration: new Date('2020-01-01'), + security: false, + infoUrl: '', + }, + { + version: '4.0.0', + expiration: new Date(), + security: false, + infoUrl: '', + }, + ]); + expect(status.label).toBe('outdated'); + }); + }); +}); + +describe('if the server version is not in the list of supported versions but is the highest', () => { + it('should return as latest version', () => { + const status = getVersionStatus('4.0.0', [ + { + version: '2.0.0', + expiration: new Date(), + security: false, + infoUrl: '', + }, + { + version: '3.0.0', + expiration: new Date(), + security: false, + infoUrl: '', + }, + ]); + + expect(status.label).toBe('outdated'); + expect(status.version).toBe('4.0.0'); + }); +}); + +describe('prerelease version', () => { + it('should not suggest available version the highest version is a prerelease from a different tag', () => { + const status = getVersionStatus('3.0.0', [ + { + version: '3.0.0', + expiration: new Date(new Date().setFullYear(new Date().getFullYear() + 1)), + security: false, + infoUrl: '', + }, + { + version: '4.0.0-develop', + expiration: new Date(new Date().setFullYear(new Date().getFullYear() + 1)), + security: false, + infoUrl: '', + }, + ]); + + expect(status.label).toBe('latest'); + expect(status.version).toBe('3.0.0'); + }); + + it('should suggest available version the highest version is a prerelease from the same tag', () => { + const status = getVersionStatus('6.5.0-rc.14', [ + { + version: '6.5.0-rc.14', + expiration: new Date(new Date().setFullYear(new Date().getFullYear() + 1)), + security: false, + infoUrl: '', + }, + { + version: '6.5.0-rc.15', + expiration: new Date(new Date().setFullYear(new Date().getFullYear() + 1)), + security: false, + infoUrl: '', + }, + { + version: '4.0.0-develop', + expiration: new Date(new Date().setFullYear(new Date().getFullYear() + 1)), + security: false, + infoUrl: '', + }, + ]); + + expect(status.label).toBe('available_version'); + expect(status.version).toBe('6.5.0-rc.15'); + }); + + it('should suggest available version the highest version even if the current one is a prerelease', () => { + const status = getVersionStatus('6.5.0-rc.14', [ + { + version: '6.5.0-rc.14', + expiration: new Date(new Date().setFullYear(new Date().getFullYear() + 1)), + security: false, + infoUrl: '', + }, + { + version: '6.5.0-rc.15', + expiration: new Date(new Date().setFullYear(new Date().getFullYear() + 1)), + security: false, + infoUrl: '', + }, + { + version: '7.0.0', + expiration: new Date(new Date().setFullYear(new Date().getFullYear() + 1)), + security: false, + infoUrl: '', + }, + ]); + + expect(status.label).toBe('available_version'); + expect(status.version).toBe('7.0.0'); + }); +}); diff --git a/apps/meteor/client/views/admin/workspace/VersionCard/getVersionStatus.ts b/apps/meteor/client/views/admin/workspace/VersionCard/getVersionStatus.ts new file mode 100644 index 000000000000..705087f58153 --- /dev/null +++ b/apps/meteor/client/views/admin/workspace/VersionCard/getVersionStatus.ts @@ -0,0 +1,37 @@ +import type { SupportedVersions } from '@rocket.chat/server-cloud-communication'; +import semver from 'semver'; + +import type { VersionStatus } from './components/VersionTag'; + +export const getVersionStatus = ( + serverVersion: string, + versions: SupportedVersions['versions'], +): { label: VersionStatus; expiration: Date | undefined; version: string } => { + const highestVersion = versions + .sort((prev, current) => semver.compare(current.version, prev.version)) + .filter((v) => { + const [prerelease] = semver.prerelease(v.version) || []; + const [currentPrerelease] = semver.prerelease(serverVersion) || []; + + return !prerelease || prerelease === currentPrerelease; + })[0]; + + const currentVersionData = + versions.find((v) => v.version === serverVersion) || + versions.find((v) => + semver.satisfies(String(semver.coerce(v.version)), `=${semver.major(serverVersion)}.${semver.minor(serverVersion)}.x`), + ); + + const currentVersionIsExpired = currentVersionData?.expiration && new Date(currentVersionData.expiration) < new Date(); + + const isSupported = !currentVersionIsExpired && !!currentVersionData; + + return { + label: 'outdated', + version: serverVersion, + ...(isSupported && semver.gte(currentVersionData?.version, highestVersion.version) && { label: 'latest' }), + ...(isSupported && + semver.gt(highestVersion.version, currentVersionData?.version) && { label: 'available_version', version: highestVersion.version }), + expiration: currentVersionData?.expiration, + }; +}; diff --git a/apps/meteor/client/views/admin/cloud/hooks/useFeatureBullets.tsx b/apps/meteor/client/views/admin/workspace/VersionCard/hooks/useFeatureBullets.tsx similarity index 75% rename from apps/meteor/client/views/admin/cloud/hooks/useFeatureBullets.tsx rename to apps/meteor/client/views/admin/workspace/VersionCard/hooks/useFeatureBullets.tsx index 926f30b00bb9..ae2d6697ea2c 100644 --- a/apps/meteor/client/views/admin/cloud/hooks/useFeatureBullets.tsx +++ b/apps/meteor/client/views/admin/workspace/VersionCard/hooks/useFeatureBullets.tsx @@ -1,5 +1,5 @@ -import { useTranslation } from '@rocket.chat/ui-contexts'; import { useMemo } from 'react'; +import { useTranslation } from 'react-i18next'; type featureBulletsType = { key: number; @@ -9,7 +9,7 @@ type featureBulletsType = { }; const useFeatureBullets = () => { - const t = useTranslation(); + const { t } = useTranslation(); const featureBullets: featureBulletsType[] = useMemo( () => [ @@ -31,12 +31,6 @@ const useFeatureBullets = () => { description: t('RegisterWorkspace_Features_Omnichannel_Description'), disconnect: t('RegisterWorkspace_Features_Omnichannel_Disconnect'), }, - { - key: 4, - title: t('RegisterWorkspace_Features_ThirdPartyLogin_Title'), - description: t('RegisterWorkspace_Features_ThirdPartyLogin_Description'), - disconnect: t('RegisterWorkspace_Features_ThirdPartyLogin_Disconnect'), - }, ], [t], ); diff --git a/apps/meteor/client/views/admin/cloud/modals/RegisterWorkspaceModal.tsx b/apps/meteor/client/views/admin/workspace/VersionCard/modals/RegisterWorkspaceModal.tsx similarity index 100% rename from apps/meteor/client/views/admin/cloud/modals/RegisterWorkspaceModal.tsx rename to apps/meteor/client/views/admin/workspace/VersionCard/modals/RegisterWorkspaceModal.tsx diff --git a/apps/meteor/client/views/admin/cloud/modals/RegisterWorkspaceSetupModal/RegisterWorkspaceSetupModal.tsx b/apps/meteor/client/views/admin/workspace/VersionCard/modals/RegisterWorkspaceSetupModal/RegisterWorkspaceSetupModal.tsx similarity index 96% rename from apps/meteor/client/views/admin/cloud/modals/RegisterWorkspaceSetupModal/RegisterWorkspaceSetupModal.tsx rename to apps/meteor/client/views/admin/workspace/VersionCard/modals/RegisterWorkspaceSetupModal/RegisterWorkspaceSetupModal.tsx index a38fbe17ae6f..880ab99fa27e 100644 --- a/apps/meteor/client/views/admin/cloud/modals/RegisterWorkspaceSetupModal/RegisterWorkspaceSetupModal.tsx +++ b/apps/meteor/client/views/admin/workspace/VersionCard/modals/RegisterWorkspaceSetupModal/RegisterWorkspaceSetupModal.tsx @@ -1,7 +1,7 @@ import { useSetModal } from '@rocket.chat/ui-contexts'; import React, { useEffect, useState } from 'react'; -import { validateEmail } from '../../../../../../lib/emailValidator'; +import { validateEmail } from '../../../../../../../lib/emailValidator'; import RegisteredWorkspaceModal from '../RegisteredWorkspaceModal'; import RegisterWorkspaceSetupStepOneModal from './RegisterWorkspaceSetupStepOneModal'; import RegisterWorkspaceSetupStepTwoModal from './RegisterWorkspaceSetupStepTwoModal'; diff --git a/apps/meteor/client/views/admin/cloud/modals/RegisterWorkspaceSetupModal/RegisterWorkspaceSetupStepOneModal.tsx b/apps/meteor/client/views/admin/workspace/VersionCard/modals/RegisterWorkspaceSetupModal/RegisterWorkspaceSetupStepOneModal.tsx similarity index 78% rename from apps/meteor/client/views/admin/cloud/modals/RegisterWorkspaceSetupModal/RegisterWorkspaceSetupStepOneModal.tsx rename to apps/meteor/client/views/admin/workspace/VersionCard/modals/RegisterWorkspaceSetupModal/RegisterWorkspaceSetupStepOneModal.tsx index 41e8f300d898..68d66657fad6 100644 --- a/apps/meteor/client/views/admin/cloud/modals/RegisterWorkspaceSetupModal/RegisterWorkspaceSetupStepOneModal.tsx +++ b/apps/meteor/client/views/admin/workspace/VersionCard/modals/RegisterWorkspaceSetupModal/RegisterWorkspaceSetupStepOneModal.tsx @@ -1,4 +1,5 @@ import { Modal, Box, Field, FieldLabel, FieldRow, TextInput, CheckBox, ButtonGroup, Button } from '@rocket.chat/fuselage'; +import { useUniqueId } from '@rocket.chat/fuselage-hooks'; import { ExternalLink } from '@rocket.chat/ui-client'; import { useEndpoint, useSetModal, useToastMessageDispatch, useTranslation } from '@rocket.chat/ui-contexts'; import React from 'react'; @@ -51,6 +52,9 @@ const RegisterWorkspaceSetupStepOneModal = ({ } }; + const emailField = useUniqueId(); + const termsField = useUniqueId(); + return ( @@ -66,9 +70,10 @@ const RegisterWorkspaceSetupStepOneModal = ({ {t('RegisterWorkspace_Setup_Subtitle')}
- {t('RegisterWorkspace_Setup_Label')} + {t('RegisterWorkspace_Setup_Label')} { setEmail((e.target as HTMLInputElement).value); }} @@ -85,16 +90,17 @@ const RegisterWorkspaceSetupStepOneModal = ({ {t('RegisterWorkspace_Setup_No_Account_Subtitle')} - - setTerms(!terms)} /> - - - I agree with Terms and Conditions - and - Privacy Policy - - - + + + + + I agree with Terms and Conditions and{' '} + Privacy Policy + + + setTerms(!terms)} /> + + diff --git a/apps/meteor/client/views/admin/cloud/modals/RegisterWorkspaceSetupModal/RegisterWorkspaceSetupStepTwoModal.tsx b/apps/meteor/client/views/admin/workspace/VersionCard/modals/RegisterWorkspaceSetupModal/RegisterWorkspaceSetupStepTwoModal.tsx similarity index 100% rename from apps/meteor/client/views/admin/cloud/modals/RegisterWorkspaceSetupModal/RegisterWorkspaceSetupStepTwoModal.tsx rename to apps/meteor/client/views/admin/workspace/VersionCard/modals/RegisterWorkspaceSetupModal/RegisterWorkspaceSetupStepTwoModal.tsx diff --git a/apps/meteor/client/views/admin/cloud/modals/RegisterWorkspaceSetupModal/index.tsx b/apps/meteor/client/views/admin/workspace/VersionCard/modals/RegisterWorkspaceSetupModal/index.tsx similarity index 100% rename from apps/meteor/client/views/admin/cloud/modals/RegisterWorkspaceSetupModal/index.tsx rename to apps/meteor/client/views/admin/workspace/VersionCard/modals/RegisterWorkspaceSetupModal/index.tsx diff --git a/apps/meteor/client/views/admin/cloud/modals/RegisterWorkspaceTokenModal.tsx b/apps/meteor/client/views/admin/workspace/VersionCard/modals/RegisterWorkspaceTokenModal.tsx similarity index 96% rename from apps/meteor/client/views/admin/cloud/modals/RegisterWorkspaceTokenModal.tsx rename to apps/meteor/client/views/admin/workspace/VersionCard/modals/RegisterWorkspaceTokenModal.tsx index 89728457226b..b0290d614c92 100644 --- a/apps/meteor/client/views/admin/cloud/modals/RegisterWorkspaceTokenModal.tsx +++ b/apps/meteor/client/views/admin/workspace/VersionCard/modals/RegisterWorkspaceTokenModal.tsx @@ -89,7 +89,7 @@ const RegisterWorkspaceTokenModal = ({ onClose, onStatusChange, ...props }: Regi - diff --git a/apps/meteor/client/views/admin/cloud/modals/RegisteredWorkspaceModal.tsx b/apps/meteor/client/views/admin/workspace/VersionCard/modals/RegisteredWorkspaceModal.tsx similarity index 96% rename from apps/meteor/client/views/admin/cloud/modals/RegisteredWorkspaceModal.tsx rename to apps/meteor/client/views/admin/workspace/VersionCard/modals/RegisteredWorkspaceModal.tsx index 050411075c74..9c5dd0159290 100644 --- a/apps/meteor/client/views/admin/cloud/modals/RegisteredWorkspaceModal.tsx +++ b/apps/meteor/client/views/admin/workspace/VersionCard/modals/RegisteredWorkspaceModal.tsx @@ -64,7 +64,7 @@ const RegisteredWorkspaceModal = ({ onClose, onStatusChange, ...props }: Registe - diff --git a/apps/meteor/client/views/admin/workspace/WorkspacePage.tsx b/apps/meteor/client/views/admin/workspace/WorkspacePage.tsx new file mode 100644 index 000000000000..d45c01153318 --- /dev/null +++ b/apps/meteor/client/views/admin/workspace/WorkspacePage.tsx @@ -0,0 +1,95 @@ +import type { IWorkspaceInfo, IStats } from '@rocket.chat/core-typings'; +import { Box, Button, ButtonGroup, Callout, CardGrid } from '@rocket.chat/fuselage'; +import type { IInstance } from '@rocket.chat/rest-typings'; +import { useTranslation } from '@rocket.chat/ui-contexts'; +import React, { memo } from 'react'; + +import { Page, PageHeader, PageScrollableContentWithShadow } from '../../../components/Page'; +import { useIsEnterprise } from '../../../hooks/useIsEnterprise'; +import DeploymentCard from './DeploymentCard/DeploymentCard'; +import MessagesRoomsCard from './MessagesRoomsCard/MessagesRoomsCard'; +import UsersUploadsCard from './UsersUploadsCard/UsersUploadsCard'; +import VersionCard from './VersionCard/VersionCard'; + +type WorkspaceStatusPageProps = { + canViewStatistics: boolean; + serverInfo: IWorkspaceInfo; + statistics: IStats; + statisticsIsLoading: boolean; + instances: IInstance[]; + onClickRefreshButton: () => void; + onClickDownloadInfo: () => void; +}; + +const WorkspacePage = ({ + canViewStatistics, + serverInfo, + statistics, + statisticsIsLoading, + instances, + onClickRefreshButton, + onClickDownloadInfo, +}: WorkspaceStatusPageProps) => { + const t = useTranslation(); + + const { data } = useIsEnterprise(); + + const warningMultipleInstances = !data?.isEnterprise && !statistics?.msEnabled && statistics?.instanceCount > 1; + const alertOplogForMultipleInstances = warningMultipleInstances && !statistics.oplogEnabled; + + return ( + + + {canViewStatistics && ( + + + + + )} + + + + + {warningMultipleInstances && ( + + )} + {alertOplogForMultipleInstances && ( + + +

{t('Error_RocketChat_requires_oplog_tailing_when_running_in_multiple_instances_details')}

+

+ + {t('Click_here_for_more_info')} + +

+
+
+ )} + + + + + + + + +
+
+
+ ); +}; + +export default memo(WorkspacePage); diff --git a/apps/meteor/client/views/admin/workspace/WorkspaceRoute.tsx b/apps/meteor/client/views/admin/workspace/WorkspaceRoute.tsx new file mode 100644 index 000000000000..7cadf4b7ce1a --- /dev/null +++ b/apps/meteor/client/views/admin/workspace/WorkspaceRoute.tsx @@ -0,0 +1,67 @@ +import { Callout, ButtonGroup, Button } from '@rocket.chat/fuselage'; +import { usePermission, useTranslation } from '@rocket.chat/ui-contexts'; +import type { ReactElement } from 'react'; +import React, { memo, useState } from 'react'; + +import { Page, PageHeader, PageScrollableContentWithShadow } from '../../../components/Page'; +import PageSkeleton from '../../../components/PageSkeleton'; +import { useWorkspaceInfo } from '../../../hooks/useWorkspaceInfo'; +import { downloadJsonAs } from '../../../lib/download'; +import NotAuthorizedPage from '../../notAuthorized/NotAuthorizedPage'; +import WorkspacePage from './WorkspacePage'; + +const WorkspaceRoute = (): ReactElement => { + const t = useTranslation(); + const canViewStatistics = usePermission('view-statistics'); + + const [refreshStatistics, setRefreshStatistics] = useState(false); + const [serverInfoQuery, instancesQuery, statisticsQuery] = useWorkspaceInfo({ refreshStatistics }); + + if (!canViewStatistics) { + return ; + } + + if (serverInfoQuery.isLoading || instancesQuery.isLoading || statisticsQuery.isLoading) { + return ; + } + + const handleClickRefreshButton = async () => { + setRefreshStatistics(true); + statisticsQuery.refetch(); + }; + + const handleClickDownloadInfo = (): void => { + downloadJsonAs(statisticsQuery.data, 'statistics'); + }; + + if (serverInfoQuery.isError || instancesQuery.isError || statisticsQuery.isError) { + return ( + + + + + + + + {t('Error_loading_pages')} + + + ); + } + + return ( + + ); +}; + +export default memo(WorkspaceRoute); diff --git a/apps/meteor/client/views/admin/workspace/components/WorkspaceCardSection.tsx b/apps/meteor/client/views/admin/workspace/components/WorkspaceCardSection.tsx new file mode 100644 index 000000000000..f120daaf0886 --- /dev/null +++ b/apps/meteor/client/views/admin/workspace/components/WorkspaceCardSection.tsx @@ -0,0 +1,19 @@ +import { Box } from '@rocket.chat/fuselage'; +import type { ReactNode } from 'react'; +import React from 'react'; + +type WorkspaceCardSectionProps = { + title: string; + body?: ReactNode; +}; + +const WorkspaceCardSection = ({ title, body }: WorkspaceCardSectionProps) => { + return ( + + {title} + {body && body} + + ); +}; + +export default WorkspaceCardSection; diff --git a/apps/meteor/client/views/admin/workspace/components/WorkspaceCardTextSeparator.tsx b/apps/meteor/client/views/admin/workspace/components/WorkspaceCardTextSeparator.tsx new file mode 100644 index 000000000000..607189d28365 --- /dev/null +++ b/apps/meteor/client/views/admin/workspace/components/WorkspaceCardTextSeparator.tsx @@ -0,0 +1,30 @@ +import { Box, Icon, StatusBullet } from '@rocket.chat/fuselage'; +import type { Keys } from '@rocket.chat/icons'; +import { TextSeparator } from '@rocket.chat/ui-client'; +import type { ComponentProps, ReactNode } from 'react'; +import React from 'react'; + +type WorkspaceCardTextSeparatorProps = { + label: ReactNode; + icon?: Keys; + status?: ComponentProps['status']; + value: ReactNode; +}; +const WorkspaceCardTextSeparator = ({ icon, label, value, status }: WorkspaceCardTextSeparatorProps) => ( + + {icon && } + {status && ( + + + + )} + {label && label} + + } + value={value} + /> +); + +export default WorkspaceCardTextSeparator; diff --git a/apps/meteor/client/views/banners/BannerRegion.tsx b/apps/meteor/client/views/banners/BannerRegion.tsx index c5394f787229..6bf51148ac03 100644 --- a/apps/meteor/client/views/banners/BannerRegion.tsx +++ b/apps/meteor/client/views/banners/BannerRegion.tsx @@ -5,13 +5,11 @@ import { useSyncExternalStore } from 'use-sync-external-store/shim'; import * as banners from '../../lib/banners'; import LegacyBanner from './LegacyBanner'; import UiKitBanner from './UiKitBanner'; -import { useRemoteBanners } from './hooks/useRemoteBanners'; import { useUserBanners } from './hooks/useUserBanners'; const BannerRegion = (): ReactElement | null => { const payload = useSyncExternalStore(...banners.firstSubscription); - useRemoteBanners(); useUserBanners(); if (!payload) { @@ -22,7 +20,7 @@ const BannerRegion = (): ReactElement | null => { return ; } - return ; + return ; }; export default BannerRegion; diff --git a/apps/meteor/client/views/banners/UiKitBanner.tsx b/apps/meteor/client/views/banners/UiKitBanner.tsx index 7cb52dd8d3c9..27478422392b 100644 --- a/apps/meteor/client/views/banners/UiKitBanner.tsx +++ b/apps/meteor/client/views/banners/UiKitBanner.tsx @@ -1,55 +1,65 @@ -import type { UIKitActionEvent, UiKitBannerProps } from '@rocket.chat/core-typings'; import { Banner, Icon } from '@rocket.chat/fuselage'; +import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; import { UiKitContext, bannerParser, UiKitBanner as UiKitBannerSurfaceRender, UiKitComponent } from '@rocket.chat/fuselage-ui-kit'; -import type { Keys as IconName } from '@rocket.chat/icons'; -import type { LayoutBlock } from '@rocket.chat/ui-kit'; -import type { FC, ReactElement, ContextType } from 'react'; +import { useToastMessageDispatch } from '@rocket.chat/ui-contexts'; +import type * as UiKit from '@rocket.chat/ui-kit'; +import type { ReactElement } from 'react'; import React, { useMemo } from 'react'; -import { useUIKitHandleAction } from '../../UIKit/hooks/useUIKitHandleAction'; -import { useUIKitHandleClose } from '../../UIKit/hooks/useUIKitHandleClose'; -import { useUIKitStateManager } from '../../UIKit/hooks/useUIKitStateManager'; import MarkdownText from '../../components/MarkdownText'; -import * as banners from '../../lib/banners'; +import { useBannerContextValue } from '../../uikit/hooks/useBannerContextValue'; +import { useUiKitActionManager } from '../../uikit/hooks/useUiKitActionManager'; +import { useUiKitView } from '../../uikit/hooks/useUiKitView'; // TODO: move this to fuselage-ui-kit itself bannerParser.mrkdwn = ({ text }): ReactElement => ; -const UiKitBanner: FC = ({ payload }) => { - const state = useUIKitStateManager(payload); +type UiKitBannerProps = { + key: UiKit.BannerView['viewId']; // force re-mount when viewId changes + initialView: UiKit.BannerView; +}; + +const UiKitBanner = ({ initialView }: UiKitBannerProps) => { + const { view, values, state } = useUiKitView(initialView); + const actionManager = useUiKitActionManager(); + const contextValue = useBannerContextValue({ view, values }); const icon = useMemo(() => { - if (state.icon) { - return ; + if (view.icon) { + return ; } return null; - }, [state.icon]); - - const handleClose = useUIKitHandleClose(state, () => banners.close()); - - const action = useUIKitHandleAction(state); - - const contextValue = useMemo>( - () => ({ - action: async (event): Promise => { - if (!event.viewId) { - return; - } - await action(event as UIKitActionEvent); - banners.closeById(state.viewId); - }, - state: (): void => undefined, - appId: state.appId, - values: {}, - }), - [action, state.appId, state.viewId], - ); + }, [view.icon]); + + const dispatchToastMessage = useToastMessageDispatch(); + const handleClose = useMutableCallback(() => { + void actionManager + .emitInteraction(view.appId, { + type: 'viewClosed', + payload: { + viewId: view.viewId, + view: { + ...view, + id: view.viewId, + state, + }, + isCleared: true, + }, + }) + .catch((error) => { + dispatchToastMessage({ type: 'error', message: error }); + return Promise.reject(error); + }) + .finally(() => { + actionManager.disposeView(view.viewId); + }); + }); return ( - + - + ); diff --git a/apps/meteor/client/views/banners/hooks/useRemoteBanners.ts b/apps/meteor/client/views/banners/hooks/useRemoteBanners.ts deleted file mode 100644 index ff42d4ae9ace..000000000000 --- a/apps/meteor/client/views/banners/hooks/useRemoteBanners.ts +++ /dev/null @@ -1,80 +0,0 @@ -import { BannerPlatform } from '@rocket.chat/core-typings'; -import type { IBanner, Serialized, UiKitBannerPayload } from '@rocket.chat/core-typings'; -import { useEndpoint, useStream, useUserId, ServerContext } from '@rocket.chat/ui-contexts'; -import { useContext, useEffect } from 'react'; - -import * as banners from '../../../lib/banners'; - -export const useRemoteBanners = () => { - const uid = useUserId(); - - const serverContext = useContext(ServerContext); - const getBanners = useEndpoint('GET', '/v1/banners'); - const subscribeToNotifyLoggedIn = useStream('notify-logged'); - const subscribeToNotifyUser = useStream('notify-user'); - - useEffect(() => { - if (!uid) { - return; - } - - const controller = new AbortController(); - - const { signal } = controller; - - const mapBanner = (banner: Serialized): UiKitBannerPayload => ({ - ...banner.view, - viewId: banner.view.viewId || banner._id, - }); - - const fetchInitialBanners = async (): Promise => { - const response = await getBanners({ - platform: BannerPlatform.Web, - }); - - if (signal?.aborted) { - return; - } - - response.banners.forEach((banner) => { - banners.open(mapBanner(banner)); - }); - }; - - fetchInitialBanners(); - - const unsubscribeFromBannerChanged = subscribeToNotifyLoggedIn('banner-changed', async (event): Promise => { - const response = await serverContext.callEndpoint({ - method: 'GET', - pathPattern: '/v1/banners/:id', - keys: { id: event.bannerId }, - params: { platform: BannerPlatform.Web }, - }); - - if (signal?.aborted) { - return; - } - - if (!response.banners.length) { - return banners.closeById(event.bannerId); - } - - response.banners.forEach((banner) => { - banners.open(mapBanner(banner)); - }); - }); - - const unsubscribeBanners = subscribeToNotifyUser(`${uid}/banners`, async (banner) => { - banners.open(banner.view); - }); - - return () => { - controller.abort(); - - unsubscribeFromBannerChanged(); - unsubscribeBanners(); - - banners.clear(); - }; - }, [getBanners, serverContext, subscribeToNotifyLoggedIn, uid, subscribeToNotifyUser]); -}; diff --git a/apps/meteor/client/views/cloud/CloudAnnouncementHandler.tsx b/apps/meteor/client/views/cloud/CloudAnnouncementHandler.tsx new file mode 100644 index 000000000000..0e148ce03c7d --- /dev/null +++ b/apps/meteor/client/views/cloud/CloudAnnouncementHandler.tsx @@ -0,0 +1,61 @@ +import type { IBanner } from '@rocket.chat/core-typings'; +import type * as UiKit from '@rocket.chat/ui-kit'; +import { useEffect, useRef } from 'react'; +import { useTranslation } from 'react-i18next'; + +import { exhaustiveCheck } from '../../../lib/utils/exhaustiveCheck'; +import { useUiKitActionManager } from '../../uikit/hooks/useUiKitActionManager'; + +type CloudAnnouncementHandlerProps = Pick; + +const CloudAnnouncementHandler = ({ dictionary = {}, surface, view }: CloudAnnouncementHandlerProps) => { + const { i18n } = useTranslation(); + + useEffect(() => { + const appNs = `app-cloud-announcements-core`; + if (!dictionary) { + return; + } + + for (const [language, translations] of Object.entries(dictionary)) { + i18n.addResources(language, appNs, translations); + } + }, [i18n, dictionary]); + + const actionManager = useUiKitActionManager(); + + const viewRef = useRef({ ...view, appId: view.appId || 'cloud-announcements-core' }); + viewRef.current = { ...view, appId: view.appId || 'cloud-announcements-core' }; + + useEffect(() => { + switch (surface) { + case 'modal': { + // TODO fixme + const modalView = viewRef.current as unknown as UiKit.ModalView; + + actionManager.openView('modal', modalView); + + return () => { + actionManager.disposeView(modalView.id); + }; + } + + case 'banner': { + const bannerView = viewRef.current as UiKit.BannerView; + + actionManager.openView('banner', { ...bannerView }); + + return () => { + actionManager.disposeView(bannerView.viewId); + }; + } + + default: + exhaustiveCheck(surface); + } + }, [actionManager, surface]); + + return null; +}; + +export default CloudAnnouncementHandler; diff --git a/apps/meteor/client/views/cloud/CloudAnnouncementsRegion.tsx b/apps/meteor/client/views/cloud/CloudAnnouncementsRegion.tsx new file mode 100644 index 000000000000..2f353a4f9701 --- /dev/null +++ b/apps/meteor/client/views/cloud/CloudAnnouncementsRegion.tsx @@ -0,0 +1,58 @@ +import { BannerPlatform } from '@rocket.chat/core-typings'; +import { useEndpoint, useStream, useUserId } from '@rocket.chat/ui-contexts'; +import { useQuery, useQueryClient } from '@tanstack/react-query'; +import React, { useEffect } from 'react'; + +import CloudAnnouncementHandler from './CloudAnnouncementHandler'; + +const CloudAnnouncementsRegion = () => { + const uid = useUserId(); + + const getAnnouncements = useEndpoint('GET', '/v1/banners'); + + const { isSuccess, data: announcements } = useQuery({ + queryKey: ['cloud', 'announcements'], + queryFn: () => getAnnouncements({ platform: BannerPlatform.Web }), + select: (data) => data.banners, + enabled: !!uid, + staleTime: 0, + refetchInterval: 1000 * 60 * 60 * 24, + }); + + const subscribeToNotifyLoggedIn = useStream('notify-logged'); + const subscribeToNotifyUser = useStream('notify-user'); + const queryClient = useQueryClient(); + + useEffect(() => { + if (!uid) { + return; + } + + const unsubscribeFromBannerChanged = subscribeToNotifyLoggedIn('banner-changed', async () => { + queryClient.invalidateQueries(['cloud', 'announcements']); + }); + + const unsubscribeBanners = subscribeToNotifyUser(`${uid}/banners`, async () => { + queryClient.invalidateQueries(['cloud', 'announcements']); + }); + + return () => { + unsubscribeFromBannerChanged(); + unsubscribeBanners(); + }; + }, [subscribeToNotifyLoggedIn, uid, subscribeToNotifyUser, queryClient]); + + if (!isSuccess) { + return null; + } + + return ( + <> + {announcements.map((announcement) => ( + + ))} + + ); +}; + +export default CloudAnnouncementsRegion; diff --git a/apps/meteor/client/views/composer/EmojiPicker/CategoriesResult.tsx b/apps/meteor/client/views/composer/EmojiPicker/CategoriesResult.tsx index a2ccb9c55f9b..fe609da8640d 100644 --- a/apps/meteor/client/views/composer/EmojiPicker/CategoriesResult.tsx +++ b/apps/meteor/client/views/composer/EmojiPicker/CategoriesResult.tsx @@ -6,7 +6,7 @@ import type { VirtuosoHandle } from 'react-virtuoso'; import { Virtuoso } from 'react-virtuoso'; import type { EmojiCategoryPosition, EmojiByCategory } from '../../../../app/emoji/client'; -import ScrollableContentWrapper from '../../../components/ScrollableContentWrapper'; +import { VirtuosoScrollbars } from '../../../components/CustomScrollbars'; import EmojiCategoryRow from './EmojiCategoryRow'; type CategoriesResultProps = { @@ -15,7 +15,7 @@ type CategoriesResultProps = { customItemsLimit: number; handleLoadMore: () => void; handleSelectEmoji: (event: MouseEvent) => void; - handleScroll: UIEventHandler<'div'>; + handleScroll: UIEventHandler; }; const CategoriesResult = forwardRef(function CategoriesResult( @@ -39,7 +39,7 @@ const CategoriesResult = forwardRef(funct totalCount={emojiListByCategory.length} data={emojiListByCategory} onScroll={handleScroll} - components={{ Scroller: ScrollableContentWrapper }} + components={{ Scroller: VirtuosoScrollbars }} isScrolling={(isScrolling: boolean) => { if (!wrapper.current) { return; diff --git a/apps/meteor/client/views/composer/EmojiPicker/EmojiElement.tsx b/apps/meteor/client/views/composer/EmojiPicker/EmojiElement.tsx index 9577e3def782..2440a940d995 100644 --- a/apps/meteor/client/views/composer/EmojiPicker/EmojiElement.tsx +++ b/apps/meteor/client/views/composer/EmojiPicker/EmojiElement.tsx @@ -30,7 +30,6 @@ const EmojiElement = ({ emoji, image, onClick, small = false, ...props }: EmojiE return ( ); }; diff --git a/apps/meteor/client/views/composer/EmojiPicker/EmojiPicker.tsx b/apps/meteor/client/views/composer/EmojiPicker/EmojiPicker.tsx index 971005e3fa8e..045952078304 100644 --- a/apps/meteor/client/views/composer/EmojiPicker/EmojiPicker.tsx +++ b/apps/meteor/client/views/composer/EmojiPicker/EmojiPicker.tsx @@ -1,5 +1,5 @@ import { TextInput, Icon, Button, Divider } from '@rocket.chat/fuselage'; -import { useMediaQuery, useOutsideClick } from '@rocket.chat/fuselage-hooks'; +import { useMediaQuery, useMergedRefs, useOutsideClick } from '@rocket.chat/fuselage-hooks'; import { EmojiPickerCategoryHeader, EmojiPickerContainer, @@ -36,11 +36,13 @@ const EmojiPicker = ({ reference, onClose, onPickEmoji }: EmojiPickerProps) => { const ref = useRef(reference); const categoriesPosition = useRef([]); - const textInputRef = useRef(null); const virtuosoRef = useRef(null); const emojiContainerRef = useRef(null); - const isInputVisible = useIsVisible(textInputRef); + const [isVisibleRef, isInputVisible] = useIsVisible(); + const textInputRef = useRef(); + + const mergedTextInputRef = useMergedRefs(isVisibleRef, textInputRef); const emojiCategories = getCategoriesList(); @@ -187,7 +189,7 @@ const EmojiPicker = ({ reference, onClose, onPickEmoji }: EmojiPickerProps) => { } @@ -195,7 +197,7 @@ const EmojiPicker = ({ reference, onClose, onPickEmoji }: EmojiPickerProps) => { aria-label={t('Search')} /> - + {emojiCategories.map((category, index) => ( { const useDropdownPosition = (reference: RefObject, target: RefObject) => { const innerContainer = getDropdownContainer(reference.current); - const boundingRect = innerContainer.getBoundingClientRect(); - const viewHeight = document.body.getBoundingClientRect().height; const refTop = reference.current?.getBoundingClientRect().top ?? 0; const targetHeight = target.current?.getBoundingClientRect().height || 0; const placement = useMemo(() => { - if (boundingRect.top === 0) { - return 'top-start'; - } if (refTop >= viewHeight / 2) { - return 'top-end'; + return 'top-start'; } return 'bottom-end'; }, [targetHeight, refTop]); @@ -52,6 +47,10 @@ type EmojiPickerDesktopDropdownProps = { reference: RefObject; }; +/** + * @reference is the trigger element target + * @ref is the dropdown element target + * */ const EmojiPickerDesktopDropdown = forwardRef(function ToolboxDropdownDesktop( { reference, children }: EmojiPickerDesktopDropdownProps, ref: Ref, diff --git a/apps/meteor/client/views/composer/EmojiPicker/SearchingResult.tsx b/apps/meteor/client/views/composer/EmojiPicker/SearchingResult.tsx index a229ab2717e4..a42e1b0580b3 100644 --- a/apps/meteor/client/views/composer/EmojiPicker/SearchingResult.tsx +++ b/apps/meteor/client/views/composer/EmojiPicker/SearchingResult.tsx @@ -6,7 +6,7 @@ import type { VirtuosoGridHandle } from 'react-virtuoso'; import { VirtuosoGrid } from 'react-virtuoso'; import type { EmojiItem } from '../../../../app/emoji/client'; -import ScrollableContentWrapper from '../../../components/ScrollableContentWrapper'; +import { VirtuosoScrollbars } from '../../../components/CustomScrollbars'; import EmojiElement from './EmojiElement'; import SearchingResultWrapper from './SearchingResultWrapper'; @@ -33,7 +33,7 @@ const SearchingResult = ({ searchResults, handleSelectEmoji }: SearchingResultPr ref={ref} totalCount={searchResults.length} components={{ - Scroller: ScrollableContentWrapper, + Scroller: VirtuosoScrollbars, List: SearchingResultWrapper, }} itemContent={(index) => { diff --git a/apps/meteor/client/views/conference/ConferencePageError.tsx b/apps/meteor/client/views/conference/ConferencePageError.tsx index 7e60e3ae7c3e..b2726b6ddaad 100644 --- a/apps/meteor/client/views/conference/ConferencePageError.tsx +++ b/apps/meteor/client/views/conference/ConferencePageError.tsx @@ -2,7 +2,7 @@ import { States, StatesIcon, StatesTitle, StatesSubtitle, StatesActions, StatesA import { useTranslation, useUser, useRoute } from '@rocket.chat/ui-contexts'; import React from 'react'; -import Page from '../../components/Page'; +import { Page, PageHeader, PageContent } from '../../components/Page'; const ConferencePageError = () => { const t = useTranslation(); @@ -11,8 +11,8 @@ const ConferencePageError = () => { return ( - - + + {t('Call_not_found')} @@ -23,7 +23,7 @@ const ConferencePageError = () => { )} - + ); }; diff --git a/apps/meteor/client/views/directory/DirectoryPage.tsx b/apps/meteor/client/views/directory/DirectoryPage.tsx index 2bcd32a2a5e8..2edfe6e05e09 100644 --- a/apps/meteor/client/views/directory/DirectoryPage.tsx +++ b/apps/meteor/client/views/directory/DirectoryPage.tsx @@ -3,7 +3,7 @@ import { useRouter, useRouteParameter, useSetting, useTranslation } from '@rocke import type { ReactElement } from 'react'; import React, { useEffect, useCallback } from 'react'; -import Page from '../../components/Page'; +import { Page, PageHeader, PageContent } from '../../components/Page'; import ChannelsTab from './tabs/channels/ChannelsTab'; import TeamsTab from './tabs/teams/TeamsTab'; import UsersTab from './tabs/users/UsersTab'; @@ -38,7 +38,7 @@ const DirectoryPage = (): ReactElement => { return ( - + {t('Channels')} @@ -55,12 +55,12 @@ const DirectoryPage = (): ReactElement => { )} - - {tab === 'users' && } + {tab === 'channels' && } + {tab === 'users' && } {tab === 'teams' && } {federationEnabled && tab === 'external' && } - + ); }; diff --git a/apps/meteor/client/views/directory/tabs/channels/ChannelsTable/ChannelsTable.tsx b/apps/meteor/client/views/directory/tabs/channels/ChannelsTable/ChannelsTable.tsx index 0d2b9f8db289..8ec510eed76d 100644 --- a/apps/meteor/client/views/directory/tabs/channels/ChannelsTable/ChannelsTable.tsx +++ b/apps/meteor/client/views/directory/tabs/channels/ChannelsTable/ChannelsTable.tsx @@ -96,7 +96,7 @@ const ChannelsTable = () => { return ( <> - setText(text)} /> + setText(text)} /> {isLoading && ( {headers} diff --git a/apps/meteor/client/views/directory/tabs/teams/TeamsTable/TeamsTable.tsx b/apps/meteor/client/views/directory/tabs/teams/TeamsTable/TeamsTable.tsx index 160ce8e8cc59..f33b359e4b07 100644 --- a/apps/meteor/client/views/directory/tabs/teams/TeamsTable/TeamsTable.tsx +++ b/apps/meteor/client/views/directory/tabs/teams/TeamsTable/TeamsTable.tsx @@ -73,7 +73,7 @@ const TeamsTable = () => { return ( <> - setText(text)} /> + setText(text)} /> {isLoading && ( {headers} diff --git a/apps/meteor/client/views/directory/tabs/users/UsersTable/UsersTable.tsx b/apps/meteor/client/views/directory/tabs/users/UsersTable/UsersTable.tsx index c67d408aa2a3..5b69a59909ca 100644 --- a/apps/meteor/client/views/directory/tabs/users/UsersTable/UsersTable.tsx +++ b/apps/meteor/client/views/directory/tabs/users/UsersTable/UsersTable.tsx @@ -95,7 +95,7 @@ const UsersTable = ({ workspace = 'local' }): ReactElement => { return ( <> - setText(text)} /> + setText(text)} /> {isLoading && ( {headers} diff --git a/apps/meteor/client/views/directory/tabs/users/UsersTable/UsersTableRow.tsx b/apps/meteor/client/views/directory/tabs/users/UsersTable/UsersTableRow.tsx index 976bb95ba926..864b0657b6e4 100644 --- a/apps/meteor/client/views/directory/tabs/users/UsersTable/UsersTableRow.tsx +++ b/apps/meteor/client/views/directory/tabs/users/UsersTable/UsersTableRow.tsx @@ -1,10 +1,10 @@ import type { IUser, Serialized } from '@rocket.chat/core-typings'; import { Box, Flex } from '@rocket.chat/fuselage'; +import { UserAvatar } from '@rocket.chat/ui-avatar'; import React from 'react'; import { GenericTableRow, GenericTableCell } from '../../../../../components/GenericTable'; import MarkdownText from '../../../../../components/MarkdownText'; -import UserAvatar from '../../../../../components/avatar/UserAvatar'; import { useFormatDate } from '../../../../../hooks/useFormatDate'; type UsersTableRowProps = { diff --git a/apps/meteor/client/views/home/DefaultHomePage.tsx b/apps/meteor/client/views/home/DefaultHomePage.tsx index 31aab73411fe..85fd1ace2db9 100644 --- a/apps/meteor/client/views/home/DefaultHomePage.tsx +++ b/apps/meteor/client/views/home/DefaultHomePage.tsx @@ -1,4 +1,4 @@ -import { Box, Grid } from '@rocket.chat/fuselage'; +import { Box, CardGroup } from '@rocket.chat/fuselage'; import { useAtLeastOnePermission, useSetting, useTranslation, useRole, usePermission } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; import React from 'react'; @@ -6,7 +6,6 @@ import React from 'react'; import Page from '../../components/Page/Page'; import PageScrollableContent from '../../components/Page/PageScrollableContent'; import HomePageHeader from './HomePageHeader'; -import HomepageGridItem from './HomepageGridItem'; import AddUsersCard from './cards/AddUsersCard'; import CreateChannelsCard from './cards/CreateChannelsCard'; import CustomContentCard from './cards/CustomContentCard'; @@ -36,35 +35,17 @@ const DefaultHomePage = (): ReactElement => { {t('Some_ideas_to_get_you_started')} - - {canAddUsers && ( - - - - )} - {canCreateChannel && ( - - - - )} - + + + {canAddUsers && } + {canCreateChannel && } - - - - - - - - - {(isAdmin || (isCustomContentVisible && !isCustomContentBodyEmpty)) && ( - - - - )} + {(isAdmin || (isCustomContentVisible && !isCustomContentBodyEmpty)) && } + + ); diff --git a/apps/meteor/client/views/home/cards/AddUsersCard.tsx b/apps/meteor/client/views/home/cards/AddUsersCard.tsx index 551552a182d4..33a096fbfe5d 100644 --- a/apps/meteor/client/views/home/cards/AddUsersCard.tsx +++ b/apps/meteor/client/views/home/cards/AddUsersCard.tsx @@ -1,29 +1,27 @@ -import { Button } from '@rocket.chat/fuselage'; -import { Card, CardBody, CardFooter, CardFooterWrapper, CardTitle } from '@rocket.chat/ui-client'; -import { useTranslation, useRoute } from '@rocket.chat/ui-contexts'; -import type { ReactElement } from 'react'; +import type { Card } from '@rocket.chat/fuselage'; +import { useTranslation, useRouter } from '@rocket.chat/ui-contexts'; +import type { ComponentProps, ReactElement } from 'react'; import React from 'react'; -const AddUsersCard = (): ReactElement => { +import { GenericCard, GenericCardButton } from '../../../components/GenericCard'; + +const AddUsersCard = (props: Omit, 'type'>): ReactElement => { const t = useTranslation(); - const adminUsersRoute = useRoute('admin-users'); + const router = useRouter(); const handleOpenUsersRoute = (): void => { - adminUsersRoute.push({}); + router.navigate('/admin/users'); }; return ( - - {t('Add_users')} - {t('Invite_and_add_members_to_this_workspace_to_start_communicating')} - - - - - - + ]} + data-qa-id='homepage-add-users-card' + width='x340' + {...props} + /> ); }; diff --git a/apps/meteor/client/views/home/cards/CreateChannelsCard.tsx b/apps/meteor/client/views/home/cards/CreateChannelsCard.tsx index 9e84a8ff373d..a0edf15ba3ac 100644 --- a/apps/meteor/client/views/home/cards/CreateChannelsCard.tsx +++ b/apps/meteor/client/views/home/cards/CreateChannelsCard.tsx @@ -1,27 +1,26 @@ -import { Button } from '@rocket.chat/fuselage'; -import { Card, CardBody, CardFooter, CardFooterWrapper, CardTitle } from '@rocket.chat/ui-client'; +import type { Card } from '@rocket.chat/fuselage'; import { useTranslation, useSetModal } from '@rocket.chat/ui-contexts'; -import type { ReactElement } from 'react'; +import type { ComponentProps, ReactElement } from 'react'; import React from 'react'; +import { GenericCard, GenericCardButton } from '../../../components/GenericCard'; import CreateChannelWithData from '../../../sidebar/header/CreateChannel'; -const CreateChannelsCard = (): ReactElement => { +const CreateChannelsCard = (props: Omit, 'type'>): ReactElement => { const t = useTranslation(); const setModal = useSetModal(); const openCreateChannelModal = (): void => setModal( setModal(null)} />); return ( - - {t('Create_channels')} - {t('Create_a_public_channel_that_new_workspace_members_can_join')} - - - - - - + ]} + data-qa-id='homepage-create-channels-card' + width='x340' + {...props} + /> ); }; diff --git a/apps/meteor/client/views/home/cards/CustomContentCard.tsx b/apps/meteor/client/views/home/cards/CustomContentCard.tsx index 0f5c40ad87f9..af1bf899dd84 100644 --- a/apps/meteor/client/views/home/cards/CustomContentCard.tsx +++ b/apps/meteor/client/views/home/cards/CustomContentCard.tsx @@ -1,24 +1,22 @@ -import { Box, Button, Icon, Tag } from '@rocket.chat/fuselage'; -import { Card, CardFooter, CardFooterWrapper } from '@rocket.chat/ui-client'; -import { useRole, useSettingSetValue, useSetting, useToastMessageDispatch, useTranslation, useRoute } from '@rocket.chat/ui-contexts'; -import type { ReactElement } from 'react'; +import { Box, Button, Card, CardBody, CardControls, CardHeader, Icon, Tag } from '@rocket.chat/fuselage'; +import { useRole, useSettingSetValue, useSetting, useToastMessageDispatch, useTranslation, useRouter } from '@rocket.chat/ui-contexts'; +import type { ComponentProps, ReactElement } from 'react'; import React from 'react'; import { useIsEnterprise } from '../../../hooks/useIsEnterprise'; import CustomHomepageContent from '../CustomHomePageContent'; -const CustomContentCard = (): ReactElement | null => { +const CustomContentCard = (props: Omit, 'type'>): ReactElement | null => { const t = useTranslation(); const dispatchToastMessage = useToastMessageDispatch(); + const router = useRouter(); const { data } = useIsEnterprise(); const isAdmin = useRole('admin'); - const customContentBody = String(useSetting('Layout_Home_Body')); + const customContentBody = useSetting('Layout_Home_Body'); const isCustomContentBodyEmpty = customContentBody === ''; - const isCustomContentVisible = Boolean(useSetting('Layout_Home_Custom_Block_Visible')); - const isCustomContentOnly = Boolean(useSetting('Layout_Custom_Body_Only')); - - const settingsRoute = useRoute('admin-settings'); + const isCustomContentVisible = useSetting('Layout_Home_Custom_Block_Visible'); + const isCustomContentOnly = useSetting('Layout_Custom_Body_Only'); const setCustomContentVisible = useSettingSetValue('Layout_Home_Custom_Block_Visible'); const setCustomContentOnly = useSettingSetValue('Layout_Custom_Body_Only'); @@ -53,41 +51,37 @@ const CustomContentCard = (): ReactElement | null => { if (isAdmin) { return ( - - - + + + {willNotShowCustomContent ? t('Not_Visible_To_Workspace') : t('Visible_To_Workspace')} - - - {isCustomContentBodyEmpty ? t('Homepage_Custom_Content_Default_Message') : } - - - - - - - - + + {isCustomContentBodyEmpty ? t('Homepage_Custom_Content_Default_Message') : } + + + + + ); } diff --git a/apps/meteor/client/views/home/cards/DesktopAppsCard.tsx b/apps/meteor/client/views/home/cards/DesktopAppsCard.tsx index 5a3c7834b3b4..bd3b46c6adbd 100644 --- a/apps/meteor/client/views/home/cards/DesktopAppsCard.tsx +++ b/apps/meteor/client/views/home/cards/DesktopAppsCard.tsx @@ -1,31 +1,32 @@ -import { Button } from '@rocket.chat/fuselage'; -import { Card, CardBody, CardFooter, CardFooterWrapper, CardTitle } from '@rocket.chat/ui-client'; +import type { Card } from '@rocket.chat/fuselage'; import { useTranslation } from '@rocket.chat/ui-contexts'; -import type { ReactElement } from 'react'; +import type { ComponentProps, ReactElement } from 'react'; import React from 'react'; +import { GenericCard, GenericCardButton } from '../../../components/GenericCard'; import { useExternalLink } from '../../../hooks/useExternalLink'; const WINDOWS_APP_URL = 'https://go.rocket.chat/i/hp-desktop-app-windows'; const LINUX_APP_URL = 'https://go.rocket.chat/i/hp-desktop-app-linux'; const MAC_APP_URL = 'https://go.rocket.chat/i/hp-desktop-app-mac'; -const DesktopAppsCard = (): ReactElement => { +const DesktopAppsCard = (props: Omit, 'type'>): ReactElement => { const t = useTranslation(); const handleOpenLink = useExternalLink(); return ( - - {t('Desktop_apps')} - {t('Install_rocket_chat_on_your_preferred_desktop_platform')} - - - - - - - - + handleOpenLink(WINDOWS_APP_URL)} children={t('Platform_Windows')} role='link' />, + handleOpenLink(LINUX_APP_URL)} children={t('Platform_Linux')} role='link' />, + handleOpenLink(MAC_APP_URL)} children={t('Platform_Mac')} role='link' />, + ]} + width='x340' + data-qa-id='homepage-desktop-apps-card' + {...props} + /> ); }; diff --git a/apps/meteor/client/views/home/cards/DocumentationCard.tsx b/apps/meteor/client/views/home/cards/DocumentationCard.tsx index 2ae8c0618093..fc50e0aefa3e 100644 --- a/apps/meteor/client/views/home/cards/DocumentationCard.tsx +++ b/apps/meteor/client/views/home/cards/DocumentationCard.tsx @@ -1,27 +1,26 @@ -import { Button } from '@rocket.chat/fuselage'; -import { Card, CardBody, CardFooter, CardFooterWrapper, CardTitle } from '@rocket.chat/ui-client'; +import type { Card } from '@rocket.chat/fuselage'; import { useTranslation } from '@rocket.chat/ui-contexts'; -import type { ReactElement } from 'react'; +import type { ComponentProps, ReactElement } from 'react'; import React from 'react'; +import { GenericCard, GenericCardButton } from '../../../components/GenericCard'; import { useExternalLink } from '../../../hooks/useExternalLink'; const DOCS_URL = 'https://go.rocket.chat/i/hp-documentation'; -const DocumentationCard = (): ReactElement => { +const DocumentationCard = (props: Omit, 'type'>): ReactElement => { const t = useTranslation(); const handleOpenLink = useExternalLink(); return ( - - {t('Documentation')} - {t('Learn_how_to_unlock_the_myriad_possibilities_of_rocket_chat')} - - - - - - + handleOpenLink(DOCS_URL)} children={t('See_documentation')} role='link' />]} + data-qa-id='homepage-documentation-card' + width='x340' + {...props} + /> ); }; diff --git a/apps/meteor/client/views/home/cards/JoinRoomsCard.tsx b/apps/meteor/client/views/home/cards/JoinRoomsCard.tsx index c4bfcc36d7e7..de995b8e8100 100644 --- a/apps/meteor/client/views/home/cards/JoinRoomsCard.tsx +++ b/apps/meteor/client/views/home/cards/JoinRoomsCard.tsx @@ -1,10 +1,11 @@ -import { Button } from '@rocket.chat/fuselage'; -import { Card, CardBody, CardFooter, CardFooterWrapper, CardTitle } from '@rocket.chat/ui-client'; +import type { Card } from '@rocket.chat/fuselage'; import { useTranslation, useRouter } from '@rocket.chat/ui-contexts'; -import type { ReactElement } from 'react'; +import type { ComponentProps, ReactElement } from 'react'; import React from 'react'; -const JoinRoomsCard = (): ReactElement => { +import { GenericCard, GenericCardButton } from '../../../components/GenericCard'; + +const JoinRoomsCard = (props: Omit, 'type'>): ReactElement => { const t = useTranslation(); const router = useRouter(); @@ -13,15 +14,14 @@ const JoinRoomsCard = (): ReactElement => { }; return ( - - {t('Join_rooms')} - {t('Discover_public_channels_and_teams_in_the_workspace_directory')} - - - - - - + ]} + data-qa-id='homepage-join-rooms-card' + width='x340' + {...props} + /> ); }; diff --git a/apps/meteor/client/views/home/cards/MobileAppsCard.tsx b/apps/meteor/client/views/home/cards/MobileAppsCard.tsx index 5527e8d3e0f5..fdb3d4044a7d 100644 --- a/apps/meteor/client/views/home/cards/MobileAppsCard.tsx +++ b/apps/meteor/client/views/home/cards/MobileAppsCard.tsx @@ -1,29 +1,30 @@ -import { Button } from '@rocket.chat/fuselage'; -import { Card, CardTitle, CardBody, CardFooterWrapper, CardFooter } from '@rocket.chat/ui-client'; +import type { Card } from '@rocket.chat/fuselage'; import { useTranslation } from '@rocket.chat/ui-contexts'; -import type { ReactElement } from 'react'; +import type { ComponentProps, ReactElement } from 'react'; import React from 'react'; +import { GenericCard, GenericCardButton } from '../../../components/GenericCard'; import { useExternalLink } from '../../../hooks/useExternalLink'; const GOOGLE_PLAY_URL = 'https://go.rocket.chat/i/hp-mobile-app-google'; const APP_STORE_URL = 'https://go.rocket.chat/i/hp-mobile-app-apple'; -const MobileAppsCard = (): ReactElement => { +const MobileAppsCard = (props: Omit, 'type'>): ReactElement => { const t = useTranslation(); const handleOpenLink = useExternalLink(); return ( - - {t('Mobile_apps')} - {t('Take_rocket_chat_with_you_with_mobile_applications')} - - - - - - - + handleOpenLink(GOOGLE_PLAY_URL)} children={t('Google_Play')} role='link' />, + handleOpenLink(APP_STORE_URL)} children={t('App_Store')} role='link' />, + ]} + data-qa-id='homepage-mobile-apps-card' + width='x340' + {...props} + /> ); }; diff --git a/apps/meteor/client/views/hooks/roomActions/useArchiveRoom.tsx b/apps/meteor/client/views/hooks/roomActions/useArchiveRoom.tsx new file mode 100644 index 000000000000..9abcffa07a35 --- /dev/null +++ b/apps/meteor/client/views/hooks/roomActions/useArchiveRoom.tsx @@ -0,0 +1,20 @@ +import type { IRoom, RoomAdminFieldsType } from '@rocket.chat/core-typings'; +import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; +import { useEndpoint, useToastMessageDispatch, useTranslation } from '@rocket.chat/ui-contexts'; + +export const useArchiveRoom = (room: Pick) => { + const t = useTranslation(); + const dispatchToastMessage = useToastMessageDispatch(); + const archiveAction = useEndpoint('POST', '/v1/rooms.changeArchivationState'); + + const handleArchive = useMutableCallback(async () => { + try { + await archiveAction({ rid: room._id, action: room.archived ? 'unarchive' : 'archive' }); + dispatchToastMessage({ type: 'success', message: room.archived ? t('Room_has_been_unarchived') : t('Room_has_been_archived') }); + } catch (error) { + dispatchToastMessage({ type: 'error', message: error }); + } + }); + + return handleArchive; +}; diff --git a/apps/meteor/client/views/hooks/roomActions/useDeleteRoom.tsx b/apps/meteor/client/views/hooks/roomActions/useDeleteRoom.tsx index be4728732284..48b6507a331d 100644 --- a/apps/meteor/client/views/hooks/roomActions/useDeleteRoom.tsx +++ b/apps/meteor/client/views/hooks/roomActions/useDeleteRoom.tsx @@ -15,7 +15,8 @@ export const useDeleteRoom = (room: IRoom | Pick, { const dispatchToastMessage = useToastMessageDispatch(); const hasPermissionToDelete = usePermission(`delete-${room.t}`, room._id); const canDeleteRoom = isRoomFederated(room) ? false : hasPermissionToDelete; - + // eslint-disable-next-line no-nested-ternary + const roomType = 'prid' in room ? 'discussion' : room.teamId && room.teamMain ? 'team' : 'channel'; const isAdminRoute = router.getRouteName() === 'admin-rooms'; const deleteRoomEndpoint = useEndpoint('POST', '/v1/rooms.delete'); @@ -24,7 +25,7 @@ export const useDeleteRoom = (room: IRoom | Pick, { const deleteRoomMutation = useMutation({ mutationFn: deleteRoomEndpoint, onSuccess: () => { - dispatchToastMessage({ type: 'success', message: t('Room_has_been_deleted') }); + dispatchToastMessage({ type: 'success', message: t('Deleted_roomType', { roomName: room.name, roomType }) }); if (isAdminRoute) { return router.navigate('/admin/rooms'); } @@ -79,8 +80,14 @@ export const useDeleteRoom = (room: IRoom | Pick, { }; setModal( - setModal(null)} confirmText={t('Yes_delete_it')}> - {t('Delete_Room_Warning')} + setModal(null)} + confirmText={t('Yes_delete_it')} + > + {t('Delete_Room_Warning', { roomType })} , ); }); diff --git a/apps/meteor/client/views/admin/customUserStatus/hooks/useActiveConnections.ts b/apps/meteor/client/views/hooks/useActiveConnections.ts similarity index 100% rename from apps/meteor/client/views/admin/customUserStatus/hooks/useActiveConnections.ts rename to apps/meteor/client/views/hooks/useActiveConnections.ts diff --git a/apps/meteor/client/views/hooks/useDepartmentsByUnitsList.ts b/apps/meteor/client/views/hooks/useDepartmentsByUnitsList.ts index 6c402a199ded..e6cffadaaa0b 100644 --- a/apps/meteor/client/views/hooks/useDepartmentsByUnitsList.ts +++ b/apps/meteor/client/views/hooks/useDepartmentsByUnitsList.ts @@ -1,4 +1,4 @@ -import type { ILivechatDepartment } from '@rocket.chat/core-typings'; +import type { ILivechatDepartment, IOmnichannelBusinessUnit } from '@rocket.chat/core-typings'; import { useTranslation, useEndpoint } from '@rocket.chat/ui-contexts'; import { useCallback, useState } from 'react'; @@ -7,7 +7,7 @@ import { useComponentDidUpdate } from '../../hooks/useComponentDidUpdate'; import { RecordList } from '../../lib/lists/RecordList'; type DepartmentsListOptions = { - unitId: string; + unitId?: IOmnichannelBusinessUnit['_id']; filter: string; }; diff --git a/apps/meteor/client/views/hooks/useStatistics.ts b/apps/meteor/client/views/hooks/useStatistics.ts new file mode 100644 index 000000000000..9b1a589253da --- /dev/null +++ b/apps/meteor/client/views/hooks/useStatistics.ts @@ -0,0 +1,12 @@ +import { useEndpoint } from '@rocket.chat/ui-contexts'; +import { useQuery } from '@tanstack/react-query'; + +type UseStatisticsOptions = { + refresh?: 'false' | 'true'; +}; + +export const useStatistics = ({ refresh }: UseStatisticsOptions = { refresh: 'false' }) => { + const getStatistics = useEndpoint('GET', '/v1/statistics'); + + return useQuery(['analytics'], () => getStatistics({ refresh }), { staleTime: 10 * 60 * 1000 }); +}; diff --git a/apps/meteor/client/views/hooks/useUpgradeTabParams.ts b/apps/meteor/client/views/hooks/useUpgradeTabParams.ts deleted file mode 100644 index 65dd4cb1e396..000000000000 --- a/apps/meteor/client/views/hooks/useUpgradeTabParams.ts +++ /dev/null @@ -1,35 +0,0 @@ -import type { ILicenseV2, ILicenseV3 } from '@rocket.chat/license'; -import { useSetting } from '@rocket.chat/ui-contexts'; -import { format } from 'date-fns'; - -import type { UpgradeTabVariant } from '../../../lib/upgradeTab'; -import { getUpgradeTabType } from '../../../lib/upgradeTab'; -import { useLicense } from '../../hooks/useLicense'; -import { useRegistrationStatus } from '../../hooks/useRegistrationStatus'; - -export const useUpgradeTabParams = (): { tabType: UpgradeTabVariant | false; trialEndDate: string | undefined; isLoading: boolean } => { - const cloudWorkspaceHadTrial = useSetting('Cloud_Workspace_Had_Trial') as boolean; - - const { data: licensesData, isSuccess: isSuccessLicense } = useLicense(); - const { data: registrationStatusData, isSuccess: isSuccessRegistrationStatus } = useRegistrationStatus(); - - const registered = registrationStatusData?.registrationStatus?.workspaceRegistered ?? false; - const hasValidLicense = licensesData?.licenses.some((license) => license.modules.length > 0) ?? false; - const hadExpiredTrials = cloudWorkspaceHadTrial ?? false; - - const licenses = (licensesData?.licenses || []) as (Partial & { modules: string[] })[]; - - const trialLicense = licenses.find(({ meta, information }) => information?.trial ?? meta?.trial); - const isTrial = Boolean(trialLicense); - const trialEndDateStr = trialLicense?.information?.visualExpiration || trialLicense?.meta?.trialEnd || trialLicense?.cloudMeta?.trialEnd; - const trialEndDate = trialEndDateStr ? format(new Date(trialEndDateStr), 'yyyy-MM-dd') : undefined; - - const upgradeTabType = getUpgradeTabType({ - registered, - hasValidLicense, - hadExpiredTrials, - isTrial, - }); - - return { tabType: upgradeTabType, trialEndDate, isLoading: !isSuccessLicense && !isSuccessRegistrationStatus }; -}; diff --git a/apps/meteor/client/views/invite/InvitePage.tsx b/apps/meteor/client/views/invite/InvitePage.tsx index 7fd180d85c80..739b7cd0eccf 100644 --- a/apps/meteor/client/views/invite/InvitePage.tsx +++ b/apps/meteor/client/views/invite/InvitePage.tsx @@ -1,96 +1,36 @@ import { HeroLayout, HeroLayoutTitle } from '@rocket.chat/layout'; -import { - useToastMessageDispatch, - useSessionDispatch, - useRoute, - useRouteParameter, - useUserId, - useSetting, - useTranslation, -} from '@rocket.chat/ui-contexts'; -import { useQuery } from '@tanstack/react-query'; +import { useRouteParameter, useUserId, useTranslation } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; -import React from 'react'; +import React, { useEffect } from 'react'; -import { sdk } from '../../../app/utils/client/lib/SDKClient'; import LoginPage from '../root/MainLayout/LoginPage'; import PageLoading from '../root/PageLoading'; +import { useInviteTokenMutation } from './hooks/useInviteTokenMutation'; +import { useValidateInviteQuery } from './hooks/useValidateInviteQuery'; const InvitePage = (): ReactElement => { const t = useTranslation(); - const dispatchToastMessage = useToastMessageDispatch(); const token = useRouteParameter('hash'); - const registrationForm = useSetting('Accounts_RegistrationForm'); - const setLoginDefaultState = useSessionDispatch('loginDefaultState'); const userId = useUserId(); - const homeRoute = useRoute('home'); - const groupRoute = useRoute('group'); - const channelRoute = useRoute('channel'); + const { isLoading, data: isValidInvite } = useValidateInviteQuery(userId, token); - const { isLoading, data } = useQuery( - ['invite', token], - async () => { - if (!token) { - return false; - } + const getInviteRoomMutation = useInviteTokenMutation(); - try { - const { valid } = await sdk.rest.post('/v1/validateInviteToken', { token }); - - return valid; - } catch (error) { - dispatchToastMessage({ type: 'error', message: t('Failed_to_validate_invite_token') }); - return false; - } - }, - { - onSuccess: async (valid) => { - if (!token) { - return; - } - - if (registrationForm !== 'Disabled') { - setLoginDefaultState('register'); - } else { - setLoginDefaultState('login'); - } - - if (!valid || !userId) { - return; - } - - try { - const result = await sdk.rest.post('/v1/useInviteToken', { token }); - - if (!result.room.name) { - dispatchToastMessage({ type: 'error', message: t('Failed_to_activate_invite_token') }); - homeRoute.push(); - return; - } - - if (result.room.t === 'p') { - groupRoute.push({ name: result.room.name }); - return; - } - - channelRoute.push({ name: result.room.name }); - } catch (error) { - dispatchToastMessage({ type: 'error', message: t('Failed_to_activate_invite_token') }); - homeRoute.push(); - } - }, - }, - ); - - if (data) { - return ; - } + useEffect(() => { + if (userId && token) { + getInviteRoomMutation(token); + } + }, [getInviteRoomMutation, token, userId]); if (isLoading) { return ; } + if (isValidInvite) { + return ; + } + return ( {t('Invalid_or_expired_invite_token')} diff --git a/apps/meteor/client/views/invite/hooks/useInviteTokenMutation.ts b/apps/meteor/client/views/invite/hooks/useInviteTokenMutation.ts new file mode 100644 index 000000000000..9408b22d9e36 --- /dev/null +++ b/apps/meteor/client/views/invite/hooks/useInviteTokenMutation.ts @@ -0,0 +1,35 @@ +import { useEndpoint, useRouter, useToastMessageDispatch, useTranslation } from '@rocket.chat/ui-contexts'; +import { useMutation } from '@tanstack/react-query'; + +export const useInviteTokenMutation = () => { + const t = useTranslation(); + const router = useRouter(); + + const dispatchToastMessage = useToastMessageDispatch(); + + const getInviteRoom = useEndpoint('POST', '/v1/useInviteToken'); + + const { mutate } = useMutation({ + mutationFn: (token: string) => getInviteRoom({ token }), + onSuccess: (result) => { + if (!result.room.name) { + dispatchToastMessage({ type: 'error', message: t('Failed_to_activate_invite_token') }); + router.navigate('/home'); + return; + } + + if (result.room.t === 'p') { + router.navigate(`/group/${result.room.name}`); + return; + } + + router.navigate(`/channel/${result.room.name}`); + }, + onError: () => { + dispatchToastMessage({ type: 'error', message: t('Failed_to_activate_invite_token') }); + router.navigate('/home'); + }, + }); + + return mutate; +}; diff --git a/apps/meteor/client/views/invite/hooks/useValidateInviteQuery.ts b/apps/meteor/client/views/invite/hooks/useValidateInviteQuery.ts new file mode 100644 index 000000000000..0d5d8bfc6dc1 --- /dev/null +++ b/apps/meteor/client/views/invite/hooks/useValidateInviteQuery.ts @@ -0,0 +1,53 @@ +import { useEndpoint, useSessionDispatch, useSetting, useToastMessageDispatch, useTranslation } from '@rocket.chat/ui-contexts'; +import { useQuery } from '@tanstack/react-query'; + +import { useInviteTokenMutation } from './useInviteTokenMutation'; + +export const useValidateInviteQuery = (userId: string | null, token: string | undefined) => { + const t = useTranslation(); + + const registrationForm = useSetting('Accounts_RegistrationForm'); + + const setLoginDefaultState = useSessionDispatch('loginDefaultState'); + const dispatchToastMessage = useToastMessageDispatch(); + const getInviteRoomMutation = useInviteTokenMutation(); + + const handleValidateInviteToken = useEndpoint('POST', '/v1/validateInviteToken'); + + return useQuery( + ['invite', token], + async () => { + if (!token) { + return false; + } + + try { + const { valid } = await handleValidateInviteToken({ token }); + + return valid; + } catch (error) { + dispatchToastMessage({ type: 'error', message: t('Failed_to_validate_invite_token') }); + return false; + } + }, + { + onSuccess: async (valid) => { + if (!token) { + return; + } + + if (registrationForm !== 'Disabled') { + setLoginDefaultState('invite-register'); + } else { + setLoginDefaultState('login'); + } + + if (!valid || !userId) { + return; + } + + return getInviteRoomMutation(token); + }, + }, + ); +}; diff --git a/apps/meteor/client/views/marketplace/AccordionLoading.tsx b/apps/meteor/client/views/marketplace/AccordionLoading.tsx deleted file mode 100644 index 5591baf268d8..000000000000 --- a/apps/meteor/client/views/marketplace/AccordionLoading.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import { Box, Skeleton, Margins } from '@rocket.chat/fuselage'; -import type { FC } from 'react'; -import React from 'react'; - -const AccordionLoading: FC = () => ( - - - - - - - -); - -export default AccordionLoading; diff --git a/apps/meteor/client/views/marketplace/AppDetailsPage/AppDetailsPage.tsx b/apps/meteor/client/views/marketplace/AppDetailsPage/AppDetailsPage.tsx index 00d5d0ee6b37..28eb55245a4c 100644 --- a/apps/meteor/client/views/marketplace/AppDetailsPage/AppDetailsPage.tsx +++ b/apps/meteor/client/views/marketplace/AppDetailsPage/AppDetailsPage.tsx @@ -1,14 +1,14 @@ import type { ISetting } from '@rocket.chat/apps-engine/definition/settings'; import type { App } from '@rocket.chat/core-typings'; -import { Button, ButtonGroup, Box, Throbber } from '@rocket.chat/fuselage'; +import { Button, ButtonGroup, Box } from '@rocket.chat/fuselage'; import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; import { useTranslation, useRouteParameter, useToastMessageDispatch, usePermission, useRouter } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; -import React, { useState, useCallback, useRef } from 'react'; +import React, { useMemo, useCallback } from 'react'; +import { FormProvider, useForm } from 'react-hook-form'; -import type { ISettings } from '../../../../ee/client/apps/@types/IOrchestrator'; import { AppClientOrchestratorInstance } from '../../../../ee/client/apps/orchestrator'; -import Page from '../../../components/Page'; +import { Page, PageFooter, PageHeader, PageScrollableContentWithShadow } from '../../../components/Page'; import { handleAPIError } from '../helpers/handleAPIError'; import { useAppInfo } from '../hooks/useAppInfo'; import AppDetailsPageHeader from './AppDetailsPageHeader'; @@ -23,18 +23,12 @@ import AppSettings from './tabs/AppSettings'; const AppDetailsPage = ({ id }: { id: App['id'] }): ReactElement => { const t = useTranslation(); - const dispatchToastMessage = useToastMessageDispatch(); const router = useRouter(); - - const [hasUnsavedChanges, setHasUnsavedChanges] = useState(false); - const [isSaving, setIsSaving] = useState(false); - - const settingsRef = useRef>({}); + const dispatchToastMessage = useToastMessageDispatch(); const isAdminUser = usePermission('manage-apps'); const tab = useRouteParameter('tab'); const context = useRouteParameter('context'); - const appData = useAppInfo(id, context || ''); const handleReturn = useMutableCallback((): void => { @@ -49,41 +43,42 @@ const AppDetailsPage = ({ id }: { id: App['id'] }): ReactElement => { }); const { installed, settings, privacyPolicySummary, permissions, tosLink, privacyLink, name } = appData || {}; - const isSecurityVisible = Boolean(privacyPolicySummary || permissions || tosLink || privacyLink); - const saveAppSettings = useCallback(async () => { - const { current } = settingsRef; - setIsSaving(true); - try { - await AppClientOrchestratorInstance.setAppSettings( - id, - (Object.values(settings || {}) as ISetting[]).map((value) => ({ - ...value, - value: current?.[value.id], - })), - ); + const saveAppSettings = useCallback( + async (data) => { + try { + await AppClientOrchestratorInstance.setAppSettings( + id, + (Object.values(settings || {}) as ISetting[]).map((setting) => ({ + ...setting, + value: data[setting.id], + })), + ); - dispatchToastMessage({ type: 'success', message: `${name} settings saved succesfully` }); - } catch (e: any) { - handleAPIError(e); - } - setIsSaving(false); - }, [dispatchToastMessage, id, name, settings]); + dispatchToastMessage({ type: 'success', message: `${name} settings saved succesfully` }); + } catch (e: any) { + handleAPIError(e); + } + }, + [dispatchToastMessage, id, name, settings], + ); + + const reducedSettings = useMemo(() => { + return Object.values(settings || {}).reduce((ret, { id, value, packageValue }) => ({ ...ret, [id]: value ?? packageValue }), {}); + }, [settings]); + + const methods = useForm({ values: reducedSettings }); + const { + handleSubmit, + reset, + formState: { isDirty, isSubmitting, isSubmitted }, + } = methods; return ( - - - {installed && isAdminUser && ( - - )} - - - + + {!appData && } {appData && ( @@ -108,17 +103,25 @@ const AppDetailsPage = ({ id }: { id: App['id'] }): ReactElement => { )} {tab === 'releases' && } {Boolean(tab === 'settings' && settings && Object.values(settings).length) && ( - + + + )} {tab === 'logs' && } )} - + + + + + {installed && isAdminUser && ( + + )} + + ); }; diff --git a/apps/meteor/client/views/marketplace/AppDetailsPage/AppDetailsPageHeader.tsx b/apps/meteor/client/views/marketplace/AppDetailsPage/AppDetailsPageHeader.tsx index ef0c7259fddd..a4a65f061252 100644 --- a/apps/meteor/client/views/marketplace/AppDetailsPage/AppDetailsPageHeader.tsx +++ b/apps/meteor/client/views/marketplace/AppDetailsPage/AppDetailsPageHeader.tsx @@ -1,11 +1,11 @@ import type { App } from '@rocket.chat/core-typings'; import { Box, Tag } from '@rocket.chat/fuselage'; +import { AppAvatar } from '@rocket.chat/ui-avatar'; import { useTranslation } from '@rocket.chat/ui-contexts'; import moment from 'moment'; import type { ReactElement } from 'react'; import React from 'react'; -import AppAvatar from '../../../components/avatar/AppAvatar'; import AppMenu from '../AppMenu'; import BundleChips from '../BundleChips'; import { appIncompatibleStatusProps } from '../helpers'; @@ -37,7 +37,9 @@ const AppDetailsPageHeader = ({ app }: { app: App }): ReactElement => { return ( - + + + diff --git a/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppLogs/AppLogs.tsx b/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppLogs/AppLogs.tsx index 11fada9305e9..a653a22478a8 100644 --- a/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppLogs/AppLogs.tsx +++ b/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppLogs/AppLogs.tsx @@ -4,7 +4,7 @@ import type { ReactElement } from 'react'; import React from 'react'; import { useFormatDateAndTime } from '../../../../../hooks/useFormatDateAndTime'; -import AccordionLoading from '../../../AccordionLoading'; +import AccordionLoading from '../../../components/AccordionLoading'; import { useLogs } from '../../../hooks/useLogs'; import AppLogsItem from './AppLogsItem'; diff --git a/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppReleases/AppReleases.tsx b/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppReleases/AppReleases.tsx index 96d04a134893..cf8118f2a766 100644 --- a/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppReleases/AppReleases.tsx +++ b/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppReleases/AppReleases.tsx @@ -5,10 +5,9 @@ import { useQuery } from '@tanstack/react-query'; import type { ReactElement } from 'react'; import React from 'react'; -import AccordionLoading from '../../../AccordionLoading'; +import AccordionLoading from '../../../components/AccordionLoading'; import AppReleasesItem from './AppReleasesItem'; -// TODO: replace useEndpointData const AppReleases = ({ id }: { id: App['id'] }): ReactElement => { const getVersions = useEndpoint('GET', '/apps/:id/versions', { id }); const dispatchToastMessage = useToastMessageDispatch(); diff --git a/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppRequests/AppRequestItem.tsx b/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppRequests/AppRequestItem.tsx index 4cdba9f22360..78be4577940c 100644 --- a/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppRequests/AppRequestItem.tsx +++ b/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppRequests/AppRequestItem.tsx @@ -1,9 +1,9 @@ import { Badge, Box } from '@rocket.chat/fuselage'; +import { UserAvatar } from '@rocket.chat/ui-avatar'; import { usePermission } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; import React from 'react'; -import UserAvatar from '../../../../../components/avatar/UserAvatar'; import { useFormatDateAndTime } from '../../../../../hooks/useFormatDateAndTime'; type AppRequestItemProps = { diff --git a/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppSettings/AppSetting.tsx b/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppSettings/AppSetting.tsx index 378d855f027f..d63c44d1668b 100644 --- a/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppSettings/AppSetting.tsx +++ b/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppSettings/AppSetting.tsx @@ -1,8 +1,9 @@ import type { ISettingSelectValue } from '@rocket.chat/apps-engine/definition/settings'; -import type { ISettingBase, SettingValue } from '@rocket.chat/core-typings'; +import type { ISetting } from '@rocket.chat/apps-engine/definition/settings/ISetting'; import { useRouteParameter, useTranslation } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; import React, { useMemo, useCallback } from 'react'; +import { Controller, useFormContext } from 'react-hook-form'; import { Utilities } from '../../../../../../ee/lib/misc/Utilities'; import MarkdownText from '../../../../../components/MarkdownText'; @@ -48,28 +49,16 @@ const useAppTranslation = (appId: string): AppTranslationFunction => { }); }; -type AppSettingProps = { - appSetting: { - id: string; - type: ISettingBase['type']; - i18nLabel: string; - i18nDescription?: string; - values?: ISettingSelectValue[]; - required: boolean; - }; - onChange: (value: SettingValue) => void; - value: SettingValue; -}; -const AppSetting = ({ appSetting, onChange, value, ...props }: AppSettingProps): ReactElement => { +const AppSetting = ({ id, type, i18nLabel, i18nDescription, values, value, packageValue, ...props }: ISetting): ReactElement => { const appId = useRouteParameter('id'); const tApp = useAppTranslation(appId || ''); - const { id, type, i18nLabel, i18nDescription, values, required } = appSetting; - - const label = (i18nLabel && tApp(i18nLabel)) + (required ? ' *' : '') || id || tApp(id); + const label = (i18nLabel && tApp(i18nLabel)) || id || tApp(id); const hint = useMemo(() => i18nDescription && , [i18nDescription, tApp]); - let translatedValues; + const { control } = useFormContext(); + + let translatedValues: ISettingSelectValue[]; if (values?.length) { translatedValues = values.map((selectFieldEntry) => { const { key, i18nLabel } = selectFieldEntry; @@ -86,15 +75,22 @@ const AppSetting = ({ appSetting, onChange, value, ...props }: AppSettingProps): } return ( - ( + + )} /> ); }; diff --git a/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppSettings/AppSettings.tsx b/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppSettings/AppSettings.tsx index 57e98fe77e86..edfae67251fe 100644 --- a/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppSettings/AppSettings.tsx +++ b/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppSettings/AppSettings.tsx @@ -1,50 +1,24 @@ -import type { ISetting } from '@rocket.chat/apps-engine/definition/settings'; -import type { SettingValue } from '@rocket.chat/core-typings'; -import { Box } from '@rocket.chat/fuselage'; +import { Box, FieldGroup } from '@rocket.chat/fuselage'; import { useTranslation } from '@rocket.chat/ui-contexts'; -import type { FC, MutableRefObject } from 'react'; -import React, { useMemo, useEffect } from 'react'; +import React from 'react'; import type { ISettings } from '../../../../../../ee/client/apps/@types/IOrchestrator'; -import { useForm } from '../../../../../hooks/useForm'; -import AppSettingsAssembler from './AppSettingsAssembler'; +import AppSetting from './AppSetting'; -type AppSettingsProps = { - settings: ISettings; - setHasUnsavedChanges: (hasUnsavedChanges: boolean) => void; - settingsRef: MutableRefObject>; -}; - -const AppSettings: FC = ({ settings, setHasUnsavedChanges, settingsRef }) => { +const AppSettings = ({ settings }: { settings: ISettings }) => { const t = useTranslation(); - const stringifiedSettings = JSON.stringify(settings); - - const reducedSettings = useMemo(() => { - const settings: AppSettingsProps['settings'] = JSON.parse(stringifiedSettings); - return Object.values(settings).reduce((ret, { id, value, packageValue }) => ({ ...ret, [id]: value ?? packageValue }), {}); - }, [stringifiedSettings]); - - const { values, handlers, hasUnsavedChanges } = useForm(reducedSettings) as { - values: Record; - handlers: Record void>; - hasUnsavedChanges: boolean; - }; - const stringifiedValues = JSON.stringify(values); - - useEffect(() => { - const values = JSON.parse(stringifiedValues); - setHasUnsavedChanges(hasUnsavedChanges); - settingsRef.current = values; - }, [hasUnsavedChanges, stringifiedValues, setHasUnsavedChanges, settingsRef]); - return ( <> {t('Settings')} - + + {Object.values(settings).map((field) => ( + + ))} + ); diff --git a/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppSettings/AppSettingsAssembler.tsx b/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppSettings/AppSettingsAssembler.tsx deleted file mode 100644 index fd60fcd6de86..000000000000 --- a/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppSettings/AppSettingsAssembler.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import type { SettingValue } from '@rocket.chat/core-typings'; -import { Box } from '@rocket.chat/fuselage'; -import { capitalize } from '@rocket.chat/string-helpers'; -import type { ReactElement } from 'react'; -import React from 'react'; - -import type { ISettings } from '../../../../../../ee/client/apps/@types/IOrchestrator'; -import AppSetting from './AppSetting'; - -type AppSettingsAssemblerProps = { - settings: ISettings; - values: Record; - handlers: Record void>; -}; -const AppSettingsAssembler = ({ settings, values, handlers }: AppSettingsAssemblerProps): ReactElement => ( - - {Object.values(settings).map((current) => { - const { id } = current; - return ; - })} - -); - -export default AppSettingsAssembler; diff --git a/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppStatus/AppStatus.tsx b/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppStatus/AppStatus.tsx index 6b99cab23283..6c854119028d 100644 --- a/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppStatus/AppStatus.tsx +++ b/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppStatus/AppStatus.tsx @@ -1,5 +1,5 @@ import type { App } from '@rocket.chat/core-typings'; -import { Box, Button, Throbber, Tag, Margins } from '@rocket.chat/fuselage'; +import { Box, Button, Tag, Margins } from '@rocket.chat/fuselage'; import { useSafely } from '@rocket.chat/fuselage-hooks'; import type { TranslationKey } from '@rocket.chat/ui-contexts'; import { useRouteParameter, usePermission, useSetModal, useTranslation } from '@rocket.chat/ui-contexts'; @@ -128,15 +128,15 @@ const AppStatus = ({ app, showStatus = true, isAppDetailsPage, installed, ...pro invisible={!showStatus && !loading} > {shouldShowPriceDisplay && !installed && ( @@ -146,7 +146,7 @@ const AppStatus = ({ app, showStatus = true, isAppDetailsPage, installed, ...pro )} {statuses?.map((status, index) => ( - + {handleAppRequestsNumber(status)} {t(`${status.label}` as TranslationKey)} diff --git a/apps/meteor/client/views/marketplace/AppInstallPage.js b/apps/meteor/client/views/marketplace/AppInstallPage.js deleted file mode 100644 index f3b4f02b0c16..000000000000 --- a/apps/meteor/client/views/marketplace/AppInstallPage.js +++ /dev/null @@ -1,250 +0,0 @@ -import { Button, ButtonGroup, Icon, Field, FieldGroup, FieldLabel, FieldRow, TextInput } from '@rocket.chat/fuselage'; -import { useUniqueId } from '@rocket.chat/fuselage-hooks'; -import { - useSetModal, - useEndpoint, - useUpload, - useTranslation, - useRouteParameter, - useRouter, - useSearchParameter, -} from '@rocket.chat/ui-contexts'; -import React, { useCallback, useState } from 'react'; -import { useForm, Controller } from 'react-hook-form'; - -import { AppClientOrchestratorInstance } from '../../../ee/client/apps/orchestrator'; -import Page from '../../components/Page'; -import { useAppsReload } from '../../contexts/hooks/useAppsReload'; -import { useFileInput } from '../../hooks/useFileInput'; -import AppPermissionsReviewModal from './AppPermissionsReviewModal'; -import AppUpdateModal from './AppUpdateModal'; -import AppInstallModal from './components/AppInstallModal/AppInstallModal'; -import { handleAPIError } from './helpers/handleAPIError'; -import { handleInstallError } from './helpers/handleInstallError'; -import { useAppsCountQuery } from './hooks/useAppsCountQuery'; -import { getManifestFromZippedApp } from './lib/getManifestFromZippedApp'; - -const placeholderUrl = 'https://rocket.chat/apps/package.zip'; - -function AppInstallPage() { - const t = useTranslation(); - - const reload = useAppsReload(); - - const router = useRouter(); - - const context = useRouteParameter('context'); - - const setModal = useSetModal(); - - const appId = useSearchParameter('id'); - const queryUrl = useSearchParameter('url'); - - const [installing, setInstalling] = useState(false); - - const endpointAddress = appId ? `/apps/${appId}` : '/apps'; - const downloadApp = useEndpoint('POST', endpointAddress); - const uploadAppEndpoint = useUpload(endpointAddress); - const uploadUpdateApp = useUpload(`${endpointAddress}/update`); - - const appCountQuery = useAppsCountQuery('private'); - - const { control, setValue, watch } = useForm({ defaultValues: { url: queryUrl || '' } }); - const { file, url } = watch(); - - const canSave = !!url || !!file?.name; - - const [handleUploadButtonClick] = useFileInput((value) => setValue('file', value), 'app'); - - const sendFile = async (permissionsGranted, appFile, appId) => { - let app; - const fileData = new FormData(); - fileData.append('app', appFile, appFile.name); - fileData.append('permissions', JSON.stringify(permissionsGranted)); - - try { - if (appId) { - await uploadUpdateApp(fileData); - } else { - app = await uploadAppEndpoint(fileData); - } - - router.navigate({ - name: 'marketplace', - params: { - context: 'private', - page: 'info', - id: appId || app.app.id, - }, - }); - - reload(); - } catch (e) { - handleAPIError(e); - } finally { - setInstalling(false); - setModal(null); - } - }; - - const cancelAction = useCallback(() => { - setInstalling(false); - setModal(null); - }, [setInstalling, setModal]); - - const isAppInstalled = async (appId) => { - try { - const app = await AppClientOrchestratorInstance.getApp(appId); - return !!app || false; - } catch (e) { - return false; - } - }; - - const handleAppPermissionsReview = async (permissions, appFile, appId) => { - setModal( - sendFile(permissionsGranted, appFile, appId)} - />, - ); - }; - - const uploadFile = async (appFile, { id, permissions }) => { - const isInstalled = await isAppInstalled(id); - - if (isInstalled) { - return setModal( handleAppPermissionsReview(permissions, appFile, id)} />); - } - - await handleAppPermissionsReview(permissions, appFile); - }; - - const getAppFileAndManifest = async () => { - try { - let manifest; - let appFile; - if (url) { - const { buff } = await downloadApp({ url, downloadOnly: true }); - const fileData = Uint8Array.from(buff.data); - manifest = await getManifestFromZippedApp(fileData); - appFile = new File([fileData], 'app.zip', { type: 'application/zip' }); - } else { - appFile = file; - manifest = await getManifestFromZippedApp(appFile); - } - - return { appFile, manifest }; - } catch (error) { - handleInstallError(error); - - return { appFile: null, manifest: null }; - } - }; - - const install = async () => { - setInstalling(true); - - if (!appCountQuery.data) { - return cancelAction(); - } - - const { appFile, manifest } = await getAppFileAndManifest(); - - if (!appFile || !manifest) { - return cancelAction(); - } - - if (appCountQuery.data.hasUnlimitedApps) { - return uploadFile(appFile, manifest); - } - - setModal( - uploadFile(appFile, manifest)} - handleEnableUnlimitedApps={() => { - router.navigate({ - name: 'upgrade', - params: { - type: 'go-fully-featured-registered', - }, - }); - setModal(null); - }} - />, - ); - }; - - const handleCancel = () => { - router.navigate({ - name: 'marketplace', - params: { - context, - page: 'list', - }, - }); - }; - - const urlField = useUniqueId(); - const fileField = useUniqueId(); - - return ( - - - - - - {t('App_Url_to_Install_From')} - - ( - } {...field} /> - )} - /> - - - - {t('App_Url_to_Install_From_File')} - - ( - - {t('Browse_Files')} - - } - /> - )} - /> - - - - - - - - - - - - ); -} - -export default AppInstallPage; diff --git a/apps/meteor/client/views/marketplace/AppInstallPage.tsx b/apps/meteor/client/views/marketplace/AppInstallPage.tsx new file mode 100644 index 000000000000..5168f978b4bc --- /dev/null +++ b/apps/meteor/client/views/marketplace/AppInstallPage.tsx @@ -0,0 +1,94 @@ +import { Button, ButtonGroup, Icon, Field, FieldGroup, FieldLabel, FieldRow, TextInput, Callout } from '@rocket.chat/fuselage'; +import { useUniqueId } from '@rocket.chat/fuselage-hooks'; +import { useTranslation, useRouter, useSearchParameter } from '@rocket.chat/ui-contexts'; +import React, { useCallback } from 'react'; +import { useForm, Controller } from 'react-hook-form'; + +import { Page, PageHeader, PageScrollableContent } from '../../components/Page'; +import { useSingleFileInput } from '../../hooks/useSingleFileInput'; +import { useInstallApp } from './hooks/useInstallApp'; + +const PLACEHOLDER_URL = 'https://rocket.chat/apps/package.zip'; + +const AppInstallPage = () => { + const t = useTranslation(); + const router = useRouter(); + + const queryUrl = useSearchParameter('url'); + + const { control, setValue, watch } = useForm<{ file: File; url: string }>({ defaultValues: { url: queryUrl || '' } }); + const { file, url } = watch(); + const { install, isInstalling } = useInstallApp(file, url); + + const [handleUploadButtonClick] = useSingleFileInput((value) => setValue('file', value), 'app'); + + const handleCancel = useCallback(() => { + router.navigate({ + name: 'marketplace', + params: { + context: 'private', + page: 'list', + }, + }); + }, [router]); + + const urlField = useUniqueId(); + const fileField = useUniqueId(); + + return ( + + + + + + {t('App_Url_to_Install_From')} + + {t('App_Installation_Deprecation')} + + + ( + } {...field} /> + )} + /> + + + + {t('App_Url_to_Install_From_File')} + + ( + + {t('Browse_Files')} + + } + /> + )} + /> + + + + + + + + + + + + ); +}; + +export default AppInstallPage; diff --git a/apps/meteor/client/views/marketplace/AppsList/AppRow.tsx b/apps/meteor/client/views/marketplace/AppsList/AppRow.tsx index 3005b706326b..33e54edd90bb 100644 --- a/apps/meteor/client/views/marketplace/AppsList/AppRow.tsx +++ b/apps/meteor/client/views/marketplace/AppsList/AppRow.tsx @@ -1,27 +1,22 @@ import type { App } from '@rocket.chat/core-typings'; -import { css } from '@rocket.chat/css-in-js'; -import { Badge, Box, Palette } from '@rocket.chat/fuselage'; -import { useBreakpoints } from '@rocket.chat/fuselage-hooks'; +import { Badge, Card, CardBody, CardCol, CardControls, CardHeader, CardRow, CardTitle } from '@rocket.chat/fuselage'; +import { AppAvatar } from '@rocket.chat/ui-avatar'; import { useRouteParameter, useRouter } from '@rocket.chat/ui-contexts'; import type { KeyboardEvent, MouseEvent, ReactElement } from 'react'; import React, { memo } from 'react'; import semver from 'semver'; -import AppAvatar from '../../../components/avatar/AppAvatar'; import AppStatus from '../AppDetailsPage/tabs/AppStatus/AppStatus'; import AppMenu from '../AppMenu'; import BundleChips from '../BundleChips'; // TODO: org props -const AppRow = (props: App): ReactElement => { +const AppRow = ({ className, ...props }: App & { className?: string }): ReactElement => { const { name, id, shortDescription, iconFileData, marketplaceVersion, iconFileContent, installed, bundledIn, version } = props; - const breakpoints = useBreakpoints(); const router = useRouter(); const context = useRouteParameter('context'); - const isMobile = !breakpoints.includes('md'); - const handleNavigateToAppInfo = () => { if (!context) { return; @@ -50,65 +45,38 @@ const AppRow = (props: App): ReactElement => { e.stopPropagation(); }; - const hoverClass = css` - &:hover, - &:focus { - cursor: pointer; - outline: 0; - background-color: ${Palette.surface['surface-hover']} !important; - } - `; - const canUpdate = installed && version && marketplaceVersion && semver.lt(version, marketplaceVersion); return ( -
- + - - - - {name} - - - {bundledIn && Boolean(bundledIn.length) && ( - - - - )} - {shortDescription && !isMobile && ( - - {shortDescription} - - )} - - - - {canUpdate && ( - - - - )} + + + + + + {name} + + {Boolean(bundledIn?.length) && } + + {shortDescription && {shortDescription}} + + + + {canUpdate && } - - - + + +
); }; diff --git a/apps/meteor/client/views/marketplace/AppsList/AppsList.tsx b/apps/meteor/client/views/marketplace/AppsList/AppsList.tsx index 27d25a566f80..2567cb9c920c 100644 --- a/apps/meteor/client/views/marketplace/AppsList/AppsList.tsx +++ b/apps/meteor/client/views/marketplace/AppsList/AppsList.tsx @@ -1,5 +1,5 @@ import type { App } from '@rocket.chat/core-typings'; -import { Box } from '@rocket.chat/fuselage'; +import { Box, CardGroup } from '@rocket.chat/fuselage'; import type { ReactElement } from 'react'; import React from 'react'; @@ -13,18 +13,18 @@ type AppsListProps = { const AppsList = ({ apps, title, appsListId }: AppsListProps): ReactElement => { return ( - <> + {title && ( {title} )} - + {apps.map((app) => ( ))} - - + + ); }; diff --git a/apps/meteor/client/views/marketplace/AppsPage/AppsPage.tsx b/apps/meteor/client/views/marketplace/AppsPage/AppsPage.tsx index 4f2f28c8bd99..0c90ac238d24 100644 --- a/apps/meteor/client/views/marketplace/AppsPage/AppsPage.tsx +++ b/apps/meteor/client/views/marketplace/AppsPage/AppsPage.tsx @@ -2,11 +2,11 @@ import { useTranslation, useRouteParameter } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; import React from 'react'; -import Page from '../../../components/Page'; +import { Page, PageContent } from '../../../components/Page'; import MarketplaceHeader from '../components/MarketplaceHeader'; import AppsPageContent from './AppsPageContent'; -type AppsContext = 'explore' | 'installed' | 'enterprise' | 'private'; +type AppsContext = 'explore' | 'installed' | 'premium' | 'private'; const AppsPage = (): ReactElement => { const t = useTranslation(); @@ -16,9 +16,9 @@ const AppsPage = (): ReactElement => { return ( - + - + ); }; diff --git a/apps/meteor/client/views/marketplace/AppsPage/AppsPageContent.tsx b/apps/meteor/client/views/marketplace/AppsPage/AppsPageContent.tsx index 1bc7642e5afc..e72a30e6a5c9 100644 --- a/apps/meteor/client/views/marketplace/AppsPage/AppsPageContent.tsx +++ b/apps/meteor/client/views/marketplace/AppsPage/AppsPageContent.tsx @@ -32,6 +32,7 @@ const AppsPageContent = (): ReactElement => { const context = useRouteParameter('context'); const isMarketplace = context === 'explore'; + const isPremium = context === 'premium'; const isRequested = context === 'requested'; const [freePaidFilterStructure, setFreePaidFilterStructure] = useState({ @@ -131,17 +132,18 @@ const AppsPageContent = (): ReactElement => { context, }); - const noInstalledApps = appsResult.phase === AsyncStatePhase.RESOLVED && !isMarketplace && appsResult.value.totalAppsLength === 0; + const noInstalledApps = appsResult.phase === AsyncStatePhase.RESOLVED && !isMarketplace && appsResult.value?.totalAppsLength === 0; - const noMarketplaceOrInstalledAppMatches = appsResult.phase === AsyncStatePhase.RESOLVED && isMarketplace && appsResult.value.count === 0; + const noMarketplaceOrInstalledAppMatches = + appsResult.phase === AsyncStatePhase.RESOLVED && (isMarketplace || isPremium) && appsResult.value?.count === 0; const noInstalledAppMatches = appsResult.phase === AsyncStatePhase.RESOLVED && context === 'installed' && - appsResult.value.totalAppsLength !== 0 && - appsResult.value.count === 0; + appsResult.value?.totalAppsLength !== 0 && + appsResult.value?.count === 0; - const noAppRequests = context === 'requested' && appsResult?.value?.totalAppsLength !== 0 && appsResult?.value?.count === 0; + const noAppRequests = context === 'requested' && appsResult?.value?.count === 0; const noErrorsOcurred = !noMarketplaceOrInstalledAppMatches && !noInstalledAppMatches && !noInstalledApps && !noAppRequests; @@ -186,6 +188,30 @@ const AppsPageContent = (): ReactElement => { toggleInitialSortOption(isRequested); }, [isMarketplace, isRequested, sortFilterOnSelected, t, toggleInitialSortOption]); + const getEmptyState = () => { + if (noAppRequests) { + return ; + } + + if (noMarketplaceOrInstalledAppMatches) { + return ; + } + + if (noInstalledAppMatches) { + return ( + + ); + } + + if (noInstalledApps) { + return context === 'private' ? : ; + } + }; + return ( <> { noErrorsOcurred={noErrorsOcurred} /> )} - {noAppRequests && } - {noMarketplaceOrInstalledAppMatches && ( - - )} - {noInstalledAppMatches && ( - - )} - {noInstalledApps && <>{context === 'private' ? : }} + {getEmptyState()} {appsResult.phase === AsyncStatePhase.REJECTED && } ); diff --git a/apps/meteor/client/views/marketplace/AppsPage/AppsPageContentBody.tsx b/apps/meteor/client/views/marketplace/AppsPage/AppsPageContentBody.tsx index e9a76d8a67ba..56c3ca26f9a7 100644 --- a/apps/meteor/client/views/marketplace/AppsPage/AppsPageContentBody.tsx +++ b/apps/meteor/client/views/marketplace/AppsPage/AppsPageContentBody.tsx @@ -11,7 +11,7 @@ import FeaturedAppsSections from './FeaturedAppsSections'; type AppsPageContentBodyProps = { isMarketplace: boolean; isFiltered: boolean; - appsResult: { items: App[] } & { shouldShowSearchText: boolean } & PaginatedResult & { allApps: App[] } & { totalAppsLength: number }; + appsResult?: { items: App[] } & { shouldShowSearchText: boolean } & PaginatedResult & { allApps: App[] } & { totalAppsLength: number }; itemsPerPage: 25 | 50 | 100; current: number; onSetItemsPerPage: React.Dispatch>; @@ -43,8 +43,8 @@ const AppsPageContentBody = ({ {noErrorsOcurred && ( - {isMarketplace && !isFiltered && } - + {isMarketplace && !isFiltered && } + )} diff --git a/apps/meteor/client/views/marketplace/AppsPage/NoAppRequestsEmptyState.tsx b/apps/meteor/client/views/marketplace/AppsPage/NoAppRequestsEmptyState.tsx index 230c52a7a9a5..dc7d77e64a73 100644 --- a/apps/meteor/client/views/marketplace/AppsPage/NoAppRequestsEmptyState.tsx +++ b/apps/meteor/client/views/marketplace/AppsPage/NoAppRequestsEmptyState.tsx @@ -1,4 +1,4 @@ -import { States, StatesSubtitle, StatesTitle } from '@rocket.chat/fuselage'; +import { Box, States, StatesIcon, StatesSubtitle, StatesTitle } from '@rocket.chat/fuselage'; import { useTranslation } from '@rocket.chat/ui-contexts'; import React from 'react'; @@ -6,10 +6,13 @@ const NoAppRequestsEmptyState = () => { const t = useTranslation(); return ( - - {t('No_requested_apps')} - {t('Requested_apps_will_appear_here')} - + + + + {t('No_requested_apps')} + {t('Requested_apps_will_appear_here')} + + ); }; diff --git a/apps/meteor/client/views/marketplace/AppsPage/PrivateEmptyState.tsx b/apps/meteor/client/views/marketplace/AppsPage/PrivateEmptyState.tsx index d52d7b92a773..b7fec778401a 100644 --- a/apps/meteor/client/views/marketplace/AppsPage/PrivateEmptyState.tsx +++ b/apps/meteor/client/views/marketplace/AppsPage/PrivateEmptyState.tsx @@ -8,7 +8,7 @@ const PrivateEmptyState = () => { return ( - + {t('No_private_apps_installed')} {t('Private_apps_are_side-loaded')} diff --git a/apps/meteor/client/views/marketplace/AppsRoute.tsx b/apps/meteor/client/views/marketplace/AppsRoute.tsx index 0b0ca342e0ad..d779ae459d4d 100644 --- a/apps/meteor/client/views/marketplace/AppsRoute.tsx +++ b/apps/meteor/client/views/marketplace/AppsRoute.tsx @@ -42,7 +42,7 @@ const AppsRoute = (): ReactElement => { }, [marketplaceRoute, context]); if ( - (context === 'explore' || context === 'installed' || context === 'private' || context === 'enterprise') && + (context === 'explore' || context === 'installed' || context === 'private' || context === 'premium') && !canAccessMarketplace && !isAdminUser ) { diff --git a/apps/meteor/client/views/marketplace/BundleChips.tsx b/apps/meteor/client/views/marketplace/BundleChips.tsx index 4e2953bd8519..b3110832145d 100644 --- a/apps/meteor/client/views/marketplace/BundleChips.tsx +++ b/apps/meteor/client/views/marketplace/BundleChips.tsx @@ -16,19 +16,31 @@ type BundleChipsProps = { const BundleChips = ({ bundledIn }: BundleChipsProps): ReactElement => { const t = useTranslation(); + const handlePlanName = (label: string): string => { + if (label === 'Enterprise') { + return 'Premium'; + } + return label; + }; + return ( <> - {bundledIn.map(({ bundleId, bundleName }) => ( - - {bundleName} - - ))} + {bundledIn.map(({ bundleId, bundleName }) => { + // this is a workaround to not change plan name for versions lower than 6.5.0 + const handledName = handlePlanName(bundleName); + + return ( + + {handledName} + + ); + })} ); }; diff --git a/apps/meteor/client/views/marketplace/UnlimitedAppsUpsellModal.tsx b/apps/meteor/client/views/marketplace/UnlimitedAppsUpsellModal.tsx index bb03f9af8065..33eb6a4960c8 100644 --- a/apps/meteor/client/views/marketplace/UnlimitedAppsUpsellModal.tsx +++ b/apps/meteor/client/views/marketplace/UnlimitedAppsUpsellModal.tsx @@ -6,7 +6,7 @@ import { useUpsellActions } from '../../components/GenericUpsellModal/hooks'; const UnlimitedAppsUpsellModal = ({ onClose }: { onClose: () => void }) => { const t = useTranslation(); - const { handleGoFullyFeatured, handleTalkToSales, cloudWorkspaceHadTrial } = useUpsellActions(); + const { handleManageSubscription, cloudWorkspaceHadTrial } = useUpsellActions(); return ( void }) => { img='images/unlimited-apps-modal.png' subtitle={t('Get_all_apps')} description={!cloudWorkspaceHadTrial ? t('Workspaces_on_community_edition_trial_on') : t('Workspaces_on_community_edition_trial_off')} - confirmText={!cloudWorkspaceHadTrial ? t('Start_free_trial') : t('Learn_more')} - cancelText={t('Talk_to_sales')} - onConfirm={handleGoFullyFeatured} - onCancel={handleTalkToSales} + onConfirm={handleManageSubscription} + onCancel={onClose} onClose={onClose} /> ); diff --git a/apps/meteor/client/views/marketplace/components/AccordionLoading.tsx b/apps/meteor/client/views/marketplace/components/AccordionLoading.tsx new file mode 100644 index 000000000000..a3c561677a32 --- /dev/null +++ b/apps/meteor/client/views/marketplace/components/AccordionLoading.tsx @@ -0,0 +1,14 @@ +import { Skeleton } from '@rocket.chat/fuselage'; +import React from 'react'; + +const SKELETON_ITEMS = 3; + +const AccordionLoading = () => ( + <> + {Array.from({ length: SKELETON_ITEMS }, (_v, k) => ( + + ))} + +); + +export default AccordionLoading; diff --git a/apps/meteor/client/views/marketplace/components/BannerEnterpriseTrialEnded.tsx b/apps/meteor/client/views/marketplace/components/BannerEnterpriseTrialEnded.tsx index 93c8114cba1a..ca9e1fb480a8 100644 --- a/apps/meteor/client/views/marketplace/components/BannerEnterpriseTrialEnded.tsx +++ b/apps/meteor/client/views/marketplace/components/BannerEnterpriseTrialEnded.tsx @@ -9,9 +9,9 @@ const BannerEnterpriseTrialEnded = (): ReactElement => { const isAdmin = usePermission('manage-apps'); const bannerLink = { - link: '/admin/upgrade/go-fully-featured', + link: '/links/manage-subscription', linkText: t('Upgrade_tab_upgrade_your_plan'), - linkTarget: '_self', + linkTarget: '_blank', }; const cloudWorkspaceHadTrial = useSetting('Cloud_Workspace_Had_Trial') as boolean; @@ -25,13 +25,13 @@ const BannerEnterpriseTrialEnded = (): ReactElement => { closeable icon={} variant='warning' - title={t('Apps_disabled_when_Enterprise_trial_ended')} + title={t('Apps_disabled_when_Premium_trial_ended')} onClose={() => setShowTrialBanner(false)} {...(isAdmin && bannerLink)} > {isAdmin - ? t('Apps_disabled_when_Enterprise_trial_ended_description_admin') - : t('Apps_disabled_when_Enterprise_trial_ended_description')} + ? t('Apps_disabled_when_Premium_trial_ended_description_admin') + : t('Apps_disabled_when_Premium_trial_ended_description')}
)} diff --git a/apps/meteor/client/views/marketplace/components/CategoryFilter/CategoryDropDownAnchor.tsx b/apps/meteor/client/views/marketplace/components/CategoryFilter/CategoryDropDownAnchor.tsx index 91e66683e66f..b3e43fda942f 100644 --- a/apps/meteor/client/views/marketplace/components/CategoryFilter/CategoryDropDownAnchor.tsx +++ b/apps/meteor/client/views/marketplace/components/CategoryFilter/CategoryDropDownAnchor.tsx @@ -1,4 +1,6 @@ -import { Box, Button, Icon } from '@rocket.chat/fuselage'; +import type { Button } from '@rocket.chat/fuselage'; +import { Box, Icon } from '@rocket.chat/fuselage'; +import colorTokens from '@rocket.chat/fuselage-tokens/colors.json'; import { useTranslation } from '@rocket.chat/ui-contexts'; import type { ComponentProps, MouseEventHandler } from 'react'; import React, { forwardRef } from 'react'; @@ -15,33 +17,42 @@ const CategoryDropDownAnchor = forwardRef {selectedCategoriesCount > 0 && ( {selectedCategoriesCount} diff --git a/apps/meteor/client/views/marketplace/components/CategoryFilter/TagList.tsx b/apps/meteor/client/views/marketplace/components/CategoryFilter/TagList.tsx index e95dea0806b2..eee02978635a 100644 --- a/apps/meteor/client/views/marketplace/components/CategoryFilter/TagList.tsx +++ b/apps/meteor/client/views/marketplace/components/CategoryFilter/TagList.tsx @@ -8,7 +8,7 @@ const TagList: FC<{ categories: (CategoryDropdownItem & { checked: true })[]; onClick: CategoryDropDownListProps['onSelected']; }> = ({ categories, onClick }) => ( - + {categories.map((category) => ( onClick(category)} disabled={undefined} mbe={8}> {category.label} diff --git a/apps/meteor/client/views/marketplace/components/EnabledAppsCount.tsx b/apps/meteor/client/views/marketplace/components/EnabledAppsCount.tsx index da135cbdedfc..9578d49961c8 100644 --- a/apps/meteor/client/views/marketplace/components/EnabledAppsCount.tsx +++ b/apps/meteor/client/views/marketplace/components/EnabledAppsCount.tsx @@ -19,12 +19,9 @@ const EnabledAppsCount = ({ }): ReactElement | null => { const t = useTranslation(); - const privateAppsCountText: string = t('Private_Apps_Count_Enabled', { count: enabled }); - const marketplaceAppsCountText: string = t('Apps_Count_Enabled', { count: enabled }); - return ( } return ( - - + + {result.isLoading && } {result.isSuccess && !result.data.hasUnlimitedApps && } {isAdmin && result.isSuccess && !result.data.hasUnlimitedApps && ( @@ -41,7 +41,7 @@ const MarketplaceHeader = ({ title }: { title: string }): ReactElement | null => )} {isAdmin && context === 'private' && } - + ); }; diff --git a/apps/meteor/client/views/marketplace/components/RadioDropDown/RadioDownAnchor.tsx b/apps/meteor/client/views/marketplace/components/RadioDropDown/RadioDownAnchor.tsx index 36e4ff55657f..f480b2a60280 100644 --- a/apps/meteor/client/views/marketplace/components/RadioDropDown/RadioDownAnchor.tsx +++ b/apps/meteor/client/views/marketplace/components/RadioDropDown/RadioDownAnchor.tsx @@ -1,4 +1,5 @@ -import { Box, Button, Icon } from '@rocket.chat/fuselage'; +import type { Button } from '@rocket.chat/fuselage'; +import { Box, Icon } from '@rocket.chat/fuselage'; import type { ComponentProps } from 'react'; import React, { forwardRef } from 'react'; @@ -14,22 +15,25 @@ const RadioDownAnchor = forwardRef(functi return ( {selected} diff --git a/apps/meteor/client/views/marketplace/helpers/handleAPIError.ts b/apps/meteor/client/views/marketplace/helpers/handleAPIError.ts index 61ec512bd6ee..108e695b6bd8 100644 --- a/apps/meteor/client/views/marketplace/helpers/handleAPIError.ts +++ b/apps/meteor/client/views/marketplace/helpers/handleAPIError.ts @@ -8,10 +8,10 @@ const shouldHandleErrorAsWarning = (message: string): boolean => { }; export const handleAPIError = (errorObject: unknown): void => { - const { message = '', error = '' } = errorObject as { message?: string; error?: string }; + const { error = '', message = error } = errorObject as { message?: string; error?: string }; if (shouldHandleErrorAsWarning(message)) { - return dispatchToastMessage({ type: 'warning', message: t(message) }); + return dispatchToastMessage({ type: 'error', message: t(message) }); } dispatchToastMessage({ type: 'error', message: t(`Apps_Error_${error}`) }); diff --git a/apps/meteor/client/views/marketplace/hooks/useAppInstallationHandler.tsx b/apps/meteor/client/views/marketplace/hooks/useAppInstallationHandler.tsx index 666ea7bf7ae0..eca06002ec57 100644 --- a/apps/meteor/client/views/marketplace/hooks/useAppInstallationHandler.tsx +++ b/apps/meteor/client/views/marketplace/hooks/useAppInstallationHandler.tsx @@ -1,8 +1,10 @@ import type { App } from '@rocket.chat/core-typings'; -import { useEndpoint, useRoute, useRouteParameter, useSetModal, useToastMessageDispatch } from '@rocket.chat/ui-contexts'; +import { useEndpoint, useRouteParameter, useSetModal, useToastMessageDispatch } from '@rocket.chat/ui-contexts'; import React, { useCallback } from 'react'; import { AppClientOrchestratorInstance } from '../../../../ee/client/apps/orchestrator'; +import { useExternalLink } from '../../../hooks/useExternalLink'; +import { useCheckoutUrl } from '../../admin/subscription/hooks/useCheckoutUrl'; import IframeModal from '../IframeModal'; import AppInstallModal from '../components/AppInstallModal/AppInstallModal'; import type { Actions } from '../helpers'; @@ -23,7 +25,6 @@ export function useAppInstallationHandler({ app, action, isAppPurchased, onDismi const dispatchToastMessage = useToastMessageDispatch(); const setModal = useSetModal(); - const upgradeRoute = useRoute('upgrade'); const routeContext = String(useRouteParameter('context')); const context = isMarketplaceRouteContext(routeContext) ? routeContext : 'explore'; @@ -33,6 +34,9 @@ export function useAppInstallationHandler({ app, action, isAppPurchased, onDismi const openIncompatibleModal = useOpenIncompatibleModal(); + const openExternalLink = useExternalLink(); + const manageSubscriptionUrl = useCheckoutUrl()({ target: 'user-page', action: 'buy_more' }); + const closeModal = useCallback(() => { setModal(null); onDismiss(); @@ -109,7 +113,7 @@ export function useAppInstallationHandler({ app, action, isAppPurchased, onDismi handleClose={closeModal} handleConfirm={acquireApp} handleEnableUnlimitedApps={() => { - upgradeRoute.push({ type: 'go-fully-featured-registered' }); + openExternalLink(manageSubscriptionUrl); setModal(null); }} />, @@ -120,13 +124,14 @@ export function useAppInstallationHandler({ app, action, isAppPurchased, onDismi appCountQuery.data, setModal, context, + closeModal, acquireApp, openIncompatibleModal, - closeModal, dispatchToastMessage, notifyAdmins, success, onDismiss, - upgradeRoute, + openExternalLink, + manageSubscriptionUrl, ]); } diff --git a/apps/meteor/client/views/marketplace/hooks/useAppRequestStats.ts b/apps/meteor/client/views/marketplace/hooks/useAppRequestStats.ts index af25282b7e53..3fff24cc9216 100644 --- a/apps/meteor/client/views/marketplace/hooks/useAppRequestStats.ts +++ b/apps/meteor/client/views/marketplace/hooks/useAppRequestStats.ts @@ -8,7 +8,8 @@ export const useAppRequestStats = () => { return useQuery({ queryKey: ['app-requests-stats'], - queryFn: async () => (await fetchRequestStats()).data, + queryFn: () => fetchRequestStats(), + select: ({ data }) => data, refetchOnWindowFocus: false, retry: false, enabled: canManageApp, diff --git a/apps/meteor/client/views/marketplace/hooks/useCategories.ts b/apps/meteor/client/views/marketplace/hooks/useCategories.ts index 4a457a146046..bf7a022f2ae3 100644 --- a/apps/meteor/client/views/marketplace/hooks/useCategories.ts +++ b/apps/meteor/client/views/marketplace/hooks/useCategories.ts @@ -21,11 +21,13 @@ export const useCategories = (): [CategoryDropDownGroups, selectedCategoriesList try { const fetchedCategories = await AppClientOrchestratorInstance.getCategories(); - const mappedCategories = fetchedCategories.map((currentCategory) => ({ - id: currentCategory.id, - label: currentCategory.title, - checked: false, - })); + const mappedCategories = fetchedCategories + .filter((currentCategory) => !currentCategory.hidden) + .map((currentCategory) => ({ + id: currentCategory.id, + label: currentCategory.title, + checked: false, + })); setCategories([ { diff --git a/apps/meteor/client/views/marketplace/hooks/useFilteredApps.ts b/apps/meteor/client/views/marketplace/hooks/useFilteredApps.ts index 437c8d35207d..c90052fd78e3 100644 --- a/apps/meteor/client/views/marketplace/hooks/useFilteredApps.ts +++ b/apps/meteor/client/views/marketplace/hooks/useFilteredApps.ts @@ -39,8 +39,9 @@ export const useFilteredApps = ({ sortingMethod: string; status: string; context?: string; -}): AsyncState< - { items: App[] } & { shouldShowSearchText: boolean } & PaginatedResult & { allApps: App[] } & { totalAppsLength: number } +}): Omit< + AsyncState<{ items: App[] } & { shouldShowSearchText: boolean } & PaginatedResult & { allApps: App[] } & { totalAppsLength: number }>, + 'error' > => { const value = useMemo(() => { if (appsData.value === undefined) { diff --git a/apps/meteor/client/views/marketplace/hooks/useInstallApp.tsx b/apps/meteor/client/views/marketplace/hooks/useInstallApp.tsx new file mode 100644 index 000000000000..78a0283ef8a9 --- /dev/null +++ b/apps/meteor/client/views/marketplace/hooks/useInstallApp.tsx @@ -0,0 +1,167 @@ +import type { App, AppPermission } from '@rocket.chat/core-typings'; +import { useRouter, useSetModal, useUpload, useEndpoint } from '@rocket.chat/ui-contexts'; +import { useMutation } from '@tanstack/react-query'; +import React, { useCallback, useState } from 'react'; + +import { AppClientOrchestratorInstance } from '../../../../ee/client/apps/orchestrator'; +import { useAppsReload } from '../../../contexts/hooks/useAppsReload'; +import { useExternalLink } from '../../../hooks/useExternalLink'; +import { useCheckoutUrl } from '../../admin/subscription/hooks/useCheckoutUrl'; +import AppPermissionsReviewModal from '../AppPermissionsReviewModal'; +import AppUpdateModal from '../AppUpdateModal'; +import AppInstallationModal from '../components/AppInstallModal/AppInstallModal'; +import { handleAPIError } from '../helpers/handleAPIError'; +import { handleInstallError } from '../helpers/handleInstallError'; +import { getManifestFromZippedApp } from '../lib/getManifestFromZippedApp'; +import { useAppsCountQuery } from './useAppsCountQuery'; + +export const useInstallApp = (file: File, url: string): { install: () => void; isInstalling: boolean } => { + const reloadAppsList = useAppsReload(); + const openExternalLink = useExternalLink(); + const setModal = useSetModal(); + + const router = useRouter(); + + const appCountQuery = useAppsCountQuery('private'); + const manageSubscriptionUrl = useCheckoutUrl()({ target: 'marketplace-app-install', action: 'Enable_unlimited_apps' }); + + const uploadAppEndpoint = useUpload('/apps'); + const uploadUpdateEndpoint = useUpload('/apps/update'); + + // TODO: This function should not be called in a next major version, it will be changed by an endpoint deprecation. + const downloadPrivateAppFromUrl = useEndpoint('POST', '/apps'); + + const [isInstalling, setInstalling] = useState(false); + + const { mutate: sendFile } = useMutation( + ['apps/installPrivateApp'], + ({ permissionsGranted, appFile, appId }: { permissionsGranted: AppPermission[]; appFile: File; appId?: string }) => { + const fileData = new FormData(); + fileData.append('app', appFile, appFile.name); + fileData.append('permissions', JSON.stringify(permissionsGranted)); + + if (appId) { + return uploadUpdateEndpoint(fileData); + } + + return uploadAppEndpoint(fileData) as any; + }, + { + onSuccess: (data: { app: App }) => { + router.navigate({ + name: 'marketplace', + params: { + context: 'private', + page: 'info', + id: data.app.id, + }, + }); + }, + onError: (e) => { + handleAPIError(e); + }, + onSettled: () => { + setInstalling(false); + setModal(null); + reloadAppsList(); + }, + }, + ); + + const cancelAction = useCallback(() => { + setInstalling(false); + setModal(null); + }, [setInstalling, setModal]); + + const isAppInstalled = async (appId: string) => { + try { + const app = await AppClientOrchestratorInstance.getApp(appId); + return !!app || false; + } catch (e) { + return false; + } + }; + + const handleAppPermissionsReview = async (permissions: AppPermission[], appFile: File, appId?: string) => { + setModal( + sendFile({ permissionsGranted, appFile, appId })} + />, + ); + }; + + const uploadFile = async (appFile: File, { id, permissions }: { id: string; permissions: AppPermission[] }) => { + const isInstalled = await isAppInstalled(id); + + if (isInstalled) { + return setModal( handleAppPermissionsReview(permissions, appFile, id)} />); + } + + await handleAppPermissionsReview(permissions, appFile); + }; + + /** @deprecated */ + const getAppFile = async (): Promise => { + try { + const { buff } = (await downloadPrivateAppFromUrl({ url, downloadOnly: true })) as { buff: { data: ArrayLike } }; + + return new File([Uint8Array.from(buff.data)], 'app.zip', { type: 'application/zip' }); + } catch (error) { + handleInstallError(error as Error); + } + }; + + const extractManifestFromAppFile = async (appFile: File) => { + const manifest = await getManifestFromZippedApp(appFile); + return manifest; + }; + + const install = async () => { + let appFile: File | undefined; + + setInstalling(true); + + if (!appCountQuery.data) { + return cancelAction(); + } + + if (!file) { + appFile = await getAppFile(); + } else { + appFile = file; + } + + if (!appFile) { + return cancelAction(); + } + + const manifest = await extractManifestFromAppFile(appFile); + + if (!manifest) { + return cancelAction(); + } + + if (appCountQuery.data.hasUnlimitedApps) { + return uploadFile(appFile, manifest); + } + + setModal( + uploadFile(appFile as File, manifest)} + handleEnableUnlimitedApps={() => { + openExternalLink(manageSubscriptionUrl); + setModal(null); + }} + />, + ); + }; + + return { install, isInstalling }; +}; diff --git a/apps/meteor/client/views/marketplace/lib/getManifestFromZippedApp.ts b/apps/meteor/client/views/marketplace/lib/getManifestFromZippedApp.ts index e9a292de6181..70f0b8827aa1 100644 --- a/apps/meteor/client/views/marketplace/lib/getManifestFromZippedApp.ts +++ b/apps/meteor/client/views/marketplace/lib/getManifestFromZippedApp.ts @@ -1,7 +1,8 @@ +import type { AppPermission } from '@rocket.chat/core-typings'; import { unzipSync, strFromU8 } from 'fflate'; type Uint8ArrayObject = { [fileName: string]: Uint8Array }; -type AppManifestSchema = { [key: string]: string }; +type AppManifestSchema = { id: string; name: string; permissions: AppPermission[] }; async function fileToUint8Array(file: File): Promise { return new Promise((resolve, reject) => { diff --git a/apps/meteor/client/views/meet/CallPage.tsx b/apps/meteor/client/views/meet/CallPage.tsx index 2c1c5f65056e..87188221c091 100644 --- a/apps/meteor/client/views/meet/CallPage.tsx +++ b/apps/meteor/client/views/meet/CallPage.tsx @@ -1,20 +1,20 @@ import { Box, Flex, ButtonGroup, Button, Icon } from '@rocket.chat/fuselage'; -import { useTranslation } from '@rocket.chat/ui-contexts'; +import { UserAvatar } from '@rocket.chat/ui-avatar'; +import { useTranslation, useStream } from '@rocket.chat/ui-contexts'; import moment from 'moment'; import type { FC } from 'react'; import React, { useEffect, useState } from 'react'; -import { Notifications } from '../../../app/notifications/client'; +import { sdk } from '../../../app/utils/client/lib/SDKClient'; import { WebRTC } from '../../../app/webrtc/client'; import { WEB_RTC_EVENTS } from '../../../app/webrtc/lib/constants'; -import UserAvatar from '../../components/avatar/UserAvatar'; import OngoingCallDuration from './OngoingCallDuration'; import './styles.css'; type CallPageProps = { - roomId: any; + roomId?: string; visitorToken: any; - visitorId: any; + visitorId: string | null; status: any; setStatus: any; isLayoutEmbedded: boolean; @@ -34,6 +34,9 @@ const CallPage: FC = ({ agentName, callStartTime, }) => { + if (!roomId) { + throw new Error('Call Page - no room id'); + } const [isAgentActive, setIsAgentActive] = useState(false); const [isMicOn, setIsMicOn] = useState(false); const [isCameraOn, setIsCameraOn] = useState(false); @@ -50,10 +53,15 @@ const CallPage: FC = ({ buttonSize = 'x35'; } + const subscribeNotifyUser = useStream('notify-user'); + const subscribeNotifyRoom = useStream('notify-room'); const t = useTranslation(); useEffect(() => { if (visitorToken) { - const webrtcInstance = WebRTC.getInstanceByRoomId(roomId, visitorId); + if (!visitorId) { + throw new Error('Call Page - no visitor id'); + } + const webrtcInstance = WebRTC.getInstanceByRoomId(roomId, visitorId as any); const isMobileDevice = (): boolean => { if (isLayoutEmbedded) { setCallInIframe(true); @@ -71,33 +79,58 @@ const CallPage: FC = ({ } return false; }; - Notifications.onVisitor(WEB_RTC_EVENTS.WEB_RTC, visitorId, (type: any, data: any) => { + + const unsubNotifyUser = subscribeNotifyUser(`${visitorId}/${WEB_RTC_EVENTS.WEB_RTC}`, (type: any, data: any) => { if (data.room == null) { return; } webrtcInstance.onUserStream(type, data); }); - Notifications.onRoom(roomId, 'webrtc' as any, (type: any, data: any) => { + const unsubNotifyRoom = subscribeNotifyRoom(`${roomId}/${WEB_RTC_EVENTS.WEB_RTC}`, (type: any, data: any) => { if (type === 'callStatus' && data.callStatus === 'ended') { webrtcInstance.stop(); setStatus(data.callStatus); } else if (type === 'getDeviceType') { - Notifications.notifyRoom(roomId, 'webrtc' as any, 'deviceType', { - isMobileDevice: isMobileDevice(), - }); + sdk.publish('notify-room', [ + `${roomId}/${WEB_RTC_EVENTS.WEB_RTC}`, + 'deviceType', + { + isMobileDevice: isMobileDevice(), + }, + ]); } else if (type === 'cameraStatus') { setIsRemoteCameraOn(data.isCameraOn); } }); - Notifications.notifyRoom(roomId, 'webrtc' as any, 'deviceType', { - isMobileDevice: isMobileDevice(), - }); - Notifications.notifyRoom(roomId, 'webrtc' as any, 'callStatus', { callStatus: 'inProgress' }); - } else if (!isAgentActive) { + + sdk.publish('notify-room', [ + `${roomId}/${WEB_RTC_EVENTS.WEB_RTC}`, + 'deviceType', + { + isMobileDevice: isMobileDevice(), + }, + ]); + + sdk.publish('notify-room', [ + `${roomId}/${WEB_RTC_EVENTS.WEB_RTC}`, + 'callStatus', + { + callStatus: 'inProgress', + }, + ]); + + return () => { + unsubNotifyRoom(); + unsubNotifyUser(); + }; + } + + if (!isAgentActive) { const webrtcInstance = WebRTC.getInstanceByRoomId(roomId); if (status === 'inProgress') { - Notifications.notifyRoom(roomId, 'webrtc' as any, 'getDeviceType'); + sdk.publish('notify-room', [`${roomId}/${WEB_RTC_EVENTS.WEB_RTC}`, 'getDeviceType']); + webrtcInstance.startCall({ audio: true, video: { @@ -106,7 +139,10 @@ const CallPage: FC = ({ }, }); } - Notifications.onRoom(roomId, 'webrtc' as any, (type: any, data: any) => { + + setIsAgentActive(true); + + return subscribeNotifyRoom(`${roomId}/${WEB_RTC_EVENTS.WEB_RTC}`, (type: any, data: any) => { if (type === 'callStatus') { switch (data.callStatus) { case 'ended': @@ -128,9 +164,8 @@ const CallPage: FC = ({ setIsRemoteCameraOn(data.isCameraOn); } }); - setIsAgentActive(true); } - }, [isAgentActive, status, setStatus, visitorId, roomId, visitorToken, isLayoutEmbedded]); + }, [isAgentActive, status, setStatus, visitorId, roomId, visitorToken, isLayoutEmbedded, subscribeNotifyUser, subscribeNotifyRoom]); const toggleButton = (control: any): any => { if (control === 'mic') { @@ -139,7 +174,13 @@ const CallPage: FC = ({ } WebRTC.getInstanceByRoomId(roomId, visitorToken).toggleVideo(); setIsCameraOn(!isCameraOn); - Notifications.notifyRoom(roomId, 'webrtc' as any, 'cameraStatus', { isCameraOn: !isCameraOn }); + sdk.publish('notify-room', [ + `${roomId}/${WEB_RTC_EVENTS.WEB_RTC}`, + 'cameraStatus', + { + isCameraOn: !isCameraOn, + }, + ]); }; const closeWindow = (): void => { @@ -176,59 +217,60 @@ const CallPage: FC = ({ display: isCameraOn ? 'block' : 'none', }} > - + > + + - - - - {isLayoutEmbedded && ( + + - )} - - + {isLayoutEmbedded && ( + + )} + + +