isometrik-plugin-chat-sdk 2.0.21 → 2.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/admin-transfer-dialog.cjs.entry.js +2 -2
- package/dist/cjs/{app-globals-2824b330.js → app-globals-0e7848be.js} +3 -3
- package/dist/cjs/{app-globals-2824b330.js.map → app-globals-0e7848be.js.map} +1 -1
- package/dist/cjs/{attachment-preview_22.cjs.entry.js → attachment-preview_23.cjs.entry.js} +692 -388
- package/dist/cjs/attachment-preview_23.cjs.entry.js.map +1 -0
- package/dist/cjs/audio-bubble_4.cjs.entry.js +66 -22
- package/dist/cjs/audio-bubble_4.cjs.entry.js.map +1 -1
- package/dist/cjs/chat-app.cjs.entry.js +1 -1
- package/dist/cjs/chat-document-message-bubble.cjs.entry.js +1 -1
- package/dist/cjs/chat-image-message-bubble.cjs.entry.js +1 -1
- package/dist/cjs/chat-tile_3.cjs.entry.js +14 -10
- package/dist/cjs/chat-tile_3.cjs.entry.js.map +1 -1
- package/dist/cjs/chat-video-message-bubble.cjs.entry.js +1 -1
- package/dist/cjs/confirm-dialog.cjs.entry.js +1 -1
- package/dist/cjs/{content-ebca062a.js → content-8b271b56.js} +3 -1
- package/dist/cjs/content-8b271b56.js.map +1 -0
- package/dist/cjs/delete-message.cjs.entry.js +1 -1
- package/dist/cjs/download-9ccc0a6c.js +120 -0
- package/dist/cjs/download-9ccc0a6c.js.map +1 -0
- package/dist/cjs/{drawer-00a2323a.js → drawer-3f9c87b4.js} +42 -5
- package/dist/cjs/drawer-3f9c87b4.js.map +1 -0
- package/dist/cjs/forward-memebers.cjs.entry.js +61 -24
- package/dist/cjs/forward-memebers.cjs.entry.js.map +1 -1
- package/dist/cjs/forward-message.cjs.entry.js +2 -2
- package/dist/cjs/group-chat-contacts.cjs.entry.js +2 -2
- package/dist/cjs/{group-members-b3bea06e.js → group-members-1205fc4c.js} +5 -5
- package/dist/cjs/{group-members-b3bea06e.js.map → group-members-1205fc4c.js.map} +1 -1
- package/dist/cjs/{groupcast-8441b4df.js → groupcast-bb393c81.js} +14 -54
- package/dist/cjs/groupcast-bb393c81.js.map +1 -0
- package/dist/cjs/{groupcast-f24da720.js → groupcast-e1e52bd1.js} +16 -16
- package/dist/cjs/{groupcast-f24da720.js.map → groupcast-e1e52bd1.js.map} +1 -1
- package/dist/cjs/{helpers-154861e9.js → helpers-877a7116.js} +30 -1
- package/dist/cjs/helpers-877a7116.js.map +1 -0
- package/dist/cjs/index.cjs.js +8 -6
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/{toast-91093c84.js → index.m-ff115b26.js} +1 -156
- package/dist/cjs/{toast-91093c84.js.map → index.m-ff115b26.js.map} +1 -1
- package/dist/cjs/info-panel-media_2.cjs.entry.js +244 -0
- package/dist/cjs/info-panel-media_2.cjs.entry.js.map +1 -0
- package/dist/cjs/isometrik-webchat.cjs.js +11 -9
- package/dist/cjs/isometrik-webchat.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +11 -9
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/cjs/{local-notification-bdd04d7a.js → local-notification-a86a2b34.js} +3 -3
- package/dist/cjs/local-notification-a86a2b34.js.map +1 -0
- package/dist/cjs/login-page_3.cjs.entry.js +258 -104
- package/dist/cjs/login-page_3.cjs.entry.js.map +1 -1
- package/dist/cjs/media-gallery.cjs.entry.js +10 -2
- package/dist/cjs/media-gallery.cjs.entry.js.map +1 -1
- package/dist/cjs/member-add.cjs.entry.js +20 -11
- package/dist/cjs/member-add.cjs.entry.js.map +1 -1
- package/dist/cjs/message-bubble.cjs.entry.js +2 -2
- package/dist/cjs/{message-reaction-82a4f93c.js → message-reaction-8f93a048.js} +5 -5
- package/dist/cjs/{message-reaction-82a4f93c.js.map → message-reaction-8f93a048.js.map} +1 -1
- package/dist/cjs/messages-e129b34d.js +179 -0
- package/dist/cjs/messages-e129b34d.js.map +1 -0
- package/dist/cjs/my-component.cjs.entry.js +1 -1
- package/dist/cjs/new-chat-sidebar.cjs.entry.js +2 -2
- package/dist/cjs/play-b473e0ab.js +13 -0
- package/dist/cjs/play-b473e0ab.js.map +1 -0
- package/dist/cjs/profile-avatar.cjs.entry.js +1 -1
- package/dist/cjs/reaction-container.cjs.entry.js +5 -4
- package/dist/cjs/reaction-container.cjs.entry.js.map +1 -1
- package/dist/cjs/{runtime-controls-cfc8fc31.js → runtime-controls-a70872fe.js} +33 -15
- package/dist/cjs/runtime-controls-a70872fe.js.map +1 -0
- package/dist/cjs/{send-media-4ee967d4.js → send-media-8a841e50.js} +559 -192
- package/dist/cjs/send-media-8a841e50.js.map +1 -0
- package/dist/cjs/share-popup.cjs.entry.js +1 -1
- package/dist/cjs/signup-page.cjs.entry.js +2 -2
- package/dist/cjs/spinner-loader.cjs.entry.js +1 -1
- package/dist/cjs/{group-members-cef1198e.js → storage-quota-2e81fb71.js} +254 -10
- package/dist/cjs/storage-quota-2e81fb71.js.map +1 -0
- package/dist/cjs/toast-a75f822c.js +159 -0
- package/dist/cjs/toast-a75f822c.js.map +1 -0
- package/dist/collection/collection-manifest.json +10 -8
- package/dist/collection/components/ChatUIComponent/AddMember.js +14 -7
- package/dist/collection/components/ChatUIComponent/AddMember.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/ChatDocumentMessageBubble.js +1 -1
- package/dist/collection/components/ChatUIComponent/ChatImageMessageBubble.js +1 -1
- package/dist/collection/components/ChatUIComponent/ChatOwnProfile/Profile.js +8 -2
- package/dist/collection/components/ChatUIComponent/ChatOwnProfile/Profile.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/ChatSidebar/ChatSidebar.js +90 -47
- package/dist/collection/components/ChatUIComponent/ChatSidebar/ChatSidebar.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/ChatVideoMessageBubble.js +1 -1
- package/dist/collection/components/ChatUIComponent/Footer/ChatFooter.js +105 -37
- package/dist/collection/components/ChatUIComponent/Footer/ChatFooter.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/Header/WebChatHeader.js +45 -11
- package/dist/collection/components/ChatUIComponent/Header/WebChatHeader.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/ReactionContainer.js +2 -2
- package/dist/collection/components/ChatUIComponent/WebChatBody/WebChatBody.js +38 -13
- package/dist/collection/components/ChatUIComponent/WebChatBody/WebChatBody.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/WebChatBody/web-chat-body.css +1 -0
- package/dist/collection/components/ChatUIComponent/shared/AudioBubble/AudioBubble.js +22 -10
- package/dist/collection/components/ChatUIComponent/shared/AudioBubble/AudioBubble.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/ForwardMessageList/ForwardMessageList.js +55 -19
- package/dist/collection/components/ChatUIComponent/shared/ForwardMessageList/ForwardMessageList.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/admin-transfer-dialog/admin-transfer-dialog.js +2 -2
- package/dist/collection/components/ChatUIComponent/shared/attachment-preview/attachment-preview.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/block chatlist/BlockChatList.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/chat-loading-placeholder/chat-loading-placeholder.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/chat-tile/chat-tile.js +31 -9
- package/dist/collection/components/ChatUIComponent/shared/chat-tile/chat-tile.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/confirm-dialog/confirm-dialog.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/contact-info/contact-info.js +66 -157
- package/dist/collection/components/ChatUIComponent/shared/contact-info/contact-info.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/delete-message/delete-message.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/document-message/document-message.js +14 -4
- package/dist/collection/components/ChatUIComponent/shared/document-message/document-message.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/forward-message/forward-message.js +2 -2
- package/dist/collection/components/ChatUIComponent/shared/group-info/group-info.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/image-message/image-message.js +65 -2
- package/dist/collection/components/ChatUIComponent/shared/image-message/image-message.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/incoming-text-message-bubble/incoming-text-message-bubble.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/info-panel-media/info-panel-media.js +335 -0
- package/dist/collection/components/ChatUIComponent/shared/info-panel-media/info-panel-media.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/shared/link-preview/link-preview.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/media-gallery/media-gallery.js +11 -2
- package/dist/collection/components/ChatUIComponent/shared/media-gallery/media-gallery.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/message-bubble/message-bubble.js +2 -2
- package/dist/collection/components/ChatUIComponent/shared/message-date-pill/message-date-pill.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/message-info/message-info.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/message-search/message-search.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/new chat/new-chat.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/outgoing-text-message-bubble/outgoing-text-message-bubble.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/profile sidebar/profile-sidebar.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/profile-avatar/profile-avatar.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/profile-info/profile-info.js +70 -3
- package/dist/collection/components/ChatUIComponent/shared/profile-info/profile-info.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/reply-block/reply-block.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/reply-message-container/reply-message-container.js +31 -2
- package/dist/collection/components/ChatUIComponent/shared/reply-message-container/reply-message-container.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/reply-message-container/reply-message-container.stories.js +10 -6
- package/dist/collection/components/ChatUIComponent/shared/searchable list/searchable-list.js +3 -3
- package/dist/collection/components/ChatUIComponent/shared/share-popup/share-popup.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/spinner-loader/spinner-loader.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/storage/storage-manager.js +140 -0
- package/dist/collection/components/ChatUIComponent/shared/storage/storage-manager.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/shared/video-message/video-message.js +35 -3
- package/dist/collection/components/ChatUIComponent/shared/video-message/video-message.js.map +1 -1
- package/dist/collection/components/Login.js +1 -1
- package/dist/collection/components/Signup.js +2 -2
- package/dist/collection/components/chat-main.js +1 -1
- package/dist/collection/components/my-component/my-component.js +1 -1
- package/dist/collection/components/my-component/web-chat/WebChat.js +145 -1
- package/dist/collection/components/my-component/web-chat/WebChat.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/WebchatRightSide.js +44 -2
- package/dist/collection/components/my-component/web-chat/WebchatRightSide.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/bootstrap.js +1 -0
- package/dist/collection/components/my-component/web-chat/bootstrap.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/conversation-ops.js +22 -2
- package/dist/collection/components/my-component/web-chat/conversation-ops.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/data-fetch.js +9 -4
- package/dist/collection/components/my-component/web-chat/data-fetch.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/event-handlers.js +51 -10
- package/dist/collection/components/my-component/web-chat/event-handlers.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/mutations.js +38 -8
- package/dist/collection/components/my-component/web-chat/mutations.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/offline-host.js +31 -17
- package/dist/collection/components/my-component/web-chat/offline-host.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/public-send.js +6 -1
- package/dist/collection/components/my-component/web-chat/public-send.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/shell-render.js +11 -9
- package/dist/collection/components/my-component/web-chat/shell-render.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/web-chat.css +40 -3
- package/dist/collection/components/theme-provider.js +1 -1
- package/dist/collection/constants/content.js +2 -0
- package/dist/collection/lib/chat/block-status.js +12 -0
- package/dist/collection/lib/chat/block-status.js.map +1 -0
- package/dist/collection/lib/chat/clipboard-paste.js +68 -0
- package/dist/collection/lib/chat/clipboard-paste.js.map +1 -0
- package/dist/collection/lib/chat/conversations.js +47 -3
- package/dist/collection/lib/chat/conversations.js.map +1 -1
- package/dist/collection/lib/chat/download-media.js +112 -0
- package/dist/collection/lib/chat/download-media.js.map +1 -0
- package/dist/collection/lib/chat/index.js +6 -2
- package/dist/collection/lib/chat/index.js.map +1 -1
- package/dist/collection/lib/chat/local-notification.js +1 -1
- package/dist/collection/lib/chat/local-notification.js.map +1 -1
- package/dist/collection/lib/chat/same-name-upload.js +53 -0
- package/dist/collection/lib/chat/same-name-upload.js.map +1 -0
- package/dist/collection/lib/chat/send-media.js +194 -27
- package/dist/collection/lib/chat/send-media.js.map +1 -1
- package/dist/collection/lib/chat/session.js +9 -3
- package/dist/collection/lib/chat/session.js.map +1 -1
- package/dist/collection/lib/chat/storage-quota.js +226 -0
- package/dist/collection/lib/chat/storage-quota.js.map +1 -0
- package/dist/collection/lib/custom-ui/public-api.js +5 -0
- package/dist/collection/lib/custom-ui/public-api.js.map +1 -1
- package/dist/collection/lib/drawer.js +42 -4
- package/dist/collection/lib/drawer.js.map +1 -1
- package/dist/collection/lib/helpers.js +29 -1
- package/dist/collection/lib/mqtt/dispatch.js +7 -3
- package/dist/collection/lib/mqtt/dispatch.js.map +1 -1
- package/dist/collection/sdk/headless-api.js +8 -0
- package/dist/collection/sdk/headless-api.js.map +1 -1
- package/dist/collection/sdk/index.js +1 -0
- package/dist/collection/sdk/index.js.map +1 -1
- package/dist/collection/sdk/webchat-api.js +5 -0
- package/dist/collection/sdk/webchat-api.js.map +1 -1
- package/dist/collection/store/storage-quota.js +244 -0
- package/dist/collection/store/storage-quota.js.map +1 -0
- package/dist/collection/testing/iso-chat-sdk-mock.js +10 -6
- package/dist/components/AudioBubble.js +22 -10
- package/dist/components/AudioBubble.js.map +1 -1
- package/dist/components/BlockChatList.js +2 -2
- package/dist/components/ChatFooter.js +172 -37
- package/dist/components/ChatFooter.js.map +1 -1
- package/dist/components/ChatSidebar.js +102 -49
- package/dist/components/ChatSidebar.js.map +1 -1
- package/dist/components/GroupCast2.js +1 -1
- package/dist/components/Login.js +1 -1
- package/dist/components/Profile.js +20 -9
- package/dist/components/Profile.js.map +1 -1
- package/dist/components/WebChat.js +301 -126
- package/dist/components/WebChat.js.map +1 -1
- package/dist/components/WebChatBody.js +39 -14
- package/dist/components/WebChatBody.js.map +1 -1
- package/dist/components/WebChatHeader.js +48 -15
- package/dist/components/WebChatHeader.js.map +1 -1
- package/dist/components/WebchatRightSide.js +22 -7
- package/dist/components/WebchatRightSide.js.map +1 -1
- package/dist/components/admin-transfer-dialog.js +2 -2
- package/dist/components/attachment-preview2.js +1 -1
- package/dist/components/chat-app.js +85 -73
- package/dist/components/chat-app.js.map +1 -1
- package/dist/components/chat-assets.js +1 -1
- package/dist/components/chat-document-message-bubble.js +1 -1
- package/dist/components/chat-image-message-bubble.js +1 -1
- package/dist/components/chat-loading-placeholder2.js +1 -1
- package/dist/components/chat-tile2.js +12 -7
- package/dist/components/chat-tile2.js.map +1 -1
- package/dist/components/chat-video-message-bubble.js +1 -1
- package/dist/components/client.js +11 -47
- package/dist/components/client.js.map +1 -1
- package/dist/components/confirm-dialog.js +1 -1
- package/dist/components/contact-info2.js +73 -162
- package/dist/components/contact-info2.js.map +1 -1
- package/dist/components/content.js +2 -0
- package/dist/components/content.js.map +1 -1
- package/dist/components/conversation.js +1 -1
- package/dist/components/conversations.js +91 -0
- package/dist/components/conversations.js.map +1 -0
- package/dist/components/delete-message.js +1 -1
- package/dist/components/document-message2.js +15 -6
- package/dist/components/document-message2.js.map +1 -1
- package/dist/components/download-media.js +115 -0
- package/dist/components/download-media.js.map +1 -0
- package/dist/components/download.js +5 -0
- package/dist/components/download.js.map +1 -0
- package/dist/components/drawer.js +42 -5
- package/dist/components/drawer.js.map +1 -1
- package/dist/components/forward-memebers.js +56 -20
- package/dist/components/forward-memebers.js.map +1 -1
- package/dist/components/forward-message.js +2 -2
- package/dist/components/group-chat-contacts2.js +1 -1
- package/dist/components/group-info.js +1 -1
- package/dist/components/group-members.js +26 -298
- package/dist/components/group-members.js.map +1 -1
- package/dist/components/helpers.js +28 -1
- package/dist/components/helpers.js.map +1 -1
- package/dist/components/image-message2.js +17 -2
- package/dist/components/image-message2.js.map +1 -1
- package/dist/components/incoming-text-message-bubble2.js +1 -1
- package/dist/components/index.js +21 -2
- package/dist/components/index.js.map +1 -1
- package/dist/{esm/group-members-7909941c.js → components/index3.js} +3 -52
- package/dist/components/index3.js.map +1 -0
- package/dist/components/info-panel-media.d.ts +11 -0
- package/dist/components/info-panel-media.js +8 -0
- package/dist/components/info-panel-media.js.map +1 -0
- package/dist/components/info-panel-media2.js +242 -0
- package/dist/components/info-panel-media2.js.map +1 -0
- package/dist/components/link-preview2.js +1 -1
- package/dist/components/local-notification.js +1 -1
- package/dist/components/local-notification.js.map +1 -1
- package/dist/components/media-gallery.js +11 -2
- package/dist/components/media-gallery.js.map +1 -1
- package/dist/components/member-add.js +16 -9
- package/dist/components/member-add.js.map +1 -1
- package/dist/components/message-bubble2.js +2 -2
- package/dist/components/message-date-pill2.js +1 -1
- package/dist/components/message-info2.js +2 -2
- package/dist/components/message-search2.js +1 -1
- package/dist/components/messages.js +1 -1
- package/dist/components/my-component.js +1 -1
- package/dist/components/new-chat-sidebar.js +1 -1
- package/dist/components/new-chat2.js +1 -1
- package/dist/components/outgoing-text-message-bubble2.js +1 -1
- package/dist/components/profile-avatar2.js +1 -1
- package/dist/components/profile-info2.js +69 -6
- package/dist/components/profile-info2.js.map +1 -1
- package/dist/components/profile-sidebar2.js +2 -2
- package/dist/components/prompt-exit-group.js +26 -3
- package/dist/components/prompt-exit-group.js.map +1 -1
- package/dist/components/reaction-container.js +2 -2
- package/dist/components/reply-block2.js +1 -1
- package/dist/components/reply-message-container2.js +12 -2
- package/dist/components/reply-message-container2.js.map +1 -1
- package/dist/components/searchable-list2.js +3 -3
- package/dist/components/send-media.js +242 -33
- package/dist/components/send-media.js.map +1 -1
- package/dist/components/share-popup.js +1 -1
- package/dist/components/signup-page.js +2 -2
- package/dist/components/spinner-loader2.js +1 -1
- package/dist/components/storage-manager.js +125 -0
- package/dist/components/storage-manager.js.map +1 -0
- package/dist/components/storage-quota.js +223 -0
- package/dist/components/storage-quota.js.map +1 -0
- package/dist/components/storage-quota2.js +248 -0
- package/dist/components/storage-quota2.js.map +1 -0
- package/dist/components/theme-provider2.js +1 -1
- package/dist/components/video-message2.js +19 -3
- package/dist/components/video-message2.js.map +1 -1
- package/dist/components/web-chat-storage.d.ts +11 -0
- package/dist/components/web-chat-storage.js +8 -0
- package/dist/components/web-chat-storage.js.map +1 -0
- package/dist/esm/admin-transfer-dialog.entry.js +2 -2
- package/dist/esm/{app-globals-e3f4717b.js → app-globals-eba1ca0c.js} +3 -3
- package/dist/esm/{app-globals-e3f4717b.js.map → app-globals-eba1ca0c.js.map} +1 -1
- package/dist/esm/{attachment-preview_22.entry.js → attachment-preview_23.entry.js} +657 -354
- package/dist/esm/attachment-preview_23.entry.js.map +1 -0
- package/dist/esm/audio-bubble_4.entry.js +66 -22
- package/dist/esm/audio-bubble_4.entry.js.map +1 -1
- package/dist/esm/chat-app.entry.js +1 -1
- package/dist/esm/chat-document-message-bubble.entry.js +1 -1
- package/dist/esm/chat-image-message-bubble.entry.js +1 -1
- package/dist/esm/chat-tile_3.entry.js +15 -11
- package/dist/esm/chat-tile_3.entry.js.map +1 -1
- package/dist/esm/chat-video-message-bubble.entry.js +1 -1
- package/dist/esm/confirm-dialog.entry.js +1 -1
- package/dist/esm/{content-fb138a93.js → content-fd0af283.js} +3 -1
- package/dist/esm/content-fd0af283.js.map +1 -0
- package/dist/esm/delete-message.entry.js +1 -1
- package/dist/esm/download-5368a10f.js +117 -0
- package/dist/esm/download-5368a10f.js.map +1 -0
- package/dist/esm/{drawer-7de04622.js → drawer-a457d820.js} +43 -6
- package/dist/esm/drawer-a457d820.js.map +1 -0
- package/dist/esm/forward-memebers.entry.js +59 -22
- package/dist/esm/forward-memebers.entry.js.map +1 -1
- package/dist/esm/forward-message.entry.js +2 -2
- package/dist/esm/group-chat-contacts.entry.js +2 -2
- package/dist/esm/{group-members-36cf9395.js → group-members-d603f29f.js} +2 -2
- package/dist/esm/{group-members-36cf9395.js.map → group-members-d603f29f.js.map} +1 -1
- package/dist/esm/{groupcast-5fb19ec3.js → groupcast-4f15b050.js} +14 -50
- package/dist/esm/groupcast-4f15b050.js.map +1 -0
- package/dist/esm/{groupcast-f96c1d9e.js → groupcast-c6da3918.js} +2 -2
- package/dist/esm/{groupcast-f96c1d9e.js.map → groupcast-c6da3918.js.map} +1 -1
- package/dist/esm/{helpers-f33b895c.js → helpers-1632a4c7.js} +29 -2
- package/dist/esm/helpers-1632a4c7.js.map +1 -0
- package/dist/esm/index.js +9 -7
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/{toast-a1531088.js → index.m-8c70037f.js} +2 -156
- package/dist/esm/{toast-a1531088.js.map → index.m-8c70037f.js.map} +1 -1
- package/dist/esm/info-panel-media_2.entry.js +239 -0
- package/dist/esm/info-panel-media_2.entry.js.map +1 -0
- package/dist/esm/isometrik-webchat.js +11 -9
- package/dist/esm/isometrik-webchat.js.map +1 -1
- package/dist/esm/loader.js +11 -9
- package/dist/esm/loader.js.map +1 -1
- package/dist/esm/{local-notification-4c1e166d.js → local-notification-f9ae9062.js} +3 -3
- package/dist/esm/local-notification-f9ae9062.js.map +1 -0
- package/dist/esm/login-page_3.entry.js +219 -65
- package/dist/esm/login-page_3.entry.js.map +1 -1
- package/dist/esm/media-gallery.entry.js +10 -2
- package/dist/esm/media-gallery.entry.js.map +1 -1
- package/dist/esm/member-add.entry.js +20 -11
- package/dist/esm/member-add.entry.js.map +1 -1
- package/dist/esm/message-bubble.entry.js +2 -2
- package/dist/esm/{message-reaction-0d2ef75f.js → message-reaction-0a2bb115.js} +2 -2
- package/dist/esm/{message-reaction-0d2ef75f.js.map → message-reaction-0a2bb115.js.map} +1 -1
- package/dist/esm/messages-057dbecb.js +167 -0
- package/dist/esm/messages-057dbecb.js.map +1 -0
- package/dist/esm/my-component.entry.js +1 -1
- package/dist/esm/new-chat-sidebar.entry.js +2 -2
- package/dist/esm/play-05ae077a.js +9 -0
- package/dist/esm/play-05ae077a.js.map +1 -0
- package/dist/esm/profile-avatar.entry.js +1 -1
- package/dist/esm/reaction-container.entry.js +5 -4
- package/dist/esm/reaction-container.entry.js.map +1 -1
- package/dist/esm/{runtime-controls-ff81e90a.js → runtime-controls-bdb84aeb.js} +21 -3
- package/dist/esm/runtime-controls-bdb84aeb.js.map +1 -0
- package/dist/esm/{send-media-58e7145b.js → send-media-04f7ca0a.js} +533 -180
- package/dist/esm/send-media-04f7ca0a.js.map +1 -0
- package/dist/esm/share-popup.entry.js +1 -1
- package/dist/esm/signup-page.entry.js +2 -2
- package/dist/esm/spinner-loader.entry.js +1 -1
- package/dist/esm/storage-quota-6329fabe.js +578 -0
- package/dist/esm/storage-quota-6329fabe.js.map +1 -0
- package/dist/esm/toast-f681e916.js +157 -0
- package/dist/esm/toast-f681e916.js.map +1 -0
- package/dist/isometrik-webchat/index.esm.js +1 -1
- package/dist/isometrik-webchat/index.esm.js.map +1 -1
- package/dist/isometrik-webchat/isometrik-webchat.esm.js +1 -1
- package/dist/isometrik-webchat/isometrik-webchat.esm.js.map +1 -1
- package/dist/isometrik-webchat/p-0161f40b.js +2 -0
- package/dist/isometrik-webchat/p-0161f40b.js.map +1 -0
- package/dist/isometrik-webchat/{p-d892b4d4.entry.js → p-02db2116.entry.js} +2 -2
- package/dist/isometrik-webchat/p-03933431.entry.js +2 -0
- package/dist/isometrik-webchat/{p-352b589e.entry.js.map → p-03933431.entry.js.map} +1 -1
- package/dist/isometrik-webchat/{p-c591fa45.js → p-04fdbd0a.js} +2 -2
- package/dist/isometrik-webchat/p-0bb42151.entry.js +2 -0
- package/dist/isometrik-webchat/p-0bb42151.entry.js.map +1 -0
- package/dist/isometrik-webchat/{p-c5bff6a1.entry.js → p-119fc683.entry.js} +2 -2
- package/dist/isometrik-webchat/p-19d37e1f.js +2 -0
- package/dist/isometrik-webchat/p-19d37e1f.js.map +1 -0
- package/dist/isometrik-webchat/{p-925decda.js → p-1dc52239.js} +2 -2
- package/dist/isometrik-webchat/p-1f0e8230.entry.js +2 -0
- package/dist/isometrik-webchat/p-1f0e8230.entry.js.map +1 -0
- package/dist/isometrik-webchat/{p-7b25f234.entry.js → p-35f2b9ae.entry.js} +2 -2
- package/dist/isometrik-webchat/p-3a0409fc.js +2 -0
- package/dist/isometrik-webchat/p-3a0409fc.js.map +1 -0
- package/dist/isometrik-webchat/{p-9982fa21.js → p-3dca1e56.js} +2 -2
- package/dist/isometrik-webchat/p-3dca1e56.js.map +1 -0
- package/dist/isometrik-webchat/p-40217f22.js +2 -0
- package/dist/isometrik-webchat/p-40217f22.js.map +1 -0
- package/dist/isometrik-webchat/{p-3b3dc33e.js → p-46be73c5.js} +2 -2
- package/dist/isometrik-webchat/p-56521ea4.entry.js +2 -0
- package/dist/isometrik-webchat/{p-f7d05551.entry.js → p-57f97cef.entry.js} +2 -2
- package/dist/isometrik-webchat/p-5f7eebbf.entry.js +2 -0
- package/dist/isometrik-webchat/p-605cb14e.entry.js +2 -0
- package/dist/isometrik-webchat/p-605cb14e.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-640e2c03.entry.js +2 -0
- package/dist/isometrik-webchat/p-69d953cb.entry.js +2 -0
- package/dist/isometrik-webchat/p-69d953cb.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-6c5eb178.js +2 -0
- package/dist/isometrik-webchat/{p-d8b65cf4.entry.js → p-6eadaa6c.entry.js} +2 -2
- package/dist/isometrik-webchat/{p-161fcb35.entry.js → p-7130f547.entry.js} +2 -2
- package/dist/isometrik-webchat/p-782d1bd2.js +2 -0
- package/dist/isometrik-webchat/p-782d1bd2.js.map +1 -0
- package/dist/isometrik-webchat/p-8142a54d.js +2 -0
- package/dist/isometrik-webchat/p-8142a54d.js.map +1 -0
- package/dist/isometrik-webchat/{p-cbb1179b.entry.js → p-89a8fc58.entry.js} +2 -2
- package/dist/isometrik-webchat/p-8f17345f.js +7 -0
- package/dist/isometrik-webchat/p-8f17345f.js.map +1 -0
- package/dist/isometrik-webchat/p-991d5437.js +2 -0
- package/dist/isometrik-webchat/p-991d5437.js.map +1 -0
- package/dist/isometrik-webchat/p-9b70e93f.entry.js +2 -0
- package/dist/isometrik-webchat/p-a5faa465.entry.js +2 -0
- package/dist/isometrik-webchat/p-a5faa465.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-a83932d4.js +2 -0
- package/dist/isometrik-webchat/p-a83932d4.js.map +1 -0
- package/dist/isometrik-webchat/p-b0f6f9ab.entry.js +2 -0
- package/dist/isometrik-webchat/p-b0f6f9ab.entry.js.map +1 -0
- package/dist/isometrik-webchat/{p-3664e0ad.entry.js → p-b431d864.entry.js} +2 -2
- package/dist/isometrik-webchat/{p-0ccfbe90.entry.js → p-b516938b.entry.js} +2 -2
- package/dist/isometrik-webchat/p-be09cdc8.js +2 -0
- package/dist/isometrik-webchat/p-be09cdc8.js.map +1 -0
- package/dist/isometrik-webchat/{p-5b965e04.js → p-c4b7babb.js} +2 -2
- package/dist/isometrik-webchat/{p-5b965e04.js.map → p-c4b7babb.js.map} +1 -1
- package/dist/isometrik-webchat/p-d0f6679d.entry.js +2 -0
- package/dist/isometrik-webchat/p-d0f6679d.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-d44c612a.entry.js +2 -0
- package/dist/isometrik-webchat/p-dc963574.entry.js +2 -0
- package/dist/isometrik-webchat/{p-5d1877d1.entry.js.map → p-dc963574.entry.js.map} +1 -1
- package/dist/isometrik-webchat/p-eb1f3118.entry.js +2 -0
- package/dist/isometrik-webchat/p-f18fa23d.js +2 -0
- package/dist/isometrik-webchat/p-f18fa23d.js.map +1 -0
- package/dist/isometrik-webchat/{p-08ba6153.entry.js → p-f5502a63.entry.js} +2 -2
- package/dist/types/components/ChatUIComponent/ChatOwnProfile/Profile.d.ts +2 -0
- package/dist/types/components/ChatUIComponent/ChatSidebar/ChatSidebar.d.ts +10 -0
- package/dist/types/components/ChatUIComponent/Footer/ChatFooter.d.ts +3 -0
- package/dist/types/components/ChatUIComponent/Header/WebChatHeader.d.ts +3 -0
- package/dist/types/components/ChatUIComponent/WebChatBody/WebChatBody.d.ts +5 -0
- package/dist/types/components/ChatUIComponent/shared/ForwardMessageList/ForwardMessageList.d.ts +5 -2
- package/dist/types/components/ChatUIComponent/shared/chat-tile/chat-tile.d.ts +4 -1
- package/dist/types/components/ChatUIComponent/shared/contact-info/contact-info.d.ts +8 -22
- package/dist/types/components/ChatUIComponent/shared/image-message/image-message.d.ts +5 -0
- package/dist/types/components/ChatUIComponent/shared/info-panel-media/info-panel-media.d.ts +45 -0
- package/dist/types/components/ChatUIComponent/shared/media-gallery/media-gallery.d.ts +1 -0
- package/dist/types/components/ChatUIComponent/shared/profile-info/profile-info.d.ts +8 -0
- package/dist/types/components/ChatUIComponent/shared/reply-message-container/reply-message-container.d.ts +3 -0
- package/dist/types/components/ChatUIComponent/shared/storage/storage-manager.d.ts +17 -0
- package/dist/types/components/ChatUIComponent/shared/video-message/video-message.d.ts +3 -0
- package/dist/types/components/my-component/web-chat/WebChat.d.ts +22 -0
- package/dist/types/components/my-component/web-chat/WebchatRightSide.d.ts +7 -0
- package/dist/types/components/my-component/web-chat/conversation-ops.d.ts +10 -2
- package/dist/types/components/my-component/web-chat/event-handlers.d.ts +5 -0
- package/dist/types/components/my-component/web-chat/mutations.d.ts +2 -2
- package/dist/types/components.d.ts +133 -2
- package/dist/types/lib/chat/block-status.d.ts +11 -0
- package/dist/types/lib/chat/clipboard-paste.d.ts +16 -0
- package/dist/types/lib/chat/download-media.d.ts +11 -0
- package/dist/types/lib/chat/index.d.ts +6 -2
- package/dist/types/lib/chat/same-name-upload.d.ts +24 -0
- package/dist/types/lib/chat/send-media.d.ts +90 -0
- package/dist/types/lib/chat/storage-quota.d.ts +98 -0
- package/dist/types/lib/custom-ui/public-api.d.ts +1 -1
- package/dist/types/lib/drawer.d.ts +1 -0
- package/dist/types/sdk/headless-api.d.ts +7 -0
- package/dist/types/sdk/index.d.ts +1 -0
- package/dist/types/sdk/webchat-api.d.ts +14 -0
- package/dist/types/store/storage-quota.d.ts +64 -0
- package/docs/MEDIA_STORAGE_QUOTA.md +130 -0
- package/package.json +3 -2
- package/dist/cjs/attachment-preview_22.cjs.entry.js.map +0 -1
- package/dist/cjs/content-ebca062a.js.map +0 -1
- package/dist/cjs/drawer-00a2323a.js.map +0 -1
- package/dist/cjs/group-members-cef1198e.js.map +0 -1
- package/dist/cjs/groupcast-8441b4df.js.map +0 -1
- package/dist/cjs/helpers-154861e9.js.map +0 -1
- package/dist/cjs/link-preview.cjs.entry.js +0 -49
- package/dist/cjs/link-preview.cjs.entry.js.map +0 -1
- package/dist/cjs/local-notification-bdd04d7a.js.map +0 -1
- package/dist/cjs/runtime-controls-cfc8fc31.js.map +0 -1
- package/dist/cjs/send-media-4ee967d4.js.map +0 -1
- package/dist/components/group-members2.js +0 -37
- package/dist/components/group-members2.js.map +0 -1
- package/dist/esm/attachment-preview_22.entry.js.map +0 -1
- package/dist/esm/content-fb138a93.js.map +0 -1
- package/dist/esm/drawer-7de04622.js.map +0 -1
- package/dist/esm/group-members-7909941c.js.map +0 -1
- package/dist/esm/groupcast-5fb19ec3.js.map +0 -1
- package/dist/esm/helpers-f33b895c.js.map +0 -1
- package/dist/esm/link-preview.entry.js +0 -45
- package/dist/esm/link-preview.entry.js.map +0 -1
- package/dist/esm/local-notification-4c1e166d.js.map +0 -1
- package/dist/esm/runtime-controls-ff81e90a.js.map +0 -1
- package/dist/esm/send-media-58e7145b.js.map +0 -1
- package/dist/isometrik-webchat/p-09980c53.entry.js +0 -2
- package/dist/isometrik-webchat/p-09980c53.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-1eecc7c5.entry.js +0 -2
- package/dist/isometrik-webchat/p-1eecc7c5.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-2cf296e6.entry.js +0 -2
- package/dist/isometrik-webchat/p-2e9974e1.entry.js +0 -2
- package/dist/isometrik-webchat/p-343f50b4.js +0 -7
- package/dist/isometrik-webchat/p-343f50b4.js.map +0 -1
- package/dist/isometrik-webchat/p-352b589e.entry.js +0 -2
- package/dist/isometrik-webchat/p-44da28d3.entry.js +0 -2
- package/dist/isometrik-webchat/p-44da28d3.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-48ce4dca.entry.js +0 -2
- package/dist/isometrik-webchat/p-52a575c0.entry.js +0 -2
- package/dist/isometrik-webchat/p-52a575c0.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-5cfb953d.js +0 -2
- package/dist/isometrik-webchat/p-5cfb953d.js.map +0 -1
- package/dist/isometrik-webchat/p-5d1877d1.entry.js +0 -2
- package/dist/isometrik-webchat/p-6f5037b2.js +0 -2
- package/dist/isometrik-webchat/p-6f5037b2.js.map +0 -1
- package/dist/isometrik-webchat/p-78fb47c4.js +0 -2
- package/dist/isometrik-webchat/p-78fb47c4.js.map +0 -1
- package/dist/isometrik-webchat/p-9982fa21.js.map +0 -1
- package/dist/isometrik-webchat/p-a9efcf1c.entry.js +0 -2
- package/dist/isometrik-webchat/p-a9efcf1c.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-ad02a8ca.entry.js +0 -2
- package/dist/isometrik-webchat/p-b0baa9ad.entry.js +0 -2
- package/dist/isometrik-webchat/p-b0baa9ad.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-b385ac4b.js +0 -2
- package/dist/isometrik-webchat/p-b385ac4b.js.map +0 -1
- package/dist/isometrik-webchat/p-c83e2d5d.entry.js +0 -2
- package/dist/isometrik-webchat/p-d758e431.js +0 -2
- package/dist/isometrik-webchat/p-d864bb9f.entry.js +0 -2
- package/dist/isometrik-webchat/p-d864bb9f.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-dab06d54.js +0 -2
- package/dist/isometrik-webchat/p-dab06d54.js.map +0 -1
- package/dist/isometrik-webchat/p-e40e8866.js +0 -2
- package/dist/isometrik-webchat/p-e40e8866.js.map +0 -1
- package/dist/isometrik-webchat/p-e48a1217.entry.js +0 -2
- /package/dist/isometrik-webchat/{p-d892b4d4.entry.js.map → p-02db2116.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-c591fa45.js.map → p-04fdbd0a.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-c5bff6a1.entry.js.map → p-119fc683.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-925decda.js.map → p-1dc52239.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-7b25f234.entry.js.map → p-35f2b9ae.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-3b3dc33e.js.map → p-46be73c5.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-2cf296e6.entry.js.map → p-56521ea4.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-f7d05551.entry.js.map → p-57f97cef.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-ad02a8ca.entry.js.map → p-5f7eebbf.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-c83e2d5d.entry.js.map → p-640e2c03.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-d758e431.js.map → p-6c5eb178.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-d8b65cf4.entry.js.map → p-6eadaa6c.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-161fcb35.entry.js.map → p-7130f547.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-cbb1179b.entry.js.map → p-89a8fc58.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-e48a1217.entry.js.map → p-9b70e93f.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-3664e0ad.entry.js.map → p-b431d864.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-0ccfbe90.entry.js.map → p-b516938b.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-48ce4dca.entry.js.map → p-d44c612a.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-2e9974e1.entry.js.map → p-eb1f3118.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-08ba6153.entry.js.map → p-f5502a63.entry.js.map} +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
function t(t){if(t.__esModule)return t;var e=Object.defineProperty({},"__esModule",{value:true});Object.keys(t).forEach((function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,i.get?i:{enumerable:true,get:function(){return t[r]}})}));return e}function e(t,e){return e=e||{},new Promise((function(r,i){var n=new XMLHttpRequest,s=[],o=[],u={},a=function(){return{ok:2==(n.status/100|0),statusText:n.statusText,status:n.status,url:n.responseURL,text:function(){return Promise.resolve(n.responseText)},json:function(){return Promise.resolve(n.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([n.response]))},clone:a,headers:{keys:function(){return s},entries:function(){return o},get:function(t){return u[t.toLowerCase()]},has:function(t){return t.toLowerCase()in u}}}};for(var h in n.open(e.method||"get",t,!0),n.onload=function(){n.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(t,e,r){s.push(e=e.toLowerCase()),o.push([e,r]),u[e]=u[e]?u[e]+","+r:r})),r(a())},n.onerror=i,n.withCredentials="include"==e.credentials,e.headers)n.setRequestHeader(h,e.headers[h]);n.send(e.body||null)}))}const r=Object.freeze({__proto__:null,default:e});const i=t(r);var n=self.fetch||(self.fetch=i.default||i);var s=Object.defineProperty;var o=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var h=(t,e)=>()=>(t&&(e=t(t=0)),e);var f=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),l=(t,e)=>{for(var r in e)s(t,r,{get:e[r],enumerable:!0})},c=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of u(e))!a.call(t,n)&&n!==r&&s(t,n,{get:()=>e[n],enumerable:!(i=o(e,n))||i.enumerable});return t};var d=t=>c(s({},"__esModule",{value:!0}),t);var p=h((()=>{}));var b={};l(b,{_debugEnd:()=>bt,_debugProcess:()=>pt,_events:()=>Pt,_eventsCount:()=>Nt,_exiting:()=>X,_fatalExceptions:()=>lt,_getActiveHandles:()=>S,_getActiveRequests:()=>k,_kill:()=>rt,_linkedBinding:()=>_,_maxListeners:()=>Ct,_preload_modules:()=>Rt,_rawDebug:()=>Y,_startProfilerIdleNotifier:()=>vt,_stopProfilerIdleNotifier:()=>wt,_tickCallback:()=>dt,abort:()=>Et,addListener:()=>Bt,allowedNodeEnvironmentFlags:()=>ht,arch:()=>U,argv:()=>L,argv0:()=>Ot,assert:()=>O,binding:()=>G,chdir:()=>K,config:()=>tt,cpuUsage:()=>it,cwd:()=>H,debugPort:()=>St,default:()=>zt,dlopen:()=>A,domain:()=>Z,emit:()=>Lt,emitWarning:()=>W,env:()=>$,execArgv:()=>D,execPath:()=>kt,exit:()=>ut,features:()=>ft,hasUncaughtExceptionCaptureCallback:()=>R,hrtime:()=>j,kill:()=>ot,listeners:()=>M,memoryUsage:()=>st,moduleLoadList:()=>J,nextTick:()=>m,off:()=>Ut,on:()=>I,once:()=>xt,openStdin:()=>at,pid:()=>_t,platform:()=>F,ppid:()=>At,prependListener:()=>Dt,prependOnceListener:()=>qt,reallyExit:()=>et,release:()=>Q,removeAllListeners:()=>$t,removeListener:()=>Ft,resourceUsage:()=>nt,setSourceMapsEnabled:()=>Tt,setUncaughtExceptionCaptureCallback:()=>ct,stderr:()=>mt,stdin:()=>gt,stdout:()=>yt,title:()=>x,umask:()=>V,uptime:()=>T,version:()=>q,versions:()=>z});function v(t){throw new Error("Node.js process "+t+" is not supported by JSPM core outside of Node.js")}function w(){!P||!N||(P=!1,N.length?C=N.concat(C):B=-1,C.length&&y())}function y(){if(!P){var t=setTimeout(w,0);P=!0;for(var e=C.length;e;){for(N=C,C=[];++B<e;)N&&N[B].run();B=-1,e=C.length}N=null,P=!1,clearTimeout(t)}}function m(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];C.push(new g(t,e)),C.length===1&&!P&&setTimeout(y,0)}function g(t,e){this.fun=t,this.array=e}function E(){}function _(t){v("_linkedBinding")}function A(t){v("dlopen")}function k(){return[]}function S(){return[]}function O(t,e){if(!t)throw new Error(e||"assertion error")}function R(){return!1}function T(){return jt.now()/1e3}function j(t){var e=Math.floor((Date.now()-jt.now())*.001),r=jt.now()*.001,i=Math.floor(r)+e,n=Math.floor(r%1*1e9);return t&&(i=i-t[0],n=n-t[1],n<0&&(i--,n+=Mt)),[i,n]}function I(){return zt}function M(t){return[]}var C,P,N,B,x,U,F,$,L,D,q,z,W,G,V,H,K,Q,Y,J,Z,X,tt,et,rt,it,nt,st,ot,ut,at,ht,ft,lt,ct,dt,pt,bt,vt,wt,yt,mt,gt,Et,_t,At,kt,St,Ot,Rt,Tt,jt,It,Mt,Ct,Pt,Nt,Bt,xt,Ut,Ft,$t,Lt,Dt,qt,zt,Wt=h((()=>{p();ue();Gt();C=[],P=!1,B=-1;g.prototype.run=function(){this.fun.apply(null,this.array)};x="browser",U="x64",F="browser",$={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},L=["/usr/bin/node"],D=[],q="v16.8.0",z={},W=function(t,e){console.warn((e?e+": ":"")+t)},G=function(t){v("binding")},V=function(t){return 0},H=function(){return"/"},K=function(t){},Q={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};Y=E,J=[];Z={},X=!1,tt={};et=E,rt=E,it=function(){return{}},nt=it,st=it,ot=E,ut=E,at=E,ht={};ft={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},lt=E,ct=E;dt=E,pt=E,bt=E,vt=E,wt=E,yt=void 0,mt=void 0,gt=void 0,Et=E,_t=2,At=1,kt="/bin/usr/node",St=9229,Ot="node",Rt=[],Tt=E,jt={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};jt.now===void 0&&(It=Date.now(),jt.timing&&jt.timing.navigationStart&&(It=jt.timing.navigationStart),jt.now=()=>Date.now()-It);Mt=1e9;j.bigint=function(t){var e=j(t);return typeof BigInt>"u"?e[0]*Mt+e[1]:BigInt(e[0]*Mt)+BigInt(e[1])};Ct=10,Pt={},Nt=0;Bt=I,xt=I,Ut=I,Ft=I,$t=I,Lt=E,Dt=I,qt=I;zt={version:q,versions:z,arch:U,platform:F,release:Q,_rawDebug:Y,moduleLoadList:J,binding:G,_linkedBinding:_,_events:Pt,_eventsCount:Nt,_maxListeners:Ct,on:I,addListener:Bt,once:xt,off:Ut,removeListener:Ft,removeAllListeners:$t,emit:Lt,prependListener:Dt,prependOnceListener:qt,listeners:M,domain:Z,_exiting:X,config:tt,dlopen:A,uptime:T,_getActiveRequests:k,_getActiveHandles:S,reallyExit:et,_kill:rt,cpuUsage:it,resourceUsage:nt,memoryUsage:st,kill:ot,exit:ut,openStdin:at,allowedNodeEnvironmentFlags:ht,assert:O,features:ft,_fatalExceptions:lt,setUncaughtExceptionCaptureCallback:ct,hasUncaughtExceptionCaptureCallback:R,emitWarning:W,nextTick:m,_tickCallback:dt,_debugProcess:pt,_debugEnd:bt,_startProfilerIdleNotifier:vt,_stopProfilerIdleNotifier:wt,stdout:yt,stdin:gt,stderr:mt,abort:Et,umask:V,chdir:K,cwd:H,env:$,title:x,argv:L,execArgv:D,pid:_t,ppid:At,execPath:kt,debugPort:St,hrtime:j,argv0:Ot,_preload_modules:Rt,setSourceMapsEnabled:Tt}}));var Gt=h((()=>{Wt()}));var Vt={};l(Vt,{Buffer:()=>ie,INSPECT_MAX_BYTES:()=>ne,default:()=>re,kMaxLength:()=>se});function Ht(){if(Jt)return Yt;Jt=!0,Yt.byteLength=u,Yt.toByteArray=h,Yt.fromByteArray=c;for(var t=[],e=[],r=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,s=i.length;n<s;++n)t[n]=i[n],e[i.charCodeAt(n)]=n;e["-".charCodeAt(0)]=62,e["_".charCodeAt(0)]=63;function o(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var i=r===e?0:4-r%4;return[r,i]}function u(t){var e=o(t),r=e[0],i=e[1];return(r+i)*3/4-i}function a(t,e,r){return(e+r)*3/4-r}function h(t){var i,n=o(t),s=n[0],u=n[1],h=new r(a(t,s,u)),f=0,l=u>0?s-4:s,c;for(c=0;c<l;c+=4)i=e[t.charCodeAt(c)]<<18|e[t.charCodeAt(c+1)]<<12|e[t.charCodeAt(c+2)]<<6|e[t.charCodeAt(c+3)],h[f++]=i>>16&255,h[f++]=i>>8&255,h[f++]=i&255;return u===2&&(i=e[t.charCodeAt(c)]<<2|e[t.charCodeAt(c+1)]>>4,h[f++]=i&255),u===1&&(i=e[t.charCodeAt(c)]<<10|e[t.charCodeAt(c+1)]<<4|e[t.charCodeAt(c+2)]>>2,h[f++]=i>>8&255,h[f++]=i&255),h}function f(e){return t[e>>18&63]+t[e>>12&63]+t[e>>6&63]+t[e&63]}function l(t,e,r){for(var i,n=[],s=e;s<r;s+=3)i=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(t[s+2]&255),n.push(f(i));return n.join("")}function c(e){for(var r,i=e.length,n=i%3,s=[],o=16383,u=0,a=i-n;u<a;u+=o)s.push(l(e,u,u+o>a?a:u+o));return n===1?(r=e[i-1],s.push(t[r>>2]+t[r<<4&63]+"==")):n===2&&(r=(e[i-2]<<8)+e[i-1],s.push(t[r>>10]+t[r>>4&63]+t[r<<2&63]+"=")),s.join("")}return Yt}function Kt(){if(Xt)return Zt;Xt=!0;return Zt.read=function(t,e,r,i,n){var s,o,u=n*8-i-1,a=(1<<u)-1,h=a>>1,f=-7,l=r?n-1:0,c=r?-1:1,d=t[e+l];for(l+=c,s=d&(1<<-f)-1,d>>=-f,f+=u;f>0;s=s*256+t[e+l],l+=c,f-=8);for(o=s&(1<<-f)-1,s>>=-f,f+=i;f>0;o=o*256+t[e+l],l+=c,f-=8);if(s===0)s=1-h;else{if(s===a)return o?NaN:(d?-1:1)*(1/0);o=o+Math.pow(2,i),s=s-h}return(d?-1:1)*o*Math.pow(2,s-i)},Zt.write=function(t,e,r,i,n,s){var o,u,a,h=s*8-n-1,f=(1<<h)-1,l=f>>1,c=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:s-1,p=i?1:-1,b=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,o=f):(o=Math.floor(Math.log(e)/Math.LN2),e*(a=Math.pow(2,-o))<1&&(o--,a*=2),o+l>=1?e+=c/a:e+=c*Math.pow(2,1-l),e*a>=2&&(o++,a/=2),o+l>=f?(u=0,o=f):o+l>=1?(u=(e*a-1)*Math.pow(2,n),o=o+l):(u=e*Math.pow(2,l-1)*Math.pow(2,n),o=0));n>=8;t[r+d]=u&255,d+=p,u/=256,n-=8);for(o=o<<n|u,h+=n;h>0;t[r+d]=o&255,d+=p,o/=256,h-=8);t[r+d-p]|=b*128},Zt}function Qt(){if(ee)return te;ee=!0;let t=Ht(),e=Kt(),r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;te.Buffer=o,te.SlowBuffer=w,te.INSPECT_MAX_BYTES=50;let i=2147483647;te.kMaxLength=i,o.TYPED_ARRAY_SUPPORT=n(),!o.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function n(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}});function s(t){if(t>i)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,o.prototype),e}function o(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return f(t)}return u(t,e,r)}o.poolSize=8192;function u(t,e,r){if(typeof t=="string")return l(t,e);if(ArrayBuffer.isView(t))return d(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(it(t,ArrayBuffer)||t&&it(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(it(t,SharedArrayBuffer)||t&&it(t.buffer,SharedArrayBuffer)))return p(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let i=t.valueOf&&t.valueOf();if(i!=null&&i!==t)return o.from(i,e,r);let n=b(t);if(n)return n;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return o.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}o.from=function(t,e,r){return u(t,e,r)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array);function a(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function h(t,e,r){return a(t),t<=0?s(t):e!==void 0?typeof r=="string"?s(t).fill(e,r):s(t).fill(e):s(t)}o.alloc=function(t,e,r){return h(t,e,r)};function f(t){return a(t),s(t<0?0:v(t)|0)}o.allocUnsafe=function(t){return f(t)},o.allocUnsafeSlow=function(t){return f(t)};function l(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!o.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let r=y(t,e)|0,i=s(r),n=i.write(t,e);return n!==r&&(i=i.slice(0,n)),i}function c(t){let e=t.length<0?0:v(t.length)|0,r=s(e);for(let i=0;i<e;i+=1)r[i]=t[i]&255;return r}function d(t){if(it(t,Uint8Array)){let e=new Uint8Array(t);return p(e.buffer,e.byteOffset,e.byteLength)}return c(t)}function p(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let i;return e===void 0&&r===void 0?i=new Uint8Array(t):r===void 0?i=new Uint8Array(t,e):i=new Uint8Array(t,e,r),Object.setPrototypeOf(i,o.prototype),i}function b(t){if(o.isBuffer(t)){let e=v(t.length)|0,r=s(e);return r.length===0||t.copy(r,0,0,e),r}if(t.length!==void 0)return typeof t.length!="number"||nt(t.length)?s(0):c(t);if(t.type==="Buffer"&&Array.isArray(t.data))return c(t.data)}function v(t){if(t>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return t|0}function w(t){return+t!=t&&(t=0),o.alloc(+t)}o.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==o.prototype},o.compare=function(t,e){if(it(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),it(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(t)||!o.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,i=e.length;for(let n=0,s=Math.min(r,i);n<s;++n)if(t[n]!==e[n]){r=t[n],i=e[n];break}return r<i?-1:i<r?1:0},o.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return o.alloc(0);let r;if(e===void 0)for(e=0,r=0;r<t.length;++r)e+=t[r].length;let i=o.allocUnsafe(e),n=0;for(r=0;r<t.length;++r){let e=t[r];if(it(e,Uint8Array))n+e.length>i.length?(o.isBuffer(e)||(e=o.from(e)),e.copy(i,n)):Uint8Array.prototype.set.call(i,e,n);else if(o.isBuffer(e))e.copy(i,n);else throw new TypeError('"list" argument must be an Array of Buffers');n+=e.length}return i};function y(t,e){if(o.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||it(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let r=t.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&r===0)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return et(t).length;default:if(n)return i?-1:Z(t).length;e=(""+e).toLowerCase(),n=!0}}o.byteLength=y;function m(t,e,r){let i=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return N(this,e,r);case"utf8":case"utf-8":return j(this,e,r);case"ascii":return C(this,e,r);case"latin1":case"binary":return P(this,e,r);case"base64":return T(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}o.prototype._isBuffer=!0;function g(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}o.prototype.swap16=function(){let t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)g(this,e,e+1);return this},o.prototype.swap32=function(){let t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},o.prototype.swap64=function(){let t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},o.prototype.toString=function(){let t=this.length;return t===0?"":arguments.length===0?j(this,0,t):m.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(t){if(!o.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:o.compare(this,t)===0},o.prototype.inspect=function(){let t="",e=te.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),"<Buffer "+t+">"},r&&(o.prototype[r]=o.prototype.inspect),o.prototype.compare=function(t,e,r,i,n){if(it(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(e===void 0&&(e=0),r===void 0&&(r=t?t.length:0),i===void 0&&(i=0),n===void 0&&(n=this.length),e<0||r>t.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&e>=r)return 0;if(i>=n)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,i>>>=0,n>>>=0,this===t)return 0;let s=n-i,u=r-e,a=Math.min(s,u),h=this.slice(i,n),f=t.slice(e,r);for(let t=0;t<a;++t)if(h[t]!==f[t]){s=h[t],u=f[t];break}return s<u?-1:u<s?1:0};function E(t,e,r,i,n){if(t.length===0)return-1;if(typeof r=="string"?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,nt(r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0)if(n)r=0;else return-1;if(typeof e=="string"&&(e=o.from(e,i)),o.isBuffer(e))return e.length===0?-1:_(t,e,r,i,n);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):_(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function _(t,e,r,i,n){let s=1,o=t.length,u=e.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(t.length<2||e.length<2)return-1;s=2,o/=2,u/=2,r/=2}function a(t,e){return s===1?t[e]:t.readUInt16BE(e*s)}let h;if(n){let i=-1;for(h=r;h<o;h++)if(a(t,h)===a(e,i===-1?0:h-i)){if(i===-1&&(i=h),h-i+1===u)return i*s}else i!==-1&&(h-=h-i),i=-1}else for(r+u>o&&(r=o-u),h=r;h>=0;h--){let r=!0;for(let i=0;i<u;i++)if(a(t,h+i)!==a(e,i)){r=!1;break}if(r)return h}return-1}o.prototype.includes=function(t,e,r){return this.indexOf(t,e,r)!==-1},o.prototype.indexOf=function(t,e,r){return E(this,t,e,r,!0)},o.prototype.lastIndexOf=function(t,e,r){return E(this,t,e,r,!1)};function A(t,e,r,i){r=Number(r)||0;let n=t.length-r;i?(i=Number(i),i>n&&(i=n)):i=n;let s=e.length;i>s/2&&(i=s/2);let o;for(o=0;o<i;++o){let i=parseInt(e.substr(o*2,2),16);if(nt(i))return o;t[r+o]=i}return o}function k(t,e,r,i){return rt(Z(e,t.length-r),t,r,i)}function S(t,e,r,i){return rt(X(e),t,r,i)}function O(t,e,r,i){return rt(et(e),t,r,i)}function R(t,e,r,i){return rt(tt(e,t.length-r),t,r,i)}o.prototype.write=function(t,e,r,i){if(e===void 0)i="utf8",r=this.length,e=0;else if(r===void 0&&typeof e=="string")i=e,r=this.length,e=0;else if(isFinite(e))e=e>>>0,isFinite(r)?(r=r>>>0,i===void 0&&(i="utf8")):(i=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let n=this.length-e;if((r===void 0||r>n)&&(r=n),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let s=!1;for(;;)switch(i){case"hex":return A(this,t,e,r);case"utf8":case"utf-8":return k(this,t,e,r);case"ascii":case"latin1":case"binary":return S(this,t,e,r);case"base64":return O(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,e,r);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(e,r,i){return r===0&&i===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(r,i))}function j(t,e,r){r=Math.min(t.length,r);let i=[],n=e;for(;n<r;){let e=t[n],s=null,o=e>239?4:e>223?3:e>191?2:1;if(n+o<=r){let r,i,u,a;switch(o){case 1:e<128&&(s=e);break;case 2:r=t[n+1],(r&192)===128&&(a=(e&31)<<6|r&63,a>127&&(s=a));break;case 3:r=t[n+1],i=t[n+2],(r&192)===128&&(i&192)===128&&(a=(e&15)<<12|(r&63)<<6|i&63,a>2047&&(a<55296||a>57343)&&(s=a));break;case 4:r=t[n+1],i=t[n+2],u=t[n+3],(r&192)===128&&(i&192)===128&&(u&192)===128&&(a=(e&15)<<18|(r&63)<<12|(i&63)<<6|u&63,a>65535&&a<1114112&&(s=a))}}s===null?(s=65533,o=1):s>65535&&(s-=65536,i.push(s>>>10&1023|55296),s=56320|s&1023),i.push(s),n+=o}return M(i)}let I=4096;function M(t){let e=t.length;if(e<=I)return String.fromCharCode.apply(String,t);let r="",i=0;for(;i<e;)r+=String.fromCharCode.apply(String,t.slice(i,i+=I));return r}function C(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;n<r;++n)i+=String.fromCharCode(t[n]&127);return i}function P(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;n<r;++n)i+=String.fromCharCode(t[n]);return i}function N(t,e,r){let i=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>i)&&(r=i);let n="";for(let i=e;i<r;++i)n+=st[t[i]];return n}function B(t,e,r){let i=t.slice(e,r),n="";for(let t=0;t<i.length-1;t+=2)n+=String.fromCharCode(i[t]+i[t+1]*256);return n}o.prototype.slice=function(t,e){let r=this.length;t=~~t,e=e===void 0?r:~~e,t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),e<t&&(e=t);let i=this.subarray(t,e);return Object.setPrototypeOf(i,o.prototype),i};function x(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(t,e,r){t=t>>>0,e=e>>>0,r||x(t,e,this.length);let i=this[t],n=1,s=0;for(;++s<e&&(n*=256);)i+=this[t+s]*n;return i},o.prototype.readUintBE=o.prototype.readUIntBE=function(t,e,r){t=t>>>0,e=e>>>0,r||x(t,e,this.length);let i=this[t+--e],n=1;for(;e>0&&(n*=256);)i+=this[t+--e]*n;return i},o.prototype.readUint8=o.prototype.readUInt8=function(t,e){return t=t>>>0,e||x(t,1,this.length),this[t]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(t,e){return t=t>>>0,e||x(t,2,this.length),this[t]|this[t+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(t,e){return t=t>>>0,e||x(t,2,this.length),this[t]<<8|this[t+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(t,e){return t=t>>>0,e||x(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(t,e){return t=t>>>0,e||x(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])},o.prototype.readBigUInt64LE=ot((function(t){t=t>>>0,K(t,"offset");let e=this[t],r=this[t+7];(e===void 0||r===void 0)&&Q(t,this.length-8);let i=e+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24,n=this[++t]+this[++t]*2**8+this[++t]*2**16+r*2**24;return BigInt(i)+(BigInt(n)<<BigInt(32))})),o.prototype.readBigUInt64BE=ot((function(t){t=t>>>0,K(t,"offset");let e=this[t],r=this[t+7];(e===void 0||r===void 0)&&Q(t,this.length-8);let i=e*2**24+this[++t]*2**16+this[++t]*2**8+this[++t],n=this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+r;return(BigInt(i)<<BigInt(32))+BigInt(n)})),o.prototype.readIntLE=function(t,e,r){t=t>>>0,e=e>>>0,r||x(t,e,this.length);let i=this[t],n=1,s=0;for(;++s<e&&(n*=256);)i+=this[t+s]*n;return n*=128,i>=n&&(i-=Math.pow(2,8*e)),i},o.prototype.readIntBE=function(t,e,r){t=t>>>0,e=e>>>0,r||x(t,e,this.length);let i=e,n=1,s=this[t+--i];for(;i>0&&(n*=256);)s+=this[t+--i]*n;return n*=128,s>=n&&(s-=Math.pow(2,8*e)),s},o.prototype.readInt8=function(t,e){return t=t>>>0,e||x(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]},o.prototype.readInt16LE=function(t,e){t=t>>>0,e||x(t,2,this.length);let r=this[t]|this[t+1]<<8;return r&32768?r|4294901760:r},o.prototype.readInt16BE=function(t,e){t=t>>>0,e||x(t,2,this.length);let r=this[t+1]|this[t]<<8;return r&32768?r|4294901760:r},o.prototype.readInt32LE=function(t,e){return t=t>>>0,e||x(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},o.prototype.readInt32BE=function(t,e){return t=t>>>0,e||x(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},o.prototype.readBigInt64LE=ot((function(t){t=t>>>0,K(t,"offset");let e=this[t],r=this[t+7];(e===void 0||r===void 0)&&Q(t,this.length-8);let i=this[t+4]+this[t+5]*2**8+this[t+6]*2**16+(r<<24);return(BigInt(i)<<BigInt(32))+BigInt(e+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24)})),o.prototype.readBigInt64BE=ot((function(t){t=t>>>0,K(t,"offset");let e=this[t],r=this[t+7];(e===void 0||r===void 0)&&Q(t,this.length-8);let i=(e<<24)+this[++t]*2**16+this[++t]*2**8+this[++t];return(BigInt(i)<<BigInt(32))+BigInt(this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+r)})),o.prototype.readFloatLE=function(t,r){return t=t>>>0,r||x(t,4,this.length),e.read(this,t,!0,23,4)},o.prototype.readFloatBE=function(t,r){return t=t>>>0,r||x(t,4,this.length),e.read(this,t,!1,23,4)},o.prototype.readDoubleLE=function(t,r){return t=t>>>0,r||x(t,8,this.length),e.read(this,t,!0,52,8)},o.prototype.readDoubleBE=function(t,r){return t=t>>>0,r||x(t,8,this.length),e.read(this,t,!1,52,8)};function U(t,e,r,i,n,s){if(!o.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<s)throw new RangeError('"value" argument is out of bounds');if(r+i>t.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(t,e,r,i){if(t=+t,e=e>>>0,r=r>>>0,!i){let i=Math.pow(2,8*r)-1;U(this,t,e,r,i,0)}let n=1,s=0;for(this[e]=t&255;++s<r&&(n*=256);)this[e+s]=t/n&255;return e+r},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(t,e,r,i){if(t=+t,e=e>>>0,r=r>>>0,!i){let i=Math.pow(2,8*r)-1;U(this,t,e,r,i,0)}let n=r-1,s=1;for(this[e+n]=t&255;--n>=0&&(s*=256);)this[e+n]=t/s&255;return e+r},o.prototype.writeUint8=o.prototype.writeUInt8=function(t,e,r){return t=+t,e=e>>>0,r||U(this,t,e,1,255,0),this[e]=t&255,e+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(t,e,r){return t=+t,e=e>>>0,r||U(this,t,e,2,65535,0),this[e]=t&255,this[e+1]=t>>>8,e+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(t,e,r){return t=+t,e=e>>>0,r||U(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=t&255,e+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(t,e,r){return t=+t,e=e>>>0,r||U(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t&255,e+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(t,e,r){return t=+t,e=e>>>0,r||U(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255,e+4};function F(t,e,r,i,n){H(e,i,n,t,r,7);let s=Number(e&BigInt(4294967295));t[r++]=s,s=s>>8,t[r++]=s,s=s>>8,t[r++]=s,s=s>>8,t[r++]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o,r}function $(t,e,r,i,n){H(e,i,n,t,r,7);let s=Number(e&BigInt(4294967295));t[r+7]=s,s=s>>8,t[r+6]=s,s=s>>8,t[r+5]=s,s=s>>8,t[r+4]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=o,o=o>>8,t[r+2]=o,o=o>>8,t[r+1]=o,o=o>>8,t[r]=o,r+8}o.prototype.writeBigUInt64LE=ot((function(t,e=0){return F(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),o.prototype.writeBigUInt64BE=ot((function(t,e=0){return $(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),o.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e=e>>>0,!i){let i=Math.pow(2,8*r-1);U(this,t,e,r,i-1,-i)}let n=0,s=1,o=0;for(this[e]=t&255;++n<r&&(s*=256);)t<0&&o===0&&this[e+n-1]!==0&&(o=1),this[e+n]=(t/s>>0)-o&255;return e+r},o.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e=e>>>0,!i){let i=Math.pow(2,8*r-1);U(this,t,e,r,i-1,-i)}let n=r-1,s=1,o=0;for(this[e+n]=t&255;--n>=0&&(s*=256);)t<0&&o===0&&this[e+n+1]!==0&&(o=1),this[e+n]=(t/s>>0)-o&255;return e+r},o.prototype.writeInt8=function(t,e,r){return t=+t,e=e>>>0,r||U(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=t&255,e+1},o.prototype.writeInt16LE=function(t,e,r){return t=+t,e=e>>>0,r||U(this,t,e,2,32767,-32768),this[e]=t&255,this[e+1]=t>>>8,e+2},o.prototype.writeInt16BE=function(t,e,r){return t=+t,e=e>>>0,r||U(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=t&255,e+2},o.prototype.writeInt32LE=function(t,e,r){return t=+t,e=e>>>0,r||U(this,t,e,4,2147483647,-2147483648),this[e]=t&255,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},o.prototype.writeInt32BE=function(t,e,r){return t=+t,e=e>>>0,r||U(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255,e+4},o.prototype.writeBigInt64LE=ot((function(t,e=0){return F(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),o.prototype.writeBigInt64BE=ot((function(t,e=0){return $(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}));function L(t,e,r,i,n,s){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(t,r,i,n,s){return r=+r,i=i>>>0,s||L(t,r,i,4),e.write(t,r,i,n,23,4),i+4}o.prototype.writeFloatLE=function(t,e,r){return D(this,t,e,!0,r)},o.prototype.writeFloatBE=function(t,e,r){return D(this,t,e,!1,r)};function q(t,r,i,n,s){return r=+r,i=i>>>0,s||L(t,r,i,8),e.write(t,r,i,n,52,8),i+8}o.prototype.writeDoubleLE=function(t,e,r){return q(this,t,e,!0,r)},o.prototype.writeDoubleBE=function(t,e,r){return q(this,t,e,!1,r)},o.prototype.copy=function(t,e,r,i){if(!o.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),!i&&i!==0&&(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<r&&(i=r),i===r||t.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-r&&(i=t.length-e+r);let n=i-r;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(e,r,i):Uint8Array.prototype.set.call(t,this.subarray(r,i),e),n},o.prototype.fill=function(t,e,r,i){if(typeof t=="string"){if(typeof e=="string"?(i=e,e=0,r=this.length):typeof r=="string"&&(i=r,r=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!o.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(t.length===1){let e=t.charCodeAt(0);(i==="utf8"&&e<128||i==="latin1")&&(t=e)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;e=e>>>0,r=r===void 0?this.length:r>>>0,t||(t=0);let n;if(typeof t=="number")for(n=e;n<r;++n)this[n]=t;else{let s=o.isBuffer(t)?t:o.from(t,i),u=s.length;if(u===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(n=0;n<r-e;++n)this[n+e]=s[n%u]}return this};let z={};function W(t,e,r){z[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}W("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),W("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),W("ERR_OUT_OF_RANGE",(function(t,e,r){let i=`The value of "${t}" is out of range.`,n=r;return Number.isInteger(r)&&Math.abs(r)>2**32?n=G(String(r)):typeof r=="bigint"&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=G(n)),n+="n"),i+=` It must be ${e}. Received ${n}`,i}),RangeError);function G(t){let e="",r=t.length,i=t[0]==="-"?1:0;for(;r>=i+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function V(t,e,r){K(e,"offset"),(t[e]===void 0||t[e+r]===void 0)&&Q(e,t.length-(r+1))}function H(t,e,r,i,n,s){if(t>r||t<e){let i=typeof e=="bigint"?"n":"",n;throw s>3?e===0||e===BigInt(0)?n=`>= 0${i} and < 2${i} ** ${(s+1)*8}${i}`:n=`>= -(2${i} ** ${(s+1)*8-1}${i}) and < 2 ** ${(s+1)*8-1}${i}`:n=`>= ${e}${i} and <= ${r}${i}`,new z.ERR_OUT_OF_RANGE("value",n,t)}V(i,n,s)}function K(t,e){if(typeof t!="number")throw new z.ERR_INVALID_ARG_TYPE(e,"number",t)}function Q(t,e,r){throw Math.floor(t)!==t?(K(t,r),new z.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new z.ERR_BUFFER_OUT_OF_BOUNDS:new z.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}let Y=/[^+/0-9A-Za-z-_]/g;function J(t){if(t=t.split("=")[0],t=t.trim().replace(Y,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Z(t,e){e=e||1/0;let r,i=t.length,n=null,s=[];for(let o=0;o<i;++o){if(r=t.charCodeAt(o),r>55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(o+1===i){(e-=3)>-1&&s.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),n=r;continue}r=(n-55296<<10|r-56320)+65536}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return s}function X(t){let e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function tt(t,e){let r,i,n,s=[];for(let o=0;o<t.length&&!((e-=2)<0);++o)r=t.charCodeAt(o),i=r>>8,n=r%256,s.push(n),s.push(i);return s}function et(e){return t.toByteArray(J(e))}function rt(t,e,r,i){let n;for(n=0;n<i&&!(n+r>=e.length||n>=t.length);++n)e[n+r]=t[n];return n}function it(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function nt(t){return t!==t}let st=function(){let t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){let i=r*16;for(let n=0;n<16;++n)e[i+n]=t[r]+t[n]}return e}();function ot(t){return typeof BigInt>"u"?ut:t}function ut(){throw new Error("BigInt not supported")}return te}var Yt,Jt,Zt,Xt,te,ee,re,ie,ne,se,oe=h((()=>{p();ue();Gt();Yt={},Jt=!1;Zt={},Xt=!1;te={},ee=!1;re=Qt();ie=re.Buffer,ne=re.INSPECT_MAX_BYTES,se=re.kMaxLength}));var ue=h((()=>{oe()}));var ae=f((t=>{p();ue();Gt();Object.defineProperty(t,"__esModule",{value:!0});var e=class{constructor(t){this.aliasToTopic={},this.max=t}put(t,e){return e===0||e>this.max?!1:(this.aliasToTopic[e]=t,this.length=Object.keys(this.aliasToTopic).length,!0)}getTopicByAlias(t){return this.aliasToTopic[t]}clear(){this.aliasToTopic={}}};t.default=e}));var he=f(((t,e)=>{p();ue();Gt();e.exports={ArrayIsArray(t){return Array.isArray(t)},ArrayPrototypeIncludes(t,e){return t.includes(e)},ArrayPrototypeIndexOf(t,e){return t.indexOf(e)},ArrayPrototypeJoin(t,e){return t.join(e)},ArrayPrototypeMap(t,e){return t.map(e)},ArrayPrototypePop(t,e){return t.pop(e)},ArrayPrototypePush(t,e){return t.push(e)},ArrayPrototypeSlice(t,e,r){return t.slice(e,r)},Error,FunctionPrototypeCall(t,e,...r){return t.call(e,...r)},FunctionPrototypeSymbolHasInstance(t,e){return Function.prototype[Symbol.hasInstance].call(t,e)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(t,e){return Object.defineProperties(t,e)},ObjectDefineProperty(t,e,r){return Object.defineProperty(t,e,r)},ObjectGetOwnPropertyDescriptor(t,e){return Object.getOwnPropertyDescriptor(t,e)},ObjectKeys(t){return Object.keys(t)},ObjectSetPrototypeOf(t,e){return Object.setPrototypeOf(t,e)},Promise,PromisePrototypeCatch(t,e){return t.catch(e)},PromisePrototypeThen(t,e,r){return t.then(e,r)},PromiseReject(t){return Promise.reject(t)},ReflectApply:Reflect.apply,RegExpPrototypeTest(t,e){return t.test(e)},SafeSet:Set,String,StringPrototypeSlice(t,e,r){return t.slice(e,r)},StringPrototypeToLowerCase(t){return t.toLowerCase()},StringPrototypeToUpperCase(t){return t.toUpperCase()},StringPrototypeTrim(t){return t.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,TypedArrayPrototypeSet(t,e,r){return t.set(e,r)},Uint8Array}}));var fe=f(((t,e)=>{p();ue();Gt();var r=(oe(),d(Vt)),i=Object.getPrototypeOf((async function(){})).constructor,n=globalThis.Blob||r.Blob,s=typeof n<"u"?function(t){return t instanceof n}:function(t){return!1},o=class extends Error{constructor(t){if(!Array.isArray(t))throw new TypeError(`Expected input to be an Array, got ${typeof t}`);let e="";for(let r=0;r<t.length;r++)e+=` ${t[r].stack}\n`;super(e),this.name="AggregateError",this.errors=t}};e.exports={AggregateError:o,kEmptyObject:Object.freeze({}),once(t){let e=!1;return function(...r){e||(e=!0,t.apply(this,r))}},createDeferredPromise:function(){let t,e;return{promise:new Promise(((r,i)=>{t=r,e=i})),resolve:t,reject:e}},promisify(t){return new Promise(((e,r)=>{t(((t,...i)=>t?r(t):e(...i)))}))},debuglog(){return function(){}},format(t,...e){return t.replace(/%([sdifj])/g,(function(...[t,r]){let i=e.shift();return r==="f"?i.toFixed(6):r==="j"?JSON.stringify(i):r==="s"&&typeof i=="object"?`${i.constructor!==Object?i.constructor.name:""} {}`.trim():i.toString()}))},inspect(t){switch(typeof t){case"string":if(t.includes("'"))if(t.includes('"')){if(!t.includes("`")&&!t.includes("${"))return`\`${t}\``}else return`"${t}"`;return`'${t}'`;case"number":return isNaN(t)?"NaN":Object.is(t,-0)?String(t):t;case"bigint":return`${String(t)}n`;case"boolean":case"undefined":return String(t);case"object":return"{}"}},types:{isAsyncFunction(t){return t instanceof i},isArrayBufferView(t){return ArrayBuffer.isView(t)}},isBlob:s};e.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")}));var le=f(((t,e)=>{p();ue();Gt();var{AbortController:r,AbortSignal:i}=typeof self<"u"?self:typeof window<"u"?window:void 0;e.exports=r;e.exports.AbortSignal=i;e.exports.default=r}));var ce=f(((t,e)=>{p();ue();Gt();var{format:r,inspect:i,AggregateError:n}=fe(),s=globalThis.AggregateError||n,o=Symbol("kIsNodeError"),u=["string","function","number","object","Function","Object","boolean","bigint","symbol"],a=/^([A-Z][a-z0-9]*)+$/,h="__node_internal_",f={};function l(t,e){if(!t)throw new f.ERR_INTERNAL_ASSERTION(e)}function c(t){let e="",r=t.length,i=t[0]==="-"?1:0;for(;r>=i+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function d(t,e,i){if(typeof e=="function")return l(e.length<=i.length,`Code: ${t}; The provided arguments length (${i.length}) does not match the required ones (${e.length}).`),e(...i);let n=(e.match(/%[dfijoOs]/g)||[]).length;return l(n===i.length,`Code: ${t}; The provided arguments length (${i.length}) does not match the required ones (${n}).`),i.length===0?e:r(e,...i)}function b(t,e,r){r||(r=Error);class i extends r{constructor(...r){super(d(t,e,r))}toString(){return`${this.name} [${t}]: ${this.message}`}}Object.defineProperties(i.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${t}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),i.prototype.code=t,i.prototype[o]=!0,f[t]=i}function v(t){let e=h+t.name;return Object.defineProperty(t,"name",{value:e}),t}function w(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;let r=new s([e,t],e.message);return r.code=e.code,r}return t||e}var y=class extends Error{constructor(t="The operation was aborted",e=void 0){if(e!==void 0&&typeof e!="object")throw new f.ERR_INVALID_ARG_TYPE("options","Object",e);super(t,e),this.code="ABORT_ERR",this.name="AbortError"}};b("ERR_ASSERTION","%s",Error);b("ERR_INVALID_ARG_TYPE",((t,e,r)=>{l(typeof t=="string","'name' must be a string"),Array.isArray(e)||(e=[e]);let n="The ";t.endsWith(" argument")?n+=`${t} `:n+=`"${t}" ${t.includes(".")?"property":"argument"} `,n+="must be ";let s=[],o=[],h=[];for(let t of e)l(typeof t=="string","All expected entries have to be of type string"),u.includes(t)?s.push(t.toLowerCase()):a.test(t)?o.push(t):(l(t!=="object",'The value "object" should be written as "Object"'),h.push(t));if(o.length>0){let t=s.indexOf("object");t!==-1&&(s.splice(s,t,1),o.push("Object"))}if(s.length>0){switch(s.length){case 1:n+=`of type ${s[0]}`;break;case 2:n+=`one of type ${s[0]} or ${s[1]}`;break;default:{let t=s.pop();n+=`one of type ${s.join(", ")}, or ${t}`}}(o.length>0||h.length>0)&&(n+=" or ")}if(o.length>0){switch(o.length){case 1:n+=`an instance of ${o[0]}`;break;case 2:n+=`an instance of ${o[0]} or ${o[1]}`;break;default:{let t=o.pop();n+=`an instance of ${o.join(", ")}, or ${t}`}}h.length>0&&(n+=" or ")}switch(h.length){case 0:break;case 1:h[0].toLowerCase()!==h[0]&&(n+="an "),n+=`${h[0]}`;break;case 2:n+=`one of ${h[0]} or ${h[1]}`;break;default:{let t=h.pop();n+=`one of ${h.join(", ")}, or ${t}`}}if(r==null)n+=`. Received ${r}`;else if(typeof r=="function"&&r.name)n+=`. Received function ${r.name}`;else if(typeof r=="object"){var f;if((f=r.constructor)!==null&&f!==void 0&&f.name)n+=`. Received an instance of ${r.constructor.name}`;else{let t=i(r,{depth:-1});n+=`. Received ${t}`}}else{let t=i(r,{colors:!1});t.length>25&&(t=`${t.slice(0,25)}...`),n+=`. Received type ${typeof r} (${t})`}return n}),TypeError);b("ERR_INVALID_ARG_VALUE",((t,e,r="is invalid")=>{let n=i(e);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${t.includes(".")?"property":"argument"} '${t}' ${r}. Received ${n}`}),TypeError);b("ERR_INVALID_RETURN_VALUE",((t,e,r)=>{var i;let n=r!=null&&(i=r.constructor)!==null&&i!==void 0&&i.name?`instance of ${r.constructor.name}`:`type ${typeof r}`;return`Expected ${t} to be returned from the "${e}" function but got ${n}.`}),TypeError);b("ERR_MISSING_ARGS",((...t)=>{l(t.length>0,"At least one arg needs to be specified");let e,r=t.length;switch(t=(Array.isArray(t)?t:[t]).map((t=>`"${t}"`)).join(" or "),r){case 1:e+=`The ${t[0]} argument`;break;case 2:e+=`The ${t[0]} and ${t[1]} arguments`;break;default:{let r=t.pop();e+=`The ${t.join(", ")}, and ${r} arguments`}break}return`${e} must be specified`}),TypeError);b("ERR_OUT_OF_RANGE",((t,e,r)=>{l(e,'Missing "range" argument');let n;return Number.isInteger(r)&&Math.abs(r)>2**32?n=c(String(r)):typeof r=="bigint"?(n=String(r),(r>2n**32n||r<-(2n**32n))&&(n=c(n)),n+="n"):n=i(r),`The value of "${t}" is out of range. It must be ${e}. Received ${n}`}),RangeError);b("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);b("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);b("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);b("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);b("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);b("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);b("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);b("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);b("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);b("ERR_STREAM_WRITE_AFTER_END","write after end",Error);b("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);e.exports={AbortError:y,aggregateTwoErrors:v(w),hideStackFrames:v,codes:f}}));var de=f(((t,e)=>{p();ue();Gt();var{ArrayIsArray:r,ArrayPrototypeIncludes:i,ArrayPrototypeJoin:n,ArrayPrototypeMap:s,NumberIsInteger:o,NumberIsNaN:u,NumberMAX_SAFE_INTEGER:a,NumberMIN_SAFE_INTEGER:h,NumberParseInt:f,ObjectPrototypeHasOwnProperty:l,RegExpPrototypeExec:c,String:d,StringPrototypeToUpperCase:b,StringPrototypeTrim:v}=he(),{hideStackFrames:w,codes:{ERR_SOCKET_BAD_PORT:y,ERR_INVALID_ARG_TYPE:m,ERR_INVALID_ARG_VALUE:g,ERR_OUT_OF_RANGE:E,ERR_UNKNOWN_SIGNAL:_}}=ce(),{normalizeEncoding:A}=fe(),{isAsyncFunction:k,isArrayBufferView:S}=fe().types,O={};function R(t){return t===(t|0)}function T(t){return t===t>>>0}var j=/^[0-7]+$/,I="must be a 32-bit unsigned integer or an octal string";function M(t,e,r){if(typeof t>"u"&&(t=r),typeof t=="string"){if(c(j,t)===null)throw new g(e,t,I);t=f(t,8)}return N(t,e),t}var C=w(((t,e,r=h,i=a)=>{if(typeof t!="number")throw new m(e,"number",t);if(!o(t))throw new E(e,"an integer",t);if(t<r||t>i)throw new E(e,`>= ${r} && <= ${i}`,t)})),P=w(((t,e,r=-2147483648,i=2147483647)=>{if(typeof t!="number")throw new m(e,"number",t);if(!o(t))throw new E(e,"an integer",t);if(t<r||t>i)throw new E(e,`>= ${r} && <= ${i}`,t)})),N=w(((t,e,r=!1)=>{if(typeof t!="number")throw new m(e,"number",t);if(!o(t))throw new E(e,"an integer",t);let i=r?1:0,n=4294967295;if(t<i||t>n)throw new E(e,`>= ${i} && <= ${n}`,t)}));function B(t,e){if(typeof t!="string")throw new m(e,"string",t)}function x(t,e,r=void 0,i){if(typeof t!="number")throw new m(e,"number",t);if(r!=null&&t<r||i!=null&&t>i||(r!=null||i!=null)&&u(t))throw new E(e,`${r!=null?`>= ${r}`:""}${r!=null&&i!=null?" && ":""}${i!=null?`<= ${i}`:""}`,t)}var U=w(((t,e,r)=>{if(!i(r,t)){let i="must be one of: "+n(s(r,(t=>typeof t=="string"?`'${t}'`:d(t))),", ");throw new g(e,t,i)}}));function F(t,e){if(typeof t!="boolean")throw new m(e,"boolean",t)}function $(t,e,r){return t==null||!l(t,e)?r:t[e]}var L=w(((t,e,i=null)=>{let n=$(i,"allowArray",!1),s=$(i,"allowFunction",!1);if(!$(i,"nullable",!1)&&t===null||!n&&r(t)||typeof t!="object"&&(!s||typeof t!="function"))throw new m(e,"Object",t)})),D=w(((t,e)=>{if(t!=null&&typeof t!="object"&&typeof t!="function")throw new m(e,"a dictionary",t)})),q=w(((t,e,i=0)=>{if(!r(t))throw new m(e,"Array",t);if(t.length<i){let r=`must be longer than ${i}`;throw new g(e,t,r)}}));function z(t,e){q(t,e);for(let r=0;r<t.length;r++)B(t[r],`${e}[${r}]`)}function W(t,e){q(t,e);for(let r=0;r<t.length;r++)F(t[r],`${e}[${r}]`)}function G(t,e="signal"){if(B(t,e),O[t]===void 0)throw O[b(t)]!==void 0?new _(t+" (signals must use all capital letters)"):new _(t)}var V=w(((t,e="buffer")=>{if(!S(t))throw new m(e,["Buffer","TypedArray","DataView"],t)}));function H(t,e){let r=A(e),i=t.length;if(r==="hex"&&i%2!==0)throw new g("encoding",e,`is invalid for data of length ${i}`)}function K(t,e="Port",r=!0){if(typeof t!="number"&&typeof t!="string"||typeof t=="string"&&v(t).length===0||+t!==+t>>>0||t>65535||t===0&&!r)throw new y(e,t,r);return t|0}var Q=w(((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new m(e,"AbortSignal",t)})),Y=w(((t,e)=>{if(typeof t!="function")throw new m(e,"Function",t)})),J=w(((t,e)=>{if(typeof t!="function"||k(t))throw new m(e,"Function",t)})),Z=w(((t,e)=>{if(t!==void 0)throw new m(e,"undefined",t)}));function X(t,e,r){if(!i(r,t))throw new m(e,`('${n(r,"|")}')`,t)}var tt=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function et(t,e){if(typeof t>"u"||!c(tt,t))throw new g(e,t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function rt(t){if(typeof t=="string")return et(t,"hints"),t;if(r(t)){let e=t.length,r="";if(e===0)return r;for(let i=0;i<e;i++){let n=t[i];et(n,"hints"),r+=n,i!==e-1&&(r+=", ")}return r}throw new g("hints",t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}e.exports={isInt32:R,isUint32:T,parseFileMode:M,validateArray:q,validateStringArray:z,validateBooleanArray:W,validateBoolean:F,validateBuffer:V,validateDictionary:D,validateEncoding:H,validateFunction:Y,validateInt32:P,validateInteger:C,validateNumber:x,validateObject:L,validateOneOf:U,validatePlainFunction:J,validatePort:K,validateSignalName:G,validateString:B,validateUint32:N,validateUndefined:Z,validateUnion:X,validateAbortSignal:Q,validateLinkHeaderValue:rt}}));var pe=f(((t,e)=>{p();ue();Gt();var r=e.exports={},i,n;function s(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?i=setTimeout:i=s}catch{i=s}try{typeof clearTimeout=="function"?n=clearTimeout:n=o}catch{n=o}})();function u(t){if(i===setTimeout)return setTimeout(t,0);if((i===s||!i)&&setTimeout)return i=setTimeout,setTimeout(t,0);try{return i(t,0)}catch{try{return i.call(null,t,0)}catch{return i.call(this,t,0)}}}function a(t){if(n===clearTimeout)return clearTimeout(t);if((n===o||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{return n(t)}catch{try{return n.call(null,t)}catch{return n.call(this,t)}}}var h=[],f=!1,l,c=-1;function d(){!f||!l||(f=!1,l.length?h=l.concat(h):c=-1,h.length&&b())}function b(){if(!f){var t=u(d);f=!0;for(var e=h.length;e;){for(l=h,h=[];++c<e;)l&&l[c].run();c=-1,e=h.length}l=null,f=!1,a(t)}}r.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];h.push(new v(t,e)),h.length===1&&!f&&u(b)};function v(t,e){this.fun=t,this.array=e}v.prototype.run=function(){this.fun.apply(null,this.array)};r.title="browser";r.browser=!0;r.env={};r.argv=[];r.version="";r.versions={};function w(){}r.on=w;r.addListener=w;r.once=w;r.off=w;r.removeListener=w;r.removeAllListeners=w;r.emit=w;r.prependListener=w;r.prependOnceListener=w;r.listeners=function(t){return[]};r.binding=function(t){throw new Error("process.binding is not supported")};r.cwd=function(){return"/"};r.chdir=function(t){throw new Error("process.chdir is not supported")};r.umask=function(){return 0}}));var be=f(((t,e)=>{p();ue();Gt();var{Symbol:r,SymbolAsyncIterator:i,SymbolIterator:n,SymbolFor:s}=he(),o=r("kDestroyed"),u=r("kIsErrored"),a=r("kIsReadable"),h=r("kIsDisturbed"),f=s("nodejs.webstream.isClosedPromise"),l=s("nodejs.webstream.controllerErrorFunction");function c(t,e=!1){var r;return!!(t&&typeof t.pipe=="function"&&typeof t.on=="function"&&(!e||typeof t.pause=="function"&&typeof t.resume=="function")&&(!t._writableState||((r=t._readableState)===null||r===void 0?void 0:r.readable)!==!1)&&(!t._writableState||t._readableState))}function d(t){var e;return!!(t&&typeof t.write=="function"&&typeof t.on=="function"&&(!t._readableState||((e=t._writableState)===null||e===void 0?void 0:e.writable)!==!1))}function b(t){return!!(t&&typeof t.pipe=="function"&&t._readableState&&typeof t.on=="function"&&typeof t.write=="function")}function v(t){return t&&(t._readableState||t._writableState||typeof t.write=="function"&&typeof t.on=="function"||typeof t.pipe=="function"&&typeof t.on=="function")}function w(t){return!!(t&&!v(t)&&typeof t.pipeThrough=="function"&&typeof t.getReader=="function"&&typeof t.cancel=="function")}function y(t){return!!(t&&!v(t)&&typeof t.getWriter=="function"&&typeof t.abort=="function")}function m(t){return!!(t&&!v(t)&&typeof t.readable=="object"&&typeof t.writable=="object")}function g(t){return w(t)||y(t)||m(t)}function E(t,e){return t==null?!1:e===!0?typeof t[i]=="function":e===!1?typeof t[n]=="function":typeof t[i]=="function"||typeof t[n]=="function"}function _(t){if(!v(t))return null;let e=t._writableState,r=t._readableState,i=e||r;return!!(t.destroyed||t[o]||i!=null&&i.destroyed)}function A(t){if(!d(t))return null;if(t.writableEnded===!0)return!0;let e=t._writableState;return e!=null&&e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}function k(t,e){if(!d(t))return null;if(t.writableFinished===!0)return!0;let r=t._writableState;return r!=null&&r.errored?!1:typeof r?.finished!="boolean"?null:!!(r.finished||e===!1&&r.ended===!0&&r.length===0)}function S(t){if(!c(t))return null;if(t.readableEnded===!0)return!0;let e=t._readableState;return!e||e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}function O(t,e){if(!c(t))return null;let r=t._readableState;return r!=null&&r.errored?!1:typeof r?.endEmitted!="boolean"?null:!!(r.endEmitted||e===!1&&r.ended===!0&&r.length===0)}function R(t){return t&&t[a]!=null?t[a]:typeof t?.readable!="boolean"?null:_(t)?!1:c(t)&&t.readable&&!O(t)}function T(t){return typeof t?.writable!="boolean"?null:_(t)?!1:d(t)&&t.writable&&!A(t)}function j(t,e){return v(t)?_(t)?!0:!(e?.readable!==!1&&R(t)||e?.writable!==!1&&T(t)):null}function I(t){var e,r;return v(t)?t.writableErrored?t.writableErrored:(e=(r=t._writableState)===null||r===void 0?void 0:r.errored)!==null&&e!==void 0?e:null:null}function M(t){var e,r;return v(t)?t.readableErrored?t.readableErrored:(e=(r=t._readableState)===null||r===void 0?void 0:r.errored)!==null&&e!==void 0?e:null:null}function C(t){if(!v(t))return null;if(typeof t.closed=="boolean")return t.closed;let e=t._writableState,r=t._readableState;return typeof e?.closed=="boolean"||typeof r?.closed=="boolean"?e?.closed||r?.closed:typeof t._closed=="boolean"&&P(t)?t._closed:null}function P(t){return typeof t._closed=="boolean"&&typeof t._defaultKeepAlive=="boolean"&&typeof t._removedConnection=="boolean"&&typeof t._removedContLen=="boolean"}function N(t){return typeof t._sent100=="boolean"&&P(t)}function B(t){var e;return typeof t._consuming=="boolean"&&typeof t._dumped=="boolean"&&((e=t.req)===null||e===void 0?void 0:e.upgradeOrConnect)===void 0}function x(t){if(!v(t))return null;let e=t._writableState,r=t._readableState,i=e||r;return!i&&N(t)||!!(i&&i.autoDestroy&&i.emitClose&&i.closed===!1)}function U(t){var e;return!!(t&&((e=t[h])!==null&&e!==void 0?e:t.readableDidRead||t.readableAborted))}function F(t){var e,r,i,n,s,o,a,h,f,l;return!!(t&&((e=(r=(i=(n=(s=(o=t[u])!==null&&o!==void 0?o:t.readableErrored)!==null&&s!==void 0?s:t.writableErrored)!==null&&n!==void 0?n:(a=t._readableState)===null||a===void 0?void 0:a.errorEmitted)!==null&&i!==void 0?i:(h=t._writableState)===null||h===void 0?void 0:h.errorEmitted)!==null&&r!==void 0?r:(f=t._readableState)===null||f===void 0?void 0:f.errored)!==null&&e!==void 0?e:!((l=t._writableState)===null||l===void 0)&&l.errored))}e.exports={kDestroyed:o,isDisturbed:U,kIsDisturbed:h,isErrored:F,kIsErrored:u,isReadable:R,kIsReadable:a,kIsClosedPromise:f,kControllerErrorFunction:l,isClosed:C,isDestroyed:_,isDuplexNodeStream:b,isFinished:j,isIterable:E,isReadableNodeStream:c,isReadableStream:w,isReadableEnded:S,isReadableFinished:O,isReadableErrored:M,isNodeStream:v,isWebStream:g,isWritable:T,isWritableNodeStream:d,isWritableStream:y,isWritableEnded:A,isWritableFinished:k,isWritableErrored:I,isServerRequest:B,isServerResponse:N,willEmitClose:x,isTransformStream:m}}));var ve=f(((t,e)=>{p();ue();Gt();var r=pe(),{AbortError:i,codes:n}=ce(),{ERR_INVALID_ARG_TYPE:s,ERR_STREAM_PREMATURE_CLOSE:o}=n,{kEmptyObject:u,once:a}=fe(),{validateAbortSignal:h,validateFunction:f,validateObject:l,validateBoolean:c}=de(),{Promise:d,PromisePrototypeThen:b}=he(),{isClosed:v,isReadable:w,isReadableNodeStream:y,isReadableStream:m,isReadableFinished:g,isReadableErrored:E,isWritable:_,isWritableNodeStream:A,isWritableStream:k,isWritableFinished:S,isWritableErrored:O,isNodeStream:R,willEmitClose:T,kIsClosedPromise:j}=be();function I(t){return t.setHeader&&typeof t.abort=="function"}var M=()=>{};function C(t,e,n){var c,d;if(arguments.length===2?(n=e,e=u):e==null?e=u:l(e,"options"),f(n,"callback"),h(e.signal,"options.signal"),n=a(n),m(t)||k(t))return P(t,e,n);if(!R(t))throw new s("stream",["ReadableStream","WritableStream","Stream"],t);let p=(c=e.readable)!==null&&c!==void 0?c:y(t),b=(d=e.writable)!==null&&d!==void 0?d:A(t),j=t._writableState,C=t._readableState,N=()=>{t.writable||U()},B=T(t)&&y(t)===p&&A(t)===b,x=S(t,!1),U=()=>{x=!0,t.destroyed&&(B=!1),!(B&&(!t.readable||p))&&(!p||F)&&n.call(t)},F=g(t,!1),$=()=>{F=!0,t.destroyed&&(B=!1),!(B&&(!t.writable||b))&&(!b||x)&&n.call(t)},L=e=>{n.call(t,e)},D=v(t),q=()=>{D=!0;let e=O(t)||E(t);if(e&&typeof e!="boolean")return n.call(t,e);if(p&&!F&&y(t,!0)&&!g(t,!1))return n.call(t,new o);if(b&&!x&&!S(t,!1))return n.call(t,new o);n.call(t)},z=()=>{D=!0;let e=O(t)||E(t);if(e&&typeof e!="boolean")return n.call(t,e);n.call(t)},W=()=>{t.req.on("finish",U)};I(t)?(t.on("complete",U),B||t.on("abort",q),t.req?W():t.on("request",W)):b&&!j&&(t.on("end",N),t.on("close",N)),!B&&typeof t.aborted=="boolean"&&t.on("aborted",q),t.on("end",$),t.on("finish",U),e.error!==!1&&t.on("error",L),t.on("close",q),D?r.nextTick(q):j!=null&&j.errorEmitted||C!=null&&C.errorEmitted?B||r.nextTick(z):(!p&&(!B||w(t))&&(x||_(t)===!1)||!b&&(!B||_(t))&&(F||w(t)===!1)||C&&t.req&&t.aborted)&&r.nextTick(z);let G=()=>{n=M,t.removeListener("aborted",q),t.removeListener("complete",U),t.removeListener("abort",q),t.removeListener("request",W),t.req&&t.req.removeListener("finish",U),t.removeListener("end",N),t.removeListener("close",N),t.removeListener("finish",U),t.removeListener("end",$),t.removeListener("error",L),t.removeListener("close",q)};if(e.signal&&!D){let s=()=>{let r=n;G(),r.call(t,new i(void 0,{cause:e.signal.reason}))};if(e.signal.aborted)r.nextTick(s);else{let r=n;n=a(((...i)=>{e.signal.removeEventListener("abort",s),r.apply(t,i)})),e.signal.addEventListener("abort",s)}}return G}function P(t,e,n){let s=!1,o=M;if(e.signal)if(o=()=>{s=!0,n.call(t,new i(void 0,{cause:e.signal.reason}))},e.signal.aborted)r.nextTick(o);else{let r=n;n=a(((...i)=>{e.signal.removeEventListener("abort",o),r.apply(t,i)})),e.signal.addEventListener("abort",o)}let u=(...e)=>{s||r.nextTick((()=>n.apply(t,e)))};return b(t[j].promise,u,u),M}function N(t,e){var r;let i=!1;return e===null&&(e=u),(r=e)!==null&&r!==void 0&&r.cleanup&&(c(e.cleanup,"cleanup"),i=e.cleanup),new d(((r,n)=>{let s=C(t,e,(t=>{i&&s(),t?n(t):r()}))}))}e.exports=C;e.exports.finished=N}));var we=f(((t,e)=>{p();ue();Gt();var r=pe(),{aggregateTwoErrors:i,codes:{ERR_MULTIPLE_CALLBACK:n},AbortError:s}=ce(),{Symbol:o}=he(),{kDestroyed:u,isDestroyed:a,isFinished:h,isServerRequest:f}=be(),l=o("kDestroy"),c=o("kConstruct");function d(t,e,r){t&&(e&&!e.errored&&(e.errored=t),r&&!r.errored&&(r.errored=t))}function b(t,e){let r=this._readableState,n=this._writableState,s=n||r;return n!=null&&n.destroyed||r!=null&&r.destroyed?(typeof e=="function"&&e(),this):(d(t,n,r),n&&(n.destroyed=!0),r&&(r.destroyed=!0),s.constructed?v(this,t,e):this.once(l,(function(r){v(this,i(r,t),e)})),this)}function v(t,e,i){let n=!1;function s(e){if(n)return;n=!0;let s=t._readableState,o=t._writableState;d(e,o,s),o&&(o.closed=!0),s&&(s.closed=!0),typeof i=="function"&&i(e),e?r.nextTick(w,t,e):r.nextTick(y,t)}try{t._destroy(e||null,s)}catch(t){s(t)}}function w(t,e){m(t,e),y(t)}function y(t){let e=t._readableState,r=t._writableState;r&&(r.closeEmitted=!0),e&&(e.closeEmitted=!0),(r!=null&&r.emitClose||e!=null&&e.emitClose)&&t.emit("close")}function m(t,e){let r=t._readableState,i=t._writableState;i!=null&&i.errorEmitted||r!=null&&r.errorEmitted||(i&&(i.errorEmitted=!0),r&&(r.errorEmitted=!0),t.emit("error",e))}function g(){let t=this._readableState,e=this._writableState;t&&(t.constructed=!0,t.closed=!1,t.closeEmitted=!1,t.destroyed=!1,t.errored=null,t.errorEmitted=!1,t.reading=!1,t.ended=t.readable===!1,t.endEmitted=t.readable===!1),e&&(e.constructed=!0,e.destroyed=!1,e.closed=!1,e.closeEmitted=!1,e.errored=null,e.errorEmitted=!1,e.finalCalled=!1,e.prefinished=!1,e.ended=e.writable===!1,e.ending=e.writable===!1,e.finished=e.writable===!1)}function E(t,e,i){let n=t._readableState,s=t._writableState;if(s!=null&&s.destroyed||n!=null&&n.destroyed)return this;n!=null&&n.autoDestroy||s!=null&&s.autoDestroy?t.destroy(e):e&&(s&&!s.errored&&(s.errored=e),n&&!n.errored&&(n.errored=e),i?r.nextTick(m,t,e):m(t,e))}function _(t,e){if(typeof t._construct!="function")return;let i=t._readableState,n=t._writableState;i&&(i.constructed=!1),n&&(n.constructed=!1),t.once(c,e),!(t.listenerCount(c)>1)&&r.nextTick(A,t)}function A(t){let e=!1;function i(i){if(e){E(t,i??new n);return}e=!0;let s=t._readableState,o=t._writableState,u=o||s;s&&(s.constructed=!0),o&&(o.constructed=!0),u.destroyed?t.emit(l,i):i?E(t,i,!0):r.nextTick(k,t)}try{t._construct((t=>{r.nextTick(i,t)}))}catch(t){r.nextTick(i,t)}}function k(t){t.emit(c)}function S(t){return t?.setHeader&&typeof t.abort=="function"}function O(t){t.emit("close")}function R(t,e){t.emit("error",e),r.nextTick(O,t)}function T(t,e){!t||a(t)||(!e&&!h(t)&&(e=new s),f(t)?(t.socket=null,t.destroy(e)):S(t)?t.abort():S(t.req)?t.req.abort():typeof t.destroy=="function"?t.destroy(e):typeof t.close=="function"?t.close():e?r.nextTick(R,t,e):r.nextTick(O,t),t.destroyed||(t[u]=!0))}e.exports={construct:_,destroyer:T,destroy:b,undestroy:g,errorOrDestroy:E}}));function ye(){ye.init.call(this)}function me(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function ge(t){return t._maxListeners===void 0?ye.defaultMaxListeners:t._maxListeners}function Ee(t,e,r,i){var n,s,o,u;if(me(r),(s=t._events)===void 0?(s=t._events=Object.create(null),t._eventsCount=0):(s.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),s=t._events),o=s[e]),o===void 0)o=s[e]=r,++t._eventsCount;else if(typeof o=="function"?o=s[e]=i?[r,o]:[o,r]:i?o.unshift(r):o.push(r),(n=ge(t))>0&&o.length>n&&!o.warned){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=o.length,u=a,console&&console.warn&&console.warn(u)}return t}function _e(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Ae(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=_e.bind(i);return n.listener=r,i.wrapFn=n,n}function ke(t,e,r){var i=t._events;if(i===void 0)return[];var n=i[e];return n===void 0?[]:typeof n=="function"?r?[n.listener||n]:[n]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(n):Oe(n,n.length)}function Se(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}function Oe(t,e){for(var r=new Array(e),i=0;i<e;++i)r[i]=t[i];return r}var Re,Te,je,Ie,Me,Ce,Pe,Ne=h((()=>{p();ue();Gt();je=typeof Reflect=="object"?Reflect:null,Ie=je&&typeof je.apply=="function"?je.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};Te=je&&typeof je.ownKeys=="function"?je.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};Me=Number.isNaN||function(t){return t!=t};Re=ye,ye.EventEmitter=ye,ye.prototype._events=void 0,ye.prototype._eventsCount=0,ye.prototype._maxListeners=void 0;Ce=10;Object.defineProperty(ye,"defaultMaxListeners",{enumerable:!0,get:function(){return Ce},set:function(t){if(typeof t!="number"||t<0||Me(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Ce=t}}),ye.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},ye.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||Me(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},ye.prototype.getMaxListeners=function(){return ge(this)},ye.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var i=t==="error",n=this._events;if(n!==void 0)i=i&&n.error===void 0;else if(!i)return!1;if(i){var s;if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var o=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw o.context=s,o}var u=n[t];if(u===void 0)return!1;if(typeof u=="function")Ie(u,this,e);else{var a=u.length,h=Oe(u,a);for(r=0;r<a;++r)Ie(h[r],this,e)}return!0},ye.prototype.addListener=function(t,e){return Ee(this,t,e,!1)},ye.prototype.on=ye.prototype.addListener,ye.prototype.prependListener=function(t,e){return Ee(this,t,e,!0)},ye.prototype.once=function(t,e){return me(e),this.on(t,Ae(this,t,e)),this},ye.prototype.prependOnceListener=function(t,e){return me(e),this.prependListener(t,Ae(this,t,e)),this},ye.prototype.removeListener=function(t,e){var r,i,n,s,o;if(me(e),(i=this._events)===void 0)return this;if((r=i[t])===void 0)return this;if(r===e||r.listener===e)--this._eventsCount==0?this._events=Object.create(null):(delete i[t],i.removeListener&&this.emit("removeListener",t,r.listener||e));else if(typeof r!="function"){for(n=-1,s=r.length-1;s>=0;s--)if(r[s]===e||r[s].listener===e){o=r[s].listener,n=s;break}if(n<0)return this;n===0?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,n),r.length===1&&(i[t]=r[0]),i.removeListener!==void 0&&this.emit("removeListener",t,o||e)}return this},ye.prototype.off=ye.prototype.removeListener,ye.prototype.removeAllListeners=function(t){var e,r,i;if((r=this._events)===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[t]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete r[t]),this;if(arguments.length===0){var n,s=Object.keys(r);for(i=0;i<s.length;++i)(n=s[i])!=="removeListener"&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(e=r[t])=="function")this.removeListener(t,e);else if(e!==void 0)for(i=e.length-1;i>=0;i--)this.removeListener(t,e[i]);return this},ye.prototype.listeners=function(t){return ke(this,t,!0)},ye.prototype.rawListeners=function(t){return ke(this,t,!1)},ye.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):Se.call(t,e)},ye.prototype.listenerCount=Se,ye.prototype.eventNames=function(){return this._eventsCount>0?Te(this._events):[]};Pe=Re}));var Be={};l(Be,{EventEmitter:()=>xe,default:()=>Pe,defaultMaxListeners:()=>Ue,init:()=>Fe,listenerCount:()=>$e,on:()=>Le,once:()=>De});var xe,Ue,Fe,$e,Le,De,qe=h((()=>{p();ue();Gt();Ne();Ne();Pe.once=function(t,e){return new Promise(((r,i)=>{function n(...e){s!==void 0&&t.removeListener("error",s),r(e)}let s;e!=="error"&&(s=e=>{t.removeListener(name,n),i(e)},t.once("error",s)),t.once(e,n)}))};Pe.on=function(t,e){let r=[],i=[],n=null,s=!1,o={async next(){let t=r.shift();if(t)return createIterResult(t,!1);if(n){let t=Promise.reject(n);return n=null,t}return s?createIterResult(void 0,!0):new Promise(((t,e)=>i.push({resolve:t,reject:e})))},async return(){t.removeListener(e,u),t.removeListener("error",a),s=!0;for(let t of i)t.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(r){n=r,t.removeListener(e,u),t.removeListener("error",a)},[Symbol.asyncIterator](){return this}};return t.on(e,u),t.on("error",a),o;function u(...t){let e=i.shift();e?e.resolve(createIterResult(t,!1)):r.push(t)}function a(t){s=!0;let e=i.shift();e?e.reject(t):n=t,o.return()}};({EventEmitter:xe,defaultMaxListeners:Ue,init:Fe,listenerCount:$e,on:Le,once:De}=Pe)}));var ze=f(((t,e)=>{p();ue();Gt();var{ArrayIsArray:r,ObjectSetPrototypeOf:i}=he(),{EventEmitter:n}=(qe(),d(Be));function s(t){n.call(this,t)}i(s.prototype,n.prototype);i(s,n);s.prototype.pipe=function(t,e){let r=this;function i(e){t.writable&&t.write(e)===!1&&r.pause&&r.pause()}r.on("data",i);function s(){r.readable&&r.resume&&r.resume()}t.on("drain",s),!t._isStdio&&(!e||e.end!==!1)&&(r.on("end",a),r.on("close",h));let u=!1;function a(){u||(u=!0,t.end())}function h(){u||(u=!0,typeof t.destroy=="function"&&t.destroy())}function f(t){l(),n.listenerCount(this,"error")===0&&this.emit("error",t)}o(r,"error",f),o(t,"error",f);function l(){r.removeListener("data",i),t.removeListener("drain",s),r.removeListener("end",a),r.removeListener("close",h),r.removeListener("error",f),t.removeListener("error",f),r.removeListener("end",l),r.removeListener("close",l),t.removeListener("close",l)}return r.on("end",l),r.on("close",l),t.on("close",l),t.emit("pipe",r),t};function o(t,e,i){if(typeof t.prependListener=="function")return t.prependListener(e,i);!t._events||!t._events[e]?t.on(e,i):r(t._events[e])?t._events[e].unshift(i):t._events[e]=[i,t._events[e]]}e.exports={Stream:s,prependListener:o}}));var We=f(((t,e)=>{p();ue();Gt();var{AbortError:r,codes:i}=ce(),{isNodeStream:n,isWebStream:s,kControllerErrorFunction:o}=be(),u=ve(),{ERR_INVALID_ARG_TYPE:a}=i,h=(t,e)=>{if(typeof t!="object"||!("aborted"in t))throw new a(e,"AbortSignal",t)};e.exports.addAbortSignal=function(t,r){if(h(t,"signal"),!n(r)&&!s(r))throw new a("stream",["ReadableStream","WritableStream","Stream"],r);return e.exports.addAbortSignalNoValidate(t,r)};e.exports.addAbortSignalNoValidate=function(t,e){if(typeof t!="object"||!("aborted"in t))return e;let i=n(e)?()=>{e.destroy(new r(void 0,{cause:t.reason}))}:()=>{e[o](new r(void 0,{cause:t.reason}))};return t.aborted?i():(t.addEventListener("abort",i),u(e,(()=>t.removeEventListener("abort",i)))),e}}));var Ge=f(((t,e)=>{p();ue();Gt();var{StringPrototypeSlice:r,SymbolIterator:i,TypedArrayPrototypeSet:n,Uint8Array:s}=he(),{Buffer:o}=(oe(),d(Vt)),{inspect:u}=fe();e.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(t){let e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}unshift(t){let e={data:t,next:this.head};this.length===0&&(this.tail=e),this.head=e,++this.length}shift(){if(this.length===0)return;let t=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,t}clear(){this.head=this.tail=null,this.length=0}join(t){if(this.length===0)return"";let e=this.head,r=""+e.data;for(;(e=e.next)!==null;)r+=t+e.data;return r}concat(t){if(this.length===0)return o.alloc(0);let e=o.allocUnsafe(t>>>0),r=this.head,i=0;for(;r;)n(e,r.data,i),i+=r.data.length,r=r.next;return e}consume(t,e){let r=this.head.data;if(t<r.length){let e=r.slice(0,t);return this.head.data=r.slice(t),e}return t===r.length?this.shift():e?this._getString(t):this._getBuffer(t)}first(){return this.head.data}*[i](){for(let t=this.head;t;t=t.next)yield t.data}_getString(t){let e="",i=this.head,n=0;do{let s=i.data;if(t>s.length)e+=s,t-=s.length;else{t===s.length?(e+=s,++n,i.next?this.head=i.next:this.head=this.tail=null):(e+=r(s,0,t),this.head=i,i.data=r(s,t));break}++n}while((i=i.next)!==null);return this.length-=n,e}_getBuffer(t){let e=o.allocUnsafe(t),r=t,i=this.head,u=0;do{let o=i.data;if(t>o.length)n(e,o,r-t),t-=o.length;else{t===o.length?(n(e,o,r-t),++u,i.next?this.head=i.next:this.head=this.tail=null):(n(e,new s(o.buffer,o.byteOffset,t),r-t),this.head=i,i.data=o.slice(t));break}++u}while((i=i.next)!==null);return this.length-=u,e}[Symbol.for("nodejs.util.inspect.custom")](t,e){return u(this,{...e,depth:0,customInspect:!1})}}}));var Ve=f(((t,e)=>{p();ue();Gt();var{MathFloor:r,NumberIsInteger:i}=he(),{ERR_INVALID_ARG_VALUE:n}=ce().codes;function s(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function o(t){return t?16:16*1024}function u(t,e,u,a){let h=s(e,a,u);if(h!=null){if(!i(h)||h<0){let t=a?`options.${u}`:"options.highWaterMark";throw new n(t,h)}return r(h)}return o(t.objectMode)}e.exports={getHighWaterMark:u,getDefaultHighWaterMark:o}}));function He(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return r===-1&&(r=e),[r,r===e?0:4-r%4]}function Ke(t,e,r){for(var i,n,s=[],o=e;o<r;o+=3)i=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(255&t[o+2]),s.push(qr[(n=i)>>18&63]+qr[n>>12&63]+qr[n>>6&63]+qr[63&n]);return s.join("")}function Qe(t){if(t>2147483647)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,Ye.prototype),e}function Ye(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Xe(t)}return Je(t,e,r)}function Je(t,e,r){if(typeof t=="string")return function(t,e){if(typeof e=="string"&&e!==""||(e="utf8"),!Ye.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|ir(t,e),i=Qe(r),n=i.write(t,e);return n!==r&&(i=i.slice(0,n)),i}(t,e);if(ArrayBuffer.isView(t))return tr(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(Tr(t,ArrayBuffer)||t&&Tr(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Tr(t,SharedArrayBuffer)||t&&Tr(t.buffer,SharedArrayBuffer)))return er(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var i=t.valueOf&&t.valueOf();if(i!=null&&i!==t)return Ye.from(i,e,r);var n=function(t){if(Ye.isBuffer(t)){var e=0|rr(t.length),r=Qe(e);return r.length===0||t.copy(r,0,0,e),r}if(t.length!==void 0)return typeof t.length!="number"||jr(t.length)?Qe(0):tr(t);if(t.type==="Buffer"&&Array.isArray(t.data))return tr(t.data)}(t);if(n)return n;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return Ye.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function Ze(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function Xe(t){return Ze(t),Qe(t<0?0:0|rr(t))}function tr(t){for(var e=t.length<0?0:0|rr(t.length),r=Qe(e),i=0;i<e;i+=1)r[i]=255&t[i];return r}function er(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var i;return i=e===void 0&&r===void 0?new Uint8Array(t):r===void 0?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(i,Ye.prototype),i}function rr(t){if(t>=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|t}function ir(t,e){if(Ye.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Tr(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&r===0)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Sr(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Or(t).length;default:if(n)return i?-1:Sr(t).length;e=(""+e).toLowerCase(),n=!0}}function nr(t,e,r){var i=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return yr(this,e,r);case"utf8":case"utf-8":return br(this,e,r);case"ascii":return vr(this,e,r);case"latin1":case"binary":return wr(this,e,r);case"base64":return pr(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return mr(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function sr(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function or(t,e,r,i,n){if(t.length===0)return-1;if(typeof r=="string"?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),jr(r=+r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0){if(!n)return-1;r=0}if(typeof e=="string"&&(e=Ye.from(e,i)),Ye.isBuffer(e))return e.length===0?-1:ur(t,e,r,i,n);if(typeof e=="number")return e&=255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):ur(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function ur(t,e,r,i,n){var s,o=1,u=t.length,a=e.length;if(i!==void 0&&((i=String(i).toLowerCase())==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(t.length<2||e.length<2)return-1;o=2,u/=2,a/=2,r/=2}function h(t,e){return o===1?t[e]:t.readUInt16BE(e*o)}if(n){var f=-1;for(s=r;s<u;s++)if(h(t,s)===h(e,f===-1?0:s-f)){if(f===-1&&(f=s),s-f+1===a)return f*o}else f!==-1&&(s-=s-f),f=-1}else for(r+a>u&&(r=u-a),s=r;s>=0;s--){for(var l=!0,c=0;c<a;c++)if(h(t,s+c)!==h(e,c)){l=!1;break}if(l)return s}return-1}function ar(t,e,r,i){r=Number(r)||0;var n=t.length-r;i?(i=Number(i))>n&&(i=n):i=n;var s=e.length;i>s/2&&(i=s/2);for(var o=0;o<i;++o){var u=parseInt(e.substr(2*o,2),16);if(jr(u))return o;t[r+o]=u}return o}function hr(t,e,r,i){return Rr(Sr(e,t.length-r),t,r,i)}function fr(t,e,r,i){return Rr(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,i)}function lr(t,e,r,i){return fr(t,e,r,i)}function cr(t,e,r,i){return Rr(Or(e),t,r,i)}function dr(t,e,r,i){return Rr(function(t,e){for(var r,i,n,s=[],o=0;o<t.length&&!((e-=2)<0);++o)r=t.charCodeAt(o),i=r>>8,n=r%256,s.push(n),s.push(i);return s}(e,t.length-r),t,r,i)}function pr(t,e,r){return e===0&&r===t.length?Yr.fromByteArray(t):Yr.fromByteArray(t.slice(e,r))}function br(t,e,r){r=Math.min(t.length,r);for(var i=[],n=e;n<r;){var s,o,u,a,h=t[n],f=null,l=h>239?4:h>223?3:h>191?2:1;if(n+l<=r)switch(l){case 1:h<128&&(f=h);break;case 2:(192&(s=t[n+1]))==128&&(a=(31&h)<<6|63&s)>127&&(f=a);break;case 3:s=t[n+1],o=t[n+2],(192&s)==128&&(192&o)==128&&(a=(15&h)<<12|(63&s)<<6|63&o)>2047&&(a<55296||a>57343)&&(f=a);break;case 4:s=t[n+1],o=t[n+2],u=t[n+3],(192&s)==128&&(192&o)==128&&(192&u)==128&&(a=(15&h)<<18|(63&s)<<12|(63&o)<<6|63&u)>65535&&a<1114112&&(f=a)}f===null?(f=65533,l=1):f>65535&&(f-=65536,i.push(f>>>10&1023|55296),f=56320|1023&f),i.push(f),n+=l}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);for(var r="",i=0;i<e;)r+=String.fromCharCode.apply(String,t.slice(i,i+=4096));return r}(i)}function vr(t,e,r){var i="";r=Math.min(t.length,r);for(var n=e;n<r;++n)i+=String.fromCharCode(127&t[n]);return i}function wr(t,e,r){var i="";r=Math.min(t.length,r);for(var n=e;n<r;++n)i+=String.fromCharCode(t[n]);return i}function yr(t,e,r){var i=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>i)&&(r=i);for(var n="",s=e;s<r;++s)n+=ti[t[s]];return n}function mr(t,e,r){for(var i=t.slice(e,r),n="",s=0;s<i.length;s+=2)n+=String.fromCharCode(i[s]+256*i[s+1]);return n}function gr(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function Er(t,e,r,i,n,s){if(!Ye.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<s)throw new RangeError('"value" argument is out of bounds');if(r+i>t.length)throw new RangeError("Index out of range")}function _r(t,e,r,i,n,s){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Ar(t,e,r,i,n){return e=+e,r>>>=0,n||_r(t,0,r,4),Jr.write(t,e,r,i,23,4),r+4}function kr(t,e,r,i,n){return e=+e,r>>>=0,n||_r(t,0,r,8),Jr.write(t,e,r,i,52,8),r+8}function Sr(t,e){var r;e=e||1/0;for(var i=t.length,n=null,s=[],o=0;o<i;++o){if((r=t.charCodeAt(o))>55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(o+1===i){(e-=3)>-1&&s.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function Or(t){return Yr.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(Xr,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function Rr(t,e,r,i){for(var n=0;n<i&&!(n+r>=e.length||n>=t.length);++n)e[n+r]=t[n];return n}function Tr(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function jr(t){return t!=t}function Ir(t,e){for(var r in t)e[r]=t[r]}function Mr(t,e,r){return ii(t,e,r)}function Cr(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){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 t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if(typeof e!="string"&&(oi.isEncoding===ui||!ui(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=Br,this.end=xr,e=4;break;case"utf8":this.fillLast=Nr,e=4;break;case"base64":this.text=Ur,this.end=Fr,e=3;break;default:return this.write=$r,this.end=Lr,void 0}this.lastNeed=0,this.lastTotal=0,this.lastChar=oi.allocUnsafe(e)}function Pr(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function Nr(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if((192&e[0])!=128)return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if((192&e[1])!=128)return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&(192&e[2])!=128)return t.lastNeed=2,"�"}}(this,t);return r!==void 0?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length,void 0)}function Br(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function xr(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function Ur(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function Fr(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function $r(t){return t.toString(this.encoding)}function Lr(t){return t&&t.length?this.write(t):""}var Dr,qr,zr,Wr,Gr,Vr,Hr,Kr,Qr,Yr,Jr,Zr,Xr,ti,ei,ri,ii,ni,si,oi,ui,ai=h((()=>{p();ue();Gt();for(Dr={byteLength:function(t){var e=He(t),r=e[0],i=e[1];return 3*(r+i)/4-i},toByteArray:function(t){var e,r,i=He(t),n=i[0],s=i[1],o=new Wr(function(t,e,r){return 3*(e+r)/4-r}(0,n,s)),u=0,a=s>0?n-4:n;for(r=0;r<a;r+=4)e=zr[t.charCodeAt(r)]<<18|zr[t.charCodeAt(r+1)]<<12|zr[t.charCodeAt(r+2)]<<6|zr[t.charCodeAt(r+3)],o[u++]=e>>16&255,o[u++]=e>>8&255,o[u++]=255&e;return s===2&&(e=zr[t.charCodeAt(r)]<<2|zr[t.charCodeAt(r+1)]>>4,o[u++]=255&e),s===1&&(e=zr[t.charCodeAt(r)]<<10|zr[t.charCodeAt(r+1)]<<4|zr[t.charCodeAt(r+2)]>>2,o[u++]=e>>8&255,o[u++]=255&e),o},fromByteArray:function(t){for(var e,r=t.length,i=r%3,n=[],s=0,o=r-i;s<o;s+=16383)n.push(Ke(t,s,s+16383>o?o:s+16383));return i===1?(e=t[r-1],n.push(qr[e>>2]+qr[e<<4&63]+"==")):i===2&&(e=(t[r-2]<<8)+t[r-1],n.push(qr[e>>10]+qr[e>>4&63]+qr[e<<2&63]+"=")),n.join("")}},qr=[],zr=[],Wr=typeof Uint8Array<"u"?Uint8Array:Array,Gr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Vr=0,Hr=Gr.length;Vr<Hr;++Vr)qr[Vr]=Gr[Vr],zr[Gr.charCodeAt(Vr)]=Vr;zr["-".charCodeAt(0)]=62,zr["_".charCodeAt(0)]=63;Kr={read:function(t,e,r,i,n){var s,o,u=8*n-i-1,a=(1<<u)-1,h=a>>1,f=-7,l=r?n-1:0,c=r?-1:1,d=t[e+l];for(l+=c,s=d&(1<<-f)-1,d>>=-f,f+=u;f>0;s=256*s+t[e+l],l+=c,f-=8);for(o=s&(1<<-f)-1,s>>=-f,f+=i;f>0;o=256*o+t[e+l],l+=c,f-=8);if(s===0)s=1-h;else{if(s===a)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,i),s-=h}return(d?-1:1)*o*Math.pow(2,s-i)},write:function(t,e,r,i,n,s){var o,u,a,h=8*s-n-1,f=(1<<h)-1,l=f>>1,c=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:s-1,p=i?1:-1,b=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,o=f):(o=Math.floor(Math.log(e)/Math.LN2),e*(a=Math.pow(2,-o))<1&&(o--,a*=2),(e+=o+l>=1?c/a:c*Math.pow(2,1-l))*a>=2&&(o++,a/=2),o+l>=f?(u=0,o=f):o+l>=1?(u=(e*a-1)*Math.pow(2,n),o+=l):(u=e*Math.pow(2,l-1)*Math.pow(2,n),o=0));n>=8;t[r+d]=255&u,d+=p,u/=256,n-=8);for(o=o<<n|u,h+=n;h>0;t[r+d]=255&o,d+=p,o/=256,h-=8);t[r+d-p]|=128*b}},Qr={},Yr=Dr,Jr=Kr,Zr=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Qr.Buffer=Ye,Qr.SlowBuffer=function(t){return+t!=t&&(t=0),Ye.alloc(+t)},Qr.INSPECT_MAX_BYTES=50;Qr.kMaxLength=2147483647,Ye.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}(),Ye.TYPED_ARRAY_SUPPORT||typeof console>"u"||typeof console.error!="function"||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(Ye.prototype,"parent",{enumerable:!0,get:function(){if(Ye.isBuffer(this))return this.buffer}}),Object.defineProperty(Ye.prototype,"offset",{enumerable:!0,get:function(){if(Ye.isBuffer(this))return this.byteOffset}}),Ye.poolSize=8192,Ye.from=function(t,e,r){return Je(t,e,r)},Object.setPrototypeOf(Ye.prototype,Uint8Array.prototype),Object.setPrototypeOf(Ye,Uint8Array),Ye.alloc=function(t,e,r){return function(t,e,r){return Ze(t),t<=0?Qe(t):e!==void 0?typeof r=="string"?Qe(t).fill(e,r):Qe(t).fill(e):Qe(t)}(t,e,r)},Ye.allocUnsafe=function(t){return Xe(t)},Ye.allocUnsafeSlow=function(t){return Xe(t)},Ye.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==Ye.prototype},Ye.compare=function(t,e){if(Tr(t,Uint8Array)&&(t=Ye.from(t,t.offset,t.byteLength)),Tr(e,Uint8Array)&&(e=Ye.from(e,e.offset,e.byteLength)),!Ye.isBuffer(t)||!Ye.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,i=e.length,n=0,s=Math.min(r,i);n<s;++n)if(t[n]!==e[n]){r=t[n],i=e[n];break}return r<i?-1:i<r?1:0},Ye.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Ye.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return Ye.alloc(0);var r;if(e===void 0)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var i=Ye.allocUnsafe(e),n=0;for(r=0;r<t.length;++r){var s=t[r];if(Tr(s,Uint8Array)&&(s=Ye.from(s)),!Ye.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(i,n),n+=s.length}return i},Ye.byteLength=ir,Ye.prototype._isBuffer=!0,Ye.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)sr(this,e,e+1);return this},Ye.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)sr(this,e,e+3),sr(this,e+1,e+2);return this},Ye.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)sr(this,e,e+7),sr(this,e+1,e+6),sr(this,e+2,e+5),sr(this,e+3,e+4);return this},Ye.prototype.toString=function(){var t=this.length;return t===0?"":arguments.length===0?br(this,0,t):nr.apply(this,arguments)},Ye.prototype.toLocaleString=Ye.prototype.toString,Ye.prototype.equals=function(t){if(!Ye.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||Ye.compare(this,t)===0},Ye.prototype.inspect=function(){var t="",e=Qr.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),"<Buffer "+t+">"},Zr&&(Ye.prototype[Zr]=Ye.prototype.inspect),Ye.prototype.compare=function(t,e,r,i,n){if(Tr(t,Uint8Array)&&(t=Ye.from(t,t.offset,t.byteLength)),!Ye.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(e===void 0&&(e=0),r===void 0&&(r=t?t.length:0),i===void 0&&(i=0),n===void 0&&(n=this.length),e<0||r>t.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&e>=r)return 0;if(i>=n)return-1;if(e>=r)return 1;if(this===t)return 0;for(var s=(n>>>=0)-(i>>>=0),o=(r>>>=0)-(e>>>=0),u=Math.min(s,o),a=this.slice(i,n),h=t.slice(e,r),f=0;f<u;++f)if(a[f]!==h[f]){s=a[f],o=h[f];break}return s<o?-1:o<s?1:0},Ye.prototype.includes=function(t,e,r){return this.indexOf(t,e,r)!==-1},Ye.prototype.indexOf=function(t,e,r){return or(this,t,e,r,!0)},Ye.prototype.lastIndexOf=function(t,e,r){return or(this,t,e,r,!1)},Ye.prototype.write=function(t,e,r,i){if(e===void 0)i="utf8",r=this.length,e=0;else if(r===void 0&&typeof e=="string")i=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,i===void 0&&(i="utf8")):(i=r,r=void 0)}var n=this.length-e;if((r===void 0||r>n)&&(r=n),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var s=!1;;)switch(i){case"hex":return ar(this,t,e,r);case"utf8":case"utf-8":return hr(this,t,e,r);case"ascii":return fr(this,t,e,r);case"latin1":case"binary":return lr(this,t,e,r);case"base64":return cr(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return dr(this,t,e,r);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}},Ye.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};Ye.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=e===void 0?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var i=this.subarray(t,e);return Object.setPrototypeOf(i,Ye.prototype),i},Ye.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||gr(t,e,this.length);for(var i=this[t],n=1,s=0;++s<e&&(n*=256);)i+=this[t+s]*n;return i},Ye.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||gr(t,e,this.length);for(var i=this[t+--e],n=1;e>0&&(n*=256);)i+=this[t+--e]*n;return i},Ye.prototype.readUInt8=function(t,e){return t>>>=0,e||gr(t,1,this.length),this[t]},Ye.prototype.readUInt16LE=function(t,e){return t>>>=0,e||gr(t,2,this.length),this[t]|this[t+1]<<8},Ye.prototype.readUInt16BE=function(t,e){return t>>>=0,e||gr(t,2,this.length),this[t]<<8|this[t+1]},Ye.prototype.readUInt32LE=function(t,e){return t>>>=0,e||gr(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},Ye.prototype.readUInt32BE=function(t,e){return t>>>=0,e||gr(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},Ye.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||gr(t,e,this.length);for(var i=this[t],n=1,s=0;++s<e&&(n*=256);)i+=this[t+s]*n;return i>=(n*=128)&&(i-=Math.pow(2,8*e)),i},Ye.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||gr(t,e,this.length);for(var i=e,n=1,s=this[t+--i];i>0&&(n*=256);)s+=this[t+--i]*n;return s>=(n*=128)&&(s-=Math.pow(2,8*e)),s},Ye.prototype.readInt8=function(t,e){return t>>>=0,e||gr(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},Ye.prototype.readInt16LE=function(t,e){t>>>=0,e||gr(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},Ye.prototype.readInt16BE=function(t,e){t>>>=0,e||gr(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},Ye.prototype.readInt32LE=function(t,e){return t>>>=0,e||gr(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},Ye.prototype.readInt32BE=function(t,e){return t>>>=0,e||gr(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},Ye.prototype.readFloatLE=function(t,e){return t>>>=0,e||gr(t,4,this.length),Jr.read(this,t,!0,23,4)},Ye.prototype.readFloatBE=function(t,e){return t>>>=0,e||gr(t,4,this.length),Jr.read(this,t,!1,23,4)},Ye.prototype.readDoubleLE=function(t,e){return t>>>=0,e||gr(t,8,this.length),Jr.read(this,t,!0,52,8)},Ye.prototype.readDoubleBE=function(t,e){return t>>>=0,e||gr(t,8,this.length),Jr.read(this,t,!1,52,8)},Ye.prototype.writeUIntLE=function(t,e,r,i){t=+t,e>>>=0,r>>>=0,i||Er(this,t,e,r,Math.pow(2,8*r)-1,0);var n=1,s=0;for(this[e]=255&t;++s<r&&(n*=256);)this[e+s]=t/n&255;return e+r},Ye.prototype.writeUIntBE=function(t,e,r,i){t=+t,e>>>=0,r>>>=0,i||Er(this,t,e,r,Math.pow(2,8*r)-1,0);var n=r-1,s=1;for(this[e+n]=255&t;--n>=0&&(s*=256);)this[e+n]=t/s&255;return e+r},Ye.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||Er(this,t,e,1,255,0),this[e]=255&t,e+1},Ye.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||Er(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},Ye.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||Er(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},Ye.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||Er(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},Ye.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||Er(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},Ye.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e>>>=0,!i){var n=Math.pow(2,8*r-1);Er(this,t,e,r,n-1,-n)}var s=0,o=1,u=0;for(this[e]=255&t;++s<r&&(o*=256);)t<0&&u===0&&this[e+s-1]!==0&&(u=1),this[e+s]=(t/o>>0)-u&255;return e+r},Ye.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e>>>=0,!i){var n=Math.pow(2,8*r-1);Er(this,t,e,r,n-1,-n)}var s=r-1,o=1,u=0;for(this[e+s]=255&t;--s>=0&&(o*=256);)t<0&&u===0&&this[e+s+1]!==0&&(u=1),this[e+s]=(t/o>>0)-u&255;return e+r},Ye.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||Er(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},Ye.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||Er(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},Ye.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||Er(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},Ye.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||Er(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},Ye.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||Er(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},Ye.prototype.writeFloatLE=function(t,e,r){return Ar(this,t,e,!0,r)},Ye.prototype.writeFloatBE=function(t,e,r){return Ar(this,t,e,!1,r)},Ye.prototype.writeDoubleLE=function(t,e,r){return kr(this,t,e,!0,r)},Ye.prototype.writeDoubleBE=function(t,e,r){return kr(this,t,e,!1,r)},Ye.prototype.copy=function(t,e,r,i){if(!Ye.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),i||i===0||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<r&&(i=r),i===r||t.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-r&&(i=t.length-e+r);var n=i-r;if(this===t&&typeof Uint8Array.prototype.copyWithin=="function")this.copyWithin(e,r,i);else if(this===t&&r<e&&e<i)for(var s=n-1;s>=0;--s)t[s+e]=this[s+r];else Uint8Array.prototype.set.call(t,this.subarray(r,i),e);return n},Ye.prototype.fill=function(t,e,r,i){if(typeof t=="string"){if(typeof e=="string"?(i=e,e=0,r=this.length):typeof r=="string"&&(i=r,r=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!Ye.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(t.length===1){var n=t.charCodeAt(0);(i==="utf8"&&n<128||i==="latin1")&&(t=n)}}else typeof t=="number"?t&=255:typeof t=="boolean"&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var s;if(e>>>=0,r=r===void 0?this.length:r>>>0,t||(t=0),typeof t=="number")for(s=e;s<r;++s)this[s]=t;else{var o=Ye.isBuffer(t)?t:Ye.from(t,i),u=o.length;if(u===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(s=0;s<r-e;++s)this[s+e]=o[s%u]}return this};Xr=/[^+/0-9A-Za-z-_]/g;ti=function(){for(var t=new Array(256),e=0;e<16;++e)for(var r=16*e,i=0;i<16;++i)t[r+i]="0123456789abcdef"[e]+"0123456789abcdef"[i];return t}();ei={},ri=Qr,ii=ri.Buffer;ii.from&&ii.alloc&&ii.allocUnsafe&&ii.allocUnsafeSlow?ei=ri:(Ir(ri,ei),ei.Buffer=Mr),Mr.prototype=Object.create(ii.prototype),Ir(ii,Mr),Mr.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return ii(t,e,r)},Mr.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var i=ii(t);return e!==void 0?typeof r=="string"?i.fill(e,r):i.fill(e):i.fill(0),i},Mr.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return ii(t)},Mr.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return ri.SlowBuffer(t)};ni=ei,si={},oi=ni.Buffer,ui=oi.isEncoding||function(t){switch((t=""+t)&&t.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}};si.StringDecoder=Cr,Cr.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if((e=this.fillLast(t))===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""},Cr.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},Cr.prototype.text=function(t,e){var r=function(t,e,r){var i=e.length-1;if(i<r)return 0;var n=Pr(e[i]);return n>=0?(n>0&&(t.lastNeed=n-1),n):--i<r||n===-2?0:(n=Pr(e[i]))>=0?(n>0&&(t.lastNeed=n-2),n):--i<r||n===-2?0:(n=Pr(e[i]))>=0?(n>0&&(n===2?n=0:t.lastNeed=n-3),n):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)},Cr.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}}));var hi={};l(hi,{StringDecoder:()=>fi,default:()=>si});var fi,li=h((()=>{p();ue();Gt();ai();ai();fi=si.StringDecoder}));var ci=f(((t,e)=>{p();ue();Gt();var r=pe(),{PromisePrototypeThen:i,SymbolAsyncIterator:n,SymbolIterator:s}=he(),{Buffer:o}=(oe(),d(Vt)),{ERR_INVALID_ARG_TYPE:u,ERR_STREAM_NULL_VALUES:a}=ce().codes;function h(t,e,h){let f;if(typeof e=="string"||e instanceof o)return new t({objectMode:!0,...h,read(){this.push(e),this.push(null)}});let l;if(e&&e[n])l=!0,f=e[n]();else if(e&&e[s])l=!1,f=e[s]();else throw new u("iterable",["Iterable"],e);let c=new t({objectMode:!0,highWaterMark:1,...h}),d=!1;c._read=function(){d||(d=!0,b())},c._destroy=function(t,e){i(p(t),(()=>r.nextTick(e,t)),(i=>r.nextTick(e,i||t)))};async function p(t){let e=t!=null,r=typeof f.throw=="function";if(e&&r){let{value:e,done:r}=await f.throw(t);if(await e,r)return}if(typeof f.return=="function"){let{value:t}=await f.return();await t}}async function b(){for(;;){try{let{value:t,done:e}=l?await f.next():f.next();if(e)c.push(null);else{let e=t&&typeof t.then=="function"?await t:t;if(e===null)throw d=!1,new a;if(c.push(e))continue;d=!1}}catch(t){c.destroy(t)}break}}return c}e.exports=h}));var di=f(((t,e)=>{p();ue();Gt();var r=pe(),{ArrayPrototypeIndexOf:i,NumberIsInteger:n,NumberIsNaN:s,NumberParseInt:o,ObjectDefineProperties:u,ObjectKeys:a,ObjectSetPrototypeOf:h,Promise:f,SafeSet:l,SymbolAsyncIterator:c,Symbol:b}=he();e.exports=L;L.ReadableState=$;var{EventEmitter:v}=(qe(),d(Be)),{Stream:w,prependListener:y}=ze(),{Buffer:m}=(oe(),d(Vt)),{addAbortSignal:g}=We(),E=ve(),_=fe().debuglog("stream",(t=>{_=t})),A=Ge(),k=we(),{getHighWaterMark:S,getDefaultHighWaterMark:O}=Ve(),{aggregateTwoErrors:R,codes:{ERR_INVALID_ARG_TYPE:T,ERR_METHOD_NOT_IMPLEMENTED:j,ERR_OUT_OF_RANGE:I,ERR_STREAM_PUSH_AFTER_EOF:M,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:C}}=ce(),{validateObject:P}=de(),N=b("kPaused"),{StringDecoder:B}=(li(),d(hi)),x=ci();h(L.prototype,w.prototype);h(L,w);var U=()=>{},{errorOrDestroy:F}=k;function $(t,e,r){typeof r!="boolean"&&(r=e instanceof vi()),this.objectMode=!!(t&&t.objectMode),r&&(this.objectMode=this.objectMode||!!(t&&t.readableObjectMode)),this.highWaterMark=t?S(this,t,"readableHighWaterMark",r):O(!1),this.buffer=new A,this.length=0,this.pipes=[],this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.constructed=!0,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this[N]=null,this.errorEmitted=!1,this.emitClose=!t||t.emitClose!==!1,this.autoDestroy=!t||t.autoDestroy!==!1,this.destroyed=!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.multiAwaitDrain=!1,this.readingMore=!1,this.dataEmitted=!1,this.decoder=null,this.encoding=null,t&&t.encoding&&(this.decoder=new B(t.encoding),this.encoding=t.encoding)}function L(t){if(!(this instanceof L))return new L(t);let e=this instanceof vi();this._readableState=new $(t,this,e),t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&!e&&g(t.signal,this)),w.call(this,t),k.construct(this,(()=>{this._readableState.needReadable&&Q(this,this._readableState)}))}L.prototype.destroy=k.destroy;L.prototype._undestroy=k.undestroy;L.prototype._destroy=function(t,e){e(t)};L.prototype[v.captureRejectionSymbol]=function(t){this.destroy(t)};L.prototype.push=function(t,e){return D(this,t,e,!1)};L.prototype.unshift=function(t,e){return D(this,t,e,!0)};function D(t,e,r,i){_("readableAddChunk",e);let n=t._readableState,s;if(n.objectMode||(typeof e=="string"?(r=r||n.defaultEncoding,n.encoding!==r&&(i&&n.encoding?e=m.from(e,r).toString(n.encoding):(e=m.from(e,r),r=""))):e instanceof m?r="":w._isUint8Array(e)?(e=w._uint8ArrayToBuffer(e),r=""):e!=null&&(s=new T("chunk",["string","Buffer","Uint8Array"],e))),s)F(t,s);else if(e===null)n.reading=!1,V(t,n);else if(n.objectMode||e&&e.length>0)if(i)if(n.endEmitted)F(t,new C);else{if(n.destroyed||n.errored)return!1;q(t,n,e,!0)}else if(n.ended)F(t,new M);else{if(n.destroyed||n.errored)return!1;n.reading=!1,n.decoder&&!r?(e=n.decoder.write(e),n.objectMode||e.length!==0?q(t,n,e,!1):Q(t,n)):q(t,n,e,!1)}else i||(n.reading=!1,Q(t,n));return!n.ended&&(n.length<n.highWaterMark||n.length===0)}function q(t,e,r,i){e.flowing&&e.length===0&&!e.sync&&t.listenerCount("data")>0?(e.multiAwaitDrain?e.awaitDrainWriters.clear():e.awaitDrainWriters=null,e.dataEmitted=!0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&H(t)),Q(t,e)}L.prototype.isPaused=function(){let t=this._readableState;return t[N]===!0||t.flowing===!1};L.prototype.setEncoding=function(t){let e=new B(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;let r=this._readableState.buffer,i="";for(let t of r)i+=e.write(t);return r.clear(),i!==""&&r.push(i),this._readableState.length=i.length,this};var z=1073741824;function W(t){if(t>z)throw new I("size","<= 1GiB",t);return t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++,t}function G(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:s(t)?e.flowing&&e.length?e.buffer.first().length:e.length:t<=e.length?t:e.ended?e.length:0}L.prototype.read=function(t){_("read",t),t===void 0?t=NaN:n(t)||(t=o(t,10));let e=this._readableState,r=t;if(t>e.highWaterMark&&(e.highWaterMark=W(t)),t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return _("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?ot(this):H(this),null;if(t=G(t,e),t===0&&e.ended)return e.length===0&&ot(this),null;let i=e.needReadable;if(_("need readable",i),(e.length===0||e.length-t<e.highWaterMark)&&(i=!0,_("length less than watermark",i)),e.ended||e.reading||e.destroyed||e.errored||!e.constructed)i=!1,_("reading, ended or constructing",i);else if(i){_("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0);try{this._read(e.highWaterMark)}catch(t){F(this,t)}e.sync=!1,e.reading||(t=G(r,e))}let s;return t>0?s=st(t,e):s=null,s===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.multiAwaitDrain?e.awaitDrainWriters.clear():e.awaitDrainWriters=null),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&ot(this)),s!==null&&!e.errorEmitted&&!e.closeEmitted&&(e.dataEmitted=!0,this.emit("data",s)),s};function V(t,e){if(_("onEofChunk"),!e.ended){if(e.decoder){let t=e.decoder.end();t&&t.length&&(e.buffer.push(t),e.length+=e.objectMode?1:t.length)}e.ended=!0,e.sync?H(t):(e.needReadable=!1,e.emittedReadable=!0,K(t))}}function H(t){let e=t._readableState;_("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(_("emitReadable",e.flowing),e.emittedReadable=!0,r.nextTick(K,t))}function K(t){let e=t._readableState;_("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&!e.errored&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,rt(t)}function Q(t,e){!e.readingMore&&e.constructed&&(e.readingMore=!0,r.nextTick(Y,t,e))}function Y(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){let r=e.length;if(_("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}L.prototype._read=function(t){throw new j("_read()")};L.prototype.pipe=function(t,e){let i=this,n=this._readableState;n.pipes.length===1&&(n.multiAwaitDrain||(n.multiAwaitDrain=!0,n.awaitDrainWriters=new l(n.awaitDrainWriters?[n.awaitDrainWriters]:[]))),n.pipes.push(t),_("pipe count=%d opts=%j",n.pipes.length,e);let s=(!e||e.end!==!1)&&t!==r.stdout&&t!==r.stderr?u:w;n.endEmitted?r.nextTick(s):i.once("end",s),t.on("unpipe",o);function o(t,e){_("onunpipe"),t===i&&e&&e.hasUnpiped===!1&&(e.hasUnpiped=!0,f())}function u(){_("onend"),t.end()}let a,h=!1;function f(){_("cleanup"),t.removeListener("close",b),t.removeListener("finish",v),a&&t.removeListener("drain",a),t.removeListener("error",p),t.removeListener("unpipe",o),i.removeListener("end",u),i.removeListener("end",w),i.removeListener("data",d),h=!0,a&&n.awaitDrainWriters&&(!t._writableState||t._writableState.needDrain)&&a()}function c(){h||(n.pipes.length===1&&n.pipes[0]===t?(_("false write response, pause",0),n.awaitDrainWriters=t,n.multiAwaitDrain=!1):n.pipes.length>1&&n.pipes.includes(t)&&(_("false write response, pause",n.awaitDrainWriters.size),n.awaitDrainWriters.add(t)),i.pause()),a||(a=J(i,t),t.on("drain",a))}i.on("data",d);function d(e){_("ondata");let r=t.write(e);_("dest.write",r),r===!1&&c()}function p(e){if(_("onerror",e),w(),t.removeListener("error",p),t.listenerCount("error")===0){let r=t._writableState||t._readableState;r&&!r.errorEmitted?F(t,e):t.emit("error",e)}}y(t,"error",p);function b(){t.removeListener("finish",v),w()}t.once("close",b);function v(){_("onfinish"),t.removeListener("close",b),w()}t.once("finish",v);function w(){_("unpipe"),i.unpipe(t)}return t.emit("pipe",i),t.writableNeedDrain===!0?n.flowing&&c():n.flowing||(_("pipe resume"),i.resume()),t};function J(t,e){return function(){let r=t._readableState;r.awaitDrainWriters===e?(_("pipeOnDrain",1),r.awaitDrainWriters=null):r.multiAwaitDrain&&(_("pipeOnDrain",r.awaitDrainWriters.size),r.awaitDrainWriters.delete(e)),(!r.awaitDrainWriters||r.awaitDrainWriters.size===0)&&t.listenerCount("data")&&t.resume()}}L.prototype.unpipe=function(t){let e=this._readableState,r={hasUnpiped:!1};if(e.pipes.length===0)return this;if(!t){let t=e.pipes;e.pipes=[],this.pause();for(let e=0;e<t.length;e++)t[e].emit("unpipe",this,{hasUnpiped:!1});return this}let n=i(e.pipes,t);return n===-1?this:(e.pipes.splice(n,1),e.pipes.length===0&&this.pause(),t.emit("unpipe",this,r),this)};L.prototype.on=function(t,e){let i=w.prototype.on.call(this,t,e),n=this._readableState;return t==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):t==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,_("on readable",n.length,n.reading),n.length?H(this):n.reading||r.nextTick(X,this)),i};L.prototype.addListener=L.prototype.on;L.prototype.removeListener=function(t,e){let i=w.prototype.removeListener.call(this,t,e);return t==="readable"&&r.nextTick(Z,this),i};L.prototype.off=L.prototype.removeListener;L.prototype.removeAllListeners=function(t){let e=w.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&r.nextTick(Z,this),e};function Z(t){let e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&e[N]===!1?e.flowing=!0:t.listenerCount("data")>0?t.resume():e.readableListening||(e.flowing=null)}function X(t){_("readable nexttick read 0"),t.read(0)}L.prototype.resume=function(){let t=this._readableState;return t.flowing||(_("resume"),t.flowing=!t.readableListening,tt(this,t)),t[N]=!1,this};function tt(t,e){e.resumeScheduled||(e.resumeScheduled=!0,r.nextTick(et,t,e))}function et(t,e){_("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),rt(t),e.flowing&&!e.reading&&t.read(0)}L.prototype.pause=function(){return _("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(_("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[N]=!0,this};function rt(t){let e=t._readableState;for(_("flow",e.flowing);e.flowing&&t.read()!==null;);}L.prototype.wrap=function(t){let e=!1;t.on("data",(r=>{!this.push(r)&&t.pause&&(e=!0,t.pause())})),t.on("end",(()=>{this.push(null)})),t.on("error",(t=>{F(this,t)})),t.on("close",(()=>{this.destroy()})),t.on("destroy",(()=>{this.destroy()})),this._read=()=>{e&&t.resume&&(e=!1,t.resume())};let r=a(t);for(let e=1;e<r.length;e++){let i=r[e];this[i]===void 0&&typeof t[i]=="function"&&(this[i]=t[i].bind(t))}return this};L.prototype[c]=function(){return it(this)};L.prototype.iterator=function(t){return t!==void 0&&P(t,"options"),it(this,t)};function it(t,e){typeof t.read!="function"&&(t=L.wrap(t,{objectMode:!0}));let r=nt(t,e);return r.stream=t,r}async function*nt(t,e){let r=U;function i(e){this===t?(r(),r=U):r=e}t.on("readable",i);let n,s=E(t,{writable:!1},(t=>{n=t?R(n,t):null,r(),r=U}));try{for(;;){let e=t.destroyed?null:t.read();if(e!==null)yield e;else{if(n)throw n;if(n===null)return;await new f(i)}}}catch(t){throw n=R(n,t),n}finally{(n||e?.destroyOnReturn!==!1)&&(n===void 0||t._readableState.autoDestroy)?k.destroyer(t,null):(t.off("readable",i),s())}}u(L.prototype,{readable:{__proto__:null,get(){let t=this._readableState;return!!t&&t.readable!==!1&&!t.destroyed&&!t.errorEmitted&&!t.endEmitted},set(t){this._readableState&&(this._readableState.readable=!!t)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(t){this._readableState&&(this._readableState.destroyed=t)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}});u($.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[N]!==!1},set(t){this[N]=!!t}}});L._fromList=st;function st(t,e){if(e.length===0)return null;let r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function ot(t){let e=t._readableState;_("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,r.nextTick(ut,e,t))}function ut(t,e){if(_("endReadableNT",t.endEmitted,t.length),!t.errored&&!t.closeEmitted&&!t.endEmitted&&t.length===0){if(t.endEmitted=!0,e.emit("end"),e.writable&&e.allowHalfOpen===!1)r.nextTick(at,e);else if(t.autoDestroy){let t=e._writableState;(!t||t.autoDestroy&&(t.finished||t.writable===!1))&&e.destroy()}}}function at(t){t.writable&&!t.writableEnded&&!t.destroyed&&t.end()}L.from=function(t,e){return x(L,t,e)};var ht;function ft(){return ht===void 0&&(ht={}),ht}L.fromWeb=function(t,e){return ft().newStreamReadableFromReadableStream(t,e)};L.toWeb=function(t,e){return ft().newReadableStreamFromStreamReadable(t,e)};L.wrap=function(t,e){var r,i;return new L({objectMode:(r=(i=t.readableObjectMode)!==null&&i!==void 0?i:t.objectMode)!==null&&r!==void 0?r:!0,...e,destroy(e,r){k.destroyer(t,e),r(e)}}).wrap(t)}}));var pi=f(((t,e)=>{p();ue();Gt();var r=pe(),{ArrayPrototypeSlice:i,Error:n,FunctionPrototypeSymbolHasInstance:s,ObjectDefineProperty:o,ObjectDefineProperties:u,ObjectSetPrototypeOf:a,StringPrototypeToLowerCase:h,Symbol:f,SymbolHasInstance:l}=he();e.exports=B;B.WritableState=P;var{EventEmitter:c}=(qe(),d(Be)),b=ze().Stream,{Buffer:v}=(oe(),d(Vt)),w=we(),{addAbortSignal:y}=We(),{getHighWaterMark:m,getDefaultHighWaterMark:g}=Ve(),{ERR_INVALID_ARG_TYPE:E,ERR_METHOD_NOT_IMPLEMENTED:_,ERR_MULTIPLE_CALLBACK:A,ERR_STREAM_CANNOT_PIPE:k,ERR_STREAM_DESTROYED:S,ERR_STREAM_ALREADY_FINISHED:O,ERR_STREAM_NULL_VALUES:R,ERR_STREAM_WRITE_AFTER_END:T,ERR_UNKNOWN_ENCODING:j}=ce().codes,{errorOrDestroy:I}=w;a(B.prototype,b.prototype);a(B,b);function M(){}var C=f("kOnFinished");function P(t,e,r){typeof r!="boolean"&&(r=e instanceof vi()),this.objectMode=!!(t&&t.objectMode),r&&(this.objectMode=this.objectMode||!!(t&&t.writableObjectMode)),this.highWaterMark=t?m(this,t,"writableHighWaterMark",r):g(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let i=!!(t&&t.decodeStrings===!1);this.decodeStrings=!i,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=L.bind(void 0,e),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,N(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!t||t.emitClose!==!1,this.autoDestroy=!t||t.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[C]=[]}function N(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0}P.prototype.getBuffer=function(){return i(this.buffered,this.bufferedIndex)};o(P.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function B(t){let e=this instanceof vi();if(!e&&!s(B,this))return new B(t);this._writableState=new P(t,this,e),t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&y(t.signal,this)),b.call(this,t),w.construct(this,(()=>{let t=this._writableState;t.writing||W(this,t),K(this,t)}))}o(B,l,{__proto__:null,value:function(t){return s(this,t)?!0:this!==B?!1:t&&t._writableState instanceof P}});B.prototype.pipe=function(){I(this,new k)};function x(t,e,i,n){let s=t._writableState;if(typeof i=="function")n=i,i=s.defaultEncoding;else{if(!i)i=s.defaultEncoding;else if(i!=="buffer"&&!v.isEncoding(i))throw new j(i);typeof n!="function"&&(n=M)}if(e===null)throw new R;if(!s.objectMode)if(typeof e=="string")s.decodeStrings!==!1&&(e=v.from(e,i),i="buffer");else if(e instanceof v)i="buffer";else if(b._isUint8Array(e))e=b._uint8ArrayToBuffer(e),i="buffer";else throw new E("chunk",["string","Buffer","Uint8Array"],e);let o;return s.ending?o=new T:s.destroyed&&(o=new S("write")),o?(r.nextTick(n,o),I(t,o,!0),o):(s.pendingcb++,U(t,s,e,i,n))}B.prototype.write=function(t,e,r){return x(this,t,e,r)===!0};B.prototype.cork=function(){this._writableState.corked++};B.prototype.uncork=function(){let t=this._writableState;t.corked&&(t.corked--,t.writing||W(this,t))};B.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=h(t)),!v.isEncoding(t))throw new j(t);return this._writableState.defaultEncoding=t,this};function U(t,e,r,i,n){let s=e.objectMode?1:r.length;e.length+=s;let o=e.length<e.highWaterMark;return o||(e.needDrain=!0),e.writing||e.corked||e.errored||!e.constructed?(e.buffered.push({chunk:r,encoding:i,callback:n}),e.allBuffers&&i!=="buffer"&&(e.allBuffers=!1),e.allNoop&&n!==M&&(e.allNoop=!1)):(e.writelen=s,e.writecb=n,e.writing=!0,e.sync=!0,t._write(r,i,e.onwrite),e.sync=!1),o&&!e.errored&&!e.destroyed}function F(t,e,r,i,n,s,o){e.writelen=i,e.writecb=o,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new S("write")):r?t._writev(n,e.onwrite):t._write(n,s,e.onwrite),e.sync=!1}function $(t,e,r,i){--e.pendingcb,i(r),z(e),I(t,r)}function L(t,e){let i=t._writableState,n=i.sync,s=i.writecb;if(typeof s!="function"){I(t,new A);return}i.writing=!1,i.writecb=null,i.length-=i.writelen,i.writelen=0,e?(i.errored||(i.errored=e),t._readableState&&!t._readableState.errored&&(t._readableState.errored=e),n?r.nextTick($,t,i,e,s):$(t,i,e,s)):(i.buffered.length>i.bufferedIndex&&W(t,i),n?i.afterWriteTickInfo!==null&&i.afterWriteTickInfo.cb===s?i.afterWriteTickInfo.count++:(i.afterWriteTickInfo={count:1,cb:s,stream:t,state:i},r.nextTick(D,i.afterWriteTickInfo)):q(t,i,1,s))}function D({stream:t,state:e,count:r,cb:i}){return e.afterWriteTickInfo=null,q(t,e,r,i)}function q(t,e,r,i){for(!e.ending&&!t.destroyed&&e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"));r-- >0;)e.pendingcb--,i();e.destroyed&&z(e),K(t,e)}function z(t){if(t.writing)return;for(let r=t.bufferedIndex;r<t.buffered.length;++r){var e;let{chunk:i,callback:n}=t.buffered[r],s=t.objectMode?1:i.length;t.length-=s,n((e=t.errored)!==null&&e!==void 0?e:new S("write"))}let r=t[C].splice(0);for(let e=0;e<r.length;e++){var i;r[e]((i=t.errored)!==null&&i!==void 0?i:new S("end"))}N(t)}function W(t,e){if(e.corked||e.bufferProcessing||e.destroyed||!e.constructed)return;let{buffered:r,bufferedIndex:n,objectMode:s}=e,o=r.length-n;if(!o)return;let u=n;if(e.bufferProcessing=!0,o>1&&t._writev){e.pendingcb-=o-1;let n=e.allNoop?M:t=>{for(let e=u;e<r.length;++e)r[e].callback(t)},s=e.allNoop&&u===0?r:i(r,u);s.allBuffers=e.allBuffers,F(t,e,!0,e.length,s,"",n),N(e)}else{do{let{chunk:i,encoding:n,callback:o}=r[u];r[u++]=null;let a=s?1:i.length;F(t,e,!1,a,i,n,o)}while(u<r.length&&!e.writing);u===r.length?N(e):u>256?(r.splice(0,u),e.bufferedIndex=0):e.bufferedIndex=u}e.bufferProcessing=!1}B.prototype._write=function(t,e,r){if(this._writev)this._writev([{chunk:t,encoding:e}],r);else throw new _("_write()")};B.prototype._writev=null;B.prototype.end=function(t,e,i){let s=this._writableState;typeof t=="function"?(i=t,t=null,e=null):typeof e=="function"&&(i=e,e=null);let o;if(t!=null){let r=x(this,t,e);r instanceof n&&(o=r)}return s.corked&&(s.corked=1,this.uncork()),o||(!s.errored&&!s.ending?(s.ending=!0,K(this,s,!0),s.ended=!0):s.finished?o=new O("end"):s.destroyed&&(o=new S("end"))),typeof i=="function"&&(o||s.finished?r.nextTick(i,o):s[C].push(i)),this};function G(t){return t.ending&&!t.destroyed&&t.constructed&&t.length===0&&!t.errored&&t.buffered.length===0&&!t.finished&&!t.writing&&!t.errorEmitted&&!t.closeEmitted}function V(t,e){let i=!1;function n(n){if(i){I(t,n??A());return}if(i=!0,e.pendingcb--,n){let r=e[C].splice(0);for(let t=0;t<r.length;t++)r[t](n);I(t,n,e.sync)}else G(e)&&(e.prefinished=!0,t.emit("prefinish"),e.pendingcb++,r.nextTick(Q,t,e))}e.sync=!0,e.pendingcb++;try{t._final(n)}catch(t){n(t)}e.sync=!1}function H(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.finalCalled=!0,V(t,e)):(e.prefinished=!0,t.emit("prefinish")))}function K(t,e,i){G(e)&&(H(t,e),e.pendingcb===0&&(i?(e.pendingcb++,r.nextTick(((t,e)=>{G(e)?Q(t,e):e.pendingcb--}),t,e)):G(e)&&(e.pendingcb++,Q(t,e))))}function Q(t,e){e.pendingcb--,e.finished=!0;let r=e[C].splice(0);for(let t=0;t<r.length;t++)r[t]();if(t.emit("finish"),e.autoDestroy){let e=t._readableState;(!e||e.autoDestroy&&(e.endEmitted||e.readable===!1))&&t.destroy()}}u(B.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(t){this._writableState&&(this._writableState.destroyed=t)}},writable:{__proto__:null,get(){let t=this._writableState;return!!t&&t.writable!==!1&&!t.destroyed&&!t.errored&&!t.ending&&!t.ended},set(t){this._writableState&&(this._writableState.writable=!!t)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let t=this._writableState;return t?!t.destroyed&&!t.ending&&t.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var Y=w.destroy;B.prototype.destroy=function(t,e){let i=this._writableState;return!i.destroyed&&(i.bufferedIndex<i.buffered.length||i[C].length)&&r.nextTick(z,i),Y.call(this,t,e),this};B.prototype._undestroy=w.undestroy;B.prototype._destroy=function(t,e){e(t)};B.prototype[c.captureRejectionSymbol]=function(t){this.destroy(t)};var J;function Z(){return J===void 0&&(J={}),J}B.fromWeb=function(t,e){return Z().newStreamWritableFromWritableStream(t,e)};B.toWeb=function(t){return Z().newWritableStreamFromStreamWritable(t)}}));var bi=f(((t,e)=>{p();ue();Gt();var r=pe(),i=(oe(),d(Vt)),{isReadable:n,isWritable:s,isIterable:o,isNodeStream:u,isReadableNodeStream:a,isWritableNodeStream:h,isDuplexNodeStream:f}=be(),l=ve(),{AbortError:c,codes:{ERR_INVALID_ARG_TYPE:b,ERR_INVALID_RETURN_VALUE:v}}=ce(),{destroyer:w}=we(),y=vi(),m=di(),{createDeferredPromise:g}=fe(),E=ci(),_=globalThis.Blob||i.Blob,A=typeof _<"u"?function(t){return t instanceof _}:function(t){return!1},k=globalThis.AbortController||le().AbortController,{FunctionPrototypeCall:S}=he(),O=class extends y{constructor(t){super(t),t?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),t?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};e.exports=function t(e,i){if(f(e))return e;if(a(e))return T({readable:e});if(h(e))return T({writable:e});if(u(e))return T({writable:!1,readable:!1});if(typeof e=="function"){let{value:t,write:n,final:s,destroy:u}=R(e);if(o(t))return E(O,t,{objectMode:!0,write:n,final:s,destroy:u});let a=t?.then;if(typeof a=="function"){let e,i=S(a,t,(t=>{if(t!=null)throw new v("nully","body",t)}),(t=>{w(e,t)}));return e=new O({objectMode:!0,readable:!1,write:n,final(t){s((async()=>{try{await i,r.nextTick(t,null)}catch(e){r.nextTick(t,e)}}))},destroy:u})}throw new v("Iterable, AsyncIterable or AsyncFunction",i,t)}if(A(e))return t(e.arrayBuffer());if(o(e))return E(O,e,{objectMode:!0,writable:!1});if(typeof e?.writable=="object"||typeof e?.readable=="object"){let r=e!=null&&e.readable?a(e?.readable)?e?.readable:t(e.readable):void 0,i=e!=null&&e.writable?h(e?.writable)?e?.writable:t(e.writable):void 0;return T({readable:r,writable:i})}let n=e?.then;if(typeof n=="function"){let t;return S(n,e,(e=>{e!=null&&t.push(e),t.push(null)}),(e=>{w(t,e)})),t=new O({objectMode:!0,writable:!1,read(){}})}throw new b(i,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],e)};function R(t){let{promise:e,resolve:i}=g(),n=new k,s=n.signal;return{value:t(async function*(){for(;;){let t=e;e=null;let{chunk:n,done:o,cb:u}=await t;if(r.nextTick(u),o)return;if(s.aborted)throw new c(void 0,{cause:s.reason});({promise:e,resolve:i}=g()),yield n}}(),{signal:s}),write(t,e,r){let n=i;i=null,n({chunk:t,done:!1,cb:r})},final(t){let e=i;i=null,e({done:!0,cb:t})},destroy(t,e){n.abort(),e(t)}}}function T(t){let e=t.readable&&typeof t.readable.read!="function"?m.wrap(t.readable):t.readable,r=t.writable,i=!!n(e),o=!!s(r),u,a,h,f,d;function p(t){let e=f;f=null,e?e(t):t&&d.destroy(t)}return d=new O({readableObjectMode:!!(e!=null&&e.readableObjectMode),writableObjectMode:!!(r!=null&&r.writableObjectMode),readable:i,writable:o}),o&&(l(r,(t=>{o=!1,t&&w(e,t),p(t)})),d._write=function(t,e,i){r.write(t,e)?i():u=i},d._final=function(t){r.end(),a=t},r.on("drain",(function(){if(u){let t=u;u=null,t()}})),r.on("finish",(function(){if(a){let t=a;a=null,t()}}))),i&&(l(e,(t=>{i=!1,t&&w(e,t),p(t)})),e.on("readable",(function(){if(h){let t=h;h=null,t()}})),e.on("end",(function(){d.push(null)})),d._read=function(){for(;;){let t=e.read();if(t===null){h=d._read;return}if(!d.push(t))return}}),d._destroy=function(t,i){!t&&f!==null&&(t=new c),h=null,u=null,a=null,f===null?i(t):(f=i,w(r,t),w(e,t))},d}}));var vi=f(((t,e)=>{p();ue();Gt();var{ObjectDefineProperties:r,ObjectGetOwnPropertyDescriptor:i,ObjectKeys:n,ObjectSetPrototypeOf:s}=he();e.exports=a;var o=di(),u=pi();s(a.prototype,o.prototype);s(a,o);{let t=n(u.prototype);for(let e=0;e<t.length;e++){let r=t[e];a.prototype[r]||(a.prototype[r]=u.prototype[r])}}function a(t){if(!(this instanceof a))return new a(t);o.call(this,t),u.call(this,t),t?(this.allowHalfOpen=t.allowHalfOpen!==!1,t.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),t.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}r(a.prototype,{writable:{__proto__:null,...i(u.prototype,"writable")},writableHighWaterMark:{__proto__:null,...i(u.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...i(u.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...i(u.prototype,"writableBuffer")},writableLength:{__proto__:null,...i(u.prototype,"writableLength")},writableFinished:{__proto__:null,...i(u.prototype,"writableFinished")},writableCorked:{__proto__:null,...i(u.prototype,"writableCorked")},writableEnded:{__proto__:null,...i(u.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...i(u.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(t){this._readableState&&this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}});var h;function f(){return h===void 0&&(h={}),h}a.fromWeb=function(t,e){return f().newStreamDuplexFromReadableWritablePair(t,e)};a.toWeb=function(t){return f().newReadableWritablePairFromDuplex(t)};var l;a.from=function(t){return l||(l=bi()),l(t,"body")}}));var wi=f(((t,e)=>{p();ue();Gt();var{ObjectSetPrototypeOf:r,Symbol:i}=he();e.exports=a;var{ERR_METHOD_NOT_IMPLEMENTED:n}=ce().codes,s=vi(),{getHighWaterMark:o}=Ve();r(a.prototype,s.prototype);r(a,s);var u=i("kCallback");function a(t){if(!(this instanceof a))return new a(t);let e=t?o(this,t,"readableHighWaterMark",!0):null;e===0&&(t={...t,highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:t.writableHighWaterMark||0}),s.call(this,t),this._readableState.sync=!1,this[u]=null,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",f)}function h(t){typeof this._flush=="function"&&!this.destroyed?this._flush(((e,r)=>{if(e){t?t(e):this.destroy(e);return}r!=null&&this.push(r),this.push(null),t&&t()})):(this.push(null),t&&t())}function f(){this._final!==h&&h.call(this)}a.prototype._final=h;a.prototype._transform=function(t,e,r){throw new n("_transform()")};a.prototype._write=function(t,e,r){let i=this._readableState,n=this._writableState,s=i.length;this._transform(t,e,((t,e)=>{if(t){r(t);return}e!=null&&this.push(e),n.ended||s===i.length||i.length<i.highWaterMark?r():this[u]=r}))};a.prototype._read=function(){if(this[u]){let t=this[u];this[u]=null,t()}}}));var yi=f(((t,e)=>{p();ue();Gt();var{ObjectSetPrototypeOf:r}=he();e.exports=n;var i=wi();r(n.prototype,i.prototype);r(n,i);function n(t){if(!(this instanceof n))return new n(t);i.call(this,t)}n.prototype._transform=function(t,e,r){r(null,t)}}));var mi=f(((t,e)=>{p();ue();Gt();var r=pe(),{ArrayIsArray:i,Promise:n,SymbolAsyncIterator:s}=he(),o=ve(),{once:u}=fe(),a=we(),h=vi(),{aggregateTwoErrors:f,codes:{ERR_INVALID_ARG_TYPE:l,ERR_INVALID_RETURN_VALUE:c,ERR_MISSING_ARGS:d,ERR_STREAM_DESTROYED:b,ERR_STREAM_PREMATURE_CLOSE:v},AbortError:w}=ce(),{validateFunction:y,validateAbortSignal:m}=de(),{isIterable:g,isReadable:E,isReadableNodeStream:_,isNodeStream:A,isTransformStream:k,isWebStream:S,isReadableStream:O,isReadableEnded:R}=be(),T=globalThis.AbortController||le().AbortController,j,I;function M(t,e,r){let i=!1;t.on("close",(()=>{i=!0}));let n=o(t,{readable:e,writable:r},(t=>{i=!t}));return{destroy:e=>{i||(i=!0,a.destroyer(t,e||new b("pipe")))},cleanup:n}}function C(t){return y(t[t.length-1],"streams[stream.length - 1]"),t.pop()}function P(t){if(g(t))return t;if(_(t))return N(t);throw new l("val",["Readable","Iterable","AsyncIterable"],t)}async function*N(t){I||(I=di()),yield*I.prototype[s].call(t)}async function B(t,e,r,{end:i}){let s,u=null,a=t=>{if(t&&(s=t),u){let t=u;u=null,t()}},h=()=>new n(((t,e)=>{s?e(s):u=()=>{s?e(s):t()}}));e.on("drain",a);let l=o(e,{readable:!1},a);try{e.writableNeedDrain&&await h();for await(let r of t)e.write(r)||await h();i&&e.end(),await h(),r()}catch(t){r(s!==t?f(s,t):t)}finally{l(),e.off("drain",a)}}async function x(t,e,r,{end:i}){k(e)&&(e=e.writable);let n=e.getWriter();try{for await(let e of t)await n.ready,n.write(e).catch((()=>{}));await n.ready,i&&await n.close(),r()}catch(t){try{await n.abort(t),r(t)}catch(t){r(t)}}}function U(...t){return F(t,u(C(t)))}function F(t,e,n){if(t.length===1&&i(t[0])&&(t=t[0]),t.length<2)throw new d("streams");let s=new T,o=s.signal,u=n?.signal,a=[];m(u,"options.signal");function f(){I(new w)}u?.addEventListener("abort",f);let p,b,v=[],y=0;function R(t){I(t,--y===0)}function I(t,i){if(t&&(!p||p.code==="ERR_STREAM_PREMATURE_CLOSE")&&(p=t),!(!p&&!i)){for(;v.length;)v.shift()(p);u?.removeEventListener("abort",f),s.abort(),i&&(p||a.forEach((t=>t())),r.nextTick(e,p,b))}}let C;for(let e=0;e<t.length;e++){let i=t[e],s=e<t.length-1,u=e>0,f=s||n?.end!==!1,d=e===t.length-1;if(A(i)){let t=function(t){t&&t.name!=="AbortError"&&t.code!=="ERR_STREAM_PREMATURE_CLOSE"&&R(t)};if(f){let{destroy:t,cleanup:e}=M(i,s,u);v.push(t),E(i)&&d&&a.push(e)}i.on("error",t),E(i)&&d&&a.push((()=>{i.removeListener("error",t)}))}if(e===0)if(typeof i=="function"){if(C=i({signal:o}),!g(C))throw new c("Iterable, AsyncIterable or Stream","source",C)}else g(i)||_(i)||k(i)?C=i:C=h.from(i);else if(typeof i=="function"){if(k(C)){var N;C=P((N=C)===null||N===void 0?void 0:N.readable)}else C=P(C);if(C=i(C,{signal:o}),s){if(!g(C,!0))throw new c("AsyncIterable",`transform[${e-1}]`,C)}else{var U;j||(j=yi());let t=new j({objectMode:!0}),e=(U=C)===null||U===void 0?void 0:U.then;if(typeof e=="function")y++,e.call(C,(e=>{b=e,e!=null&&t.write(e),f&&t.end(),r.nextTick(R)}),(e=>{t.destroy(e),r.nextTick(R,e)}));else if(g(C,!0))y++,B(C,t,R,{end:f});else if(O(C)||k(C)){let e=C.readable||C;y++,B(e,t,R,{end:f})}else throw new c("AsyncIterable or Promise","destination",C);C=t;let{destroy:i,cleanup:n}=M(C,!1,!0);v.push(i),d&&a.push(n)}}else if(A(i)){if(_(C)){y+=2;let t=$(C,i,R,{end:f});E(i)&&d&&a.push(t)}else if(k(C)||O(C)){let t=C.readable||C;y++,B(t,i,R,{end:f})}else if(g(C))y++,B(C,i,R,{end:f});else throw new l("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],C);C=i}else if(S(i)){if(_(C))y++,x(P(C),i,R,{end:f});else if(O(C)||g(C))y++,x(C,i,R,{end:f});else if(k(C))y++,x(C.readable,i,R,{end:f});else throw new l("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],C);C=i}else C=h.from(i)}return(o!=null&&o.aborted||u!=null&&u.aborted)&&r.nextTick(f),C}function $(t,e,i,{end:n}){let s=!1;if(e.on("close",(()=>{s||i(new v)})),t.pipe(e,{end:!1}),n){let i=function(){s=!0,e.end()};R(t)?r.nextTick(i):t.once("end",i)}else i();return o(t,{readable:!0,writable:!1},(e=>{let r=t._readableState;e&&e.code==="ERR_STREAM_PREMATURE_CLOSE"&&r&&r.ended&&!r.errored&&!r.errorEmitted?t.once("end",i).once("error",i):i(e)})),o(e,{readable:!1,writable:!0},i)}e.exports={pipelineImpl:F,pipeline:U}}));var gi=f(((t,e)=>{p();ue();Gt();var{pipeline:r}=mi(),i=vi(),{destroyer:n}=we(),{isNodeStream:s,isReadable:o,isWritable:u,isWebStream:a,isTransformStream:h,isWritableStream:f,isReadableStream:l}=be(),{AbortError:c,codes:{ERR_INVALID_ARG_VALUE:d,ERR_MISSING_ARGS:b}}=ce(),v=ve();e.exports=function(...t){if(t.length===0)throw new b("streams");if(t.length===1)return i.from(t[0]);let e=[...t];if(typeof t[0]=="function"&&(t[0]=i.from(t[0])),typeof t[t.length-1]=="function"){let e=t.length-1;t[e]=i.from(t[e])}for(let r=0;r<t.length;++r)if(!(!s(t[r])&&!a(t[r]))){if(r<t.length-1&&!(o(t[r])||l(t[r])||h(t[r])))throw new d(`streams[${r}]`,e[r],"must be readable");if(r>0&&!(u(t[r])||f(t[r])||h(t[r])))throw new d(`streams[${r}]`,e[r],"must be writable")}let p,w,y,m,g;function E(t){let e=m;m=null,e?e(t):t?g.destroy(t):!S&&!k&&g.destroy()}let _=t[0],A=r(t,E),k=!!(u(_)||f(_)||h(_)),S=!!(o(A)||l(A)||h(A));if(g=new i({writableObjectMode:!!(_!=null&&_.writableObjectMode),readableObjectMode:!!(A!=null&&A.writableObjectMode),writable:k,readable:S}),k){if(s(_))g._write=function(t,e,r){_.write(t,e)?r():p=r},g._final=function(t){_.end(),w=t},_.on("drain",(function(){if(p){let t=p;p=null,t()}}));else if(a(_)){let t=(h(_)?_.writable:_).getWriter();g._write=async function(e,r,i){try{await t.ready,t.write(e).catch((()=>{})),i()}catch(t){i(t)}},g._final=async function(e){try{await t.ready,t.close().catch((()=>{})),w=e}catch(t){e(t)}}}let t=h(A)?A.readable:A;v(t,(()=>{if(w){let t=w;w=null,t()}}))}if(S){if(s(A))A.on("readable",(function(){if(y){let t=y;y=null,t()}})),A.on("end",(function(){g.push(null)})),g._read=function(){for(;;){let t=A.read();if(t===null){y=g._read;return}if(!g.push(t))return}};else if(a(A)){let t=(h(A)?A.readable:A).getReader();g._read=async function(){for(;;)try{let{value:e,done:r}=await t.read();if(!g.push(e))return;if(r){g.push(null);return}}catch{return}}}}return g._destroy=function(t,e){!t&&m!==null&&(t=new c),y=null,p=null,w=null,m===null?e(t):(m=e,s(A)&&n(A,t))},g}}));var Ei=f(((t,e)=>{p();ue();Gt();var r=globalThis.AbortController||le().AbortController,{codes:{ERR_INVALID_ARG_VALUE:i,ERR_INVALID_ARG_TYPE:n,ERR_MISSING_ARGS:s,ERR_OUT_OF_RANGE:o},AbortError:u}=ce(),{validateAbortSignal:a,validateInteger:h,validateObject:f}=de(),l=he().Symbol("kWeak"),{finished:c}=ve(),d=gi(),{addAbortSignalNoValidate:b}=We(),{isWritable:v,isNodeStream:w}=be(),{ArrayPrototypePush:y,MathFloor:m,Number:g,NumberIsNaN:E,Promise:_,PromiseReject:A,PromisePrototypeThen:k,Symbol:S}=he(),O=S("kEmpty"),R=S("kEof");function T(t,e){if(e!=null&&f(e,"options"),e?.signal!=null&&a(e.signal,"options.signal"),w(t)&&!v(t))throw new i("stream",t,"must be writable");let r=d(this,t);return e!=null&&e.signal&&b(e.signal,r),r}function j(t,e){if(typeof t!="function")throw new n("fn",["Function","AsyncFunction"],t);e!=null&&f(e,"options"),e?.signal!=null&&a(e.signal,"options.signal");let i=1;return e?.concurrency!=null&&(i=m(e.concurrency)),h(i,"concurrency",1),async function*(){var n,s;let o=new r,a=this,h=[],f=o.signal,l={signal:f},c=()=>o.abort();e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted&&c(),e==null||(s=e.signal)===null||s===void 0||s.addEventListener("abort",c);let d,p,b=!1;function v(){b=!0}async function w(){try{for await(let e of a){var r;if(b)return;if(f.aborted)throw new u;try{e=t(e,l)}catch(t){e=A(t)}e!==O&&(typeof((r=e)===null||r===void 0?void 0:r.catch)=="function"&&e.catch(v),h.push(e),d&&(d(),d=null),!b&&h.length&&h.length>=i&&await new _((t=>{p=t})))}h.push(R)}catch(t){let e=A(t);k(e,void 0,v),h.push(e)}finally{var n;b=!0,d&&(d(),d=null),e==null||(n=e.signal)===null||n===void 0||n.removeEventListener("abort",c)}}w();try{for(;;){for(;h.length>0;){let t=await h[0];if(t===R)return;if(f.aborted)throw new u;t!==O&&(yield t),h.shift(),p&&(p(),p=null)}await new _((t=>{d=t}))}}finally{o.abort(),b=!0,p&&(p(),p=null)}}.call(this)}function I(t=void 0){return t!=null&&f(t,"options"),t?.signal!=null&&a(t.signal,"options.signal"),async function*(){let e=0;for await(let i of this){var r;if(t!=null&&(r=t.signal)!==null&&r!==void 0&&r.aborted)throw new u({cause:t.signal.reason});yield[e++,i]}}.call(this)}async function M(t,e=void 0){for await(let r of B.call(this,t,e))return!0;return!1}async function C(t,e=void 0){if(typeof t!="function")throw new n("fn",["Function","AsyncFunction"],t);return!await M.call(this,(async(...e)=>!await t(...e)),e)}async function P(t,e){for await(let r of B.call(this,t,e))return r}async function N(t,e){if(typeof t!="function")throw new n("fn",["Function","AsyncFunction"],t);async function r(e,r){return await t(e,r),O}for await(let t of j.call(this,r,e));}function B(t,e){if(typeof t!="function")throw new n("fn",["Function","AsyncFunction"],t);async function r(e,r){return await t(e,r)?e:O}return j.call(this,r,e)}var x=class extends s{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function U(t,e,i){var s;if(typeof t!="function")throw new n("reducer",["Function","AsyncFunction"],t);i!=null&&f(i,"options"),i?.signal!=null&&a(i.signal,"options.signal");let o=arguments.length>1;if(i!=null&&(s=i.signal)!==null&&s!==void 0&&s.aborted){let t=new u(void 0,{cause:i.signal.reason});throw this.once("error",(()=>{})),await c(this.destroy(t)),t}let h=new r,d=h.signal;if(i!=null&&i.signal){let t={once:!0,[l]:this};i.signal.addEventListener("abort",(()=>h.abort()),t)}let p=!1;try{for await(let r of this){var b;if(p=!0,i!=null&&(b=i.signal)!==null&&b!==void 0&&b.aborted)throw new u;o?e=await t(e,r,{signal:d}):(e=r,o=!0)}if(!p&&!o)throw new x}finally{h.abort()}return e}async function F(t){t!=null&&f(t,"options"),t?.signal!=null&&a(t.signal,"options.signal");let e=[];for await(let i of this){var r;if(t!=null&&(r=t.signal)!==null&&r!==void 0&&r.aborted)throw new u(void 0,{cause:t.signal.reason});y(e,i)}return e}function $(t,e){let r=j.call(this,t,e);return async function*(){for await(let t of r)yield*t}.call(this)}function L(t){if(t=g(t),E(t))return 0;if(t<0)throw new o("number",">= 0",t);return t}function D(t,e=void 0){return e!=null&&f(e,"options"),e?.signal!=null&&a(e.signal,"options.signal"),t=L(t),async function*(){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new u;for await(let r of this){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new u;t--<=0&&(yield r)}}.call(this)}function q(t,e=void 0){return e!=null&&f(e,"options"),e?.signal!=null&&a(e.signal,"options.signal"),t=L(t),async function*(){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new u;for await(let r of this){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new u;if(t-- >0)yield r;else return}}.call(this)}e.exports.streamReturningOperators={asIndexedPairs:I,drop:D,filter:B,flatMap:$,map:j,take:q,compose:T};e.exports.promiseReturningOperators={every:C,forEach:N,reduce:U,toArray:F,some:M,find:P}}));var _i=f(((t,e)=>{p();ue();Gt();var{ArrayPrototypePop:r,Promise:i}=he(),{isIterable:n,isNodeStream:s,isWebStream:o}=be(),{pipelineImpl:u}=mi(),{finished:a}=ve();Ai();function h(...t){return new i(((e,i)=>{let a,h,f=t[t.length-1];if(f&&typeof f=="object"&&!s(f)&&!n(f)&&!o(f)){let e=r(t);a=e.signal,h=e.end}u(t,((t,r)=>{t?i(t):e(r)}),{signal:a,end:h})}))}e.exports={finished:a,pipeline:h}}));var Ai=f(((t,e)=>{p();ue();Gt();var{Buffer:r}=(oe(),d(Vt)),{ObjectDefineProperty:i,ObjectKeys:n,ReflectApply:s}=he(),{promisify:{custom:o}}=fe(),{streamReturningOperators:u,promiseReturningOperators:a}=Ei(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:h}}=ce(),f=gi(),{pipeline:l}=mi(),{destroyer:c}=we(),b=ve(),v=_i(),w=be(),y=e.exports=ze().Stream;y.isDisturbed=w.isDisturbed;y.isErrored=w.isErrored;y.isReadable=w.isReadable;y.Readable=di();for(let t of n(u)){let e=function(...t){if(new.target)throw h();return y.Readable.from(s(r,this,t))};let r=u[t];i(e,"name",{__proto__:null,value:r.name}),i(e,"length",{__proto__:null,value:r.length}),i(y.Readable.prototype,t,{__proto__:null,value:e,enumerable:!1,configurable:!0,writable:!0})}for(let t of n(a)){let e=function(...t){if(new.target)throw h();return s(r,this,t)};let r=a[t];i(e,"name",{__proto__:null,value:r.name}),i(e,"length",{__proto__:null,value:r.length}),i(y.Readable.prototype,t,{__proto__:null,value:e,enumerable:!1,configurable:!0,writable:!0})}y.Writable=pi();y.Duplex=vi();y.Transform=wi();y.PassThrough=yi();y.pipeline=l;var{addAbortSignal:m}=We();y.addAbortSignal=m;y.finished=b;y.destroy=c;y.compose=f;i(y,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return v}});i(l,o,{__proto__:null,enumerable:!0,get(){return v.pipeline}});i(b,o,{__proto__:null,enumerable:!0,get(){return v.finished}});y.Stream=y;y._isUint8Array=function(t){return t instanceof Uint8Array};y._uint8ArrayToBuffer=function(t){return r.from(t.buffer,t.byteOffset,t.byteLength)}}));var ki=f(((t,e)=>{p();ue();Gt();var r=Ai(),i=_i(),n=r.Readable.destroy;e.exports=r.Readable;e.exports._uint8ArrayToBuffer=r._uint8ArrayToBuffer;e.exports._isUint8Array=r._isUint8Array;e.exports.isDisturbed=r.isDisturbed;e.exports.isErrored=r.isErrored;e.exports.isReadable=r.isReadable;e.exports.Readable=r.Readable;e.exports.Writable=r.Writable;e.exports.Duplex=r.Duplex;e.exports.Transform=r.Transform;e.exports.PassThrough=r.PassThrough;e.exports.addAbortSignal=r.addAbortSignal;e.exports.finished=r.finished;e.exports.destroy=r.destroy;e.exports.destroy=n;e.exports.pipeline=r.pipeline;e.exports.compose=r.compose;Object.defineProperty(r,"promises",{configurable:!0,enumerable:!0,get(){return i}});e.exports.Stream=r.Stream;e.exports.default=e.exports}));var Si=f(((t,e)=>{p();ue();Gt();typeof Object.create=="function"?e.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}}));var Oi=f(((t,e)=>{p();ue();Gt();var{Buffer:r}=(oe(),d(Vt)),i=Symbol.for("BufferList");function n(t){if(!(this instanceof n))return new n(t);n._init.call(this,t)}n._init=function(t){Object.defineProperty(this,i,{value:!0}),this._bufs=[],this.length=0,t&&this.append(t)};n.prototype._new=function(t){return new n(t)};n.prototype._offset=function(t){if(t===0)return[0,0];let e=0;for(let r=0;r<this._bufs.length;r++){let i=e+this._bufs[r].length;if(t<i||r===this._bufs.length-1)return[r,t-e];e=i}};n.prototype._reverseOffset=function(t){let e=t[0],r=t[1];for(let t=0;t<e;t++)r+=this._bufs[t].length;return r};n.prototype.get=function(t){if(t>this.length||t<0)return;let e=this._offset(t);return this._bufs[e[0]][e[1]]};n.prototype.slice=function(t,e){return typeof t=="number"&&t<0&&(t+=this.length),typeof e=="number"&&e<0&&(e+=this.length),this.copy(null,0,t,e)};n.prototype.copy=function(t,e,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 t||r.alloc(0);let s=!!t,o=this._offset(i),u=n-i,a=u,h=s&&e||0,f=o[1];if(i===0&&n===this.length){if(!s)return this._bufs.length===1?this._bufs[0]:r.concat(this._bufs,this.length);for(let e=0;e<this._bufs.length;e++)this._bufs[e].copy(t,h),h+=this._bufs[e].length;return t}if(a<=this._bufs[o[0]].length-f)return s?this._bufs[o[0]].copy(t,e,f,f+a):this._bufs[o[0]].slice(f,f+a);s||(t=r.allocUnsafe(u));for(let e=o[0];e<this._bufs.length;e++){let r=this._bufs[e].length-f;if(a>r)this._bufs[e].copy(t,h,f),h+=r;else{this._bufs[e].copy(t,h,f,f+a),h+=r;break}a-=r,f&&(f=0)}return t.length>h?t.slice(0,h):t};n.prototype.shallowSlice=function(t,e){if(t=t||0,e=typeof e!="number"?this.length:e,t<0&&(t+=this.length),e<0&&(e+=this.length),t===e)return this._new();let r=this._offset(t),i=this._offset(e),n=this._bufs.slice(r[0],i[0]+1);return i[1]===0?n.pop():n[n.length-1]=n[n.length-1].slice(0,i[1]),r[1]!==0&&(n[0]=n[0].slice(r[1])),this._new(n)};n.prototype.toString=function(t,e,r){return this.slice(e,r).toString(t)};n.prototype.consume=function(t){if(t=Math.trunc(t),Number.isNaN(t)||t<=0)return this;for(;this._bufs.length;)if(t>=this._bufs[0].length)t-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(t),this.length-=t;break}return this};n.prototype.duplicate=function(){let t=this._new();for(let e=0;e<this._bufs.length;e++)t.append(this._bufs[e]);return t};n.prototype.append=function(t){if(t==null)return this;if(t.buffer)this._appendBuffer(r.from(t.buffer,t.byteOffset,t.byteLength));else if(Array.isArray(t))for(let e=0;e<t.length;e++)this.append(t[e]);else if(this._isBufferList(t))for(let e=0;e<t._bufs.length;e++)this.append(t._bufs[e]);else typeof t=="number"&&(t=t.toString()),this._appendBuffer(r.from(t));return this};n.prototype._appendBuffer=function(t){this._bufs.push(t),this.length+=t.length};n.prototype.indexOf=function(t,e,i){if(i===void 0&&typeof e=="string"&&(i=e,e=void 0),typeof t=="function"||Array.isArray(t))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if(typeof t=="number"?t=r.from([t]):typeof t=="string"?t=r.from(t,i):this._isBufferList(t)?t=t.slice():Array.isArray(t.buffer)?t=r.from(t.buffer,t.byteOffset,t.byteLength):r.isBuffer(t)||(t=r.from(t)),e=Number(e||0),isNaN(e)&&(e=0),e<0&&(e=this.length+e),e<0&&(e=0),t.length===0)return e>this.length?this.length:e;let n=this._offset(e),s=n[0],o=n[1];for(;s<this._bufs.length;s++){let e=this._bufs[s];for(;o<e.length;)if(e.length-o>=t.length){let r=e.indexOf(t,o);if(r!==-1)return this._reverseOffset([s,r]);o=e.length-t.length+1}else{let e=this._reverseOffset([s,o]);if(this._match(e,t))return e;o++}o=0}return-1};n.prototype._match=function(t,e){if(this.length-t<e.length)return!1;for(let r=0;r<e.length;r++)if(this.get(t+r)!==e[r])return!1;return!0};(function(){let t={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readBigInt64BE:8,readBigInt64LE:8,readBigUInt64BE:8,readBigUInt64LE:8,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(let e in t)(function(e){t[e]===null?n.prototype[e]=function(t,r){return this.slice(t,t+r)[e](0,r)}:n.prototype[e]=function(r=0){return this.slice(r,r+t[e])[e](0)}})(e)})();n.prototype._isBufferList=function(t){return t instanceof n||n.isBufferList(t)};n.isBufferList=function(t){return t!=null&&t[i]};e.exports=n}));var Ri=f(((t,e)=>{p();ue();Gt();var r=ki().Duplex,i=Si(),n=Oi();function s(t){if(!(this instanceof s))return new s(t);if(typeof t=="function"){this._callback=t;let e=function(t){this._callback&&(this._callback(t),this._callback=null)}.bind(this);this.on("pipe",(function(t){t.on("error",e)})),this.on("unpipe",(function(t){t.removeListener("error",e)})),t=null}n._init.call(this,t),r.call(this)}i(s,r);Object.assign(s.prototype,n.prototype);s.prototype._new=function(t){return new s(t)};s.prototype._write=function(t,e,r){this._appendBuffer(t),typeof r=="function"&&r()};s.prototype._read=function(t){if(!this.length)return this.push(null);t=Math.min(t,this.length),this.push(this.slice(0,t)),this.consume(t)};s.prototype.end=function(t){r.prototype.end.call(this,t),this._callback&&(this._callback(null,this.slice()),this._callback=null)};s.prototype._destroy=function(t,e){this._bufs.length=0,this.length=0,e(t)};s.prototype._isBufferList=function(t){return t instanceof s||t instanceof n||s.isBufferList(t)};s.isBufferList=n.isBufferList;e.exports=s;e.exports.BufferListStream=s;e.exports.BufferList=n}));var Ti=f(((t,e)=>{p();ue();Gt();var r=class{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}};e.exports=r}));var ji=f(((t,e)=>{p();ue();Gt();var r=e.exports,{Buffer:i}=(oe(),d(Vt));r.types={0:"reserved",1:"connect",2:"connack",3:"publish",4:"puback",5:"pubrec",6:"pubrel",7:"pubcomp",8:"subscribe",9:"suback",10:"unsubscribe",11:"unsuback",12:"pingreq",13:"pingresp",14:"disconnect",15:"auth"};r.requiredHeaderFlags={1:0,2:0,4:0,5:0,6:2,7:0,8:2,9:0,10:2,11:0,12:0,13:0,14:0,15:0};r.requiredHeaderFlagsErrors={};for(let t in r.requiredHeaderFlags){let e=r.requiredHeaderFlags[t];r.requiredHeaderFlagsErrors[t]="Invalid header flag bits, must be 0x"+e.toString(16)+" for "+r.types[t]+" packet"}r.codes={};for(let t in r.types){let e=r.types[t];r.codes[e]=t}r.CMD_SHIFT=4;r.CMD_MASK=240;r.DUP_MASK=8;r.QOS_MASK=3;r.QOS_SHIFT=1;r.RETAIN_MASK=1;r.VARBYTEINT_MASK=127;r.VARBYTEINT_FIN_MASK=128;r.VARBYTEINT_MAX=268435455;r.SESSIONPRESENT_MASK=1;r.SESSIONPRESENT_HEADER=i.from([r.SESSIONPRESENT_MASK]);r.CONNACK_HEADER=i.from([r.codes.connack<<r.CMD_SHIFT]);r.USERNAME_MASK=128;r.PASSWORD_MASK=64;r.WILL_RETAIN_MASK=32;r.WILL_QOS_MASK=24;r.WILL_QOS_SHIFT=3;r.WILL_FLAG_MASK=4;r.CLEAN_SESSION_MASK=2;r.CONNECT_HEADER=i.from([r.codes.connect<<r.CMD_SHIFT]);r.properties={sessionExpiryInterval:17,willDelayInterval:24,receiveMaximum:33,maximumPacketSize:39,topicAliasMaximum:34,requestResponseInformation:25,requestProblemInformation:23,userProperties:38,authenticationMethod:21,authenticationData:22,payloadFormatIndicator:1,messageExpiryInterval:2,contentType:3,responseTopic:8,correlationData:9,maximumQoS:36,retainAvailable:37,assignedClientIdentifier:18,reasonString:31,wildcardSubscriptionAvailable:40,subscriptionIdentifiersAvailable:41,sharedSubscriptionAvailable:42,serverKeepAlive:19,responseInformation:26,serverReference:28,topicAlias:35,subscriptionIdentifier:11};r.propertiesCodes={};for(let t in r.properties){let e=r.properties[t];r.propertiesCodes[e]=t}r.propertiesTypes={sessionExpiryInterval:"int32",willDelayInterval:"int32",receiveMaximum:"int16",maximumPacketSize:"int32",topicAliasMaximum:"int16",requestResponseInformation:"byte",requestProblemInformation:"byte",userProperties:"pair",authenticationMethod:"string",authenticationData:"binary",payloadFormatIndicator:"byte",messageExpiryInterval:"int32",contentType:"string",responseTopic:"string",correlationData:"binary",maximumQoS:"int8",retainAvailable:"byte",assignedClientIdentifier:"string",reasonString:"string",wildcardSubscriptionAvailable:"byte",subscriptionIdentifiersAvailable:"byte",sharedSubscriptionAvailable:"byte",serverKeepAlive:"int16",responseInformation:"string",serverReference:"string",topicAlias:"int16",subscriptionIdentifier:"var"};function n(t){return[0,1,2].map((e=>[0,1].map((n=>[0,1].map((s=>{let o=i.alloc(1);return o.writeUInt8(r.codes[t]<<r.CMD_SHIFT|(n?r.DUP_MASK:0)|e<<r.QOS_SHIFT|s,0,!0),o}))))))}r.PUBLISH_HEADER=n("publish");r.SUBSCRIBE_HEADER=n("subscribe");r.SUBSCRIBE_OPTIONS_QOS_MASK=3;r.SUBSCRIBE_OPTIONS_NL_MASK=1;r.SUBSCRIBE_OPTIONS_NL_SHIFT=2;r.SUBSCRIBE_OPTIONS_RAP_MASK=1;r.SUBSCRIBE_OPTIONS_RAP_SHIFT=3;r.SUBSCRIBE_OPTIONS_RH_MASK=3;r.SUBSCRIBE_OPTIONS_RH_SHIFT=4;r.SUBSCRIBE_OPTIONS_RH=[0,16,32];r.SUBSCRIBE_OPTIONS_NL=4;r.SUBSCRIBE_OPTIONS_RAP=8;r.SUBSCRIBE_OPTIONS_QOS=[0,1,2];r.UNSUBSCRIBE_HEADER=n("unsubscribe");r.ACKS={unsuback:n("unsuback"),puback:n("puback"),pubcomp:n("pubcomp"),pubrel:n("pubrel"),pubrec:n("pubrec")};r.SUBACK_HEADER=i.from([r.codes.suback<<r.CMD_SHIFT]);r.VERSION3=i.from([3]);r.VERSION4=i.from([4]);r.VERSION5=i.from([5]);r.VERSION131=i.from([131]);r.VERSION132=i.from([132]);r.QOS=[0,1,2].map((t=>i.from([t])));r.EMPTY={pingreq:i.from([r.codes.pingreq<<4,0]),pingresp:i.from([r.codes.pingresp<<4,0]),disconnect:i.from([r.codes.disconnect<<4,0])};r.MQTT5_PUBACK_PUBREC_CODES={0:"Success",16:"No matching subscribers",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",144:"Topic Name invalid",145:"Packet identifier in use",151:"Quota exceeded",153:"Payload format invalid"};r.MQTT5_PUBREL_PUBCOMP_CODES={0:"Success",146:"Packet Identifier not found"};r.MQTT5_SUBACK_CODES={0:"Granted QoS 0",1:"Granted QoS 1",2:"Granted QoS 2",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",143:"Topic Filter invalid",145:"Packet Identifier in use",151:"Quota exceeded",158:"Shared Subscriptions not supported",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"};r.MQTT5_UNSUBACK_CODES={0:"Success",17:"No subscription existed",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",143:"Topic Filter invalid",145:"Packet Identifier in use"};r.MQTT5_DISCONNECT_CODES={0:"Normal disconnection",4:"Disconnect with Will Message",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",135:"Not authorized",137:"Server busy",139:"Server shutting down",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",147:"Receive Maximum exceeded",148:"Topic Alias invalid",149:"Packet too large",150:"Message rate too high",151:"Quota exceeded",152:"Administrative action",153:"Payload format invalid",154:"Retain not supported",155:"QoS not supported",156:"Use another server",157:"Server moved",158:"Shared Subscriptions not supported",159:"Connection rate exceeded",160:"Maximum connect time",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"};r.MQTT5_AUTH_CODES={0:"Success",24:"Continue authentication",25:"Re-authenticate"}}));var Ii=f(((t,e)=>{p();ue();Gt();var r=1e3,i=r*60,n=i*60,s=n*24,o=s*7,u=s*365.25;e.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return a(t);if(r==="number"&&isFinite(t))return e.long?f(t):h(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function a(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var a=parseFloat(e[1]),h=(e[2]||"ms").toLowerCase();switch(h){case"years":case"year":case"yrs":case"yr":case"y":return a*u;case"weeks":case"week":case"w":return a*o;case"days":case"day":case"d":return a*s;case"hours":case"hour":case"hrs":case"hr":case"h":return a*n;case"minutes":case"minute":case"mins":case"min":case"m":return a*i;case"seconds":case"second":case"secs":case"sec":case"s":return a*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}}}function h(t){var e=Math.abs(t);return e>=s?Math.round(t/s)+"d":e>=n?Math.round(t/n)+"h":e>=i?Math.round(t/i)+"m":e>=r?Math.round(t/r)+"s":t+"ms"}function f(t){var e=Math.abs(t);return e>=s?l(t,e,s,"day"):e>=n?l(t,e,n,"hour"):e>=i?l(t,e,i,"minute"):e>=r?l(t,e,r,"second"):t+" ms"}function l(t,e,r,i){var n=e>=r*1.5;return Math.round(t/r)+" "+i+(n?"s":"")}}));var Mi=f(((t,e)=>{p();ue();Gt();function r(t){r.debug=r,r.default=r,r.coerce=a,r.disable=s,r.enable=n,r.enabled=o,r.humanize=Ii(),r.destroy=h,Object.keys(t).forEach((e=>{r[e]=t[e]})),r.names=[],r.skips=[],r.formatters={};function e(t){let e=0;for(let r=0;r<t.length;r++)e=(e<<5)-e+t.charCodeAt(r),e|=0;return r.colors[Math.abs(e)%r.colors.length]}r.selectColor=e;function r(t){let e,n=null,s,o;function u(...t){if(!u.enabled)return;let i=u,n=Number(new Date),s=n-(e||n);i.diff=s,i.prev=e,i.curr=n,e=n,t[0]=r.coerce(t[0]),typeof t[0]!="string"&&t.unshift("%O");let o=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,((e,n)=>{if(e==="%%")return"%";o++;let s=r.formatters[n];if(typeof s=="function"){let r=t[o];e=s.call(i,r),t.splice(o,1),o--}return e})),r.formatArgs.call(i,t),(i.log||r.log).apply(i,t)}return u.namespace=t,u.useColors=r.useColors(),u.color=r.selectColor(t),u.extend=i,u.destroy=r.destroy,Object.defineProperty(u,"enabled",{enumerable:!0,configurable:!1,get:()=>n!==null?n:(s!==r.namespaces&&(s=r.namespaces,o=r.enabled(t)),o),set:t=>{n=t}}),typeof r.init=="function"&&r.init(u),u}function i(t,e){let i=r(this.namespace+(typeof e>"u"?":":e)+t);return i.log=this.log,i}function n(t){r.save(t),r.namespaces=t,r.names=[],r.skips=[];let e,i=(typeof t=="string"?t:"").split(/[\s,]+/),n=i.length;for(e=0;e<n;e++)i[e]&&(t=i[e].replace(/\*/g,".*?"),t[0]==="-"?r.skips.push(new RegExp("^"+t.slice(1)+"$")):r.names.push(new RegExp("^"+t+"$")))}function s(){let t=[...r.names.map(u),...r.skips.map(u).map((t=>"-"+t))].join(",");return r.enable(""),t}function o(t){if(t[t.length-1]==="*")return!0;let e,i;for(e=0,i=r.skips.length;e<i;e++)if(r.skips[e].test(t))return!1;for(e=0,i=r.names.length;e<i;e++)if(r.names[e].test(t))return!0;return!1}function u(t){return t.toString().substring(2,t.toString().length-2).replace(/\.\*\?$/,"*")}function a(t){return t instanceof Error?t.stack||t.message:t}function h(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}e.exports=r}));var Ci=f(((t,e)=>{p();ue();Gt();t.formatArgs=i;t.save=n;t.load=s;t.useColors=r;t.storage=o();t.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function i(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;let r="color: "+this.color;t.splice(1,0,r,"color: inherit");let i=0,n=0;t[0].replace(/%[a-zA-Z%]/g,(t=>{t!=="%%"&&(i++,t==="%c"&&(n=i))})),t.splice(n,0,r)}t.log=console.debug||console.log||(()=>{});function n(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch{}}function s(){let e;try{e=t.storage.getItem("debug")}catch{}return!e&&typeof b<"u"&&"env"in b&&(e=b.env.DEBUG),e}function o(){try{return localStorage}catch{}}e.exports=Mi()(t);var{formatters:u}=e.exports;u.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}));var Pi=f(((t,e)=>{p();ue();Gt();var r=Ri(),{EventEmitter:i}=(qe(),d(Be)),n=Ti(),s=ji(),o=Ci()("mqtt-packet:parser"),u=class t extends i{constructor(){super(),this.parser=this.constructor.parser}static parser(e){return this instanceof t?(this.settings=e||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):(new t).parser(e)}_resetState(){o("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new n,this.error=null,this._list=r(),this._stateCounter=0}parse(t){for(this.error&&this._resetState(),this._list.append(t),o("parse: current state: %s",this._states[this._stateCounter]);(this.packet.length!==-1||this._list.length>0)&&this[this._states[this._stateCounter]]()&&!this.error;)this._stateCounter++,o("parse: state complete. _stateCounter is now: %d",this._stateCounter),o("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return o("parse: exited while loop. packet: %d, buffer list length: %d",this.packet.length,this._list.length),this._list.length}_parseHeader(){let t=this._list.readUInt8(0),e=t>>s.CMD_SHIFT;this.packet.cmd=s.types[e];let r=t&15,i=s.requiredHeaderFlags[e];return i!=null&&r!==i?this._emitError(new Error(s.requiredHeaderFlagsErrors[e])):(this.packet.retain=(t&s.RETAIN_MASK)!==0,this.packet.qos=t>>s.QOS_SHIFT&s.QOS_MASK,this.packet.qos>2?this._emitError(new Error("Packet must not have both QoS bits set to 1")):(this.packet.dup=(t&s.DUP_MASK)!==0,o("_parseHeader: packet: %o",this.packet),this._list.consume(1),!0))}_parseLength(){let t=this._parseVarByteNum(!0);return t&&(this.packet.length=t.value,this._list.consume(t.bytes)),o("_parseLength %d",t.value),!!t}_parsePayload(){o("_parsePayload: payload %O",this._list);let t=!1;if(this.packet.length===0||this._list.length>=this.packet.length){switch(this._pos=0,this.packet.cmd){case"connect":this._parseConnect();break;case"connack":this._parseConnack();break;case"publish":this._parsePublish();break;case"puback":case"pubrec":case"pubrel":case"pubcomp":this._parseConfirmation();break;case"subscribe":this._parseSubscribe();break;case"suback":this._parseSuback();break;case"unsubscribe":this._parseUnsubscribe();break;case"unsuback":this._parseUnsuback();break;case"pingreq":case"pingresp":break;case"disconnect":this._parseDisconnect();break;case"auth":this._parseAuth();break;default:this._emitError(new Error("Not supported"))}t=!0}return o("_parsePayload complete result: %s",t),t}_parseConnect(){o("_parseConnect");let t,e,r,i,n={},u=this.packet,a=this._parseString();if(a===null)return this._emitError(new Error("Cannot parse protocolId"));if(a!=="MQTT"&&a!=="MQIsdp")return this._emitError(new Error("Invalid protocolId"));if(u.protocolId=a,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(u.protocolVersion=this._list.readUInt8(this._pos),u.protocolVersion>=128&&(u.bridgeMode=!0,u.protocolVersion=u.protocolVersion-128),u.protocolVersion!==3&&u.protocolVersion!==4&&u.protocolVersion!==5)return this._emitError(new Error("Invalid protocol version"));if(this._pos++,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(this._list.readUInt8(this._pos)&1)return this._emitError(new Error("Connect flag bit 0 must be 0, but got 1"));n.username=this._list.readUInt8(this._pos)&s.USERNAME_MASK,n.password=this._list.readUInt8(this._pos)&s.PASSWORD_MASK,n.will=this._list.readUInt8(this._pos)&s.WILL_FLAG_MASK;let h=!!(this._list.readUInt8(this._pos)&s.WILL_RETAIN_MASK),f=(this._list.readUInt8(this._pos)&s.WILL_QOS_MASK)>>s.WILL_QOS_SHIFT;if(n.will)u.will={},u.will.retain=h,u.will.qos=f;else{if(h)return this._emitError(new Error("Will Retain Flag must be set to zero when Will Flag is set to 0"));if(f)return this._emitError(new Error("Will QoS must be set to zero when Will Flag is set to 0"))}if(u.clean=(this._list.readUInt8(this._pos)&s.CLEAN_SESSION_MASK)!==0,this._pos++,u.keepalive=this._parseNum(),u.keepalive===-1)return this._emitError(new Error("Packet too short"));if(u.protocolVersion===5){let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(u.properties=t)}let l=this._parseString();if(l===null)return this._emitError(new Error("Packet too short"));if(u.clientId=l,o("_parseConnect: packet.clientId: %s",u.clientId),n.will){if(u.protocolVersion===5){let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(u.will.properties=t)}if(t=this._parseString(),t===null)return this._emitError(new Error("Cannot parse will topic"));if(u.will.topic=t,o("_parseConnect: packet.will.topic: %s",u.will.topic),e=this._parseBuffer(),e===null)return this._emitError(new Error("Cannot parse will payload"));u.will.payload=e,o("_parseConnect: packet.will.paylaod: %s",u.will.payload)}if(n.username){if(i=this._parseString(),i===null)return this._emitError(new Error("Cannot parse username"));u.username=i,o("_parseConnect: packet.username: %s",u.username)}if(n.password){if(r=this._parseBuffer(),r===null)return this._emitError(new Error("Cannot parse password"));u.password=r}return this.settings=u,o("_parseConnect: complete"),u}_parseConnack(){o("_parseConnack");let t=this.packet;if(this._list.length<1)return null;let e=this._list.readUInt8(this._pos++);if(e>1)return this._emitError(new Error("Invalid connack flags, bits 7-1 must be set to 0"));if(t.sessionPresent=!!(e&s.SESSIONPRESENT_MASK),this.settings.protocolVersion===5)this._list.length>=2?t.reasonCode=this._list.readUInt8(this._pos++):t.reasonCode=0;else{if(this._list.length<2)return null;t.returnCode=this._list.readUInt8(this._pos++)}if(t.returnCode===-1||t.reasonCode===-1)return this._emitError(new Error("Cannot parse return code"));if(this.settings.protocolVersion===5){let e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(t.properties=e)}o("_parseConnack: complete")}_parsePublish(){o("_parsePublish");let t=this.packet;if(t.topic=this._parseString(),t.topic===null)return this._emitError(new Error("Cannot parse topic"));if(!(t.qos>0&&!this._parseMessageId())){if(this.settings.protocolVersion===5){let e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(t.properties=e)}t.payload=this._list.slice(this._pos,t.length),o("_parsePublish: payload from buffer list: %o",t.payload)}}_parseSubscribe(){o("_parseSubscribe");let t=this.packet,e,r,i,n,u,a,h;if(t.subscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(t.properties=e)}if(t.length<=0)return this._emitError(new Error("Malformed subscribe, no payload specified"));for(;this._pos<t.length;){if(e=this._parseString(),e===null)return this._emitError(new Error("Cannot parse topic"));if(this._pos>=t.length)return this._emitError(new Error("Malformed Subscribe Payload"));if(r=this._parseByte(),this.settings.protocolVersion===5){if(r&192)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-6 must be 0"))}else if(r&252)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-2 must be 0"));if(i=r&s.SUBSCRIBE_OPTIONS_QOS_MASK,i>2)return this._emitError(new Error("Invalid subscribe QoS, must be <= 2"));if(a=(r>>s.SUBSCRIBE_OPTIONS_NL_SHIFT&s.SUBSCRIBE_OPTIONS_NL_MASK)!==0,u=(r>>s.SUBSCRIBE_OPTIONS_RAP_SHIFT&s.SUBSCRIBE_OPTIONS_RAP_MASK)!==0,n=r>>s.SUBSCRIBE_OPTIONS_RH_SHIFT&s.SUBSCRIBE_OPTIONS_RH_MASK,n>2)return this._emitError(new Error("Invalid retain handling, must be <= 2"));h={topic:e,qos:i},this.settings.protocolVersion===5?(h.nl=a,h.rap=u,h.rh=n):this.settings.bridgeMode&&(h.rh=0,h.rap=!0,h.nl=!0),o("_parseSubscribe: push subscription `%s` to subscription",h),t.subscriptions.push(h)}}}_parseSuback(){o("_parseSuback");let t=this.packet;if(this.packet.granted=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(t.properties=e)}if(t.length<=0)return this._emitError(new Error("Malformed suback, no payload specified"));for(;this._pos<this.packet.length;){let t=this._list.readUInt8(this._pos++);if(this.settings.protocolVersion===5){if(!s.MQTT5_SUBACK_CODES[t])return this._emitError(new Error("Invalid suback code"))}else if(t>2&&t!==128)return this._emitError(new Error("Invalid suback QoS, must be 0, 1, 2 or 128"));this.packet.granted.push(t)}}}_parseUnsubscribe(){o("_parseUnsubscribe");let t=this.packet;if(t.unsubscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(t.properties=e)}if(t.length<=0)return this._emitError(new Error("Malformed unsubscribe, no payload specified"));for(;this._pos<t.length;){let e=this._parseString();if(e===null)return this._emitError(new Error("Cannot parse topic"));o("_parseUnsubscribe: push topic `%s` to unsubscriptions",e),t.unsubscriptions.push(e)}}}_parseUnsuback(){o("_parseUnsuback");let t=this.packet;if(!this._parseMessageId())return this._emitError(new Error("Cannot parse messageId"));if((this.settings.protocolVersion===3||this.settings.protocolVersion===4)&&t.length!==2)return this._emitError(new Error("Malformed unsuback, payload length must be 2"));if(t.length<=0)return this._emitError(new Error("Malformed unsuback, no payload specified"));if(this.settings.protocolVersion===5){let e=this._parseProperties();for(Object.getOwnPropertyNames(e).length&&(t.properties=e),t.granted=[];this._pos<this.packet.length;){let t=this._list.readUInt8(this._pos++);if(!s.MQTT5_UNSUBACK_CODES[t])return this._emitError(new Error("Invalid unsuback code"));this.packet.granted.push(t)}}}_parseConfirmation(){o("_parseConfirmation: packet.cmd: `%s`",this.packet.cmd);let t=this.packet;if(this._parseMessageId(),this.settings.protocolVersion===5){if(t.length>2){switch(t.reasonCode=this._parseByte(),this.packet.cmd){case"puback":case"pubrec":if(!s.MQTT5_PUBACK_PUBREC_CODES[t.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break;case"pubrel":case"pubcomp":if(!s.MQTT5_PUBREL_PUBCOMP_CODES[t.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break}o("_parseConfirmation: packet.reasonCode `%d`",t.reasonCode)}else t.reasonCode=0;if(t.length>3){let e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(t.properties=e)}}return!0}_parseDisconnect(){let t=this.packet;if(o("_parseDisconnect"),this.settings.protocolVersion===5){this._list.length>0?(t.reasonCode=this._parseByte(),s.MQTT5_DISCONNECT_CODES[t.reasonCode]||this._emitError(new Error("Invalid disconnect reason code"))):t.reasonCode=0;let e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(t.properties=e)}return o("_parseDisconnect result: true"),!0}_parseAuth(){o("_parseAuth");let t=this.packet;if(this.settings.protocolVersion!==5)return this._emitError(new Error("Not supported auth packet for this version MQTT"));if(t.reasonCode=this._parseByte(),!s.MQTT5_AUTH_CODES[t.reasonCode])return this._emitError(new Error("Invalid auth reason code"));let e=this._parseProperties();return Object.getOwnPropertyNames(e).length&&(t.properties=e),o("_parseAuth: result: true"),!0}_parseMessageId(){let t=this.packet;return t.messageId=this._parseNum(),t.messageId===null?(this._emitError(new Error("Cannot parse messageId")),!1):(o("_parseMessageId: packet.messageId %d",t.messageId),!0)}_parseString(t){let e=this._parseNum(),r=e+this._pos;if(e===-1||r>this._list.length||r>this.packet.length)return null;let i=this._list.toString("utf8",this._pos,r);return this._pos+=e,o("_parseString: result: %s",i),i}_parseStringPair(){return o("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}_parseBuffer(){let t=this._parseNum(),e=t+this._pos;if(t===-1||e>this._list.length||e>this.packet.length)return null;let r=this._list.slice(this._pos,e);return this._pos+=t,o("_parseBuffer: result: %o",r),r}_parseNum(){if(this._list.length-this._pos<2)return-1;let t=this._list.readUInt16BE(this._pos);return this._pos+=2,o("_parseNum: result: %s",t),t}_parse4ByteNum(){if(this._list.length-this._pos<4)return-1;let t=this._list.readUInt32BE(this._pos);return this._pos+=4,o("_parse4ByteNum: result: %s",t),t}_parseVarByteNum(t){o("_parseVarByteNum");let e=4,r=0,i=1,n=0,u=!1,a,h=this._pos?this._pos:0;for(;r<e&&h+r<this._list.length;){if(a=this._list.readUInt8(h+r++),n+=i*(a&s.VARBYTEINT_MASK),i*=128,!(a&s.VARBYTEINT_FIN_MASK)){u=!0;break}if(this._list.length<=r)break}return!u&&r===e&&this._list.length>=r&&this._emitError(new Error("Invalid variable byte integer")),h&&(this._pos+=r),u?t?u={bytes:r,value:n}:u=n:u=!1,o("_parseVarByteNum: result: %o",u),u}_parseByte(){let t;return this._pos<this._list.length&&(t=this._list.readUInt8(this._pos),this._pos++),o("_parseByte: result: %o",t),t}_parseByType(t){switch(o("_parseByType: type: %s",t),t){case"byte":return this._parseByte()!==0;case"int8":return this._parseByte();case"int16":return this._parseNum();case"int32":return this._parse4ByteNum();case"var":return this._parseVarByteNum();case"string":return this._parseString();case"pair":return this._parseStringPair();case"binary":return this._parseBuffer()}}_parseProperties(){o("_parseProperties");let t=this._parseVarByteNum(),e=this._pos+t,r={};for(;this._pos<e;){let t=this._parseByte();if(!t)return this._emitError(new Error("Cannot parse property code type")),!1;let e=s.propertiesCodes[t];if(!e)return this._emitError(new Error("Unknown property")),!1;if(e==="userProperties"){r[e]||(r[e]=Object.create(null));let t=this._parseByType(s.propertiesTypes[e]);if(r[e][t.name])if(Array.isArray(r[e][t.name]))r[e][t.name].push(t.value);else{let i=r[e][t.name];r[e][t.name]=[i],r[e][t.name].push(t.value)}else r[e][t.name]=t.value;continue}r[e]?Array.isArray(r[e])?r[e].push(this._parseByType(s.propertiesTypes[e])):(r[e]=[r[e]],r[e].push(this._parseByType(s.propertiesTypes[e]))):r[e]=this._parseByType(s.propertiesTypes[e])}return r}_newPacket(){return o("_newPacket"),this.packet&&(this._list.consume(this.packet.length),o("_newPacket: parser emit packet: packet.cmd: %s, packet.payload: %s, packet.length: %d",this.packet.cmd,this.packet.payload,this.packet.length),this.emit("packet",this.packet)),o("_newPacket: new packet"),this.packet=new n,this._pos=0,!0}_emitError(t){o("_emitError",t),this.error=t,this.emit("error",t)}};e.exports=u}));var Ni=f(((t,e)=>{p();ue();Gt();var{Buffer:r}=(oe(),d(Vt)),i=65536,n={},s=r.isBuffer(r.from([1,2]).subarray(0,1));function o(t){let e=r.allocUnsafe(2);return e.writeUInt8(t>>8,0),e.writeUInt8(t&255,0+1),e}function u(){for(let t=0;t<i;t++)n[t]=o(t)}function a(t){let e=0,i=0,n=r.allocUnsafe(4);do{e=t%128|0,t=t/128|0,t>0&&(e=e|128),n.writeUInt8(e,i++)}while(t>0&&i<4);return t>0&&(i=0),s?n.subarray(0,i):n.slice(0,i)}function h(t){let e=r.allocUnsafe(4);return e.writeUInt32BE(t,0),e}e.exports={cache:n,generateCache:u,generateNumber:o,genBufVariableByteInt:a,generate4ByteBuffer:h}}));var Bi=f(((t,e)=>{p();ue();Gt();typeof b>"u"||!b.version||b.version.indexOf("v0.")===0||b.version.indexOf("v1.")===0&&b.version.indexOf("v1.8.")!==0?e.exports={nextTick:r}:e.exports=b;function r(t,e,r,i){if(typeof t!="function")throw new TypeError('"callback" argument must be a function');var n=arguments.length,s,o;switch(n){case 0:case 1:return b.nextTick(t);case 2:return b.nextTick((function(){t.call(null,e)}));case 3:return b.nextTick((function(){t.call(null,e,r)}));case 4:return b.nextTick((function(){t.call(null,e,r,i)}));default:for(s=new Array(n-1),o=0;o<s.length;)s[o++]=arguments[o];return b.nextTick((function(){t.apply(null,s)}))}}}));var xi=f(((t,e)=>{p();ue();Gt();var r=ji(),{Buffer:i}=(oe(),d(Vt)),n=i.allocUnsafe(0),s=i.from([0]),o=Ni(),u=Bi().nextTick,a=Ci()("mqtt-packet:writeToStream"),h=o.cache,f=o.generateNumber,l=o.generateCache,c=o.genBufVariableByteInt,b=o.generate4ByteBuffer,v=B,w=!0;function y(t,e,r){switch(a("generate called"),e.cork&&(e.cork(),u(m,e)),w&&(w=!1,l()),a("generate: packet.cmd: %s",t.cmd),t.cmd){case"connect":return g(t,e);case"connack":return E(t,e,r);case"publish":return _(t,e,r);case"puback":case"pubrec":case"pubrel":case"pubcomp":return A(t,e,r);case"subscribe":return k(t,e,r);case"suback":return S(t,e,r);case"unsubscribe":return O(t,e,r);case"unsuback":return R(t,e,r);case"pingreq":case"pingresp":return T(t,e);case"disconnect":return j(t,e,r);case"auth":return I(t,e,r);default:return e.destroy(new Error("Unknown command")),!1}}Object.defineProperty(y,"cacheNumbers",{get(){return v===B},set(t){t?((!h||Object.keys(h).length===0)&&(w=!0),v=B):(w=!1,v=x)}});function m(t){t.uncork()}function g(t,e,n){let s=t||{},o=s.protocolId||"MQTT",u=s.protocolVersion||4,a=s.will,h=s.clean,f=s.keepalive||0,l=s.clientId||"",c=s.username,d=s.password,p=s.properties;h===void 0&&(h=!0);let b=0;if(!o||typeof o!="string"&&!i.isBuffer(o))return e.destroy(new Error("Invalid protocolId")),!1;if(b+=o.length+2,u!==3&&u!==4&&u!==5)return e.destroy(new Error("Invalid protocol version")),!1;if(b+=1,(typeof l=="string"||i.isBuffer(l))&&(l||u>=4)&&(l||h))b+=i.byteLength(l)+2;else{if(u<4)return e.destroy(new Error("clientId must be supplied before 3.1.1")),!1;if(h*1===0)return e.destroy(new Error("clientId must be given if cleanSession set to 0")),!1}if(typeof f!="number"||f<0||f>65535||f%1!==0)return e.destroy(new Error("Invalid keepalive")),!1;b+=2,b+=1;let w,y;if(u===5){if(w=$(e,p),!w)return!1;b+=w.length}if(a){if(typeof a!="object")return e.destroy(new Error("Invalid will")),!1;if(!a.topic||typeof a.topic!="string")return e.destroy(new Error("Invalid will topic")),!1;if(b+=i.byteLength(a.topic)+2,b+=2,a.payload)if(a.payload.length>=0)typeof a.payload=="string"?b+=i.byteLength(a.payload):b+=a.payload.length;else return e.destroy(new Error("Invalid will payload")),!1;if(y={},u===5){if(y=$(e,a.properties),!y)return!1;b+=y.length}}let m=!1;if(c!=null)if(W(c))m=!0,b+=i.byteLength(c)+2;else return e.destroy(new Error("Invalid username")),!1;if(d!=null){if(!m)return e.destroy(new Error("Username is required to use password")),!1;if(W(d))b+=z(d)+2;else return e.destroy(new Error("Invalid password")),!1}e.write(r.CONNECT_HEADER),C(e,b),F(e,o),s.bridgeMode&&(u+=128),e.write(u===131?r.VERSION131:u===132?r.VERSION132:u===4?r.VERSION4:u===5?r.VERSION5:r.VERSION3);let g=0;return g|=c!=null?r.USERNAME_MASK:0,g|=d!=null?r.PASSWORD_MASK:0,g|=a&&a.retain?r.WILL_RETAIN_MASK:0,g|=a&&a.qos?a.qos<<r.WILL_QOS_SHIFT:0,g|=a?r.WILL_FLAG_MASK:0,g|=h?r.CLEAN_SESSION_MASK:0,e.write(i.from([g])),v(e,f),u===5&&w.write(),F(e,l),a&&(u===5&&y.write(),P(e,a.topic),F(e,a.payload)),c!=null&&F(e,c),d!=null&&F(e,d),!0}function E(t,e,n){let o=n?n.protocolVersion:4,u=t||{},a=o===5?u.reasonCode:u.returnCode,h=u.properties,f=2;if(typeof a!="number")return e.destroy(new Error("Invalid return code")),!1;let l=null;if(o===5){if(l=$(e,h),!l)return!1;f+=l.length}return e.write(r.CONNACK_HEADER),C(e,f),e.write(u.sessionPresent?r.SESSIONPRESENT_HEADER:s),e.write(i.from([a])),l?.write(),!0}function _(t,e,s){a("publish: packet: %o",t);let o=s?s.protocolVersion:4,u=t||{},h=u.qos||0,f=u.retain?r.RETAIN_MASK:0,l=u.topic,c=u.payload||n,d=u.messageId,p=u.properties,b=0;if(typeof l=="string")b+=i.byteLength(l)+2;else if(i.isBuffer(l))b+=l.length+2;else return e.destroy(new Error("Invalid topic")),!1;if(i.isBuffer(c)?b+=c.length:b+=i.byteLength(c),h&&typeof d!="number")return e.destroy(new Error("Invalid messageId")),!1;h&&(b+=2);let w=null;if(o===5){if(w=$(e,p),!w)return!1;b+=w.length}return e.write(r.PUBLISH_HEADER[h][u.dup?1:0][f?1:0]),C(e,b),v(e,z(l)),e.write(l),h>0&&v(e,d),w?.write(),a("publish: payload: %o",c),e.write(c)}function A(t,e,n){let s=n?n.protocolVersion:4,o=t||{},u=o.cmd||"puback",a=o.messageId,h=o.dup&&u==="pubrel"?r.DUP_MASK:0,f=0,l=o.reasonCode,c=o.properties,d=s===5?3:2;if(u==="pubrel"&&(f=1),typeof a!="number")return e.destroy(new Error("Invalid messageId")),!1;let p=null;if(s===5&&typeof c=="object"){if(p=L(e,c,n,d),!p)return!1;d+=p.length}return e.write(r.ACKS[u][f][h][0]),d===3&&(d+=l!==0?1:-1),C(e,d),v(e,a),s===5&&d!==2&&e.write(i.from([l])),p!==null?p.write():d===4&&e.write(i.from([0])),!0}function k(t,e,n){a("subscribe: packet: ");let s=n?n.protocolVersion:4,o=t||{},u=o.dup?r.DUP_MASK:0,h=o.messageId,f=o.subscriptions,l=o.properties,c=0;if(typeof h!="number")return e.destroy(new Error("Invalid messageId")),!1;c+=2;let d=null;if(s===5){if(d=$(e,l),!d)return!1;c+=d.length}if(typeof f=="object"&&f.length)for(let t=0;t<f.length;t+=1){let r=f[t].topic,n=f[t].qos;if(typeof r!="string")return e.destroy(new Error("Invalid subscriptions - invalid topic")),!1;if(typeof n!="number")return e.destroy(new Error("Invalid subscriptions - invalid qos")),!1;if(s===5){if(typeof(f[t].nl||!1)!="boolean")return e.destroy(new Error("Invalid subscriptions - invalid No Local")),!1;if(typeof(f[t].rap||!1)!="boolean")return e.destroy(new Error("Invalid subscriptions - invalid Retain as Published")),!1;let r=f[t].rh||0;if(typeof r!="number"||r>2)return e.destroy(new Error("Invalid subscriptions - invalid Retain Handling")),!1}c+=i.byteLength(r)+2+1}else return e.destroy(new Error("Invalid subscriptions")),!1;a("subscribe: writing to stream: %o",r.SUBSCRIBE_HEADER),e.write(r.SUBSCRIBE_HEADER[1][u?1:0][0]),C(e,c),v(e,h),d!==null&&d.write();let p=!0;for(let t of f){let n=t.topic,o=t.qos,u=+t.nl,a=+t.rap,h=t.rh,f;P(e,n),f=r.SUBSCRIBE_OPTIONS_QOS[o],s===5&&(f|=u?r.SUBSCRIBE_OPTIONS_NL:0,f|=a?r.SUBSCRIBE_OPTIONS_RAP:0,f|=h?r.SUBSCRIBE_OPTIONS_RH[h]:0),p=e.write(i.from([f]))}return p}function S(t,e,n){let s=n?n.protocolVersion:4,o=t||{},u=o.messageId,a=o.granted,h=o.properties,f=0;if(typeof u!="number")return e.destroy(new Error("Invalid messageId")),!1;if(f+=2,typeof a=="object"&&a.length)for(let t=0;t<a.length;t+=1){if(typeof a[t]!="number")return e.destroy(new Error("Invalid qos vector")),!1;f+=1}else return e.destroy(new Error("Invalid qos vector")),!1;let l=null;if(s===5){if(l=L(e,h,n,f),!l)return!1;f+=l.length}return e.write(r.SUBACK_HEADER),C(e,f),v(e,u),l!==null&&l.write(),e.write(i.from(a))}function O(t,e,n){let s=n?n.protocolVersion:4,o=t||{},u=o.messageId,a=o.dup?r.DUP_MASK:0,h=o.unsubscriptions,f=o.properties,l=0;if(typeof u!="number")return e.destroy(new Error("Invalid messageId")),!1;if(l+=2,typeof h=="object"&&h.length)for(let t=0;t<h.length;t+=1){if(typeof h[t]!="string")return e.destroy(new Error("Invalid unsubscriptions")),!1;l+=i.byteLength(h[t])+2}else return e.destroy(new Error("Invalid unsubscriptions")),!1;let c=null;if(s===5){if(c=$(e,f),!c)return!1;l+=c.length}e.write(r.UNSUBSCRIBE_HEADER[1][a?1:0][0]),C(e,l),v(e,u),c!==null&&c.write();let d=!0;for(let t=0;t<h.length;t++)d=P(e,h[t]);return d}function R(t,e,n){let s=n?n.protocolVersion:4,o=t||{},u=o.messageId,a=o.dup?r.DUP_MASK:0,h=o.granted,f=o.properties,l=o.cmd,c=0,d=2;if(typeof u!="number")return e.destroy(new Error("Invalid messageId")),!1;if(s===5)if(typeof h=="object"&&h.length)for(let t=0;t<h.length;t+=1){if(typeof h[t]!="number")return e.destroy(new Error("Invalid qos vector")),!1;d+=1}else return e.destroy(new Error("Invalid qos vector")),!1;let p=null;if(s===5){if(p=L(e,f,n,d),!p)return!1;d+=p.length}return e.write(r.ACKS[l][c][a][0]),C(e,d),v(e,u),p!==null&&p.write(),s===5&&e.write(i.from(h)),!0}function T(t,e,i){return e.write(r.EMPTY[t.cmd])}function j(t,e,n){let s=n?n.protocolVersion:4,o=t||{},u=o.reasonCode,a=o.properties,h=s===5?1:0,f=null;if(s===5){if(f=L(e,a,n,h),!f)return!1;h+=f.length}return e.write(i.from([r.codes.disconnect<<4])),C(e,h),s===5&&e.write(i.from([u])),f!==null&&f.write(),!0}function I(t,e,n){let s=n?n.protocolVersion:4,o=t||{},u=o.reasonCode,a=o.properties,h=s===5?1:0;s!==5&&e.destroy(new Error("Invalid mqtt version for auth packet"));let f=L(e,a,n,h);return f?(h+=f.length,e.write(i.from([r.codes.auth<<4])),C(e,h),e.write(i.from([u])),f!==null&&f.write(),!0):!1}var M={};function C(t,e){if(e>r.VARBYTEINT_MAX)return t.destroy(new Error(`Invalid variable byte integer: ${e}`)),!1;let i=M[e];return i||(i=c(e),e<16384&&(M[e]=i)),a("writeVarByteInt: writing to stream: %o",i),t.write(i)}function P(t,e){let r=i.byteLength(e);return v(t,r),a("writeString: %s",e),t.write(e,"utf8")}function N(t,e,r){P(t,e),P(t,r)}function B(t,e){return a("writeNumberCached: number: %d",e),a("writeNumberCached: %o",h[e]),t.write(h[e])}function x(t,e){let r=f(e);return a("writeNumberGenerated: %o",r),t.write(r)}function U(t,e){let r=b(e);return a("write4ByteNumber: %o",r),t.write(r)}function F(t,e){typeof e=="string"?P(t,e):e?(v(t,e.length),t.write(e)):v(t,0)}function $(t,e){if(typeof e!="object"||e.length!=null)return{length:1,write(){q(t,{},0)}};let n=0;function s(e,n){let s=r.propertiesTypes[e],o=0;switch(s){case"byte":{if(typeof n!="boolean")return t.destroy(new Error(`Invalid ${e}: ${n}`)),!1;o+=1+1;break}case"int8":{if(typeof n!="number"||n<0||n>255)return t.destroy(new Error(`Invalid ${e}: ${n}`)),!1;o+=1+1;break}case"binary":{if(n&&n===null)return t.destroy(new Error(`Invalid ${e}: ${n}`)),!1;o+=1+i.byteLength(n)+2;break}case"int16":{if(typeof n!="number"||n<0||n>65535)return t.destroy(new Error(`Invalid ${e}: ${n}`)),!1;o+=1+2;break}case"int32":{if(typeof n!="number"||n<0||n>4294967295)return t.destroy(new Error(`Invalid ${e}: ${n}`)),!1;o+=1+4;break}case"var":{if(typeof n!="number"||n<0||n>268435455)return t.destroy(new Error(`Invalid ${e}: ${n}`)),!1;o+=1+i.byteLength(c(n));break}case"string":{if(typeof n!="string")return t.destroy(new Error(`Invalid ${e}: ${n}`)),!1;o+=1+2+i.byteLength(n.toString());break}case"pair":{if(typeof n!="object")return t.destroy(new Error(`Invalid ${e}: ${n}`)),!1;o+=Object.getOwnPropertyNames(n).reduce(((t,e)=>{let r=n[e];return Array.isArray(r)?t+=r.reduce(((t,r)=>(t+=1+2+i.byteLength(e.toString())+2+i.byteLength(r.toString()),t)),0):t+=1+2+i.byteLength(e.toString())+2+i.byteLength(n[e].toString()),t}),0);break}default:return t.destroy(new Error(`Invalid property ${e}: ${n}`)),!1}return o}if(e)for(let t in e){let r=0,i=0,o=e[t];if(Array.isArray(o))for(let e=0;e<o.length;e++){if(i=s(t,o[e]),!i)return!1;r+=i}else{if(i=s(t,o),!i)return!1;r=i}if(!r)return!1;n+=r}return{length:i.byteLength(c(n))+n,write(){q(t,e,n)}}}function L(t,e,r,i){let n=["reasonString","userProperties"],s=r&&r.properties&&r.properties.maximumPacketSize?r.properties.maximumPacketSize:0,o=$(t,e);if(s)for(;i+o.length>s;){let r=n.shift();if(r&&e[r])delete e[r],o=$(t,e);else return!1}return o}function D(t,e,n){switch(r.propertiesTypes[e]){case"byte":{t.write(i.from([r.properties[e]])),t.write(i.from([+n]));break}case"int8":{t.write(i.from([r.properties[e]])),t.write(i.from([n]));break}case"binary":{t.write(i.from([r.properties[e]])),F(t,n);break}case"int16":{t.write(i.from([r.properties[e]])),v(t,n);break}case"int32":{t.write(i.from([r.properties[e]])),U(t,n);break}case"var":{t.write(i.from([r.properties[e]])),C(t,n);break}case"string":{t.write(i.from([r.properties[e]])),P(t,n);break}case"pair":{Object.getOwnPropertyNames(n).forEach((s=>{let o=n[s];Array.isArray(o)?o.forEach((n=>{t.write(i.from([r.properties[e]])),N(t,s.toString(),n.toString())})):(t.write(i.from([r.properties[e]])),N(t,s.toString(),o.toString()))}));break}default:return t.destroy(new Error(`Invalid property ${e} value: ${n}`)),!1}}function q(t,e,r){C(t,r);for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&e[r]!==null){let i=e[r];if(Array.isArray(i))for(let e=0;e<i.length;e++)D(t,r,i[e]);else D(t,r,i)}}function z(t){return t?t instanceof i?t.length:i.byteLength(t):0}function W(t){return typeof t=="string"||t instanceof i}e.exports=y}));var Ui=f(((t,e)=>{p();ue();Gt();var r=xi(),{EventEmitter:i}=(qe(),d(Be)),{Buffer:n}=(oe(),d(Vt));function s(t,e){let i=new o;return r(t,i,e),i.concat()}var o=class extends i{constructor(){super(),this._array=new Array(20),this._i=0}write(t){return this._array[this._i++]=t,!0}concat(){let t=0,e=new Array(this._array.length),r=this._array,i=0,s;for(s=0;s<r.length&&r[s]!==void 0;s++)typeof r[s]!="string"?e[s]=r[s].length:e[s]=n.byteLength(r[s]),t+=e[s];let o=n.allocUnsafe(t);for(s=0;s<r.length&&r[s]!==void 0;s++)typeof r[s]!="string"?(r[s].copy(o,i),i+=e[s]):(o.write(r[s],i),i+=e[s]);return o}destroy(t){t&&this.emit("error",t)}};e.exports=s}));var Fi=f((t=>{p();ue();Gt();t.parser=Pi().parser;t.generate=Ui();t.writeToStream=xi()}));var $i=f((t=>{p();ue();Gt();Object.defineProperty(t,"__esModule",{value:!0});var e=class{constructor(){this.nextId=Math.max(1,Math.floor(Math.random()*65535))}allocate(){let t=this.nextId++;return this.nextId===65536&&(this.nextId=1),t}getLastAllocated(){return this.nextId===1?65535:this.nextId-1}register(t){return!0}deallocate(t){}clear(){}};t.default=e}));var Li=f(((t,e)=>{p();ue();Gt();e.exports=i;function r(t){return t instanceof ie?ie.from(t):new t.constructor(t.buffer.slice(),t.byteOffset,t.length)}function i(t){if(t=t||{},t.circles)return n(t);return t.proto?s:i;function e(t,e){for(var i=Object.keys(t),n=new Array(i.length),s=0;s<i.length;s++){var o=i[s],u=t[o];typeof u!="object"||u===null?n[o]=u:u instanceof Date?n[o]=new Date(u):ArrayBuffer.isView(u)?n[o]=r(u):n[o]=e(u)}return n}function i(t){if(typeof t!="object"||t===null)return t;if(t instanceof Date)return new Date(t);if(Array.isArray(t))return e(t,i);if(t instanceof Map)return new Map(e(Array.from(t),i));if(t instanceof Set)return new Set(e(Array.from(t),i));var n={};for(var s in t)if(Object.hasOwnProperty.call(t,s)!==!1){var o=t[s];typeof o!="object"||o===null?n[s]=o:o instanceof Date?n[s]=new Date(o):o instanceof Map?n[s]=new Map(e(Array.from(o),i)):o instanceof Set?n[s]=new Set(e(Array.from(o),i)):ArrayBuffer.isView(o)?n[s]=r(o):n[s]=i(o)}return n}function s(t){if(typeof t!="object"||t===null)return t;if(t instanceof Date)return new Date(t);if(Array.isArray(t))return e(t,s);if(t instanceof Map)return new Map(e(Array.from(t),s));if(t instanceof Set)return new Set(e(Array.from(t),s));var i={};for(var n in t){var o=t[n];typeof o!="object"||o===null?i[n]=o:o instanceof Date?i[n]=new Date(o):o instanceof Map?i[n]=new Map(e(Array.from(o),s)):o instanceof Set?i[n]=new Set(e(Array.from(o),s)):ArrayBuffer.isView(o)?i[n]=r(o):i[n]=s(o)}return i}}function n(t){var e=[],i=[];return t.proto?o:s;function n(t,n){for(var s=Object.keys(t),o=new Array(s.length),u=0;u<s.length;u++){var a=s[u],h=t[a];if(typeof h!="object"||h===null)o[a]=h;else if(h instanceof Date)o[a]=new Date(h);else if(ArrayBuffer.isView(h))o[a]=r(h);else{var f=e.indexOf(h);f!==-1?o[a]=i[f]:o[a]=n(h)}}return o}function s(t){if(typeof t!="object"||t===null)return t;if(t instanceof Date)return new Date(t);if(Array.isArray(t))return n(t,s);if(t instanceof Map)return new Map(n(Array.from(t),s));if(t instanceof Set)return new Set(n(Array.from(t),s));var o={};e.push(t),i.push(o);for(var u in t)if(Object.hasOwnProperty.call(t,u)!==!1){var a=t[u];if(typeof a!="object"||a===null)o[u]=a;else if(a instanceof Date)o[u]=new Date(a);else if(a instanceof Map)o[u]=new Map(n(Array.from(a),s));else if(a instanceof Set)o[u]=new Set(n(Array.from(a),s));else if(ArrayBuffer.isView(a))o[u]=r(a);else{var h=e.indexOf(a);h!==-1?o[u]=i[h]:o[u]=s(a)}}return e.pop(),i.pop(),o}function o(t){if(typeof t!="object"||t===null)return t;if(t instanceof Date)return new Date(t);if(Array.isArray(t))return n(t,o);if(t instanceof Map)return new Map(n(Array.from(t),o));if(t instanceof Set)return new Set(n(Array.from(t),o));var s={};e.push(t),i.push(s);for(var u in t){var a=t[u];if(typeof a!="object"||a===null)s[u]=a;else if(a instanceof Date)s[u]=new Date(a);else if(a instanceof Map)s[u]=new Map(n(Array.from(a),o));else if(a instanceof Set)s[u]=new Set(n(Array.from(a),o));else if(ArrayBuffer.isView(a))s[u]=r(a);else{var h=e.indexOf(a);h!==-1?s[u]=i[h]:s[u]=o(a)}}return e.pop(),i.pop(),s}}}));var Di=f(((t,e)=>{p();ue();Gt();e.exports=Li()()}));var qi=f((t=>{p();ue();Gt();Object.defineProperty(t,"__esModule",{value:!0});t.validateTopics=t.validateTopic=void 0;function e(t){let e=t.split("/");for(let t=0;t<e.length;t++)if(e[t]!=="+"){if(e[t]==="#")return t===e.length-1;if(e[t].indexOf("+")!==-1||e[t].indexOf("#")!==-1)return!1}return!0}t.validateTopic=e;function r(t){if(t.length===0)return"empty_topic_list";for(let r=0;r<t.length;r++)if(!e(t[r]))return t[r];return null}t.validateTopics=r}));var zi=f((t=>{p();ue();Gt();Object.defineProperty(t,"__esModule",{value:!0});var e=ki(),r={objectMode:!0},i={clean:!0},n=class{constructor(t){this.options=t||{},this.options=Object.assign(Object.assign({},i),t),this._inflights=new Map}put(t,e){return this._inflights.set(t.messageId,t),e&&e(),this}createStream(){let t=new e.Readable(r),i=[],n=!1,s=0;return this._inflights.forEach(((t,e)=>{i.push(t)})),t._read=()=>{!n&&s<i.length?t.push(i[s++]):t.push(null)},t.destroy=e=>{if(!n)return n=!0,setTimeout((()=>{t.emit("close")}),0),t},t}del(t,e){let r=this._inflights.get(t.messageId);return r?(this._inflights.delete(t.messageId),e(null,r)):e&&e(new Error("missing packet")),this}get(t,e){let r=this._inflights.get(t.messageId);return r?e(null,r):e&&e(new Error("missing packet")),this}close(t){this.options.clean&&(this._inflights=null),t&&t()}};t.default=n}));var Wi=f((t=>{p();ue();Gt();Object.defineProperty(t,"__esModule",{value:!0});var e=[0,16,128,131,135,144,145,151,153],r=(t,r,i)=>{t.log("handlePublish: packet %o",r),i=typeof i<"u"?i:t.noop;let n=r.topic.toString(),s=r.payload,{qos:o}=r,{messageId:u}=r,{options:a}=t;if(t.options.protocolVersion===5){let e;if(r.properties&&(e=r.properties.topicAlias),typeof e<"u")if(n.length===0)if(e>0&&e<=65535){let r=t.topicAliasRecv.getTopicByAlias(e);if(r)n=r,t.log("handlePublish :: topic complemented by alias. topic: %s - alias: %d",n,e);else{t.log("handlePublish :: unregistered topic alias. alias: %d",e),t.emit("error",new Error("Received unregistered Topic Alias"));return}}else{t.log("handlePublish :: topic alias out of range. alias: %d",e),t.emit("error",new Error("Received Topic Alias is out of range"));return}else if(t.topicAliasRecv.put(n,e))t.log("handlePublish :: registered topic: %s - alias: %d",n,e);else{t.log("handlePublish :: topic alias out of range. alias: %d",e),t.emit("error",new Error("Received Topic Alias is out of range"));return}}switch(t.log("handlePublish: qos %d",o),o){case 2:{a.customHandleAcks(n,s,r,((n,s)=>{if(typeof n=="number"&&(s=n,n=null),n)return t.emit("error",n);if(e.indexOf(s)===-1)return t.emit("error",new Error("Wrong reason code for pubrec"));s?t._sendPacket({cmd:"pubrec",messageId:u,reasonCode:s},i):t.incomingStore.put(r,(()=>{t._sendPacket({cmd:"pubrec",messageId:u},i)}))}));break}case 1:{a.customHandleAcks(n,s,r,((o,a)=>{if(typeof o=="number"&&(a=o,o=null),o)return t.emit("error",o);if(e.indexOf(a)===-1)return t.emit("error",new Error("Wrong reason code for puback"));a||t.emit("message",n,s,r),t.handleMessage(r,(e=>{if(e)return i&&i(e);t._sendPacket({cmd:"puback",messageId:u,reasonCode:a},i)}))}));break}case 0:t.emit("message",n,s,r),t.handleMessage(r,i);break;default:t.log("handlePublish: unknown QoS. Doing nothing.");break}};t.default=r}));var Gi=f(((t,e)=>{e.exports={version:"5.10.1"}}));var Vi=f((t=>{p();ue();Gt();Object.defineProperty(t,"__esModule",{value:!0});t.MQTTJS_VERSION=t.nextTick=t.applyMixin=t.ErrorWithReasonCode=void 0;var e=class t extends Error{constructor(e,r){super(e),this.code=r,Object.setPrototypeOf(this,t.prototype),Object.getPrototypeOf(this).name="ErrorWithReasonCode"}};t.ErrorWithReasonCode=e;function r(t,e,r=!1){var i;let n=[e];for(;;){let t=n[0],e=Object.getPrototypeOf(t);if(e?.prototype)n.unshift(e);else break}for(let e of n)for(let n of Object.getOwnPropertyNames(e.prototype))(r||n!=="constructor")&&Object.defineProperty(t.prototype,n,(i=Object.getOwnPropertyDescriptor(e.prototype,n))!==null&&i!==void 0?i:Object.create(null))}t.applyMixin=r;t.nextTick=typeof(b===null||b===void 0?void 0:b.nextTick)=="function"?b.nextTick:t=>{setTimeout(t,0)};t.MQTTJS_VERSION=Gi().version}));var Hi=f((t=>{p();ue();Gt();Object.defineProperty(t,"__esModule",{value:!0});t.ReasonCodes=void 0;var e=Vi();t.ReasonCodes={0:"",1:"Unacceptable protocol version",2:"Identifier rejected",3:"Server unavailable",4:"Bad username or password",5:"Not authorized",16:"No matching subscribers",17:"No subscription existed",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",132:"Unsupported Protocol Version",133:"Client Identifier not valid",134:"Bad User Name or Password",135:"Not authorized",136:"Server unavailable",137:"Server busy",138:"Banned",139:"Server shutting down",140:"Bad authentication method",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",145:"Packet identifier in use",146:"Packet Identifier not found",147:"Receive Maximum exceeded",148:"Topic Alias invalid",149:"Packet too large",150:"Message rate too high",151:"Quota exceeded",152:"Administrative action",153:"Payload format invalid",154:"Retain not supported",155:"QoS not supported",156:"Use another server",157:"Server moved",158:"Shared Subscriptions not supported",159:"Connection rate exceeded",160:"Maximum connect time",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"};var r=(r,i)=>{let{messageId:n}=i,s=i.cmd,o=null,u=r.outgoing[n]?r.outgoing[n].cb:null,a=null;if(!u){r.log("_handleAck :: Server sent an ack in error. Ignoring.");return}switch(r.log("_handleAck :: packet type",s),s){case"pubcomp":case"puback":{let s=i.reasonCode;s&&s>0&&s!==16?(a=new e.ErrorWithReasonCode(`Publish error: ${t.ReasonCodes[s]}`,s),r._removeOutgoingAndStoreMessage(n,(()=>{u(a,i)}))):r._removeOutgoingAndStoreMessage(n,u);break}case"pubrec":{o={cmd:"pubrel",qos:2,messageId:n};let s=i.reasonCode;s&&s>0&&s!==16?(a=new e.ErrorWithReasonCode(`Publish error: ${t.ReasonCodes[s]}`,s),r._removeOutgoingAndStoreMessage(n,(()=>{u(a,i)}))):r._sendPacket(o);break}case"suback":{delete r.outgoing[n],r.messageIdProvider.deallocate(n);let e=i.granted;for(let i=0;i<e.length;i++){let s=e[i];if(s&128){a=new Error(`Subscribe error: ${t.ReasonCodes[s]}`),a.code=s;let e=r.messageIdToTopic[n];e&&e.forEach((t=>{delete r._resubscribeTopics[t]}))}}delete r.messageIdToTopic[n],r._invokeStoreProcessingQueue(),u(a,i);break}case"unsuback":{delete r.outgoing[n],r.messageIdProvider.deallocate(n),r._invokeStoreProcessingQueue(),u(null,i);break}default:r.emit("error",new Error("unrecognized packet type"))}r.disconnecting&&Object.keys(r.outgoing).length===0&&r.emit("outgoingEmpty")};t.default=r}));var Ki=f((t=>{p();ue();Gt();Object.defineProperty(t,"__esModule",{value:!0});var e=Vi(),r=Hi(),i=(t,i)=>{let{options:n}=t,s=n.protocolVersion,o=s===5?i.reasonCode:i.returnCode;if(s!==5){let r=new e.ErrorWithReasonCode(`Protocol error: Auth packets are only supported in MQTT 5. Your version:${s}`,o);t.emit("error",r);return}t.handleAuth(i,((i,n)=>{if(i){t.emit("error",i);return}if(o===24)t.reconnecting=!1,t._sendPacket(n);else{let i=new e.ErrorWithReasonCode(`Connection refused: ${r.ReasonCodes[o]}`,o);t.emit("error",i)}}))};t.default=i}));var Qi=f((t=>{p();ue();Gt();Object.defineProperty(t,"__esModule",{value:!0});t.LRUCache=void 0;var e=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,r=new Set,i=typeof b=="object"&&b?b:{},n=(t,e,r,n)=>{typeof i.emitWarning=="function"?i.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`)},s=globalThis.AbortController,o=globalThis.AbortSignal;if(typeof s>"u"){o=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(t,e){this._onabort.push(e)}},s=class{constructor(){e()}signal=new o;abort(t){if(!this.signal.aborted){this.signal.reason=t,this.signal.aborted=!0;for(let e of this.signal._onabort)e(t);this.signal.onabort?.(t)}}};let t=i.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,n("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}var u=t=>!r.has(t),a=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),h=t=>a(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?f:null:null,f=class extends Array{constructor(t){super(t),this.fill(0)}},l=class t{heap;length;static#t=!1;static create(e){let r=h(e);if(!r)return[];t.#t=!0;let i=new t(e,r);return t.#t=!1,i}constructor(e,r){if(!t.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},c=class t{#t;#e;#r;#i;#n;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#s;#o;#u;#a;#h;#f;#l;#c;#d;#p;#b;#v;#w;#y;#m;#g;#E;static unsafeExposeInternals(t){return{starts:t.#w,ttls:t.#y,sizes:t.#v,keyMap:t.#u,keyList:t.#a,valList:t.#h,next:t.#f,prev:t.#l,get head(){return t.#c},get tail(){return t.#d},free:t.#p,isBackgroundFetch:e=>t.#_(e),backgroundFetch:(e,r,i,n)=>t.#A(e,r,i,n),moveToTail:e=>t.#k(e),indexes:e=>t.#S(e),rindexes:e=>t.#O(e),isStale:e=>t.#R(e)}}get max(){return this.#t}get maxSize(){return this.#e}get calculatedSize(){return this.#o}get size(){return this.#s}get fetchMethod(){return this.#n}get dispose(){return this.#r}get disposeAfter(){return this.#i}constructor(e){let{max:i=0,ttl:s,ttlResolution:o=1,ttlAutopurge:f,updateAgeOnGet:c,updateAgeOnHas:d,allowStale:p,dispose:b,disposeAfter:v,noDisposeOnSet:w,noUpdateTTL:y,maxSize:m=0,maxEntrySize:g=0,sizeCalculation:E,fetchMethod:_,noDeleteOnFetchRejection:A,noDeleteOnStaleGet:k,allowStaleOnFetchRejection:S,allowStaleOnFetchAbort:O,ignoreFetchAbort:R}=e;if(i!==0&&!a(i))throw new TypeError("max option must be a nonnegative integer");let T=i?h(i):Array;if(!T)throw new Error("invalid max value: "+i);if(this.#t=i,this.#e=m,this.maxEntrySize=g||this.#e,this.sizeCalculation=E,this.sizeCalculation){if(!this.#e&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(_!==void 0&&typeof _!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#n=_,this.#g=!!_,this.#u=new Map,this.#a=new Array(i).fill(void 0),this.#h=new Array(i).fill(void 0),this.#f=new T(i),this.#l=new T(i),this.#c=0,this.#d=0,this.#p=l.create(i),this.#s=0,this.#o=0,typeof b=="function"&&(this.#r=b),typeof v=="function"?(this.#i=v,this.#b=[]):(this.#i=void 0,this.#b=void 0),this.#m=!!this.#r,this.#E=!!this.#i,this.noDisposeOnSet=!!w,this.noUpdateTTL=!!y,this.noDeleteOnFetchRejection=!!A,this.allowStaleOnFetchRejection=!!S,this.allowStaleOnFetchAbort=!!O,this.ignoreFetchAbort=!!R,this.maxEntrySize!==0){if(this.#e!==0&&!a(this.#e))throw new TypeError("maxSize must be a positive integer if specified");if(!a(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#T()}if(this.allowStale=!!p,this.noDeleteOnStaleGet=!!k,this.updateAgeOnGet=!!c,this.updateAgeOnHas=!!d,this.ttlResolution=a(o)||o===0?o:1,this.ttlAutopurge=!!f,this.ttl=s||0,this.ttl){if(!a(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#j()}if(this.#t===0&&this.ttl===0&&this.#e===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#e){let e="LRU_CACHE_UNBOUNDED";u(e)&&(r.add(e),n("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",e,t))}}getRemainingTTL(t){return this.#u.has(t)?1/0:0}#j(){let t=new f(this.#t),r=new f(this.#t);this.#y=t,this.#w=r,this.#I=(i,n,s=e.now())=>{if(r[i]=n!==0?s:0,t[i]=n,n!==0&&this.ttlAutopurge){let t=setTimeout((()=>{this.#R(i)&&this.delete(this.#a[i])}),n+1);t.unref&&t.unref()}},this.#M=i=>{r[i]=t[i]!==0?e.now():0},this.#C=(e,s)=>{if(t[s]){let o=t[s],u=r[s];e.ttl=o,e.start=u,e.now=i||n();let a=e.now-u;e.remainingTTL=o-a}};let i=0,n=()=>{let t=e.now();if(this.ttlResolution>0){i=t;let e=setTimeout((()=>i=0),this.ttlResolution);e.unref&&e.unref()}return t};this.getRemainingTTL=e=>{let s=this.#u.get(e);if(s===void 0)return 0;let o=t[s],u=r[s];if(o===0||u===0)return 1/0;let a=(i||n())-u;return o-a},this.#R=e=>t[e]!==0&&r[e]!==0&&(i||n())-r[e]>t[e]}#M=()=>{};#C=()=>{};#I=()=>{};#R=()=>!1;#T(){let t=new f(this.#t);this.#o=0,this.#v=t,this.#P=e=>{this.#o-=t[e],t[e]=0},this.#N=(t,e,r,i)=>{if(this.#_(e))return 0;if(!a(r))if(i){if(typeof i!="function")throw new TypeError("sizeCalculation must be a function");if(r=i(e,t),!a(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return r},this.#B=(e,r,i)=>{if(t[e]=r,this.#e){let r=this.#e-t[e];for(;this.#o>r;)this.#x(!0)}this.#o+=t[e],i&&(i.entrySize=r,i.totalCalculatedSize=this.#o)}}#P=t=>{};#B=(t,e,r)=>{};#N=(t,e,r,i)=>{if(r||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#S({allowStale:t=this.allowStale}={}){if(this.#s)for(let e=this.#d;!(!this.#U(e)||((t||!this.#R(e))&&(yield e),e===this.#c));)e=this.#l[e]}*#O({allowStale:t=this.allowStale}={}){if(this.#s)for(let e=this.#c;!(!this.#U(e)||((t||!this.#R(e))&&(yield e),e===this.#d));)e=this.#f[e]}#U(t){return t!==void 0&&this.#u.get(this.#a[t])===t}*entries(){for(let t of this.#S())this.#h[t]!==void 0&&this.#a[t]!==void 0&&!this.#_(this.#h[t])&&(yield[this.#a[t],this.#h[t]])}*rentries(){for(let t of this.#O())this.#h[t]!==void 0&&this.#a[t]!==void 0&&!this.#_(this.#h[t])&&(yield[this.#a[t],this.#h[t]])}*keys(){for(let t of this.#S()){let e=this.#a[t];e!==void 0&&!this.#_(this.#h[t])&&(yield e)}}*rkeys(){for(let t of this.#O()){let e=this.#a[t];e!==void 0&&!this.#_(this.#h[t])&&(yield e)}}*values(){for(let t of this.#S())this.#h[t]!==void 0&&!this.#_(this.#h[t])&&(yield this.#h[t])}*rvalues(){for(let t of this.#O())this.#h[t]!==void 0&&!this.#_(this.#h[t])&&(yield this.#h[t])}[Symbol.iterator](){return this.entries()}find(t,e={}){for(let r of this.#S()){let i=this.#h[r],n=this.#_(i)?i.__staleWhileFetching:i;if(n!==void 0&&t(n,this.#a[r],this))return this.get(this.#a[r],e)}}forEach(t,e=this){for(let r of this.#S()){let i=this.#h[r],n=this.#_(i)?i.__staleWhileFetching:i;n!==void 0&&t.call(e,n,this.#a[r],this)}}rforEach(t,e=this){for(let r of this.#O()){let i=this.#h[r],n=this.#_(i)?i.__staleWhileFetching:i;n!==void 0&&t.call(e,n,this.#a[r],this)}}purgeStale(){let t=!1;for(let e of this.#O({allowStale:!0}))this.#R(e)&&(this.delete(this.#a[e]),t=!0);return t}dump(){let t=[];for(let r of this.#S({allowStale:!0})){let i=this.#a[r],n=this.#h[r],s=this.#_(n)?n.__staleWhileFetching:n;if(s===void 0||i===void 0)continue;let o={value:s};if(this.#y&&this.#w){o.ttl=this.#y[r];let t=e.now()-this.#w[r];o.start=Math.floor(Date.now()-t)}this.#v&&(o.size=this.#v[r]),t.unshift([i,o])}return t}load(t){this.clear();for(let[r,i]of t){if(i.start){let t=Date.now()-i.start;i.start=e.now()-t}this.set(r,i.value,i)}}set(t,e,r={}){if(e===void 0)return this.delete(t),this;let{ttl:i=this.ttl,start:n,noDisposeOnSet:s=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:u}=r,{noUpdateTTL:a=this.noUpdateTTL}=r,h=this.#N(t,e,r.size||0,o);if(this.maxEntrySize&&h>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.delete(t),this;let f=this.#s===0?void 0:this.#u.get(t);if(f===void 0)f=this.#s===0?this.#d:this.#p.length!==0?this.#p.pop():this.#s===this.#t?this.#x(!1):this.#s,this.#a[f]=t,this.#h[f]=e,this.#u.set(t,f),this.#f[this.#d]=f,this.#l[f]=this.#d,this.#d=f,this.#s++,this.#B(f,h,u),u&&(u.set="add"),a=!1;else{this.#k(f);let r=this.#h[f];if(e!==r){if(this.#g&&this.#_(r)){r.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:e}=r;e!==void 0&&!s&&(this.#m&&this.#r?.(e,t,"set"),this.#E&&this.#b?.push([e,t,"set"]))}else s||(this.#m&&this.#r?.(r,t,"set"),this.#E&&this.#b?.push([r,t,"set"]));if(this.#P(f),this.#B(f,h,u),this.#h[f]=e,u){u.set="replace";let t=r&&this.#_(r)?r.__staleWhileFetching:r;t!==void 0&&(u.oldValue=t)}}else u&&(u.set="update")}if(i!==0&&!this.#y&&this.#j(),this.#y&&(a||this.#I(f,i,n),u&&this.#C(u,f)),!s&&this.#E&&this.#b){let t=this.#b,e;for(;e=t?.shift();)this.#i?.(...e)}return this}pop(){try{for(;this.#s;){let t=this.#h[this.#c];if(this.#x(!0),this.#_(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#E&&this.#b){let t=this.#b,e;for(;e=t?.shift();)this.#i?.(...e)}}}#x(t){let e=this.#c,r=this.#a[e],i=this.#h[e];return this.#g&&this.#_(i)?i.__abortController.abort(new Error("evicted")):(this.#m||this.#E)&&(this.#m&&this.#r?.(i,r,"evict"),this.#E&&this.#b?.push([i,r,"evict"])),this.#P(e),t&&(this.#a[e]=void 0,this.#h[e]=void 0,this.#p.push(e)),this.#s===1?(this.#c=this.#d=0,this.#p.length=0):this.#c=this.#f[e],this.#u.delete(r),this.#s--,e}has(t,e={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:i}=e,n=this.#u.get(t);if(n!==void 0){let t=this.#h[n];if(this.#_(t)&&t.__staleWhileFetching===void 0)return!1;if(this.#R(n))i&&(i.has="stale",this.#C(i,n));else return r&&this.#M(n),i&&(i.has="hit",this.#C(i,n)),!0}else i&&(i.has="miss");return!1}peek(t,e={}){let{allowStale:r=this.allowStale}=e,i=this.#u.get(t);if(i!==void 0&&(r||!this.#R(i))){let t=this.#h[i];return this.#_(t)?t.__staleWhileFetching:t}}#A(t,e,r,i){let n=e===void 0?void 0:this.#h[e];if(this.#_(n))return n;let o=new s,{signal:u}=r;u?.addEventListener("abort",(()=>o.abort(u.reason)),{signal:o.signal});let a={signal:o.signal,options:r,context:i},h=(i,n=!1)=>{let{aborted:s}=o.signal,u=r.ignoreFetchAbort&&i!==void 0;if(r.status&&(s&&!n?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,u&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),s&&!u&&!n)return l(o.signal.reason);let h=d;return this.#h[e]===d&&(i===void 0?h.__staleWhileFetching?this.#h[e]=h.__staleWhileFetching:this.delete(t):(r.status&&(r.status.fetchUpdated=!0),this.set(t,i,a.options))),i},f=t=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=t),l(t)),l=i=>{let{aborted:n}=o.signal,s=n&&r.allowStaleOnFetchAbort,u=s||r.allowStaleOnFetchRejection,a=u||r.noDeleteOnFetchRejection,h=d;if(this.#h[e]===d&&(!a||h.__staleWhileFetching===void 0?this.delete(t):s||(this.#h[e]=h.__staleWhileFetching)),u)return r.status&&h.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),h.__staleWhileFetching;if(h.__returned===h)throw i},c=(e,i)=>{let s=this.#n?.(t,n,a);s&&s instanceof Promise&&s.then((t=>e(t===void 0?void 0:t)),i),o.signal.addEventListener("abort",(()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(e(void 0),r.allowStaleOnFetchAbort&&(e=t=>h(t,!0)))}))};r.status&&(r.status.fetchDispatched=!0);let d=new Promise(c).then(h,f),p=Object.assign(d,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return e===void 0?(this.set(t,p,{...a.options,status:void 0}),e=this.#u.get(t)):this.#h[e]=p,p}#_(t){if(!this.#g)return!1;let e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof s}async fetch(t,e={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:u=0,sizeCalculation:a=this.sizeCalculation,noUpdateTTL:h=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:l=this.allowStaleOnFetchRejection,ignoreFetchAbort:c=this.ignoreFetchAbort,allowStaleOnFetchAbort:d=this.allowStaleOnFetchAbort,context:p,forceRefresh:b=!1,status:v,signal:w}=e;if(!this.#g)return v&&(v.fetch="get"),this.get(t,{allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:n,status:v});let y={allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:n,ttl:s,noDisposeOnSet:o,size:u,sizeCalculation:a,noUpdateTTL:h,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:l,allowStaleOnFetchAbort:d,ignoreFetchAbort:c,status:v,signal:w},m=this.#u.get(t);if(m===void 0){v&&(v.fetch="miss");let e=this.#A(t,m,y,p);return e.__returned=e}else{let e=this.#h[m];if(this.#_(e)){let t=r&&e.__staleWhileFetching!==void 0;return v&&(v.fetch="inflight",t&&(v.returnedStale=!0)),t?e.__staleWhileFetching:e.__returned=e}let n=this.#R(m);if(!b&&!n)return v&&(v.fetch="hit"),this.#k(m),i&&this.#M(m),v&&this.#C(v,m),e;let s=this.#A(t,m,y,p),o=s.__staleWhileFetching!==void 0&&r;return v&&(v.fetch=n?"stale":"refresh",o&&n&&(v.returnedStale=!0)),o?s.__staleWhileFetching:s.__returned=s}}get(t,e={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:s}=e,o=this.#u.get(t);if(o!==void 0){let e=this.#h[o],u=this.#_(e);return s&&this.#C(s,o),this.#R(o)?(s&&(s.get="stale"),u?(s&&r&&e.__staleWhileFetching!==void 0&&(s.returnedStale=!0),r?e.__staleWhileFetching:void 0):(n||this.delete(t),s&&r&&(s.returnedStale=!0),r?e:void 0)):(s&&(s.get="hit"),u?e.__staleWhileFetching:(this.#k(o),i&&this.#M(o),e))}else s&&(s.get="miss")}#F(t,e){this.#l[e]=t,this.#f[t]=e}#k(t){t!==this.#d&&(t===this.#c?this.#c=this.#f[t]:this.#F(this.#l[t],this.#f[t]),this.#F(this.#d,t),this.#d=t)}delete(t){let e=!1;if(this.#s!==0){let r=this.#u.get(t);if(r!==void 0)if(e=!0,this.#s===1)this.clear();else{this.#P(r);let e=this.#h[r];this.#_(e)?e.__abortController.abort(new Error("deleted")):(this.#m||this.#E)&&(this.#m&&this.#r?.(e,t,"delete"),this.#E&&this.#b?.push([e,t,"delete"])),this.#u.delete(t),this.#a[r]=void 0,this.#h[r]=void 0,r===this.#d?this.#d=this.#l[r]:r===this.#c?this.#c=this.#f[r]:(this.#f[this.#l[r]]=this.#f[r],this.#l[this.#f[r]]=this.#l[r]),this.#s--,this.#p.push(r)}}if(this.#E&&this.#b?.length){let t=this.#b,e;for(;e=t?.shift();)this.#i?.(...e)}return e}clear(){for(let t of this.#O({allowStale:!0})){let e=this.#h[t];if(this.#_(e))e.__abortController.abort(new Error("deleted"));else{let r=this.#a[t];this.#m&&this.#r?.(e,r,"delete"),this.#E&&this.#b?.push([e,r,"delete"])}}if(this.#u.clear(),this.#h.fill(void 0),this.#a.fill(void 0),this.#y&&this.#w&&(this.#y.fill(0),this.#w.fill(0)),this.#v&&this.#v.fill(0),this.#c=0,this.#d=0,this.#p.length=0,this.#o=0,this.#s=0,this.#E&&this.#b){let t=this.#b,e;for(;e=t?.shift();)this.#i?.(...e)}}};t.LRUCache=c}));var Yi=f((t=>{p();ue();Gt();Object.defineProperty(t,"t",{value:!0});t.ContainerIterator=t.Container=t.Base=void 0;var e=class{constructor(t=0){this.iteratorType=t}equals(t){return this.o===t.o}};t.ContainerIterator=e;var r=class{constructor(){this.i=0}get length(){return this.i}size(){return this.i}empty(){return this.i===0}};t.Base=r;var i=class extends r{};t.Container=i}));var Ji=f((t=>{p();ue();Gt();Object.defineProperty(t,"t",{value:!0});t.default=void 0;var e=Yi(),r=class extends e.Base{constructor(t=[]){super(),this.S=[];let e=this;t.forEach((function(t){e.push(t)}))}clear(){this.i=0,this.S=[]}push(t){return this.S.push(t),this.i+=1,this.i}pop(){if(this.i!==0)return this.i-=1,this.S.pop()}top(){return this.S[this.i-1]}},i=r;t.default=i}));var Zi=f((t=>{p();ue();Gt();Object.defineProperty(t,"t",{value:!0});t.default=void 0;var e=Yi(),r=class extends e.Base{constructor(t=[]){super(),this.j=0,this.q=[];let e=this;t.forEach((function(t){e.push(t)}))}clear(){this.q=[],this.i=this.j=0}push(t){let e=this.q.length;if(this.j/e>.5&&this.j+this.i>=e&&e>4096){let e=this.i;for(let t=0;t<e;++t)this.q[t]=this.q[this.j+t];this.j=0,this.q[this.i]=t}else this.q[this.j+this.i]=t;return++this.i}pop(){if(this.i===0)return;let t=this.q[this.j++];return this.i-=1,t}front(){if(this.i!==0)return this.q[this.j]}},i=r;t.default=i}));var Xi=f((t=>{p();ue();Gt();Object.defineProperty(t,"t",{value:!0});t.default=void 0;var e=Yi(),r=class extends e.Base{constructor(t=[],e=function(t,e){return t>e?-1:t<e?1:0},r=!0){if(super(),this.v=e,Array.isArray(t))this.C=r?[...t]:t;else{this.C=[];let e=this;t.forEach((function(t){e.C.push(t)}))}this.i=this.C.length;let i=this.i>>1;for(let t=this.i-1>>1;t>=0;--t)this.k(t,i)}m(t){let e=this.C[t];for(;t>0;){let r=t-1>>1,i=this.C[r];if(this.v(i,e)<=0)break;this.C[t]=i,t=r}this.C[t]=e}k(t,e){let r=this.C[t];for(;t<e;){let e=t<<1|1,i=e+1,n=this.C[e];if(i<this.i&&this.v(n,this.C[i])>0&&(e=i,n=this.C[i]),this.v(n,r)>=0)break;this.C[t]=n,t=e}this.C[t]=r}clear(){this.i=0,this.C.length=0}push(t){this.C.push(t),this.m(this.i),this.i+=1}pop(){if(this.i===0)return;let t=this.C[0],e=this.C.pop();return this.i-=1,this.i&&(this.C[0]=e,this.k(0,this.i>>1)),t}top(){return this.C[0]}find(t){return this.C.indexOf(t)>=0}remove(t){let e=this.C.indexOf(t);return e<0?!1:(e===0?this.pop():e===this.i-1?(this.C.pop(),this.i-=1):(this.C.splice(e,1,this.C.pop()),this.i-=1,this.m(e),this.k(e,this.i>>1)),!0)}updateItem(t){let e=this.C.indexOf(t);return e<0?!1:(this.m(e),this.k(e,this.i>>1),!0)}toArray(){return[...this.C]}},i=r;t.default=i}));var tn=f((t=>{p();ue();Gt();Object.defineProperty(t,"t",{value:!0});t.default=void 0;var e=Yi(),r=class extends e.Container{},i=r;t.default=i}));var en=f((t=>{p();ue();Gt();Object.defineProperty(t,"t",{value:!0});t.throwIteratorAccessError=e;function e(){throw new RangeError("Iterator access denied!")}}));var rn=f((t=>{p();ue();Gt();Object.defineProperty(t,"t",{value:!0});t.RandomIterator=void 0;var e=Yi(),r=en(),i=class extends e.ContainerIterator{constructor(t,e){super(e),this.o=t,this.iteratorType===0?(this.pre=function(){return this.o===0&&(0,r.throwIteratorAccessError)(),this.o-=1,this},this.next=function(){return this.o===this.container.size()&&(0,r.throwIteratorAccessError)(),this.o+=1,this}):(this.pre=function(){return this.o===this.container.size()-1&&(0,r.throwIteratorAccessError)(),this.o+=1,this},this.next=function(){return this.o===-1&&(0,r.throwIteratorAccessError)(),this.o-=1,this})}get pointer(){return this.container.getElementByPos(this.o)}set pointer(t){this.container.setElementByPos(this.o,t)}};t.RandomIterator=i}));var nn=f((t=>{p();ue();Gt();Object.defineProperty(t,"t",{value:!0});t.default=void 0;var e=i(tn()),r=rn();function i(t){return t&&t.t?t:{default:t}}var n=class t extends r.RandomIterator{constructor(t,e,r){super(t,r),this.container=e}copy(){return new t(this.o,this.container,this.iteratorType)}},s=class extends e.default{constructor(t=[],e=!0){if(super(),Array.isArray(t))this.J=e?[...t]:t,this.i=t.length;else{this.J=[];let e=this;t.forEach((function(t){e.pushBack(t)}))}}clear(){this.i=0,this.J.length=0}begin(){return new n(0,this)}end(){return new n(this.i,this)}rBegin(){return new n(this.i-1,this,1)}rEnd(){return new n(-1,this,1)}front(){return this.J[0]}back(){return this.J[this.i-1]}getElementByPos(t){if(t<0||t>this.i-1)throw new RangeError;return this.J[t]}eraseElementByPos(t){if(t<0||t>this.i-1)throw new RangeError;return this.J.splice(t,1),this.i-=1,this.i}eraseElementByValue(t){let e=0;for(let r=0;r<this.i;++r)this.J[r]!==t&&(this.J[e++]=this.J[r]);return this.i=this.J.length=e,this.i}eraseElementByIterator(t){let e=t.o;return t=t.next(),this.eraseElementByPos(e),t}pushBack(t){return this.J.push(t),this.i+=1,this.i}popBack(){if(this.i!==0)return this.i-=1,this.J.pop()}setElementByPos(t,e){if(t<0||t>this.i-1)throw new RangeError;this.J[t]=e}insert(t,e,r=1){if(t<0||t>this.i)throw new RangeError;return this.J.splice(t,0,...new Array(r).fill(e)),this.i+=r,this.i}find(t){for(let e=0;e<this.i;++e)if(this.J[e]===t)return new n(e,this);return this.end()}reverse(){this.J.reverse()}unique(){let t=1;for(let e=1;e<this.i;++e)this.J[e]!==this.J[e-1]&&(this.J[t++]=this.J[e]);return this.i=this.J.length=t,this.i}sort(t){this.J.sort(t)}forEach(t){for(let e=0;e<this.i;++e)t(this.J[e],e,this)}[Symbol.iterator](){return function*(){yield*this.J}.bind(this)()}},o=s;t.default=o}));var sn=f((t=>{p();ue();Gt();Object.defineProperty(t,"t",{value:!0});t.default=void 0;var e=n(tn()),r=Yi(),i=en();function n(t){return t&&t.t?t:{default:t}}var s=class t extends r.ContainerIterator{constructor(t,e,r,n){super(n),this.o=t,this.h=e,this.container=r,this.iteratorType===0?(this.pre=function(){return this.o.L===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.L,this})}get pointer(){return this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o.l}set pointer(t){this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o.l=t}copy(){return new t(this.o,this.h,this.container,this.iteratorType)}},o=class extends e.default{constructor(t=[]){super(),this.h={},this.p=this._=this.h.L=this.h.B=this.h;let e=this;t.forEach((function(t){e.pushBack(t)}))}V(t){let{L:e,B:r}=t;e.B=r,r.L=e,t===this.p&&(this.p=r),t===this._&&(this._=e),this.i-=1}G(t,e){let r=e.B,i={l:t,L:e,B:r};e.B=i,r.L=i,e===this.h&&(this.p=i),r===this.h&&(this._=i),this.i+=1}clear(){this.i=0,this.p=this._=this.h.L=this.h.B=this.h}begin(){return new s(this.p,this.h,this)}end(){return new s(this.h,this.h,this)}rBegin(){return new s(this._,this.h,this,1)}rEnd(){return new s(this.h,this.h,this,1)}front(){return this.p.l}back(){return this._.l}getElementByPos(t){if(t<0||t>this.i-1)throw new RangeError;let e=this.p;for(;t--;)e=e.B;return e.l}eraseElementByPos(t){if(t<0||t>this.i-1)throw new RangeError;let e=this.p;for(;t--;)e=e.B;return this.V(e),this.i}eraseElementByValue(t){let e=this.p;for(;e!==this.h;)e.l===t&&this.V(e),e=e.B;return this.i}eraseElementByIterator(t){let e=t.o;return e===this.h&&(0,i.throwIteratorAccessError)(),t=t.next(),this.V(e),t}pushBack(t){return this.G(t,this._),this.i}popBack(){if(this.i===0)return;let t=this._.l;return this.V(this._),t}pushFront(t){return this.G(t,this.h),this.i}popFront(){if(this.i===0)return;let t=this.p.l;return this.V(this.p),t}setElementByPos(t,e){if(t<0||t>this.i-1)throw new RangeError;let r=this.p;for(;t--;)r=r.B;r.l=e}insert(t,e,r=1){if(t<0||t>this.i)throw new RangeError;if(r<=0)return this.i;if(t===0)for(;r--;)this.pushFront(e);else if(t===this.i)for(;r--;)this.pushBack(e);else{let i=this.p;for(let e=1;e<t;++e)i=i.B;let n=i.B;for(this.i+=r;r--;)i.B={l:e,L:i},i.B.L=i,i=i.B;i.B=n,n.L=i}return this.i}find(t){let e=this.p;for(;e!==this.h;){if(e.l===t)return new s(e,this.h,this);e=e.B}return this.end()}reverse(){if(this.i<=1)return;let t=this.p,e=this._,r=0;for(;r<<1<this.i;){let i=t.l;t.l=e.l,e.l=i,t=t.B,e=e.L,r+=1}}unique(){if(this.i<=1)return this.i;let t=this.p;for(;t!==this.h;){let e=t;for(;e.B!==this.h&&e.l===e.B.l;)e=e.B,this.i-=1;t.B=e.B,t.B.L=t,t=t.B}return this.i}sort(t){if(this.i<=1)return;let e=[];this.forEach((function(t){e.push(t)})),e.sort(t);let r=this.p;e.forEach((function(t){r.l=t,r=r.B}))}merge(t){let e=this;if(this.i===0)t.forEach((function(t){e.pushBack(t)}));else{let r=this.p;t.forEach((function(t){for(;r!==e.h&&r.l<=t;)r=r.B;e.G(t,r.L)}))}return this.i}forEach(t){let e=this.p,r=0;for(;e!==this.h;)t(e.l,r++,this),e=e.B}[Symbol.iterator](){return function*(){if(this.i===0)return;let t=this.p;for(;t!==this.h;)yield t.l,t=t.B}.bind(this)()}},u=o;t.default=u}));var on=f((t=>{p();ue();Gt();Object.defineProperty(t,"t",{value:!0});t.default=void 0;var e=i(tn()),r=rn();function i(t){return t&&t.t?t:{default:t}}var n=class t extends r.RandomIterator{constructor(t,e,r){super(t,r),this.container=e}copy(){return new t(this.o,this.container,this.iteratorType)}},s=class extends e.default{constructor(t=[],e=4096){super(),this.j=0,this.D=0,this.R=0,this.N=0,this.P=0,this.A=[];let r=(()=>{if(typeof t.length=="number")return t.length;if(typeof t.size=="number")return t.size;if(typeof t.size=="function")return t.size();throw new TypeError("Cannot get the length or size of the container")})();this.F=e,this.P=Math.max(Math.ceil(r/this.F),1);for(let t=0;t<this.P;++t)this.A.push(new Array(this.F));let i=Math.ceil(r/this.F);this.j=this.R=(this.P>>1)-(i>>1),this.D=this.N=this.F-r%this.F>>1;let n=this;t.forEach((function(t){n.pushBack(t)}))}T(){let t=[],e=Math.max(this.P>>1,1);for(let r=0;r<e;++r)t[r]=new Array(this.F);for(let e=this.j;e<this.P;++e)t[t.length]=this.A[e];for(let e=0;e<this.R;++e)t[t.length]=this.A[e];t[t.length]=[...this.A[this.R]],this.j=e,this.R=t.length-1;for(let r=0;r<e;++r)t[t.length]=new Array(this.F);this.A=t,this.P=t.length}O(t){let e=this.D+t+1,r=e%this.F,i=r-1,n=this.j+(e-r)/this.F;return r===0&&(n-=1),n%=this.P,i<0&&(i+=this.F),{curNodeBucketIndex:n,curNodePointerIndex:i}}clear(){this.A=[new Array(this.F)],this.P=1,this.j=this.R=this.i=0,this.D=this.N=this.F>>1}begin(){return new n(0,this)}end(){return new n(this.i,this)}rBegin(){return new n(this.i-1,this,1)}rEnd(){return new n(-1,this,1)}front(){if(this.i!==0)return this.A[this.j][this.D]}back(){if(this.i!==0)return this.A[this.R][this.N]}pushBack(t){return this.i&&(this.N<this.F-1?this.N+=1:this.R<this.P-1?(this.R+=1,this.N=0):(this.R=0,this.N=0),this.R===this.j&&this.N===this.D&&this.T()),this.i+=1,this.A[this.R][this.N]=t,this.i}popBack(){if(this.i===0)return;let t=this.A[this.R][this.N];return this.i!==1&&(this.N>0?this.N-=1:this.R>0?(this.R-=1,this.N=this.F-1):(this.R=this.P-1,this.N=this.F-1)),this.i-=1,t}pushFront(t){return this.i&&(this.D>0?this.D-=1:this.j>0?(this.j-=1,this.D=this.F-1):(this.j=this.P-1,this.D=this.F-1),this.j===this.R&&this.D===this.N&&this.T()),this.i+=1,this.A[this.j][this.D]=t,this.i}popFront(){if(this.i===0)return;let t=this.A[this.j][this.D];return this.i!==1&&(this.D<this.F-1?this.D+=1:this.j<this.P-1?(this.j+=1,this.D=0):(this.j=0,this.D=0)),this.i-=1,t}getElementByPos(t){if(t<0||t>this.i-1)throw new RangeError;let{curNodeBucketIndex:e,curNodePointerIndex:r}=this.O(t);return this.A[e][r]}setElementByPos(t,e){if(t<0||t>this.i-1)throw new RangeError;let{curNodeBucketIndex:r,curNodePointerIndex:i}=this.O(t);this.A[r][i]=e}insert(t,e,r=1){if(t<0||t>this.i)throw new RangeError;if(t===0)for(;r--;)this.pushFront(e);else if(t===this.i)for(;r--;)this.pushBack(e);else{let i=[];for(let e=t;e<this.i;++e)i.push(this.getElementByPos(e));this.cut(t-1);for(let t=0;t<r;++t)this.pushBack(e);for(let t=0;t<i.length;++t)this.pushBack(i[t])}return this.i}cut(t){if(t<0)return this.clear(),0;let{curNodeBucketIndex:e,curNodePointerIndex:r}=this.O(t);return this.R=e,this.N=r,this.i=t+1,this.i}eraseElementByPos(t){if(t<0||t>this.i-1)throw new RangeError;if(t===0)this.popFront();else if(t===this.i-1)this.popBack();else{let e=[];for(let r=t+1;r<this.i;++r)e.push(this.getElementByPos(r));this.cut(t),this.popBack();let r=this;e.forEach((function(t){r.pushBack(t)}))}return this.i}eraseElementByValue(t){if(this.i===0)return 0;let e=[];for(let r=0;r<this.i;++r){let i=this.getElementByPos(r);i!==t&&e.push(i)}let r=e.length;for(let t=0;t<r;++t)this.setElementByPos(t,e[t]);return this.cut(r-1)}eraseElementByIterator(t){let e=t.o;return this.eraseElementByPos(e),t=t.next(),t}find(t){for(let e=0;e<this.i;++e)if(this.getElementByPos(e)===t)return new n(e,this);return this.end()}reverse(){let t=0,e=this.i-1;for(;t<e;){let r=this.getElementByPos(t);this.setElementByPos(t,this.getElementByPos(e)),this.setElementByPos(e,r),t+=1,e-=1}}unique(){if(this.i<=1)return this.i;let t=1,e=this.getElementByPos(0);for(let r=1;r<this.i;++r){let i=this.getElementByPos(r);i!==e&&(e=i,this.setElementByPos(t++,i))}for(;this.i>t;)this.popBack();return this.i}sort(t){let e=[];for(let t=0;t<this.i;++t)e.push(this.getElementByPos(t));e.sort(t);for(let t=0;t<this.i;++t)this.setElementByPos(t,e[t])}shrinkToFit(){if(this.i===0)return;let t=[];this.forEach((function(e){t.push(e)})),this.P=Math.max(Math.ceil(this.i/this.F),1),this.i=this.j=this.R=this.D=this.N=0,this.A=[];for(let t=0;t<this.P;++t)this.A.push(new Array(this.F));for(let e=0;e<t.length;++e)this.pushBack(t[e])}forEach(t){for(let e=0;e<this.i;++e)t(this.getElementByPos(e),e,this)}[Symbol.iterator](){return function*(){for(let t=0;t<this.i;++t)yield this.getElementByPos(t)}.bind(this)()}},o=s;t.default=o}));var un=f((t=>{p();ue();Gt();Object.defineProperty(t,"t",{value:!0});t.TreeNodeEnableIndex=t.TreeNode=void 0;var e=class{constructor(t,e){this.ee=1,this.u=void 0,this.l=void 0,this.U=void 0,this.W=void 0,this.tt=void 0,this.u=t,this.l=e}L(){let t=this;if(t.ee===1&&t.tt.tt===t)t=t.W;else if(t.U)for(t=t.U;t.W;)t=t.W;else{let e=t.tt;for(;e.U===t;)t=e,e=t.tt;t=e}return t}B(){let t=this;if(t.W){for(t=t.W;t.U;)t=t.U;return t}else{let e=t.tt;for(;e.W===t;)t=e,e=t.tt;return t.W!==e?e:t}}te(){let t=this.tt,e=this.W,r=e.U;return t.tt===this?t.tt=e:t.U===this?t.U=e:t.W=e,e.tt=t,e.U=this,this.tt=e,this.W=r,r&&(r.tt=this),e}se(){let t=this.tt,e=this.U,r=e.W;return t.tt===this?t.tt=e:t.U===this?t.U=e:t.W=e,e.tt=t,e.W=this,this.tt=e,this.U=r,r&&(r.tt=this),e}};t.TreeNode=e;var r=class extends e{constructor(){super(...arguments),this.rt=1}te(){let t=super.te();return this.ie(),t.ie(),t}se(){let t=super.se();return this.ie(),t.ie(),t}ie(){this.rt=1,this.U&&(this.rt+=this.U.rt),this.W&&(this.rt+=this.W.rt)}};t.TreeNodeEnableIndex=r}));var an=f((t=>{p();ue();Gt();Object.defineProperty(t,"t",{value:!0});t.default=void 0;var e=un(),r=Yi(),i=en(),n=class extends r.Container{constructor(t=function(t,e){return t<e?-1:t>e?1:0},r=!1){super(),this.Y=void 0,this.v=t,r?(this.re=e.TreeNodeEnableIndex,this.M=function(t,e,r){let i=this.ne(t,e,r);if(i){let t=i.tt;for(;t!==this.h;)t.rt+=1,t=t.tt;let e=this.he(i);if(e){let{parentNode:t,grandParent:r,curNode:i}=e;t.ie(),r.ie(),i.ie()}}return this.i},this.V=function(t){let e=this.fe(t);for(;e!==this.h;)e.rt-=1,e=e.tt}):(this.re=e.TreeNode,this.M=function(t,e,r){let i=this.ne(t,e,r);return i&&this.he(i),this.i},this.V=this.fe),this.h=new this.re}X(t,e){let r=this.h;for(;t;){let i=this.v(t.u,e);if(i<0)t=t.W;else if(i>0)r=t,t=t.U;else return t}return r}Z(t,e){let r=this.h;for(;t;)this.v(t.u,e)<=0?t=t.W:(r=t,t=t.U);return r}$(t,e){let r=this.h;for(;t;){let i=this.v(t.u,e);if(i<0)r=t,t=t.W;else if(i>0)t=t.U;else return t}return r}rr(t,e){let r=this.h;for(;t;)this.v(t.u,e)<0?(r=t,t=t.W):t=t.U;return r}ue(t){for(;;){let e=t.tt;if(e===this.h)return;if(t.ee===1){t.ee=0;return}if(t===e.U){let r=e.W;if(r.ee===1)r.ee=0,e.ee=1,e===this.Y?this.Y=e.te():e.te();else if(r.W&&r.W.ee===1){r.ee=e.ee,e.ee=0,r.W.ee=0,e===this.Y?this.Y=e.te():e.te();return}else r.U&&r.U.ee===1?(r.ee=1,r.U.ee=0,r.se()):(r.ee=1,t=e)}else{let r=e.U;if(r.ee===1)r.ee=0,e.ee=1,e===this.Y?this.Y=e.se():e.se();else if(r.U&&r.U.ee===1){r.ee=e.ee,e.ee=0,r.U.ee=0,e===this.Y?this.Y=e.se():e.se();return}else r.W&&r.W.ee===1?(r.ee=1,r.W.ee=0,r.te()):(r.ee=1,t=e)}}}fe(t){if(this.i===1)return this.clear(),this.h;let e=t;for(;e.U||e.W;){if(e.W)for(e=e.W;e.U;)e=e.U;else e=e.U;[t.u,e.u]=[e.u,t.u],[t.l,e.l]=[e.l,t.l],t=e}this.h.U===e?this.h.U=e.tt:this.h.W===e&&(this.h.W=e.tt),this.ue(e);let r=e.tt;return e===r.U?r.U=void 0:r.W=void 0,this.i-=1,this.Y.ee=0,r}oe(t,e){return t===void 0?!1:this.oe(t.U,e)||e(t)?!0:this.oe(t.W,e)}he(t){for(;;){let e=t.tt;if(e.ee===0)return;let r=e.tt;if(e===r.U){let i=r.W;if(i&&i.ee===1){if(i.ee=e.ee=0,r===this.Y)return;r.ee=1,t=r;continue}else if(t===e.W){if(t.ee=0,t.U&&(t.U.tt=e),t.W&&(t.W.tt=r),e.W=t.U,r.U=t.W,t.U=e,t.W=r,r===this.Y)this.Y=t,this.h.tt=t;else{let e=r.tt;e.U===r?e.U=t:e.W=t}return t.tt=r.tt,e.tt=t,r.tt=t,r.ee=1,{parentNode:e,grandParent:r,curNode:t}}else e.ee=0,r===this.Y?this.Y=r.se():r.se(),r.ee=1}else{let i=r.U;if(i&&i.ee===1){if(i.ee=e.ee=0,r===this.Y)return;r.ee=1,t=r;continue}else if(t===e.U){if(t.ee=0,t.U&&(t.U.tt=r),t.W&&(t.W.tt=e),r.W=t.U,e.U=t.W,t.U=r,t.W=e,r===this.Y)this.Y=t,this.h.tt=t;else{let e=r.tt;e.U===r?e.U=t:e.W=t}return t.tt=r.tt,e.tt=t,r.tt=t,r.ee=1,{parentNode:e,grandParent:r,curNode:t}}else e.ee=0,r===this.Y?this.Y=r.te():r.te(),r.ee=1}return}}ne(t,e,r){if(this.Y===void 0){this.i+=1,this.Y=new this.re(t,e),this.Y.ee=0,this.Y.tt=this.h,this.h.tt=this.Y,this.h.U=this.Y,this.h.W=this.Y;return}let i,n=this.h.U,s=this.v(n.u,t);if(s===0){n.l=e;return}else if(s>0)n.U=new this.re(t,e),n.U.tt=n,i=n.U,this.h.U=i;else{let n=this.h.W,s=this.v(n.u,t);if(s===0){n.l=e;return}else if(s<0)n.W=new this.re(t,e),n.W.tt=n,i=n.W,this.h.W=i;else{if(r!==void 0){let n=r.o;if(n!==this.h){let r=this.v(n.u,t);if(r===0){n.l=e;return}else if(r>0){let r=n.L(),s=this.v(r.u,t);if(s===0){r.l=e;return}else s<0&&(i=new this.re(t,e),r.W===void 0?(r.W=i,i.tt=r):(n.U=i,i.tt=n))}}}if(i===void 0)for(i=this.Y;;){let r=this.v(i.u,t);if(r>0){if(i.U===void 0){i.U=new this.re(t,e),i.U.tt=i,i=i.U;break}i=i.U}else if(r<0){if(i.W===void 0){i.W=new this.re(t,e),i.W.tt=i,i=i.W;break}i=i.W}else{i.l=e;return}}}}return this.i+=1,i}I(t,e){for(;t;){let r=this.v(t.u,e);if(r<0)t=t.W;else if(r>0)t=t.U;else return t}return t||this.h}clear(){this.i=0,this.Y=void 0,this.h.tt=void 0,this.h.U=this.h.W=void 0}updateKeyByIterator(t,e){let r=t.o;if(r===this.h&&(0,i.throwIteratorAccessError)(),this.i===1)return r.u=e,!0;if(r===this.h.U)return this.v(r.B().u,e)>0?(r.u=e,!0):!1;if(r===this.h.W)return this.v(r.L().u,e)<0?(r.u=e,!0):!1;let n=r.L().u;if(this.v(n,e)>=0)return!1;let s=r.B().u;return this.v(s,e)<=0?!1:(r.u=e,!0)}eraseElementByPos(t){if(t<0||t>this.i-1)throw new RangeError;let e=0,r=this;return this.oe(this.Y,(function(i){return t===e?(r.V(i),!0):(e+=1,!1)})),this.i}eraseElementByKey(t){if(this.i===0)return!1;let e=this.I(this.Y,t);return e===this.h?!1:(this.V(e),!0)}eraseElementByIterator(t){let e=t.o;e===this.h&&(0,i.throwIteratorAccessError)();let r=e.W===void 0;return t.iteratorType===0?r&&t.next():(!r||e.U===void 0)&&t.next(),this.V(e),t}forEach(t){let e=0;for(let r of this)t(r,e++,this)}getElementByPos(t){if(t<0||t>this.i-1)throw new RangeError;let e,r=0;for(let i of this){if(r===t){e=i;break}r+=1}return e}getHeight(){if(this.i===0)return 0;let t=function(e){return e?Math.max(t(e.U),t(e.W))+1:0};return t(this.Y)}},s=n;t.default=s}));var hn=f((t=>{p();ue();Gt();Object.defineProperty(t,"t",{value:!0});t.default=void 0;var e=Yi(),r=en(),i=class extends e.ContainerIterator{constructor(t,e,i){super(i),this.o=t,this.h=e,this.iteratorType===0?(this.pre=function(){return this.o===this.h.U&&(0,r.throwIteratorAccessError)(),this.o=this.o.L(),this},this.next=function(){return this.o===this.h&&(0,r.throwIteratorAccessError)(),this.o=this.o.B(),this}):(this.pre=function(){return this.o===this.h.W&&(0,r.throwIteratorAccessError)(),this.o=this.o.B(),this},this.next=function(){return this.o===this.h&&(0,r.throwIteratorAccessError)(),this.o=this.o.L(),this})}get index(){let t=this.o,e=this.h.tt;if(t===this.h)return e?e.rt-1:0;let r=0;for(t.U&&(r+=t.U.rt);t!==e;){let e=t.tt;t===e.W&&(r+=1,e.U&&(r+=e.U.rt)),t=e}return r}},n=i;t.default=n}));var fn=f((t=>{p();ue();Gt();Object.defineProperty(t,"t",{value:!0});t.default=void 0;var e=n(an()),r=n(hn()),i=en();function n(t){return t&&t.t?t:{default:t}}var s=class t extends r.default{constructor(t,e,r,i){super(t,e,i),this.container=r}get pointer(){return this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o.u}copy(){return new t(this.o,this.h,this.container,this.iteratorType)}},o=class extends e.default{constructor(t=[],e,r){super(e,r);let i=this;t.forEach((function(t){i.insert(t)}))}*K(t){t!==void 0&&(yield*this.K(t.U),yield t.u,yield*this.K(t.W))}begin(){return new s(this.h.U||this.h,this.h,this)}end(){return new s(this.h,this.h,this)}rBegin(){return new s(this.h.W||this.h,this.h,this,1)}rEnd(){return new s(this.h,this.h,this,1)}front(){return this.h.U?this.h.U.u:void 0}back(){return this.h.W?this.h.W.u:void 0}insert(t,e){return this.M(t,void 0,e)}find(t){let e=this.I(this.Y,t);return new s(e,this.h,this)}lowerBound(t){let e=this.X(this.Y,t);return new s(e,this.h,this)}upperBound(t){let e=this.Z(this.Y,t);return new s(e,this.h,this)}reverseLowerBound(t){let e=this.$(this.Y,t);return new s(e,this.h,this)}reverseUpperBound(t){let e=this.rr(this.Y,t);return new s(e,this.h,this)}union(t){let e=this;return t.forEach((function(t){e.insert(t)})),this.i}[Symbol.iterator](){return this.K(this.Y)}},u=o;t.default=u}));var ln=f((t=>{p();ue();Gt();Object.defineProperty(t,"t",{value:!0});t.default=void 0;var e=n(an()),r=n(hn()),i=en();function n(t){return t&&t.t?t:{default:t}}var s=class t extends r.default{constructor(t,e,r,i){super(t,e,i),this.container=r}get pointer(){this.o===this.h&&(0,i.throwIteratorAccessError)();let t=this;return new Proxy([],{get(e,r){if(r==="0")return t.o.u;if(r==="1")return t.o.l},set(e,r,i){if(r!=="1")throw new TypeError("props must be 1");return t.o.l=i,!0}})}copy(){return new t(this.o,this.h,this.container,this.iteratorType)}},o=class extends e.default{constructor(t=[],e,r){super(e,r);let i=this;t.forEach((function(t){i.setElement(t[0],t[1])}))}*K(t){t!==void 0&&(yield*this.K(t.U),yield[t.u,t.l],yield*this.K(t.W))}begin(){return new s(this.h.U||this.h,this.h,this)}end(){return new s(this.h,this.h,this)}rBegin(){return new s(this.h.W||this.h,this.h,this,1)}rEnd(){return new s(this.h,this.h,this,1)}front(){if(this.i===0)return;let t=this.h.U;return[t.u,t.l]}back(){if(this.i===0)return;let t=this.h.W;return[t.u,t.l]}lowerBound(t){let e=this.X(this.Y,t);return new s(e,this.h,this)}upperBound(t){let e=this.Z(this.Y,t);return new s(e,this.h,this)}reverseLowerBound(t){let e=this.$(this.Y,t);return new s(e,this.h,this)}reverseUpperBound(t){let e=this.rr(this.Y,t);return new s(e,this.h,this)}setElement(t,e,r){return this.M(t,e,r)}find(t){let e=this.I(this.Y,t);return new s(e,this.h,this)}getElementByKey(t){return this.I(this.Y,t).l}union(t){let e=this;return t.forEach((function(t){e.setElement(t[0],t[1])})),this.i}[Symbol.iterator](){return this.K(this.Y)}},u=o;t.default=u}));var cn=f((t=>{p();ue();Gt();Object.defineProperty(t,"t",{value:!0});t.default=e;function e(t){let e=typeof t;return e==="object"&&t!==null||e==="function"}}));var dn=f((t=>{p();ue();Gt();Object.defineProperty(t,"t",{value:!0});t.HashContainerIterator=t.HashContainer=void 0;var e=Yi(),r=n(cn()),i=en();function n(t){return t&&t.t?t:{default:t}}var s=class extends e.ContainerIterator{constructor(t,e,r){super(r),this.o=t,this.h=e,this.iteratorType===0?(this.pre=function(){return this.o.L===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.L,this})}};t.HashContainerIterator=s;var o=class extends e.Container{constructor(){super(),this.H=[],this.g={},this.HASH_TAG=Symbol("@@HASH_TAG"),Object.setPrototypeOf(this.g,null),this.h={},this.h.L=this.h.B=this.p=this._=this.h}V(t){let{L:e,B:r}=t;e.B=r,r.L=e,t===this.p&&(this.p=r),t===this._&&(this._=e),this.i-=1}M(t,e,i){i===void 0&&(i=(0,r.default)(t));let n;if(i){let r=t[this.HASH_TAG];if(r!==void 0)return this.H[r].l=e,this.i;Object.defineProperty(t,this.HASH_TAG,{value:this.H.length,configurable:!0}),n={u:t,l:e,L:this._,B:this.h},this.H.push(n)}else{let r=this.g[t];if(r)return r.l=e,this.i;n={u:t,l:e,L:this._,B:this.h},this.g[t]=n}return this.i===0?(this.p=n,this.h.B=n):this._.B=n,this._=n,this.h.L=n,++this.i}I(t,e){if(e===void 0&&(e=(0,r.default)(t)),e){let e=t[this.HASH_TAG];return e===void 0?this.h:this.H[e]}else return this.g[t]||this.h}clear(){let t=this.HASH_TAG;this.H.forEach((function(e){delete e.u[t]})),this.H=[],this.g={},Object.setPrototypeOf(this.g,null),this.i=0,this.p=this._=this.h.L=this.h.B=this.h}eraseElementByKey(t,e){let i;if(e===void 0&&(e=(0,r.default)(t)),e){let e=t[this.HASH_TAG];if(e===void 0)return!1;delete t[this.HASH_TAG],i=this.H[e],delete this.H[e]}else{if(i=this.g[t],i===void 0)return!1;delete this.g[t]}return this.V(i),!0}eraseElementByIterator(t){let e=t.o;return e===this.h&&(0,i.throwIteratorAccessError)(),this.V(e),t.next()}eraseElementByPos(t){if(t<0||t>this.i-1)throw new RangeError;let e=this.p;for(;t--;)e=e.B;return this.V(e),this.i}};t.HashContainer=o}));var pn=f((t=>{p();ue();Gt();Object.defineProperty(t,"t",{value:!0});t.default=void 0;var e=dn(),r=en(),i=class t extends e.HashContainerIterator{constructor(t,e,r,i){super(t,e,i),this.container=r}get pointer(){return this.o===this.h&&(0,r.throwIteratorAccessError)(),this.o.u}copy(){return new t(this.o,this.h,this.container,this.iteratorType)}},n=class extends e.HashContainer{constructor(t=[]){super();let e=this;t.forEach((function(t){e.insert(t)}))}begin(){return new i(this.p,this.h,this)}end(){return new i(this.h,this.h,this)}rBegin(){return new i(this._,this.h,this,1)}rEnd(){return new i(this.h,this.h,this,1)}front(){return this.p.u}back(){return this._.u}insert(t,e){return this.M(t,void 0,e)}getElementByPos(t){if(t<0||t>this.i-1)throw new RangeError;let e=this.p;for(;t--;)e=e.B;return e.u}find(t,e){let r=this.I(t,e);return new i(r,this.h,this)}forEach(t){let e=0,r=this.p;for(;r!==this.h;)t(r.u,e++,this),r=r.B}[Symbol.iterator](){return function*(){let t=this.p;for(;t!==this.h;)yield t.u,t=t.B}.bind(this)()}},s=n;t.default=s}));var bn=f((t=>{p();ue();Gt();Object.defineProperty(t,"t",{value:!0});t.default=void 0;var e=dn(),r=n(cn()),i=en();function n(t){return t&&t.t?t:{default:t}}var s=class t extends e.HashContainerIterator{constructor(t,e,r,i){super(t,e,i),this.container=r}get pointer(){this.o===this.h&&(0,i.throwIteratorAccessError)();let t=this;return new Proxy([],{get(e,r){if(r==="0")return t.o.u;if(r==="1")return t.o.l},set(e,r,i){if(r!=="1")throw new TypeError("props must be 1");return t.o.l=i,!0}})}copy(){return new t(this.o,this.h,this.container,this.iteratorType)}},o=class extends e.HashContainer{constructor(t=[]){super();let e=this;t.forEach((function(t){e.setElement(t[0],t[1])}))}begin(){return new s(this.p,this.h,this)}end(){return new s(this.h,this.h,this)}rBegin(){return new s(this._,this.h,this,1)}rEnd(){return new s(this.h,this.h,this,1)}front(){if(this.i!==0)return[this.p.u,this.p.l]}back(){if(this.i!==0)return[this._.u,this._.l]}setElement(t,e,r){return this.M(t,e,r)}getElementByKey(t,e){if(e===void 0&&(e=(0,r.default)(t)),e){let e=t[this.HASH_TAG];return e!==void 0?this.H[e].l:void 0}let i=this.g[t];return i?i.l:void 0}getElementByPos(t){if(t<0||t>this.i-1)throw new RangeError;let e=this.p;for(;t--;)e=e.B;return[e.u,e.l]}find(t,e){let r=this.I(t,e);return new s(r,this.h,this)}forEach(t){let e=0,r=this.p;for(;r!==this.h;)t([r.u,r.l],e++,this),r=r.B}[Symbol.iterator](){return function*(){let t=this.p;for(;t!==this.h;)yield[t.u,t.l],t=t.B}.bind(this)()}},u=o;t.default=u}));var vn=f((t=>{p();ue();Gt();Object.defineProperty(t,"t",{value:!0});Object.defineProperty(t,"Deque",{enumerable:!0,get:function(){return o.default}});Object.defineProperty(t,"HashMap",{enumerable:!0,get:function(){return f.default}});Object.defineProperty(t,"HashSet",{enumerable:!0,get:function(){return h.default}});Object.defineProperty(t,"LinkList",{enumerable:!0,get:function(){return s.default}});Object.defineProperty(t,"OrderedMap",{enumerable:!0,get:function(){return a.default}});Object.defineProperty(t,"OrderedSet",{enumerable:!0,get:function(){return u.default}});Object.defineProperty(t,"PriorityQueue",{enumerable:!0,get:function(){return i.default}});Object.defineProperty(t,"Queue",{enumerable:!0,get:function(){return r.default}});Object.defineProperty(t,"Stack",{enumerable:!0,get:function(){return e.default}});Object.defineProperty(t,"Vector",{enumerable:!0,get:function(){return n.default}});var e=l(Ji()),r=l(Zi()),i=l(Xi()),n=l(nn()),s=l(sn()),o=l(on()),u=l(fn()),a=l(ln()),h=l(pn()),f=l(bn());function l(t){return t&&t.t?t:{default:t}}}));var wn=f(((t,e)=>{p();ue();Gt();var r=vn().OrderedSet,i=Ci()("number-allocator:trace"),n=Ci()("number-allocator:error");function s(t,e){this.low=t,this.high=e}s.prototype.equals=function(t){return this.low===t.low&&this.high===t.high};s.prototype.compare=function(t){return this.low<t.low&&this.high<t.low?-1:t.low<this.low&&t.high<this.low?1:0};function o(t,e){if(!(this instanceof o))return new o(t,e);this.min=t,this.max=e,this.ss=new r([],((t,e)=>t.compare(e))),i("Create"),this.clear()}o.prototype.firstVacant=function(){return this.ss.size()===0?null:this.ss.front().low};o.prototype.alloc=function(){if(this.ss.size()===0)return i("alloc():empty"),null;let t=this.ss.begin(),e=t.pointer.low,r=t.pointer.high,n=e;return n+1<=r?this.ss.updateKeyByIterator(t,new s(e+1,r)):this.ss.eraseElementByPos(0),i("alloc():"+n),n};o.prototype.use=function(t){let e=new s(t,t),r=this.ss.lowerBound(e);if(!r.equals(this.ss.end())){let n=r.pointer.low,o=r.pointer.high;return r.pointer.equals(e)?(this.ss.eraseElementByIterator(r),i("use():"+t),!0):n>t?!1:n===t?(this.ss.updateKeyByIterator(r,new s(n+1,o)),i("use():"+t),!0):o===t?(this.ss.updateKeyByIterator(r,new s(n,o-1)),i("use():"+t),!0):(this.ss.updateKeyByIterator(r,new s(t+1,o)),this.ss.insert(new s(n,t-1)),i("use():"+t),!0)}return i("use():failed"),!1};o.prototype.free=function(t){if(t<this.min||t>this.max){n("free():"+t+" is out of range");return}let e=new s(t,t),r=this.ss.upperBound(e);if(r.equals(this.ss.end())){if(r.equals(this.ss.begin())){this.ss.insert(e);return}r.pre();let i=r.pointer.high;r.pointer.high+1===t?this.ss.updateKeyByIterator(r,new s(i,t)):this.ss.insert(e)}else if(r.equals(this.ss.begin()))if(t+1===r.pointer.low){let e=r.pointer.high;this.ss.updateKeyByIterator(r,new s(t,e))}else this.ss.insert(e);else{let i=r.pointer.low,n=r.pointer.high;r.pre();let o=r.pointer.low;r.pointer.high+1===t?t+1===i?(this.ss.eraseElementByIterator(r),this.ss.updateKeyByIterator(r,new s(o,n))):this.ss.updateKeyByIterator(r,new s(o,t)):t+1===i?(this.ss.eraseElementByIterator(r.next()),this.ss.insert(new s(t,n))):this.ss.insert(e)}i("free():"+t)};o.prototype.clear=function(){i("clear()"),this.ss.clear(),this.ss.insert(new s(this.min,this.max))};o.prototype.intervalCount=function(){return this.ss.size()};o.prototype.dump=function(){console.log("length:"+this.ss.size());for(let t of this.ss)console.log(t)};e.exports=o}));var yn=f(((t,e)=>{p();ue();Gt();var r=wn();e.exports.NumberAllocator=r}));var mn=f((t=>{p();ue();Gt();Object.defineProperty(t,"__esModule",{value:!0});var e=Qi(),r=yn(),i=class{constructor(t){t>0&&(this.aliasToTopic=new e.LRUCache({max:t}),this.topicToAlias={},this.numberAllocator=new r.NumberAllocator(1,t),this.max=t,this.length=0)}put(t,e){if(e===0||e>this.max)return!1;let r=this.aliasToTopic.get(e);return r&&delete this.topicToAlias[r],this.aliasToTopic.set(e,t),this.topicToAlias[t]=e,this.numberAllocator.use(e),this.length=this.aliasToTopic.size,!0}getTopicByAlias(t){return this.aliasToTopic.get(t)}getAliasByTopic(t){let e=this.topicToAlias[t];return typeof e<"u"&&this.aliasToTopic.get(e),e}clear(){this.aliasToTopic.clear(),this.topicToAlias={},this.numberAllocator.clear(),this.length=0}getLruAlias(){let t=this.numberAllocator.firstVacant();return t||[...this.aliasToTopic.keys()][this.aliasToTopic.size-1]}};t.default=i}));var gn=f((t=>{p();ue();Gt();var e=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0});var r=Hi(),i=e(mn()),n=Vi(),s=(t,e)=>{t.log("_handleConnack");let{options:s}=t,o=s.protocolVersion===5?e.reasonCode:e.returnCode;if(clearTimeout(t.connackTimer),delete t.topicAliasSend,e.properties){if(e.properties.topicAliasMaximum){if(e.properties.topicAliasMaximum>65535){t.emit("error",new Error("topicAliasMaximum from broker is out of range"));return}e.properties.topicAliasMaximum>0&&(t.topicAliasSend=new i.default(e.properties.topicAliasMaximum))}e.properties.serverKeepAlive&&s.keepalive&&(s.keepalive=e.properties.serverKeepAlive),e.properties.maximumPacketSize&&(s.properties||(s.properties={}),s.properties.maximumPacketSize=e.properties.maximumPacketSize)}if(o===0)t.reconnecting=!1,t._onConnect(e);else if(o>0){let e=new n.ErrorWithReasonCode(`Connection refused: ${r.ReasonCodes[o]}`,o);t.emit("error",e)}};t.default=s}));var En=f((t=>{p();ue();Gt();Object.defineProperty(t,"__esModule",{value:!0});var e=(t,e,r)=>{t.log("handling pubrel packet");let i=typeof r<"u"?r:t.noop,{messageId:n}=e,s={cmd:"pubcomp",messageId:n};t.incomingStore.get(e,((e,r)=>{e?t._sendPacket(s,i):(t.emit("message",r.topic,r.payload,r),t.handleMessage(r,(e=>{if(e)return i(e);t.incomingStore.del(r,t.noop),t._sendPacket(s,i)})))}))};t.default=e}));var _n=f((t=>{p();ue();Gt();var e=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0});var r=e(Wi()),i=e(Ki()),n=e(gn()),s=e(Hi()),o=e(En()),u=(t,e,u)=>{let{options:a}=t;if(a.protocolVersion===5&&a.properties&&a.properties.maximumPacketSize&&a.properties.maximumPacketSize<e.length)return t.emit("error",new Error(`exceeding packets size ${e.cmd}`)),t.end({reasonCode:149,properties:{reasonString:"Maximum packet size was exceeded"}}),t;switch(t.log("_handlePacket :: emitting packetreceive"),t.emit("packetreceive",e),e.cmd){case"publish":(0,r.default)(t,e,u);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":t.reschedulePing(),(0,s.default)(t,e),u();break;case"pubrel":t.reschedulePing(),(0,o.default)(t,e,u);break;case"connack":(0,n.default)(t,e),u();break;case"auth":t.reschedulePing(),(0,i.default)(t,e),u();break;case"pingresp":t.log("_handlePacket :: received pingresp"),t.reschedulePing(!0),u();break;case"disconnect":t.emit("disconnect",e),u();break;default:t.log("_handlePacket :: unknown command"),u();break}};t.default=u}));var An=f((t=>{p();ue();Gt();var e=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0});t.TypedEventEmitter=void 0;var r=e((qe(),d(Be))),i=Vi(),n=class{};t.TypedEventEmitter=n;(0,i.applyMixin)(n,r.default)}));var kn=f((t=>{p();ue();Gt();Object.defineProperty(t,"__esModule",{value:!0});t.isReactNativeBrowser=t.isWebWorker=void 0;var e=()=>{var t;return typeof window<"u"?typeof navigator<"u"&&((t=navigator.userAgent)===null||t===void 0?void 0:t.toLowerCase().indexOf(" electron/"))>-1&&(!(b===null||b===void 0)&&b.versions)?!Object.prototype.hasOwnProperty.call(b.versions,"electron"):typeof window.document<"u":!1},r=()=>{var t,e;return!!(typeof self=="object"&&(!((e=(t=self?.constructor)===null||t===void 0?void 0:t.name)===null||e===void 0)&&e.includes("WorkerGlobalScope")))},i=()=>typeof navigator<"u"&&navigator.product==="ReactNative",n=e()||r()||i();t.isWebWorker=r();t.isReactNativeBrowser=i();t.default=n}));var Sn=f(((t,e)=>{p();ue();Gt();(function(r,i){typeof t=="object"&&typeof e<"u"?i(t):typeof define=="function"&&define.amd?define(["exports"],i):(r=typeof globalThis<"u"?globalThis:r||self,i(r.fastUniqueNumbers={}))})(t,(function(t){var e=function(t){return function(e){var r=t(e);return e.add(r),r}},r=function(t){return function(e,r){return t.set(e,r),r}},i=Number.MAX_SAFE_INTEGER===void 0?9007199254740991:Number.MAX_SAFE_INTEGER,n=536870912,s=n*2,o=function(t,e){return function(r){var o=e.get(r),u=o===void 0?r.size:o<s?o+1:0;if(!r.has(u))return t(r,u);if(r.size<n){for(;r.has(u);)u=Math.floor(Math.random()*s);return t(r,u)}if(r.size>i)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;r.has(u);)u=Math.floor(Math.random()*i);return t(r,u)}},u=new WeakMap,a=r(u),h=o(a,u),f=e(h);t.addUniqueNumber=f,t.generateUniqueNumber=h}))}));var On=f(((t,e)=>{p();ue();Gt();(function(r,i){typeof t=="object"&&typeof e<"u"?i(t,Sn()):typeof define=="function"&&define.amd?define(["exports","fast-unique-numbers"],i):(r=typeof globalThis<"u"?globalThis:r||self,i(r.workerTimersBroker={},r.fastUniqueNumbers))})(t,(function(t,e){var r=function(t){return t.method!==void 0&&t.method==="call"},i=function(t){return t.error===null&&typeof t.id=="number"},n=function(t){var n=new Map([[0,function(){}]]),s=new Map([[0,function(){}]]),o=new Map,u=new Worker(t);u.addEventListener("message",(function(t){var e=t.data;if(r(e)){var u=e.params,a=u.timerId,h=u.timerType;if(h==="interval"){var f=n.get(a);if(typeof f=="number"){var l=o.get(f);if(l===void 0||l.timerId!==a||l.timerType!==h)throw new Error("The timer is in an undefined state.")}else if(typeof f<"u")f();else throw new Error("The timer is in an undefined state.")}else if(h==="timeout"){var c=s.get(a);if(typeof c=="number"){var d=o.get(c);if(d===void 0||d.timerId!==a||d.timerType!==h)throw new Error("The timer is in an undefined state.")}else if(typeof c<"u")c(),s.delete(a);else throw new Error("The timer is in an undefined state.")}}else if(i(e)){var p=e.id,b=o.get(p);if(b===void 0)throw new Error("The timer is in an undefined state.");var v=b.timerId,w=b.timerType;o.delete(p),w==="interval"?n.delete(v):s.delete(v)}else{var y=e.error.message;throw new Error(y)}}));var a=function(t){var r=e.generateUniqueNumber(o);o.set(r,{timerId:t,timerType:"interval"}),n.set(t,r),u.postMessage({id:r,method:"clear",params:{timerId:t,timerType:"interval"}})},h=function(t){var r=e.generateUniqueNumber(o);o.set(r,{timerId:t,timerType:"timeout"}),s.set(t,r),u.postMessage({id:r,method:"clear",params:{timerId:t,timerType:"timeout"}})},f=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=e.generateUniqueNumber(n);return n.set(i,(function(){t(),typeof n.get(i)=="function"&&u.postMessage({id:null,method:"set",params:{delay:r,now:performance.now(),timerId:i,timerType:"interval"}})})),u.postMessage({id:null,method:"set",params:{delay:r,now:performance.now(),timerId:i,timerType:"interval"}}),i},l=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=e.generateUniqueNumber(s);return s.set(i,t),u.postMessage({id:null,method:"set",params:{delay:r,now:performance.now(),timerId:i,timerType:"timeout"}}),i};return{clearInterval:a,clearTimeout:h,setInterval:f,setTimeout:l}};t.load=n}))}));var Rn=f(((t,e)=>{p();ue();Gt();(function(r,i){typeof t=="object"&&typeof e<"u"?i(t,On()):typeof define=="function"&&define.amd?define(["exports","worker-timers-broker"],i):(r=typeof globalThis<"u"?globalThis:r||self,i(r.workerTimers={},r.workerTimersBroker))})(t,(function(t,e){var r=function(t,e){var r=null;return function(){if(r!==null)return r;var i=new Blob([e],{type:"application/javascript; charset=utf-8"}),n=URL.createObjectURL(i);return r=t(n),setTimeout((function(){return URL.revokeObjectURL(n)})),r}},i=`(()=>{var e={472:(e,t,r)=>{var o,i;void 0===(i="function"==typeof(o=function(){"use strict";var e=new Map,t=new Map,r=function(t){var r=e.get(t);if(void 0===r)throw new Error('There is no interval scheduled with the given id "'.concat(t,'".'));clearTimeout(r),e.delete(t)},o=function(e){var r=t.get(e);if(void 0===r)throw new Error('There is no timeout scheduled with the given id "'.concat(e,'".'));clearTimeout(r),t.delete(e)},i=function(e,t){var r,o=performance.now();return{expected:o+(r=e-Math.max(0,o-t)),remainingDelay:r}},n=function e(t,r,o,i){var n=performance.now();n>o?postMessage({id:null,method:"call",params:{timerId:r,timerType:i}}):t.set(r,setTimeout(e,o-n,t,r,o,i))},a=function(t,r,o){var a=i(t,o),s=a.expected,d=a.remainingDelay;e.set(r,setTimeout(n,d,e,r,s,"interval"))},s=function(e,r,o){var a=i(e,o),s=a.expected,d=a.remainingDelay;t.set(r,setTimeout(n,d,t,r,s,"timeout"))};addEventListener("message",(function(e){var t=e.data;try{if("clear"===t.method){var i=t.id,n=t.params,d=n.timerId,c=n.timerType;if("interval"===c)r(d),postMessage({error:null,id:i});else{if("timeout"!==c)throw new Error('The given type "'.concat(c,'" is not supported'));o(d),postMessage({error:null,id:i})}}else{if("set"!==t.method)throw new Error('The given method "'.concat(t.method,'" is not supported'));var u=t.params,l=u.delay,p=u.now,m=u.timerId,v=u.timerType;if("interval"===v)a(l,m,p);else{if("timeout"!==v)throw new Error('The given type "'.concat(v,'" is not supported'));s(l,m,p)}}}catch(e){postMessage({error:{message:e.message},id:t.id,result:null})}}))})?o.call(t,r,t,e):o)||(e.exports=i)}},t={};function r(o){var i=t[o];if(void 0!==i)return i.exports;var n=t[o]={exports:{}};return e[o](n,n.exports,r),n.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";r(472)})()})();`,n=r(e.load,i),s=function(t){return n().clearInterval(t)},o=function(t){return n().clearTimeout(t)},u=function(){var t;return(t=n()).setInterval.apply(t,arguments)},a=function(){var t;return(t=n()).setTimeout.apply(t,arguments)};t.clearInterval=s,t.clearTimeout=o,t.setInterval=u,t.setTimeout=a}))}));var Tn=f((t=>{p();ue();Gt();var e=t&&t.__createBinding||(Object.create?function(t,e,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}:function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]}),r=t&&t.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=t&&t.__importStar||function(t){if(t&&t.__esModule)return t;var i={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&e(i,t,n);return r(i,t),i};Object.defineProperty(t,"__esModule",{value:!0});var n=i(kn()),s=Rn(),o={set:s.setInterval,clear:s.clearInterval},u={set:(t,e)=>setInterval(t,e),clear:t=>clearInterval(t)},a=t=>{switch(t){case"native":return u;case"worker":return o;case"auto":default:return n.default&&!n.isWebWorker&&!n.isReactNativeBrowser?o:u}};t.default=a}));var jn=f((t=>{p();ue();Gt();var e=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0});var r=e(Tn()),i=class{get keepaliveTimeoutTimestamp(){return this._keepaliveTimeoutTimestamp}get intervalEvery(){return this._intervalEvery}get keepalive(){return this._keepalive}constructor(t,e){this.destroyed=!1,this.client=t,this.timer=typeof e=="object"&&"set"in e&&"clear"in e?e:(0,r.default)(e),this.setKeepalive(t.options.keepalive)}clear(){this.timerId&&(this.timer.clear(this.timerId),this.timerId=null)}setKeepalive(t){if(t*=1e3,isNaN(t)||t<=0||t>2147483647)throw new Error(`Keepalive value must be an integer between 0 and 2147483647. Provided value is ${t}`);this._keepalive=t,this.reschedule(),this.client.log(`KeepaliveManager: set keepalive to ${t}ms`)}destroy(){this.clear(),this.destroyed=!0}reschedule(){if(this.destroyed)return;this.clear(),this.counter=0;let t=Math.ceil(this._keepalive*1.5);this._keepaliveTimeoutTimestamp=Date.now()+t,this._intervalEvery=Math.ceil(this._keepalive/2),this.timerId=this.timer.set((()=>{this.destroyed||(this.counter+=1,this.counter===2?this.client.sendPing():this.counter>2&&this.client.onKeepaliveTimeout())}),this._intervalEvery)}};t.default=i}));var In=f((t=>{p();ue();Gt();var e=t&&t.__createBinding||(Object.create?function(t,e,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}:function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]}),r=t&&t.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=t&&t.__importStar||function(t){if(t&&t.__esModule)return t;var i={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&e(i,t,n);return r(i,t),i},n=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(ae()),o=n(Fi()),u=n($i()),a=ki(),h=n(Di()),f=i(qi()),l=n(Ci()),c=n(zi()),d=n(_n()),b=Vi(),v=An(),w=n(jn()),y=i(kn()),m=globalThis.setImmediate||((...t)=>{let e=t.shift();(0,b.nextTick)((()=>{e(...t)}))}),g={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:30*1e3,clean:!0,resubscribe:!0,writeCache:!0,timerVariant:"auto"},E=class t extends v.TypedEventEmitter{static defaultId(){return`mqttjs_${Math.random().toString(16).substr(2,8)}`}constructor(e,r){super(),this.options=r||{};for(let t in g)typeof this.options[t]>"u"?this.options[t]=g[t]:this.options[t]=r[t];this.log=this.options.log||(0,l.default)("mqttjs:client"),this.noop=this._noop.bind(this),this.log("MqttClient :: version:",t.VERSION),y.isWebWorker?this.log("MqttClient :: environment","webworker"):this.log("MqttClient :: environment",y.default?"browser":"node"),this.log("MqttClient :: options.protocol",r.protocol),this.log("MqttClient :: options.protocolVersion",r.protocolVersion),this.log("MqttClient :: options.username",r.username),this.log("MqttClient :: options.keepalive",r.keepalive),this.log("MqttClient :: options.reconnectPeriod",r.reconnectPeriod),this.log("MqttClient :: options.rejectUnauthorized",r.rejectUnauthorized),this.log("MqttClient :: options.properties.topicAliasMaximum",r.properties?r.properties.topicAliasMaximum:void 0),this.options.clientId=typeof r.clientId=="string"?r.clientId:t.defaultId(),this.log("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=r.protocolVersion===5&&r.customHandleAcks?r.customHandleAcks:(...t)=>{t[3](null,0)},this.options.writeCache||(o.default.writeToStream.cacheNumbers=!1),this.streamBuilder=e,this.messageIdProvider=typeof this.options.messageIdProvider>"u"?new u.default:this.options.messageIdProvider,this.outgoingStore=r.outgoingStore||new c.default,this.incomingStore=r.incomingStore||new c.default,this.queueQoSZero=r.queueQoSZero===void 0?!0:r.queueQoSZero,this._resubscribeTopics={},this.messageIdToTopic={},this.keepaliveManager=null,this.connected=!1,this.disconnecting=!1,this.reconnecting=!1,this.queue=[],this.connackTimer=null,this.reconnectTimer=null,this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={},this._storeProcessingQueue=[],this.outgoing={},this._firstConnection=!0,r.properties&&r.properties.topicAliasMaximum>0&&(r.properties.topicAliasMaximum>65535?this.log("MqttClient :: options.properties.topicAliasMaximum is out of range"):this.topicAliasRecv=new s.default(r.properties.topicAliasMaximum)),this.on("connect",(()=>{let{queue:t}=this,e=()=>{let r=t.shift();this.log("deliver :: entry %o",r);let i=null;if(!r){this._resubscribe();return}i=r.packet,this.log("deliver :: call _sendPacket for %o",i);let n=!0;i.messageId&&i.messageId!==0&&(this.messageIdProvider.register(i.messageId)||(n=!1)),n?this._sendPacket(i,(t=>{r.cb&&r.cb(t),e()})):(this.log("messageId: %d has already used. The message is skipped and removed.",i.messageId),e())};this.log("connect :: sending queued packets"),e()})),this.on("close",(()=>{this.log("close :: connected set to `false`"),this.connected=!1,this.log("close :: clearing connackTimer"),clearTimeout(this.connackTimer),this._destroyKeepaliveManager(),this.topicAliasRecv&&this.topicAliasRecv.clear(),this.log("close :: calling _setupReconnect"),this._setupReconnect()})),this.options.manualConnect||(this.log("MqttClient :: setting up stream"),this.connect())}handleAuth(t,e){e()}handleMessage(t,e){e()}_nextId(){return this.messageIdProvider.allocate()}getLastMessageId(){return this.messageIdProvider.getLastAllocated()}connect(){var t;let e=new a.Writable,r=o.default.parser(this.options),i=null,n=[];this.log("connect :: calling method to clear reconnect"),this._clearReconnect(),this.disconnected&&!this.reconnecting&&(this.incomingStore=this.options.incomingStore||new c.default,this.outgoingStore=this.options.outgoingStore||new c.default,this.disconnecting=!1,this.disconnected=!1),this.log("connect :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),r.on("packet",(t=>{this.log("parser :: on packet push to packets array."),n.push(t)}));let s=()=>{this.log("work :: getting next packet in queue");let t=n.shift();if(t)this.log("work :: packet pulled from queue"),(0,d.default)(this,t,u);else{this.log("work :: no packets in queue");let t=i;i=null,this.log("work :: done flag is %s",!!t),t&&t()}},u=()=>{if(n.length)(0,b.nextTick)(s);else{let t=i;i=null,t()}};e._write=(t,e,n)=>{i=n,this.log("writable stream :: parsing buffer"),r.parse(t),s()};let h=t=>{this.log("streamErrorHandler :: error",t.message),t.code?(this.log("streamErrorHandler :: emitting error"),this.emit("error",t)):this.noop(t)};this.log("connect :: pipe stream to writable stream"),this.stream.pipe(e),this.stream.on("error",h),this.stream.on("close",(()=>{this.log("(%s)stream :: on close",this.options.clientId),this._flushVolatile(),this.log("stream: emit close to MqttClient"),this.emit("close")})),this.log("connect: sending packet `connect`");let f={cmd:"connect",protocolId:this.options.protocolId,protocolVersion:this.options.protocolVersion,clean:this.options.clean,clientId:this.options.clientId,keepalive:this.options.keepalive,username:this.options.username,password:this.options.password,properties:this.options.properties};if(this.options.will&&(f.will=Object.assign(Object.assign({},this.options.will),{payload:(t=this.options.will)===null||t===void 0?void 0:t.payload})),this.topicAliasRecv&&(f.properties||(f.properties={}),this.topicAliasRecv&&(f.properties.topicAliasMaximum=this.topicAliasRecv.max)),this._writePacket(f),r.on("error",this.emit.bind(this,"error")),this.options.properties){if(!this.options.properties.authenticationMethod&&this.options.properties.authenticationData)return this.end((()=>this.emit("error",new Error("Packet has no Authentication Method")))),this;if(this.options.properties.authenticationMethod&&this.options.authPacket&&typeof this.options.authPacket=="object"){let t=Object.assign({cmd:"auth",reasonCode:0},this.options.authPacket);this._writePacket(t)}}return this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout((()=>{this.log("!!connectTimeout hit!! Calling _cleanUp with force `true`"),this.emit("error",new Error("connack timeout")),this._cleanUp(!0)}),this.options.connectTimeout),this}publish(t,e,r,i){this.log("publish :: message `%s` to topic `%s`",e,t);let{options:n}=this;typeof r=="function"&&(i=r,r=null),r=r||{},r=Object.assign(Object.assign({},{qos:0,retain:!1,dup:!1}),r);let{qos:s,retain:o,dup:u,properties:a,cbStorePut:h}=r;if(this._checkDisconnecting(i))return this;let f=()=>{let r=0;if((s===1||s===2)&&(r=this._nextId(),r===null))return this.log("No messageId left"),!1;let f={cmd:"publish",topic:t,payload:e,qos:s,retain:o,messageId:r,dup:u};switch(n.protocolVersion===5&&(f.properties=a),this.log("publish :: qos",s),s){case 1:case 2:this.outgoing[f.messageId]={volatile:!1,cb:i||this.noop},this.log("MqttClient:publish: packet cmd: %s",f.cmd),this._sendPacket(f,void 0,h);break;default:this.log("MqttClient:publish: packet cmd: %s",f.cmd),this._sendPacket(f,i,h);break}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!f())&&this._storeProcessingQueue.push({invoke:f,cbStorePut:r.cbStorePut,callback:i}),this}publishAsync(t,e,r){return new Promise(((i,n)=>{this.publish(t,e,r,((t,e)=>{t?n(t):i(e)}))}))}subscribe(t,e,r){let i=this.options.protocolVersion;typeof e=="function"&&(r=e),r=r||this.noop;let n=!1,s=[];typeof t=="string"?(t=[t],s=t):Array.isArray(t)?s=t:typeof t=="object"&&(n=t.resubscribe,delete t.resubscribe,s=Object.keys(t));let o=f.validateTopics(s);if(o!==null)return m(r,new Error(`Invalid topic ${o}`)),this;if(this._checkDisconnecting(r))return this.log("subscribe: discconecting true"),this;let u={qos:0};i===5&&(u.nl=!1,u.rap=!1,u.rh=0),e=Object.assign(Object.assign({},u),e);let a=e.properties,h=[],l=(t,r)=>{if(r=r||e,!Object.prototype.hasOwnProperty.call(this._resubscribeTopics,t)||this._resubscribeTopics[t].qos<r.qos||n){let e={topic:t,qos:r.qos};i===5&&(e.nl=r.nl,e.rap=r.rap,e.rh=r.rh,e.properties=a),this.log("subscribe: pushing topic `%s` and qos `%s` to subs list",e.topic,e.qos),h.push(e)}};if(Array.isArray(t)?t.forEach((t=>{this.log("subscribe: array topic %s",t),l(t)})):Object.keys(t).forEach((e=>{this.log("subscribe: object topic %s, %o",e,t[e]),l(e,t[e])})),!h.length)return r(null,[]),this;let c=()=>{let t=this._nextId();if(t===null)return this.log("No messageId left"),!1;let e={cmd:"subscribe",subscriptions:h,messageId:t};if(a&&(e.properties=a),this.options.resubscribe){this.log("subscribe :: resubscribe true");let t=[];h.forEach((e=>{if(this.options.reconnectPeriod>0){let r={qos:e.qos};i===5&&(r.nl=e.nl||!1,r.rap=e.rap||!1,r.rh=e.rh||0,r.properties=e.properties),this._resubscribeTopics[e.topic]=r,t.push(e.topic)}})),this.messageIdToTopic[e.messageId]=t}return this.outgoing[e.messageId]={volatile:!0,cb(t,e){if(!t){let{granted:t}=e;for(let e=0;e<t.length;e+=1)h[e].qos=t[e]}r(t,h,e)}},this.log("subscribe :: call _sendPacket"),this._sendPacket(e),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!c())&&this._storeProcessingQueue.push({invoke:c,callback:r}),this}subscribeAsync(t,e){return new Promise(((r,i)=>{this.subscribe(t,e,((t,e)=>{t?i(t):r(e)}))}))}unsubscribe(t,e,r){typeof t=="string"&&(t=[t]),typeof e=="function"&&(r=e),r=r||this.noop;let i=f.validateTopics(t);if(i!==null)return m(r,new Error(`Invalid topic ${i}`)),this;if(this._checkDisconnecting(r))return this;let n=()=>{let i=this._nextId();if(i===null)return this.log("No messageId left"),!1;let n={cmd:"unsubscribe",messageId:i,unsubscriptions:[]};return typeof t=="string"?n.unsubscriptions=[t]:Array.isArray(t)&&(n.unsubscriptions=t),this.options.resubscribe&&n.unsubscriptions.forEach((t=>{delete this._resubscribeTopics[t]})),typeof e=="object"&&e.properties&&(n.properties=e.properties),this.outgoing[n.messageId]={volatile:!0,cb:r},this.log("unsubscribe: call _sendPacket"),this._sendPacket(n),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!n())&&this._storeProcessingQueue.push({invoke:n,callback:r}),this}unsubscribeAsync(t,e){return new Promise(((r,i)=>{this.unsubscribe(t,e,((t,e)=>{t?i(t):r(e)}))}))}end(t,e,r){this.log("end :: (%s)",this.options.clientId),(t==null||typeof t!="boolean")&&(r=r||e,e=t,t=!1),typeof e!="object"&&(r=r||e,e=null),this.log("end :: cb? %s",!!r),(!r||typeof r!="function")&&(r=this.noop);let i=()=>{this.log("end :: closeStores: closing incoming and outgoing stores"),this.disconnected=!0,this.incomingStore.close((t=>{this.outgoingStore.close((e=>{if(this.log("end :: closeStores: emitting end"),this.emit("end"),r){let i=t||e;this.log("end :: closeStores: invoking callback with args"),r(i)}}))})),this._deferredReconnect?this._deferredReconnect():(this.options.reconnectPeriod===0||this.options.manualConnect)&&(this.disconnecting=!1)},n=()=>{this.log("end :: (%s) :: finish :: calling _cleanUp with force %s",this.options.clientId,t),this._cleanUp(t,(()=>{this.log("end :: finish :: calling process.nextTick on closeStores"),(0,b.nextTick)(i)}),e)};return this.disconnecting?(r(),this):(this._clearReconnect(),this.disconnecting=!0,!t&&Object.keys(this.outgoing).length>0?(this.log("end :: (%s) :: calling finish in 10ms once outgoing is empty",this.options.clientId),this.once("outgoingEmpty",setTimeout.bind(null,n,10))):(this.log("end :: (%s) :: immediately calling finish",this.options.clientId),n()),this)}endAsync(t,e){return new Promise(((r,i)=>{this.end(t,e,(t=>{t?i(t):r()}))}))}removeOutgoingMessage(t){if(this.outgoing[t]){let{cb:e}=this.outgoing[t];this._removeOutgoingAndStoreMessage(t,(()=>{e(new Error("Message removed"))}))}return this}reconnect(t){this.log("client reconnect");let e=()=>{t?(this.options.incomingStore=t.incomingStore,this.options.outgoingStore=t.outgoingStore):(this.options.incomingStore=null,this.options.outgoingStore=null),this.incomingStore=this.options.incomingStore||new c.default,this.outgoingStore=this.options.outgoingStore||new c.default,this.disconnecting=!1,this.disconnected=!1,this._deferredReconnect=null,this._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=e:e(),this}_flushVolatile(){this.outgoing&&(this.log("_flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function"),Object.keys(this.outgoing).forEach((t=>{this.outgoing[t].volatile&&typeof this.outgoing[t].cb=="function"&&(this.outgoing[t].cb(new Error("Connection closed")),delete this.outgoing[t])})))}_flush(){this.outgoing&&(this.log("_flush: queue exists? %b",!!this.outgoing),Object.keys(this.outgoing).forEach((t=>{typeof this.outgoing[t].cb=="function"&&(this.outgoing[t].cb(new Error("Connection closed")),delete this.outgoing[t])})))}_removeTopicAliasAndRecoverTopicName(t){let e;t.properties&&(e=t.properties.topicAlias);let r=t.topic.toString();if(this.log("_removeTopicAliasAndRecoverTopicName :: alias %d, topic %o",e,r),r.length===0){if(typeof e>"u")return new Error("Unregistered Topic Alias");if(r=this.topicAliasSend.getTopicByAlias(e),typeof r>"u")return new Error("Unregistered Topic Alias");t.topic=r}e&&delete t.properties.topicAlias}_checkDisconnecting(t){return this.disconnecting&&(t&&t!==this.noop?t(new Error("client disconnecting")):this.emit("error",new Error("client disconnecting"))),this.disconnecting}_reconnect(){this.log("_reconnect: emitting reconnect to client"),this.emit("reconnect"),this.connected?(this.end((()=>{this.connect()})),this.log("client already connected. disconnecting first.")):(this.log("_reconnect: calling connect"),this.connect())}_setupReconnect(){!this.disconnecting&&!this.reconnectTimer&&this.options.reconnectPeriod>0?(this.reconnecting||(this.log("_setupReconnect :: emit `offline` state"),this.emit("offline"),this.log("_setupReconnect :: set `reconnecting` to `true`"),this.reconnecting=!0),this.log("_setupReconnect :: setting reconnectTimer for %d ms",this.options.reconnectPeriod),this.reconnectTimer=setInterval((()=>{this.log("reconnectTimer :: reconnect triggered!"),this._reconnect()}),this.options.reconnectPeriod)):this.log("_setupReconnect :: doing nothing...")}_clearReconnect(){this.log("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)}_cleanUp(t,e,r={}){if(e&&(this.log("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",e)),this.log("_cleanUp :: forced? %s",t),t)this.options.reconnectPeriod===0&&this.options.clean&&this._flush(),this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{let t=Object.assign({cmd:"disconnect"},r);this.log("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(t,(()=>{this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),m((()=>{this.stream.end((()=>{this.log("_cleanUp :: (%s) :: stream destroyed",this.options.clientId)}))}))}))}!this.disconnecting&&!this.reconnecting&&(this.log("_cleanUp :: client not disconnecting/reconnecting. Clearing and resetting reconnect."),this._clearReconnect(),this._setupReconnect()),this._destroyKeepaliveManager(),e&&!this.connected&&(this.log("_cleanUp :: (%s) :: removing stream `done` callback `close` listener",this.options.clientId),this.stream.removeListener("close",e),e())}_storeAndSend(t,e,r){this.log("storeAndSend :: store packet with cmd %s to outgoingStore",t.cmd);let i=t,n;if(i.cmd==="publish"&&(i=(0,h.default)(t),n=this._removeTopicAliasAndRecoverTopicName(i),n))return e&&e(n);this.outgoingStore.put(i,(i=>{if(i)return e&&e(i);r(),this._writePacket(t,e)}))}_applyTopicAlias(t){if(this.options.protocolVersion===5&&t.cmd==="publish"){let e;t.properties&&(e=t.properties.topicAlias);let r=t.topic.toString();if(this.topicAliasSend)if(e){if(r.length!==0&&(this.log("applyTopicAlias :: register topic: %s - alias: %d",r,e),!this.topicAliasSend.put(r,e)))return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",r,e),new Error("Sending Topic Alias out of range")}else r.length!==0&&(this.options.autoAssignTopicAlias?(e=this.topicAliasSend.getAliasByTopic(r),e?(t.topic="",t.properties=Object.assign(Object.assign({},t.properties),{topicAlias:e}),this.log("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",r,e)):(e=this.topicAliasSend.getLruAlias(),this.topicAliasSend.put(r,e),t.properties=Object.assign(Object.assign({},t.properties),{topicAlias:e}),this.log("applyTopicAlias :: auto assign topic: %s - alias: %d",r,e))):this.options.autoUseTopicAlias&&(e=this.topicAliasSend.getAliasByTopic(r),e&&(t.topic="",t.properties=Object.assign(Object.assign({},t.properties),{topicAlias:e}),this.log("applyTopicAlias :: auto use topic: %s - alias: %d",r,e))));else if(e)return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",r,e),new Error("Sending Topic Alias out of range")}}_noop(t){this.log("noop ::",t)}_writePacket(t,e){this.log("_writePacket :: packet: %O",t),this.log("_writePacket :: emitting `packetsend`"),this.emit("packetsend",t),this.log("_writePacket :: writing to stream");let r=o.default.writeToStream(t,this.stream,this.options);this.log("_writePacket :: writeToStream result %s",r),!r&&e&&e!==this.noop?(this.log("_writePacket :: handle events on `drain` once through callback."),this.stream.once("drain",e)):e&&(this.log("_writePacket :: invoking cb"),e())}_sendPacket(t,e,r,i){this.log("_sendPacket :: (%s) :: start",this.options.clientId),r=r||this.noop,e=e||this.noop;let n=this._applyTopicAlias(t);if(n){e(n);return}if(!this.connected){if(t.cmd==="auth"){this._writePacket(t,e);return}this.log("_sendPacket :: client not connected. Storing packet offline."),this._storePacket(t,e,r);return}if(i){this._writePacket(t,e);return}switch(t.cmd){case"publish":break;case"pubrel":this._storeAndSend(t,e,r);return;default:this._writePacket(t,e);return}switch(t.qos){case 2:case 1:this._storeAndSend(t,e,r);break;case 0:default:this._writePacket(t,e);break}this.log("_sendPacket :: (%s) :: end",this.options.clientId)}_storePacket(t,e,r){this.log("_storePacket :: packet: %o",t),this.log("_storePacket :: cb? %s",!!e),r=r||this.noop;let i=t;if(i.cmd==="publish"){i=(0,h.default)(t);let r=this._removeTopicAliasAndRecoverTopicName(i);if(r)return e&&e(r)}let n=i.qos||0;n===0&&this.queueQoSZero||i.cmd!=="publish"?this.queue.push({packet:i,cb:e}):n>0?(e=this.outgoing[i.messageId]?this.outgoing[i.messageId].cb:null,this.outgoingStore.put(i,(t=>{if(t)return e&&e(t);r()}))):e&&e(new Error("No connection to broker"))}_setupKeepaliveManager(){this.log("_setupKeepaliveManager :: keepalive %d (seconds)",this.options.keepalive),!this.keepaliveManager&&this.options.keepalive&&(this.keepaliveManager=new w.default(this,this.options.timerVariant))}_destroyKeepaliveManager(){this.keepaliveManager&&(this.log("_destroyKeepaliveManager :: destroying keepalive manager"),this.keepaliveManager.destroy(),this.keepaliveManager=null)}reschedulePing(t=!1){this.keepaliveManager&&this.options.keepalive&&(t||this.options.reschedulePings)&&this._reschedulePing()}_reschedulePing(){this.log("_reschedulePing :: rescheduling ping"),this.keepaliveManager.reschedule()}sendPing(){this.log("_sendPing :: sending pingreq"),this._sendPacket({cmd:"pingreq"})}onKeepaliveTimeout(){this.emit("error",new Error("Keepalive timeout")),this.log("onKeepaliveTimeout :: calling _cleanUp with force true"),this._cleanUp(!0)}_resubscribe(){this.log("_resubscribe");let t=Object.keys(this._resubscribeTopics);if(!this._firstConnection&&(this.options.clean||this.options.protocolVersion>=4&&!this.connackPacket.sessionPresent)&&t.length>0)if(this.options.resubscribe)if(this.options.protocolVersion===5){this.log("_resubscribe: protocolVersion 5");for(let e=0;e<t.length;e++){let r={};r[t[e]]=this._resubscribeTopics[t[e]],r.resubscribe=!0,this.subscribe(r,{properties:r[t[e]].properties})}}else this._resubscribeTopics.resubscribe=!0,this.subscribe(this._resubscribeTopics);else this._resubscribeTopics={};this._firstConnection=!1}_onConnect(t){if(this.disconnected){this.emit("connect",t);return}this.connackPacket=t,this.messageIdProvider.clear(),this._setupKeepaliveManager(),this.connected=!0;let e=()=>{let r=this.outgoingStore.createStream(),i=()=>{r.destroy(),r=null,this._flushStoreProcessingQueue(),n()},n=()=>{this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={}};this.once("close",i),r.on("error",(t=>{n(),this._flushStoreProcessingQueue(),this.removeListener("close",i),this.emit("error",t)}));let s=()=>{if(!r)return;let t=r.read(1),e;if(!t){r.once("readable",s);return}if(this._storeProcessing=!0,this._packetIdsDuringStoreProcessing[t.messageId]){s();return}!this.disconnecting&&!this.reconnectTimer?(e=this.outgoing[t.messageId]?this.outgoing[t.messageId].cb:null,this.outgoing[t.messageId]={volatile:!1,cb(t,r){e&&e(t,r),s()}},this._packetIdsDuringStoreProcessing[t.messageId]=!0,this.messageIdProvider.register(t.messageId)?this._sendPacket(t,void 0,void 0,!0):this.log("messageId: %d has already used.",t.messageId)):r.destroy&&r.destroy()};r.on("end",(()=>{let r=!0;for(let t in this._packetIdsDuringStoreProcessing)if(!this._packetIdsDuringStoreProcessing[t]){r=!1;break}this.removeListener("close",i),r?(n(),this._invokeAllStoreProcessingQueue(),this.emit("connect",t)):e()})),s()};e()}_invokeStoreProcessingQueue(){if(!this._storeProcessing&&this._storeProcessingQueue.length>0){let t=this._storeProcessingQueue[0];if(t&&t.invoke())return this._storeProcessingQueue.shift(),!0}return!1}_invokeAllStoreProcessingQueue(){for(;this._invokeStoreProcessingQueue(););}_flushStoreProcessingQueue(){for(let t of this._storeProcessingQueue)t.cbStorePut&&t.cbStorePut(new Error("Connection closed")),t.callback&&t.callback(new Error("Connection closed"));this._storeProcessingQueue.splice(0)}_removeOutgoingAndStoreMessage(t,e){delete this.outgoing[t],this.outgoingStore.del({messageId:t},((r,i)=>{e(r,i),this.messageIdProvider.deallocate(t),this._invokeStoreProcessingQueue()}))}};E.VERSION=b.MQTTJS_VERSION;t.default=E}));var Mn=f((t=>{p();ue();Gt();Object.defineProperty(t,"__esModule",{value:!0});var e=yn(),r=class{constructor(){this.numberAllocator=new e.NumberAllocator(1,65535)}allocate(){return this.lastId=this.numberAllocator.alloc(),this.lastId}getLastAllocated(){return this.lastId}register(t){return this.numberAllocator.use(t)}deallocate(t){this.numberAllocator.free(t)}clear(){this.numberAllocator.clear()}};t.default=r}));function Cn(t){throw new RangeError(Fn[t])}function Pn(t,e){let r=t.split("@"),i="";r.length>1&&(i=r[0]+"@",t=r[1]);let n=function(t,e){let r=[],i=t.length;for(;i--;)r[i]=e(t[i]);return r}((t=t.replace(Un,".")).split("."),e).join(".");return i+n}function Nn(t){let e=[],r=0,i=t.length;for(;r<i;){let n=t.charCodeAt(r++);if(n>=55296&&n<=56319&&r<i){let i=t.charCodeAt(r++);(64512&i)==56320?e.push(((1023&n)<<10)+(1023&i)+65536):(e.push(n),r--)}else e.push(n)}return e}var Bn,xn,Un,Fn,$n,Ln,Dn,qn,zn,Wn,Gn,Vn=h((()=>{p();ue();Gt();Bn=/^xn--/,xn=/[^\0-\x7E]/,Un=/[\x2E\u3002\uFF0E\uFF61]/g,Fn={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},$n=Math.floor,Ln=String.fromCharCode;Dn=function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},qn=function(t,e,r){let i=0;for(t=r?$n(t/700):t>>1,t+=$n(t/e);t>455;i+=36)t=$n(t/35);return $n(i+36*t/(t+38))},zn=function(t){let e=[],r=t.length,i=0,n=128,s=72,o=t.lastIndexOf("-");o<0&&(o=0);for(let r=0;r<o;++r)t.charCodeAt(r)>=128&&Cn("not-basic"),e.push(t.charCodeAt(r));for(let a=o>0?o+1:0;a<r;){let o=i;for(let e=1,n=36;;n+=36){a>=r&&Cn("invalid-input");let o=(u=t.charCodeAt(a++))-48<10?u-22:u-65<26?u-65:u-97<26?u-97:36;(o>=36||o>$n((2147483647-i)/e))&&Cn("overflow"),i+=o*e;let h=n<=s?1:n>=s+26?26:n-s;if(o<h)break;let f=36-h;e>$n(2147483647/f)&&Cn("overflow"),e*=f}let h=e.length+1;s=qn(i-o,h,o==0),$n(i/h)>2147483647-n&&Cn("overflow"),n+=$n(i/h),i%=h,e.splice(i++,0,n)}var u;return String.fromCodePoint(...e)},Wn=function(t){let e=[],r=(t=Nn(t)).length,i=128,n=0,s=72;for(let r of t)r<128&&e.push(Ln(r));let o=e.length,u=o;for(o&&e.push("-");u<r;){let r=2147483647;for(let e of t)e>=i&&e<r&&(r=e);let a=u+1;r-i>$n((2147483647-n)/a)&&Cn("overflow"),n+=(r-i)*a,i=r;for(let r of t)if(r<i&&++n>2147483647&&Cn("overflow"),r==i){let t=n;for(let r=36;;r+=36){let i=r<=s?1:r>=s+26?26:r-s;if(t<i)break;let n=t-i,o=36-i;e.push(Ln(Dn(i+n%o,0))),t=$n(n/o)}e.push(Ln(Dn(t,0))),s=qn(n,a,u==o),n=0,++u}++n,++i}return e.join("")},Gn={version:"2.1.0",ucs2:{decode:Nn,encode:t=>String.fromCodePoint(...t)},decode:zn,encode:Wn,toASCII:function(t){return Pn(t,(function(t){return xn.test(t)?"xn--"+Wn(t):t}))},toUnicode:function(t){return Pn(t,(function(t){return Bn.test(t)?zn(t.slice(4).toLowerCase()):t}))}}}));function Hn(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var Kn,Qn,Yn,Jn,Zn=h((()=>{p();ue();Gt();Kn=function(t,e,r,i){e=e||"&",r=r||"=";var n={};if(typeof t!="string"||t.length===0)return n;var s=/\+/g;t=t.split(e);var o=1e3;i&&typeof i.maxKeys=="number"&&(o=i.maxKeys);var u=t.length;o>0&&u>o&&(u=o);for(var a=0;a<u;++a){var h,f,l,c,d=t[a].replace(s,"%20"),p=d.indexOf(r);p>=0?(h=d.substr(0,p),f=d.substr(p+1)):(h=d,f=""),l=decodeURIComponent(h),c=decodeURIComponent(f),Hn(n,l)?Array.isArray(n[l])?n[l].push(c):n[l]=[n[l],c]:n[l]=c}return n},Qn=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},Yn=function(t,e,r,i){return e=e||"&",r=r||"=",t===null&&(t=void 0),typeof t=="object"?Object.keys(t).map((function(i){var n=encodeURIComponent(Qn(i))+r;return Array.isArray(t[i])?t[i].map((function(t){return n+encodeURIComponent(Qn(t))})).join(e):n+encodeURIComponent(Qn(t[i]))})).join(e):i?encodeURIComponent(Qn(i))+r+encodeURIComponent(Qn(t)):""},Jn={};Jn.decode=Jn.parse=Kn,Jn.encode=Jn.stringify=Yn}));function Xn(){throw new Error("setTimeout has not been defined")}function ts(){throw new Error("clearTimeout has not been defined")}function es(t){if(us===setTimeout)return setTimeout(t,0);if((us===Xn||!us)&&setTimeout)return us=setTimeout,setTimeout(t,0);try{return us(t,0)}catch{try{return us.call(null,t,0)}catch{return us.call(this||hs,t,0)}}}function rs(){ds&&ls&&(ds=!1,ls.length?cs=ls.concat(cs):ps=-1,cs.length&&is())}function is(){if(!ds){var t=es(rs);ds=!0;for(var e=cs.length;e;){for(ls=cs,cs=[];++ps<e;)ls&&ls[ps].run();ps=-1,e=cs.length}ls=null,ds=!1,function(t){if(as===clearTimeout)return clearTimeout(t);if((as===ts||!as)&&clearTimeout)return as=clearTimeout,clearTimeout(t);try{as(t)}catch{try{return as.call(null,t)}catch{return as.call(this||hs,t)}}}(t)}}function ns(t,e){(this||hs).fun=t,(this||hs).array=e}function ss(){}var os,us,as,hs,fs,ls,cs,ds,ps,bs,vs=h((()=>{p();ue();Gt();hs=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,fs=os={};(function(){try{us=typeof setTimeout=="function"?setTimeout:Xn}catch{us=Xn}try{as=typeof clearTimeout=="function"?clearTimeout:ts}catch{as=ts}})();cs=[],ds=!1,ps=-1;fs.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];cs.push(new ns(t,e)),cs.length!==1||ds||es(is)},ns.prototype.run=function(){(this||hs).fun.apply(null,(this||hs).array)},fs.title="browser",fs.browser=!0,fs.env={},fs.argv=[],fs.version="",fs.versions={},fs.on=ss,fs.addListener=ss,fs.once=ss,fs.off=ss,fs.removeListener=ss,fs.removeAllListeners=ss,fs.emit=ss,fs.prependListener=ss,fs.prependOnceListener=ss,fs.listeners=function(t){return[]},fs.binding=function(t){throw new Error("process.binding is not supported")},fs.cwd=function(){return"/"},fs.chdir=function(t){throw new Error("process.chdir is not supported")},fs.umask=function(){return 0};bs=os}));function ws(){if(ms)return ys;ms=!0;var t=ys={},e,r;function i(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?e=setTimeout:e=i}catch{e=i}try{typeof clearTimeout=="function"?r=clearTimeout:r=n}catch{r=n}})();function s(t){if(e===setTimeout)return setTimeout(t,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch{try{return e.call(null,t,0)}catch{return e.call(this||gs,t,0)}}}function o(t){if(r===clearTimeout)return clearTimeout(t);if((r===n||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{return r(t)}catch{try{return r.call(null,t)}catch{return r.call(this||gs,t)}}}var u=[],a=!1,h,f=-1;function l(){!a||!h||(a=!1,h.length?u=h.concat(u):f=-1,u.length&&c())}function c(){if(!a){var t=s(l);a=!0;for(var e=u.length;e;){for(h=u,u=[];++f<e;)h&&h[f].run();f=-1,e=u.length}h=null,a=!1,o(t)}}t.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];u.push(new d(t,e)),u.length===1&&!a&&s(c)};function d(t,e){(this||gs).fun=t,(this||gs).array=e}d.prototype.run=function(){(this||gs).fun.apply(null,(this||gs).array)},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={};function p(){}return t.on=p,t.addListener=p,t.once=p,t.off=p,t.removeListener=p,t.removeAllListeners=p,t.emit=p,t.prependListener=p,t.prependOnceListener=p,t.listeners=function(t){return[]},t.binding=function(t){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(t){throw new Error("process.chdir is not supported")},t.umask=function(){return 0},ys}var ys,ms,gs,Es,_s=h((()=>{p();ue();Gt();ys={},ms=!1,gs=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Es=ws();Es.platform="browser"}));function As(){if(Ss)return ks;Ss=!0;var t=Es;function e(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function r(t,e){for(var r="",i=0,n=-1,s=0,o,u=0;u<=t.length;++u){if(u<t.length)o=t.charCodeAt(u);else{if(o===47)break;o=47}if(o===47){if(!(n===u-1||s===1))if(n!==u-1&&s===2){if(r.length<2||i!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var a=r.lastIndexOf("/");if(a!==r.length-1){a===-1?(r="",i=0):(r=r.slice(0,a),i=r.length-1-r.lastIndexOf("/")),n=u,s=0;continue}}else if(r.length===2||r.length===1){r="",i=0,n=u,s=0;continue}}e&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+t.slice(n+1,u):r=t.slice(n+1,u),i=u-n-1;n=u,s=0}else o===46&&s!==-1?++s:s=-1}return r}function i(t,e){var r=e.dir||e.root,i=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+i:r+t+i:i}var n={resolve:function(){for(var i="",n=!1,s,o=arguments.length-1;o>=-1&&!n;o--){var u;o>=0?u=arguments[o]:(s===void 0&&(s=t.cwd()),u=s),e(u),u.length!==0&&(i=u+"/"+i,n=u.charCodeAt(0)===47)}return i=r(i,!n),n?i.length>0?"/"+i:"/":i.length>0?i:"."},normalize:function(t){if(e(t),t.length===0)return".";var i=t.charCodeAt(0)===47,n=t.charCodeAt(t.length-1)===47;return t=r(t,!i),t.length===0&&!i&&(t="."),t.length>0&&n&&(t+="/"),i?"/"+t:t},isAbsolute:function(t){return e(t),t.length>0&&t.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var t,r=0;r<arguments.length;++r){var i=arguments[r];e(i),i.length>0&&(t===void 0?t=i:t+="/"+i)}return t===void 0?".":n.normalize(t)},relative:function(t,r){if(e(t),e(r),t===r||(t=n.resolve(t),r=n.resolve(r),t===r))return"";for(var i=1;i<t.length&&t.charCodeAt(i)===47;++i);for(var s=t.length,o=s-i,u=1;u<r.length&&r.charCodeAt(u)===47;++u);for(var a=r.length,h=a-u,f=o<h?o:h,l=-1,c=0;c<=f;++c){if(c===f){if(h>f){if(r.charCodeAt(u+c)===47)return r.slice(u+c+1);if(c===0)return r.slice(u+c)}else o>f&&(t.charCodeAt(i+c)===47?l=c:c===0&&(l=0));break}var d=t.charCodeAt(i+c),p=r.charCodeAt(u+c);if(d!==p)break;d===47&&(l=c)}var b="";for(c=i+l+1;c<=s;++c)(c===s||t.charCodeAt(c)===47)&&(b.length===0?b+="..":b+="/..");return b.length>0?b+r.slice(u+l):(u+=l,r.charCodeAt(u)===47&&++u,r.slice(u))},_makeLong:function(t){return t},dirname:function(t){if(e(t),t.length===0)return".";for(var r=t.charCodeAt(0),i=r===47,n=-1,s=!0,o=t.length-1;o>=1;--o)if(r=t.charCodeAt(o),r===47){if(!s){n=o;break}}else s=!1;return n===-1?i?"/":".":i&&n===1?"//":t.slice(0,n)},basename:function(t,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');e(t);var i=0,n=-1,s=!0,o;if(r!==void 0&&r.length>0&&r.length<=t.length){if(r.length===t.length&&r===t)return"";var u=r.length-1,a=-1;for(o=t.length-1;o>=0;--o){var h=t.charCodeAt(o);if(h===47){if(!s){i=o+1;break}}else a===-1&&(s=!1,a=o+1),u>=0&&(h===r.charCodeAt(u)?--u===-1&&(n=o):(u=-1,n=a))}return i===n?n=a:n===-1&&(n=t.length),t.slice(i,n)}else{for(o=t.length-1;o>=0;--o)if(t.charCodeAt(o)===47){if(!s){i=o+1;break}}else n===-1&&(s=!1,n=o+1);return n===-1?"":t.slice(i,n)}},extname:function(t){e(t);for(var r=-1,i=0,n=-1,s=!0,o=0,u=t.length-1;u>=0;--u){var a=t.charCodeAt(u);if(a===47){if(!s){i=u+1;break}continue}n===-1&&(s=!1,n=u+1),a===46?r===-1?r=u:o!==1&&(o=1):r!==-1&&(o=-1)}return r===-1||n===-1||o===0||o===1&&r===n-1&&r===i+1?"":t.slice(r,n)},format:function(t){if(t===null||typeof t!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return i("/",t)},parse:function(t){e(t);var r={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return r;var i=t.charCodeAt(0),n=i===47,s;n?(r.root="/",s=1):s=0;for(var o=-1,u=0,a=-1,h=!0,f=t.length-1,l=0;f>=s;--f){if(i=t.charCodeAt(f),i===47){if(!h){u=f+1;break}continue}a===-1&&(h=!1,a=f+1),i===46?o===-1?o=f:l!==1&&(l=1):o!==-1&&(l=-1)}return o===-1||a===-1||l===0||l===1&&o===a-1&&o===u+1?a!==-1&&(u===0&&n?r.base=r.name=t.slice(1,a):r.base=r.name=t.slice(u,a)):(u===0&&n?(r.name=t.slice(1,o),r.base=t.slice(1,a)):(r.name=t.slice(u,o),r.base=t.slice(u,a)),r.ext=t.slice(o,a)),u>0?r.dir=t.slice(0,u-1):n&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};return n.posix=n,ks=n,ks}var ks,Ss,Os,Rs=h((()=>{p();ue();Gt();_s();ks={},Ss=!1;Os=As()}));var Ts={};l(Ts,{URL:()=>ko,Url:()=>mo,default:()=>Ls,fileURLToPath:()=>xs,format:()=>go,parse:()=>Ao,pathToFileURL:()=>$s,resolve:()=>Eo,resolveObject:()=>_o});function js(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function Is(t,e,r){if(t&&qs.isObject(t)&&t instanceof js)return t;var i=new js;return i.parse(t,e,r),i}function Ms(){if(io)return ro;io=!0;var t=bs;function e(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function r(t,e){for(var r="",i=0,n=-1,s=0,o,u=0;u<=t.length;++u){if(u<t.length)o=t.charCodeAt(u);else{if(o===47)break;o=47}if(o===47){if(!(n===u-1||s===1))if(n!==u-1&&s===2){if(r.length<2||i!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var a=r.lastIndexOf("/");if(a!==r.length-1){a===-1?(r="",i=0):(r=r.slice(0,a),i=r.length-1-r.lastIndexOf("/")),n=u,s=0;continue}}else if(r.length===2||r.length===1){r="",i=0,n=u,s=0;continue}}e&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+t.slice(n+1,u):r=t.slice(n+1,u),i=u-n-1;n=u,s=0}else o===46&&s!==-1?++s:s=-1}return r}function i(t,e){var r=e.dir||e.root,i=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+i:r+t+i:i}var n={resolve:function(){for(var i="",n=!1,s,o=arguments.length-1;o>=-1&&!n;o--){var u;o>=0?u=arguments[o]:(s===void 0&&(s=t.cwd()),u=s),e(u),u.length!==0&&(i=u+"/"+i,n=u.charCodeAt(0)===47)}return i=r(i,!n),n?i.length>0?"/"+i:"/":i.length>0?i:"."},normalize:function(t){if(e(t),t.length===0)return".";var i=t.charCodeAt(0)===47,n=t.charCodeAt(t.length-1)===47;return t=r(t,!i),t.length===0&&!i&&(t="."),t.length>0&&n&&(t+="/"),i?"/"+t:t},isAbsolute:function(t){return e(t),t.length>0&&t.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var t,r=0;r<arguments.length;++r){var i=arguments[r];e(i),i.length>0&&(t===void 0?t=i:t+="/"+i)}return t===void 0?".":n.normalize(t)},relative:function(t,r){if(e(t),e(r),t===r||(t=n.resolve(t),r=n.resolve(r),t===r))return"";for(var i=1;i<t.length&&t.charCodeAt(i)===47;++i);for(var s=t.length,o=s-i,u=1;u<r.length&&r.charCodeAt(u)===47;++u);for(var a=r.length,h=a-u,f=o<h?o:h,l=-1,c=0;c<=f;++c){if(c===f){if(h>f){if(r.charCodeAt(u+c)===47)return r.slice(u+c+1);if(c===0)return r.slice(u+c)}else o>f&&(t.charCodeAt(i+c)===47?l=c:c===0&&(l=0));break}var d=t.charCodeAt(i+c),p=r.charCodeAt(u+c);if(d!==p)break;d===47&&(l=c)}var b="";for(c=i+l+1;c<=s;++c)(c===s||t.charCodeAt(c)===47)&&(b.length===0?b+="..":b+="/..");return b.length>0?b+r.slice(u+l):(u+=l,r.charCodeAt(u)===47&&++u,r.slice(u))},_makeLong:function(t){return t},dirname:function(t){if(e(t),t.length===0)return".";for(var r=t.charCodeAt(0),i=r===47,n=-1,s=!0,o=t.length-1;o>=1;--o)if(r=t.charCodeAt(o),r===47){if(!s){n=o;break}}else s=!1;return n===-1?i?"/":".":i&&n===1?"//":t.slice(0,n)},basename:function(t,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');e(t);var i=0,n=-1,s=!0,o;if(r!==void 0&&r.length>0&&r.length<=t.length){if(r.length===t.length&&r===t)return"";var u=r.length-1,a=-1;for(o=t.length-1;o>=0;--o){var h=t.charCodeAt(o);if(h===47){if(!s){i=o+1;break}}else a===-1&&(s=!1,a=o+1),u>=0&&(h===r.charCodeAt(u)?--u===-1&&(n=o):(u=-1,n=a))}return i===n?n=a:n===-1&&(n=t.length),t.slice(i,n)}else{for(o=t.length-1;o>=0;--o)if(t.charCodeAt(o)===47){if(!s){i=o+1;break}}else n===-1&&(s=!1,n=o+1);return n===-1?"":t.slice(i,n)}},extname:function(t){e(t);for(var r=-1,i=0,n=-1,s=!0,o=0,u=t.length-1;u>=0;--u){var a=t.charCodeAt(u);if(a===47){if(!s){i=u+1;break}continue}n===-1&&(s=!1,n=u+1),a===46?r===-1?r=u:o!==1&&(o=1):r!==-1&&(o=-1)}return r===-1||n===-1||o===0||o===1&&r===n-1&&r===i+1?"":t.slice(r,n)},format:function(t){if(t===null||typeof t!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return i("/",t)},parse:function(t){e(t);var r={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return r;var i=t.charCodeAt(0),n=i===47,s;n?(r.root="/",s=1):s=0;for(var o=-1,u=0,a=-1,h=!0,f=t.length-1,l=0;f>=s;--f){if(i=t.charCodeAt(f),i===47){if(!h){u=f+1;break}continue}a===-1&&(h=!1,a=f+1),i===46?o===-1?o=f:l!==1&&(l=1):o!==-1&&(l=-1)}return o===-1||a===-1||l===0||l===1&&o===a-1&&o===u+1?a!==-1&&(u===0&&n?r.base=r.name=t.slice(1,a):r.base=r.name=t.slice(u,a)):(u===0&&n?(r.name=t.slice(1,o),r.base=t.slice(1,a)):(r.name=t.slice(u,o),r.base=t.slice(u,a)),r.ext=t.slice(o,a)),u>0?r.dir=t.slice(0,u-1):n&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};return n.posix=n,ro=n,ro}function Cs(t){if(typeof t=="string")t=new URL(t);else if(!(t instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if(t.protocol!=="file:")throw new Deno.errors.InvalidData("invalid url scheme");return fo?Ps(t):Ns(t)}function Ps(t){let e=t.hostname,r=t.pathname;for(let t=0;t<r.length;t++)if(r[t]==="%"){let e=r.codePointAt(t+2)||32;if(r[t+1]==="2"&&e===102||r[t+1]==="5"&&e===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(r=r.replace(lo,"\\"),r=decodeURIComponent(r),e!=="")return`\\\\${e}${r}`;{let t=r.codePointAt(1)|32,e=r[2];if(t<ao||t>ho||e!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return r.slice(1)}}function Ns(t){if(t.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let e=t.pathname;for(let t=0;t<e.length;t++)if(e[t]==="%"){let r=e.codePointAt(t+2)||32;if(e[t+1]==="2"&&r===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(e)}function Bs(t){let e=no.resolve(t),r=t.charCodeAt(t.length-1);(r===uo||fo&&r===oo)&&e[e.length-1]!==no.sep&&(e+="/");let i=new URL("file://");return e.includes("%")&&(e=e.replace(co,"%25")),!fo&&e.includes("\\")&&(e=e.replace(po,"%5C")),e.includes(`\n`)&&(e=e.replace(bo,"%0A")),e.includes("\r")&&(e=e.replace(vo,"%0D")),e.includes("\t")&&(e=e.replace(wo,"%09")),i.pathname=e,i}function xs(t){if(typeof t=="string")t=new URL(t);else if(!(t instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if(t.protocol!=="file:")throw new Deno.errors.InvalidData("invalid url scheme");return jo?Us(t):Fs(t)}function Us(t){let e=t.hostname,r=t.pathname;for(let t=0;t<r.length;t++)if(r[t]==="%"){let e=r.codePointAt(t+2)||32;if(r[t+1]==="2"&&e===102||r[t+1]==="5"&&e===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(r=r.replace(Io,"\\"),r=decodeURIComponent(r),e!=="")return`\\\\${e}${r}`;{let t=r.codePointAt(1)|32,e=r[2];if(t<Ro||t>To||e!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return r.slice(1)}}function Fs(t){if(t.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let e=t.pathname;for(let t=0;t<e.length;t++)if(e[t]==="%"){let r=e.codePointAt(t+2)||32;if(e[t+1]==="2"&&r===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(e)}function $s(t){let e=Os.resolve(t),r=t.charCodeAt(t.length-1);(r===Oo||jo&&r===So)&&e[e.length-1]!==Os.sep&&(e+="/");let i=new URL("file://");return e.includes("%")&&(e=e.replace(Mo,"%25")),!jo&&e.includes("\\")&&(e=e.replace(Co,"%5C")),e.includes(`\n`)&&(e=e.replace(Po,"%0A")),e.includes("\r")&&(e=e.replace(No,"%0D")),e.includes("\t")&&(e=e.replace(Bo,"%09")),i.pathname=e,i}var Ls,Ds,qs,zs,Ws,Gs,Vs,Hs,Ks,Qs,Ys,Js,Zs,Xs,to,eo,ro,io,no,so,oo,uo,ao,ho,fo,lo,co,po,bo,vo,wo,yo,mo,go,Eo,_o,Ao,ko,So,Oo,Ro,To,jo,Io,Mo,Co,Po,No,Bo,xo=h((()=>{p();ue();Gt();Vn();Zn();vs();Rs();_s();Ls={},Ds=Gn,qs={isString:function(t){return typeof t=="string"},isObject:function(t){return typeof t=="object"&&t!==null},isNull:function(t){return t===null},isNullOrUndefined:function(t){return t==null}};Ls.parse=Is,Ls.resolve=function(t,e){return Is(t,!1,!0).resolve(e)},Ls.resolveObject=function(t,e){return t?Is(t,!1,!0).resolveObject(e):e},Ls.format=function(t){return qs.isString(t)&&(t=Is(t)),t instanceof js?t.format():js.prototype.format.call(t)},Ls.Url=js;zs=/^([a-z0-9.+-]+:)/i,Ws=/:[0-9]*$/,Gs=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Vs=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`\n`,"\t"]),Hs=["'"].concat(Vs),Ks=["%","/","?",";","#"].concat(Hs),Qs=["/","?","#"],Ys=/^[+a-z0-9A-Z_-]{0,63}$/,Js=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Zs={javascript:!0,"javascript:":!0},Xs={javascript:!0,"javascript:":!0},to={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},eo=Jn;js.prototype.parse=function(t,e,r){if(!qs.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),n=i!==-1&&i<t.indexOf("#")?"?":"#",s=t.split(n);s[0]=s[0].replace(/\\/g,"/");var o=t=s.join(n);if(o=o.trim(),!r&&t.split("#").length===1){var u=Gs.exec(o);if(u)return this.path=o,this.href=o,this.pathname=u[1],u[2]?(this.search=u[2],this.query=e?eo.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var a=zs.exec(o);if(a){var h=(a=a[0]).toLowerCase();this.protocol=h,o=o.substr(a.length)}if(r||a||o.match(/^\/\/[^@\/]+@[^@\/]+/)){var f=o.substr(0,2)==="//";!f||a&&Xs[a]||(o=o.substr(2),this.slashes=!0)}if(!Xs[a]&&(f||a&&!to[a])){for(var l,c,d=-1,p=0;p<Qs.length;p++)(b=o.indexOf(Qs[p]))!==-1&&(d===-1||b<d)&&(d=b);for((c=d===-1?o.lastIndexOf("@"):o.lastIndexOf("@",d))!==-1&&(l=o.slice(0,c),o=o.slice(c+1),this.auth=decodeURIComponent(l)),d=-1,p=0;p<Ks.length;p++){var b;(b=o.indexOf(Ks[p]))!==-1&&(d===-1||b<d)&&(d=b)}d===-1&&(d=o.length),this.host=o.slice(0,d),o=o.slice(d),this.parseHost(),this.hostname=this.hostname||"";var v=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!v)for(var w=this.hostname.split(/\./),y=(p=0,w.length);p<y;p++){var m=w[p];if(m&&!m.match(Ys)){for(var g="",E=0,_=m.length;E<_;E++)m.charCodeAt(E)>127?g+="x":g+=m[E];if(!g.match(Ys)){var A=w.slice(0,p),k=w.slice(p+1),S=m.match(Js);S&&(A.push(S[1]),k.unshift(S[2])),k.length&&(o="/"+k.join(".")+o),this.hostname=A.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),v||(this.hostname=Ds.toASCII(this.hostname));var O=this.port?":"+this.port:"",R=this.hostname||"";this.host=R+O,this.href+=this.host,v&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),o[0]!=="/"&&(o="/"+o))}if(!Zs[h])for(p=0,y=Hs.length;p<y;p++){var T=Hs[p];if(o.indexOf(T)!==-1){var j=encodeURIComponent(T);j===T&&(j=escape(T)),o=o.split(T).join(j)}}var I=o.indexOf("#");I!==-1&&(this.hash=o.substr(I),o=o.slice(0,I));var M=o.indexOf("?");if(M!==-1?(this.search=o.substr(M),this.query=o.substr(M+1),e&&(this.query=eo.parse(this.query)),o=o.slice(0,M)):e&&(this.search="",this.query={}),o&&(this.pathname=o),to[h]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){O=this.pathname||"";var C=this.search||"";this.path=O+C}return this.href=this.format(),this},js.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",i=this.hash||"",n=!1,s="";this.host?n=t+this.host:this.hostname&&(n=t+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(n+=":"+this.port)),this.query&&qs.isObject(this.query)&&Object.keys(this.query).length&&(s=eo.stringify(this.query));var o=this.search||s&&"?"+s||"";return e&&e.substr(-1)!==":"&&(e+=":"),this.slashes||(!e||to[e])&&n!==!1?(n="//"+(n||""),r&&r.charAt(0)!=="/"&&(r="/"+r)):n||(n=""),i&&i.charAt(0)!=="#"&&(i="#"+i),o&&o.charAt(0)!=="?"&&(o="?"+o),e+n+(r=r.replace(/[?#]/g,(function(t){return encodeURIComponent(t)})))+(o=o.replace("#","%23"))+i},js.prototype.resolve=function(t){return this.resolveObject(Is(t,!1,!0)).format()},js.prototype.resolveObject=function(t){if(qs.isString(t)){var e=new js;e.parse(t,!1,!0),t=e}for(var r=new js,i=Object.keys(this),n=0;n<i.length;n++){var s=i[n];r[s]=this[s]}if(r.hash=t.hash,t.href==="")return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var o=Object.keys(t),u=0;u<o.length;u++){var a=o[u];a!=="protocol"&&(r[a]=t[a])}return to[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!to[t.protocol]){for(var h=Object.keys(t),f=0;f<h.length;f++){var l=h[f];r[l]=t[l]}return r.href=r.format(),r}if(r.protocol=t.protocol,t.host||Xs[t.protocol])r.pathname=t.pathname;else{for(var c=(t.pathname||"").split("/");c.length&&!(t.host=c.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),c[0]!==""&&c.unshift(""),c.length<2&&c.unshift(""),r.pathname=c.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var d=r.pathname||"",p=r.search||"";r.path=d+p}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var b=r.pathname&&r.pathname.charAt(0)==="/",v=t.host||t.pathname&&t.pathname.charAt(0)==="/",w=v||b||r.host&&t.pathname,y=w,m=r.pathname&&r.pathname.split("/")||[],g=(c=t.pathname&&t.pathname.split("/")||[],r.protocol&&!to[r.protocol]);if(g&&(r.hostname="",r.port=null,r.host&&(m[0]===""?m[0]=r.host:m.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(c[0]===""?c[0]=t.host:c.unshift(t.host)),t.host=null),w=w&&(c[0]===""||m[0]==="")),v)r.host=t.host||t.host===""?t.host:r.host,r.hostname=t.hostname||t.hostname===""?t.hostname:r.hostname,r.search=t.search,r.query=t.query,m=c;else if(c.length)m||(m=[]),m.pop(),m=m.concat(c),r.search=t.search,r.query=t.query;else if(!qs.isNullOrUndefined(t.search))return g&&(r.hostname=r.host=m.shift(),(S=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=S.shift(),r.host=r.hostname=S.shift())),r.search=t.search,r.query=t.query,qs.isNull(r.pathname)&&qs.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!m.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var E=m.slice(-1)[0],_=(r.host||t.host||m.length>1)&&(E==="."||E==="..")||E==="",A=0,k=m.length;k>=0;k--)(E=m[k])==="."?m.splice(k,1):E===".."?(m.splice(k,1),A++):A&&(m.splice(k,1),A--);if(!w&&!y)for(;A--;A)m.unshift("..");!w||m[0]===""||m[0]&&m[0].charAt(0)==="/"||m.unshift(""),_&&m.join("/").substr(-1)!=="/"&&m.push("");var S,O=m[0]===""||m[0]&&m[0].charAt(0)==="/";return g&&(r.hostname=r.host=O?"":m.length?m.shift():"",(S=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=S.shift(),r.host=r.hostname=S.shift())),(w=w||r.host&&m.length)&&!O&&m.unshift(""),m.length?r.pathname=m.join("/"):(r.pathname=null,r.path=null),qs.isNull(r.pathname)&&qs.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},js.prototype.parseHost=function(){var t=this.host,e=Ws.exec(t);e&&((e=e[0])!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};ro={},io=!1;no=Ms(),so=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;Ls.URL=typeof URL<"u"?URL:null;Ls.pathToFileURL=Bs;Ls.fileURLToPath=Cs;oo=92,uo=47,ao=97,ho=122,fo=so==="win32",lo=/\//g,co=/%/g,po=/\\/g,bo=/\n/g,vo=/\r/g,wo=/\t/g;yo=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;Ls.URL=typeof URL<"u"?URL:null;Ls.pathToFileURL=$s;Ls.fileURLToPath=xs;mo=Ls.Url,go=Ls.format,Eo=Ls.resolve,_o=Ls.resolveObject,Ao=Ls.parse,ko=Ls.URL,So=92,Oo=47,Ro=97,To=122,jo=yo==="win32",Io=/\//g,Mo=/%/g,Co=/\\/g,Po=/\n/g,No=/\r/g,Bo=/\t/g}));var Uo=f(((t,e)=>{p();ue();Gt();e.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}}));var Fo=f((t=>{p();ue();Gt();Object.defineProperty(t,"__esModule",{value:!0});t.BufferedDuplex=t.writev=void 0;var e=ki(),r=(oe(),d(Vt));function i(t,e){let i=new Array(t.length);for(let e=0;e<t.length;e++)typeof t[e].chunk=="string"?i[e]=r.Buffer.from(t[e].chunk,"utf8"):i[e]=t[e].chunk;this._write(r.Buffer.concat(i),"binary",e)}t.writev=i;var n=class extends e.Duplex{constructor(t,e,r){super({objectMode:!0}),this.proxy=e,this.socket=r,this.writeQueue=[],t.objectMode||(this._writev=i.bind(this)),this.isSocketOpen=!1,this.proxy.on("data",(t=>{this.destroyed||this.push(t)}))}_read(t){this.proxy.read(t)}_write(t,e,r){this.isSocketOpen?this.writeToProxy(t,e,r):this.writeQueue.push({chunk:t,encoding:e,cb:r})}_final(t){this.writeQueue=[],this.proxy.end(t)}_destroy(t,e){this.writeQueue=[],this.proxy.destroy(),e(t)}socketReady(){this.emit("connect"),this.isSocketOpen=!0,this.processWriteQueue()}writeToProxy(t,e,r){this.proxy.write(t,e)===!1?this.proxy.once("drain",r):r()}processWriteQueue(){for(;this.writeQueue.length>0;){let{chunk:t,encoding:e,cb:r}=this.writeQueue.shift();this.writeToProxy(t,e,r)}}};t.BufferedDuplex=n}));var $o=f((t=>{p();ue();Gt();var e=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0});t.streamBuilder=t.browserStreamBuilder=void 0;var r=(oe(),d(Vt)),i=e(Uo()),n=e(Ci()),s=ki(),o=e(kn()),u=Fo(),a=(0,n.default)("mqttjs:ws"),h=["rejectUnauthorized","ca","cert","key","pfx","passphrase"];function f(t,e){let r=`${t.protocol}://${t.hostname}:${t.port}${t.path}`;return typeof t.transformWsUrl=="function"&&(r=t.transformWsUrl(r,t,e)),r}function l(t){let e=t;return t.port||(t.protocol==="wss"?e.port=443:e.port=80),t.path||(e.path="/"),t.wsOptions||(e.wsOptions={}),!o.default&&!t.forceNativeWebSocket&&t.protocol==="wss"&&h.forEach((r=>{Object.prototype.hasOwnProperty.call(t,r)&&!Object.prototype.hasOwnProperty.call(t.wsOptions,r)&&(e.wsOptions[r]=t[r])})),e}function c(t){let e=l(t);if(e.hostname||(e.hostname=e.host),!e.hostname){if(typeof document>"u")throw new Error("Could not determine host. Specify host manually.");let t=new URL(document.URL);e.hostname=t.hostname,e.port||(e.port=Number(t.port))}return e.objectMode===void 0&&(e.objectMode=!(e.binary===!0||e.binary===void 0)),e}function b(t,e,r){a("createWebSocket"),a(`protocol: ${r.protocolId} ${r.protocolVersion}`);let n=r.protocolId==="MQIsdp"&&r.protocolVersion===3?"mqttv3.1":"mqtt";a(`creating new Websocket for url: ${e} and protocol: ${n}`);let s;return r.createWebsocket?s=r.createWebsocket(e,[n],r):s=new i.default(e,[n],r.wsOptions),s}function v(t,e){let r=e.protocolId==="MQIsdp"&&e.protocolVersion===3?"mqttv3.1":"mqtt",i=f(e,t),n;return e.createWebsocket?n=e.createWebsocket(i,[r],e):n=new WebSocket(i,[r]),n.binaryType="arraybuffer",n}var w=(t,e)=>{a("streamBuilder");let r=l(e);r.hostname=r.hostname||r.host||"localhost";let n=f(r,t),s=b(t,n,r),o=i.default.createWebSocketStream(s,r.wsOptions);return o.url=n,s.on("close",(()=>{o.destroy()})),o};t.streamBuilder=w;var y=(t,e)=>{a("browserStreamBuilder");let i,n=c(e).browserBufferSize||1024*512,o=e.browserBufferTimeout||1e3,h=!e.objectMode,f=v(t,e),l=p(e,g,E);e.objectMode||(l._writev=u.writev.bind(l)),l.on("close",(()=>{f.close()}));let d=typeof f.addEventListener<"u";f.readyState===f.OPEN?(i=l,i.socket=f):(i=new u.BufferedDuplex(e,l,f),d?f.addEventListener("open",b):f.onopen=b),d?(f.addEventListener("close",w),f.addEventListener("error",y),f.addEventListener("message",m)):(f.onclose=w,f.onerror=y,f.onmessage=m);function p(t,e,r){let i=new s.Transform({objectMode:t.objectMode});return i._write=e,i._flush=r,i}function b(){a("WebSocket onOpen"),i instanceof u.BufferedDuplex&&i.socketReady()}function w(t){a("WebSocket onClose",t),i.end(),i.destroy()}function y(t){a("WebSocket onError",t);let e=new Error("WebSocket error");e.event=t,i.destroy(e)}async function m(t){let{data:e}=t;e instanceof ArrayBuffer?e=r.Buffer.from(e):e instanceof Blob?e=r.Buffer.from(await new Response(e).arrayBuffer()):e=r.Buffer.from(e,"utf8"),l&&!l.destroyed&&l.push(e)}function g(t,e,i){if(f.bufferedAmount>n){setTimeout(g,o,t,e,i);return}h&&typeof t=="string"&&(t=r.Buffer.from(t,"utf8"));try{f.send(t)}catch(t){return i(t)}i()}function E(t){f.close(),t()}return i};t.browserStreamBuilder=y}));var Lo={};l(Lo,{Server:()=>Do,Socket:()=>Do,Stream:()=>Do,_createServerHandle:()=>Do,_normalizeArgs:()=>Do,_setSimultaneousAccepts:()=>Do,connect:()=>Do,createConnection:()=>Do,createServer:()=>Do,default:()=>qo,isIP:()=>Do,isIPv4:()=>Do,isIPv6:()=>Do});function Do(){throw new Error("Node.js net module is not supported by JSPM core outside of Node.js")}var qo,zo=h((()=>{p();ue();Gt();qo={_createServerHandle:Do,_normalizeArgs:Do,_setSimultaneousAccepts:Do,connect:Do,createConnection:Do,createServer:Do,isIP:Do,isIPv4:Do,isIPv6:Do,Server:Do,Socket:Do,Stream:Do}}));var Wo=f((t=>{p();ue();Gt();var e=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0});var r=e((zo(),d(Lo))),i=e(Ci()),n=(0,i.default)("mqttjs:tcp"),s=(t,e)=>{e.port=e.port||1883,e.hostname=e.hostname||e.host||"localhost";let{port:i,path:s}=e,o=e.hostname;return n("port %d and host %s",i,o),r.default.createConnection({port:i,host:o,path:s})};t.default=s}));var Go={};l(Go,{default:()=>Vo});var Vo,Ho=h((()=>{p();ue();Gt();Vo={}}));var Ko=f((t=>{p();ue();Gt();var e=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0});var r=e((Ho(),d(Go))),i=e((zo(),d(Lo))),n=e(Ci()),s=(0,n.default)("mqttjs:tls"),o=(t,e)=>{e.port=e.port||8883,e.host=e.hostname||e.host||"localhost",i.default.isIP(e.host)===0&&(e.servername=e.host),e.rejectUnauthorized=e.rejectUnauthorized!==!1,delete e.path,s("port %d host %s rejectUnauthorized %b",e.port,e.host,e.rejectUnauthorized);let n=r.default.connect(e);n.on("secureConnect",(()=>{e.rejectUnauthorized&&!n.authorized?n.emit("error",new Error("TLS not authorized")):n.removeListener("error",o)}));function o(r){e.rejectUnauthorized&&t.emit("error",r),n.end()}return n.on("error",o),n};t.default=o}));var Qo=f((t=>{p();ue();Gt();Object.defineProperty(t,"__esModule",{value:!0});var e=(oe(),d(Vt)),r=ki(),i=Fo(),n,s,o;function u(){let t=new r.Transform;return t._write=(t,e,r)=>{n.send({data:t.buffer,success(){r()},fail(t){r(new Error(t))}})},t._flush=t=>{n.close({success(){t()}})},t}function a(t){t.hostname||(t.hostname="localhost"),t.path||(t.path="/"),t.wsOptions||(t.wsOptions={})}function h(t,e){let r=t.protocol==="wxs"?"wss":"ws",i=`${r}://${t.hostname}${t.path}`;return t.port&&t.port!==80&&t.port!==443&&(i=`${r}://${t.hostname}:${t.port}${t.path}`),typeof t.transformWsUrl=="function"&&(i=t.transformWsUrl(i,t,e)),i}function f(){n.onOpen((()=>{o.socketReady()})),n.onMessage((t=>{let{data:r}=t;r instanceof ArrayBuffer?r=e.Buffer.from(r):r=e.Buffer.from(r,"utf8"),s.push(r)})),n.onClose((()=>{o.emit("close"),o.end(),o.destroy()})),n.onError((t=>{let e=new Error(t.errMsg);o.destroy(e)}))}var l=(t,e)=>{if(e.hostname=e.hostname||e.host,!e.hostname)throw new Error("Could not determine host. Specify host manually.");let r=e.protocolId==="MQIsdp"&&e.protocolVersion===3?"mqttv3.1":"mqtt";a(e);let l=h(e,t);n=wx.connectSocket({url:l,protocols:[r]}),s=u(),o=new i.BufferedDuplex(e,s,n),o._destroy=(t,e)=>{n.close({success(){e&&e(t)}})};let c=o.destroy;return o.destroy=(t,e)=>(o.destroy=c,setTimeout((()=>{n.close({fail(){o._destroy(t,e)}})}),0),o),f(),o};t.default=l}));var Yo=f((t=>{p();ue();Gt();Object.defineProperty(t,"__esModule",{value:!0});var e=(oe(),d(Vt)),r=ki(),i=Fo(),n,s,o,u=!1;function a(){let t=new r.Transform;return t._write=(t,e,r)=>{n.sendSocketMessage({data:t.buffer,success(){r()},fail(){r(new Error)}})},t._flush=t=>{n.closeSocket({success(){t()}})},t}function h(t){t.hostname||(t.hostname="localhost"),t.path||(t.path="/"),t.wsOptions||(t.wsOptions={})}function f(t,e){let r=t.protocol==="alis"?"wss":"ws",i=`${r}://${t.hostname}${t.path}`;return t.port&&t.port!==80&&t.port!==443&&(i=`${r}://${t.hostname}:${t.port}${t.path}`),typeof t.transformWsUrl=="function"&&(i=t.transformWsUrl(i,t,e)),i}function l(){u||(u=!0,n.onSocketOpen((()=>{o.socketReady()})),n.onSocketMessage((t=>{if(typeof t.data=="string"){let r=e.Buffer.from(t.data,"base64");s.push(r)}else{let r=new FileReader;r.addEventListener("load",(()=>{let t=r.result;t instanceof ArrayBuffer?t=e.Buffer.from(t):t=e.Buffer.from(t,"utf8"),s.push(t)})),r.readAsArrayBuffer(t.data)}})),n.onSocketClose((()=>{o.end(),o.destroy()})),n.onSocketError((t=>{o.destroy(t)})))}var c=(t,e)=>{if(e.hostname=e.hostname||e.host,!e.hostname)throw new Error("Could not determine host. Specify host manually.");let r=e.protocolId==="MQIsdp"&&e.protocolVersion===3?"mqttv3.1":"mqtt";h(e);let u=f(e,t);return n=e.my,n.connectSocket({url:u,protocols:r}),s=a(),o=new i.BufferedDuplex(e,s,n),l(),o};t.default=c}));var Jo=f((t=>{p();ue();Gt();var e=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0});t.connectAsync=void 0;var r=e(Ci()),i=e((xo(),d(Ts))),n=e(In()),s=e(kn());typeof(b===null||b===void 0?void 0:b.nextTick)!="function"&&(b.nextTick=setImmediate);var o=(0,r.default)("mqttjs"),u=null;function a(t){let e;t.auth&&(e=t.auth.match(/^(.+):(.+)$/),e?(t.username=e[1],t.password=e[2]):t.username=t.auth)}function h(t,e){var r,h,f,l;if(o("connecting to an MQTT broker..."),typeof t=="object"&&!e&&(e=t,t=""),e=e||{},t&&typeof t=="string"){let n=i.default.parse(t,!0),s={};if(n.port!=null&&(s.port=Number(n.port)),s.host=n.hostname,s.query=n.query,s.auth=n.auth,s.protocol=n.protocol,s.path=n.path,s.protocol=(r=s.protocol)===null||r===void 0?void 0:r.replace(/:$/,""),e=Object.assign(Object.assign({},s),e),!e.protocol)throw new Error("Missing protocol")}if(e.unixSocket=e.unixSocket||((h=e.protocol)===null||h===void 0?void 0:h.includes("+unix")),e.unixSocket?e.protocol=e.protocol.replace("+unix",""):!(!((f=e.protocol)===null||f===void 0)&&f.startsWith("ws"))&&!(!((l=e.protocol)===null||l===void 0)&&l.startsWith("wx"))&&delete e.path,a(e),e.query&&typeof e.query.clientId=="string"&&(e.clientId=e.query.clientId),e.cert&&e.key)if(e.protocol){if(["mqtts","wss","wxs","alis"].indexOf(e.protocol)===-1)switch(e.protocol){case"mqtt":e.protocol="mqtts";break;case"ws":e.protocol="wss";break;case"wx":e.protocol="wxs";break;case"ali":e.protocol="alis";break;default:throw new Error(`Unknown protocol for secure connection: "${e.protocol}"!`)}}else throw new Error("Missing secure protocol key");if(u||(u={},!s.default&&!e.forceNativeWebSocket?(u.ws=$o().streamBuilder,u.wss=$o().streamBuilder,u.mqtt=Wo().default,u.tcp=Wo().default,u.ssl=Ko().default,u.tls=u.ssl,u.mqtts=Ko().default):(u.ws=$o().browserStreamBuilder,u.wss=$o().browserStreamBuilder,u.wx=Qo().default,u.wxs=Qo().default,u.ali=Yo().default,u.alis=Yo().default)),!u[e.protocol]){let t=["mqtts","wss"].indexOf(e.protocol)!==-1;e.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter(((e,r)=>t&&r%2===0?!1:typeof u[e]=="function"))[0]}if(e.clean===!1&&!e.clientId)throw new Error("Missing clientId for unclean clients");e.protocol&&(e.defaultProtocol=e.protocol);function c(t){return e.servers&&((!t._reconnectCount||t._reconnectCount===e.servers.length)&&(t._reconnectCount=0),e.host=e.servers[t._reconnectCount].host,e.port=e.servers[t._reconnectCount].port,e.protocol=e.servers[t._reconnectCount].protocol?e.servers[t._reconnectCount].protocol:e.defaultProtocol,e.hostname=e.host,t._reconnectCount++),o("calling streambuilder for",e.protocol),u[e.protocol](t,e)}let d=new n.default(c,e);return d.on("error",(()=>{})),d}function f(t,e,r=!0){return new Promise(((i,n)=>{let s=h(t,e),o={connect:t=>{u(),i(s)},end:()=>{u(),i(s)},error:t=>{u(),s.end(),n(t)}};r===!1&&(o.close=()=>{o.error(new Error("Couldn't connect to server"))});function u(){Object.keys(o).forEach((t=>{s.off(t,o[t])}))}Object.keys(o).forEach((t=>{s.on(t,o[t])}))}))}t.connectAsync=f;t.default=h}));var Zo=f((t=>{p();ue();Gt();var e=t&&t.__createBinding||(Object.create?function(t,e,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}:function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]}),r=t&&t.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=t&&t.__importStar||function(t){if(t&&t.__esModule)return t;var i={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&e(i,t,n);return r(i,t),i},n=t&&t.__exportStar||function(t,r){for(var i in t)i!=="default"&&!Object.prototype.hasOwnProperty.call(r,i)&&e(r,t,i)},s=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0});t.ReasonCodes=t.KeepaliveManager=t.UniqueMessageIdProvider=t.DefaultMessageIdProvider=t.Store=t.MqttClient=t.connectAsync=t.connect=t.Client=void 0;var o=s(In());t.MqttClient=o.default;var u=s($i());t.DefaultMessageIdProvider=u.default;var a=s(Mn());t.UniqueMessageIdProvider=a.default;var h=s(zi());t.Store=h.default;var f=i(Jo());t.connect=f.default;Object.defineProperty(t,"connectAsync",{enumerable:!0,get:function(){return f.connectAsync}});var l=s(jn());t.KeepaliveManager=l.default;t.Client=o.default;n(In(),t);n(Vi(),t);var c=Hi();Object.defineProperty(t,"ReasonCodes",{enumerable:!0,get:function(){return c.ReasonCodes}})}));var Xo=f((t=>{p();ue();Gt();var e=t&&t.__createBinding||(Object.create?function(t,e,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}:function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]}),r=t&&t.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=t&&t.__importStar||function(t){if(t&&t.__esModule)return t;var i={};if(t!=null)for(var n in t)n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)&&e(i,t,n);return r(i,t),i},n=t&&t.__exportStar||function(t,r){for(var i in t)i!=="default"&&!Object.prototype.hasOwnProperty.call(r,i)&&e(r,t,i)};Object.defineProperty(t,"__esModule",{value:!0});var s=i(Zo());t.default=s;n(Zo(),t)}));const tu=Xo();
|
|
2
|
+
/*! Bundled license information:
|
|
3
|
+
|
|
4
|
+
@jspm/core/nodelibs/browser/buffer.js:
|
|
5
|
+
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
6
|
+
*/function eu(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,iu(t,e)}function ru(t){return ru=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ru(t)}function iu(t,e){return iu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},iu(t,e)}function nu(t,e,r){return nu=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}()?Reflect.construct.bind():function(t,e,r){var i=[null];i.push.apply(i,e);var n=new(Function.bind.apply(t,i));return r&&iu(n,r.prototype),n},nu.apply(null,arguments)}function su(t){var e="function"==typeof Map?new Map:void 0;return su=function(t){if(null===t||-1===Function.toString.call(t).indexOf("[native code]"))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return nu(t,arguments,ru(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),iu(r,t)},su(t)}function ou(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var uu=function(t){function e(r,i){var n;return(n=t.call(this,i)||this).statusCode=void 0,Object.setPrototypeOf(ou(n),(this instanceof e?this.constructor:void 0).prototype),n.name=Error.name,n.statusCode=r,Error.captureStackTrace(ou(n)),n}return eu(e,t),e}(su(Error)),au=function(t){function e(e,r){var i;return(i=t.call(this,400,"Conversation not found or not allowed to fetch messages count")||this).errorMsg=void 0,i.errorCode=void 0,i.errorMsg=e,i.errorCode=r||0,i}return eu(e,t),e}(uu),hu=function(t){function e(e,r){var i;return(i=t.call(this,404,e)||this).errorMsg=void 0,i.errorCode=void 0,i.errorMsg=e,i.errorCode=r,i}return eu(e,t),e}(uu),fu=function(t){function e(e){var r;return(r=t.call(this,503,"Service Unavailable")||this).errorMsg=void 0,r.errorMsg=e,r}return eu(e,t),e}(uu),lu=function(t){function e(e,r){var i;return(i=t.call(this,422,"Unprocessable entity")||this).errorProperties=void 0,i.errorCode=void 0,i.errorProperties=e,i.errorCode=r||0,i}return eu(e,t),e}(uu),cu=function(t){function e(e,r){var i;return(i=t.call(this,e,"Unknown Error Caught")||this).errorMsg=void 0,i.errorMsg=r,i}return eu(e,t),e}(uu),du=function(t){function e(e,r){var i;return(i=t.call(this,403,e)||this).errorMsg=void 0,i.errorCode=void 0,i.errorMsg=e,i.errorCode=r,i}return eu(e,t),e}(uu),pu=function(t){function e(e,r){var i;return(i=t.call(this,403,e)||this).errorMsg=void 0,i.errorCode=void 0,i.errorMsg=e,i.errorCode=r,i}return eu(e,t),e}(uu),bu=function(t){function e(e,r){var i;return(i=t.call(this,400,"Conversation not found or not allowed to fetch messages count")||this).errorMsg=void 0,i.errorCode=void 0,i.errorMsg=e,i.errorCode=r||0,i}return eu(e,t),e}(uu),vu=function(){function t(t){this.baseUrl=void 0,this.licenseKey=void 0,this.appSecret=void 0,this.userSecret=void 0,this.userToken=void 0,this.baseUrl=t.baseUrl,this.licenseKey=t.licenseKey,this.appSecret=t.appSecret,this.userSecret=t.userSecret,this.userToken=t.userToken||void 0}var e=t.prototype;return e.updateUserToken=function(t){this.userToken=t},e.invoke=function(t,e){try{return Promise.resolve(function(r,i){try{var s=Promise.resolve(n(t,e)).then((function(t){if(t.ok)return t.json();var e=new Error(t.statusText);throw e.response=t,e}))}catch(t){return i(t)}return s&&s.then?s.then(void 0,i):s}(0,(function(t){var e=t.response.status;return Promise.resolve(t.response.json()).then((function(t){switch(e){case 400:throw new au(t.error);case 401:throw new pu(t.error,t.errorCode);case 403:throw new du(t.error,t.errorCode);case 404:throw new hu(t.error,t.errorCode);case 409:throw new bu(t.error,t.errorCode);case 422:throw new lu(t.errors);case 503:throw new fu(t.error);default:throw new cu(e,t.error)}}))})))}catch(t){return Promise.reject(t)}},e.get=function(t,e){void 0===e&&(e=!1);var r=""+this.baseUrl+t,i={"Content-type":"application/json",licenseKey:this.licenseKey,appSecret:this.appSecret,userToken:this.userToken};return e&&(i.userSecret=this.userSecret),this.invoke(r,{headers:i})},e.post=function(t,e,r){void 0===r&&(r=!1);var i=""+this.baseUrl+t,n={"Content-type":"application/json",licenseKey:this.licenseKey,appSecret:this.appSecret,userToken:this.userToken};r&&(n.userSecret=this.userSecret);var s={method:"POST",body:JSON.stringify(e),headers:n};return this.invoke(i,s)},e.put=function(t,e,r){void 0===r&&(r=!1);var i=""+this.baseUrl+t,n={"Content-type":"application/json",licenseKey:this.licenseKey,appSecret:this.appSecret,userToken:this.userToken};r&&(n.userSecret=this.userSecret);var s={method:"PUT",body:JSON.stringify(e),headers:n};return this.invoke(i,s)},e.patch=function(t,e,r){void 0===r&&(r=!1);var i=""+this.baseUrl+t,n={"Content-type":"application/json",licenseKey:this.licenseKey,appSecret:this.appSecret,userToken:this.userToken};r&&(n.userSecret=this.userSecret);var s={method:"PATCH",body:JSON.stringify(e),headers:n};return this.invoke(i,s)},e.delete=function(t,e,r){void 0===r&&(r=!1);var i=""+this.baseUrl+t,n={"Content-type":"application/json",licenseKey:this.licenseKey,appSecret:this.appSecret,userToken:this.userToken};r&&(n.userSecret=this.userSecret);var s={method:"DELETE",body:JSON.stringify(e),headers:n};return this.invoke(i,s)},t}(),wu="chat/messages",yu=function(){function t(t){this.base=void 0,this.base=new vu(t)}var e=t.prototype;return e.getMessagesForUser=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.get("/"+wu+"/user?"+e)},e.getMessagesForMentioned=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.get("/"+wu+"/user?"+e)},e.getMessagesCount=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.get("/"+wu+"/count?"+e)},e.getMessages=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.get("/"+wu+"?"+e)},e.postMessages=function(t){return this.base.post("/chat/message",t)},e.patchMessages=function(t){return this.base.patch("/chat/message",t)},e.postMessagesPresignedurls=function(t){return this.base.post("/chat/messages/presignedurls",t)},e.getMessageReactionType=function(t,e){var r=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.get("/chat/reaction/"+e+"?"+r)},e.postReaction=function(t){return this.base.post("/chat/reaction",t)},e.deleteReactionType=function(t,e){var r=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.delete("/chat/reaction/"+e+"?"+r)},e.postMessagesForward=function(t){return this.base.post("/chat/message/forward",t)},e.postMessagesbroadcast=function(t){return this.base.post("/chat/message/broadcast",t)},e.getStatus=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.get("/"+wu+"/status?"+e)},e.getStatusReadPending=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.get("/chat/message/status/read/pending?"+e)},e.getStatusRead=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.get("/chat/message/status/read?"+e)},e.getStatusDeliveryPending=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.get("/chat/message/status/delivery/pending?"+e)},e.getStatusDelivery=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.get("/chat/message/status/delivery?"+e)},e.postIndicateTyping=function(t){return this.base.post("/chat/indicator/typing",t)},e.putIndicateRead=function(t){return this.base.put("/chat/indicator/read",t)},e.putIndicateDelivered=function(t){return this.base.put("/chat/indicator/delivered",t)},e.getUnreadCount=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.get("/"+wu+"/unread/count?"+e)},e.getUnread=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.get("/"+wu+"/unread?"+e)},e.putRead=function(t){return this.base.put("/"+wu+"/read",t)},e.deleteMessageSelf=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.delete("/"+wu+"/self?"+e)},e.deleteMessagesEveryone=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.delete("/"+wu+"/everyone?"+e)},t}(),mu="chat/conversations",gu=function(){function t(t){this.base=void 0,this.base=new vu(t)}var e=t.prototype;return e.getWatchers=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.get("/"+mu+"/watchers?"+e)},e.getPublicOrOpen=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.get("/"+mu+"/watchers?"+e)},e.getConversationDetails=function(t,e){var r=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.get("/chat/conversation/details/"+e+"?"+r)},e.getConversationCount=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.get("/"+mu+"/count?"+e)},e.getConversations=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.get("/"+mu+"?"+e)},e.getUnreadConversations=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.get("/"+mu+"/unread?"+e)},e.getMessagingStatus=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.get("/chat/conversation/messaging/status?"+e)},e.postConversation=function(t){return this.base.post("/chat/conversation",t)},e.patchTitle=function(t){return this.base.patch("/chat/conversation/title",t)},e.patchSettings=function(t){return this.base.patch("/chat/conversation/settings",t)},e.patchImage=function(t){return this.base.patch("/chat/conversation/image",t)},e.patchDetails=function(t){return this.base.patch("/chat/conversation/details",t)},e.getConversationPresignedurl=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.get("/chat/conversation/presignedurl?"+e)},e.getStatusRead=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.get("/chat/conversation/status/read?"+e)},e.getObserver=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.get("/chat/conversation/members?"+e)},e.deleteObserverLeave=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.delete("/chat/conversation/observer/leave?"+e)},e.putObserverJoin=function(t){return this.base.put("/chat/conversation/observer/join",t)},e.putMembers=function(t){return this.base.put("/chat/conversation/members",t)},e.getConversationMembers=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.get("/chat/conversation/members?"+e)},e.deleteConversationMembers=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.delete("/chat/conversation/members?"+e)},e.getConversationMemberDetails=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.get("/chat/conversation/member/details?"+e)},e.getConversationEligibleMembers=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.get("/chat/conversation/eligible/members?"+e)},e.deleteConversationLeave=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.delete("/chat/conversation/leave?"+e)},e.putConversationJoin=function(t){return this.base.put("/chat/conversation/join",t)},e.putConversationAdmin=function(t){return this.base.put("/chat/conversation/admin",t)},e.deleteConversationAdmin=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.delete("/chat/conversation/admin?"+e)},e.getConversationUnreadCount=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.get("/"+mu+"/unread/count?"+e)},e.putConversationLastread=function(t){return this.base.put("/chat/conversation/lastread",t)},e.deleteConversationClear=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.delete("/chat/conversation/local?"+e)},e.deleteConversationLocal=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.delete("/chat/conversation/clear?"+e)},t}(),Eu=function(){function t(t){this.base=void 0,this.base=new vu(t)}var e=t.prototype;return e.getUsers=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.get("/chat/users?"+e,!0)},e.getUserDetails=function(){return this.base.get("/chat/user/details")},e.postUserAuthenticate=function(t){var e=this,r=this.base.post("/chat/user/authenticate",t,!0);return r.then((function(t){e.base.updateUserToken(t.userToken)})),r},e.setUserToken=function(t){this.base.updateUserToken(t)},e.postUser=function(t){return this.base.post("/chat/user",t,!0)},e.patchUser=function(t){return this.base.patch("/chat/user",t)},e.deleteUser=function(){return this.base.delete("/chat/user")},e.postUserUnblock=function(t){return this.base.post("/chat/user/unblock",t)},e.getUserNonblock=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.get("/chat/user/nonblock?"+e)},e.getUserblockCount=function(){return this.base.get("/chat/user/block/count")},e.postUserBlock=function(t){return this.base.post("/chat/user/block",t)},e.getUserBlock=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.get("/chat/user/block?"+e)},e.getPresignedurlUpdate=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.get("/chat/user/presignedurl/update?"+e)},e.getPresignedurlCreate=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.get("/chat/user/presignedurl/update?"+e)},t}(),_u=function(){function t(t){var e=this;this.hostUri=void 0,this.clientId=void 0,this.client=void 0,this.licenseKey=void 0,this.projectId=void 0,this.keysetId=void 0,this.accountId=void 0,this.deviceId=void 0,this.customUsername=void 0,this.customPassword=void 0,this.hostUri=t.hostUri,this.clientId=t.clientId,this.deviceId=t.deviceId,this.licenseKey=t.licenseKey,this.projectId=t.projectId,this.keysetId=t.keysetId,this.accountId=t.accountId,this.customUsername=t.customUsername||"",this.customPassword=t.customPassword||"",this.client=tu.connect(this.hostUri,{clientId:this.clientId+this.deviceId,username:this.customUsername||"2"+this.accountId+this.projectId,password:this.customPassword||this.licenseKey+this.keysetId,keepalive:30,clean:!0}),this.client.on("connect",(function(){console.log("Isometrick MQTT Connected !!",e.client);try{e.client.subscribe("/"+e.accountId+"/"+e.projectId+"/Message/"+e.clientId,{qos:0},(function(t,e){t||console.log("Subscribed Successfully:: =>> Message",e),t&&console.log("Subscribed Failed || >>",t)})),e.client.subscribe("/"+e.accountId+"/"+e.projectId+"/Status/"+e.clientId,{qos:0},(function(t,e){t||console.log("Subscribed Successfully:: =>> Message",e),t&&console.log("Subscribed Failed || >>",t)}))}catch(t){console.error(t)}})),this.client.on("error",(function(t){console.log("Isometrick MQTT Connection ERROR !!",t,{clientId:e.clientId+e.deviceId,username:e.customUsername||"2"+e.accountId+e.projectId,password:e.customPassword||e.licenseKey+e.keysetId,keepalive:30,clean:!0},e.hostUri)}))}var e=t.prototype;return e.on=function(t,e){var r=this;switch(t){case"MESSAGE_RECEIVED":this.client.on("message",(function(t,r){var i=Buffer.from(r).toString("utf8"),n=JSON.parse(i||"{}");e(n,t)}));break;case"CONNECTION_LOST":this.client.stream.on("error",(function(t){console.log("connection error",t),e(t),r.client.end()}))}},e.disconnect=function(){this.client.end()},e.getInstance=function(){return this.client},t}(),Au=function(){function t(t){this.base=void 0,this.base=new vu(t)}var e=t.prototype;return e.getGroupCasts=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.get("/chat/groupcasts?"+e)},e.postGroupCast=function(t){return this.base.post("/chat/groupcast",t)},e.patchGroupCast=function(t){return this.base.patch("/chat/groupcast",t)},e.deleteGroupCastConversation=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.delete("/chat/groupcast?"+e)},e.getGroupcastStatus=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.get("/chat/groupcast/messages/status}?"+e)},e.getGroupCastStatusReadPending=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.get("/chat/groupcast/message/status/read/pending?"+e)},e.getGroupCastStatusRead=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.get("/chat/groupcast/message/status/read?"+e)},e.getGroupCastStatusDeliveryPending=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.get("/chat/groupcast/message/status/delivery/pending?"+e)},e.getGroupCastStatusDelivery=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.get("/chat/groupcast/message/status/delivery?"+e)},e.getGroupCastMessages=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.get("/chat/groupcast/messages?"+e)},e.postGroupCastMessage=function(t){return this.base.post("/chat/groupcast/message",t)},e.deleteMessageSelf=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.delete("/chat/groupcast/message/self?"+e)},e.deleteMessageEveryone=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.delete("/chat/groupcast/message/everyone?"+e)},e.getGroupCastMembers=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.get("/chat/groupcast/members?"+e)},e.addMembersToGroupCast=function(t){return this.base.put("/chat/groupcast/members",t)},e.removeMemebersFromGroupCast=function(t){return this.base.delete("/chat/groupcast/members",t)},e.getEligibleMembersForGroupCast=function(t){var e=t?Object.keys(t).map((function(e){return e+"="+t[e]})).join("&"):"";return this.base.get("/chat/groupcast/eligible/members?"+e)},t}(),ku={BadRequestError:au,ConflictError:bu,ForbiddenErrorRequest:du,NotFoundError:hu,ServiceUnavailableError:fu,UnauthorizedError:pu,UnknownError:cu,UnprocessableEntityError:lu},Su=function(){function t(t){this.message=void 0,this.Conversation=void 0,this.user=void 0,this.groupcast=void 0,this.error=void 0,this.message=new yu(t),this.Conversation=new gu(t),this.user=new Eu(t),this.error=ku,this.groupcast=new Au(t)}return t.getInstance=function(){if(null!==t.instance)return t.instance;throw new Error("Need to initialize instance first!")},t.getMqttInstance=function(){if(null!==t.mqttInstance)return t.mqttInstance;throw new Error("Need to initialize MQTT instance first!")},t.initializeInstance=function(e){return null===t.instance&&(t.instance=new t(e)),t.instance},t.prototype.initializeMqtt=function(e){return null===t.mqttInstance&&(t.mqttInstance=new _u(e)),t.mqttInstance},t}();Su.instance=null,Su.mqttInstance=null;export{Su as M};
|
|
7
|
+
//# sourceMappingURL=p-8f17345f.js.map
|