From cb101e52562795095b547b1158ac94d170fb10bb Mon Sep 17 00:00:00 2001 From: Sebin Song Date: Tue, 21 Jan 2025 03:19:29 +0900 Subject: [PATCH 01/24] #2512 - Fix a couple of chat regressions (#2521) * fix the emoji related issue * fix the wrong line-break errors * fix the code-block bug * enhance/simplify the logic to keep multiple line-breaks in chat * fix some linter errs * fix additional bugs --- .../chat-mentions/RenderMessageText.vue | 3 +- .../chat-mentions/chat-mentions-utils.js | 38 +++++++++++++------ frontend/views/utils/markdown-utils.js | 16 ++++---- 3 files changed, 36 insertions(+), 21 deletions(-) diff --git a/frontend/views/containers/chatroom/chat-mentions/RenderMessageText.vue b/frontend/views/containers/chatroom/chat-mentions/RenderMessageText.vue index 1bece09c1..0944c9982 100644 --- a/frontend/views/containers/chatroom/chat-mentions/RenderMessageText.vue +++ b/frontend/views/containers/chatroom/chat-mentions/RenderMessageText.vue @@ -89,8 +89,9 @@ export default ({ generateTextObjectsFromText (text) { const containsMentionChar = str => new RegExp(`[${CHATROOM_MEMBER_MENTION_SPECIAL_CHAR}${CHATROOM_CHANNEL_MENTION_SPECIAL_CHAR}]`, 'g').test(text) const wrapEmojis = str => { + const emojiRegex = /(\p{Emoji_Presentation}|\p{Emoji}\uFE0F|[\u2615-\u27BF]|\u200D)/gu // We should be able to style the emojis in message-text (reference issue: https://github.com/okTurtles/group-income/issues/2464) - return str.replace(/(\p{Emoji})/gu, '$1') + return str.replace(emojiRegex, '$1') } if (!text) { return [] } diff --git a/frontend/views/containers/chatroom/chat-mentions/chat-mentions-utils.js b/frontend/views/containers/chatroom/chat-mentions/chat-mentions-utils.js index 7d47c68ff..2efa33605 100644 --- a/frontend/views/containers/chatroom/chat-mentions/chat-mentions-utils.js +++ b/frontend/views/containers/chatroom/chat-mentions/chat-mentions-utils.js @@ -15,9 +15,7 @@ export function htmlStringToDomObjectTree (htmlString: string): Array // Below is a bug-fix for the issue #2130 (https://github.com/okTurtles/group-income/issues/2130) // DOMParser.parseFromString() has some caveats re how it interprets < and > // so manually wrap them with tags. - // $FlowFixMe[prop-missing] - htmlString = htmlString.replaceAll('<', '<') - .replaceAll('>', '>') + htmlString = replaceMultiple(htmlString, { '<': '(<)', '>': '(>)' }) const doc = parser.parseFromString(htmlString, 'text/html') const rootNode = doc.body @@ -25,6 +23,18 @@ export function htmlStringToDomObjectTree (htmlString: string): Array return createRecursiveDomObjects(rootNode)?.children || [] } +function isOnlyNewlines (str: any): boolean { + return /^[\n]*$/.test(str) +} + +function replaceMultiple (input: string, replacements: Object): string { + return Object.entries(replacements).reduce( + // $FlowFixMe[prop-missing] + (str, [from, to]) => str.replaceAll(from, to), + input + ) +} + function createRecursiveDomObjects (element: any): DomObject { /* This function takes the virtual DOM tree generated as a reult of calling the DOMParser method, @@ -61,15 +71,25 @@ function createRecursiveDomObjects (element: any): DomObject { const isNodeTypeText = element?.nodeType === Node.TEXT_NODE const isNodeCodeElement = element?.nodeName === 'CODE' // ... element needs a special treatment in the chat. - const isBodyElement = element?.nodeName === 'BODY' const nodeObj: DomObject = isNodeTypeText - ? { tagName: null, attributes: {}, text: element.textContent } + ? { + tagName: null, + attributes: {}, + text: replaceMultiple(element.textContent, { '(<)': '<', '(>)': '>' }) + } : { tagName: element.tagName, text: isNodeCodeElement // $FlowFixMe[prop-missing] - ? element.innerText.replaceAll('
', '') + ? replaceMultiple(element.innerText, + { + '
': '', + '>': '>', + '<': '<', + '(<)': '<', + '(>)': '>' + }) : undefined, attributes: {} } @@ -90,11 +110,7 @@ function createRecursiveDomObjects (element: any): DomObject { nodeObj.children = nodeObj.children.filter(child => { if (child.tagName) return true - else { - return isBodyElement - ? child.text !== '\n' // DOMParser.parseFromString() adds a '\n' at the end of the body content which needs to be removed. - : (child.text || '').length - } + else return Boolean(child.text?.length) && !isOnlyNewlines(child.text) }) } diff --git a/frontend/views/utils/markdown-utils.js b/frontend/views/utils/markdown-utils.js index 0c25e3c46..e8214b644 100644 --- a/frontend/views/utils/markdown-utils.js +++ b/frontend/views/utils/markdown-utils.js @@ -40,18 +40,15 @@ export function renderMarkdown (str: string): any { entryText = entryText.replace(//g, '>') // Replace all '>' with '>' except for the ones that are not preceded by a line-break or start of the string (e.g. '> asdf' is a blockquote). - entryText = entryText.replace(/\n(?=\n)/g, '\n
') - .replace(/
\n(\s*)(>|\d+\.|-)/g, '\n\n$1$2') // [1] custom-handling the case where
is directly followed by the start of ordered/unordered lists - .replace(/(>|\d+\.|-)(\s.+)\n
/g, '$1$2\n\n') // [2] this is a custom-logic added so that the end of ordered/un-ordered lists are correctly detected by markedjs. - .replace(/(>)(\s.+)\n
/gs, '$1$2\n\n') // [3] this is a custom-logic added so that the end of blockquotes are correctly detected by markedjs. ('s' flag is needed to account for multi-line strings) - + // GI needs to keep the line-breaks in the markdown but the markedjs with 'gfm' option doesn't fully support it. + // So we need to manually add
tags here before passing it to markedjs. + // (Reference: https://github.com/markedjs/marked/issues/190#issuecomment-865303317) + entryText = entryText.replace(/\n(?=\n)/g, '\n\n
\n') entry.text = entryText } }) str = combineMarkdownSegmentListIntoString(strSplitByCodeMarkdown) - str = str.replace(/(\d+\.|-)(\s.+)\n
/g, '$1$2\n\n') - .replace(/(>)(\s.+)\n
/gs, '$1$2\n\n') // Check for [2], [3] above once more to resolve edge-cases (reference: https://github.com/okTurtles/group-income/issues/2356) // STEP 2. convert the markdown into html DOM string. let converted = marked.parse(str, { gfm: true }) @@ -59,6 +56,7 @@ export function renderMarkdown (str: string): any { // STEP 3. Remove the unecessary starting/end line-breaks added in/outside of the converted html tags. converted = converted.replace(/<([a-z]+)>\n/g, '<$1>') .replace(/\n<\/([a-z]+)>/g, '') + return converted } @@ -158,8 +156,8 @@ export function splitStringByMarkdownCode ( // This function takes a markdown string and split it by texts written as either inline/block code. // (e.g. `asdf`, ```const var = 123```) - const regExCodeMultiple = /(```\n[\s\S]*?```$)/gm // Detecting multi-line code-block by reg-exp - reference: https://regexr.com/4h9sh - const regExCodeInline = /(`.+`)/g + const regExCodeMultiple = /(```[a-z]*?\n[\s\S]*?```$)/gm // Detecting multi-line code-block by reg-exp - reference: https://regexr.com/4h9sh + const regExCodeInline = /(`[^`]+`)/g const splitByMulitpleCode = str.split(regExCodeMultiple) const finalArr = [] From f79daaaff00b7f1178417384bdf10b5a95aab200 Mon Sep 17 00:00:00 2001 From: Greg Slepak Date: Mon, 20 Jan 2025 10:39:33 -0800 Subject: [PATCH 02/24] Update README.md some deployment instructions --- README.md | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5dcd42b86..74683251e 100644 --- a/README.md +++ b/README.md @@ -83,19 +83,26 @@ grunt dev --tunnel > $ ssh -R 80:localhost:8000 nokey@localhost.run > ``` -Build the app for distribution +Pin a new version of contracts: ```bash -grunt deploy +$ NODE_ENV=production grunt pin:0.1.0 ``` -Clean up files in `dist/` +Build the app for distribution: + +```bash +$ NODE_ENV=production grunt deploy +$ tar cfz gi-v1.1.0.tgz dist +``` + +Clean up files in `dist/`: ```bash grunt clean ``` -Run tests. +Run tests: **NOTE: You may need to first install Cypress using `./node_modules/.bin/cypress install`** From ae22899540304dfae99e9297a46879e2e87d86e8 Mon Sep 17 00:00:00 2001 From: Sebin Song Date: Tue, 21 Jan 2025 12:45:36 +0900 Subject: [PATCH 03/24] fix the html rendering bug in the banner (#2532) --- frontend/views/components/banners/BannerGeneral.vue | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/frontend/views/components/banners/BannerGeneral.vue b/frontend/views/components/banners/BannerGeneral.vue index fe08abc73..2fb0250eb 100644 --- a/frontend/views/components/banners/BannerGeneral.vue +++ b/frontend/views/components/banners/BannerGeneral.vue @@ -7,19 +7,17 @@ aria-live='polite' ) i(:class='`icon-${ephemeral.icon} is-prefix`') - render-message-with-markdown(:text='ephemeral.message') + .c-banner-content(v-safe-html:a='ephemeral.message') @@ -42,5 +47,6 @@ export default ({ flex-direction: column; align-items: stretch; font-weight: normal; + word-break: break-word; } From fe77c20126e1f9f86fa3bcee5d7fd7d7ca94a063 Mon Sep 17 00:00:00 2001 From: Sebin Song Date: Wed, 22 Jan 2025 13:36:10 +0900 Subject: [PATCH 06/24] #2529 - Fix the chat regression (#2533) * fix the extra br tag issues * better comment --- frontend/views/utils/markdown-utils.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend/views/utils/markdown-utils.js b/frontend/views/utils/markdown-utils.js index e8214b644..9be7635b4 100644 --- a/frontend/views/utils/markdown-utils.js +++ b/frontend/views/utils/markdown-utils.js @@ -57,6 +57,11 @@ export function renderMarkdown (str: string): any { converted = converted.replace(/<([a-z]+)>\n/g, '<$1>') .replace(/\n<\/([a-z]+)>/g, '') + // STEP 4. Sanitize some
s that directly precedes/follows
    ,
      ,
      elements. + // - These are block elements by themselves, meaning they naturally carry one line-breaks at the start/end the tag(s). + // So remove 1 direct sibling
      s. (reference issue: https://github.com/okTurtles/group-income/issues/2529) + converted = converted.replace(/\s*?(
        |
          |
          )/g, '$1') + .replace(/(<\/ul>|<\/ol>|<\/blockquote>)\s*?/g, '$1') return converted } From 53a8a39dfcafdab89753bc7c98580579fd9995ea Mon Sep 17 00:00:00 2001 From: Greg Slepak Date: Thu, 23 Jan 2025 11:47:39 -0800 Subject: [PATCH 07/24] v1.2.0 prep --- contracts/1.2.0/chatroom-slim.js | 8807 +++++++++++++ contracts/1.2.0/chatroom.1.2.0.manifest.json | 1 + contracts/1.2.0/chatroom.js | 8862 +++++++++++++ contracts/1.2.0/group-slim.js | 10253 +++++++++++++++ contracts/1.2.0/group.1.2.0.manifest.json | 1 + contracts/1.2.0/group.js | 10320 ++++++++++++++++ contracts/1.2.0/identity-slim.js | 8358 +++++++++++++ contracts/1.2.0/identity.1.2.0.manifest.json | 1 + contracts/1.2.0/identity.js | 8413 +++++++++++++ .../global-dashboard/NewsAndUpdates.vue | 43 +- package.json | 4 +- 11 files changed, 55058 insertions(+), 5 deletions(-) create mode 100644 contracts/1.2.0/chatroom-slim.js create mode 100644 contracts/1.2.0/chatroom.1.2.0.manifest.json create mode 100644 contracts/1.2.0/chatroom.js create mode 100644 contracts/1.2.0/group-slim.js create mode 100644 contracts/1.2.0/group.1.2.0.manifest.json create mode 100644 contracts/1.2.0/group.js create mode 100644 contracts/1.2.0/identity-slim.js create mode 100644 contracts/1.2.0/identity.1.2.0.manifest.json create mode 100644 contracts/1.2.0/identity.js diff --git a/contracts/1.2.0/chatroom-slim.js b/contracts/1.2.0/chatroom-slim.js new file mode 100644 index 000000000..4021ec0ca --- /dev/null +++ b/contracts/1.2.0/chatroom-slim.js @@ -0,0 +1,8807 @@ +"use strict"; +(() => { + var __create = Object.create; + var __defProp = Object.defineProperty; + var __getOwnPropDesc = Object.getOwnPropertyDescriptor; + var __getOwnPropNames = Object.getOwnPropertyNames; + var __getProtoOf = Object.getPrototypeOf; + var __hasOwnProp = Object.prototype.hasOwnProperty; + var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; + var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { + get: (a, b) => (typeof require !== "undefined" ? require : a)[b] + }) : x)(function(x) { + if (typeof require !== "undefined") + return require.apply(this, arguments); + throw new Error('Dynamic require of "' + x + '" is not supported'); + }); + var __commonJS = (cb, mod) => function __require2() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; + }; + var __copyProps = (to, from3, except, desc) => { + if (from3 && typeof from3 === "object" || typeof from3 === "function") { + for (let key of __getOwnPropNames(from3)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from3[key], enumerable: !(desc = __getOwnPropDesc(from3, key)) || desc.enumerable }); + } + return to; + }; + var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod)); + var __publicField = (obj, key, value) => { + __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); + return value; + }; + + // node_modules/blakejs/util.js + var require_util = __commonJS({ + "node_modules/blakejs/util.js"(exports, module) { + var ERROR_MSG_INPUT = "Input must be an string, Buffer or Uint8Array"; + function normalizeInput(input) { + let ret; + if (input instanceof Uint8Array) { + ret = input; + } else if (typeof input === "string") { + const encoder = new TextEncoder(); + ret = encoder.encode(input); + } else { + throw new Error(ERROR_MSG_INPUT); + } + return ret; + } + function toHex(bytes) { + return Array.prototype.map.call(bytes, function(n) { + return (n < 16 ? "0" : "") + n.toString(16); + }).join(""); + } + function uint32ToHex(val) { + return (4294967296 + val).toString(16).substring(1); + } + function debugPrint(label, arr, size) { + let msg = "\n" + label + " = "; + for (let i = 0; i < arr.length; i += 2) { + if (size === 32) { + msg += uint32ToHex(arr[i]).toUpperCase(); + msg += " "; + msg += uint32ToHex(arr[i + 1]).toUpperCase(); + } else if (size === 64) { + msg += uint32ToHex(arr[i + 1]).toUpperCase(); + msg += uint32ToHex(arr[i]).toUpperCase(); + } else + throw new Error("Invalid size " + size); + if (i % 6 === 4) { + msg += "\n" + new Array(label.length + 4).join(" "); + } else if (i < arr.length - 2) { + msg += " "; + } + } + console.log(msg); + } + function testSpeed(hashFn, N, M) { + let startMs = new Date().getTime(); + const input = new Uint8Array(N); + for (let i = 0; i < N; i++) { + input[i] = i % 256; + } + const genMs = new Date().getTime(); + console.log("Generated random input in " + (genMs - startMs) + "ms"); + startMs = genMs; + for (let i = 0; i < M; i++) { + const hashHex = hashFn(input); + const hashMs = new Date().getTime(); + const ms = hashMs - startMs; + startMs = hashMs; + console.log("Hashed in " + ms + "ms: " + hashHex.substring(0, 20) + "..."); + console.log(Math.round(N / (1 << 20) / (ms / 1e3) * 100) / 100 + " MB PER SECOND"); + } + } + module.exports = { + normalizeInput, + toHex, + debugPrint, + testSpeed + }; + } + }); + + // node_modules/blakejs/blake2b.js + var require_blake2b = __commonJS({ + "node_modules/blakejs/blake2b.js"(exports, module) { + var util = require_util(); + function ADD64AA(v2, a, b) { + const o0 = v2[a] + v2[b]; + let o1 = v2[a + 1] + v2[b + 1]; + if (o0 >= 4294967296) { + o1++; + } + v2[a] = o0; + v2[a + 1] = o1; + } + function ADD64AC(v2, a, b0, b1) { + let o0 = v2[a] + b0; + if (b0 < 0) { + o0 += 4294967296; + } + let o1 = v2[a + 1] + b1; + if (o0 >= 4294967296) { + o1++; + } + v2[a] = o0; + v2[a + 1] = o1; + } + function B2B_GET32(arr, i) { + return arr[i] ^ arr[i + 1] << 8 ^ arr[i + 2] << 16 ^ arr[i + 3] << 24; + } + function B2B_G(a, b, c, d, ix, iy) { + const x0 = m[ix]; + const x1 = m[ix + 1]; + const y0 = m[iy]; + const y1 = m[iy + 1]; + ADD64AA(v, a, b); + ADD64AC(v, a, x0, x1); + let xor0 = v[d] ^ v[a]; + let xor1 = v[d + 1] ^ v[a + 1]; + v[d] = xor1; + v[d + 1] = xor0; + ADD64AA(v, c, d); + xor0 = v[b] ^ v[c]; + xor1 = v[b + 1] ^ v[c + 1]; + v[b] = xor0 >>> 24 ^ xor1 << 8; + v[b + 1] = xor1 >>> 24 ^ xor0 << 8; + ADD64AA(v, a, b); + ADD64AC(v, a, y0, y1); + xor0 = v[d] ^ v[a]; + xor1 = v[d + 1] ^ v[a + 1]; + v[d] = xor0 >>> 16 ^ xor1 << 16; + v[d + 1] = xor1 >>> 16 ^ xor0 << 16; + ADD64AA(v, c, d); + xor0 = v[b] ^ v[c]; + xor1 = v[b + 1] ^ v[c + 1]; + v[b] = xor1 >>> 31 ^ xor0 << 1; + v[b + 1] = xor0 >>> 31 ^ xor1 << 1; + } + var BLAKE2B_IV32 = new Uint32Array([ + 4089235720, + 1779033703, + 2227873595, + 3144134277, + 4271175723, + 1013904242, + 1595750129, + 2773480762, + 2917565137, + 1359893119, + 725511199, + 2600822924, + 4215389547, + 528734635, + 327033209, + 1541459225 + ]); + var SIGMA8 = [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 14, + 10, + 4, + 8, + 9, + 15, + 13, + 6, + 1, + 12, + 0, + 2, + 11, + 7, + 5, + 3, + 11, + 8, + 12, + 0, + 5, + 2, + 15, + 13, + 10, + 14, + 3, + 6, + 7, + 1, + 9, + 4, + 7, + 9, + 3, + 1, + 13, + 12, + 11, + 14, + 2, + 6, + 5, + 10, + 4, + 0, + 15, + 8, + 9, + 0, + 5, + 7, + 2, + 4, + 10, + 15, + 14, + 1, + 11, + 12, + 6, + 8, + 3, + 13, + 2, + 12, + 6, + 10, + 0, + 11, + 8, + 3, + 4, + 13, + 7, + 5, + 15, + 14, + 1, + 9, + 12, + 5, + 1, + 15, + 14, + 13, + 4, + 10, + 0, + 7, + 6, + 3, + 9, + 2, + 8, + 11, + 13, + 11, + 7, + 14, + 12, + 1, + 3, + 9, + 5, + 0, + 15, + 4, + 8, + 6, + 2, + 10, + 6, + 15, + 14, + 9, + 11, + 3, + 0, + 8, + 12, + 2, + 13, + 7, + 1, + 4, + 10, + 5, + 10, + 2, + 8, + 4, + 7, + 6, + 1, + 5, + 15, + 11, + 9, + 14, + 3, + 12, + 13, + 0, + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 14, + 10, + 4, + 8, + 9, + 15, + 13, + 6, + 1, + 12, + 0, + 2, + 11, + 7, + 5, + 3 + ]; + var SIGMA82 = new Uint8Array(SIGMA8.map(function(x) { + return x * 2; + })); + var v = new Uint32Array(32); + var m = new Uint32Array(32); + function blake2bCompress(ctx, last) { + let i = 0; + for (i = 0; i < 16; i++) { + v[i] = ctx.h[i]; + v[i + 16] = BLAKE2B_IV32[i]; + } + v[24] = v[24] ^ ctx.t; + v[25] = v[25] ^ ctx.t / 4294967296; + if (last) { + v[28] = ~v[28]; + v[29] = ~v[29]; + } + for (i = 0; i < 32; i++) { + m[i] = B2B_GET32(ctx.b, 4 * i); + } + for (i = 0; i < 12; i++) { + B2B_G(0, 8, 16, 24, SIGMA82[i * 16 + 0], SIGMA82[i * 16 + 1]); + B2B_G(2, 10, 18, 26, SIGMA82[i * 16 + 2], SIGMA82[i * 16 + 3]); + B2B_G(4, 12, 20, 28, SIGMA82[i * 16 + 4], SIGMA82[i * 16 + 5]); + B2B_G(6, 14, 22, 30, SIGMA82[i * 16 + 6], SIGMA82[i * 16 + 7]); + B2B_G(0, 10, 20, 30, SIGMA82[i * 16 + 8], SIGMA82[i * 16 + 9]); + B2B_G(2, 12, 22, 24, SIGMA82[i * 16 + 10], SIGMA82[i * 16 + 11]); + B2B_G(4, 14, 16, 26, SIGMA82[i * 16 + 12], SIGMA82[i * 16 + 13]); + B2B_G(6, 8, 18, 28, SIGMA82[i * 16 + 14], SIGMA82[i * 16 + 15]); + } + for (i = 0; i < 16; i++) { + ctx.h[i] = ctx.h[i] ^ v[i] ^ v[i + 16]; + } + } + var parameterBlock = new Uint8Array([ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ]); + function blake2bInit2(outlen, key, salt, personal) { + if (outlen === 0 || outlen > 64) { + throw new Error("Illegal output length, expected 0 < length <= 64"); + } + if (key && key.length > 64) { + throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64"); + } + if (salt && salt.length !== 16) { + throw new Error("Illegal salt, expected Uint8Array with length is 16"); + } + if (personal && personal.length !== 16) { + throw new Error("Illegal personal, expected Uint8Array with length is 16"); + } + const ctx = { + b: new Uint8Array(128), + h: new Uint32Array(16), + t: 0, + c: 0, + outlen + }; + parameterBlock.fill(0); + parameterBlock[0] = outlen; + if (key) + parameterBlock[1] = key.length; + parameterBlock[2] = 1; + parameterBlock[3] = 1; + if (salt) + parameterBlock.set(salt, 32); + if (personal) + parameterBlock.set(personal, 48); + for (let i = 0; i < 16; i++) { + ctx.h[i] = BLAKE2B_IV32[i] ^ B2B_GET32(parameterBlock, i * 4); + } + if (key) { + blake2bUpdate2(ctx, key); + ctx.c = 128; + } + return ctx; + } + function blake2bUpdate2(ctx, input) { + for (let i = 0; i < input.length; i++) { + if (ctx.c === 128) { + ctx.t += ctx.c; + blake2bCompress(ctx, false); + ctx.c = 0; + } + ctx.b[ctx.c++] = input[i]; + } + } + function blake2bFinal2(ctx) { + ctx.t += ctx.c; + while (ctx.c < 128) { + ctx.b[ctx.c++] = 0; + } + blake2bCompress(ctx, true); + const out = new Uint8Array(ctx.outlen); + for (let i = 0; i < ctx.outlen; i++) { + out[i] = ctx.h[i >> 2] >> 8 * (i & 3); + } + return out; + } + function blake2b3(input, key, outlen, salt, personal) { + outlen = outlen || 64; + input = util.normalizeInput(input); + if (salt) { + salt = util.normalizeInput(salt); + } + if (personal) { + personal = util.normalizeInput(personal); + } + const ctx = blake2bInit2(outlen, key, salt, personal); + blake2bUpdate2(ctx, input); + return blake2bFinal2(ctx); + } + function blake2bHex(input, key, outlen, salt, personal) { + const output = blake2b3(input, key, outlen, salt, personal); + return util.toHex(output); + } + module.exports = { + blake2b: blake2b3, + blake2bHex, + blake2bInit: blake2bInit2, + blake2bUpdate: blake2bUpdate2, + blake2bFinal: blake2bFinal2 + }; + } + }); + + // node_modules/blakejs/blake2s.js + var require_blake2s = __commonJS({ + "node_modules/blakejs/blake2s.js"(exports, module) { + var util = require_util(); + function B2S_GET32(v2, i) { + return v2[i] ^ v2[i + 1] << 8 ^ v2[i + 2] << 16 ^ v2[i + 3] << 24; + } + function B2S_G(a, b, c, d, x, y) { + v[a] = v[a] + v[b] + x; + v[d] = ROTR32(v[d] ^ v[a], 16); + v[c] = v[c] + v[d]; + v[b] = ROTR32(v[b] ^ v[c], 12); + v[a] = v[a] + v[b] + y; + v[d] = ROTR32(v[d] ^ v[a], 8); + v[c] = v[c] + v[d]; + v[b] = ROTR32(v[b] ^ v[c], 7); + } + function ROTR32(x, y) { + return x >>> y ^ x << 32 - y; + } + var BLAKE2S_IV = new Uint32Array([ + 1779033703, + 3144134277, + 1013904242, + 2773480762, + 1359893119, + 2600822924, + 528734635, + 1541459225 + ]); + var SIGMA = new Uint8Array([ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 14, + 10, + 4, + 8, + 9, + 15, + 13, + 6, + 1, + 12, + 0, + 2, + 11, + 7, + 5, + 3, + 11, + 8, + 12, + 0, + 5, + 2, + 15, + 13, + 10, + 14, + 3, + 6, + 7, + 1, + 9, + 4, + 7, + 9, + 3, + 1, + 13, + 12, + 11, + 14, + 2, + 6, + 5, + 10, + 4, + 0, + 15, + 8, + 9, + 0, + 5, + 7, + 2, + 4, + 10, + 15, + 14, + 1, + 11, + 12, + 6, + 8, + 3, + 13, + 2, + 12, + 6, + 10, + 0, + 11, + 8, + 3, + 4, + 13, + 7, + 5, + 15, + 14, + 1, + 9, + 12, + 5, + 1, + 15, + 14, + 13, + 4, + 10, + 0, + 7, + 6, + 3, + 9, + 2, + 8, + 11, + 13, + 11, + 7, + 14, + 12, + 1, + 3, + 9, + 5, + 0, + 15, + 4, + 8, + 6, + 2, + 10, + 6, + 15, + 14, + 9, + 11, + 3, + 0, + 8, + 12, + 2, + 13, + 7, + 1, + 4, + 10, + 5, + 10, + 2, + 8, + 4, + 7, + 6, + 1, + 5, + 15, + 11, + 9, + 14, + 3, + 12, + 13, + 0 + ]); + var v = new Uint32Array(16); + var m = new Uint32Array(16); + function blake2sCompress(ctx, last) { + let i = 0; + for (i = 0; i < 8; i++) { + v[i] = ctx.h[i]; + v[i + 8] = BLAKE2S_IV[i]; + } + v[12] ^= ctx.t; + v[13] ^= ctx.t / 4294967296; + if (last) { + v[14] = ~v[14]; + } + for (i = 0; i < 16; i++) { + m[i] = B2S_GET32(ctx.b, 4 * i); + } + for (i = 0; i < 10; i++) { + B2S_G(0, 4, 8, 12, m[SIGMA[i * 16 + 0]], m[SIGMA[i * 16 + 1]]); + B2S_G(1, 5, 9, 13, m[SIGMA[i * 16 + 2]], m[SIGMA[i * 16 + 3]]); + B2S_G(2, 6, 10, 14, m[SIGMA[i * 16 + 4]], m[SIGMA[i * 16 + 5]]); + B2S_G(3, 7, 11, 15, m[SIGMA[i * 16 + 6]], m[SIGMA[i * 16 + 7]]); + B2S_G(0, 5, 10, 15, m[SIGMA[i * 16 + 8]], m[SIGMA[i * 16 + 9]]); + B2S_G(1, 6, 11, 12, m[SIGMA[i * 16 + 10]], m[SIGMA[i * 16 + 11]]); + B2S_G(2, 7, 8, 13, m[SIGMA[i * 16 + 12]], m[SIGMA[i * 16 + 13]]); + B2S_G(3, 4, 9, 14, m[SIGMA[i * 16 + 14]], m[SIGMA[i * 16 + 15]]); + } + for (i = 0; i < 8; i++) { + ctx.h[i] ^= v[i] ^ v[i + 8]; + } + } + function blake2sInit(outlen, key) { + if (!(outlen > 0 && outlen <= 32)) { + throw new Error("Incorrect output length, should be in [1, 32]"); + } + const keylen = key ? key.length : 0; + if (key && !(keylen > 0 && keylen <= 32)) { + throw new Error("Incorrect key length, should be in [1, 32]"); + } + const ctx = { + h: new Uint32Array(BLAKE2S_IV), + b: new Uint8Array(64), + c: 0, + t: 0, + outlen + }; + ctx.h[0] ^= 16842752 ^ keylen << 8 ^ outlen; + if (keylen > 0) { + blake2sUpdate(ctx, key); + ctx.c = 64; + } + return ctx; + } + function blake2sUpdate(ctx, input) { + for (let i = 0; i < input.length; i++) { + if (ctx.c === 64) { + ctx.t += ctx.c; + blake2sCompress(ctx, false); + ctx.c = 0; + } + ctx.b[ctx.c++] = input[i]; + } + } + function blake2sFinal(ctx) { + ctx.t += ctx.c; + while (ctx.c < 64) { + ctx.b[ctx.c++] = 0; + } + blake2sCompress(ctx, true); + const out = new Uint8Array(ctx.outlen); + for (let i = 0; i < ctx.outlen; i++) { + out[i] = ctx.h[i >> 2] >> 8 * (i & 3) & 255; + } + return out; + } + function blake2s(input, key, outlen) { + outlen = outlen || 32; + input = util.normalizeInput(input); + const ctx = blake2sInit(outlen, key); + blake2sUpdate(ctx, input); + return blake2sFinal(ctx); + } + function blake2sHex(input, key, outlen) { + const output = blake2s(input, key, outlen); + return util.toHex(output); + } + module.exports = { + blake2s, + blake2sHex, + blake2sInit, + blake2sUpdate, + blake2sFinal + }; + } + }); + + // node_modules/blakejs/index.js + var require_blakejs = __commonJS({ + "node_modules/blakejs/index.js"(exports, module) { + var b2b = require_blake2b(); + var b2s = require_blake2s(); + module.exports = { + blake2b: b2b.blake2b, + blake2bHex: b2b.blake2bHex, + blake2bInit: b2b.blake2bInit, + blake2bUpdate: b2b.blake2bUpdate, + blake2bFinal: b2b.blake2bFinal, + blake2s: b2s.blake2s, + blake2sHex: b2s.blake2sHex, + blake2sInit: b2s.blake2sInit, + blake2sUpdate: b2s.blake2sUpdate, + blake2sFinal: b2s.blake2sFinal + }; + } + }); + + // node_modules/base64-js/index.js + var require_base64_js = __commonJS({ + "node_modules/base64-js/index.js"(exports) { + "use strict"; + exports.byteLength = byteLength; + exports.toByteArray = toByteArray; + exports.fromByteArray = fromByteArray; + var lookup = []; + var revLookup = []; + var Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array; + var code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + for (i = 0, len = code.length; i < len; ++i) { + lookup[i] = code[i]; + revLookup[code.charCodeAt(i)] = i; + } + var i; + var len; + revLookup["-".charCodeAt(0)] = 62; + revLookup["_".charCodeAt(0)] = 63; + function getLens(b64) { + var len2 = b64.length; + if (len2 % 4 > 0) { + throw new Error("Invalid string. Length must be a multiple of 4"); + } + var validLen = b64.indexOf("="); + if (validLen === -1) + validLen = len2; + var placeHoldersLen = validLen === len2 ? 0 : 4 - validLen % 4; + return [validLen, placeHoldersLen]; + } + function byteLength(b64) { + var lens = getLens(b64); + var validLen = lens[0]; + var placeHoldersLen = lens[1]; + return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; + } + function _byteLength(b64, validLen, placeHoldersLen) { + return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; + } + function toByteArray(b64) { + var tmp; + var lens = getLens(b64); + var validLen = lens[0]; + var placeHoldersLen = lens[1]; + var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)); + var curByte = 0; + var len2 = placeHoldersLen > 0 ? validLen - 4 : validLen; + var i2; + for (i2 = 0; i2 < len2; i2 += 4) { + tmp = revLookup[b64.charCodeAt(i2)] << 18 | revLookup[b64.charCodeAt(i2 + 1)] << 12 | revLookup[b64.charCodeAt(i2 + 2)] << 6 | revLookup[b64.charCodeAt(i2 + 3)]; + arr[curByte++] = tmp >> 16 & 255; + arr[curByte++] = tmp >> 8 & 255; + arr[curByte++] = tmp & 255; + } + if (placeHoldersLen === 2) { + tmp = revLookup[b64.charCodeAt(i2)] << 2 | revLookup[b64.charCodeAt(i2 + 1)] >> 4; + arr[curByte++] = tmp & 255; + } + if (placeHoldersLen === 1) { + tmp = revLookup[b64.charCodeAt(i2)] << 10 | revLookup[b64.charCodeAt(i2 + 1)] << 4 | revLookup[b64.charCodeAt(i2 + 2)] >> 2; + arr[curByte++] = tmp >> 8 & 255; + arr[curByte++] = tmp & 255; + } + return arr; + } + function tripletToBase64(num) { + return lookup[num >> 18 & 63] + lookup[num >> 12 & 63] + lookup[num >> 6 & 63] + lookup[num & 63]; + } + function encodeChunk(uint8, start, end) { + var tmp; + var output = []; + for (var i2 = start; i2 < end; i2 += 3) { + tmp = (uint8[i2] << 16 & 16711680) + (uint8[i2 + 1] << 8 & 65280) + (uint8[i2 + 2] & 255); + output.push(tripletToBase64(tmp)); + } + return output.join(""); + } + function fromByteArray(uint8) { + var tmp; + var len2 = uint8.length; + var extraBytes = len2 % 3; + var parts = []; + var maxChunkLength = 16383; + for (var i2 = 0, len22 = len2 - extraBytes; i2 < len22; i2 += maxChunkLength) { + parts.push(encodeChunk(uint8, i2, i2 + maxChunkLength > len22 ? len22 : i2 + maxChunkLength)); + } + if (extraBytes === 1) { + tmp = uint8[len2 - 1]; + parts.push(lookup[tmp >> 2] + lookup[tmp << 4 & 63] + "=="); + } else if (extraBytes === 2) { + tmp = (uint8[len2 - 2] << 8) + uint8[len2 - 1]; + parts.push(lookup[tmp >> 10] + lookup[tmp >> 4 & 63] + lookup[tmp << 2 & 63] + "="); + } + return parts.join(""); + } + } + }); + + // node_modules/ieee754/index.js + var require_ieee754 = __commonJS({ + "node_modules/ieee754/index.js"(exports) { + exports.read = function(buffer, offset, isLE, mLen, nBytes) { + var e, m; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var nBits = -7; + var i = isLE ? nBytes - 1 : 0; + var d = isLE ? -1 : 1; + var s = buffer[offset + i]; + i += d; + e = s & (1 << -nBits) - 1; + s >>= -nBits; + nBits += eLen; + for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) { + } + m = e & (1 << -nBits) - 1; + e >>= -nBits; + nBits += mLen; + for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) { + } + if (e === 0) { + e = 1 - eBias; + } else if (e === eMax) { + return m ? NaN : (s ? -1 : 1) * Infinity; + } else { + m = m + Math.pow(2, mLen); + e = e - eBias; + } + return (s ? -1 : 1) * m * Math.pow(2, e - mLen); + }; + exports.write = function(buffer, value, offset, isLE, mLen, nBytes) { + var e, m, c; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0; + var i = isLE ? 0 : nBytes - 1; + var d = isLE ? 1 : -1; + var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; + value = Math.abs(value); + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0; + e = eMax; + } else { + e = Math.floor(Math.log(value) / Math.LN2); + if (value * (c = Math.pow(2, -e)) < 1) { + e--; + c *= 2; + } + if (e + eBias >= 1) { + value += rt / c; + } else { + value += rt * Math.pow(2, 1 - eBias); + } + if (value * c >= 2) { + e++; + c /= 2; + } + if (e + eBias >= eMax) { + m = 0; + e = eMax; + } else if (e + eBias >= 1) { + m = (value * c - 1) * Math.pow(2, mLen); + e = e + eBias; + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); + e = 0; + } + } + for (; mLen >= 8; buffer[offset + i] = m & 255, i += d, m /= 256, mLen -= 8) { + } + e = e << mLen | m; + eLen += mLen; + for (; eLen > 0; buffer[offset + i] = e & 255, i += d, e /= 256, eLen -= 8) { + } + buffer[offset + i - d] |= s * 128; + }; + } + }); + + // node_modules/buffer/index.js + var require_buffer = __commonJS({ + "node_modules/buffer/index.js"(exports) { + "use strict"; + var base64 = require_base64_js(); + var ieee754 = require_ieee754(); + var customInspectSymbol = typeof Symbol === "function" && typeof Symbol["for"] === "function" ? Symbol["for"]("nodejs.util.inspect.custom") : null; + exports.Buffer = Buffer2; + exports.SlowBuffer = SlowBuffer; + exports.INSPECT_MAX_BYTES = 50; + var K_MAX_LENGTH = 2147483647; + exports.kMaxLength = K_MAX_LENGTH; + Buffer2.TYPED_ARRAY_SUPPORT = typedArraySupport(); + if (!Buffer2.TYPED_ARRAY_SUPPORT && typeof console !== "undefined" && 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 typedArraySupport() { + try { + const arr = new Uint8Array(1); + const proto3 = { foo: function() { + return 42; + } }; + Object.setPrototypeOf(proto3, Uint8Array.prototype); + Object.setPrototypeOf(arr, proto3); + return arr.foo() === 42; + } catch (e) { + return false; + } + } + Object.defineProperty(Buffer2.prototype, "parent", { + enumerable: true, + get: function() { + if (!Buffer2.isBuffer(this)) + return void 0; + return this.buffer; + } + }); + Object.defineProperty(Buffer2.prototype, "offset", { + enumerable: true, + get: function() { + if (!Buffer2.isBuffer(this)) + return void 0; + return this.byteOffset; + } + }); + function createBuffer(length2) { + if (length2 > K_MAX_LENGTH) { + throw new RangeError('The value "' + length2 + '" is invalid for option "size"'); + } + const buf = new Uint8Array(length2); + Object.setPrototypeOf(buf, Buffer2.prototype); + return buf; + } + function Buffer2(arg, encodingOrOffset, length2) { + if (typeof arg === "number") { + if (typeof encodingOrOffset === "string") { + throw new TypeError('The "string" argument must be of type string. Received type number'); + } + return allocUnsafe(arg); + } + return from3(arg, encodingOrOffset, length2); + } + Buffer2.poolSize = 8192; + function from3(value, encodingOrOffset, length2) { + if (typeof value === "string") { + return fromString(value, encodingOrOffset); + } + if (ArrayBuffer.isView(value)) { + return fromArrayView(value); + } + if (value == null) { + throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value); + } + if (isInstance(value, ArrayBuffer) || value && isInstance(value.buffer, ArrayBuffer)) { + return fromArrayBuffer(value, encodingOrOffset, length2); + } + if (typeof SharedArrayBuffer !== "undefined" && (isInstance(value, SharedArrayBuffer) || value && isInstance(value.buffer, SharedArrayBuffer))) { + return fromArrayBuffer(value, encodingOrOffset, length2); + } + if (typeof value === "number") { + throw new TypeError('The "value" argument must not be of type number. Received type number'); + } + const valueOf = value.valueOf && value.valueOf(); + if (valueOf != null && valueOf !== value) { + return Buffer2.from(valueOf, encodingOrOffset, length2); + } + const b = fromObject(value); + if (b) + return b; + if (typeof Symbol !== "undefined" && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === "function") { + return Buffer2.from(value[Symbol.toPrimitive]("string"), encodingOrOffset, length2); + } + throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value); + } + Buffer2.from = function(value, encodingOrOffset, length2) { + return from3(value, encodingOrOffset, length2); + }; + Object.setPrototypeOf(Buffer2.prototype, Uint8Array.prototype); + Object.setPrototypeOf(Buffer2, Uint8Array); + function assertSize(size) { + if (typeof size !== "number") { + throw new TypeError('"size" argument must be of type number'); + } else if (size < 0) { + throw new RangeError('The value "' + size + '" is invalid for option "size"'); + } + } + function alloc(size, fill, encoding) { + assertSize(size); + if (size <= 0) { + return createBuffer(size); + } + if (fill !== void 0) { + return typeof encoding === "string" ? createBuffer(size).fill(fill, encoding) : createBuffer(size).fill(fill); + } + return createBuffer(size); + } + Buffer2.alloc = function(size, fill, encoding) { + return alloc(size, fill, encoding); + }; + function allocUnsafe(size) { + assertSize(size); + return createBuffer(size < 0 ? 0 : checked(size) | 0); + } + Buffer2.allocUnsafe = function(size) { + return allocUnsafe(size); + }; + Buffer2.allocUnsafeSlow = function(size) { + return allocUnsafe(size); + }; + function fromString(string3, encoding) { + if (typeof encoding !== "string" || encoding === "") { + encoding = "utf8"; + } + if (!Buffer2.isEncoding(encoding)) { + throw new TypeError("Unknown encoding: " + encoding); + } + const length2 = byteLength(string3, encoding) | 0; + let buf = createBuffer(length2); + const actual = buf.write(string3, encoding); + if (actual !== length2) { + buf = buf.slice(0, actual); + } + return buf; + } + function fromArrayLike(array) { + const length2 = array.length < 0 ? 0 : checked(array.length) | 0; + const buf = createBuffer(length2); + for (let i = 0; i < length2; i += 1) { + buf[i] = array[i] & 255; + } + return buf; + } + function fromArrayView(arrayView) { + if (isInstance(arrayView, Uint8Array)) { + const copy = new Uint8Array(arrayView); + return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength); + } + return fromArrayLike(arrayView); + } + function fromArrayBuffer(array, byteOffset, length2) { + if (byteOffset < 0 || array.byteLength < byteOffset) { + throw new RangeError('"offset" is outside of buffer bounds'); + } + if (array.byteLength < byteOffset + (length2 || 0)) { + throw new RangeError('"length" is outside of buffer bounds'); + } + let buf; + if (byteOffset === void 0 && length2 === void 0) { + buf = new Uint8Array(array); + } else if (length2 === void 0) { + buf = new Uint8Array(array, byteOffset); + } else { + buf = new Uint8Array(array, byteOffset, length2); + } + Object.setPrototypeOf(buf, Buffer2.prototype); + return buf; + } + function fromObject(obj) { + if (Buffer2.isBuffer(obj)) { + const len = checked(obj.length) | 0; + const buf = createBuffer(len); + if (buf.length === 0) { + return buf; + } + obj.copy(buf, 0, 0, len); + return buf; + } + if (obj.length !== void 0) { + if (typeof obj.length !== "number" || numberIsNaN(obj.length)) { + return createBuffer(0); + } + return fromArrayLike(obj); + } + if (obj.type === "Buffer" && Array.isArray(obj.data)) { + return fromArrayLike(obj.data); + } + } + function checked(length2) { + if (length2 >= K_MAX_LENGTH) { + throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + K_MAX_LENGTH.toString(16) + " bytes"); + } + return length2 | 0; + } + function SlowBuffer(length2) { + if (+length2 != length2) { + length2 = 0; + } + return Buffer2.alloc(+length2); + } + Buffer2.isBuffer = function isBuffer(b) { + return b != null && b._isBuffer === true && b !== Buffer2.prototype; + }; + Buffer2.compare = function compare(a, b) { + if (isInstance(a, Uint8Array)) + a = Buffer2.from(a, a.offset, a.byteLength); + if (isInstance(b, Uint8Array)) + b = Buffer2.from(b, b.offset, b.byteLength); + if (!Buffer2.isBuffer(a) || !Buffer2.isBuffer(b)) { + throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'); + } + if (a === b) + return 0; + let x = a.length; + let y = b.length; + for (let i = 0, len = Math.min(x, y); i < len; ++i) { + if (a[i] !== b[i]) { + x = a[i]; + y = b[i]; + break; + } + } + if (x < y) + return -1; + if (y < x) + return 1; + return 0; + }; + Buffer2.isEncoding = function isEncoding(encoding) { + switch (String(encoding).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 true; + default: + return false; + } + }; + Buffer2.concat = function concat(list, length2) { + if (!Array.isArray(list)) { + throw new TypeError('"list" argument must be an Array of Buffers'); + } + if (list.length === 0) { + return Buffer2.alloc(0); + } + let i; + if (length2 === void 0) { + length2 = 0; + for (i = 0; i < list.length; ++i) { + length2 += list[i].length; + } + } + const buffer = Buffer2.allocUnsafe(length2); + let pos = 0; + for (i = 0; i < list.length; ++i) { + let buf = list[i]; + if (isInstance(buf, Uint8Array)) { + if (pos + buf.length > buffer.length) { + if (!Buffer2.isBuffer(buf)) + buf = Buffer2.from(buf); + buf.copy(buffer, pos); + } else { + Uint8Array.prototype.set.call(buffer, buf, pos); + } + } else if (!Buffer2.isBuffer(buf)) { + throw new TypeError('"list" argument must be an Array of Buffers'); + } else { + buf.copy(buffer, pos); + } + pos += buf.length; + } + return buffer; + }; + function byteLength(string3, encoding) { + if (Buffer2.isBuffer(string3)) { + return string3.length; + } + if (ArrayBuffer.isView(string3) || isInstance(string3, ArrayBuffer)) { + return string3.byteLength; + } + if (typeof string3 !== "string") { + throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof string3); + } + const len = string3.length; + const mustMatch = arguments.length > 2 && arguments[2] === true; + if (!mustMatch && len === 0) + return 0; + let loweredCase = false; + for (; ; ) { + switch (encoding) { + case "ascii": + case "latin1": + case "binary": + return len; + case "utf8": + case "utf-8": + return utf8ToBytes(string3).length; + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return len * 2; + case "hex": + return len >>> 1; + case "base64": + return base64ToBytes(string3).length; + default: + if (loweredCase) { + return mustMatch ? -1 : utf8ToBytes(string3).length; + } + encoding = ("" + encoding).toLowerCase(); + loweredCase = true; + } + } + } + Buffer2.byteLength = byteLength; + function slowToString(encoding, start, end) { + let loweredCase = false; + if (start === void 0 || start < 0) { + start = 0; + } + if (start > this.length) { + return ""; + } + if (end === void 0 || end > this.length) { + end = this.length; + } + if (end <= 0) { + return ""; + } + end >>>= 0; + start >>>= 0; + if (end <= start) { + return ""; + } + if (!encoding) + encoding = "utf8"; + while (true) { + switch (encoding) { + case "hex": + return hexSlice(this, start, end); + case "utf8": + case "utf-8": + return utf8Slice(this, start, end); + case "ascii": + return asciiSlice(this, start, end); + case "latin1": + case "binary": + return latin1Slice(this, start, end); + case "base64": + return base64Slice(this, start, end); + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return utf16leSlice(this, start, end); + default: + if (loweredCase) + throw new TypeError("Unknown encoding: " + encoding); + encoding = (encoding + "").toLowerCase(); + loweredCase = true; + } + } + } + Buffer2.prototype._isBuffer = true; + function swap(b, n, m) { + const i = b[n]; + b[n] = b[m]; + b[m] = i; + } + Buffer2.prototype.swap16 = function swap16() { + const len = this.length; + if (len % 2 !== 0) { + throw new RangeError("Buffer size must be a multiple of 16-bits"); + } + for (let i = 0; i < len; i += 2) { + swap(this, i, i + 1); + } + return this; + }; + Buffer2.prototype.swap32 = function swap32() { + const len = this.length; + if (len % 4 !== 0) { + throw new RangeError("Buffer size must be a multiple of 32-bits"); + } + for (let i = 0; i < len; i += 4) { + swap(this, i, i + 3); + swap(this, i + 1, i + 2); + } + return this; + }; + Buffer2.prototype.swap64 = function swap64() { + const len = this.length; + if (len % 8 !== 0) { + throw new RangeError("Buffer size must be a multiple of 64-bits"); + } + for (let i = 0; i < len; i += 8) { + swap(this, i, i + 7); + swap(this, i + 1, i + 6); + swap(this, i + 2, i + 5); + swap(this, i + 3, i + 4); + } + return this; + }; + Buffer2.prototype.toString = function toString() { + const length2 = this.length; + if (length2 === 0) + return ""; + if (arguments.length === 0) + return utf8Slice(this, 0, length2); + return slowToString.apply(this, arguments); + }; + Buffer2.prototype.toLocaleString = Buffer2.prototype.toString; + Buffer2.prototype.equals = function equals3(b) { + if (!Buffer2.isBuffer(b)) + throw new TypeError("Argument must be a Buffer"); + if (this === b) + return true; + return Buffer2.compare(this, b) === 0; + }; + Buffer2.prototype.inspect = function inspect() { + let str = ""; + const max = exports.INSPECT_MAX_BYTES; + str = this.toString("hex", 0, max).replace(/(.{2})/g, "$1 ").trim(); + if (this.length > max) + str += " ... "; + return ""; + }; + if (customInspectSymbol) { + Buffer2.prototype[customInspectSymbol] = Buffer2.prototype.inspect; + } + Buffer2.prototype.compare = function compare(target, start, end, thisStart, thisEnd) { + if (isInstance(target, Uint8Array)) { + target = Buffer2.from(target, target.offset, target.byteLength); + } + if (!Buffer2.isBuffer(target)) { + throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof target); + } + if (start === void 0) { + start = 0; + } + if (end === void 0) { + end = target ? target.length : 0; + } + if (thisStart === void 0) { + thisStart = 0; + } + if (thisEnd === void 0) { + thisEnd = this.length; + } + if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { + throw new RangeError("out of range index"); + } + if (thisStart >= thisEnd && start >= end) { + return 0; + } + if (thisStart >= thisEnd) { + return -1; + } + if (start >= end) { + return 1; + } + start >>>= 0; + end >>>= 0; + thisStart >>>= 0; + thisEnd >>>= 0; + if (this === target) + return 0; + let x = thisEnd - thisStart; + let y = end - start; + const len = Math.min(x, y); + const thisCopy = this.slice(thisStart, thisEnd); + const targetCopy = target.slice(start, end); + for (let i = 0; i < len; ++i) { + if (thisCopy[i] !== targetCopy[i]) { + x = thisCopy[i]; + y = targetCopy[i]; + break; + } + } + if (x < y) + return -1; + if (y < x) + return 1; + return 0; + }; + function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) { + if (buffer.length === 0) + return -1; + if (typeof byteOffset === "string") { + encoding = byteOffset; + byteOffset = 0; + } else if (byteOffset > 2147483647) { + byteOffset = 2147483647; + } else if (byteOffset < -2147483648) { + byteOffset = -2147483648; + } + byteOffset = +byteOffset; + if (numberIsNaN(byteOffset)) { + byteOffset = dir ? 0 : buffer.length - 1; + } + if (byteOffset < 0) + byteOffset = buffer.length + byteOffset; + if (byteOffset >= buffer.length) { + if (dir) + return -1; + else + byteOffset = buffer.length - 1; + } else if (byteOffset < 0) { + if (dir) + byteOffset = 0; + else + return -1; + } + if (typeof val === "string") { + val = Buffer2.from(val, encoding); + } + if (Buffer2.isBuffer(val)) { + if (val.length === 0) { + return -1; + } + return arrayIndexOf(buffer, val, byteOffset, encoding, dir); + } else if (typeof val === "number") { + val = val & 255; + if (typeof Uint8Array.prototype.indexOf === "function") { + if (dir) { + return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset); + } else { + return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset); + } + } + return arrayIndexOf(buffer, [val], byteOffset, encoding, dir); + } + throw new TypeError("val must be string, number or Buffer"); + } + function arrayIndexOf(arr, val, byteOffset, encoding, dir) { + let indexSize = 1; + let arrLength = arr.length; + let valLength = val.length; + if (encoding !== void 0) { + encoding = String(encoding).toLowerCase(); + if (encoding === "ucs2" || encoding === "ucs-2" || encoding === "utf16le" || encoding === "utf-16le") { + if (arr.length < 2 || val.length < 2) { + return -1; + } + indexSize = 2; + arrLength /= 2; + valLength /= 2; + byteOffset /= 2; + } + } + function read2(buf, i2) { + if (indexSize === 1) { + return buf[i2]; + } else { + return buf.readUInt16BE(i2 * indexSize); + } + } + let i; + if (dir) { + let foundIndex = -1; + for (i = byteOffset; i < arrLength; i++) { + if (read2(arr, i) === read2(val, foundIndex === -1 ? 0 : i - foundIndex)) { + if (foundIndex === -1) + foundIndex = i; + if (i - foundIndex + 1 === valLength) + return foundIndex * indexSize; + } else { + if (foundIndex !== -1) + i -= i - foundIndex; + foundIndex = -1; + } + } + } else { + if (byteOffset + valLength > arrLength) + byteOffset = arrLength - valLength; + for (i = byteOffset; i >= 0; i--) { + let found = true; + for (let j = 0; j < valLength; j++) { + if (read2(arr, i + j) !== read2(val, j)) { + found = false; + break; + } + } + if (found) + return i; + } + } + return -1; + } + Buffer2.prototype.includes = function includes(val, byteOffset, encoding) { + return this.indexOf(val, byteOffset, encoding) !== -1; + }; + Buffer2.prototype.indexOf = function indexOf(val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, true); + }; + Buffer2.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, false); + }; + function hexWrite(buf, string3, offset, length2) { + offset = Number(offset) || 0; + const remaining = buf.length - offset; + if (!length2) { + length2 = remaining; + } else { + length2 = Number(length2); + if (length2 > remaining) { + length2 = remaining; + } + } + const strLen = string3.length; + if (length2 > strLen / 2) { + length2 = strLen / 2; + } + let i; + for (i = 0; i < length2; ++i) { + const parsed = parseInt(string3.substr(i * 2, 2), 16); + if (numberIsNaN(parsed)) + return i; + buf[offset + i] = parsed; + } + return i; + } + function utf8Write(buf, string3, offset, length2) { + return blitBuffer(utf8ToBytes(string3, buf.length - offset), buf, offset, length2); + } + function asciiWrite(buf, string3, offset, length2) { + return blitBuffer(asciiToBytes(string3), buf, offset, length2); + } + function base64Write(buf, string3, offset, length2) { + return blitBuffer(base64ToBytes(string3), buf, offset, length2); + } + function ucs2Write(buf, string3, offset, length2) { + return blitBuffer(utf16leToBytes(string3, buf.length - offset), buf, offset, length2); + } + Buffer2.prototype.write = function write(string3, offset, length2, encoding) { + if (offset === void 0) { + encoding = "utf8"; + length2 = this.length; + offset = 0; + } else if (length2 === void 0 && typeof offset === "string") { + encoding = offset; + length2 = this.length; + offset = 0; + } else if (isFinite(offset)) { + offset = offset >>> 0; + if (isFinite(length2)) { + length2 = length2 >>> 0; + if (encoding === void 0) + encoding = "utf8"; + } else { + encoding = length2; + length2 = void 0; + } + } else { + throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported"); + } + const remaining = this.length - offset; + if (length2 === void 0 || length2 > remaining) + length2 = remaining; + if (string3.length > 0 && (length2 < 0 || offset < 0) || offset > this.length) { + throw new RangeError("Attempt to write outside buffer bounds"); + } + if (!encoding) + encoding = "utf8"; + let loweredCase = false; + for (; ; ) { + switch (encoding) { + case "hex": + return hexWrite(this, string3, offset, length2); + case "utf8": + case "utf-8": + return utf8Write(this, string3, offset, length2); + case "ascii": + case "latin1": + case "binary": + return asciiWrite(this, string3, offset, length2); + case "base64": + return base64Write(this, string3, offset, length2); + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return ucs2Write(this, string3, offset, length2); + default: + if (loweredCase) + throw new TypeError("Unknown encoding: " + encoding); + encoding = ("" + encoding).toLowerCase(); + loweredCase = true; + } + } + }; + Buffer2.prototype.toJSON = function toJSON() { + return { + type: "Buffer", + data: Array.prototype.slice.call(this._arr || this, 0) + }; + }; + function base64Slice(buf, start, end) { + if (start === 0 && end === buf.length) { + return base64.fromByteArray(buf); + } else { + return base64.fromByteArray(buf.slice(start, end)); + } + } + function utf8Slice(buf, start, end) { + end = Math.min(buf.length, end); + const res = []; + let i = start; + while (i < end) { + const firstByte = buf[i]; + let codePoint = null; + let bytesPerSequence = firstByte > 239 ? 4 : firstByte > 223 ? 3 : firstByte > 191 ? 2 : 1; + if (i + bytesPerSequence <= end) { + let secondByte, thirdByte, fourthByte, tempCodePoint; + switch (bytesPerSequence) { + case 1: + if (firstByte < 128) { + codePoint = firstByte; + } + break; + case 2: + secondByte = buf[i + 1]; + if ((secondByte & 192) === 128) { + tempCodePoint = (firstByte & 31) << 6 | secondByte & 63; + if (tempCodePoint > 127) { + codePoint = tempCodePoint; + } + } + break; + case 3: + secondByte = buf[i + 1]; + thirdByte = buf[i + 2]; + if ((secondByte & 192) === 128 && (thirdByte & 192) === 128) { + tempCodePoint = (firstByte & 15) << 12 | (secondByte & 63) << 6 | thirdByte & 63; + if (tempCodePoint > 2047 && (tempCodePoint < 55296 || tempCodePoint > 57343)) { + codePoint = tempCodePoint; + } + } + break; + case 4: + secondByte = buf[i + 1]; + thirdByte = buf[i + 2]; + fourthByte = buf[i + 3]; + if ((secondByte & 192) === 128 && (thirdByte & 192) === 128 && (fourthByte & 192) === 128) { + tempCodePoint = (firstByte & 15) << 18 | (secondByte & 63) << 12 | (thirdByte & 63) << 6 | fourthByte & 63; + if (tempCodePoint > 65535 && tempCodePoint < 1114112) { + codePoint = tempCodePoint; + } + } + } + } + if (codePoint === null) { + codePoint = 65533; + bytesPerSequence = 1; + } else if (codePoint > 65535) { + codePoint -= 65536; + res.push(codePoint >>> 10 & 1023 | 55296); + codePoint = 56320 | codePoint & 1023; + } + res.push(codePoint); + i += bytesPerSequence; + } + return decodeCodePointsArray(res); + } + var MAX_ARGUMENTS_LENGTH = 4096; + function decodeCodePointsArray(codePoints) { + const len = codePoints.length; + if (len <= MAX_ARGUMENTS_LENGTH) { + return String.fromCharCode.apply(String, codePoints); + } + let res = ""; + let i = 0; + while (i < len) { + res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)); + } + return res; + } + function asciiSlice(buf, start, end) { + let ret = ""; + end = Math.min(buf.length, end); + for (let i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i] & 127); + } + return ret; + } + function latin1Slice(buf, start, end) { + let ret = ""; + end = Math.min(buf.length, end); + for (let i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i]); + } + return ret; + } + function hexSlice(buf, start, end) { + const len = buf.length; + if (!start || start < 0) + start = 0; + if (!end || end < 0 || end > len) + end = len; + let out = ""; + for (let i = start; i < end; ++i) { + out += hexSliceLookupTable[buf[i]]; + } + return out; + } + function utf16leSlice(buf, start, end) { + const bytes = buf.slice(start, end); + let res = ""; + for (let i = 0; i < bytes.length - 1; i += 2) { + res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256); + } + return res; + } + Buffer2.prototype.slice = function slice(start, end) { + const len = this.length; + start = ~~start; + end = end === void 0 ? len : ~~end; + if (start < 0) { + start += len; + if (start < 0) + start = 0; + } else if (start > len) { + start = len; + } + if (end < 0) { + end += len; + if (end < 0) + end = 0; + } else if (end > len) { + end = len; + } + if (end < start) + end = start; + const newBuf = this.subarray(start, end); + Object.setPrototypeOf(newBuf, Buffer2.prototype); + return newBuf; + }; + function checkOffset(offset, ext, length2) { + if (offset % 1 !== 0 || offset < 0) + throw new RangeError("offset is not uint"); + if (offset + ext > length2) + throw new RangeError("Trying to access beyond buffer length"); + } + Buffer2.prototype.readUintLE = Buffer2.prototype.readUIntLE = function readUIntLE(offset, byteLength2, noAssert) { + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) + checkOffset(offset, byteLength2, this.length); + let val = this[offset]; + let mul = 1; + let i = 0; + while (++i < byteLength2 && (mul *= 256)) { + val += this[offset + i] * mul; + } + return val; + }; + Buffer2.prototype.readUintBE = Buffer2.prototype.readUIntBE = function readUIntBE(offset, byteLength2, noAssert) { + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) { + checkOffset(offset, byteLength2, this.length); + } + let val = this[offset + --byteLength2]; + let mul = 1; + while (byteLength2 > 0 && (mul *= 256)) { + val += this[offset + --byteLength2] * mul; + } + return val; + }; + Buffer2.prototype.readUint8 = Buffer2.prototype.readUInt8 = function readUInt8(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 1, this.length); + return this[offset]; + }; + Buffer2.prototype.readUint16LE = Buffer2.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 2, this.length); + return this[offset] | this[offset + 1] << 8; + }; + Buffer2.prototype.readUint16BE = Buffer2.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 2, this.length); + return this[offset] << 8 | this[offset + 1]; + }; + Buffer2.prototype.readUint32LE = Buffer2.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 16777216; + }; + Buffer2.prototype.readUint32BE = Buffer2.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return this[offset] * 16777216 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]); + }; + Buffer2.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE(offset) { + offset = offset >>> 0; + validateNumber(offset, "offset"); + const first = this[offset]; + const last = this[offset + 7]; + if (first === void 0 || last === void 0) { + boundsError(offset, this.length - 8); + } + const lo = first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24; + const hi = this[++offset] + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + last * 2 ** 24; + return BigInt(lo) + (BigInt(hi) << BigInt(32)); + }); + Buffer2.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE(offset) { + offset = offset >>> 0; + validateNumber(offset, "offset"); + const first = this[offset]; + const last = this[offset + 7]; + if (first === void 0 || last === void 0) { + boundsError(offset, this.length - 8); + } + const hi = first * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset]; + const lo = this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last; + return (BigInt(hi) << BigInt(32)) + BigInt(lo); + }); + Buffer2.prototype.readIntLE = function readIntLE(offset, byteLength2, noAssert) { + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) + checkOffset(offset, byteLength2, this.length); + let val = this[offset]; + let mul = 1; + let i = 0; + while (++i < byteLength2 && (mul *= 256)) { + val += this[offset + i] * mul; + } + mul *= 128; + if (val >= mul) + val -= Math.pow(2, 8 * byteLength2); + return val; + }; + Buffer2.prototype.readIntBE = function readIntBE(offset, byteLength2, noAssert) { + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) + checkOffset(offset, byteLength2, this.length); + let i = byteLength2; + let mul = 1; + let val = this[offset + --i]; + while (i > 0 && (mul *= 256)) { + val += this[offset + --i] * mul; + } + mul *= 128; + if (val >= mul) + val -= Math.pow(2, 8 * byteLength2); + return val; + }; + Buffer2.prototype.readInt8 = function readInt8(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 1, this.length); + if (!(this[offset] & 128)) + return this[offset]; + return (255 - this[offset] + 1) * -1; + }; + Buffer2.prototype.readInt16LE = function readInt16LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 2, this.length); + const val = this[offset] | this[offset + 1] << 8; + return val & 32768 ? val | 4294901760 : val; + }; + Buffer2.prototype.readInt16BE = function readInt16BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 2, this.length); + const val = this[offset + 1] | this[offset] << 8; + return val & 32768 ? val | 4294901760 : val; + }; + Buffer2.prototype.readInt32LE = function readInt32LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24; + }; + Buffer2.prototype.readInt32BE = function readInt32BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]; + }; + Buffer2.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE(offset) { + offset = offset >>> 0; + validateNumber(offset, "offset"); + const first = this[offset]; + const last = this[offset + 7]; + if (first === void 0 || last === void 0) { + boundsError(offset, this.length - 8); + } + const val = this[offset + 4] + this[offset + 5] * 2 ** 8 + this[offset + 6] * 2 ** 16 + (last << 24); + return (BigInt(val) << BigInt(32)) + BigInt(first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24); + }); + Buffer2.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE(offset) { + offset = offset >>> 0; + validateNumber(offset, "offset"); + const first = this[offset]; + const last = this[offset + 7]; + if (first === void 0 || last === void 0) { + boundsError(offset, this.length - 8); + } + const val = (first << 24) + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset]; + return (BigInt(val) << BigInt(32)) + BigInt(this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last); + }); + Buffer2.prototype.readFloatLE = function readFloatLE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return ieee754.read(this, offset, true, 23, 4); + }; + Buffer2.prototype.readFloatBE = function readFloatBE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return ieee754.read(this, offset, false, 23, 4); + }; + Buffer2.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 8, this.length); + return ieee754.read(this, offset, true, 52, 8); + }; + Buffer2.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 8, this.length); + return ieee754.read(this, offset, false, 52, 8); + }; + function checkInt(buf, value, offset, ext, max, min) { + if (!Buffer2.isBuffer(buf)) + throw new TypeError('"buffer" argument must be a Buffer instance'); + if (value > max || value < min) + throw new RangeError('"value" argument is out of bounds'); + if (offset + ext > buf.length) + throw new RangeError("Index out of range"); + } + Buffer2.prototype.writeUintLE = Buffer2.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength2, noAssert) { + value = +value; + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) { + const maxBytes = Math.pow(2, 8 * byteLength2) - 1; + checkInt(this, value, offset, byteLength2, maxBytes, 0); + } + let mul = 1; + let i = 0; + this[offset] = value & 255; + while (++i < byteLength2 && (mul *= 256)) { + this[offset + i] = value / mul & 255; + } + return offset + byteLength2; + }; + Buffer2.prototype.writeUintBE = Buffer2.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength2, noAssert) { + value = +value; + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) { + const maxBytes = Math.pow(2, 8 * byteLength2) - 1; + checkInt(this, value, offset, byteLength2, maxBytes, 0); + } + let i = byteLength2 - 1; + let mul = 1; + this[offset + i] = value & 255; + while (--i >= 0 && (mul *= 256)) { + this[offset + i] = value / mul & 255; + } + return offset + byteLength2; + }; + Buffer2.prototype.writeUint8 = Buffer2.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 1, 255, 0); + this[offset] = value & 255; + return offset + 1; + }; + Buffer2.prototype.writeUint16LE = Buffer2.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 2, 65535, 0); + this[offset] = value & 255; + this[offset + 1] = value >>> 8; + return offset + 2; + }; + Buffer2.prototype.writeUint16BE = Buffer2.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 2, 65535, 0); + this[offset] = value >>> 8; + this[offset + 1] = value & 255; + return offset + 2; + }; + Buffer2.prototype.writeUint32LE = Buffer2.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 4, 4294967295, 0); + this[offset + 3] = value >>> 24; + this[offset + 2] = value >>> 16; + this[offset + 1] = value >>> 8; + this[offset] = value & 255; + return offset + 4; + }; + Buffer2.prototype.writeUint32BE = Buffer2.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 4, 4294967295, 0); + this[offset] = value >>> 24; + this[offset + 1] = value >>> 16; + this[offset + 2] = value >>> 8; + this[offset + 3] = value & 255; + return offset + 4; + }; + function wrtBigUInt64LE(buf, value, offset, min, max) { + checkIntBI(value, min, max, buf, offset, 7); + let lo = Number(value & BigInt(4294967295)); + buf[offset++] = lo; + lo = lo >> 8; + buf[offset++] = lo; + lo = lo >> 8; + buf[offset++] = lo; + lo = lo >> 8; + buf[offset++] = lo; + let hi = Number(value >> BigInt(32) & BigInt(4294967295)); + buf[offset++] = hi; + hi = hi >> 8; + buf[offset++] = hi; + hi = hi >> 8; + buf[offset++] = hi; + hi = hi >> 8; + buf[offset++] = hi; + return offset; + } + function wrtBigUInt64BE(buf, value, offset, min, max) { + checkIntBI(value, min, max, buf, offset, 7); + let lo = Number(value & BigInt(4294967295)); + buf[offset + 7] = lo; + lo = lo >> 8; + buf[offset + 6] = lo; + lo = lo >> 8; + buf[offset + 5] = lo; + lo = lo >> 8; + buf[offset + 4] = lo; + let hi = Number(value >> BigInt(32) & BigInt(4294967295)); + buf[offset + 3] = hi; + hi = hi >> 8; + buf[offset + 2] = hi; + hi = hi >> 8; + buf[offset + 1] = hi; + hi = hi >> 8; + buf[offset] = hi; + return offset + 8; + } + Buffer2.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE(value, offset = 0) { + return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt("0xffffffffffffffff")); + }); + Buffer2.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE(value, offset = 0) { + return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt("0xffffffffffffffff")); + }); + Buffer2.prototype.writeIntLE = function writeIntLE(value, offset, byteLength2, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + const limit = Math.pow(2, 8 * byteLength2 - 1); + checkInt(this, value, offset, byteLength2, limit - 1, -limit); + } + let i = 0; + let mul = 1; + let sub = 0; + this[offset] = value & 255; + while (++i < byteLength2 && (mul *= 256)) { + if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { + sub = 1; + } + this[offset + i] = (value / mul >> 0) - sub & 255; + } + return offset + byteLength2; + }; + Buffer2.prototype.writeIntBE = function writeIntBE(value, offset, byteLength2, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + const limit = Math.pow(2, 8 * byteLength2 - 1); + checkInt(this, value, offset, byteLength2, limit - 1, -limit); + } + let i = byteLength2 - 1; + let mul = 1; + let sub = 0; + this[offset + i] = value & 255; + while (--i >= 0 && (mul *= 256)) { + if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { + sub = 1; + } + this[offset + i] = (value / mul >> 0) - sub & 255; + } + return offset + byteLength2; + }; + Buffer2.prototype.writeInt8 = function writeInt8(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 1, 127, -128); + if (value < 0) + value = 255 + value + 1; + this[offset] = value & 255; + return offset + 1; + }; + Buffer2.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 2, 32767, -32768); + this[offset] = value & 255; + this[offset + 1] = value >>> 8; + return offset + 2; + }; + Buffer2.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 2, 32767, -32768); + this[offset] = value >>> 8; + this[offset + 1] = value & 255; + return offset + 2; + }; + Buffer2.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 4, 2147483647, -2147483648); + this[offset] = value & 255; + this[offset + 1] = value >>> 8; + this[offset + 2] = value >>> 16; + this[offset + 3] = value >>> 24; + return offset + 4; + }; + Buffer2.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 4, 2147483647, -2147483648); + if (value < 0) + value = 4294967295 + value + 1; + this[offset] = value >>> 24; + this[offset + 1] = value >>> 16; + this[offset + 2] = value >>> 8; + this[offset + 3] = value & 255; + return offset + 4; + }; + Buffer2.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE(value, offset = 0) { + return wrtBigUInt64LE(this, value, offset, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff")); + }); + Buffer2.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE(value, offset = 0) { + return wrtBigUInt64BE(this, value, offset, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff")); + }); + function checkIEEE754(buf, value, offset, ext, max, min) { + if (offset + ext > buf.length) + throw new RangeError("Index out of range"); + if (offset < 0) + throw new RangeError("Index out of range"); + } + function writeFloat(buf, value, offset, littleEndian, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + checkIEEE754(buf, value, offset, 4, 34028234663852886e22, -34028234663852886e22); + } + ieee754.write(buf, value, offset, littleEndian, 23, 4); + return offset + 4; + } + Buffer2.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) { + return writeFloat(this, value, offset, true, noAssert); + }; + Buffer2.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) { + return writeFloat(this, value, offset, false, noAssert); + }; + function writeDouble(buf, value, offset, littleEndian, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + checkIEEE754(buf, value, offset, 8, 17976931348623157e292, -17976931348623157e292); + } + ieee754.write(buf, value, offset, littleEndian, 52, 8); + return offset + 8; + } + Buffer2.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) { + return writeDouble(this, value, offset, true, noAssert); + }; + Buffer2.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) { + return writeDouble(this, value, offset, false, noAssert); + }; + Buffer2.prototype.copy = function copy(target, targetStart, start, end) { + if (!Buffer2.isBuffer(target)) + throw new TypeError("argument should be a Buffer"); + if (!start) + start = 0; + if (!end && end !== 0) + end = this.length; + if (targetStart >= target.length) + targetStart = target.length; + if (!targetStart) + targetStart = 0; + if (end > 0 && end < start) + end = start; + if (end === start) + return 0; + if (target.length === 0 || this.length === 0) + return 0; + if (targetStart < 0) { + throw new RangeError("targetStart out of bounds"); + } + if (start < 0 || start >= this.length) + throw new RangeError("Index out of range"); + if (end < 0) + throw new RangeError("sourceEnd out of bounds"); + if (end > this.length) + end = this.length; + if (target.length - targetStart < end - start) { + end = target.length - targetStart + start; + } + const len = end - start; + if (this === target && typeof Uint8Array.prototype.copyWithin === "function") { + this.copyWithin(targetStart, start, end); + } else { + Uint8Array.prototype.set.call(target, this.subarray(start, end), targetStart); + } + return len; + }; + Buffer2.prototype.fill = function fill(val, start, end, encoding) { + if (typeof val === "string") { + if (typeof start === "string") { + encoding = start; + start = 0; + end = this.length; + } else if (typeof end === "string") { + encoding = end; + end = this.length; + } + if (encoding !== void 0 && typeof encoding !== "string") { + throw new TypeError("encoding must be a string"); + } + if (typeof encoding === "string" && !Buffer2.isEncoding(encoding)) { + throw new TypeError("Unknown encoding: " + encoding); + } + if (val.length === 1) { + const code = val.charCodeAt(0); + if (encoding === "utf8" && code < 128 || encoding === "latin1") { + val = code; + } + } + } else if (typeof val === "number") { + val = val & 255; + } else if (typeof val === "boolean") { + val = Number(val); + } + if (start < 0 || this.length < start || this.length < end) { + throw new RangeError("Out of range index"); + } + if (end <= start) { + return this; + } + start = start >>> 0; + end = end === void 0 ? this.length : end >>> 0; + if (!val) + val = 0; + let i; + if (typeof val === "number") { + for (i = start; i < end; ++i) { + this[i] = val; + } + } else { + const bytes = Buffer2.isBuffer(val) ? val : Buffer2.from(val, encoding); + const len = bytes.length; + if (len === 0) { + throw new TypeError('The value "' + val + '" is invalid for argument "value"'); + } + for (i = 0; i < end - start; ++i) { + this[i + start] = bytes[i % len]; + } + } + return this; + }; + var errors = {}; + function E(sym, getMessage, Base) { + errors[sym] = class NodeError extends Base { + constructor() { + super(); + Object.defineProperty(this, "message", { + value: getMessage.apply(this, arguments), + writable: true, + configurable: true + }); + this.name = `${this.name} [${sym}]`; + this.stack; + delete this.name; + } + get code() { + return sym; + } + set code(value) { + Object.defineProperty(this, "code", { + configurable: true, + enumerable: true, + value, + writable: true + }); + } + toString() { + return `${this.name} [${sym}]: ${this.message}`; + } + }; + } + E("ERR_BUFFER_OUT_OF_BOUNDS", function(name) { + if (name) { + return `${name} is outside of buffer bounds`; + } + return "Attempt to access memory outside buffer bounds"; + }, RangeError); + E("ERR_INVALID_ARG_TYPE", function(name, actual) { + return `The "${name}" argument must be of type number. Received type ${typeof actual}`; + }, TypeError); + E("ERR_OUT_OF_RANGE", function(str, range, input) { + let msg = `The value of "${str}" is out of range.`; + let received = input; + if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) { + received = addNumericalSeparator(String(input)); + } else if (typeof input === "bigint") { + received = String(input); + if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) { + received = addNumericalSeparator(received); + } + received += "n"; + } + msg += ` It must be ${range}. Received ${received}`; + return msg; + }, RangeError); + function addNumericalSeparator(val) { + let res = ""; + let i = val.length; + const start = val[0] === "-" ? 1 : 0; + for (; i >= start + 4; i -= 3) { + res = `_${val.slice(i - 3, i)}${res}`; + } + return `${val.slice(0, i)}${res}`; + } + function checkBounds(buf, offset, byteLength2) { + validateNumber(offset, "offset"); + if (buf[offset] === void 0 || buf[offset + byteLength2] === void 0) { + boundsError(offset, buf.length - (byteLength2 + 1)); + } + } + function checkIntBI(value, min, max, buf, offset, byteLength2) { + if (value > max || value < min) { + const n = typeof min === "bigint" ? "n" : ""; + let range; + if (byteLength2 > 3) { + if (min === 0 || min === BigInt(0)) { + range = `>= 0${n} and < 2${n} ** ${(byteLength2 + 1) * 8}${n}`; + } else { + range = `>= -(2${n} ** ${(byteLength2 + 1) * 8 - 1}${n}) and < 2 ** ${(byteLength2 + 1) * 8 - 1}${n}`; + } + } else { + range = `>= ${min}${n} and <= ${max}${n}`; + } + throw new errors.ERR_OUT_OF_RANGE("value", range, value); + } + checkBounds(buf, offset, byteLength2); + } + function validateNumber(value, name) { + if (typeof value !== "number") { + throw new errors.ERR_INVALID_ARG_TYPE(name, "number", value); + } + } + function boundsError(value, length2, type) { + if (Math.floor(value) !== value) { + validateNumber(value, type); + throw new errors.ERR_OUT_OF_RANGE(type || "offset", "an integer", value); + } + if (length2 < 0) { + throw new errors.ERR_BUFFER_OUT_OF_BOUNDS(); + } + throw new errors.ERR_OUT_OF_RANGE(type || "offset", `>= ${type ? 1 : 0} and <= ${length2}`, value); + } + var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g; + function base64clean(str) { + str = str.split("=")[0]; + str = str.trim().replace(INVALID_BASE64_RE, ""); + if (str.length < 2) + return ""; + while (str.length % 4 !== 0) { + str = str + "="; + } + return str; + } + function utf8ToBytes(string3, units) { + units = units || Infinity; + let codePoint; + const length2 = string3.length; + let leadSurrogate = null; + const bytes = []; + for (let i = 0; i < length2; ++i) { + codePoint = string3.charCodeAt(i); + if (codePoint > 55295 && codePoint < 57344) { + if (!leadSurrogate) { + if (codePoint > 56319) { + if ((units -= 3) > -1) + bytes.push(239, 191, 189); + continue; + } else if (i + 1 === length2) { + if ((units -= 3) > -1) + bytes.push(239, 191, 189); + continue; + } + leadSurrogate = codePoint; + continue; + } + if (codePoint < 56320) { + if ((units -= 3) > -1) + bytes.push(239, 191, 189); + leadSurrogate = codePoint; + continue; + } + codePoint = (leadSurrogate - 55296 << 10 | codePoint - 56320) + 65536; + } else if (leadSurrogate) { + if ((units -= 3) > -1) + bytes.push(239, 191, 189); + } + leadSurrogate = null; + if (codePoint < 128) { + if ((units -= 1) < 0) + break; + bytes.push(codePoint); + } else if (codePoint < 2048) { + if ((units -= 2) < 0) + break; + bytes.push(codePoint >> 6 | 192, codePoint & 63 | 128); + } else if (codePoint < 65536) { + if ((units -= 3) < 0) + break; + bytes.push(codePoint >> 12 | 224, codePoint >> 6 & 63 | 128, codePoint & 63 | 128); + } else if (codePoint < 1114112) { + if ((units -= 4) < 0) + break; + bytes.push(codePoint >> 18 | 240, codePoint >> 12 & 63 | 128, codePoint >> 6 & 63 | 128, codePoint & 63 | 128); + } else { + throw new Error("Invalid code point"); + } + } + return bytes; + } + function asciiToBytes(str) { + const byteArray = []; + for (let i = 0; i < str.length; ++i) { + byteArray.push(str.charCodeAt(i) & 255); + } + return byteArray; + } + function utf16leToBytes(str, units) { + let c, hi, lo; + const byteArray = []; + for (let i = 0; i < str.length; ++i) { + if ((units -= 2) < 0) + break; + c = str.charCodeAt(i); + hi = c >> 8; + lo = c % 256; + byteArray.push(lo); + byteArray.push(hi); + } + return byteArray; + } + function base64ToBytes(str) { + return base64.toByteArray(base64clean(str)); + } + function blitBuffer(src2, dst, offset, length2) { + let i; + for (i = 0; i < length2; ++i) { + if (i + offset >= dst.length || i >= src2.length) + break; + dst[i + offset] = src2[i]; + } + return i; + } + function isInstance(obj, type) { + return obj instanceof type || obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type.name; + } + function numberIsNaN(obj) { + return obj !== obj; + } + var hexSliceLookupTable = function() { + const alphabet = "0123456789abcdef"; + const table = new Array(256); + for (let i = 0; i < 16; ++i) { + const i16 = i * 16; + for (let j = 0; j < 16; ++j) { + table[i16 + j] = alphabet[i] + alphabet[j]; + } + } + return table; + }(); + function defineBigIntMethod(fn) { + return typeof BigInt === "undefined" ? BufferBigIntNotDefined : fn; + } + function BufferBigIntNotDefined() { + throw new Error("BigInt not supported"); + } + } + }); + + // (disabled):crypto + var require_crypto = __commonJS({ + "(disabled):crypto"() { + } + }); + + // node_modules/tweetnacl/nacl-fast.js + var require_nacl_fast = __commonJS({ + "node_modules/tweetnacl/nacl-fast.js"(exports, module) { + (function(nacl2) { + "use strict"; + var gf = function(init) { + var i, r = new Float64Array(16); + if (init) + for (i = 0; i < init.length; i++) + r[i] = init[i]; + return r; + }; + var randombytes = function() { + throw new Error("no PRNG"); + }; + var _0 = new Uint8Array(16); + var _9 = new Uint8Array(32); + _9[0] = 9; + var gf0 = gf(), gf1 = gf([1]), _121665 = gf([56129, 1]), D = gf([30883, 4953, 19914, 30187, 55467, 16705, 2637, 112, 59544, 30585, 16505, 36039, 65139, 11119, 27886, 20995]), D2 = gf([61785, 9906, 39828, 60374, 45398, 33411, 5274, 224, 53552, 61171, 33010, 6542, 64743, 22239, 55772, 9222]), X = gf([54554, 36645, 11616, 51542, 42930, 38181, 51040, 26924, 56412, 64982, 57905, 49316, 21502, 52590, 14035, 8553]), Y = gf([26200, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214]), I = gf([41136, 18958, 6951, 50414, 58488, 44335, 6150, 12099, 55207, 15867, 153, 11085, 57099, 20417, 9344, 11139]); + function ts64(x, i, h, l) { + x[i] = h >> 24 & 255; + x[i + 1] = h >> 16 & 255; + x[i + 2] = h >> 8 & 255; + x[i + 3] = h & 255; + x[i + 4] = l >> 24 & 255; + x[i + 5] = l >> 16 & 255; + x[i + 6] = l >> 8 & 255; + x[i + 7] = l & 255; + } + function vn(x, xi, y, yi, n) { + var i, d = 0; + for (i = 0; i < n; i++) + d |= x[xi + i] ^ y[yi + i]; + return (1 & d - 1 >>> 8) - 1; + } + function crypto_verify_16(x, xi, y, yi) { + return vn(x, xi, y, yi, 16); + } + function crypto_verify_32(x, xi, y, yi) { + return vn(x, xi, y, yi, 32); + } + function core_salsa20(o, p, k, c) { + var j0 = c[0] & 255 | (c[1] & 255) << 8 | (c[2] & 255) << 16 | (c[3] & 255) << 24, j1 = k[0] & 255 | (k[1] & 255) << 8 | (k[2] & 255) << 16 | (k[3] & 255) << 24, j2 = k[4] & 255 | (k[5] & 255) << 8 | (k[6] & 255) << 16 | (k[7] & 255) << 24, j3 = k[8] & 255 | (k[9] & 255) << 8 | (k[10] & 255) << 16 | (k[11] & 255) << 24, j4 = k[12] & 255 | (k[13] & 255) << 8 | (k[14] & 255) << 16 | (k[15] & 255) << 24, j5 = c[4] & 255 | (c[5] & 255) << 8 | (c[6] & 255) << 16 | (c[7] & 255) << 24, j6 = p[0] & 255 | (p[1] & 255) << 8 | (p[2] & 255) << 16 | (p[3] & 255) << 24, j7 = p[4] & 255 | (p[5] & 255) << 8 | (p[6] & 255) << 16 | (p[7] & 255) << 24, j8 = p[8] & 255 | (p[9] & 255) << 8 | (p[10] & 255) << 16 | (p[11] & 255) << 24, j9 = p[12] & 255 | (p[13] & 255) << 8 | (p[14] & 255) << 16 | (p[15] & 255) << 24, j10 = c[8] & 255 | (c[9] & 255) << 8 | (c[10] & 255) << 16 | (c[11] & 255) << 24, j11 = k[16] & 255 | (k[17] & 255) << 8 | (k[18] & 255) << 16 | (k[19] & 255) << 24, j12 = k[20] & 255 | (k[21] & 255) << 8 | (k[22] & 255) << 16 | (k[23] & 255) << 24, j13 = k[24] & 255 | (k[25] & 255) << 8 | (k[26] & 255) << 16 | (k[27] & 255) << 24, j14 = k[28] & 255 | (k[29] & 255) << 8 | (k[30] & 255) << 16 | (k[31] & 255) << 24, j15 = c[12] & 255 | (c[13] & 255) << 8 | (c[14] & 255) << 16 | (c[15] & 255) << 24; + var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7, x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14, x15 = j15, u; + for (var i = 0; i < 20; i += 2) { + u = x0 + x12 | 0; + x4 ^= u << 7 | u >>> 32 - 7; + u = x4 + x0 | 0; + x8 ^= u << 9 | u >>> 32 - 9; + u = x8 + x4 | 0; + x12 ^= u << 13 | u >>> 32 - 13; + u = x12 + x8 | 0; + x0 ^= u << 18 | u >>> 32 - 18; + u = x5 + x1 | 0; + x9 ^= u << 7 | u >>> 32 - 7; + u = x9 + x5 | 0; + x13 ^= u << 9 | u >>> 32 - 9; + u = x13 + x9 | 0; + x1 ^= u << 13 | u >>> 32 - 13; + u = x1 + x13 | 0; + x5 ^= u << 18 | u >>> 32 - 18; + u = x10 + x6 | 0; + x14 ^= u << 7 | u >>> 32 - 7; + u = x14 + x10 | 0; + x2 ^= u << 9 | u >>> 32 - 9; + u = x2 + x14 | 0; + x6 ^= u << 13 | u >>> 32 - 13; + u = x6 + x2 | 0; + x10 ^= u << 18 | u >>> 32 - 18; + u = x15 + x11 | 0; + x3 ^= u << 7 | u >>> 32 - 7; + u = x3 + x15 | 0; + x7 ^= u << 9 | u >>> 32 - 9; + u = x7 + x3 | 0; + x11 ^= u << 13 | u >>> 32 - 13; + u = x11 + x7 | 0; + x15 ^= u << 18 | u >>> 32 - 18; + u = x0 + x3 | 0; + x1 ^= u << 7 | u >>> 32 - 7; + u = x1 + x0 | 0; + x2 ^= u << 9 | u >>> 32 - 9; + u = x2 + x1 | 0; + x3 ^= u << 13 | u >>> 32 - 13; + u = x3 + x2 | 0; + x0 ^= u << 18 | u >>> 32 - 18; + u = x5 + x4 | 0; + x6 ^= u << 7 | u >>> 32 - 7; + u = x6 + x5 | 0; + x7 ^= u << 9 | u >>> 32 - 9; + u = x7 + x6 | 0; + x4 ^= u << 13 | u >>> 32 - 13; + u = x4 + x7 | 0; + x5 ^= u << 18 | u >>> 32 - 18; + u = x10 + x9 | 0; + x11 ^= u << 7 | u >>> 32 - 7; + u = x11 + x10 | 0; + x8 ^= u << 9 | u >>> 32 - 9; + u = x8 + x11 | 0; + x9 ^= u << 13 | u >>> 32 - 13; + u = x9 + x8 | 0; + x10 ^= u << 18 | u >>> 32 - 18; + u = x15 + x14 | 0; + x12 ^= u << 7 | u >>> 32 - 7; + u = x12 + x15 | 0; + x13 ^= u << 9 | u >>> 32 - 9; + u = x13 + x12 | 0; + x14 ^= u << 13 | u >>> 32 - 13; + u = x14 + x13 | 0; + x15 ^= u << 18 | u >>> 32 - 18; + } + x0 = x0 + j0 | 0; + x1 = x1 + j1 | 0; + x2 = x2 + j2 | 0; + x3 = x3 + j3 | 0; + x4 = x4 + j4 | 0; + x5 = x5 + j5 | 0; + x6 = x6 + j6 | 0; + x7 = x7 + j7 | 0; + x8 = x8 + j8 | 0; + x9 = x9 + j9 | 0; + x10 = x10 + j10 | 0; + x11 = x11 + j11 | 0; + x12 = x12 + j12 | 0; + x13 = x13 + j13 | 0; + x14 = x14 + j14 | 0; + x15 = x15 + j15 | 0; + o[0] = x0 >>> 0 & 255; + o[1] = x0 >>> 8 & 255; + o[2] = x0 >>> 16 & 255; + o[3] = x0 >>> 24 & 255; + o[4] = x1 >>> 0 & 255; + o[5] = x1 >>> 8 & 255; + o[6] = x1 >>> 16 & 255; + o[7] = x1 >>> 24 & 255; + o[8] = x2 >>> 0 & 255; + o[9] = x2 >>> 8 & 255; + o[10] = x2 >>> 16 & 255; + o[11] = x2 >>> 24 & 255; + o[12] = x3 >>> 0 & 255; + o[13] = x3 >>> 8 & 255; + o[14] = x3 >>> 16 & 255; + o[15] = x3 >>> 24 & 255; + o[16] = x4 >>> 0 & 255; + o[17] = x4 >>> 8 & 255; + o[18] = x4 >>> 16 & 255; + o[19] = x4 >>> 24 & 255; + o[20] = x5 >>> 0 & 255; + o[21] = x5 >>> 8 & 255; + o[22] = x5 >>> 16 & 255; + o[23] = x5 >>> 24 & 255; + o[24] = x6 >>> 0 & 255; + o[25] = x6 >>> 8 & 255; + o[26] = x6 >>> 16 & 255; + o[27] = x6 >>> 24 & 255; + o[28] = x7 >>> 0 & 255; + o[29] = x7 >>> 8 & 255; + o[30] = x7 >>> 16 & 255; + o[31] = x7 >>> 24 & 255; + o[32] = x8 >>> 0 & 255; + o[33] = x8 >>> 8 & 255; + o[34] = x8 >>> 16 & 255; + o[35] = x8 >>> 24 & 255; + o[36] = x9 >>> 0 & 255; + o[37] = x9 >>> 8 & 255; + o[38] = x9 >>> 16 & 255; + o[39] = x9 >>> 24 & 255; + o[40] = x10 >>> 0 & 255; + o[41] = x10 >>> 8 & 255; + o[42] = x10 >>> 16 & 255; + o[43] = x10 >>> 24 & 255; + o[44] = x11 >>> 0 & 255; + o[45] = x11 >>> 8 & 255; + o[46] = x11 >>> 16 & 255; + o[47] = x11 >>> 24 & 255; + o[48] = x12 >>> 0 & 255; + o[49] = x12 >>> 8 & 255; + o[50] = x12 >>> 16 & 255; + o[51] = x12 >>> 24 & 255; + o[52] = x13 >>> 0 & 255; + o[53] = x13 >>> 8 & 255; + o[54] = x13 >>> 16 & 255; + o[55] = x13 >>> 24 & 255; + o[56] = x14 >>> 0 & 255; + o[57] = x14 >>> 8 & 255; + o[58] = x14 >>> 16 & 255; + o[59] = x14 >>> 24 & 255; + o[60] = x15 >>> 0 & 255; + o[61] = x15 >>> 8 & 255; + o[62] = x15 >>> 16 & 255; + o[63] = x15 >>> 24 & 255; + } + function core_hsalsa20(o, p, k, c) { + var j0 = c[0] & 255 | (c[1] & 255) << 8 | (c[2] & 255) << 16 | (c[3] & 255) << 24, j1 = k[0] & 255 | (k[1] & 255) << 8 | (k[2] & 255) << 16 | (k[3] & 255) << 24, j2 = k[4] & 255 | (k[5] & 255) << 8 | (k[6] & 255) << 16 | (k[7] & 255) << 24, j3 = k[8] & 255 | (k[9] & 255) << 8 | (k[10] & 255) << 16 | (k[11] & 255) << 24, j4 = k[12] & 255 | (k[13] & 255) << 8 | (k[14] & 255) << 16 | (k[15] & 255) << 24, j5 = c[4] & 255 | (c[5] & 255) << 8 | (c[6] & 255) << 16 | (c[7] & 255) << 24, j6 = p[0] & 255 | (p[1] & 255) << 8 | (p[2] & 255) << 16 | (p[3] & 255) << 24, j7 = p[4] & 255 | (p[5] & 255) << 8 | (p[6] & 255) << 16 | (p[7] & 255) << 24, j8 = p[8] & 255 | (p[9] & 255) << 8 | (p[10] & 255) << 16 | (p[11] & 255) << 24, j9 = p[12] & 255 | (p[13] & 255) << 8 | (p[14] & 255) << 16 | (p[15] & 255) << 24, j10 = c[8] & 255 | (c[9] & 255) << 8 | (c[10] & 255) << 16 | (c[11] & 255) << 24, j11 = k[16] & 255 | (k[17] & 255) << 8 | (k[18] & 255) << 16 | (k[19] & 255) << 24, j12 = k[20] & 255 | (k[21] & 255) << 8 | (k[22] & 255) << 16 | (k[23] & 255) << 24, j13 = k[24] & 255 | (k[25] & 255) << 8 | (k[26] & 255) << 16 | (k[27] & 255) << 24, j14 = k[28] & 255 | (k[29] & 255) << 8 | (k[30] & 255) << 16 | (k[31] & 255) << 24, j15 = c[12] & 255 | (c[13] & 255) << 8 | (c[14] & 255) << 16 | (c[15] & 255) << 24; + var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7, x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14, x15 = j15, u; + for (var i = 0; i < 20; i += 2) { + u = x0 + x12 | 0; + x4 ^= u << 7 | u >>> 32 - 7; + u = x4 + x0 | 0; + x8 ^= u << 9 | u >>> 32 - 9; + u = x8 + x4 | 0; + x12 ^= u << 13 | u >>> 32 - 13; + u = x12 + x8 | 0; + x0 ^= u << 18 | u >>> 32 - 18; + u = x5 + x1 | 0; + x9 ^= u << 7 | u >>> 32 - 7; + u = x9 + x5 | 0; + x13 ^= u << 9 | u >>> 32 - 9; + u = x13 + x9 | 0; + x1 ^= u << 13 | u >>> 32 - 13; + u = x1 + x13 | 0; + x5 ^= u << 18 | u >>> 32 - 18; + u = x10 + x6 | 0; + x14 ^= u << 7 | u >>> 32 - 7; + u = x14 + x10 | 0; + x2 ^= u << 9 | u >>> 32 - 9; + u = x2 + x14 | 0; + x6 ^= u << 13 | u >>> 32 - 13; + u = x6 + x2 | 0; + x10 ^= u << 18 | u >>> 32 - 18; + u = x15 + x11 | 0; + x3 ^= u << 7 | u >>> 32 - 7; + u = x3 + x15 | 0; + x7 ^= u << 9 | u >>> 32 - 9; + u = x7 + x3 | 0; + x11 ^= u << 13 | u >>> 32 - 13; + u = x11 + x7 | 0; + x15 ^= u << 18 | u >>> 32 - 18; + u = x0 + x3 | 0; + x1 ^= u << 7 | u >>> 32 - 7; + u = x1 + x0 | 0; + x2 ^= u << 9 | u >>> 32 - 9; + u = x2 + x1 | 0; + x3 ^= u << 13 | u >>> 32 - 13; + u = x3 + x2 | 0; + x0 ^= u << 18 | u >>> 32 - 18; + u = x5 + x4 | 0; + x6 ^= u << 7 | u >>> 32 - 7; + u = x6 + x5 | 0; + x7 ^= u << 9 | u >>> 32 - 9; + u = x7 + x6 | 0; + x4 ^= u << 13 | u >>> 32 - 13; + u = x4 + x7 | 0; + x5 ^= u << 18 | u >>> 32 - 18; + u = x10 + x9 | 0; + x11 ^= u << 7 | u >>> 32 - 7; + u = x11 + x10 | 0; + x8 ^= u << 9 | u >>> 32 - 9; + u = x8 + x11 | 0; + x9 ^= u << 13 | u >>> 32 - 13; + u = x9 + x8 | 0; + x10 ^= u << 18 | u >>> 32 - 18; + u = x15 + x14 | 0; + x12 ^= u << 7 | u >>> 32 - 7; + u = x12 + x15 | 0; + x13 ^= u << 9 | u >>> 32 - 9; + u = x13 + x12 | 0; + x14 ^= u << 13 | u >>> 32 - 13; + u = x14 + x13 | 0; + x15 ^= u << 18 | u >>> 32 - 18; + } + o[0] = x0 >>> 0 & 255; + o[1] = x0 >>> 8 & 255; + o[2] = x0 >>> 16 & 255; + o[3] = x0 >>> 24 & 255; + o[4] = x5 >>> 0 & 255; + o[5] = x5 >>> 8 & 255; + o[6] = x5 >>> 16 & 255; + o[7] = x5 >>> 24 & 255; + o[8] = x10 >>> 0 & 255; + o[9] = x10 >>> 8 & 255; + o[10] = x10 >>> 16 & 255; + o[11] = x10 >>> 24 & 255; + o[12] = x15 >>> 0 & 255; + o[13] = x15 >>> 8 & 255; + o[14] = x15 >>> 16 & 255; + o[15] = x15 >>> 24 & 255; + o[16] = x6 >>> 0 & 255; + o[17] = x6 >>> 8 & 255; + o[18] = x6 >>> 16 & 255; + o[19] = x6 >>> 24 & 255; + o[20] = x7 >>> 0 & 255; + o[21] = x7 >>> 8 & 255; + o[22] = x7 >>> 16 & 255; + o[23] = x7 >>> 24 & 255; + o[24] = x8 >>> 0 & 255; + o[25] = x8 >>> 8 & 255; + o[26] = x8 >>> 16 & 255; + o[27] = x8 >>> 24 & 255; + o[28] = x9 >>> 0 & 255; + o[29] = x9 >>> 8 & 255; + o[30] = x9 >>> 16 & 255; + o[31] = x9 >>> 24 & 255; + } + function crypto_core_salsa20(out, inp, k, c) { + core_salsa20(out, inp, k, c); + } + function crypto_core_hsalsa20(out, inp, k, c) { + core_hsalsa20(out, inp, k, c); + } + var sigma = new Uint8Array([101, 120, 112, 97, 110, 100, 32, 51, 50, 45, 98, 121, 116, 101, 32, 107]); + function crypto_stream_salsa20_xor(c, cpos, m, mpos, b, n, k) { + var z = new Uint8Array(16), x = new Uint8Array(64); + var u, i; + for (i = 0; i < 16; i++) + z[i] = 0; + for (i = 0; i < 8; i++) + z[i] = n[i]; + while (b >= 64) { + crypto_core_salsa20(x, z, k, sigma); + for (i = 0; i < 64; i++) + c[cpos + i] = m[mpos + i] ^ x[i]; + u = 1; + for (i = 8; i < 16; i++) { + u = u + (z[i] & 255) | 0; + z[i] = u & 255; + u >>>= 8; + } + b -= 64; + cpos += 64; + mpos += 64; + } + if (b > 0) { + crypto_core_salsa20(x, z, k, sigma); + for (i = 0; i < b; i++) + c[cpos + i] = m[mpos + i] ^ x[i]; + } + return 0; + } + function crypto_stream_salsa20(c, cpos, b, n, k) { + var z = new Uint8Array(16), x = new Uint8Array(64); + var u, i; + for (i = 0; i < 16; i++) + z[i] = 0; + for (i = 0; i < 8; i++) + z[i] = n[i]; + while (b >= 64) { + crypto_core_salsa20(x, z, k, sigma); + for (i = 0; i < 64; i++) + c[cpos + i] = x[i]; + u = 1; + for (i = 8; i < 16; i++) { + u = u + (z[i] & 255) | 0; + z[i] = u & 255; + u >>>= 8; + } + b -= 64; + cpos += 64; + } + if (b > 0) { + crypto_core_salsa20(x, z, k, sigma); + for (i = 0; i < b; i++) + c[cpos + i] = x[i]; + } + return 0; + } + function crypto_stream(c, cpos, d, n, k) { + var s = new Uint8Array(32); + crypto_core_hsalsa20(s, n, k, sigma); + var sn = new Uint8Array(8); + for (var i = 0; i < 8; i++) + sn[i] = n[i + 16]; + return crypto_stream_salsa20(c, cpos, d, sn, s); + } + function crypto_stream_xor(c, cpos, m, mpos, d, n, k) { + var s = new Uint8Array(32); + crypto_core_hsalsa20(s, n, k, sigma); + var sn = new Uint8Array(8); + for (var i = 0; i < 8; i++) + sn[i] = n[i + 16]; + return crypto_stream_salsa20_xor(c, cpos, m, mpos, d, sn, s); + } + var poly1305 = function(key) { + this.buffer = new Uint8Array(16); + this.r = new Uint16Array(10); + this.h = new Uint16Array(10); + this.pad = new Uint16Array(8); + this.leftover = 0; + this.fin = 0; + var t0, t1, t2, t3, t4, t5, t6, t7; + t0 = key[0] & 255 | (key[1] & 255) << 8; + this.r[0] = t0 & 8191; + t1 = key[2] & 255 | (key[3] & 255) << 8; + this.r[1] = (t0 >>> 13 | t1 << 3) & 8191; + t2 = key[4] & 255 | (key[5] & 255) << 8; + this.r[2] = (t1 >>> 10 | t2 << 6) & 7939; + t3 = key[6] & 255 | (key[7] & 255) << 8; + this.r[3] = (t2 >>> 7 | t3 << 9) & 8191; + t4 = key[8] & 255 | (key[9] & 255) << 8; + this.r[4] = (t3 >>> 4 | t4 << 12) & 255; + this.r[5] = t4 >>> 1 & 8190; + t5 = key[10] & 255 | (key[11] & 255) << 8; + this.r[6] = (t4 >>> 14 | t5 << 2) & 8191; + t6 = key[12] & 255 | (key[13] & 255) << 8; + this.r[7] = (t5 >>> 11 | t6 << 5) & 8065; + t7 = key[14] & 255 | (key[15] & 255) << 8; + this.r[8] = (t6 >>> 8 | t7 << 8) & 8191; + this.r[9] = t7 >>> 5 & 127; + this.pad[0] = key[16] & 255 | (key[17] & 255) << 8; + this.pad[1] = key[18] & 255 | (key[19] & 255) << 8; + this.pad[2] = key[20] & 255 | (key[21] & 255) << 8; + this.pad[3] = key[22] & 255 | (key[23] & 255) << 8; + this.pad[4] = key[24] & 255 | (key[25] & 255) << 8; + this.pad[5] = key[26] & 255 | (key[27] & 255) << 8; + this.pad[6] = key[28] & 255 | (key[29] & 255) << 8; + this.pad[7] = key[30] & 255 | (key[31] & 255) << 8; + }; + poly1305.prototype.blocks = function(m, mpos, bytes) { + var hibit = this.fin ? 0 : 1 << 11; + var t0, t1, t2, t3, t4, t5, t6, t7, c; + var d0, d1, d2, d3, d4, d5, d6, d7, d8, d9; + var h0 = this.h[0], h1 = this.h[1], h2 = this.h[2], h3 = this.h[3], h4 = this.h[4], h5 = this.h[5], h6 = this.h[6], h7 = this.h[7], h8 = this.h[8], h9 = this.h[9]; + var r0 = this.r[0], r1 = this.r[1], r2 = this.r[2], r3 = this.r[3], r4 = this.r[4], r5 = this.r[5], r6 = this.r[6], r7 = this.r[7], r8 = this.r[8], r9 = this.r[9]; + while (bytes >= 16) { + t0 = m[mpos + 0] & 255 | (m[mpos + 1] & 255) << 8; + h0 += t0 & 8191; + t1 = m[mpos + 2] & 255 | (m[mpos + 3] & 255) << 8; + h1 += (t0 >>> 13 | t1 << 3) & 8191; + t2 = m[mpos + 4] & 255 | (m[mpos + 5] & 255) << 8; + h2 += (t1 >>> 10 | t2 << 6) & 8191; + t3 = m[mpos + 6] & 255 | (m[mpos + 7] & 255) << 8; + h3 += (t2 >>> 7 | t3 << 9) & 8191; + t4 = m[mpos + 8] & 255 | (m[mpos + 9] & 255) << 8; + h4 += (t3 >>> 4 | t4 << 12) & 8191; + h5 += t4 >>> 1 & 8191; + t5 = m[mpos + 10] & 255 | (m[mpos + 11] & 255) << 8; + h6 += (t4 >>> 14 | t5 << 2) & 8191; + t6 = m[mpos + 12] & 255 | (m[mpos + 13] & 255) << 8; + h7 += (t5 >>> 11 | t6 << 5) & 8191; + t7 = m[mpos + 14] & 255 | (m[mpos + 15] & 255) << 8; + h8 += (t6 >>> 8 | t7 << 8) & 8191; + h9 += t7 >>> 5 | hibit; + c = 0; + d0 = c; + d0 += h0 * r0; + d0 += h1 * (5 * r9); + d0 += h2 * (5 * r8); + d0 += h3 * (5 * r7); + d0 += h4 * (5 * r6); + c = d0 >>> 13; + d0 &= 8191; + d0 += h5 * (5 * r5); + d0 += h6 * (5 * r4); + d0 += h7 * (5 * r3); + d0 += h8 * (5 * r2); + d0 += h9 * (5 * r1); + c += d0 >>> 13; + d0 &= 8191; + d1 = c; + d1 += h0 * r1; + d1 += h1 * r0; + d1 += h2 * (5 * r9); + d1 += h3 * (5 * r8); + d1 += h4 * (5 * r7); + c = d1 >>> 13; + d1 &= 8191; + d1 += h5 * (5 * r6); + d1 += h6 * (5 * r5); + d1 += h7 * (5 * r4); + d1 += h8 * (5 * r3); + d1 += h9 * (5 * r2); + c += d1 >>> 13; + d1 &= 8191; + d2 = c; + d2 += h0 * r2; + d2 += h1 * r1; + d2 += h2 * r0; + d2 += h3 * (5 * r9); + d2 += h4 * (5 * r8); + c = d2 >>> 13; + d2 &= 8191; + d2 += h5 * (5 * r7); + d2 += h6 * (5 * r6); + d2 += h7 * (5 * r5); + d2 += h8 * (5 * r4); + d2 += h9 * (5 * r3); + c += d2 >>> 13; + d2 &= 8191; + d3 = c; + d3 += h0 * r3; + d3 += h1 * r2; + d3 += h2 * r1; + d3 += h3 * r0; + d3 += h4 * (5 * r9); + c = d3 >>> 13; + d3 &= 8191; + d3 += h5 * (5 * r8); + d3 += h6 * (5 * r7); + d3 += h7 * (5 * r6); + d3 += h8 * (5 * r5); + d3 += h9 * (5 * r4); + c += d3 >>> 13; + d3 &= 8191; + d4 = c; + d4 += h0 * r4; + d4 += h1 * r3; + d4 += h2 * r2; + d4 += h3 * r1; + d4 += h4 * r0; + c = d4 >>> 13; + d4 &= 8191; + d4 += h5 * (5 * r9); + d4 += h6 * (5 * r8); + d4 += h7 * (5 * r7); + d4 += h8 * (5 * r6); + d4 += h9 * (5 * r5); + c += d4 >>> 13; + d4 &= 8191; + d5 = c; + d5 += h0 * r5; + d5 += h1 * r4; + d5 += h2 * r3; + d5 += h3 * r2; + d5 += h4 * r1; + c = d5 >>> 13; + d5 &= 8191; + d5 += h5 * r0; + d5 += h6 * (5 * r9); + d5 += h7 * (5 * r8); + d5 += h8 * (5 * r7); + d5 += h9 * (5 * r6); + c += d5 >>> 13; + d5 &= 8191; + d6 = c; + d6 += h0 * r6; + d6 += h1 * r5; + d6 += h2 * r4; + d6 += h3 * r3; + d6 += h4 * r2; + c = d6 >>> 13; + d6 &= 8191; + d6 += h5 * r1; + d6 += h6 * r0; + d6 += h7 * (5 * r9); + d6 += h8 * (5 * r8); + d6 += h9 * (5 * r7); + c += d6 >>> 13; + d6 &= 8191; + d7 = c; + d7 += h0 * r7; + d7 += h1 * r6; + d7 += h2 * r5; + d7 += h3 * r4; + d7 += h4 * r3; + c = d7 >>> 13; + d7 &= 8191; + d7 += h5 * r2; + d7 += h6 * r1; + d7 += h7 * r0; + d7 += h8 * (5 * r9); + d7 += h9 * (5 * r8); + c += d7 >>> 13; + d7 &= 8191; + d8 = c; + d8 += h0 * r8; + d8 += h1 * r7; + d8 += h2 * r6; + d8 += h3 * r5; + d8 += h4 * r4; + c = d8 >>> 13; + d8 &= 8191; + d8 += h5 * r3; + d8 += h6 * r2; + d8 += h7 * r1; + d8 += h8 * r0; + d8 += h9 * (5 * r9); + c += d8 >>> 13; + d8 &= 8191; + d9 = c; + d9 += h0 * r9; + d9 += h1 * r8; + d9 += h2 * r7; + d9 += h3 * r6; + d9 += h4 * r5; + c = d9 >>> 13; + d9 &= 8191; + d9 += h5 * r4; + d9 += h6 * r3; + d9 += h7 * r2; + d9 += h8 * r1; + d9 += h9 * r0; + c += d9 >>> 13; + d9 &= 8191; + c = (c << 2) + c | 0; + c = c + d0 | 0; + d0 = c & 8191; + c = c >>> 13; + d1 += c; + h0 = d0; + h1 = d1; + h2 = d2; + h3 = d3; + h4 = d4; + h5 = d5; + h6 = d6; + h7 = d7; + h8 = d8; + h9 = d9; + mpos += 16; + bytes -= 16; + } + this.h[0] = h0; + this.h[1] = h1; + this.h[2] = h2; + this.h[3] = h3; + this.h[4] = h4; + this.h[5] = h5; + this.h[6] = h6; + this.h[7] = h7; + this.h[8] = h8; + this.h[9] = h9; + }; + poly1305.prototype.finish = function(mac, macpos) { + var g = new Uint16Array(10); + var c, mask, f, i; + if (this.leftover) { + i = this.leftover; + this.buffer[i++] = 1; + for (; i < 16; i++) + this.buffer[i] = 0; + this.fin = 1; + this.blocks(this.buffer, 0, 16); + } + c = this.h[1] >>> 13; + this.h[1] &= 8191; + for (i = 2; i < 10; i++) { + this.h[i] += c; + c = this.h[i] >>> 13; + this.h[i] &= 8191; + } + this.h[0] += c * 5; + c = this.h[0] >>> 13; + this.h[0] &= 8191; + this.h[1] += c; + c = this.h[1] >>> 13; + this.h[1] &= 8191; + this.h[2] += c; + g[0] = this.h[0] + 5; + c = g[0] >>> 13; + g[0] &= 8191; + for (i = 1; i < 10; i++) { + g[i] = this.h[i] + c; + c = g[i] >>> 13; + g[i] &= 8191; + } + g[9] -= 1 << 13; + mask = (c ^ 1) - 1; + for (i = 0; i < 10; i++) + g[i] &= mask; + mask = ~mask; + for (i = 0; i < 10; i++) + this.h[i] = this.h[i] & mask | g[i]; + this.h[0] = (this.h[0] | this.h[1] << 13) & 65535; + this.h[1] = (this.h[1] >>> 3 | this.h[2] << 10) & 65535; + this.h[2] = (this.h[2] >>> 6 | this.h[3] << 7) & 65535; + this.h[3] = (this.h[3] >>> 9 | this.h[4] << 4) & 65535; + this.h[4] = (this.h[4] >>> 12 | this.h[5] << 1 | this.h[6] << 14) & 65535; + this.h[5] = (this.h[6] >>> 2 | this.h[7] << 11) & 65535; + this.h[6] = (this.h[7] >>> 5 | this.h[8] << 8) & 65535; + this.h[7] = (this.h[8] >>> 8 | this.h[9] << 5) & 65535; + f = this.h[0] + this.pad[0]; + this.h[0] = f & 65535; + for (i = 1; i < 8; i++) { + f = (this.h[i] + this.pad[i] | 0) + (f >>> 16) | 0; + this.h[i] = f & 65535; + } + mac[macpos + 0] = this.h[0] >>> 0 & 255; + mac[macpos + 1] = this.h[0] >>> 8 & 255; + mac[macpos + 2] = this.h[1] >>> 0 & 255; + mac[macpos + 3] = this.h[1] >>> 8 & 255; + mac[macpos + 4] = this.h[2] >>> 0 & 255; + mac[macpos + 5] = this.h[2] >>> 8 & 255; + mac[macpos + 6] = this.h[3] >>> 0 & 255; + mac[macpos + 7] = this.h[3] >>> 8 & 255; + mac[macpos + 8] = this.h[4] >>> 0 & 255; + mac[macpos + 9] = this.h[4] >>> 8 & 255; + mac[macpos + 10] = this.h[5] >>> 0 & 255; + mac[macpos + 11] = this.h[5] >>> 8 & 255; + mac[macpos + 12] = this.h[6] >>> 0 & 255; + mac[macpos + 13] = this.h[6] >>> 8 & 255; + mac[macpos + 14] = this.h[7] >>> 0 & 255; + mac[macpos + 15] = this.h[7] >>> 8 & 255; + }; + poly1305.prototype.update = function(m, mpos, bytes) { + var i, want; + if (this.leftover) { + want = 16 - this.leftover; + if (want > bytes) + want = bytes; + for (i = 0; i < want; i++) + this.buffer[this.leftover + i] = m[mpos + i]; + bytes -= want; + mpos += want; + this.leftover += want; + if (this.leftover < 16) + return; + this.blocks(this.buffer, 0, 16); + this.leftover = 0; + } + if (bytes >= 16) { + want = bytes - bytes % 16; + this.blocks(m, mpos, want); + mpos += want; + bytes -= want; + } + if (bytes) { + for (i = 0; i < bytes; i++) + this.buffer[this.leftover + i] = m[mpos + i]; + this.leftover += bytes; + } + }; + function crypto_onetimeauth(out, outpos, m, mpos, n, k) { + var s = new poly1305(k); + s.update(m, mpos, n); + s.finish(out, outpos); + return 0; + } + function crypto_onetimeauth_verify(h, hpos, m, mpos, n, k) { + var x = new Uint8Array(16); + crypto_onetimeauth(x, 0, m, mpos, n, k); + return crypto_verify_16(h, hpos, x, 0); + } + function crypto_secretbox(c, m, d, n, k) { + var i; + if (d < 32) + return -1; + crypto_stream_xor(c, 0, m, 0, d, n, k); + crypto_onetimeauth(c, 16, c, 32, d - 32, c); + for (i = 0; i < 16; i++) + c[i] = 0; + return 0; + } + function crypto_secretbox_open(m, c, d, n, k) { + var i; + var x = new Uint8Array(32); + if (d < 32) + return -1; + crypto_stream(x, 0, 32, n, k); + if (crypto_onetimeauth_verify(c, 16, c, 32, d - 32, x) !== 0) + return -1; + crypto_stream_xor(m, 0, c, 0, d, n, k); + for (i = 0; i < 32; i++) + m[i] = 0; + return 0; + } + function set25519(r, a) { + var i; + for (i = 0; i < 16; i++) + r[i] = a[i] | 0; + } + function car25519(o) { + var i, v, c = 1; + for (i = 0; i < 16; i++) { + v = o[i] + c + 65535; + c = Math.floor(v / 65536); + o[i] = v - c * 65536; + } + o[0] += c - 1 + 37 * (c - 1); + } + function sel25519(p, q, b) { + var t, c = ~(b - 1); + for (var i = 0; i < 16; i++) { + t = c & (p[i] ^ q[i]); + p[i] ^= t; + q[i] ^= t; + } + } + function pack25519(o, n) { + var i, j, b; + var m = gf(), t = gf(); + for (i = 0; i < 16; i++) + t[i] = n[i]; + car25519(t); + car25519(t); + car25519(t); + for (j = 0; j < 2; j++) { + m[0] = t[0] - 65517; + for (i = 1; i < 15; i++) { + m[i] = t[i] - 65535 - (m[i - 1] >> 16 & 1); + m[i - 1] &= 65535; + } + m[15] = t[15] - 32767 - (m[14] >> 16 & 1); + b = m[15] >> 16 & 1; + m[14] &= 65535; + sel25519(t, m, 1 - b); + } + for (i = 0; i < 16; i++) { + o[2 * i] = t[i] & 255; + o[2 * i + 1] = t[i] >> 8; + } + } + function neq25519(a, b) { + var c = new Uint8Array(32), d = new Uint8Array(32); + pack25519(c, a); + pack25519(d, b); + return crypto_verify_32(c, 0, d, 0); + } + function par25519(a) { + var d = new Uint8Array(32); + pack25519(d, a); + return d[0] & 1; + } + function unpack25519(o, n) { + var i; + for (i = 0; i < 16; i++) + o[i] = n[2 * i] + (n[2 * i + 1] << 8); + o[15] &= 32767; + } + function A(o, a, b) { + for (var i = 0; i < 16; i++) + o[i] = a[i] + b[i]; + } + function Z(o, a, b) { + for (var i = 0; i < 16; i++) + o[i] = a[i] - b[i]; + } + function M(o, a, b) { + var v, c, t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, t10 = 0, t11 = 0, t12 = 0, t13 = 0, t14 = 0, t15 = 0, t16 = 0, t17 = 0, t18 = 0, t19 = 0, t20 = 0, t21 = 0, t22 = 0, t23 = 0, t24 = 0, t25 = 0, t26 = 0, t27 = 0, t28 = 0, t29 = 0, t30 = 0, b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3], b4 = b[4], b5 = b[5], b6 = b[6], b7 = b[7], b8 = b[8], b9 = b[9], b10 = b[10], b11 = b[11], b12 = b[12], b13 = b[13], b14 = b[14], b15 = b[15]; + v = a[0]; + t0 += v * b0; + t1 += v * b1; + t2 += v * b2; + t3 += v * b3; + t4 += v * b4; + t5 += v * b5; + t6 += v * b6; + t7 += v * b7; + t8 += v * b8; + t9 += v * b9; + t10 += v * b10; + t11 += v * b11; + t12 += v * b12; + t13 += v * b13; + t14 += v * b14; + t15 += v * b15; + v = a[1]; + t1 += v * b0; + t2 += v * b1; + t3 += v * b2; + t4 += v * b3; + t5 += v * b4; + t6 += v * b5; + t7 += v * b6; + t8 += v * b7; + t9 += v * b8; + t10 += v * b9; + t11 += v * b10; + t12 += v * b11; + t13 += v * b12; + t14 += v * b13; + t15 += v * b14; + t16 += v * b15; + v = a[2]; + t2 += v * b0; + t3 += v * b1; + t4 += v * b2; + t5 += v * b3; + t6 += v * b4; + t7 += v * b5; + t8 += v * b6; + t9 += v * b7; + t10 += v * b8; + t11 += v * b9; + t12 += v * b10; + t13 += v * b11; + t14 += v * b12; + t15 += v * b13; + t16 += v * b14; + t17 += v * b15; + v = a[3]; + t3 += v * b0; + t4 += v * b1; + t5 += v * b2; + t6 += v * b3; + t7 += v * b4; + t8 += v * b5; + t9 += v * b6; + t10 += v * b7; + t11 += v * b8; + t12 += v * b9; + t13 += v * b10; + t14 += v * b11; + t15 += v * b12; + t16 += v * b13; + t17 += v * b14; + t18 += v * b15; + v = a[4]; + t4 += v * b0; + t5 += v * b1; + t6 += v * b2; + t7 += v * b3; + t8 += v * b4; + t9 += v * b5; + t10 += v * b6; + t11 += v * b7; + t12 += v * b8; + t13 += v * b9; + t14 += v * b10; + t15 += v * b11; + t16 += v * b12; + t17 += v * b13; + t18 += v * b14; + t19 += v * b15; + v = a[5]; + t5 += v * b0; + t6 += v * b1; + t7 += v * b2; + t8 += v * b3; + t9 += v * b4; + t10 += v * b5; + t11 += v * b6; + t12 += v * b7; + t13 += v * b8; + t14 += v * b9; + t15 += v * b10; + t16 += v * b11; + t17 += v * b12; + t18 += v * b13; + t19 += v * b14; + t20 += v * b15; + v = a[6]; + t6 += v * b0; + t7 += v * b1; + t8 += v * b2; + t9 += v * b3; + t10 += v * b4; + t11 += v * b5; + t12 += v * b6; + t13 += v * b7; + t14 += v * b8; + t15 += v * b9; + t16 += v * b10; + t17 += v * b11; + t18 += v * b12; + t19 += v * b13; + t20 += v * b14; + t21 += v * b15; + v = a[7]; + t7 += v * b0; + t8 += v * b1; + t9 += v * b2; + t10 += v * b3; + t11 += v * b4; + t12 += v * b5; + t13 += v * b6; + t14 += v * b7; + t15 += v * b8; + t16 += v * b9; + t17 += v * b10; + t18 += v * b11; + t19 += v * b12; + t20 += v * b13; + t21 += v * b14; + t22 += v * b15; + v = a[8]; + t8 += v * b0; + t9 += v * b1; + t10 += v * b2; + t11 += v * b3; + t12 += v * b4; + t13 += v * b5; + t14 += v * b6; + t15 += v * b7; + t16 += v * b8; + t17 += v * b9; + t18 += v * b10; + t19 += v * b11; + t20 += v * b12; + t21 += v * b13; + t22 += v * b14; + t23 += v * b15; + v = a[9]; + t9 += v * b0; + t10 += v * b1; + t11 += v * b2; + t12 += v * b3; + t13 += v * b4; + t14 += v * b5; + t15 += v * b6; + t16 += v * b7; + t17 += v * b8; + t18 += v * b9; + t19 += v * b10; + t20 += v * b11; + t21 += v * b12; + t22 += v * b13; + t23 += v * b14; + t24 += v * b15; + v = a[10]; + t10 += v * b0; + t11 += v * b1; + t12 += v * b2; + t13 += v * b3; + t14 += v * b4; + t15 += v * b5; + t16 += v * b6; + t17 += v * b7; + t18 += v * b8; + t19 += v * b9; + t20 += v * b10; + t21 += v * b11; + t22 += v * b12; + t23 += v * b13; + t24 += v * b14; + t25 += v * b15; + v = a[11]; + t11 += v * b0; + t12 += v * b1; + t13 += v * b2; + t14 += v * b3; + t15 += v * b4; + t16 += v * b5; + t17 += v * b6; + t18 += v * b7; + t19 += v * b8; + t20 += v * b9; + t21 += v * b10; + t22 += v * b11; + t23 += v * b12; + t24 += v * b13; + t25 += v * b14; + t26 += v * b15; + v = a[12]; + t12 += v * b0; + t13 += v * b1; + t14 += v * b2; + t15 += v * b3; + t16 += v * b4; + t17 += v * b5; + t18 += v * b6; + t19 += v * b7; + t20 += v * b8; + t21 += v * b9; + t22 += v * b10; + t23 += v * b11; + t24 += v * b12; + t25 += v * b13; + t26 += v * b14; + t27 += v * b15; + v = a[13]; + t13 += v * b0; + t14 += v * b1; + t15 += v * b2; + t16 += v * b3; + t17 += v * b4; + t18 += v * b5; + t19 += v * b6; + t20 += v * b7; + t21 += v * b8; + t22 += v * b9; + t23 += v * b10; + t24 += v * b11; + t25 += v * b12; + t26 += v * b13; + t27 += v * b14; + t28 += v * b15; + v = a[14]; + t14 += v * b0; + t15 += v * b1; + t16 += v * b2; + t17 += v * b3; + t18 += v * b4; + t19 += v * b5; + t20 += v * b6; + t21 += v * b7; + t22 += v * b8; + t23 += v * b9; + t24 += v * b10; + t25 += v * b11; + t26 += v * b12; + t27 += v * b13; + t28 += v * b14; + t29 += v * b15; + v = a[15]; + t15 += v * b0; + t16 += v * b1; + t17 += v * b2; + t18 += v * b3; + t19 += v * b4; + t20 += v * b5; + t21 += v * b6; + t22 += v * b7; + t23 += v * b8; + t24 += v * b9; + t25 += v * b10; + t26 += v * b11; + t27 += v * b12; + t28 += v * b13; + t29 += v * b14; + t30 += v * b15; + t0 += 38 * t16; + t1 += 38 * t17; + t2 += 38 * t18; + t3 += 38 * t19; + t4 += 38 * t20; + t5 += 38 * t21; + t6 += 38 * t22; + t7 += 38 * t23; + t8 += 38 * t24; + t9 += 38 * t25; + t10 += 38 * t26; + t11 += 38 * t27; + t12 += 38 * t28; + t13 += 38 * t29; + t14 += 38 * t30; + c = 1; + v = t0 + c + 65535; + c = Math.floor(v / 65536); + t0 = v - c * 65536; + v = t1 + c + 65535; + c = Math.floor(v / 65536); + t1 = v - c * 65536; + v = t2 + c + 65535; + c = Math.floor(v / 65536); + t2 = v - c * 65536; + v = t3 + c + 65535; + c = Math.floor(v / 65536); + t3 = v - c * 65536; + v = t4 + c + 65535; + c = Math.floor(v / 65536); + t4 = v - c * 65536; + v = t5 + c + 65535; + c = Math.floor(v / 65536); + t5 = v - c * 65536; + v = t6 + c + 65535; + c = Math.floor(v / 65536); + t6 = v - c * 65536; + v = t7 + c + 65535; + c = Math.floor(v / 65536); + t7 = v - c * 65536; + v = t8 + c + 65535; + c = Math.floor(v / 65536); + t8 = v - c * 65536; + v = t9 + c + 65535; + c = Math.floor(v / 65536); + t9 = v - c * 65536; + v = t10 + c + 65535; + c = Math.floor(v / 65536); + t10 = v - c * 65536; + v = t11 + c + 65535; + c = Math.floor(v / 65536); + t11 = v - c * 65536; + v = t12 + c + 65535; + c = Math.floor(v / 65536); + t12 = v - c * 65536; + v = t13 + c + 65535; + c = Math.floor(v / 65536); + t13 = v - c * 65536; + v = t14 + c + 65535; + c = Math.floor(v / 65536); + t14 = v - c * 65536; + v = t15 + c + 65535; + c = Math.floor(v / 65536); + t15 = v - c * 65536; + t0 += c - 1 + 37 * (c - 1); + c = 1; + v = t0 + c + 65535; + c = Math.floor(v / 65536); + t0 = v - c * 65536; + v = t1 + c + 65535; + c = Math.floor(v / 65536); + t1 = v - c * 65536; + v = t2 + c + 65535; + c = Math.floor(v / 65536); + t2 = v - c * 65536; + v = t3 + c + 65535; + c = Math.floor(v / 65536); + t3 = v - c * 65536; + v = t4 + c + 65535; + c = Math.floor(v / 65536); + t4 = v - c * 65536; + v = t5 + c + 65535; + c = Math.floor(v / 65536); + t5 = v - c * 65536; + v = t6 + c + 65535; + c = Math.floor(v / 65536); + t6 = v - c * 65536; + v = t7 + c + 65535; + c = Math.floor(v / 65536); + t7 = v - c * 65536; + v = t8 + c + 65535; + c = Math.floor(v / 65536); + t8 = v - c * 65536; + v = t9 + c + 65535; + c = Math.floor(v / 65536); + t9 = v - c * 65536; + v = t10 + c + 65535; + c = Math.floor(v / 65536); + t10 = v - c * 65536; + v = t11 + c + 65535; + c = Math.floor(v / 65536); + t11 = v - c * 65536; + v = t12 + c + 65535; + c = Math.floor(v / 65536); + t12 = v - c * 65536; + v = t13 + c + 65535; + c = Math.floor(v / 65536); + t13 = v - c * 65536; + v = t14 + c + 65535; + c = Math.floor(v / 65536); + t14 = v - c * 65536; + v = t15 + c + 65535; + c = Math.floor(v / 65536); + t15 = v - c * 65536; + t0 += c - 1 + 37 * (c - 1); + o[0] = t0; + o[1] = t1; + o[2] = t2; + o[3] = t3; + o[4] = t4; + o[5] = t5; + o[6] = t6; + o[7] = t7; + o[8] = t8; + o[9] = t9; + o[10] = t10; + o[11] = t11; + o[12] = t12; + o[13] = t13; + o[14] = t14; + o[15] = t15; + } + function S(o, a) { + M(o, a, a); + } + function inv25519(o, i) { + var c = gf(); + var a; + for (a = 0; a < 16; a++) + c[a] = i[a]; + for (a = 253; a >= 0; a--) { + S(c, c); + if (a !== 2 && a !== 4) + M(c, c, i); + } + for (a = 0; a < 16; a++) + o[a] = c[a]; + } + function pow2523(o, i) { + var c = gf(); + var a; + for (a = 0; a < 16; a++) + c[a] = i[a]; + for (a = 250; a >= 0; a--) { + S(c, c); + if (a !== 1) + M(c, c, i); + } + for (a = 0; a < 16; a++) + o[a] = c[a]; + } + function crypto_scalarmult(q, n, p) { + var z = new Uint8Array(32); + var x = new Float64Array(80), r, i; + var a = gf(), b = gf(), c = gf(), d = gf(), e = gf(), f = gf(); + for (i = 0; i < 31; i++) + z[i] = n[i]; + z[31] = n[31] & 127 | 64; + z[0] &= 248; + unpack25519(x, p); + for (i = 0; i < 16; i++) { + b[i] = x[i]; + d[i] = a[i] = c[i] = 0; + } + a[0] = d[0] = 1; + for (i = 254; i >= 0; --i) { + r = z[i >>> 3] >>> (i & 7) & 1; + sel25519(a, b, r); + sel25519(c, d, r); + A(e, a, c); + Z(a, a, c); + A(c, b, d); + Z(b, b, d); + S(d, e); + S(f, a); + M(a, c, a); + M(c, b, e); + A(e, a, c); + Z(a, a, c); + S(b, a); + Z(c, d, f); + M(a, c, _121665); + A(a, a, d); + M(c, c, a); + M(a, d, f); + M(d, b, x); + S(b, e); + sel25519(a, b, r); + sel25519(c, d, r); + } + for (i = 0; i < 16; i++) { + x[i + 16] = a[i]; + x[i + 32] = c[i]; + x[i + 48] = b[i]; + x[i + 64] = d[i]; + } + var x32 = x.subarray(32); + var x16 = x.subarray(16); + inv25519(x32, x32); + M(x16, x16, x32); + pack25519(q, x16); + return 0; + } + function crypto_scalarmult_base(q, n) { + return crypto_scalarmult(q, n, _9); + } + function crypto_box_keypair(y, x) { + randombytes(x, 32); + return crypto_scalarmult_base(y, x); + } + function crypto_box_beforenm(k, y, x) { + var s = new Uint8Array(32); + crypto_scalarmult(s, x, y); + return crypto_core_hsalsa20(k, _0, s, sigma); + } + var crypto_box_afternm = crypto_secretbox; + var crypto_box_open_afternm = crypto_secretbox_open; + function crypto_box(c, m, d, n, y, x) { + var k = new Uint8Array(32); + crypto_box_beforenm(k, y, x); + return crypto_box_afternm(c, m, d, n, k); + } + function crypto_box_open(m, c, d, n, y, x) { + var k = new Uint8Array(32); + crypto_box_beforenm(k, y, x); + return crypto_box_open_afternm(m, c, d, n, k); + } + var K = [ + 1116352408, + 3609767458, + 1899447441, + 602891725, + 3049323471, + 3964484399, + 3921009573, + 2173295548, + 961987163, + 4081628472, + 1508970993, + 3053834265, + 2453635748, + 2937671579, + 2870763221, + 3664609560, + 3624381080, + 2734883394, + 310598401, + 1164996542, + 607225278, + 1323610764, + 1426881987, + 3590304994, + 1925078388, + 4068182383, + 2162078206, + 991336113, + 2614888103, + 633803317, + 3248222580, + 3479774868, + 3835390401, + 2666613458, + 4022224774, + 944711139, + 264347078, + 2341262773, + 604807628, + 2007800933, + 770255983, + 1495990901, + 1249150122, + 1856431235, + 1555081692, + 3175218132, + 1996064986, + 2198950837, + 2554220882, + 3999719339, + 2821834349, + 766784016, + 2952996808, + 2566594879, + 3210313671, + 3203337956, + 3336571891, + 1034457026, + 3584528711, + 2466948901, + 113926993, + 3758326383, + 338241895, + 168717936, + 666307205, + 1188179964, + 773529912, + 1546045734, + 1294757372, + 1522805485, + 1396182291, + 2643833823, + 1695183700, + 2343527390, + 1986661051, + 1014477480, + 2177026350, + 1206759142, + 2456956037, + 344077627, + 2730485921, + 1290863460, + 2820302411, + 3158454273, + 3259730800, + 3505952657, + 3345764771, + 106217008, + 3516065817, + 3606008344, + 3600352804, + 1432725776, + 4094571909, + 1467031594, + 275423344, + 851169720, + 430227734, + 3100823752, + 506948616, + 1363258195, + 659060556, + 3750685593, + 883997877, + 3785050280, + 958139571, + 3318307427, + 1322822218, + 3812723403, + 1537002063, + 2003034995, + 1747873779, + 3602036899, + 1955562222, + 1575990012, + 2024104815, + 1125592928, + 2227730452, + 2716904306, + 2361852424, + 442776044, + 2428436474, + 593698344, + 2756734187, + 3733110249, + 3204031479, + 2999351573, + 3329325298, + 3815920427, + 3391569614, + 3928383900, + 3515267271, + 566280711, + 3940187606, + 3454069534, + 4118630271, + 4000239992, + 116418474, + 1914138554, + 174292421, + 2731055270, + 289380356, + 3203993006, + 460393269, + 320620315, + 685471733, + 587496836, + 852142971, + 1086792851, + 1017036298, + 365543100, + 1126000580, + 2618297676, + 1288033470, + 3409855158, + 1501505948, + 4234509866, + 1607167915, + 987167468, + 1816402316, + 1246189591 + ]; + function crypto_hashblocks_hl(hh, hl, m, n) { + var wh = new Int32Array(16), wl = new Int32Array(16), bh0, bh1, bh2, bh3, bh4, bh5, bh6, bh7, bl0, bl1, bl2, bl3, bl4, bl5, bl6, bl7, th, tl, i, j, h, l, a, b, c, d; + var ah0 = hh[0], ah1 = hh[1], ah2 = hh[2], ah3 = hh[3], ah4 = hh[4], ah5 = hh[5], ah6 = hh[6], ah7 = hh[7], al0 = hl[0], al1 = hl[1], al2 = hl[2], al3 = hl[3], al4 = hl[4], al5 = hl[5], al6 = hl[6], al7 = hl[7]; + var pos = 0; + while (n >= 128) { + for (i = 0; i < 16; i++) { + j = 8 * i + pos; + wh[i] = m[j + 0] << 24 | m[j + 1] << 16 | m[j + 2] << 8 | m[j + 3]; + wl[i] = m[j + 4] << 24 | m[j + 5] << 16 | m[j + 6] << 8 | m[j + 7]; + } + for (i = 0; i < 80; i++) { + bh0 = ah0; + bh1 = ah1; + bh2 = ah2; + bh3 = ah3; + bh4 = ah4; + bh5 = ah5; + bh6 = ah6; + bh7 = ah7; + bl0 = al0; + bl1 = al1; + bl2 = al2; + bl3 = al3; + bl4 = al4; + bl5 = al5; + bl6 = al6; + bl7 = al7; + h = ah7; + l = al7; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = (ah4 >>> 14 | al4 << 32 - 14) ^ (ah4 >>> 18 | al4 << 32 - 18) ^ (al4 >>> 41 - 32 | ah4 << 32 - (41 - 32)); + l = (al4 >>> 14 | ah4 << 32 - 14) ^ (al4 >>> 18 | ah4 << 32 - 18) ^ (ah4 >>> 41 - 32 | al4 << 32 - (41 - 32)); + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + h = ah4 & ah5 ^ ~ah4 & ah6; + l = al4 & al5 ^ ~al4 & al6; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + h = K[i * 2]; + l = K[i * 2 + 1]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + h = wh[i % 16]; + l = wl[i % 16]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + th = c & 65535 | d << 16; + tl = a & 65535 | b << 16; + h = th; + l = tl; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = (ah0 >>> 28 | al0 << 32 - 28) ^ (al0 >>> 34 - 32 | ah0 << 32 - (34 - 32)) ^ (al0 >>> 39 - 32 | ah0 << 32 - (39 - 32)); + l = (al0 >>> 28 | ah0 << 32 - 28) ^ (ah0 >>> 34 - 32 | al0 << 32 - (34 - 32)) ^ (ah0 >>> 39 - 32 | al0 << 32 - (39 - 32)); + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + h = ah0 & ah1 ^ ah0 & ah2 ^ ah1 & ah2; + l = al0 & al1 ^ al0 & al2 ^ al1 & al2; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + bh7 = c & 65535 | d << 16; + bl7 = a & 65535 | b << 16; + h = bh3; + l = bl3; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = th; + l = tl; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + bh3 = c & 65535 | d << 16; + bl3 = a & 65535 | b << 16; + ah1 = bh0; + ah2 = bh1; + ah3 = bh2; + ah4 = bh3; + ah5 = bh4; + ah6 = bh5; + ah7 = bh6; + ah0 = bh7; + al1 = bl0; + al2 = bl1; + al3 = bl2; + al4 = bl3; + al5 = bl4; + al6 = bl5; + al7 = bl6; + al0 = bl7; + if (i % 16 === 15) { + for (j = 0; j < 16; j++) { + h = wh[j]; + l = wl[j]; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = wh[(j + 9) % 16]; + l = wl[(j + 9) % 16]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + th = wh[(j + 1) % 16]; + tl = wl[(j + 1) % 16]; + h = (th >>> 1 | tl << 32 - 1) ^ (th >>> 8 | tl << 32 - 8) ^ th >>> 7; + l = (tl >>> 1 | th << 32 - 1) ^ (tl >>> 8 | th << 32 - 8) ^ (tl >>> 7 | th << 32 - 7); + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + th = wh[(j + 14) % 16]; + tl = wl[(j + 14) % 16]; + h = (th >>> 19 | tl << 32 - 19) ^ (tl >>> 61 - 32 | th << 32 - (61 - 32)) ^ th >>> 6; + l = (tl >>> 19 | th << 32 - 19) ^ (th >>> 61 - 32 | tl << 32 - (61 - 32)) ^ (tl >>> 6 | th << 32 - 6); + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + wh[j] = c & 65535 | d << 16; + wl[j] = a & 65535 | b << 16; + } + } + } + h = ah0; + l = al0; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = hh[0]; + l = hl[0]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + hh[0] = ah0 = c & 65535 | d << 16; + hl[0] = al0 = a & 65535 | b << 16; + h = ah1; + l = al1; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = hh[1]; + l = hl[1]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + hh[1] = ah1 = c & 65535 | d << 16; + hl[1] = al1 = a & 65535 | b << 16; + h = ah2; + l = al2; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = hh[2]; + l = hl[2]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + hh[2] = ah2 = c & 65535 | d << 16; + hl[2] = al2 = a & 65535 | b << 16; + h = ah3; + l = al3; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = hh[3]; + l = hl[3]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + hh[3] = ah3 = c & 65535 | d << 16; + hl[3] = al3 = a & 65535 | b << 16; + h = ah4; + l = al4; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = hh[4]; + l = hl[4]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + hh[4] = ah4 = c & 65535 | d << 16; + hl[4] = al4 = a & 65535 | b << 16; + h = ah5; + l = al5; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = hh[5]; + l = hl[5]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + hh[5] = ah5 = c & 65535 | d << 16; + hl[5] = al5 = a & 65535 | b << 16; + h = ah6; + l = al6; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = hh[6]; + l = hl[6]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + hh[6] = ah6 = c & 65535 | d << 16; + hl[6] = al6 = a & 65535 | b << 16; + h = ah7; + l = al7; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = hh[7]; + l = hl[7]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + hh[7] = ah7 = c & 65535 | d << 16; + hl[7] = al7 = a & 65535 | b << 16; + pos += 128; + n -= 128; + } + return n; + } + function crypto_hash(out, m, n) { + var hh = new Int32Array(8), hl = new Int32Array(8), x = new Uint8Array(256), i, b = n; + hh[0] = 1779033703; + hh[1] = 3144134277; + hh[2] = 1013904242; + hh[3] = 2773480762; + hh[4] = 1359893119; + hh[5] = 2600822924; + hh[6] = 528734635; + hh[7] = 1541459225; + hl[0] = 4089235720; + hl[1] = 2227873595; + hl[2] = 4271175723; + hl[3] = 1595750129; + hl[4] = 2917565137; + hl[5] = 725511199; + hl[6] = 4215389547; + hl[7] = 327033209; + crypto_hashblocks_hl(hh, hl, m, n); + n %= 128; + for (i = 0; i < n; i++) + x[i] = m[b - n + i]; + x[n] = 128; + n = 256 - 128 * (n < 112 ? 1 : 0); + x[n - 9] = 0; + ts64(x, n - 8, b / 536870912 | 0, b << 3); + crypto_hashblocks_hl(hh, hl, x, n); + for (i = 0; i < 8; i++) + ts64(out, 8 * i, hh[i], hl[i]); + return 0; + } + function add(p, q) { + var a = gf(), b = gf(), c = gf(), d = gf(), e = gf(), f = gf(), g = gf(), h = gf(), t = gf(); + Z(a, p[1], p[0]); + Z(t, q[1], q[0]); + M(a, a, t); + A(b, p[0], p[1]); + A(t, q[0], q[1]); + M(b, b, t); + M(c, p[3], q[3]); + M(c, c, D2); + M(d, p[2], q[2]); + A(d, d, d); + Z(e, b, a); + Z(f, d, c); + A(g, d, c); + A(h, b, a); + M(p[0], e, f); + M(p[1], h, g); + M(p[2], g, f); + M(p[3], e, h); + } + function cswap(p, q, b) { + var i; + for (i = 0; i < 4; i++) { + sel25519(p[i], q[i], b); + } + } + function pack(r, p) { + var tx = gf(), ty = gf(), zi = gf(); + inv25519(zi, p[2]); + M(tx, p[0], zi); + M(ty, p[1], zi); + pack25519(r, ty); + r[31] ^= par25519(tx) << 7; + } + function scalarmult(p, q, s) { + var b, i; + set25519(p[0], gf0); + set25519(p[1], gf1); + set25519(p[2], gf1); + set25519(p[3], gf0); + for (i = 255; i >= 0; --i) { + b = s[i / 8 | 0] >> (i & 7) & 1; + cswap(p, q, b); + add(q, p); + add(p, p); + cswap(p, q, b); + } + } + function scalarbase(p, s) { + var q = [gf(), gf(), gf(), gf()]; + set25519(q[0], X); + set25519(q[1], Y); + set25519(q[2], gf1); + M(q[3], X, Y); + scalarmult(p, q, s); + } + function crypto_sign_keypair(pk, sk, seeded) { + var d = new Uint8Array(64); + var p = [gf(), gf(), gf(), gf()]; + var i; + if (!seeded) + randombytes(sk, 32); + crypto_hash(d, sk, 32); + d[0] &= 248; + d[31] &= 127; + d[31] |= 64; + scalarbase(p, d); + pack(pk, p); + for (i = 0; i < 32; i++) + sk[i + 32] = pk[i]; + return 0; + } + var L4 = new Float64Array([237, 211, 245, 92, 26, 99, 18, 88, 214, 156, 247, 162, 222, 249, 222, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16]); + function modL(r, x) { + var carry, i, j, k; + for (i = 63; i >= 32; --i) { + carry = 0; + for (j = i - 32, k = i - 12; j < k; ++j) { + x[j] += carry - 16 * x[i] * L4[j - (i - 32)]; + carry = Math.floor((x[j] + 128) / 256); + x[j] -= carry * 256; + } + x[j] += carry; + x[i] = 0; + } + carry = 0; + for (j = 0; j < 32; j++) { + x[j] += carry - (x[31] >> 4) * L4[j]; + carry = x[j] >> 8; + x[j] &= 255; + } + for (j = 0; j < 32; j++) + x[j] -= carry * L4[j]; + for (i = 0; i < 32; i++) { + x[i + 1] += x[i] >> 8; + r[i] = x[i] & 255; + } + } + function reduce(r) { + var x = new Float64Array(64), i; + for (i = 0; i < 64; i++) + x[i] = r[i]; + for (i = 0; i < 64; i++) + r[i] = 0; + modL(r, x); + } + function crypto_sign(sm, m, n, sk) { + var d = new Uint8Array(64), h = new Uint8Array(64), r = new Uint8Array(64); + var i, j, x = new Float64Array(64); + var p = [gf(), gf(), gf(), gf()]; + crypto_hash(d, sk, 32); + d[0] &= 248; + d[31] &= 127; + d[31] |= 64; + var smlen = n + 64; + for (i = 0; i < n; i++) + sm[64 + i] = m[i]; + for (i = 0; i < 32; i++) + sm[32 + i] = d[32 + i]; + crypto_hash(r, sm.subarray(32), n + 32); + reduce(r); + scalarbase(p, r); + pack(sm, p); + for (i = 32; i < 64; i++) + sm[i] = sk[i]; + crypto_hash(h, sm, n + 64); + reduce(h); + for (i = 0; i < 64; i++) + x[i] = 0; + for (i = 0; i < 32; i++) + x[i] = r[i]; + for (i = 0; i < 32; i++) { + for (j = 0; j < 32; j++) { + x[i + j] += h[i] * d[j]; + } + } + modL(sm.subarray(32), x); + return smlen; + } + function unpackneg(r, p) { + var t = gf(), chk = gf(), num = gf(), den = gf(), den2 = gf(), den4 = gf(), den6 = gf(); + set25519(r[2], gf1); + unpack25519(r[1], p); + S(num, r[1]); + M(den, num, D); + Z(num, num, r[2]); + A(den, r[2], den); + S(den2, den); + S(den4, den2); + M(den6, den4, den2); + M(t, den6, num); + M(t, t, den); + pow2523(t, t); + M(t, t, num); + M(t, t, den); + M(t, t, den); + M(r[0], t, den); + S(chk, r[0]); + M(chk, chk, den); + if (neq25519(chk, num)) + M(r[0], r[0], I); + S(chk, r[0]); + M(chk, chk, den); + if (neq25519(chk, num)) + return -1; + if (par25519(r[0]) === p[31] >> 7) + Z(r[0], gf0, r[0]); + M(r[3], r[0], r[1]); + return 0; + } + function crypto_sign_open(m, sm, n, pk) { + var i; + var t = new Uint8Array(32), h = new Uint8Array(64); + var p = [gf(), gf(), gf(), gf()], q = [gf(), gf(), gf(), gf()]; + if (n < 64) + return -1; + if (unpackneg(q, pk)) + return -1; + for (i = 0; i < n; i++) + m[i] = sm[i]; + for (i = 0; i < 32; i++) + m[i + 32] = pk[i]; + crypto_hash(h, m, n); + reduce(h); + scalarmult(p, q, h); + scalarbase(q, sm.subarray(32)); + add(p, q); + pack(t, p); + n -= 64; + if (crypto_verify_32(sm, 0, t, 0)) { + for (i = 0; i < n; i++) + m[i] = 0; + return -1; + } + for (i = 0; i < n; i++) + m[i] = sm[i + 64]; + return n; + } + var crypto_secretbox_KEYBYTES = 32, crypto_secretbox_NONCEBYTES = 24, crypto_secretbox_ZEROBYTES = 32, crypto_secretbox_BOXZEROBYTES = 16, crypto_scalarmult_BYTES = 32, crypto_scalarmult_SCALARBYTES = 32, crypto_box_PUBLICKEYBYTES = 32, crypto_box_SECRETKEYBYTES = 32, crypto_box_BEFORENMBYTES = 32, crypto_box_NONCEBYTES = crypto_secretbox_NONCEBYTES, crypto_box_ZEROBYTES = crypto_secretbox_ZEROBYTES, crypto_box_BOXZEROBYTES = crypto_secretbox_BOXZEROBYTES, crypto_sign_BYTES = 64, crypto_sign_PUBLICKEYBYTES = 32, crypto_sign_SECRETKEYBYTES = 64, crypto_sign_SEEDBYTES = 32, crypto_hash_BYTES = 64; + nacl2.lowlevel = { + crypto_core_hsalsa20, + crypto_stream_xor, + crypto_stream, + crypto_stream_salsa20_xor, + crypto_stream_salsa20, + crypto_onetimeauth, + crypto_onetimeauth_verify, + crypto_verify_16, + crypto_verify_32, + crypto_secretbox, + crypto_secretbox_open, + crypto_scalarmult, + crypto_scalarmult_base, + crypto_box_beforenm, + crypto_box_afternm, + crypto_box, + crypto_box_open, + crypto_box_keypair, + crypto_hash, + crypto_sign, + crypto_sign_keypair, + crypto_sign_open, + crypto_secretbox_KEYBYTES, + crypto_secretbox_NONCEBYTES, + crypto_secretbox_ZEROBYTES, + crypto_secretbox_BOXZEROBYTES, + crypto_scalarmult_BYTES, + crypto_scalarmult_SCALARBYTES, + crypto_box_PUBLICKEYBYTES, + crypto_box_SECRETKEYBYTES, + crypto_box_BEFORENMBYTES, + crypto_box_NONCEBYTES, + crypto_box_ZEROBYTES, + crypto_box_BOXZEROBYTES, + crypto_sign_BYTES, + crypto_sign_PUBLICKEYBYTES, + crypto_sign_SECRETKEYBYTES, + crypto_sign_SEEDBYTES, + crypto_hash_BYTES, + gf, + D, + L: L4, + pack25519, + unpack25519, + M, + A, + S, + Z, + pow2523, + add, + set25519, + modL, + scalarmult, + scalarbase + }; + function checkLengths(k, n) { + if (k.length !== crypto_secretbox_KEYBYTES) + throw new Error("bad key size"); + if (n.length !== crypto_secretbox_NONCEBYTES) + throw new Error("bad nonce size"); + } + function checkBoxLengths(pk, sk) { + if (pk.length !== crypto_box_PUBLICKEYBYTES) + throw new Error("bad public key size"); + if (sk.length !== crypto_box_SECRETKEYBYTES) + throw new Error("bad secret key size"); + } + function checkArrayTypes() { + for (var i = 0; i < arguments.length; i++) { + if (!(arguments[i] instanceof Uint8Array)) + throw new TypeError("unexpected type, use Uint8Array"); + } + } + function cleanup(arr) { + for (var i = 0; i < arr.length; i++) + arr[i] = 0; + } + nacl2.randomBytes = function(n) { + var b = new Uint8Array(n); + randombytes(b, n); + return b; + }; + nacl2.secretbox = function(msg, nonce, key) { + checkArrayTypes(msg, nonce, key); + checkLengths(key, nonce); + var m = new Uint8Array(crypto_secretbox_ZEROBYTES + msg.length); + var c = new Uint8Array(m.length); + for (var i = 0; i < msg.length; i++) + m[i + crypto_secretbox_ZEROBYTES] = msg[i]; + crypto_secretbox(c, m, m.length, nonce, key); + return c.subarray(crypto_secretbox_BOXZEROBYTES); + }; + nacl2.secretbox.open = function(box, nonce, key) { + checkArrayTypes(box, nonce, key); + checkLengths(key, nonce); + var c = new Uint8Array(crypto_secretbox_BOXZEROBYTES + box.length); + var m = new Uint8Array(c.length); + for (var i = 0; i < box.length; i++) + c[i + crypto_secretbox_BOXZEROBYTES] = box[i]; + if (c.length < 32) + return null; + if (crypto_secretbox_open(m, c, c.length, nonce, key) !== 0) + return null; + return m.subarray(crypto_secretbox_ZEROBYTES); + }; + nacl2.secretbox.keyLength = crypto_secretbox_KEYBYTES; + nacl2.secretbox.nonceLength = crypto_secretbox_NONCEBYTES; + nacl2.secretbox.overheadLength = crypto_secretbox_BOXZEROBYTES; + nacl2.scalarMult = function(n, p) { + checkArrayTypes(n, p); + if (n.length !== crypto_scalarmult_SCALARBYTES) + throw new Error("bad n size"); + if (p.length !== crypto_scalarmult_BYTES) + throw new Error("bad p size"); + var q = new Uint8Array(crypto_scalarmult_BYTES); + crypto_scalarmult(q, n, p); + return q; + }; + nacl2.scalarMult.base = function(n) { + checkArrayTypes(n); + if (n.length !== crypto_scalarmult_SCALARBYTES) + throw new Error("bad n size"); + var q = new Uint8Array(crypto_scalarmult_BYTES); + crypto_scalarmult_base(q, n); + return q; + }; + nacl2.scalarMult.scalarLength = crypto_scalarmult_SCALARBYTES; + nacl2.scalarMult.groupElementLength = crypto_scalarmult_BYTES; + nacl2.box = function(msg, nonce, publicKey, secretKey) { + var k = nacl2.box.before(publicKey, secretKey); + return nacl2.secretbox(msg, nonce, k); + }; + nacl2.box.before = function(publicKey, secretKey) { + checkArrayTypes(publicKey, secretKey); + checkBoxLengths(publicKey, secretKey); + var k = new Uint8Array(crypto_box_BEFORENMBYTES); + crypto_box_beforenm(k, publicKey, secretKey); + return k; + }; + nacl2.box.after = nacl2.secretbox; + nacl2.box.open = function(msg, nonce, publicKey, secretKey) { + var k = nacl2.box.before(publicKey, secretKey); + return nacl2.secretbox.open(msg, nonce, k); + }; + nacl2.box.open.after = nacl2.secretbox.open; + nacl2.box.keyPair = function() { + var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES); + var sk = new Uint8Array(crypto_box_SECRETKEYBYTES); + crypto_box_keypair(pk, sk); + return { publicKey: pk, secretKey: sk }; + }; + nacl2.box.keyPair.fromSecretKey = function(secretKey) { + checkArrayTypes(secretKey); + if (secretKey.length !== crypto_box_SECRETKEYBYTES) + throw new Error("bad secret key size"); + var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES); + crypto_scalarmult_base(pk, secretKey); + return { publicKey: pk, secretKey: new Uint8Array(secretKey) }; + }; + nacl2.box.publicKeyLength = crypto_box_PUBLICKEYBYTES; + nacl2.box.secretKeyLength = crypto_box_SECRETKEYBYTES; + nacl2.box.sharedKeyLength = crypto_box_BEFORENMBYTES; + nacl2.box.nonceLength = crypto_box_NONCEBYTES; + nacl2.box.overheadLength = nacl2.secretbox.overheadLength; + nacl2.sign = function(msg, secretKey) { + checkArrayTypes(msg, secretKey); + if (secretKey.length !== crypto_sign_SECRETKEYBYTES) + throw new Error("bad secret key size"); + var signedMsg = new Uint8Array(crypto_sign_BYTES + msg.length); + crypto_sign(signedMsg, msg, msg.length, secretKey); + return signedMsg; + }; + nacl2.sign.open = function(signedMsg, publicKey) { + checkArrayTypes(signedMsg, publicKey); + if (publicKey.length !== crypto_sign_PUBLICKEYBYTES) + throw new Error("bad public key size"); + var tmp = new Uint8Array(signedMsg.length); + var mlen = crypto_sign_open(tmp, signedMsg, signedMsg.length, publicKey); + if (mlen < 0) + return null; + var m = new Uint8Array(mlen); + for (var i = 0; i < m.length; i++) + m[i] = tmp[i]; + return m; + }; + nacl2.sign.detached = function(msg, secretKey) { + var signedMsg = nacl2.sign(msg, secretKey); + var sig = new Uint8Array(crypto_sign_BYTES); + for (var i = 0; i < sig.length; i++) + sig[i] = signedMsg[i]; + return sig; + }; + nacl2.sign.detached.verify = function(msg, sig, publicKey) { + checkArrayTypes(msg, sig, publicKey); + if (sig.length !== crypto_sign_BYTES) + throw new Error("bad signature size"); + if (publicKey.length !== crypto_sign_PUBLICKEYBYTES) + throw new Error("bad public key size"); + var sm = new Uint8Array(crypto_sign_BYTES + msg.length); + var m = new Uint8Array(crypto_sign_BYTES + msg.length); + var i; + for (i = 0; i < crypto_sign_BYTES; i++) + sm[i] = sig[i]; + for (i = 0; i < msg.length; i++) + sm[i + crypto_sign_BYTES] = msg[i]; + return crypto_sign_open(m, sm, sm.length, publicKey) >= 0; + }; + nacl2.sign.keyPair = function() { + var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES); + var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES); + crypto_sign_keypair(pk, sk); + return { publicKey: pk, secretKey: sk }; + }; + nacl2.sign.keyPair.fromSecretKey = function(secretKey) { + checkArrayTypes(secretKey); + if (secretKey.length !== crypto_sign_SECRETKEYBYTES) + throw new Error("bad secret key size"); + var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES); + for (var i = 0; i < pk.length; i++) + pk[i] = secretKey[32 + i]; + return { publicKey: pk, secretKey: new Uint8Array(secretKey) }; + }; + nacl2.sign.keyPair.fromSeed = function(seed) { + checkArrayTypes(seed); + if (seed.length !== crypto_sign_SEEDBYTES) + throw new Error("bad seed size"); + var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES); + var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES); + for (var i = 0; i < 32; i++) + sk[i] = seed[i]; + crypto_sign_keypair(pk, sk, true); + return { publicKey: pk, secretKey: sk }; + }; + nacl2.sign.publicKeyLength = crypto_sign_PUBLICKEYBYTES; + nacl2.sign.secretKeyLength = crypto_sign_SECRETKEYBYTES; + nacl2.sign.seedLength = crypto_sign_SEEDBYTES; + nacl2.sign.signatureLength = crypto_sign_BYTES; + nacl2.hash = function(msg) { + checkArrayTypes(msg); + var h = new Uint8Array(crypto_hash_BYTES); + crypto_hash(h, msg, msg.length); + return h; + }; + nacl2.hash.hashLength = crypto_hash_BYTES; + nacl2.verify = function(x, y) { + checkArrayTypes(x, y); + if (x.length === 0 || y.length === 0) + return false; + if (x.length !== y.length) + return false; + return vn(x, 0, y, 0, x.length) === 0 ? true : false; + }; + nacl2.setPRNG = function(fn) { + randombytes = fn; + }; + (function() { + var crypto2 = typeof self !== "undefined" ? self.crypto || self.msCrypto : null; + if (crypto2 && crypto2.getRandomValues) { + var QUOTA = 65536; + nacl2.setPRNG(function(x, n) { + var i, v = new Uint8Array(n); + for (i = 0; i < n; i += QUOTA) { + crypto2.getRandomValues(v.subarray(i, i + Math.min(n - i, QUOTA))); + } + for (i = 0; i < n; i++) + x[i] = v[i]; + cleanup(v); + }); + } else if (typeof __require !== "undefined") { + crypto2 = require_crypto(); + if (crypto2 && crypto2.randomBytes) { + nacl2.setPRNG(function(x, n) { + var i, v = crypto2.randomBytes(n); + for (i = 0; i < n; i++) + x[i] = v[i]; + cleanup(v); + }); + } + } + })(); + })(typeof module !== "undefined" && module.exports ? module.exports : self.nacl = self.nacl || {}); + } + }); + + // node_modules/scrypt-async/scrypt-async.js + var require_scrypt_async = __commonJS({ + "node_modules/scrypt-async/scrypt-async.js"(exports, module) { + function scrypt2(password, salt, logN, r, dkLen, interruptStep, callback, encoding) { + "use strict"; + function SHA256(m) { + var K = [ + 1116352408, + 1899447441, + 3049323471, + 3921009573, + 961987163, + 1508970993, + 2453635748, + 2870763221, + 3624381080, + 310598401, + 607225278, + 1426881987, + 1925078388, + 2162078206, + 2614888103, + 3248222580, + 3835390401, + 4022224774, + 264347078, + 604807628, + 770255983, + 1249150122, + 1555081692, + 1996064986, + 2554220882, + 2821834349, + 2952996808, + 3210313671, + 3336571891, + 3584528711, + 113926993, + 338241895, + 666307205, + 773529912, + 1294757372, + 1396182291, + 1695183700, + 1986661051, + 2177026350, + 2456956037, + 2730485921, + 2820302411, + 3259730800, + 3345764771, + 3516065817, + 3600352804, + 4094571909, + 275423344, + 430227734, + 506948616, + 659060556, + 883997877, + 958139571, + 1322822218, + 1537002063, + 1747873779, + 1955562222, + 2024104815, + 2227730452, + 2361852424, + 2428436474, + 2756734187, + 3204031479, + 3329325298 + ]; + var h0 = 1779033703, h1 = 3144134277, h2 = 1013904242, h3 = 2773480762, h4 = 1359893119, h5 = 2600822924, h6 = 528734635, h7 = 1541459225, w = new Array(64); + function blocks(p3) { + var off = 0, len = p3.length; + while (len >= 64) { + var a = h0, b = h1, c = h2, d = h3, e = h4, f = h5, g = h6, h = h7, u, i2, j, t1, t2; + for (i2 = 0; i2 < 16; i2++) { + j = off + i2 * 4; + w[i2] = (p3[j] & 255) << 24 | (p3[j + 1] & 255) << 16 | (p3[j + 2] & 255) << 8 | p3[j + 3] & 255; + } + for (i2 = 16; i2 < 64; i2++) { + u = w[i2 - 2]; + t1 = (u >>> 17 | u << 32 - 17) ^ (u >>> 19 | u << 32 - 19) ^ u >>> 10; + u = w[i2 - 15]; + t2 = (u >>> 7 | u << 32 - 7) ^ (u >>> 18 | u << 32 - 18) ^ u >>> 3; + w[i2] = (t1 + w[i2 - 7] | 0) + (t2 + w[i2 - 16] | 0) | 0; + } + for (i2 = 0; i2 < 64; i2++) { + t1 = (((e >>> 6 | e << 32 - 6) ^ (e >>> 11 | e << 32 - 11) ^ (e >>> 25 | e << 32 - 25)) + (e & f ^ ~e & g) | 0) + (h + (K[i2] + w[i2] | 0) | 0) | 0; + t2 = ((a >>> 2 | a << 32 - 2) ^ (a >>> 13 | a << 32 - 13) ^ (a >>> 22 | a << 32 - 22)) + (a & b ^ a & c ^ b & c) | 0; + h = g; + g = f; + f = e; + e = d + t1 | 0; + d = c; + c = b; + b = a; + a = t1 + t2 | 0; + } + h0 = h0 + a | 0; + h1 = h1 + b | 0; + h2 = h2 + c | 0; + h3 = h3 + d | 0; + h4 = h4 + e | 0; + h5 = h5 + f | 0; + h6 = h6 + g | 0; + h7 = h7 + h | 0; + off += 64; + len -= 64; + } + } + blocks(m); + var i, bytesLeft = m.length % 64, bitLenHi = m.length / 536870912 | 0, bitLenLo = m.length << 3, numZeros = bytesLeft < 56 ? 56 : 120, p2 = m.slice(m.length - bytesLeft, m.length); + p2.push(128); + for (i = bytesLeft + 1; i < numZeros; i++) + p2.push(0); + p2.push(bitLenHi >>> 24 & 255); + p2.push(bitLenHi >>> 16 & 255); + p2.push(bitLenHi >>> 8 & 255); + p2.push(bitLenHi >>> 0 & 255); + p2.push(bitLenLo >>> 24 & 255); + p2.push(bitLenLo >>> 16 & 255); + p2.push(bitLenLo >>> 8 & 255); + p2.push(bitLenLo >>> 0 & 255); + blocks(p2); + return [ + h0 >>> 24 & 255, + h0 >>> 16 & 255, + h0 >>> 8 & 255, + h0 >>> 0 & 255, + h1 >>> 24 & 255, + h1 >>> 16 & 255, + h1 >>> 8 & 255, + h1 >>> 0 & 255, + h2 >>> 24 & 255, + h2 >>> 16 & 255, + h2 >>> 8 & 255, + h2 >>> 0 & 255, + h3 >>> 24 & 255, + h3 >>> 16 & 255, + h3 >>> 8 & 255, + h3 >>> 0 & 255, + h4 >>> 24 & 255, + h4 >>> 16 & 255, + h4 >>> 8 & 255, + h4 >>> 0 & 255, + h5 >>> 24 & 255, + h5 >>> 16 & 255, + h5 >>> 8 & 255, + h5 >>> 0 & 255, + h6 >>> 24 & 255, + h6 >>> 16 & 255, + h6 >>> 8 & 255, + h6 >>> 0 & 255, + h7 >>> 24 & 255, + h7 >>> 16 & 255, + h7 >>> 8 & 255, + h7 >>> 0 & 255 + ]; + } + function PBKDF2_HMAC_SHA256_OneIter(password2, salt2, dkLen2) { + if (password2.length > 64) { + password2 = SHA256(password2.push ? password2 : Array.prototype.slice.call(password2, 0)); + } + var i, innerLen = 64 + salt2.length + 4, inner = new Array(innerLen), outerKey = new Array(64), dk = []; + for (i = 0; i < 64; i++) + inner[i] = 54; + for (i = 0; i < password2.length; i++) + inner[i] ^= password2[i]; + for (i = 0; i < salt2.length; i++) + inner[64 + i] = salt2[i]; + for (i = innerLen - 4; i < innerLen; i++) + inner[i] = 0; + for (i = 0; i < 64; i++) + outerKey[i] = 92; + for (i = 0; i < password2.length; i++) + outerKey[i] ^= password2[i]; + function incrementCounter() { + for (var i2 = innerLen - 1; i2 >= innerLen - 4; i2--) { + inner[i2]++; + if (inner[i2] <= 255) + return; + inner[i2] = 0; + } + } + while (dkLen2 >= 32) { + incrementCounter(); + dk = dk.concat(SHA256(outerKey.concat(SHA256(inner)))); + dkLen2 -= 32; + } + if (dkLen2 > 0) { + incrementCounter(); + dk = dk.concat(SHA256(outerKey.concat(SHA256(inner))).slice(0, dkLen2)); + } + return dk; + } + function salsaXOR(tmp2, B2, bin, bout) { + var j0 = tmp2[0] ^ B2[bin++], j1 = tmp2[1] ^ B2[bin++], j2 = tmp2[2] ^ B2[bin++], j3 = tmp2[3] ^ B2[bin++], j4 = tmp2[4] ^ B2[bin++], j5 = tmp2[5] ^ B2[bin++], j6 = tmp2[6] ^ B2[bin++], j7 = tmp2[7] ^ B2[bin++], j8 = tmp2[8] ^ B2[bin++], j9 = tmp2[9] ^ B2[bin++], j10 = tmp2[10] ^ B2[bin++], j11 = tmp2[11] ^ B2[bin++], j12 = tmp2[12] ^ B2[bin++], j13 = tmp2[13] ^ B2[bin++], j14 = tmp2[14] ^ B2[bin++], j15 = tmp2[15] ^ B2[bin++], u, i; + var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7, x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14, x15 = j15; + for (i = 0; i < 8; i += 2) { + u = x0 + x12; + x4 ^= u << 7 | u >>> 32 - 7; + u = x4 + x0; + x8 ^= u << 9 | u >>> 32 - 9; + u = x8 + x4; + x12 ^= u << 13 | u >>> 32 - 13; + u = x12 + x8; + x0 ^= u << 18 | u >>> 32 - 18; + u = x5 + x1; + x9 ^= u << 7 | u >>> 32 - 7; + u = x9 + x5; + x13 ^= u << 9 | u >>> 32 - 9; + u = x13 + x9; + x1 ^= u << 13 | u >>> 32 - 13; + u = x1 + x13; + x5 ^= u << 18 | u >>> 32 - 18; + u = x10 + x6; + x14 ^= u << 7 | u >>> 32 - 7; + u = x14 + x10; + x2 ^= u << 9 | u >>> 32 - 9; + u = x2 + x14; + x6 ^= u << 13 | u >>> 32 - 13; + u = x6 + x2; + x10 ^= u << 18 | u >>> 32 - 18; + u = x15 + x11; + x3 ^= u << 7 | u >>> 32 - 7; + u = x3 + x15; + x7 ^= u << 9 | u >>> 32 - 9; + u = x7 + x3; + x11 ^= u << 13 | u >>> 32 - 13; + u = x11 + x7; + x15 ^= u << 18 | u >>> 32 - 18; + u = x0 + x3; + x1 ^= u << 7 | u >>> 32 - 7; + u = x1 + x0; + x2 ^= u << 9 | u >>> 32 - 9; + u = x2 + x1; + x3 ^= u << 13 | u >>> 32 - 13; + u = x3 + x2; + x0 ^= u << 18 | u >>> 32 - 18; + u = x5 + x4; + x6 ^= u << 7 | u >>> 32 - 7; + u = x6 + x5; + x7 ^= u << 9 | u >>> 32 - 9; + u = x7 + x6; + x4 ^= u << 13 | u >>> 32 - 13; + u = x4 + x7; + x5 ^= u << 18 | u >>> 32 - 18; + u = x10 + x9; + x11 ^= u << 7 | u >>> 32 - 7; + u = x11 + x10; + x8 ^= u << 9 | u >>> 32 - 9; + u = x8 + x11; + x9 ^= u << 13 | u >>> 32 - 13; + u = x9 + x8; + x10 ^= u << 18 | u >>> 32 - 18; + u = x15 + x14; + x12 ^= u << 7 | u >>> 32 - 7; + u = x12 + x15; + x13 ^= u << 9 | u >>> 32 - 9; + u = x13 + x12; + x14 ^= u << 13 | u >>> 32 - 13; + u = x14 + x13; + x15 ^= u << 18 | u >>> 32 - 18; + } + B2[bout++] = tmp2[0] = x0 + j0 | 0; + B2[bout++] = tmp2[1] = x1 + j1 | 0; + B2[bout++] = tmp2[2] = x2 + j2 | 0; + B2[bout++] = tmp2[3] = x3 + j3 | 0; + B2[bout++] = tmp2[4] = x4 + j4 | 0; + B2[bout++] = tmp2[5] = x5 + j5 | 0; + B2[bout++] = tmp2[6] = x6 + j6 | 0; + B2[bout++] = tmp2[7] = x7 + j7 | 0; + B2[bout++] = tmp2[8] = x8 + j8 | 0; + B2[bout++] = tmp2[9] = x9 + j9 | 0; + B2[bout++] = tmp2[10] = x10 + j10 | 0; + B2[bout++] = tmp2[11] = x11 + j11 | 0; + B2[bout++] = tmp2[12] = x12 + j12 | 0; + B2[bout++] = tmp2[13] = x13 + j13 | 0; + B2[bout++] = tmp2[14] = x14 + j14 | 0; + B2[bout++] = tmp2[15] = x15 + j15 | 0; + } + function blockCopy(dst, di, src2, si, len) { + while (len--) + dst[di++] = src2[si++]; + } + function blockXOR(dst, di, src2, si, len) { + while (len--) + dst[di++] ^= src2[si++]; + } + function blockMix(tmp2, B2, bin, bout, r2) { + blockCopy(tmp2, 0, B2, bin + (2 * r2 - 1) * 16, 16); + for (var i = 0; i < 2 * r2; i += 2) { + salsaXOR(tmp2, B2, bin + i * 16, bout + i * 8); + salsaXOR(tmp2, B2, bin + i * 16 + 16, bout + i * 8 + r2 * 16); + } + } + function integerify(B2, bi, r2) { + return B2[bi + (2 * r2 - 1) * 16]; + } + function stringToUTF8Bytes(s) { + var arr = []; + for (var i = 0; i < s.length; i++) { + var c = s.charCodeAt(i); + if (c < 128) { + arr.push(c); + } else if (c < 2048) { + arr.push(192 | c >> 6); + arr.push(128 | c & 63); + } else if (c < 55296) { + arr.push(224 | c >> 12); + arr.push(128 | c >> 6 & 63); + arr.push(128 | c & 63); + } else { + if (i >= s.length - 1) { + throw new Error("invalid string"); + } + i++; + c = (c & 1023) << 10; + c |= s.charCodeAt(i) & 1023; + c += 65536; + arr.push(240 | c >> 18); + arr.push(128 | c >> 12 & 63); + arr.push(128 | c >> 6 & 63); + arr.push(128 | c & 63); + } + } + return arr; + } + function bytesToHex(p2) { + var enc = "0123456789abcdef".split(""); + var len = p2.length, arr = [], i = 0; + for (; i < len; i++) { + arr.push(enc[p2[i] >>> 4 & 15]); + arr.push(enc[p2[i] >>> 0 & 15]); + } + return arr.join(""); + } + function bytesToBase64(p2) { + var enc = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""); + var len = p2.length, arr = [], i = 0, a, b, c, t; + while (i < len) { + a = i < len ? p2[i++] : 0; + b = i < len ? p2[i++] : 0; + c = i < len ? p2[i++] : 0; + t = (a << 16) + (b << 8) + c; + arr.push(enc[t >>> 3 * 6 & 63]); + arr.push(enc[t >>> 2 * 6 & 63]); + arr.push(enc[t >>> 1 * 6 & 63]); + arr.push(enc[t >>> 0 * 6 & 63]); + } + if (len % 3 > 0) { + arr[arr.length - 1] = "="; + if (len % 3 === 1) + arr[arr.length - 2] = "="; + } + return arr.join(""); + } + var MAX_UINT = -1 >>> 0, p = 1; + if (typeof logN === "object") { + if (arguments.length > 4) { + throw new Error("scrypt: incorrect number of arguments"); + } + var opts = logN; + callback = r; + logN = opts.logN; + if (typeof logN === "undefined") { + if (typeof opts.N !== "undefined") { + if (opts.N < 2 || opts.N > MAX_UINT) + throw new Error("scrypt: N is out of range"); + if ((opts.N & opts.N - 1) !== 0) + throw new Error("scrypt: N is not a power of 2"); + logN = Math.log(opts.N) / Math.LN2; + } else { + throw new Error("scrypt: missing N parameter"); + } + } + p = opts.p || 1; + r = opts.r; + dkLen = opts.dkLen || 32; + interruptStep = opts.interruptStep || 0; + encoding = opts.encoding; + } + if (p < 1) + throw new Error("scrypt: invalid p"); + if (r <= 0) + throw new Error("scrypt: invalid r"); + if (logN < 1 || logN > 31) + throw new Error("scrypt: logN must be between 1 and 31"); + var N = 1 << logN >>> 0, XY, V, B, tmp; + if (r * p >= 1 << 30 || r > MAX_UINT / 128 / p || r > MAX_UINT / 256 || N > MAX_UINT / 128 / r) + throw new Error("scrypt: parameters are too large"); + if (typeof password === "string") + password = stringToUTF8Bytes(password); + if (typeof salt === "string") + salt = stringToUTF8Bytes(salt); + if (typeof Int32Array !== "undefined") { + XY = new Int32Array(64 * r); + V = new Int32Array(32 * N * r); + tmp = new Int32Array(16); + } else { + XY = []; + V = []; + tmp = new Array(16); + } + B = PBKDF2_HMAC_SHA256_OneIter(password, salt, p * 128 * r); + var xi = 0, yi = 32 * r; + function smixStart(pos) { + for (var i = 0; i < 32 * r; i++) { + var j = pos + i * 4; + XY[xi + i] = (B[j + 3] & 255) << 24 | (B[j + 2] & 255) << 16 | (B[j + 1] & 255) << 8 | (B[j + 0] & 255) << 0; + } + } + function smixStep1(start, end) { + for (var i = start; i < end; i += 2) { + blockCopy(V, i * (32 * r), XY, xi, 32 * r); + blockMix(tmp, XY, xi, yi, r); + blockCopy(V, (i + 1) * (32 * r), XY, yi, 32 * r); + blockMix(tmp, XY, yi, xi, r); + } + } + function smixStep2(start, end) { + for (var i = start; i < end; i += 2) { + var j = integerify(XY, xi, r) & N - 1; + blockXOR(XY, xi, V, j * (32 * r), 32 * r); + blockMix(tmp, XY, xi, yi, r); + j = integerify(XY, yi, r) & N - 1; + blockXOR(XY, yi, V, j * (32 * r), 32 * r); + blockMix(tmp, XY, yi, xi, r); + } + } + function smixFinish(pos) { + for (var i = 0; i < 32 * r; i++) { + var j = XY[xi + i]; + B[pos + i * 4 + 0] = j >>> 0 & 255; + B[pos + i * 4 + 1] = j >>> 8 & 255; + B[pos + i * 4 + 2] = j >>> 16 & 255; + B[pos + i * 4 + 3] = j >>> 24 & 255; + } + } + var nextTick = typeof setImmediate !== "undefined" ? setImmediate : setTimeout; + function interruptedFor(start, end, step, fn, donefn) { + (function performStep() { + nextTick(function() { + fn(start, start + step < end ? start + step : end); + start += step; + if (start < end) + performStep(); + else + donefn(); + }); + })(); + } + function getResult(enc) { + var result = PBKDF2_HMAC_SHA256_OneIter(password, B, dkLen); + if (enc === "base64") + return bytesToBase64(result); + else if (enc === "hex") + return bytesToHex(result); + else if (enc === "binary") + return new Uint8Array(result); + else + return result; + } + function calculateSync() { + for (var i = 0; i < p; i++) { + smixStart(i * 128 * r); + smixStep1(0, N); + smixStep2(0, N); + smixFinish(i * 128 * r); + } + callback(getResult(encoding)); + } + function calculateAsync(i) { + smixStart(i * 128 * r); + interruptedFor(0, N, interruptStep * 2, smixStep1, function() { + interruptedFor(0, N, interruptStep * 2, smixStep2, function() { + smixFinish(i * 128 * r); + if (i + 1 < p) { + nextTick(function() { + calculateAsync(i + 1); + }); + } else { + callback(getResult(encoding)); + } + }); + }); + } + if (typeof interruptStep === "function") { + encoding = callback; + callback = interruptStep; + interruptStep = 1e3; + } + if (interruptStep <= 0) { + calculateSync(); + } else { + calculateAsync(0); + } + } + if (typeof module !== "undefined") + module.exports = scrypt2; + } + }); + + // frontend/model/contracts/chatroom.js + var import_common3 = __require("@common/common.js"); + var import_sbp5 = __toESM(__require("@sbp/sbp")); + + // frontend/utils/events.js + var NEW_CHATROOM_UNREAD_POSITION = "new-chatroom-unread-position"; + + // frontend/model/contracts/misc/flowTyper.js + var EMPTY_VALUE = Symbol("@@empty"); + var isEmpty = (v) => v === EMPTY_VALUE; + var isNil = (v) => v === null; + var isUndef = (v) => typeof v === "undefined"; + var isBoolean = (v) => typeof v === "boolean"; + var isNumber = (v) => typeof v === "number"; + var isString = (v) => typeof v === "string"; + var isObject = (v) => !isNil(v) && typeof v === "object"; + var isFunction = (v) => typeof v === "function"; + var getType = (typeFn, _options) => { + if (isFunction(typeFn.type)) + return typeFn.type(_options); + return typeFn.name || "?"; + }; + var TypeValidatorError = class extends Error { + expectedType; + valueType; + value; + typeScope; + sourceFile; + constructor(message, expectedType, valueType, value, typeName = "", typeScope = "") { + const errMessage = message || `invalid "${valueType}" value type; ${typeName || expectedType} type expected`; + super(errMessage); + this.expectedType = expectedType; + this.valueType = valueType; + this.value = value; + this.typeScope = typeScope || ""; + this.sourceFile = this.getSourceFile(); + this.message = `${errMessage} +${this.getErrorInfo()}`; + this.name = this.constructor.name; + if (Error.captureStackTrace) { + Error.captureStackTrace(this, TypeValidatorError); + } + } + getSourceFile() { + const fileNames = this.stack.match(/(\/[\w_\-.]+)+(\.\w+:\d+:\d+)/g) || []; + return fileNames.find((fileName) => fileName.indexOf("/flowTyper-js/dist/") === -1) || ""; + } + getErrorInfo() { + return ` + file ${this.sourceFile} + scope ${this.typeScope} + expected ${this.expectedType.replace(/\n/g, "")} + type ${this.valueType} + value ${this.value} +`; + } + }; + var validatorError = (typeFn, value, scope, message, expectedType, valueType) => { + return new TypeValidatorError(message, expectedType || getType(typeFn), valueType || typeof value, JSON.stringify(value), typeFn.name, scope); + }; + var arrayOf = (typeFn, _scope = "Array") => { + function array(value) { + if (isEmpty(value)) + return [typeFn(value)]; + if (Array.isArray(value)) { + let index = 0; + return value.map((v) => typeFn(v, `${_scope}[${index++}]`)); + } + throw validatorError(array, value, _scope); + } + array.type = () => `Array<${getType(typeFn)}>`; + return array; + }; + var literalOf = (primitive) => { + function literal(value, _scope = "") { + if (isEmpty(value) || value === primitive) + return primitive; + throw validatorError(literal, value, _scope); + } + literal.type = () => { + if (isBoolean(primitive)) + return `${primitive ? "true" : "false"}`; + else + return `"${primitive}"`; + }; + return literal; + }; + var mapOf = (keyTypeFn, typeFn) => { + function mapOf2(value) { + if (isEmpty(value)) + return {}; + const o = object(value); + const reducer = (acc, key) => Object.assign(acc, { + [keyTypeFn(key, "Map[_]")]: typeFn(o[key], `Map.${key}`) + }); + return Object.keys(o).reduce(reducer, {}); + } + mapOf2.type = () => `{ [_:${getType(keyTypeFn)}]: ${getType(typeFn)} }`; + return mapOf2; + }; + var object = function(value) { + if (isEmpty(value)) + return {}; + if (isObject(value) && !Array.isArray(value)) { + return Object.assign({}, value); + } + throw validatorError(object, value); + }; + var objectOf = (typeObj, _scope = "Object") => { + function object2(value) { + const o = object(value); + const typeAttrs = Object.keys(typeObj); + const unknownAttr = Object.keys(o).find((attr) => !typeAttrs.includes(attr)); + if (unknownAttr) { + throw validatorError(object2, value, _scope, `missing object property '${unknownAttr}' in ${_scope} type`); + } + const undefAttr = typeAttrs.find((property) => { + const propertyTypeFn = typeObj[property]; + return propertyTypeFn.name.includes("maybe") && !o.hasOwnProperty(property); + }); + if (undefAttr) { + throw validatorError(object2, o[undefAttr], `${_scope}.${undefAttr}`, `empty object property '${undefAttr}' for ${_scope} type`, `void | null | ${getType(typeObj[undefAttr]).substr(1)}`, "-"); + } + const reducer = isEmpty(value) ? (acc, key) => Object.assign(acc, { [key]: typeObj[key](value) }) : (acc, key) => { + const typeFn = typeObj[key]; + if (typeFn.name.includes("optional") && !o.hasOwnProperty(key)) { + return Object.assign(acc, {}); + } else { + return Object.assign(acc, { [key]: typeFn(o[key], `${_scope}.${key}`) }); + } + }; + return typeAttrs.reduce(reducer, {}); + } + object2.type = () => { + const props = Object.keys(typeObj).map((key) => { + const ret = typeObj[key].name.includes("optional") ? `${key}?: ${getType(typeObj[key], { noVoid: true })}` : `${key}: ${getType(typeObj[key])}`; + return ret; + }); + return `{| + ${props.join(",\n ")} +|}`; + }; + return object2; + }; + function objectMaybeOf(validations, _scope = "Object") { + return function(data) { + object(data); + for (const key in data) { + validations[key]?.(data[key], `${_scope}.${key}`); + } + return data; + }; + } + var optional = (typeFn) => { + const unionFn = unionOf(typeFn, undef); + function optional2(v) { + return unionFn(v); + } + optional2.type = ({ noVoid }) => !noVoid ? getType(unionFn) : getType(typeFn); + return optional2; + }; + function undef(value, _scope = "") { + if (isEmpty(value) || isUndef(value)) + return void 0; + throw validatorError(undef, value, _scope); + } + undef.type = () => "void"; + var boolean = function boolean2(value, _scope = "") { + if (isEmpty(value)) + return false; + if (isBoolean(value)) + return value; + throw validatorError(boolean2, value, _scope); + }; + var number = function number2(value, _scope = "") { + if (isEmpty(value)) + return 0; + if (isNumber(value)) + return value; + throw validatorError(number2, value, _scope); + }; + var numberRange = (from3, to, key = "") => { + if (!isNumber(from3) || !isNumber(to)) { + throw new TypeError("Params for numberRange must be numbers"); + } + if (from3 >= to) { + throw new TypeError('Params "to" should be bigger than "from"'); + } + function numberRange2(value, _scope = "") { + number(value, _scope); + if (value >= from3 && value <= to) + return value; + throw validatorError(numberRange2, value, _scope, key ? `number type '${key}' must be within the range of [${from3}, ${to}]` : `must be within the range of [${from3}, ${to}]`); + } + numberRange2.type = `number(range: [${from3}, ${to}])`; + return numberRange2; + }; + var string = function string2(value, _scope = "") { + if (isEmpty(value)) + return ""; + if (isString(value)) + return value; + throw validatorError(string2, value, _scope); + }; + var stringMax = (numChar, key = "") => { + if (!isNumber(numChar)) { + throw new Error("param for stringMax must be number"); + } + function stringMax2(value, _scope = "") { + string(value, _scope); + if (value.length <= numChar) + return value; + throw validatorError(stringMax2, value, _scope, key ? `string type '${key}' cannot exceed ${numChar} characters` : `cannot exceed ${numChar} characters`); + } + stringMax2.type = () => `string(max: ${numChar})`; + return stringMax2; + }; + function unionOf_(...typeFuncs) { + function union(value, _scope = "") { + for (const typeFn of typeFuncs) { + try { + return typeFn(value, _scope); + } catch (_) { + } + } + throw validatorError(union, value, _scope); + } + union.type = () => `(${typeFuncs.map((fn) => getType(fn)).join(" | ")})`; + return union; + } + var unionOf = unionOf_; + var actionRequireInnerSignature = (next) => (data, props) => { + const innerSigningContractID = props.message.innerSigningContractID; + if (!innerSigningContractID || innerSigningContractID === props.contractID) { + throw new Error("Missing inner signature"); + } + return next(data, props); + }; + + // shared/domains/chelonia/errors.js + var ChelErrorGenerator = (name, base2 = Error) => class extends base2 { + constructor(...params) { + super(...params); + this.name = name; + if (params[1]?.cause !== this.cause) { + Object.defineProperty(this, "cause", { value: params[1].cause }); + } + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + } + }; + var ChelErrorWarning = ChelErrorGenerator("ChelErrorWarning"); + var ChelErrorAlreadyProcessed = ChelErrorGenerator("ChelErrorAlreadyProcessed"); + var ChelErrorDBBadPreviousHEAD = ChelErrorGenerator("ChelErrorDBBadPreviousHEAD"); + var ChelErrorDBConnection = ChelErrorGenerator("ChelErrorDBConnection"); + var ChelErrorUnexpected = ChelErrorGenerator("ChelErrorUnexpected"); + var ChelErrorUnrecoverable = ChelErrorGenerator("ChelErrorUnrecoverable"); + var ChelErrorDecryptionError = ChelErrorGenerator("ChelErrorDecryptionError"); + var ChelErrorDecryptionKeyNotFound = ChelErrorGenerator("ChelErrorDecryptionKeyNotFound", ChelErrorDecryptionError); + var ChelErrorSignatureError = ChelErrorGenerator("ChelErrorSignatureError"); + var ChelErrorSignatureKeyUnauthorized = ChelErrorGenerator("ChelErrorSignatureKeyUnauthorized", ChelErrorSignatureError); + var ChelErrorSignatureKeyNotFound = ChelErrorGenerator("ChelErrorSignatureKeyNotFound", ChelErrorSignatureError); + var ChelErrorFetchServerTimeFailed = ChelErrorGenerator("ChelErrorFetchServerTimeFailed"); + + // shared/domains/chelonia/utils.js + var import_sbp3 = __toESM(__require("@sbp/sbp")); + + // frontend/model/contracts/shared/giLodash.js + function cloneDeep(obj) { + return JSON.parse(JSON.stringify(obj)); + } + function isMergeableObject(val) { + const nonNullObject = val && typeof val === "object"; + return nonNullObject && Object.prototype.toString.call(val) !== "[object RegExp]" && Object.prototype.toString.call(val) !== "[object Date]"; + } + function merge(obj, src2) { + for (const key in src2) { + const clone = isMergeableObject(src2[key]) ? cloneDeep(src2[key]) : void 0; + if (clone && isMergeableObject(obj[key])) { + merge(obj[key], clone); + continue; + } + obj[key] = clone || src2[key]; + } + return obj; + } + var has = Function.prototype.call.bind(Object.prototype.hasOwnProperty); + + // shared/blake2bstream.js + var import_blakejs = __toESM(require_blakejs()); + + // shared/multiformats/bytes.js + var empty = new Uint8Array(0); + function equals(aa, bb) { + if (aa === bb) { + return true; + } + if (aa.byteLength !== bb.byteLength) { + return false; + } + for (let ii = 0; ii < aa.byteLength; ii++) { + if (aa[ii] !== bb[ii]) { + return false; + } + } + return true; + } + function coerce(o) { + if (o instanceof Uint8Array && o.constructor.name === "Uint8Array") { + return o; + } + if (o instanceof ArrayBuffer) { + return new Uint8Array(o); + } + if (ArrayBuffer.isView(o)) { + return new Uint8Array(o.buffer, o.byteOffset, o.byteLength); + } + throw new Error("Unknown type, must be binary type"); + } + + // shared/multiformats/vendor/varint.js + var encode_1 = encode; + var MSB = 128; + var REST = 127; + var MSBALL = ~REST; + var INT = Math.pow(2, 31); + function encode(num, out, offset) { + out = out || []; + offset = offset || 0; + var oldOffset = offset; + while (num >= INT) { + out[offset++] = num & 255 | MSB; + num /= 128; + } + while (num & MSBALL) { + out[offset++] = num & 255 | MSB; + num >>>= 7; + } + out[offset] = num | 0; + encode.bytes = offset - oldOffset + 1; + return out; + } + var decode = read; + var MSB$1 = 128; + var REST$1 = 127; + function read(buf, offset) { + var res = 0, offset = offset || 0, shift = 0, counter = offset, b, l = buf.length; + do { + if (counter >= l) { + read.bytes = 0; + throw new RangeError("Could not decode varint"); + } + b = buf[counter++]; + res += shift < 28 ? (b & REST$1) << shift : (b & REST$1) * Math.pow(2, shift); + shift += 7; + } while (b >= MSB$1); + read.bytes = counter - offset; + return res; + } + var N1 = Math.pow(2, 7); + var N2 = Math.pow(2, 14); + var N3 = Math.pow(2, 21); + var N4 = Math.pow(2, 28); + var N5 = Math.pow(2, 35); + var N6 = Math.pow(2, 42); + var N7 = Math.pow(2, 49); + var N8 = Math.pow(2, 56); + var N9 = Math.pow(2, 63); + var length = function(value) { + return value < N1 ? 1 : value < N2 ? 2 : value < N3 ? 3 : value < N4 ? 4 : value < N5 ? 5 : value < N6 ? 6 : value < N7 ? 7 : value < N8 ? 8 : value < N9 ? 9 : 10; + }; + var varint = { + encode: encode_1, + decode, + encodingLength: length + }; + var _brrp_varint = varint; + var varint_default = _brrp_varint; + + // shared/multiformats/varint.js + function decode2(data, offset = 0) { + const code = varint_default.decode(data, offset); + return [code, varint_default.decode.bytes]; + } + function encodeTo(int, target, offset = 0) { + varint_default.encode(int, target, offset); + return target; + } + function encodingLength(int) { + return varint_default.encodingLength(int); + } + + // shared/multiformats/hashes/digest.js + function create(code, digest) { + const size = digest.byteLength; + const sizeOffset = encodingLength(code); + const digestOffset = sizeOffset + encodingLength(size); + const bytes = new Uint8Array(digestOffset + size); + encodeTo(code, bytes, 0); + encodeTo(size, bytes, sizeOffset); + bytes.set(digest, digestOffset); + return new Digest(code, size, digest, bytes); + } + function decode3(multihash) { + const bytes = coerce(multihash); + const [code, sizeOffset] = decode2(bytes); + const [size, digestOffset] = decode2(bytes.subarray(sizeOffset)); + const digest = bytes.subarray(sizeOffset + digestOffset); + if (digest.byteLength !== size) { + throw new Error("Incorrect length"); + } + return new Digest(code, size, digest, bytes); + } + function equals2(a, b) { + if (a === b) { + return true; + } else { + const data = b; + return a.code === data.code && a.size === data.size && data.bytes instanceof Uint8Array && equals(a.bytes, data.bytes); + } + } + var Digest = class { + code; + size; + digest; + bytes; + constructor(code, size, digest, bytes) { + this.code = code; + this.size = size; + this.digest = digest; + this.bytes = bytes; + } + }; + + // shared/multiformats/hasher.js + function from({ name, code, encode: encode3 }) { + return new Hasher(name, code, encode3); + } + var Hasher = class { + name; + code; + encode; + constructor(name, code, encode3) { + this.name = name; + this.code = code; + this.encode = encode3; + } + digest(input) { + if (input instanceof Uint8Array || input instanceof ReadableStream) { + const result = this.encode(input); + return result instanceof Uint8Array ? create(this.code, result) : result.then((digest) => create(this.code, digest)); + } else { + throw Error("Unknown type, must be binary type"); + } + } + }; + + // shared/blake2bstream.js + var { blake2b, blake2bInit, blake2bUpdate, blake2bFinal } = import_blakejs.default; + var blake2b256stream = from({ + name: "blake2b-256", + code: 45600, + encode: async (input) => { + if (input instanceof ReadableStream) { + const ctx = blake2bInit(32); + const reader = input.getReader(); + for (; ; ) { + const result = await reader.read(); + if (result.done) + break; + blake2bUpdate(ctx, coerce(result.value)); + } + return blake2bFinal(ctx); + } else { + return coerce(blake2b(input, void 0, 32)); + } + } + }); + + // shared/multiformats/base-x.js + function base(ALPHABET, name) { + if (ALPHABET.length >= 255) { + throw new TypeError("Alphabet too long"); + } + var BASE_MAP = new Uint8Array(256); + for (var j = 0; j < BASE_MAP.length; j++) { + BASE_MAP[j] = 255; + } + for (var i = 0; i < ALPHABET.length; i++) { + var x = ALPHABET.charAt(i); + var xc = x.charCodeAt(0); + if (BASE_MAP[xc] !== 255) { + throw new TypeError(x + " is ambiguous"); + } + BASE_MAP[xc] = i; + } + var BASE = ALPHABET.length; + var LEADER = ALPHABET.charAt(0); + var FACTOR = Math.log(BASE) / Math.log(256); + var iFACTOR = Math.log(256) / Math.log(BASE); + function encode3(source) { + if (source instanceof Uint8Array) + ; + else if (ArrayBuffer.isView(source)) { + source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength); + } else if (Array.isArray(source)) { + source = Uint8Array.from(source); + } + if (!(source instanceof Uint8Array)) { + throw new TypeError("Expected Uint8Array"); + } + if (source.length === 0) { + return ""; + } + var zeroes = 0; + var length2 = 0; + var pbegin = 0; + var pend = source.length; + while (pbegin !== pend && source[pbegin] === 0) { + pbegin++; + zeroes++; + } + var size = (pend - pbegin) * iFACTOR + 1 >>> 0; + var b58 = new Uint8Array(size); + while (pbegin !== pend) { + var carry = source[pbegin]; + var i2 = 0; + for (var it1 = size - 1; (carry !== 0 || i2 < length2) && it1 !== -1; it1--, i2++) { + carry += 256 * b58[it1] >>> 0; + b58[it1] = carry % BASE >>> 0; + carry = carry / BASE >>> 0; + } + if (carry !== 0) { + throw new Error("Non-zero carry"); + } + length2 = i2; + pbegin++; + } + var it2 = size - length2; + while (it2 !== size && b58[it2] === 0) { + it2++; + } + var str = LEADER.repeat(zeroes); + for (; it2 < size; ++it2) { + str += ALPHABET.charAt(b58[it2]); + } + return str; + } + function decodeUnsafe(source) { + if (typeof source !== "string") { + throw new TypeError("Expected String"); + } + if (source.length === 0) { + return new Uint8Array(); + } + var psz = 0; + if (source[psz] === " ") { + return; + } + var zeroes = 0; + var length2 = 0; + while (source[psz] === LEADER) { + zeroes++; + psz++; + } + var size = (source.length - psz) * FACTOR + 1 >>> 0; + var b256 = new Uint8Array(size); + while (source[psz]) { + var carry = BASE_MAP[source.charCodeAt(psz)]; + if (carry === 255) { + return; + } + var i2 = 0; + for (var it3 = size - 1; (carry !== 0 || i2 < length2) && it3 !== -1; it3--, i2++) { + carry += BASE * b256[it3] >>> 0; + b256[it3] = carry % 256 >>> 0; + carry = carry / 256 >>> 0; + } + if (carry !== 0) { + throw new Error("Non-zero carry"); + } + length2 = i2; + psz++; + } + if (source[psz] === " ") { + return; + } + var it4 = size - length2; + while (it4 !== size && b256[it4] === 0) { + it4++; + } + var vch = new Uint8Array(zeroes + (size - it4)); + var j2 = zeroes; + while (it4 !== size) { + vch[j2++] = b256[it4++]; + } + return vch; + } + function decode5(string3) { + var buffer = decodeUnsafe(string3); + if (buffer) { + return buffer; + } + throw new Error(`Non-${name} character`); + } + return { + encode: encode3, + decodeUnsafe, + decode: decode5 + }; + } + var src = base; + var _brrp__multiformats_scope_baseX = src; + var base_x_default = _brrp__multiformats_scope_baseX; + + // shared/multiformats/bases/base.js + var Encoder = class { + name; + prefix; + baseEncode; + constructor(name, prefix, baseEncode) { + this.name = name; + this.prefix = prefix; + this.baseEncode = baseEncode; + } + encode(bytes) { + if (bytes instanceof Uint8Array) { + return `${this.prefix}${this.baseEncode(bytes)}`; + } else { + throw Error("Unknown type, must be binary type"); + } + } + }; + var Decoder = class { + name; + prefix; + baseDecode; + prefixCodePoint; + constructor(name, prefix, baseDecode) { + this.name = name; + this.prefix = prefix; + if (prefix.codePointAt(0) === void 0) { + throw new Error("Invalid prefix character"); + } + this.prefixCodePoint = prefix.codePointAt(0); + this.baseDecode = baseDecode; + } + decode(text) { + if (typeof text === "string") { + if (text.codePointAt(0) !== this.prefixCodePoint) { + throw Error(`Unable to decode multibase string ${JSON.stringify(text)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`); + } + return this.baseDecode(text.slice(this.prefix.length)); + } else { + throw Error("Can only multibase decode strings"); + } + } + or(decoder) { + return or(this, decoder); + } + }; + var ComposedDecoder = class { + decoders; + constructor(decoders) { + this.decoders = decoders; + } + or(decoder) { + return or(this, decoder); + } + decode(input) { + const prefix = input[0]; + const decoder = this.decoders[prefix]; + if (decoder != null) { + return decoder.decode(input); + } else { + throw RangeError(`Unable to decode multibase string ${JSON.stringify(input)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`); + } + } + }; + function or(left, right) { + return new ComposedDecoder({ + ...left.decoders ?? { [left.prefix]: left }, + ...right.decoders ?? { [right.prefix]: right } + }); + } + var Codec = class { + name; + prefix; + baseEncode; + baseDecode; + encoder; + decoder; + constructor(name, prefix, baseEncode, baseDecode) { + this.name = name; + this.prefix = prefix; + this.baseEncode = baseEncode; + this.baseDecode = baseDecode; + this.encoder = new Encoder(name, prefix, baseEncode); + this.decoder = new Decoder(name, prefix, baseDecode); + } + encode(input) { + return this.encoder.encode(input); + } + decode(input) { + return this.decoder.decode(input); + } + }; + function from2({ name, prefix, encode: encode3, decode: decode5 }) { + return new Codec(name, prefix, encode3, decode5); + } + function baseX({ name, prefix, alphabet }) { + const { encode: encode3, decode: decode5 } = base_x_default(alphabet, name); + return from2({ + prefix, + name, + encode: encode3, + decode: (text) => coerce(decode5(text)) + }); + } + function decode4(string3, alphabet, bitsPerChar, name) { + const codes = {}; + for (let i = 0; i < alphabet.length; ++i) { + codes[alphabet[i]] = i; + } + let end = string3.length; + while (string3[end - 1] === "=") { + --end; + } + const out = new Uint8Array(end * bitsPerChar / 8 | 0); + let bits = 0; + let buffer = 0; + let written = 0; + for (let i = 0; i < end; ++i) { + const value = codes[string3[i]]; + if (value === void 0) { + throw new SyntaxError(`Non-${name} character`); + } + buffer = buffer << bitsPerChar | value; + bits += bitsPerChar; + if (bits >= 8) { + bits -= 8; + out[written++] = 255 & buffer >> bits; + } + } + if (bits >= bitsPerChar || (255 & buffer << 8 - bits) !== 0) { + throw new SyntaxError("Unexpected end of data"); + } + return out; + } + function encode2(data, alphabet, bitsPerChar) { + const pad = alphabet[alphabet.length - 1] === "="; + const mask = (1 << bitsPerChar) - 1; + let out = ""; + let bits = 0; + let buffer = 0; + for (let i = 0; i < data.length; ++i) { + buffer = buffer << 8 | data[i]; + bits += 8; + while (bits > bitsPerChar) { + bits -= bitsPerChar; + out += alphabet[mask & buffer >> bits]; + } + } + if (bits !== 0) { + out += alphabet[mask & buffer << bitsPerChar - bits]; + } + if (pad) { + while ((out.length * bitsPerChar & 7) !== 0) { + out += "="; + } + } + return out; + } + function rfc4648({ name, prefix, bitsPerChar, alphabet }) { + return from2({ + prefix, + name, + encode(input) { + return encode2(input, alphabet, bitsPerChar); + }, + decode(input) { + return decode4(input, alphabet, bitsPerChar, name); + } + }); + } + + // shared/multiformats/bases/base58.js + var base58btc = baseX({ + name: "base58btc", + prefix: "z", + alphabet: "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz" + }); + var base58flickr = baseX({ + name: "base58flickr", + prefix: "Z", + alphabet: "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ" + }); + + // shared/multiformats/blake2b.js + var import_blakejs2 = __toESM(require_blakejs()); + var { blake2b: blake2b2 } = import_blakejs2.default; + var blake2b8 = from({ + name: "blake2b-8", + code: 45569, + encode: (input) => coerce(blake2b2(input, void 0, 1)) + }); + var blake2b16 = from({ + name: "blake2b-16", + code: 45570, + encode: (input) => coerce(blake2b2(input, void 0, 2)) + }); + var blake2b24 = from({ + name: "blake2b-24", + code: 45571, + encode: (input) => coerce(blake2b2(input, void 0, 3)) + }); + var blake2b32 = from({ + name: "blake2b-32", + code: 45572, + encode: (input) => coerce(blake2b2(input, void 0, 4)) + }); + var blake2b40 = from({ + name: "blake2b-40", + code: 45573, + encode: (input) => coerce(blake2b2(input, void 0, 5)) + }); + var blake2b48 = from({ + name: "blake2b-48", + code: 45574, + encode: (input) => coerce(blake2b2(input, void 0, 6)) + }); + var blake2b56 = from({ + name: "blake2b-56", + code: 45575, + encode: (input) => coerce(blake2b2(input, void 0, 7)) + }); + var blake2b64 = from({ + name: "blake2b-64", + code: 45576, + encode: (input) => coerce(blake2b2(input, void 0, 8)) + }); + var blake2b72 = from({ + name: "blake2b-72", + code: 45577, + encode: (input) => coerce(blake2b2(input, void 0, 9)) + }); + var blake2b80 = from({ + name: "blake2b-80", + code: 45578, + encode: (input) => coerce(blake2b2(input, void 0, 10)) + }); + var blake2b88 = from({ + name: "blake2b-88", + code: 45579, + encode: (input) => coerce(blake2b2(input, void 0, 11)) + }); + var blake2b96 = from({ + name: "blake2b-96", + code: 45580, + encode: (input) => coerce(blake2b2(input, void 0, 12)) + }); + var blake2b104 = from({ + name: "blake2b-104", + code: 45581, + encode: (input) => coerce(blake2b2(input, void 0, 13)) + }); + var blake2b112 = from({ + name: "blake2b-112", + code: 45582, + encode: (input) => coerce(blake2b2(input, void 0, 14)) + }); + var blake2b120 = from({ + name: "blake2b-120", + code: 45583, + encode: (input) => coerce(blake2b2(input, void 0, 15)) + }); + var blake2b128 = from({ + name: "blake2b-128", + code: 45584, + encode: (input) => coerce(blake2b2(input, void 0, 16)) + }); + var blake2b136 = from({ + name: "blake2b-136", + code: 45585, + encode: (input) => coerce(blake2b2(input, void 0, 17)) + }); + var blake2b144 = from({ + name: "blake2b-144", + code: 45586, + encode: (input) => coerce(blake2b2(input, void 0, 18)) + }); + var blake2b152 = from({ + name: "blake2b-152", + code: 45587, + encode: (input) => coerce(blake2b2(input, void 0, 19)) + }); + var blake2b160 = from({ + name: "blake2b-160", + code: 45588, + encode: (input) => coerce(blake2b2(input, void 0, 20)) + }); + var blake2b168 = from({ + name: "blake2b-168", + code: 45589, + encode: (input) => coerce(blake2b2(input, void 0, 21)) + }); + var blake2b176 = from({ + name: "blake2b-176", + code: 45590, + encode: (input) => coerce(blake2b2(input, void 0, 22)) + }); + var blake2b184 = from({ + name: "blake2b-184", + code: 45591, + encode: (input) => coerce(blake2b2(input, void 0, 23)) + }); + var blake2b192 = from({ + name: "blake2b-192", + code: 45592, + encode: (input) => coerce(blake2b2(input, void 0, 24)) + }); + var blake2b200 = from({ + name: "blake2b-200", + code: 45593, + encode: (input) => coerce(blake2b2(input, void 0, 25)) + }); + var blake2b208 = from({ + name: "blake2b-208", + code: 45594, + encode: (input) => coerce(blake2b2(input, void 0, 26)) + }); + var blake2b216 = from({ + name: "blake2b-216", + code: 45595, + encode: (input) => coerce(blake2b2(input, void 0, 27)) + }); + var blake2b224 = from({ + name: "blake2b-224", + code: 45596, + encode: (input) => coerce(blake2b2(input, void 0, 28)) + }); + var blake2b232 = from({ + name: "blake2b-232", + code: 45597, + encode: (input) => coerce(blake2b2(input, void 0, 29)) + }); + var blake2b240 = from({ + name: "blake2b-240", + code: 45598, + encode: (input) => coerce(blake2b2(input, void 0, 30)) + }); + var blake2b248 = from({ + name: "blake2b-248", + code: 45599, + encode: (input) => coerce(blake2b2(input, void 0, 31)) + }); + var blake2b256 = from({ + name: "blake2b-256", + code: 45600, + encode: (input) => coerce(blake2b2(input, void 0, 32)) + }); + var blake2b264 = from({ + name: "blake2b-264", + code: 45601, + encode: (input) => coerce(blake2b2(input, void 0, 33)) + }); + var blake2b272 = from({ + name: "blake2b-272", + code: 45602, + encode: (input) => coerce(blake2b2(input, void 0, 34)) + }); + var blake2b280 = from({ + name: "blake2b-280", + code: 45603, + encode: (input) => coerce(blake2b2(input, void 0, 35)) + }); + var blake2b288 = from({ + name: "blake2b-288", + code: 45604, + encode: (input) => coerce(blake2b2(input, void 0, 36)) + }); + var blake2b296 = from({ + name: "blake2b-296", + code: 45605, + encode: (input) => coerce(blake2b2(input, void 0, 37)) + }); + var blake2b304 = from({ + name: "blake2b-304", + code: 45606, + encode: (input) => coerce(blake2b2(input, void 0, 38)) + }); + var blake2b312 = from({ + name: "blake2b-312", + code: 45607, + encode: (input) => coerce(blake2b2(input, void 0, 39)) + }); + var blake2b320 = from({ + name: "blake2b-320", + code: 45608, + encode: (input) => coerce(blake2b2(input, void 0, 40)) + }); + var blake2b328 = from({ + name: "blake2b-328", + code: 45609, + encode: (input) => coerce(blake2b2(input, void 0, 41)) + }); + var blake2b336 = from({ + name: "blake2b-336", + code: 45610, + encode: (input) => coerce(blake2b2(input, void 0, 42)) + }); + var blake2b344 = from({ + name: "blake2b-344", + code: 45611, + encode: (input) => coerce(blake2b2(input, void 0, 43)) + }); + var blake2b352 = from({ + name: "blake2b-352", + code: 45612, + encode: (input) => coerce(blake2b2(input, void 0, 44)) + }); + var blake2b360 = from({ + name: "blake2b-360", + code: 45613, + encode: (input) => coerce(blake2b2(input, void 0, 45)) + }); + var blake2b368 = from({ + name: "blake2b-368", + code: 45614, + encode: (input) => coerce(blake2b2(input, void 0, 46)) + }); + var blake2b376 = from({ + name: "blake2b-376", + code: 45615, + encode: (input) => coerce(blake2b2(input, void 0, 47)) + }); + var blake2b384 = from({ + name: "blake2b-384", + code: 45616, + encode: (input) => coerce(blake2b2(input, void 0, 48)) + }); + var blake2b392 = from({ + name: "blake2b-392", + code: 45617, + encode: (input) => coerce(blake2b2(input, void 0, 49)) + }); + var blake2b400 = from({ + name: "blake2b-400", + code: 45618, + encode: (input) => coerce(blake2b2(input, void 0, 50)) + }); + var blake2b408 = from({ + name: "blake2b-408", + code: 45619, + encode: (input) => coerce(blake2b2(input, void 0, 51)) + }); + var blake2b416 = from({ + name: "blake2b-416", + code: 45620, + encode: (input) => coerce(blake2b2(input, void 0, 52)) + }); + var blake2b424 = from({ + name: "blake2b-424", + code: 45621, + encode: (input) => coerce(blake2b2(input, void 0, 53)) + }); + var blake2b432 = from({ + name: "blake2b-432", + code: 45622, + encode: (input) => coerce(blake2b2(input, void 0, 54)) + }); + var blake2b440 = from({ + name: "blake2b-440", + code: 45623, + encode: (input) => coerce(blake2b2(input, void 0, 55)) + }); + var blake2b448 = from({ + name: "blake2b-448", + code: 45624, + encode: (input) => coerce(blake2b2(input, void 0, 56)) + }); + var blake2b456 = from({ + name: "blake2b-456", + code: 45625, + encode: (input) => coerce(blake2b2(input, void 0, 57)) + }); + var blake2b464 = from({ + name: "blake2b-464", + code: 45626, + encode: (input) => coerce(blake2b2(input, void 0, 58)) + }); + var blake2b472 = from({ + name: "blake2b-472", + code: 45627, + encode: (input) => coerce(blake2b2(input, void 0, 59)) + }); + var blake2b480 = from({ + name: "blake2b-480", + code: 45628, + encode: (input) => coerce(blake2b2(input, void 0, 60)) + }); + var blake2b488 = from({ + name: "blake2b-488", + code: 45629, + encode: (input) => coerce(blake2b2(input, void 0, 61)) + }); + var blake2b496 = from({ + name: "blake2b-496", + code: 45630, + encode: (input) => coerce(blake2b2(input, void 0, 62)) + }); + var blake2b504 = from({ + name: "blake2b-504", + code: 45631, + encode: (input) => coerce(blake2b2(input, void 0, 63)) + }); + var blake2b512 = from({ + name: "blake2b-512", + code: 45632, + encode: (input) => coerce(blake2b2(input, void 0, 64)) + }); + + // shared/multiformats/bases/base32.js + var base32 = rfc4648({ + prefix: "b", + name: "base32", + alphabet: "abcdefghijklmnopqrstuvwxyz234567", + bitsPerChar: 5 + }); + var base32upper = rfc4648({ + prefix: "B", + name: "base32upper", + alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567", + bitsPerChar: 5 + }); + var base32pad = rfc4648({ + prefix: "c", + name: "base32pad", + alphabet: "abcdefghijklmnopqrstuvwxyz234567=", + bitsPerChar: 5 + }); + var base32padupper = rfc4648({ + prefix: "C", + name: "base32padupper", + alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=", + bitsPerChar: 5 + }); + var base32hex = rfc4648({ + prefix: "v", + name: "base32hex", + alphabet: "0123456789abcdefghijklmnopqrstuv", + bitsPerChar: 5 + }); + var base32hexupper = rfc4648({ + prefix: "V", + name: "base32hexupper", + alphabet: "0123456789ABCDEFGHIJKLMNOPQRSTUV", + bitsPerChar: 5 + }); + var base32hexpad = rfc4648({ + prefix: "t", + name: "base32hexpad", + alphabet: "0123456789abcdefghijklmnopqrstuv=", + bitsPerChar: 5 + }); + var base32hexpadupper = rfc4648({ + prefix: "T", + name: "base32hexpadupper", + alphabet: "0123456789ABCDEFGHIJKLMNOPQRSTUV=", + bitsPerChar: 5 + }); + var base32z = rfc4648({ + prefix: "h", + name: "base32z", + alphabet: "ybndrfg8ejkmcpqxot1uwisza345h769", + bitsPerChar: 5 + }); + + // shared/multiformats/cid.js + function format(link, base2) { + const { bytes, version } = link; + switch (version) { + case 0: + return toStringV0(bytes, baseCache(link), base2 ?? base58btc.encoder); + default: + return toStringV1(bytes, baseCache(link), base2 ?? base32.encoder); + } + } + var cache = /* @__PURE__ */ new WeakMap(); + function baseCache(cid) { + const baseCache2 = cache.get(cid); + if (baseCache2 == null) { + const baseCache3 = /* @__PURE__ */ new Map(); + cache.set(cid, baseCache3); + return baseCache3; + } + return baseCache2; + } + var CID = class { + code; + version; + multihash; + bytes; + "/"; + constructor(version, code, multihash, bytes) { + this.code = code; + this.version = version; + this.multihash = multihash; + this.bytes = bytes; + this["/"] = bytes; + } + get asCID() { + return this; + } + get byteOffset() { + return this.bytes.byteOffset; + } + get byteLength() { + return this.bytes.byteLength; + } + toV0() { + switch (this.version) { + case 0: { + return this; + } + case 1: { + const { code, multihash } = this; + if (code !== DAG_PB_CODE) { + throw new Error("Cannot convert a non dag-pb CID to CIDv0"); + } + if (multihash.code !== SHA_256_CODE) { + throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0"); + } + return CID.createV0(multihash); + } + default: { + throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`); + } + } + } + toV1() { + switch (this.version) { + case 0: { + const { code, digest } = this.multihash; + const multihash = create(code, digest); + return CID.createV1(this.code, multihash); + } + case 1: { + return this; + } + default: { + throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`); + } + } + } + equals(other) { + return CID.equals(this, other); + } + static equals(self2, other) { + const unknown = other; + return unknown != null && self2.code === unknown.code && self2.version === unknown.version && equals2(self2.multihash, unknown.multihash); + } + toString(base2) { + return format(this, base2); + } + toJSON() { + return { "/": format(this) }; + } + link() { + return this; + } + [Symbol.toStringTag] = "CID"; + [Symbol.for("nodejs.util.inspect.custom")]() { + return `CID(${this.toString()})`; + } + static asCID(input) { + if (input == null) { + return null; + } + const value = input; + if (value instanceof CID) { + return value; + } else if (value["/"] != null && value["/"] === value.bytes || value.asCID === value) { + const { version, code, multihash, bytes } = value; + return new CID(version, code, multihash, bytes ?? encodeCID(version, code, multihash.bytes)); + } else if (value[cidSymbol] === true) { + const { version, multihash, code } = value; + const digest = decode3(multihash); + return CID.create(version, code, digest); + } else { + return null; + } + } + static create(version, code, digest) { + if (typeof code !== "number") { + throw new Error("String codecs are no longer supported"); + } + if (!(digest.bytes instanceof Uint8Array)) { + throw new Error("Invalid digest"); + } + switch (version) { + case 0: { + if (code !== DAG_PB_CODE) { + throw new Error(`Version 0 CID must use dag-pb (code: ${DAG_PB_CODE}) block encoding`); + } else { + return new CID(version, code, digest, digest.bytes); + } + } + case 1: { + const bytes = encodeCID(version, code, digest.bytes); + return new CID(version, code, digest, bytes); + } + default: { + throw new Error("Invalid version"); + } + } + } + static createV0(digest) { + return CID.create(0, DAG_PB_CODE, digest); + } + static createV1(code, digest) { + return CID.create(1, code, digest); + } + static decode(bytes) { + const [cid, remainder] = CID.decodeFirst(bytes); + if (remainder.length !== 0) { + throw new Error("Incorrect length"); + } + return cid; + } + static decodeFirst(bytes) { + const specs = CID.inspectBytes(bytes); + const prefixSize = specs.size - specs.multihashSize; + const multihashBytes = coerce(bytes.subarray(prefixSize, prefixSize + specs.multihashSize)); + if (multihashBytes.byteLength !== specs.multihashSize) { + throw new Error("Incorrect length"); + } + const digestBytes = multihashBytes.subarray(specs.multihashSize - specs.digestSize); + const digest = new Digest(specs.multihashCode, specs.digestSize, digestBytes, multihashBytes); + const cid = specs.version === 0 ? CID.createV0(digest) : CID.createV1(specs.codec, digest); + return [cid, bytes.subarray(specs.size)]; + } + static inspectBytes(initialBytes) { + let offset = 0; + const next = () => { + const [i, length2] = decode2(initialBytes.subarray(offset)); + offset += length2; + return i; + }; + let version = next(); + let codec = DAG_PB_CODE; + if (version === 18) { + version = 0; + offset = 0; + } else { + codec = next(); + } + if (version !== 0 && version !== 1) { + throw new RangeError(`Invalid CID version ${version}`); + } + const prefixSize = offset; + const multihashCode = next(); + const digestSize = next(); + const size = offset + digestSize; + const multihashSize = size - prefixSize; + return { version, codec, multihashCode, digestSize, multihashSize, size }; + } + static parse(source, base2) { + const [prefix, bytes] = parseCIDtoBytes(source, base2); + const cid = CID.decode(bytes); + if (cid.version === 0 && source[0] !== "Q") { + throw Error("Version 0 CID string must not include multibase prefix"); + } + baseCache(cid).set(prefix, source); + return cid; + } + }; + function parseCIDtoBytes(source, base2) { + switch (source[0]) { + case "Q": { + const decoder = base2 ?? base58btc; + return [ + base58btc.prefix, + decoder.decode(`${base58btc.prefix}${source}`) + ]; + } + case base58btc.prefix: { + const decoder = base2 ?? base58btc; + return [base58btc.prefix, decoder.decode(source)]; + } + case base32.prefix: { + const decoder = base2 ?? base32; + return [base32.prefix, decoder.decode(source)]; + } + default: { + if (base2 == null) { + throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided"); + } + return [source[0], base2.decode(source)]; + } + } + } + function toStringV0(bytes, cache2, base2) { + const { prefix } = base2; + if (prefix !== base58btc.prefix) { + throw Error(`Cannot string encode V0 in ${base2.name} encoding`); + } + const cid = cache2.get(prefix); + if (cid == null) { + const cid2 = base2.encode(bytes).slice(1); + cache2.set(prefix, cid2); + return cid2; + } else { + return cid; + } + } + function toStringV1(bytes, cache2, base2) { + const { prefix } = base2; + const cid = cache2.get(prefix); + if (cid == null) { + const cid2 = base2.encode(bytes); + cache2.set(prefix, cid2); + return cid2; + } else { + return cid; + } + } + var DAG_PB_CODE = 112; + var SHA_256_CODE = 18; + function encodeCID(version, code, multihash) { + const codeOffset = encodingLength(version); + const hashOffset = codeOffset + encodingLength(code); + const bytes = new Uint8Array(hashOffset + multihash.byteLength); + encodeTo(version, bytes, 0); + encodeTo(code, bytes, codeOffset); + bytes.set(multihash, hashOffset); + return bytes; + } + var cidSymbol = Symbol.for("@ipld/js-cid/CID"); + + // shared/functions.js + var multicodes = { JSON: 512, RAW: 0 }; + if (typeof globalThis === "object" && !has(globalThis, "Buffer")) { + const { Buffer: Buffer2 } = require_buffer(); + globalThis.Buffer = Buffer2; + } + function createCID(data, multicode = multicodes.RAW) { + const uint8array = typeof data === "string" ? new TextEncoder().encode(data) : data; + const digest = blake2b256.digest(uint8array); + return CID.create(1, multicode, digest).toString(base58btc.encoder); + } + function blake32Hash(data) { + const uint8array = typeof data === "string" ? new TextEncoder().encode(data) : data; + const digest = blake2b256.digest(uint8array); + return base58btc.encode(digest.bytes); + } + var b64ToBuf = (b64) => Buffer.from(b64, "base64"); + var strToBuf = (str) => Buffer.from(str, "utf8"); + var bytesToB64 = (ary) => Buffer.from(ary).toString("base64"); + + // shared/domains/chelonia/crypto.js + var import_tweetnacl = __toESM(require_nacl_fast()); + var import_scrypt_async = __toESM(require_scrypt_async()); + var EDWARDS25519SHA512BATCH = "edwards25519sha512batch"; + var CURVE25519XSALSA20POLY1305 = "curve25519xsalsa20poly1305"; + var XSALSA20POLY1305 = "xsalsa20poly1305"; + if (false) { + throw new Error("ENABLE_UNSAFE_NULL_CRYPTO cannot be enabled in production mode"); + } + var bytesOrObjectToB64 = (ary) => { + if (!(ary instanceof Uint8Array)) { + throw Error("Unsupported type"); + } + return bytesToB64(ary); + }; + var serializeKey = (key, saveSecretKey) => { + if (false) { + return JSON.stringify([ + key.type, + saveSecretKey ? null : key.publicKey, + saveSecretKey ? key.secretKey : null + ], void 0, 0); + } + if (key.type === EDWARDS25519SHA512BATCH || key.type === CURVE25519XSALSA20POLY1305) { + if (!saveSecretKey) { + if (!key.publicKey) { + throw new Error("Unsupported operation: no public key to export"); + } + return JSON.stringify([ + key.type, + bytesOrObjectToB64(key.publicKey), + null + ], void 0, 0); + } + if (!key.secretKey) { + throw new Error("Unsupported operation: no secret key to export"); + } + return JSON.stringify([ + key.type, + null, + bytesOrObjectToB64(key.secretKey) + ], void 0, 0); + } else if (key.type === XSALSA20POLY1305) { + if (!saveSecretKey) { + throw new Error("Unsupported operation: no public key to export"); + } + if (!key.secretKey) { + throw new Error("Unsupported operation: no secret key to export"); + } + return JSON.stringify([ + key.type, + null, + bytesOrObjectToB64(key.secretKey) + ], void 0, 0); + } + throw new Error("Unsupported key type"); + }; + var deserializeKey = (data) => { + const keyData = JSON.parse(data); + if (!keyData || keyData.length !== 3) { + throw new Error("Invalid key object"); + } + if (false) { + const res = { + type: keyData[0] + }; + if (keyData[2]) { + Object.defineProperty(res, "secretKey", { value: keyData[2] }); + res.publicKey = keyData[2]; + } else { + res.publicKey = keyData[1]; + } + return res; + } + if (keyData[0] === EDWARDS25519SHA512BATCH) { + if (keyData[2]) { + const key = import_tweetnacl.default.sign.keyPair.fromSecretKey(b64ToBuf(keyData[2])); + const res = { + type: keyData[0], + publicKey: key.publicKey + }; + Object.defineProperty(res, "secretKey", { value: key.secretKey }); + return res; + } else if (keyData[1]) { + return { + type: keyData[0], + publicKey: new Uint8Array(b64ToBuf(keyData[1])) + }; + } + throw new Error("Missing secret or public key"); + } else if (keyData[0] === CURVE25519XSALSA20POLY1305) { + if (keyData[2]) { + const key = import_tweetnacl.default.box.keyPair.fromSecretKey(b64ToBuf(keyData[2])); + const res = { + type: keyData[0], + publicKey: key.publicKey + }; + Object.defineProperty(res, "secretKey", { value: key.secretKey }); + return res; + } else if (keyData[1]) { + return { + type: keyData[0], + publicKey: new Uint8Array(b64ToBuf(keyData[1])) + }; + } + throw new Error("Missing secret or public key"); + } else if (keyData[0] === XSALSA20POLY1305) { + if (!keyData[2]) { + throw new Error("Secret key missing"); + } + const res = { + type: keyData[0] + }; + Object.defineProperty(res, "secretKey", { value: new Uint8Array(b64ToBuf(keyData[2])) }); + return res; + } + throw new Error("Unsupported key type"); + }; + var keyId = (inKey) => { + const key = Object(inKey) instanceof String ? deserializeKey(inKey) : inKey; + const serializedKey = serializeKey(key, !key.publicKey); + return blake32Hash(serializedKey); + }; + var verifySignature = (inKey, data, signature) => { + const key = Object(inKey) instanceof String ? deserializeKey(inKey) : inKey; + if (false) { + if (!key.publicKey) { + throw new Error("Public key missing"); + } + if (key.publicKey + ";" + blake32Hash(data) !== signature) { + throw new Error("Invalid signature"); + } + return; + } + if (key.type !== EDWARDS25519SHA512BATCH) { + throw new Error("Unsupported algorithm"); + } + if (!key.publicKey) { + throw new Error("Public key missing"); + } + const decodedSignature = b64ToBuf(signature); + const messageUint8 = strToBuf(data); + const result = import_tweetnacl.default.sign.detached.verify(messageUint8, decodedSignature, key.publicKey); + if (!result) { + throw new Error("Invalid signature"); + } + }; + var decrypt = (inKey, data, ad) => { + const key = Object(inKey) instanceof String ? deserializeKey(inKey) : inKey; + if (false) { + if (!key.secretKey) { + throw new Error("Secret key missing"); + } + if (!data.startsWith(key.secretKey + ";") || !data.endsWith(";" + (ad ?? ""))) { + throw new Error("Additional data mismatch"); + } + return data.slice(String(key.secretKey).length + 1, data.length - 1 - (ad ?? "").length); + } + if (key.type === XSALSA20POLY1305) { + if (!key.secretKey) { + throw new Error("Secret key missing"); + } + const messageWithNonceAsUint8Array = b64ToBuf(data); + const nonce = messageWithNonceAsUint8Array.slice(0, import_tweetnacl.default.secretbox.nonceLength); + const message = messageWithNonceAsUint8Array.slice(import_tweetnacl.default.secretbox.nonceLength, messageWithNonceAsUint8Array.length); + if (ad) { + const adHash = import_tweetnacl.default.hash(strToBuf(ad)); + const len = Math.min(adHash.length, nonce.length); + for (let i = 0; i < len; i++) { + nonce[i] ^= adHash[i]; + } + } + const decrypted = import_tweetnacl.default.secretbox.open(message, nonce, key.secretKey); + if (!decrypted) { + throw new Error("Could not decrypt message"); + } + return Buffer.from(decrypted).toString("utf-8"); + } else if (key.type === CURVE25519XSALSA20POLY1305) { + if (!key.secretKey) { + throw new Error("Secret key missing"); + } + const messageWithNonceAsUint8Array = b64ToBuf(data); + const ephemeralPublicKey = messageWithNonceAsUint8Array.slice(0, import_tweetnacl.default.box.publicKeyLength); + const nonce = messageWithNonceAsUint8Array.slice(import_tweetnacl.default.box.publicKeyLength, import_tweetnacl.default.box.publicKeyLength + import_tweetnacl.default.box.nonceLength); + const message = messageWithNonceAsUint8Array.slice(import_tweetnacl.default.box.publicKeyLength + import_tweetnacl.default.box.nonceLength); + if (ad) { + const adHash = import_tweetnacl.default.hash(strToBuf(ad)); + const len = Math.min(adHash.length, nonce.length); + for (let i = 0; i < len; i++) { + nonce[i] ^= adHash[i]; + } + } + const decrypted = import_tweetnacl.default.box.open(message, nonce, ephemeralPublicKey, key.secretKey); + if (!decrypted) { + throw new Error("Could not decrypt message"); + } + return Buffer.from(decrypted).toString("utf-8"); + } + throw new Error("Unsupported algorithm"); + }; + + // shared/domains/chelonia/encryptedData.js + var import_sbp2 = __toESM(__require("@sbp/sbp")); + + // shared/domains/chelonia/signedData.js + var import_sbp = __toESM(__require("@sbp/sbp")); + var rootStateFn = () => (0, import_sbp.default)("chelonia/rootState"); + var proto = Object.create(null, { + _isSignedData: { + value: true + } + }); + var wrapper = (o) => { + return Object.setPrototypeOf(o, proto); + }; + var isSignedData = (o) => { + return !!o && !!Object.getPrototypeOf(o)?._isSignedData; + }; + var verifySignatureData = function(height, data, additionalData) { + if (!this) { + throw new ChelErrorSignatureError("Missing contract state"); + } + if (!isRawSignedData(data)) { + throw new ChelErrorSignatureError("Invalid message format"); + } + if (!Number.isSafeInteger(height) || height < 0) { + throw new ChelErrorSignatureError(`Height ${height} is invalid or out of range`); + } + const [serializedMessage, sKeyId, signature] = data._signedData; + const designatedKey = this._vm?.authorizedKeys?.[sKeyId]; + if (!designatedKey || height > designatedKey._notAfterHeight || height < designatedKey._notBeforeHeight || !designatedKey.purpose.includes("sig")) { + if ("") { + console.error(`Key ${sKeyId} is unauthorized or expired for the current contract`, { designatedKey, height, state: JSON.parse(JSON.stringify((0, import_sbp.default)("state/vuex/state"))) }); + Promise.reject(new ChelErrorSignatureKeyUnauthorized(`Key ${sKeyId} is unauthorized or expired for the current contract`)); + } + throw new ChelErrorSignatureKeyUnauthorized(`Key ${sKeyId} is unauthorized or expired for the current contract`); + } + const deserializedKey = designatedKey.data; + const payloadToSign = blake32Hash(`${blake32Hash(additionalData)}${blake32Hash(serializedMessage)}`); + try { + verifySignature(deserializedKey, payloadToSign, signature); + const message = JSON.parse(serializedMessage); + return [sKeyId, message]; + } catch (e) { + throw new ChelErrorSignatureError(e?.message || e); + } + }; + var signedIncomingData = (contractID, state, data, height, additionalData, mapperFn) => { + const stringValueFn = () => data; + let verifySignedValue; + const verifySignedValueFn = () => { + if (verifySignedValue) { + return verifySignedValue[1]; + } + verifySignedValue = verifySignatureData.call(state || rootStateFn()[contractID], height, data, additionalData); + if (mapperFn) + verifySignedValue[1] = mapperFn(verifySignedValue[1]); + return verifySignedValue[1]; + }; + return wrapper({ + get signingKeyId() { + if (verifySignedValue) + return verifySignedValue[0]; + return signedDataKeyId(data); + }, + get serialize() { + return stringValueFn; + }, + get context() { + return [contractID, data, height, additionalData]; + }, + get toString() { + return () => JSON.stringify(this.serialize()); + }, + get valueOf() { + return verifySignedValueFn; + }, + get toJSON() { + return this.serialize; + }, + get get() { + return (k) => k !== "_signedData" ? data[k] : void 0; + } + }); + }; + var signedDataKeyId = (data) => { + if (!isRawSignedData(data)) { + throw new ChelErrorSignatureError("Invalid message format"); + } + return data._signedData[1]; + }; + var isRawSignedData = (data) => { + if (!data || typeof data !== "object" || !has(data, "_signedData") || !Array.isArray(data._signedData) || data._signedData.length !== 3 || data._signedData.map((v) => typeof v).filter((v) => v !== "string").length !== 0) { + return false; + } + return true; + }; + var rawSignedIncomingData = (data) => { + if (!isRawSignedData(data)) { + throw new ChelErrorSignatureError("Invalid message format"); + } + const stringValueFn = () => data; + let verifySignedValue; + const verifySignedValueFn = () => { + if (verifySignedValue) { + return verifySignedValue[1]; + } + verifySignedValue = [data._signedData[1], JSON.parse(data._signedData[0])]; + return verifySignedValue[1]; + }; + return wrapper({ + get signingKeyId() { + if (verifySignedValue) + return verifySignedValue[0]; + return signedDataKeyId(data); + }, + get serialize() { + return stringValueFn; + }, + get toString() { + return () => JSON.stringify(this.serialize()); + }, + get valueOf() { + return verifySignedValueFn; + }, + get toJSON() { + return this.serialize; + }, + get get() { + return (k) => k !== "_signedData" ? data[k] : void 0; + } + }); + }; + + // shared/domains/chelonia/encryptedData.js + var rootStateFn2 = () => (0, import_sbp2.default)("chelonia/rootState"); + var proto2 = Object.create(null, { + _isEncryptedData: { + value: true + } + }); + var wrapper2 = (o) => { + return Object.setPrototypeOf(o, proto2); + }; + var isEncryptedData = (o) => { + return !!o && !!Object.getPrototypeOf(o)?._isEncryptedData; + }; + var decryptData = function(height, data, additionalKeys, additionalData, validatorFn) { + if (!this) { + throw new ChelErrorDecryptionError("Missing contract state"); + } + if (typeof data.valueOf === "function") + data = data.valueOf(); + if (!isRawEncryptedData(data)) { + throw new ChelErrorDecryptionError("Invalid message format"); + } + const [eKeyId, message] = data; + const key = additionalKeys[eKeyId]; + if (!key) { + throw new ChelErrorDecryptionKeyNotFound(`Key ${eKeyId} not found`); + } + const designatedKey = this._vm?.authorizedKeys?.[eKeyId]; + if (!designatedKey || height > designatedKey._notAfterHeight || height < designatedKey._notBeforeHeight || !designatedKey.purpose.includes("enc")) { + throw new ChelErrorUnexpected(`Key ${eKeyId} is unauthorized or expired for the current contract`); + } + const deserializedKey = typeof key === "string" ? deserializeKey(key) : key; + try { + const result = JSON.parse(decrypt(deserializedKey, message, additionalData)); + if (typeof validatorFn === "function") + validatorFn(result, eKeyId); + return result; + } catch (e) { + throw new ChelErrorDecryptionError(e?.message || e); + } + }; + var encryptedIncomingData = (contractID, state, data, height, additionalKeys, additionalData, validatorFn) => { + let decryptedValue; + const decryptedValueFn = () => { + if (decryptedValue) { + return decryptedValue; + } + if (!state || !additionalKeys) { + const rootState = rootStateFn2(); + state = state || rootState[contractID]; + additionalKeys = additionalKeys ?? rootState.secretKeys; + } + decryptedValue = decryptData.call(state, height, data, additionalKeys, additionalData || "", validatorFn); + if (isRawSignedData(decryptedValue)) { + decryptedValue = signedIncomingData(contractID, state, decryptedValue, height, additionalData || ""); + } + return decryptedValue; + }; + return wrapper2({ + get encryptionKeyId() { + return encryptedDataKeyId(data); + }, + get serialize() { + return () => data; + }, + get toString() { + return () => JSON.stringify(this.serialize()); + }, + get valueOf() { + return decryptedValueFn; + }, + get toJSON() { + return this.serialize; + } + }); + }; + var encryptedIncomingForeignData = (contractID, _0, data, _1, additionalKeys, additionalData, validatorFn) => { + let decryptedValue; + const decryptedValueFn = () => { + if (decryptedValue) { + return decryptedValue; + } + const rootState = rootStateFn2(); + const state = rootState[contractID]; + decryptedValue = decryptData.call(state, NaN, data, additionalKeys ?? rootState.secretKeys, additionalData || "", validatorFn); + if (isRawSignedData(decryptedValue)) { + return signedIncomingData(contractID, state, decryptedValue, NaN, additionalData || ""); + } + return decryptedValue; + }; + return wrapper2({ + get encryptionKeyId() { + return encryptedDataKeyId(data); + }, + get serialize() { + return () => data; + }, + get toString() { + return () => JSON.stringify(this.serialize()); + }, + get valueOf() { + return decryptedValueFn; + }, + get toJSON() { + return this.serialize; + } + }); + }; + var encryptedDataKeyId = (data) => { + if (!isRawEncryptedData(data)) { + throw new ChelErrorDecryptionError("Invalid message format"); + } + return data[0]; + }; + var isRawEncryptedData = (data) => { + if (!Array.isArray(data) || data.length !== 2 || data.map((v) => typeof v).filter((v) => v !== "string").length !== 0) { + return false; + } + return true; + }; + var unwrapMaybeEncryptedData = (data) => { + if (isEncryptedData(data)) { + if (false) + return; + try { + return { + encryptionKeyId: data.encryptionKeyId, + data: data.valueOf() + }; + } catch (e) { + console.warn("unwrapMaybeEncryptedData: Unable to decrypt", e); + } + } else { + return { + encryptionKeyId: null, + data + }; + } + }; + var maybeEncryptedIncomingData = (contractID, state, data, height, additionalKeys, additionalData, validatorFn) => { + if (isRawEncryptedData(data)) { + return encryptedIncomingData(contractID, state, data, height, additionalKeys, additionalData, validatorFn); + } else { + validatorFn?.(data, ""); + return data; + } + }; + + // shared/serdes/index.js + var raw = Symbol("raw"); + var serdesTagSymbol = Symbol("tag"); + var serdesSerializeSymbol = Symbol("serialize"); + var serdesDeserializeSymbol = Symbol("deserialize"); + var rawResult = (obj) => { + Object.defineProperty(obj, raw, { value: true }); + return obj; + }; + var serializer = (data) => { + const verbatim = []; + const transferables = /* @__PURE__ */ new Set(); + const revokables = /* @__PURE__ */ new Set(); + const result = JSON.parse(JSON.stringify(data, (_key, value) => { + if (value && value[raw]) + return value; + if (value === void 0) + return rawResult(["_", "_"]); + if (!value) + return value; + if (Array.isArray(value) && value[0] === "_") + return rawResult(["_", "_", ...value]); + if (value instanceof Map) { + return rawResult(["_", "Map", Array.from(value.entries())]); + } + if (value instanceof Set) { + return rawResult(["_", "Set", Array.from(value.entries())]); + } + if (value instanceof Error || value instanceof Blob || value instanceof File) { + const pos = verbatim.length; + verbatim[verbatim.length] = value; + return rawResult(["_", "_ref", pos]); + } + if (value instanceof MessagePort || value instanceof ReadableStream || value instanceof WritableStream || value instanceof ArrayBuffer) { + const pos = verbatim.length; + verbatim[verbatim.length] = value; + transferables.add(value); + return rawResult(["_", "_ref", pos]); + } + if (ArrayBuffer.isView(value)) { + const pos = verbatim.length; + verbatim[verbatim.length] = value; + transferables.add(value.buffer); + return rawResult(["_", "_ref", pos]); + } + if (typeof value === "function") { + const mc = new MessageChannel(); + mc.port1.onmessage = async (ev) => { + try { + try { + const result2 = await value(...deserializer(ev.data[1])); + const { data: data2, transferables: transferables2 } = serializer(result2); + ev.data[0].postMessage([true, data2], transferables2); + } catch (e) { + const { data: data2, transferables: transferables2 } = serializer(e); + ev.data[0].postMessage([false, data2], transferables2); + } + } catch (e) { + console.error("Async error on onmessage handler", e); + } + }; + transferables.add(mc.port2); + revokables.add(mc.port1); + return rawResult(["_", "_fn", mc.port2]); + } + const proto3 = Object.getPrototypeOf(value); + if (proto3?.constructor?.[serdesTagSymbol] && proto3.constructor[serdesSerializeSymbol]) { + return rawResult(["_", "_custom", proto3.constructor[serdesTagSymbol], proto3.constructor[serdesSerializeSymbol](value)]); + } + return value; + }), (_key, value) => { + if (Array.isArray(value) && value[0] === "_" && value[1] === "_ref") { + return verbatim[value[2]]; + } + return value; + }); + return { + data: result, + transferables: Array.from(transferables), + revokables: Array.from(revokables) + }; + }; + var deserializerTable = /* @__PURE__ */ Object.create(null); + var deserializer = (data) => { + const verbatim = []; + return JSON.parse(JSON.stringify(data, (_key, value) => { + if (value && typeof value === "object" && !Array.isArray(value) && Object.getPrototypeOf(value) !== Object.prototype) { + const pos = verbatim.length; + verbatim[verbatim.length] = value; + return rawResult(["_", "_ref", pos]); + } + return value; + }), (_key, value) => { + if (Array.isArray(value) && value[0] === "_") { + switch (value[1]) { + case "_": + if (value.length >= 3) { + return value.slice(2); + } else { + return void 0; + } + case "Map": + return new Map(value[2]); + case "Set": + return new Set(value[2]); + case "_custom": + if (deserializerTable[value[2]]) { + return deserializerTable[value[2]](value[3]); + } else { + throw new Error("Invalid or unknown tag: " + value[2]); + } + case "_ref": + return verbatim[value[2]]; + case "_fn": { + const mp = value[2]; + return (...args) => { + return new Promise((resolve, reject) => { + const mc = new MessageChannel(); + const { data: data2, transferables } = serializer(args); + mc.port1.onmessage = (ev) => { + if (ev.data[0]) { + resolve(deserializer(ev.data[1])); + } else { + reject(deserializer(ev.data[1])); + } + }; + mp.postMessage([mc.port2, data2], [mc.port2, ...transferables]); + }); + }; + } + } + } + return value; + }); + }; + deserializer.register = (y) => { + if (typeof y === "function" && typeof y[serdesTagSymbol] === "string" && typeof y[serdesDeserializeSymbol] === "function") { + deserializerTable[y[serdesTagSymbol]] = y[serdesDeserializeSymbol].bind(y); + } + }; + + // shared/domains/chelonia/GIMessage.js + var decryptedAndVerifiedDeserializedMessage = (head, headJSON, contractID, parsedMessage, additionalKeys, state) => { + const op = head.op; + const height = head.height; + const message = op === GIMessage.OP_ACTION_ENCRYPTED ? encryptedIncomingData(contractID, state, parsedMessage, height, additionalKeys, headJSON, void 0) : parsedMessage; + if ([GIMessage.OP_KEY_ADD, GIMessage.OP_KEY_UPDATE].includes(op)) { + return message.map((key) => { + return maybeEncryptedIncomingData(contractID, state, key, height, additionalKeys, headJSON, (key2, eKeyId) => { + if (key2.meta?.private?.content) { + key2.meta.private.content = encryptedIncomingData(contractID, state, key2.meta.private.content, height, additionalKeys, headJSON, (value) => { + const computedKeyId = keyId(value); + if (computedKeyId !== key2.id) { + throw new Error(`Key ID mismatch. Expected to decrypt key ID ${key2.id} but got ${computedKeyId}`); + } + }); + } + if (key2.meta?.keyRequest?.reference) { + try { + key2.meta.keyRequest.reference = maybeEncryptedIncomingData(contractID, state, key2.meta.keyRequest.reference, height, additionalKeys, headJSON)?.valueOf(); + } catch { + delete key2.meta.keyRequest.reference; + } + } + if (key2.meta?.keyRequest?.contractID) { + try { + key2.meta.keyRequest.contractID = maybeEncryptedIncomingData(contractID, state, key2.meta.keyRequest.contractID, height, additionalKeys, headJSON)?.valueOf(); + } catch { + delete key2.meta.keyRequest.contractID; + } + } + }); + }); + } + if (op === GIMessage.OP_CONTRACT) { + message.keys = message.keys?.map((key, eKeyId) => { + return maybeEncryptedIncomingData(contractID, state, key, height, additionalKeys, headJSON, (key2) => { + if (!key2.meta?.private?.content) + return; + const decryptionFn = message.foreignContractID ? encryptedIncomingForeignData : encryptedIncomingData; + const decryptionContract = message.foreignContractID ? message.foreignContractID : contractID; + key2.meta.private.content = decryptionFn(decryptionContract, state, key2.meta.private.content, height, additionalKeys, headJSON, (value) => { + const computedKeyId = keyId(value); + if (computedKeyId !== key2.id) { + throw new Error(`Key ID mismatch. Expected to decrypt key ID ${key2.id} but got ${computedKeyId}`); + } + }); + }); + }); + } + if (op === GIMessage.OP_KEY_SHARE) { + return maybeEncryptedIncomingData(contractID, state, message, height, additionalKeys, headJSON, (message2) => { + message2.keys?.forEach((key) => { + if (!key.meta?.private?.content) + return; + const decryptionFn = message2.foreignContractID ? encryptedIncomingForeignData : encryptedIncomingData; + const decryptionContract = message2.foreignContractID || contractID; + key.meta.private.content = decryptionFn(decryptionContract, state, key.meta.private.content, height, additionalKeys, headJSON, (value) => { + const computedKeyId = keyId(value); + if (computedKeyId !== key.id) { + throw new Error(`Key ID mismatch. Expected to decrypt key ID ${key.id} but got ${computedKeyId}`); + } + }); + }); + }); + } + if (op === GIMessage.OP_KEY_REQUEST) { + return maybeEncryptedIncomingData(contractID, state, message, height, additionalKeys, headJSON, (msg) => { + msg.replyWith = signedIncomingData(msg.contractID, void 0, msg.replyWith, msg.height, headJSON); + }); + } + if (op === GIMessage.OP_ACTION_UNENCRYPTED && isRawSignedData(message)) { + return signedIncomingData(contractID, state, message, height, headJSON); + } + if (op === GIMessage.OP_ACTION_ENCRYPTED) { + return message; + } + if (op === GIMessage.OP_KEY_DEL) { + return message.map((key) => { + return maybeEncryptedIncomingData(contractID, state, key, height, additionalKeys, headJSON, void 0); + }); + } + if (op === GIMessage.OP_KEY_REQUEST_SEEN) { + return maybeEncryptedIncomingData(contractID, state, parsedMessage, height, additionalKeys, headJSON, void 0); + } + if (op === GIMessage.OP_ATOMIC) { + return message.map(([opT, opV]) => [ + opT, + decryptedAndVerifiedDeserializedMessage({ ...head, op: opT }, headJSON, contractID, opV, additionalKeys, state) + ]); + } + return message; + }; + var _GIMessage = class { + _mapping; + _head; + _message; + _signedMessageData; + _direction; + _decryptedValue; + _innerSigningKeyId; + static createV1_0({ + contractID, + previousHEAD = null, + height = Number.MAX_SAFE_INTEGER, + op, + manifest + }) { + const head = { + version: "1.0.0", + previousHEAD, + height, + contractID, + op: op[0], + manifest + }; + return new this(messageToParams(head, op[1])); + } + static cloneWith(targetHead, targetOp, sources) { + const head = Object.assign({}, targetHead, sources); + return new this(messageToParams(head, targetOp[1])); + } + static deserialize(value, additionalKeys, state) { + if (!value) + throw new Error(`deserialize bad value: ${value}`); + const { head: headJSON, ...parsedValue } = JSON.parse(value); + const head = JSON.parse(headJSON); + const contractID = head.op === _GIMessage.OP_CONTRACT ? createCID(value) : head.contractID; + if (!state?._vm?.authorizedKeys && head.op === _GIMessage.OP_CONTRACT) { + const value2 = rawSignedIncomingData(parsedValue); + const authorizedKeys = Object.fromEntries(value2.valueOf()?.keys.map((k) => [k.id, k])); + state = { + _vm: { + authorizedKeys + } + }; + } + const signedMessageData = signedIncomingData(contractID, state, parsedValue, head.height, headJSON, (message) => decryptedAndVerifiedDeserializedMessage(head, headJSON, contractID, message, additionalKeys, state)); + return new this({ + direction: "incoming", + mapping: { key: createCID(value), value }, + head, + signedMessageData + }); + } + static deserializeHEAD(value) { + if (!value) + throw new Error(`deserialize bad value: ${value}`); + let head, hash; + const result = { + get head() { + if (head === void 0) { + head = JSON.parse(JSON.parse(value).head); + } + return head; + }, + get hash() { + if (!hash) { + hash = createCID(value); + } + return hash; + }, + get contractID() { + return result.head?.contractID ?? result.hash; + }, + description() { + const type = this.head.op; + return ``; + }, + get isFirstMessage() { + return !result.head?.contractID; + } + }; + return result; + } + constructor(params) { + this._direction = params.direction; + this._mapping = params.mapping; + this._head = params.head; + this._signedMessageData = params.signedMessageData; + const type = this.opType(); + let atomicTopLevel = true; + const validate = (type2, message) => { + switch (type2) { + case _GIMessage.OP_CONTRACT: + if (!this.isFirstMessage() || !atomicTopLevel) + throw new Error("OP_CONTRACT: must be first message"); + break; + case _GIMessage.OP_ATOMIC: + if (!atomicTopLevel) { + throw new Error("OP_ATOMIC not allowed inside of OP_ATOMIC"); + } + if (!Array.isArray(message)) { + throw new TypeError("OP_ATOMIC must be of an array type"); + } + atomicTopLevel = false; + message.forEach(([t, m]) => validate(t, m)); + break; + case _GIMessage.OP_KEY_ADD: + case _GIMessage.OP_KEY_DEL: + case _GIMessage.OP_KEY_UPDATE: + if (!Array.isArray(message)) + throw new TypeError("OP_KEY_{ADD|DEL|UPDATE} must be of an array type"); + break; + case _GIMessage.OP_KEY_SHARE: + case _GIMessage.OP_KEY_REQUEST: + case _GIMessage.OP_KEY_REQUEST_SEEN: + case _GIMessage.OP_ACTION_ENCRYPTED: + case _GIMessage.OP_ACTION_UNENCRYPTED: + break; + default: + throw new Error(`unsupported op: ${type2}`); + } + }; + Object.defineProperty(this, "_message", { + get: ((validated) => () => { + const message = this._signedMessageData.valueOf(); + if (!validated) { + validate(type, message); + validated = true; + } + return message; + })() + }); + } + decryptedValue() { + if (this._decryptedValue) + return this._decryptedValue; + try { + const value = this.message(); + const data = unwrapMaybeEncryptedData(value); + if (data?.data) { + if (isSignedData(data.data)) { + this._innerSigningKeyId = data.data.signingKeyId; + this._decryptedValue = data.data.valueOf(); + } else { + this._decryptedValue = data.data; + } + } + return this._decryptedValue; + } catch { + return void 0; + } + } + innerSigningKeyId() { + if (!this._decryptedValue) { + this.decryptedValue(); + } + return this._innerSigningKeyId; + } + head() { + return this._head; + } + message() { + return this._message; + } + op() { + return [this.head().op, this.message()]; + } + rawOp() { + return [this.head().op, this._signedMessageData]; + } + opType() { + return this.head().op; + } + opValue() { + return this.message(); + } + signingKeyId() { + return this._signedMessageData.signingKeyId; + } + manifest() { + return this.head().manifest; + } + description() { + const type = this.opType(); + let desc = ``; + } + isFirstMessage() { + return !this.head().contractID; + } + contractID() { + return this.head().contractID || this.hash(); + } + serialize() { + return this._mapping.value; + } + hash() { + return this._mapping.key; + } + height() { + return this._head.height; + } + id() { + throw new Error("GIMessage.id() was called but it has been removed"); + } + direction() { + return this._direction; + } + static get [serdesTagSymbol]() { + return "GIMessage"; + } + static [serdesSerializeSymbol](m) { + return [m.serialize(), m.direction(), m.decryptedValue(), m.innerSigningKeyId()]; + } + static [serdesDeserializeSymbol]([serialized, direction, decryptedValue, innerSigningKeyId]) { + const m = _GIMessage.deserialize(serialized); + m._direction = direction; + m._decryptedValue = decryptedValue; + m._innerSigningKeyId = innerSigningKeyId; + return m; + } + }; + var GIMessage = _GIMessage; + __publicField(GIMessage, "OP_CONTRACT", "c"); + __publicField(GIMessage, "OP_ACTION_ENCRYPTED", "ae"); + __publicField(GIMessage, "OP_ACTION_UNENCRYPTED", "au"); + __publicField(GIMessage, "OP_KEY_ADD", "ka"); + __publicField(GIMessage, "OP_KEY_DEL", "kd"); + __publicField(GIMessage, "OP_KEY_UPDATE", "ku"); + __publicField(GIMessage, "OP_PROTOCOL_UPGRADE", "pu"); + __publicField(GIMessage, "OP_PROP_SET", "ps"); + __publicField(GIMessage, "OP_PROP_DEL", "pd"); + __publicField(GIMessage, "OP_CONTRACT_AUTH", "ca"); + __publicField(GIMessage, "OP_CONTRACT_DEAUTH", "cd"); + __publicField(GIMessage, "OP_ATOMIC", "a"); + __publicField(GIMessage, "OP_KEY_SHARE", "ks"); + __publicField(GIMessage, "OP_KEY_REQUEST", "kr"); + __publicField(GIMessage, "OP_KEY_REQUEST_SEEN", "krs"); + function messageToParams(head, message) { + let mapping; + return { + direction: has(message, "recreate") ? "outgoing" : "incoming", + get mapping() { + if (!mapping) { + const headJSON = JSON.stringify(head); + const messageJSON = { ...message.serialize(headJSON), head: headJSON }; + const value = JSON.stringify(messageJSON); + mapping = { + key: createCID(value), + value + }; + } + return mapping; + }, + head, + signedMessageData: message + }; + } + + // shared/domains/chelonia/Secret.js + var wm = /* @__PURE__ */ new WeakMap(); + var Secret = class { + static [serdesDeserializeSymbol](secret) { + return new this(secret); + } + static [serdesSerializeSymbol](secret) { + return wm.get(secret); + } + static get [serdesTagSymbol]() { + return "__chelonia_Secret"; + } + constructor(value) { + wm.set(this, value); + } + valueOf() { + return wm.get(this); + } + }; + + // shared/domains/chelonia/utils.js + var MAX_EVENTS_AFTER = Number.parseInt("", 10) || Infinity; + var findKeyIdByName = (state, name) => state._vm?.authorizedKeys && Object.values(state._vm.authorizedKeys).find((k) => k.name === name && k._notAfterHeight == null)?.id; + var findForeignKeysByContractID = (state, contractID) => state._vm?.authorizedKeys && Object.values(state._vm.authorizedKeys).filter((k) => k._notAfterHeight == null && k.foreignKey?.includes(contractID)).map((k) => k.id); + + // frontend/model/contracts/shared/constants.js + var MAX_HASH_LEN = 300; + var STATUS_OPEN = "open"; + var STATUS_PASSED = "passed"; + var STATUS_FAILED = "failed"; + var STATUS_EXPIRING = "expiring"; + var STATUS_EXPIRED = "expired"; + var STATUS_CANCELLED = "cancelled"; + var CHATROOM_NAME_LIMITS_IN_CHARS = 50; + var CHATROOM_DESCRIPTION_LIMITS_IN_CHARS = 280; + var CHATROOM_MAX_MESSAGE_LEN = 2e4; + var CHATROOM_MAX_MESSAGES = 20; + var CHATROOM_ACTIONS_PER_PAGE = 40; + var CHATROOM_MEMBER_MENTION_SPECIAL_CHAR = "@"; + var MESSAGE_RECEIVE_RAW = "message-receive-raw"; + var CHATROOM_TYPES = { + DIRECT_MESSAGE: "direct-message", + GROUP: "group" + }; + var CHATROOM_PRIVACY_LEVEL = { + GROUP: "group", + PRIVATE: "private", + PUBLIC: "public" + }; + var MESSAGE_TYPES = { + POLL: "poll", + TEXT: "text", + INTERACTIVE: "interactive", + NOTIFICATION: "notification" + }; + var MESSAGE_NOTIFICATIONS = { + ADD_MEMBER: "add-member", + JOIN_MEMBER: "join-member", + LEAVE_MEMBER: "leave-member", + KICK_MEMBER: "kick-member", + UPDATE_DESCRIPTION: "update-description", + UPDATE_NAME: "update-name" + }; + var POLL_TYPES = { + SINGLE_CHOICE: "single-vote", + MULTIPLE_CHOICES: "multiple-votes" + }; + var POLL_STATUS = { + ACTIVE: "active", + CLOSED: "closed" + }; + + // frontend/model/contracts/shared/functions.js + var import_sbp4 = __toESM(__require("@sbp/sbp")); + var import_common2 = __require("@common/common.js"); + + // frontend/model/contracts/shared/time.js + var import_common = __require("@common/common.js"); + var MINS_MILLIS = 6e4; + var HOURS_MILLIS = 60 * MINS_MILLIS; + var DAYS_MILLIS = 24 * HOURS_MILLIS; + var MONTHS_MILLIS = 30 * DAYS_MILLIS; + var YEARS_MILLIS = 365 * DAYS_MILLIS; + + // frontend/model/contracts/shared/functions.js + function createMessage({ meta, data, hash, height, state, pending, innerSigningContractID }) { + const { type, text, replyingMessage, attachments } = data; + const { createdDate } = meta; + const newMessage = { + type, + hash, + height, + from: innerSigningContractID, + datetime: new Date(createdDate).toISOString() + }; + if (pending) { + newMessage.pending = true; + } + if (type === MESSAGE_TYPES.TEXT) { + newMessage.text = text; + if (replyingMessage) { + newMessage.replyingMessage = replyingMessage; + } + if (attachments) { + newMessage.attachments = attachments; + } + } else if (type === MESSAGE_TYPES.POLL) { + newMessage.pollData = { + ...data.pollData, + creatorID: innerSigningContractID, + status: POLL_STATUS.ACTIVE, + options: data.pollData.options.map((opt) => ({ ...opt, voted: [] })) + }; + } else if (type === MESSAGE_TYPES.NOTIFICATION) { + const params = { + channelName: state?.attributes.name, + channelDescription: state?.attributes.description, + ...data.notification + }; + delete params.type; + newMessage.notification = { type: data.notification.type, params }; + } else if (type === MESSAGE_TYPES.INTERACTIVE) { + newMessage.proposal = data.proposal; + } + return newMessage; + } + async function leaveChatRoom(contractID, state) { + if (await (0, import_sbp4.default)("chelonia/contract/isSyncing", contractID, { firstSync: true })) { + return; + } + (0, import_sbp4.default)("gi.actions/identity/kv/deleteChatRoomUnreadMessages", { contractID }).catch((e) => { + console.error("[leaveChatroom] Error at deleteChatRoomUnreadMessages ", contractID, e); + }); + (0, import_sbp4.default)("okTurtles.events/emit", NEW_CHATROOM_UNREAD_POSITION, { chatRoomID: contractID }); + } + function findMessageIdx(hash, messages = []) { + for (let i = messages.length - 1; i >= 0; i--) { + if (messages[i].hash === hash) { + return i; + } + } + return -1; + } + function makeMentionFromUserID(userID) { + return { + me: userID ? `${CHATROOM_MEMBER_MENTION_SPECIAL_CHAR}${userID}` : "", + all: `${CHATROOM_MEMBER_MENTION_SPECIAL_CHAR}all` + }; + } + var referenceTally = (selector) => { + const delta = { + "retain": 1, + "release": -1 + }; + return { + [selector]: (parentContractID, childContractIDs, op) => { + if (!Array.isArray(childContractIDs)) + childContractIDs = [childContractIDs]; + if (op !== "retain" && op !== "release") + throw new Error("Invalid operation"); + for (const childContractID of childContractIDs) { + const key = `${selector}-${parentContractID}-${childContractID}`; + const count = (0, import_sbp4.default)("okTurtles.data/get", key); + (0, import_sbp4.default)("okTurtles.data/set", key, (count || 0) + delta[op]); + if (count != null) + return; + (0, import_sbp4.default)("chelonia/queueInvocation", parentContractID, () => { + const count2 = (0, import_sbp4.default)("okTurtles.data/get", key); + (0, import_sbp4.default)("okTurtles.data/delete", key); + if (count2 && count2 !== Math.sign(count2)) { + console.warn(`[${selector}] Unexpected value`, parentContractID, childContractID, count2); + if ("") { + Promise.reject(new Error(`[${selector}] Unexpected value ${parentContractID} ${childContractID}: ${count2}`)); + } + } + switch (Math.sign(count2)) { + case -1: + (0, import_sbp4.default)("chelonia/contract/release", childContractID).catch((e) => { + console.error(`[${selector}] Error calling release`, parentContractID, childContractID, e); + }); + break; + case 1: + (0, import_sbp4.default)("chelonia/contract/retain", childContractID).catch((e) => console.error(`[${selector}] Error calling retain`, parentContractID, childContractID, e)); + break; + } + }).catch((e) => { + console.error(`[${selector}] Error in queued invocation`, parentContractID, childContractID, e); + }); + } + } + }; + }; + + // frontend/model/contracts/shared/getters/chatroom.js + var chatroom_default = { + chatRoomSettings(state, getters) { + return getters.currentChatRoomState.settings || {}; + }, + chatRoomAttributes(state, getters) { + return getters.currentChatRoomState.attributes || {}; + }, + chatRoomMembers(state, getters) { + return getters.currentChatRoomState.members || {}; + }, + chatRoomRecentMessages(state, getters) { + return getters.currentChatRoomState.messages || []; + }, + chatRoomPinnedMessages(state, getters) { + return (getters.currentChatRoomState.pinnedMessages || []).sort((a, b) => a.height < b.height ? 1 : -1); + } + }; + + // frontend/model/contracts/shared/types.js + var inviteType = objectOf({ + inviteKeyId: string, + creatorID: string, + invitee: optional(string) + }); + var chatRoomAttributesType = objectOf({ + name: stringMax(CHATROOM_NAME_LIMITS_IN_CHARS), + description: stringMax(CHATROOM_DESCRIPTION_LIMITS_IN_CHARS), + creatorID: optional(string), + adminIDs: optional(arrayOf(string)), + type: unionOf(...Object.values(CHATROOM_TYPES).map((v) => literalOf(v))), + privacyLevel: unionOf(...Object.values(CHATROOM_PRIVACY_LEVEL).map((v) => literalOf(v))) + }); + var messageType = objectMaybeOf({ + type: unionOf(...Object.values(MESSAGE_TYPES).map((v) => literalOf(v))), + text: string, + proposal: objectOf({ + proposalId: string, + proposalType: string, + proposalData: object, + expires_date_ms: number, + createdDate: string, + creatorID: string, + status: unionOf(...[ + STATUS_OPEN, + STATUS_PASSED, + STATUS_FAILED, + STATUS_EXPIRING, + STATUS_EXPIRED, + STATUS_CANCELLED + ].map((v) => literalOf(v))) + }), + notification: objectMaybeOf({ + type: unionOf(...Object.values(MESSAGE_NOTIFICATIONS).map((v) => literalOf(v))), + params: mapOf(string, string) + }), + attachments: optional(arrayOf(objectOf({ + name: string, + mimeType: string, + size: numberRange(1, Number.MAX_SAFE_INTEGER), + dimension: optional(objectOf({ + width: number, + height: number + })), + downloadData: objectOf({ + manifestCid: string, + downloadParams: optional(object) + }) + }))), + replyingMessage: objectOf({ + hash: string, + text: string + }), + pollData: objectOf({ + question: string, + options: arrayOf(objectOf({ id: string, value: string })), + expires_date_ms: number, + hideVoters: boolean, + pollType: unionOf(...Object.values(POLL_TYPES).map((v) => literalOf(v))) + }), + onlyVisibleTo: arrayOf(string) + }); + + // frontend/model/contracts/chatroom.js + var GIChatroomAlreadyMemberError = ChelErrorGenerator("GIChatroomAlreadyMemberError"); + var GIChatroomNotMemberError = ChelErrorGenerator("GIChatroomNotMemberError"); + function createNotificationData(notificationType, moreParams = {}) { + return { + type: MESSAGE_TYPES.NOTIFICATION, + notification: { + type: notificationType, + ...moreParams + } + }; + } + async function deleteEncryptedFiles(manifestCids, option) { + if (Object.values(option).reduce((a, c) => a || c, false)) { + if (!Array.isArray(manifestCids)) { + manifestCids = [manifestCids]; + } + await (0, import_sbp5.default)("gi.actions/identity/removeFiles", { manifestCids, option }); + } + } + function addMessage(state, message) { + state.messages.push(message); + if (state.renderingContext) { + return; + } + while (state.messages.length > CHATROOM_MAX_MESSAGES) { + state.messages.shift(); + } + } + (0, import_sbp5.default)("chelonia/defineContract", { + name: "gi.contracts/chatroom", + metadata: { + validate: objectOf({ + createdDate: string + }), + async create() { + return { + createdDate: await fetchServerTime() + }; + } + }, + getters: { + currentChatRoomState(state) { + return state; + }, + ...chatroom_default + }, + actions: { + "gi.contracts/chatroom": { + validate: objectOf({ + attributes: chatRoomAttributesType + }), + process({ data }, { state }) { + const initialState = merge({ + settings: { + actionsPerPage: CHATROOM_ACTIONS_PER_PAGE, + maxNameLength: CHATROOM_NAME_LIMITS_IN_CHARS, + maxDescriptionLength: CHATROOM_DESCRIPTION_LIMITS_IN_CHARS + }, + attributes: { + adminIDs: [], + deletedDate: null + }, + members: {}, + messages: [], + pinnedMessages: [] + }, data); + for (const key in initialState) { + state[key] = initialState[key]; + } + } + }, + "gi.contracts/chatroom/join": { + validate: actionRequireInnerSignature(objectOf({ + memberID: optional(string) + })), + process({ data, meta, hash, height, contractID, innerSigningContractID }, { state }) { + const memberID = data.memberID || innerSigningContractID; + if (!memberID) { + throw new Error("The new member must be given either explicitly or implcitly with an inner signature"); + } + if (!state.renderingContext) { + if (!state.members) { + state.members = {}; + } + if (state.members[memberID]) { + throw new GIChatroomAlreadyMemberError(`Can not join the chatroom which ${memberID} is already part of`); + } + } + state.members[memberID] = { joinedDate: meta.createdDate, joinedHeight: height }; + if (!state.attributes) + return; + if (state.attributes.type === CHATROOM_TYPES.DIRECT_MESSAGE) { + return; + } + const notificationType = memberID === innerSigningContractID ? MESSAGE_NOTIFICATIONS.JOIN_MEMBER : MESSAGE_NOTIFICATIONS.ADD_MEMBER; + const notificationData = createNotificationData(notificationType, notificationType === MESSAGE_NOTIFICATIONS.ADD_MEMBER ? { memberID, actorID: innerSigningContractID } : { memberID }); + addMessage(state, createMessage({ meta, hash, height, state, data: notificationData, innerSigningContractID })); + }, + sideEffect({ data, contractID, hash, meta, innerSigningContractID, height }, { state }) { + const memberID = data.memberID || innerSigningContractID; + (0, import_sbp5.default)("gi.contracts/chatroom/referenceTally", contractID, memberID, "retain"); + (0, import_sbp5.default)("chelonia/queueInvocation", contractID, async () => { + const state2 = await (0, import_sbp5.default)("chelonia/contract/state", contractID); + if (!state2?.members?.[memberID]) { + return; + } + const identityContractID = (0, import_sbp5.default)("state/vuex/state").loggedIn.identityContractID; + if (memberID === identityContractID) { + (0, import_sbp5.default)("gi.actions/identity/kv/initChatRoomUnreadMessages", { + contractID, + messageHash: hash, + createdHeight: height + }); + } + }).catch((e) => { + console.error("[gi.contracts/chatroom/join/sideEffect] Error at sideEffect", e?.message || e); + }); + } + }, + "gi.contracts/chatroom/rename": { + validate: actionRequireInnerSignature((data, { state, message: { innerSigningContractID } }) => { + objectOf({ name: stringMax(CHATROOM_NAME_LIMITS_IN_CHARS, "name") })(data); + if (state.attributes.creatorID !== innerSigningContractID) { + throw new TypeError((0, import_common3.L)("Only the channel creator can rename.")); + } + }), + process({ data, meta, hash, height, innerSigningContractID }, { state }) { + state.attributes["name"] = data.name; + const notificationData = createNotificationData(MESSAGE_NOTIFICATIONS.UPDATE_NAME, {}); + const newMessage = createMessage({ meta, hash, height, data: notificationData, state, innerSigningContractID }); + state.messages.push(newMessage); + } + }, + "gi.contracts/chatroom/changeDescription": { + validate: actionRequireInnerSignature((data, { state, message: { innerSigningContractID } }) => { + objectOf({ description: stringMax(CHATROOM_DESCRIPTION_LIMITS_IN_CHARS, "description") })(data); + if (state.attributes.creatorID !== innerSigningContractID) { + throw new TypeError((0, import_common3.L)("Only the channel creator can change description.")); + } + }), + process({ data, meta, hash, height, innerSigningContractID }, { state }) { + state.attributes["description"] = data.description; + const notificationData = createNotificationData(MESSAGE_NOTIFICATIONS.UPDATE_DESCRIPTION, {}); + addMessage(state, createMessage({ meta, hash, height, state, data: notificationData, innerSigningContractID })); + } + }, + "gi.contracts/chatroom/leave": { + validate: objectOf({ + memberID: optional(string) + }), + process({ data, meta, hash, height, contractID, innerSigningContractID }, { state }) { + const memberID = data.memberID || innerSigningContractID; + if (!memberID) { + throw new Error("The removed member must be given either explicitly or implcitly with an inner signature"); + } + const isKicked = innerSigningContractID && memberID !== innerSigningContractID; + if (!state.renderingContext) { + if (!state.members) { + throw new Error("Missing members state"); + } else if (!state.members[memberID]) { + throw new GIChatroomNotMemberError(`Can not leave the chatroom ${contractID} which ${memberID} is not part of`); + } + } + delete state.members[memberID]; + if (!state.attributes) + return; + if (state.attributes.type === CHATROOM_TYPES.DIRECT_MESSAGE) { + return; + } + const notificationType = !isKicked ? MESSAGE_NOTIFICATIONS.LEAVE_MEMBER : MESSAGE_NOTIFICATIONS.KICK_MEMBER; + const notificationData = createNotificationData(notificationType, { memberID }); + addMessage(state, createMessage({ + meta, + hash, + height, + data: notificationData, + state, + innerSigningContractID: !isKicked ? memberID : innerSigningContractID + })); + }, + async sideEffect({ data, hash, contractID, meta, innerSigningContractID }, { state }) { + const memberID = data.memberID || innerSigningContractID; + const itsMe = memberID === (0, import_sbp5.default)("state/vuex/state").loggedIn.identityContractID; + if (itsMe) { + await leaveChatRoom(contractID, state).catch((e) => { + console.error("[gi.contracts/chatroom/leave] Error at leaveChatRoom", e); + }); + } + (0, import_sbp5.default)("gi.contracts/chatroom/referenceTally", contractID, memberID, "release"); + (0, import_sbp5.default)("chelonia/queueInvocation", contractID, async () => { + const state2 = await (0, import_sbp5.default)("chelonia/contract/state", contractID); + if (!state2 || !!state2.members?.[data.memberID] || !state2.attributes) { + return; + } + if (!itsMe && state2.attributes.privacyLevel === CHATROOM_PRIVACY_LEVEL.PRIVATE) { + (0, import_sbp5.default)("gi.contracts/chatroom/rotateKeys", contractID, state2); + } + (0, import_sbp5.default)("gi.contracts/chatroom/removeForeignKeys", contractID, memberID, state2); + }).catch((e) => { + console.error("[gi.contracts/chatroom/leave/sideEffect] Error at sideEffect", e?.message || e); + }); + } + }, + "gi.contracts/chatroom/delete": { + validate: actionRequireInnerSignature((_, { state, meta, message: { innerSigningContractID } }) => { + if (state.attributes.creatorID !== innerSigningContractID) { + throw new TypeError((0, import_common3.L)("Only the channel creator can delete channel.")); + } + }), + process({ meta, contractID }, { state }) { + if (!state.attributes) + return; + state.attributes["deletedDate"] = meta.createdDate; + (0, import_sbp5.default)("gi.contracts/chatroom/pushSideEffect", contractID, ["gi.contracts/chatroom/referenceTally", contractID, Object.keys(state.members), "release"]); + for (const memberID in state.members) { + delete state.members[memberID]; + } + }, + async sideEffect({ contractID }, { state }) { + await leaveChatRoom(contractID, state); + } + }, + "gi.contracts/chatroom/addMessage": { + validate: actionRequireInnerSignature(messageType), + process({ direction, data, meta, hash, height, innerSigningContractID }, { state }) { + if (!state.messages) + return; + const existingMsg = state.messages.find((msg) => msg.hash === hash); + if (!existingMsg) { + const pending = direction === "outgoing"; + addMessage(state, createMessage({ meta, data, hash, height, state, pending, innerSigningContractID })); + } else if (direction !== "outgoing") { + delete existingMsg["pending"]; + } + }, + sideEffect({ contractID, hash, height, meta, data, innerSigningContractID }, { state, getters }) { + const me = (0, import_sbp5.default)("state/vuex/state").loggedIn.identityContractID; + if (me === innerSigningContractID && data.type !== MESSAGE_TYPES.INTERACTIVE) { + return; + } + const newMessage = createMessage({ meta, data, hash, height, state, innerSigningContractID }); + (0, import_sbp5.default)("okTurtles.events/emit", MESSAGE_RECEIVE_RAW, { + contractID, + data, + innerSigningContractID, + newMessage + }); + } + }, + "gi.contracts/chatroom/editMessage": { + validate: actionRequireInnerSignature(objectOf({ + hash: stringMax(MAX_HASH_LEN, "hash"), + createdHeight: number, + text: stringMax(CHATROOM_MAX_MESSAGE_LEN, "text") + })), + process({ data, meta }, { state }) { + if (!state.messages) + return; + const { hash, text } = data; + const fnEditMessage = (message) => { + message["text"] = text; + message["updatedDate"] = meta.createdDate; + if (state.renderingContext && message.pending) { + delete message["pending"]; + } + }; + [state.messages, state.pinnedMessages].forEach((messageArray) => { + const msgIndex = findMessageIdx(hash, messageArray); + if (msgIndex >= 0) { + fnEditMessage(messageArray[msgIndex]); + } + }); + }, + sideEffect({ contractID, hash, meta, data, innerSigningContractID }, { state, getters }) { + const me = (0, import_sbp5.default)("state/vuex/state").loggedIn.identityContractID; + if (me === innerSigningContractID || getters.chatRoomAttributes.type === CHATROOM_TYPES.DIRECT_MESSAGE) { + return; + } + (0, import_sbp5.default)("okTurtles.events/emit", MESSAGE_RECEIVE_RAW, { + contractID, + data, + innerSigningContractID + }); + } + }, + "gi.contracts/chatroom/deleteMessage": { + validate: actionRequireInnerSignature((data, { state, message: { innerSigningContractID }, contractID }) => { + objectOf({ + hash: stringMax(MAX_HASH_LEN, "hash"), + manifestCids: arrayOf(stringMax(MAX_HASH_LEN, "manifestCids")), + messageSender: stringMax(MAX_HASH_LEN, "messageSender") + })(data); + if (innerSigningContractID !== data.messageSender) { + if (state.attributes.type === CHATROOM_TYPES.DIRECT_MESSAGE) { + throw new TypeError((0, import_common3.L)("Only the person who sent the message can delete it.")); + } else if (!state.attributes.adminIDs.includes(innerSigningContractID)) { + throw new TypeError((0, import_common3.L)("Only the group creator and the person who sent the message can delete it.")); + } + } + }), + process({ data, innerSigningContractID }, { state }) { + if (!state.messages) + return; + [state.messages, state.pinnedMessages].forEach((messageArray) => { + const msgIndex = findMessageIdx(data.hash, messageArray); + if (msgIndex >= 0) { + messageArray.splice(msgIndex, 1); + } + for (const message of messageArray) { + if (message.replyingMessage?.hash === data.hash) { + message.replyingMessage.hash = null; + message.replyingMessage.text = (0, import_common3.L)("Original message was removed by {user}", { + user: makeMentionFromUserID(innerSigningContractID).me + }); + } + } + }); + }, + sideEffect({ data, contractID, innerSigningContractID }) { + const rootState = (0, import_sbp5.default)("state/vuex/state"); + const me = rootState.loggedIn.identityContractID; + if (rootState.chatroom?.chatRoomScrollPosition?.[contractID] === data.hash) { + (0, import_sbp5.default)("okTurtles.events/emit", NEW_CHATROOM_UNREAD_POSITION, { + chatRoomID: contractID, + messageHash: null + }); + } + if (data.manifestCids.length) { + const option = { + shouldDeleteFile: me === innerSigningContractID, + shouldDeleteToken: me === data.messageSender + }; + deleteEncryptedFiles(data.manifestCids, option).catch((e) => { + console.error(`[gi.contracts/chatroom/deleteMessage/sideEffect] (${contractID}):`, e); + }); + } + if (me === innerSigningContractID) { + return; + } + (0, import_sbp5.default)("gi.actions/identity/kv/removeChatRoomUnreadMessage", { contractID, messageHash: data.hash }); + } + }, + "gi.contracts/chatroom/deleteAttachment": { + validate: actionRequireInnerSignature(objectOf({ + hash: stringMax(MAX_HASH_LEN, "hash"), + manifestCid: stringMax(MAX_HASH_LEN, "manifestCid"), + messageSender: stringMax(MAX_HASH_LEN, "messageSender") + })), + process({ data }, { state }) { + if (!state.messages) + return; + const fnDeleteAttachment = (message) => { + const oldAttachments = message.attachments; + if (Array.isArray(oldAttachments)) { + const newAttachments = oldAttachments.filter((attachment) => { + return attachment.downloadData.manifestCid !== data.manifestCid; + }); + message["attachments"] = newAttachments; + } + }; + [state.messages, state.pinnedMessages].forEach((messageArray) => { + const msgIndex = findMessageIdx(data.hash, messageArray); + if (msgIndex >= 0) { + fnDeleteAttachment(messageArray[msgIndex]); + } + }); + }, + sideEffect({ data, contractID, innerSigningContractID }) { + const me = (0, import_sbp5.default)("state/vuex/state").loggedIn.identityContractID; + const option = { + shouldDeleteFile: me === innerSigningContractID, + shouldDeleteToken: me === data.messageSender + }; + deleteEncryptedFiles(data.manifestCid, option).catch((e) => { + console.error(`[gi.contracts/chatroom/deleteAttachment/sideEffect] (${contractID}):`, e); + }); + } + }, + "gi.contracts/chatroom/makeEmotion": { + validate: actionRequireInnerSignature(objectOf({ + hash: stringMax(MAX_HASH_LEN, "hash"), + emoticon: string + })), + process({ data, innerSigningContractID }, { state }) { + if (!state.messages) + return; + const { hash, emoticon } = data; + const fnMakeEmotion = (message) => { + let emoticons = cloneDeep(message.emoticons || {}); + if (emoticons[emoticon]) { + const alreadyAdded = emoticons[emoticon].indexOf(innerSigningContractID); + if (alreadyAdded >= 0) { + emoticons[emoticon].splice(alreadyAdded, 1); + if (!emoticons[emoticon].length) { + delete emoticons[emoticon]; + if (!Object.keys(emoticons).length) { + emoticons = null; + } + } + } else { + emoticons[emoticon].push(innerSigningContractID); + } + } else { + emoticons[emoticon] = [innerSigningContractID]; + } + if (emoticons) { + message["emoticons"] = emoticons; + } else { + delete message["emoticons"]; + } + }; + [state.messages, state.pinnedMessages].forEach((messageArray) => { + const msgIndex = findMessageIdx(hash, messageArray); + if (msgIndex >= 0) { + fnMakeEmotion(messageArray[msgIndex]); + } + }); + } + }, + "gi.contracts/chatroom/voteOnPoll": { + validate: actionRequireInnerSignature(objectOf({ + hash: stringMax(MAX_HASH_LEN, "hash"), + votes: arrayOf(string), + votesAsString: string + })), + process({ data, meta, hash, height, innerSigningContractID }, { state }) { + if (!state.messages) + return; + const fnVoteOnPoll = (message) => { + const myVotes = data.votes; + const pollData = message.pollData; + const optsCopy = cloneDeep(pollData.options); + myVotes.forEach((optId) => { + optsCopy.find((x) => x.id === optId)?.voted.push(innerSigningContractID); + }); + message["pollData"] = { ...pollData, options: optsCopy }; + }; + [state.messages, state.pinnedMessages].forEach((messageArray) => { + const msgIndex = findMessageIdx(data.hash, messageArray); + if (msgIndex >= 0) { + fnVoteOnPoll(messageArray[msgIndex]); + } + }); + } + }, + "gi.contracts/chatroom/changeVoteOnPoll": { + validate: actionRequireInnerSignature(objectOf({ + hash: string, + votes: arrayOf(string), + votesAsString: string + })), + process({ data, meta, hash, height, innerSigningContractID }, { state }) { + if (!state.messages) + return; + const fnChangeVoteOnPoll = (message) => { + const myUpdatedVotes = data.votes; + const pollData = message.pollData; + const optsCopy = cloneDeep(pollData.options); + optsCopy.forEach((opt) => { + opt.voted = opt.voted.filter((votername) => votername !== innerSigningContractID); + }); + myUpdatedVotes.forEach((optId) => { + optsCopy.find((x) => x.id === optId)?.voted.push(innerSigningContractID); + }); + message["pollData"] = { ...pollData, options: optsCopy }; + }; + [state.messages, state.pinnedMessages].forEach((messageArray) => { + const msgIndex = findMessageIdx(data.hash, messageArray); + if (msgIndex >= 0) { + fnChangeVoteOnPoll(messageArray[msgIndex]); + } + }); + } + }, + "gi.contracts/chatroom/closePoll": { + validate: actionRequireInnerSignature(objectOf({ + hash: stringMax(MAX_HASH_LEN, "hash") + })), + process({ data }, { state }) { + if (!state.messages) + return; + const fnClosePoll = (message) => { + message.pollData["status"] = POLL_STATUS.CLOSED; + }; + [state.messages, state.pinnedMessages].forEach((messageArray) => { + const msgIndex = findMessageIdx(data.hash, messageArray); + if (msgIndex >= 0) { + fnClosePoll(messageArray[msgIndex]); + } + }); + } + }, + "gi.contracts/chatroom/pinMessage": { + validate: actionRequireInnerSignature(objectOf({ + message: object + })), + process({ data, innerSigningContractID }, { state }) { + if (!state.messages) + return; + const { message } = data; + state.pinnedMessages.unshift(message); + const msgIndex = findMessageIdx(message.hash, state.messages); + if (msgIndex >= 0) { + state.messages[msgIndex]["pinnedBy"] = innerSigningContractID; + } + } + }, + "gi.contracts/chatroom/unpinMessage": { + validate: actionRequireInnerSignature(objectOf({ + hash: stringMax(MAX_HASH_LEN, "hash") + })), + process({ data }, { state }) { + if (!state.messages) + return; + const pinnedMsgIndex = findMessageIdx(data.hash, state.pinnedMessages); + if (pinnedMsgIndex >= 0) { + state.pinnedMessages.splice(pinnedMsgIndex, 1); + } + const msgIndex = findMessageIdx(data.hash, state.messages); + if (msgIndex >= 0) { + delete state.messages[msgIndex]["pinnedBy"]; + } + } + }, + "gi.contracts/chatroom/upgradeFrom1.0.8": { + validate: actionRequireInnerSignature(optional(string)), + process({ data }, { state }) { + if (state.attributes.adminIDs) { + throw new Error("Upgrade can only be done once"); + } + state.attributes.adminIDs = data ? [data] : []; + } + } + }, + methods: { + "gi.contracts/chatroom/_cleanup": ({ contractID, state }) => { + if (state?.members) { + (0, import_sbp5.default)("chelonia/contract/release", Object.keys(state.members)).catch((e) => { + console.error("[gi.contracts/chatroom/_cleanup] Error calling release", contractID, e); + }); + } + }, + "gi.contracts/chatroom/rotateKeys": (contractID, state) => { + if (!state._volatile) + state["_volatile"] = /* @__PURE__ */ Object.create(null); + if (!state._volatile.pendingKeyRevocations) + state._volatile["pendingKeyRevocations"] = /* @__PURE__ */ Object.create(null); + const CSKid = findKeyIdByName(state, "csk"); + const CEKid = findKeyIdByName(state, "cek"); + state._volatile.pendingKeyRevocations[CSKid] = true; + state._volatile.pendingKeyRevocations[CEKid] = true; + (0, import_sbp5.default)("gi.actions/out/rotateKeys", contractID, "gi.contracts/chatroom", "pending", "gi.actions/chatroom/shareNewKeys").catch((e) => { + console.warn(`rotateKeys: ${e.name} thrown during queueEvent to ${contractID}:`, e); + }); + }, + "gi.contracts/chatroom/removeForeignKeys": (contractID, memberID, state) => { + const keyIds = findForeignKeysByContractID(state, memberID); + if (!keyIds?.length) + return; + const CSKid = findKeyIdByName(state, "csk"); + const CEKid = findKeyIdByName(state, "cek"); + if (!CEKid) + throw new Error("Missing encryption key"); + (0, import_sbp5.default)("chelonia/out/keyDel", { + contractID, + contractName: "gi.contracts/chatroom", + data: keyIds, + signingKeyId: CSKid, + hooks: { + preSendCheck: (_, state2) => { + return !state2.members?.[memberID]; + } + } + }).catch((e) => { + console.warn(`removeForeignKeys: ${e.name} thrown during queueEvent to ${contractID}:`, e); + }); + }, + ...referenceTally("gi.contracts/chatroom/referenceTally") + } + }); +})(); +/*! + * Fast "async" scrypt implementation in JavaScript. + * Copyright (c) 2013-2016 Dmitry Chestnykh | BSD License + * https://github.com/dchest/scrypt-async-js + */ +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ +/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ diff --git a/contracts/1.2.0/chatroom.1.2.0.manifest.json b/contracts/1.2.0/chatroom.1.2.0.manifest.json new file mode 100644 index 000000000..9baa42af0 --- /dev/null +++ b/contracts/1.2.0/chatroom.1.2.0.manifest.json @@ -0,0 +1 @@ +{"head":"{\"manifestVersion\":\"1.0.0\"}","body":"{\"name\":\"gi.contracts/chatroom\",\"version\":\"1.2.0\",\"contract\":{\"hash\":\"z9brRu3VQGDmACP2edyavncBbMxxHqDkQZdRLNkVypwgSvsxznD4\",\"file\":\"chatroom.js\"},\"signingKeys\":[\"[\\\"edwards25519sha512batch\\\",\\\"IjAFp6gIzHW2HOIXXS9b4A3EKf8t9NNa5nndHcROiDk=\\\",null]\"],\"contractSlim\":{\"file\":\"chatroom-slim.js\",\"hash\":\"z9brRu3VVDbcVmFJLxHGPPqL6h7R8si75KucRnwNqqFRGz4yDBR3\"}}","signature":{"keyId":"z2DrjgbCDg34SaBhFjNEF45AVodCUu7QwcFBksz3BDgN4BekrdN","value":"GTr4f6UKBucektFbzfaOKV+SE6anz98IrzMuuOQQlSdkFdOfYqAeHx/XdSh48epgA1WIdlQlPxk8ejzcB/saBw=="}} \ No newline at end of file diff --git a/contracts/1.2.0/chatroom.js b/contracts/1.2.0/chatroom.js new file mode 100644 index 000000000..6fbdb9369 --- /dev/null +++ b/contracts/1.2.0/chatroom.js @@ -0,0 +1,8862 @@ +"use strict"; +(() => { + var __create = Object.create; + var __defProp = Object.defineProperty; + var __getOwnPropDesc = Object.getOwnPropertyDescriptor; + var __getOwnPropNames = Object.getOwnPropertyNames; + var __getProtoOf = Object.getPrototypeOf; + var __hasOwnProp = Object.prototype.hasOwnProperty; + var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; + var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { + get: (a, b) => (typeof require !== "undefined" ? require : a)[b] + }) : x)(function(x) { + if (typeof require !== "undefined") + return require.apply(this, arguments); + throw new Error('Dynamic require of "' + x + '" is not supported'); + }); + var __commonJS = (cb, mod) => function __require2() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; + }; + var __copyProps = (to, from3, except, desc) => { + if (from3 && typeof from3 === "object" || typeof from3 === "function") { + for (let key of __getOwnPropNames(from3)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from3[key], enumerable: !(desc = __getOwnPropDesc(from3, key)) || desc.enumerable }); + } + return to; + }; + var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod)); + var __publicField = (obj, key, value) => { + __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); + return value; + }; + + // node_modules/blakejs/util.js + var require_util = __commonJS({ + "node_modules/blakejs/util.js"(exports, module) { + var ERROR_MSG_INPUT = "Input must be an string, Buffer or Uint8Array"; + function normalizeInput(input) { + let ret; + if (input instanceof Uint8Array) { + ret = input; + } else if (typeof input === "string") { + const encoder = new TextEncoder(); + ret = encoder.encode(input); + } else { + throw new Error(ERROR_MSG_INPUT); + } + return ret; + } + function toHex(bytes) { + return Array.prototype.map.call(bytes, function(n) { + return (n < 16 ? "0" : "") + n.toString(16); + }).join(""); + } + function uint32ToHex(val) { + return (4294967296 + val).toString(16).substring(1); + } + function debugPrint(label, arr, size) { + let msg = "\n" + label + " = "; + for (let i = 0; i < arr.length; i += 2) { + if (size === 32) { + msg += uint32ToHex(arr[i]).toUpperCase(); + msg += " "; + msg += uint32ToHex(arr[i + 1]).toUpperCase(); + } else if (size === 64) { + msg += uint32ToHex(arr[i + 1]).toUpperCase(); + msg += uint32ToHex(arr[i]).toUpperCase(); + } else + throw new Error("Invalid size " + size); + if (i % 6 === 4) { + msg += "\n" + new Array(label.length + 4).join(" "); + } else if (i < arr.length - 2) { + msg += " "; + } + } + console.log(msg); + } + function testSpeed(hashFn, N, M) { + let startMs = new Date().getTime(); + const input = new Uint8Array(N); + for (let i = 0; i < N; i++) { + input[i] = i % 256; + } + const genMs = new Date().getTime(); + console.log("Generated random input in " + (genMs - startMs) + "ms"); + startMs = genMs; + for (let i = 0; i < M; i++) { + const hashHex = hashFn(input); + const hashMs = new Date().getTime(); + const ms = hashMs - startMs; + startMs = hashMs; + console.log("Hashed in " + ms + "ms: " + hashHex.substring(0, 20) + "..."); + console.log(Math.round(N / (1 << 20) / (ms / 1e3) * 100) / 100 + " MB PER SECOND"); + } + } + module.exports = { + normalizeInput, + toHex, + debugPrint, + testSpeed + }; + } + }); + + // node_modules/blakejs/blake2b.js + var require_blake2b = __commonJS({ + "node_modules/blakejs/blake2b.js"(exports, module) { + var util = require_util(); + function ADD64AA(v2, a, b) { + const o0 = v2[a] + v2[b]; + let o1 = v2[a + 1] + v2[b + 1]; + if (o0 >= 4294967296) { + o1++; + } + v2[a] = o0; + v2[a + 1] = o1; + } + function ADD64AC(v2, a, b0, b1) { + let o0 = v2[a] + b0; + if (b0 < 0) { + o0 += 4294967296; + } + let o1 = v2[a + 1] + b1; + if (o0 >= 4294967296) { + o1++; + } + v2[a] = o0; + v2[a + 1] = o1; + } + function B2B_GET32(arr, i) { + return arr[i] ^ arr[i + 1] << 8 ^ arr[i + 2] << 16 ^ arr[i + 3] << 24; + } + function B2B_G(a, b, c, d, ix, iy) { + const x0 = m[ix]; + const x1 = m[ix + 1]; + const y0 = m[iy]; + const y1 = m[iy + 1]; + ADD64AA(v, a, b); + ADD64AC(v, a, x0, x1); + let xor0 = v[d] ^ v[a]; + let xor1 = v[d + 1] ^ v[a + 1]; + v[d] = xor1; + v[d + 1] = xor0; + ADD64AA(v, c, d); + xor0 = v[b] ^ v[c]; + xor1 = v[b + 1] ^ v[c + 1]; + v[b] = xor0 >>> 24 ^ xor1 << 8; + v[b + 1] = xor1 >>> 24 ^ xor0 << 8; + ADD64AA(v, a, b); + ADD64AC(v, a, y0, y1); + xor0 = v[d] ^ v[a]; + xor1 = v[d + 1] ^ v[a + 1]; + v[d] = xor0 >>> 16 ^ xor1 << 16; + v[d + 1] = xor1 >>> 16 ^ xor0 << 16; + ADD64AA(v, c, d); + xor0 = v[b] ^ v[c]; + xor1 = v[b + 1] ^ v[c + 1]; + v[b] = xor1 >>> 31 ^ xor0 << 1; + v[b + 1] = xor0 >>> 31 ^ xor1 << 1; + } + var BLAKE2B_IV32 = new Uint32Array([ + 4089235720, + 1779033703, + 2227873595, + 3144134277, + 4271175723, + 1013904242, + 1595750129, + 2773480762, + 2917565137, + 1359893119, + 725511199, + 2600822924, + 4215389547, + 528734635, + 327033209, + 1541459225 + ]); + var SIGMA8 = [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 14, + 10, + 4, + 8, + 9, + 15, + 13, + 6, + 1, + 12, + 0, + 2, + 11, + 7, + 5, + 3, + 11, + 8, + 12, + 0, + 5, + 2, + 15, + 13, + 10, + 14, + 3, + 6, + 7, + 1, + 9, + 4, + 7, + 9, + 3, + 1, + 13, + 12, + 11, + 14, + 2, + 6, + 5, + 10, + 4, + 0, + 15, + 8, + 9, + 0, + 5, + 7, + 2, + 4, + 10, + 15, + 14, + 1, + 11, + 12, + 6, + 8, + 3, + 13, + 2, + 12, + 6, + 10, + 0, + 11, + 8, + 3, + 4, + 13, + 7, + 5, + 15, + 14, + 1, + 9, + 12, + 5, + 1, + 15, + 14, + 13, + 4, + 10, + 0, + 7, + 6, + 3, + 9, + 2, + 8, + 11, + 13, + 11, + 7, + 14, + 12, + 1, + 3, + 9, + 5, + 0, + 15, + 4, + 8, + 6, + 2, + 10, + 6, + 15, + 14, + 9, + 11, + 3, + 0, + 8, + 12, + 2, + 13, + 7, + 1, + 4, + 10, + 5, + 10, + 2, + 8, + 4, + 7, + 6, + 1, + 5, + 15, + 11, + 9, + 14, + 3, + 12, + 13, + 0, + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 14, + 10, + 4, + 8, + 9, + 15, + 13, + 6, + 1, + 12, + 0, + 2, + 11, + 7, + 5, + 3 + ]; + var SIGMA82 = new Uint8Array(SIGMA8.map(function(x) { + return x * 2; + })); + var v = new Uint32Array(32); + var m = new Uint32Array(32); + function blake2bCompress(ctx, last) { + let i = 0; + for (i = 0; i < 16; i++) { + v[i] = ctx.h[i]; + v[i + 16] = BLAKE2B_IV32[i]; + } + v[24] = v[24] ^ ctx.t; + v[25] = v[25] ^ ctx.t / 4294967296; + if (last) { + v[28] = ~v[28]; + v[29] = ~v[29]; + } + for (i = 0; i < 32; i++) { + m[i] = B2B_GET32(ctx.b, 4 * i); + } + for (i = 0; i < 12; i++) { + B2B_G(0, 8, 16, 24, SIGMA82[i * 16 + 0], SIGMA82[i * 16 + 1]); + B2B_G(2, 10, 18, 26, SIGMA82[i * 16 + 2], SIGMA82[i * 16 + 3]); + B2B_G(4, 12, 20, 28, SIGMA82[i * 16 + 4], SIGMA82[i * 16 + 5]); + B2B_G(6, 14, 22, 30, SIGMA82[i * 16 + 6], SIGMA82[i * 16 + 7]); + B2B_G(0, 10, 20, 30, SIGMA82[i * 16 + 8], SIGMA82[i * 16 + 9]); + B2B_G(2, 12, 22, 24, SIGMA82[i * 16 + 10], SIGMA82[i * 16 + 11]); + B2B_G(4, 14, 16, 26, SIGMA82[i * 16 + 12], SIGMA82[i * 16 + 13]); + B2B_G(6, 8, 18, 28, SIGMA82[i * 16 + 14], SIGMA82[i * 16 + 15]); + } + for (i = 0; i < 16; i++) { + ctx.h[i] = ctx.h[i] ^ v[i] ^ v[i + 16]; + } + } + var parameterBlock = new Uint8Array([ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ]); + function blake2bInit2(outlen, key, salt, personal) { + if (outlen === 0 || outlen > 64) { + throw new Error("Illegal output length, expected 0 < length <= 64"); + } + if (key && key.length > 64) { + throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64"); + } + if (salt && salt.length !== 16) { + throw new Error("Illegal salt, expected Uint8Array with length is 16"); + } + if (personal && personal.length !== 16) { + throw new Error("Illegal personal, expected Uint8Array with length is 16"); + } + const ctx = { + b: new Uint8Array(128), + h: new Uint32Array(16), + t: 0, + c: 0, + outlen + }; + parameterBlock.fill(0); + parameterBlock[0] = outlen; + if (key) + parameterBlock[1] = key.length; + parameterBlock[2] = 1; + parameterBlock[3] = 1; + if (salt) + parameterBlock.set(salt, 32); + if (personal) + parameterBlock.set(personal, 48); + for (let i = 0; i < 16; i++) { + ctx.h[i] = BLAKE2B_IV32[i] ^ B2B_GET32(parameterBlock, i * 4); + } + if (key) { + blake2bUpdate2(ctx, key); + ctx.c = 128; + } + return ctx; + } + function blake2bUpdate2(ctx, input) { + for (let i = 0; i < input.length; i++) { + if (ctx.c === 128) { + ctx.t += ctx.c; + blake2bCompress(ctx, false); + ctx.c = 0; + } + ctx.b[ctx.c++] = input[i]; + } + } + function blake2bFinal2(ctx) { + ctx.t += ctx.c; + while (ctx.c < 128) { + ctx.b[ctx.c++] = 0; + } + blake2bCompress(ctx, true); + const out = new Uint8Array(ctx.outlen); + for (let i = 0; i < ctx.outlen; i++) { + out[i] = ctx.h[i >> 2] >> 8 * (i & 3); + } + return out; + } + function blake2b3(input, key, outlen, salt, personal) { + outlen = outlen || 64; + input = util.normalizeInput(input); + if (salt) { + salt = util.normalizeInput(salt); + } + if (personal) { + personal = util.normalizeInput(personal); + } + const ctx = blake2bInit2(outlen, key, salt, personal); + blake2bUpdate2(ctx, input); + return blake2bFinal2(ctx); + } + function blake2bHex(input, key, outlen, salt, personal) { + const output = blake2b3(input, key, outlen, salt, personal); + return util.toHex(output); + } + module.exports = { + blake2b: blake2b3, + blake2bHex, + blake2bInit: blake2bInit2, + blake2bUpdate: blake2bUpdate2, + blake2bFinal: blake2bFinal2 + }; + } + }); + + // node_modules/blakejs/blake2s.js + var require_blake2s = __commonJS({ + "node_modules/blakejs/blake2s.js"(exports, module) { + var util = require_util(); + function B2S_GET32(v2, i) { + return v2[i] ^ v2[i + 1] << 8 ^ v2[i + 2] << 16 ^ v2[i + 3] << 24; + } + function B2S_G(a, b, c, d, x, y) { + v[a] = v[a] + v[b] + x; + v[d] = ROTR32(v[d] ^ v[a], 16); + v[c] = v[c] + v[d]; + v[b] = ROTR32(v[b] ^ v[c], 12); + v[a] = v[a] + v[b] + y; + v[d] = ROTR32(v[d] ^ v[a], 8); + v[c] = v[c] + v[d]; + v[b] = ROTR32(v[b] ^ v[c], 7); + } + function ROTR32(x, y) { + return x >>> y ^ x << 32 - y; + } + var BLAKE2S_IV = new Uint32Array([ + 1779033703, + 3144134277, + 1013904242, + 2773480762, + 1359893119, + 2600822924, + 528734635, + 1541459225 + ]); + var SIGMA = new Uint8Array([ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 14, + 10, + 4, + 8, + 9, + 15, + 13, + 6, + 1, + 12, + 0, + 2, + 11, + 7, + 5, + 3, + 11, + 8, + 12, + 0, + 5, + 2, + 15, + 13, + 10, + 14, + 3, + 6, + 7, + 1, + 9, + 4, + 7, + 9, + 3, + 1, + 13, + 12, + 11, + 14, + 2, + 6, + 5, + 10, + 4, + 0, + 15, + 8, + 9, + 0, + 5, + 7, + 2, + 4, + 10, + 15, + 14, + 1, + 11, + 12, + 6, + 8, + 3, + 13, + 2, + 12, + 6, + 10, + 0, + 11, + 8, + 3, + 4, + 13, + 7, + 5, + 15, + 14, + 1, + 9, + 12, + 5, + 1, + 15, + 14, + 13, + 4, + 10, + 0, + 7, + 6, + 3, + 9, + 2, + 8, + 11, + 13, + 11, + 7, + 14, + 12, + 1, + 3, + 9, + 5, + 0, + 15, + 4, + 8, + 6, + 2, + 10, + 6, + 15, + 14, + 9, + 11, + 3, + 0, + 8, + 12, + 2, + 13, + 7, + 1, + 4, + 10, + 5, + 10, + 2, + 8, + 4, + 7, + 6, + 1, + 5, + 15, + 11, + 9, + 14, + 3, + 12, + 13, + 0 + ]); + var v = new Uint32Array(16); + var m = new Uint32Array(16); + function blake2sCompress(ctx, last) { + let i = 0; + for (i = 0; i < 8; i++) { + v[i] = ctx.h[i]; + v[i + 8] = BLAKE2S_IV[i]; + } + v[12] ^= ctx.t; + v[13] ^= ctx.t / 4294967296; + if (last) { + v[14] = ~v[14]; + } + for (i = 0; i < 16; i++) { + m[i] = B2S_GET32(ctx.b, 4 * i); + } + for (i = 0; i < 10; i++) { + B2S_G(0, 4, 8, 12, m[SIGMA[i * 16 + 0]], m[SIGMA[i * 16 + 1]]); + B2S_G(1, 5, 9, 13, m[SIGMA[i * 16 + 2]], m[SIGMA[i * 16 + 3]]); + B2S_G(2, 6, 10, 14, m[SIGMA[i * 16 + 4]], m[SIGMA[i * 16 + 5]]); + B2S_G(3, 7, 11, 15, m[SIGMA[i * 16 + 6]], m[SIGMA[i * 16 + 7]]); + B2S_G(0, 5, 10, 15, m[SIGMA[i * 16 + 8]], m[SIGMA[i * 16 + 9]]); + B2S_G(1, 6, 11, 12, m[SIGMA[i * 16 + 10]], m[SIGMA[i * 16 + 11]]); + B2S_G(2, 7, 8, 13, m[SIGMA[i * 16 + 12]], m[SIGMA[i * 16 + 13]]); + B2S_G(3, 4, 9, 14, m[SIGMA[i * 16 + 14]], m[SIGMA[i * 16 + 15]]); + } + for (i = 0; i < 8; i++) { + ctx.h[i] ^= v[i] ^ v[i + 8]; + } + } + function blake2sInit(outlen, key) { + if (!(outlen > 0 && outlen <= 32)) { + throw new Error("Incorrect output length, should be in [1, 32]"); + } + const keylen = key ? key.length : 0; + if (key && !(keylen > 0 && keylen <= 32)) { + throw new Error("Incorrect key length, should be in [1, 32]"); + } + const ctx = { + h: new Uint32Array(BLAKE2S_IV), + b: new Uint8Array(64), + c: 0, + t: 0, + outlen + }; + ctx.h[0] ^= 16842752 ^ keylen << 8 ^ outlen; + if (keylen > 0) { + blake2sUpdate(ctx, key); + ctx.c = 64; + } + return ctx; + } + function blake2sUpdate(ctx, input) { + for (let i = 0; i < input.length; i++) { + if (ctx.c === 64) { + ctx.t += ctx.c; + blake2sCompress(ctx, false); + ctx.c = 0; + } + ctx.b[ctx.c++] = input[i]; + } + } + function blake2sFinal(ctx) { + ctx.t += ctx.c; + while (ctx.c < 64) { + ctx.b[ctx.c++] = 0; + } + blake2sCompress(ctx, true); + const out = new Uint8Array(ctx.outlen); + for (let i = 0; i < ctx.outlen; i++) { + out[i] = ctx.h[i >> 2] >> 8 * (i & 3) & 255; + } + return out; + } + function blake2s(input, key, outlen) { + outlen = outlen || 32; + input = util.normalizeInput(input); + const ctx = blake2sInit(outlen, key); + blake2sUpdate(ctx, input); + return blake2sFinal(ctx); + } + function blake2sHex(input, key, outlen) { + const output = blake2s(input, key, outlen); + return util.toHex(output); + } + module.exports = { + blake2s, + blake2sHex, + blake2sInit, + blake2sUpdate, + blake2sFinal + }; + } + }); + + // node_modules/blakejs/index.js + var require_blakejs = __commonJS({ + "node_modules/blakejs/index.js"(exports, module) { + var b2b = require_blake2b(); + var b2s = require_blake2s(); + module.exports = { + blake2b: b2b.blake2b, + blake2bHex: b2b.blake2bHex, + blake2bInit: b2b.blake2bInit, + blake2bUpdate: b2b.blake2bUpdate, + blake2bFinal: b2b.blake2bFinal, + blake2s: b2s.blake2s, + blake2sHex: b2s.blake2sHex, + blake2sInit: b2s.blake2sInit, + blake2sUpdate: b2s.blake2sUpdate, + blake2sFinal: b2s.blake2sFinal + }; + } + }); + + // node_modules/base64-js/index.js + var require_base64_js = __commonJS({ + "node_modules/base64-js/index.js"(exports) { + "use strict"; + exports.byteLength = byteLength; + exports.toByteArray = toByteArray; + exports.fromByteArray = fromByteArray; + var lookup = []; + var revLookup = []; + var Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array; + var code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + for (i = 0, len = code.length; i < len; ++i) { + lookup[i] = code[i]; + revLookup[code.charCodeAt(i)] = i; + } + var i; + var len; + revLookup["-".charCodeAt(0)] = 62; + revLookup["_".charCodeAt(0)] = 63; + function getLens(b64) { + var len2 = b64.length; + if (len2 % 4 > 0) { + throw new Error("Invalid string. Length must be a multiple of 4"); + } + var validLen = b64.indexOf("="); + if (validLen === -1) + validLen = len2; + var placeHoldersLen = validLen === len2 ? 0 : 4 - validLen % 4; + return [validLen, placeHoldersLen]; + } + function byteLength(b64) { + var lens = getLens(b64); + var validLen = lens[0]; + var placeHoldersLen = lens[1]; + return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; + } + function _byteLength(b64, validLen, placeHoldersLen) { + return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; + } + function toByteArray(b64) { + var tmp; + var lens = getLens(b64); + var validLen = lens[0]; + var placeHoldersLen = lens[1]; + var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)); + var curByte = 0; + var len2 = placeHoldersLen > 0 ? validLen - 4 : validLen; + var i2; + for (i2 = 0; i2 < len2; i2 += 4) { + tmp = revLookup[b64.charCodeAt(i2)] << 18 | revLookup[b64.charCodeAt(i2 + 1)] << 12 | revLookup[b64.charCodeAt(i2 + 2)] << 6 | revLookup[b64.charCodeAt(i2 + 3)]; + arr[curByte++] = tmp >> 16 & 255; + arr[curByte++] = tmp >> 8 & 255; + arr[curByte++] = tmp & 255; + } + if (placeHoldersLen === 2) { + tmp = revLookup[b64.charCodeAt(i2)] << 2 | revLookup[b64.charCodeAt(i2 + 1)] >> 4; + arr[curByte++] = tmp & 255; + } + if (placeHoldersLen === 1) { + tmp = revLookup[b64.charCodeAt(i2)] << 10 | revLookup[b64.charCodeAt(i2 + 1)] << 4 | revLookup[b64.charCodeAt(i2 + 2)] >> 2; + arr[curByte++] = tmp >> 8 & 255; + arr[curByte++] = tmp & 255; + } + return arr; + } + function tripletToBase64(num) { + return lookup[num >> 18 & 63] + lookup[num >> 12 & 63] + lookup[num >> 6 & 63] + lookup[num & 63]; + } + function encodeChunk(uint8, start, end) { + var tmp; + var output = []; + for (var i2 = start; i2 < end; i2 += 3) { + tmp = (uint8[i2] << 16 & 16711680) + (uint8[i2 + 1] << 8 & 65280) + (uint8[i2 + 2] & 255); + output.push(tripletToBase64(tmp)); + } + return output.join(""); + } + function fromByteArray(uint8) { + var tmp; + var len2 = uint8.length; + var extraBytes = len2 % 3; + var parts = []; + var maxChunkLength = 16383; + for (var i2 = 0, len22 = len2 - extraBytes; i2 < len22; i2 += maxChunkLength) { + parts.push(encodeChunk(uint8, i2, i2 + maxChunkLength > len22 ? len22 : i2 + maxChunkLength)); + } + if (extraBytes === 1) { + tmp = uint8[len2 - 1]; + parts.push(lookup[tmp >> 2] + lookup[tmp << 4 & 63] + "=="); + } else if (extraBytes === 2) { + tmp = (uint8[len2 - 2] << 8) + uint8[len2 - 1]; + parts.push(lookup[tmp >> 10] + lookup[tmp >> 4 & 63] + lookup[tmp << 2 & 63] + "="); + } + return parts.join(""); + } + } + }); + + // node_modules/ieee754/index.js + var require_ieee754 = __commonJS({ + "node_modules/ieee754/index.js"(exports) { + exports.read = function(buffer, offset, isLE, mLen, nBytes) { + var e, m; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var nBits = -7; + var i = isLE ? nBytes - 1 : 0; + var d = isLE ? -1 : 1; + var s = buffer[offset + i]; + i += d; + e = s & (1 << -nBits) - 1; + s >>= -nBits; + nBits += eLen; + for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) { + } + m = e & (1 << -nBits) - 1; + e >>= -nBits; + nBits += mLen; + for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) { + } + if (e === 0) { + e = 1 - eBias; + } else if (e === eMax) { + return m ? NaN : (s ? -1 : 1) * Infinity; + } else { + m = m + Math.pow(2, mLen); + e = e - eBias; + } + return (s ? -1 : 1) * m * Math.pow(2, e - mLen); + }; + exports.write = function(buffer, value, offset, isLE, mLen, nBytes) { + var e, m, c; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0; + var i = isLE ? 0 : nBytes - 1; + var d = isLE ? 1 : -1; + var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; + value = Math.abs(value); + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0; + e = eMax; + } else { + e = Math.floor(Math.log(value) / Math.LN2); + if (value * (c = Math.pow(2, -e)) < 1) { + e--; + c *= 2; + } + if (e + eBias >= 1) { + value += rt / c; + } else { + value += rt * Math.pow(2, 1 - eBias); + } + if (value * c >= 2) { + e++; + c /= 2; + } + if (e + eBias >= eMax) { + m = 0; + e = eMax; + } else if (e + eBias >= 1) { + m = (value * c - 1) * Math.pow(2, mLen); + e = e + eBias; + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); + e = 0; + } + } + for (; mLen >= 8; buffer[offset + i] = m & 255, i += d, m /= 256, mLen -= 8) { + } + e = e << mLen | m; + eLen += mLen; + for (; eLen > 0; buffer[offset + i] = e & 255, i += d, e /= 256, eLen -= 8) { + } + buffer[offset + i - d] |= s * 128; + }; + } + }); + + // node_modules/buffer/index.js + var require_buffer = __commonJS({ + "node_modules/buffer/index.js"(exports) { + "use strict"; + var base64 = require_base64_js(); + var ieee754 = require_ieee754(); + var customInspectSymbol = typeof Symbol === "function" && typeof Symbol["for"] === "function" ? Symbol["for"]("nodejs.util.inspect.custom") : null; + exports.Buffer = Buffer2; + exports.SlowBuffer = SlowBuffer; + exports.INSPECT_MAX_BYTES = 50; + var K_MAX_LENGTH = 2147483647; + exports.kMaxLength = K_MAX_LENGTH; + Buffer2.TYPED_ARRAY_SUPPORT = typedArraySupport(); + if (!Buffer2.TYPED_ARRAY_SUPPORT && typeof console !== "undefined" && 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 typedArraySupport() { + try { + const arr = new Uint8Array(1); + const proto3 = { foo: function() { + return 42; + } }; + Object.setPrototypeOf(proto3, Uint8Array.prototype); + Object.setPrototypeOf(arr, proto3); + return arr.foo() === 42; + } catch (e) { + return false; + } + } + Object.defineProperty(Buffer2.prototype, "parent", { + enumerable: true, + get: function() { + if (!Buffer2.isBuffer(this)) + return void 0; + return this.buffer; + } + }); + Object.defineProperty(Buffer2.prototype, "offset", { + enumerable: true, + get: function() { + if (!Buffer2.isBuffer(this)) + return void 0; + return this.byteOffset; + } + }); + function createBuffer(length2) { + if (length2 > K_MAX_LENGTH) { + throw new RangeError('The value "' + length2 + '" is invalid for option "size"'); + } + const buf = new Uint8Array(length2); + Object.setPrototypeOf(buf, Buffer2.prototype); + return buf; + } + function Buffer2(arg, encodingOrOffset, length2) { + if (typeof arg === "number") { + if (typeof encodingOrOffset === "string") { + throw new TypeError('The "string" argument must be of type string. Received type number'); + } + return allocUnsafe(arg); + } + return from3(arg, encodingOrOffset, length2); + } + Buffer2.poolSize = 8192; + function from3(value, encodingOrOffset, length2) { + if (typeof value === "string") { + return fromString(value, encodingOrOffset); + } + if (ArrayBuffer.isView(value)) { + return fromArrayView(value); + } + if (value == null) { + throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value); + } + if (isInstance(value, ArrayBuffer) || value && isInstance(value.buffer, ArrayBuffer)) { + return fromArrayBuffer(value, encodingOrOffset, length2); + } + if (typeof SharedArrayBuffer !== "undefined" && (isInstance(value, SharedArrayBuffer) || value && isInstance(value.buffer, SharedArrayBuffer))) { + return fromArrayBuffer(value, encodingOrOffset, length2); + } + if (typeof value === "number") { + throw new TypeError('The "value" argument must not be of type number. Received type number'); + } + const valueOf = value.valueOf && value.valueOf(); + if (valueOf != null && valueOf !== value) { + return Buffer2.from(valueOf, encodingOrOffset, length2); + } + const b = fromObject(value); + if (b) + return b; + if (typeof Symbol !== "undefined" && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === "function") { + return Buffer2.from(value[Symbol.toPrimitive]("string"), encodingOrOffset, length2); + } + throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value); + } + Buffer2.from = function(value, encodingOrOffset, length2) { + return from3(value, encodingOrOffset, length2); + }; + Object.setPrototypeOf(Buffer2.prototype, Uint8Array.prototype); + Object.setPrototypeOf(Buffer2, Uint8Array); + function assertSize(size) { + if (typeof size !== "number") { + throw new TypeError('"size" argument must be of type number'); + } else if (size < 0) { + throw new RangeError('The value "' + size + '" is invalid for option "size"'); + } + } + function alloc(size, fill, encoding) { + assertSize(size); + if (size <= 0) { + return createBuffer(size); + } + if (fill !== void 0) { + return typeof encoding === "string" ? createBuffer(size).fill(fill, encoding) : createBuffer(size).fill(fill); + } + return createBuffer(size); + } + Buffer2.alloc = function(size, fill, encoding) { + return alloc(size, fill, encoding); + }; + function allocUnsafe(size) { + assertSize(size); + return createBuffer(size < 0 ? 0 : checked(size) | 0); + } + Buffer2.allocUnsafe = function(size) { + return allocUnsafe(size); + }; + Buffer2.allocUnsafeSlow = function(size) { + return allocUnsafe(size); + }; + function fromString(string3, encoding) { + if (typeof encoding !== "string" || encoding === "") { + encoding = "utf8"; + } + if (!Buffer2.isEncoding(encoding)) { + throw new TypeError("Unknown encoding: " + encoding); + } + const length2 = byteLength(string3, encoding) | 0; + let buf = createBuffer(length2); + const actual = buf.write(string3, encoding); + if (actual !== length2) { + buf = buf.slice(0, actual); + } + return buf; + } + function fromArrayLike(array) { + const length2 = array.length < 0 ? 0 : checked(array.length) | 0; + const buf = createBuffer(length2); + for (let i = 0; i < length2; i += 1) { + buf[i] = array[i] & 255; + } + return buf; + } + function fromArrayView(arrayView) { + if (isInstance(arrayView, Uint8Array)) { + const copy = new Uint8Array(arrayView); + return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength); + } + return fromArrayLike(arrayView); + } + function fromArrayBuffer(array, byteOffset, length2) { + if (byteOffset < 0 || array.byteLength < byteOffset) { + throw new RangeError('"offset" is outside of buffer bounds'); + } + if (array.byteLength < byteOffset + (length2 || 0)) { + throw new RangeError('"length" is outside of buffer bounds'); + } + let buf; + if (byteOffset === void 0 && length2 === void 0) { + buf = new Uint8Array(array); + } else if (length2 === void 0) { + buf = new Uint8Array(array, byteOffset); + } else { + buf = new Uint8Array(array, byteOffset, length2); + } + Object.setPrototypeOf(buf, Buffer2.prototype); + return buf; + } + function fromObject(obj) { + if (Buffer2.isBuffer(obj)) { + const len = checked(obj.length) | 0; + const buf = createBuffer(len); + if (buf.length === 0) { + return buf; + } + obj.copy(buf, 0, 0, len); + return buf; + } + if (obj.length !== void 0) { + if (typeof obj.length !== "number" || numberIsNaN(obj.length)) { + return createBuffer(0); + } + return fromArrayLike(obj); + } + if (obj.type === "Buffer" && Array.isArray(obj.data)) { + return fromArrayLike(obj.data); + } + } + function checked(length2) { + if (length2 >= K_MAX_LENGTH) { + throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + K_MAX_LENGTH.toString(16) + " bytes"); + } + return length2 | 0; + } + function SlowBuffer(length2) { + if (+length2 != length2) { + length2 = 0; + } + return Buffer2.alloc(+length2); + } + Buffer2.isBuffer = function isBuffer(b) { + return b != null && b._isBuffer === true && b !== Buffer2.prototype; + }; + Buffer2.compare = function compare(a, b) { + if (isInstance(a, Uint8Array)) + a = Buffer2.from(a, a.offset, a.byteLength); + if (isInstance(b, Uint8Array)) + b = Buffer2.from(b, b.offset, b.byteLength); + if (!Buffer2.isBuffer(a) || !Buffer2.isBuffer(b)) { + throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'); + } + if (a === b) + return 0; + let x = a.length; + let y = b.length; + for (let i = 0, len = Math.min(x, y); i < len; ++i) { + if (a[i] !== b[i]) { + x = a[i]; + y = b[i]; + break; + } + } + if (x < y) + return -1; + if (y < x) + return 1; + return 0; + }; + Buffer2.isEncoding = function isEncoding(encoding) { + switch (String(encoding).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 true; + default: + return false; + } + }; + Buffer2.concat = function concat(list, length2) { + if (!Array.isArray(list)) { + throw new TypeError('"list" argument must be an Array of Buffers'); + } + if (list.length === 0) { + return Buffer2.alloc(0); + } + let i; + if (length2 === void 0) { + length2 = 0; + for (i = 0; i < list.length; ++i) { + length2 += list[i].length; + } + } + const buffer = Buffer2.allocUnsafe(length2); + let pos = 0; + for (i = 0; i < list.length; ++i) { + let buf = list[i]; + if (isInstance(buf, Uint8Array)) { + if (pos + buf.length > buffer.length) { + if (!Buffer2.isBuffer(buf)) + buf = Buffer2.from(buf); + buf.copy(buffer, pos); + } else { + Uint8Array.prototype.set.call(buffer, buf, pos); + } + } else if (!Buffer2.isBuffer(buf)) { + throw new TypeError('"list" argument must be an Array of Buffers'); + } else { + buf.copy(buffer, pos); + } + pos += buf.length; + } + return buffer; + }; + function byteLength(string3, encoding) { + if (Buffer2.isBuffer(string3)) { + return string3.length; + } + if (ArrayBuffer.isView(string3) || isInstance(string3, ArrayBuffer)) { + return string3.byteLength; + } + if (typeof string3 !== "string") { + throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof string3); + } + const len = string3.length; + const mustMatch = arguments.length > 2 && arguments[2] === true; + if (!mustMatch && len === 0) + return 0; + let loweredCase = false; + for (; ; ) { + switch (encoding) { + case "ascii": + case "latin1": + case "binary": + return len; + case "utf8": + case "utf-8": + return utf8ToBytes(string3).length; + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return len * 2; + case "hex": + return len >>> 1; + case "base64": + return base64ToBytes(string3).length; + default: + if (loweredCase) { + return mustMatch ? -1 : utf8ToBytes(string3).length; + } + encoding = ("" + encoding).toLowerCase(); + loweredCase = true; + } + } + } + Buffer2.byteLength = byteLength; + function slowToString(encoding, start, end) { + let loweredCase = false; + if (start === void 0 || start < 0) { + start = 0; + } + if (start > this.length) { + return ""; + } + if (end === void 0 || end > this.length) { + end = this.length; + } + if (end <= 0) { + return ""; + } + end >>>= 0; + start >>>= 0; + if (end <= start) { + return ""; + } + if (!encoding) + encoding = "utf8"; + while (true) { + switch (encoding) { + case "hex": + return hexSlice(this, start, end); + case "utf8": + case "utf-8": + return utf8Slice(this, start, end); + case "ascii": + return asciiSlice(this, start, end); + case "latin1": + case "binary": + return latin1Slice(this, start, end); + case "base64": + return base64Slice(this, start, end); + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return utf16leSlice(this, start, end); + default: + if (loweredCase) + throw new TypeError("Unknown encoding: " + encoding); + encoding = (encoding + "").toLowerCase(); + loweredCase = true; + } + } + } + Buffer2.prototype._isBuffer = true; + function swap(b, n, m) { + const i = b[n]; + b[n] = b[m]; + b[m] = i; + } + Buffer2.prototype.swap16 = function swap16() { + const len = this.length; + if (len % 2 !== 0) { + throw new RangeError("Buffer size must be a multiple of 16-bits"); + } + for (let i = 0; i < len; i += 2) { + swap(this, i, i + 1); + } + return this; + }; + Buffer2.prototype.swap32 = function swap32() { + const len = this.length; + if (len % 4 !== 0) { + throw new RangeError("Buffer size must be a multiple of 32-bits"); + } + for (let i = 0; i < len; i += 4) { + swap(this, i, i + 3); + swap(this, i + 1, i + 2); + } + return this; + }; + Buffer2.prototype.swap64 = function swap64() { + const len = this.length; + if (len % 8 !== 0) { + throw new RangeError("Buffer size must be a multiple of 64-bits"); + } + for (let i = 0; i < len; i += 8) { + swap(this, i, i + 7); + swap(this, i + 1, i + 6); + swap(this, i + 2, i + 5); + swap(this, i + 3, i + 4); + } + return this; + }; + Buffer2.prototype.toString = function toString() { + const length2 = this.length; + if (length2 === 0) + return ""; + if (arguments.length === 0) + return utf8Slice(this, 0, length2); + return slowToString.apply(this, arguments); + }; + Buffer2.prototype.toLocaleString = Buffer2.prototype.toString; + Buffer2.prototype.equals = function equals3(b) { + if (!Buffer2.isBuffer(b)) + throw new TypeError("Argument must be a Buffer"); + if (this === b) + return true; + return Buffer2.compare(this, b) === 0; + }; + Buffer2.prototype.inspect = function inspect() { + let str = ""; + const max = exports.INSPECT_MAX_BYTES; + str = this.toString("hex", 0, max).replace(/(.{2})/g, "$1 ").trim(); + if (this.length > max) + str += " ... "; + return ""; + }; + if (customInspectSymbol) { + Buffer2.prototype[customInspectSymbol] = Buffer2.prototype.inspect; + } + Buffer2.prototype.compare = function compare(target, start, end, thisStart, thisEnd) { + if (isInstance(target, Uint8Array)) { + target = Buffer2.from(target, target.offset, target.byteLength); + } + if (!Buffer2.isBuffer(target)) { + throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof target); + } + if (start === void 0) { + start = 0; + } + if (end === void 0) { + end = target ? target.length : 0; + } + if (thisStart === void 0) { + thisStart = 0; + } + if (thisEnd === void 0) { + thisEnd = this.length; + } + if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { + throw new RangeError("out of range index"); + } + if (thisStart >= thisEnd && start >= end) { + return 0; + } + if (thisStart >= thisEnd) { + return -1; + } + if (start >= end) { + return 1; + } + start >>>= 0; + end >>>= 0; + thisStart >>>= 0; + thisEnd >>>= 0; + if (this === target) + return 0; + let x = thisEnd - thisStart; + let y = end - start; + const len = Math.min(x, y); + const thisCopy = this.slice(thisStart, thisEnd); + const targetCopy = target.slice(start, end); + for (let i = 0; i < len; ++i) { + if (thisCopy[i] !== targetCopy[i]) { + x = thisCopy[i]; + y = targetCopy[i]; + break; + } + } + if (x < y) + return -1; + if (y < x) + return 1; + return 0; + }; + function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) { + if (buffer.length === 0) + return -1; + if (typeof byteOffset === "string") { + encoding = byteOffset; + byteOffset = 0; + } else if (byteOffset > 2147483647) { + byteOffset = 2147483647; + } else if (byteOffset < -2147483648) { + byteOffset = -2147483648; + } + byteOffset = +byteOffset; + if (numberIsNaN(byteOffset)) { + byteOffset = dir ? 0 : buffer.length - 1; + } + if (byteOffset < 0) + byteOffset = buffer.length + byteOffset; + if (byteOffset >= buffer.length) { + if (dir) + return -1; + else + byteOffset = buffer.length - 1; + } else if (byteOffset < 0) { + if (dir) + byteOffset = 0; + else + return -1; + } + if (typeof val === "string") { + val = Buffer2.from(val, encoding); + } + if (Buffer2.isBuffer(val)) { + if (val.length === 0) { + return -1; + } + return arrayIndexOf(buffer, val, byteOffset, encoding, dir); + } else if (typeof val === "number") { + val = val & 255; + if (typeof Uint8Array.prototype.indexOf === "function") { + if (dir) { + return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset); + } else { + return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset); + } + } + return arrayIndexOf(buffer, [val], byteOffset, encoding, dir); + } + throw new TypeError("val must be string, number or Buffer"); + } + function arrayIndexOf(arr, val, byteOffset, encoding, dir) { + let indexSize = 1; + let arrLength = arr.length; + let valLength = val.length; + if (encoding !== void 0) { + encoding = String(encoding).toLowerCase(); + if (encoding === "ucs2" || encoding === "ucs-2" || encoding === "utf16le" || encoding === "utf-16le") { + if (arr.length < 2 || val.length < 2) { + return -1; + } + indexSize = 2; + arrLength /= 2; + valLength /= 2; + byteOffset /= 2; + } + } + function read2(buf, i2) { + if (indexSize === 1) { + return buf[i2]; + } else { + return buf.readUInt16BE(i2 * indexSize); + } + } + let i; + if (dir) { + let foundIndex = -1; + for (i = byteOffset; i < arrLength; i++) { + if (read2(arr, i) === read2(val, foundIndex === -1 ? 0 : i - foundIndex)) { + if (foundIndex === -1) + foundIndex = i; + if (i - foundIndex + 1 === valLength) + return foundIndex * indexSize; + } else { + if (foundIndex !== -1) + i -= i - foundIndex; + foundIndex = -1; + } + } + } else { + if (byteOffset + valLength > arrLength) + byteOffset = arrLength - valLength; + for (i = byteOffset; i >= 0; i--) { + let found = true; + for (let j = 0; j < valLength; j++) { + if (read2(arr, i + j) !== read2(val, j)) { + found = false; + break; + } + } + if (found) + return i; + } + } + return -1; + } + Buffer2.prototype.includes = function includes(val, byteOffset, encoding) { + return this.indexOf(val, byteOffset, encoding) !== -1; + }; + Buffer2.prototype.indexOf = function indexOf(val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, true); + }; + Buffer2.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, false); + }; + function hexWrite(buf, string3, offset, length2) { + offset = Number(offset) || 0; + const remaining = buf.length - offset; + if (!length2) { + length2 = remaining; + } else { + length2 = Number(length2); + if (length2 > remaining) { + length2 = remaining; + } + } + const strLen = string3.length; + if (length2 > strLen / 2) { + length2 = strLen / 2; + } + let i; + for (i = 0; i < length2; ++i) { + const parsed = parseInt(string3.substr(i * 2, 2), 16); + if (numberIsNaN(parsed)) + return i; + buf[offset + i] = parsed; + } + return i; + } + function utf8Write(buf, string3, offset, length2) { + return blitBuffer(utf8ToBytes(string3, buf.length - offset), buf, offset, length2); + } + function asciiWrite(buf, string3, offset, length2) { + return blitBuffer(asciiToBytes(string3), buf, offset, length2); + } + function base64Write(buf, string3, offset, length2) { + return blitBuffer(base64ToBytes(string3), buf, offset, length2); + } + function ucs2Write(buf, string3, offset, length2) { + return blitBuffer(utf16leToBytes(string3, buf.length - offset), buf, offset, length2); + } + Buffer2.prototype.write = function write(string3, offset, length2, encoding) { + if (offset === void 0) { + encoding = "utf8"; + length2 = this.length; + offset = 0; + } else if (length2 === void 0 && typeof offset === "string") { + encoding = offset; + length2 = this.length; + offset = 0; + } else if (isFinite(offset)) { + offset = offset >>> 0; + if (isFinite(length2)) { + length2 = length2 >>> 0; + if (encoding === void 0) + encoding = "utf8"; + } else { + encoding = length2; + length2 = void 0; + } + } else { + throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported"); + } + const remaining = this.length - offset; + if (length2 === void 0 || length2 > remaining) + length2 = remaining; + if (string3.length > 0 && (length2 < 0 || offset < 0) || offset > this.length) { + throw new RangeError("Attempt to write outside buffer bounds"); + } + if (!encoding) + encoding = "utf8"; + let loweredCase = false; + for (; ; ) { + switch (encoding) { + case "hex": + return hexWrite(this, string3, offset, length2); + case "utf8": + case "utf-8": + return utf8Write(this, string3, offset, length2); + case "ascii": + case "latin1": + case "binary": + return asciiWrite(this, string3, offset, length2); + case "base64": + return base64Write(this, string3, offset, length2); + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return ucs2Write(this, string3, offset, length2); + default: + if (loweredCase) + throw new TypeError("Unknown encoding: " + encoding); + encoding = ("" + encoding).toLowerCase(); + loweredCase = true; + } + } + }; + Buffer2.prototype.toJSON = function toJSON() { + return { + type: "Buffer", + data: Array.prototype.slice.call(this._arr || this, 0) + }; + }; + function base64Slice(buf, start, end) { + if (start === 0 && end === buf.length) { + return base64.fromByteArray(buf); + } else { + return base64.fromByteArray(buf.slice(start, end)); + } + } + function utf8Slice(buf, start, end) { + end = Math.min(buf.length, end); + const res = []; + let i = start; + while (i < end) { + const firstByte = buf[i]; + let codePoint = null; + let bytesPerSequence = firstByte > 239 ? 4 : firstByte > 223 ? 3 : firstByte > 191 ? 2 : 1; + if (i + bytesPerSequence <= end) { + let secondByte, thirdByte, fourthByte, tempCodePoint; + switch (bytesPerSequence) { + case 1: + if (firstByte < 128) { + codePoint = firstByte; + } + break; + case 2: + secondByte = buf[i + 1]; + if ((secondByte & 192) === 128) { + tempCodePoint = (firstByte & 31) << 6 | secondByte & 63; + if (tempCodePoint > 127) { + codePoint = tempCodePoint; + } + } + break; + case 3: + secondByte = buf[i + 1]; + thirdByte = buf[i + 2]; + if ((secondByte & 192) === 128 && (thirdByte & 192) === 128) { + tempCodePoint = (firstByte & 15) << 12 | (secondByte & 63) << 6 | thirdByte & 63; + if (tempCodePoint > 2047 && (tempCodePoint < 55296 || tempCodePoint > 57343)) { + codePoint = tempCodePoint; + } + } + break; + case 4: + secondByte = buf[i + 1]; + thirdByte = buf[i + 2]; + fourthByte = buf[i + 3]; + if ((secondByte & 192) === 128 && (thirdByte & 192) === 128 && (fourthByte & 192) === 128) { + tempCodePoint = (firstByte & 15) << 18 | (secondByte & 63) << 12 | (thirdByte & 63) << 6 | fourthByte & 63; + if (tempCodePoint > 65535 && tempCodePoint < 1114112) { + codePoint = tempCodePoint; + } + } + } + } + if (codePoint === null) { + codePoint = 65533; + bytesPerSequence = 1; + } else if (codePoint > 65535) { + codePoint -= 65536; + res.push(codePoint >>> 10 & 1023 | 55296); + codePoint = 56320 | codePoint & 1023; + } + res.push(codePoint); + i += bytesPerSequence; + } + return decodeCodePointsArray(res); + } + var MAX_ARGUMENTS_LENGTH = 4096; + function decodeCodePointsArray(codePoints) { + const len = codePoints.length; + if (len <= MAX_ARGUMENTS_LENGTH) { + return String.fromCharCode.apply(String, codePoints); + } + let res = ""; + let i = 0; + while (i < len) { + res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)); + } + return res; + } + function asciiSlice(buf, start, end) { + let ret = ""; + end = Math.min(buf.length, end); + for (let i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i] & 127); + } + return ret; + } + function latin1Slice(buf, start, end) { + let ret = ""; + end = Math.min(buf.length, end); + for (let i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i]); + } + return ret; + } + function hexSlice(buf, start, end) { + const len = buf.length; + if (!start || start < 0) + start = 0; + if (!end || end < 0 || end > len) + end = len; + let out = ""; + for (let i = start; i < end; ++i) { + out += hexSliceLookupTable[buf[i]]; + } + return out; + } + function utf16leSlice(buf, start, end) { + const bytes = buf.slice(start, end); + let res = ""; + for (let i = 0; i < bytes.length - 1; i += 2) { + res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256); + } + return res; + } + Buffer2.prototype.slice = function slice(start, end) { + const len = this.length; + start = ~~start; + end = end === void 0 ? len : ~~end; + if (start < 0) { + start += len; + if (start < 0) + start = 0; + } else if (start > len) { + start = len; + } + if (end < 0) { + end += len; + if (end < 0) + end = 0; + } else if (end > len) { + end = len; + } + if (end < start) + end = start; + const newBuf = this.subarray(start, end); + Object.setPrototypeOf(newBuf, Buffer2.prototype); + return newBuf; + }; + function checkOffset(offset, ext, length2) { + if (offset % 1 !== 0 || offset < 0) + throw new RangeError("offset is not uint"); + if (offset + ext > length2) + throw new RangeError("Trying to access beyond buffer length"); + } + Buffer2.prototype.readUintLE = Buffer2.prototype.readUIntLE = function readUIntLE(offset, byteLength2, noAssert) { + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) + checkOffset(offset, byteLength2, this.length); + let val = this[offset]; + let mul = 1; + let i = 0; + while (++i < byteLength2 && (mul *= 256)) { + val += this[offset + i] * mul; + } + return val; + }; + Buffer2.prototype.readUintBE = Buffer2.prototype.readUIntBE = function readUIntBE(offset, byteLength2, noAssert) { + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) { + checkOffset(offset, byteLength2, this.length); + } + let val = this[offset + --byteLength2]; + let mul = 1; + while (byteLength2 > 0 && (mul *= 256)) { + val += this[offset + --byteLength2] * mul; + } + return val; + }; + Buffer2.prototype.readUint8 = Buffer2.prototype.readUInt8 = function readUInt8(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 1, this.length); + return this[offset]; + }; + Buffer2.prototype.readUint16LE = Buffer2.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 2, this.length); + return this[offset] | this[offset + 1] << 8; + }; + Buffer2.prototype.readUint16BE = Buffer2.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 2, this.length); + return this[offset] << 8 | this[offset + 1]; + }; + Buffer2.prototype.readUint32LE = Buffer2.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 16777216; + }; + Buffer2.prototype.readUint32BE = Buffer2.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return this[offset] * 16777216 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]); + }; + Buffer2.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE(offset) { + offset = offset >>> 0; + validateNumber(offset, "offset"); + const first = this[offset]; + const last = this[offset + 7]; + if (first === void 0 || last === void 0) { + boundsError(offset, this.length - 8); + } + const lo = first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24; + const hi = this[++offset] + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + last * 2 ** 24; + return BigInt(lo) + (BigInt(hi) << BigInt(32)); + }); + Buffer2.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE(offset) { + offset = offset >>> 0; + validateNumber(offset, "offset"); + const first = this[offset]; + const last = this[offset + 7]; + if (first === void 0 || last === void 0) { + boundsError(offset, this.length - 8); + } + const hi = first * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset]; + const lo = this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last; + return (BigInt(hi) << BigInt(32)) + BigInt(lo); + }); + Buffer2.prototype.readIntLE = function readIntLE(offset, byteLength2, noAssert) { + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) + checkOffset(offset, byteLength2, this.length); + let val = this[offset]; + let mul = 1; + let i = 0; + while (++i < byteLength2 && (mul *= 256)) { + val += this[offset + i] * mul; + } + mul *= 128; + if (val >= mul) + val -= Math.pow(2, 8 * byteLength2); + return val; + }; + Buffer2.prototype.readIntBE = function readIntBE(offset, byteLength2, noAssert) { + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) + checkOffset(offset, byteLength2, this.length); + let i = byteLength2; + let mul = 1; + let val = this[offset + --i]; + while (i > 0 && (mul *= 256)) { + val += this[offset + --i] * mul; + } + mul *= 128; + if (val >= mul) + val -= Math.pow(2, 8 * byteLength2); + return val; + }; + Buffer2.prototype.readInt8 = function readInt8(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 1, this.length); + if (!(this[offset] & 128)) + return this[offset]; + return (255 - this[offset] + 1) * -1; + }; + Buffer2.prototype.readInt16LE = function readInt16LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 2, this.length); + const val = this[offset] | this[offset + 1] << 8; + return val & 32768 ? val | 4294901760 : val; + }; + Buffer2.prototype.readInt16BE = function readInt16BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 2, this.length); + const val = this[offset + 1] | this[offset] << 8; + return val & 32768 ? val | 4294901760 : val; + }; + Buffer2.prototype.readInt32LE = function readInt32LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24; + }; + Buffer2.prototype.readInt32BE = function readInt32BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]; + }; + Buffer2.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE(offset) { + offset = offset >>> 0; + validateNumber(offset, "offset"); + const first = this[offset]; + const last = this[offset + 7]; + if (first === void 0 || last === void 0) { + boundsError(offset, this.length - 8); + } + const val = this[offset + 4] + this[offset + 5] * 2 ** 8 + this[offset + 6] * 2 ** 16 + (last << 24); + return (BigInt(val) << BigInt(32)) + BigInt(first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24); + }); + Buffer2.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE(offset) { + offset = offset >>> 0; + validateNumber(offset, "offset"); + const first = this[offset]; + const last = this[offset + 7]; + if (first === void 0 || last === void 0) { + boundsError(offset, this.length - 8); + } + const val = (first << 24) + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset]; + return (BigInt(val) << BigInt(32)) + BigInt(this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last); + }); + Buffer2.prototype.readFloatLE = function readFloatLE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return ieee754.read(this, offset, true, 23, 4); + }; + Buffer2.prototype.readFloatBE = function readFloatBE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return ieee754.read(this, offset, false, 23, 4); + }; + Buffer2.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 8, this.length); + return ieee754.read(this, offset, true, 52, 8); + }; + Buffer2.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 8, this.length); + return ieee754.read(this, offset, false, 52, 8); + }; + function checkInt(buf, value, offset, ext, max, min) { + if (!Buffer2.isBuffer(buf)) + throw new TypeError('"buffer" argument must be a Buffer instance'); + if (value > max || value < min) + throw new RangeError('"value" argument is out of bounds'); + if (offset + ext > buf.length) + throw new RangeError("Index out of range"); + } + Buffer2.prototype.writeUintLE = Buffer2.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength2, noAssert) { + value = +value; + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) { + const maxBytes = Math.pow(2, 8 * byteLength2) - 1; + checkInt(this, value, offset, byteLength2, maxBytes, 0); + } + let mul = 1; + let i = 0; + this[offset] = value & 255; + while (++i < byteLength2 && (mul *= 256)) { + this[offset + i] = value / mul & 255; + } + return offset + byteLength2; + }; + Buffer2.prototype.writeUintBE = Buffer2.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength2, noAssert) { + value = +value; + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) { + const maxBytes = Math.pow(2, 8 * byteLength2) - 1; + checkInt(this, value, offset, byteLength2, maxBytes, 0); + } + let i = byteLength2 - 1; + let mul = 1; + this[offset + i] = value & 255; + while (--i >= 0 && (mul *= 256)) { + this[offset + i] = value / mul & 255; + } + return offset + byteLength2; + }; + Buffer2.prototype.writeUint8 = Buffer2.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 1, 255, 0); + this[offset] = value & 255; + return offset + 1; + }; + Buffer2.prototype.writeUint16LE = Buffer2.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 2, 65535, 0); + this[offset] = value & 255; + this[offset + 1] = value >>> 8; + return offset + 2; + }; + Buffer2.prototype.writeUint16BE = Buffer2.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 2, 65535, 0); + this[offset] = value >>> 8; + this[offset + 1] = value & 255; + return offset + 2; + }; + Buffer2.prototype.writeUint32LE = Buffer2.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 4, 4294967295, 0); + this[offset + 3] = value >>> 24; + this[offset + 2] = value >>> 16; + this[offset + 1] = value >>> 8; + this[offset] = value & 255; + return offset + 4; + }; + Buffer2.prototype.writeUint32BE = Buffer2.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 4, 4294967295, 0); + this[offset] = value >>> 24; + this[offset + 1] = value >>> 16; + this[offset + 2] = value >>> 8; + this[offset + 3] = value & 255; + return offset + 4; + }; + function wrtBigUInt64LE(buf, value, offset, min, max) { + checkIntBI(value, min, max, buf, offset, 7); + let lo = Number(value & BigInt(4294967295)); + buf[offset++] = lo; + lo = lo >> 8; + buf[offset++] = lo; + lo = lo >> 8; + buf[offset++] = lo; + lo = lo >> 8; + buf[offset++] = lo; + let hi = Number(value >> BigInt(32) & BigInt(4294967295)); + buf[offset++] = hi; + hi = hi >> 8; + buf[offset++] = hi; + hi = hi >> 8; + buf[offset++] = hi; + hi = hi >> 8; + buf[offset++] = hi; + return offset; + } + function wrtBigUInt64BE(buf, value, offset, min, max) { + checkIntBI(value, min, max, buf, offset, 7); + let lo = Number(value & BigInt(4294967295)); + buf[offset + 7] = lo; + lo = lo >> 8; + buf[offset + 6] = lo; + lo = lo >> 8; + buf[offset + 5] = lo; + lo = lo >> 8; + buf[offset + 4] = lo; + let hi = Number(value >> BigInt(32) & BigInt(4294967295)); + buf[offset + 3] = hi; + hi = hi >> 8; + buf[offset + 2] = hi; + hi = hi >> 8; + buf[offset + 1] = hi; + hi = hi >> 8; + buf[offset] = hi; + return offset + 8; + } + Buffer2.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE(value, offset = 0) { + return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt("0xffffffffffffffff")); + }); + Buffer2.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE(value, offset = 0) { + return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt("0xffffffffffffffff")); + }); + Buffer2.prototype.writeIntLE = function writeIntLE(value, offset, byteLength2, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + const limit = Math.pow(2, 8 * byteLength2 - 1); + checkInt(this, value, offset, byteLength2, limit - 1, -limit); + } + let i = 0; + let mul = 1; + let sub = 0; + this[offset] = value & 255; + while (++i < byteLength2 && (mul *= 256)) { + if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { + sub = 1; + } + this[offset + i] = (value / mul >> 0) - sub & 255; + } + return offset + byteLength2; + }; + Buffer2.prototype.writeIntBE = function writeIntBE(value, offset, byteLength2, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + const limit = Math.pow(2, 8 * byteLength2 - 1); + checkInt(this, value, offset, byteLength2, limit - 1, -limit); + } + let i = byteLength2 - 1; + let mul = 1; + let sub = 0; + this[offset + i] = value & 255; + while (--i >= 0 && (mul *= 256)) { + if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { + sub = 1; + } + this[offset + i] = (value / mul >> 0) - sub & 255; + } + return offset + byteLength2; + }; + Buffer2.prototype.writeInt8 = function writeInt8(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 1, 127, -128); + if (value < 0) + value = 255 + value + 1; + this[offset] = value & 255; + return offset + 1; + }; + Buffer2.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 2, 32767, -32768); + this[offset] = value & 255; + this[offset + 1] = value >>> 8; + return offset + 2; + }; + Buffer2.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 2, 32767, -32768); + this[offset] = value >>> 8; + this[offset + 1] = value & 255; + return offset + 2; + }; + Buffer2.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 4, 2147483647, -2147483648); + this[offset] = value & 255; + this[offset + 1] = value >>> 8; + this[offset + 2] = value >>> 16; + this[offset + 3] = value >>> 24; + return offset + 4; + }; + Buffer2.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 4, 2147483647, -2147483648); + if (value < 0) + value = 4294967295 + value + 1; + this[offset] = value >>> 24; + this[offset + 1] = value >>> 16; + this[offset + 2] = value >>> 8; + this[offset + 3] = value & 255; + return offset + 4; + }; + Buffer2.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE(value, offset = 0) { + return wrtBigUInt64LE(this, value, offset, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff")); + }); + Buffer2.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE(value, offset = 0) { + return wrtBigUInt64BE(this, value, offset, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff")); + }); + function checkIEEE754(buf, value, offset, ext, max, min) { + if (offset + ext > buf.length) + throw new RangeError("Index out of range"); + if (offset < 0) + throw new RangeError("Index out of range"); + } + function writeFloat(buf, value, offset, littleEndian, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + checkIEEE754(buf, value, offset, 4, 34028234663852886e22, -34028234663852886e22); + } + ieee754.write(buf, value, offset, littleEndian, 23, 4); + return offset + 4; + } + Buffer2.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) { + return writeFloat(this, value, offset, true, noAssert); + }; + Buffer2.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) { + return writeFloat(this, value, offset, false, noAssert); + }; + function writeDouble(buf, value, offset, littleEndian, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + checkIEEE754(buf, value, offset, 8, 17976931348623157e292, -17976931348623157e292); + } + ieee754.write(buf, value, offset, littleEndian, 52, 8); + return offset + 8; + } + Buffer2.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) { + return writeDouble(this, value, offset, true, noAssert); + }; + Buffer2.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) { + return writeDouble(this, value, offset, false, noAssert); + }; + Buffer2.prototype.copy = function copy(target, targetStart, start, end) { + if (!Buffer2.isBuffer(target)) + throw new TypeError("argument should be a Buffer"); + if (!start) + start = 0; + if (!end && end !== 0) + end = this.length; + if (targetStart >= target.length) + targetStart = target.length; + if (!targetStart) + targetStart = 0; + if (end > 0 && end < start) + end = start; + if (end === start) + return 0; + if (target.length === 0 || this.length === 0) + return 0; + if (targetStart < 0) { + throw new RangeError("targetStart out of bounds"); + } + if (start < 0 || start >= this.length) + throw new RangeError("Index out of range"); + if (end < 0) + throw new RangeError("sourceEnd out of bounds"); + if (end > this.length) + end = this.length; + if (target.length - targetStart < end - start) { + end = target.length - targetStart + start; + } + const len = end - start; + if (this === target && typeof Uint8Array.prototype.copyWithin === "function") { + this.copyWithin(targetStart, start, end); + } else { + Uint8Array.prototype.set.call(target, this.subarray(start, end), targetStart); + } + return len; + }; + Buffer2.prototype.fill = function fill(val, start, end, encoding) { + if (typeof val === "string") { + if (typeof start === "string") { + encoding = start; + start = 0; + end = this.length; + } else if (typeof end === "string") { + encoding = end; + end = this.length; + } + if (encoding !== void 0 && typeof encoding !== "string") { + throw new TypeError("encoding must be a string"); + } + if (typeof encoding === "string" && !Buffer2.isEncoding(encoding)) { + throw new TypeError("Unknown encoding: " + encoding); + } + if (val.length === 1) { + const code = val.charCodeAt(0); + if (encoding === "utf8" && code < 128 || encoding === "latin1") { + val = code; + } + } + } else if (typeof val === "number") { + val = val & 255; + } else if (typeof val === "boolean") { + val = Number(val); + } + if (start < 0 || this.length < start || this.length < end) { + throw new RangeError("Out of range index"); + } + if (end <= start) { + return this; + } + start = start >>> 0; + end = end === void 0 ? this.length : end >>> 0; + if (!val) + val = 0; + let i; + if (typeof val === "number") { + for (i = start; i < end; ++i) { + this[i] = val; + } + } else { + const bytes = Buffer2.isBuffer(val) ? val : Buffer2.from(val, encoding); + const len = bytes.length; + if (len === 0) { + throw new TypeError('The value "' + val + '" is invalid for argument "value"'); + } + for (i = 0; i < end - start; ++i) { + this[i + start] = bytes[i % len]; + } + } + return this; + }; + var errors = {}; + function E(sym, getMessage, Base) { + errors[sym] = class NodeError extends Base { + constructor() { + super(); + Object.defineProperty(this, "message", { + value: getMessage.apply(this, arguments), + writable: true, + configurable: true + }); + this.name = `${this.name} [${sym}]`; + this.stack; + delete this.name; + } + get code() { + return sym; + } + set code(value) { + Object.defineProperty(this, "code", { + configurable: true, + enumerable: true, + value, + writable: true + }); + } + toString() { + return `${this.name} [${sym}]: ${this.message}`; + } + }; + } + E("ERR_BUFFER_OUT_OF_BOUNDS", function(name) { + if (name) { + return `${name} is outside of buffer bounds`; + } + return "Attempt to access memory outside buffer bounds"; + }, RangeError); + E("ERR_INVALID_ARG_TYPE", function(name, actual) { + return `The "${name}" argument must be of type number. Received type ${typeof actual}`; + }, TypeError); + E("ERR_OUT_OF_RANGE", function(str, range, input) { + let msg = `The value of "${str}" is out of range.`; + let received = input; + if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) { + received = addNumericalSeparator(String(input)); + } else if (typeof input === "bigint") { + received = String(input); + if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) { + received = addNumericalSeparator(received); + } + received += "n"; + } + msg += ` It must be ${range}. Received ${received}`; + return msg; + }, RangeError); + function addNumericalSeparator(val) { + let res = ""; + let i = val.length; + const start = val[0] === "-" ? 1 : 0; + for (; i >= start + 4; i -= 3) { + res = `_${val.slice(i - 3, i)}${res}`; + } + return `${val.slice(0, i)}${res}`; + } + function checkBounds(buf, offset, byteLength2) { + validateNumber(offset, "offset"); + if (buf[offset] === void 0 || buf[offset + byteLength2] === void 0) { + boundsError(offset, buf.length - (byteLength2 + 1)); + } + } + function checkIntBI(value, min, max, buf, offset, byteLength2) { + if (value > max || value < min) { + const n = typeof min === "bigint" ? "n" : ""; + let range; + if (byteLength2 > 3) { + if (min === 0 || min === BigInt(0)) { + range = `>= 0${n} and < 2${n} ** ${(byteLength2 + 1) * 8}${n}`; + } else { + range = `>= -(2${n} ** ${(byteLength2 + 1) * 8 - 1}${n}) and < 2 ** ${(byteLength2 + 1) * 8 - 1}${n}`; + } + } else { + range = `>= ${min}${n} and <= ${max}${n}`; + } + throw new errors.ERR_OUT_OF_RANGE("value", range, value); + } + checkBounds(buf, offset, byteLength2); + } + function validateNumber(value, name) { + if (typeof value !== "number") { + throw new errors.ERR_INVALID_ARG_TYPE(name, "number", value); + } + } + function boundsError(value, length2, type) { + if (Math.floor(value) !== value) { + validateNumber(value, type); + throw new errors.ERR_OUT_OF_RANGE(type || "offset", "an integer", value); + } + if (length2 < 0) { + throw new errors.ERR_BUFFER_OUT_OF_BOUNDS(); + } + throw new errors.ERR_OUT_OF_RANGE(type || "offset", `>= ${type ? 1 : 0} and <= ${length2}`, value); + } + var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g; + function base64clean(str) { + str = str.split("=")[0]; + str = str.trim().replace(INVALID_BASE64_RE, ""); + if (str.length < 2) + return ""; + while (str.length % 4 !== 0) { + str = str + "="; + } + return str; + } + function utf8ToBytes(string3, units) { + units = units || Infinity; + let codePoint; + const length2 = string3.length; + let leadSurrogate = null; + const bytes = []; + for (let i = 0; i < length2; ++i) { + codePoint = string3.charCodeAt(i); + if (codePoint > 55295 && codePoint < 57344) { + if (!leadSurrogate) { + if (codePoint > 56319) { + if ((units -= 3) > -1) + bytes.push(239, 191, 189); + continue; + } else if (i + 1 === length2) { + if ((units -= 3) > -1) + bytes.push(239, 191, 189); + continue; + } + leadSurrogate = codePoint; + continue; + } + if (codePoint < 56320) { + if ((units -= 3) > -1) + bytes.push(239, 191, 189); + leadSurrogate = codePoint; + continue; + } + codePoint = (leadSurrogate - 55296 << 10 | codePoint - 56320) + 65536; + } else if (leadSurrogate) { + if ((units -= 3) > -1) + bytes.push(239, 191, 189); + } + leadSurrogate = null; + if (codePoint < 128) { + if ((units -= 1) < 0) + break; + bytes.push(codePoint); + } else if (codePoint < 2048) { + if ((units -= 2) < 0) + break; + bytes.push(codePoint >> 6 | 192, codePoint & 63 | 128); + } else if (codePoint < 65536) { + if ((units -= 3) < 0) + break; + bytes.push(codePoint >> 12 | 224, codePoint >> 6 & 63 | 128, codePoint & 63 | 128); + } else if (codePoint < 1114112) { + if ((units -= 4) < 0) + break; + bytes.push(codePoint >> 18 | 240, codePoint >> 12 & 63 | 128, codePoint >> 6 & 63 | 128, codePoint & 63 | 128); + } else { + throw new Error("Invalid code point"); + } + } + return bytes; + } + function asciiToBytes(str) { + const byteArray = []; + for (let i = 0; i < str.length; ++i) { + byteArray.push(str.charCodeAt(i) & 255); + } + return byteArray; + } + function utf16leToBytes(str, units) { + let c, hi, lo; + const byteArray = []; + for (let i = 0; i < str.length; ++i) { + if ((units -= 2) < 0) + break; + c = str.charCodeAt(i); + hi = c >> 8; + lo = c % 256; + byteArray.push(lo); + byteArray.push(hi); + } + return byteArray; + } + function base64ToBytes(str) { + return base64.toByteArray(base64clean(str)); + } + function blitBuffer(src2, dst, offset, length2) { + let i; + for (i = 0; i < length2; ++i) { + if (i + offset >= dst.length || i >= src2.length) + break; + dst[i + offset] = src2[i]; + } + return i; + } + function isInstance(obj, type) { + return obj instanceof type || obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type.name; + } + function numberIsNaN(obj) { + return obj !== obj; + } + var hexSliceLookupTable = function() { + const alphabet = "0123456789abcdef"; + const table = new Array(256); + for (let i = 0; i < 16; ++i) { + const i16 = i * 16; + for (let j = 0; j < 16; ++j) { + table[i16 + j] = alphabet[i] + alphabet[j]; + } + } + return table; + }(); + function defineBigIntMethod(fn) { + return typeof BigInt === "undefined" ? BufferBigIntNotDefined : fn; + } + function BufferBigIntNotDefined() { + throw new Error("BigInt not supported"); + } + } + }); + + // (disabled):crypto + var require_crypto = __commonJS({ + "(disabled):crypto"() { + } + }); + + // node_modules/tweetnacl/nacl-fast.js + var require_nacl_fast = __commonJS({ + "node_modules/tweetnacl/nacl-fast.js"(exports, module) { + (function(nacl2) { + "use strict"; + var gf = function(init2) { + var i, r = new Float64Array(16); + if (init2) + for (i = 0; i < init2.length; i++) + r[i] = init2[i]; + return r; + }; + var randombytes = function() { + throw new Error("no PRNG"); + }; + var _0 = new Uint8Array(16); + var _9 = new Uint8Array(32); + _9[0] = 9; + var gf0 = gf(), gf1 = gf([1]), _121665 = gf([56129, 1]), D = gf([30883, 4953, 19914, 30187, 55467, 16705, 2637, 112, 59544, 30585, 16505, 36039, 65139, 11119, 27886, 20995]), D2 = gf([61785, 9906, 39828, 60374, 45398, 33411, 5274, 224, 53552, 61171, 33010, 6542, 64743, 22239, 55772, 9222]), X = gf([54554, 36645, 11616, 51542, 42930, 38181, 51040, 26924, 56412, 64982, 57905, 49316, 21502, 52590, 14035, 8553]), Y = gf([26200, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214]), I = gf([41136, 18958, 6951, 50414, 58488, 44335, 6150, 12099, 55207, 15867, 153, 11085, 57099, 20417, 9344, 11139]); + function ts64(x, i, h, l) { + x[i] = h >> 24 & 255; + x[i + 1] = h >> 16 & 255; + x[i + 2] = h >> 8 & 255; + x[i + 3] = h & 255; + x[i + 4] = l >> 24 & 255; + x[i + 5] = l >> 16 & 255; + x[i + 6] = l >> 8 & 255; + x[i + 7] = l & 255; + } + function vn(x, xi, y, yi, n) { + var i, d = 0; + for (i = 0; i < n; i++) + d |= x[xi + i] ^ y[yi + i]; + return (1 & d - 1 >>> 8) - 1; + } + function crypto_verify_16(x, xi, y, yi) { + return vn(x, xi, y, yi, 16); + } + function crypto_verify_32(x, xi, y, yi) { + return vn(x, xi, y, yi, 32); + } + function core_salsa20(o, p, k, c) { + var j0 = c[0] & 255 | (c[1] & 255) << 8 | (c[2] & 255) << 16 | (c[3] & 255) << 24, j1 = k[0] & 255 | (k[1] & 255) << 8 | (k[2] & 255) << 16 | (k[3] & 255) << 24, j2 = k[4] & 255 | (k[5] & 255) << 8 | (k[6] & 255) << 16 | (k[7] & 255) << 24, j3 = k[8] & 255 | (k[9] & 255) << 8 | (k[10] & 255) << 16 | (k[11] & 255) << 24, j4 = k[12] & 255 | (k[13] & 255) << 8 | (k[14] & 255) << 16 | (k[15] & 255) << 24, j5 = c[4] & 255 | (c[5] & 255) << 8 | (c[6] & 255) << 16 | (c[7] & 255) << 24, j6 = p[0] & 255 | (p[1] & 255) << 8 | (p[2] & 255) << 16 | (p[3] & 255) << 24, j7 = p[4] & 255 | (p[5] & 255) << 8 | (p[6] & 255) << 16 | (p[7] & 255) << 24, j8 = p[8] & 255 | (p[9] & 255) << 8 | (p[10] & 255) << 16 | (p[11] & 255) << 24, j9 = p[12] & 255 | (p[13] & 255) << 8 | (p[14] & 255) << 16 | (p[15] & 255) << 24, j10 = c[8] & 255 | (c[9] & 255) << 8 | (c[10] & 255) << 16 | (c[11] & 255) << 24, j11 = k[16] & 255 | (k[17] & 255) << 8 | (k[18] & 255) << 16 | (k[19] & 255) << 24, j12 = k[20] & 255 | (k[21] & 255) << 8 | (k[22] & 255) << 16 | (k[23] & 255) << 24, j13 = k[24] & 255 | (k[25] & 255) << 8 | (k[26] & 255) << 16 | (k[27] & 255) << 24, j14 = k[28] & 255 | (k[29] & 255) << 8 | (k[30] & 255) << 16 | (k[31] & 255) << 24, j15 = c[12] & 255 | (c[13] & 255) << 8 | (c[14] & 255) << 16 | (c[15] & 255) << 24; + var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7, x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14, x15 = j15, u; + for (var i = 0; i < 20; i += 2) { + u = x0 + x12 | 0; + x4 ^= u << 7 | u >>> 32 - 7; + u = x4 + x0 | 0; + x8 ^= u << 9 | u >>> 32 - 9; + u = x8 + x4 | 0; + x12 ^= u << 13 | u >>> 32 - 13; + u = x12 + x8 | 0; + x0 ^= u << 18 | u >>> 32 - 18; + u = x5 + x1 | 0; + x9 ^= u << 7 | u >>> 32 - 7; + u = x9 + x5 | 0; + x13 ^= u << 9 | u >>> 32 - 9; + u = x13 + x9 | 0; + x1 ^= u << 13 | u >>> 32 - 13; + u = x1 + x13 | 0; + x5 ^= u << 18 | u >>> 32 - 18; + u = x10 + x6 | 0; + x14 ^= u << 7 | u >>> 32 - 7; + u = x14 + x10 | 0; + x2 ^= u << 9 | u >>> 32 - 9; + u = x2 + x14 | 0; + x6 ^= u << 13 | u >>> 32 - 13; + u = x6 + x2 | 0; + x10 ^= u << 18 | u >>> 32 - 18; + u = x15 + x11 | 0; + x3 ^= u << 7 | u >>> 32 - 7; + u = x3 + x15 | 0; + x7 ^= u << 9 | u >>> 32 - 9; + u = x7 + x3 | 0; + x11 ^= u << 13 | u >>> 32 - 13; + u = x11 + x7 | 0; + x15 ^= u << 18 | u >>> 32 - 18; + u = x0 + x3 | 0; + x1 ^= u << 7 | u >>> 32 - 7; + u = x1 + x0 | 0; + x2 ^= u << 9 | u >>> 32 - 9; + u = x2 + x1 | 0; + x3 ^= u << 13 | u >>> 32 - 13; + u = x3 + x2 | 0; + x0 ^= u << 18 | u >>> 32 - 18; + u = x5 + x4 | 0; + x6 ^= u << 7 | u >>> 32 - 7; + u = x6 + x5 | 0; + x7 ^= u << 9 | u >>> 32 - 9; + u = x7 + x6 | 0; + x4 ^= u << 13 | u >>> 32 - 13; + u = x4 + x7 | 0; + x5 ^= u << 18 | u >>> 32 - 18; + u = x10 + x9 | 0; + x11 ^= u << 7 | u >>> 32 - 7; + u = x11 + x10 | 0; + x8 ^= u << 9 | u >>> 32 - 9; + u = x8 + x11 | 0; + x9 ^= u << 13 | u >>> 32 - 13; + u = x9 + x8 | 0; + x10 ^= u << 18 | u >>> 32 - 18; + u = x15 + x14 | 0; + x12 ^= u << 7 | u >>> 32 - 7; + u = x12 + x15 | 0; + x13 ^= u << 9 | u >>> 32 - 9; + u = x13 + x12 | 0; + x14 ^= u << 13 | u >>> 32 - 13; + u = x14 + x13 | 0; + x15 ^= u << 18 | u >>> 32 - 18; + } + x0 = x0 + j0 | 0; + x1 = x1 + j1 | 0; + x2 = x2 + j2 | 0; + x3 = x3 + j3 | 0; + x4 = x4 + j4 | 0; + x5 = x5 + j5 | 0; + x6 = x6 + j6 | 0; + x7 = x7 + j7 | 0; + x8 = x8 + j8 | 0; + x9 = x9 + j9 | 0; + x10 = x10 + j10 | 0; + x11 = x11 + j11 | 0; + x12 = x12 + j12 | 0; + x13 = x13 + j13 | 0; + x14 = x14 + j14 | 0; + x15 = x15 + j15 | 0; + o[0] = x0 >>> 0 & 255; + o[1] = x0 >>> 8 & 255; + o[2] = x0 >>> 16 & 255; + o[3] = x0 >>> 24 & 255; + o[4] = x1 >>> 0 & 255; + o[5] = x1 >>> 8 & 255; + o[6] = x1 >>> 16 & 255; + o[7] = x1 >>> 24 & 255; + o[8] = x2 >>> 0 & 255; + o[9] = x2 >>> 8 & 255; + o[10] = x2 >>> 16 & 255; + o[11] = x2 >>> 24 & 255; + o[12] = x3 >>> 0 & 255; + o[13] = x3 >>> 8 & 255; + o[14] = x3 >>> 16 & 255; + o[15] = x3 >>> 24 & 255; + o[16] = x4 >>> 0 & 255; + o[17] = x4 >>> 8 & 255; + o[18] = x4 >>> 16 & 255; + o[19] = x4 >>> 24 & 255; + o[20] = x5 >>> 0 & 255; + o[21] = x5 >>> 8 & 255; + o[22] = x5 >>> 16 & 255; + o[23] = x5 >>> 24 & 255; + o[24] = x6 >>> 0 & 255; + o[25] = x6 >>> 8 & 255; + o[26] = x6 >>> 16 & 255; + o[27] = x6 >>> 24 & 255; + o[28] = x7 >>> 0 & 255; + o[29] = x7 >>> 8 & 255; + o[30] = x7 >>> 16 & 255; + o[31] = x7 >>> 24 & 255; + o[32] = x8 >>> 0 & 255; + o[33] = x8 >>> 8 & 255; + o[34] = x8 >>> 16 & 255; + o[35] = x8 >>> 24 & 255; + o[36] = x9 >>> 0 & 255; + o[37] = x9 >>> 8 & 255; + o[38] = x9 >>> 16 & 255; + o[39] = x9 >>> 24 & 255; + o[40] = x10 >>> 0 & 255; + o[41] = x10 >>> 8 & 255; + o[42] = x10 >>> 16 & 255; + o[43] = x10 >>> 24 & 255; + o[44] = x11 >>> 0 & 255; + o[45] = x11 >>> 8 & 255; + o[46] = x11 >>> 16 & 255; + o[47] = x11 >>> 24 & 255; + o[48] = x12 >>> 0 & 255; + o[49] = x12 >>> 8 & 255; + o[50] = x12 >>> 16 & 255; + o[51] = x12 >>> 24 & 255; + o[52] = x13 >>> 0 & 255; + o[53] = x13 >>> 8 & 255; + o[54] = x13 >>> 16 & 255; + o[55] = x13 >>> 24 & 255; + o[56] = x14 >>> 0 & 255; + o[57] = x14 >>> 8 & 255; + o[58] = x14 >>> 16 & 255; + o[59] = x14 >>> 24 & 255; + o[60] = x15 >>> 0 & 255; + o[61] = x15 >>> 8 & 255; + o[62] = x15 >>> 16 & 255; + o[63] = x15 >>> 24 & 255; + } + function core_hsalsa20(o, p, k, c) { + var j0 = c[0] & 255 | (c[1] & 255) << 8 | (c[2] & 255) << 16 | (c[3] & 255) << 24, j1 = k[0] & 255 | (k[1] & 255) << 8 | (k[2] & 255) << 16 | (k[3] & 255) << 24, j2 = k[4] & 255 | (k[5] & 255) << 8 | (k[6] & 255) << 16 | (k[7] & 255) << 24, j3 = k[8] & 255 | (k[9] & 255) << 8 | (k[10] & 255) << 16 | (k[11] & 255) << 24, j4 = k[12] & 255 | (k[13] & 255) << 8 | (k[14] & 255) << 16 | (k[15] & 255) << 24, j5 = c[4] & 255 | (c[5] & 255) << 8 | (c[6] & 255) << 16 | (c[7] & 255) << 24, j6 = p[0] & 255 | (p[1] & 255) << 8 | (p[2] & 255) << 16 | (p[3] & 255) << 24, j7 = p[4] & 255 | (p[5] & 255) << 8 | (p[6] & 255) << 16 | (p[7] & 255) << 24, j8 = p[8] & 255 | (p[9] & 255) << 8 | (p[10] & 255) << 16 | (p[11] & 255) << 24, j9 = p[12] & 255 | (p[13] & 255) << 8 | (p[14] & 255) << 16 | (p[15] & 255) << 24, j10 = c[8] & 255 | (c[9] & 255) << 8 | (c[10] & 255) << 16 | (c[11] & 255) << 24, j11 = k[16] & 255 | (k[17] & 255) << 8 | (k[18] & 255) << 16 | (k[19] & 255) << 24, j12 = k[20] & 255 | (k[21] & 255) << 8 | (k[22] & 255) << 16 | (k[23] & 255) << 24, j13 = k[24] & 255 | (k[25] & 255) << 8 | (k[26] & 255) << 16 | (k[27] & 255) << 24, j14 = k[28] & 255 | (k[29] & 255) << 8 | (k[30] & 255) << 16 | (k[31] & 255) << 24, j15 = c[12] & 255 | (c[13] & 255) << 8 | (c[14] & 255) << 16 | (c[15] & 255) << 24; + var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7, x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14, x15 = j15, u; + for (var i = 0; i < 20; i += 2) { + u = x0 + x12 | 0; + x4 ^= u << 7 | u >>> 32 - 7; + u = x4 + x0 | 0; + x8 ^= u << 9 | u >>> 32 - 9; + u = x8 + x4 | 0; + x12 ^= u << 13 | u >>> 32 - 13; + u = x12 + x8 | 0; + x0 ^= u << 18 | u >>> 32 - 18; + u = x5 + x1 | 0; + x9 ^= u << 7 | u >>> 32 - 7; + u = x9 + x5 | 0; + x13 ^= u << 9 | u >>> 32 - 9; + u = x13 + x9 | 0; + x1 ^= u << 13 | u >>> 32 - 13; + u = x1 + x13 | 0; + x5 ^= u << 18 | u >>> 32 - 18; + u = x10 + x6 | 0; + x14 ^= u << 7 | u >>> 32 - 7; + u = x14 + x10 | 0; + x2 ^= u << 9 | u >>> 32 - 9; + u = x2 + x14 | 0; + x6 ^= u << 13 | u >>> 32 - 13; + u = x6 + x2 | 0; + x10 ^= u << 18 | u >>> 32 - 18; + u = x15 + x11 | 0; + x3 ^= u << 7 | u >>> 32 - 7; + u = x3 + x15 | 0; + x7 ^= u << 9 | u >>> 32 - 9; + u = x7 + x3 | 0; + x11 ^= u << 13 | u >>> 32 - 13; + u = x11 + x7 | 0; + x15 ^= u << 18 | u >>> 32 - 18; + u = x0 + x3 | 0; + x1 ^= u << 7 | u >>> 32 - 7; + u = x1 + x0 | 0; + x2 ^= u << 9 | u >>> 32 - 9; + u = x2 + x1 | 0; + x3 ^= u << 13 | u >>> 32 - 13; + u = x3 + x2 | 0; + x0 ^= u << 18 | u >>> 32 - 18; + u = x5 + x4 | 0; + x6 ^= u << 7 | u >>> 32 - 7; + u = x6 + x5 | 0; + x7 ^= u << 9 | u >>> 32 - 9; + u = x7 + x6 | 0; + x4 ^= u << 13 | u >>> 32 - 13; + u = x4 + x7 | 0; + x5 ^= u << 18 | u >>> 32 - 18; + u = x10 + x9 | 0; + x11 ^= u << 7 | u >>> 32 - 7; + u = x11 + x10 | 0; + x8 ^= u << 9 | u >>> 32 - 9; + u = x8 + x11 | 0; + x9 ^= u << 13 | u >>> 32 - 13; + u = x9 + x8 | 0; + x10 ^= u << 18 | u >>> 32 - 18; + u = x15 + x14 | 0; + x12 ^= u << 7 | u >>> 32 - 7; + u = x12 + x15 | 0; + x13 ^= u << 9 | u >>> 32 - 9; + u = x13 + x12 | 0; + x14 ^= u << 13 | u >>> 32 - 13; + u = x14 + x13 | 0; + x15 ^= u << 18 | u >>> 32 - 18; + } + o[0] = x0 >>> 0 & 255; + o[1] = x0 >>> 8 & 255; + o[2] = x0 >>> 16 & 255; + o[3] = x0 >>> 24 & 255; + o[4] = x5 >>> 0 & 255; + o[5] = x5 >>> 8 & 255; + o[6] = x5 >>> 16 & 255; + o[7] = x5 >>> 24 & 255; + o[8] = x10 >>> 0 & 255; + o[9] = x10 >>> 8 & 255; + o[10] = x10 >>> 16 & 255; + o[11] = x10 >>> 24 & 255; + o[12] = x15 >>> 0 & 255; + o[13] = x15 >>> 8 & 255; + o[14] = x15 >>> 16 & 255; + o[15] = x15 >>> 24 & 255; + o[16] = x6 >>> 0 & 255; + o[17] = x6 >>> 8 & 255; + o[18] = x6 >>> 16 & 255; + o[19] = x6 >>> 24 & 255; + o[20] = x7 >>> 0 & 255; + o[21] = x7 >>> 8 & 255; + o[22] = x7 >>> 16 & 255; + o[23] = x7 >>> 24 & 255; + o[24] = x8 >>> 0 & 255; + o[25] = x8 >>> 8 & 255; + o[26] = x8 >>> 16 & 255; + o[27] = x8 >>> 24 & 255; + o[28] = x9 >>> 0 & 255; + o[29] = x9 >>> 8 & 255; + o[30] = x9 >>> 16 & 255; + o[31] = x9 >>> 24 & 255; + } + function crypto_core_salsa20(out, inp, k, c) { + core_salsa20(out, inp, k, c); + } + function crypto_core_hsalsa20(out, inp, k, c) { + core_hsalsa20(out, inp, k, c); + } + var sigma = new Uint8Array([101, 120, 112, 97, 110, 100, 32, 51, 50, 45, 98, 121, 116, 101, 32, 107]); + function crypto_stream_salsa20_xor(c, cpos, m, mpos, b, n, k) { + var z = new Uint8Array(16), x = new Uint8Array(64); + var u, i; + for (i = 0; i < 16; i++) + z[i] = 0; + for (i = 0; i < 8; i++) + z[i] = n[i]; + while (b >= 64) { + crypto_core_salsa20(x, z, k, sigma); + for (i = 0; i < 64; i++) + c[cpos + i] = m[mpos + i] ^ x[i]; + u = 1; + for (i = 8; i < 16; i++) { + u = u + (z[i] & 255) | 0; + z[i] = u & 255; + u >>>= 8; + } + b -= 64; + cpos += 64; + mpos += 64; + } + if (b > 0) { + crypto_core_salsa20(x, z, k, sigma); + for (i = 0; i < b; i++) + c[cpos + i] = m[mpos + i] ^ x[i]; + } + return 0; + } + function crypto_stream_salsa20(c, cpos, b, n, k) { + var z = new Uint8Array(16), x = new Uint8Array(64); + var u, i; + for (i = 0; i < 16; i++) + z[i] = 0; + for (i = 0; i < 8; i++) + z[i] = n[i]; + while (b >= 64) { + crypto_core_salsa20(x, z, k, sigma); + for (i = 0; i < 64; i++) + c[cpos + i] = x[i]; + u = 1; + for (i = 8; i < 16; i++) { + u = u + (z[i] & 255) | 0; + z[i] = u & 255; + u >>>= 8; + } + b -= 64; + cpos += 64; + } + if (b > 0) { + crypto_core_salsa20(x, z, k, sigma); + for (i = 0; i < b; i++) + c[cpos + i] = x[i]; + } + return 0; + } + function crypto_stream(c, cpos, d, n, k) { + var s = new Uint8Array(32); + crypto_core_hsalsa20(s, n, k, sigma); + var sn = new Uint8Array(8); + for (var i = 0; i < 8; i++) + sn[i] = n[i + 16]; + return crypto_stream_salsa20(c, cpos, d, sn, s); + } + function crypto_stream_xor(c, cpos, m, mpos, d, n, k) { + var s = new Uint8Array(32); + crypto_core_hsalsa20(s, n, k, sigma); + var sn = new Uint8Array(8); + for (var i = 0; i < 8; i++) + sn[i] = n[i + 16]; + return crypto_stream_salsa20_xor(c, cpos, m, mpos, d, sn, s); + } + var poly1305 = function(key) { + this.buffer = new Uint8Array(16); + this.r = new Uint16Array(10); + this.h = new Uint16Array(10); + this.pad = new Uint16Array(8); + this.leftover = 0; + this.fin = 0; + var t0, t1, t2, t3, t4, t5, t6, t7; + t0 = key[0] & 255 | (key[1] & 255) << 8; + this.r[0] = t0 & 8191; + t1 = key[2] & 255 | (key[3] & 255) << 8; + this.r[1] = (t0 >>> 13 | t1 << 3) & 8191; + t2 = key[4] & 255 | (key[5] & 255) << 8; + this.r[2] = (t1 >>> 10 | t2 << 6) & 7939; + t3 = key[6] & 255 | (key[7] & 255) << 8; + this.r[3] = (t2 >>> 7 | t3 << 9) & 8191; + t4 = key[8] & 255 | (key[9] & 255) << 8; + this.r[4] = (t3 >>> 4 | t4 << 12) & 255; + this.r[5] = t4 >>> 1 & 8190; + t5 = key[10] & 255 | (key[11] & 255) << 8; + this.r[6] = (t4 >>> 14 | t5 << 2) & 8191; + t6 = key[12] & 255 | (key[13] & 255) << 8; + this.r[7] = (t5 >>> 11 | t6 << 5) & 8065; + t7 = key[14] & 255 | (key[15] & 255) << 8; + this.r[8] = (t6 >>> 8 | t7 << 8) & 8191; + this.r[9] = t7 >>> 5 & 127; + this.pad[0] = key[16] & 255 | (key[17] & 255) << 8; + this.pad[1] = key[18] & 255 | (key[19] & 255) << 8; + this.pad[2] = key[20] & 255 | (key[21] & 255) << 8; + this.pad[3] = key[22] & 255 | (key[23] & 255) << 8; + this.pad[4] = key[24] & 255 | (key[25] & 255) << 8; + this.pad[5] = key[26] & 255 | (key[27] & 255) << 8; + this.pad[6] = key[28] & 255 | (key[29] & 255) << 8; + this.pad[7] = key[30] & 255 | (key[31] & 255) << 8; + }; + poly1305.prototype.blocks = function(m, mpos, bytes) { + var hibit = this.fin ? 0 : 1 << 11; + var t0, t1, t2, t3, t4, t5, t6, t7, c; + var d0, d1, d2, d3, d4, d5, d6, d7, d8, d9; + var h0 = this.h[0], h1 = this.h[1], h2 = this.h[2], h3 = this.h[3], h4 = this.h[4], h5 = this.h[5], h6 = this.h[6], h7 = this.h[7], h8 = this.h[8], h9 = this.h[9]; + var r0 = this.r[0], r1 = this.r[1], r2 = this.r[2], r3 = this.r[3], r4 = this.r[4], r5 = this.r[5], r6 = this.r[6], r7 = this.r[7], r8 = this.r[8], r9 = this.r[9]; + while (bytes >= 16) { + t0 = m[mpos + 0] & 255 | (m[mpos + 1] & 255) << 8; + h0 += t0 & 8191; + t1 = m[mpos + 2] & 255 | (m[mpos + 3] & 255) << 8; + h1 += (t0 >>> 13 | t1 << 3) & 8191; + t2 = m[mpos + 4] & 255 | (m[mpos + 5] & 255) << 8; + h2 += (t1 >>> 10 | t2 << 6) & 8191; + t3 = m[mpos + 6] & 255 | (m[mpos + 7] & 255) << 8; + h3 += (t2 >>> 7 | t3 << 9) & 8191; + t4 = m[mpos + 8] & 255 | (m[mpos + 9] & 255) << 8; + h4 += (t3 >>> 4 | t4 << 12) & 8191; + h5 += t4 >>> 1 & 8191; + t5 = m[mpos + 10] & 255 | (m[mpos + 11] & 255) << 8; + h6 += (t4 >>> 14 | t5 << 2) & 8191; + t6 = m[mpos + 12] & 255 | (m[mpos + 13] & 255) << 8; + h7 += (t5 >>> 11 | t6 << 5) & 8191; + t7 = m[mpos + 14] & 255 | (m[mpos + 15] & 255) << 8; + h8 += (t6 >>> 8 | t7 << 8) & 8191; + h9 += t7 >>> 5 | hibit; + c = 0; + d0 = c; + d0 += h0 * r0; + d0 += h1 * (5 * r9); + d0 += h2 * (5 * r8); + d0 += h3 * (5 * r7); + d0 += h4 * (5 * r6); + c = d0 >>> 13; + d0 &= 8191; + d0 += h5 * (5 * r5); + d0 += h6 * (5 * r4); + d0 += h7 * (5 * r3); + d0 += h8 * (5 * r2); + d0 += h9 * (5 * r1); + c += d0 >>> 13; + d0 &= 8191; + d1 = c; + d1 += h0 * r1; + d1 += h1 * r0; + d1 += h2 * (5 * r9); + d1 += h3 * (5 * r8); + d1 += h4 * (5 * r7); + c = d1 >>> 13; + d1 &= 8191; + d1 += h5 * (5 * r6); + d1 += h6 * (5 * r5); + d1 += h7 * (5 * r4); + d1 += h8 * (5 * r3); + d1 += h9 * (5 * r2); + c += d1 >>> 13; + d1 &= 8191; + d2 = c; + d2 += h0 * r2; + d2 += h1 * r1; + d2 += h2 * r0; + d2 += h3 * (5 * r9); + d2 += h4 * (5 * r8); + c = d2 >>> 13; + d2 &= 8191; + d2 += h5 * (5 * r7); + d2 += h6 * (5 * r6); + d2 += h7 * (5 * r5); + d2 += h8 * (5 * r4); + d2 += h9 * (5 * r3); + c += d2 >>> 13; + d2 &= 8191; + d3 = c; + d3 += h0 * r3; + d3 += h1 * r2; + d3 += h2 * r1; + d3 += h3 * r0; + d3 += h4 * (5 * r9); + c = d3 >>> 13; + d3 &= 8191; + d3 += h5 * (5 * r8); + d3 += h6 * (5 * r7); + d3 += h7 * (5 * r6); + d3 += h8 * (5 * r5); + d3 += h9 * (5 * r4); + c += d3 >>> 13; + d3 &= 8191; + d4 = c; + d4 += h0 * r4; + d4 += h1 * r3; + d4 += h2 * r2; + d4 += h3 * r1; + d4 += h4 * r0; + c = d4 >>> 13; + d4 &= 8191; + d4 += h5 * (5 * r9); + d4 += h6 * (5 * r8); + d4 += h7 * (5 * r7); + d4 += h8 * (5 * r6); + d4 += h9 * (5 * r5); + c += d4 >>> 13; + d4 &= 8191; + d5 = c; + d5 += h0 * r5; + d5 += h1 * r4; + d5 += h2 * r3; + d5 += h3 * r2; + d5 += h4 * r1; + c = d5 >>> 13; + d5 &= 8191; + d5 += h5 * r0; + d5 += h6 * (5 * r9); + d5 += h7 * (5 * r8); + d5 += h8 * (5 * r7); + d5 += h9 * (5 * r6); + c += d5 >>> 13; + d5 &= 8191; + d6 = c; + d6 += h0 * r6; + d6 += h1 * r5; + d6 += h2 * r4; + d6 += h3 * r3; + d6 += h4 * r2; + c = d6 >>> 13; + d6 &= 8191; + d6 += h5 * r1; + d6 += h6 * r0; + d6 += h7 * (5 * r9); + d6 += h8 * (5 * r8); + d6 += h9 * (5 * r7); + c += d6 >>> 13; + d6 &= 8191; + d7 = c; + d7 += h0 * r7; + d7 += h1 * r6; + d7 += h2 * r5; + d7 += h3 * r4; + d7 += h4 * r3; + c = d7 >>> 13; + d7 &= 8191; + d7 += h5 * r2; + d7 += h6 * r1; + d7 += h7 * r0; + d7 += h8 * (5 * r9); + d7 += h9 * (5 * r8); + c += d7 >>> 13; + d7 &= 8191; + d8 = c; + d8 += h0 * r8; + d8 += h1 * r7; + d8 += h2 * r6; + d8 += h3 * r5; + d8 += h4 * r4; + c = d8 >>> 13; + d8 &= 8191; + d8 += h5 * r3; + d8 += h6 * r2; + d8 += h7 * r1; + d8 += h8 * r0; + d8 += h9 * (5 * r9); + c += d8 >>> 13; + d8 &= 8191; + d9 = c; + d9 += h0 * r9; + d9 += h1 * r8; + d9 += h2 * r7; + d9 += h3 * r6; + d9 += h4 * r5; + c = d9 >>> 13; + d9 &= 8191; + d9 += h5 * r4; + d9 += h6 * r3; + d9 += h7 * r2; + d9 += h8 * r1; + d9 += h9 * r0; + c += d9 >>> 13; + d9 &= 8191; + c = (c << 2) + c | 0; + c = c + d0 | 0; + d0 = c & 8191; + c = c >>> 13; + d1 += c; + h0 = d0; + h1 = d1; + h2 = d2; + h3 = d3; + h4 = d4; + h5 = d5; + h6 = d6; + h7 = d7; + h8 = d8; + h9 = d9; + mpos += 16; + bytes -= 16; + } + this.h[0] = h0; + this.h[1] = h1; + this.h[2] = h2; + this.h[3] = h3; + this.h[4] = h4; + this.h[5] = h5; + this.h[6] = h6; + this.h[7] = h7; + this.h[8] = h8; + this.h[9] = h9; + }; + poly1305.prototype.finish = function(mac, macpos) { + var g = new Uint16Array(10); + var c, mask, f, i; + if (this.leftover) { + i = this.leftover; + this.buffer[i++] = 1; + for (; i < 16; i++) + this.buffer[i] = 0; + this.fin = 1; + this.blocks(this.buffer, 0, 16); + } + c = this.h[1] >>> 13; + this.h[1] &= 8191; + for (i = 2; i < 10; i++) { + this.h[i] += c; + c = this.h[i] >>> 13; + this.h[i] &= 8191; + } + this.h[0] += c * 5; + c = this.h[0] >>> 13; + this.h[0] &= 8191; + this.h[1] += c; + c = this.h[1] >>> 13; + this.h[1] &= 8191; + this.h[2] += c; + g[0] = this.h[0] + 5; + c = g[0] >>> 13; + g[0] &= 8191; + for (i = 1; i < 10; i++) { + g[i] = this.h[i] + c; + c = g[i] >>> 13; + g[i] &= 8191; + } + g[9] -= 1 << 13; + mask = (c ^ 1) - 1; + for (i = 0; i < 10; i++) + g[i] &= mask; + mask = ~mask; + for (i = 0; i < 10; i++) + this.h[i] = this.h[i] & mask | g[i]; + this.h[0] = (this.h[0] | this.h[1] << 13) & 65535; + this.h[1] = (this.h[1] >>> 3 | this.h[2] << 10) & 65535; + this.h[2] = (this.h[2] >>> 6 | this.h[3] << 7) & 65535; + this.h[3] = (this.h[3] >>> 9 | this.h[4] << 4) & 65535; + this.h[4] = (this.h[4] >>> 12 | this.h[5] << 1 | this.h[6] << 14) & 65535; + this.h[5] = (this.h[6] >>> 2 | this.h[7] << 11) & 65535; + this.h[6] = (this.h[7] >>> 5 | this.h[8] << 8) & 65535; + this.h[7] = (this.h[8] >>> 8 | this.h[9] << 5) & 65535; + f = this.h[0] + this.pad[0]; + this.h[0] = f & 65535; + for (i = 1; i < 8; i++) { + f = (this.h[i] + this.pad[i] | 0) + (f >>> 16) | 0; + this.h[i] = f & 65535; + } + mac[macpos + 0] = this.h[0] >>> 0 & 255; + mac[macpos + 1] = this.h[0] >>> 8 & 255; + mac[macpos + 2] = this.h[1] >>> 0 & 255; + mac[macpos + 3] = this.h[1] >>> 8 & 255; + mac[macpos + 4] = this.h[2] >>> 0 & 255; + mac[macpos + 5] = this.h[2] >>> 8 & 255; + mac[macpos + 6] = this.h[3] >>> 0 & 255; + mac[macpos + 7] = this.h[3] >>> 8 & 255; + mac[macpos + 8] = this.h[4] >>> 0 & 255; + mac[macpos + 9] = this.h[4] >>> 8 & 255; + mac[macpos + 10] = this.h[5] >>> 0 & 255; + mac[macpos + 11] = this.h[5] >>> 8 & 255; + mac[macpos + 12] = this.h[6] >>> 0 & 255; + mac[macpos + 13] = this.h[6] >>> 8 & 255; + mac[macpos + 14] = this.h[7] >>> 0 & 255; + mac[macpos + 15] = this.h[7] >>> 8 & 255; + }; + poly1305.prototype.update = function(m, mpos, bytes) { + var i, want; + if (this.leftover) { + want = 16 - this.leftover; + if (want > bytes) + want = bytes; + for (i = 0; i < want; i++) + this.buffer[this.leftover + i] = m[mpos + i]; + bytes -= want; + mpos += want; + this.leftover += want; + if (this.leftover < 16) + return; + this.blocks(this.buffer, 0, 16); + this.leftover = 0; + } + if (bytes >= 16) { + want = bytes - bytes % 16; + this.blocks(m, mpos, want); + mpos += want; + bytes -= want; + } + if (bytes) { + for (i = 0; i < bytes; i++) + this.buffer[this.leftover + i] = m[mpos + i]; + this.leftover += bytes; + } + }; + function crypto_onetimeauth(out, outpos, m, mpos, n, k) { + var s = new poly1305(k); + s.update(m, mpos, n); + s.finish(out, outpos); + return 0; + } + function crypto_onetimeauth_verify(h, hpos, m, mpos, n, k) { + var x = new Uint8Array(16); + crypto_onetimeauth(x, 0, m, mpos, n, k); + return crypto_verify_16(h, hpos, x, 0); + } + function crypto_secretbox(c, m, d, n, k) { + var i; + if (d < 32) + return -1; + crypto_stream_xor(c, 0, m, 0, d, n, k); + crypto_onetimeauth(c, 16, c, 32, d - 32, c); + for (i = 0; i < 16; i++) + c[i] = 0; + return 0; + } + function crypto_secretbox_open(m, c, d, n, k) { + var i; + var x = new Uint8Array(32); + if (d < 32) + return -1; + crypto_stream(x, 0, 32, n, k); + if (crypto_onetimeauth_verify(c, 16, c, 32, d - 32, x) !== 0) + return -1; + crypto_stream_xor(m, 0, c, 0, d, n, k); + for (i = 0; i < 32; i++) + m[i] = 0; + return 0; + } + function set25519(r, a) { + var i; + for (i = 0; i < 16; i++) + r[i] = a[i] | 0; + } + function car25519(o) { + var i, v, c = 1; + for (i = 0; i < 16; i++) { + v = o[i] + c + 65535; + c = Math.floor(v / 65536); + o[i] = v - c * 65536; + } + o[0] += c - 1 + 37 * (c - 1); + } + function sel25519(p, q, b) { + var t, c = ~(b - 1); + for (var i = 0; i < 16; i++) { + t = c & (p[i] ^ q[i]); + p[i] ^= t; + q[i] ^= t; + } + } + function pack25519(o, n) { + var i, j, b; + var m = gf(), t = gf(); + for (i = 0; i < 16; i++) + t[i] = n[i]; + car25519(t); + car25519(t); + car25519(t); + for (j = 0; j < 2; j++) { + m[0] = t[0] - 65517; + for (i = 1; i < 15; i++) { + m[i] = t[i] - 65535 - (m[i - 1] >> 16 & 1); + m[i - 1] &= 65535; + } + m[15] = t[15] - 32767 - (m[14] >> 16 & 1); + b = m[15] >> 16 & 1; + m[14] &= 65535; + sel25519(t, m, 1 - b); + } + for (i = 0; i < 16; i++) { + o[2 * i] = t[i] & 255; + o[2 * i + 1] = t[i] >> 8; + } + } + function neq25519(a, b) { + var c = new Uint8Array(32), d = new Uint8Array(32); + pack25519(c, a); + pack25519(d, b); + return crypto_verify_32(c, 0, d, 0); + } + function par25519(a) { + var d = new Uint8Array(32); + pack25519(d, a); + return d[0] & 1; + } + function unpack25519(o, n) { + var i; + for (i = 0; i < 16; i++) + o[i] = n[2 * i] + (n[2 * i + 1] << 8); + o[15] &= 32767; + } + function A(o, a, b) { + for (var i = 0; i < 16; i++) + o[i] = a[i] + b[i]; + } + function Z(o, a, b) { + for (var i = 0; i < 16; i++) + o[i] = a[i] - b[i]; + } + function M(o, a, b) { + var v, c, t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, t10 = 0, t11 = 0, t12 = 0, t13 = 0, t14 = 0, t15 = 0, t16 = 0, t17 = 0, t18 = 0, t19 = 0, t20 = 0, t21 = 0, t22 = 0, t23 = 0, t24 = 0, t25 = 0, t26 = 0, t27 = 0, t28 = 0, t29 = 0, t30 = 0, b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3], b4 = b[4], b5 = b[5], b6 = b[6], b7 = b[7], b8 = b[8], b9 = b[9], b10 = b[10], b11 = b[11], b12 = b[12], b13 = b[13], b14 = b[14], b15 = b[15]; + v = a[0]; + t0 += v * b0; + t1 += v * b1; + t2 += v * b2; + t3 += v * b3; + t4 += v * b4; + t5 += v * b5; + t6 += v * b6; + t7 += v * b7; + t8 += v * b8; + t9 += v * b9; + t10 += v * b10; + t11 += v * b11; + t12 += v * b12; + t13 += v * b13; + t14 += v * b14; + t15 += v * b15; + v = a[1]; + t1 += v * b0; + t2 += v * b1; + t3 += v * b2; + t4 += v * b3; + t5 += v * b4; + t6 += v * b5; + t7 += v * b6; + t8 += v * b7; + t9 += v * b8; + t10 += v * b9; + t11 += v * b10; + t12 += v * b11; + t13 += v * b12; + t14 += v * b13; + t15 += v * b14; + t16 += v * b15; + v = a[2]; + t2 += v * b0; + t3 += v * b1; + t4 += v * b2; + t5 += v * b3; + t6 += v * b4; + t7 += v * b5; + t8 += v * b6; + t9 += v * b7; + t10 += v * b8; + t11 += v * b9; + t12 += v * b10; + t13 += v * b11; + t14 += v * b12; + t15 += v * b13; + t16 += v * b14; + t17 += v * b15; + v = a[3]; + t3 += v * b0; + t4 += v * b1; + t5 += v * b2; + t6 += v * b3; + t7 += v * b4; + t8 += v * b5; + t9 += v * b6; + t10 += v * b7; + t11 += v * b8; + t12 += v * b9; + t13 += v * b10; + t14 += v * b11; + t15 += v * b12; + t16 += v * b13; + t17 += v * b14; + t18 += v * b15; + v = a[4]; + t4 += v * b0; + t5 += v * b1; + t6 += v * b2; + t7 += v * b3; + t8 += v * b4; + t9 += v * b5; + t10 += v * b6; + t11 += v * b7; + t12 += v * b8; + t13 += v * b9; + t14 += v * b10; + t15 += v * b11; + t16 += v * b12; + t17 += v * b13; + t18 += v * b14; + t19 += v * b15; + v = a[5]; + t5 += v * b0; + t6 += v * b1; + t7 += v * b2; + t8 += v * b3; + t9 += v * b4; + t10 += v * b5; + t11 += v * b6; + t12 += v * b7; + t13 += v * b8; + t14 += v * b9; + t15 += v * b10; + t16 += v * b11; + t17 += v * b12; + t18 += v * b13; + t19 += v * b14; + t20 += v * b15; + v = a[6]; + t6 += v * b0; + t7 += v * b1; + t8 += v * b2; + t9 += v * b3; + t10 += v * b4; + t11 += v * b5; + t12 += v * b6; + t13 += v * b7; + t14 += v * b8; + t15 += v * b9; + t16 += v * b10; + t17 += v * b11; + t18 += v * b12; + t19 += v * b13; + t20 += v * b14; + t21 += v * b15; + v = a[7]; + t7 += v * b0; + t8 += v * b1; + t9 += v * b2; + t10 += v * b3; + t11 += v * b4; + t12 += v * b5; + t13 += v * b6; + t14 += v * b7; + t15 += v * b8; + t16 += v * b9; + t17 += v * b10; + t18 += v * b11; + t19 += v * b12; + t20 += v * b13; + t21 += v * b14; + t22 += v * b15; + v = a[8]; + t8 += v * b0; + t9 += v * b1; + t10 += v * b2; + t11 += v * b3; + t12 += v * b4; + t13 += v * b5; + t14 += v * b6; + t15 += v * b7; + t16 += v * b8; + t17 += v * b9; + t18 += v * b10; + t19 += v * b11; + t20 += v * b12; + t21 += v * b13; + t22 += v * b14; + t23 += v * b15; + v = a[9]; + t9 += v * b0; + t10 += v * b1; + t11 += v * b2; + t12 += v * b3; + t13 += v * b4; + t14 += v * b5; + t15 += v * b6; + t16 += v * b7; + t17 += v * b8; + t18 += v * b9; + t19 += v * b10; + t20 += v * b11; + t21 += v * b12; + t22 += v * b13; + t23 += v * b14; + t24 += v * b15; + v = a[10]; + t10 += v * b0; + t11 += v * b1; + t12 += v * b2; + t13 += v * b3; + t14 += v * b4; + t15 += v * b5; + t16 += v * b6; + t17 += v * b7; + t18 += v * b8; + t19 += v * b9; + t20 += v * b10; + t21 += v * b11; + t22 += v * b12; + t23 += v * b13; + t24 += v * b14; + t25 += v * b15; + v = a[11]; + t11 += v * b0; + t12 += v * b1; + t13 += v * b2; + t14 += v * b3; + t15 += v * b4; + t16 += v * b5; + t17 += v * b6; + t18 += v * b7; + t19 += v * b8; + t20 += v * b9; + t21 += v * b10; + t22 += v * b11; + t23 += v * b12; + t24 += v * b13; + t25 += v * b14; + t26 += v * b15; + v = a[12]; + t12 += v * b0; + t13 += v * b1; + t14 += v * b2; + t15 += v * b3; + t16 += v * b4; + t17 += v * b5; + t18 += v * b6; + t19 += v * b7; + t20 += v * b8; + t21 += v * b9; + t22 += v * b10; + t23 += v * b11; + t24 += v * b12; + t25 += v * b13; + t26 += v * b14; + t27 += v * b15; + v = a[13]; + t13 += v * b0; + t14 += v * b1; + t15 += v * b2; + t16 += v * b3; + t17 += v * b4; + t18 += v * b5; + t19 += v * b6; + t20 += v * b7; + t21 += v * b8; + t22 += v * b9; + t23 += v * b10; + t24 += v * b11; + t25 += v * b12; + t26 += v * b13; + t27 += v * b14; + t28 += v * b15; + v = a[14]; + t14 += v * b0; + t15 += v * b1; + t16 += v * b2; + t17 += v * b3; + t18 += v * b4; + t19 += v * b5; + t20 += v * b6; + t21 += v * b7; + t22 += v * b8; + t23 += v * b9; + t24 += v * b10; + t25 += v * b11; + t26 += v * b12; + t27 += v * b13; + t28 += v * b14; + t29 += v * b15; + v = a[15]; + t15 += v * b0; + t16 += v * b1; + t17 += v * b2; + t18 += v * b3; + t19 += v * b4; + t20 += v * b5; + t21 += v * b6; + t22 += v * b7; + t23 += v * b8; + t24 += v * b9; + t25 += v * b10; + t26 += v * b11; + t27 += v * b12; + t28 += v * b13; + t29 += v * b14; + t30 += v * b15; + t0 += 38 * t16; + t1 += 38 * t17; + t2 += 38 * t18; + t3 += 38 * t19; + t4 += 38 * t20; + t5 += 38 * t21; + t6 += 38 * t22; + t7 += 38 * t23; + t8 += 38 * t24; + t9 += 38 * t25; + t10 += 38 * t26; + t11 += 38 * t27; + t12 += 38 * t28; + t13 += 38 * t29; + t14 += 38 * t30; + c = 1; + v = t0 + c + 65535; + c = Math.floor(v / 65536); + t0 = v - c * 65536; + v = t1 + c + 65535; + c = Math.floor(v / 65536); + t1 = v - c * 65536; + v = t2 + c + 65535; + c = Math.floor(v / 65536); + t2 = v - c * 65536; + v = t3 + c + 65535; + c = Math.floor(v / 65536); + t3 = v - c * 65536; + v = t4 + c + 65535; + c = Math.floor(v / 65536); + t4 = v - c * 65536; + v = t5 + c + 65535; + c = Math.floor(v / 65536); + t5 = v - c * 65536; + v = t6 + c + 65535; + c = Math.floor(v / 65536); + t6 = v - c * 65536; + v = t7 + c + 65535; + c = Math.floor(v / 65536); + t7 = v - c * 65536; + v = t8 + c + 65535; + c = Math.floor(v / 65536); + t8 = v - c * 65536; + v = t9 + c + 65535; + c = Math.floor(v / 65536); + t9 = v - c * 65536; + v = t10 + c + 65535; + c = Math.floor(v / 65536); + t10 = v - c * 65536; + v = t11 + c + 65535; + c = Math.floor(v / 65536); + t11 = v - c * 65536; + v = t12 + c + 65535; + c = Math.floor(v / 65536); + t12 = v - c * 65536; + v = t13 + c + 65535; + c = Math.floor(v / 65536); + t13 = v - c * 65536; + v = t14 + c + 65535; + c = Math.floor(v / 65536); + t14 = v - c * 65536; + v = t15 + c + 65535; + c = Math.floor(v / 65536); + t15 = v - c * 65536; + t0 += c - 1 + 37 * (c - 1); + c = 1; + v = t0 + c + 65535; + c = Math.floor(v / 65536); + t0 = v - c * 65536; + v = t1 + c + 65535; + c = Math.floor(v / 65536); + t1 = v - c * 65536; + v = t2 + c + 65535; + c = Math.floor(v / 65536); + t2 = v - c * 65536; + v = t3 + c + 65535; + c = Math.floor(v / 65536); + t3 = v - c * 65536; + v = t4 + c + 65535; + c = Math.floor(v / 65536); + t4 = v - c * 65536; + v = t5 + c + 65535; + c = Math.floor(v / 65536); + t5 = v - c * 65536; + v = t6 + c + 65535; + c = Math.floor(v / 65536); + t6 = v - c * 65536; + v = t7 + c + 65535; + c = Math.floor(v / 65536); + t7 = v - c * 65536; + v = t8 + c + 65535; + c = Math.floor(v / 65536); + t8 = v - c * 65536; + v = t9 + c + 65535; + c = Math.floor(v / 65536); + t9 = v - c * 65536; + v = t10 + c + 65535; + c = Math.floor(v / 65536); + t10 = v - c * 65536; + v = t11 + c + 65535; + c = Math.floor(v / 65536); + t11 = v - c * 65536; + v = t12 + c + 65535; + c = Math.floor(v / 65536); + t12 = v - c * 65536; + v = t13 + c + 65535; + c = Math.floor(v / 65536); + t13 = v - c * 65536; + v = t14 + c + 65535; + c = Math.floor(v / 65536); + t14 = v - c * 65536; + v = t15 + c + 65535; + c = Math.floor(v / 65536); + t15 = v - c * 65536; + t0 += c - 1 + 37 * (c - 1); + o[0] = t0; + o[1] = t1; + o[2] = t2; + o[3] = t3; + o[4] = t4; + o[5] = t5; + o[6] = t6; + o[7] = t7; + o[8] = t8; + o[9] = t9; + o[10] = t10; + o[11] = t11; + o[12] = t12; + o[13] = t13; + o[14] = t14; + o[15] = t15; + } + function S(o, a) { + M(o, a, a); + } + function inv25519(o, i) { + var c = gf(); + var a; + for (a = 0; a < 16; a++) + c[a] = i[a]; + for (a = 253; a >= 0; a--) { + S(c, c); + if (a !== 2 && a !== 4) + M(c, c, i); + } + for (a = 0; a < 16; a++) + o[a] = c[a]; + } + function pow2523(o, i) { + var c = gf(); + var a; + for (a = 0; a < 16; a++) + c[a] = i[a]; + for (a = 250; a >= 0; a--) { + S(c, c); + if (a !== 1) + M(c, c, i); + } + for (a = 0; a < 16; a++) + o[a] = c[a]; + } + function crypto_scalarmult(q, n, p) { + var z = new Uint8Array(32); + var x = new Float64Array(80), r, i; + var a = gf(), b = gf(), c = gf(), d = gf(), e = gf(), f = gf(); + for (i = 0; i < 31; i++) + z[i] = n[i]; + z[31] = n[31] & 127 | 64; + z[0] &= 248; + unpack25519(x, p); + for (i = 0; i < 16; i++) { + b[i] = x[i]; + d[i] = a[i] = c[i] = 0; + } + a[0] = d[0] = 1; + for (i = 254; i >= 0; --i) { + r = z[i >>> 3] >>> (i & 7) & 1; + sel25519(a, b, r); + sel25519(c, d, r); + A(e, a, c); + Z(a, a, c); + A(c, b, d); + Z(b, b, d); + S(d, e); + S(f, a); + M(a, c, a); + M(c, b, e); + A(e, a, c); + Z(a, a, c); + S(b, a); + Z(c, d, f); + M(a, c, _121665); + A(a, a, d); + M(c, c, a); + M(a, d, f); + M(d, b, x); + S(b, e); + sel25519(a, b, r); + sel25519(c, d, r); + } + for (i = 0; i < 16; i++) { + x[i + 16] = a[i]; + x[i + 32] = c[i]; + x[i + 48] = b[i]; + x[i + 64] = d[i]; + } + var x32 = x.subarray(32); + var x16 = x.subarray(16); + inv25519(x32, x32); + M(x16, x16, x32); + pack25519(q, x16); + return 0; + } + function crypto_scalarmult_base(q, n) { + return crypto_scalarmult(q, n, _9); + } + function crypto_box_keypair(y, x) { + randombytes(x, 32); + return crypto_scalarmult_base(y, x); + } + function crypto_box_beforenm(k, y, x) { + var s = new Uint8Array(32); + crypto_scalarmult(s, x, y); + return crypto_core_hsalsa20(k, _0, s, sigma); + } + var crypto_box_afternm = crypto_secretbox; + var crypto_box_open_afternm = crypto_secretbox_open; + function crypto_box(c, m, d, n, y, x) { + var k = new Uint8Array(32); + crypto_box_beforenm(k, y, x); + return crypto_box_afternm(c, m, d, n, k); + } + function crypto_box_open(m, c, d, n, y, x) { + var k = new Uint8Array(32); + crypto_box_beforenm(k, y, x); + return crypto_box_open_afternm(m, c, d, n, k); + } + var K = [ + 1116352408, + 3609767458, + 1899447441, + 602891725, + 3049323471, + 3964484399, + 3921009573, + 2173295548, + 961987163, + 4081628472, + 1508970993, + 3053834265, + 2453635748, + 2937671579, + 2870763221, + 3664609560, + 3624381080, + 2734883394, + 310598401, + 1164996542, + 607225278, + 1323610764, + 1426881987, + 3590304994, + 1925078388, + 4068182383, + 2162078206, + 991336113, + 2614888103, + 633803317, + 3248222580, + 3479774868, + 3835390401, + 2666613458, + 4022224774, + 944711139, + 264347078, + 2341262773, + 604807628, + 2007800933, + 770255983, + 1495990901, + 1249150122, + 1856431235, + 1555081692, + 3175218132, + 1996064986, + 2198950837, + 2554220882, + 3999719339, + 2821834349, + 766784016, + 2952996808, + 2566594879, + 3210313671, + 3203337956, + 3336571891, + 1034457026, + 3584528711, + 2466948901, + 113926993, + 3758326383, + 338241895, + 168717936, + 666307205, + 1188179964, + 773529912, + 1546045734, + 1294757372, + 1522805485, + 1396182291, + 2643833823, + 1695183700, + 2343527390, + 1986661051, + 1014477480, + 2177026350, + 1206759142, + 2456956037, + 344077627, + 2730485921, + 1290863460, + 2820302411, + 3158454273, + 3259730800, + 3505952657, + 3345764771, + 106217008, + 3516065817, + 3606008344, + 3600352804, + 1432725776, + 4094571909, + 1467031594, + 275423344, + 851169720, + 430227734, + 3100823752, + 506948616, + 1363258195, + 659060556, + 3750685593, + 883997877, + 3785050280, + 958139571, + 3318307427, + 1322822218, + 3812723403, + 1537002063, + 2003034995, + 1747873779, + 3602036899, + 1955562222, + 1575990012, + 2024104815, + 1125592928, + 2227730452, + 2716904306, + 2361852424, + 442776044, + 2428436474, + 593698344, + 2756734187, + 3733110249, + 3204031479, + 2999351573, + 3329325298, + 3815920427, + 3391569614, + 3928383900, + 3515267271, + 566280711, + 3940187606, + 3454069534, + 4118630271, + 4000239992, + 116418474, + 1914138554, + 174292421, + 2731055270, + 289380356, + 3203993006, + 460393269, + 320620315, + 685471733, + 587496836, + 852142971, + 1086792851, + 1017036298, + 365543100, + 1126000580, + 2618297676, + 1288033470, + 3409855158, + 1501505948, + 4234509866, + 1607167915, + 987167468, + 1816402316, + 1246189591 + ]; + function crypto_hashblocks_hl(hh, hl, m, n) { + var wh = new Int32Array(16), wl = new Int32Array(16), bh0, bh1, bh2, bh3, bh4, bh5, bh6, bh7, bl0, bl1, bl2, bl3, bl4, bl5, bl6, bl7, th, tl, i, j, h, l, a, b, c, d; + var ah0 = hh[0], ah1 = hh[1], ah2 = hh[2], ah3 = hh[3], ah4 = hh[4], ah5 = hh[5], ah6 = hh[6], ah7 = hh[7], al0 = hl[0], al1 = hl[1], al2 = hl[2], al3 = hl[3], al4 = hl[4], al5 = hl[5], al6 = hl[6], al7 = hl[7]; + var pos = 0; + while (n >= 128) { + for (i = 0; i < 16; i++) { + j = 8 * i + pos; + wh[i] = m[j + 0] << 24 | m[j + 1] << 16 | m[j + 2] << 8 | m[j + 3]; + wl[i] = m[j + 4] << 24 | m[j + 5] << 16 | m[j + 6] << 8 | m[j + 7]; + } + for (i = 0; i < 80; i++) { + bh0 = ah0; + bh1 = ah1; + bh2 = ah2; + bh3 = ah3; + bh4 = ah4; + bh5 = ah5; + bh6 = ah6; + bh7 = ah7; + bl0 = al0; + bl1 = al1; + bl2 = al2; + bl3 = al3; + bl4 = al4; + bl5 = al5; + bl6 = al6; + bl7 = al7; + h = ah7; + l = al7; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = (ah4 >>> 14 | al4 << 32 - 14) ^ (ah4 >>> 18 | al4 << 32 - 18) ^ (al4 >>> 41 - 32 | ah4 << 32 - (41 - 32)); + l = (al4 >>> 14 | ah4 << 32 - 14) ^ (al4 >>> 18 | ah4 << 32 - 18) ^ (ah4 >>> 41 - 32 | al4 << 32 - (41 - 32)); + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + h = ah4 & ah5 ^ ~ah4 & ah6; + l = al4 & al5 ^ ~al4 & al6; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + h = K[i * 2]; + l = K[i * 2 + 1]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + h = wh[i % 16]; + l = wl[i % 16]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + th = c & 65535 | d << 16; + tl = a & 65535 | b << 16; + h = th; + l = tl; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = (ah0 >>> 28 | al0 << 32 - 28) ^ (al0 >>> 34 - 32 | ah0 << 32 - (34 - 32)) ^ (al0 >>> 39 - 32 | ah0 << 32 - (39 - 32)); + l = (al0 >>> 28 | ah0 << 32 - 28) ^ (ah0 >>> 34 - 32 | al0 << 32 - (34 - 32)) ^ (ah0 >>> 39 - 32 | al0 << 32 - (39 - 32)); + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + h = ah0 & ah1 ^ ah0 & ah2 ^ ah1 & ah2; + l = al0 & al1 ^ al0 & al2 ^ al1 & al2; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + bh7 = c & 65535 | d << 16; + bl7 = a & 65535 | b << 16; + h = bh3; + l = bl3; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = th; + l = tl; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + bh3 = c & 65535 | d << 16; + bl3 = a & 65535 | b << 16; + ah1 = bh0; + ah2 = bh1; + ah3 = bh2; + ah4 = bh3; + ah5 = bh4; + ah6 = bh5; + ah7 = bh6; + ah0 = bh7; + al1 = bl0; + al2 = bl1; + al3 = bl2; + al4 = bl3; + al5 = bl4; + al6 = bl5; + al7 = bl6; + al0 = bl7; + if (i % 16 === 15) { + for (j = 0; j < 16; j++) { + h = wh[j]; + l = wl[j]; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = wh[(j + 9) % 16]; + l = wl[(j + 9) % 16]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + th = wh[(j + 1) % 16]; + tl = wl[(j + 1) % 16]; + h = (th >>> 1 | tl << 32 - 1) ^ (th >>> 8 | tl << 32 - 8) ^ th >>> 7; + l = (tl >>> 1 | th << 32 - 1) ^ (tl >>> 8 | th << 32 - 8) ^ (tl >>> 7 | th << 32 - 7); + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + th = wh[(j + 14) % 16]; + tl = wl[(j + 14) % 16]; + h = (th >>> 19 | tl << 32 - 19) ^ (tl >>> 61 - 32 | th << 32 - (61 - 32)) ^ th >>> 6; + l = (tl >>> 19 | th << 32 - 19) ^ (th >>> 61 - 32 | tl << 32 - (61 - 32)) ^ (tl >>> 6 | th << 32 - 6); + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + wh[j] = c & 65535 | d << 16; + wl[j] = a & 65535 | b << 16; + } + } + } + h = ah0; + l = al0; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = hh[0]; + l = hl[0]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + hh[0] = ah0 = c & 65535 | d << 16; + hl[0] = al0 = a & 65535 | b << 16; + h = ah1; + l = al1; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = hh[1]; + l = hl[1]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + hh[1] = ah1 = c & 65535 | d << 16; + hl[1] = al1 = a & 65535 | b << 16; + h = ah2; + l = al2; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = hh[2]; + l = hl[2]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + hh[2] = ah2 = c & 65535 | d << 16; + hl[2] = al2 = a & 65535 | b << 16; + h = ah3; + l = al3; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = hh[3]; + l = hl[3]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + hh[3] = ah3 = c & 65535 | d << 16; + hl[3] = al3 = a & 65535 | b << 16; + h = ah4; + l = al4; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = hh[4]; + l = hl[4]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + hh[4] = ah4 = c & 65535 | d << 16; + hl[4] = al4 = a & 65535 | b << 16; + h = ah5; + l = al5; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = hh[5]; + l = hl[5]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + hh[5] = ah5 = c & 65535 | d << 16; + hl[5] = al5 = a & 65535 | b << 16; + h = ah6; + l = al6; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = hh[6]; + l = hl[6]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + hh[6] = ah6 = c & 65535 | d << 16; + hl[6] = al6 = a & 65535 | b << 16; + h = ah7; + l = al7; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = hh[7]; + l = hl[7]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + hh[7] = ah7 = c & 65535 | d << 16; + hl[7] = al7 = a & 65535 | b << 16; + pos += 128; + n -= 128; + } + return n; + } + function crypto_hash(out, m, n) { + var hh = new Int32Array(8), hl = new Int32Array(8), x = new Uint8Array(256), i, b = n; + hh[0] = 1779033703; + hh[1] = 3144134277; + hh[2] = 1013904242; + hh[3] = 2773480762; + hh[4] = 1359893119; + hh[5] = 2600822924; + hh[6] = 528734635; + hh[7] = 1541459225; + hl[0] = 4089235720; + hl[1] = 2227873595; + hl[2] = 4271175723; + hl[3] = 1595750129; + hl[4] = 2917565137; + hl[5] = 725511199; + hl[6] = 4215389547; + hl[7] = 327033209; + crypto_hashblocks_hl(hh, hl, m, n); + n %= 128; + for (i = 0; i < n; i++) + x[i] = m[b - n + i]; + x[n] = 128; + n = 256 - 128 * (n < 112 ? 1 : 0); + x[n - 9] = 0; + ts64(x, n - 8, b / 536870912 | 0, b << 3); + crypto_hashblocks_hl(hh, hl, x, n); + for (i = 0; i < 8; i++) + ts64(out, 8 * i, hh[i], hl[i]); + return 0; + } + function add(p, q) { + var a = gf(), b = gf(), c = gf(), d = gf(), e = gf(), f = gf(), g = gf(), h = gf(), t = gf(); + Z(a, p[1], p[0]); + Z(t, q[1], q[0]); + M(a, a, t); + A(b, p[0], p[1]); + A(t, q[0], q[1]); + M(b, b, t); + M(c, p[3], q[3]); + M(c, c, D2); + M(d, p[2], q[2]); + A(d, d, d); + Z(e, b, a); + Z(f, d, c); + A(g, d, c); + A(h, b, a); + M(p[0], e, f); + M(p[1], h, g); + M(p[2], g, f); + M(p[3], e, h); + } + function cswap(p, q, b) { + var i; + for (i = 0; i < 4; i++) { + sel25519(p[i], q[i], b); + } + } + function pack(r, p) { + var tx = gf(), ty = gf(), zi = gf(); + inv25519(zi, p[2]); + M(tx, p[0], zi); + M(ty, p[1], zi); + pack25519(r, ty); + r[31] ^= par25519(tx) << 7; + } + function scalarmult(p, q, s) { + var b, i; + set25519(p[0], gf0); + set25519(p[1], gf1); + set25519(p[2], gf1); + set25519(p[3], gf0); + for (i = 255; i >= 0; --i) { + b = s[i / 8 | 0] >> (i & 7) & 1; + cswap(p, q, b); + add(q, p); + add(p, p); + cswap(p, q, b); + } + } + function scalarbase(p, s) { + var q = [gf(), gf(), gf(), gf()]; + set25519(q[0], X); + set25519(q[1], Y); + set25519(q[2], gf1); + M(q[3], X, Y); + scalarmult(p, q, s); + } + function crypto_sign_keypair(pk, sk, seeded) { + var d = new Uint8Array(64); + var p = [gf(), gf(), gf(), gf()]; + var i; + if (!seeded) + randombytes(sk, 32); + crypto_hash(d, sk, 32); + d[0] &= 248; + d[31] &= 127; + d[31] |= 64; + scalarbase(p, d); + pack(pk, p); + for (i = 0; i < 32; i++) + sk[i + 32] = pk[i]; + return 0; + } + var L2 = new Float64Array([237, 211, 245, 92, 26, 99, 18, 88, 214, 156, 247, 162, 222, 249, 222, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16]); + function modL(r, x) { + var carry, i, j, k; + for (i = 63; i >= 32; --i) { + carry = 0; + for (j = i - 32, k = i - 12; j < k; ++j) { + x[j] += carry - 16 * x[i] * L2[j - (i - 32)]; + carry = Math.floor((x[j] + 128) / 256); + x[j] -= carry * 256; + } + x[j] += carry; + x[i] = 0; + } + carry = 0; + for (j = 0; j < 32; j++) { + x[j] += carry - (x[31] >> 4) * L2[j]; + carry = x[j] >> 8; + x[j] &= 255; + } + for (j = 0; j < 32; j++) + x[j] -= carry * L2[j]; + for (i = 0; i < 32; i++) { + x[i + 1] += x[i] >> 8; + r[i] = x[i] & 255; + } + } + function reduce(r) { + var x = new Float64Array(64), i; + for (i = 0; i < 64; i++) + x[i] = r[i]; + for (i = 0; i < 64; i++) + r[i] = 0; + modL(r, x); + } + function crypto_sign(sm, m, n, sk) { + var d = new Uint8Array(64), h = new Uint8Array(64), r = new Uint8Array(64); + var i, j, x = new Float64Array(64); + var p = [gf(), gf(), gf(), gf()]; + crypto_hash(d, sk, 32); + d[0] &= 248; + d[31] &= 127; + d[31] |= 64; + var smlen = n + 64; + for (i = 0; i < n; i++) + sm[64 + i] = m[i]; + for (i = 0; i < 32; i++) + sm[32 + i] = d[32 + i]; + crypto_hash(r, sm.subarray(32), n + 32); + reduce(r); + scalarbase(p, r); + pack(sm, p); + for (i = 32; i < 64; i++) + sm[i] = sk[i]; + crypto_hash(h, sm, n + 64); + reduce(h); + for (i = 0; i < 64; i++) + x[i] = 0; + for (i = 0; i < 32; i++) + x[i] = r[i]; + for (i = 0; i < 32; i++) { + for (j = 0; j < 32; j++) { + x[i + j] += h[i] * d[j]; + } + } + modL(sm.subarray(32), x); + return smlen; + } + function unpackneg(r, p) { + var t = gf(), chk = gf(), num = gf(), den = gf(), den2 = gf(), den4 = gf(), den6 = gf(); + set25519(r[2], gf1); + unpack25519(r[1], p); + S(num, r[1]); + M(den, num, D); + Z(num, num, r[2]); + A(den, r[2], den); + S(den2, den); + S(den4, den2); + M(den6, den4, den2); + M(t, den6, num); + M(t, t, den); + pow2523(t, t); + M(t, t, num); + M(t, t, den); + M(t, t, den); + M(r[0], t, den); + S(chk, r[0]); + M(chk, chk, den); + if (neq25519(chk, num)) + M(r[0], r[0], I); + S(chk, r[0]); + M(chk, chk, den); + if (neq25519(chk, num)) + return -1; + if (par25519(r[0]) === p[31] >> 7) + Z(r[0], gf0, r[0]); + M(r[3], r[0], r[1]); + return 0; + } + function crypto_sign_open(m, sm, n, pk) { + var i; + var t = new Uint8Array(32), h = new Uint8Array(64); + var p = [gf(), gf(), gf(), gf()], q = [gf(), gf(), gf(), gf()]; + if (n < 64) + return -1; + if (unpackneg(q, pk)) + return -1; + for (i = 0; i < n; i++) + m[i] = sm[i]; + for (i = 0; i < 32; i++) + m[i + 32] = pk[i]; + crypto_hash(h, m, n); + reduce(h); + scalarmult(p, q, h); + scalarbase(q, sm.subarray(32)); + add(p, q); + pack(t, p); + n -= 64; + if (crypto_verify_32(sm, 0, t, 0)) { + for (i = 0; i < n; i++) + m[i] = 0; + return -1; + } + for (i = 0; i < n; i++) + m[i] = sm[i + 64]; + return n; + } + var crypto_secretbox_KEYBYTES = 32, crypto_secretbox_NONCEBYTES = 24, crypto_secretbox_ZEROBYTES = 32, crypto_secretbox_BOXZEROBYTES = 16, crypto_scalarmult_BYTES = 32, crypto_scalarmult_SCALARBYTES = 32, crypto_box_PUBLICKEYBYTES = 32, crypto_box_SECRETKEYBYTES = 32, crypto_box_BEFORENMBYTES = 32, crypto_box_NONCEBYTES = crypto_secretbox_NONCEBYTES, crypto_box_ZEROBYTES = crypto_secretbox_ZEROBYTES, crypto_box_BOXZEROBYTES = crypto_secretbox_BOXZEROBYTES, crypto_sign_BYTES = 64, crypto_sign_PUBLICKEYBYTES = 32, crypto_sign_SECRETKEYBYTES = 64, crypto_sign_SEEDBYTES = 32, crypto_hash_BYTES = 64; + nacl2.lowlevel = { + crypto_core_hsalsa20, + crypto_stream_xor, + crypto_stream, + crypto_stream_salsa20_xor, + crypto_stream_salsa20, + crypto_onetimeauth, + crypto_onetimeauth_verify, + crypto_verify_16, + crypto_verify_32, + crypto_secretbox, + crypto_secretbox_open, + crypto_scalarmult, + crypto_scalarmult_base, + crypto_box_beforenm, + crypto_box_afternm, + crypto_box, + crypto_box_open, + crypto_box_keypair, + crypto_hash, + crypto_sign, + crypto_sign_keypair, + crypto_sign_open, + crypto_secretbox_KEYBYTES, + crypto_secretbox_NONCEBYTES, + crypto_secretbox_ZEROBYTES, + crypto_secretbox_BOXZEROBYTES, + crypto_scalarmult_BYTES, + crypto_scalarmult_SCALARBYTES, + crypto_box_PUBLICKEYBYTES, + crypto_box_SECRETKEYBYTES, + crypto_box_BEFORENMBYTES, + crypto_box_NONCEBYTES, + crypto_box_ZEROBYTES, + crypto_box_BOXZEROBYTES, + crypto_sign_BYTES, + crypto_sign_PUBLICKEYBYTES, + crypto_sign_SECRETKEYBYTES, + crypto_sign_SEEDBYTES, + crypto_hash_BYTES, + gf, + D, + L: L2, + pack25519, + unpack25519, + M, + A, + S, + Z, + pow2523, + add, + set25519, + modL, + scalarmult, + scalarbase + }; + function checkLengths(k, n) { + if (k.length !== crypto_secretbox_KEYBYTES) + throw new Error("bad key size"); + if (n.length !== crypto_secretbox_NONCEBYTES) + throw new Error("bad nonce size"); + } + function checkBoxLengths(pk, sk) { + if (pk.length !== crypto_box_PUBLICKEYBYTES) + throw new Error("bad public key size"); + if (sk.length !== crypto_box_SECRETKEYBYTES) + throw new Error("bad secret key size"); + } + function checkArrayTypes() { + for (var i = 0; i < arguments.length; i++) { + if (!(arguments[i] instanceof Uint8Array)) + throw new TypeError("unexpected type, use Uint8Array"); + } + } + function cleanup(arr) { + for (var i = 0; i < arr.length; i++) + arr[i] = 0; + } + nacl2.randomBytes = function(n) { + var b = new Uint8Array(n); + randombytes(b, n); + return b; + }; + nacl2.secretbox = function(msg, nonce, key) { + checkArrayTypes(msg, nonce, key); + checkLengths(key, nonce); + var m = new Uint8Array(crypto_secretbox_ZEROBYTES + msg.length); + var c = new Uint8Array(m.length); + for (var i = 0; i < msg.length; i++) + m[i + crypto_secretbox_ZEROBYTES] = msg[i]; + crypto_secretbox(c, m, m.length, nonce, key); + return c.subarray(crypto_secretbox_BOXZEROBYTES); + }; + nacl2.secretbox.open = function(box, nonce, key) { + checkArrayTypes(box, nonce, key); + checkLengths(key, nonce); + var c = new Uint8Array(crypto_secretbox_BOXZEROBYTES + box.length); + var m = new Uint8Array(c.length); + for (var i = 0; i < box.length; i++) + c[i + crypto_secretbox_BOXZEROBYTES] = box[i]; + if (c.length < 32) + return null; + if (crypto_secretbox_open(m, c, c.length, nonce, key) !== 0) + return null; + return m.subarray(crypto_secretbox_ZEROBYTES); + }; + nacl2.secretbox.keyLength = crypto_secretbox_KEYBYTES; + nacl2.secretbox.nonceLength = crypto_secretbox_NONCEBYTES; + nacl2.secretbox.overheadLength = crypto_secretbox_BOXZEROBYTES; + nacl2.scalarMult = function(n, p) { + checkArrayTypes(n, p); + if (n.length !== crypto_scalarmult_SCALARBYTES) + throw new Error("bad n size"); + if (p.length !== crypto_scalarmult_BYTES) + throw new Error("bad p size"); + var q = new Uint8Array(crypto_scalarmult_BYTES); + crypto_scalarmult(q, n, p); + return q; + }; + nacl2.scalarMult.base = function(n) { + checkArrayTypes(n); + if (n.length !== crypto_scalarmult_SCALARBYTES) + throw new Error("bad n size"); + var q = new Uint8Array(crypto_scalarmult_BYTES); + crypto_scalarmult_base(q, n); + return q; + }; + nacl2.scalarMult.scalarLength = crypto_scalarmult_SCALARBYTES; + nacl2.scalarMult.groupElementLength = crypto_scalarmult_BYTES; + nacl2.box = function(msg, nonce, publicKey, secretKey) { + var k = nacl2.box.before(publicKey, secretKey); + return nacl2.secretbox(msg, nonce, k); + }; + nacl2.box.before = function(publicKey, secretKey) { + checkArrayTypes(publicKey, secretKey); + checkBoxLengths(publicKey, secretKey); + var k = new Uint8Array(crypto_box_BEFORENMBYTES); + crypto_box_beforenm(k, publicKey, secretKey); + return k; + }; + nacl2.box.after = nacl2.secretbox; + nacl2.box.open = function(msg, nonce, publicKey, secretKey) { + var k = nacl2.box.before(publicKey, secretKey); + return nacl2.secretbox.open(msg, nonce, k); + }; + nacl2.box.open.after = nacl2.secretbox.open; + nacl2.box.keyPair = function() { + var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES); + var sk = new Uint8Array(crypto_box_SECRETKEYBYTES); + crypto_box_keypair(pk, sk); + return { publicKey: pk, secretKey: sk }; + }; + nacl2.box.keyPair.fromSecretKey = function(secretKey) { + checkArrayTypes(secretKey); + if (secretKey.length !== crypto_box_SECRETKEYBYTES) + throw new Error("bad secret key size"); + var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES); + crypto_scalarmult_base(pk, secretKey); + return { publicKey: pk, secretKey: new Uint8Array(secretKey) }; + }; + nacl2.box.publicKeyLength = crypto_box_PUBLICKEYBYTES; + nacl2.box.secretKeyLength = crypto_box_SECRETKEYBYTES; + nacl2.box.sharedKeyLength = crypto_box_BEFORENMBYTES; + nacl2.box.nonceLength = crypto_box_NONCEBYTES; + nacl2.box.overheadLength = nacl2.secretbox.overheadLength; + nacl2.sign = function(msg, secretKey) { + checkArrayTypes(msg, secretKey); + if (secretKey.length !== crypto_sign_SECRETKEYBYTES) + throw new Error("bad secret key size"); + var signedMsg = new Uint8Array(crypto_sign_BYTES + msg.length); + crypto_sign(signedMsg, msg, msg.length, secretKey); + return signedMsg; + }; + nacl2.sign.open = function(signedMsg, publicKey) { + checkArrayTypes(signedMsg, publicKey); + if (publicKey.length !== crypto_sign_PUBLICKEYBYTES) + throw new Error("bad public key size"); + var tmp = new Uint8Array(signedMsg.length); + var mlen = crypto_sign_open(tmp, signedMsg, signedMsg.length, publicKey); + if (mlen < 0) + return null; + var m = new Uint8Array(mlen); + for (var i = 0; i < m.length; i++) + m[i] = tmp[i]; + return m; + }; + nacl2.sign.detached = function(msg, secretKey) { + var signedMsg = nacl2.sign(msg, secretKey); + var sig = new Uint8Array(crypto_sign_BYTES); + for (var i = 0; i < sig.length; i++) + sig[i] = signedMsg[i]; + return sig; + }; + nacl2.sign.detached.verify = function(msg, sig, publicKey) { + checkArrayTypes(msg, sig, publicKey); + if (sig.length !== crypto_sign_BYTES) + throw new Error("bad signature size"); + if (publicKey.length !== crypto_sign_PUBLICKEYBYTES) + throw new Error("bad public key size"); + var sm = new Uint8Array(crypto_sign_BYTES + msg.length); + var m = new Uint8Array(crypto_sign_BYTES + msg.length); + var i; + for (i = 0; i < crypto_sign_BYTES; i++) + sm[i] = sig[i]; + for (i = 0; i < msg.length; i++) + sm[i + crypto_sign_BYTES] = msg[i]; + return crypto_sign_open(m, sm, sm.length, publicKey) >= 0; + }; + nacl2.sign.keyPair = function() { + var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES); + var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES); + crypto_sign_keypair(pk, sk); + return { publicKey: pk, secretKey: sk }; + }; + nacl2.sign.keyPair.fromSecretKey = function(secretKey) { + checkArrayTypes(secretKey); + if (secretKey.length !== crypto_sign_SECRETKEYBYTES) + throw new Error("bad secret key size"); + var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES); + for (var i = 0; i < pk.length; i++) + pk[i] = secretKey[32 + i]; + return { publicKey: pk, secretKey: new Uint8Array(secretKey) }; + }; + nacl2.sign.keyPair.fromSeed = function(seed) { + checkArrayTypes(seed); + if (seed.length !== crypto_sign_SEEDBYTES) + throw new Error("bad seed size"); + var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES); + var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES); + for (var i = 0; i < 32; i++) + sk[i] = seed[i]; + crypto_sign_keypair(pk, sk, true); + return { publicKey: pk, secretKey: sk }; + }; + nacl2.sign.publicKeyLength = crypto_sign_PUBLICKEYBYTES; + nacl2.sign.secretKeyLength = crypto_sign_SECRETKEYBYTES; + nacl2.sign.seedLength = crypto_sign_SEEDBYTES; + nacl2.sign.signatureLength = crypto_sign_BYTES; + nacl2.hash = function(msg) { + checkArrayTypes(msg); + var h = new Uint8Array(crypto_hash_BYTES); + crypto_hash(h, msg, msg.length); + return h; + }; + nacl2.hash.hashLength = crypto_hash_BYTES; + nacl2.verify = function(x, y) { + checkArrayTypes(x, y); + if (x.length === 0 || y.length === 0) + return false; + if (x.length !== y.length) + return false; + return vn(x, 0, y, 0, x.length) === 0 ? true : false; + }; + nacl2.setPRNG = function(fn) { + randombytes = fn; + }; + (function() { + var crypto2 = typeof self !== "undefined" ? self.crypto || self.msCrypto : null; + if (crypto2 && crypto2.getRandomValues) { + var QUOTA = 65536; + nacl2.setPRNG(function(x, n) { + var i, v = new Uint8Array(n); + for (i = 0; i < n; i += QUOTA) { + crypto2.getRandomValues(v.subarray(i, i + Math.min(n - i, QUOTA))); + } + for (i = 0; i < n; i++) + x[i] = v[i]; + cleanup(v); + }); + } else if (typeof __require !== "undefined") { + crypto2 = require_crypto(); + if (crypto2 && crypto2.randomBytes) { + nacl2.setPRNG(function(x, n) { + var i, v = crypto2.randomBytes(n); + for (i = 0; i < n; i++) + x[i] = v[i]; + cleanup(v); + }); + } + } + })(); + })(typeof module !== "undefined" && module.exports ? module.exports : self.nacl = self.nacl || {}); + } + }); + + // node_modules/scrypt-async/scrypt-async.js + var require_scrypt_async = __commonJS({ + "node_modules/scrypt-async/scrypt-async.js"(exports, module) { + function scrypt2(password, salt, logN, r, dkLen, interruptStep, callback, encoding) { + "use strict"; + function SHA256(m) { + var K = [ + 1116352408, + 1899447441, + 3049323471, + 3921009573, + 961987163, + 1508970993, + 2453635748, + 2870763221, + 3624381080, + 310598401, + 607225278, + 1426881987, + 1925078388, + 2162078206, + 2614888103, + 3248222580, + 3835390401, + 4022224774, + 264347078, + 604807628, + 770255983, + 1249150122, + 1555081692, + 1996064986, + 2554220882, + 2821834349, + 2952996808, + 3210313671, + 3336571891, + 3584528711, + 113926993, + 338241895, + 666307205, + 773529912, + 1294757372, + 1396182291, + 1695183700, + 1986661051, + 2177026350, + 2456956037, + 2730485921, + 2820302411, + 3259730800, + 3345764771, + 3516065817, + 3600352804, + 4094571909, + 275423344, + 430227734, + 506948616, + 659060556, + 883997877, + 958139571, + 1322822218, + 1537002063, + 1747873779, + 1955562222, + 2024104815, + 2227730452, + 2361852424, + 2428436474, + 2756734187, + 3204031479, + 3329325298 + ]; + var h0 = 1779033703, h1 = 3144134277, h2 = 1013904242, h3 = 2773480762, h4 = 1359893119, h5 = 2600822924, h6 = 528734635, h7 = 1541459225, w = new Array(64); + function blocks(p3) { + var off = 0, len = p3.length; + while (len >= 64) { + var a = h0, b = h1, c = h2, d = h3, e = h4, f = h5, g = h6, h = h7, u, i2, j, t1, t2; + for (i2 = 0; i2 < 16; i2++) { + j = off + i2 * 4; + w[i2] = (p3[j] & 255) << 24 | (p3[j + 1] & 255) << 16 | (p3[j + 2] & 255) << 8 | p3[j + 3] & 255; + } + for (i2 = 16; i2 < 64; i2++) { + u = w[i2 - 2]; + t1 = (u >>> 17 | u << 32 - 17) ^ (u >>> 19 | u << 32 - 19) ^ u >>> 10; + u = w[i2 - 15]; + t2 = (u >>> 7 | u << 32 - 7) ^ (u >>> 18 | u << 32 - 18) ^ u >>> 3; + w[i2] = (t1 + w[i2 - 7] | 0) + (t2 + w[i2 - 16] | 0) | 0; + } + for (i2 = 0; i2 < 64; i2++) { + t1 = (((e >>> 6 | e << 32 - 6) ^ (e >>> 11 | e << 32 - 11) ^ (e >>> 25 | e << 32 - 25)) + (e & f ^ ~e & g) | 0) + (h + (K[i2] + w[i2] | 0) | 0) | 0; + t2 = ((a >>> 2 | a << 32 - 2) ^ (a >>> 13 | a << 32 - 13) ^ (a >>> 22 | a << 32 - 22)) + (a & b ^ a & c ^ b & c) | 0; + h = g; + g = f; + f = e; + e = d + t1 | 0; + d = c; + c = b; + b = a; + a = t1 + t2 | 0; + } + h0 = h0 + a | 0; + h1 = h1 + b | 0; + h2 = h2 + c | 0; + h3 = h3 + d | 0; + h4 = h4 + e | 0; + h5 = h5 + f | 0; + h6 = h6 + g | 0; + h7 = h7 + h | 0; + off += 64; + len -= 64; + } + } + blocks(m); + var i, bytesLeft = m.length % 64, bitLenHi = m.length / 536870912 | 0, bitLenLo = m.length << 3, numZeros = bytesLeft < 56 ? 56 : 120, p2 = m.slice(m.length - bytesLeft, m.length); + p2.push(128); + for (i = bytesLeft + 1; i < numZeros; i++) + p2.push(0); + p2.push(bitLenHi >>> 24 & 255); + p2.push(bitLenHi >>> 16 & 255); + p2.push(bitLenHi >>> 8 & 255); + p2.push(bitLenHi >>> 0 & 255); + p2.push(bitLenLo >>> 24 & 255); + p2.push(bitLenLo >>> 16 & 255); + p2.push(bitLenLo >>> 8 & 255); + p2.push(bitLenLo >>> 0 & 255); + blocks(p2); + return [ + h0 >>> 24 & 255, + h0 >>> 16 & 255, + h0 >>> 8 & 255, + h0 >>> 0 & 255, + h1 >>> 24 & 255, + h1 >>> 16 & 255, + h1 >>> 8 & 255, + h1 >>> 0 & 255, + h2 >>> 24 & 255, + h2 >>> 16 & 255, + h2 >>> 8 & 255, + h2 >>> 0 & 255, + h3 >>> 24 & 255, + h3 >>> 16 & 255, + h3 >>> 8 & 255, + h3 >>> 0 & 255, + h4 >>> 24 & 255, + h4 >>> 16 & 255, + h4 >>> 8 & 255, + h4 >>> 0 & 255, + h5 >>> 24 & 255, + h5 >>> 16 & 255, + h5 >>> 8 & 255, + h5 >>> 0 & 255, + h6 >>> 24 & 255, + h6 >>> 16 & 255, + h6 >>> 8 & 255, + h6 >>> 0 & 255, + h7 >>> 24 & 255, + h7 >>> 16 & 255, + h7 >>> 8 & 255, + h7 >>> 0 & 255 + ]; + } + function PBKDF2_HMAC_SHA256_OneIter(password2, salt2, dkLen2) { + if (password2.length > 64) { + password2 = SHA256(password2.push ? password2 : Array.prototype.slice.call(password2, 0)); + } + var i, innerLen = 64 + salt2.length + 4, inner = new Array(innerLen), outerKey = new Array(64), dk = []; + for (i = 0; i < 64; i++) + inner[i] = 54; + for (i = 0; i < password2.length; i++) + inner[i] ^= password2[i]; + for (i = 0; i < salt2.length; i++) + inner[64 + i] = salt2[i]; + for (i = innerLen - 4; i < innerLen; i++) + inner[i] = 0; + for (i = 0; i < 64; i++) + outerKey[i] = 92; + for (i = 0; i < password2.length; i++) + outerKey[i] ^= password2[i]; + function incrementCounter() { + for (var i2 = innerLen - 1; i2 >= innerLen - 4; i2--) { + inner[i2]++; + if (inner[i2] <= 255) + return; + inner[i2] = 0; + } + } + while (dkLen2 >= 32) { + incrementCounter(); + dk = dk.concat(SHA256(outerKey.concat(SHA256(inner)))); + dkLen2 -= 32; + } + if (dkLen2 > 0) { + incrementCounter(); + dk = dk.concat(SHA256(outerKey.concat(SHA256(inner))).slice(0, dkLen2)); + } + return dk; + } + function salsaXOR(tmp2, B2, bin, bout) { + var j0 = tmp2[0] ^ B2[bin++], j1 = tmp2[1] ^ B2[bin++], j2 = tmp2[2] ^ B2[bin++], j3 = tmp2[3] ^ B2[bin++], j4 = tmp2[4] ^ B2[bin++], j5 = tmp2[5] ^ B2[bin++], j6 = tmp2[6] ^ B2[bin++], j7 = tmp2[7] ^ B2[bin++], j8 = tmp2[8] ^ B2[bin++], j9 = tmp2[9] ^ B2[bin++], j10 = tmp2[10] ^ B2[bin++], j11 = tmp2[11] ^ B2[bin++], j12 = tmp2[12] ^ B2[bin++], j13 = tmp2[13] ^ B2[bin++], j14 = tmp2[14] ^ B2[bin++], j15 = tmp2[15] ^ B2[bin++], u, i; + var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7, x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14, x15 = j15; + for (i = 0; i < 8; i += 2) { + u = x0 + x12; + x4 ^= u << 7 | u >>> 32 - 7; + u = x4 + x0; + x8 ^= u << 9 | u >>> 32 - 9; + u = x8 + x4; + x12 ^= u << 13 | u >>> 32 - 13; + u = x12 + x8; + x0 ^= u << 18 | u >>> 32 - 18; + u = x5 + x1; + x9 ^= u << 7 | u >>> 32 - 7; + u = x9 + x5; + x13 ^= u << 9 | u >>> 32 - 9; + u = x13 + x9; + x1 ^= u << 13 | u >>> 32 - 13; + u = x1 + x13; + x5 ^= u << 18 | u >>> 32 - 18; + u = x10 + x6; + x14 ^= u << 7 | u >>> 32 - 7; + u = x14 + x10; + x2 ^= u << 9 | u >>> 32 - 9; + u = x2 + x14; + x6 ^= u << 13 | u >>> 32 - 13; + u = x6 + x2; + x10 ^= u << 18 | u >>> 32 - 18; + u = x15 + x11; + x3 ^= u << 7 | u >>> 32 - 7; + u = x3 + x15; + x7 ^= u << 9 | u >>> 32 - 9; + u = x7 + x3; + x11 ^= u << 13 | u >>> 32 - 13; + u = x11 + x7; + x15 ^= u << 18 | u >>> 32 - 18; + u = x0 + x3; + x1 ^= u << 7 | u >>> 32 - 7; + u = x1 + x0; + x2 ^= u << 9 | u >>> 32 - 9; + u = x2 + x1; + x3 ^= u << 13 | u >>> 32 - 13; + u = x3 + x2; + x0 ^= u << 18 | u >>> 32 - 18; + u = x5 + x4; + x6 ^= u << 7 | u >>> 32 - 7; + u = x6 + x5; + x7 ^= u << 9 | u >>> 32 - 9; + u = x7 + x6; + x4 ^= u << 13 | u >>> 32 - 13; + u = x4 + x7; + x5 ^= u << 18 | u >>> 32 - 18; + u = x10 + x9; + x11 ^= u << 7 | u >>> 32 - 7; + u = x11 + x10; + x8 ^= u << 9 | u >>> 32 - 9; + u = x8 + x11; + x9 ^= u << 13 | u >>> 32 - 13; + u = x9 + x8; + x10 ^= u << 18 | u >>> 32 - 18; + u = x15 + x14; + x12 ^= u << 7 | u >>> 32 - 7; + u = x12 + x15; + x13 ^= u << 9 | u >>> 32 - 9; + u = x13 + x12; + x14 ^= u << 13 | u >>> 32 - 13; + u = x14 + x13; + x15 ^= u << 18 | u >>> 32 - 18; + } + B2[bout++] = tmp2[0] = x0 + j0 | 0; + B2[bout++] = tmp2[1] = x1 + j1 | 0; + B2[bout++] = tmp2[2] = x2 + j2 | 0; + B2[bout++] = tmp2[3] = x3 + j3 | 0; + B2[bout++] = tmp2[4] = x4 + j4 | 0; + B2[bout++] = tmp2[5] = x5 + j5 | 0; + B2[bout++] = tmp2[6] = x6 + j6 | 0; + B2[bout++] = tmp2[7] = x7 + j7 | 0; + B2[bout++] = tmp2[8] = x8 + j8 | 0; + B2[bout++] = tmp2[9] = x9 + j9 | 0; + B2[bout++] = tmp2[10] = x10 + j10 | 0; + B2[bout++] = tmp2[11] = x11 + j11 | 0; + B2[bout++] = tmp2[12] = x12 + j12 | 0; + B2[bout++] = tmp2[13] = x13 + j13 | 0; + B2[bout++] = tmp2[14] = x14 + j14 | 0; + B2[bout++] = tmp2[15] = x15 + j15 | 0; + } + function blockCopy(dst, di, src2, si, len) { + while (len--) + dst[di++] = src2[si++]; + } + function blockXOR(dst, di, src2, si, len) { + while (len--) + dst[di++] ^= src2[si++]; + } + function blockMix(tmp2, B2, bin, bout, r2) { + blockCopy(tmp2, 0, B2, bin + (2 * r2 - 1) * 16, 16); + for (var i = 0; i < 2 * r2; i += 2) { + salsaXOR(tmp2, B2, bin + i * 16, bout + i * 8); + salsaXOR(tmp2, B2, bin + i * 16 + 16, bout + i * 8 + r2 * 16); + } + } + function integerify(B2, bi, r2) { + return B2[bi + (2 * r2 - 1) * 16]; + } + function stringToUTF8Bytes(s) { + var arr = []; + for (var i = 0; i < s.length; i++) { + var c = s.charCodeAt(i); + if (c < 128) { + arr.push(c); + } else if (c < 2048) { + arr.push(192 | c >> 6); + arr.push(128 | c & 63); + } else if (c < 55296) { + arr.push(224 | c >> 12); + arr.push(128 | c >> 6 & 63); + arr.push(128 | c & 63); + } else { + if (i >= s.length - 1) { + throw new Error("invalid string"); + } + i++; + c = (c & 1023) << 10; + c |= s.charCodeAt(i) & 1023; + c += 65536; + arr.push(240 | c >> 18); + arr.push(128 | c >> 12 & 63); + arr.push(128 | c >> 6 & 63); + arr.push(128 | c & 63); + } + } + return arr; + } + function bytesToHex(p2) { + var enc = "0123456789abcdef".split(""); + var len = p2.length, arr = [], i = 0; + for (; i < len; i++) { + arr.push(enc[p2[i] >>> 4 & 15]); + arr.push(enc[p2[i] >>> 0 & 15]); + } + return arr.join(""); + } + function bytesToBase64(p2) { + var enc = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""); + var len = p2.length, arr = [], i = 0, a, b, c, t; + while (i < len) { + a = i < len ? p2[i++] : 0; + b = i < len ? p2[i++] : 0; + c = i < len ? p2[i++] : 0; + t = (a << 16) + (b << 8) + c; + arr.push(enc[t >>> 3 * 6 & 63]); + arr.push(enc[t >>> 2 * 6 & 63]); + arr.push(enc[t >>> 1 * 6 & 63]); + arr.push(enc[t >>> 0 * 6 & 63]); + } + if (len % 3 > 0) { + arr[arr.length - 1] = "="; + if (len % 3 === 1) + arr[arr.length - 2] = "="; + } + return arr.join(""); + } + var MAX_UINT = -1 >>> 0, p = 1; + if (typeof logN === "object") { + if (arguments.length > 4) { + throw new Error("scrypt: incorrect number of arguments"); + } + var opts = logN; + callback = r; + logN = opts.logN; + if (typeof logN === "undefined") { + if (typeof opts.N !== "undefined") { + if (opts.N < 2 || opts.N > MAX_UINT) + throw new Error("scrypt: N is out of range"); + if ((opts.N & opts.N - 1) !== 0) + throw new Error("scrypt: N is not a power of 2"); + logN = Math.log(opts.N) / Math.LN2; + } else { + throw new Error("scrypt: missing N parameter"); + } + } + p = opts.p || 1; + r = opts.r; + dkLen = opts.dkLen || 32; + interruptStep = opts.interruptStep || 0; + encoding = opts.encoding; + } + if (p < 1) + throw new Error("scrypt: invalid p"); + if (r <= 0) + throw new Error("scrypt: invalid r"); + if (logN < 1 || logN > 31) + throw new Error("scrypt: logN must be between 1 and 31"); + var N = 1 << logN >>> 0, XY, V, B, tmp; + if (r * p >= 1 << 30 || r > MAX_UINT / 128 / p || r > MAX_UINT / 256 || N > MAX_UINT / 128 / r) + throw new Error("scrypt: parameters are too large"); + if (typeof password === "string") + password = stringToUTF8Bytes(password); + if (typeof salt === "string") + salt = stringToUTF8Bytes(salt); + if (typeof Int32Array !== "undefined") { + XY = new Int32Array(64 * r); + V = new Int32Array(32 * N * r); + tmp = new Int32Array(16); + } else { + XY = []; + V = []; + tmp = new Array(16); + } + B = PBKDF2_HMAC_SHA256_OneIter(password, salt, p * 128 * r); + var xi = 0, yi = 32 * r; + function smixStart(pos) { + for (var i = 0; i < 32 * r; i++) { + var j = pos + i * 4; + XY[xi + i] = (B[j + 3] & 255) << 24 | (B[j + 2] & 255) << 16 | (B[j + 1] & 255) << 8 | (B[j + 0] & 255) << 0; + } + } + function smixStep1(start, end) { + for (var i = start; i < end; i += 2) { + blockCopy(V, i * (32 * r), XY, xi, 32 * r); + blockMix(tmp, XY, xi, yi, r); + blockCopy(V, (i + 1) * (32 * r), XY, yi, 32 * r); + blockMix(tmp, XY, yi, xi, r); + } + } + function smixStep2(start, end) { + for (var i = start; i < end; i += 2) { + var j = integerify(XY, xi, r) & N - 1; + blockXOR(XY, xi, V, j * (32 * r), 32 * r); + blockMix(tmp, XY, xi, yi, r); + j = integerify(XY, yi, r) & N - 1; + blockXOR(XY, yi, V, j * (32 * r), 32 * r); + blockMix(tmp, XY, yi, xi, r); + } + } + function smixFinish(pos) { + for (var i = 0; i < 32 * r; i++) { + var j = XY[xi + i]; + B[pos + i * 4 + 0] = j >>> 0 & 255; + B[pos + i * 4 + 1] = j >>> 8 & 255; + B[pos + i * 4 + 2] = j >>> 16 & 255; + B[pos + i * 4 + 3] = j >>> 24 & 255; + } + } + var nextTick = typeof setImmediate !== "undefined" ? setImmediate : setTimeout; + function interruptedFor(start, end, step, fn, donefn) { + (function performStep() { + nextTick(function() { + fn(start, start + step < end ? start + step : end); + start += step; + if (start < end) + performStep(); + else + donefn(); + }); + })(); + } + function getResult(enc) { + var result = PBKDF2_HMAC_SHA256_OneIter(password, B, dkLen); + if (enc === "base64") + return bytesToBase64(result); + else if (enc === "hex") + return bytesToHex(result); + else if (enc === "binary") + return new Uint8Array(result); + else + return result; + } + function calculateSync() { + for (var i = 0; i < p; i++) { + smixStart(i * 128 * r); + smixStep1(0, N); + smixStep2(0, N); + smixFinish(i * 128 * r); + } + callback(getResult(encoding)); + } + function calculateAsync(i) { + smixStart(i * 128 * r); + interruptedFor(0, N, interruptStep * 2, smixStep1, function() { + interruptedFor(0, N, interruptStep * 2, smixStep2, function() { + smixFinish(i * 128 * r); + if (i + 1 < p) { + nextTick(function() { + calculateAsync(i + 1); + }); + } else { + callback(getResult(encoding)); + } + }); + }); + } + if (typeof interruptStep === "function") { + encoding = callback; + callback = interruptStep; + interruptStep = 1e3; + } + if (interruptStep <= 0) { + calculateSync(); + } else { + calculateAsync(0); + } + } + if (typeof module !== "undefined") + module.exports = scrypt2; + } + }); + + // frontend/common/translations.js + var import_sbp = __toESM(__require("@sbp/sbp")); + + // frontend/common/stringTemplate.js + var nargs = /\{([0-9a-zA-Z_]+)\}/g; + function template(string3, ...args) { + const firstArg = args[0]; + const replacementsByKey = typeof firstArg === "object" && firstArg !== null ? firstArg : args; + return string3.replace(nargs, function replaceArg(match, capture, index) { + if (string3[index - 1] === "{" && string3[index + match.length] === "}") { + return capture; + } + const maybeReplacement = Object.prototype.hasOwnProperty.call(replacementsByKey, capture) ? replacementsByKey[capture] : void 0; + if (maybeReplacement === null || maybeReplacement === void 0) { + return ""; + } + return String(maybeReplacement); + }); + } + + // frontend/common/translations.js + var defaultLanguage = "en-US"; + var defaultLanguageCode = "en"; + var defaultTranslationTable = {}; + var currentLanguage = defaultLanguage; + var currentLanguageCode = defaultLanguage.split("-")[0]; + var currentTranslationTable = defaultTranslationTable; + var translations_default = (0, import_sbp.default)("sbp/selectors/register", { + "translations/init": async function init(language) { + const [languageCode] = language.toLowerCase().split("-"); + if (language.toLowerCase() === currentLanguage.toLowerCase()) + return; + if (languageCode === currentLanguageCode) + return; + if (languageCode === defaultLanguageCode) { + currentLanguage = defaultLanguage; + currentLanguageCode = defaultLanguageCode; + currentTranslationTable = defaultTranslationTable; + return; + } + try { + currentTranslationTable = await (0, import_sbp.default)("backend/translations/get", language) || defaultTranslationTable; + currentLanguage = language; + currentLanguageCode = languageCode; + } catch (error) { + console.error(error); + } + } + }); + function L(key, args) { + return template(currentTranslationTable[key] || key, args).replace(/\s(?=[;:?!])/g, "\xA0"); + } + + // shared/domains/chelonia/errors.js + var ChelErrorGenerator = (name, base2 = Error) => class extends base2 { + constructor(...params) { + super(...params); + this.name = name; + if (params[1]?.cause !== this.cause) { + Object.defineProperty(this, "cause", { value: params[1].cause }); + } + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + } + }; + var ChelErrorWarning = ChelErrorGenerator("ChelErrorWarning"); + var ChelErrorAlreadyProcessed = ChelErrorGenerator("ChelErrorAlreadyProcessed"); + var ChelErrorDBBadPreviousHEAD = ChelErrorGenerator("ChelErrorDBBadPreviousHEAD"); + var ChelErrorDBConnection = ChelErrorGenerator("ChelErrorDBConnection"); + var ChelErrorUnexpected = ChelErrorGenerator("ChelErrorUnexpected"); + var ChelErrorUnrecoverable = ChelErrorGenerator("ChelErrorUnrecoverable"); + var ChelErrorDecryptionError = ChelErrorGenerator("ChelErrorDecryptionError"); + var ChelErrorDecryptionKeyNotFound = ChelErrorGenerator("ChelErrorDecryptionKeyNotFound", ChelErrorDecryptionError); + var ChelErrorSignatureError = ChelErrorGenerator("ChelErrorSignatureError"); + var ChelErrorSignatureKeyUnauthorized = ChelErrorGenerator("ChelErrorSignatureKeyUnauthorized", ChelErrorSignatureError); + var ChelErrorSignatureKeyNotFound = ChelErrorGenerator("ChelErrorSignatureKeyNotFound", ChelErrorSignatureError); + var ChelErrorFetchServerTimeFailed = ChelErrorGenerator("ChelErrorFetchServerTimeFailed"); + + // frontend/common/errors.js + var GIErrorIgnoreAndBan = ChelErrorGenerator("GIErrorIgnoreAndBan"); + var GIErrorUIRuntimeError = ChelErrorGenerator("GIErrorUIRuntimeError"); + var GIErrorMissingSigningKeyError = ChelErrorGenerator("GIErrorMissingSigningKeyError"); + + // frontend/model/contracts/chatroom.js + var import_sbp6 = __toESM(__require("@sbp/sbp")); + + // frontend/utils/events.js + var NEW_CHATROOM_UNREAD_POSITION = "new-chatroom-unread-position"; + + // frontend/model/contracts/misc/flowTyper.js + var EMPTY_VALUE = Symbol("@@empty"); + var isEmpty = (v) => v === EMPTY_VALUE; + var isNil = (v) => v === null; + var isUndef = (v) => typeof v === "undefined"; + var isBoolean = (v) => typeof v === "boolean"; + var isNumber = (v) => typeof v === "number"; + var isString = (v) => typeof v === "string"; + var isObject = (v) => !isNil(v) && typeof v === "object"; + var isFunction = (v) => typeof v === "function"; + var getType = (typeFn, _options) => { + if (isFunction(typeFn.type)) + return typeFn.type(_options); + return typeFn.name || "?"; + }; + var TypeValidatorError = class extends Error { + expectedType; + valueType; + value; + typeScope; + sourceFile; + constructor(message, expectedType, valueType, value, typeName = "", typeScope = "") { + const errMessage = message || `invalid "${valueType}" value type; ${typeName || expectedType} type expected`; + super(errMessage); + this.expectedType = expectedType; + this.valueType = valueType; + this.value = value; + this.typeScope = typeScope || ""; + this.sourceFile = this.getSourceFile(); + this.message = `${errMessage} +${this.getErrorInfo()}`; + this.name = this.constructor.name; + if (Error.captureStackTrace) { + Error.captureStackTrace(this, TypeValidatorError); + } + } + getSourceFile() { + const fileNames = this.stack.match(/(\/[\w_\-.]+)+(\.\w+:\d+:\d+)/g) || []; + return fileNames.find((fileName) => fileName.indexOf("/flowTyper-js/dist/") === -1) || ""; + } + getErrorInfo() { + return ` + file ${this.sourceFile} + scope ${this.typeScope} + expected ${this.expectedType.replace(/\n/g, "")} + type ${this.valueType} + value ${this.value} +`; + } + }; + var validatorError = (typeFn, value, scope, message, expectedType, valueType) => { + return new TypeValidatorError(message, expectedType || getType(typeFn), valueType || typeof value, JSON.stringify(value), typeFn.name, scope); + }; + var arrayOf = (typeFn, _scope = "Array") => { + function array(value) { + if (isEmpty(value)) + return [typeFn(value)]; + if (Array.isArray(value)) { + let index = 0; + return value.map((v) => typeFn(v, `${_scope}[${index++}]`)); + } + throw validatorError(array, value, _scope); + } + array.type = () => `Array<${getType(typeFn)}>`; + return array; + }; + var literalOf = (primitive) => { + function literal(value, _scope = "") { + if (isEmpty(value) || value === primitive) + return primitive; + throw validatorError(literal, value, _scope); + } + literal.type = () => { + if (isBoolean(primitive)) + return `${primitive ? "true" : "false"}`; + else + return `"${primitive}"`; + }; + return literal; + }; + var mapOf = (keyTypeFn, typeFn) => { + function mapOf2(value) { + if (isEmpty(value)) + return {}; + const o = object(value); + const reducer = (acc, key) => Object.assign(acc, { + [keyTypeFn(key, "Map[_]")]: typeFn(o[key], `Map.${key}`) + }); + return Object.keys(o).reduce(reducer, {}); + } + mapOf2.type = () => `{ [_:${getType(keyTypeFn)}]: ${getType(typeFn)} }`; + return mapOf2; + }; + var object = function(value) { + if (isEmpty(value)) + return {}; + if (isObject(value) && !Array.isArray(value)) { + return Object.assign({}, value); + } + throw validatorError(object, value); + }; + var objectOf = (typeObj, _scope = "Object") => { + function object2(value) { + const o = object(value); + const typeAttrs = Object.keys(typeObj); + const unknownAttr = Object.keys(o).find((attr) => !typeAttrs.includes(attr)); + if (unknownAttr) { + throw validatorError(object2, value, _scope, `missing object property '${unknownAttr}' in ${_scope} type`); + } + const undefAttr = typeAttrs.find((property) => { + const propertyTypeFn = typeObj[property]; + return propertyTypeFn.name.includes("maybe") && !o.hasOwnProperty(property); + }); + if (undefAttr) { + throw validatorError(object2, o[undefAttr], `${_scope}.${undefAttr}`, `empty object property '${undefAttr}' for ${_scope} type`, `void | null | ${getType(typeObj[undefAttr]).substr(1)}`, "-"); + } + const reducer = isEmpty(value) ? (acc, key) => Object.assign(acc, { [key]: typeObj[key](value) }) : (acc, key) => { + const typeFn = typeObj[key]; + if (typeFn.name.includes("optional") && !o.hasOwnProperty(key)) { + return Object.assign(acc, {}); + } else { + return Object.assign(acc, { [key]: typeFn(o[key], `${_scope}.${key}`) }); + } + }; + return typeAttrs.reduce(reducer, {}); + } + object2.type = () => { + const props = Object.keys(typeObj).map((key) => { + const ret = typeObj[key].name.includes("optional") ? `${key}?: ${getType(typeObj[key], { noVoid: true })}` : `${key}: ${getType(typeObj[key])}`; + return ret; + }); + return `{| + ${props.join(",\n ")} +|}`; + }; + return object2; + }; + function objectMaybeOf(validations, _scope = "Object") { + return function(data) { + object(data); + for (const key in data) { + validations[key]?.(data[key], `${_scope}.${key}`); + } + return data; + }; + } + var optional = (typeFn) => { + const unionFn = unionOf(typeFn, undef); + function optional2(v) { + return unionFn(v); + } + optional2.type = ({ noVoid }) => !noVoid ? getType(unionFn) : getType(typeFn); + return optional2; + }; + function undef(value, _scope = "") { + if (isEmpty(value) || isUndef(value)) + return void 0; + throw validatorError(undef, value, _scope); + } + undef.type = () => "void"; + var boolean = function boolean2(value, _scope = "") { + if (isEmpty(value)) + return false; + if (isBoolean(value)) + return value; + throw validatorError(boolean2, value, _scope); + }; + var number = function number2(value, _scope = "") { + if (isEmpty(value)) + return 0; + if (isNumber(value)) + return value; + throw validatorError(number2, value, _scope); + }; + var numberRange = (from3, to, key = "") => { + if (!isNumber(from3) || !isNumber(to)) { + throw new TypeError("Params for numberRange must be numbers"); + } + if (from3 >= to) { + throw new TypeError('Params "to" should be bigger than "from"'); + } + function numberRange2(value, _scope = "") { + number(value, _scope); + if (value >= from3 && value <= to) + return value; + throw validatorError(numberRange2, value, _scope, key ? `number type '${key}' must be within the range of [${from3}, ${to}]` : `must be within the range of [${from3}, ${to}]`); + } + numberRange2.type = `number(range: [${from3}, ${to}])`; + return numberRange2; + }; + var string = function string2(value, _scope = "") { + if (isEmpty(value)) + return ""; + if (isString(value)) + return value; + throw validatorError(string2, value, _scope); + }; + var stringMax = (numChar, key = "") => { + if (!isNumber(numChar)) { + throw new Error("param for stringMax must be number"); + } + function stringMax2(value, _scope = "") { + string(value, _scope); + if (value.length <= numChar) + return value; + throw validatorError(stringMax2, value, _scope, key ? `string type '${key}' cannot exceed ${numChar} characters` : `cannot exceed ${numChar} characters`); + } + stringMax2.type = () => `string(max: ${numChar})`; + return stringMax2; + }; + function unionOf_(...typeFuncs) { + function union(value, _scope = "") { + for (const typeFn of typeFuncs) { + try { + return typeFn(value, _scope); + } catch (_) { + } + } + throw validatorError(union, value, _scope); + } + union.type = () => `(${typeFuncs.map((fn) => getType(fn)).join(" | ")})`; + return union; + } + var unionOf = unionOf_; + var actionRequireInnerSignature = (next) => (data, props) => { + const innerSigningContractID = props.message.innerSigningContractID; + if (!innerSigningContractID || innerSigningContractID === props.contractID) { + throw new Error("Missing inner signature"); + } + return next(data, props); + }; + + // shared/domains/chelonia/utils.js + var import_sbp4 = __toESM(__require("@sbp/sbp")); + + // frontend/model/contracts/shared/giLodash.js + function cloneDeep(obj) { + return JSON.parse(JSON.stringify(obj)); + } + function isMergeableObject(val) { + const nonNullObject = val && typeof val === "object"; + return nonNullObject && Object.prototype.toString.call(val) !== "[object RegExp]" && Object.prototype.toString.call(val) !== "[object Date]"; + } + function merge(obj, src2) { + for (const key in src2) { + const clone = isMergeableObject(src2[key]) ? cloneDeep(src2[key]) : void 0; + if (clone && isMergeableObject(obj[key])) { + merge(obj[key], clone); + continue; + } + obj[key] = clone || src2[key]; + } + return obj; + } + var has = Function.prototype.call.bind(Object.prototype.hasOwnProperty); + + // shared/blake2bstream.js + var import_blakejs = __toESM(require_blakejs()); + + // shared/multiformats/bytes.js + var empty = new Uint8Array(0); + function equals(aa, bb) { + if (aa === bb) { + return true; + } + if (aa.byteLength !== bb.byteLength) { + return false; + } + for (let ii = 0; ii < aa.byteLength; ii++) { + if (aa[ii] !== bb[ii]) { + return false; + } + } + return true; + } + function coerce(o) { + if (o instanceof Uint8Array && o.constructor.name === "Uint8Array") { + return o; + } + if (o instanceof ArrayBuffer) { + return new Uint8Array(o); + } + if (ArrayBuffer.isView(o)) { + return new Uint8Array(o.buffer, o.byteOffset, o.byteLength); + } + throw new Error("Unknown type, must be binary type"); + } + + // shared/multiformats/vendor/varint.js + var encode_1 = encode; + var MSB = 128; + var REST = 127; + var MSBALL = ~REST; + var INT = Math.pow(2, 31); + function encode(num, out, offset) { + out = out || []; + offset = offset || 0; + var oldOffset = offset; + while (num >= INT) { + out[offset++] = num & 255 | MSB; + num /= 128; + } + while (num & MSBALL) { + out[offset++] = num & 255 | MSB; + num >>>= 7; + } + out[offset] = num | 0; + encode.bytes = offset - oldOffset + 1; + return out; + } + var decode = read; + var MSB$1 = 128; + var REST$1 = 127; + function read(buf, offset) { + var res = 0, offset = offset || 0, shift = 0, counter = offset, b, l = buf.length; + do { + if (counter >= l) { + read.bytes = 0; + throw new RangeError("Could not decode varint"); + } + b = buf[counter++]; + res += shift < 28 ? (b & REST$1) << shift : (b & REST$1) * Math.pow(2, shift); + shift += 7; + } while (b >= MSB$1); + read.bytes = counter - offset; + return res; + } + var N1 = Math.pow(2, 7); + var N2 = Math.pow(2, 14); + var N3 = Math.pow(2, 21); + var N4 = Math.pow(2, 28); + var N5 = Math.pow(2, 35); + var N6 = Math.pow(2, 42); + var N7 = Math.pow(2, 49); + var N8 = Math.pow(2, 56); + var N9 = Math.pow(2, 63); + var length = function(value) { + return value < N1 ? 1 : value < N2 ? 2 : value < N3 ? 3 : value < N4 ? 4 : value < N5 ? 5 : value < N6 ? 6 : value < N7 ? 7 : value < N8 ? 8 : value < N9 ? 9 : 10; + }; + var varint = { + encode: encode_1, + decode, + encodingLength: length + }; + var _brrp_varint = varint; + var varint_default = _brrp_varint; + + // shared/multiformats/varint.js + function decode2(data, offset = 0) { + const code = varint_default.decode(data, offset); + return [code, varint_default.decode.bytes]; + } + function encodeTo(int, target, offset = 0) { + varint_default.encode(int, target, offset); + return target; + } + function encodingLength(int) { + return varint_default.encodingLength(int); + } + + // shared/multiformats/hashes/digest.js + function create(code, digest) { + const size = digest.byteLength; + const sizeOffset = encodingLength(code); + const digestOffset = sizeOffset + encodingLength(size); + const bytes = new Uint8Array(digestOffset + size); + encodeTo(code, bytes, 0); + encodeTo(size, bytes, sizeOffset); + bytes.set(digest, digestOffset); + return new Digest(code, size, digest, bytes); + } + function decode3(multihash) { + const bytes = coerce(multihash); + const [code, sizeOffset] = decode2(bytes); + const [size, digestOffset] = decode2(bytes.subarray(sizeOffset)); + const digest = bytes.subarray(sizeOffset + digestOffset); + if (digest.byteLength !== size) { + throw new Error("Incorrect length"); + } + return new Digest(code, size, digest, bytes); + } + function equals2(a, b) { + if (a === b) { + return true; + } else { + const data = b; + return a.code === data.code && a.size === data.size && data.bytes instanceof Uint8Array && equals(a.bytes, data.bytes); + } + } + var Digest = class { + code; + size; + digest; + bytes; + constructor(code, size, digest, bytes) { + this.code = code; + this.size = size; + this.digest = digest; + this.bytes = bytes; + } + }; + + // shared/multiformats/hasher.js + function from({ name, code, encode: encode3 }) { + return new Hasher(name, code, encode3); + } + var Hasher = class { + name; + code; + encode; + constructor(name, code, encode3) { + this.name = name; + this.code = code; + this.encode = encode3; + } + digest(input) { + if (input instanceof Uint8Array || input instanceof ReadableStream) { + const result = this.encode(input); + return result instanceof Uint8Array ? create(this.code, result) : result.then((digest) => create(this.code, digest)); + } else { + throw Error("Unknown type, must be binary type"); + } + } + }; + + // shared/blake2bstream.js + var { blake2b, blake2bInit, blake2bUpdate, blake2bFinal } = import_blakejs.default; + var blake2b256stream = from({ + name: "blake2b-256", + code: 45600, + encode: async (input) => { + if (input instanceof ReadableStream) { + const ctx = blake2bInit(32); + const reader = input.getReader(); + for (; ; ) { + const result = await reader.read(); + if (result.done) + break; + blake2bUpdate(ctx, coerce(result.value)); + } + return blake2bFinal(ctx); + } else { + return coerce(blake2b(input, void 0, 32)); + } + } + }); + + // shared/multiformats/base-x.js + function base(ALPHABET, name) { + if (ALPHABET.length >= 255) { + throw new TypeError("Alphabet too long"); + } + var BASE_MAP = new Uint8Array(256); + for (var j = 0; j < BASE_MAP.length; j++) { + BASE_MAP[j] = 255; + } + for (var i = 0; i < ALPHABET.length; i++) { + var x = ALPHABET.charAt(i); + var xc = x.charCodeAt(0); + if (BASE_MAP[xc] !== 255) { + throw new TypeError(x + " is ambiguous"); + } + BASE_MAP[xc] = i; + } + var BASE = ALPHABET.length; + var LEADER = ALPHABET.charAt(0); + var FACTOR = Math.log(BASE) / Math.log(256); + var iFACTOR = Math.log(256) / Math.log(BASE); + function encode3(source) { + if (source instanceof Uint8Array) + ; + else if (ArrayBuffer.isView(source)) { + source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength); + } else if (Array.isArray(source)) { + source = Uint8Array.from(source); + } + if (!(source instanceof Uint8Array)) { + throw new TypeError("Expected Uint8Array"); + } + if (source.length === 0) { + return ""; + } + var zeroes = 0; + var length2 = 0; + var pbegin = 0; + var pend = source.length; + while (pbegin !== pend && source[pbegin] === 0) { + pbegin++; + zeroes++; + } + var size = (pend - pbegin) * iFACTOR + 1 >>> 0; + var b58 = new Uint8Array(size); + while (pbegin !== pend) { + var carry = source[pbegin]; + var i2 = 0; + for (var it1 = size - 1; (carry !== 0 || i2 < length2) && it1 !== -1; it1--, i2++) { + carry += 256 * b58[it1] >>> 0; + b58[it1] = carry % BASE >>> 0; + carry = carry / BASE >>> 0; + } + if (carry !== 0) { + throw new Error("Non-zero carry"); + } + length2 = i2; + pbegin++; + } + var it2 = size - length2; + while (it2 !== size && b58[it2] === 0) { + it2++; + } + var str = LEADER.repeat(zeroes); + for (; it2 < size; ++it2) { + str += ALPHABET.charAt(b58[it2]); + } + return str; + } + function decodeUnsafe(source) { + if (typeof source !== "string") { + throw new TypeError("Expected String"); + } + if (source.length === 0) { + return new Uint8Array(); + } + var psz = 0; + if (source[psz] === " ") { + return; + } + var zeroes = 0; + var length2 = 0; + while (source[psz] === LEADER) { + zeroes++; + psz++; + } + var size = (source.length - psz) * FACTOR + 1 >>> 0; + var b256 = new Uint8Array(size); + while (source[psz]) { + var carry = BASE_MAP[source.charCodeAt(psz)]; + if (carry === 255) { + return; + } + var i2 = 0; + for (var it3 = size - 1; (carry !== 0 || i2 < length2) && it3 !== -1; it3--, i2++) { + carry += BASE * b256[it3] >>> 0; + b256[it3] = carry % 256 >>> 0; + carry = carry / 256 >>> 0; + } + if (carry !== 0) { + throw new Error("Non-zero carry"); + } + length2 = i2; + psz++; + } + if (source[psz] === " ") { + return; + } + var it4 = size - length2; + while (it4 !== size && b256[it4] === 0) { + it4++; + } + var vch = new Uint8Array(zeroes + (size - it4)); + var j2 = zeroes; + while (it4 !== size) { + vch[j2++] = b256[it4++]; + } + return vch; + } + function decode5(string3) { + var buffer = decodeUnsafe(string3); + if (buffer) { + return buffer; + } + throw new Error(`Non-${name} character`); + } + return { + encode: encode3, + decodeUnsafe, + decode: decode5 + }; + } + var src = base; + var _brrp__multiformats_scope_baseX = src; + var base_x_default = _brrp__multiformats_scope_baseX; + + // shared/multiformats/bases/base.js + var Encoder = class { + name; + prefix; + baseEncode; + constructor(name, prefix, baseEncode) { + this.name = name; + this.prefix = prefix; + this.baseEncode = baseEncode; + } + encode(bytes) { + if (bytes instanceof Uint8Array) { + return `${this.prefix}${this.baseEncode(bytes)}`; + } else { + throw Error("Unknown type, must be binary type"); + } + } + }; + var Decoder = class { + name; + prefix; + baseDecode; + prefixCodePoint; + constructor(name, prefix, baseDecode) { + this.name = name; + this.prefix = prefix; + if (prefix.codePointAt(0) === void 0) { + throw new Error("Invalid prefix character"); + } + this.prefixCodePoint = prefix.codePointAt(0); + this.baseDecode = baseDecode; + } + decode(text) { + if (typeof text === "string") { + if (text.codePointAt(0) !== this.prefixCodePoint) { + throw Error(`Unable to decode multibase string ${JSON.stringify(text)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`); + } + return this.baseDecode(text.slice(this.prefix.length)); + } else { + throw Error("Can only multibase decode strings"); + } + } + or(decoder) { + return or(this, decoder); + } + }; + var ComposedDecoder = class { + decoders; + constructor(decoders) { + this.decoders = decoders; + } + or(decoder) { + return or(this, decoder); + } + decode(input) { + const prefix = input[0]; + const decoder = this.decoders[prefix]; + if (decoder != null) { + return decoder.decode(input); + } else { + throw RangeError(`Unable to decode multibase string ${JSON.stringify(input)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`); + } + } + }; + function or(left, right) { + return new ComposedDecoder({ + ...left.decoders ?? { [left.prefix]: left }, + ...right.decoders ?? { [right.prefix]: right } + }); + } + var Codec = class { + name; + prefix; + baseEncode; + baseDecode; + encoder; + decoder; + constructor(name, prefix, baseEncode, baseDecode) { + this.name = name; + this.prefix = prefix; + this.baseEncode = baseEncode; + this.baseDecode = baseDecode; + this.encoder = new Encoder(name, prefix, baseEncode); + this.decoder = new Decoder(name, prefix, baseDecode); + } + encode(input) { + return this.encoder.encode(input); + } + decode(input) { + return this.decoder.decode(input); + } + }; + function from2({ name, prefix, encode: encode3, decode: decode5 }) { + return new Codec(name, prefix, encode3, decode5); + } + function baseX({ name, prefix, alphabet }) { + const { encode: encode3, decode: decode5 } = base_x_default(alphabet, name); + return from2({ + prefix, + name, + encode: encode3, + decode: (text) => coerce(decode5(text)) + }); + } + function decode4(string3, alphabet, bitsPerChar, name) { + const codes = {}; + for (let i = 0; i < alphabet.length; ++i) { + codes[alphabet[i]] = i; + } + let end = string3.length; + while (string3[end - 1] === "=") { + --end; + } + const out = new Uint8Array(end * bitsPerChar / 8 | 0); + let bits = 0; + let buffer = 0; + let written = 0; + for (let i = 0; i < end; ++i) { + const value = codes[string3[i]]; + if (value === void 0) { + throw new SyntaxError(`Non-${name} character`); + } + buffer = buffer << bitsPerChar | value; + bits += bitsPerChar; + if (bits >= 8) { + bits -= 8; + out[written++] = 255 & buffer >> bits; + } + } + if (bits >= bitsPerChar || (255 & buffer << 8 - bits) !== 0) { + throw new SyntaxError("Unexpected end of data"); + } + return out; + } + function encode2(data, alphabet, bitsPerChar) { + const pad = alphabet[alphabet.length - 1] === "="; + const mask = (1 << bitsPerChar) - 1; + let out = ""; + let bits = 0; + let buffer = 0; + for (let i = 0; i < data.length; ++i) { + buffer = buffer << 8 | data[i]; + bits += 8; + while (bits > bitsPerChar) { + bits -= bitsPerChar; + out += alphabet[mask & buffer >> bits]; + } + } + if (bits !== 0) { + out += alphabet[mask & buffer << bitsPerChar - bits]; + } + if (pad) { + while ((out.length * bitsPerChar & 7) !== 0) { + out += "="; + } + } + return out; + } + function rfc4648({ name, prefix, bitsPerChar, alphabet }) { + return from2({ + prefix, + name, + encode(input) { + return encode2(input, alphabet, bitsPerChar); + }, + decode(input) { + return decode4(input, alphabet, bitsPerChar, name); + } + }); + } + + // shared/multiformats/bases/base58.js + var base58btc = baseX({ + name: "base58btc", + prefix: "z", + alphabet: "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz" + }); + var base58flickr = baseX({ + name: "base58flickr", + prefix: "Z", + alphabet: "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ" + }); + + // shared/multiformats/blake2b.js + var import_blakejs2 = __toESM(require_blakejs()); + var { blake2b: blake2b2 } = import_blakejs2.default; + var blake2b8 = from({ + name: "blake2b-8", + code: 45569, + encode: (input) => coerce(blake2b2(input, void 0, 1)) + }); + var blake2b16 = from({ + name: "blake2b-16", + code: 45570, + encode: (input) => coerce(blake2b2(input, void 0, 2)) + }); + var blake2b24 = from({ + name: "blake2b-24", + code: 45571, + encode: (input) => coerce(blake2b2(input, void 0, 3)) + }); + var blake2b32 = from({ + name: "blake2b-32", + code: 45572, + encode: (input) => coerce(blake2b2(input, void 0, 4)) + }); + var blake2b40 = from({ + name: "blake2b-40", + code: 45573, + encode: (input) => coerce(blake2b2(input, void 0, 5)) + }); + var blake2b48 = from({ + name: "blake2b-48", + code: 45574, + encode: (input) => coerce(blake2b2(input, void 0, 6)) + }); + var blake2b56 = from({ + name: "blake2b-56", + code: 45575, + encode: (input) => coerce(blake2b2(input, void 0, 7)) + }); + var blake2b64 = from({ + name: "blake2b-64", + code: 45576, + encode: (input) => coerce(blake2b2(input, void 0, 8)) + }); + var blake2b72 = from({ + name: "blake2b-72", + code: 45577, + encode: (input) => coerce(blake2b2(input, void 0, 9)) + }); + var blake2b80 = from({ + name: "blake2b-80", + code: 45578, + encode: (input) => coerce(blake2b2(input, void 0, 10)) + }); + var blake2b88 = from({ + name: "blake2b-88", + code: 45579, + encode: (input) => coerce(blake2b2(input, void 0, 11)) + }); + var blake2b96 = from({ + name: "blake2b-96", + code: 45580, + encode: (input) => coerce(blake2b2(input, void 0, 12)) + }); + var blake2b104 = from({ + name: "blake2b-104", + code: 45581, + encode: (input) => coerce(blake2b2(input, void 0, 13)) + }); + var blake2b112 = from({ + name: "blake2b-112", + code: 45582, + encode: (input) => coerce(blake2b2(input, void 0, 14)) + }); + var blake2b120 = from({ + name: "blake2b-120", + code: 45583, + encode: (input) => coerce(blake2b2(input, void 0, 15)) + }); + var blake2b128 = from({ + name: "blake2b-128", + code: 45584, + encode: (input) => coerce(blake2b2(input, void 0, 16)) + }); + var blake2b136 = from({ + name: "blake2b-136", + code: 45585, + encode: (input) => coerce(blake2b2(input, void 0, 17)) + }); + var blake2b144 = from({ + name: "blake2b-144", + code: 45586, + encode: (input) => coerce(blake2b2(input, void 0, 18)) + }); + var blake2b152 = from({ + name: "blake2b-152", + code: 45587, + encode: (input) => coerce(blake2b2(input, void 0, 19)) + }); + var blake2b160 = from({ + name: "blake2b-160", + code: 45588, + encode: (input) => coerce(blake2b2(input, void 0, 20)) + }); + var blake2b168 = from({ + name: "blake2b-168", + code: 45589, + encode: (input) => coerce(blake2b2(input, void 0, 21)) + }); + var blake2b176 = from({ + name: "blake2b-176", + code: 45590, + encode: (input) => coerce(blake2b2(input, void 0, 22)) + }); + var blake2b184 = from({ + name: "blake2b-184", + code: 45591, + encode: (input) => coerce(blake2b2(input, void 0, 23)) + }); + var blake2b192 = from({ + name: "blake2b-192", + code: 45592, + encode: (input) => coerce(blake2b2(input, void 0, 24)) + }); + var blake2b200 = from({ + name: "blake2b-200", + code: 45593, + encode: (input) => coerce(blake2b2(input, void 0, 25)) + }); + var blake2b208 = from({ + name: "blake2b-208", + code: 45594, + encode: (input) => coerce(blake2b2(input, void 0, 26)) + }); + var blake2b216 = from({ + name: "blake2b-216", + code: 45595, + encode: (input) => coerce(blake2b2(input, void 0, 27)) + }); + var blake2b224 = from({ + name: "blake2b-224", + code: 45596, + encode: (input) => coerce(blake2b2(input, void 0, 28)) + }); + var blake2b232 = from({ + name: "blake2b-232", + code: 45597, + encode: (input) => coerce(blake2b2(input, void 0, 29)) + }); + var blake2b240 = from({ + name: "blake2b-240", + code: 45598, + encode: (input) => coerce(blake2b2(input, void 0, 30)) + }); + var blake2b248 = from({ + name: "blake2b-248", + code: 45599, + encode: (input) => coerce(blake2b2(input, void 0, 31)) + }); + var blake2b256 = from({ + name: "blake2b-256", + code: 45600, + encode: (input) => coerce(blake2b2(input, void 0, 32)) + }); + var blake2b264 = from({ + name: "blake2b-264", + code: 45601, + encode: (input) => coerce(blake2b2(input, void 0, 33)) + }); + var blake2b272 = from({ + name: "blake2b-272", + code: 45602, + encode: (input) => coerce(blake2b2(input, void 0, 34)) + }); + var blake2b280 = from({ + name: "blake2b-280", + code: 45603, + encode: (input) => coerce(blake2b2(input, void 0, 35)) + }); + var blake2b288 = from({ + name: "blake2b-288", + code: 45604, + encode: (input) => coerce(blake2b2(input, void 0, 36)) + }); + var blake2b296 = from({ + name: "blake2b-296", + code: 45605, + encode: (input) => coerce(blake2b2(input, void 0, 37)) + }); + var blake2b304 = from({ + name: "blake2b-304", + code: 45606, + encode: (input) => coerce(blake2b2(input, void 0, 38)) + }); + var blake2b312 = from({ + name: "blake2b-312", + code: 45607, + encode: (input) => coerce(blake2b2(input, void 0, 39)) + }); + var blake2b320 = from({ + name: "blake2b-320", + code: 45608, + encode: (input) => coerce(blake2b2(input, void 0, 40)) + }); + var blake2b328 = from({ + name: "blake2b-328", + code: 45609, + encode: (input) => coerce(blake2b2(input, void 0, 41)) + }); + var blake2b336 = from({ + name: "blake2b-336", + code: 45610, + encode: (input) => coerce(blake2b2(input, void 0, 42)) + }); + var blake2b344 = from({ + name: "blake2b-344", + code: 45611, + encode: (input) => coerce(blake2b2(input, void 0, 43)) + }); + var blake2b352 = from({ + name: "blake2b-352", + code: 45612, + encode: (input) => coerce(blake2b2(input, void 0, 44)) + }); + var blake2b360 = from({ + name: "blake2b-360", + code: 45613, + encode: (input) => coerce(blake2b2(input, void 0, 45)) + }); + var blake2b368 = from({ + name: "blake2b-368", + code: 45614, + encode: (input) => coerce(blake2b2(input, void 0, 46)) + }); + var blake2b376 = from({ + name: "blake2b-376", + code: 45615, + encode: (input) => coerce(blake2b2(input, void 0, 47)) + }); + var blake2b384 = from({ + name: "blake2b-384", + code: 45616, + encode: (input) => coerce(blake2b2(input, void 0, 48)) + }); + var blake2b392 = from({ + name: "blake2b-392", + code: 45617, + encode: (input) => coerce(blake2b2(input, void 0, 49)) + }); + var blake2b400 = from({ + name: "blake2b-400", + code: 45618, + encode: (input) => coerce(blake2b2(input, void 0, 50)) + }); + var blake2b408 = from({ + name: "blake2b-408", + code: 45619, + encode: (input) => coerce(blake2b2(input, void 0, 51)) + }); + var blake2b416 = from({ + name: "blake2b-416", + code: 45620, + encode: (input) => coerce(blake2b2(input, void 0, 52)) + }); + var blake2b424 = from({ + name: "blake2b-424", + code: 45621, + encode: (input) => coerce(blake2b2(input, void 0, 53)) + }); + var blake2b432 = from({ + name: "blake2b-432", + code: 45622, + encode: (input) => coerce(blake2b2(input, void 0, 54)) + }); + var blake2b440 = from({ + name: "blake2b-440", + code: 45623, + encode: (input) => coerce(blake2b2(input, void 0, 55)) + }); + var blake2b448 = from({ + name: "blake2b-448", + code: 45624, + encode: (input) => coerce(blake2b2(input, void 0, 56)) + }); + var blake2b456 = from({ + name: "blake2b-456", + code: 45625, + encode: (input) => coerce(blake2b2(input, void 0, 57)) + }); + var blake2b464 = from({ + name: "blake2b-464", + code: 45626, + encode: (input) => coerce(blake2b2(input, void 0, 58)) + }); + var blake2b472 = from({ + name: "blake2b-472", + code: 45627, + encode: (input) => coerce(blake2b2(input, void 0, 59)) + }); + var blake2b480 = from({ + name: "blake2b-480", + code: 45628, + encode: (input) => coerce(blake2b2(input, void 0, 60)) + }); + var blake2b488 = from({ + name: "blake2b-488", + code: 45629, + encode: (input) => coerce(blake2b2(input, void 0, 61)) + }); + var blake2b496 = from({ + name: "blake2b-496", + code: 45630, + encode: (input) => coerce(blake2b2(input, void 0, 62)) + }); + var blake2b504 = from({ + name: "blake2b-504", + code: 45631, + encode: (input) => coerce(blake2b2(input, void 0, 63)) + }); + var blake2b512 = from({ + name: "blake2b-512", + code: 45632, + encode: (input) => coerce(blake2b2(input, void 0, 64)) + }); + + // shared/multiformats/bases/base32.js + var base32 = rfc4648({ + prefix: "b", + name: "base32", + alphabet: "abcdefghijklmnopqrstuvwxyz234567", + bitsPerChar: 5 + }); + var base32upper = rfc4648({ + prefix: "B", + name: "base32upper", + alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567", + bitsPerChar: 5 + }); + var base32pad = rfc4648({ + prefix: "c", + name: "base32pad", + alphabet: "abcdefghijklmnopqrstuvwxyz234567=", + bitsPerChar: 5 + }); + var base32padupper = rfc4648({ + prefix: "C", + name: "base32padupper", + alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=", + bitsPerChar: 5 + }); + var base32hex = rfc4648({ + prefix: "v", + name: "base32hex", + alphabet: "0123456789abcdefghijklmnopqrstuv", + bitsPerChar: 5 + }); + var base32hexupper = rfc4648({ + prefix: "V", + name: "base32hexupper", + alphabet: "0123456789ABCDEFGHIJKLMNOPQRSTUV", + bitsPerChar: 5 + }); + var base32hexpad = rfc4648({ + prefix: "t", + name: "base32hexpad", + alphabet: "0123456789abcdefghijklmnopqrstuv=", + bitsPerChar: 5 + }); + var base32hexpadupper = rfc4648({ + prefix: "T", + name: "base32hexpadupper", + alphabet: "0123456789ABCDEFGHIJKLMNOPQRSTUV=", + bitsPerChar: 5 + }); + var base32z = rfc4648({ + prefix: "h", + name: "base32z", + alphabet: "ybndrfg8ejkmcpqxot1uwisza345h769", + bitsPerChar: 5 + }); + + // shared/multiformats/cid.js + function format(link, base2) { + const { bytes, version } = link; + switch (version) { + case 0: + return toStringV0(bytes, baseCache(link), base2 ?? base58btc.encoder); + default: + return toStringV1(bytes, baseCache(link), base2 ?? base32.encoder); + } + } + var cache = /* @__PURE__ */ new WeakMap(); + function baseCache(cid) { + const baseCache2 = cache.get(cid); + if (baseCache2 == null) { + const baseCache3 = /* @__PURE__ */ new Map(); + cache.set(cid, baseCache3); + return baseCache3; + } + return baseCache2; + } + var CID = class { + code; + version; + multihash; + bytes; + "/"; + constructor(version, code, multihash, bytes) { + this.code = code; + this.version = version; + this.multihash = multihash; + this.bytes = bytes; + this["/"] = bytes; + } + get asCID() { + return this; + } + get byteOffset() { + return this.bytes.byteOffset; + } + get byteLength() { + return this.bytes.byteLength; + } + toV0() { + switch (this.version) { + case 0: { + return this; + } + case 1: { + const { code, multihash } = this; + if (code !== DAG_PB_CODE) { + throw new Error("Cannot convert a non dag-pb CID to CIDv0"); + } + if (multihash.code !== SHA_256_CODE) { + throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0"); + } + return CID.createV0(multihash); + } + default: { + throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`); + } + } + } + toV1() { + switch (this.version) { + case 0: { + const { code, digest } = this.multihash; + const multihash = create(code, digest); + return CID.createV1(this.code, multihash); + } + case 1: { + return this; + } + default: { + throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`); + } + } + } + equals(other) { + return CID.equals(this, other); + } + static equals(self2, other) { + const unknown = other; + return unknown != null && self2.code === unknown.code && self2.version === unknown.version && equals2(self2.multihash, unknown.multihash); + } + toString(base2) { + return format(this, base2); + } + toJSON() { + return { "/": format(this) }; + } + link() { + return this; + } + [Symbol.toStringTag] = "CID"; + [Symbol.for("nodejs.util.inspect.custom")]() { + return `CID(${this.toString()})`; + } + static asCID(input) { + if (input == null) { + return null; + } + const value = input; + if (value instanceof CID) { + return value; + } else if (value["/"] != null && value["/"] === value.bytes || value.asCID === value) { + const { version, code, multihash, bytes } = value; + return new CID(version, code, multihash, bytes ?? encodeCID(version, code, multihash.bytes)); + } else if (value[cidSymbol] === true) { + const { version, multihash, code } = value; + const digest = decode3(multihash); + return CID.create(version, code, digest); + } else { + return null; + } + } + static create(version, code, digest) { + if (typeof code !== "number") { + throw new Error("String codecs are no longer supported"); + } + if (!(digest.bytes instanceof Uint8Array)) { + throw new Error("Invalid digest"); + } + switch (version) { + case 0: { + if (code !== DAG_PB_CODE) { + throw new Error(`Version 0 CID must use dag-pb (code: ${DAG_PB_CODE}) block encoding`); + } else { + return new CID(version, code, digest, digest.bytes); + } + } + case 1: { + const bytes = encodeCID(version, code, digest.bytes); + return new CID(version, code, digest, bytes); + } + default: { + throw new Error("Invalid version"); + } + } + } + static createV0(digest) { + return CID.create(0, DAG_PB_CODE, digest); + } + static createV1(code, digest) { + return CID.create(1, code, digest); + } + static decode(bytes) { + const [cid, remainder] = CID.decodeFirst(bytes); + if (remainder.length !== 0) { + throw new Error("Incorrect length"); + } + return cid; + } + static decodeFirst(bytes) { + const specs = CID.inspectBytes(bytes); + const prefixSize = specs.size - specs.multihashSize; + const multihashBytes = coerce(bytes.subarray(prefixSize, prefixSize + specs.multihashSize)); + if (multihashBytes.byteLength !== specs.multihashSize) { + throw new Error("Incorrect length"); + } + const digestBytes = multihashBytes.subarray(specs.multihashSize - specs.digestSize); + const digest = new Digest(specs.multihashCode, specs.digestSize, digestBytes, multihashBytes); + const cid = specs.version === 0 ? CID.createV0(digest) : CID.createV1(specs.codec, digest); + return [cid, bytes.subarray(specs.size)]; + } + static inspectBytes(initialBytes) { + let offset = 0; + const next = () => { + const [i, length2] = decode2(initialBytes.subarray(offset)); + offset += length2; + return i; + }; + let version = next(); + let codec = DAG_PB_CODE; + if (version === 18) { + version = 0; + offset = 0; + } else { + codec = next(); + } + if (version !== 0 && version !== 1) { + throw new RangeError(`Invalid CID version ${version}`); + } + const prefixSize = offset; + const multihashCode = next(); + const digestSize = next(); + const size = offset + digestSize; + const multihashSize = size - prefixSize; + return { version, codec, multihashCode, digestSize, multihashSize, size }; + } + static parse(source, base2) { + const [prefix, bytes] = parseCIDtoBytes(source, base2); + const cid = CID.decode(bytes); + if (cid.version === 0 && source[0] !== "Q") { + throw Error("Version 0 CID string must not include multibase prefix"); + } + baseCache(cid).set(prefix, source); + return cid; + } + }; + function parseCIDtoBytes(source, base2) { + switch (source[0]) { + case "Q": { + const decoder = base2 ?? base58btc; + return [ + base58btc.prefix, + decoder.decode(`${base58btc.prefix}${source}`) + ]; + } + case base58btc.prefix: { + const decoder = base2 ?? base58btc; + return [base58btc.prefix, decoder.decode(source)]; + } + case base32.prefix: { + const decoder = base2 ?? base32; + return [base32.prefix, decoder.decode(source)]; + } + default: { + if (base2 == null) { + throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided"); + } + return [source[0], base2.decode(source)]; + } + } + } + function toStringV0(bytes, cache2, base2) { + const { prefix } = base2; + if (prefix !== base58btc.prefix) { + throw Error(`Cannot string encode V0 in ${base2.name} encoding`); + } + const cid = cache2.get(prefix); + if (cid == null) { + const cid2 = base2.encode(bytes).slice(1); + cache2.set(prefix, cid2); + return cid2; + } else { + return cid; + } + } + function toStringV1(bytes, cache2, base2) { + const { prefix } = base2; + const cid = cache2.get(prefix); + if (cid == null) { + const cid2 = base2.encode(bytes); + cache2.set(prefix, cid2); + return cid2; + } else { + return cid; + } + } + var DAG_PB_CODE = 112; + var SHA_256_CODE = 18; + function encodeCID(version, code, multihash) { + const codeOffset = encodingLength(version); + const hashOffset = codeOffset + encodingLength(code); + const bytes = new Uint8Array(hashOffset + multihash.byteLength); + encodeTo(version, bytes, 0); + encodeTo(code, bytes, codeOffset); + bytes.set(multihash, hashOffset); + return bytes; + } + var cidSymbol = Symbol.for("@ipld/js-cid/CID"); + + // shared/functions.js + var multicodes = { JSON: 512, RAW: 0 }; + if (typeof globalThis === "object" && !has(globalThis, "Buffer")) { + const { Buffer: Buffer2 } = require_buffer(); + globalThis.Buffer = Buffer2; + } + function createCID(data, multicode = multicodes.RAW) { + const uint8array = typeof data === "string" ? new TextEncoder().encode(data) : data; + const digest = blake2b256.digest(uint8array); + return CID.create(1, multicode, digest).toString(base58btc.encoder); + } + function blake32Hash(data) { + const uint8array = typeof data === "string" ? new TextEncoder().encode(data) : data; + const digest = blake2b256.digest(uint8array); + return base58btc.encode(digest.bytes); + } + var b64ToBuf = (b64) => Buffer.from(b64, "base64"); + var strToBuf = (str) => Buffer.from(str, "utf8"); + var bytesToB64 = (ary) => Buffer.from(ary).toString("base64"); + + // shared/domains/chelonia/crypto.js + var import_tweetnacl = __toESM(require_nacl_fast()); + var import_scrypt_async = __toESM(require_scrypt_async()); + var EDWARDS25519SHA512BATCH = "edwards25519sha512batch"; + var CURVE25519XSALSA20POLY1305 = "curve25519xsalsa20poly1305"; + var XSALSA20POLY1305 = "xsalsa20poly1305"; + if (false) { + throw new Error("ENABLE_UNSAFE_NULL_CRYPTO cannot be enabled in production mode"); + } + var bytesOrObjectToB64 = (ary) => { + if (!(ary instanceof Uint8Array)) { + throw Error("Unsupported type"); + } + return bytesToB64(ary); + }; + var serializeKey = (key, saveSecretKey) => { + if (false) { + return JSON.stringify([ + key.type, + saveSecretKey ? null : key.publicKey, + saveSecretKey ? key.secretKey : null + ], void 0, 0); + } + if (key.type === EDWARDS25519SHA512BATCH || key.type === CURVE25519XSALSA20POLY1305) { + if (!saveSecretKey) { + if (!key.publicKey) { + throw new Error("Unsupported operation: no public key to export"); + } + return JSON.stringify([ + key.type, + bytesOrObjectToB64(key.publicKey), + null + ], void 0, 0); + } + if (!key.secretKey) { + throw new Error("Unsupported operation: no secret key to export"); + } + return JSON.stringify([ + key.type, + null, + bytesOrObjectToB64(key.secretKey) + ], void 0, 0); + } else if (key.type === XSALSA20POLY1305) { + if (!saveSecretKey) { + throw new Error("Unsupported operation: no public key to export"); + } + if (!key.secretKey) { + throw new Error("Unsupported operation: no secret key to export"); + } + return JSON.stringify([ + key.type, + null, + bytesOrObjectToB64(key.secretKey) + ], void 0, 0); + } + throw new Error("Unsupported key type"); + }; + var deserializeKey = (data) => { + const keyData = JSON.parse(data); + if (!keyData || keyData.length !== 3) { + throw new Error("Invalid key object"); + } + if (false) { + const res = { + type: keyData[0] + }; + if (keyData[2]) { + Object.defineProperty(res, "secretKey", { value: keyData[2] }); + res.publicKey = keyData[2]; + } else { + res.publicKey = keyData[1]; + } + return res; + } + if (keyData[0] === EDWARDS25519SHA512BATCH) { + if (keyData[2]) { + const key = import_tweetnacl.default.sign.keyPair.fromSecretKey(b64ToBuf(keyData[2])); + const res = { + type: keyData[0], + publicKey: key.publicKey + }; + Object.defineProperty(res, "secretKey", { value: key.secretKey }); + return res; + } else if (keyData[1]) { + return { + type: keyData[0], + publicKey: new Uint8Array(b64ToBuf(keyData[1])) + }; + } + throw new Error("Missing secret or public key"); + } else if (keyData[0] === CURVE25519XSALSA20POLY1305) { + if (keyData[2]) { + const key = import_tweetnacl.default.box.keyPair.fromSecretKey(b64ToBuf(keyData[2])); + const res = { + type: keyData[0], + publicKey: key.publicKey + }; + Object.defineProperty(res, "secretKey", { value: key.secretKey }); + return res; + } else if (keyData[1]) { + return { + type: keyData[0], + publicKey: new Uint8Array(b64ToBuf(keyData[1])) + }; + } + throw new Error("Missing secret or public key"); + } else if (keyData[0] === XSALSA20POLY1305) { + if (!keyData[2]) { + throw new Error("Secret key missing"); + } + const res = { + type: keyData[0] + }; + Object.defineProperty(res, "secretKey", { value: new Uint8Array(b64ToBuf(keyData[2])) }); + return res; + } + throw new Error("Unsupported key type"); + }; + var keyId = (inKey) => { + const key = Object(inKey) instanceof String ? deserializeKey(inKey) : inKey; + const serializedKey = serializeKey(key, !key.publicKey); + return blake32Hash(serializedKey); + }; + var verifySignature = (inKey, data, signature) => { + const key = Object(inKey) instanceof String ? deserializeKey(inKey) : inKey; + if (false) { + if (!key.publicKey) { + throw new Error("Public key missing"); + } + if (key.publicKey + ";" + blake32Hash(data) !== signature) { + throw new Error("Invalid signature"); + } + return; + } + if (key.type !== EDWARDS25519SHA512BATCH) { + throw new Error("Unsupported algorithm"); + } + if (!key.publicKey) { + throw new Error("Public key missing"); + } + const decodedSignature = b64ToBuf(signature); + const messageUint8 = strToBuf(data); + const result = import_tweetnacl.default.sign.detached.verify(messageUint8, decodedSignature, key.publicKey); + if (!result) { + throw new Error("Invalid signature"); + } + }; + var decrypt = (inKey, data, ad) => { + const key = Object(inKey) instanceof String ? deserializeKey(inKey) : inKey; + if (false) { + if (!key.secretKey) { + throw new Error("Secret key missing"); + } + if (!data.startsWith(key.secretKey + ";") || !data.endsWith(";" + (ad ?? ""))) { + throw new Error("Additional data mismatch"); + } + return data.slice(String(key.secretKey).length + 1, data.length - 1 - (ad ?? "").length); + } + if (key.type === XSALSA20POLY1305) { + if (!key.secretKey) { + throw new Error("Secret key missing"); + } + const messageWithNonceAsUint8Array = b64ToBuf(data); + const nonce = messageWithNonceAsUint8Array.slice(0, import_tweetnacl.default.secretbox.nonceLength); + const message = messageWithNonceAsUint8Array.slice(import_tweetnacl.default.secretbox.nonceLength, messageWithNonceAsUint8Array.length); + if (ad) { + const adHash = import_tweetnacl.default.hash(strToBuf(ad)); + const len = Math.min(adHash.length, nonce.length); + for (let i = 0; i < len; i++) { + nonce[i] ^= adHash[i]; + } + } + const decrypted = import_tweetnacl.default.secretbox.open(message, nonce, key.secretKey); + if (!decrypted) { + throw new Error("Could not decrypt message"); + } + return Buffer.from(decrypted).toString("utf-8"); + } else if (key.type === CURVE25519XSALSA20POLY1305) { + if (!key.secretKey) { + throw new Error("Secret key missing"); + } + const messageWithNonceAsUint8Array = b64ToBuf(data); + const ephemeralPublicKey = messageWithNonceAsUint8Array.slice(0, import_tweetnacl.default.box.publicKeyLength); + const nonce = messageWithNonceAsUint8Array.slice(import_tweetnacl.default.box.publicKeyLength, import_tweetnacl.default.box.publicKeyLength + import_tweetnacl.default.box.nonceLength); + const message = messageWithNonceAsUint8Array.slice(import_tweetnacl.default.box.publicKeyLength + import_tweetnacl.default.box.nonceLength); + if (ad) { + const adHash = import_tweetnacl.default.hash(strToBuf(ad)); + const len = Math.min(adHash.length, nonce.length); + for (let i = 0; i < len; i++) { + nonce[i] ^= adHash[i]; + } + } + const decrypted = import_tweetnacl.default.box.open(message, nonce, ephemeralPublicKey, key.secretKey); + if (!decrypted) { + throw new Error("Could not decrypt message"); + } + return Buffer.from(decrypted).toString("utf-8"); + } + throw new Error("Unsupported algorithm"); + }; + + // shared/domains/chelonia/encryptedData.js + var import_sbp3 = __toESM(__require("@sbp/sbp")); + + // shared/domains/chelonia/signedData.js + var import_sbp2 = __toESM(__require("@sbp/sbp")); + var rootStateFn = () => (0, import_sbp2.default)("chelonia/rootState"); + var proto = Object.create(null, { + _isSignedData: { + value: true + } + }); + var wrapper = (o) => { + return Object.setPrototypeOf(o, proto); + }; + var isSignedData = (o) => { + return !!o && !!Object.getPrototypeOf(o)?._isSignedData; + }; + var verifySignatureData = function(height, data, additionalData) { + if (!this) { + throw new ChelErrorSignatureError("Missing contract state"); + } + if (!isRawSignedData(data)) { + throw new ChelErrorSignatureError("Invalid message format"); + } + if (!Number.isSafeInteger(height) || height < 0) { + throw new ChelErrorSignatureError(`Height ${height} is invalid or out of range`); + } + const [serializedMessage, sKeyId, signature] = data._signedData; + const designatedKey = this._vm?.authorizedKeys?.[sKeyId]; + if (!designatedKey || height > designatedKey._notAfterHeight || height < designatedKey._notBeforeHeight || !designatedKey.purpose.includes("sig")) { + if ("") { + console.error(`Key ${sKeyId} is unauthorized or expired for the current contract`, { designatedKey, height, state: JSON.parse(JSON.stringify((0, import_sbp2.default)("state/vuex/state"))) }); + Promise.reject(new ChelErrorSignatureKeyUnauthorized(`Key ${sKeyId} is unauthorized or expired for the current contract`)); + } + throw new ChelErrorSignatureKeyUnauthorized(`Key ${sKeyId} is unauthorized or expired for the current contract`); + } + const deserializedKey = designatedKey.data; + const payloadToSign = blake32Hash(`${blake32Hash(additionalData)}${blake32Hash(serializedMessage)}`); + try { + verifySignature(deserializedKey, payloadToSign, signature); + const message = JSON.parse(serializedMessage); + return [sKeyId, message]; + } catch (e) { + throw new ChelErrorSignatureError(e?.message || e); + } + }; + var signedIncomingData = (contractID, state, data, height, additionalData, mapperFn) => { + const stringValueFn = () => data; + let verifySignedValue; + const verifySignedValueFn = () => { + if (verifySignedValue) { + return verifySignedValue[1]; + } + verifySignedValue = verifySignatureData.call(state || rootStateFn()[contractID], height, data, additionalData); + if (mapperFn) + verifySignedValue[1] = mapperFn(verifySignedValue[1]); + return verifySignedValue[1]; + }; + return wrapper({ + get signingKeyId() { + if (verifySignedValue) + return verifySignedValue[0]; + return signedDataKeyId(data); + }, + get serialize() { + return stringValueFn; + }, + get context() { + return [contractID, data, height, additionalData]; + }, + get toString() { + return () => JSON.stringify(this.serialize()); + }, + get valueOf() { + return verifySignedValueFn; + }, + get toJSON() { + return this.serialize; + }, + get get() { + return (k) => k !== "_signedData" ? data[k] : void 0; + } + }); + }; + var signedDataKeyId = (data) => { + if (!isRawSignedData(data)) { + throw new ChelErrorSignatureError("Invalid message format"); + } + return data._signedData[1]; + }; + var isRawSignedData = (data) => { + if (!data || typeof data !== "object" || !has(data, "_signedData") || !Array.isArray(data._signedData) || data._signedData.length !== 3 || data._signedData.map((v) => typeof v).filter((v) => v !== "string").length !== 0) { + return false; + } + return true; + }; + var rawSignedIncomingData = (data) => { + if (!isRawSignedData(data)) { + throw new ChelErrorSignatureError("Invalid message format"); + } + const stringValueFn = () => data; + let verifySignedValue; + const verifySignedValueFn = () => { + if (verifySignedValue) { + return verifySignedValue[1]; + } + verifySignedValue = [data._signedData[1], JSON.parse(data._signedData[0])]; + return verifySignedValue[1]; + }; + return wrapper({ + get signingKeyId() { + if (verifySignedValue) + return verifySignedValue[0]; + return signedDataKeyId(data); + }, + get serialize() { + return stringValueFn; + }, + get toString() { + return () => JSON.stringify(this.serialize()); + }, + get valueOf() { + return verifySignedValueFn; + }, + get toJSON() { + return this.serialize; + }, + get get() { + return (k) => k !== "_signedData" ? data[k] : void 0; + } + }); + }; + + // shared/domains/chelonia/encryptedData.js + var rootStateFn2 = () => (0, import_sbp3.default)("chelonia/rootState"); + var proto2 = Object.create(null, { + _isEncryptedData: { + value: true + } + }); + var wrapper2 = (o) => { + return Object.setPrototypeOf(o, proto2); + }; + var isEncryptedData = (o) => { + return !!o && !!Object.getPrototypeOf(o)?._isEncryptedData; + }; + var decryptData = function(height, data, additionalKeys, additionalData, validatorFn) { + if (!this) { + throw new ChelErrorDecryptionError("Missing contract state"); + } + if (typeof data.valueOf === "function") + data = data.valueOf(); + if (!isRawEncryptedData(data)) { + throw new ChelErrorDecryptionError("Invalid message format"); + } + const [eKeyId, message] = data; + const key = additionalKeys[eKeyId]; + if (!key) { + throw new ChelErrorDecryptionKeyNotFound(`Key ${eKeyId} not found`); + } + const designatedKey = this._vm?.authorizedKeys?.[eKeyId]; + if (!designatedKey || height > designatedKey._notAfterHeight || height < designatedKey._notBeforeHeight || !designatedKey.purpose.includes("enc")) { + throw new ChelErrorUnexpected(`Key ${eKeyId} is unauthorized or expired for the current contract`); + } + const deserializedKey = typeof key === "string" ? deserializeKey(key) : key; + try { + const result = JSON.parse(decrypt(deserializedKey, message, additionalData)); + if (typeof validatorFn === "function") + validatorFn(result, eKeyId); + return result; + } catch (e) { + throw new ChelErrorDecryptionError(e?.message || e); + } + }; + var encryptedIncomingData = (contractID, state, data, height, additionalKeys, additionalData, validatorFn) => { + let decryptedValue; + const decryptedValueFn = () => { + if (decryptedValue) { + return decryptedValue; + } + if (!state || !additionalKeys) { + const rootState = rootStateFn2(); + state = state || rootState[contractID]; + additionalKeys = additionalKeys ?? rootState.secretKeys; + } + decryptedValue = decryptData.call(state, height, data, additionalKeys, additionalData || "", validatorFn); + if (isRawSignedData(decryptedValue)) { + decryptedValue = signedIncomingData(contractID, state, decryptedValue, height, additionalData || ""); + } + return decryptedValue; + }; + return wrapper2({ + get encryptionKeyId() { + return encryptedDataKeyId(data); + }, + get serialize() { + return () => data; + }, + get toString() { + return () => JSON.stringify(this.serialize()); + }, + get valueOf() { + return decryptedValueFn; + }, + get toJSON() { + return this.serialize; + } + }); + }; + var encryptedIncomingForeignData = (contractID, _0, data, _1, additionalKeys, additionalData, validatorFn) => { + let decryptedValue; + const decryptedValueFn = () => { + if (decryptedValue) { + return decryptedValue; + } + const rootState = rootStateFn2(); + const state = rootState[contractID]; + decryptedValue = decryptData.call(state, NaN, data, additionalKeys ?? rootState.secretKeys, additionalData || "", validatorFn); + if (isRawSignedData(decryptedValue)) { + return signedIncomingData(contractID, state, decryptedValue, NaN, additionalData || ""); + } + return decryptedValue; + }; + return wrapper2({ + get encryptionKeyId() { + return encryptedDataKeyId(data); + }, + get serialize() { + return () => data; + }, + get toString() { + return () => JSON.stringify(this.serialize()); + }, + get valueOf() { + return decryptedValueFn; + }, + get toJSON() { + return this.serialize; + } + }); + }; + var encryptedDataKeyId = (data) => { + if (!isRawEncryptedData(data)) { + throw new ChelErrorDecryptionError("Invalid message format"); + } + return data[0]; + }; + var isRawEncryptedData = (data) => { + if (!Array.isArray(data) || data.length !== 2 || data.map((v) => typeof v).filter((v) => v !== "string").length !== 0) { + return false; + } + return true; + }; + var unwrapMaybeEncryptedData = (data) => { + if (isEncryptedData(data)) { + if (false) + return; + try { + return { + encryptionKeyId: data.encryptionKeyId, + data: data.valueOf() + }; + } catch (e) { + console.warn("unwrapMaybeEncryptedData: Unable to decrypt", e); + } + } else { + return { + encryptionKeyId: null, + data + }; + } + }; + var maybeEncryptedIncomingData = (contractID, state, data, height, additionalKeys, additionalData, validatorFn) => { + if (isRawEncryptedData(data)) { + return encryptedIncomingData(contractID, state, data, height, additionalKeys, additionalData, validatorFn); + } else { + validatorFn?.(data, ""); + return data; + } + }; + + // shared/serdes/index.js + var raw = Symbol("raw"); + var serdesTagSymbol = Symbol("tag"); + var serdesSerializeSymbol = Symbol("serialize"); + var serdesDeserializeSymbol = Symbol("deserialize"); + var rawResult = (obj) => { + Object.defineProperty(obj, raw, { value: true }); + return obj; + }; + var serializer = (data) => { + const verbatim = []; + const transferables = /* @__PURE__ */ new Set(); + const revokables = /* @__PURE__ */ new Set(); + const result = JSON.parse(JSON.stringify(data, (_key, value) => { + if (value && value[raw]) + return value; + if (value === void 0) + return rawResult(["_", "_"]); + if (!value) + return value; + if (Array.isArray(value) && value[0] === "_") + return rawResult(["_", "_", ...value]); + if (value instanceof Map) { + return rawResult(["_", "Map", Array.from(value.entries())]); + } + if (value instanceof Set) { + return rawResult(["_", "Set", Array.from(value.entries())]); + } + if (value instanceof Error || value instanceof Blob || value instanceof File) { + const pos = verbatim.length; + verbatim[verbatim.length] = value; + return rawResult(["_", "_ref", pos]); + } + if (value instanceof MessagePort || value instanceof ReadableStream || value instanceof WritableStream || value instanceof ArrayBuffer) { + const pos = verbatim.length; + verbatim[verbatim.length] = value; + transferables.add(value); + return rawResult(["_", "_ref", pos]); + } + if (ArrayBuffer.isView(value)) { + const pos = verbatim.length; + verbatim[verbatim.length] = value; + transferables.add(value.buffer); + return rawResult(["_", "_ref", pos]); + } + if (typeof value === "function") { + const mc = new MessageChannel(); + mc.port1.onmessage = async (ev) => { + try { + try { + const result2 = await value(...deserializer(ev.data[1])); + const { data: data2, transferables: transferables2 } = serializer(result2); + ev.data[0].postMessage([true, data2], transferables2); + } catch (e) { + const { data: data2, transferables: transferables2 } = serializer(e); + ev.data[0].postMessage([false, data2], transferables2); + } + } catch (e) { + console.error("Async error on onmessage handler", e); + } + }; + transferables.add(mc.port2); + revokables.add(mc.port1); + return rawResult(["_", "_fn", mc.port2]); + } + const proto3 = Object.getPrototypeOf(value); + if (proto3?.constructor?.[serdesTagSymbol] && proto3.constructor[serdesSerializeSymbol]) { + return rawResult(["_", "_custom", proto3.constructor[serdesTagSymbol], proto3.constructor[serdesSerializeSymbol](value)]); + } + return value; + }), (_key, value) => { + if (Array.isArray(value) && value[0] === "_" && value[1] === "_ref") { + return verbatim[value[2]]; + } + return value; + }); + return { + data: result, + transferables: Array.from(transferables), + revokables: Array.from(revokables) + }; + }; + var deserializerTable = /* @__PURE__ */ Object.create(null); + var deserializer = (data) => { + const verbatim = []; + return JSON.parse(JSON.stringify(data, (_key, value) => { + if (value && typeof value === "object" && !Array.isArray(value) && Object.getPrototypeOf(value) !== Object.prototype) { + const pos = verbatim.length; + verbatim[verbatim.length] = value; + return rawResult(["_", "_ref", pos]); + } + return value; + }), (_key, value) => { + if (Array.isArray(value) && value[0] === "_") { + switch (value[1]) { + case "_": + if (value.length >= 3) { + return value.slice(2); + } else { + return void 0; + } + case "Map": + return new Map(value[2]); + case "Set": + return new Set(value[2]); + case "_custom": + if (deserializerTable[value[2]]) { + return deserializerTable[value[2]](value[3]); + } else { + throw new Error("Invalid or unknown tag: " + value[2]); + } + case "_ref": + return verbatim[value[2]]; + case "_fn": { + const mp = value[2]; + return (...args) => { + return new Promise((resolve, reject) => { + const mc = new MessageChannel(); + const { data: data2, transferables } = serializer(args); + mc.port1.onmessage = (ev) => { + if (ev.data[0]) { + resolve(deserializer(ev.data[1])); + } else { + reject(deserializer(ev.data[1])); + } + }; + mp.postMessage([mc.port2, data2], [mc.port2, ...transferables]); + }); + }; + } + } + } + return value; + }); + }; + deserializer.register = (y) => { + if (typeof y === "function" && typeof y[serdesTagSymbol] === "string" && typeof y[serdesDeserializeSymbol] === "function") { + deserializerTable[y[serdesTagSymbol]] = y[serdesDeserializeSymbol].bind(y); + } + }; + + // shared/domains/chelonia/GIMessage.js + var decryptedAndVerifiedDeserializedMessage = (head, headJSON, contractID, parsedMessage, additionalKeys, state) => { + const op = head.op; + const height = head.height; + const message = op === GIMessage.OP_ACTION_ENCRYPTED ? encryptedIncomingData(contractID, state, parsedMessage, height, additionalKeys, headJSON, void 0) : parsedMessage; + if ([GIMessage.OP_KEY_ADD, GIMessage.OP_KEY_UPDATE].includes(op)) { + return message.map((key) => { + return maybeEncryptedIncomingData(contractID, state, key, height, additionalKeys, headJSON, (key2, eKeyId) => { + if (key2.meta?.private?.content) { + key2.meta.private.content = encryptedIncomingData(contractID, state, key2.meta.private.content, height, additionalKeys, headJSON, (value) => { + const computedKeyId = keyId(value); + if (computedKeyId !== key2.id) { + throw new Error(`Key ID mismatch. Expected to decrypt key ID ${key2.id} but got ${computedKeyId}`); + } + }); + } + if (key2.meta?.keyRequest?.reference) { + try { + key2.meta.keyRequest.reference = maybeEncryptedIncomingData(contractID, state, key2.meta.keyRequest.reference, height, additionalKeys, headJSON)?.valueOf(); + } catch { + delete key2.meta.keyRequest.reference; + } + } + if (key2.meta?.keyRequest?.contractID) { + try { + key2.meta.keyRequest.contractID = maybeEncryptedIncomingData(contractID, state, key2.meta.keyRequest.contractID, height, additionalKeys, headJSON)?.valueOf(); + } catch { + delete key2.meta.keyRequest.contractID; + } + } + }); + }); + } + if (op === GIMessage.OP_CONTRACT) { + message.keys = message.keys?.map((key, eKeyId) => { + return maybeEncryptedIncomingData(contractID, state, key, height, additionalKeys, headJSON, (key2) => { + if (!key2.meta?.private?.content) + return; + const decryptionFn = message.foreignContractID ? encryptedIncomingForeignData : encryptedIncomingData; + const decryptionContract = message.foreignContractID ? message.foreignContractID : contractID; + key2.meta.private.content = decryptionFn(decryptionContract, state, key2.meta.private.content, height, additionalKeys, headJSON, (value) => { + const computedKeyId = keyId(value); + if (computedKeyId !== key2.id) { + throw new Error(`Key ID mismatch. Expected to decrypt key ID ${key2.id} but got ${computedKeyId}`); + } + }); + }); + }); + } + if (op === GIMessage.OP_KEY_SHARE) { + return maybeEncryptedIncomingData(contractID, state, message, height, additionalKeys, headJSON, (message2) => { + message2.keys?.forEach((key) => { + if (!key.meta?.private?.content) + return; + const decryptionFn = message2.foreignContractID ? encryptedIncomingForeignData : encryptedIncomingData; + const decryptionContract = message2.foreignContractID || contractID; + key.meta.private.content = decryptionFn(decryptionContract, state, key.meta.private.content, height, additionalKeys, headJSON, (value) => { + const computedKeyId = keyId(value); + if (computedKeyId !== key.id) { + throw new Error(`Key ID mismatch. Expected to decrypt key ID ${key.id} but got ${computedKeyId}`); + } + }); + }); + }); + } + if (op === GIMessage.OP_KEY_REQUEST) { + return maybeEncryptedIncomingData(contractID, state, message, height, additionalKeys, headJSON, (msg) => { + msg.replyWith = signedIncomingData(msg.contractID, void 0, msg.replyWith, msg.height, headJSON); + }); + } + if (op === GIMessage.OP_ACTION_UNENCRYPTED && isRawSignedData(message)) { + return signedIncomingData(contractID, state, message, height, headJSON); + } + if (op === GIMessage.OP_ACTION_ENCRYPTED) { + return message; + } + if (op === GIMessage.OP_KEY_DEL) { + return message.map((key) => { + return maybeEncryptedIncomingData(contractID, state, key, height, additionalKeys, headJSON, void 0); + }); + } + if (op === GIMessage.OP_KEY_REQUEST_SEEN) { + return maybeEncryptedIncomingData(contractID, state, parsedMessage, height, additionalKeys, headJSON, void 0); + } + if (op === GIMessage.OP_ATOMIC) { + return message.map(([opT, opV]) => [ + opT, + decryptedAndVerifiedDeserializedMessage({ ...head, op: opT }, headJSON, contractID, opV, additionalKeys, state) + ]); + } + return message; + }; + var _GIMessage = class { + _mapping; + _head; + _message; + _signedMessageData; + _direction; + _decryptedValue; + _innerSigningKeyId; + static createV1_0({ + contractID, + previousHEAD = null, + height = Number.MAX_SAFE_INTEGER, + op, + manifest + }) { + const head = { + version: "1.0.0", + previousHEAD, + height, + contractID, + op: op[0], + manifest + }; + return new this(messageToParams(head, op[1])); + } + static cloneWith(targetHead, targetOp, sources) { + const head = Object.assign({}, targetHead, sources); + return new this(messageToParams(head, targetOp[1])); + } + static deserialize(value, additionalKeys, state) { + if (!value) + throw new Error(`deserialize bad value: ${value}`); + const { head: headJSON, ...parsedValue } = JSON.parse(value); + const head = JSON.parse(headJSON); + const contractID = head.op === _GIMessage.OP_CONTRACT ? createCID(value) : head.contractID; + if (!state?._vm?.authorizedKeys && head.op === _GIMessage.OP_CONTRACT) { + const value2 = rawSignedIncomingData(parsedValue); + const authorizedKeys = Object.fromEntries(value2.valueOf()?.keys.map((k) => [k.id, k])); + state = { + _vm: { + authorizedKeys + } + }; + } + const signedMessageData = signedIncomingData(contractID, state, parsedValue, head.height, headJSON, (message) => decryptedAndVerifiedDeserializedMessage(head, headJSON, contractID, message, additionalKeys, state)); + return new this({ + direction: "incoming", + mapping: { key: createCID(value), value }, + head, + signedMessageData + }); + } + static deserializeHEAD(value) { + if (!value) + throw new Error(`deserialize bad value: ${value}`); + let head, hash; + const result = { + get head() { + if (head === void 0) { + head = JSON.parse(JSON.parse(value).head); + } + return head; + }, + get hash() { + if (!hash) { + hash = createCID(value); + } + return hash; + }, + get contractID() { + return result.head?.contractID ?? result.hash; + }, + description() { + const type = this.head.op; + return ``; + }, + get isFirstMessage() { + return !result.head?.contractID; + } + }; + return result; + } + constructor(params) { + this._direction = params.direction; + this._mapping = params.mapping; + this._head = params.head; + this._signedMessageData = params.signedMessageData; + const type = this.opType(); + let atomicTopLevel = true; + const validate = (type2, message) => { + switch (type2) { + case _GIMessage.OP_CONTRACT: + if (!this.isFirstMessage() || !atomicTopLevel) + throw new Error("OP_CONTRACT: must be first message"); + break; + case _GIMessage.OP_ATOMIC: + if (!atomicTopLevel) { + throw new Error("OP_ATOMIC not allowed inside of OP_ATOMIC"); + } + if (!Array.isArray(message)) { + throw new TypeError("OP_ATOMIC must be of an array type"); + } + atomicTopLevel = false; + message.forEach(([t, m]) => validate(t, m)); + break; + case _GIMessage.OP_KEY_ADD: + case _GIMessage.OP_KEY_DEL: + case _GIMessage.OP_KEY_UPDATE: + if (!Array.isArray(message)) + throw new TypeError("OP_KEY_{ADD|DEL|UPDATE} must be of an array type"); + break; + case _GIMessage.OP_KEY_SHARE: + case _GIMessage.OP_KEY_REQUEST: + case _GIMessage.OP_KEY_REQUEST_SEEN: + case _GIMessage.OP_ACTION_ENCRYPTED: + case _GIMessage.OP_ACTION_UNENCRYPTED: + break; + default: + throw new Error(`unsupported op: ${type2}`); + } + }; + Object.defineProperty(this, "_message", { + get: ((validated) => () => { + const message = this._signedMessageData.valueOf(); + if (!validated) { + validate(type, message); + validated = true; + } + return message; + })() + }); + } + decryptedValue() { + if (this._decryptedValue) + return this._decryptedValue; + try { + const value = this.message(); + const data = unwrapMaybeEncryptedData(value); + if (data?.data) { + if (isSignedData(data.data)) { + this._innerSigningKeyId = data.data.signingKeyId; + this._decryptedValue = data.data.valueOf(); + } else { + this._decryptedValue = data.data; + } + } + return this._decryptedValue; + } catch { + return void 0; + } + } + innerSigningKeyId() { + if (!this._decryptedValue) { + this.decryptedValue(); + } + return this._innerSigningKeyId; + } + head() { + return this._head; + } + message() { + return this._message; + } + op() { + return [this.head().op, this.message()]; + } + rawOp() { + return [this.head().op, this._signedMessageData]; + } + opType() { + return this.head().op; + } + opValue() { + return this.message(); + } + signingKeyId() { + return this._signedMessageData.signingKeyId; + } + manifest() { + return this.head().manifest; + } + description() { + const type = this.opType(); + let desc = ``; + } + isFirstMessage() { + return !this.head().contractID; + } + contractID() { + return this.head().contractID || this.hash(); + } + serialize() { + return this._mapping.value; + } + hash() { + return this._mapping.key; + } + height() { + return this._head.height; + } + id() { + throw new Error("GIMessage.id() was called but it has been removed"); + } + direction() { + return this._direction; + } + static get [serdesTagSymbol]() { + return "GIMessage"; + } + static [serdesSerializeSymbol](m) { + return [m.serialize(), m.direction(), m.decryptedValue(), m.innerSigningKeyId()]; + } + static [serdesDeserializeSymbol]([serialized, direction, decryptedValue, innerSigningKeyId]) { + const m = _GIMessage.deserialize(serialized); + m._direction = direction; + m._decryptedValue = decryptedValue; + m._innerSigningKeyId = innerSigningKeyId; + return m; + } + }; + var GIMessage = _GIMessage; + __publicField(GIMessage, "OP_CONTRACT", "c"); + __publicField(GIMessage, "OP_ACTION_ENCRYPTED", "ae"); + __publicField(GIMessage, "OP_ACTION_UNENCRYPTED", "au"); + __publicField(GIMessage, "OP_KEY_ADD", "ka"); + __publicField(GIMessage, "OP_KEY_DEL", "kd"); + __publicField(GIMessage, "OP_KEY_UPDATE", "ku"); + __publicField(GIMessage, "OP_PROTOCOL_UPGRADE", "pu"); + __publicField(GIMessage, "OP_PROP_SET", "ps"); + __publicField(GIMessage, "OP_PROP_DEL", "pd"); + __publicField(GIMessage, "OP_CONTRACT_AUTH", "ca"); + __publicField(GIMessage, "OP_CONTRACT_DEAUTH", "cd"); + __publicField(GIMessage, "OP_ATOMIC", "a"); + __publicField(GIMessage, "OP_KEY_SHARE", "ks"); + __publicField(GIMessage, "OP_KEY_REQUEST", "kr"); + __publicField(GIMessage, "OP_KEY_REQUEST_SEEN", "krs"); + function messageToParams(head, message) { + let mapping; + return { + direction: has(message, "recreate") ? "outgoing" : "incoming", + get mapping() { + if (!mapping) { + const headJSON = JSON.stringify(head); + const messageJSON = { ...message.serialize(headJSON), head: headJSON }; + const value = JSON.stringify(messageJSON); + mapping = { + key: createCID(value), + value + }; + } + return mapping; + }, + head, + signedMessageData: message + }; + } + + // shared/domains/chelonia/Secret.js + var wm = /* @__PURE__ */ new WeakMap(); + var Secret = class { + static [serdesDeserializeSymbol](secret) { + return new this(secret); + } + static [serdesSerializeSymbol](secret) { + return wm.get(secret); + } + static get [serdesTagSymbol]() { + return "__chelonia_Secret"; + } + constructor(value) { + wm.set(this, value); + } + valueOf() { + return wm.get(this); + } + }; + + // shared/domains/chelonia/utils.js + var MAX_EVENTS_AFTER = Number.parseInt("", 10) || Infinity; + var findKeyIdByName = (state, name) => state._vm?.authorizedKeys && Object.values(state._vm.authorizedKeys).find((k) => k.name === name && k._notAfterHeight == null)?.id; + var findForeignKeysByContractID = (state, contractID) => state._vm?.authorizedKeys && Object.values(state._vm.authorizedKeys).filter((k) => k._notAfterHeight == null && k.foreignKey?.includes(contractID)).map((k) => k.id); + + // frontend/model/contracts/shared/constants.js + var MAX_HASH_LEN = 300; + var STATUS_OPEN = "open"; + var STATUS_PASSED = "passed"; + var STATUS_FAILED = "failed"; + var STATUS_EXPIRING = "expiring"; + var STATUS_EXPIRED = "expired"; + var STATUS_CANCELLED = "cancelled"; + var CHATROOM_NAME_LIMITS_IN_CHARS = 50; + var CHATROOM_DESCRIPTION_LIMITS_IN_CHARS = 280; + var CHATROOM_MAX_MESSAGE_LEN = 2e4; + var CHATROOM_MAX_MESSAGES = 20; + var CHATROOM_ACTIONS_PER_PAGE = 40; + var CHATROOM_MEMBER_MENTION_SPECIAL_CHAR = "@"; + var MESSAGE_RECEIVE_RAW = "message-receive-raw"; + var CHATROOM_TYPES = { + DIRECT_MESSAGE: "direct-message", + GROUP: "group" + }; + var CHATROOM_PRIVACY_LEVEL = { + GROUP: "group", + PRIVATE: "private", + PUBLIC: "public" + }; + var MESSAGE_TYPES = { + POLL: "poll", + TEXT: "text", + INTERACTIVE: "interactive", + NOTIFICATION: "notification" + }; + var MESSAGE_NOTIFICATIONS = { + ADD_MEMBER: "add-member", + JOIN_MEMBER: "join-member", + LEAVE_MEMBER: "leave-member", + KICK_MEMBER: "kick-member", + UPDATE_DESCRIPTION: "update-description", + UPDATE_NAME: "update-name" + }; + var POLL_TYPES = { + SINGLE_CHOICE: "single-vote", + MULTIPLE_CHOICES: "multiple-votes" + }; + var POLL_STATUS = { + ACTIVE: "active", + CLOSED: "closed" + }; + + // frontend/model/contracts/shared/functions.js + var import_sbp5 = __toESM(__require("@sbp/sbp")); + + // frontend/model/contracts/shared/time.js + var MINS_MILLIS = 6e4; + var HOURS_MILLIS = 60 * MINS_MILLIS; + var DAYS_MILLIS = 24 * HOURS_MILLIS; + var MONTHS_MILLIS = 30 * DAYS_MILLIS; + var YEARS_MILLIS = 365 * DAYS_MILLIS; + + // frontend/model/contracts/shared/functions.js + function createMessage({ meta, data, hash, height, state, pending, innerSigningContractID }) { + const { type, text, replyingMessage, attachments } = data; + const { createdDate } = meta; + const newMessage = { + type, + hash, + height, + from: innerSigningContractID, + datetime: new Date(createdDate).toISOString() + }; + if (pending) { + newMessage.pending = true; + } + if (type === MESSAGE_TYPES.TEXT) { + newMessage.text = text; + if (replyingMessage) { + newMessage.replyingMessage = replyingMessage; + } + if (attachments) { + newMessage.attachments = attachments; + } + } else if (type === MESSAGE_TYPES.POLL) { + newMessage.pollData = { + ...data.pollData, + creatorID: innerSigningContractID, + status: POLL_STATUS.ACTIVE, + options: data.pollData.options.map((opt) => ({ ...opt, voted: [] })) + }; + } else if (type === MESSAGE_TYPES.NOTIFICATION) { + const params = { + channelName: state?.attributes.name, + channelDescription: state?.attributes.description, + ...data.notification + }; + delete params.type; + newMessage.notification = { type: data.notification.type, params }; + } else if (type === MESSAGE_TYPES.INTERACTIVE) { + newMessage.proposal = data.proposal; + } + return newMessage; + } + async function leaveChatRoom(contractID, state) { + if (await (0, import_sbp5.default)("chelonia/contract/isSyncing", contractID, { firstSync: true })) { + return; + } + (0, import_sbp5.default)("gi.actions/identity/kv/deleteChatRoomUnreadMessages", { contractID }).catch((e) => { + console.error("[leaveChatroom] Error at deleteChatRoomUnreadMessages ", contractID, e); + }); + (0, import_sbp5.default)("okTurtles.events/emit", NEW_CHATROOM_UNREAD_POSITION, { chatRoomID: contractID }); + } + function findMessageIdx(hash, messages = []) { + for (let i = messages.length - 1; i >= 0; i--) { + if (messages[i].hash === hash) { + return i; + } + } + return -1; + } + function makeMentionFromUserID(userID) { + return { + me: userID ? `${CHATROOM_MEMBER_MENTION_SPECIAL_CHAR}${userID}` : "", + all: `${CHATROOM_MEMBER_MENTION_SPECIAL_CHAR}all` + }; + } + var referenceTally = (selector) => { + const delta = { + "retain": 1, + "release": -1 + }; + return { + [selector]: (parentContractID, childContractIDs, op) => { + if (!Array.isArray(childContractIDs)) + childContractIDs = [childContractIDs]; + if (op !== "retain" && op !== "release") + throw new Error("Invalid operation"); + for (const childContractID of childContractIDs) { + const key = `${selector}-${parentContractID}-${childContractID}`; + const count = (0, import_sbp5.default)("okTurtles.data/get", key); + (0, import_sbp5.default)("okTurtles.data/set", key, (count || 0) + delta[op]); + if (count != null) + return; + (0, import_sbp5.default)("chelonia/queueInvocation", parentContractID, () => { + const count2 = (0, import_sbp5.default)("okTurtles.data/get", key); + (0, import_sbp5.default)("okTurtles.data/delete", key); + if (count2 && count2 !== Math.sign(count2)) { + console.warn(`[${selector}] Unexpected value`, parentContractID, childContractID, count2); + if ("") { + Promise.reject(new Error(`[${selector}] Unexpected value ${parentContractID} ${childContractID}: ${count2}`)); + } + } + switch (Math.sign(count2)) { + case -1: + (0, import_sbp5.default)("chelonia/contract/release", childContractID).catch((e) => { + console.error(`[${selector}] Error calling release`, parentContractID, childContractID, e); + }); + break; + case 1: + (0, import_sbp5.default)("chelonia/contract/retain", childContractID).catch((e) => console.error(`[${selector}] Error calling retain`, parentContractID, childContractID, e)); + break; + } + }).catch((e) => { + console.error(`[${selector}] Error in queued invocation`, parentContractID, childContractID, e); + }); + } + } + }; + }; + + // frontend/model/contracts/shared/getters/chatroom.js + var chatroom_default = { + chatRoomSettings(state, getters) { + return getters.currentChatRoomState.settings || {}; + }, + chatRoomAttributes(state, getters) { + return getters.currentChatRoomState.attributes || {}; + }, + chatRoomMembers(state, getters) { + return getters.currentChatRoomState.members || {}; + }, + chatRoomRecentMessages(state, getters) { + return getters.currentChatRoomState.messages || []; + }, + chatRoomPinnedMessages(state, getters) { + return (getters.currentChatRoomState.pinnedMessages || []).sort((a, b) => a.height < b.height ? 1 : -1); + } + }; + + // frontend/model/contracts/shared/types.js + var inviteType = objectOf({ + inviteKeyId: string, + creatorID: string, + invitee: optional(string) + }); + var chatRoomAttributesType = objectOf({ + name: stringMax(CHATROOM_NAME_LIMITS_IN_CHARS), + description: stringMax(CHATROOM_DESCRIPTION_LIMITS_IN_CHARS), + creatorID: optional(string), + adminIDs: optional(arrayOf(string)), + type: unionOf(...Object.values(CHATROOM_TYPES).map((v) => literalOf(v))), + privacyLevel: unionOf(...Object.values(CHATROOM_PRIVACY_LEVEL).map((v) => literalOf(v))) + }); + var messageType = objectMaybeOf({ + type: unionOf(...Object.values(MESSAGE_TYPES).map((v) => literalOf(v))), + text: string, + proposal: objectOf({ + proposalId: string, + proposalType: string, + proposalData: object, + expires_date_ms: number, + createdDate: string, + creatorID: string, + status: unionOf(...[ + STATUS_OPEN, + STATUS_PASSED, + STATUS_FAILED, + STATUS_EXPIRING, + STATUS_EXPIRED, + STATUS_CANCELLED + ].map((v) => literalOf(v))) + }), + notification: objectMaybeOf({ + type: unionOf(...Object.values(MESSAGE_NOTIFICATIONS).map((v) => literalOf(v))), + params: mapOf(string, string) + }), + attachments: optional(arrayOf(objectOf({ + name: string, + mimeType: string, + size: numberRange(1, Number.MAX_SAFE_INTEGER), + dimension: optional(objectOf({ + width: number, + height: number + })), + downloadData: objectOf({ + manifestCid: string, + downloadParams: optional(object) + }) + }))), + replyingMessage: objectOf({ + hash: string, + text: string + }), + pollData: objectOf({ + question: string, + options: arrayOf(objectOf({ id: string, value: string })), + expires_date_ms: number, + hideVoters: boolean, + pollType: unionOf(...Object.values(POLL_TYPES).map((v) => literalOf(v))) + }), + onlyVisibleTo: arrayOf(string) + }); + + // frontend/model/contracts/chatroom.js + var GIChatroomAlreadyMemberError = ChelErrorGenerator("GIChatroomAlreadyMemberError"); + var GIChatroomNotMemberError = ChelErrorGenerator("GIChatroomNotMemberError"); + function createNotificationData(notificationType, moreParams = {}) { + return { + type: MESSAGE_TYPES.NOTIFICATION, + notification: { + type: notificationType, + ...moreParams + } + }; + } + async function deleteEncryptedFiles(manifestCids, option) { + if (Object.values(option).reduce((a, c) => a || c, false)) { + if (!Array.isArray(manifestCids)) { + manifestCids = [manifestCids]; + } + await (0, import_sbp6.default)("gi.actions/identity/removeFiles", { manifestCids, option }); + } + } + function addMessage(state, message) { + state.messages.push(message); + if (state.renderingContext) { + return; + } + while (state.messages.length > CHATROOM_MAX_MESSAGES) { + state.messages.shift(); + } + } + (0, import_sbp6.default)("chelonia/defineContract", { + name: "gi.contracts/chatroom", + metadata: { + validate: objectOf({ + createdDate: string + }), + async create() { + return { + createdDate: await fetchServerTime() + }; + } + }, + getters: { + currentChatRoomState(state) { + return state; + }, + ...chatroom_default + }, + actions: { + "gi.contracts/chatroom": { + validate: objectOf({ + attributes: chatRoomAttributesType + }), + process({ data }, { state }) { + const initialState = merge({ + settings: { + actionsPerPage: CHATROOM_ACTIONS_PER_PAGE, + maxNameLength: CHATROOM_NAME_LIMITS_IN_CHARS, + maxDescriptionLength: CHATROOM_DESCRIPTION_LIMITS_IN_CHARS + }, + attributes: { + adminIDs: [], + deletedDate: null + }, + members: {}, + messages: [], + pinnedMessages: [] + }, data); + for (const key in initialState) { + state[key] = initialState[key]; + } + } + }, + "gi.contracts/chatroom/join": { + validate: actionRequireInnerSignature(objectOf({ + memberID: optional(string) + })), + process({ data, meta, hash, height, contractID, innerSigningContractID }, { state }) { + const memberID = data.memberID || innerSigningContractID; + if (!memberID) { + throw new Error("The new member must be given either explicitly or implcitly with an inner signature"); + } + if (!state.renderingContext) { + if (!state.members) { + state.members = {}; + } + if (state.members[memberID]) { + throw new GIChatroomAlreadyMemberError(`Can not join the chatroom which ${memberID} is already part of`); + } + } + state.members[memberID] = { joinedDate: meta.createdDate, joinedHeight: height }; + if (!state.attributes) + return; + if (state.attributes.type === CHATROOM_TYPES.DIRECT_MESSAGE) { + return; + } + const notificationType = memberID === innerSigningContractID ? MESSAGE_NOTIFICATIONS.JOIN_MEMBER : MESSAGE_NOTIFICATIONS.ADD_MEMBER; + const notificationData = createNotificationData(notificationType, notificationType === MESSAGE_NOTIFICATIONS.ADD_MEMBER ? { memberID, actorID: innerSigningContractID } : { memberID }); + addMessage(state, createMessage({ meta, hash, height, state, data: notificationData, innerSigningContractID })); + }, + sideEffect({ data, contractID, hash, meta, innerSigningContractID, height }, { state }) { + const memberID = data.memberID || innerSigningContractID; + (0, import_sbp6.default)("gi.contracts/chatroom/referenceTally", contractID, memberID, "retain"); + (0, import_sbp6.default)("chelonia/queueInvocation", contractID, async () => { + const state2 = await (0, import_sbp6.default)("chelonia/contract/state", contractID); + if (!state2?.members?.[memberID]) { + return; + } + const identityContractID = (0, import_sbp6.default)("state/vuex/state").loggedIn.identityContractID; + if (memberID === identityContractID) { + (0, import_sbp6.default)("gi.actions/identity/kv/initChatRoomUnreadMessages", { + contractID, + messageHash: hash, + createdHeight: height + }); + } + }).catch((e) => { + console.error("[gi.contracts/chatroom/join/sideEffect] Error at sideEffect", e?.message || e); + }); + } + }, + "gi.contracts/chatroom/rename": { + validate: actionRequireInnerSignature((data, { state, message: { innerSigningContractID } }) => { + objectOf({ name: stringMax(CHATROOM_NAME_LIMITS_IN_CHARS, "name") })(data); + if (state.attributes.creatorID !== innerSigningContractID) { + throw new TypeError(L("Only the channel creator can rename.")); + } + }), + process({ data, meta, hash, height, innerSigningContractID }, { state }) { + state.attributes["name"] = data.name; + const notificationData = createNotificationData(MESSAGE_NOTIFICATIONS.UPDATE_NAME, {}); + const newMessage = createMessage({ meta, hash, height, data: notificationData, state, innerSigningContractID }); + state.messages.push(newMessage); + } + }, + "gi.contracts/chatroom/changeDescription": { + validate: actionRequireInnerSignature((data, { state, message: { innerSigningContractID } }) => { + objectOf({ description: stringMax(CHATROOM_DESCRIPTION_LIMITS_IN_CHARS, "description") })(data); + if (state.attributes.creatorID !== innerSigningContractID) { + throw new TypeError(L("Only the channel creator can change description.")); + } + }), + process({ data, meta, hash, height, innerSigningContractID }, { state }) { + state.attributes["description"] = data.description; + const notificationData = createNotificationData(MESSAGE_NOTIFICATIONS.UPDATE_DESCRIPTION, {}); + addMessage(state, createMessage({ meta, hash, height, state, data: notificationData, innerSigningContractID })); + } + }, + "gi.contracts/chatroom/leave": { + validate: objectOf({ + memberID: optional(string) + }), + process({ data, meta, hash, height, contractID, innerSigningContractID }, { state }) { + const memberID = data.memberID || innerSigningContractID; + if (!memberID) { + throw new Error("The removed member must be given either explicitly or implcitly with an inner signature"); + } + const isKicked = innerSigningContractID && memberID !== innerSigningContractID; + if (!state.renderingContext) { + if (!state.members) { + throw new Error("Missing members state"); + } else if (!state.members[memberID]) { + throw new GIChatroomNotMemberError(`Can not leave the chatroom ${contractID} which ${memberID} is not part of`); + } + } + delete state.members[memberID]; + if (!state.attributes) + return; + if (state.attributes.type === CHATROOM_TYPES.DIRECT_MESSAGE) { + return; + } + const notificationType = !isKicked ? MESSAGE_NOTIFICATIONS.LEAVE_MEMBER : MESSAGE_NOTIFICATIONS.KICK_MEMBER; + const notificationData = createNotificationData(notificationType, { memberID }); + addMessage(state, createMessage({ + meta, + hash, + height, + data: notificationData, + state, + innerSigningContractID: !isKicked ? memberID : innerSigningContractID + })); + }, + async sideEffect({ data, hash, contractID, meta, innerSigningContractID }, { state }) { + const memberID = data.memberID || innerSigningContractID; + const itsMe = memberID === (0, import_sbp6.default)("state/vuex/state").loggedIn.identityContractID; + if (itsMe) { + await leaveChatRoom(contractID, state).catch((e) => { + console.error("[gi.contracts/chatroom/leave] Error at leaveChatRoom", e); + }); + } + (0, import_sbp6.default)("gi.contracts/chatroom/referenceTally", contractID, memberID, "release"); + (0, import_sbp6.default)("chelonia/queueInvocation", contractID, async () => { + const state2 = await (0, import_sbp6.default)("chelonia/contract/state", contractID); + if (!state2 || !!state2.members?.[data.memberID] || !state2.attributes) { + return; + } + if (!itsMe && state2.attributes.privacyLevel === CHATROOM_PRIVACY_LEVEL.PRIVATE) { + (0, import_sbp6.default)("gi.contracts/chatroom/rotateKeys", contractID, state2); + } + (0, import_sbp6.default)("gi.contracts/chatroom/removeForeignKeys", contractID, memberID, state2); + }).catch((e) => { + console.error("[gi.contracts/chatroom/leave/sideEffect] Error at sideEffect", e?.message || e); + }); + } + }, + "gi.contracts/chatroom/delete": { + validate: actionRequireInnerSignature((_, { state, meta, message: { innerSigningContractID } }) => { + if (state.attributes.creatorID !== innerSigningContractID) { + throw new TypeError(L("Only the channel creator can delete channel.")); + } + }), + process({ meta, contractID }, { state }) { + if (!state.attributes) + return; + state.attributes["deletedDate"] = meta.createdDate; + (0, import_sbp6.default)("gi.contracts/chatroom/pushSideEffect", contractID, ["gi.contracts/chatroom/referenceTally", contractID, Object.keys(state.members), "release"]); + for (const memberID in state.members) { + delete state.members[memberID]; + } + }, + async sideEffect({ contractID }, { state }) { + await leaveChatRoom(contractID, state); + } + }, + "gi.contracts/chatroom/addMessage": { + validate: actionRequireInnerSignature(messageType), + process({ direction, data, meta, hash, height, innerSigningContractID }, { state }) { + if (!state.messages) + return; + const existingMsg = state.messages.find((msg) => msg.hash === hash); + if (!existingMsg) { + const pending = direction === "outgoing"; + addMessage(state, createMessage({ meta, data, hash, height, state, pending, innerSigningContractID })); + } else if (direction !== "outgoing") { + delete existingMsg["pending"]; + } + }, + sideEffect({ contractID, hash, height, meta, data, innerSigningContractID }, { state, getters }) { + const me = (0, import_sbp6.default)("state/vuex/state").loggedIn.identityContractID; + if (me === innerSigningContractID && data.type !== MESSAGE_TYPES.INTERACTIVE) { + return; + } + const newMessage = createMessage({ meta, data, hash, height, state, innerSigningContractID }); + (0, import_sbp6.default)("okTurtles.events/emit", MESSAGE_RECEIVE_RAW, { + contractID, + data, + innerSigningContractID, + newMessage + }); + } + }, + "gi.contracts/chatroom/editMessage": { + validate: actionRequireInnerSignature(objectOf({ + hash: stringMax(MAX_HASH_LEN, "hash"), + createdHeight: number, + text: stringMax(CHATROOM_MAX_MESSAGE_LEN, "text") + })), + process({ data, meta }, { state }) { + if (!state.messages) + return; + const { hash, text } = data; + const fnEditMessage = (message) => { + message["text"] = text; + message["updatedDate"] = meta.createdDate; + if (state.renderingContext && message.pending) { + delete message["pending"]; + } + }; + [state.messages, state.pinnedMessages].forEach((messageArray) => { + const msgIndex = findMessageIdx(hash, messageArray); + if (msgIndex >= 0) { + fnEditMessage(messageArray[msgIndex]); + } + }); + }, + sideEffect({ contractID, hash, meta, data, innerSigningContractID }, { state, getters }) { + const me = (0, import_sbp6.default)("state/vuex/state").loggedIn.identityContractID; + if (me === innerSigningContractID || getters.chatRoomAttributes.type === CHATROOM_TYPES.DIRECT_MESSAGE) { + return; + } + (0, import_sbp6.default)("okTurtles.events/emit", MESSAGE_RECEIVE_RAW, { + contractID, + data, + innerSigningContractID + }); + } + }, + "gi.contracts/chatroom/deleteMessage": { + validate: actionRequireInnerSignature((data, { state, message: { innerSigningContractID }, contractID }) => { + objectOf({ + hash: stringMax(MAX_HASH_LEN, "hash"), + manifestCids: arrayOf(stringMax(MAX_HASH_LEN, "manifestCids")), + messageSender: stringMax(MAX_HASH_LEN, "messageSender") + })(data); + if (innerSigningContractID !== data.messageSender) { + if (state.attributes.type === CHATROOM_TYPES.DIRECT_MESSAGE) { + throw new TypeError(L("Only the person who sent the message can delete it.")); + } else if (!state.attributes.adminIDs.includes(innerSigningContractID)) { + throw new TypeError(L("Only the group creator and the person who sent the message can delete it.")); + } + } + }), + process({ data, innerSigningContractID }, { state }) { + if (!state.messages) + return; + [state.messages, state.pinnedMessages].forEach((messageArray) => { + const msgIndex = findMessageIdx(data.hash, messageArray); + if (msgIndex >= 0) { + messageArray.splice(msgIndex, 1); + } + for (const message of messageArray) { + if (message.replyingMessage?.hash === data.hash) { + message.replyingMessage.hash = null; + message.replyingMessage.text = L("Original message was removed by {user}", { + user: makeMentionFromUserID(innerSigningContractID).me + }); + } + } + }); + }, + sideEffect({ data, contractID, innerSigningContractID }) { + const rootState = (0, import_sbp6.default)("state/vuex/state"); + const me = rootState.loggedIn.identityContractID; + if (rootState.chatroom?.chatRoomScrollPosition?.[contractID] === data.hash) { + (0, import_sbp6.default)("okTurtles.events/emit", NEW_CHATROOM_UNREAD_POSITION, { + chatRoomID: contractID, + messageHash: null + }); + } + if (data.manifestCids.length) { + const option = { + shouldDeleteFile: me === innerSigningContractID, + shouldDeleteToken: me === data.messageSender + }; + deleteEncryptedFiles(data.manifestCids, option).catch((e) => { + console.error(`[gi.contracts/chatroom/deleteMessage/sideEffect] (${contractID}):`, e); + }); + } + if (me === innerSigningContractID) { + return; + } + (0, import_sbp6.default)("gi.actions/identity/kv/removeChatRoomUnreadMessage", { contractID, messageHash: data.hash }); + } + }, + "gi.contracts/chatroom/deleteAttachment": { + validate: actionRequireInnerSignature(objectOf({ + hash: stringMax(MAX_HASH_LEN, "hash"), + manifestCid: stringMax(MAX_HASH_LEN, "manifestCid"), + messageSender: stringMax(MAX_HASH_LEN, "messageSender") + })), + process({ data }, { state }) { + if (!state.messages) + return; + const fnDeleteAttachment = (message) => { + const oldAttachments = message.attachments; + if (Array.isArray(oldAttachments)) { + const newAttachments = oldAttachments.filter((attachment) => { + return attachment.downloadData.manifestCid !== data.manifestCid; + }); + message["attachments"] = newAttachments; + } + }; + [state.messages, state.pinnedMessages].forEach((messageArray) => { + const msgIndex = findMessageIdx(data.hash, messageArray); + if (msgIndex >= 0) { + fnDeleteAttachment(messageArray[msgIndex]); + } + }); + }, + sideEffect({ data, contractID, innerSigningContractID }) { + const me = (0, import_sbp6.default)("state/vuex/state").loggedIn.identityContractID; + const option = { + shouldDeleteFile: me === innerSigningContractID, + shouldDeleteToken: me === data.messageSender + }; + deleteEncryptedFiles(data.manifestCid, option).catch((e) => { + console.error(`[gi.contracts/chatroom/deleteAttachment/sideEffect] (${contractID}):`, e); + }); + } + }, + "gi.contracts/chatroom/makeEmotion": { + validate: actionRequireInnerSignature(objectOf({ + hash: stringMax(MAX_HASH_LEN, "hash"), + emoticon: string + })), + process({ data, innerSigningContractID }, { state }) { + if (!state.messages) + return; + const { hash, emoticon } = data; + const fnMakeEmotion = (message) => { + let emoticons = cloneDeep(message.emoticons || {}); + if (emoticons[emoticon]) { + const alreadyAdded = emoticons[emoticon].indexOf(innerSigningContractID); + if (alreadyAdded >= 0) { + emoticons[emoticon].splice(alreadyAdded, 1); + if (!emoticons[emoticon].length) { + delete emoticons[emoticon]; + if (!Object.keys(emoticons).length) { + emoticons = null; + } + } + } else { + emoticons[emoticon].push(innerSigningContractID); + } + } else { + emoticons[emoticon] = [innerSigningContractID]; + } + if (emoticons) { + message["emoticons"] = emoticons; + } else { + delete message["emoticons"]; + } + }; + [state.messages, state.pinnedMessages].forEach((messageArray) => { + const msgIndex = findMessageIdx(hash, messageArray); + if (msgIndex >= 0) { + fnMakeEmotion(messageArray[msgIndex]); + } + }); + } + }, + "gi.contracts/chatroom/voteOnPoll": { + validate: actionRequireInnerSignature(objectOf({ + hash: stringMax(MAX_HASH_LEN, "hash"), + votes: arrayOf(string), + votesAsString: string + })), + process({ data, meta, hash, height, innerSigningContractID }, { state }) { + if (!state.messages) + return; + const fnVoteOnPoll = (message) => { + const myVotes = data.votes; + const pollData = message.pollData; + const optsCopy = cloneDeep(pollData.options); + myVotes.forEach((optId) => { + optsCopy.find((x) => x.id === optId)?.voted.push(innerSigningContractID); + }); + message["pollData"] = { ...pollData, options: optsCopy }; + }; + [state.messages, state.pinnedMessages].forEach((messageArray) => { + const msgIndex = findMessageIdx(data.hash, messageArray); + if (msgIndex >= 0) { + fnVoteOnPoll(messageArray[msgIndex]); + } + }); + } + }, + "gi.contracts/chatroom/changeVoteOnPoll": { + validate: actionRequireInnerSignature(objectOf({ + hash: string, + votes: arrayOf(string), + votesAsString: string + })), + process({ data, meta, hash, height, innerSigningContractID }, { state }) { + if (!state.messages) + return; + const fnChangeVoteOnPoll = (message) => { + const myUpdatedVotes = data.votes; + const pollData = message.pollData; + const optsCopy = cloneDeep(pollData.options); + optsCopy.forEach((opt) => { + opt.voted = opt.voted.filter((votername) => votername !== innerSigningContractID); + }); + myUpdatedVotes.forEach((optId) => { + optsCopy.find((x) => x.id === optId)?.voted.push(innerSigningContractID); + }); + message["pollData"] = { ...pollData, options: optsCopy }; + }; + [state.messages, state.pinnedMessages].forEach((messageArray) => { + const msgIndex = findMessageIdx(data.hash, messageArray); + if (msgIndex >= 0) { + fnChangeVoteOnPoll(messageArray[msgIndex]); + } + }); + } + }, + "gi.contracts/chatroom/closePoll": { + validate: actionRequireInnerSignature(objectOf({ + hash: stringMax(MAX_HASH_LEN, "hash") + })), + process({ data }, { state }) { + if (!state.messages) + return; + const fnClosePoll = (message) => { + message.pollData["status"] = POLL_STATUS.CLOSED; + }; + [state.messages, state.pinnedMessages].forEach((messageArray) => { + const msgIndex = findMessageIdx(data.hash, messageArray); + if (msgIndex >= 0) { + fnClosePoll(messageArray[msgIndex]); + } + }); + } + }, + "gi.contracts/chatroom/pinMessage": { + validate: actionRequireInnerSignature(objectOf({ + message: object + })), + process({ data, innerSigningContractID }, { state }) { + if (!state.messages) + return; + const { message } = data; + state.pinnedMessages.unshift(message); + const msgIndex = findMessageIdx(message.hash, state.messages); + if (msgIndex >= 0) { + state.messages[msgIndex]["pinnedBy"] = innerSigningContractID; + } + } + }, + "gi.contracts/chatroom/unpinMessage": { + validate: actionRequireInnerSignature(objectOf({ + hash: stringMax(MAX_HASH_LEN, "hash") + })), + process({ data }, { state }) { + if (!state.messages) + return; + const pinnedMsgIndex = findMessageIdx(data.hash, state.pinnedMessages); + if (pinnedMsgIndex >= 0) { + state.pinnedMessages.splice(pinnedMsgIndex, 1); + } + const msgIndex = findMessageIdx(data.hash, state.messages); + if (msgIndex >= 0) { + delete state.messages[msgIndex]["pinnedBy"]; + } + } + }, + "gi.contracts/chatroom/upgradeFrom1.0.8": { + validate: actionRequireInnerSignature(optional(string)), + process({ data }, { state }) { + if (state.attributes.adminIDs) { + throw new Error("Upgrade can only be done once"); + } + state.attributes.adminIDs = data ? [data] : []; + } + } + }, + methods: { + "gi.contracts/chatroom/_cleanup": ({ contractID, state }) => { + if (state?.members) { + (0, import_sbp6.default)("chelonia/contract/release", Object.keys(state.members)).catch((e) => { + console.error("[gi.contracts/chatroom/_cleanup] Error calling release", contractID, e); + }); + } + }, + "gi.contracts/chatroom/rotateKeys": (contractID, state) => { + if (!state._volatile) + state["_volatile"] = /* @__PURE__ */ Object.create(null); + if (!state._volatile.pendingKeyRevocations) + state._volatile["pendingKeyRevocations"] = /* @__PURE__ */ Object.create(null); + const CSKid = findKeyIdByName(state, "csk"); + const CEKid = findKeyIdByName(state, "cek"); + state._volatile.pendingKeyRevocations[CSKid] = true; + state._volatile.pendingKeyRevocations[CEKid] = true; + (0, import_sbp6.default)("gi.actions/out/rotateKeys", contractID, "gi.contracts/chatroom", "pending", "gi.actions/chatroom/shareNewKeys").catch((e) => { + console.warn(`rotateKeys: ${e.name} thrown during queueEvent to ${contractID}:`, e); + }); + }, + "gi.contracts/chatroom/removeForeignKeys": (contractID, memberID, state) => { + const keyIds = findForeignKeysByContractID(state, memberID); + if (!keyIds?.length) + return; + const CSKid = findKeyIdByName(state, "csk"); + const CEKid = findKeyIdByName(state, "cek"); + if (!CEKid) + throw new Error("Missing encryption key"); + (0, import_sbp6.default)("chelonia/out/keyDel", { + contractID, + contractName: "gi.contracts/chatroom", + data: keyIds, + signingKeyId: CSKid, + hooks: { + preSendCheck: (_, state2) => { + return !state2.members?.[memberID]; + } + } + }).catch((e) => { + console.warn(`removeForeignKeys: ${e.name} thrown during queueEvent to ${contractID}:`, e); + }); + }, + ...referenceTally("gi.contracts/chatroom/referenceTally") + } + }); +})(); +/*! + * Fast "async" scrypt implementation in JavaScript. + * Copyright (c) 2013-2016 Dmitry Chestnykh | BSD License + * https://github.com/dchest/scrypt-async-js + */ +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ +/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ diff --git a/contracts/1.2.0/group-slim.js b/contracts/1.2.0/group-slim.js new file mode 100644 index 000000000..9b185db4d --- /dev/null +++ b/contracts/1.2.0/group-slim.js @@ -0,0 +1,10253 @@ +"use strict"; +(() => { + var __create = Object.create; + var __defProp = Object.defineProperty; + var __getOwnPropDesc = Object.getOwnPropertyDescriptor; + var __getOwnPropNames = Object.getOwnPropertyNames; + var __getProtoOf = Object.getPrototypeOf; + var __hasOwnProp = Object.prototype.hasOwnProperty; + var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; + var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { + get: (a, b) => (typeof require !== "undefined" ? require : a)[b] + }) : x)(function(x) { + if (typeof require !== "undefined") + return require.apply(this, arguments); + throw new Error('Dynamic require of "' + x + '" is not supported'); + }); + var __commonJS = (cb, mod) => function __require2() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; + }; + var __copyProps = (to, from3, except, desc) => { + if (from3 && typeof from3 === "object" || typeof from3 === "function") { + for (let key of __getOwnPropNames(from3)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from3[key], enumerable: !(desc = __getOwnPropDesc(from3, key)) || desc.enumerable }); + } + return to; + }; + var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod)); + var __publicField = (obj, key, value) => { + __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); + return value; + }; + + // node_modules/blakejs/util.js + var require_util = __commonJS({ + "node_modules/blakejs/util.js"(exports, module) { + var ERROR_MSG_INPUT = "Input must be an string, Buffer or Uint8Array"; + function normalizeInput(input) { + let ret; + if (input instanceof Uint8Array) { + ret = input; + } else if (typeof input === "string") { + const encoder = new TextEncoder(); + ret = encoder.encode(input); + } else { + throw new Error(ERROR_MSG_INPUT); + } + return ret; + } + function toHex(bytes) { + return Array.prototype.map.call(bytes, function(n) { + return (n < 16 ? "0" : "") + n.toString(16); + }).join(""); + } + function uint32ToHex(val) { + return (4294967296 + val).toString(16).substring(1); + } + function debugPrint(label, arr, size) { + let msg = "\n" + label + " = "; + for (let i = 0; i < arr.length; i += 2) { + if (size === 32) { + msg += uint32ToHex(arr[i]).toUpperCase(); + msg += " "; + msg += uint32ToHex(arr[i + 1]).toUpperCase(); + } else if (size === 64) { + msg += uint32ToHex(arr[i + 1]).toUpperCase(); + msg += uint32ToHex(arr[i]).toUpperCase(); + } else + throw new Error("Invalid size " + size); + if (i % 6 === 4) { + msg += "\n" + new Array(label.length + 4).join(" "); + } else if (i < arr.length - 2) { + msg += " "; + } + } + console.log(msg); + } + function testSpeed(hashFn, N, M) { + let startMs = new Date().getTime(); + const input = new Uint8Array(N); + for (let i = 0; i < N; i++) { + input[i] = i % 256; + } + const genMs = new Date().getTime(); + console.log("Generated random input in " + (genMs - startMs) + "ms"); + startMs = genMs; + for (let i = 0; i < M; i++) { + const hashHex = hashFn(input); + const hashMs = new Date().getTime(); + const ms = hashMs - startMs; + startMs = hashMs; + console.log("Hashed in " + ms + "ms: " + hashHex.substring(0, 20) + "..."); + console.log(Math.round(N / (1 << 20) / (ms / 1e3) * 100) / 100 + " MB PER SECOND"); + } + } + module.exports = { + normalizeInput, + toHex, + debugPrint, + testSpeed + }; + } + }); + + // node_modules/blakejs/blake2b.js + var require_blake2b = __commonJS({ + "node_modules/blakejs/blake2b.js"(exports, module) { + var util = require_util(); + function ADD64AA(v2, a, b) { + const o0 = v2[a] + v2[b]; + let o1 = v2[a + 1] + v2[b + 1]; + if (o0 >= 4294967296) { + o1++; + } + v2[a] = o0; + v2[a + 1] = o1; + } + function ADD64AC(v2, a, b0, b1) { + let o0 = v2[a] + b0; + if (b0 < 0) { + o0 += 4294967296; + } + let o1 = v2[a + 1] + b1; + if (o0 >= 4294967296) { + o1++; + } + v2[a] = o0; + v2[a + 1] = o1; + } + function B2B_GET32(arr, i) { + return arr[i] ^ arr[i + 1] << 8 ^ arr[i + 2] << 16 ^ arr[i + 3] << 24; + } + function B2B_G(a, b, c, d, ix, iy) { + const x0 = m[ix]; + const x1 = m[ix + 1]; + const y0 = m[iy]; + const y1 = m[iy + 1]; + ADD64AA(v, a, b); + ADD64AC(v, a, x0, x1); + let xor0 = v[d] ^ v[a]; + let xor1 = v[d + 1] ^ v[a + 1]; + v[d] = xor1; + v[d + 1] = xor0; + ADD64AA(v, c, d); + xor0 = v[b] ^ v[c]; + xor1 = v[b + 1] ^ v[c + 1]; + v[b] = xor0 >>> 24 ^ xor1 << 8; + v[b + 1] = xor1 >>> 24 ^ xor0 << 8; + ADD64AA(v, a, b); + ADD64AC(v, a, y0, y1); + xor0 = v[d] ^ v[a]; + xor1 = v[d + 1] ^ v[a + 1]; + v[d] = xor0 >>> 16 ^ xor1 << 16; + v[d + 1] = xor1 >>> 16 ^ xor0 << 16; + ADD64AA(v, c, d); + xor0 = v[b] ^ v[c]; + xor1 = v[b + 1] ^ v[c + 1]; + v[b] = xor1 >>> 31 ^ xor0 << 1; + v[b + 1] = xor0 >>> 31 ^ xor1 << 1; + } + var BLAKE2B_IV32 = new Uint32Array([ + 4089235720, + 1779033703, + 2227873595, + 3144134277, + 4271175723, + 1013904242, + 1595750129, + 2773480762, + 2917565137, + 1359893119, + 725511199, + 2600822924, + 4215389547, + 528734635, + 327033209, + 1541459225 + ]); + var SIGMA8 = [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 14, + 10, + 4, + 8, + 9, + 15, + 13, + 6, + 1, + 12, + 0, + 2, + 11, + 7, + 5, + 3, + 11, + 8, + 12, + 0, + 5, + 2, + 15, + 13, + 10, + 14, + 3, + 6, + 7, + 1, + 9, + 4, + 7, + 9, + 3, + 1, + 13, + 12, + 11, + 14, + 2, + 6, + 5, + 10, + 4, + 0, + 15, + 8, + 9, + 0, + 5, + 7, + 2, + 4, + 10, + 15, + 14, + 1, + 11, + 12, + 6, + 8, + 3, + 13, + 2, + 12, + 6, + 10, + 0, + 11, + 8, + 3, + 4, + 13, + 7, + 5, + 15, + 14, + 1, + 9, + 12, + 5, + 1, + 15, + 14, + 13, + 4, + 10, + 0, + 7, + 6, + 3, + 9, + 2, + 8, + 11, + 13, + 11, + 7, + 14, + 12, + 1, + 3, + 9, + 5, + 0, + 15, + 4, + 8, + 6, + 2, + 10, + 6, + 15, + 14, + 9, + 11, + 3, + 0, + 8, + 12, + 2, + 13, + 7, + 1, + 4, + 10, + 5, + 10, + 2, + 8, + 4, + 7, + 6, + 1, + 5, + 15, + 11, + 9, + 14, + 3, + 12, + 13, + 0, + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 14, + 10, + 4, + 8, + 9, + 15, + 13, + 6, + 1, + 12, + 0, + 2, + 11, + 7, + 5, + 3 + ]; + var SIGMA82 = new Uint8Array(SIGMA8.map(function(x) { + return x * 2; + })); + var v = new Uint32Array(32); + var m = new Uint32Array(32); + function blake2bCompress(ctx, last) { + let i = 0; + for (i = 0; i < 16; i++) { + v[i] = ctx.h[i]; + v[i + 16] = BLAKE2B_IV32[i]; + } + v[24] = v[24] ^ ctx.t; + v[25] = v[25] ^ ctx.t / 4294967296; + if (last) { + v[28] = ~v[28]; + v[29] = ~v[29]; + } + for (i = 0; i < 32; i++) { + m[i] = B2B_GET32(ctx.b, 4 * i); + } + for (i = 0; i < 12; i++) { + B2B_G(0, 8, 16, 24, SIGMA82[i * 16 + 0], SIGMA82[i * 16 + 1]); + B2B_G(2, 10, 18, 26, SIGMA82[i * 16 + 2], SIGMA82[i * 16 + 3]); + B2B_G(4, 12, 20, 28, SIGMA82[i * 16 + 4], SIGMA82[i * 16 + 5]); + B2B_G(6, 14, 22, 30, SIGMA82[i * 16 + 6], SIGMA82[i * 16 + 7]); + B2B_G(0, 10, 20, 30, SIGMA82[i * 16 + 8], SIGMA82[i * 16 + 9]); + B2B_G(2, 12, 22, 24, SIGMA82[i * 16 + 10], SIGMA82[i * 16 + 11]); + B2B_G(4, 14, 16, 26, SIGMA82[i * 16 + 12], SIGMA82[i * 16 + 13]); + B2B_G(6, 8, 18, 28, SIGMA82[i * 16 + 14], SIGMA82[i * 16 + 15]); + } + for (i = 0; i < 16; i++) { + ctx.h[i] = ctx.h[i] ^ v[i] ^ v[i + 16]; + } + } + var parameterBlock = new Uint8Array([ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ]); + function blake2bInit2(outlen, key, salt, personal) { + if (outlen === 0 || outlen > 64) { + throw new Error("Illegal output length, expected 0 < length <= 64"); + } + if (key && key.length > 64) { + throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64"); + } + if (salt && salt.length !== 16) { + throw new Error("Illegal salt, expected Uint8Array with length is 16"); + } + if (personal && personal.length !== 16) { + throw new Error("Illegal personal, expected Uint8Array with length is 16"); + } + const ctx = { + b: new Uint8Array(128), + h: new Uint32Array(16), + t: 0, + c: 0, + outlen + }; + parameterBlock.fill(0); + parameterBlock[0] = outlen; + if (key) + parameterBlock[1] = key.length; + parameterBlock[2] = 1; + parameterBlock[3] = 1; + if (salt) + parameterBlock.set(salt, 32); + if (personal) + parameterBlock.set(personal, 48); + for (let i = 0; i < 16; i++) { + ctx.h[i] = BLAKE2B_IV32[i] ^ B2B_GET32(parameterBlock, i * 4); + } + if (key) { + blake2bUpdate2(ctx, key); + ctx.c = 128; + } + return ctx; + } + function blake2bUpdate2(ctx, input) { + for (let i = 0; i < input.length; i++) { + if (ctx.c === 128) { + ctx.t += ctx.c; + blake2bCompress(ctx, false); + ctx.c = 0; + } + ctx.b[ctx.c++] = input[i]; + } + } + function blake2bFinal2(ctx) { + ctx.t += ctx.c; + while (ctx.c < 128) { + ctx.b[ctx.c++] = 0; + } + blake2bCompress(ctx, true); + const out = new Uint8Array(ctx.outlen); + for (let i = 0; i < ctx.outlen; i++) { + out[i] = ctx.h[i >> 2] >> 8 * (i & 3); + } + return out; + } + function blake2b3(input, key, outlen, salt, personal) { + outlen = outlen || 64; + input = util.normalizeInput(input); + if (salt) { + salt = util.normalizeInput(salt); + } + if (personal) { + personal = util.normalizeInput(personal); + } + const ctx = blake2bInit2(outlen, key, salt, personal); + blake2bUpdate2(ctx, input); + return blake2bFinal2(ctx); + } + function blake2bHex(input, key, outlen, salt, personal) { + const output = blake2b3(input, key, outlen, salt, personal); + return util.toHex(output); + } + module.exports = { + blake2b: blake2b3, + blake2bHex, + blake2bInit: blake2bInit2, + blake2bUpdate: blake2bUpdate2, + blake2bFinal: blake2bFinal2 + }; + } + }); + + // node_modules/blakejs/blake2s.js + var require_blake2s = __commonJS({ + "node_modules/blakejs/blake2s.js"(exports, module) { + var util = require_util(); + function B2S_GET32(v2, i) { + return v2[i] ^ v2[i + 1] << 8 ^ v2[i + 2] << 16 ^ v2[i + 3] << 24; + } + function B2S_G(a, b, c, d, x, y) { + v[a] = v[a] + v[b] + x; + v[d] = ROTR32(v[d] ^ v[a], 16); + v[c] = v[c] + v[d]; + v[b] = ROTR32(v[b] ^ v[c], 12); + v[a] = v[a] + v[b] + y; + v[d] = ROTR32(v[d] ^ v[a], 8); + v[c] = v[c] + v[d]; + v[b] = ROTR32(v[b] ^ v[c], 7); + } + function ROTR32(x, y) { + return x >>> y ^ x << 32 - y; + } + var BLAKE2S_IV = new Uint32Array([ + 1779033703, + 3144134277, + 1013904242, + 2773480762, + 1359893119, + 2600822924, + 528734635, + 1541459225 + ]); + var SIGMA = new Uint8Array([ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 14, + 10, + 4, + 8, + 9, + 15, + 13, + 6, + 1, + 12, + 0, + 2, + 11, + 7, + 5, + 3, + 11, + 8, + 12, + 0, + 5, + 2, + 15, + 13, + 10, + 14, + 3, + 6, + 7, + 1, + 9, + 4, + 7, + 9, + 3, + 1, + 13, + 12, + 11, + 14, + 2, + 6, + 5, + 10, + 4, + 0, + 15, + 8, + 9, + 0, + 5, + 7, + 2, + 4, + 10, + 15, + 14, + 1, + 11, + 12, + 6, + 8, + 3, + 13, + 2, + 12, + 6, + 10, + 0, + 11, + 8, + 3, + 4, + 13, + 7, + 5, + 15, + 14, + 1, + 9, + 12, + 5, + 1, + 15, + 14, + 13, + 4, + 10, + 0, + 7, + 6, + 3, + 9, + 2, + 8, + 11, + 13, + 11, + 7, + 14, + 12, + 1, + 3, + 9, + 5, + 0, + 15, + 4, + 8, + 6, + 2, + 10, + 6, + 15, + 14, + 9, + 11, + 3, + 0, + 8, + 12, + 2, + 13, + 7, + 1, + 4, + 10, + 5, + 10, + 2, + 8, + 4, + 7, + 6, + 1, + 5, + 15, + 11, + 9, + 14, + 3, + 12, + 13, + 0 + ]); + var v = new Uint32Array(16); + var m = new Uint32Array(16); + function blake2sCompress(ctx, last) { + let i = 0; + for (i = 0; i < 8; i++) { + v[i] = ctx.h[i]; + v[i + 8] = BLAKE2S_IV[i]; + } + v[12] ^= ctx.t; + v[13] ^= ctx.t / 4294967296; + if (last) { + v[14] = ~v[14]; + } + for (i = 0; i < 16; i++) { + m[i] = B2S_GET32(ctx.b, 4 * i); + } + for (i = 0; i < 10; i++) { + B2S_G(0, 4, 8, 12, m[SIGMA[i * 16 + 0]], m[SIGMA[i * 16 + 1]]); + B2S_G(1, 5, 9, 13, m[SIGMA[i * 16 + 2]], m[SIGMA[i * 16 + 3]]); + B2S_G(2, 6, 10, 14, m[SIGMA[i * 16 + 4]], m[SIGMA[i * 16 + 5]]); + B2S_G(3, 7, 11, 15, m[SIGMA[i * 16 + 6]], m[SIGMA[i * 16 + 7]]); + B2S_G(0, 5, 10, 15, m[SIGMA[i * 16 + 8]], m[SIGMA[i * 16 + 9]]); + B2S_G(1, 6, 11, 12, m[SIGMA[i * 16 + 10]], m[SIGMA[i * 16 + 11]]); + B2S_G(2, 7, 8, 13, m[SIGMA[i * 16 + 12]], m[SIGMA[i * 16 + 13]]); + B2S_G(3, 4, 9, 14, m[SIGMA[i * 16 + 14]], m[SIGMA[i * 16 + 15]]); + } + for (i = 0; i < 8; i++) { + ctx.h[i] ^= v[i] ^ v[i + 8]; + } + } + function blake2sInit(outlen, key) { + if (!(outlen > 0 && outlen <= 32)) { + throw new Error("Incorrect output length, should be in [1, 32]"); + } + const keylen = key ? key.length : 0; + if (key && !(keylen > 0 && keylen <= 32)) { + throw new Error("Incorrect key length, should be in [1, 32]"); + } + const ctx = { + h: new Uint32Array(BLAKE2S_IV), + b: new Uint8Array(64), + c: 0, + t: 0, + outlen + }; + ctx.h[0] ^= 16842752 ^ keylen << 8 ^ outlen; + if (keylen > 0) { + blake2sUpdate(ctx, key); + ctx.c = 64; + } + return ctx; + } + function blake2sUpdate(ctx, input) { + for (let i = 0; i < input.length; i++) { + if (ctx.c === 64) { + ctx.t += ctx.c; + blake2sCompress(ctx, false); + ctx.c = 0; + } + ctx.b[ctx.c++] = input[i]; + } + } + function blake2sFinal(ctx) { + ctx.t += ctx.c; + while (ctx.c < 64) { + ctx.b[ctx.c++] = 0; + } + blake2sCompress(ctx, true); + const out = new Uint8Array(ctx.outlen); + for (let i = 0; i < ctx.outlen; i++) { + out[i] = ctx.h[i >> 2] >> 8 * (i & 3) & 255; + } + return out; + } + function blake2s(input, key, outlen) { + outlen = outlen || 32; + input = util.normalizeInput(input); + const ctx = blake2sInit(outlen, key); + blake2sUpdate(ctx, input); + return blake2sFinal(ctx); + } + function blake2sHex(input, key, outlen) { + const output = blake2s(input, key, outlen); + return util.toHex(output); + } + module.exports = { + blake2s, + blake2sHex, + blake2sInit, + blake2sUpdate, + blake2sFinal + }; + } + }); + + // node_modules/blakejs/index.js + var require_blakejs = __commonJS({ + "node_modules/blakejs/index.js"(exports, module) { + var b2b = require_blake2b(); + var b2s = require_blake2s(); + module.exports = { + blake2b: b2b.blake2b, + blake2bHex: b2b.blake2bHex, + blake2bInit: b2b.blake2bInit, + blake2bUpdate: b2b.blake2bUpdate, + blake2bFinal: b2b.blake2bFinal, + blake2s: b2s.blake2s, + blake2sHex: b2s.blake2sHex, + blake2sInit: b2s.blake2sInit, + blake2sUpdate: b2s.blake2sUpdate, + blake2sFinal: b2s.blake2sFinal + }; + } + }); + + // node_modules/base64-js/index.js + var require_base64_js = __commonJS({ + "node_modules/base64-js/index.js"(exports) { + "use strict"; + exports.byteLength = byteLength; + exports.toByteArray = toByteArray; + exports.fromByteArray = fromByteArray; + var lookup = []; + var revLookup = []; + var Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array; + var code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + for (i = 0, len = code.length; i < len; ++i) { + lookup[i] = code[i]; + revLookup[code.charCodeAt(i)] = i; + } + var i; + var len; + revLookup["-".charCodeAt(0)] = 62; + revLookup["_".charCodeAt(0)] = 63; + function getLens(b64) { + var len2 = b64.length; + if (len2 % 4 > 0) { + throw new Error("Invalid string. Length must be a multiple of 4"); + } + var validLen = b64.indexOf("="); + if (validLen === -1) + validLen = len2; + var placeHoldersLen = validLen === len2 ? 0 : 4 - validLen % 4; + return [validLen, placeHoldersLen]; + } + function byteLength(b64) { + var lens = getLens(b64); + var validLen = lens[0]; + var placeHoldersLen = lens[1]; + return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; + } + function _byteLength(b64, validLen, placeHoldersLen) { + return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; + } + function toByteArray(b64) { + var tmp; + var lens = getLens(b64); + var validLen = lens[0]; + var placeHoldersLen = lens[1]; + var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)); + var curByte = 0; + var len2 = placeHoldersLen > 0 ? validLen - 4 : validLen; + var i2; + for (i2 = 0; i2 < len2; i2 += 4) { + tmp = revLookup[b64.charCodeAt(i2)] << 18 | revLookup[b64.charCodeAt(i2 + 1)] << 12 | revLookup[b64.charCodeAt(i2 + 2)] << 6 | revLookup[b64.charCodeAt(i2 + 3)]; + arr[curByte++] = tmp >> 16 & 255; + arr[curByte++] = tmp >> 8 & 255; + arr[curByte++] = tmp & 255; + } + if (placeHoldersLen === 2) { + tmp = revLookup[b64.charCodeAt(i2)] << 2 | revLookup[b64.charCodeAt(i2 + 1)] >> 4; + arr[curByte++] = tmp & 255; + } + if (placeHoldersLen === 1) { + tmp = revLookup[b64.charCodeAt(i2)] << 10 | revLookup[b64.charCodeAt(i2 + 1)] << 4 | revLookup[b64.charCodeAt(i2 + 2)] >> 2; + arr[curByte++] = tmp >> 8 & 255; + arr[curByte++] = tmp & 255; + } + return arr; + } + function tripletToBase64(num) { + return lookup[num >> 18 & 63] + lookup[num >> 12 & 63] + lookup[num >> 6 & 63] + lookup[num & 63]; + } + function encodeChunk(uint8, start, end) { + var tmp; + var output = []; + for (var i2 = start; i2 < end; i2 += 3) { + tmp = (uint8[i2] << 16 & 16711680) + (uint8[i2 + 1] << 8 & 65280) + (uint8[i2 + 2] & 255); + output.push(tripletToBase64(tmp)); + } + return output.join(""); + } + function fromByteArray(uint8) { + var tmp; + var len2 = uint8.length; + var extraBytes = len2 % 3; + var parts = []; + var maxChunkLength = 16383; + for (var i2 = 0, len22 = len2 - extraBytes; i2 < len22; i2 += maxChunkLength) { + parts.push(encodeChunk(uint8, i2, i2 + maxChunkLength > len22 ? len22 : i2 + maxChunkLength)); + } + if (extraBytes === 1) { + tmp = uint8[len2 - 1]; + parts.push(lookup[tmp >> 2] + lookup[tmp << 4 & 63] + "=="); + } else if (extraBytes === 2) { + tmp = (uint8[len2 - 2] << 8) + uint8[len2 - 1]; + parts.push(lookup[tmp >> 10] + lookup[tmp >> 4 & 63] + lookup[tmp << 2 & 63] + "="); + } + return parts.join(""); + } + } + }); + + // node_modules/ieee754/index.js + var require_ieee754 = __commonJS({ + "node_modules/ieee754/index.js"(exports) { + exports.read = function(buffer, offset, isLE, mLen, nBytes) { + var e, m; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var nBits = -7; + var i = isLE ? nBytes - 1 : 0; + var d = isLE ? -1 : 1; + var s = buffer[offset + i]; + i += d; + e = s & (1 << -nBits) - 1; + s >>= -nBits; + nBits += eLen; + for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) { + } + m = e & (1 << -nBits) - 1; + e >>= -nBits; + nBits += mLen; + for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) { + } + if (e === 0) { + e = 1 - eBias; + } else if (e === eMax) { + return m ? NaN : (s ? -1 : 1) * Infinity; + } else { + m = m + Math.pow(2, mLen); + e = e - eBias; + } + return (s ? -1 : 1) * m * Math.pow(2, e - mLen); + }; + exports.write = function(buffer, value, offset, isLE, mLen, nBytes) { + var e, m, c; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0; + var i = isLE ? 0 : nBytes - 1; + var d = isLE ? 1 : -1; + var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; + value = Math.abs(value); + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0; + e = eMax; + } else { + e = Math.floor(Math.log(value) / Math.LN2); + if (value * (c = Math.pow(2, -e)) < 1) { + e--; + c *= 2; + } + if (e + eBias >= 1) { + value += rt / c; + } else { + value += rt * Math.pow(2, 1 - eBias); + } + if (value * c >= 2) { + e++; + c /= 2; + } + if (e + eBias >= eMax) { + m = 0; + e = eMax; + } else if (e + eBias >= 1) { + m = (value * c - 1) * Math.pow(2, mLen); + e = e + eBias; + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); + e = 0; + } + } + for (; mLen >= 8; buffer[offset + i] = m & 255, i += d, m /= 256, mLen -= 8) { + } + e = e << mLen | m; + eLen += mLen; + for (; eLen > 0; buffer[offset + i] = e & 255, i += d, e /= 256, eLen -= 8) { + } + buffer[offset + i - d] |= s * 128; + }; + } + }); + + // node_modules/buffer/index.js + var require_buffer = __commonJS({ + "node_modules/buffer/index.js"(exports) { + "use strict"; + var base64 = require_base64_js(); + var ieee754 = require_ieee754(); + var customInspectSymbol = typeof Symbol === "function" && typeof Symbol["for"] === "function" ? Symbol["for"]("nodejs.util.inspect.custom") : null; + exports.Buffer = Buffer2; + exports.SlowBuffer = SlowBuffer; + exports.INSPECT_MAX_BYTES = 50; + var K_MAX_LENGTH = 2147483647; + exports.kMaxLength = K_MAX_LENGTH; + Buffer2.TYPED_ARRAY_SUPPORT = typedArraySupport(); + if (!Buffer2.TYPED_ARRAY_SUPPORT && typeof console !== "undefined" && 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 typedArraySupport() { + try { + const arr = new Uint8Array(1); + const proto3 = { foo: function() { + return 42; + } }; + Object.setPrototypeOf(proto3, Uint8Array.prototype); + Object.setPrototypeOf(arr, proto3); + return arr.foo() === 42; + } catch (e) { + return false; + } + } + Object.defineProperty(Buffer2.prototype, "parent", { + enumerable: true, + get: function() { + if (!Buffer2.isBuffer(this)) + return void 0; + return this.buffer; + } + }); + Object.defineProperty(Buffer2.prototype, "offset", { + enumerable: true, + get: function() { + if (!Buffer2.isBuffer(this)) + return void 0; + return this.byteOffset; + } + }); + function createBuffer(length2) { + if (length2 > K_MAX_LENGTH) { + throw new RangeError('The value "' + length2 + '" is invalid for option "size"'); + } + const buf = new Uint8Array(length2); + Object.setPrototypeOf(buf, Buffer2.prototype); + return buf; + } + function Buffer2(arg, encodingOrOffset, length2) { + if (typeof arg === "number") { + if (typeof encodingOrOffset === "string") { + throw new TypeError('The "string" argument must be of type string. Received type number'); + } + return allocUnsafe(arg); + } + return from3(arg, encodingOrOffset, length2); + } + Buffer2.poolSize = 8192; + function from3(value, encodingOrOffset, length2) { + if (typeof value === "string") { + return fromString(value, encodingOrOffset); + } + if (ArrayBuffer.isView(value)) { + return fromArrayView(value); + } + if (value == null) { + throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value); + } + if (isInstance(value, ArrayBuffer) || value && isInstance(value.buffer, ArrayBuffer)) { + return fromArrayBuffer(value, encodingOrOffset, length2); + } + if (typeof SharedArrayBuffer !== "undefined" && (isInstance(value, SharedArrayBuffer) || value && isInstance(value.buffer, SharedArrayBuffer))) { + return fromArrayBuffer(value, encodingOrOffset, length2); + } + if (typeof value === "number") { + throw new TypeError('The "value" argument must not be of type number. Received type number'); + } + const valueOf = value.valueOf && value.valueOf(); + if (valueOf != null && valueOf !== value) { + return Buffer2.from(valueOf, encodingOrOffset, length2); + } + const b = fromObject(value); + if (b) + return b; + if (typeof Symbol !== "undefined" && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === "function") { + return Buffer2.from(value[Symbol.toPrimitive]("string"), encodingOrOffset, length2); + } + throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value); + } + Buffer2.from = function(value, encodingOrOffset, length2) { + return from3(value, encodingOrOffset, length2); + }; + Object.setPrototypeOf(Buffer2.prototype, Uint8Array.prototype); + Object.setPrototypeOf(Buffer2, Uint8Array); + function assertSize(size) { + if (typeof size !== "number") { + throw new TypeError('"size" argument must be of type number'); + } else if (size < 0) { + throw new RangeError('The value "' + size + '" is invalid for option "size"'); + } + } + function alloc(size, fill, encoding) { + assertSize(size); + if (size <= 0) { + return createBuffer(size); + } + if (fill !== void 0) { + return typeof encoding === "string" ? createBuffer(size).fill(fill, encoding) : createBuffer(size).fill(fill); + } + return createBuffer(size); + } + Buffer2.alloc = function(size, fill, encoding) { + return alloc(size, fill, encoding); + }; + function allocUnsafe(size) { + assertSize(size); + return createBuffer(size < 0 ? 0 : checked(size) | 0); + } + Buffer2.allocUnsafe = function(size) { + return allocUnsafe(size); + }; + Buffer2.allocUnsafeSlow = function(size) { + return allocUnsafe(size); + }; + function fromString(string3, encoding) { + if (typeof encoding !== "string" || encoding === "") { + encoding = "utf8"; + } + if (!Buffer2.isEncoding(encoding)) { + throw new TypeError("Unknown encoding: " + encoding); + } + const length2 = byteLength(string3, encoding) | 0; + let buf = createBuffer(length2); + const actual = buf.write(string3, encoding); + if (actual !== length2) { + buf = buf.slice(0, actual); + } + return buf; + } + function fromArrayLike(array) { + const length2 = array.length < 0 ? 0 : checked(array.length) | 0; + const buf = createBuffer(length2); + for (let i = 0; i < length2; i += 1) { + buf[i] = array[i] & 255; + } + return buf; + } + function fromArrayView(arrayView) { + if (isInstance(arrayView, Uint8Array)) { + const copy = new Uint8Array(arrayView); + return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength); + } + return fromArrayLike(arrayView); + } + function fromArrayBuffer(array, byteOffset, length2) { + if (byteOffset < 0 || array.byteLength < byteOffset) { + throw new RangeError('"offset" is outside of buffer bounds'); + } + if (array.byteLength < byteOffset + (length2 || 0)) { + throw new RangeError('"length" is outside of buffer bounds'); + } + let buf; + if (byteOffset === void 0 && length2 === void 0) { + buf = new Uint8Array(array); + } else if (length2 === void 0) { + buf = new Uint8Array(array, byteOffset); + } else { + buf = new Uint8Array(array, byteOffset, length2); + } + Object.setPrototypeOf(buf, Buffer2.prototype); + return buf; + } + function fromObject(obj) { + if (Buffer2.isBuffer(obj)) { + const len = checked(obj.length) | 0; + const buf = createBuffer(len); + if (buf.length === 0) { + return buf; + } + obj.copy(buf, 0, 0, len); + return buf; + } + if (obj.length !== void 0) { + if (typeof obj.length !== "number" || numberIsNaN(obj.length)) { + return createBuffer(0); + } + return fromArrayLike(obj); + } + if (obj.type === "Buffer" && Array.isArray(obj.data)) { + return fromArrayLike(obj.data); + } + } + function checked(length2) { + if (length2 >= K_MAX_LENGTH) { + throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + K_MAX_LENGTH.toString(16) + " bytes"); + } + return length2 | 0; + } + function SlowBuffer(length2) { + if (+length2 != length2) { + length2 = 0; + } + return Buffer2.alloc(+length2); + } + Buffer2.isBuffer = function isBuffer(b) { + return b != null && b._isBuffer === true && b !== Buffer2.prototype; + }; + Buffer2.compare = function compare(a, b) { + if (isInstance(a, Uint8Array)) + a = Buffer2.from(a, a.offset, a.byteLength); + if (isInstance(b, Uint8Array)) + b = Buffer2.from(b, b.offset, b.byteLength); + if (!Buffer2.isBuffer(a) || !Buffer2.isBuffer(b)) { + throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'); + } + if (a === b) + return 0; + let x = a.length; + let y = b.length; + for (let i = 0, len = Math.min(x, y); i < len; ++i) { + if (a[i] !== b[i]) { + x = a[i]; + y = b[i]; + break; + } + } + if (x < y) + return -1; + if (y < x) + return 1; + return 0; + }; + Buffer2.isEncoding = function isEncoding(encoding) { + switch (String(encoding).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 true; + default: + return false; + } + }; + Buffer2.concat = function concat(list, length2) { + if (!Array.isArray(list)) { + throw new TypeError('"list" argument must be an Array of Buffers'); + } + if (list.length === 0) { + return Buffer2.alloc(0); + } + let i; + if (length2 === void 0) { + length2 = 0; + for (i = 0; i < list.length; ++i) { + length2 += list[i].length; + } + } + const buffer = Buffer2.allocUnsafe(length2); + let pos = 0; + for (i = 0; i < list.length; ++i) { + let buf = list[i]; + if (isInstance(buf, Uint8Array)) { + if (pos + buf.length > buffer.length) { + if (!Buffer2.isBuffer(buf)) + buf = Buffer2.from(buf); + buf.copy(buffer, pos); + } else { + Uint8Array.prototype.set.call(buffer, buf, pos); + } + } else if (!Buffer2.isBuffer(buf)) { + throw new TypeError('"list" argument must be an Array of Buffers'); + } else { + buf.copy(buffer, pos); + } + pos += buf.length; + } + return buffer; + }; + function byteLength(string3, encoding) { + if (Buffer2.isBuffer(string3)) { + return string3.length; + } + if (ArrayBuffer.isView(string3) || isInstance(string3, ArrayBuffer)) { + return string3.byteLength; + } + if (typeof string3 !== "string") { + throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof string3); + } + const len = string3.length; + const mustMatch = arguments.length > 2 && arguments[2] === true; + if (!mustMatch && len === 0) + return 0; + let loweredCase = false; + for (; ; ) { + switch (encoding) { + case "ascii": + case "latin1": + case "binary": + return len; + case "utf8": + case "utf-8": + return utf8ToBytes(string3).length; + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return len * 2; + case "hex": + return len >>> 1; + case "base64": + return base64ToBytes(string3).length; + default: + if (loweredCase) { + return mustMatch ? -1 : utf8ToBytes(string3).length; + } + encoding = ("" + encoding).toLowerCase(); + loweredCase = true; + } + } + } + Buffer2.byteLength = byteLength; + function slowToString(encoding, start, end) { + let loweredCase = false; + if (start === void 0 || start < 0) { + start = 0; + } + if (start > this.length) { + return ""; + } + if (end === void 0 || end > this.length) { + end = this.length; + } + if (end <= 0) { + return ""; + } + end >>>= 0; + start >>>= 0; + if (end <= start) { + return ""; + } + if (!encoding) + encoding = "utf8"; + while (true) { + switch (encoding) { + case "hex": + return hexSlice(this, start, end); + case "utf8": + case "utf-8": + return utf8Slice(this, start, end); + case "ascii": + return asciiSlice(this, start, end); + case "latin1": + case "binary": + return latin1Slice(this, start, end); + case "base64": + return base64Slice(this, start, end); + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return utf16leSlice(this, start, end); + default: + if (loweredCase) + throw new TypeError("Unknown encoding: " + encoding); + encoding = (encoding + "").toLowerCase(); + loweredCase = true; + } + } + } + Buffer2.prototype._isBuffer = true; + function swap(b, n, m) { + const i = b[n]; + b[n] = b[m]; + b[m] = i; + } + Buffer2.prototype.swap16 = function swap16() { + const len = this.length; + if (len % 2 !== 0) { + throw new RangeError("Buffer size must be a multiple of 16-bits"); + } + for (let i = 0; i < len; i += 2) { + swap(this, i, i + 1); + } + return this; + }; + Buffer2.prototype.swap32 = function swap32() { + const len = this.length; + if (len % 4 !== 0) { + throw new RangeError("Buffer size must be a multiple of 32-bits"); + } + for (let i = 0; i < len; i += 4) { + swap(this, i, i + 3); + swap(this, i + 1, i + 2); + } + return this; + }; + Buffer2.prototype.swap64 = function swap64() { + const len = this.length; + if (len % 8 !== 0) { + throw new RangeError("Buffer size must be a multiple of 64-bits"); + } + for (let i = 0; i < len; i += 8) { + swap(this, i, i + 7); + swap(this, i + 1, i + 6); + swap(this, i + 2, i + 5); + swap(this, i + 3, i + 4); + } + return this; + }; + Buffer2.prototype.toString = function toString() { + const length2 = this.length; + if (length2 === 0) + return ""; + if (arguments.length === 0) + return utf8Slice(this, 0, length2); + return slowToString.apply(this, arguments); + }; + Buffer2.prototype.toLocaleString = Buffer2.prototype.toString; + Buffer2.prototype.equals = function equals3(b) { + if (!Buffer2.isBuffer(b)) + throw new TypeError("Argument must be a Buffer"); + if (this === b) + return true; + return Buffer2.compare(this, b) === 0; + }; + Buffer2.prototype.inspect = function inspect() { + let str = ""; + const max = exports.INSPECT_MAX_BYTES; + str = this.toString("hex", 0, max).replace(/(.{2})/g, "$1 ").trim(); + if (this.length > max) + str += " ... "; + return ""; + }; + if (customInspectSymbol) { + Buffer2.prototype[customInspectSymbol] = Buffer2.prototype.inspect; + } + Buffer2.prototype.compare = function compare(target, start, end, thisStart, thisEnd) { + if (isInstance(target, Uint8Array)) { + target = Buffer2.from(target, target.offset, target.byteLength); + } + if (!Buffer2.isBuffer(target)) { + throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof target); + } + if (start === void 0) { + start = 0; + } + if (end === void 0) { + end = target ? target.length : 0; + } + if (thisStart === void 0) { + thisStart = 0; + } + if (thisEnd === void 0) { + thisEnd = this.length; + } + if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { + throw new RangeError("out of range index"); + } + if (thisStart >= thisEnd && start >= end) { + return 0; + } + if (thisStart >= thisEnd) { + return -1; + } + if (start >= end) { + return 1; + } + start >>>= 0; + end >>>= 0; + thisStart >>>= 0; + thisEnd >>>= 0; + if (this === target) + return 0; + let x = thisEnd - thisStart; + let y = end - start; + const len = Math.min(x, y); + const thisCopy = this.slice(thisStart, thisEnd); + const targetCopy = target.slice(start, end); + for (let i = 0; i < len; ++i) { + if (thisCopy[i] !== targetCopy[i]) { + x = thisCopy[i]; + y = targetCopy[i]; + break; + } + } + if (x < y) + return -1; + if (y < x) + return 1; + return 0; + }; + function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) { + if (buffer.length === 0) + return -1; + if (typeof byteOffset === "string") { + encoding = byteOffset; + byteOffset = 0; + } else if (byteOffset > 2147483647) { + byteOffset = 2147483647; + } else if (byteOffset < -2147483648) { + byteOffset = -2147483648; + } + byteOffset = +byteOffset; + if (numberIsNaN(byteOffset)) { + byteOffset = dir ? 0 : buffer.length - 1; + } + if (byteOffset < 0) + byteOffset = buffer.length + byteOffset; + if (byteOffset >= buffer.length) { + if (dir) + return -1; + else + byteOffset = buffer.length - 1; + } else if (byteOffset < 0) { + if (dir) + byteOffset = 0; + else + return -1; + } + if (typeof val === "string") { + val = Buffer2.from(val, encoding); + } + if (Buffer2.isBuffer(val)) { + if (val.length === 0) { + return -1; + } + return arrayIndexOf(buffer, val, byteOffset, encoding, dir); + } else if (typeof val === "number") { + val = val & 255; + if (typeof Uint8Array.prototype.indexOf === "function") { + if (dir) { + return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset); + } else { + return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset); + } + } + return arrayIndexOf(buffer, [val], byteOffset, encoding, dir); + } + throw new TypeError("val must be string, number or Buffer"); + } + function arrayIndexOf(arr, val, byteOffset, encoding, dir) { + let indexSize = 1; + let arrLength = arr.length; + let valLength = val.length; + if (encoding !== void 0) { + encoding = String(encoding).toLowerCase(); + if (encoding === "ucs2" || encoding === "ucs-2" || encoding === "utf16le" || encoding === "utf-16le") { + if (arr.length < 2 || val.length < 2) { + return -1; + } + indexSize = 2; + arrLength /= 2; + valLength /= 2; + byteOffset /= 2; + } + } + function read2(buf, i2) { + if (indexSize === 1) { + return buf[i2]; + } else { + return buf.readUInt16BE(i2 * indexSize); + } + } + let i; + if (dir) { + let foundIndex = -1; + for (i = byteOffset; i < arrLength; i++) { + if (read2(arr, i) === read2(val, foundIndex === -1 ? 0 : i - foundIndex)) { + if (foundIndex === -1) + foundIndex = i; + if (i - foundIndex + 1 === valLength) + return foundIndex * indexSize; + } else { + if (foundIndex !== -1) + i -= i - foundIndex; + foundIndex = -1; + } + } + } else { + if (byteOffset + valLength > arrLength) + byteOffset = arrLength - valLength; + for (i = byteOffset; i >= 0; i--) { + let found = true; + for (let j = 0; j < valLength; j++) { + if (read2(arr, i + j) !== read2(val, j)) { + found = false; + break; + } + } + if (found) + return i; + } + } + return -1; + } + Buffer2.prototype.includes = function includes(val, byteOffset, encoding) { + return this.indexOf(val, byteOffset, encoding) !== -1; + }; + Buffer2.prototype.indexOf = function indexOf(val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, true); + }; + Buffer2.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, false); + }; + function hexWrite(buf, string3, offset, length2) { + offset = Number(offset) || 0; + const remaining = buf.length - offset; + if (!length2) { + length2 = remaining; + } else { + length2 = Number(length2); + if (length2 > remaining) { + length2 = remaining; + } + } + const strLen = string3.length; + if (length2 > strLen / 2) { + length2 = strLen / 2; + } + let i; + for (i = 0; i < length2; ++i) { + const parsed = parseInt(string3.substr(i * 2, 2), 16); + if (numberIsNaN(parsed)) + return i; + buf[offset + i] = parsed; + } + return i; + } + function utf8Write(buf, string3, offset, length2) { + return blitBuffer(utf8ToBytes(string3, buf.length - offset), buf, offset, length2); + } + function asciiWrite(buf, string3, offset, length2) { + return blitBuffer(asciiToBytes(string3), buf, offset, length2); + } + function base64Write(buf, string3, offset, length2) { + return blitBuffer(base64ToBytes(string3), buf, offset, length2); + } + function ucs2Write(buf, string3, offset, length2) { + return blitBuffer(utf16leToBytes(string3, buf.length - offset), buf, offset, length2); + } + Buffer2.prototype.write = function write(string3, offset, length2, encoding) { + if (offset === void 0) { + encoding = "utf8"; + length2 = this.length; + offset = 0; + } else if (length2 === void 0 && typeof offset === "string") { + encoding = offset; + length2 = this.length; + offset = 0; + } else if (isFinite(offset)) { + offset = offset >>> 0; + if (isFinite(length2)) { + length2 = length2 >>> 0; + if (encoding === void 0) + encoding = "utf8"; + } else { + encoding = length2; + length2 = void 0; + } + } else { + throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported"); + } + const remaining = this.length - offset; + if (length2 === void 0 || length2 > remaining) + length2 = remaining; + if (string3.length > 0 && (length2 < 0 || offset < 0) || offset > this.length) { + throw new RangeError("Attempt to write outside buffer bounds"); + } + if (!encoding) + encoding = "utf8"; + let loweredCase = false; + for (; ; ) { + switch (encoding) { + case "hex": + return hexWrite(this, string3, offset, length2); + case "utf8": + case "utf-8": + return utf8Write(this, string3, offset, length2); + case "ascii": + case "latin1": + case "binary": + return asciiWrite(this, string3, offset, length2); + case "base64": + return base64Write(this, string3, offset, length2); + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return ucs2Write(this, string3, offset, length2); + default: + if (loweredCase) + throw new TypeError("Unknown encoding: " + encoding); + encoding = ("" + encoding).toLowerCase(); + loweredCase = true; + } + } + }; + Buffer2.prototype.toJSON = function toJSON() { + return { + type: "Buffer", + data: Array.prototype.slice.call(this._arr || this, 0) + }; + }; + function base64Slice(buf, start, end) { + if (start === 0 && end === buf.length) { + return base64.fromByteArray(buf); + } else { + return base64.fromByteArray(buf.slice(start, end)); + } + } + function utf8Slice(buf, start, end) { + end = Math.min(buf.length, end); + const res = []; + let i = start; + while (i < end) { + const firstByte = buf[i]; + let codePoint = null; + let bytesPerSequence = firstByte > 239 ? 4 : firstByte > 223 ? 3 : firstByte > 191 ? 2 : 1; + if (i + bytesPerSequence <= end) { + let secondByte, thirdByte, fourthByte, tempCodePoint; + switch (bytesPerSequence) { + case 1: + if (firstByte < 128) { + codePoint = firstByte; + } + break; + case 2: + secondByte = buf[i + 1]; + if ((secondByte & 192) === 128) { + tempCodePoint = (firstByte & 31) << 6 | secondByte & 63; + if (tempCodePoint > 127) { + codePoint = tempCodePoint; + } + } + break; + case 3: + secondByte = buf[i + 1]; + thirdByte = buf[i + 2]; + if ((secondByte & 192) === 128 && (thirdByte & 192) === 128) { + tempCodePoint = (firstByte & 15) << 12 | (secondByte & 63) << 6 | thirdByte & 63; + if (tempCodePoint > 2047 && (tempCodePoint < 55296 || tempCodePoint > 57343)) { + codePoint = tempCodePoint; + } + } + break; + case 4: + secondByte = buf[i + 1]; + thirdByte = buf[i + 2]; + fourthByte = buf[i + 3]; + if ((secondByte & 192) === 128 && (thirdByte & 192) === 128 && (fourthByte & 192) === 128) { + tempCodePoint = (firstByte & 15) << 18 | (secondByte & 63) << 12 | (thirdByte & 63) << 6 | fourthByte & 63; + if (tempCodePoint > 65535 && tempCodePoint < 1114112) { + codePoint = tempCodePoint; + } + } + } + } + if (codePoint === null) { + codePoint = 65533; + bytesPerSequence = 1; + } else if (codePoint > 65535) { + codePoint -= 65536; + res.push(codePoint >>> 10 & 1023 | 55296); + codePoint = 56320 | codePoint & 1023; + } + res.push(codePoint); + i += bytesPerSequence; + } + return decodeCodePointsArray(res); + } + var MAX_ARGUMENTS_LENGTH = 4096; + function decodeCodePointsArray(codePoints) { + const len = codePoints.length; + if (len <= MAX_ARGUMENTS_LENGTH) { + return String.fromCharCode.apply(String, codePoints); + } + let res = ""; + let i = 0; + while (i < len) { + res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)); + } + return res; + } + function asciiSlice(buf, start, end) { + let ret = ""; + end = Math.min(buf.length, end); + for (let i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i] & 127); + } + return ret; + } + function latin1Slice(buf, start, end) { + let ret = ""; + end = Math.min(buf.length, end); + for (let i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i]); + } + return ret; + } + function hexSlice(buf, start, end) { + const len = buf.length; + if (!start || start < 0) + start = 0; + if (!end || end < 0 || end > len) + end = len; + let out = ""; + for (let i = start; i < end; ++i) { + out += hexSliceLookupTable[buf[i]]; + } + return out; + } + function utf16leSlice(buf, start, end) { + const bytes = buf.slice(start, end); + let res = ""; + for (let i = 0; i < bytes.length - 1; i += 2) { + res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256); + } + return res; + } + Buffer2.prototype.slice = function slice(start, end) { + const len = this.length; + start = ~~start; + end = end === void 0 ? len : ~~end; + if (start < 0) { + start += len; + if (start < 0) + start = 0; + } else if (start > len) { + start = len; + } + if (end < 0) { + end += len; + if (end < 0) + end = 0; + } else if (end > len) { + end = len; + } + if (end < start) + end = start; + const newBuf = this.subarray(start, end); + Object.setPrototypeOf(newBuf, Buffer2.prototype); + return newBuf; + }; + function checkOffset(offset, ext, length2) { + if (offset % 1 !== 0 || offset < 0) + throw new RangeError("offset is not uint"); + if (offset + ext > length2) + throw new RangeError("Trying to access beyond buffer length"); + } + Buffer2.prototype.readUintLE = Buffer2.prototype.readUIntLE = function readUIntLE(offset, byteLength2, noAssert) { + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) + checkOffset(offset, byteLength2, this.length); + let val = this[offset]; + let mul = 1; + let i = 0; + while (++i < byteLength2 && (mul *= 256)) { + val += this[offset + i] * mul; + } + return val; + }; + Buffer2.prototype.readUintBE = Buffer2.prototype.readUIntBE = function readUIntBE(offset, byteLength2, noAssert) { + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) { + checkOffset(offset, byteLength2, this.length); + } + let val = this[offset + --byteLength2]; + let mul = 1; + while (byteLength2 > 0 && (mul *= 256)) { + val += this[offset + --byteLength2] * mul; + } + return val; + }; + Buffer2.prototype.readUint8 = Buffer2.prototype.readUInt8 = function readUInt8(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 1, this.length); + return this[offset]; + }; + Buffer2.prototype.readUint16LE = Buffer2.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 2, this.length); + return this[offset] | this[offset + 1] << 8; + }; + Buffer2.prototype.readUint16BE = Buffer2.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 2, this.length); + return this[offset] << 8 | this[offset + 1]; + }; + Buffer2.prototype.readUint32LE = Buffer2.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 16777216; + }; + Buffer2.prototype.readUint32BE = Buffer2.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return this[offset] * 16777216 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]); + }; + Buffer2.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE(offset) { + offset = offset >>> 0; + validateNumber(offset, "offset"); + const first = this[offset]; + const last = this[offset + 7]; + if (first === void 0 || last === void 0) { + boundsError(offset, this.length - 8); + } + const lo = first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24; + const hi = this[++offset] + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + last * 2 ** 24; + return BigInt(lo) + (BigInt(hi) << BigInt(32)); + }); + Buffer2.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE(offset) { + offset = offset >>> 0; + validateNumber(offset, "offset"); + const first = this[offset]; + const last = this[offset + 7]; + if (first === void 0 || last === void 0) { + boundsError(offset, this.length - 8); + } + const hi = first * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset]; + const lo = this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last; + return (BigInt(hi) << BigInt(32)) + BigInt(lo); + }); + Buffer2.prototype.readIntLE = function readIntLE(offset, byteLength2, noAssert) { + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) + checkOffset(offset, byteLength2, this.length); + let val = this[offset]; + let mul = 1; + let i = 0; + while (++i < byteLength2 && (mul *= 256)) { + val += this[offset + i] * mul; + } + mul *= 128; + if (val >= mul) + val -= Math.pow(2, 8 * byteLength2); + return val; + }; + Buffer2.prototype.readIntBE = function readIntBE(offset, byteLength2, noAssert) { + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) + checkOffset(offset, byteLength2, this.length); + let i = byteLength2; + let mul = 1; + let val = this[offset + --i]; + while (i > 0 && (mul *= 256)) { + val += this[offset + --i] * mul; + } + mul *= 128; + if (val >= mul) + val -= Math.pow(2, 8 * byteLength2); + return val; + }; + Buffer2.prototype.readInt8 = function readInt8(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 1, this.length); + if (!(this[offset] & 128)) + return this[offset]; + return (255 - this[offset] + 1) * -1; + }; + Buffer2.prototype.readInt16LE = function readInt16LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 2, this.length); + const val = this[offset] | this[offset + 1] << 8; + return val & 32768 ? val | 4294901760 : val; + }; + Buffer2.prototype.readInt16BE = function readInt16BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 2, this.length); + const val = this[offset + 1] | this[offset] << 8; + return val & 32768 ? val | 4294901760 : val; + }; + Buffer2.prototype.readInt32LE = function readInt32LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24; + }; + Buffer2.prototype.readInt32BE = function readInt32BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]; + }; + Buffer2.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE(offset) { + offset = offset >>> 0; + validateNumber(offset, "offset"); + const first = this[offset]; + const last = this[offset + 7]; + if (first === void 0 || last === void 0) { + boundsError(offset, this.length - 8); + } + const val = this[offset + 4] + this[offset + 5] * 2 ** 8 + this[offset + 6] * 2 ** 16 + (last << 24); + return (BigInt(val) << BigInt(32)) + BigInt(first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24); + }); + Buffer2.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE(offset) { + offset = offset >>> 0; + validateNumber(offset, "offset"); + const first = this[offset]; + const last = this[offset + 7]; + if (first === void 0 || last === void 0) { + boundsError(offset, this.length - 8); + } + const val = (first << 24) + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset]; + return (BigInt(val) << BigInt(32)) + BigInt(this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last); + }); + Buffer2.prototype.readFloatLE = function readFloatLE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return ieee754.read(this, offset, true, 23, 4); + }; + Buffer2.prototype.readFloatBE = function readFloatBE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return ieee754.read(this, offset, false, 23, 4); + }; + Buffer2.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 8, this.length); + return ieee754.read(this, offset, true, 52, 8); + }; + Buffer2.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 8, this.length); + return ieee754.read(this, offset, false, 52, 8); + }; + function checkInt(buf, value, offset, ext, max, min) { + if (!Buffer2.isBuffer(buf)) + throw new TypeError('"buffer" argument must be a Buffer instance'); + if (value > max || value < min) + throw new RangeError('"value" argument is out of bounds'); + if (offset + ext > buf.length) + throw new RangeError("Index out of range"); + } + Buffer2.prototype.writeUintLE = Buffer2.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength2, noAssert) { + value = +value; + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) { + const maxBytes = Math.pow(2, 8 * byteLength2) - 1; + checkInt(this, value, offset, byteLength2, maxBytes, 0); + } + let mul = 1; + let i = 0; + this[offset] = value & 255; + while (++i < byteLength2 && (mul *= 256)) { + this[offset + i] = value / mul & 255; + } + return offset + byteLength2; + }; + Buffer2.prototype.writeUintBE = Buffer2.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength2, noAssert) { + value = +value; + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) { + const maxBytes = Math.pow(2, 8 * byteLength2) - 1; + checkInt(this, value, offset, byteLength2, maxBytes, 0); + } + let i = byteLength2 - 1; + let mul = 1; + this[offset + i] = value & 255; + while (--i >= 0 && (mul *= 256)) { + this[offset + i] = value / mul & 255; + } + return offset + byteLength2; + }; + Buffer2.prototype.writeUint8 = Buffer2.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 1, 255, 0); + this[offset] = value & 255; + return offset + 1; + }; + Buffer2.prototype.writeUint16LE = Buffer2.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 2, 65535, 0); + this[offset] = value & 255; + this[offset + 1] = value >>> 8; + return offset + 2; + }; + Buffer2.prototype.writeUint16BE = Buffer2.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 2, 65535, 0); + this[offset] = value >>> 8; + this[offset + 1] = value & 255; + return offset + 2; + }; + Buffer2.prototype.writeUint32LE = Buffer2.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 4, 4294967295, 0); + this[offset + 3] = value >>> 24; + this[offset + 2] = value >>> 16; + this[offset + 1] = value >>> 8; + this[offset] = value & 255; + return offset + 4; + }; + Buffer2.prototype.writeUint32BE = Buffer2.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 4, 4294967295, 0); + this[offset] = value >>> 24; + this[offset + 1] = value >>> 16; + this[offset + 2] = value >>> 8; + this[offset + 3] = value & 255; + return offset + 4; + }; + function wrtBigUInt64LE(buf, value, offset, min, max) { + checkIntBI(value, min, max, buf, offset, 7); + let lo = Number(value & BigInt(4294967295)); + buf[offset++] = lo; + lo = lo >> 8; + buf[offset++] = lo; + lo = lo >> 8; + buf[offset++] = lo; + lo = lo >> 8; + buf[offset++] = lo; + let hi = Number(value >> BigInt(32) & BigInt(4294967295)); + buf[offset++] = hi; + hi = hi >> 8; + buf[offset++] = hi; + hi = hi >> 8; + buf[offset++] = hi; + hi = hi >> 8; + buf[offset++] = hi; + return offset; + } + function wrtBigUInt64BE(buf, value, offset, min, max) { + checkIntBI(value, min, max, buf, offset, 7); + let lo = Number(value & BigInt(4294967295)); + buf[offset + 7] = lo; + lo = lo >> 8; + buf[offset + 6] = lo; + lo = lo >> 8; + buf[offset + 5] = lo; + lo = lo >> 8; + buf[offset + 4] = lo; + let hi = Number(value >> BigInt(32) & BigInt(4294967295)); + buf[offset + 3] = hi; + hi = hi >> 8; + buf[offset + 2] = hi; + hi = hi >> 8; + buf[offset + 1] = hi; + hi = hi >> 8; + buf[offset] = hi; + return offset + 8; + } + Buffer2.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE(value, offset = 0) { + return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt("0xffffffffffffffff")); + }); + Buffer2.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE(value, offset = 0) { + return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt("0xffffffffffffffff")); + }); + Buffer2.prototype.writeIntLE = function writeIntLE(value, offset, byteLength2, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + const limit = Math.pow(2, 8 * byteLength2 - 1); + checkInt(this, value, offset, byteLength2, limit - 1, -limit); + } + let i = 0; + let mul = 1; + let sub = 0; + this[offset] = value & 255; + while (++i < byteLength2 && (mul *= 256)) { + if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { + sub = 1; + } + this[offset + i] = (value / mul >> 0) - sub & 255; + } + return offset + byteLength2; + }; + Buffer2.prototype.writeIntBE = function writeIntBE(value, offset, byteLength2, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + const limit = Math.pow(2, 8 * byteLength2 - 1); + checkInt(this, value, offset, byteLength2, limit - 1, -limit); + } + let i = byteLength2 - 1; + let mul = 1; + let sub = 0; + this[offset + i] = value & 255; + while (--i >= 0 && (mul *= 256)) { + if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { + sub = 1; + } + this[offset + i] = (value / mul >> 0) - sub & 255; + } + return offset + byteLength2; + }; + Buffer2.prototype.writeInt8 = function writeInt8(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 1, 127, -128); + if (value < 0) + value = 255 + value + 1; + this[offset] = value & 255; + return offset + 1; + }; + Buffer2.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 2, 32767, -32768); + this[offset] = value & 255; + this[offset + 1] = value >>> 8; + return offset + 2; + }; + Buffer2.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 2, 32767, -32768); + this[offset] = value >>> 8; + this[offset + 1] = value & 255; + return offset + 2; + }; + Buffer2.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 4, 2147483647, -2147483648); + this[offset] = value & 255; + this[offset + 1] = value >>> 8; + this[offset + 2] = value >>> 16; + this[offset + 3] = value >>> 24; + return offset + 4; + }; + Buffer2.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 4, 2147483647, -2147483648); + if (value < 0) + value = 4294967295 + value + 1; + this[offset] = value >>> 24; + this[offset + 1] = value >>> 16; + this[offset + 2] = value >>> 8; + this[offset + 3] = value & 255; + return offset + 4; + }; + Buffer2.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE(value, offset = 0) { + return wrtBigUInt64LE(this, value, offset, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff")); + }); + Buffer2.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE(value, offset = 0) { + return wrtBigUInt64BE(this, value, offset, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff")); + }); + function checkIEEE754(buf, value, offset, ext, max, min) { + if (offset + ext > buf.length) + throw new RangeError("Index out of range"); + if (offset < 0) + throw new RangeError("Index out of range"); + } + function writeFloat(buf, value, offset, littleEndian, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + checkIEEE754(buf, value, offset, 4, 34028234663852886e22, -34028234663852886e22); + } + ieee754.write(buf, value, offset, littleEndian, 23, 4); + return offset + 4; + } + Buffer2.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) { + return writeFloat(this, value, offset, true, noAssert); + }; + Buffer2.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) { + return writeFloat(this, value, offset, false, noAssert); + }; + function writeDouble(buf, value, offset, littleEndian, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + checkIEEE754(buf, value, offset, 8, 17976931348623157e292, -17976931348623157e292); + } + ieee754.write(buf, value, offset, littleEndian, 52, 8); + return offset + 8; + } + Buffer2.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) { + return writeDouble(this, value, offset, true, noAssert); + }; + Buffer2.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) { + return writeDouble(this, value, offset, false, noAssert); + }; + Buffer2.prototype.copy = function copy(target, targetStart, start, end) { + if (!Buffer2.isBuffer(target)) + throw new TypeError("argument should be a Buffer"); + if (!start) + start = 0; + if (!end && end !== 0) + end = this.length; + if (targetStart >= target.length) + targetStart = target.length; + if (!targetStart) + targetStart = 0; + if (end > 0 && end < start) + end = start; + if (end === start) + return 0; + if (target.length === 0 || this.length === 0) + return 0; + if (targetStart < 0) { + throw new RangeError("targetStart out of bounds"); + } + if (start < 0 || start >= this.length) + throw new RangeError("Index out of range"); + if (end < 0) + throw new RangeError("sourceEnd out of bounds"); + if (end > this.length) + end = this.length; + if (target.length - targetStart < end - start) { + end = target.length - targetStart + start; + } + const len = end - start; + if (this === target && typeof Uint8Array.prototype.copyWithin === "function") { + this.copyWithin(targetStart, start, end); + } else { + Uint8Array.prototype.set.call(target, this.subarray(start, end), targetStart); + } + return len; + }; + Buffer2.prototype.fill = function fill(val, start, end, encoding) { + if (typeof val === "string") { + if (typeof start === "string") { + encoding = start; + start = 0; + end = this.length; + } else if (typeof end === "string") { + encoding = end; + end = this.length; + } + if (encoding !== void 0 && typeof encoding !== "string") { + throw new TypeError("encoding must be a string"); + } + if (typeof encoding === "string" && !Buffer2.isEncoding(encoding)) { + throw new TypeError("Unknown encoding: " + encoding); + } + if (val.length === 1) { + const code = val.charCodeAt(0); + if (encoding === "utf8" && code < 128 || encoding === "latin1") { + val = code; + } + } + } else if (typeof val === "number") { + val = val & 255; + } else if (typeof val === "boolean") { + val = Number(val); + } + if (start < 0 || this.length < start || this.length < end) { + throw new RangeError("Out of range index"); + } + if (end <= start) { + return this; + } + start = start >>> 0; + end = end === void 0 ? this.length : end >>> 0; + if (!val) + val = 0; + let i; + if (typeof val === "number") { + for (i = start; i < end; ++i) { + this[i] = val; + } + } else { + const bytes = Buffer2.isBuffer(val) ? val : Buffer2.from(val, encoding); + const len = bytes.length; + if (len === 0) { + throw new TypeError('The value "' + val + '" is invalid for argument "value"'); + } + for (i = 0; i < end - start; ++i) { + this[i + start] = bytes[i % len]; + } + } + return this; + }; + var errors = {}; + function E(sym, getMessage, Base) { + errors[sym] = class NodeError extends Base { + constructor() { + super(); + Object.defineProperty(this, "message", { + value: getMessage.apply(this, arguments), + writable: true, + configurable: true + }); + this.name = `${this.name} [${sym}]`; + this.stack; + delete this.name; + } + get code() { + return sym; + } + set code(value) { + Object.defineProperty(this, "code", { + configurable: true, + enumerable: true, + value, + writable: true + }); + } + toString() { + return `${this.name} [${sym}]: ${this.message}`; + } + }; + } + E("ERR_BUFFER_OUT_OF_BOUNDS", function(name) { + if (name) { + return `${name} is outside of buffer bounds`; + } + return "Attempt to access memory outside buffer bounds"; + }, RangeError); + E("ERR_INVALID_ARG_TYPE", function(name, actual) { + return `The "${name}" argument must be of type number. Received type ${typeof actual}`; + }, TypeError); + E("ERR_OUT_OF_RANGE", function(str, range, input) { + let msg = `The value of "${str}" is out of range.`; + let received = input; + if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) { + received = addNumericalSeparator(String(input)); + } else if (typeof input === "bigint") { + received = String(input); + if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) { + received = addNumericalSeparator(received); + } + received += "n"; + } + msg += ` It must be ${range}. Received ${received}`; + return msg; + }, RangeError); + function addNumericalSeparator(val) { + let res = ""; + let i = val.length; + const start = val[0] === "-" ? 1 : 0; + for (; i >= start + 4; i -= 3) { + res = `_${val.slice(i - 3, i)}${res}`; + } + return `${val.slice(0, i)}${res}`; + } + function checkBounds(buf, offset, byteLength2) { + validateNumber(offset, "offset"); + if (buf[offset] === void 0 || buf[offset + byteLength2] === void 0) { + boundsError(offset, buf.length - (byteLength2 + 1)); + } + } + function checkIntBI(value, min, max, buf, offset, byteLength2) { + if (value > max || value < min) { + const n = typeof min === "bigint" ? "n" : ""; + let range; + if (byteLength2 > 3) { + if (min === 0 || min === BigInt(0)) { + range = `>= 0${n} and < 2${n} ** ${(byteLength2 + 1) * 8}${n}`; + } else { + range = `>= -(2${n} ** ${(byteLength2 + 1) * 8 - 1}${n}) and < 2 ** ${(byteLength2 + 1) * 8 - 1}${n}`; + } + } else { + range = `>= ${min}${n} and <= ${max}${n}`; + } + throw new errors.ERR_OUT_OF_RANGE("value", range, value); + } + checkBounds(buf, offset, byteLength2); + } + function validateNumber(value, name) { + if (typeof value !== "number") { + throw new errors.ERR_INVALID_ARG_TYPE(name, "number", value); + } + } + function boundsError(value, length2, type) { + if (Math.floor(value) !== value) { + validateNumber(value, type); + throw new errors.ERR_OUT_OF_RANGE(type || "offset", "an integer", value); + } + if (length2 < 0) { + throw new errors.ERR_BUFFER_OUT_OF_BOUNDS(); + } + throw new errors.ERR_OUT_OF_RANGE(type || "offset", `>= ${type ? 1 : 0} and <= ${length2}`, value); + } + var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g; + function base64clean(str) { + str = str.split("=")[0]; + str = str.trim().replace(INVALID_BASE64_RE, ""); + if (str.length < 2) + return ""; + while (str.length % 4 !== 0) { + str = str + "="; + } + return str; + } + function utf8ToBytes(string3, units) { + units = units || Infinity; + let codePoint; + const length2 = string3.length; + let leadSurrogate = null; + const bytes = []; + for (let i = 0; i < length2; ++i) { + codePoint = string3.charCodeAt(i); + if (codePoint > 55295 && codePoint < 57344) { + if (!leadSurrogate) { + if (codePoint > 56319) { + if ((units -= 3) > -1) + bytes.push(239, 191, 189); + continue; + } else if (i + 1 === length2) { + if ((units -= 3) > -1) + bytes.push(239, 191, 189); + continue; + } + leadSurrogate = codePoint; + continue; + } + if (codePoint < 56320) { + if ((units -= 3) > -1) + bytes.push(239, 191, 189); + leadSurrogate = codePoint; + continue; + } + codePoint = (leadSurrogate - 55296 << 10 | codePoint - 56320) + 65536; + } else if (leadSurrogate) { + if ((units -= 3) > -1) + bytes.push(239, 191, 189); + } + leadSurrogate = null; + if (codePoint < 128) { + if ((units -= 1) < 0) + break; + bytes.push(codePoint); + } else if (codePoint < 2048) { + if ((units -= 2) < 0) + break; + bytes.push(codePoint >> 6 | 192, codePoint & 63 | 128); + } else if (codePoint < 65536) { + if ((units -= 3) < 0) + break; + bytes.push(codePoint >> 12 | 224, codePoint >> 6 & 63 | 128, codePoint & 63 | 128); + } else if (codePoint < 1114112) { + if ((units -= 4) < 0) + break; + bytes.push(codePoint >> 18 | 240, codePoint >> 12 & 63 | 128, codePoint >> 6 & 63 | 128, codePoint & 63 | 128); + } else { + throw new Error("Invalid code point"); + } + } + return bytes; + } + function asciiToBytes(str) { + const byteArray = []; + for (let i = 0; i < str.length; ++i) { + byteArray.push(str.charCodeAt(i) & 255); + } + return byteArray; + } + function utf16leToBytes(str, units) { + let c, hi, lo; + const byteArray = []; + for (let i = 0; i < str.length; ++i) { + if ((units -= 2) < 0) + break; + c = str.charCodeAt(i); + hi = c >> 8; + lo = c % 256; + byteArray.push(lo); + byteArray.push(hi); + } + return byteArray; + } + function base64ToBytes(str) { + return base64.toByteArray(base64clean(str)); + } + function blitBuffer(src2, dst, offset, length2) { + let i; + for (i = 0; i < length2; ++i) { + if (i + offset >= dst.length || i >= src2.length) + break; + dst[i + offset] = src2[i]; + } + return i; + } + function isInstance(obj, type) { + return obj instanceof type || obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type.name; + } + function numberIsNaN(obj) { + return obj !== obj; + } + var hexSliceLookupTable = function() { + const alphabet = "0123456789abcdef"; + const table = new Array(256); + for (let i = 0; i < 16; ++i) { + const i16 = i * 16; + for (let j = 0; j < 16; ++j) { + table[i16 + j] = alphabet[i] + alphabet[j]; + } + } + return table; + }(); + function defineBigIntMethod(fn) { + return typeof BigInt === "undefined" ? BufferBigIntNotDefined : fn; + } + function BufferBigIntNotDefined() { + throw new Error("BigInt not supported"); + } + } + }); + + // (disabled):crypto + var require_crypto = __commonJS({ + "(disabled):crypto"() { + } + }); + + // node_modules/tweetnacl/nacl-fast.js + var require_nacl_fast = __commonJS({ + "node_modules/tweetnacl/nacl-fast.js"(exports, module) { + (function(nacl2) { + "use strict"; + var gf = function(init) { + var i, r = new Float64Array(16); + if (init) + for (i = 0; i < init.length; i++) + r[i] = init[i]; + return r; + }; + var randombytes = function() { + throw new Error("no PRNG"); + }; + var _0 = new Uint8Array(16); + var _9 = new Uint8Array(32); + _9[0] = 9; + var gf0 = gf(), gf1 = gf([1]), _121665 = gf([56129, 1]), D = gf([30883, 4953, 19914, 30187, 55467, 16705, 2637, 112, 59544, 30585, 16505, 36039, 65139, 11119, 27886, 20995]), D2 = gf([61785, 9906, 39828, 60374, 45398, 33411, 5274, 224, 53552, 61171, 33010, 6542, 64743, 22239, 55772, 9222]), X = gf([54554, 36645, 11616, 51542, 42930, 38181, 51040, 26924, 56412, 64982, 57905, 49316, 21502, 52590, 14035, 8553]), Y = gf([26200, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214]), I = gf([41136, 18958, 6951, 50414, 58488, 44335, 6150, 12099, 55207, 15867, 153, 11085, 57099, 20417, 9344, 11139]); + function ts64(x, i, h, l) { + x[i] = h >> 24 & 255; + x[i + 1] = h >> 16 & 255; + x[i + 2] = h >> 8 & 255; + x[i + 3] = h & 255; + x[i + 4] = l >> 24 & 255; + x[i + 5] = l >> 16 & 255; + x[i + 6] = l >> 8 & 255; + x[i + 7] = l & 255; + } + function vn(x, xi, y, yi, n) { + var i, d = 0; + for (i = 0; i < n; i++) + d |= x[xi + i] ^ y[yi + i]; + return (1 & d - 1 >>> 8) - 1; + } + function crypto_verify_16(x, xi, y, yi) { + return vn(x, xi, y, yi, 16); + } + function crypto_verify_32(x, xi, y, yi) { + return vn(x, xi, y, yi, 32); + } + function core_salsa20(o, p, k, c) { + var j0 = c[0] & 255 | (c[1] & 255) << 8 | (c[2] & 255) << 16 | (c[3] & 255) << 24, j1 = k[0] & 255 | (k[1] & 255) << 8 | (k[2] & 255) << 16 | (k[3] & 255) << 24, j2 = k[4] & 255 | (k[5] & 255) << 8 | (k[6] & 255) << 16 | (k[7] & 255) << 24, j3 = k[8] & 255 | (k[9] & 255) << 8 | (k[10] & 255) << 16 | (k[11] & 255) << 24, j4 = k[12] & 255 | (k[13] & 255) << 8 | (k[14] & 255) << 16 | (k[15] & 255) << 24, j5 = c[4] & 255 | (c[5] & 255) << 8 | (c[6] & 255) << 16 | (c[7] & 255) << 24, j6 = p[0] & 255 | (p[1] & 255) << 8 | (p[2] & 255) << 16 | (p[3] & 255) << 24, j7 = p[4] & 255 | (p[5] & 255) << 8 | (p[6] & 255) << 16 | (p[7] & 255) << 24, j8 = p[8] & 255 | (p[9] & 255) << 8 | (p[10] & 255) << 16 | (p[11] & 255) << 24, j9 = p[12] & 255 | (p[13] & 255) << 8 | (p[14] & 255) << 16 | (p[15] & 255) << 24, j10 = c[8] & 255 | (c[9] & 255) << 8 | (c[10] & 255) << 16 | (c[11] & 255) << 24, j11 = k[16] & 255 | (k[17] & 255) << 8 | (k[18] & 255) << 16 | (k[19] & 255) << 24, j12 = k[20] & 255 | (k[21] & 255) << 8 | (k[22] & 255) << 16 | (k[23] & 255) << 24, j13 = k[24] & 255 | (k[25] & 255) << 8 | (k[26] & 255) << 16 | (k[27] & 255) << 24, j14 = k[28] & 255 | (k[29] & 255) << 8 | (k[30] & 255) << 16 | (k[31] & 255) << 24, j15 = c[12] & 255 | (c[13] & 255) << 8 | (c[14] & 255) << 16 | (c[15] & 255) << 24; + var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7, x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14, x15 = j15, u; + for (var i = 0; i < 20; i += 2) { + u = x0 + x12 | 0; + x4 ^= u << 7 | u >>> 32 - 7; + u = x4 + x0 | 0; + x8 ^= u << 9 | u >>> 32 - 9; + u = x8 + x4 | 0; + x12 ^= u << 13 | u >>> 32 - 13; + u = x12 + x8 | 0; + x0 ^= u << 18 | u >>> 32 - 18; + u = x5 + x1 | 0; + x9 ^= u << 7 | u >>> 32 - 7; + u = x9 + x5 | 0; + x13 ^= u << 9 | u >>> 32 - 9; + u = x13 + x9 | 0; + x1 ^= u << 13 | u >>> 32 - 13; + u = x1 + x13 | 0; + x5 ^= u << 18 | u >>> 32 - 18; + u = x10 + x6 | 0; + x14 ^= u << 7 | u >>> 32 - 7; + u = x14 + x10 | 0; + x2 ^= u << 9 | u >>> 32 - 9; + u = x2 + x14 | 0; + x6 ^= u << 13 | u >>> 32 - 13; + u = x6 + x2 | 0; + x10 ^= u << 18 | u >>> 32 - 18; + u = x15 + x11 | 0; + x3 ^= u << 7 | u >>> 32 - 7; + u = x3 + x15 | 0; + x7 ^= u << 9 | u >>> 32 - 9; + u = x7 + x3 | 0; + x11 ^= u << 13 | u >>> 32 - 13; + u = x11 + x7 | 0; + x15 ^= u << 18 | u >>> 32 - 18; + u = x0 + x3 | 0; + x1 ^= u << 7 | u >>> 32 - 7; + u = x1 + x0 | 0; + x2 ^= u << 9 | u >>> 32 - 9; + u = x2 + x1 | 0; + x3 ^= u << 13 | u >>> 32 - 13; + u = x3 + x2 | 0; + x0 ^= u << 18 | u >>> 32 - 18; + u = x5 + x4 | 0; + x6 ^= u << 7 | u >>> 32 - 7; + u = x6 + x5 | 0; + x7 ^= u << 9 | u >>> 32 - 9; + u = x7 + x6 | 0; + x4 ^= u << 13 | u >>> 32 - 13; + u = x4 + x7 | 0; + x5 ^= u << 18 | u >>> 32 - 18; + u = x10 + x9 | 0; + x11 ^= u << 7 | u >>> 32 - 7; + u = x11 + x10 | 0; + x8 ^= u << 9 | u >>> 32 - 9; + u = x8 + x11 | 0; + x9 ^= u << 13 | u >>> 32 - 13; + u = x9 + x8 | 0; + x10 ^= u << 18 | u >>> 32 - 18; + u = x15 + x14 | 0; + x12 ^= u << 7 | u >>> 32 - 7; + u = x12 + x15 | 0; + x13 ^= u << 9 | u >>> 32 - 9; + u = x13 + x12 | 0; + x14 ^= u << 13 | u >>> 32 - 13; + u = x14 + x13 | 0; + x15 ^= u << 18 | u >>> 32 - 18; + } + x0 = x0 + j0 | 0; + x1 = x1 + j1 | 0; + x2 = x2 + j2 | 0; + x3 = x3 + j3 | 0; + x4 = x4 + j4 | 0; + x5 = x5 + j5 | 0; + x6 = x6 + j6 | 0; + x7 = x7 + j7 | 0; + x8 = x8 + j8 | 0; + x9 = x9 + j9 | 0; + x10 = x10 + j10 | 0; + x11 = x11 + j11 | 0; + x12 = x12 + j12 | 0; + x13 = x13 + j13 | 0; + x14 = x14 + j14 | 0; + x15 = x15 + j15 | 0; + o[0] = x0 >>> 0 & 255; + o[1] = x0 >>> 8 & 255; + o[2] = x0 >>> 16 & 255; + o[3] = x0 >>> 24 & 255; + o[4] = x1 >>> 0 & 255; + o[5] = x1 >>> 8 & 255; + o[6] = x1 >>> 16 & 255; + o[7] = x1 >>> 24 & 255; + o[8] = x2 >>> 0 & 255; + o[9] = x2 >>> 8 & 255; + o[10] = x2 >>> 16 & 255; + o[11] = x2 >>> 24 & 255; + o[12] = x3 >>> 0 & 255; + o[13] = x3 >>> 8 & 255; + o[14] = x3 >>> 16 & 255; + o[15] = x3 >>> 24 & 255; + o[16] = x4 >>> 0 & 255; + o[17] = x4 >>> 8 & 255; + o[18] = x4 >>> 16 & 255; + o[19] = x4 >>> 24 & 255; + o[20] = x5 >>> 0 & 255; + o[21] = x5 >>> 8 & 255; + o[22] = x5 >>> 16 & 255; + o[23] = x5 >>> 24 & 255; + o[24] = x6 >>> 0 & 255; + o[25] = x6 >>> 8 & 255; + o[26] = x6 >>> 16 & 255; + o[27] = x6 >>> 24 & 255; + o[28] = x7 >>> 0 & 255; + o[29] = x7 >>> 8 & 255; + o[30] = x7 >>> 16 & 255; + o[31] = x7 >>> 24 & 255; + o[32] = x8 >>> 0 & 255; + o[33] = x8 >>> 8 & 255; + o[34] = x8 >>> 16 & 255; + o[35] = x8 >>> 24 & 255; + o[36] = x9 >>> 0 & 255; + o[37] = x9 >>> 8 & 255; + o[38] = x9 >>> 16 & 255; + o[39] = x9 >>> 24 & 255; + o[40] = x10 >>> 0 & 255; + o[41] = x10 >>> 8 & 255; + o[42] = x10 >>> 16 & 255; + o[43] = x10 >>> 24 & 255; + o[44] = x11 >>> 0 & 255; + o[45] = x11 >>> 8 & 255; + o[46] = x11 >>> 16 & 255; + o[47] = x11 >>> 24 & 255; + o[48] = x12 >>> 0 & 255; + o[49] = x12 >>> 8 & 255; + o[50] = x12 >>> 16 & 255; + o[51] = x12 >>> 24 & 255; + o[52] = x13 >>> 0 & 255; + o[53] = x13 >>> 8 & 255; + o[54] = x13 >>> 16 & 255; + o[55] = x13 >>> 24 & 255; + o[56] = x14 >>> 0 & 255; + o[57] = x14 >>> 8 & 255; + o[58] = x14 >>> 16 & 255; + o[59] = x14 >>> 24 & 255; + o[60] = x15 >>> 0 & 255; + o[61] = x15 >>> 8 & 255; + o[62] = x15 >>> 16 & 255; + o[63] = x15 >>> 24 & 255; + } + function core_hsalsa20(o, p, k, c) { + var j0 = c[0] & 255 | (c[1] & 255) << 8 | (c[2] & 255) << 16 | (c[3] & 255) << 24, j1 = k[0] & 255 | (k[1] & 255) << 8 | (k[2] & 255) << 16 | (k[3] & 255) << 24, j2 = k[4] & 255 | (k[5] & 255) << 8 | (k[6] & 255) << 16 | (k[7] & 255) << 24, j3 = k[8] & 255 | (k[9] & 255) << 8 | (k[10] & 255) << 16 | (k[11] & 255) << 24, j4 = k[12] & 255 | (k[13] & 255) << 8 | (k[14] & 255) << 16 | (k[15] & 255) << 24, j5 = c[4] & 255 | (c[5] & 255) << 8 | (c[6] & 255) << 16 | (c[7] & 255) << 24, j6 = p[0] & 255 | (p[1] & 255) << 8 | (p[2] & 255) << 16 | (p[3] & 255) << 24, j7 = p[4] & 255 | (p[5] & 255) << 8 | (p[6] & 255) << 16 | (p[7] & 255) << 24, j8 = p[8] & 255 | (p[9] & 255) << 8 | (p[10] & 255) << 16 | (p[11] & 255) << 24, j9 = p[12] & 255 | (p[13] & 255) << 8 | (p[14] & 255) << 16 | (p[15] & 255) << 24, j10 = c[8] & 255 | (c[9] & 255) << 8 | (c[10] & 255) << 16 | (c[11] & 255) << 24, j11 = k[16] & 255 | (k[17] & 255) << 8 | (k[18] & 255) << 16 | (k[19] & 255) << 24, j12 = k[20] & 255 | (k[21] & 255) << 8 | (k[22] & 255) << 16 | (k[23] & 255) << 24, j13 = k[24] & 255 | (k[25] & 255) << 8 | (k[26] & 255) << 16 | (k[27] & 255) << 24, j14 = k[28] & 255 | (k[29] & 255) << 8 | (k[30] & 255) << 16 | (k[31] & 255) << 24, j15 = c[12] & 255 | (c[13] & 255) << 8 | (c[14] & 255) << 16 | (c[15] & 255) << 24; + var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7, x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14, x15 = j15, u; + for (var i = 0; i < 20; i += 2) { + u = x0 + x12 | 0; + x4 ^= u << 7 | u >>> 32 - 7; + u = x4 + x0 | 0; + x8 ^= u << 9 | u >>> 32 - 9; + u = x8 + x4 | 0; + x12 ^= u << 13 | u >>> 32 - 13; + u = x12 + x8 | 0; + x0 ^= u << 18 | u >>> 32 - 18; + u = x5 + x1 | 0; + x9 ^= u << 7 | u >>> 32 - 7; + u = x9 + x5 | 0; + x13 ^= u << 9 | u >>> 32 - 9; + u = x13 + x9 | 0; + x1 ^= u << 13 | u >>> 32 - 13; + u = x1 + x13 | 0; + x5 ^= u << 18 | u >>> 32 - 18; + u = x10 + x6 | 0; + x14 ^= u << 7 | u >>> 32 - 7; + u = x14 + x10 | 0; + x2 ^= u << 9 | u >>> 32 - 9; + u = x2 + x14 | 0; + x6 ^= u << 13 | u >>> 32 - 13; + u = x6 + x2 | 0; + x10 ^= u << 18 | u >>> 32 - 18; + u = x15 + x11 | 0; + x3 ^= u << 7 | u >>> 32 - 7; + u = x3 + x15 | 0; + x7 ^= u << 9 | u >>> 32 - 9; + u = x7 + x3 | 0; + x11 ^= u << 13 | u >>> 32 - 13; + u = x11 + x7 | 0; + x15 ^= u << 18 | u >>> 32 - 18; + u = x0 + x3 | 0; + x1 ^= u << 7 | u >>> 32 - 7; + u = x1 + x0 | 0; + x2 ^= u << 9 | u >>> 32 - 9; + u = x2 + x1 | 0; + x3 ^= u << 13 | u >>> 32 - 13; + u = x3 + x2 | 0; + x0 ^= u << 18 | u >>> 32 - 18; + u = x5 + x4 | 0; + x6 ^= u << 7 | u >>> 32 - 7; + u = x6 + x5 | 0; + x7 ^= u << 9 | u >>> 32 - 9; + u = x7 + x6 | 0; + x4 ^= u << 13 | u >>> 32 - 13; + u = x4 + x7 | 0; + x5 ^= u << 18 | u >>> 32 - 18; + u = x10 + x9 | 0; + x11 ^= u << 7 | u >>> 32 - 7; + u = x11 + x10 | 0; + x8 ^= u << 9 | u >>> 32 - 9; + u = x8 + x11 | 0; + x9 ^= u << 13 | u >>> 32 - 13; + u = x9 + x8 | 0; + x10 ^= u << 18 | u >>> 32 - 18; + u = x15 + x14 | 0; + x12 ^= u << 7 | u >>> 32 - 7; + u = x12 + x15 | 0; + x13 ^= u << 9 | u >>> 32 - 9; + u = x13 + x12 | 0; + x14 ^= u << 13 | u >>> 32 - 13; + u = x14 + x13 | 0; + x15 ^= u << 18 | u >>> 32 - 18; + } + o[0] = x0 >>> 0 & 255; + o[1] = x0 >>> 8 & 255; + o[2] = x0 >>> 16 & 255; + o[3] = x0 >>> 24 & 255; + o[4] = x5 >>> 0 & 255; + o[5] = x5 >>> 8 & 255; + o[6] = x5 >>> 16 & 255; + o[7] = x5 >>> 24 & 255; + o[8] = x10 >>> 0 & 255; + o[9] = x10 >>> 8 & 255; + o[10] = x10 >>> 16 & 255; + o[11] = x10 >>> 24 & 255; + o[12] = x15 >>> 0 & 255; + o[13] = x15 >>> 8 & 255; + o[14] = x15 >>> 16 & 255; + o[15] = x15 >>> 24 & 255; + o[16] = x6 >>> 0 & 255; + o[17] = x6 >>> 8 & 255; + o[18] = x6 >>> 16 & 255; + o[19] = x6 >>> 24 & 255; + o[20] = x7 >>> 0 & 255; + o[21] = x7 >>> 8 & 255; + o[22] = x7 >>> 16 & 255; + o[23] = x7 >>> 24 & 255; + o[24] = x8 >>> 0 & 255; + o[25] = x8 >>> 8 & 255; + o[26] = x8 >>> 16 & 255; + o[27] = x8 >>> 24 & 255; + o[28] = x9 >>> 0 & 255; + o[29] = x9 >>> 8 & 255; + o[30] = x9 >>> 16 & 255; + o[31] = x9 >>> 24 & 255; + } + function crypto_core_salsa20(out, inp, k, c) { + core_salsa20(out, inp, k, c); + } + function crypto_core_hsalsa20(out, inp, k, c) { + core_hsalsa20(out, inp, k, c); + } + var sigma = new Uint8Array([101, 120, 112, 97, 110, 100, 32, 51, 50, 45, 98, 121, 116, 101, 32, 107]); + function crypto_stream_salsa20_xor(c, cpos, m, mpos, b, n, k) { + var z = new Uint8Array(16), x = new Uint8Array(64); + var u, i; + for (i = 0; i < 16; i++) + z[i] = 0; + for (i = 0; i < 8; i++) + z[i] = n[i]; + while (b >= 64) { + crypto_core_salsa20(x, z, k, sigma); + for (i = 0; i < 64; i++) + c[cpos + i] = m[mpos + i] ^ x[i]; + u = 1; + for (i = 8; i < 16; i++) { + u = u + (z[i] & 255) | 0; + z[i] = u & 255; + u >>>= 8; + } + b -= 64; + cpos += 64; + mpos += 64; + } + if (b > 0) { + crypto_core_salsa20(x, z, k, sigma); + for (i = 0; i < b; i++) + c[cpos + i] = m[mpos + i] ^ x[i]; + } + return 0; + } + function crypto_stream_salsa20(c, cpos, b, n, k) { + var z = new Uint8Array(16), x = new Uint8Array(64); + var u, i; + for (i = 0; i < 16; i++) + z[i] = 0; + for (i = 0; i < 8; i++) + z[i] = n[i]; + while (b >= 64) { + crypto_core_salsa20(x, z, k, sigma); + for (i = 0; i < 64; i++) + c[cpos + i] = x[i]; + u = 1; + for (i = 8; i < 16; i++) { + u = u + (z[i] & 255) | 0; + z[i] = u & 255; + u >>>= 8; + } + b -= 64; + cpos += 64; + } + if (b > 0) { + crypto_core_salsa20(x, z, k, sigma); + for (i = 0; i < b; i++) + c[cpos + i] = x[i]; + } + return 0; + } + function crypto_stream(c, cpos, d, n, k) { + var s = new Uint8Array(32); + crypto_core_hsalsa20(s, n, k, sigma); + var sn = new Uint8Array(8); + for (var i = 0; i < 8; i++) + sn[i] = n[i + 16]; + return crypto_stream_salsa20(c, cpos, d, sn, s); + } + function crypto_stream_xor(c, cpos, m, mpos, d, n, k) { + var s = new Uint8Array(32); + crypto_core_hsalsa20(s, n, k, sigma); + var sn = new Uint8Array(8); + for (var i = 0; i < 8; i++) + sn[i] = n[i + 16]; + return crypto_stream_salsa20_xor(c, cpos, m, mpos, d, sn, s); + } + var poly1305 = function(key) { + this.buffer = new Uint8Array(16); + this.r = new Uint16Array(10); + this.h = new Uint16Array(10); + this.pad = new Uint16Array(8); + this.leftover = 0; + this.fin = 0; + var t0, t1, t2, t3, t4, t5, t6, t7; + t0 = key[0] & 255 | (key[1] & 255) << 8; + this.r[0] = t0 & 8191; + t1 = key[2] & 255 | (key[3] & 255) << 8; + this.r[1] = (t0 >>> 13 | t1 << 3) & 8191; + t2 = key[4] & 255 | (key[5] & 255) << 8; + this.r[2] = (t1 >>> 10 | t2 << 6) & 7939; + t3 = key[6] & 255 | (key[7] & 255) << 8; + this.r[3] = (t2 >>> 7 | t3 << 9) & 8191; + t4 = key[8] & 255 | (key[9] & 255) << 8; + this.r[4] = (t3 >>> 4 | t4 << 12) & 255; + this.r[5] = t4 >>> 1 & 8190; + t5 = key[10] & 255 | (key[11] & 255) << 8; + this.r[6] = (t4 >>> 14 | t5 << 2) & 8191; + t6 = key[12] & 255 | (key[13] & 255) << 8; + this.r[7] = (t5 >>> 11 | t6 << 5) & 8065; + t7 = key[14] & 255 | (key[15] & 255) << 8; + this.r[8] = (t6 >>> 8 | t7 << 8) & 8191; + this.r[9] = t7 >>> 5 & 127; + this.pad[0] = key[16] & 255 | (key[17] & 255) << 8; + this.pad[1] = key[18] & 255 | (key[19] & 255) << 8; + this.pad[2] = key[20] & 255 | (key[21] & 255) << 8; + this.pad[3] = key[22] & 255 | (key[23] & 255) << 8; + this.pad[4] = key[24] & 255 | (key[25] & 255) << 8; + this.pad[5] = key[26] & 255 | (key[27] & 255) << 8; + this.pad[6] = key[28] & 255 | (key[29] & 255) << 8; + this.pad[7] = key[30] & 255 | (key[31] & 255) << 8; + }; + poly1305.prototype.blocks = function(m, mpos, bytes) { + var hibit = this.fin ? 0 : 1 << 11; + var t0, t1, t2, t3, t4, t5, t6, t7, c; + var d0, d1, d2, d3, d4, d5, d6, d7, d8, d9; + var h0 = this.h[0], h1 = this.h[1], h2 = this.h[2], h3 = this.h[3], h4 = this.h[4], h5 = this.h[5], h6 = this.h[6], h7 = this.h[7], h8 = this.h[8], h9 = this.h[9]; + var r0 = this.r[0], r1 = this.r[1], r2 = this.r[2], r3 = this.r[3], r4 = this.r[4], r5 = this.r[5], r6 = this.r[6], r7 = this.r[7], r8 = this.r[8], r9 = this.r[9]; + while (bytes >= 16) { + t0 = m[mpos + 0] & 255 | (m[mpos + 1] & 255) << 8; + h0 += t0 & 8191; + t1 = m[mpos + 2] & 255 | (m[mpos + 3] & 255) << 8; + h1 += (t0 >>> 13 | t1 << 3) & 8191; + t2 = m[mpos + 4] & 255 | (m[mpos + 5] & 255) << 8; + h2 += (t1 >>> 10 | t2 << 6) & 8191; + t3 = m[mpos + 6] & 255 | (m[mpos + 7] & 255) << 8; + h3 += (t2 >>> 7 | t3 << 9) & 8191; + t4 = m[mpos + 8] & 255 | (m[mpos + 9] & 255) << 8; + h4 += (t3 >>> 4 | t4 << 12) & 8191; + h5 += t4 >>> 1 & 8191; + t5 = m[mpos + 10] & 255 | (m[mpos + 11] & 255) << 8; + h6 += (t4 >>> 14 | t5 << 2) & 8191; + t6 = m[mpos + 12] & 255 | (m[mpos + 13] & 255) << 8; + h7 += (t5 >>> 11 | t6 << 5) & 8191; + t7 = m[mpos + 14] & 255 | (m[mpos + 15] & 255) << 8; + h8 += (t6 >>> 8 | t7 << 8) & 8191; + h9 += t7 >>> 5 | hibit; + c = 0; + d0 = c; + d0 += h0 * r0; + d0 += h1 * (5 * r9); + d0 += h2 * (5 * r8); + d0 += h3 * (5 * r7); + d0 += h4 * (5 * r6); + c = d0 >>> 13; + d0 &= 8191; + d0 += h5 * (5 * r5); + d0 += h6 * (5 * r4); + d0 += h7 * (5 * r3); + d0 += h8 * (5 * r2); + d0 += h9 * (5 * r1); + c += d0 >>> 13; + d0 &= 8191; + d1 = c; + d1 += h0 * r1; + d1 += h1 * r0; + d1 += h2 * (5 * r9); + d1 += h3 * (5 * r8); + d1 += h4 * (5 * r7); + c = d1 >>> 13; + d1 &= 8191; + d1 += h5 * (5 * r6); + d1 += h6 * (5 * r5); + d1 += h7 * (5 * r4); + d1 += h8 * (5 * r3); + d1 += h9 * (5 * r2); + c += d1 >>> 13; + d1 &= 8191; + d2 = c; + d2 += h0 * r2; + d2 += h1 * r1; + d2 += h2 * r0; + d2 += h3 * (5 * r9); + d2 += h4 * (5 * r8); + c = d2 >>> 13; + d2 &= 8191; + d2 += h5 * (5 * r7); + d2 += h6 * (5 * r6); + d2 += h7 * (5 * r5); + d2 += h8 * (5 * r4); + d2 += h9 * (5 * r3); + c += d2 >>> 13; + d2 &= 8191; + d3 = c; + d3 += h0 * r3; + d3 += h1 * r2; + d3 += h2 * r1; + d3 += h3 * r0; + d3 += h4 * (5 * r9); + c = d3 >>> 13; + d3 &= 8191; + d3 += h5 * (5 * r8); + d3 += h6 * (5 * r7); + d3 += h7 * (5 * r6); + d3 += h8 * (5 * r5); + d3 += h9 * (5 * r4); + c += d3 >>> 13; + d3 &= 8191; + d4 = c; + d4 += h0 * r4; + d4 += h1 * r3; + d4 += h2 * r2; + d4 += h3 * r1; + d4 += h4 * r0; + c = d4 >>> 13; + d4 &= 8191; + d4 += h5 * (5 * r9); + d4 += h6 * (5 * r8); + d4 += h7 * (5 * r7); + d4 += h8 * (5 * r6); + d4 += h9 * (5 * r5); + c += d4 >>> 13; + d4 &= 8191; + d5 = c; + d5 += h0 * r5; + d5 += h1 * r4; + d5 += h2 * r3; + d5 += h3 * r2; + d5 += h4 * r1; + c = d5 >>> 13; + d5 &= 8191; + d5 += h5 * r0; + d5 += h6 * (5 * r9); + d5 += h7 * (5 * r8); + d5 += h8 * (5 * r7); + d5 += h9 * (5 * r6); + c += d5 >>> 13; + d5 &= 8191; + d6 = c; + d6 += h0 * r6; + d6 += h1 * r5; + d6 += h2 * r4; + d6 += h3 * r3; + d6 += h4 * r2; + c = d6 >>> 13; + d6 &= 8191; + d6 += h5 * r1; + d6 += h6 * r0; + d6 += h7 * (5 * r9); + d6 += h8 * (5 * r8); + d6 += h9 * (5 * r7); + c += d6 >>> 13; + d6 &= 8191; + d7 = c; + d7 += h0 * r7; + d7 += h1 * r6; + d7 += h2 * r5; + d7 += h3 * r4; + d7 += h4 * r3; + c = d7 >>> 13; + d7 &= 8191; + d7 += h5 * r2; + d7 += h6 * r1; + d7 += h7 * r0; + d7 += h8 * (5 * r9); + d7 += h9 * (5 * r8); + c += d7 >>> 13; + d7 &= 8191; + d8 = c; + d8 += h0 * r8; + d8 += h1 * r7; + d8 += h2 * r6; + d8 += h3 * r5; + d8 += h4 * r4; + c = d8 >>> 13; + d8 &= 8191; + d8 += h5 * r3; + d8 += h6 * r2; + d8 += h7 * r1; + d8 += h8 * r0; + d8 += h9 * (5 * r9); + c += d8 >>> 13; + d8 &= 8191; + d9 = c; + d9 += h0 * r9; + d9 += h1 * r8; + d9 += h2 * r7; + d9 += h3 * r6; + d9 += h4 * r5; + c = d9 >>> 13; + d9 &= 8191; + d9 += h5 * r4; + d9 += h6 * r3; + d9 += h7 * r2; + d9 += h8 * r1; + d9 += h9 * r0; + c += d9 >>> 13; + d9 &= 8191; + c = (c << 2) + c | 0; + c = c + d0 | 0; + d0 = c & 8191; + c = c >>> 13; + d1 += c; + h0 = d0; + h1 = d1; + h2 = d2; + h3 = d3; + h4 = d4; + h5 = d5; + h6 = d6; + h7 = d7; + h8 = d8; + h9 = d9; + mpos += 16; + bytes -= 16; + } + this.h[0] = h0; + this.h[1] = h1; + this.h[2] = h2; + this.h[3] = h3; + this.h[4] = h4; + this.h[5] = h5; + this.h[6] = h6; + this.h[7] = h7; + this.h[8] = h8; + this.h[9] = h9; + }; + poly1305.prototype.finish = function(mac, macpos) { + var g = new Uint16Array(10); + var c, mask, f, i; + if (this.leftover) { + i = this.leftover; + this.buffer[i++] = 1; + for (; i < 16; i++) + this.buffer[i] = 0; + this.fin = 1; + this.blocks(this.buffer, 0, 16); + } + c = this.h[1] >>> 13; + this.h[1] &= 8191; + for (i = 2; i < 10; i++) { + this.h[i] += c; + c = this.h[i] >>> 13; + this.h[i] &= 8191; + } + this.h[0] += c * 5; + c = this.h[0] >>> 13; + this.h[0] &= 8191; + this.h[1] += c; + c = this.h[1] >>> 13; + this.h[1] &= 8191; + this.h[2] += c; + g[0] = this.h[0] + 5; + c = g[0] >>> 13; + g[0] &= 8191; + for (i = 1; i < 10; i++) { + g[i] = this.h[i] + c; + c = g[i] >>> 13; + g[i] &= 8191; + } + g[9] -= 1 << 13; + mask = (c ^ 1) - 1; + for (i = 0; i < 10; i++) + g[i] &= mask; + mask = ~mask; + for (i = 0; i < 10; i++) + this.h[i] = this.h[i] & mask | g[i]; + this.h[0] = (this.h[0] | this.h[1] << 13) & 65535; + this.h[1] = (this.h[1] >>> 3 | this.h[2] << 10) & 65535; + this.h[2] = (this.h[2] >>> 6 | this.h[3] << 7) & 65535; + this.h[3] = (this.h[3] >>> 9 | this.h[4] << 4) & 65535; + this.h[4] = (this.h[4] >>> 12 | this.h[5] << 1 | this.h[6] << 14) & 65535; + this.h[5] = (this.h[6] >>> 2 | this.h[7] << 11) & 65535; + this.h[6] = (this.h[7] >>> 5 | this.h[8] << 8) & 65535; + this.h[7] = (this.h[8] >>> 8 | this.h[9] << 5) & 65535; + f = this.h[0] + this.pad[0]; + this.h[0] = f & 65535; + for (i = 1; i < 8; i++) { + f = (this.h[i] + this.pad[i] | 0) + (f >>> 16) | 0; + this.h[i] = f & 65535; + } + mac[macpos + 0] = this.h[0] >>> 0 & 255; + mac[macpos + 1] = this.h[0] >>> 8 & 255; + mac[macpos + 2] = this.h[1] >>> 0 & 255; + mac[macpos + 3] = this.h[1] >>> 8 & 255; + mac[macpos + 4] = this.h[2] >>> 0 & 255; + mac[macpos + 5] = this.h[2] >>> 8 & 255; + mac[macpos + 6] = this.h[3] >>> 0 & 255; + mac[macpos + 7] = this.h[3] >>> 8 & 255; + mac[macpos + 8] = this.h[4] >>> 0 & 255; + mac[macpos + 9] = this.h[4] >>> 8 & 255; + mac[macpos + 10] = this.h[5] >>> 0 & 255; + mac[macpos + 11] = this.h[5] >>> 8 & 255; + mac[macpos + 12] = this.h[6] >>> 0 & 255; + mac[macpos + 13] = this.h[6] >>> 8 & 255; + mac[macpos + 14] = this.h[7] >>> 0 & 255; + mac[macpos + 15] = this.h[7] >>> 8 & 255; + }; + poly1305.prototype.update = function(m, mpos, bytes) { + var i, want; + if (this.leftover) { + want = 16 - this.leftover; + if (want > bytes) + want = bytes; + for (i = 0; i < want; i++) + this.buffer[this.leftover + i] = m[mpos + i]; + bytes -= want; + mpos += want; + this.leftover += want; + if (this.leftover < 16) + return; + this.blocks(this.buffer, 0, 16); + this.leftover = 0; + } + if (bytes >= 16) { + want = bytes - bytes % 16; + this.blocks(m, mpos, want); + mpos += want; + bytes -= want; + } + if (bytes) { + for (i = 0; i < bytes; i++) + this.buffer[this.leftover + i] = m[mpos + i]; + this.leftover += bytes; + } + }; + function crypto_onetimeauth(out, outpos, m, mpos, n, k) { + var s = new poly1305(k); + s.update(m, mpos, n); + s.finish(out, outpos); + return 0; + } + function crypto_onetimeauth_verify(h, hpos, m, mpos, n, k) { + var x = new Uint8Array(16); + crypto_onetimeauth(x, 0, m, mpos, n, k); + return crypto_verify_16(h, hpos, x, 0); + } + function crypto_secretbox(c, m, d, n, k) { + var i; + if (d < 32) + return -1; + crypto_stream_xor(c, 0, m, 0, d, n, k); + crypto_onetimeauth(c, 16, c, 32, d - 32, c); + for (i = 0; i < 16; i++) + c[i] = 0; + return 0; + } + function crypto_secretbox_open(m, c, d, n, k) { + var i; + var x = new Uint8Array(32); + if (d < 32) + return -1; + crypto_stream(x, 0, 32, n, k); + if (crypto_onetimeauth_verify(c, 16, c, 32, d - 32, x) !== 0) + return -1; + crypto_stream_xor(m, 0, c, 0, d, n, k); + for (i = 0; i < 32; i++) + m[i] = 0; + return 0; + } + function set25519(r, a) { + var i; + for (i = 0; i < 16; i++) + r[i] = a[i] | 0; + } + function car25519(o) { + var i, v, c = 1; + for (i = 0; i < 16; i++) { + v = o[i] + c + 65535; + c = Math.floor(v / 65536); + o[i] = v - c * 65536; + } + o[0] += c - 1 + 37 * (c - 1); + } + function sel25519(p, q, b) { + var t, c = ~(b - 1); + for (var i = 0; i < 16; i++) { + t = c & (p[i] ^ q[i]); + p[i] ^= t; + q[i] ^= t; + } + } + function pack25519(o, n) { + var i, j, b; + var m = gf(), t = gf(); + for (i = 0; i < 16; i++) + t[i] = n[i]; + car25519(t); + car25519(t); + car25519(t); + for (j = 0; j < 2; j++) { + m[0] = t[0] - 65517; + for (i = 1; i < 15; i++) { + m[i] = t[i] - 65535 - (m[i - 1] >> 16 & 1); + m[i - 1] &= 65535; + } + m[15] = t[15] - 32767 - (m[14] >> 16 & 1); + b = m[15] >> 16 & 1; + m[14] &= 65535; + sel25519(t, m, 1 - b); + } + for (i = 0; i < 16; i++) { + o[2 * i] = t[i] & 255; + o[2 * i + 1] = t[i] >> 8; + } + } + function neq25519(a, b) { + var c = new Uint8Array(32), d = new Uint8Array(32); + pack25519(c, a); + pack25519(d, b); + return crypto_verify_32(c, 0, d, 0); + } + function par25519(a) { + var d = new Uint8Array(32); + pack25519(d, a); + return d[0] & 1; + } + function unpack25519(o, n) { + var i; + for (i = 0; i < 16; i++) + o[i] = n[2 * i] + (n[2 * i + 1] << 8); + o[15] &= 32767; + } + function A(o, a, b) { + for (var i = 0; i < 16; i++) + o[i] = a[i] + b[i]; + } + function Z(o, a, b) { + for (var i = 0; i < 16; i++) + o[i] = a[i] - b[i]; + } + function M(o, a, b) { + var v, c, t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, t10 = 0, t11 = 0, t12 = 0, t13 = 0, t14 = 0, t15 = 0, t16 = 0, t17 = 0, t18 = 0, t19 = 0, t20 = 0, t21 = 0, t22 = 0, t23 = 0, t24 = 0, t25 = 0, t26 = 0, t27 = 0, t28 = 0, t29 = 0, t30 = 0, b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3], b4 = b[4], b5 = b[5], b6 = b[6], b7 = b[7], b8 = b[8], b9 = b[9], b10 = b[10], b11 = b[11], b12 = b[12], b13 = b[13], b14 = b[14], b15 = b[15]; + v = a[0]; + t0 += v * b0; + t1 += v * b1; + t2 += v * b2; + t3 += v * b3; + t4 += v * b4; + t5 += v * b5; + t6 += v * b6; + t7 += v * b7; + t8 += v * b8; + t9 += v * b9; + t10 += v * b10; + t11 += v * b11; + t12 += v * b12; + t13 += v * b13; + t14 += v * b14; + t15 += v * b15; + v = a[1]; + t1 += v * b0; + t2 += v * b1; + t3 += v * b2; + t4 += v * b3; + t5 += v * b4; + t6 += v * b5; + t7 += v * b6; + t8 += v * b7; + t9 += v * b8; + t10 += v * b9; + t11 += v * b10; + t12 += v * b11; + t13 += v * b12; + t14 += v * b13; + t15 += v * b14; + t16 += v * b15; + v = a[2]; + t2 += v * b0; + t3 += v * b1; + t4 += v * b2; + t5 += v * b3; + t6 += v * b4; + t7 += v * b5; + t8 += v * b6; + t9 += v * b7; + t10 += v * b8; + t11 += v * b9; + t12 += v * b10; + t13 += v * b11; + t14 += v * b12; + t15 += v * b13; + t16 += v * b14; + t17 += v * b15; + v = a[3]; + t3 += v * b0; + t4 += v * b1; + t5 += v * b2; + t6 += v * b3; + t7 += v * b4; + t8 += v * b5; + t9 += v * b6; + t10 += v * b7; + t11 += v * b8; + t12 += v * b9; + t13 += v * b10; + t14 += v * b11; + t15 += v * b12; + t16 += v * b13; + t17 += v * b14; + t18 += v * b15; + v = a[4]; + t4 += v * b0; + t5 += v * b1; + t6 += v * b2; + t7 += v * b3; + t8 += v * b4; + t9 += v * b5; + t10 += v * b6; + t11 += v * b7; + t12 += v * b8; + t13 += v * b9; + t14 += v * b10; + t15 += v * b11; + t16 += v * b12; + t17 += v * b13; + t18 += v * b14; + t19 += v * b15; + v = a[5]; + t5 += v * b0; + t6 += v * b1; + t7 += v * b2; + t8 += v * b3; + t9 += v * b4; + t10 += v * b5; + t11 += v * b6; + t12 += v * b7; + t13 += v * b8; + t14 += v * b9; + t15 += v * b10; + t16 += v * b11; + t17 += v * b12; + t18 += v * b13; + t19 += v * b14; + t20 += v * b15; + v = a[6]; + t6 += v * b0; + t7 += v * b1; + t8 += v * b2; + t9 += v * b3; + t10 += v * b4; + t11 += v * b5; + t12 += v * b6; + t13 += v * b7; + t14 += v * b8; + t15 += v * b9; + t16 += v * b10; + t17 += v * b11; + t18 += v * b12; + t19 += v * b13; + t20 += v * b14; + t21 += v * b15; + v = a[7]; + t7 += v * b0; + t8 += v * b1; + t9 += v * b2; + t10 += v * b3; + t11 += v * b4; + t12 += v * b5; + t13 += v * b6; + t14 += v * b7; + t15 += v * b8; + t16 += v * b9; + t17 += v * b10; + t18 += v * b11; + t19 += v * b12; + t20 += v * b13; + t21 += v * b14; + t22 += v * b15; + v = a[8]; + t8 += v * b0; + t9 += v * b1; + t10 += v * b2; + t11 += v * b3; + t12 += v * b4; + t13 += v * b5; + t14 += v * b6; + t15 += v * b7; + t16 += v * b8; + t17 += v * b9; + t18 += v * b10; + t19 += v * b11; + t20 += v * b12; + t21 += v * b13; + t22 += v * b14; + t23 += v * b15; + v = a[9]; + t9 += v * b0; + t10 += v * b1; + t11 += v * b2; + t12 += v * b3; + t13 += v * b4; + t14 += v * b5; + t15 += v * b6; + t16 += v * b7; + t17 += v * b8; + t18 += v * b9; + t19 += v * b10; + t20 += v * b11; + t21 += v * b12; + t22 += v * b13; + t23 += v * b14; + t24 += v * b15; + v = a[10]; + t10 += v * b0; + t11 += v * b1; + t12 += v * b2; + t13 += v * b3; + t14 += v * b4; + t15 += v * b5; + t16 += v * b6; + t17 += v * b7; + t18 += v * b8; + t19 += v * b9; + t20 += v * b10; + t21 += v * b11; + t22 += v * b12; + t23 += v * b13; + t24 += v * b14; + t25 += v * b15; + v = a[11]; + t11 += v * b0; + t12 += v * b1; + t13 += v * b2; + t14 += v * b3; + t15 += v * b4; + t16 += v * b5; + t17 += v * b6; + t18 += v * b7; + t19 += v * b8; + t20 += v * b9; + t21 += v * b10; + t22 += v * b11; + t23 += v * b12; + t24 += v * b13; + t25 += v * b14; + t26 += v * b15; + v = a[12]; + t12 += v * b0; + t13 += v * b1; + t14 += v * b2; + t15 += v * b3; + t16 += v * b4; + t17 += v * b5; + t18 += v * b6; + t19 += v * b7; + t20 += v * b8; + t21 += v * b9; + t22 += v * b10; + t23 += v * b11; + t24 += v * b12; + t25 += v * b13; + t26 += v * b14; + t27 += v * b15; + v = a[13]; + t13 += v * b0; + t14 += v * b1; + t15 += v * b2; + t16 += v * b3; + t17 += v * b4; + t18 += v * b5; + t19 += v * b6; + t20 += v * b7; + t21 += v * b8; + t22 += v * b9; + t23 += v * b10; + t24 += v * b11; + t25 += v * b12; + t26 += v * b13; + t27 += v * b14; + t28 += v * b15; + v = a[14]; + t14 += v * b0; + t15 += v * b1; + t16 += v * b2; + t17 += v * b3; + t18 += v * b4; + t19 += v * b5; + t20 += v * b6; + t21 += v * b7; + t22 += v * b8; + t23 += v * b9; + t24 += v * b10; + t25 += v * b11; + t26 += v * b12; + t27 += v * b13; + t28 += v * b14; + t29 += v * b15; + v = a[15]; + t15 += v * b0; + t16 += v * b1; + t17 += v * b2; + t18 += v * b3; + t19 += v * b4; + t20 += v * b5; + t21 += v * b6; + t22 += v * b7; + t23 += v * b8; + t24 += v * b9; + t25 += v * b10; + t26 += v * b11; + t27 += v * b12; + t28 += v * b13; + t29 += v * b14; + t30 += v * b15; + t0 += 38 * t16; + t1 += 38 * t17; + t2 += 38 * t18; + t3 += 38 * t19; + t4 += 38 * t20; + t5 += 38 * t21; + t6 += 38 * t22; + t7 += 38 * t23; + t8 += 38 * t24; + t9 += 38 * t25; + t10 += 38 * t26; + t11 += 38 * t27; + t12 += 38 * t28; + t13 += 38 * t29; + t14 += 38 * t30; + c = 1; + v = t0 + c + 65535; + c = Math.floor(v / 65536); + t0 = v - c * 65536; + v = t1 + c + 65535; + c = Math.floor(v / 65536); + t1 = v - c * 65536; + v = t2 + c + 65535; + c = Math.floor(v / 65536); + t2 = v - c * 65536; + v = t3 + c + 65535; + c = Math.floor(v / 65536); + t3 = v - c * 65536; + v = t4 + c + 65535; + c = Math.floor(v / 65536); + t4 = v - c * 65536; + v = t5 + c + 65535; + c = Math.floor(v / 65536); + t5 = v - c * 65536; + v = t6 + c + 65535; + c = Math.floor(v / 65536); + t6 = v - c * 65536; + v = t7 + c + 65535; + c = Math.floor(v / 65536); + t7 = v - c * 65536; + v = t8 + c + 65535; + c = Math.floor(v / 65536); + t8 = v - c * 65536; + v = t9 + c + 65535; + c = Math.floor(v / 65536); + t9 = v - c * 65536; + v = t10 + c + 65535; + c = Math.floor(v / 65536); + t10 = v - c * 65536; + v = t11 + c + 65535; + c = Math.floor(v / 65536); + t11 = v - c * 65536; + v = t12 + c + 65535; + c = Math.floor(v / 65536); + t12 = v - c * 65536; + v = t13 + c + 65535; + c = Math.floor(v / 65536); + t13 = v - c * 65536; + v = t14 + c + 65535; + c = Math.floor(v / 65536); + t14 = v - c * 65536; + v = t15 + c + 65535; + c = Math.floor(v / 65536); + t15 = v - c * 65536; + t0 += c - 1 + 37 * (c - 1); + c = 1; + v = t0 + c + 65535; + c = Math.floor(v / 65536); + t0 = v - c * 65536; + v = t1 + c + 65535; + c = Math.floor(v / 65536); + t1 = v - c * 65536; + v = t2 + c + 65535; + c = Math.floor(v / 65536); + t2 = v - c * 65536; + v = t3 + c + 65535; + c = Math.floor(v / 65536); + t3 = v - c * 65536; + v = t4 + c + 65535; + c = Math.floor(v / 65536); + t4 = v - c * 65536; + v = t5 + c + 65535; + c = Math.floor(v / 65536); + t5 = v - c * 65536; + v = t6 + c + 65535; + c = Math.floor(v / 65536); + t6 = v - c * 65536; + v = t7 + c + 65535; + c = Math.floor(v / 65536); + t7 = v - c * 65536; + v = t8 + c + 65535; + c = Math.floor(v / 65536); + t8 = v - c * 65536; + v = t9 + c + 65535; + c = Math.floor(v / 65536); + t9 = v - c * 65536; + v = t10 + c + 65535; + c = Math.floor(v / 65536); + t10 = v - c * 65536; + v = t11 + c + 65535; + c = Math.floor(v / 65536); + t11 = v - c * 65536; + v = t12 + c + 65535; + c = Math.floor(v / 65536); + t12 = v - c * 65536; + v = t13 + c + 65535; + c = Math.floor(v / 65536); + t13 = v - c * 65536; + v = t14 + c + 65535; + c = Math.floor(v / 65536); + t14 = v - c * 65536; + v = t15 + c + 65535; + c = Math.floor(v / 65536); + t15 = v - c * 65536; + t0 += c - 1 + 37 * (c - 1); + o[0] = t0; + o[1] = t1; + o[2] = t2; + o[3] = t3; + o[4] = t4; + o[5] = t5; + o[6] = t6; + o[7] = t7; + o[8] = t8; + o[9] = t9; + o[10] = t10; + o[11] = t11; + o[12] = t12; + o[13] = t13; + o[14] = t14; + o[15] = t15; + } + function S(o, a) { + M(o, a, a); + } + function inv25519(o, i) { + var c = gf(); + var a; + for (a = 0; a < 16; a++) + c[a] = i[a]; + for (a = 253; a >= 0; a--) { + S(c, c); + if (a !== 2 && a !== 4) + M(c, c, i); + } + for (a = 0; a < 16; a++) + o[a] = c[a]; + } + function pow2523(o, i) { + var c = gf(); + var a; + for (a = 0; a < 16; a++) + c[a] = i[a]; + for (a = 250; a >= 0; a--) { + S(c, c); + if (a !== 1) + M(c, c, i); + } + for (a = 0; a < 16; a++) + o[a] = c[a]; + } + function crypto_scalarmult(q, n, p) { + var z = new Uint8Array(32); + var x = new Float64Array(80), r, i; + var a = gf(), b = gf(), c = gf(), d = gf(), e = gf(), f = gf(); + for (i = 0; i < 31; i++) + z[i] = n[i]; + z[31] = n[31] & 127 | 64; + z[0] &= 248; + unpack25519(x, p); + for (i = 0; i < 16; i++) { + b[i] = x[i]; + d[i] = a[i] = c[i] = 0; + } + a[0] = d[0] = 1; + for (i = 254; i >= 0; --i) { + r = z[i >>> 3] >>> (i & 7) & 1; + sel25519(a, b, r); + sel25519(c, d, r); + A(e, a, c); + Z(a, a, c); + A(c, b, d); + Z(b, b, d); + S(d, e); + S(f, a); + M(a, c, a); + M(c, b, e); + A(e, a, c); + Z(a, a, c); + S(b, a); + Z(c, d, f); + M(a, c, _121665); + A(a, a, d); + M(c, c, a); + M(a, d, f); + M(d, b, x); + S(b, e); + sel25519(a, b, r); + sel25519(c, d, r); + } + for (i = 0; i < 16; i++) { + x[i + 16] = a[i]; + x[i + 32] = c[i]; + x[i + 48] = b[i]; + x[i + 64] = d[i]; + } + var x32 = x.subarray(32); + var x16 = x.subarray(16); + inv25519(x32, x32); + M(x16, x16, x32); + pack25519(q, x16); + return 0; + } + function crypto_scalarmult_base(q, n) { + return crypto_scalarmult(q, n, _9); + } + function crypto_box_keypair(y, x) { + randombytes(x, 32); + return crypto_scalarmult_base(y, x); + } + function crypto_box_beforenm(k, y, x) { + var s = new Uint8Array(32); + crypto_scalarmult(s, x, y); + return crypto_core_hsalsa20(k, _0, s, sigma); + } + var crypto_box_afternm = crypto_secretbox; + var crypto_box_open_afternm = crypto_secretbox_open; + function crypto_box(c, m, d, n, y, x) { + var k = new Uint8Array(32); + crypto_box_beforenm(k, y, x); + return crypto_box_afternm(c, m, d, n, k); + } + function crypto_box_open(m, c, d, n, y, x) { + var k = new Uint8Array(32); + crypto_box_beforenm(k, y, x); + return crypto_box_open_afternm(m, c, d, n, k); + } + var K = [ + 1116352408, + 3609767458, + 1899447441, + 602891725, + 3049323471, + 3964484399, + 3921009573, + 2173295548, + 961987163, + 4081628472, + 1508970993, + 3053834265, + 2453635748, + 2937671579, + 2870763221, + 3664609560, + 3624381080, + 2734883394, + 310598401, + 1164996542, + 607225278, + 1323610764, + 1426881987, + 3590304994, + 1925078388, + 4068182383, + 2162078206, + 991336113, + 2614888103, + 633803317, + 3248222580, + 3479774868, + 3835390401, + 2666613458, + 4022224774, + 944711139, + 264347078, + 2341262773, + 604807628, + 2007800933, + 770255983, + 1495990901, + 1249150122, + 1856431235, + 1555081692, + 3175218132, + 1996064986, + 2198950837, + 2554220882, + 3999719339, + 2821834349, + 766784016, + 2952996808, + 2566594879, + 3210313671, + 3203337956, + 3336571891, + 1034457026, + 3584528711, + 2466948901, + 113926993, + 3758326383, + 338241895, + 168717936, + 666307205, + 1188179964, + 773529912, + 1546045734, + 1294757372, + 1522805485, + 1396182291, + 2643833823, + 1695183700, + 2343527390, + 1986661051, + 1014477480, + 2177026350, + 1206759142, + 2456956037, + 344077627, + 2730485921, + 1290863460, + 2820302411, + 3158454273, + 3259730800, + 3505952657, + 3345764771, + 106217008, + 3516065817, + 3606008344, + 3600352804, + 1432725776, + 4094571909, + 1467031594, + 275423344, + 851169720, + 430227734, + 3100823752, + 506948616, + 1363258195, + 659060556, + 3750685593, + 883997877, + 3785050280, + 958139571, + 3318307427, + 1322822218, + 3812723403, + 1537002063, + 2003034995, + 1747873779, + 3602036899, + 1955562222, + 1575990012, + 2024104815, + 1125592928, + 2227730452, + 2716904306, + 2361852424, + 442776044, + 2428436474, + 593698344, + 2756734187, + 3733110249, + 3204031479, + 2999351573, + 3329325298, + 3815920427, + 3391569614, + 3928383900, + 3515267271, + 566280711, + 3940187606, + 3454069534, + 4118630271, + 4000239992, + 116418474, + 1914138554, + 174292421, + 2731055270, + 289380356, + 3203993006, + 460393269, + 320620315, + 685471733, + 587496836, + 852142971, + 1086792851, + 1017036298, + 365543100, + 1126000580, + 2618297676, + 1288033470, + 3409855158, + 1501505948, + 4234509866, + 1607167915, + 987167468, + 1816402316, + 1246189591 + ]; + function crypto_hashblocks_hl(hh, hl, m, n) { + var wh = new Int32Array(16), wl = new Int32Array(16), bh0, bh1, bh2, bh3, bh4, bh5, bh6, bh7, bl0, bl1, bl2, bl3, bl4, bl5, bl6, bl7, th, tl, i, j, h, l, a, b, c, d; + var ah0 = hh[0], ah1 = hh[1], ah2 = hh[2], ah3 = hh[3], ah4 = hh[4], ah5 = hh[5], ah6 = hh[6], ah7 = hh[7], al0 = hl[0], al1 = hl[1], al2 = hl[2], al3 = hl[3], al4 = hl[4], al5 = hl[5], al6 = hl[6], al7 = hl[7]; + var pos = 0; + while (n >= 128) { + for (i = 0; i < 16; i++) { + j = 8 * i + pos; + wh[i] = m[j + 0] << 24 | m[j + 1] << 16 | m[j + 2] << 8 | m[j + 3]; + wl[i] = m[j + 4] << 24 | m[j + 5] << 16 | m[j + 6] << 8 | m[j + 7]; + } + for (i = 0; i < 80; i++) { + bh0 = ah0; + bh1 = ah1; + bh2 = ah2; + bh3 = ah3; + bh4 = ah4; + bh5 = ah5; + bh6 = ah6; + bh7 = ah7; + bl0 = al0; + bl1 = al1; + bl2 = al2; + bl3 = al3; + bl4 = al4; + bl5 = al5; + bl6 = al6; + bl7 = al7; + h = ah7; + l = al7; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = (ah4 >>> 14 | al4 << 32 - 14) ^ (ah4 >>> 18 | al4 << 32 - 18) ^ (al4 >>> 41 - 32 | ah4 << 32 - (41 - 32)); + l = (al4 >>> 14 | ah4 << 32 - 14) ^ (al4 >>> 18 | ah4 << 32 - 18) ^ (ah4 >>> 41 - 32 | al4 << 32 - (41 - 32)); + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + h = ah4 & ah5 ^ ~ah4 & ah6; + l = al4 & al5 ^ ~al4 & al6; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + h = K[i * 2]; + l = K[i * 2 + 1]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + h = wh[i % 16]; + l = wl[i % 16]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + th = c & 65535 | d << 16; + tl = a & 65535 | b << 16; + h = th; + l = tl; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = (ah0 >>> 28 | al0 << 32 - 28) ^ (al0 >>> 34 - 32 | ah0 << 32 - (34 - 32)) ^ (al0 >>> 39 - 32 | ah0 << 32 - (39 - 32)); + l = (al0 >>> 28 | ah0 << 32 - 28) ^ (ah0 >>> 34 - 32 | al0 << 32 - (34 - 32)) ^ (ah0 >>> 39 - 32 | al0 << 32 - (39 - 32)); + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + h = ah0 & ah1 ^ ah0 & ah2 ^ ah1 & ah2; + l = al0 & al1 ^ al0 & al2 ^ al1 & al2; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + bh7 = c & 65535 | d << 16; + bl7 = a & 65535 | b << 16; + h = bh3; + l = bl3; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = th; + l = tl; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + bh3 = c & 65535 | d << 16; + bl3 = a & 65535 | b << 16; + ah1 = bh0; + ah2 = bh1; + ah3 = bh2; + ah4 = bh3; + ah5 = bh4; + ah6 = bh5; + ah7 = bh6; + ah0 = bh7; + al1 = bl0; + al2 = bl1; + al3 = bl2; + al4 = bl3; + al5 = bl4; + al6 = bl5; + al7 = bl6; + al0 = bl7; + if (i % 16 === 15) { + for (j = 0; j < 16; j++) { + h = wh[j]; + l = wl[j]; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = wh[(j + 9) % 16]; + l = wl[(j + 9) % 16]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + th = wh[(j + 1) % 16]; + tl = wl[(j + 1) % 16]; + h = (th >>> 1 | tl << 32 - 1) ^ (th >>> 8 | tl << 32 - 8) ^ th >>> 7; + l = (tl >>> 1 | th << 32 - 1) ^ (tl >>> 8 | th << 32 - 8) ^ (tl >>> 7 | th << 32 - 7); + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + th = wh[(j + 14) % 16]; + tl = wl[(j + 14) % 16]; + h = (th >>> 19 | tl << 32 - 19) ^ (tl >>> 61 - 32 | th << 32 - (61 - 32)) ^ th >>> 6; + l = (tl >>> 19 | th << 32 - 19) ^ (th >>> 61 - 32 | tl << 32 - (61 - 32)) ^ (tl >>> 6 | th << 32 - 6); + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + wh[j] = c & 65535 | d << 16; + wl[j] = a & 65535 | b << 16; + } + } + } + h = ah0; + l = al0; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = hh[0]; + l = hl[0]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + hh[0] = ah0 = c & 65535 | d << 16; + hl[0] = al0 = a & 65535 | b << 16; + h = ah1; + l = al1; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = hh[1]; + l = hl[1]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + hh[1] = ah1 = c & 65535 | d << 16; + hl[1] = al1 = a & 65535 | b << 16; + h = ah2; + l = al2; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = hh[2]; + l = hl[2]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + hh[2] = ah2 = c & 65535 | d << 16; + hl[2] = al2 = a & 65535 | b << 16; + h = ah3; + l = al3; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = hh[3]; + l = hl[3]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + hh[3] = ah3 = c & 65535 | d << 16; + hl[3] = al3 = a & 65535 | b << 16; + h = ah4; + l = al4; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = hh[4]; + l = hl[4]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + hh[4] = ah4 = c & 65535 | d << 16; + hl[4] = al4 = a & 65535 | b << 16; + h = ah5; + l = al5; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = hh[5]; + l = hl[5]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + hh[5] = ah5 = c & 65535 | d << 16; + hl[5] = al5 = a & 65535 | b << 16; + h = ah6; + l = al6; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = hh[6]; + l = hl[6]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + hh[6] = ah6 = c & 65535 | d << 16; + hl[6] = al6 = a & 65535 | b << 16; + h = ah7; + l = al7; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = hh[7]; + l = hl[7]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + hh[7] = ah7 = c & 65535 | d << 16; + hl[7] = al7 = a & 65535 | b << 16; + pos += 128; + n -= 128; + } + return n; + } + function crypto_hash(out, m, n) { + var hh = new Int32Array(8), hl = new Int32Array(8), x = new Uint8Array(256), i, b = n; + hh[0] = 1779033703; + hh[1] = 3144134277; + hh[2] = 1013904242; + hh[3] = 2773480762; + hh[4] = 1359893119; + hh[5] = 2600822924; + hh[6] = 528734635; + hh[7] = 1541459225; + hl[0] = 4089235720; + hl[1] = 2227873595; + hl[2] = 4271175723; + hl[3] = 1595750129; + hl[4] = 2917565137; + hl[5] = 725511199; + hl[6] = 4215389547; + hl[7] = 327033209; + crypto_hashblocks_hl(hh, hl, m, n); + n %= 128; + for (i = 0; i < n; i++) + x[i] = m[b - n + i]; + x[n] = 128; + n = 256 - 128 * (n < 112 ? 1 : 0); + x[n - 9] = 0; + ts64(x, n - 8, b / 536870912 | 0, b << 3); + crypto_hashblocks_hl(hh, hl, x, n); + for (i = 0; i < 8; i++) + ts64(out, 8 * i, hh[i], hl[i]); + return 0; + } + function add(p, q) { + var a = gf(), b = gf(), c = gf(), d = gf(), e = gf(), f = gf(), g = gf(), h = gf(), t = gf(); + Z(a, p[1], p[0]); + Z(t, q[1], q[0]); + M(a, a, t); + A(b, p[0], p[1]); + A(t, q[0], q[1]); + M(b, b, t); + M(c, p[3], q[3]); + M(c, c, D2); + M(d, p[2], q[2]); + A(d, d, d); + Z(e, b, a); + Z(f, d, c); + A(g, d, c); + A(h, b, a); + M(p[0], e, f); + M(p[1], h, g); + M(p[2], g, f); + M(p[3], e, h); + } + function cswap(p, q, b) { + var i; + for (i = 0; i < 4; i++) { + sel25519(p[i], q[i], b); + } + } + function pack(r, p) { + var tx = gf(), ty = gf(), zi = gf(); + inv25519(zi, p[2]); + M(tx, p[0], zi); + M(ty, p[1], zi); + pack25519(r, ty); + r[31] ^= par25519(tx) << 7; + } + function scalarmult(p, q, s) { + var b, i; + set25519(p[0], gf0); + set25519(p[1], gf1); + set25519(p[2], gf1); + set25519(p[3], gf0); + for (i = 255; i >= 0; --i) { + b = s[i / 8 | 0] >> (i & 7) & 1; + cswap(p, q, b); + add(q, p); + add(p, p); + cswap(p, q, b); + } + } + function scalarbase(p, s) { + var q = [gf(), gf(), gf(), gf()]; + set25519(q[0], X); + set25519(q[1], Y); + set25519(q[2], gf1); + M(q[3], X, Y); + scalarmult(p, q, s); + } + function crypto_sign_keypair(pk, sk, seeded) { + var d = new Uint8Array(64); + var p = [gf(), gf(), gf(), gf()]; + var i; + if (!seeded) + randombytes(sk, 32); + crypto_hash(d, sk, 32); + d[0] &= 248; + d[31] &= 127; + d[31] |= 64; + scalarbase(p, d); + pack(pk, p); + for (i = 0; i < 32; i++) + sk[i + 32] = pk[i]; + return 0; + } + var L4 = new Float64Array([237, 211, 245, 92, 26, 99, 18, 88, 214, 156, 247, 162, 222, 249, 222, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16]); + function modL(r, x) { + var carry, i, j, k; + for (i = 63; i >= 32; --i) { + carry = 0; + for (j = i - 32, k = i - 12; j < k; ++j) { + x[j] += carry - 16 * x[i] * L4[j - (i - 32)]; + carry = Math.floor((x[j] + 128) / 256); + x[j] -= carry * 256; + } + x[j] += carry; + x[i] = 0; + } + carry = 0; + for (j = 0; j < 32; j++) { + x[j] += carry - (x[31] >> 4) * L4[j]; + carry = x[j] >> 8; + x[j] &= 255; + } + for (j = 0; j < 32; j++) + x[j] -= carry * L4[j]; + for (i = 0; i < 32; i++) { + x[i + 1] += x[i] >> 8; + r[i] = x[i] & 255; + } + } + function reduce(r) { + var x = new Float64Array(64), i; + for (i = 0; i < 64; i++) + x[i] = r[i]; + for (i = 0; i < 64; i++) + r[i] = 0; + modL(r, x); + } + function crypto_sign(sm, m, n, sk) { + var d = new Uint8Array(64), h = new Uint8Array(64), r = new Uint8Array(64); + var i, j, x = new Float64Array(64); + var p = [gf(), gf(), gf(), gf()]; + crypto_hash(d, sk, 32); + d[0] &= 248; + d[31] &= 127; + d[31] |= 64; + var smlen = n + 64; + for (i = 0; i < n; i++) + sm[64 + i] = m[i]; + for (i = 0; i < 32; i++) + sm[32 + i] = d[32 + i]; + crypto_hash(r, sm.subarray(32), n + 32); + reduce(r); + scalarbase(p, r); + pack(sm, p); + for (i = 32; i < 64; i++) + sm[i] = sk[i]; + crypto_hash(h, sm, n + 64); + reduce(h); + for (i = 0; i < 64; i++) + x[i] = 0; + for (i = 0; i < 32; i++) + x[i] = r[i]; + for (i = 0; i < 32; i++) { + for (j = 0; j < 32; j++) { + x[i + j] += h[i] * d[j]; + } + } + modL(sm.subarray(32), x); + return smlen; + } + function unpackneg(r, p) { + var t = gf(), chk = gf(), num = gf(), den = gf(), den2 = gf(), den4 = gf(), den6 = gf(); + set25519(r[2], gf1); + unpack25519(r[1], p); + S(num, r[1]); + M(den, num, D); + Z(num, num, r[2]); + A(den, r[2], den); + S(den2, den); + S(den4, den2); + M(den6, den4, den2); + M(t, den6, num); + M(t, t, den); + pow2523(t, t); + M(t, t, num); + M(t, t, den); + M(t, t, den); + M(r[0], t, den); + S(chk, r[0]); + M(chk, chk, den); + if (neq25519(chk, num)) + M(r[0], r[0], I); + S(chk, r[0]); + M(chk, chk, den); + if (neq25519(chk, num)) + return -1; + if (par25519(r[0]) === p[31] >> 7) + Z(r[0], gf0, r[0]); + M(r[3], r[0], r[1]); + return 0; + } + function crypto_sign_open(m, sm, n, pk) { + var i; + var t = new Uint8Array(32), h = new Uint8Array(64); + var p = [gf(), gf(), gf(), gf()], q = [gf(), gf(), gf(), gf()]; + if (n < 64) + return -1; + if (unpackneg(q, pk)) + return -1; + for (i = 0; i < n; i++) + m[i] = sm[i]; + for (i = 0; i < 32; i++) + m[i + 32] = pk[i]; + crypto_hash(h, m, n); + reduce(h); + scalarmult(p, q, h); + scalarbase(q, sm.subarray(32)); + add(p, q); + pack(t, p); + n -= 64; + if (crypto_verify_32(sm, 0, t, 0)) { + for (i = 0; i < n; i++) + m[i] = 0; + return -1; + } + for (i = 0; i < n; i++) + m[i] = sm[i + 64]; + return n; + } + var crypto_secretbox_KEYBYTES = 32, crypto_secretbox_NONCEBYTES = 24, crypto_secretbox_ZEROBYTES = 32, crypto_secretbox_BOXZEROBYTES = 16, crypto_scalarmult_BYTES = 32, crypto_scalarmult_SCALARBYTES = 32, crypto_box_PUBLICKEYBYTES = 32, crypto_box_SECRETKEYBYTES = 32, crypto_box_BEFORENMBYTES = 32, crypto_box_NONCEBYTES = crypto_secretbox_NONCEBYTES, crypto_box_ZEROBYTES = crypto_secretbox_ZEROBYTES, crypto_box_BOXZEROBYTES = crypto_secretbox_BOXZEROBYTES, crypto_sign_BYTES = 64, crypto_sign_PUBLICKEYBYTES = 32, crypto_sign_SECRETKEYBYTES = 64, crypto_sign_SEEDBYTES = 32, crypto_hash_BYTES = 64; + nacl2.lowlevel = { + crypto_core_hsalsa20, + crypto_stream_xor, + crypto_stream, + crypto_stream_salsa20_xor, + crypto_stream_salsa20, + crypto_onetimeauth, + crypto_onetimeauth_verify, + crypto_verify_16, + crypto_verify_32, + crypto_secretbox, + crypto_secretbox_open, + crypto_scalarmult, + crypto_scalarmult_base, + crypto_box_beforenm, + crypto_box_afternm, + crypto_box, + crypto_box_open, + crypto_box_keypair, + crypto_hash, + crypto_sign, + crypto_sign_keypair, + crypto_sign_open, + crypto_secretbox_KEYBYTES, + crypto_secretbox_NONCEBYTES, + crypto_secretbox_ZEROBYTES, + crypto_secretbox_BOXZEROBYTES, + crypto_scalarmult_BYTES, + crypto_scalarmult_SCALARBYTES, + crypto_box_PUBLICKEYBYTES, + crypto_box_SECRETKEYBYTES, + crypto_box_BEFORENMBYTES, + crypto_box_NONCEBYTES, + crypto_box_ZEROBYTES, + crypto_box_BOXZEROBYTES, + crypto_sign_BYTES, + crypto_sign_PUBLICKEYBYTES, + crypto_sign_SECRETKEYBYTES, + crypto_sign_SEEDBYTES, + crypto_hash_BYTES, + gf, + D, + L: L4, + pack25519, + unpack25519, + M, + A, + S, + Z, + pow2523, + add, + set25519, + modL, + scalarmult, + scalarbase + }; + function checkLengths(k, n) { + if (k.length !== crypto_secretbox_KEYBYTES) + throw new Error("bad key size"); + if (n.length !== crypto_secretbox_NONCEBYTES) + throw new Error("bad nonce size"); + } + function checkBoxLengths(pk, sk) { + if (pk.length !== crypto_box_PUBLICKEYBYTES) + throw new Error("bad public key size"); + if (sk.length !== crypto_box_SECRETKEYBYTES) + throw new Error("bad secret key size"); + } + function checkArrayTypes() { + for (var i = 0; i < arguments.length; i++) { + if (!(arguments[i] instanceof Uint8Array)) + throw new TypeError("unexpected type, use Uint8Array"); + } + } + function cleanup(arr) { + for (var i = 0; i < arr.length; i++) + arr[i] = 0; + } + nacl2.randomBytes = function(n) { + var b = new Uint8Array(n); + randombytes(b, n); + return b; + }; + nacl2.secretbox = function(msg, nonce, key) { + checkArrayTypes(msg, nonce, key); + checkLengths(key, nonce); + var m = new Uint8Array(crypto_secretbox_ZEROBYTES + msg.length); + var c = new Uint8Array(m.length); + for (var i = 0; i < msg.length; i++) + m[i + crypto_secretbox_ZEROBYTES] = msg[i]; + crypto_secretbox(c, m, m.length, nonce, key); + return c.subarray(crypto_secretbox_BOXZEROBYTES); + }; + nacl2.secretbox.open = function(box, nonce, key) { + checkArrayTypes(box, nonce, key); + checkLengths(key, nonce); + var c = new Uint8Array(crypto_secretbox_BOXZEROBYTES + box.length); + var m = new Uint8Array(c.length); + for (var i = 0; i < box.length; i++) + c[i + crypto_secretbox_BOXZEROBYTES] = box[i]; + if (c.length < 32) + return null; + if (crypto_secretbox_open(m, c, c.length, nonce, key) !== 0) + return null; + return m.subarray(crypto_secretbox_ZEROBYTES); + }; + nacl2.secretbox.keyLength = crypto_secretbox_KEYBYTES; + nacl2.secretbox.nonceLength = crypto_secretbox_NONCEBYTES; + nacl2.secretbox.overheadLength = crypto_secretbox_BOXZEROBYTES; + nacl2.scalarMult = function(n, p) { + checkArrayTypes(n, p); + if (n.length !== crypto_scalarmult_SCALARBYTES) + throw new Error("bad n size"); + if (p.length !== crypto_scalarmult_BYTES) + throw new Error("bad p size"); + var q = new Uint8Array(crypto_scalarmult_BYTES); + crypto_scalarmult(q, n, p); + return q; + }; + nacl2.scalarMult.base = function(n) { + checkArrayTypes(n); + if (n.length !== crypto_scalarmult_SCALARBYTES) + throw new Error("bad n size"); + var q = new Uint8Array(crypto_scalarmult_BYTES); + crypto_scalarmult_base(q, n); + return q; + }; + nacl2.scalarMult.scalarLength = crypto_scalarmult_SCALARBYTES; + nacl2.scalarMult.groupElementLength = crypto_scalarmult_BYTES; + nacl2.box = function(msg, nonce, publicKey, secretKey) { + var k = nacl2.box.before(publicKey, secretKey); + return nacl2.secretbox(msg, nonce, k); + }; + nacl2.box.before = function(publicKey, secretKey) { + checkArrayTypes(publicKey, secretKey); + checkBoxLengths(publicKey, secretKey); + var k = new Uint8Array(crypto_box_BEFORENMBYTES); + crypto_box_beforenm(k, publicKey, secretKey); + return k; + }; + nacl2.box.after = nacl2.secretbox; + nacl2.box.open = function(msg, nonce, publicKey, secretKey) { + var k = nacl2.box.before(publicKey, secretKey); + return nacl2.secretbox.open(msg, nonce, k); + }; + nacl2.box.open.after = nacl2.secretbox.open; + nacl2.box.keyPair = function() { + var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES); + var sk = new Uint8Array(crypto_box_SECRETKEYBYTES); + crypto_box_keypair(pk, sk); + return { publicKey: pk, secretKey: sk }; + }; + nacl2.box.keyPair.fromSecretKey = function(secretKey) { + checkArrayTypes(secretKey); + if (secretKey.length !== crypto_box_SECRETKEYBYTES) + throw new Error("bad secret key size"); + var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES); + crypto_scalarmult_base(pk, secretKey); + return { publicKey: pk, secretKey: new Uint8Array(secretKey) }; + }; + nacl2.box.publicKeyLength = crypto_box_PUBLICKEYBYTES; + nacl2.box.secretKeyLength = crypto_box_SECRETKEYBYTES; + nacl2.box.sharedKeyLength = crypto_box_BEFORENMBYTES; + nacl2.box.nonceLength = crypto_box_NONCEBYTES; + nacl2.box.overheadLength = nacl2.secretbox.overheadLength; + nacl2.sign = function(msg, secretKey) { + checkArrayTypes(msg, secretKey); + if (secretKey.length !== crypto_sign_SECRETKEYBYTES) + throw new Error("bad secret key size"); + var signedMsg = new Uint8Array(crypto_sign_BYTES + msg.length); + crypto_sign(signedMsg, msg, msg.length, secretKey); + return signedMsg; + }; + nacl2.sign.open = function(signedMsg, publicKey) { + checkArrayTypes(signedMsg, publicKey); + if (publicKey.length !== crypto_sign_PUBLICKEYBYTES) + throw new Error("bad public key size"); + var tmp = new Uint8Array(signedMsg.length); + var mlen = crypto_sign_open(tmp, signedMsg, signedMsg.length, publicKey); + if (mlen < 0) + return null; + var m = new Uint8Array(mlen); + for (var i = 0; i < m.length; i++) + m[i] = tmp[i]; + return m; + }; + nacl2.sign.detached = function(msg, secretKey) { + var signedMsg = nacl2.sign(msg, secretKey); + var sig = new Uint8Array(crypto_sign_BYTES); + for (var i = 0; i < sig.length; i++) + sig[i] = signedMsg[i]; + return sig; + }; + nacl2.sign.detached.verify = function(msg, sig, publicKey) { + checkArrayTypes(msg, sig, publicKey); + if (sig.length !== crypto_sign_BYTES) + throw new Error("bad signature size"); + if (publicKey.length !== crypto_sign_PUBLICKEYBYTES) + throw new Error("bad public key size"); + var sm = new Uint8Array(crypto_sign_BYTES + msg.length); + var m = new Uint8Array(crypto_sign_BYTES + msg.length); + var i; + for (i = 0; i < crypto_sign_BYTES; i++) + sm[i] = sig[i]; + for (i = 0; i < msg.length; i++) + sm[i + crypto_sign_BYTES] = msg[i]; + return crypto_sign_open(m, sm, sm.length, publicKey) >= 0; + }; + nacl2.sign.keyPair = function() { + var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES); + var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES); + crypto_sign_keypair(pk, sk); + return { publicKey: pk, secretKey: sk }; + }; + nacl2.sign.keyPair.fromSecretKey = function(secretKey) { + checkArrayTypes(secretKey); + if (secretKey.length !== crypto_sign_SECRETKEYBYTES) + throw new Error("bad secret key size"); + var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES); + for (var i = 0; i < pk.length; i++) + pk[i] = secretKey[32 + i]; + return { publicKey: pk, secretKey: new Uint8Array(secretKey) }; + }; + nacl2.sign.keyPair.fromSeed = function(seed) { + checkArrayTypes(seed); + if (seed.length !== crypto_sign_SEEDBYTES) + throw new Error("bad seed size"); + var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES); + var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES); + for (var i = 0; i < 32; i++) + sk[i] = seed[i]; + crypto_sign_keypair(pk, sk, true); + return { publicKey: pk, secretKey: sk }; + }; + nacl2.sign.publicKeyLength = crypto_sign_PUBLICKEYBYTES; + nacl2.sign.secretKeyLength = crypto_sign_SECRETKEYBYTES; + nacl2.sign.seedLength = crypto_sign_SEEDBYTES; + nacl2.sign.signatureLength = crypto_sign_BYTES; + nacl2.hash = function(msg) { + checkArrayTypes(msg); + var h = new Uint8Array(crypto_hash_BYTES); + crypto_hash(h, msg, msg.length); + return h; + }; + nacl2.hash.hashLength = crypto_hash_BYTES; + nacl2.verify = function(x, y) { + checkArrayTypes(x, y); + if (x.length === 0 || y.length === 0) + return false; + if (x.length !== y.length) + return false; + return vn(x, 0, y, 0, x.length) === 0 ? true : false; + }; + nacl2.setPRNG = function(fn) { + randombytes = fn; + }; + (function() { + var crypto2 = typeof self !== "undefined" ? self.crypto || self.msCrypto : null; + if (crypto2 && crypto2.getRandomValues) { + var QUOTA = 65536; + nacl2.setPRNG(function(x, n) { + var i, v = new Uint8Array(n); + for (i = 0; i < n; i += QUOTA) { + crypto2.getRandomValues(v.subarray(i, i + Math.min(n - i, QUOTA))); + } + for (i = 0; i < n; i++) + x[i] = v[i]; + cleanup(v); + }); + } else if (typeof __require !== "undefined") { + crypto2 = require_crypto(); + if (crypto2 && crypto2.randomBytes) { + nacl2.setPRNG(function(x, n) { + var i, v = crypto2.randomBytes(n); + for (i = 0; i < n; i++) + x[i] = v[i]; + cleanup(v); + }); + } + } + })(); + })(typeof module !== "undefined" && module.exports ? module.exports : self.nacl = self.nacl || {}); + } + }); + + // node_modules/scrypt-async/scrypt-async.js + var require_scrypt_async = __commonJS({ + "node_modules/scrypt-async/scrypt-async.js"(exports, module) { + function scrypt2(password, salt, logN, r, dkLen, interruptStep, callback, encoding) { + "use strict"; + function SHA256(m) { + var K = [ + 1116352408, + 1899447441, + 3049323471, + 3921009573, + 961987163, + 1508970993, + 2453635748, + 2870763221, + 3624381080, + 310598401, + 607225278, + 1426881987, + 1925078388, + 2162078206, + 2614888103, + 3248222580, + 3835390401, + 4022224774, + 264347078, + 604807628, + 770255983, + 1249150122, + 1555081692, + 1996064986, + 2554220882, + 2821834349, + 2952996808, + 3210313671, + 3336571891, + 3584528711, + 113926993, + 338241895, + 666307205, + 773529912, + 1294757372, + 1396182291, + 1695183700, + 1986661051, + 2177026350, + 2456956037, + 2730485921, + 2820302411, + 3259730800, + 3345764771, + 3516065817, + 3600352804, + 4094571909, + 275423344, + 430227734, + 506948616, + 659060556, + 883997877, + 958139571, + 1322822218, + 1537002063, + 1747873779, + 1955562222, + 2024104815, + 2227730452, + 2361852424, + 2428436474, + 2756734187, + 3204031479, + 3329325298 + ]; + var h0 = 1779033703, h1 = 3144134277, h2 = 1013904242, h3 = 2773480762, h4 = 1359893119, h5 = 2600822924, h6 = 528734635, h7 = 1541459225, w = new Array(64); + function blocks(p3) { + var off = 0, len = p3.length; + while (len >= 64) { + var a = h0, b = h1, c = h2, d = h3, e = h4, f = h5, g = h6, h = h7, u, i2, j, t1, t2; + for (i2 = 0; i2 < 16; i2++) { + j = off + i2 * 4; + w[i2] = (p3[j] & 255) << 24 | (p3[j + 1] & 255) << 16 | (p3[j + 2] & 255) << 8 | p3[j + 3] & 255; + } + for (i2 = 16; i2 < 64; i2++) { + u = w[i2 - 2]; + t1 = (u >>> 17 | u << 32 - 17) ^ (u >>> 19 | u << 32 - 19) ^ u >>> 10; + u = w[i2 - 15]; + t2 = (u >>> 7 | u << 32 - 7) ^ (u >>> 18 | u << 32 - 18) ^ u >>> 3; + w[i2] = (t1 + w[i2 - 7] | 0) + (t2 + w[i2 - 16] | 0) | 0; + } + for (i2 = 0; i2 < 64; i2++) { + t1 = (((e >>> 6 | e << 32 - 6) ^ (e >>> 11 | e << 32 - 11) ^ (e >>> 25 | e << 32 - 25)) + (e & f ^ ~e & g) | 0) + (h + (K[i2] + w[i2] | 0) | 0) | 0; + t2 = ((a >>> 2 | a << 32 - 2) ^ (a >>> 13 | a << 32 - 13) ^ (a >>> 22 | a << 32 - 22)) + (a & b ^ a & c ^ b & c) | 0; + h = g; + g = f; + f = e; + e = d + t1 | 0; + d = c; + c = b; + b = a; + a = t1 + t2 | 0; + } + h0 = h0 + a | 0; + h1 = h1 + b | 0; + h2 = h2 + c | 0; + h3 = h3 + d | 0; + h4 = h4 + e | 0; + h5 = h5 + f | 0; + h6 = h6 + g | 0; + h7 = h7 + h | 0; + off += 64; + len -= 64; + } + } + blocks(m); + var i, bytesLeft = m.length % 64, bitLenHi = m.length / 536870912 | 0, bitLenLo = m.length << 3, numZeros = bytesLeft < 56 ? 56 : 120, p2 = m.slice(m.length - bytesLeft, m.length); + p2.push(128); + for (i = bytesLeft + 1; i < numZeros; i++) + p2.push(0); + p2.push(bitLenHi >>> 24 & 255); + p2.push(bitLenHi >>> 16 & 255); + p2.push(bitLenHi >>> 8 & 255); + p2.push(bitLenHi >>> 0 & 255); + p2.push(bitLenLo >>> 24 & 255); + p2.push(bitLenLo >>> 16 & 255); + p2.push(bitLenLo >>> 8 & 255); + p2.push(bitLenLo >>> 0 & 255); + blocks(p2); + return [ + h0 >>> 24 & 255, + h0 >>> 16 & 255, + h0 >>> 8 & 255, + h0 >>> 0 & 255, + h1 >>> 24 & 255, + h1 >>> 16 & 255, + h1 >>> 8 & 255, + h1 >>> 0 & 255, + h2 >>> 24 & 255, + h2 >>> 16 & 255, + h2 >>> 8 & 255, + h2 >>> 0 & 255, + h3 >>> 24 & 255, + h3 >>> 16 & 255, + h3 >>> 8 & 255, + h3 >>> 0 & 255, + h4 >>> 24 & 255, + h4 >>> 16 & 255, + h4 >>> 8 & 255, + h4 >>> 0 & 255, + h5 >>> 24 & 255, + h5 >>> 16 & 255, + h5 >>> 8 & 255, + h5 >>> 0 & 255, + h6 >>> 24 & 255, + h6 >>> 16 & 255, + h6 >>> 8 & 255, + h6 >>> 0 & 255, + h7 >>> 24 & 255, + h7 >>> 16 & 255, + h7 >>> 8 & 255, + h7 >>> 0 & 255 + ]; + } + function PBKDF2_HMAC_SHA256_OneIter(password2, salt2, dkLen2) { + if (password2.length > 64) { + password2 = SHA256(password2.push ? password2 : Array.prototype.slice.call(password2, 0)); + } + var i, innerLen = 64 + salt2.length + 4, inner = new Array(innerLen), outerKey = new Array(64), dk = []; + for (i = 0; i < 64; i++) + inner[i] = 54; + for (i = 0; i < password2.length; i++) + inner[i] ^= password2[i]; + for (i = 0; i < salt2.length; i++) + inner[64 + i] = salt2[i]; + for (i = innerLen - 4; i < innerLen; i++) + inner[i] = 0; + for (i = 0; i < 64; i++) + outerKey[i] = 92; + for (i = 0; i < password2.length; i++) + outerKey[i] ^= password2[i]; + function incrementCounter() { + for (var i2 = innerLen - 1; i2 >= innerLen - 4; i2--) { + inner[i2]++; + if (inner[i2] <= 255) + return; + inner[i2] = 0; + } + } + while (dkLen2 >= 32) { + incrementCounter(); + dk = dk.concat(SHA256(outerKey.concat(SHA256(inner)))); + dkLen2 -= 32; + } + if (dkLen2 > 0) { + incrementCounter(); + dk = dk.concat(SHA256(outerKey.concat(SHA256(inner))).slice(0, dkLen2)); + } + return dk; + } + function salsaXOR(tmp2, B2, bin, bout) { + var j0 = tmp2[0] ^ B2[bin++], j1 = tmp2[1] ^ B2[bin++], j2 = tmp2[2] ^ B2[bin++], j3 = tmp2[3] ^ B2[bin++], j4 = tmp2[4] ^ B2[bin++], j5 = tmp2[5] ^ B2[bin++], j6 = tmp2[6] ^ B2[bin++], j7 = tmp2[7] ^ B2[bin++], j8 = tmp2[8] ^ B2[bin++], j9 = tmp2[9] ^ B2[bin++], j10 = tmp2[10] ^ B2[bin++], j11 = tmp2[11] ^ B2[bin++], j12 = tmp2[12] ^ B2[bin++], j13 = tmp2[13] ^ B2[bin++], j14 = tmp2[14] ^ B2[bin++], j15 = tmp2[15] ^ B2[bin++], u, i; + var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7, x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14, x15 = j15; + for (i = 0; i < 8; i += 2) { + u = x0 + x12; + x4 ^= u << 7 | u >>> 32 - 7; + u = x4 + x0; + x8 ^= u << 9 | u >>> 32 - 9; + u = x8 + x4; + x12 ^= u << 13 | u >>> 32 - 13; + u = x12 + x8; + x0 ^= u << 18 | u >>> 32 - 18; + u = x5 + x1; + x9 ^= u << 7 | u >>> 32 - 7; + u = x9 + x5; + x13 ^= u << 9 | u >>> 32 - 9; + u = x13 + x9; + x1 ^= u << 13 | u >>> 32 - 13; + u = x1 + x13; + x5 ^= u << 18 | u >>> 32 - 18; + u = x10 + x6; + x14 ^= u << 7 | u >>> 32 - 7; + u = x14 + x10; + x2 ^= u << 9 | u >>> 32 - 9; + u = x2 + x14; + x6 ^= u << 13 | u >>> 32 - 13; + u = x6 + x2; + x10 ^= u << 18 | u >>> 32 - 18; + u = x15 + x11; + x3 ^= u << 7 | u >>> 32 - 7; + u = x3 + x15; + x7 ^= u << 9 | u >>> 32 - 9; + u = x7 + x3; + x11 ^= u << 13 | u >>> 32 - 13; + u = x11 + x7; + x15 ^= u << 18 | u >>> 32 - 18; + u = x0 + x3; + x1 ^= u << 7 | u >>> 32 - 7; + u = x1 + x0; + x2 ^= u << 9 | u >>> 32 - 9; + u = x2 + x1; + x3 ^= u << 13 | u >>> 32 - 13; + u = x3 + x2; + x0 ^= u << 18 | u >>> 32 - 18; + u = x5 + x4; + x6 ^= u << 7 | u >>> 32 - 7; + u = x6 + x5; + x7 ^= u << 9 | u >>> 32 - 9; + u = x7 + x6; + x4 ^= u << 13 | u >>> 32 - 13; + u = x4 + x7; + x5 ^= u << 18 | u >>> 32 - 18; + u = x10 + x9; + x11 ^= u << 7 | u >>> 32 - 7; + u = x11 + x10; + x8 ^= u << 9 | u >>> 32 - 9; + u = x8 + x11; + x9 ^= u << 13 | u >>> 32 - 13; + u = x9 + x8; + x10 ^= u << 18 | u >>> 32 - 18; + u = x15 + x14; + x12 ^= u << 7 | u >>> 32 - 7; + u = x12 + x15; + x13 ^= u << 9 | u >>> 32 - 9; + u = x13 + x12; + x14 ^= u << 13 | u >>> 32 - 13; + u = x14 + x13; + x15 ^= u << 18 | u >>> 32 - 18; + } + B2[bout++] = tmp2[0] = x0 + j0 | 0; + B2[bout++] = tmp2[1] = x1 + j1 | 0; + B2[bout++] = tmp2[2] = x2 + j2 | 0; + B2[bout++] = tmp2[3] = x3 + j3 | 0; + B2[bout++] = tmp2[4] = x4 + j4 | 0; + B2[bout++] = tmp2[5] = x5 + j5 | 0; + B2[bout++] = tmp2[6] = x6 + j6 | 0; + B2[bout++] = tmp2[7] = x7 + j7 | 0; + B2[bout++] = tmp2[8] = x8 + j8 | 0; + B2[bout++] = tmp2[9] = x9 + j9 | 0; + B2[bout++] = tmp2[10] = x10 + j10 | 0; + B2[bout++] = tmp2[11] = x11 + j11 | 0; + B2[bout++] = tmp2[12] = x12 + j12 | 0; + B2[bout++] = tmp2[13] = x13 + j13 | 0; + B2[bout++] = tmp2[14] = x14 + j14 | 0; + B2[bout++] = tmp2[15] = x15 + j15 | 0; + } + function blockCopy(dst, di, src2, si, len) { + while (len--) + dst[di++] = src2[si++]; + } + function blockXOR(dst, di, src2, si, len) { + while (len--) + dst[di++] ^= src2[si++]; + } + function blockMix(tmp2, B2, bin, bout, r2) { + blockCopy(tmp2, 0, B2, bin + (2 * r2 - 1) * 16, 16); + for (var i = 0; i < 2 * r2; i += 2) { + salsaXOR(tmp2, B2, bin + i * 16, bout + i * 8); + salsaXOR(tmp2, B2, bin + i * 16 + 16, bout + i * 8 + r2 * 16); + } + } + function integerify(B2, bi, r2) { + return B2[bi + (2 * r2 - 1) * 16]; + } + function stringToUTF8Bytes(s) { + var arr = []; + for (var i = 0; i < s.length; i++) { + var c = s.charCodeAt(i); + if (c < 128) { + arr.push(c); + } else if (c < 2048) { + arr.push(192 | c >> 6); + arr.push(128 | c & 63); + } else if (c < 55296) { + arr.push(224 | c >> 12); + arr.push(128 | c >> 6 & 63); + arr.push(128 | c & 63); + } else { + if (i >= s.length - 1) { + throw new Error("invalid string"); + } + i++; + c = (c & 1023) << 10; + c |= s.charCodeAt(i) & 1023; + c += 65536; + arr.push(240 | c >> 18); + arr.push(128 | c >> 12 & 63); + arr.push(128 | c >> 6 & 63); + arr.push(128 | c & 63); + } + } + return arr; + } + function bytesToHex(p2) { + var enc = "0123456789abcdef".split(""); + var len = p2.length, arr = [], i = 0; + for (; i < len; i++) { + arr.push(enc[p2[i] >>> 4 & 15]); + arr.push(enc[p2[i] >>> 0 & 15]); + } + return arr.join(""); + } + function bytesToBase64(p2) { + var enc = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""); + var len = p2.length, arr = [], i = 0, a, b, c, t; + while (i < len) { + a = i < len ? p2[i++] : 0; + b = i < len ? p2[i++] : 0; + c = i < len ? p2[i++] : 0; + t = (a << 16) + (b << 8) + c; + arr.push(enc[t >>> 3 * 6 & 63]); + arr.push(enc[t >>> 2 * 6 & 63]); + arr.push(enc[t >>> 1 * 6 & 63]); + arr.push(enc[t >>> 0 * 6 & 63]); + } + if (len % 3 > 0) { + arr[arr.length - 1] = "="; + if (len % 3 === 1) + arr[arr.length - 2] = "="; + } + return arr.join(""); + } + var MAX_UINT = -1 >>> 0, p = 1; + if (typeof logN === "object") { + if (arguments.length > 4) { + throw new Error("scrypt: incorrect number of arguments"); + } + var opts = logN; + callback = r; + logN = opts.logN; + if (typeof logN === "undefined") { + if (typeof opts.N !== "undefined") { + if (opts.N < 2 || opts.N > MAX_UINT) + throw new Error("scrypt: N is out of range"); + if ((opts.N & opts.N - 1) !== 0) + throw new Error("scrypt: N is not a power of 2"); + logN = Math.log(opts.N) / Math.LN2; + } else { + throw new Error("scrypt: missing N parameter"); + } + } + p = opts.p || 1; + r = opts.r; + dkLen = opts.dkLen || 32; + interruptStep = opts.interruptStep || 0; + encoding = opts.encoding; + } + if (p < 1) + throw new Error("scrypt: invalid p"); + if (r <= 0) + throw new Error("scrypt: invalid r"); + if (logN < 1 || logN > 31) + throw new Error("scrypt: logN must be between 1 and 31"); + var N = 1 << logN >>> 0, XY, V, B, tmp; + if (r * p >= 1 << 30 || r > MAX_UINT / 128 / p || r > MAX_UINT / 256 || N > MAX_UINT / 128 / r) + throw new Error("scrypt: parameters are too large"); + if (typeof password === "string") + password = stringToUTF8Bytes(password); + if (typeof salt === "string") + salt = stringToUTF8Bytes(salt); + if (typeof Int32Array !== "undefined") { + XY = new Int32Array(64 * r); + V = new Int32Array(32 * N * r); + tmp = new Int32Array(16); + } else { + XY = []; + V = []; + tmp = new Array(16); + } + B = PBKDF2_HMAC_SHA256_OneIter(password, salt, p * 128 * r); + var xi = 0, yi = 32 * r; + function smixStart(pos) { + for (var i = 0; i < 32 * r; i++) { + var j = pos + i * 4; + XY[xi + i] = (B[j + 3] & 255) << 24 | (B[j + 2] & 255) << 16 | (B[j + 1] & 255) << 8 | (B[j + 0] & 255) << 0; + } + } + function smixStep1(start, end) { + for (var i = start; i < end; i += 2) { + blockCopy(V, i * (32 * r), XY, xi, 32 * r); + blockMix(tmp, XY, xi, yi, r); + blockCopy(V, (i + 1) * (32 * r), XY, yi, 32 * r); + blockMix(tmp, XY, yi, xi, r); + } + } + function smixStep2(start, end) { + for (var i = start; i < end; i += 2) { + var j = integerify(XY, xi, r) & N - 1; + blockXOR(XY, xi, V, j * (32 * r), 32 * r); + blockMix(tmp, XY, xi, yi, r); + j = integerify(XY, yi, r) & N - 1; + blockXOR(XY, yi, V, j * (32 * r), 32 * r); + blockMix(tmp, XY, yi, xi, r); + } + } + function smixFinish(pos) { + for (var i = 0; i < 32 * r; i++) { + var j = XY[xi + i]; + B[pos + i * 4 + 0] = j >>> 0 & 255; + B[pos + i * 4 + 1] = j >>> 8 & 255; + B[pos + i * 4 + 2] = j >>> 16 & 255; + B[pos + i * 4 + 3] = j >>> 24 & 255; + } + } + var nextTick = typeof setImmediate !== "undefined" ? setImmediate : setTimeout; + function interruptedFor(start, end, step, fn, donefn) { + (function performStep() { + nextTick(function() { + fn(start, start + step < end ? start + step : end); + start += step; + if (start < end) + performStep(); + else + donefn(); + }); + })(); + } + function getResult(enc) { + var result = PBKDF2_HMAC_SHA256_OneIter(password, B, dkLen); + if (enc === "base64") + return bytesToBase64(result); + else if (enc === "hex") + return bytesToHex(result); + else if (enc === "binary") + return new Uint8Array(result); + else + return result; + } + function calculateSync() { + for (var i = 0; i < p; i++) { + smixStart(i * 128 * r); + smixStep1(0, N); + smixStep2(0, N); + smixFinish(i * 128 * r); + } + callback(getResult(encoding)); + } + function calculateAsync(i) { + smixStart(i * 128 * r); + interruptedFor(0, N, interruptStep * 2, smixStep1, function() { + interruptedFor(0, N, interruptStep * 2, smixStep2, function() { + smixFinish(i * 128 * r); + if (i + 1 < p) { + nextTick(function() { + calculateAsync(i + 1); + }); + } else { + callback(getResult(encoding)); + } + }); + }); + } + if (typeof interruptStep === "function") { + encoding = callback; + callback = interruptStep; + interruptStep = 1e3; + } + if (interruptStep <= 0) { + calculateSync(); + } else { + calculateAsync(0); + } + } + if (typeof module !== "undefined") + module.exports = scrypt2; + } + }); + + // frontend/model/contracts/group.js + var import_common3 = __require("@common/common.js"); + var import_sbp6 = __toESM(__require("@sbp/sbp")); + + // frontend/utils/events.js + var JOINED_GROUP = "joined-group"; + var LEFT_CHATROOM = "left-chatroom"; + var DELETED_CHATROOM = "deleted-chatroom"; + + // frontend/model/contracts/misc/flowTyper.js + var EMPTY_VALUE = Symbol("@@empty"); + var isEmpty = (v) => v === EMPTY_VALUE; + var isNil = (v) => v === null; + var isUndef = (v) => typeof v === "undefined"; + var isBoolean = (v) => typeof v === "boolean"; + var isNumber = (v) => typeof v === "number"; + var isString = (v) => typeof v === "string"; + var isObject = (v) => !isNil(v) && typeof v === "object"; + var isFunction = (v) => typeof v === "function"; + var getType = (typeFn, _options) => { + if (isFunction(typeFn.type)) + return typeFn.type(_options); + return typeFn.name || "?"; + }; + var TypeValidatorError = class extends Error { + expectedType; + valueType; + value; + typeScope; + sourceFile; + constructor(message, expectedType, valueType, value, typeName = "", typeScope = "") { + const errMessage = message || `invalid "${valueType}" value type; ${typeName || expectedType} type expected`; + super(errMessage); + this.expectedType = expectedType; + this.valueType = valueType; + this.value = value; + this.typeScope = typeScope || ""; + this.sourceFile = this.getSourceFile(); + this.message = `${errMessage} +${this.getErrorInfo()}`; + this.name = this.constructor.name; + if (Error.captureStackTrace) { + Error.captureStackTrace(this, TypeValidatorError); + } + } + getSourceFile() { + const fileNames = this.stack.match(/(\/[\w_\-.]+)+(\.\w+:\d+:\d+)/g) || []; + return fileNames.find((fileName) => fileName.indexOf("/flowTyper-js/dist/") === -1) || ""; + } + getErrorInfo() { + return ` + file ${this.sourceFile} + scope ${this.typeScope} + expected ${this.expectedType.replace(/\n/g, "")} + type ${this.valueType} + value ${this.value} +`; + } + }; + var validatorError = (typeFn, value, scope, message, expectedType, valueType) => { + return new TypeValidatorError(message, expectedType || getType(typeFn), valueType || typeof value, JSON.stringify(value), typeFn.name, scope); + }; + var arrayOf = (typeFn, _scope = "Array") => { + function array(value) { + if (isEmpty(value)) + return [typeFn(value)]; + if (Array.isArray(value)) { + let index = 0; + return value.map((v) => typeFn(v, `${_scope}[${index++}]`)); + } + throw validatorError(array, value, _scope); + } + array.type = () => `Array<${getType(typeFn)}>`; + return array; + }; + var literalOf = (primitive) => { + function literal(value, _scope = "") { + if (isEmpty(value) || value === primitive) + return primitive; + throw validatorError(literal, value, _scope); + } + literal.type = () => { + if (isBoolean(primitive)) + return `${primitive ? "true" : "false"}`; + else + return `"${primitive}"`; + }; + return literal; + }; + var mapOf = (keyTypeFn, typeFn) => { + function mapOf2(value) { + if (isEmpty(value)) + return {}; + const o = object(value); + const reducer = (acc, key) => Object.assign(acc, { + [keyTypeFn(key, "Map[_]")]: typeFn(o[key], `Map.${key}`) + }); + return Object.keys(o).reduce(reducer, {}); + } + mapOf2.type = () => `{ [_:${getType(keyTypeFn)}]: ${getType(typeFn)} }`; + return mapOf2; + }; + var object = function(value) { + if (isEmpty(value)) + return {}; + if (isObject(value) && !Array.isArray(value)) { + return Object.assign({}, value); + } + throw validatorError(object, value); + }; + var objectOf = (typeObj, _scope = "Object") => { + function object2(value) { + const o = object(value); + const typeAttrs = Object.keys(typeObj); + const unknownAttr = Object.keys(o).find((attr) => !typeAttrs.includes(attr)); + if (unknownAttr) { + throw validatorError(object2, value, _scope, `missing object property '${unknownAttr}' in ${_scope} type`); + } + const undefAttr = typeAttrs.find((property) => { + const propertyTypeFn = typeObj[property]; + return propertyTypeFn.name.includes("maybe") && !o.hasOwnProperty(property); + }); + if (undefAttr) { + throw validatorError(object2, o[undefAttr], `${_scope}.${undefAttr}`, `empty object property '${undefAttr}' for ${_scope} type`, `void | null | ${getType(typeObj[undefAttr]).substr(1)}`, "-"); + } + const reducer = isEmpty(value) ? (acc, key) => Object.assign(acc, { [key]: typeObj[key](value) }) : (acc, key) => { + const typeFn = typeObj[key]; + if (typeFn.name.includes("optional") && !o.hasOwnProperty(key)) { + return Object.assign(acc, {}); + } else { + return Object.assign(acc, { [key]: typeFn(o[key], `${_scope}.${key}`) }); + } + }; + return typeAttrs.reduce(reducer, {}); + } + object2.type = () => { + const props = Object.keys(typeObj).map((key) => { + const ret = typeObj[key].name.includes("optional") ? `${key}?: ${getType(typeObj[key], { noVoid: true })}` : `${key}: ${getType(typeObj[key])}`; + return ret; + }); + return `{| + ${props.join(",\n ")} +|}`; + }; + return object2; + }; + function objectMaybeOf(validations, _scope = "Object") { + return function(data) { + object(data); + for (const key in data) { + validations[key]?.(data[key], `${_scope}.${key}`); + } + return data; + }; + } + var optional = (typeFn) => { + const unionFn = unionOf(typeFn, undef); + function optional2(v) { + return unionFn(v); + } + optional2.type = ({ noVoid }) => !noVoid ? getType(unionFn) : getType(typeFn); + return optional2; + }; + function undef(value, _scope = "") { + if (isEmpty(value) || isUndef(value)) + return void 0; + throw validatorError(undef, value, _scope); + } + undef.type = () => "void"; + var boolean = function boolean2(value, _scope = "") { + if (isEmpty(value)) + return false; + if (isBoolean(value)) + return value; + throw validatorError(boolean2, value, _scope); + }; + var number = function number2(value, _scope = "") { + if (isEmpty(value)) + return 0; + if (isNumber(value)) + return value; + throw validatorError(number2, value, _scope); + }; + var numberRange = (from3, to, key = "") => { + if (!isNumber(from3) || !isNumber(to)) { + throw new TypeError("Params for numberRange must be numbers"); + } + if (from3 >= to) { + throw new TypeError('Params "to" should be bigger than "from"'); + } + function numberRange2(value, _scope = "") { + number(value, _scope); + if (value >= from3 && value <= to) + return value; + throw validatorError(numberRange2, value, _scope, key ? `number type '${key}' must be within the range of [${from3}, ${to}]` : `must be within the range of [${from3}, ${to}]`); + } + numberRange2.type = `number(range: [${from3}, ${to}])`; + return numberRange2; + }; + var string = function string2(value, _scope = "") { + if (isEmpty(value)) + return ""; + if (isString(value)) + return value; + throw validatorError(string2, value, _scope); + }; + var stringMax = (numChar, key = "") => { + if (!isNumber(numChar)) { + throw new Error("param for stringMax must be number"); + } + function stringMax2(value, _scope = "") { + string(value, _scope); + if (value.length <= numChar) + return value; + throw validatorError(stringMax2, value, _scope, key ? `string type '${key}' cannot exceed ${numChar} characters` : `cannot exceed ${numChar} characters`); + } + stringMax2.type = () => `string(max: ${numChar})`; + return stringMax2; + }; + function tupleOf_(...typeFuncs) { + function tuple(value, _scope = "") { + const cardinality = typeFuncs.length; + if (isEmpty(value)) + return typeFuncs.map((fn) => fn(value)); + if (Array.isArray(value) && value.length === cardinality) { + const tupleValue = []; + for (let i = 0; i < cardinality; i += 1) { + tupleValue.push(typeFuncs[i](value[i], _scope)); + } + return tupleValue; + } + throw validatorError(tuple, value, _scope); + } + tuple.type = () => `[${typeFuncs.map((fn) => getType(fn)).join(", ")}]`; + return tuple; + } + var tupleOf = tupleOf_; + function unionOf_(...typeFuncs) { + function union(value, _scope = "") { + for (const typeFn of typeFuncs) { + try { + return typeFn(value, _scope); + } catch (_) { + } + } + throw validatorError(union, value, _scope); + } + union.type = () => `(${typeFuncs.map((fn) => getType(fn)).join(" | ")})`; + return union; + } + var unionOf = unionOf_; + var actionRequireInnerSignature = (next) => (data, props) => { + const innerSigningContractID = props.message.innerSigningContractID; + if (!innerSigningContractID || innerSigningContractID === props.contractID) { + throw new Error("Missing inner signature"); + } + return next(data, props); + }; + var validatorFrom = (fn) => { + function customType(value, _scope = "") { + if (!fn(value)) { + throw validatorError(customType, value, _scope); + } + return value; + } + return customType; + }; + + // shared/domains/chelonia/errors.js + var ChelErrorGenerator = (name, base2 = Error) => class extends base2 { + constructor(...params) { + super(...params); + this.name = name; + if (params[1]?.cause !== this.cause) { + Object.defineProperty(this, "cause", { value: params[1].cause }); + } + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + } + }; + var ChelErrorWarning = ChelErrorGenerator("ChelErrorWarning"); + var ChelErrorAlreadyProcessed = ChelErrorGenerator("ChelErrorAlreadyProcessed"); + var ChelErrorDBBadPreviousHEAD = ChelErrorGenerator("ChelErrorDBBadPreviousHEAD"); + var ChelErrorDBConnection = ChelErrorGenerator("ChelErrorDBConnection"); + var ChelErrorUnexpected = ChelErrorGenerator("ChelErrorUnexpected"); + var ChelErrorUnrecoverable = ChelErrorGenerator("ChelErrorUnrecoverable"); + var ChelErrorDecryptionError = ChelErrorGenerator("ChelErrorDecryptionError"); + var ChelErrorDecryptionKeyNotFound = ChelErrorGenerator("ChelErrorDecryptionKeyNotFound", ChelErrorDecryptionError); + var ChelErrorSignatureError = ChelErrorGenerator("ChelErrorSignatureError"); + var ChelErrorSignatureKeyUnauthorized = ChelErrorGenerator("ChelErrorSignatureKeyUnauthorized", ChelErrorSignatureError); + var ChelErrorSignatureKeyNotFound = ChelErrorGenerator("ChelErrorSignatureKeyNotFound", ChelErrorSignatureError); + var ChelErrorFetchServerTimeFailed = ChelErrorGenerator("ChelErrorFetchServerTimeFailed"); + + // shared/domains/chelonia/utils.js + var import_sbp3 = __toESM(__require("@sbp/sbp")); + + // frontend/model/contracts/shared/giLodash.js + function omit(o, props) { + const x = {}; + for (const k in o) { + if (!props.includes(k)) { + x[k] = o[k]; + } + } + return x; + } + function cloneDeep(obj) { + return JSON.parse(JSON.stringify(obj)); + } + function isMergeableObject(val) { + const nonNullObject = val && typeof val === "object"; + return nonNullObject && Object.prototype.toString.call(val) !== "[object RegExp]" && Object.prototype.toString.call(val) !== "[object Date]"; + } + function merge(obj, src2) { + for (const key in src2) { + const clone = isMergeableObject(src2[key]) ? cloneDeep(src2[key]) : void 0; + if (clone && isMergeableObject(obj[key])) { + merge(obj[key], clone); + continue; + } + obj[key] = clone || src2[key]; + } + return obj; + } + function deepEqualJSONType(a, b) { + if (a === b) + return true; + if (a === null || b === null || typeof a !== typeof b) + return false; + if (typeof a !== "object") + return a === b; + if (Array.isArray(a)) { + if (a.length !== b.length) + return false; + } else if (a.constructor.name !== "Object") { + throw new Error(`not JSON type: ${a}`); + } + for (const key in a) { + if (!deepEqualJSONType(a[key], b[key])) + return false; + } + return true; + } + var has = Function.prototype.call.bind(Object.prototype.hasOwnProperty); + + // shared/blake2bstream.js + var import_blakejs = __toESM(require_blakejs()); + + // shared/multiformats/bytes.js + var empty = new Uint8Array(0); + function equals(aa, bb) { + if (aa === bb) { + return true; + } + if (aa.byteLength !== bb.byteLength) { + return false; + } + for (let ii = 0; ii < aa.byteLength; ii++) { + if (aa[ii] !== bb[ii]) { + return false; + } + } + return true; + } + function coerce(o) { + if (o instanceof Uint8Array && o.constructor.name === "Uint8Array") { + return o; + } + if (o instanceof ArrayBuffer) { + return new Uint8Array(o); + } + if (ArrayBuffer.isView(o)) { + return new Uint8Array(o.buffer, o.byteOffset, o.byteLength); + } + throw new Error("Unknown type, must be binary type"); + } + + // shared/multiformats/vendor/varint.js + var encode_1 = encode; + var MSB = 128; + var REST = 127; + var MSBALL = ~REST; + var INT = Math.pow(2, 31); + function encode(num, out, offset) { + out = out || []; + offset = offset || 0; + var oldOffset = offset; + while (num >= INT) { + out[offset++] = num & 255 | MSB; + num /= 128; + } + while (num & MSBALL) { + out[offset++] = num & 255 | MSB; + num >>>= 7; + } + out[offset] = num | 0; + encode.bytes = offset - oldOffset + 1; + return out; + } + var decode = read; + var MSB$1 = 128; + var REST$1 = 127; + function read(buf, offset) { + var res = 0, offset = offset || 0, shift = 0, counter = offset, b, l = buf.length; + do { + if (counter >= l) { + read.bytes = 0; + throw new RangeError("Could not decode varint"); + } + b = buf[counter++]; + res += shift < 28 ? (b & REST$1) << shift : (b & REST$1) * Math.pow(2, shift); + shift += 7; + } while (b >= MSB$1); + read.bytes = counter - offset; + return res; + } + var N1 = Math.pow(2, 7); + var N2 = Math.pow(2, 14); + var N3 = Math.pow(2, 21); + var N4 = Math.pow(2, 28); + var N5 = Math.pow(2, 35); + var N6 = Math.pow(2, 42); + var N7 = Math.pow(2, 49); + var N8 = Math.pow(2, 56); + var N9 = Math.pow(2, 63); + var length = function(value) { + return value < N1 ? 1 : value < N2 ? 2 : value < N3 ? 3 : value < N4 ? 4 : value < N5 ? 5 : value < N6 ? 6 : value < N7 ? 7 : value < N8 ? 8 : value < N9 ? 9 : 10; + }; + var varint = { + encode: encode_1, + decode, + encodingLength: length + }; + var _brrp_varint = varint; + var varint_default = _brrp_varint; + + // shared/multiformats/varint.js + function decode2(data, offset = 0) { + const code = varint_default.decode(data, offset); + return [code, varint_default.decode.bytes]; + } + function encodeTo(int, target, offset = 0) { + varint_default.encode(int, target, offset); + return target; + } + function encodingLength(int) { + return varint_default.encodingLength(int); + } + + // shared/multiformats/hashes/digest.js + function create(code, digest) { + const size = digest.byteLength; + const sizeOffset = encodingLength(code); + const digestOffset = sizeOffset + encodingLength(size); + const bytes = new Uint8Array(digestOffset + size); + encodeTo(code, bytes, 0); + encodeTo(size, bytes, sizeOffset); + bytes.set(digest, digestOffset); + return new Digest(code, size, digest, bytes); + } + function decode3(multihash) { + const bytes = coerce(multihash); + const [code, sizeOffset] = decode2(bytes); + const [size, digestOffset] = decode2(bytes.subarray(sizeOffset)); + const digest = bytes.subarray(sizeOffset + digestOffset); + if (digest.byteLength !== size) { + throw new Error("Incorrect length"); + } + return new Digest(code, size, digest, bytes); + } + function equals2(a, b) { + if (a === b) { + return true; + } else { + const data = b; + return a.code === data.code && a.size === data.size && data.bytes instanceof Uint8Array && equals(a.bytes, data.bytes); + } + } + var Digest = class { + code; + size; + digest; + bytes; + constructor(code, size, digest, bytes) { + this.code = code; + this.size = size; + this.digest = digest; + this.bytes = bytes; + } + }; + + // shared/multiformats/hasher.js + function from({ name, code, encode: encode3 }) { + return new Hasher(name, code, encode3); + } + var Hasher = class { + name; + code; + encode; + constructor(name, code, encode3) { + this.name = name; + this.code = code; + this.encode = encode3; + } + digest(input) { + if (input instanceof Uint8Array || input instanceof ReadableStream) { + const result = this.encode(input); + return result instanceof Uint8Array ? create(this.code, result) : result.then((digest) => create(this.code, digest)); + } else { + throw Error("Unknown type, must be binary type"); + } + } + }; + + // shared/blake2bstream.js + var { blake2b, blake2bInit, blake2bUpdate, blake2bFinal } = import_blakejs.default; + var blake2b256stream = from({ + name: "blake2b-256", + code: 45600, + encode: async (input) => { + if (input instanceof ReadableStream) { + const ctx = blake2bInit(32); + const reader = input.getReader(); + for (; ; ) { + const result = await reader.read(); + if (result.done) + break; + blake2bUpdate(ctx, coerce(result.value)); + } + return blake2bFinal(ctx); + } else { + return coerce(blake2b(input, void 0, 32)); + } + } + }); + + // shared/multiformats/base-x.js + function base(ALPHABET, name) { + if (ALPHABET.length >= 255) { + throw new TypeError("Alphabet too long"); + } + var BASE_MAP = new Uint8Array(256); + for (var j = 0; j < BASE_MAP.length; j++) { + BASE_MAP[j] = 255; + } + for (var i = 0; i < ALPHABET.length; i++) { + var x = ALPHABET.charAt(i); + var xc = x.charCodeAt(0); + if (BASE_MAP[xc] !== 255) { + throw new TypeError(x + " is ambiguous"); + } + BASE_MAP[xc] = i; + } + var BASE = ALPHABET.length; + var LEADER = ALPHABET.charAt(0); + var FACTOR = Math.log(BASE) / Math.log(256); + var iFACTOR = Math.log(256) / Math.log(BASE); + function encode3(source) { + if (source instanceof Uint8Array) + ; + else if (ArrayBuffer.isView(source)) { + source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength); + } else if (Array.isArray(source)) { + source = Uint8Array.from(source); + } + if (!(source instanceof Uint8Array)) { + throw new TypeError("Expected Uint8Array"); + } + if (source.length === 0) { + return ""; + } + var zeroes = 0; + var length2 = 0; + var pbegin = 0; + var pend = source.length; + while (pbegin !== pend && source[pbegin] === 0) { + pbegin++; + zeroes++; + } + var size = (pend - pbegin) * iFACTOR + 1 >>> 0; + var b58 = new Uint8Array(size); + while (pbegin !== pend) { + var carry = source[pbegin]; + var i2 = 0; + for (var it1 = size - 1; (carry !== 0 || i2 < length2) && it1 !== -1; it1--, i2++) { + carry += 256 * b58[it1] >>> 0; + b58[it1] = carry % BASE >>> 0; + carry = carry / BASE >>> 0; + } + if (carry !== 0) { + throw new Error("Non-zero carry"); + } + length2 = i2; + pbegin++; + } + var it2 = size - length2; + while (it2 !== size && b58[it2] === 0) { + it2++; + } + var str = LEADER.repeat(zeroes); + for (; it2 < size; ++it2) { + str += ALPHABET.charAt(b58[it2]); + } + return str; + } + function decodeUnsafe(source) { + if (typeof source !== "string") { + throw new TypeError("Expected String"); + } + if (source.length === 0) { + return new Uint8Array(); + } + var psz = 0; + if (source[psz] === " ") { + return; + } + var zeroes = 0; + var length2 = 0; + while (source[psz] === LEADER) { + zeroes++; + psz++; + } + var size = (source.length - psz) * FACTOR + 1 >>> 0; + var b256 = new Uint8Array(size); + while (source[psz]) { + var carry = BASE_MAP[source.charCodeAt(psz)]; + if (carry === 255) { + return; + } + var i2 = 0; + for (var it3 = size - 1; (carry !== 0 || i2 < length2) && it3 !== -1; it3--, i2++) { + carry += BASE * b256[it3] >>> 0; + b256[it3] = carry % 256 >>> 0; + carry = carry / 256 >>> 0; + } + if (carry !== 0) { + throw new Error("Non-zero carry"); + } + length2 = i2; + psz++; + } + if (source[psz] === " ") { + return; + } + var it4 = size - length2; + while (it4 !== size && b256[it4] === 0) { + it4++; + } + var vch = new Uint8Array(zeroes + (size - it4)); + var j2 = zeroes; + while (it4 !== size) { + vch[j2++] = b256[it4++]; + } + return vch; + } + function decode5(string3) { + var buffer = decodeUnsafe(string3); + if (buffer) { + return buffer; + } + throw new Error(`Non-${name} character`); + } + return { + encode: encode3, + decodeUnsafe, + decode: decode5 + }; + } + var src = base; + var _brrp__multiformats_scope_baseX = src; + var base_x_default = _brrp__multiformats_scope_baseX; + + // shared/multiformats/bases/base.js + var Encoder = class { + name; + prefix; + baseEncode; + constructor(name, prefix, baseEncode) { + this.name = name; + this.prefix = prefix; + this.baseEncode = baseEncode; + } + encode(bytes) { + if (bytes instanceof Uint8Array) { + return `${this.prefix}${this.baseEncode(bytes)}`; + } else { + throw Error("Unknown type, must be binary type"); + } + } + }; + var Decoder = class { + name; + prefix; + baseDecode; + prefixCodePoint; + constructor(name, prefix, baseDecode) { + this.name = name; + this.prefix = prefix; + if (prefix.codePointAt(0) === void 0) { + throw new Error("Invalid prefix character"); + } + this.prefixCodePoint = prefix.codePointAt(0); + this.baseDecode = baseDecode; + } + decode(text) { + if (typeof text === "string") { + if (text.codePointAt(0) !== this.prefixCodePoint) { + throw Error(`Unable to decode multibase string ${JSON.stringify(text)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`); + } + return this.baseDecode(text.slice(this.prefix.length)); + } else { + throw Error("Can only multibase decode strings"); + } + } + or(decoder) { + return or(this, decoder); + } + }; + var ComposedDecoder = class { + decoders; + constructor(decoders) { + this.decoders = decoders; + } + or(decoder) { + return or(this, decoder); + } + decode(input) { + const prefix = input[0]; + const decoder = this.decoders[prefix]; + if (decoder != null) { + return decoder.decode(input); + } else { + throw RangeError(`Unable to decode multibase string ${JSON.stringify(input)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`); + } + } + }; + function or(left, right) { + return new ComposedDecoder({ + ...left.decoders ?? { [left.prefix]: left }, + ...right.decoders ?? { [right.prefix]: right } + }); + } + var Codec = class { + name; + prefix; + baseEncode; + baseDecode; + encoder; + decoder; + constructor(name, prefix, baseEncode, baseDecode) { + this.name = name; + this.prefix = prefix; + this.baseEncode = baseEncode; + this.baseDecode = baseDecode; + this.encoder = new Encoder(name, prefix, baseEncode); + this.decoder = new Decoder(name, prefix, baseDecode); + } + encode(input) { + return this.encoder.encode(input); + } + decode(input) { + return this.decoder.decode(input); + } + }; + function from2({ name, prefix, encode: encode3, decode: decode5 }) { + return new Codec(name, prefix, encode3, decode5); + } + function baseX({ name, prefix, alphabet }) { + const { encode: encode3, decode: decode5 } = base_x_default(alphabet, name); + return from2({ + prefix, + name, + encode: encode3, + decode: (text) => coerce(decode5(text)) + }); + } + function decode4(string3, alphabet, bitsPerChar, name) { + const codes = {}; + for (let i = 0; i < alphabet.length; ++i) { + codes[alphabet[i]] = i; + } + let end = string3.length; + while (string3[end - 1] === "=") { + --end; + } + const out = new Uint8Array(end * bitsPerChar / 8 | 0); + let bits = 0; + let buffer = 0; + let written = 0; + for (let i = 0; i < end; ++i) { + const value = codes[string3[i]]; + if (value === void 0) { + throw new SyntaxError(`Non-${name} character`); + } + buffer = buffer << bitsPerChar | value; + bits += bitsPerChar; + if (bits >= 8) { + bits -= 8; + out[written++] = 255 & buffer >> bits; + } + } + if (bits >= bitsPerChar || (255 & buffer << 8 - bits) !== 0) { + throw new SyntaxError("Unexpected end of data"); + } + return out; + } + function encode2(data, alphabet, bitsPerChar) { + const pad = alphabet[alphabet.length - 1] === "="; + const mask = (1 << bitsPerChar) - 1; + let out = ""; + let bits = 0; + let buffer = 0; + for (let i = 0; i < data.length; ++i) { + buffer = buffer << 8 | data[i]; + bits += 8; + while (bits > bitsPerChar) { + bits -= bitsPerChar; + out += alphabet[mask & buffer >> bits]; + } + } + if (bits !== 0) { + out += alphabet[mask & buffer << bitsPerChar - bits]; + } + if (pad) { + while ((out.length * bitsPerChar & 7) !== 0) { + out += "="; + } + } + return out; + } + function rfc4648({ name, prefix, bitsPerChar, alphabet }) { + return from2({ + prefix, + name, + encode(input) { + return encode2(input, alphabet, bitsPerChar); + }, + decode(input) { + return decode4(input, alphabet, bitsPerChar, name); + } + }); + } + + // shared/multiformats/bases/base58.js + var base58btc = baseX({ + name: "base58btc", + prefix: "z", + alphabet: "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz" + }); + var base58flickr = baseX({ + name: "base58flickr", + prefix: "Z", + alphabet: "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ" + }); + + // shared/multiformats/blake2b.js + var import_blakejs2 = __toESM(require_blakejs()); + var { blake2b: blake2b2 } = import_blakejs2.default; + var blake2b8 = from({ + name: "blake2b-8", + code: 45569, + encode: (input) => coerce(blake2b2(input, void 0, 1)) + }); + var blake2b16 = from({ + name: "blake2b-16", + code: 45570, + encode: (input) => coerce(blake2b2(input, void 0, 2)) + }); + var blake2b24 = from({ + name: "blake2b-24", + code: 45571, + encode: (input) => coerce(blake2b2(input, void 0, 3)) + }); + var blake2b32 = from({ + name: "blake2b-32", + code: 45572, + encode: (input) => coerce(blake2b2(input, void 0, 4)) + }); + var blake2b40 = from({ + name: "blake2b-40", + code: 45573, + encode: (input) => coerce(blake2b2(input, void 0, 5)) + }); + var blake2b48 = from({ + name: "blake2b-48", + code: 45574, + encode: (input) => coerce(blake2b2(input, void 0, 6)) + }); + var blake2b56 = from({ + name: "blake2b-56", + code: 45575, + encode: (input) => coerce(blake2b2(input, void 0, 7)) + }); + var blake2b64 = from({ + name: "blake2b-64", + code: 45576, + encode: (input) => coerce(blake2b2(input, void 0, 8)) + }); + var blake2b72 = from({ + name: "blake2b-72", + code: 45577, + encode: (input) => coerce(blake2b2(input, void 0, 9)) + }); + var blake2b80 = from({ + name: "blake2b-80", + code: 45578, + encode: (input) => coerce(blake2b2(input, void 0, 10)) + }); + var blake2b88 = from({ + name: "blake2b-88", + code: 45579, + encode: (input) => coerce(blake2b2(input, void 0, 11)) + }); + var blake2b96 = from({ + name: "blake2b-96", + code: 45580, + encode: (input) => coerce(blake2b2(input, void 0, 12)) + }); + var blake2b104 = from({ + name: "blake2b-104", + code: 45581, + encode: (input) => coerce(blake2b2(input, void 0, 13)) + }); + var blake2b112 = from({ + name: "blake2b-112", + code: 45582, + encode: (input) => coerce(blake2b2(input, void 0, 14)) + }); + var blake2b120 = from({ + name: "blake2b-120", + code: 45583, + encode: (input) => coerce(blake2b2(input, void 0, 15)) + }); + var blake2b128 = from({ + name: "blake2b-128", + code: 45584, + encode: (input) => coerce(blake2b2(input, void 0, 16)) + }); + var blake2b136 = from({ + name: "blake2b-136", + code: 45585, + encode: (input) => coerce(blake2b2(input, void 0, 17)) + }); + var blake2b144 = from({ + name: "blake2b-144", + code: 45586, + encode: (input) => coerce(blake2b2(input, void 0, 18)) + }); + var blake2b152 = from({ + name: "blake2b-152", + code: 45587, + encode: (input) => coerce(blake2b2(input, void 0, 19)) + }); + var blake2b160 = from({ + name: "blake2b-160", + code: 45588, + encode: (input) => coerce(blake2b2(input, void 0, 20)) + }); + var blake2b168 = from({ + name: "blake2b-168", + code: 45589, + encode: (input) => coerce(blake2b2(input, void 0, 21)) + }); + var blake2b176 = from({ + name: "blake2b-176", + code: 45590, + encode: (input) => coerce(blake2b2(input, void 0, 22)) + }); + var blake2b184 = from({ + name: "blake2b-184", + code: 45591, + encode: (input) => coerce(blake2b2(input, void 0, 23)) + }); + var blake2b192 = from({ + name: "blake2b-192", + code: 45592, + encode: (input) => coerce(blake2b2(input, void 0, 24)) + }); + var blake2b200 = from({ + name: "blake2b-200", + code: 45593, + encode: (input) => coerce(blake2b2(input, void 0, 25)) + }); + var blake2b208 = from({ + name: "blake2b-208", + code: 45594, + encode: (input) => coerce(blake2b2(input, void 0, 26)) + }); + var blake2b216 = from({ + name: "blake2b-216", + code: 45595, + encode: (input) => coerce(blake2b2(input, void 0, 27)) + }); + var blake2b224 = from({ + name: "blake2b-224", + code: 45596, + encode: (input) => coerce(blake2b2(input, void 0, 28)) + }); + var blake2b232 = from({ + name: "blake2b-232", + code: 45597, + encode: (input) => coerce(blake2b2(input, void 0, 29)) + }); + var blake2b240 = from({ + name: "blake2b-240", + code: 45598, + encode: (input) => coerce(blake2b2(input, void 0, 30)) + }); + var blake2b248 = from({ + name: "blake2b-248", + code: 45599, + encode: (input) => coerce(blake2b2(input, void 0, 31)) + }); + var blake2b256 = from({ + name: "blake2b-256", + code: 45600, + encode: (input) => coerce(blake2b2(input, void 0, 32)) + }); + var blake2b264 = from({ + name: "blake2b-264", + code: 45601, + encode: (input) => coerce(blake2b2(input, void 0, 33)) + }); + var blake2b272 = from({ + name: "blake2b-272", + code: 45602, + encode: (input) => coerce(blake2b2(input, void 0, 34)) + }); + var blake2b280 = from({ + name: "blake2b-280", + code: 45603, + encode: (input) => coerce(blake2b2(input, void 0, 35)) + }); + var blake2b288 = from({ + name: "blake2b-288", + code: 45604, + encode: (input) => coerce(blake2b2(input, void 0, 36)) + }); + var blake2b296 = from({ + name: "blake2b-296", + code: 45605, + encode: (input) => coerce(blake2b2(input, void 0, 37)) + }); + var blake2b304 = from({ + name: "blake2b-304", + code: 45606, + encode: (input) => coerce(blake2b2(input, void 0, 38)) + }); + var blake2b312 = from({ + name: "blake2b-312", + code: 45607, + encode: (input) => coerce(blake2b2(input, void 0, 39)) + }); + var blake2b320 = from({ + name: "blake2b-320", + code: 45608, + encode: (input) => coerce(blake2b2(input, void 0, 40)) + }); + var blake2b328 = from({ + name: "blake2b-328", + code: 45609, + encode: (input) => coerce(blake2b2(input, void 0, 41)) + }); + var blake2b336 = from({ + name: "blake2b-336", + code: 45610, + encode: (input) => coerce(blake2b2(input, void 0, 42)) + }); + var blake2b344 = from({ + name: "blake2b-344", + code: 45611, + encode: (input) => coerce(blake2b2(input, void 0, 43)) + }); + var blake2b352 = from({ + name: "blake2b-352", + code: 45612, + encode: (input) => coerce(blake2b2(input, void 0, 44)) + }); + var blake2b360 = from({ + name: "blake2b-360", + code: 45613, + encode: (input) => coerce(blake2b2(input, void 0, 45)) + }); + var blake2b368 = from({ + name: "blake2b-368", + code: 45614, + encode: (input) => coerce(blake2b2(input, void 0, 46)) + }); + var blake2b376 = from({ + name: "blake2b-376", + code: 45615, + encode: (input) => coerce(blake2b2(input, void 0, 47)) + }); + var blake2b384 = from({ + name: "blake2b-384", + code: 45616, + encode: (input) => coerce(blake2b2(input, void 0, 48)) + }); + var blake2b392 = from({ + name: "blake2b-392", + code: 45617, + encode: (input) => coerce(blake2b2(input, void 0, 49)) + }); + var blake2b400 = from({ + name: "blake2b-400", + code: 45618, + encode: (input) => coerce(blake2b2(input, void 0, 50)) + }); + var blake2b408 = from({ + name: "blake2b-408", + code: 45619, + encode: (input) => coerce(blake2b2(input, void 0, 51)) + }); + var blake2b416 = from({ + name: "blake2b-416", + code: 45620, + encode: (input) => coerce(blake2b2(input, void 0, 52)) + }); + var blake2b424 = from({ + name: "blake2b-424", + code: 45621, + encode: (input) => coerce(blake2b2(input, void 0, 53)) + }); + var blake2b432 = from({ + name: "blake2b-432", + code: 45622, + encode: (input) => coerce(blake2b2(input, void 0, 54)) + }); + var blake2b440 = from({ + name: "blake2b-440", + code: 45623, + encode: (input) => coerce(blake2b2(input, void 0, 55)) + }); + var blake2b448 = from({ + name: "blake2b-448", + code: 45624, + encode: (input) => coerce(blake2b2(input, void 0, 56)) + }); + var blake2b456 = from({ + name: "blake2b-456", + code: 45625, + encode: (input) => coerce(blake2b2(input, void 0, 57)) + }); + var blake2b464 = from({ + name: "blake2b-464", + code: 45626, + encode: (input) => coerce(blake2b2(input, void 0, 58)) + }); + var blake2b472 = from({ + name: "blake2b-472", + code: 45627, + encode: (input) => coerce(blake2b2(input, void 0, 59)) + }); + var blake2b480 = from({ + name: "blake2b-480", + code: 45628, + encode: (input) => coerce(blake2b2(input, void 0, 60)) + }); + var blake2b488 = from({ + name: "blake2b-488", + code: 45629, + encode: (input) => coerce(blake2b2(input, void 0, 61)) + }); + var blake2b496 = from({ + name: "blake2b-496", + code: 45630, + encode: (input) => coerce(blake2b2(input, void 0, 62)) + }); + var blake2b504 = from({ + name: "blake2b-504", + code: 45631, + encode: (input) => coerce(blake2b2(input, void 0, 63)) + }); + var blake2b512 = from({ + name: "blake2b-512", + code: 45632, + encode: (input) => coerce(blake2b2(input, void 0, 64)) + }); + + // shared/multiformats/bases/base32.js + var base32 = rfc4648({ + prefix: "b", + name: "base32", + alphabet: "abcdefghijklmnopqrstuvwxyz234567", + bitsPerChar: 5 + }); + var base32upper = rfc4648({ + prefix: "B", + name: "base32upper", + alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567", + bitsPerChar: 5 + }); + var base32pad = rfc4648({ + prefix: "c", + name: "base32pad", + alphabet: "abcdefghijklmnopqrstuvwxyz234567=", + bitsPerChar: 5 + }); + var base32padupper = rfc4648({ + prefix: "C", + name: "base32padupper", + alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=", + bitsPerChar: 5 + }); + var base32hex = rfc4648({ + prefix: "v", + name: "base32hex", + alphabet: "0123456789abcdefghijklmnopqrstuv", + bitsPerChar: 5 + }); + var base32hexupper = rfc4648({ + prefix: "V", + name: "base32hexupper", + alphabet: "0123456789ABCDEFGHIJKLMNOPQRSTUV", + bitsPerChar: 5 + }); + var base32hexpad = rfc4648({ + prefix: "t", + name: "base32hexpad", + alphabet: "0123456789abcdefghijklmnopqrstuv=", + bitsPerChar: 5 + }); + var base32hexpadupper = rfc4648({ + prefix: "T", + name: "base32hexpadupper", + alphabet: "0123456789ABCDEFGHIJKLMNOPQRSTUV=", + bitsPerChar: 5 + }); + var base32z = rfc4648({ + prefix: "h", + name: "base32z", + alphabet: "ybndrfg8ejkmcpqxot1uwisza345h769", + bitsPerChar: 5 + }); + + // shared/multiformats/cid.js + function format(link, base2) { + const { bytes, version } = link; + switch (version) { + case 0: + return toStringV0(bytes, baseCache(link), base2 ?? base58btc.encoder); + default: + return toStringV1(bytes, baseCache(link), base2 ?? base32.encoder); + } + } + var cache = /* @__PURE__ */ new WeakMap(); + function baseCache(cid) { + const baseCache2 = cache.get(cid); + if (baseCache2 == null) { + const baseCache3 = /* @__PURE__ */ new Map(); + cache.set(cid, baseCache3); + return baseCache3; + } + return baseCache2; + } + var CID = class { + code; + version; + multihash; + bytes; + "/"; + constructor(version, code, multihash, bytes) { + this.code = code; + this.version = version; + this.multihash = multihash; + this.bytes = bytes; + this["/"] = bytes; + } + get asCID() { + return this; + } + get byteOffset() { + return this.bytes.byteOffset; + } + get byteLength() { + return this.bytes.byteLength; + } + toV0() { + switch (this.version) { + case 0: { + return this; + } + case 1: { + const { code, multihash } = this; + if (code !== DAG_PB_CODE) { + throw new Error("Cannot convert a non dag-pb CID to CIDv0"); + } + if (multihash.code !== SHA_256_CODE) { + throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0"); + } + return CID.createV0(multihash); + } + default: { + throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`); + } + } + } + toV1() { + switch (this.version) { + case 0: { + const { code, digest } = this.multihash; + const multihash = create(code, digest); + return CID.createV1(this.code, multihash); + } + case 1: { + return this; + } + default: { + throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`); + } + } + } + equals(other) { + return CID.equals(this, other); + } + static equals(self2, other) { + const unknown = other; + return unknown != null && self2.code === unknown.code && self2.version === unknown.version && equals2(self2.multihash, unknown.multihash); + } + toString(base2) { + return format(this, base2); + } + toJSON() { + return { "/": format(this) }; + } + link() { + return this; + } + [Symbol.toStringTag] = "CID"; + [Symbol.for("nodejs.util.inspect.custom")]() { + return `CID(${this.toString()})`; + } + static asCID(input) { + if (input == null) { + return null; + } + const value = input; + if (value instanceof CID) { + return value; + } else if (value["/"] != null && value["/"] === value.bytes || value.asCID === value) { + const { version, code, multihash, bytes } = value; + return new CID(version, code, multihash, bytes ?? encodeCID(version, code, multihash.bytes)); + } else if (value[cidSymbol] === true) { + const { version, multihash, code } = value; + const digest = decode3(multihash); + return CID.create(version, code, digest); + } else { + return null; + } + } + static create(version, code, digest) { + if (typeof code !== "number") { + throw new Error("String codecs are no longer supported"); + } + if (!(digest.bytes instanceof Uint8Array)) { + throw new Error("Invalid digest"); + } + switch (version) { + case 0: { + if (code !== DAG_PB_CODE) { + throw new Error(`Version 0 CID must use dag-pb (code: ${DAG_PB_CODE}) block encoding`); + } else { + return new CID(version, code, digest, digest.bytes); + } + } + case 1: { + const bytes = encodeCID(version, code, digest.bytes); + return new CID(version, code, digest, bytes); + } + default: { + throw new Error("Invalid version"); + } + } + } + static createV0(digest) { + return CID.create(0, DAG_PB_CODE, digest); + } + static createV1(code, digest) { + return CID.create(1, code, digest); + } + static decode(bytes) { + const [cid, remainder] = CID.decodeFirst(bytes); + if (remainder.length !== 0) { + throw new Error("Incorrect length"); + } + return cid; + } + static decodeFirst(bytes) { + const specs = CID.inspectBytes(bytes); + const prefixSize = specs.size - specs.multihashSize; + const multihashBytes = coerce(bytes.subarray(prefixSize, prefixSize + specs.multihashSize)); + if (multihashBytes.byteLength !== specs.multihashSize) { + throw new Error("Incorrect length"); + } + const digestBytes = multihashBytes.subarray(specs.multihashSize - specs.digestSize); + const digest = new Digest(specs.multihashCode, specs.digestSize, digestBytes, multihashBytes); + const cid = specs.version === 0 ? CID.createV0(digest) : CID.createV1(specs.codec, digest); + return [cid, bytes.subarray(specs.size)]; + } + static inspectBytes(initialBytes) { + let offset = 0; + const next = () => { + const [i, length2] = decode2(initialBytes.subarray(offset)); + offset += length2; + return i; + }; + let version = next(); + let codec = DAG_PB_CODE; + if (version === 18) { + version = 0; + offset = 0; + } else { + codec = next(); + } + if (version !== 0 && version !== 1) { + throw new RangeError(`Invalid CID version ${version}`); + } + const prefixSize = offset; + const multihashCode = next(); + const digestSize = next(); + const size = offset + digestSize; + const multihashSize = size - prefixSize; + return { version, codec, multihashCode, digestSize, multihashSize, size }; + } + static parse(source, base2) { + const [prefix, bytes] = parseCIDtoBytes(source, base2); + const cid = CID.decode(bytes); + if (cid.version === 0 && source[0] !== "Q") { + throw Error("Version 0 CID string must not include multibase prefix"); + } + baseCache(cid).set(prefix, source); + return cid; + } + }; + function parseCIDtoBytes(source, base2) { + switch (source[0]) { + case "Q": { + const decoder = base2 ?? base58btc; + return [ + base58btc.prefix, + decoder.decode(`${base58btc.prefix}${source}`) + ]; + } + case base58btc.prefix: { + const decoder = base2 ?? base58btc; + return [base58btc.prefix, decoder.decode(source)]; + } + case base32.prefix: { + const decoder = base2 ?? base32; + return [base32.prefix, decoder.decode(source)]; + } + default: { + if (base2 == null) { + throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided"); + } + return [source[0], base2.decode(source)]; + } + } + } + function toStringV0(bytes, cache2, base2) { + const { prefix } = base2; + if (prefix !== base58btc.prefix) { + throw Error(`Cannot string encode V0 in ${base2.name} encoding`); + } + const cid = cache2.get(prefix); + if (cid == null) { + const cid2 = base2.encode(bytes).slice(1); + cache2.set(prefix, cid2); + return cid2; + } else { + return cid; + } + } + function toStringV1(bytes, cache2, base2) { + const { prefix } = base2; + const cid = cache2.get(prefix); + if (cid == null) { + const cid2 = base2.encode(bytes); + cache2.set(prefix, cid2); + return cid2; + } else { + return cid; + } + } + var DAG_PB_CODE = 112; + var SHA_256_CODE = 18; + function encodeCID(version, code, multihash) { + const codeOffset = encodingLength(version); + const hashOffset = codeOffset + encodingLength(code); + const bytes = new Uint8Array(hashOffset + multihash.byteLength); + encodeTo(version, bytes, 0); + encodeTo(code, bytes, codeOffset); + bytes.set(multihash, hashOffset); + return bytes; + } + var cidSymbol = Symbol.for("@ipld/js-cid/CID"); + + // shared/functions.js + var multicodes = { JSON: 512, RAW: 0 }; + if (typeof globalThis === "object" && !has(globalThis, "Buffer")) { + const { Buffer: Buffer2 } = require_buffer(); + globalThis.Buffer = Buffer2; + } + function createCID(data, multicode = multicodes.RAW) { + const uint8array = typeof data === "string" ? new TextEncoder().encode(data) : data; + const digest = blake2b256.digest(uint8array); + return CID.create(1, multicode, digest).toString(base58btc.encoder); + } + function blake32Hash(data) { + const uint8array = typeof data === "string" ? new TextEncoder().encode(data) : data; + const digest = blake2b256.digest(uint8array); + return base58btc.encode(digest.bytes); + } + var b64ToBuf = (b64) => Buffer.from(b64, "base64"); + var strToBuf = (str) => Buffer.from(str, "utf8"); + var bytesToB64 = (ary) => Buffer.from(ary).toString("base64"); + + // shared/domains/chelonia/crypto.js + var import_tweetnacl = __toESM(require_nacl_fast()); + var import_scrypt_async = __toESM(require_scrypt_async()); + var EDWARDS25519SHA512BATCH = "edwards25519sha512batch"; + var CURVE25519XSALSA20POLY1305 = "curve25519xsalsa20poly1305"; + var XSALSA20POLY1305 = "xsalsa20poly1305"; + if (false) { + throw new Error("ENABLE_UNSAFE_NULL_CRYPTO cannot be enabled in production mode"); + } + var bytesOrObjectToB64 = (ary) => { + if (!(ary instanceof Uint8Array)) { + throw Error("Unsupported type"); + } + return bytesToB64(ary); + }; + var serializeKey = (key, saveSecretKey) => { + if (false) { + return JSON.stringify([ + key.type, + saveSecretKey ? null : key.publicKey, + saveSecretKey ? key.secretKey : null + ], void 0, 0); + } + if (key.type === EDWARDS25519SHA512BATCH || key.type === CURVE25519XSALSA20POLY1305) { + if (!saveSecretKey) { + if (!key.publicKey) { + throw new Error("Unsupported operation: no public key to export"); + } + return JSON.stringify([ + key.type, + bytesOrObjectToB64(key.publicKey), + null + ], void 0, 0); + } + if (!key.secretKey) { + throw new Error("Unsupported operation: no secret key to export"); + } + return JSON.stringify([ + key.type, + null, + bytesOrObjectToB64(key.secretKey) + ], void 0, 0); + } else if (key.type === XSALSA20POLY1305) { + if (!saveSecretKey) { + throw new Error("Unsupported operation: no public key to export"); + } + if (!key.secretKey) { + throw new Error("Unsupported operation: no secret key to export"); + } + return JSON.stringify([ + key.type, + null, + bytesOrObjectToB64(key.secretKey) + ], void 0, 0); + } + throw new Error("Unsupported key type"); + }; + var deserializeKey = (data) => { + const keyData = JSON.parse(data); + if (!keyData || keyData.length !== 3) { + throw new Error("Invalid key object"); + } + if (false) { + const res = { + type: keyData[0] + }; + if (keyData[2]) { + Object.defineProperty(res, "secretKey", { value: keyData[2] }); + res.publicKey = keyData[2]; + } else { + res.publicKey = keyData[1]; + } + return res; + } + if (keyData[0] === EDWARDS25519SHA512BATCH) { + if (keyData[2]) { + const key = import_tweetnacl.default.sign.keyPair.fromSecretKey(b64ToBuf(keyData[2])); + const res = { + type: keyData[0], + publicKey: key.publicKey + }; + Object.defineProperty(res, "secretKey", { value: key.secretKey }); + return res; + } else if (keyData[1]) { + return { + type: keyData[0], + publicKey: new Uint8Array(b64ToBuf(keyData[1])) + }; + } + throw new Error("Missing secret or public key"); + } else if (keyData[0] === CURVE25519XSALSA20POLY1305) { + if (keyData[2]) { + const key = import_tweetnacl.default.box.keyPair.fromSecretKey(b64ToBuf(keyData[2])); + const res = { + type: keyData[0], + publicKey: key.publicKey + }; + Object.defineProperty(res, "secretKey", { value: key.secretKey }); + return res; + } else if (keyData[1]) { + return { + type: keyData[0], + publicKey: new Uint8Array(b64ToBuf(keyData[1])) + }; + } + throw new Error("Missing secret or public key"); + } else if (keyData[0] === XSALSA20POLY1305) { + if (!keyData[2]) { + throw new Error("Secret key missing"); + } + const res = { + type: keyData[0] + }; + Object.defineProperty(res, "secretKey", { value: new Uint8Array(b64ToBuf(keyData[2])) }); + return res; + } + throw new Error("Unsupported key type"); + }; + var keyId = (inKey) => { + const key = Object(inKey) instanceof String ? deserializeKey(inKey) : inKey; + const serializedKey = serializeKey(key, !key.publicKey); + return blake32Hash(serializedKey); + }; + var verifySignature = (inKey, data, signature) => { + const key = Object(inKey) instanceof String ? deserializeKey(inKey) : inKey; + if (false) { + if (!key.publicKey) { + throw new Error("Public key missing"); + } + if (key.publicKey + ";" + blake32Hash(data) !== signature) { + throw new Error("Invalid signature"); + } + return; + } + if (key.type !== EDWARDS25519SHA512BATCH) { + throw new Error("Unsupported algorithm"); + } + if (!key.publicKey) { + throw new Error("Public key missing"); + } + const decodedSignature = b64ToBuf(signature); + const messageUint8 = strToBuf(data); + const result = import_tweetnacl.default.sign.detached.verify(messageUint8, decodedSignature, key.publicKey); + if (!result) { + throw new Error("Invalid signature"); + } + }; + var decrypt = (inKey, data, ad) => { + const key = Object(inKey) instanceof String ? deserializeKey(inKey) : inKey; + if (false) { + if (!key.secretKey) { + throw new Error("Secret key missing"); + } + if (!data.startsWith(key.secretKey + ";") || !data.endsWith(";" + (ad ?? ""))) { + throw new Error("Additional data mismatch"); + } + return data.slice(String(key.secretKey).length + 1, data.length - 1 - (ad ?? "").length); + } + if (key.type === XSALSA20POLY1305) { + if (!key.secretKey) { + throw new Error("Secret key missing"); + } + const messageWithNonceAsUint8Array = b64ToBuf(data); + const nonce = messageWithNonceAsUint8Array.slice(0, import_tweetnacl.default.secretbox.nonceLength); + const message = messageWithNonceAsUint8Array.slice(import_tweetnacl.default.secretbox.nonceLength, messageWithNonceAsUint8Array.length); + if (ad) { + const adHash = import_tweetnacl.default.hash(strToBuf(ad)); + const len = Math.min(adHash.length, nonce.length); + for (let i = 0; i < len; i++) { + nonce[i] ^= adHash[i]; + } + } + const decrypted = import_tweetnacl.default.secretbox.open(message, nonce, key.secretKey); + if (!decrypted) { + throw new Error("Could not decrypt message"); + } + return Buffer.from(decrypted).toString("utf-8"); + } else if (key.type === CURVE25519XSALSA20POLY1305) { + if (!key.secretKey) { + throw new Error("Secret key missing"); + } + const messageWithNonceAsUint8Array = b64ToBuf(data); + const ephemeralPublicKey = messageWithNonceAsUint8Array.slice(0, import_tweetnacl.default.box.publicKeyLength); + const nonce = messageWithNonceAsUint8Array.slice(import_tweetnacl.default.box.publicKeyLength, import_tweetnacl.default.box.publicKeyLength + import_tweetnacl.default.box.nonceLength); + const message = messageWithNonceAsUint8Array.slice(import_tweetnacl.default.box.publicKeyLength + import_tweetnacl.default.box.nonceLength); + if (ad) { + const adHash = import_tweetnacl.default.hash(strToBuf(ad)); + const len = Math.min(adHash.length, nonce.length); + for (let i = 0; i < len; i++) { + nonce[i] ^= adHash[i]; + } + } + const decrypted = import_tweetnacl.default.box.open(message, nonce, ephemeralPublicKey, key.secretKey); + if (!decrypted) { + throw new Error("Could not decrypt message"); + } + return Buffer.from(decrypted).toString("utf-8"); + } + throw new Error("Unsupported algorithm"); + }; + + // shared/domains/chelonia/encryptedData.js + var import_sbp2 = __toESM(__require("@sbp/sbp")); + + // shared/domains/chelonia/signedData.js + var import_sbp = __toESM(__require("@sbp/sbp")); + var rootStateFn = () => (0, import_sbp.default)("chelonia/rootState"); + var proto = Object.create(null, { + _isSignedData: { + value: true + } + }); + var wrapper = (o) => { + return Object.setPrototypeOf(o, proto); + }; + var isSignedData = (o) => { + return !!o && !!Object.getPrototypeOf(o)?._isSignedData; + }; + var verifySignatureData = function(height, data, additionalData) { + if (!this) { + throw new ChelErrorSignatureError("Missing contract state"); + } + if (!isRawSignedData(data)) { + throw new ChelErrorSignatureError("Invalid message format"); + } + if (!Number.isSafeInteger(height) || height < 0) { + throw new ChelErrorSignatureError(`Height ${height} is invalid or out of range`); + } + const [serializedMessage, sKeyId, signature] = data._signedData; + const designatedKey = this._vm?.authorizedKeys?.[sKeyId]; + if (!designatedKey || height > designatedKey._notAfterHeight || height < designatedKey._notBeforeHeight || !designatedKey.purpose.includes("sig")) { + if ("") { + console.error(`Key ${sKeyId} is unauthorized or expired for the current contract`, { designatedKey, height, state: JSON.parse(JSON.stringify((0, import_sbp.default)("state/vuex/state"))) }); + Promise.reject(new ChelErrorSignatureKeyUnauthorized(`Key ${sKeyId} is unauthorized or expired for the current contract`)); + } + throw new ChelErrorSignatureKeyUnauthorized(`Key ${sKeyId} is unauthorized or expired for the current contract`); + } + const deserializedKey = designatedKey.data; + const payloadToSign = blake32Hash(`${blake32Hash(additionalData)}${blake32Hash(serializedMessage)}`); + try { + verifySignature(deserializedKey, payloadToSign, signature); + const message = JSON.parse(serializedMessage); + return [sKeyId, message]; + } catch (e) { + throw new ChelErrorSignatureError(e?.message || e); + } + }; + var signedIncomingData = (contractID, state, data, height, additionalData, mapperFn) => { + const stringValueFn = () => data; + let verifySignedValue; + const verifySignedValueFn = () => { + if (verifySignedValue) { + return verifySignedValue[1]; + } + verifySignedValue = verifySignatureData.call(state || rootStateFn()[contractID], height, data, additionalData); + if (mapperFn) + verifySignedValue[1] = mapperFn(verifySignedValue[1]); + return verifySignedValue[1]; + }; + return wrapper({ + get signingKeyId() { + if (verifySignedValue) + return verifySignedValue[0]; + return signedDataKeyId(data); + }, + get serialize() { + return stringValueFn; + }, + get context() { + return [contractID, data, height, additionalData]; + }, + get toString() { + return () => JSON.stringify(this.serialize()); + }, + get valueOf() { + return verifySignedValueFn; + }, + get toJSON() { + return this.serialize; + }, + get get() { + return (k) => k !== "_signedData" ? data[k] : void 0; + } + }); + }; + var signedDataKeyId = (data) => { + if (!isRawSignedData(data)) { + throw new ChelErrorSignatureError("Invalid message format"); + } + return data._signedData[1]; + }; + var isRawSignedData = (data) => { + if (!data || typeof data !== "object" || !has(data, "_signedData") || !Array.isArray(data._signedData) || data._signedData.length !== 3 || data._signedData.map((v) => typeof v).filter((v) => v !== "string").length !== 0) { + return false; + } + return true; + }; + var rawSignedIncomingData = (data) => { + if (!isRawSignedData(data)) { + throw new ChelErrorSignatureError("Invalid message format"); + } + const stringValueFn = () => data; + let verifySignedValue; + const verifySignedValueFn = () => { + if (verifySignedValue) { + return verifySignedValue[1]; + } + verifySignedValue = [data._signedData[1], JSON.parse(data._signedData[0])]; + return verifySignedValue[1]; + }; + return wrapper({ + get signingKeyId() { + if (verifySignedValue) + return verifySignedValue[0]; + return signedDataKeyId(data); + }, + get serialize() { + return stringValueFn; + }, + get toString() { + return () => JSON.stringify(this.serialize()); + }, + get valueOf() { + return verifySignedValueFn; + }, + get toJSON() { + return this.serialize; + }, + get get() { + return (k) => k !== "_signedData" ? data[k] : void 0; + } + }); + }; + + // shared/domains/chelonia/encryptedData.js + var rootStateFn2 = () => (0, import_sbp2.default)("chelonia/rootState"); + var proto2 = Object.create(null, { + _isEncryptedData: { + value: true + } + }); + var wrapper2 = (o) => { + return Object.setPrototypeOf(o, proto2); + }; + var isEncryptedData = (o) => { + return !!o && !!Object.getPrototypeOf(o)?._isEncryptedData; + }; + var decryptData = function(height, data, additionalKeys, additionalData, validatorFn) { + if (!this) { + throw new ChelErrorDecryptionError("Missing contract state"); + } + if (typeof data.valueOf === "function") + data = data.valueOf(); + if (!isRawEncryptedData(data)) { + throw new ChelErrorDecryptionError("Invalid message format"); + } + const [eKeyId, message] = data; + const key = additionalKeys[eKeyId]; + if (!key) { + throw new ChelErrorDecryptionKeyNotFound(`Key ${eKeyId} not found`); + } + const designatedKey = this._vm?.authorizedKeys?.[eKeyId]; + if (!designatedKey || height > designatedKey._notAfterHeight || height < designatedKey._notBeforeHeight || !designatedKey.purpose.includes("enc")) { + throw new ChelErrorUnexpected(`Key ${eKeyId} is unauthorized or expired for the current contract`); + } + const deserializedKey = typeof key === "string" ? deserializeKey(key) : key; + try { + const result = JSON.parse(decrypt(deserializedKey, message, additionalData)); + if (typeof validatorFn === "function") + validatorFn(result, eKeyId); + return result; + } catch (e) { + throw new ChelErrorDecryptionError(e?.message || e); + } + }; + var encryptedIncomingData = (contractID, state, data, height, additionalKeys, additionalData, validatorFn) => { + let decryptedValue; + const decryptedValueFn = () => { + if (decryptedValue) { + return decryptedValue; + } + if (!state || !additionalKeys) { + const rootState = rootStateFn2(); + state = state || rootState[contractID]; + additionalKeys = additionalKeys ?? rootState.secretKeys; + } + decryptedValue = decryptData.call(state, height, data, additionalKeys, additionalData || "", validatorFn); + if (isRawSignedData(decryptedValue)) { + decryptedValue = signedIncomingData(contractID, state, decryptedValue, height, additionalData || ""); + } + return decryptedValue; + }; + return wrapper2({ + get encryptionKeyId() { + return encryptedDataKeyId(data); + }, + get serialize() { + return () => data; + }, + get toString() { + return () => JSON.stringify(this.serialize()); + }, + get valueOf() { + return decryptedValueFn; + }, + get toJSON() { + return this.serialize; + } + }); + }; + var encryptedIncomingForeignData = (contractID, _0, data, _1, additionalKeys, additionalData, validatorFn) => { + let decryptedValue; + const decryptedValueFn = () => { + if (decryptedValue) { + return decryptedValue; + } + const rootState = rootStateFn2(); + const state = rootState[contractID]; + decryptedValue = decryptData.call(state, NaN, data, additionalKeys ?? rootState.secretKeys, additionalData || "", validatorFn); + if (isRawSignedData(decryptedValue)) { + return signedIncomingData(contractID, state, decryptedValue, NaN, additionalData || ""); + } + return decryptedValue; + }; + return wrapper2({ + get encryptionKeyId() { + return encryptedDataKeyId(data); + }, + get serialize() { + return () => data; + }, + get toString() { + return () => JSON.stringify(this.serialize()); + }, + get valueOf() { + return decryptedValueFn; + }, + get toJSON() { + return this.serialize; + } + }); + }; + var encryptedDataKeyId = (data) => { + if (!isRawEncryptedData(data)) { + throw new ChelErrorDecryptionError("Invalid message format"); + } + return data[0]; + }; + var isRawEncryptedData = (data) => { + if (!Array.isArray(data) || data.length !== 2 || data.map((v) => typeof v).filter((v) => v !== "string").length !== 0) { + return false; + } + return true; + }; + var unwrapMaybeEncryptedData = (data) => { + if (isEncryptedData(data)) { + if (false) + return; + try { + return { + encryptionKeyId: data.encryptionKeyId, + data: data.valueOf() + }; + } catch (e) { + console.warn("unwrapMaybeEncryptedData: Unable to decrypt", e); + } + } else { + return { + encryptionKeyId: null, + data + }; + } + }; + var maybeEncryptedIncomingData = (contractID, state, data, height, additionalKeys, additionalData, validatorFn) => { + if (isRawEncryptedData(data)) { + return encryptedIncomingData(contractID, state, data, height, additionalKeys, additionalData, validatorFn); + } else { + validatorFn?.(data, ""); + return data; + } + }; + + // shared/serdes/index.js + var raw = Symbol("raw"); + var serdesTagSymbol = Symbol("tag"); + var serdesSerializeSymbol = Symbol("serialize"); + var serdesDeserializeSymbol = Symbol("deserialize"); + var rawResult = (obj) => { + Object.defineProperty(obj, raw, { value: true }); + return obj; + }; + var serializer = (data) => { + const verbatim = []; + const transferables = /* @__PURE__ */ new Set(); + const revokables = /* @__PURE__ */ new Set(); + const result = JSON.parse(JSON.stringify(data, (_key, value) => { + if (value && value[raw]) + return value; + if (value === void 0) + return rawResult(["_", "_"]); + if (!value) + return value; + if (Array.isArray(value) && value[0] === "_") + return rawResult(["_", "_", ...value]); + if (value instanceof Map) { + return rawResult(["_", "Map", Array.from(value.entries())]); + } + if (value instanceof Set) { + return rawResult(["_", "Set", Array.from(value.entries())]); + } + if (value instanceof Error || value instanceof Blob || value instanceof File) { + const pos = verbatim.length; + verbatim[verbatim.length] = value; + return rawResult(["_", "_ref", pos]); + } + if (value instanceof MessagePort || value instanceof ReadableStream || value instanceof WritableStream || value instanceof ArrayBuffer) { + const pos = verbatim.length; + verbatim[verbatim.length] = value; + transferables.add(value); + return rawResult(["_", "_ref", pos]); + } + if (ArrayBuffer.isView(value)) { + const pos = verbatim.length; + verbatim[verbatim.length] = value; + transferables.add(value.buffer); + return rawResult(["_", "_ref", pos]); + } + if (typeof value === "function") { + const mc = new MessageChannel(); + mc.port1.onmessage = async (ev) => { + try { + try { + const result2 = await value(...deserializer(ev.data[1])); + const { data: data2, transferables: transferables2 } = serializer(result2); + ev.data[0].postMessage([true, data2], transferables2); + } catch (e) { + const { data: data2, transferables: transferables2 } = serializer(e); + ev.data[0].postMessage([false, data2], transferables2); + } + } catch (e) { + console.error("Async error on onmessage handler", e); + } + }; + transferables.add(mc.port2); + revokables.add(mc.port1); + return rawResult(["_", "_fn", mc.port2]); + } + const proto3 = Object.getPrototypeOf(value); + if (proto3?.constructor?.[serdesTagSymbol] && proto3.constructor[serdesSerializeSymbol]) { + return rawResult(["_", "_custom", proto3.constructor[serdesTagSymbol], proto3.constructor[serdesSerializeSymbol](value)]); + } + return value; + }), (_key, value) => { + if (Array.isArray(value) && value[0] === "_" && value[1] === "_ref") { + return verbatim[value[2]]; + } + return value; + }); + return { + data: result, + transferables: Array.from(transferables), + revokables: Array.from(revokables) + }; + }; + var deserializerTable = /* @__PURE__ */ Object.create(null); + var deserializer = (data) => { + const verbatim = []; + return JSON.parse(JSON.stringify(data, (_key, value) => { + if (value && typeof value === "object" && !Array.isArray(value) && Object.getPrototypeOf(value) !== Object.prototype) { + const pos = verbatim.length; + verbatim[verbatim.length] = value; + return rawResult(["_", "_ref", pos]); + } + return value; + }), (_key, value) => { + if (Array.isArray(value) && value[0] === "_") { + switch (value[1]) { + case "_": + if (value.length >= 3) { + return value.slice(2); + } else { + return void 0; + } + case "Map": + return new Map(value[2]); + case "Set": + return new Set(value[2]); + case "_custom": + if (deserializerTable[value[2]]) { + return deserializerTable[value[2]](value[3]); + } else { + throw new Error("Invalid or unknown tag: " + value[2]); + } + case "_ref": + return verbatim[value[2]]; + case "_fn": { + const mp = value[2]; + return (...args) => { + return new Promise((resolve, reject) => { + const mc = new MessageChannel(); + const { data: data2, transferables } = serializer(args); + mc.port1.onmessage = (ev) => { + if (ev.data[0]) { + resolve(deserializer(ev.data[1])); + } else { + reject(deserializer(ev.data[1])); + } + }; + mp.postMessage([mc.port2, data2], [mc.port2, ...transferables]); + }); + }; + } + } + } + return value; + }); + }; + deserializer.register = (y) => { + if (typeof y === "function" && typeof y[serdesTagSymbol] === "string" && typeof y[serdesDeserializeSymbol] === "function") { + deserializerTable[y[serdesTagSymbol]] = y[serdesDeserializeSymbol].bind(y); + } + }; + + // shared/domains/chelonia/GIMessage.js + var decryptedAndVerifiedDeserializedMessage = (head, headJSON, contractID, parsedMessage, additionalKeys, state) => { + const op = head.op; + const height = head.height; + const message = op === GIMessage.OP_ACTION_ENCRYPTED ? encryptedIncomingData(contractID, state, parsedMessage, height, additionalKeys, headJSON, void 0) : parsedMessage; + if ([GIMessage.OP_KEY_ADD, GIMessage.OP_KEY_UPDATE].includes(op)) { + return message.map((key) => { + return maybeEncryptedIncomingData(contractID, state, key, height, additionalKeys, headJSON, (key2, eKeyId) => { + if (key2.meta?.private?.content) { + key2.meta.private.content = encryptedIncomingData(contractID, state, key2.meta.private.content, height, additionalKeys, headJSON, (value) => { + const computedKeyId = keyId(value); + if (computedKeyId !== key2.id) { + throw new Error(`Key ID mismatch. Expected to decrypt key ID ${key2.id} but got ${computedKeyId}`); + } + }); + } + if (key2.meta?.keyRequest?.reference) { + try { + key2.meta.keyRequest.reference = maybeEncryptedIncomingData(contractID, state, key2.meta.keyRequest.reference, height, additionalKeys, headJSON)?.valueOf(); + } catch { + delete key2.meta.keyRequest.reference; + } + } + if (key2.meta?.keyRequest?.contractID) { + try { + key2.meta.keyRequest.contractID = maybeEncryptedIncomingData(contractID, state, key2.meta.keyRequest.contractID, height, additionalKeys, headJSON)?.valueOf(); + } catch { + delete key2.meta.keyRequest.contractID; + } + } + }); + }); + } + if (op === GIMessage.OP_CONTRACT) { + message.keys = message.keys?.map((key, eKeyId) => { + return maybeEncryptedIncomingData(contractID, state, key, height, additionalKeys, headJSON, (key2) => { + if (!key2.meta?.private?.content) + return; + const decryptionFn = message.foreignContractID ? encryptedIncomingForeignData : encryptedIncomingData; + const decryptionContract = message.foreignContractID ? message.foreignContractID : contractID; + key2.meta.private.content = decryptionFn(decryptionContract, state, key2.meta.private.content, height, additionalKeys, headJSON, (value) => { + const computedKeyId = keyId(value); + if (computedKeyId !== key2.id) { + throw new Error(`Key ID mismatch. Expected to decrypt key ID ${key2.id} but got ${computedKeyId}`); + } + }); + }); + }); + } + if (op === GIMessage.OP_KEY_SHARE) { + return maybeEncryptedIncomingData(contractID, state, message, height, additionalKeys, headJSON, (message2) => { + message2.keys?.forEach((key) => { + if (!key.meta?.private?.content) + return; + const decryptionFn = message2.foreignContractID ? encryptedIncomingForeignData : encryptedIncomingData; + const decryptionContract = message2.foreignContractID || contractID; + key.meta.private.content = decryptionFn(decryptionContract, state, key.meta.private.content, height, additionalKeys, headJSON, (value) => { + const computedKeyId = keyId(value); + if (computedKeyId !== key.id) { + throw new Error(`Key ID mismatch. Expected to decrypt key ID ${key.id} but got ${computedKeyId}`); + } + }); + }); + }); + } + if (op === GIMessage.OP_KEY_REQUEST) { + return maybeEncryptedIncomingData(contractID, state, message, height, additionalKeys, headJSON, (msg) => { + msg.replyWith = signedIncomingData(msg.contractID, void 0, msg.replyWith, msg.height, headJSON); + }); + } + if (op === GIMessage.OP_ACTION_UNENCRYPTED && isRawSignedData(message)) { + return signedIncomingData(contractID, state, message, height, headJSON); + } + if (op === GIMessage.OP_ACTION_ENCRYPTED) { + return message; + } + if (op === GIMessage.OP_KEY_DEL) { + return message.map((key) => { + return maybeEncryptedIncomingData(contractID, state, key, height, additionalKeys, headJSON, void 0); + }); + } + if (op === GIMessage.OP_KEY_REQUEST_SEEN) { + return maybeEncryptedIncomingData(contractID, state, parsedMessage, height, additionalKeys, headJSON, void 0); + } + if (op === GIMessage.OP_ATOMIC) { + return message.map(([opT, opV]) => [ + opT, + decryptedAndVerifiedDeserializedMessage({ ...head, op: opT }, headJSON, contractID, opV, additionalKeys, state) + ]); + } + return message; + }; + var _GIMessage = class { + _mapping; + _head; + _message; + _signedMessageData; + _direction; + _decryptedValue; + _innerSigningKeyId; + static createV1_0({ + contractID, + previousHEAD = null, + height = Number.MAX_SAFE_INTEGER, + op, + manifest + }) { + const head = { + version: "1.0.0", + previousHEAD, + height, + contractID, + op: op[0], + manifest + }; + return new this(messageToParams(head, op[1])); + } + static cloneWith(targetHead, targetOp, sources) { + const head = Object.assign({}, targetHead, sources); + return new this(messageToParams(head, targetOp[1])); + } + static deserialize(value, additionalKeys, state) { + if (!value) + throw new Error(`deserialize bad value: ${value}`); + const { head: headJSON, ...parsedValue } = JSON.parse(value); + const head = JSON.parse(headJSON); + const contractID = head.op === _GIMessage.OP_CONTRACT ? createCID(value) : head.contractID; + if (!state?._vm?.authorizedKeys && head.op === _GIMessage.OP_CONTRACT) { + const value2 = rawSignedIncomingData(parsedValue); + const authorizedKeys = Object.fromEntries(value2.valueOf()?.keys.map((k) => [k.id, k])); + state = { + _vm: { + authorizedKeys + } + }; + } + const signedMessageData = signedIncomingData(contractID, state, parsedValue, head.height, headJSON, (message) => decryptedAndVerifiedDeserializedMessage(head, headJSON, contractID, message, additionalKeys, state)); + return new this({ + direction: "incoming", + mapping: { key: createCID(value), value }, + head, + signedMessageData + }); + } + static deserializeHEAD(value) { + if (!value) + throw new Error(`deserialize bad value: ${value}`); + let head, hash; + const result = { + get head() { + if (head === void 0) { + head = JSON.parse(JSON.parse(value).head); + } + return head; + }, + get hash() { + if (!hash) { + hash = createCID(value); + } + return hash; + }, + get contractID() { + return result.head?.contractID ?? result.hash; + }, + description() { + const type = this.head.op; + return ``; + }, + get isFirstMessage() { + return !result.head?.contractID; + } + }; + return result; + } + constructor(params) { + this._direction = params.direction; + this._mapping = params.mapping; + this._head = params.head; + this._signedMessageData = params.signedMessageData; + const type = this.opType(); + let atomicTopLevel = true; + const validate = (type2, message) => { + switch (type2) { + case _GIMessage.OP_CONTRACT: + if (!this.isFirstMessage() || !atomicTopLevel) + throw new Error("OP_CONTRACT: must be first message"); + break; + case _GIMessage.OP_ATOMIC: + if (!atomicTopLevel) { + throw new Error("OP_ATOMIC not allowed inside of OP_ATOMIC"); + } + if (!Array.isArray(message)) { + throw new TypeError("OP_ATOMIC must be of an array type"); + } + atomicTopLevel = false; + message.forEach(([t, m]) => validate(t, m)); + break; + case _GIMessage.OP_KEY_ADD: + case _GIMessage.OP_KEY_DEL: + case _GIMessage.OP_KEY_UPDATE: + if (!Array.isArray(message)) + throw new TypeError("OP_KEY_{ADD|DEL|UPDATE} must be of an array type"); + break; + case _GIMessage.OP_KEY_SHARE: + case _GIMessage.OP_KEY_REQUEST: + case _GIMessage.OP_KEY_REQUEST_SEEN: + case _GIMessage.OP_ACTION_ENCRYPTED: + case _GIMessage.OP_ACTION_UNENCRYPTED: + break; + default: + throw new Error(`unsupported op: ${type2}`); + } + }; + Object.defineProperty(this, "_message", { + get: ((validated) => () => { + const message = this._signedMessageData.valueOf(); + if (!validated) { + validate(type, message); + validated = true; + } + return message; + })() + }); + } + decryptedValue() { + if (this._decryptedValue) + return this._decryptedValue; + try { + const value = this.message(); + const data = unwrapMaybeEncryptedData(value); + if (data?.data) { + if (isSignedData(data.data)) { + this._innerSigningKeyId = data.data.signingKeyId; + this._decryptedValue = data.data.valueOf(); + } else { + this._decryptedValue = data.data; + } + } + return this._decryptedValue; + } catch { + return void 0; + } + } + innerSigningKeyId() { + if (!this._decryptedValue) { + this.decryptedValue(); + } + return this._innerSigningKeyId; + } + head() { + return this._head; + } + message() { + return this._message; + } + op() { + return [this.head().op, this.message()]; + } + rawOp() { + return [this.head().op, this._signedMessageData]; + } + opType() { + return this.head().op; + } + opValue() { + return this.message(); + } + signingKeyId() { + return this._signedMessageData.signingKeyId; + } + manifest() { + return this.head().manifest; + } + description() { + const type = this.opType(); + let desc = ``; + } + isFirstMessage() { + return !this.head().contractID; + } + contractID() { + return this.head().contractID || this.hash(); + } + serialize() { + return this._mapping.value; + } + hash() { + return this._mapping.key; + } + height() { + return this._head.height; + } + id() { + throw new Error("GIMessage.id() was called but it has been removed"); + } + direction() { + return this._direction; + } + static get [serdesTagSymbol]() { + return "GIMessage"; + } + static [serdesSerializeSymbol](m) { + return [m.serialize(), m.direction(), m.decryptedValue(), m.innerSigningKeyId()]; + } + static [serdesDeserializeSymbol]([serialized, direction, decryptedValue, innerSigningKeyId]) { + const m = _GIMessage.deserialize(serialized); + m._direction = direction; + m._decryptedValue = decryptedValue; + m._innerSigningKeyId = innerSigningKeyId; + return m; + } + }; + var GIMessage = _GIMessage; + __publicField(GIMessage, "OP_CONTRACT", "c"); + __publicField(GIMessage, "OP_ACTION_ENCRYPTED", "ae"); + __publicField(GIMessage, "OP_ACTION_UNENCRYPTED", "au"); + __publicField(GIMessage, "OP_KEY_ADD", "ka"); + __publicField(GIMessage, "OP_KEY_DEL", "kd"); + __publicField(GIMessage, "OP_KEY_UPDATE", "ku"); + __publicField(GIMessage, "OP_PROTOCOL_UPGRADE", "pu"); + __publicField(GIMessage, "OP_PROP_SET", "ps"); + __publicField(GIMessage, "OP_PROP_DEL", "pd"); + __publicField(GIMessage, "OP_CONTRACT_AUTH", "ca"); + __publicField(GIMessage, "OP_CONTRACT_DEAUTH", "cd"); + __publicField(GIMessage, "OP_ATOMIC", "a"); + __publicField(GIMessage, "OP_KEY_SHARE", "ks"); + __publicField(GIMessage, "OP_KEY_REQUEST", "kr"); + __publicField(GIMessage, "OP_KEY_REQUEST_SEEN", "krs"); + function messageToParams(head, message) { + let mapping; + return { + direction: has(message, "recreate") ? "outgoing" : "incoming", + get mapping() { + if (!mapping) { + const headJSON = JSON.stringify(head); + const messageJSON = { ...message.serialize(headJSON), head: headJSON }; + const value = JSON.stringify(messageJSON); + mapping = { + key: createCID(value), + value + }; + } + return mapping; + }, + head, + signedMessageData: message + }; + } + + // shared/domains/chelonia/Secret.js + var wm = /* @__PURE__ */ new WeakMap(); + var Secret = class { + static [serdesDeserializeSymbol](secret) { + return new this(secret); + } + static [serdesSerializeSymbol](secret) { + return wm.get(secret); + } + static get [serdesTagSymbol]() { + return "__chelonia_Secret"; + } + constructor(value) { + wm.set(this, value); + } + valueOf() { + return wm.get(this); + } + }; + + // shared/domains/chelonia/constants.js + var INVITE_STATUS = { + REVOKED: "revoked", + VALID: "valid", + USED: "used" + }; + + // shared/domains/chelonia/utils.js + var MAX_EVENTS_AFTER = Number.parseInt("", 10) || Infinity; + var findKeyIdByName = (state, name) => state._vm?.authorizedKeys && Object.values(state._vm.authorizedKeys).find((k) => k.name === name && k._notAfterHeight == null)?.id; + var findForeignKeysByContractID = (state, contractID) => state._vm?.authorizedKeys && Object.values(state._vm.authorizedKeys).filter((k) => k._notAfterHeight == null && k.foreignKey?.includes(contractID)).map((k) => k.id); + + // frontend/model/contracts/shared/constants.js + var MAX_HASH_LEN = 300; + var MAX_MEMO_LEN = 4096; + var INVITE_INITIAL_CREATOR = "invite-initial-creator"; + var PROFILE_STATUS = { + ACTIVE: "active", + PENDING: "pending", + REMOVED: "removed" + }; + var GROUP_NAME_MAX_CHAR = 50; + var GROUP_DESCRIPTION_MAX_CHAR = 500; + var GROUP_PAYMENT_METHOD_MAX_CHAR = 1024; + var GROUP_NON_MONETARY_CONTRIBUTION_MAX_CHAR = 150; + var GROUP_CURRENCY_MAX_CHAR = 10; + var GROUP_MAX_PLEDGE_AMOUNT = 1e9; + var GROUP_MINCOME_MAX = 1e9; + var GROUP_DISTRIBUTION_PERIOD_MAX_DAYS = 365; + var PROPOSAL_RESULT = "proposal-result"; + var PROPOSAL_INVITE_MEMBER = "invite-member"; + var PROPOSAL_REMOVE_MEMBER = "remove-member"; + var PROPOSAL_GROUP_SETTING_CHANGE = "group-setting-change"; + var PROPOSAL_PROPOSAL_SETTING_CHANGE = "proposal-setting-change"; + var PROPOSAL_GENERIC = "generic"; + var PROPOSAL_ARCHIVED = "proposal-archived"; + var MAX_ARCHIVED_PROPOSALS = 100; + var PAYMENTS_ARCHIVED = "payments-archived"; + var MAX_ARCHIVED_PERIODS = 100; + var MAX_SAVED_PERIODS = 2; + var STATUS_OPEN = "open"; + var STATUS_PASSED = "passed"; + var STATUS_FAILED = "failed"; + var STATUS_EXPIRING = "expiring"; + var STATUS_EXPIRED = "expired"; + var STATUS_CANCELLED = "cancelled"; + var CHATROOM_GENERAL_NAME = "general"; + var CHATROOM_NAME_LIMITS_IN_CHARS = 50; + var CHATROOM_DESCRIPTION_LIMITS_IN_CHARS = 280; + var CHATROOM_TYPES = { + DIRECT_MESSAGE: "direct-message", + GROUP: "group" + }; + var CHATROOM_PRIVACY_LEVEL = { + GROUP: "group", + PRIVATE: "private", + PUBLIC: "public" + }; + var MESSAGE_TYPES = { + POLL: "poll", + TEXT: "text", + INTERACTIVE: "interactive", + NOTIFICATION: "notification" + }; + var INVITE_EXPIRES_IN_DAYS = { + ON_BOARDING: null, + PROPOSAL: 7 + }; + var MESSAGE_NOTIFICATIONS = { + ADD_MEMBER: "add-member", + JOIN_MEMBER: "join-member", + LEAVE_MEMBER: "leave-member", + KICK_MEMBER: "kick-member", + UPDATE_DESCRIPTION: "update-description", + UPDATE_NAME: "update-name" + }; + var POLL_TYPES = { + SINGLE_CHOICE: "single-vote", + MULTIPLE_CHOICES: "multiple-votes" + }; + + // frontend/model/contracts/shared/distribution/mincome-proportional.js + function mincomeProportional(haveNeeds) { + let totalHave = 0; + let totalNeed = 0; + const havers = []; + const needers = []; + for (const haveNeed of haveNeeds) { + if (haveNeed.haveNeed > 0) { + havers.push(haveNeed); + totalHave += haveNeed.haveNeed; + } else if (haveNeed.haveNeed < 0) { + needers.push(haveNeed); + totalNeed += Math.abs(haveNeed.haveNeed); + } + } + const totalPercent = Math.min(1, totalNeed / totalHave); + const payments = []; + for (const haver of havers) { + const distributionAmount = totalPercent * haver.haveNeed; + for (const needer of needers) { + const belowPercentage = Math.abs(needer.haveNeed) / totalNeed; + payments.push({ + amount: distributionAmount * belowPercentage, + fromMemberID: haver.memberID, + toMemberID: needer.memberID + }); + } + } + return payments; + } + + // frontend/model/contracts/shared/distribution/payments-minimizer.js + function minimizeTotalPaymentsCount(distribution) { + const neederTotalReceived = {}; + const haverTotalHave = {}; + const haversSorted = []; + const needersSorted = []; + const minimizedDistribution = []; + for (const todo of distribution) { + neederTotalReceived[todo.toMemberID] = (neederTotalReceived[todo.toMemberID] || 0) + todo.amount; + haverTotalHave[todo.fromMemberID] = (haverTotalHave[todo.fromMemberID] || 0) + todo.amount; + } + for (const memberID in haverTotalHave) { + haversSorted.push({ memberID, amount: haverTotalHave[memberID] }); + } + for (const memberID in neederTotalReceived) { + needersSorted.push({ memberID, amount: neederTotalReceived[memberID] }); + } + haversSorted.sort((a, b) => b.amount - a.amount); + needersSorted.sort((a, b) => b.amount - a.amount); + while (haversSorted.length > 0 && needersSorted.length > 0) { + const mostHaver = haversSorted.pop(); + const mostNeeder = needersSorted.pop(); + const diff = mostHaver.amount - mostNeeder.amount; + if (diff < 0) { + minimizedDistribution.push({ amount: mostHaver.amount, fromMemberID: mostHaver.memberID, toMemberID: mostNeeder.memberID }); + mostNeeder.amount -= mostHaver.amount; + needersSorted.push(mostNeeder); + } else if (diff > 0) { + minimizedDistribution.push({ amount: mostNeeder.amount, fromMemberID: mostHaver.memberID, toMemberID: mostNeeder.memberID }); + mostHaver.amount -= mostNeeder.amount; + haversSorted.push(mostHaver); + } else { + minimizedDistribution.push({ amount: mostNeeder.amount, fromMemberID: mostHaver.memberID, toMemberID: mostNeeder.memberID }); + } + } + return minimizedDistribution; + } + + // frontend/model/contracts/shared/currencies.js + var DECIMALS_MAX = 8; + function commaToDots(value) { + return typeof value === "string" ? value.replace(/,/, ".") : value.toString(); + } + function isNumeric(nr) { + return !isNaN(nr - parseFloat(nr)); + } + function isInDecimalsLimit(nr, decimalsMax) { + const decimals = nr.split(".")[1]; + return !decimals || decimals.length <= decimalsMax; + } + function validateMincome(value, decimalsMax) { + const nr = commaToDots(value); + return isNumeric(nr) && isInDecimalsLimit(nr, decimalsMax); + } + function decimalsOrInt(num, decimalsMax) { + return num.toFixed(decimalsMax).replace(/\.0+$/, ""); + } + function saferFloat(value) { + return parseFloat(value.toFixed(DECIMALS_MAX)); + } + function makeCurrency(options) { + const { symbol, symbolWithCode, decimalsMax, formatCurrency } = options; + return { + symbol, + symbolWithCode, + decimalsMax, + displayWithCurrency: (n) => formatCurrency(decimalsOrInt(n, decimalsMax)), + displayWithoutCurrency: (n) => decimalsOrInt(n, decimalsMax), + validate: (n) => validateMincome(n, decimalsMax) + }; + } + var currencies = { + USD: makeCurrency({ + symbol: "$", + symbolWithCode: "$ USD", + decimalsMax: 2, + formatCurrency: (amount) => "$" + amount + }), + EUR: makeCurrency({ + symbol: "\u20AC", + symbolWithCode: "\u20AC EUR", + decimalsMax: 2, + formatCurrency: (amount) => "\u20AC" + amount + }), + BTC: makeCurrency({ + symbol: "\u0243", + symbolWithCode: "\u0243 BTC", + decimalsMax: DECIMALS_MAX, + formatCurrency: (amount) => amount + "\u0243" + }) + }; + var currencies_default = currencies; + + // frontend/model/contracts/shared/distribution/distribution.js + var tinyNum = 1 / Math.pow(10, DECIMALS_MAX); + function unadjustedDistribution({ haveNeeds = [], minimize = true }) { + const distribution = mincomeProportional(haveNeeds); + return minimize ? minimizeTotalPaymentsCount(distribution) : distribution; + } + function adjustedDistribution({ distribution, payments, dueOn }) { + distribution = cloneDeep(distribution); + for (const todo of distribution) { + todo.total = todo.amount; + } + distribution = subtractDistributions(distribution, payments).filter((todo) => todo.amount >= tinyNum); + for (const todo of distribution) { + todo.amount = saferFloat(todo.amount); + todo.total = saferFloat(todo.total); + todo.partial = todo.total !== todo.amount; + todo.isLate = false; + todo.dueOn = dueOn; + } + return distribution; + } + function reduceDistribution(payments) { + payments = cloneDeep(payments); + for (let i = 0; i < payments.length; i++) { + const paymentA = payments[i]; + for (let j = i + 1; j < payments.length; j++) { + const paymentB = payments[j]; + if (paymentA.fromMemberID === paymentB.fromMemberID && paymentA.toMemberID === paymentB.toMemberID || paymentA.toMemberID === paymentB.fromMemberID && paymentA.fromMemberID === paymentB.toMemberID) { + paymentA.amount += (paymentA.fromMemberID === paymentB.fromMemberID ? 1 : -1) * paymentB.amount; + paymentA.total += (paymentA.fromMemberID === paymentB.fromMemberID ? 1 : -1) * paymentB.total; + payments.splice(j, 1); + j--; + } + } + } + return payments; + } + function addDistributions(paymentsA, paymentsB) { + return reduceDistribution([...paymentsA, ...paymentsB]); + } + function subtractDistributions(paymentsA, paymentsB) { + paymentsB = cloneDeep(paymentsB); + for (const p of paymentsB) { + p.amount *= -1; + p.total *= -1; + } + return addDistributions(paymentsA, paymentsB); + } + + // frontend/model/contracts/shared/functions.js + var import_sbp4 = __toESM(__require("@sbp/sbp")); + var import_common2 = __require("@common/common.js"); + + // frontend/model/contracts/shared/time.js + var import_common = __require("@common/common.js"); + var MINS_MILLIS = 6e4; + var HOURS_MILLIS = 60 * MINS_MILLIS; + var DAYS_MILLIS = 24 * HOURS_MILLIS; + var MONTHS_MILLIS = 30 * DAYS_MILLIS; + var YEARS_MILLIS = 365 * DAYS_MILLIS; + var plusOnePeriodLength = (timestamp, periodLength) => dateToPeriodStamp(addTimeToDate(timestamp, periodLength)); + var minusOnePeriodLength = (timestamp, periodLength) => dateToPeriodStamp(addTimeToDate(timestamp, -periodLength)); + function periodStampsForDate(date, { knownSortedStamps, periodLength, guess }) { + if (!(isIsoString(date) || Object.prototype.toString.call(date) === "[object Date]")) { + throw new TypeError("must be ISO string or Date object"); + } + const timestamp = typeof date === "string" ? date : date.toISOString(); + let previous, current, next; + if (knownSortedStamps.length) { + const latest = knownSortedStamps[knownSortedStamps.length - 1]; + const earliest = knownSortedStamps[0]; + if (timestamp >= latest) { + current = periodStampGivenDate({ recentDate: timestamp, periodStart: latest, periodLength }); + next = plusOnePeriodLength(current, periodLength); + previous = current > latest ? minusOnePeriodLength(current, periodLength) : knownSortedStamps[knownSortedStamps.length - 2]; + } else if (guess && timestamp < earliest) { + current = periodStampGivenDate({ recentDate: timestamp, periodStart: earliest, periodLength }); + next = plusOnePeriodLength(current, periodLength); + previous = minusOnePeriodLength(current, periodLength); + } else { + for (let i = knownSortedStamps.length - 2; i >= 0; i--) { + if (timestamp >= knownSortedStamps[i]) { + current = knownSortedStamps[i]; + next = knownSortedStamps[i + 1]; + previous = i > 0 ? knownSortedStamps[i - 1] : guess ? minusOnePeriodLength(current, periodLength) : void 0; + break; + } + } + } + } + return { previous, current, next }; + } + function dateToPeriodStamp(date) { + return new Date(date).toISOString(); + } + function dateFromPeriodStamp(daystamp) { + return new Date(daystamp); + } + function periodStampGivenDate({ recentDate, periodStart, periodLength }) { + const periodStartDate = dateFromPeriodStamp(periodStart); + let nextPeriod = addTimeToDate(periodStartDate, periodLength); + const curDate = new Date(recentDate); + let curPeriod; + if (curDate < nextPeriod) { + if (curDate >= periodStartDate) { + return periodStart; + } else { + curPeriod = periodStartDate; + do { + curPeriod = addTimeToDate(curPeriod, -periodLength); + } while (curDate < curPeriod); + } + } else { + do { + curPeriod = nextPeriod; + nextPeriod = addTimeToDate(nextPeriod, periodLength); + } while (curDate >= nextPeriod); + } + return dateToPeriodStamp(curPeriod); + } + function dateIsWithinPeriod({ date, periodStart, periodLength }) { + const dateObj = new Date(date); + const start = dateFromPeriodStamp(periodStart); + return dateObj > start && dateObj < addTimeToDate(start, periodLength); + } + function addTimeToDate(date, timeMillis) { + const d = new Date(date); + d.setTime(d.getTime() + timeMillis); + return d; + } + function comparePeriodStamps(periodA, periodB) { + return dateFromPeriodStamp(periodA).getTime() - dateFromPeriodStamp(periodB).getTime(); + } + function isPeriodStamp(arg) { + return isIsoString(arg); + } + function isIsoString(arg) { + return typeof arg === "string" && /\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/.test(arg); + } + + // frontend/model/contracts/shared/functions.js + function paymentHashesFromPaymentPeriod(periodPayments) { + let hashes = []; + if (periodPayments) { + const { paymentsFrom } = periodPayments; + for (const fromMemberID in paymentsFrom) { + for (const toMemberID in paymentsFrom[fromMemberID]) { + hashes = hashes.concat(paymentsFrom[fromMemberID][toMemberID]); + } + } + } + return hashes; + } + function createPaymentInfo(paymentHash, payment) { + return { + fromMemberID: payment.data.fromMemberID, + toMemberID: payment.data.toMemberID, + hash: paymentHash, + amount: payment.data.amount, + isLate: !!payment.data.isLate, + when: payment.data.completedDate + }; + } + var referenceTally = (selector) => { + const delta = { + "retain": 1, + "release": -1 + }; + return { + [selector]: (parentContractID, childContractIDs, op) => { + if (!Array.isArray(childContractIDs)) + childContractIDs = [childContractIDs]; + if (op !== "retain" && op !== "release") + throw new Error("Invalid operation"); + for (const childContractID of childContractIDs) { + const key = `${selector}-${parentContractID}-${childContractID}`; + const count = (0, import_sbp4.default)("okTurtles.data/get", key); + (0, import_sbp4.default)("okTurtles.data/set", key, (count || 0) + delta[op]); + if (count != null) + return; + (0, import_sbp4.default)("chelonia/queueInvocation", parentContractID, () => { + const count2 = (0, import_sbp4.default)("okTurtles.data/get", key); + (0, import_sbp4.default)("okTurtles.data/delete", key); + if (count2 && count2 !== Math.sign(count2)) { + console.warn(`[${selector}] Unexpected value`, parentContractID, childContractID, count2); + if ("") { + Promise.reject(new Error(`[${selector}] Unexpected value ${parentContractID} ${childContractID}: ${count2}`)); + } + } + switch (Math.sign(count2)) { + case -1: + (0, import_sbp4.default)("chelonia/contract/release", childContractID).catch((e) => { + console.error(`[${selector}] Error calling release`, parentContractID, childContractID, e); + }); + break; + case 1: + (0, import_sbp4.default)("chelonia/contract/retain", childContractID).catch((e) => console.error(`[${selector}] Error calling retain`, parentContractID, childContractID, e)); + break; + } + }).catch((e) => { + console.error(`[${selector}] Error in queued invocation`, parentContractID, childContractID, e); + }); + } + } + }; + }; + + // frontend/model/contracts/shared/payments/index.js + var PAYMENT_PENDING = "pending"; + var PAYMENT_CANCELLED = "cancelled"; + var PAYMENT_ERROR = "error"; + var PAYMENT_NOT_RECEIVED = "not-received"; + var PAYMENT_COMPLETED = "completed"; + var paymentStatusType = unionOf(...[PAYMENT_PENDING, PAYMENT_CANCELLED, PAYMENT_ERROR, PAYMENT_NOT_RECEIVED, PAYMENT_COMPLETED].map((k) => literalOf(k))); + var PAYMENT_TYPE_MANUAL = "manual"; + var PAYMENT_TYPE_BITCOIN = "bitcoin"; + var PAYMENT_TYPE_PAYPAL = "paypal"; + var paymentType = unionOf(...[PAYMENT_TYPE_MANUAL, PAYMENT_TYPE_BITCOIN, PAYMENT_TYPE_PAYPAL].map((k) => literalOf(k))); + + // frontend/model/contracts/shared/getters/group.js + var group_default = { + currentGroupOwnerID(state, getters) { + return getters.currentGroupState.groupOwnerID; + }, + groupSettingsForGroup(state, getters) { + return (state2) => state2.settings || {}; + }, + groupSettings(state, getters) { + return getters.groupSettingsForGroup(getters.currentGroupState); + }, + profileActive(state, getters) { + return (member) => { + const profiles = getters.currentGroupState.profiles; + return profiles?.[member]?.status === PROFILE_STATUS.ACTIVE; + }; + }, + pendingAccept(state, getters) { + return (member) => { + const profiles = getters.currentGroupState.profiles; + return profiles?.[member]?.status === PROFILE_STATUS.PENDING; + }; + }, + groupProfileForGroup(state, getters) { + return (state2, member) => { + const profiles = state2.profiles; + return profiles && profiles[member] && { + ...profiles[member], + get lastLoggedIn() { + return getters.currentGroupLastLoggedIn[member] || this.joinedDate; + } + }; + }; + }, + groupProfile(state, getters) { + return (member) => getters.groupProfileForGroup(getters.currentGroupState, member); + }, + groupProfilesForGroup(state, getters) { + return (state2) => { + const profiles = {}; + for (const member in state2.profiles || {}) { + const profile = getters.groupProfileForGroup(state2, member); + if (profile.status === PROFILE_STATUS.ACTIVE) { + profiles[member] = profile; + } + } + return profiles; + }; + }, + groupProfiles(state, getters) { + return getters.groupProfilesForGroup(getters.currentGroupState); + }, + groupCreatedDate(state, getters) { + return getters.groupProfile(getters.currentGroupOwnerID).joinedDate; + }, + groupMincomeAmountForGroup(state, getters) { + return (state2) => getters.groupSettingsForGroup(state2).mincomeAmount; + }, + groupMincomeAmount(state, getters) { + return getters.groupMincomeAmountForGroup(getters.currentGroupState); + }, + groupMincomeCurrency(state, getters) { + return getters.groupSettings.mincomeCurrency; + }, + groupSortedPeriodKeysForGroup(state, getters) { + return (state2) => { + const { distributionDate, distributionPeriodLength } = getters.groupSettingsForGroup(state2); + if (!distributionDate) + return []; + const keys = Object.keys(getters.groupPeriodPaymentsForGroup(state2)).sort(); + if (!keys.length && MAX_SAVED_PERIODS > 0) { + keys.push(dateToPeriodStamp(addTimeToDate(distributionDate, -distributionPeriodLength))); + } + if (keys[keys.length - 1] !== distributionDate) { + keys.push(distributionDate); + } + return keys; + }; + }, + groupSortedPeriodKeys(state, getters) { + return getters.groupSortedPeriodKeysForGroup(getters.currentGroupState); + }, + periodStampGivenDateForGroup(state, getters) { + return (state2, date, periods) => { + return periodStampsForDate(date, { + knownSortedStamps: periods || getters.groupSortedPeriodKeysForGroup(state2), + periodLength: getters.groupSettingsForGroup(state2).distributionPeriodLength + }).current; + }; + }, + periodStampGivenDate(state, getters) { + return (date, periods) => { + return getters.periodStampGivenDateForGroup(getters.currentGroupState, date, periods); + }; + }, + periodBeforePeriodForGroup(state, getters) { + return (groupState, periodStamp, periods) => { + return periodStampsForDate(periodStamp, { + knownSortedStamps: periods || getters.groupSortedPeriodKeysForGroup(groupState), + periodLength: getters.groupSettingsForGroup(groupState).distributionPeriodLength + }).previous; + }; + }, + periodBeforePeriod(state, getters) { + return (periodStamp, periods) => getters.periodBeforePeriodForGroup(getters.currentGroupState, periodStamp, periods); + }, + periodAfterPeriodForGroup(state, getters) { + return (groupState, periodStamp, periods) => { + return periodStampsForDate(periodStamp, { + knownSortedStamps: periods || getters.groupSortedPeriodKeysForGroup(groupState), + periodLength: getters.groupSettingsForGroup(groupState).distributionPeriodLength + }).next; + }; + }, + periodAfterPeriod(state, getters) { + return (periodStamp, periods) => getters.periodAfterPeriodForGroup(getters.currentGroupState, periodStamp, periods); + }, + dueDateForPeriodForGroup(state, getters) { + return (state2, periodStamp, periods) => { + return getters.periodAfterPeriodForGroup(state2, periodStamp, periods); + }; + }, + dueDateForPeriod(state, getters) { + return (periodStamp, periods) => { + return getters.dueDateForPeriodForGroup(getters.currentGroupState, periodStamp, periods); + }; + }, + paymentHashesForPeriodForGroup(state, getters) { + return (state2, periodStamp) => { + const periodPayments = getters.groupPeriodPaymentsForGroup(state2)[periodStamp]; + if (periodPayments) { + return paymentHashesFromPaymentPeriod(periodPayments); + } + }; + }, + paymentHashesForPeriod(state, getters) { + return (periodStamp) => { + return getters.paymentHashesForPeriodForGroup(getters.currentGroupState, periodStamp); + }; + }, + groupMembersByContractID(state, getters) { + return Object.keys(getters.groupProfiles); + }, + groupMembersCount(state, getters) { + return getters.groupMembersByContractID.length; + }, + groupMembersPending(state, getters) { + const invites = getters.currentGroupState.invites; + const vmInvites = getters.currentGroupState._vm.invites; + const pendingMembers = /* @__PURE__ */ Object.create(null); + for (const inviteKeyId in invites) { + if (vmInvites[inviteKeyId].status === INVITE_STATUS.VALID && invites[inviteKeyId].creatorID !== INVITE_INITIAL_CREATOR) { + pendingMembers[inviteKeyId] = { + displayName: invites[inviteKeyId].invitee, + invitedBy: invites[inviteKeyId].creatorID, + expires: vmInvites[inviteKeyId].expires + }; + } + } + return pendingMembers; + }, + groupShouldPropose(state, getters) { + return getters.groupMembersCount >= 3; + }, + groupDistributionStarted(state, getters) { + return (currentDate) => currentDate >= getters.groupSettings?.distributionDate; + }, + groupProposalSettings(state, getters) { + return (proposalType2 = PROPOSAL_GENERIC) => { + return getters.groupSettings.proposals?.[proposalType2]; + }; + }, + groupCurrency(state, getters) { + const mincomeCurrency = getters.groupMincomeCurrency; + return mincomeCurrency && currencies_default[mincomeCurrency]; + }, + groupMincomeFormatted(state, getters) { + return getters.withGroupCurrency?.(getters.groupMincomeAmount); + }, + groupMincomeSymbolWithCode(state, getters) { + return getters.groupCurrency?.symbolWithCode; + }, + groupPeriodPaymentsForGroup(state, getters) { + return (state2) => { + return state2.paymentsByPeriod || {}; + }; + }, + groupPeriodPayments(state, getters) { + return getters.groupPeriodPaymentsForGroup(getters.currentGroupState); + }, + groupThankYousFrom(state, getters) { + return getters.currentGroupState.thankYousFrom || {}; + }, + groupStreaks(state, getters) { + return getters.currentGroupState.streaks || {}; + }, + groupTotalPledgeAmount(state, getters) { + return getters.currentGroupState.totalPledgeAmount || 0; + }, + withGroupCurrency(state, getters) { + return getters.groupCurrency?.displayWithCurrency; + }, + groupChatRooms(state, getters) { + return getters.currentGroupState.chatRooms; + }, + groupGeneralChatRoomId(state, getters) { + return getters.currentGroupState.generalChatRoomId; + }, + haveNeedsForThisPeriodForGroup(state, getters) { + return (state2, currentPeriod) => { + const groupProfiles = getters.groupProfilesForGroup(state2); + const haveNeeds = []; + for (const memberID in groupProfiles) { + const { incomeDetailsType, joinedDate } = groupProfiles[memberID]; + if (incomeDetailsType) { + const amount = groupProfiles[memberID][incomeDetailsType]; + const haveNeed = incomeDetailsType === "incomeAmount" ? amount - getters.groupMincomeAmountForGroup(state2) : amount; + let when = dateFromPeriodStamp(currentPeriod).toISOString(); + if (dateIsWithinPeriod({ + date: joinedDate, + periodStart: currentPeriod, + periodLength: getters.groupSettingsForGroup(state2).distributionPeriodLength + })) { + when = joinedDate; + } + haveNeeds.push({ memberID, haveNeed, when }); + } + } + return haveNeeds; + }; + }, + haveNeedsForThisPeriod(state, getters) { + return (currentPeriod) => { + return getters.haveNeedsForThisPeriodForGroup(getters.currentGroupState, currentPeriod); + }; + }, + paymentsForPeriodForGroup(state, getters) { + return (state2, periodStamp) => { + const hashes = getters.paymentHashesForPeriodForGroup(state2, periodStamp); + const events = []; + if (hashes && hashes.length > 0) { + const payments = state2.payments; + for (const paymentHash of hashes) { + const payment = payments[paymentHash]; + if (payment.data.status === PAYMENT_COMPLETED) { + events.push(createPaymentInfo(paymentHash, payment)); + } + } + } + return events; + }; + }, + paymentsForPeriod(state, getters) { + return (periodStamp) => { + return getters.paymentsForPeriodForGroup(getters.currentGroupState, periodStamp); + }; + } + }; + + // frontend/model/contracts/shared/types.js + var inviteType = objectOf({ + inviteKeyId: string, + creatorID: string, + invitee: optional(string) + }); + var chatRoomAttributesType = objectOf({ + name: stringMax(CHATROOM_NAME_LIMITS_IN_CHARS), + description: stringMax(CHATROOM_DESCRIPTION_LIMITS_IN_CHARS), + creatorID: optional(string), + adminIDs: optional(arrayOf(string)), + type: unionOf(...Object.values(CHATROOM_TYPES).map((v) => literalOf(v))), + privacyLevel: unionOf(...Object.values(CHATROOM_PRIVACY_LEVEL).map((v) => literalOf(v))) + }); + var messageType = objectMaybeOf({ + type: unionOf(...Object.values(MESSAGE_TYPES).map((v) => literalOf(v))), + text: string, + proposal: objectOf({ + proposalId: string, + proposalType: string, + proposalData: object, + expires_date_ms: number, + createdDate: string, + creatorID: string, + status: unionOf(...[ + STATUS_OPEN, + STATUS_PASSED, + STATUS_FAILED, + STATUS_EXPIRING, + STATUS_EXPIRED, + STATUS_CANCELLED + ].map((v) => literalOf(v))) + }), + notification: objectMaybeOf({ + type: unionOf(...Object.values(MESSAGE_NOTIFICATIONS).map((v) => literalOf(v))), + params: mapOf(string, string) + }), + attachments: optional(arrayOf(objectOf({ + name: string, + mimeType: string, + size: numberRange(1, Number.MAX_SAFE_INTEGER), + dimension: optional(objectOf({ + width: number, + height: number + })), + downloadData: objectOf({ + manifestCid: string, + downloadParams: optional(object) + }) + }))), + replyingMessage: objectOf({ + hash: string, + text: string + }), + pollData: objectOf({ + question: string, + options: arrayOf(objectOf({ id: string, value: string })), + expires_date_ms: number, + hideVoters: boolean, + pollType: unionOf(...Object.values(POLL_TYPES).map((v) => literalOf(v))) + }), + onlyVisibleTo: arrayOf(string) + }); + + // frontend/model/contracts/shared/voting/proposals.js + var import_sbp5 = __toESM(__require("@sbp/sbp")); + + // frontend/model/contracts/shared/voting/rules.js + var VOTE_AGAINST = ":against"; + var VOTE_INDIFFERENT = ":indifferent"; + var VOTE_UNDECIDED = ":undecided"; + var VOTE_FOR = ":for"; + var RULE_PERCENTAGE = "percentage"; + var RULE_DISAGREEMENT = "disagreement"; + var RULE_MULTI_CHOICE = "multi-choice"; + var getPopulation = (state) => Object.keys(state.profiles).filter((p) => state.profiles[p].status === PROFILE_STATUS.ACTIVE).length; + var rules = { + [RULE_PERCENTAGE]: function(state, proposalType2, votes) { + votes = Object.values(votes); + let population = getPopulation(state); + if (proposalType2 === PROPOSAL_REMOVE_MEMBER) + population -= 1; + const defaultThreshold = state.settings.proposals[proposalType2].ruleSettings[RULE_PERCENTAGE].threshold; + const threshold = getThresholdAdjusted(RULE_PERCENTAGE, defaultThreshold, population); + const totalIndifferent = votes.filter((x) => x === VOTE_INDIFFERENT).length; + const totalFor = votes.filter((x) => x === VOTE_FOR).length; + const totalAgainst = votes.filter((x) => x === VOTE_AGAINST).length; + const totalForOrAgainst = totalFor + totalAgainst; + const turnout = totalForOrAgainst + totalIndifferent; + const absent = population - turnout; + const neededToPass = Math.ceil(threshold * (population - totalIndifferent)); + console.debug(`votingRule ${RULE_PERCENTAGE} for ${proposalType2}:`, { neededToPass, totalFor, totalAgainst, totalIndifferent, threshold, absent, turnout, population }); + if (totalFor >= neededToPass) { + return VOTE_FOR; + } + return totalFor + absent < neededToPass ? VOTE_AGAINST : VOTE_UNDECIDED; + }, + [RULE_DISAGREEMENT]: function(state, proposalType2, votes) { + votes = Object.values(votes); + const population = getPopulation(state); + const minimumMax = proposalType2 === PROPOSAL_REMOVE_MEMBER ? 2 : 1; + const thresholdOriginal = Math.max(state.settings.proposals[proposalType2].ruleSettings[RULE_DISAGREEMENT].threshold, minimumMax); + const threshold = getThresholdAdjusted(RULE_DISAGREEMENT, thresholdOriginal, population); + const totalFor = votes.filter((x) => x === VOTE_FOR).length; + const totalAgainst = votes.filter((x) => x === VOTE_AGAINST).length; + const turnout = votes.length; + const absent = population - turnout; + console.debug(`votingRule ${RULE_DISAGREEMENT} for ${proposalType2}:`, { totalFor, totalAgainst, threshold, turnout, population, absent }); + if (totalAgainst >= threshold) { + return VOTE_AGAINST; + } + return totalAgainst + absent < threshold ? VOTE_FOR : VOTE_UNDECIDED; + }, + [RULE_MULTI_CHOICE]: function(state, proposalType2, votes) { + throw new Error("unimplemented!"); + } + }; + var rules_default = rules; + var ruleType = unionOf(...Object.keys(rules).map((k) => literalOf(k))); + var voteType = unionOf(...[VOTE_AGAINST, VOTE_INDIFFERENT, VOTE_UNDECIDED, VOTE_FOR].map((v) => literalOf(v))); + var getThresholdAdjusted = (rule, threshold, groupSize) => { + const groupSizeVoting = Math.max(3, groupSize); + return { + [RULE_DISAGREEMENT]: () => { + return Math.min(groupSizeVoting - 1, threshold); + }, + [RULE_PERCENTAGE]: () => { + const minThreshold = 2 / groupSizeVoting; + return Math.max(minThreshold, threshold); + } + }[rule](); + }; + + // frontend/model/contracts/shared/voting/proposals.js + function notifyAndArchiveProposal({ state, proposalHash, proposal, contractID, meta, height }) { + delete state.proposals[proposalHash]; + (0, import_sbp5.default)("gi.contracts/group/pushSideEffect", contractID, ["gi.contracts/group/makeNotificationWhenProposalClosed", state, contractID, meta, height, proposalHash, proposal]); + (0, import_sbp5.default)("gi.contracts/group/pushSideEffect", contractID, ["gi.contracts/group/archiveProposal", contractID, proposalHash, proposal]); + } + var proposalSettingsType = objectOf({ + rule: ruleType, + expires_ms: number, + ruleSettings: objectOf({ + [RULE_PERCENTAGE]: objectOf({ threshold: number }), + [RULE_DISAGREEMENT]: objectOf({ threshold: number }) + }) + }); + function voteAgainst(state, { meta, data, contractID, height }) { + const { proposalHash } = data; + const proposal = state.proposals[proposalHash]; + proposal.status = STATUS_FAILED; + (0, import_sbp5.default)("okTurtles.events/emit", PROPOSAL_RESULT, state, VOTE_AGAINST, data); + notifyAndArchiveProposal({ state, proposalHash, proposal, contractID, meta, height }); + } + var proposalDefaults = { + rule: RULE_PERCENTAGE, + expires_ms: 14 * DAYS_MILLIS, + ruleSettings: { + [RULE_PERCENTAGE]: { threshold: 0.66 }, + [RULE_DISAGREEMENT]: { threshold: 1 } + } + }; + var proposals = { + [PROPOSAL_INVITE_MEMBER]: { + defaults: proposalDefaults, + [VOTE_FOR]: async function(state, message) { + const { data, contractID, meta, height } = message; + const { proposalHash } = data; + const proposal = state.proposals[proposalHash]; + proposal.payload = data.passPayload; + proposal.status = STATUS_PASSED; + const forMessage = { ...message, data: data.passPayload }; + await (0, import_sbp5.default)("gi.contracts/group/invite/process", forMessage, state); + (0, import_sbp5.default)("okTurtles.events/emit", PROPOSAL_RESULT, state, VOTE_FOR, data); + notifyAndArchiveProposal({ state, proposalHash, proposal, contractID, meta, height }); + }, + [VOTE_AGAINST]: voteAgainst + }, + [PROPOSAL_REMOVE_MEMBER]: { + defaults: proposalDefaults, + [VOTE_FOR]: async function(state, message) { + const { data, contractID, meta, height } = message; + const { proposalHash, passPayload } = data; + const proposal = state.proposals[proposalHash]; + proposal.status = STATUS_PASSED; + proposal.payload = passPayload; + const messageData = proposal.data.proposalData; + const forMessage = { ...message, data: messageData, proposalHash }; + await (0, import_sbp5.default)("gi.contracts/group/removeMember/process", forMessage, state); + (0, import_sbp5.default)("gi.contracts/group/pushSideEffect", contractID, ["gi.contracts/group/removeMember/sideEffect", forMessage]); + notifyAndArchiveProposal({ state, proposalHash, proposal, contractID, meta, height }); + }, + [VOTE_AGAINST]: voteAgainst + }, + [PROPOSAL_GROUP_SETTING_CHANGE]: { + defaults: proposalDefaults, + [VOTE_FOR]: async function(state, message) { + const { data, contractID, meta, height } = message; + const { proposalHash } = data; + const proposal = state.proposals[proposalHash]; + proposal.status = STATUS_PASSED; + const { setting, proposedValue } = proposal.data.proposalData; + const forMessage = { + ...message, + data: { [setting]: proposedValue }, + proposalHash + }; + await (0, import_sbp5.default)("gi.contracts/group/updateSettings/process", forMessage, state); + (0, import_sbp5.default)("gi.contracts/group/pushSideEffect", contractID, ["gi.contracts/group/updateSettings/sideEffect", forMessage]); + notifyAndArchiveProposal({ state, proposalHash, proposal, contractID, meta, height }); + }, + [VOTE_AGAINST]: voteAgainst + }, + [PROPOSAL_PROPOSAL_SETTING_CHANGE]: { + defaults: proposalDefaults, + [VOTE_FOR]: async function(state, message) { + const { data, contractID, meta, height } = message; + const { proposalHash } = data; + const proposal = state.proposals[proposalHash]; + proposal.status = STATUS_PASSED; + const forMessage = { + ...message, + data: proposal.data.proposalData, + proposalHash + }; + await (0, import_sbp5.default)("gi.contracts/group/updateAllVotingRules/process", forMessage, state); + notifyAndArchiveProposal({ state, proposalHash, proposal, contractID, meta, height }); + }, + [VOTE_AGAINST]: voteAgainst + }, + [PROPOSAL_GENERIC]: { + defaults: proposalDefaults, + [VOTE_FOR]: function(state, { data, contractID, meta, height }) { + const { proposalHash } = data; + const proposal = state.proposals[proposalHash]; + proposal.status = STATUS_PASSED; + (0, import_sbp5.default)("okTurtles.events/emit", PROPOSAL_RESULT, state, VOTE_FOR, data); + notifyAndArchiveProposal({ state, proposalHash, proposal, contractID, meta, height }); + }, + [VOTE_AGAINST]: voteAgainst + } + }; + var proposals_default = proposals; + var proposalType = unionOf(...Object.keys(proposals).map((k) => literalOf(k))); + + // frontend/model/contracts/group.js + function fetchInitKV(obj, key, initialValue) { + let value = obj[key]; + if (!value) { + obj[key] = initialValue; + value = obj[key]; + } + return value; + } + function initGroupProfile(joinedDate, joinedHeight, reference) { + return { + globalUsername: "", + joinedDate, + joinedHeight, + reference, + nonMonetaryContributions: [], + status: PROFILE_STATUS.ACTIVE, + departedDate: null, + incomeDetailsLastUpdatedDate: null + }; + } + function initPaymentPeriod({ meta, getters }) { + const start = getters.periodStampGivenDate(meta.createdDate); + return { + start, + end: plusOnePeriodLength(start, getters.groupSettings.distributionPeriodLength), + initialCurrency: getters.groupMincomeCurrency, + mincomeExchangeRate: 1, + paymentsFrom: {}, + lastAdjustedDistribution: null, + haveNeedsSnapshot: null + }; + } + function clearOldPayments({ contractID, state, getters }) { + const sortedPeriodKeys = Object.keys(state.paymentsByPeriod).sort(); + const archivingPayments = { paymentsByPeriod: {}, payments: {} }; + while (sortedPeriodKeys.length > MAX_SAVED_PERIODS) { + const period = sortedPeriodKeys.shift(); + archivingPayments.paymentsByPeriod[period] = cloneDeep(state.paymentsByPeriod[period]); + for (const paymentHash of getters.paymentHashesForPeriod(period)) { + archivingPayments.payments[paymentHash] = cloneDeep(state.payments[paymentHash]); + delete state.payments[paymentHash]; + } + delete state.paymentsByPeriod[period]; + } + delete archivingPayments.paymentsByPeriod[state.waitingPeriod]; + (0, import_sbp6.default)("gi.contracts/group/pushSideEffect", contractID, ["gi.contracts/group/archivePayments", contractID, archivingPayments]); + } + function initFetchPeriodPayments({ contractID, meta, state, getters }) { + const period = getters.periodStampGivenDate(meta.createdDate); + const periodPayments = fetchInitKV(state.paymentsByPeriod, period, initPaymentPeriod({ meta, getters })); + const previousPeriod = getters.periodBeforePeriod(period); + if (previousPeriod in state.paymentsByPeriod) { + state.paymentsByPeriod[previousPeriod].end = period; + } + clearOldPayments({ contractID, state, getters }); + return periodPayments; + } + function initGroupStreaks() { + return { + lastStreakPeriod: null, + fullMonthlyPledges: 0, + fullMonthlySupport: 0, + onTimePayments: {}, + missedPayments: {}, + noVotes: {} + }; + } + function updateCurrentDistribution({ contractID, meta, state, getters }) { + const curPeriodPayments = initFetchPeriodPayments({ contractID, meta, state, getters }); + const period = getters.periodStampGivenDate(meta.createdDate); + const noPayments = Object.keys(curPeriodPayments.paymentsFrom).length === 0; + if (comparePeriodStamps(period, getters.groupSettings.distributionDate) > 0) { + updateGroupStreaks({ state, getters }); + getters.groupSettings.distributionDate = period; + } + if (noPayments || !curPeriodPayments.haveNeedsSnapshot) { + curPeriodPayments.haveNeedsSnapshot = getters.haveNeedsForThisPeriod(period); + } + if (!noPayments) { + updateAdjustedDistribution({ period, getters }); + } + } + function updateAdjustedDistribution({ period, getters }) { + const payments = getters.groupPeriodPayments[period]; + if (payments && payments.haveNeedsSnapshot) { + const minimize = getters.groupSettings.minimizeDistribution; + payments.lastAdjustedDistribution = adjustedDistribution({ + distribution: unadjustedDistribution({ haveNeeds: payments.haveNeedsSnapshot, minimize }), + payments: getters.paymentsForPeriod(period), + dueOn: getters.dueDateForPeriod(period) + }).filter((todo) => { + return getters.groupProfile(todo.toMemberID).status === PROFILE_STATUS.ACTIVE; + }); + } + } + function memberLeaves({ memberID, dateLeft, heightLeft, ourselvesLeaving }, { contractID, meta, state, getters }) { + if (!state.profiles[memberID] || state.profiles[memberID].status !== PROFILE_STATUS.ACTIVE) { + throw new Error(`[gi.contracts/group memberLeaves] Can't remove non-exisiting member ${memberID}`); + } + state.profiles[memberID].status = PROFILE_STATUS.REMOVED; + state.profiles[memberID].departedDate = dateLeft; + state.profiles[memberID].departedHeight = heightLeft; + updateCurrentDistribution({ contractID, meta, state, getters }); + Object.keys(state.chatRooms).forEach((chatroomID) => { + removeGroupChatroomProfile(state, chatroomID, memberID, ourselvesLeaving); + }); + if (!state._volatile) + state["_volatile"] = /* @__PURE__ */ Object.create(null); + if (!state._volatile.pendingKeyRevocations) + state._volatile["pendingKeyRevocations"] = /* @__PURE__ */ Object.create(null); + const CSKid = findKeyIdByName(state, "csk"); + const CEKid = findKeyIdByName(state, "cek"); + state._volatile.pendingKeyRevocations[CSKid] = true; + state._volatile.pendingKeyRevocations[CEKid] = true; + } + function isActionNewerThanUserJoinedDate(height, userProfile) { + if (!userProfile) { + return false; + } + return userProfile.status === PROFILE_STATUS.ACTIVE && userProfile.joinedHeight < height; + } + function updateGroupStreaks({ state, getters }) { + const streaks = fetchInitKV(state, "streaks", initGroupStreaks()); + const cPeriod = getters.groupSettings.distributionDate; + const thisPeriodPayments = getters.groupPeriodPayments[cPeriod]; + const noPaymentsAtAll = !thisPeriodPayments; + if (streaks.lastStreakPeriod === cPeriod) + return; + else { + streaks["lastStreakPeriod"] = cPeriod; + } + const thisPeriodDistribution = thisPeriodPayments?.lastAdjustedDistribution || adjustedDistribution({ + distribution: unadjustedDistribution({ + haveNeeds: getters.haveNeedsForThisPeriod(cPeriod), + minimize: getters.groupSettings.minimizeDistribution + }) || [], + payments: getters.paymentsForPeriod(cPeriod), + dueOn: getters.dueDateForPeriod(cPeriod) + }).filter((todo) => { + return getters.groupProfile(todo.toMemberID).status === PROFILE_STATUS.ACTIVE; + }); + streaks["fullMonthlyPledges"] = noPaymentsAtAll ? 0 : thisPeriodDistribution.length === 0 ? streaks.fullMonthlyPledges + 1 : 0; + const thisPeriodPaymentDetails = getters.paymentsForPeriod(cPeriod); + const thisPeriodHaveNeeds = thisPeriodPayments?.haveNeedsSnapshot || getters.haveNeedsForThisPeriod(cPeriod); + const filterMyItems = (array, member) => array.filter((item) => item.fromMemberID === member); + const isPledgingMember = (member) => thisPeriodHaveNeeds.some((entry) => entry.memberID === member && entry.haveNeed > 0); + const totalContributionGoal = thisPeriodHaveNeeds.reduce((total, item) => item.haveNeed < 0 ? total + -1 * item.haveNeed : total, 0); + const totalPledgesDone = thisPeriodPaymentDetails.reduce((total, paymentItem) => paymentItem.amount + total, 0); + const fullMonthlySupportCurrent = fetchInitKV(streaks, "fullMonthlySupport", 0); + streaks["fullMonthlySupport"] = totalPledgesDone > 0 && totalPledgesDone >= totalContributionGoal ? fullMonthlySupportCurrent + 1 : 0; + for (const memberID in getters.groupProfiles) { + if (!isPledgingMember(memberID)) + continue; + const myMissedPaymentsInThisPeriod = filterMyItems(thisPeriodDistribution, memberID); + const userCurrentStreak = fetchInitKV(streaks.onTimePayments, memberID, 0); + streaks.onTimePayments[memberID] = noPaymentsAtAll ? 0 : myMissedPaymentsInThisPeriod.length === 0 && filterMyItems(thisPeriodPaymentDetails, memberID).every((p) => p.isLate === false) ? userCurrentStreak + 1 : 0; + const myMissedPaymentsStreak = fetchInitKV(streaks.missedPayments, memberID, 0); + streaks.missedPayments[memberID] = noPaymentsAtAll ? myMissedPaymentsStreak + 1 : myMissedPaymentsInThisPeriod.length >= 1 ? myMissedPaymentsStreak + 1 : 0; + } + } + var removeGroupChatroomProfile = (state, chatRoomID, memberID, ourselvesLeaving) => { + if (!state.chatRooms[chatRoomID].members[memberID]) + return; + state.chatRooms[chatRoomID].members[memberID].status = PROFILE_STATUS.REMOVED; + }; + var leaveChatRoomAction = async (groupID, state, chatRoomID, memberID, actorID, leavingGroup) => { + const sendingData = leavingGroup || actorID !== memberID ? { memberID } : {}; + if (state?.chatRooms?.[chatRoomID]?.members?.[memberID]?.status !== PROFILE_STATUS.REMOVED) { + return; + } + const extraParams = {}; + if (leavingGroup) { + const encryptionKeyId = await (0, import_sbp6.default)("chelonia/contract/currentKeyIdByName", state, "cek", true); + const signingKeyId = await (0, import_sbp6.default)("chelonia/contract/currentKeyIdByName", state, "csk", true); + if (!signingKeyId) { + return; + } + extraParams.encryptionKeyId = encryptionKeyId; + extraParams.signingKeyId = signingKeyId; + extraParams.innerSigningContractID = null; + } + (0, import_sbp6.default)("gi.actions/chatroom/leave", { + contractID: chatRoomID, + data: sendingData, + ...extraParams + }).catch((e) => { + if (leavingGroup && (e?.name === "ChelErrorSignatureKeyNotFound" || e?.name === "GIErrorUIRuntimeError" && (["ChelErrorSignatureKeyNotFound", "GIErrorMissingSigningKeyError"].includes(e?.cause?.name) || e?.cause?.name === "GIChatroomNotMemberError"))) { + return; + } + console.warn("[gi.contracts/group] Error sending chatroom leave action", e); + }); + }; + var leaveAllChatRoomsUponLeaving = (groupID, state, memberID, actorID) => { + const chatRooms = state.chatRooms; + return Promise.all(Object.keys(chatRooms).filter((cID) => chatRooms[cID].members?.[memberID]?.status === PROFILE_STATUS.REMOVED).map((chatRoomID) => leaveChatRoomAction(groupID, state, chatRoomID, memberID, actorID, true))); + }; + var actionRequireActiveMember = (next) => (data, props) => { + const innerSigningContractID = props.message.innerSigningContractID; + if (!innerSigningContractID || innerSigningContractID === props.contractID) { + throw new Error("Missing inner signature"); + } + return next(data, props); + }; + var GIGroupAlreadyJoinedError = ChelErrorGenerator("GIGroupAlreadyJoinedError"); + var GIGroupNotJoinedError = ChelErrorGenerator("GIGroupNotJoinedError"); + (0, import_sbp6.default)("chelonia/defineContract", { + name: "gi.contracts/group", + metadata: { + validate: objectOf({ + createdDate: string + }), + async create() { + return { + createdDate: await fetchServerTime() + }; + } + }, + getters: { + currentGroupState(state) { + return state; + }, + currentGroupLastLoggedIn() { + return {}; + }, + ...group_default + }, + actions: { + "gi.contracts/group": { + validate: objectMaybeOf({ + settings: objectMaybeOf({ + groupName: stringMax(GROUP_NAME_MAX_CHAR, "groupName"), + groupPicture: unionOf(string, objectOf({ + manifestCid: stringMax(MAX_HASH_LEN, "manifestCid"), + downloadParams: optional(object) + })), + sharedValues: stringMax(GROUP_DESCRIPTION_MAX_CHAR, "sharedValues"), + mincomeAmount: numberRange(1, GROUP_MINCOME_MAX), + mincomeCurrency: stringMax(GROUP_CURRENCY_MAX_CHAR, "mincomeCurrency"), + distributionDate: validatorFrom(isPeriodStamp), + distributionPeriodLength: numberRange(1 * DAYS_MILLIS, GROUP_DISTRIBUTION_PERIOD_MAX_DAYS * DAYS_MILLIS), + minimizeDistribution: boolean, + proposals: objectOf({ + [PROPOSAL_INVITE_MEMBER]: proposalSettingsType, + [PROPOSAL_REMOVE_MEMBER]: proposalSettingsType, + [PROPOSAL_GROUP_SETTING_CHANGE]: proposalSettingsType, + [PROPOSAL_PROPOSAL_SETTING_CHANGE]: proposalSettingsType, + [PROPOSAL_GENERIC]: proposalSettingsType + }) + }) + }), + process({ data, meta, contractID }, { state, getters }) { + const initialState = merge({ + payments: {}, + paymentsByPeriod: {}, + thankYousFrom: {}, + invites: {}, + proposals: {}, + settings: { + distributionPeriodLength: 30 * DAYS_MILLIS, + inviteExpiryOnboarding: INVITE_EXPIRES_IN_DAYS.ON_BOARDING, + inviteExpiryProposal: INVITE_EXPIRES_IN_DAYS.PROPOSAL, + allowPublicChannels: false + }, + streaks: initGroupStreaks(), + profiles: {}, + chatRooms: {}, + totalPledgeAmount: 0 + }, data); + for (const key in initialState) { + state[key] = initialState[key]; + } + initFetchPeriodPayments({ contractID, meta, state, getters }); + state.waitingPeriod = getters.periodStampGivenDate(meta.createdDate); + }, + sideEffect({ contractID }, { state }) { + if (!state.generalChatRoomId) { + (0, import_sbp6.default)("chelonia/queueInvocation", contractID, async () => { + const state2 = await (0, import_sbp6.default)("chelonia/contract/state", contractID); + if (!state2 || state2.generalChatRoomId) + return; + const CSKid = findKeyIdByName(state2, "csk"); + const CEKid = findKeyIdByName(state2, "cek"); + (0, import_sbp6.default)("gi.actions/group/addChatRoom", { + contractID, + data: { + attributes: { + name: CHATROOM_GENERAL_NAME, + type: CHATROOM_TYPES.GROUP, + description: "", + privacyLevel: CHATROOM_PRIVACY_LEVEL.GROUP + } + }, + signingKeyId: CSKid, + encryptionKeyId: CEKid, + innerSigningContractID: null + }).catch((e) => { + console.error(`[gi.contracts/group/sideEffect] Error creating #General chatroom for ${contractID} (unable to send action)`, e); + }); + }).catch((e) => { + console.error(`[gi.contracts/group/sideEffect] Error creating #General chatroom for ${contractID}`, e); + }); + } + } + }, + "gi.contracts/group/payment": { + validate: actionRequireActiveMember(objectMaybeOf({ + toMemberID: stringMax(MAX_HASH_LEN, "toMemberID"), + amount: numberRange(0, GROUP_MINCOME_MAX), + currencyFromTo: tupleOf(string, string), + exchangeRate: numberRange(0, GROUP_MINCOME_MAX), + txid: stringMax(MAX_HASH_LEN, "txid"), + status: paymentStatusType, + paymentType, + details: optional(object), + memo: optional(stringMax(MAX_MEMO_LEN, "memo")) + })), + process({ data, meta, hash, contractID, height, innerSigningContractID }, { state, getters }) { + if (data.status === PAYMENT_COMPLETED) { + console.error(`payment: payment ${hash} cannot have status = 'completed'!`, { data, meta, hash }); + throw new import_common3.Errors.GIErrorIgnoreAndBan("payments cannot be instantly completed!"); + } + state.payments[hash] = { + data: { + ...data, + fromMemberID: innerSigningContractID, + groupMincome: getters.groupMincomeAmount + }, + height, + meta, + history: [[meta.createdDate, hash]] + }; + const { paymentsFrom } = initFetchPeriodPayments({ contractID, meta, state, getters }); + const fromMemberID = fetchInitKV(paymentsFrom, innerSigningContractID, {}); + const toMemberID = fetchInitKV(fromMemberID, data.toMemberID, []); + toMemberID.push(hash); + } + }, + "gi.contracts/group/paymentUpdate": { + validate: actionRequireActiveMember(objectMaybeOf({ + paymentHash: stringMax(MAX_HASH_LEN, "paymentHash"), + updatedProperties: objectMaybeOf({ + status: paymentStatusType, + details: object, + memo: stringMax(MAX_MEMO_LEN, "memo") + }) + })), + process({ data, meta, hash, contractID, innerSigningContractID }, { state, getters }) { + const payment = state.payments[data.paymentHash]; + if (!payment) { + console.error(`paymentUpdate: no payment ${data.paymentHash}`, { data, meta, hash }); + throw new import_common3.Errors.GIErrorIgnoreAndBan("paymentUpdate without existing payment"); + } + if (innerSigningContractID !== payment.data.fromMemberID && innerSigningContractID !== payment.data.toMemberID) { + console.error(`paymentUpdate: bad member ${innerSigningContractID} != ${payment.data.fromMemberID} != ${payment.data.toMemberID}`, { data, meta, hash }); + throw new import_common3.Errors.GIErrorIgnoreAndBan("paymentUpdate from bad user!"); + } + payment.history.push([meta.createdDate, hash]); + merge(payment.data, data.updatedProperties); + if (data.updatedProperties.status === PAYMENT_COMPLETED) { + payment.data.completedDate = meta.createdDate; + const updatePeriodStamp = getters.periodStampGivenDate(meta.createdDate); + const paymentPeriodStamp = getters.periodStampGivenDate(payment.meta.createdDate); + if (comparePeriodStamps(updatePeriodStamp, paymentPeriodStamp) > 0) { + updateAdjustedDistribution({ period: paymentPeriodStamp, getters }); + } else { + updateCurrentDistribution({ contractID, meta, state, getters }); + } + const currentTotalPledgeAmount = fetchInitKV(state, "totalPledgeAmount", 0); + state.totalPledgeAmount = currentTotalPledgeAmount + payment.data.amount; + } + }, + sideEffect({ meta, contractID, height, data, innerSigningContractID }, { state, getters }) { + if (data.updatedProperties.status === PAYMENT_COMPLETED) { + const { loggedIn } = (0, import_sbp6.default)("state/vuex/state"); + const payment = state.payments[data.paymentHash]; + if (loggedIn.identityContractID === payment.data.toMemberID) { + const myProfile = getters.groupProfile(loggedIn.identityContractID); + if (isActionNewerThanUserJoinedDate(height, myProfile)) { + (0, import_sbp6.default)("gi.notifications/emit", "PAYMENT_RECEIVED", { + createdDate: meta.createdDate, + groupID: contractID, + creatorID: innerSigningContractID, + paymentHash: data.paymentHash, + amount: getters.withGroupCurrency(payment.data.amount) + }); + } + } + } + } + }, + "gi.contracts/group/sendPaymentThankYou": { + validate: actionRequireActiveMember(objectOf({ + toMemberID: stringMax(MAX_HASH_LEN, "toMemberID"), + memo: stringMax(MAX_MEMO_LEN, "memo") + })), + process({ data, innerSigningContractID }, { state }) { + const fromMemberID = fetchInitKV(state.thankYousFrom, innerSigningContractID, {}); + fromMemberID[data.toMemberID] = data.memo; + }, + sideEffect({ contractID, meta, height, data, innerSigningContractID }, { getters }) { + const { loggedIn } = (0, import_sbp6.default)("state/vuex/state"); + if (data.toMemberID === loggedIn.identityContractID) { + const myProfile = getters.groupProfile(loggedIn.identityContractID); + if (isActionNewerThanUserJoinedDate(height, myProfile)) { + (0, import_sbp6.default)("gi.notifications/emit", "PAYMENT_THANKYOU_SENT", { + createdDate: meta.createdDate, + groupID: contractID, + fromMemberID: innerSigningContractID, + toMemberID: data.toMemberID + }); + } + } + } + }, + "gi.contracts/group/proposal": { + validate: actionRequireActiveMember((data, { state }) => { + objectOf({ + proposalType, + proposalData: object, + votingRule: ruleType, + expires_date_ms: numberRange(0, Number.MAX_SAFE_INTEGER) + })(data); + const dataToCompare = omit(data.proposalData, ["reason"]); + for (const hash in state.proposals) { + const prop = state.proposals[hash]; + if (prop.status !== STATUS_OPEN || prop.data.proposalType !== data.proposalType) { + continue; + } + if (deepEqualJSONType(omit(prop.data.proposalData, ["reason"]), dataToCompare)) { + throw new TypeError((0, import_common3.L)("There is an identical open proposal.")); + } + } + }), + process({ data, meta, hash, height, innerSigningContractID }, { state }) { + state.proposals[hash] = { + data, + meta, + height, + creatorID: innerSigningContractID, + votes: { [innerSigningContractID]: VOTE_FOR }, + status: STATUS_OPEN, + notifiedBeforeExpire: false, + payload: null + }; + }, + sideEffect({ contractID, meta, hash, data, height, innerSigningContractID }, { getters }) { + const { loggedIn } = (0, import_sbp6.default)("state/vuex/state"); + const typeToSubTypeMap = { + [PROPOSAL_INVITE_MEMBER]: "ADD_MEMBER", + [PROPOSAL_REMOVE_MEMBER]: "REMOVE_MEMBER", + [PROPOSAL_GROUP_SETTING_CHANGE]: { + mincomeAmount: "CHANGE_MINCOME", + distributionDate: "CHANGE_DISTRIBUTION_DATE" + }[data.proposalData.setting], + [PROPOSAL_PROPOSAL_SETTING_CHANGE]: "CHANGE_VOTING_RULE", + [PROPOSAL_GENERIC]: "GENERIC" + }; + const myProfile = getters.groupProfile(loggedIn.identityContractID); + if (isActionNewerThanUserJoinedDate(height, myProfile)) { + (0, import_sbp6.default)("gi.notifications/emit", "NEW_PROPOSAL", { + createdDate: meta.createdDate, + groupID: contractID, + creatorID: innerSigningContractID, + proposalHash: hash, + subtype: typeToSubTypeMap[data.proposalType] + }); + } + } + }, + "gi.contracts/group/proposalVote": { + validate: actionRequireActiveMember(objectOf({ + proposalHash: stringMax(MAX_HASH_LEN, "proposalHash"), + vote: voteType, + passPayload: optional(unionOf(object, string)) + })), + async process(message, { state, getters }) { + const { data, hash, meta, innerSigningContractID } = message; + const proposal = state.proposals[data.proposalHash]; + if (!proposal) { + console.error(`proposalVote: no proposal for ${data.proposalHash}!`, { data, meta, hash }); + throw new import_common3.Errors.GIErrorIgnoreAndBan("proposalVote without existing proposal"); + } + proposal.votes[innerSigningContractID] = data.vote; + if (new Date(meta.createdDate).getTime() > proposal.data.expires_date_ms) { + console.warn("proposalVote: vote on expired proposal!", { proposal, data, meta }); + return; + } + const result = rules_default[proposal.data.votingRule](state, proposal.data.proposalType, proposal.votes); + if (result === VOTE_FOR || result === VOTE_AGAINST) { + proposal["dateClosed"] = meta.createdDate; + await proposals_default[proposal.data.proposalType][result](state, message); + const votedMemberIDs = Object.keys(proposal.votes); + for (const memberID of getters.groupMembersByContractID) { + const memberCurrentStreak = fetchInitKV(getters.groupStreaks.noVotes, memberID, 0); + const memberHasVoted = votedMemberIDs.includes(memberID); + getters.groupStreaks.noVotes[memberID] = memberHasVoted ? 0 : memberCurrentStreak + 1; + } + } + } + }, + "gi.contracts/group/proposalCancel": { + validate: actionRequireActiveMember(objectOf({ + proposalHash: stringMax(MAX_HASH_LEN, "proposalHash") + })), + process({ data, meta, contractID, innerSigningContractID, height }, { state }) { + const proposal = state.proposals[data.proposalHash]; + if (!proposal) { + console.error(`proposalCancel: no proposal for ${data.proposalHash}!`, { data, meta }); + throw new import_common3.Errors.GIErrorIgnoreAndBan("proposalVote without existing proposal"); + } else if (proposal.creatorID !== innerSigningContractID) { + console.error(`proposalCancel: proposal ${data.proposalHash} belongs to ${proposal.creatorID} not ${innerSigningContractID}!`, { data, meta }); + throw new import_common3.Errors.GIErrorIgnoreAndBan("proposalWithdraw for wrong user!"); + } + proposal["status"] = STATUS_CANCELLED; + proposal["dateClosed"] = meta.createdDate; + notifyAndArchiveProposal({ state, proposalHash: data.proposalHash, proposal, contractID, meta, height }); + } + }, + "gi.contracts/group/markProposalsExpired": { + validate: actionRequireActiveMember(objectOf({ + proposalIds: arrayOf(stringMax(MAX_HASH_LEN)) + })), + process({ data, meta, contractID, height }, { state }) { + if (data.proposalIds.length) { + for (const proposalId of data.proposalIds) { + const proposal = state.proposals[proposalId]; + if (proposal) { + proposal["status"] = STATUS_EXPIRED; + proposal["dateClosed"] = meta.createdDate; + notifyAndArchiveProposal({ state, proposalHash: proposalId, proposal, contractID, meta, height }); + } + } + } + } + }, + "gi.contracts/group/notifyExpiringProposals": { + validate: actionRequireActiveMember(objectOf({ + proposalIds: arrayOf(string) + })), + process({ data }, { state }) { + for (const proposalId of data.proposalIds) { + state.proposals[proposalId]["notifiedBeforeExpire"] = true; + } + }, + sideEffect({ data, height, contractID }, { state, getters }) { + const { loggedIn } = (0, import_sbp6.default)("state/vuex/state"); + const myProfile = getters.groupProfile(loggedIn.identityContractID); + if (isActionNewerThanUserJoinedDate(height, myProfile)) { + for (const proposalId of data.proposalIds) { + const proposal = state.proposals[proposalId]; + (0, import_sbp6.default)("gi.notifications/emit", "PROPOSAL_EXPIRING", { + groupID: contractID, + proposal, + proposalId + }); + } + } + } + }, + "gi.contracts/group/removeMember": { + validate: actionRequireActiveMember((data, { state, getters, message: { innerSigningContractID, proposalHash } }) => { + objectOf({ + memberID: optional(stringMax(MAX_HASH_LEN)), + reason: optional(stringMax(GROUP_DESCRIPTION_MAX_CHAR)), + automated: optional(boolean) + })(data); + const memberToRemove = data.memberID || innerSigningContractID; + const membersCount = getters.groupMembersCount; + const isGroupCreator = innerSigningContractID === getters.currentGroupOwnerID; + if (!state.profiles[memberToRemove]) { + throw new GIGroupNotJoinedError((0, import_common3.L)("Not part of the group.")); + } + if (membersCount === 1) { + throw new TypeError((0, import_common3.L)("Cannot remove the last member.")); + } + if (memberToRemove === innerSigningContractID) { + return true; + } + if (isGroupCreator) { + return true; + } else if (membersCount < 3) { + throw new TypeError((0, import_common3.L)("Only the group creator can remove members.")); + } else { + const proposal = state.proposals[proposalHash]; + if (!proposal) { + throw new TypeError((0, import_common3.L)("Admin credentials needed and not implemented yet.")); + } + } + }), + process({ data, meta, contractID, height, innerSigningContractID }, { state, getters }) { + const memberID = data.memberID || innerSigningContractID; + const identityContractID = (0, import_sbp6.default)("state/vuex/state").loggedIn?.identityContractID; + if (memberID === identityContractID) { + const ourChatrooms = Object.entries(state?.chatRooms || {}).filter(([, state2]) => state2.members[identityContractID]?.status === PROFILE_STATUS.ACTIVE).map(([cID]) => cID); + if (ourChatrooms.length) { + (0, import_sbp6.default)("gi.contracts/group/pushSideEffect", contractID, ["gi.contracts/group/referenceTally", contractID, ourChatrooms, "release"]); + } + } + memberLeaves({ memberID, dateLeft: meta.createdDate, heightLeft: height, ourselvesLeaving: memberID === identityContractID }, { contractID, meta, state, getters }); + }, + sideEffect({ data, meta, contractID, height, innerSigningContractID, proposalHash }, { state, getters }) { + const memberID = data.memberID || innerSigningContractID; + (0, import_sbp6.default)("gi.contracts/group/referenceTally", contractID, memberID, "release"); + (0, import_sbp6.default)("chelonia/queueInvocation", contractID, () => (0, import_sbp6.default)("gi.contracts/group/leaveGroup", { + data, + meta, + contractID, + getters, + height, + innerSigningContractID, + proposalHash + })).catch((e) => { + console.warn(`[gi.contracts/group/removeMember/sideEffect] Error ${e.name} during queueInvocation for ${contractID}`, e); + }); + } + }, + "gi.contracts/group/invite": { + validate: actionRequireActiveMember(inviteType), + process({ data }, { state }) { + state.invites[data.inviteKeyId] = data; + } + }, + "gi.contracts/group/inviteAccept": { + validate: actionRequireInnerSignature(objectOf({ reference: string })), + process({ data, meta, height, innerSigningContractID }, { state }) { + if (state.profiles[innerSigningContractID]?.status === PROFILE_STATUS.ACTIVE) { + throw new Error(`[gi.contracts/group/inviteAccept] Existing members can't accept invites: ${innerSigningContractID}`); + } + state.profiles[innerSigningContractID] = initGroupProfile(meta.createdDate, height, data.reference); + }, + sideEffect({ meta, contractID, height, innerSigningContractID }) { + const { loggedIn } = (0, import_sbp6.default)("state/vuex/state"); + (0, import_sbp6.default)("gi.contracts/group/referenceTally", contractID, innerSigningContractID, "retain"); + (0, import_sbp6.default)("chelonia/queueInvocation", contractID, async () => { + const state = await (0, import_sbp6.default)("chelonia/contract/state", contractID); + if (!state) { + console.info(`[gi.contracts/group/inviteAccept] Contract ${contractID} has been removed`); + return; + } + const { profiles = {} } = state; + if (profiles[innerSigningContractID].status !== PROFILE_STATUS.ACTIVE) { + return; + } + const userID = loggedIn.identityContractID; + if (innerSigningContractID === userID) { + await (0, import_sbp6.default)("gi.actions/identity/addJoinDirectMessageKey", userID, contractID, "csk"); + const generalChatRoomId = state.generalChatRoomId; + if (generalChatRoomId) { + if (state.chatRooms[generalChatRoomId]?.members?.[userID]?.status !== PROFILE_STATUS.ACTIVE) { + (0, import_sbp6.default)("gi.actions/group/joinChatRoom", { + contractID, + data: { chatRoomID: generalChatRoomId } + }).catch((e) => { + if (e?.name === "GIErrorUIRuntimeError" && e.cause?.name === "GIGroupAlreadyJoinedError") + return; + console.error("Error while joining the #General chatroom", e); + const errMsg = (0, import_common3.L)("Couldn't join the #{chatroomName} in the group. An error occurred: {error}", { chatroomName: CHATROOM_GENERAL_NAME, error: e?.message || e }); + const promptOptions = { + heading: (0, import_common3.L)("Error while joining a chatroom"), + question: errMsg, + primaryButton: (0, import_common3.L)("Close") + }; + (0, import_sbp6.default)("gi.ui/prompt", promptOptions); + }); + } + } else { + (async () => { + alert((0, import_common3.L)("Couldn't join the #{chatroomName} in the group. Doesn't exist.", { chatroomName: CHATROOM_GENERAL_NAME })); + })(); + } + (0, import_sbp6.default)("okTurtles.events/emit", JOINED_GROUP, { identityContractID: userID, groupContractID: contractID }); + } else if (isActionNewerThanUserJoinedDate(height, state?.profiles?.[userID])) { + (0, import_sbp6.default)("gi.notifications/emit", "MEMBER_ADDED", { + createdDate: meta.createdDate, + groupID: contractID, + memberID: innerSigningContractID + }); + } + }).catch((e) => { + console.error("[gi.contracts/group/inviteAccept/sideEffect]: An error occurred", e); + }); + } + }, + "gi.contracts/group/inviteRevoke": { + validate: actionRequireActiveMember((data, { state }) => { + objectOf({ + inviteKeyId: stringMax(MAX_HASH_LEN, "inviteKeyId") + })(data); + if (!state._vm.invites[data.inviteKeyId]) { + throw new TypeError((0, import_common3.L)("The link does not exist.")); + } + }), + process() { + } + }, + "gi.contracts/group/updateSettings": { + validate: actionRequireActiveMember((data, { getters, meta, message: { innerSigningContractID } }) => { + objectMaybeOf({ + groupName: stringMax(GROUP_NAME_MAX_CHAR, "groupName"), + groupPicture: unionOf(string, objectOf({ + manifestCid: stringMax(MAX_HASH_LEN, "manifestCid"), + downloadParams: optional(object) + })), + sharedValues: stringMax(GROUP_DESCRIPTION_MAX_CHAR, "sharedValues"), + mincomeAmount: numberRange(Number.EPSILON, Number.MAX_VALUE), + mincomeCurrency: stringMax(GROUP_CURRENCY_MAX_CHAR, "mincomeCurrency"), + distributionDate: string, + allowPublicChannels: boolean + })(data); + const isGroupCreator = innerSigningContractID === getters.currentGroupOwnerID; + if ("allowPublicChannels" in data && !isGroupCreator) { + throw new TypeError((0, import_common3.L)("Only group creator can allow public channels.")); + } else if ("distributionDate" in data && !isGroupCreator) { + throw new TypeError((0, import_common3.L)("Only group creator can update distribution date.")); + } else if ("distributionDate" in data && (getters.groupDistributionStarted(meta.createdDate) || Object.keys(getters.groupPeriodPayments).length > 1)) { + throw new TypeError((0, import_common3.L)("Can't change distribution date because distribution period has already started.")); + } + }), + process({ contractID, meta, data, height, innerSigningContractID, proposalHash }, { state, getters }) { + const mincomeCache = "mincomeAmount" in data ? state.settings.mincomeAmount : null; + for (const key in data) { + state.settings[key] = data[key]; + } + if ("distributionDate" in data) { + state["paymentsByPeriod"] = {}; + initFetchPeriodPayments({ contractID, meta, state, getters }); + } + if (mincomeCache !== null && !proposalHash) { + (0, import_sbp6.default)("gi.contracts/group/pushSideEffect", contractID, [ + "gi.contracts/group/sendMincomeChangedNotification", + contractID, + meta, + { + toAmount: data.mincomeAmount, + fromAmount: mincomeCache + }, + height, + innerSigningContractID + ]); + } + } + }, + "gi.contracts/group/groupProfileUpdate": { + validate: actionRequireActiveMember(objectMaybeOf({ + incomeDetailsType: validatorFrom((x) => ["incomeAmount", "pledgeAmount"].includes(x)), + incomeAmount: numberRange(0, Number.MAX_VALUE), + pledgeAmount: numberRange(0, GROUP_MAX_PLEDGE_AMOUNT, "pledgeAmount"), + nonMonetaryAdd: stringMax(GROUP_NON_MONETARY_CONTRIBUTION_MAX_CHAR, "nonMonetaryAdd"), + nonMonetaryEdit: objectOf({ + replace: stringMax(GROUP_NON_MONETARY_CONTRIBUTION_MAX_CHAR, "replace"), + with: stringMax(GROUP_NON_MONETARY_CONTRIBUTION_MAX_CHAR, "with") + }), + nonMonetaryRemove: stringMax(GROUP_NON_MONETARY_CONTRIBUTION_MAX_CHAR, "nonMonetaryRemove"), + nonMonetaryReplace: arrayOf(stringMax(GROUP_NON_MONETARY_CONTRIBUTION_MAX_CHAR)), + paymentMethods: arrayOf(objectOf({ + name: stringMax(GROUP_NAME_MAX_CHAR), + value: stringMax(GROUP_PAYMENT_METHOD_MAX_CHAR, "paymentMethods.value") + })) + })), + process({ data, meta, contractID, height, innerSigningContractID }, { state, getters }) { + const groupProfile = state.profiles[innerSigningContractID]; + const nonMonetary = groupProfile.nonMonetaryContributions; + const isUpdatingNonMonetary = Object.keys(data).some((key) => ["nonMonetaryAdd", "nonMonetaryRemove", "nonMonetaryEdit", "nonMonetaryReplace"].includes(key)); + const prevNonMonetary = nonMonetary.slice(); + for (const key in data) { + const value = data[key]; + switch (key) { + case "nonMonetaryAdd": + nonMonetary.push(value); + break; + case "nonMonetaryRemove": + nonMonetary.splice(nonMonetary.indexOf(value), 1); + break; + case "nonMonetaryEdit": + nonMonetary.splice(nonMonetary.indexOf(value.replace), 1, value.with); + break; + case "nonMonetaryReplace": + groupProfile.nonMonetaryContributions = cloneDeep(value); + break; + default: + groupProfile[key] = value; + } + } + if (isUpdatingNonMonetary && (prevNonMonetary.length || groupProfile.nonMonetaryContributions.length)) { + (0, import_sbp6.default)("gi.contracts/group/pushSideEffect", contractID, ["gi.contracts/group/sendNonMonetaryUpdateNotification", { + contractID, + innerSigningContractID, + meta, + height, + getters, + updateData: { + prev: prevNonMonetary, + after: groupProfile.nonMonetaryContributions.slice() + } + }]); + } + if (data.incomeDetailsType) { + groupProfile["incomeDetailsLastUpdatedDate"] = meta.createdDate; + updateCurrentDistribution({ contractID, meta, state, getters }); + } + } + }, + "gi.contracts/group/updateAllVotingRules": { + validate: actionRequireActiveMember(objectMaybeOf({ + ruleName: (x) => [RULE_PERCENTAGE, RULE_DISAGREEMENT].includes(x), + ruleThreshold: number, + expires_ms: number + })), + process({ data }, { state }) { + if (data.ruleName && data.ruleThreshold) { + for (const proposalSettings in state.settings.proposals) { + state.settings.proposals[proposalSettings]["rule"] = data.ruleName; + state.settings.proposals[proposalSettings].ruleSettings[data.ruleName]["threshold"] = data.ruleThreshold; + } + } + } + }, + "gi.contracts/group/addChatRoom": { + validate: (data) => { + objectOf({ + chatRoomID: stringMax(MAX_HASH_LEN, "chatRoomID"), + attributes: chatRoomAttributesType + })(data); + const chatroomName = data.attributes.name; + const nameValidationMap = { + [(0, import_common3.L)("Chatroom name cannot contain white-space")]: (v) => /\s/g.test(v), + [(0, import_common3.L)("Chatroom name must be lower-case only")]: (v) => /[A-Z]/g.test(v) + }; + for (const key in nameValidationMap) { + const check = nameValidationMap[key]; + if (check(chatroomName)) { + throw new TypeError(key); + } + } + }, + process({ data, contractID, innerSigningContractID }, { state }) { + const { name, type, privacyLevel, description } = data.attributes; + if (!!innerSigningContractID === (data.attributes.name === CHATROOM_GENERAL_NAME)) { + throw new Error("All chatrooms other than #General must have an inner signature and the #General chatroom must have no inner signature"); + } + state.chatRooms[data.chatRoomID] = { + creatorID: innerSigningContractID || contractID, + name, + description, + type, + privacyLevel, + deletedDate: null, + members: {} + }; + if (!state.generalChatRoomId) { + state["generalChatRoomId"] = data.chatRoomID; + } + }, + sideEffect({ contractID, data }, { state }) { + if (data.chatRoomID === state.generalChatRoomId) { + (0, import_sbp6.default)("chelonia/queueInvocation", contractID, () => { + const { identityContractID } = (0, import_sbp6.default)("state/vuex/state").loggedIn; + if (state.profiles?.[identityContractID]?.status === PROFILE_STATUS.ACTIVE && state.chatRooms?.[contractID]?.members[identityContractID]?.status !== PROFILE_STATUS.ACTIVE) { + (0, import_sbp6.default)("gi.actions/group/joinChatRoom", { + contractID, + data: { + chatRoomID: data.chatRoomID + } + }).catch((e) => { + console.error("Unable to add ourselves to the #General chatroom", e); + }); + } + }); + } + } + }, + "gi.contracts/group/deleteChatRoom": { + validate: actionRequireActiveMember((data, { getters, message: { innerSigningContractID } }) => { + objectOf({ chatRoomID: stringMax(MAX_HASH_LEN, "chatRoomID") })(data); + if (getters.groupChatRooms[data.chatRoomID].creatorID !== innerSigningContractID) { + throw new TypeError((0, import_common3.L)("Only the channel creator can delete channel.")); + } + }), + process({ contractID, data }, { state }) { + const identityContractID = (0, import_sbp6.default)("state/vuex/state").loggedIn?.identityContractID; + if (identityContractID && state?.chatRooms[data.chatRoomID]?.members[identityContractID]?.status === PROFILE_STATUS.ACTIVE) { + (0, import_sbp6.default)("gi.contracts/group/pushSideEffect", contractID, ["gi.contracts/group/referenceTally", contractID, data.chatRoomID, "release"]); + } + delete state.chatRooms[data.chatRoomID]; + }, + sideEffect({ data, contractID, innerSigningContractID }) { + (0, import_sbp6.default)("okTurtles.events/emit", DELETED_CHATROOM, { groupContractID: contractID, chatRoomID: data.chatRoomID }); + const { identityContractID } = (0, import_sbp6.default)("state/vuex/state").loggedIn; + if (identityContractID === innerSigningContractID) { + (0, import_sbp6.default)("gi.actions/chatroom/delete", { contractID: data.chatRoomID, data: {} }).catch((e) => { + console.log(`Error sending chatroom removal action for ${data.chatRoomID}`, e); + }); + } + } + }, + "gi.contracts/group/leaveChatRoom": { + validate: actionRequireActiveMember(objectOf({ + chatRoomID: stringMax(MAX_HASH_LEN, "chatRoomID"), + memberID: optional(stringMax(MAX_HASH_LEN), "memberID"), + joinedHeight: numberRange(1, Number.MAX_SAFE_INTEGER) + })), + process({ data, innerSigningContractID }, { state }) { + if (!state.chatRooms[data.chatRoomID]) { + throw new Error("Cannot leave a chatroom which isn't part of the group"); + } + const memberID = data.memberID || innerSigningContractID; + if (state.chatRooms[data.chatRoomID].members[memberID]?.status !== PROFILE_STATUS.ACTIVE || state.chatRooms[data.chatRoomID].members[memberID].joinedHeight !== data.joinedHeight) { + throw new Error("Cannot leave a chatroom that you're not part of"); + } + removeGroupChatroomProfile(state, data.chatRoomID, memberID); + }, + sideEffect({ data, contractID, innerSigningContractID }, { state }) { + const memberID = data.memberID || innerSigningContractID; + const { identityContractID } = (0, import_sbp6.default)("state/vuex/state").loggedIn; + if (innerSigningContractID === identityContractID) { + (0, import_sbp6.default)("chelonia/queueInvocation", contractID, async () => { + const state2 = await (0, import_sbp6.default)("chelonia/contract/state", contractID); + if (state2?.profiles?.[innerSigningContractID]?.status === PROFILE_STATUS.ACTIVE && state2.chatRooms?.[data.chatRoomID]?.members[memberID]?.status === PROFILE_STATUS.REMOVED && state2.chatRooms[data.chatRoomID].members[memberID].joinedHeight === data.joinedHeight) { + await leaveChatRoomAction(contractID, state2, data.chatRoomID, memberID, innerSigningContractID); + } + }).catch((e) => { + console.error(`[gi.contracts/group/leaveChatRoom/sideEffect] Error for ${contractID}`, { contractID, data, error: e }); + }); + } + if (memberID === identityContractID) { + (0, import_sbp6.default)("gi.contracts/group/referenceTally", contractID, data.chatRoomID, "release"); + (0, import_sbp6.default)("okTurtles.events/emit", LEFT_CHATROOM, { + identityContractID, + groupContractID: contractID, + chatRoomID: data.chatRoomID + }); + } + } + }, + "gi.contracts/group/joinChatRoom": { + validate: actionRequireActiveMember(objectMaybeOf({ + memberID: optional(stringMax(MAX_HASH_LEN, "memberID")), + chatRoomID: stringMax(MAX_HASH_LEN, "chatRoomID") + })), + process({ data, height, innerSigningContractID }, { state }) { + const memberID = data.memberID || innerSigningContractID; + const { chatRoomID } = data; + if (state.profiles[memberID]?.status !== PROFILE_STATUS.ACTIVE) { + throw new Error("Cannot join a chatroom for a group you're not a member of"); + } + if (!state.chatRooms[chatRoomID]) { + throw new Error("Cannot join a chatroom which isn't part of the group"); + } + if (state.chatRooms[chatRoomID].members[memberID]?.status === PROFILE_STATUS.ACTIVE) { + throw new GIGroupAlreadyJoinedError("Cannot join a chatroom that you're already part of"); + } + state.chatRooms[chatRoomID].members[memberID] = { status: PROFILE_STATUS.ACTIVE, joinedHeight: height }; + }, + sideEffect({ data, contractID, height, innerSigningContractID }) { + const memberID = data.memberID || innerSigningContractID; + const { identityContractID } = (0, import_sbp6.default)("state/vuex/state").loggedIn; + if (memberID === identityContractID) { + (0, import_sbp6.default)("gi.contracts/group/referenceTally", contractID, data.chatRoomID, "retain"); + } + if (innerSigningContractID === identityContractID) { + (0, import_sbp6.default)("chelonia/queueInvocation", contractID, () => (0, import_sbp6.default)("gi.contracts/group/joinGroupChatrooms", contractID, data.chatRoomID, identityContractID, memberID, height)).catch((e) => { + console.warn(`[gi.contracts/group/joinChatRoom/sideEffect] Error adding member to group chatroom for ${contractID}`, { e, data }); + }); + } + } + }, + "gi.contracts/group/renameChatRoom": { + validate: actionRequireActiveMember(objectOf({ + chatRoomID: stringMax(MAX_HASH_LEN, "chatRoomID"), + name: stringMax(CHATROOM_NAME_LIMITS_IN_CHARS, "name") + })), + process({ data }, { state }) { + state.chatRooms[data.chatRoomID]["name"] = data.name; + } + }, + "gi.contracts/group/changeChatRoomDescription": { + validate: actionRequireActiveMember(objectOf({ + chatRoomID: stringMax(MAX_HASH_LEN, "chatRoomID"), + description: stringMax(CHATROOM_DESCRIPTION_LIMITS_IN_CHARS, "description") + })), + process({ data }, { state }) { + state.chatRooms[data.chatRoomID]["description"] = data.description; + } + }, + "gi.contracts/group/updateDistributionDate": { + validate: actionRequireActiveMember(optional), + process({ meta }, { state, getters }) { + const period = getters.periodStampGivenDate(meta.createdDate); + const current = state.settings?.distributionDate; + if (current !== period) { + updateGroupStreaks({ state, getters }); + state.settings.distributionDate = period; + } + } + }, + "gi.contracts/group/upgradeFrom1.0.7": { + validate: actionRequireActiveMember(optional), + process({ height }, { state }) { + let changed = false; + Object.values(state.chatRooms).forEach((chatroom) => { + Object.values(chatroom.members).forEach((member) => { + if (member.status === PROFILE_STATUS.ACTIVE && member.joinedHeight == null) { + member.joinedHeight = height; + changed = true; + } + }); + }); + if (!changed) { + throw new Error("[gi.contracts/group/upgradeFrom1.0.7/process] Invalid or duplicate upgrade action"); + } + } + }, + ..."" + }, + methods: { + "gi.contracts/group/_cleanup": ({ contractID, state }) => { + const { identityContractID } = (0, import_sbp6.default)("state/vuex/state").loggedIn; + const dependentContractIDs = [ + ...Object.entries(state?.profiles || {}).filter(([, state2]) => state2.status === PROFILE_STATUS.ACTIVE).map(([cID]) => cID), + ...Object.entries(state?.chatRooms || {}).filter(([, state2]) => state2.members[identityContractID]?.status === PROFILE_STATUS.ACTIVE).map(([cID]) => cID) + ]; + if (dependentContractIDs.length) { + (0, import_sbp6.default)("chelonia/contract/release", dependentContractIDs).catch((e) => { + console.error("[gi.contracts/group/_cleanup] Error calling release", contractID, e); + }); + } + Promise.all([ + () => (0, import_sbp6.default)("gi.contracts/group/removeArchivedProposals", contractID), + () => (0, import_sbp6.default)("gi.contracts/group/removeArchivedPayments", contractID) + ]).catch((e) => { + console.error(`[gi.contracts/group/_cleanup] Error removing entries for archive for ${contractID}`, e); + }); + }, + "gi.contracts/group/archiveProposal": async function(contractID, proposalHash, proposal) { + const { identityContractID } = (0, import_sbp6.default)("state/vuex/state").loggedIn; + const key = `proposals/${identityContractID}/${contractID}`; + const proposals2 = await (0, import_sbp6.default)("gi.db/archive/load", key) || []; + if (proposals2.some(([archivedProposalHash]) => archivedProposalHash === proposalHash)) { + return; + } + proposals2.unshift([proposalHash, proposal]); + while (proposals2.length > MAX_ARCHIVED_PROPOSALS) { + proposals2.pop(); + } + await (0, import_sbp6.default)("gi.db/archive/save", key, proposals2); + (0, import_sbp6.default)("okTurtles.events/emit", PROPOSAL_ARCHIVED, contractID, proposalHash, proposal); + }, + "gi.contracts/group/archivePayments": async function(contractID, archivingPayments) { + const { paymentsByPeriod, payments } = archivingPayments; + const { identityContractID } = (0, import_sbp6.default)("state/vuex/state").loggedIn; + const archPaymentsByPeriodKey = `paymentsByPeriod/${identityContractID}/${contractID}`; + const archPaymentsByPeriod = await (0, import_sbp6.default)("gi.db/archive/load", archPaymentsByPeriodKey) || {}; + const archSentOrReceivedPaymentsKey = `sentOrReceivedPayments/${identityContractID}/${contractID}`; + const archSentOrReceivedPayments = await (0, import_sbp6.default)("gi.db/archive/load", archSentOrReceivedPaymentsKey) || { sent: [], received: [] }; + const sortPayments = (payments2) => payments2.sort((f, l) => l.height - f.height); + for (const period of Object.keys(paymentsByPeriod).sort()) { + archPaymentsByPeriod[period] = paymentsByPeriod[period]; + const newSentOrReceivedPayments = { sent: [], received: [] }; + const { paymentsFrom } = paymentsByPeriod[period]; + for (const fromMemberID of Object.keys(paymentsFrom)) { + for (const toMemberID of Object.keys(paymentsFrom[fromMemberID])) { + if (toMemberID === identityContractID || fromMemberID === identityContractID) { + const receivedOrSent = toMemberID === identityContractID ? "received" : "sent"; + for (const hash of paymentsFrom[fromMemberID][toMemberID]) { + const { data, meta, height } = payments[hash]; + newSentOrReceivedPayments[receivedOrSent].push({ hash, period, height, data, meta, amount: data.amount }); + } + } + } + } + archSentOrReceivedPayments.sent = [...sortPayments(newSentOrReceivedPayments.sent), ...archSentOrReceivedPayments.sent]; + archSentOrReceivedPayments.received = [...sortPayments(newSentOrReceivedPayments.received), ...archSentOrReceivedPayments.received]; + const archPaymentsKey = `payments/${identityContractID}/${period}/${contractID}`; + const hashes = paymentHashesFromPaymentPeriod(paymentsByPeriod[period]); + const archPayments = Object.fromEntries(hashes.map((hash) => [hash, payments[hash]])); + while (Object.keys(archPaymentsByPeriod).length > MAX_ARCHIVED_PERIODS) { + const shouldBeDeletedPeriod = Object.keys(archPaymentsByPeriod).sort().shift(); + const paymentHashes = paymentHashesFromPaymentPeriod(archPaymentsByPeriod[shouldBeDeletedPeriod]); + await (0, import_sbp6.default)("gi.db/archive/delete", `payments/${shouldBeDeletedPeriod}/${identityContractID}/${contractID}`); + delete archPaymentsByPeriod[shouldBeDeletedPeriod]; + archSentOrReceivedPayments.sent = archSentOrReceivedPayments.sent.filter((payment) => !paymentHashes.includes(payment.hash)); + archSentOrReceivedPayments.received = archSentOrReceivedPayments.received.filter((payment) => !paymentHashes.includes(payment.hash)); + } + await (0, import_sbp6.default)("gi.db/archive/save", archPaymentsKey, archPayments); + } + await (0, import_sbp6.default)("gi.db/archive/save", archPaymentsByPeriodKey, archPaymentsByPeriod); + await (0, import_sbp6.default)("gi.db/archive/save", archSentOrReceivedPaymentsKey, archSentOrReceivedPayments); + (0, import_sbp6.default)("okTurtles.events/emit", PAYMENTS_ARCHIVED, { paymentsByPeriod, payments }); + }, + "gi.contracts/group/removeArchivedProposals": async function(contractID) { + const { identityContractID } = (0, import_sbp6.default)("state/vuex/state").loggedIn; + const key = `proposals/${identityContractID}/${contractID}`; + await (0, import_sbp6.default)("gi.db/archive/delete", key); + }, + "gi.contracts/group/removeArchivedPayments": async function(contractID) { + const { identityContractID } = (0, import_sbp6.default)("state/vuex/state").loggedIn; + const archPaymentsByPeriodKey = `paymentsByPeriod/${identityContractID}/${contractID}`; + const periods = Object.keys(await (0, import_sbp6.default)("gi.db/archive/load", archPaymentsByPeriodKey) || {}); + const archSentOrReceivedPaymentsKey = `sentOrReceivedPayments/${identityContractID}/${contractID}`; + for (const period of periods) { + const archPaymentsKey = `payments/${identityContractID}/${period}/${contractID}`; + await (0, import_sbp6.default)("gi.db/archive/delete", archPaymentsKey); + } + await (0, import_sbp6.default)("gi.db/archive/delete", archPaymentsByPeriodKey); + await (0, import_sbp6.default)("gi.db/archive/delete", archSentOrReceivedPaymentsKey); + }, + "gi.contracts/group/makeNotificationWhenProposalClosed": function(state, contractID, meta, height, proposalHash, proposal) { + const { loggedIn } = (0, import_sbp6.default)("state/vuex/state"); + if (isActionNewerThanUserJoinedDate(height, state.profiles[loggedIn.identityContractID])) { + (0, import_sbp6.default)("gi.notifications/emit", "PROPOSAL_CLOSED", { createdDate: meta.createdDate, groupID: contractID, proposalHash, proposal }); + } + }, + "gi.contracts/group/sendMincomeChangedNotification": async function(contractID, meta, data, height, innerSigningContractID) { + const { identityContractID } = (0, import_sbp6.default)("state/vuex/state").loggedIn; + const myProfile = (await (0, import_sbp6.default)("chelonia/contract/state", contractID)).profiles[identityContractID]; + const { fromAmount, toAmount } = data; + if (isActionNewerThanUserJoinedDate(height, myProfile) && myProfile.incomeDetailsType) { + const memberType = myProfile.incomeDetailsType === "pledgeAmount" ? "pledging" : "receiving"; + const mincomeIncreased = toAmount > fromAmount; + const actionNeeded = mincomeIncreased || memberType === "receiving" && !mincomeIncreased && myProfile.incomeAmount < fromAmount && myProfile.incomeAmount > toAmount; + if (!actionNeeded) { + return; + } + if (memberType === "receiving" && !mincomeIncreased) { + await (0, import_sbp6.default)("gi.actions/group/groupProfileUpdate", { + contractID, + data: { + incomeDetailsType: "pledgeAmount", + pledgeAmount: 0 + } + }); + } + (0, import_sbp6.default)("gi.notifications/emit", "MINCOME_CHANGED", { + createdDate: meta.createdDate, + groupID: contractID, + creatorID: innerSigningContractID, + to: toAmount, + memberType, + increased: mincomeIncreased + }); + } + }, + "gi.contracts/group/joinGroupChatrooms": async function(contractID, chatRoomID, originalActorID, memberID, height) { + const state = await (0, import_sbp6.default)("chelonia/contract/state", contractID); + const actorID = (0, import_sbp6.default)("state/vuex/state").loggedIn.identityContractID; + if (actorID !== originalActorID) { + return; + } + if (state?.profiles?.[actorID]?.status !== PROFILE_STATUS.ACTIVE || state?.profiles?.[memberID]?.status !== PROFILE_STATUS.ACTIVE || state?.chatRooms?.[chatRoomID]?.members[memberID]?.status !== PROFILE_STATUS.ACTIVE || state?.chatRooms?.[chatRoomID]?.members[memberID]?.joinedHeight !== height) { + (0, import_sbp6.default)("okTurtles.data/set", `gi.contracts/group/chatroom-skipped-${contractID}-${chatRoomID}-${height}`, true); + return; + } + { + await (0, import_sbp6.default)("chelonia/contract/retain", chatRoomID, { ephemeral: true }); + if (!await (0, import_sbp6.default)("chelonia/contract/hasKeysToPerformOperation", chatRoomID, "gi.contracts/chatroom/join")) { + throw new Error(`Missing keys to join chatroom ${chatRoomID}`); + } + const encryptionKeyId = (0, import_sbp6.default)("chelonia/contract/currentKeyIdByName", state, "cek", true); + (0, import_sbp6.default)("gi.actions/chatroom/join", { + contractID: chatRoomID, + data: actorID === memberID ? {} : { memberID }, + encryptionKeyId + }).catch((e) => { + if (e.name === "GIErrorUIRuntimeError" && e.cause?.name === "GIChatroomAlreadyMemberError") { + return; + } + console.warn(`Unable to join ${memberID} to chatroom ${chatRoomID} for group ${contractID}`, e); + }).finally(() => { + (0, import_sbp6.default)("chelonia/contract/release", chatRoomID, { ephemeral: true }).catch((e) => console.error("[gi.contracts/group/joinGroupChatrooms] Error during release", e)); + }); + } + }, + "gi.contracts/group/leaveGroup": async ({ data, meta, contractID, height, getters, innerSigningContractID, proposalHash }) => { + const { identityContractID } = (0, import_sbp6.default)("state/vuex/state").loggedIn; + const memberID = data.memberID || innerSigningContractID; + const state = await (0, import_sbp6.default)("chelonia/contract/state", contractID); + if (!state) { + console.info(`[gi.contracts/group/leaveGroup] for ${contractID}: contract has been removed`); + return; + } + if (state.profiles?.[memberID]?.status !== PROFILE_STATUS.REMOVED) { + console.info(`[gi.contracts/group/leaveGroup] for ${contractID}: member has not left`, { contractID, memberID, status: state.profiles?.[memberID]?.status }); + return; + } + if (memberID === identityContractID) { + const areWeRejoining = async () => { + const pendingKeyShares = await (0, import_sbp6.default)("chelonia/contract/waitingForKeyShareTo", state, identityContractID); + if (pendingKeyShares) { + console.info("[gi.contracts/group/leaveGroup] Not removing group contract because it has a pending key share for ourselves", contractID); + return true; + } + const sentKeyShares = await (0, import_sbp6.default)("chelonia/contract/successfulKeySharesByContractID", state, identityContractID); + if (sentKeyShares?.[identityContractID]?.[0].height > state.profiles[memberID].departedHeight) { + console.info("[gi.contracts/group/leaveGroup] Not removing group contract because it has shared keys with ourselves after we left", contractID); + return true; + } + return false; + }; + if (await areWeRejoining()) { + console.info("[gi.contracts/group/leaveGroup] aborting as we're rejoining", contractID); + return; + } + } + leaveAllChatRoomsUponLeaving(contractID, state, memberID, innerSigningContractID).catch((e) => { + console.warn("[gi.contracts/group/leaveGroup]: Error while leaving all chatrooms", e); + }); + if (memberID === identityContractID) { + (0, import_sbp6.default)("gi.actions/identity/leaveGroup", { + contractID: identityContractID, + data: { + groupContractID: contractID, + reference: state.profiles[identityContractID].reference + } + }).catch((e) => { + console.warn(`[gi.contracts/group/leaveGroup] ${e.name} thrown by gi.contracts/identity/leaveGroup ${identityContractID} for ${contractID}:`, e); + }); + } else { + const myProfile = getters.groupProfile(identityContractID); + if (isActionNewerThanUserJoinedDate(height, myProfile)) { + if (!proposalHash) { + const memberRemovedThemselves = memberID === innerSigningContractID; + (0, import_sbp6.default)("gi.notifications/emit", memberRemovedThemselves ? "MEMBER_LEFT" : "MEMBER_REMOVED", { + createdDate: meta.createdDate, + groupID: contractID, + memberID + }); + } + Promise.resolve().then(() => (0, import_sbp6.default)("gi.contracts/group/rotateKeys", contractID)).then(() => (0, import_sbp6.default)("gi.contracts/group/revokeGroupKeyAndRotateOurPEK", contractID)).catch((e) => { + console.warn(`[gi.contracts/group/leaveGroup] for ${contractID}: Error rotating group keys or our PEK`, e); + }); + (0, import_sbp6.default)("gi.contracts/group/removeForeignKeys", contractID, memberID, state); + } + } + }, + "gi.contracts/group/rotateKeys": async (contractID) => { + const state = await (0, import_sbp6.default)("chelonia/contract/state", contractID); + const pendingKeyRevocations = state?._volatile?.pendingKeyRevocations; + if (!pendingKeyRevocations || Object.keys(pendingKeyRevocations).length === 0) { + return; + } + (0, import_sbp6.default)("gi.actions/out/rotateKeys", contractID, "gi.contracts/group", "pending", "gi.actions/group/shareNewKeys").catch((e) => { + console.warn(`rotateKeys: ${e.name} thrown:`, e); + }); + }, + "gi.contracts/group/revokeGroupKeyAndRotateOurPEK": (groupContractID) => { + const rootState = (0, import_sbp6.default)("state/vuex/state"); + const { identityContractID } = rootState.loggedIn; + const state = rootState[identityContractID]; + if (!state._volatile) + state["_volatile"] = /* @__PURE__ */ Object.create(null); + if (!state._volatile.pendingKeyRevocations) + state._volatile["pendingKeyRevocations"] = /* @__PURE__ */ Object.create(null); + const PEKid = findKeyIdByName(state, "pek"); + state._volatile.pendingKeyRevocations[PEKid] = true; + (0, import_sbp6.default)("chelonia/queueInvocation", identityContractID, ["gi.actions/out/rotateKeys", identityContractID, "gi.contracts/identity", "pending", "gi.actions/identity/shareNewPEK"]).catch((e) => { + console.warn(`revokeGroupKeyAndRotateOurPEK: ${e.name} thrown during queueEvent to ${identityContractID}:`, e); + }); + }, + "gi.contracts/group/removeForeignKeys": (contractID, userID, state) => { + const keyIds = findForeignKeysByContractID(state, userID); + if (!keyIds?.length) + return; + const CSKid = findKeyIdByName(state, "csk"); + (0, import_sbp6.default)("chelonia/out/keyDel", { + contractID, + contractName: "gi.contracts/group", + data: keyIds, + signingKeyId: CSKid + }).catch((e) => { + console.warn(`removeForeignKeys: ${e.name} error thrown:`, e); + }); + }, + "gi.contracts/group/sendNonMonetaryUpdateNotification": ({ + contractID, + innerSigningContractID, + meta, + height, + updateData, + getters + }) => { + const { loggedIn } = (0, import_sbp6.default)("state/vuex/state"); + const isUpdatingMyself = loggedIn.identityContractID === innerSigningContractID; + if (!isUpdatingMyself) { + const myProfile = getters.groupProfile(loggedIn.identityContractID); + if (isActionNewerThanUserJoinedDate(height, myProfile)) { + (0, import_sbp6.default)("gi.notifications/emit", "NONMONETARY_CONTRIBUTION_UPDATE", { + createdDate: meta.createdDate, + groupID: contractID, + creatorID: innerSigningContractID, + updateData + }); + } + } + }, + ...referenceTally("gi.contracts/group/referenceTally") + } + }); +})(); +/*! + * Fast "async" scrypt implementation in JavaScript. + * Copyright (c) 2013-2016 Dmitry Chestnykh | BSD License + * https://github.com/dchest/scrypt-async-js + */ +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ +/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ diff --git a/contracts/1.2.0/group.1.2.0.manifest.json b/contracts/1.2.0/group.1.2.0.manifest.json new file mode 100644 index 000000000..57f7e7cff --- /dev/null +++ b/contracts/1.2.0/group.1.2.0.manifest.json @@ -0,0 +1 @@ +{"head":"{\"manifestVersion\":\"1.0.0\"}","body":"{\"name\":\"gi.contracts/group\",\"version\":\"1.2.0\",\"contract\":{\"hash\":\"z9brRu3VQD8amYtP4uifxGw7ELWzRJ7D1U3XANPUBWkCYwEaUqpZ\",\"file\":\"group.js\"},\"signingKeys\":[\"[\\\"edwards25519sha512batch\\\",\\\"IjAFp6gIzHW2HOIXXS9b4A3EKf8t9NNa5nndHcROiDk=\\\",null]\"],\"contractSlim\":{\"file\":\"group-slim.js\",\"hash\":\"z9brRu3VHm39WXNZGC1UuafFGnQoruB1uhrZsDFNZ7Ac5XH6PGRz\"}}","signature":{"keyId":"z2DrjgbCDg34SaBhFjNEF45AVodCUu7QwcFBksz3BDgN4BekrdN","value":"m9BhqZkEjANt/6X3bYi4TXScMvyZSEvRNqN1GdggoqjIh/XmOZL96svWrV4Sm7+cgwE1AuvZ0FOToZhd/1ppCQ=="}} \ No newline at end of file diff --git a/contracts/1.2.0/group.js b/contracts/1.2.0/group.js new file mode 100644 index 000000000..ae2e0fef4 --- /dev/null +++ b/contracts/1.2.0/group.js @@ -0,0 +1,10320 @@ +"use strict"; +(() => { + var __create = Object.create; + var __defProp = Object.defineProperty; + var __getOwnPropDesc = Object.getOwnPropertyDescriptor; + var __getOwnPropNames = Object.getOwnPropertyNames; + var __getProtoOf = Object.getPrototypeOf; + var __hasOwnProp = Object.prototype.hasOwnProperty; + var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; + var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { + get: (a, b) => (typeof require !== "undefined" ? require : a)[b] + }) : x)(function(x) { + if (typeof require !== "undefined") + return require.apply(this, arguments); + throw new Error('Dynamic require of "' + x + '" is not supported'); + }); + var __commonJS = (cb, mod) => function __require2() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; + }; + var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); + }; + var __copyProps = (to, from3, except, desc) => { + if (from3 && typeof from3 === "object" || typeof from3 === "function") { + for (let key of __getOwnPropNames(from3)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from3[key], enumerable: !(desc = __getOwnPropDesc(from3, key)) || desc.enumerable }); + } + return to; + }; + var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod)); + var __publicField = (obj, key, value) => { + __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); + return value; + }; + + // node_modules/blakejs/util.js + var require_util = __commonJS({ + "node_modules/blakejs/util.js"(exports, module) { + var ERROR_MSG_INPUT = "Input must be an string, Buffer or Uint8Array"; + function normalizeInput(input) { + let ret; + if (input instanceof Uint8Array) { + ret = input; + } else if (typeof input === "string") { + const encoder = new TextEncoder(); + ret = encoder.encode(input); + } else { + throw new Error(ERROR_MSG_INPUT); + } + return ret; + } + function toHex(bytes) { + return Array.prototype.map.call(bytes, function(n) { + return (n < 16 ? "0" : "") + n.toString(16); + }).join(""); + } + function uint32ToHex(val) { + return (4294967296 + val).toString(16).substring(1); + } + function debugPrint(label, arr, size) { + let msg = "\n" + label + " = "; + for (let i = 0; i < arr.length; i += 2) { + if (size === 32) { + msg += uint32ToHex(arr[i]).toUpperCase(); + msg += " "; + msg += uint32ToHex(arr[i + 1]).toUpperCase(); + } else if (size === 64) { + msg += uint32ToHex(arr[i + 1]).toUpperCase(); + msg += uint32ToHex(arr[i]).toUpperCase(); + } else + throw new Error("Invalid size " + size); + if (i % 6 === 4) { + msg += "\n" + new Array(label.length + 4).join(" "); + } else if (i < arr.length - 2) { + msg += " "; + } + } + console.log(msg); + } + function testSpeed(hashFn, N, M) { + let startMs = new Date().getTime(); + const input = new Uint8Array(N); + for (let i = 0; i < N; i++) { + input[i] = i % 256; + } + const genMs = new Date().getTime(); + console.log("Generated random input in " + (genMs - startMs) + "ms"); + startMs = genMs; + for (let i = 0; i < M; i++) { + const hashHex = hashFn(input); + const hashMs = new Date().getTime(); + const ms = hashMs - startMs; + startMs = hashMs; + console.log("Hashed in " + ms + "ms: " + hashHex.substring(0, 20) + "..."); + console.log(Math.round(N / (1 << 20) / (ms / 1e3) * 100) / 100 + " MB PER SECOND"); + } + } + module.exports = { + normalizeInput, + toHex, + debugPrint, + testSpeed + }; + } + }); + + // node_modules/blakejs/blake2b.js + var require_blake2b = __commonJS({ + "node_modules/blakejs/blake2b.js"(exports, module) { + var util = require_util(); + function ADD64AA(v2, a, b) { + const o0 = v2[a] + v2[b]; + let o1 = v2[a + 1] + v2[b + 1]; + if (o0 >= 4294967296) { + o1++; + } + v2[a] = o0; + v2[a + 1] = o1; + } + function ADD64AC(v2, a, b0, b1) { + let o0 = v2[a] + b0; + if (b0 < 0) { + o0 += 4294967296; + } + let o1 = v2[a + 1] + b1; + if (o0 >= 4294967296) { + o1++; + } + v2[a] = o0; + v2[a + 1] = o1; + } + function B2B_GET32(arr, i) { + return arr[i] ^ arr[i + 1] << 8 ^ arr[i + 2] << 16 ^ arr[i + 3] << 24; + } + function B2B_G(a, b, c, d, ix, iy) { + const x0 = m[ix]; + const x1 = m[ix + 1]; + const y0 = m[iy]; + const y1 = m[iy + 1]; + ADD64AA(v, a, b); + ADD64AC(v, a, x0, x1); + let xor0 = v[d] ^ v[a]; + let xor1 = v[d + 1] ^ v[a + 1]; + v[d] = xor1; + v[d + 1] = xor0; + ADD64AA(v, c, d); + xor0 = v[b] ^ v[c]; + xor1 = v[b + 1] ^ v[c + 1]; + v[b] = xor0 >>> 24 ^ xor1 << 8; + v[b + 1] = xor1 >>> 24 ^ xor0 << 8; + ADD64AA(v, a, b); + ADD64AC(v, a, y0, y1); + xor0 = v[d] ^ v[a]; + xor1 = v[d + 1] ^ v[a + 1]; + v[d] = xor0 >>> 16 ^ xor1 << 16; + v[d + 1] = xor1 >>> 16 ^ xor0 << 16; + ADD64AA(v, c, d); + xor0 = v[b] ^ v[c]; + xor1 = v[b + 1] ^ v[c + 1]; + v[b] = xor1 >>> 31 ^ xor0 << 1; + v[b + 1] = xor0 >>> 31 ^ xor1 << 1; + } + var BLAKE2B_IV32 = new Uint32Array([ + 4089235720, + 1779033703, + 2227873595, + 3144134277, + 4271175723, + 1013904242, + 1595750129, + 2773480762, + 2917565137, + 1359893119, + 725511199, + 2600822924, + 4215389547, + 528734635, + 327033209, + 1541459225 + ]); + var SIGMA8 = [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 14, + 10, + 4, + 8, + 9, + 15, + 13, + 6, + 1, + 12, + 0, + 2, + 11, + 7, + 5, + 3, + 11, + 8, + 12, + 0, + 5, + 2, + 15, + 13, + 10, + 14, + 3, + 6, + 7, + 1, + 9, + 4, + 7, + 9, + 3, + 1, + 13, + 12, + 11, + 14, + 2, + 6, + 5, + 10, + 4, + 0, + 15, + 8, + 9, + 0, + 5, + 7, + 2, + 4, + 10, + 15, + 14, + 1, + 11, + 12, + 6, + 8, + 3, + 13, + 2, + 12, + 6, + 10, + 0, + 11, + 8, + 3, + 4, + 13, + 7, + 5, + 15, + 14, + 1, + 9, + 12, + 5, + 1, + 15, + 14, + 13, + 4, + 10, + 0, + 7, + 6, + 3, + 9, + 2, + 8, + 11, + 13, + 11, + 7, + 14, + 12, + 1, + 3, + 9, + 5, + 0, + 15, + 4, + 8, + 6, + 2, + 10, + 6, + 15, + 14, + 9, + 11, + 3, + 0, + 8, + 12, + 2, + 13, + 7, + 1, + 4, + 10, + 5, + 10, + 2, + 8, + 4, + 7, + 6, + 1, + 5, + 15, + 11, + 9, + 14, + 3, + 12, + 13, + 0, + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 14, + 10, + 4, + 8, + 9, + 15, + 13, + 6, + 1, + 12, + 0, + 2, + 11, + 7, + 5, + 3 + ]; + var SIGMA82 = new Uint8Array(SIGMA8.map(function(x) { + return x * 2; + })); + var v = new Uint32Array(32); + var m = new Uint32Array(32); + function blake2bCompress(ctx, last) { + let i = 0; + for (i = 0; i < 16; i++) { + v[i] = ctx.h[i]; + v[i + 16] = BLAKE2B_IV32[i]; + } + v[24] = v[24] ^ ctx.t; + v[25] = v[25] ^ ctx.t / 4294967296; + if (last) { + v[28] = ~v[28]; + v[29] = ~v[29]; + } + for (i = 0; i < 32; i++) { + m[i] = B2B_GET32(ctx.b, 4 * i); + } + for (i = 0; i < 12; i++) { + B2B_G(0, 8, 16, 24, SIGMA82[i * 16 + 0], SIGMA82[i * 16 + 1]); + B2B_G(2, 10, 18, 26, SIGMA82[i * 16 + 2], SIGMA82[i * 16 + 3]); + B2B_G(4, 12, 20, 28, SIGMA82[i * 16 + 4], SIGMA82[i * 16 + 5]); + B2B_G(6, 14, 22, 30, SIGMA82[i * 16 + 6], SIGMA82[i * 16 + 7]); + B2B_G(0, 10, 20, 30, SIGMA82[i * 16 + 8], SIGMA82[i * 16 + 9]); + B2B_G(2, 12, 22, 24, SIGMA82[i * 16 + 10], SIGMA82[i * 16 + 11]); + B2B_G(4, 14, 16, 26, SIGMA82[i * 16 + 12], SIGMA82[i * 16 + 13]); + B2B_G(6, 8, 18, 28, SIGMA82[i * 16 + 14], SIGMA82[i * 16 + 15]); + } + for (i = 0; i < 16; i++) { + ctx.h[i] = ctx.h[i] ^ v[i] ^ v[i + 16]; + } + } + var parameterBlock = new Uint8Array([ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ]); + function blake2bInit2(outlen, key, salt, personal) { + if (outlen === 0 || outlen > 64) { + throw new Error("Illegal output length, expected 0 < length <= 64"); + } + if (key && key.length > 64) { + throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64"); + } + if (salt && salt.length !== 16) { + throw new Error("Illegal salt, expected Uint8Array with length is 16"); + } + if (personal && personal.length !== 16) { + throw new Error("Illegal personal, expected Uint8Array with length is 16"); + } + const ctx = { + b: new Uint8Array(128), + h: new Uint32Array(16), + t: 0, + c: 0, + outlen + }; + parameterBlock.fill(0); + parameterBlock[0] = outlen; + if (key) + parameterBlock[1] = key.length; + parameterBlock[2] = 1; + parameterBlock[3] = 1; + if (salt) + parameterBlock.set(salt, 32); + if (personal) + parameterBlock.set(personal, 48); + for (let i = 0; i < 16; i++) { + ctx.h[i] = BLAKE2B_IV32[i] ^ B2B_GET32(parameterBlock, i * 4); + } + if (key) { + blake2bUpdate2(ctx, key); + ctx.c = 128; + } + return ctx; + } + function blake2bUpdate2(ctx, input) { + for (let i = 0; i < input.length; i++) { + if (ctx.c === 128) { + ctx.t += ctx.c; + blake2bCompress(ctx, false); + ctx.c = 0; + } + ctx.b[ctx.c++] = input[i]; + } + } + function blake2bFinal2(ctx) { + ctx.t += ctx.c; + while (ctx.c < 128) { + ctx.b[ctx.c++] = 0; + } + blake2bCompress(ctx, true); + const out = new Uint8Array(ctx.outlen); + for (let i = 0; i < ctx.outlen; i++) { + out[i] = ctx.h[i >> 2] >> 8 * (i & 3); + } + return out; + } + function blake2b3(input, key, outlen, salt, personal) { + outlen = outlen || 64; + input = util.normalizeInput(input); + if (salt) { + salt = util.normalizeInput(salt); + } + if (personal) { + personal = util.normalizeInput(personal); + } + const ctx = blake2bInit2(outlen, key, salt, personal); + blake2bUpdate2(ctx, input); + return blake2bFinal2(ctx); + } + function blake2bHex(input, key, outlen, salt, personal) { + const output = blake2b3(input, key, outlen, salt, personal); + return util.toHex(output); + } + module.exports = { + blake2b: blake2b3, + blake2bHex, + blake2bInit: blake2bInit2, + blake2bUpdate: blake2bUpdate2, + blake2bFinal: blake2bFinal2 + }; + } + }); + + // node_modules/blakejs/blake2s.js + var require_blake2s = __commonJS({ + "node_modules/blakejs/blake2s.js"(exports, module) { + var util = require_util(); + function B2S_GET32(v2, i) { + return v2[i] ^ v2[i + 1] << 8 ^ v2[i + 2] << 16 ^ v2[i + 3] << 24; + } + function B2S_G(a, b, c, d, x, y) { + v[a] = v[a] + v[b] + x; + v[d] = ROTR32(v[d] ^ v[a], 16); + v[c] = v[c] + v[d]; + v[b] = ROTR32(v[b] ^ v[c], 12); + v[a] = v[a] + v[b] + y; + v[d] = ROTR32(v[d] ^ v[a], 8); + v[c] = v[c] + v[d]; + v[b] = ROTR32(v[b] ^ v[c], 7); + } + function ROTR32(x, y) { + return x >>> y ^ x << 32 - y; + } + var BLAKE2S_IV = new Uint32Array([ + 1779033703, + 3144134277, + 1013904242, + 2773480762, + 1359893119, + 2600822924, + 528734635, + 1541459225 + ]); + var SIGMA = new Uint8Array([ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 14, + 10, + 4, + 8, + 9, + 15, + 13, + 6, + 1, + 12, + 0, + 2, + 11, + 7, + 5, + 3, + 11, + 8, + 12, + 0, + 5, + 2, + 15, + 13, + 10, + 14, + 3, + 6, + 7, + 1, + 9, + 4, + 7, + 9, + 3, + 1, + 13, + 12, + 11, + 14, + 2, + 6, + 5, + 10, + 4, + 0, + 15, + 8, + 9, + 0, + 5, + 7, + 2, + 4, + 10, + 15, + 14, + 1, + 11, + 12, + 6, + 8, + 3, + 13, + 2, + 12, + 6, + 10, + 0, + 11, + 8, + 3, + 4, + 13, + 7, + 5, + 15, + 14, + 1, + 9, + 12, + 5, + 1, + 15, + 14, + 13, + 4, + 10, + 0, + 7, + 6, + 3, + 9, + 2, + 8, + 11, + 13, + 11, + 7, + 14, + 12, + 1, + 3, + 9, + 5, + 0, + 15, + 4, + 8, + 6, + 2, + 10, + 6, + 15, + 14, + 9, + 11, + 3, + 0, + 8, + 12, + 2, + 13, + 7, + 1, + 4, + 10, + 5, + 10, + 2, + 8, + 4, + 7, + 6, + 1, + 5, + 15, + 11, + 9, + 14, + 3, + 12, + 13, + 0 + ]); + var v = new Uint32Array(16); + var m = new Uint32Array(16); + function blake2sCompress(ctx, last) { + let i = 0; + for (i = 0; i < 8; i++) { + v[i] = ctx.h[i]; + v[i + 8] = BLAKE2S_IV[i]; + } + v[12] ^= ctx.t; + v[13] ^= ctx.t / 4294967296; + if (last) { + v[14] = ~v[14]; + } + for (i = 0; i < 16; i++) { + m[i] = B2S_GET32(ctx.b, 4 * i); + } + for (i = 0; i < 10; i++) { + B2S_G(0, 4, 8, 12, m[SIGMA[i * 16 + 0]], m[SIGMA[i * 16 + 1]]); + B2S_G(1, 5, 9, 13, m[SIGMA[i * 16 + 2]], m[SIGMA[i * 16 + 3]]); + B2S_G(2, 6, 10, 14, m[SIGMA[i * 16 + 4]], m[SIGMA[i * 16 + 5]]); + B2S_G(3, 7, 11, 15, m[SIGMA[i * 16 + 6]], m[SIGMA[i * 16 + 7]]); + B2S_G(0, 5, 10, 15, m[SIGMA[i * 16 + 8]], m[SIGMA[i * 16 + 9]]); + B2S_G(1, 6, 11, 12, m[SIGMA[i * 16 + 10]], m[SIGMA[i * 16 + 11]]); + B2S_G(2, 7, 8, 13, m[SIGMA[i * 16 + 12]], m[SIGMA[i * 16 + 13]]); + B2S_G(3, 4, 9, 14, m[SIGMA[i * 16 + 14]], m[SIGMA[i * 16 + 15]]); + } + for (i = 0; i < 8; i++) { + ctx.h[i] ^= v[i] ^ v[i + 8]; + } + } + function blake2sInit(outlen, key) { + if (!(outlen > 0 && outlen <= 32)) { + throw new Error("Incorrect output length, should be in [1, 32]"); + } + const keylen = key ? key.length : 0; + if (key && !(keylen > 0 && keylen <= 32)) { + throw new Error("Incorrect key length, should be in [1, 32]"); + } + const ctx = { + h: new Uint32Array(BLAKE2S_IV), + b: new Uint8Array(64), + c: 0, + t: 0, + outlen + }; + ctx.h[0] ^= 16842752 ^ keylen << 8 ^ outlen; + if (keylen > 0) { + blake2sUpdate(ctx, key); + ctx.c = 64; + } + return ctx; + } + function blake2sUpdate(ctx, input) { + for (let i = 0; i < input.length; i++) { + if (ctx.c === 64) { + ctx.t += ctx.c; + blake2sCompress(ctx, false); + ctx.c = 0; + } + ctx.b[ctx.c++] = input[i]; + } + } + function blake2sFinal(ctx) { + ctx.t += ctx.c; + while (ctx.c < 64) { + ctx.b[ctx.c++] = 0; + } + blake2sCompress(ctx, true); + const out = new Uint8Array(ctx.outlen); + for (let i = 0; i < ctx.outlen; i++) { + out[i] = ctx.h[i >> 2] >> 8 * (i & 3) & 255; + } + return out; + } + function blake2s(input, key, outlen) { + outlen = outlen || 32; + input = util.normalizeInput(input); + const ctx = blake2sInit(outlen, key); + blake2sUpdate(ctx, input); + return blake2sFinal(ctx); + } + function blake2sHex(input, key, outlen) { + const output = blake2s(input, key, outlen); + return util.toHex(output); + } + module.exports = { + blake2s, + blake2sHex, + blake2sInit, + blake2sUpdate, + blake2sFinal + }; + } + }); + + // node_modules/blakejs/index.js + var require_blakejs = __commonJS({ + "node_modules/blakejs/index.js"(exports, module) { + var b2b = require_blake2b(); + var b2s = require_blake2s(); + module.exports = { + blake2b: b2b.blake2b, + blake2bHex: b2b.blake2bHex, + blake2bInit: b2b.blake2bInit, + blake2bUpdate: b2b.blake2bUpdate, + blake2bFinal: b2b.blake2bFinal, + blake2s: b2s.blake2s, + blake2sHex: b2s.blake2sHex, + blake2sInit: b2s.blake2sInit, + blake2sUpdate: b2s.blake2sUpdate, + blake2sFinal: b2s.blake2sFinal + }; + } + }); + + // node_modules/base64-js/index.js + var require_base64_js = __commonJS({ + "node_modules/base64-js/index.js"(exports) { + "use strict"; + exports.byteLength = byteLength; + exports.toByteArray = toByteArray; + exports.fromByteArray = fromByteArray; + var lookup = []; + var revLookup = []; + var Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array; + var code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + for (i = 0, len = code.length; i < len; ++i) { + lookup[i] = code[i]; + revLookup[code.charCodeAt(i)] = i; + } + var i; + var len; + revLookup["-".charCodeAt(0)] = 62; + revLookup["_".charCodeAt(0)] = 63; + function getLens(b64) { + var len2 = b64.length; + if (len2 % 4 > 0) { + throw new Error("Invalid string. Length must be a multiple of 4"); + } + var validLen = b64.indexOf("="); + if (validLen === -1) + validLen = len2; + var placeHoldersLen = validLen === len2 ? 0 : 4 - validLen % 4; + return [validLen, placeHoldersLen]; + } + function byteLength(b64) { + var lens = getLens(b64); + var validLen = lens[0]; + var placeHoldersLen = lens[1]; + return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; + } + function _byteLength(b64, validLen, placeHoldersLen) { + return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; + } + function toByteArray(b64) { + var tmp; + var lens = getLens(b64); + var validLen = lens[0]; + var placeHoldersLen = lens[1]; + var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)); + var curByte = 0; + var len2 = placeHoldersLen > 0 ? validLen - 4 : validLen; + var i2; + for (i2 = 0; i2 < len2; i2 += 4) { + tmp = revLookup[b64.charCodeAt(i2)] << 18 | revLookup[b64.charCodeAt(i2 + 1)] << 12 | revLookup[b64.charCodeAt(i2 + 2)] << 6 | revLookup[b64.charCodeAt(i2 + 3)]; + arr[curByte++] = tmp >> 16 & 255; + arr[curByte++] = tmp >> 8 & 255; + arr[curByte++] = tmp & 255; + } + if (placeHoldersLen === 2) { + tmp = revLookup[b64.charCodeAt(i2)] << 2 | revLookup[b64.charCodeAt(i2 + 1)] >> 4; + arr[curByte++] = tmp & 255; + } + if (placeHoldersLen === 1) { + tmp = revLookup[b64.charCodeAt(i2)] << 10 | revLookup[b64.charCodeAt(i2 + 1)] << 4 | revLookup[b64.charCodeAt(i2 + 2)] >> 2; + arr[curByte++] = tmp >> 8 & 255; + arr[curByte++] = tmp & 255; + } + return arr; + } + function tripletToBase64(num) { + return lookup[num >> 18 & 63] + lookup[num >> 12 & 63] + lookup[num >> 6 & 63] + lookup[num & 63]; + } + function encodeChunk(uint8, start, end) { + var tmp; + var output = []; + for (var i2 = start; i2 < end; i2 += 3) { + tmp = (uint8[i2] << 16 & 16711680) + (uint8[i2 + 1] << 8 & 65280) + (uint8[i2 + 2] & 255); + output.push(tripletToBase64(tmp)); + } + return output.join(""); + } + function fromByteArray(uint8) { + var tmp; + var len2 = uint8.length; + var extraBytes = len2 % 3; + var parts = []; + var maxChunkLength = 16383; + for (var i2 = 0, len22 = len2 - extraBytes; i2 < len22; i2 += maxChunkLength) { + parts.push(encodeChunk(uint8, i2, i2 + maxChunkLength > len22 ? len22 : i2 + maxChunkLength)); + } + if (extraBytes === 1) { + tmp = uint8[len2 - 1]; + parts.push(lookup[tmp >> 2] + lookup[tmp << 4 & 63] + "=="); + } else if (extraBytes === 2) { + tmp = (uint8[len2 - 2] << 8) + uint8[len2 - 1]; + parts.push(lookup[tmp >> 10] + lookup[tmp >> 4 & 63] + lookup[tmp << 2 & 63] + "="); + } + return parts.join(""); + } + } + }); + + // node_modules/ieee754/index.js + var require_ieee754 = __commonJS({ + "node_modules/ieee754/index.js"(exports) { + exports.read = function(buffer, offset, isLE, mLen, nBytes) { + var e, m; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var nBits = -7; + var i = isLE ? nBytes - 1 : 0; + var d = isLE ? -1 : 1; + var s = buffer[offset + i]; + i += d; + e = s & (1 << -nBits) - 1; + s >>= -nBits; + nBits += eLen; + for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) { + } + m = e & (1 << -nBits) - 1; + e >>= -nBits; + nBits += mLen; + for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) { + } + if (e === 0) { + e = 1 - eBias; + } else if (e === eMax) { + return m ? NaN : (s ? -1 : 1) * Infinity; + } else { + m = m + Math.pow(2, mLen); + e = e - eBias; + } + return (s ? -1 : 1) * m * Math.pow(2, e - mLen); + }; + exports.write = function(buffer, value, offset, isLE, mLen, nBytes) { + var e, m, c; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0; + var i = isLE ? 0 : nBytes - 1; + var d = isLE ? 1 : -1; + var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; + value = Math.abs(value); + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0; + e = eMax; + } else { + e = Math.floor(Math.log(value) / Math.LN2); + if (value * (c = Math.pow(2, -e)) < 1) { + e--; + c *= 2; + } + if (e + eBias >= 1) { + value += rt / c; + } else { + value += rt * Math.pow(2, 1 - eBias); + } + if (value * c >= 2) { + e++; + c /= 2; + } + if (e + eBias >= eMax) { + m = 0; + e = eMax; + } else if (e + eBias >= 1) { + m = (value * c - 1) * Math.pow(2, mLen); + e = e + eBias; + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); + e = 0; + } + } + for (; mLen >= 8; buffer[offset + i] = m & 255, i += d, m /= 256, mLen -= 8) { + } + e = e << mLen | m; + eLen += mLen; + for (; eLen > 0; buffer[offset + i] = e & 255, i += d, e /= 256, eLen -= 8) { + } + buffer[offset + i - d] |= s * 128; + }; + } + }); + + // node_modules/buffer/index.js + var require_buffer = __commonJS({ + "node_modules/buffer/index.js"(exports) { + "use strict"; + var base64 = require_base64_js(); + var ieee754 = require_ieee754(); + var customInspectSymbol = typeof Symbol === "function" && typeof Symbol["for"] === "function" ? Symbol["for"]("nodejs.util.inspect.custom") : null; + exports.Buffer = Buffer2; + exports.SlowBuffer = SlowBuffer; + exports.INSPECT_MAX_BYTES = 50; + var K_MAX_LENGTH = 2147483647; + exports.kMaxLength = K_MAX_LENGTH; + Buffer2.TYPED_ARRAY_SUPPORT = typedArraySupport(); + if (!Buffer2.TYPED_ARRAY_SUPPORT && typeof console !== "undefined" && 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 typedArraySupport() { + try { + const arr = new Uint8Array(1); + const proto3 = { foo: function() { + return 42; + } }; + Object.setPrototypeOf(proto3, Uint8Array.prototype); + Object.setPrototypeOf(arr, proto3); + return arr.foo() === 42; + } catch (e) { + return false; + } + } + Object.defineProperty(Buffer2.prototype, "parent", { + enumerable: true, + get: function() { + if (!Buffer2.isBuffer(this)) + return void 0; + return this.buffer; + } + }); + Object.defineProperty(Buffer2.prototype, "offset", { + enumerable: true, + get: function() { + if (!Buffer2.isBuffer(this)) + return void 0; + return this.byteOffset; + } + }); + function createBuffer(length2) { + if (length2 > K_MAX_LENGTH) { + throw new RangeError('The value "' + length2 + '" is invalid for option "size"'); + } + const buf = new Uint8Array(length2); + Object.setPrototypeOf(buf, Buffer2.prototype); + return buf; + } + function Buffer2(arg, encodingOrOffset, length2) { + if (typeof arg === "number") { + if (typeof encodingOrOffset === "string") { + throw new TypeError('The "string" argument must be of type string. Received type number'); + } + return allocUnsafe(arg); + } + return from3(arg, encodingOrOffset, length2); + } + Buffer2.poolSize = 8192; + function from3(value, encodingOrOffset, length2) { + if (typeof value === "string") { + return fromString(value, encodingOrOffset); + } + if (ArrayBuffer.isView(value)) { + return fromArrayView(value); + } + if (value == null) { + throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value); + } + if (isInstance(value, ArrayBuffer) || value && isInstance(value.buffer, ArrayBuffer)) { + return fromArrayBuffer(value, encodingOrOffset, length2); + } + if (typeof SharedArrayBuffer !== "undefined" && (isInstance(value, SharedArrayBuffer) || value && isInstance(value.buffer, SharedArrayBuffer))) { + return fromArrayBuffer(value, encodingOrOffset, length2); + } + if (typeof value === "number") { + throw new TypeError('The "value" argument must not be of type number. Received type number'); + } + const valueOf = value.valueOf && value.valueOf(); + if (valueOf != null && valueOf !== value) { + return Buffer2.from(valueOf, encodingOrOffset, length2); + } + const b = fromObject(value); + if (b) + return b; + if (typeof Symbol !== "undefined" && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === "function") { + return Buffer2.from(value[Symbol.toPrimitive]("string"), encodingOrOffset, length2); + } + throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value); + } + Buffer2.from = function(value, encodingOrOffset, length2) { + return from3(value, encodingOrOffset, length2); + }; + Object.setPrototypeOf(Buffer2.prototype, Uint8Array.prototype); + Object.setPrototypeOf(Buffer2, Uint8Array); + function assertSize(size) { + if (typeof size !== "number") { + throw new TypeError('"size" argument must be of type number'); + } else if (size < 0) { + throw new RangeError('The value "' + size + '" is invalid for option "size"'); + } + } + function alloc(size, fill, encoding) { + assertSize(size); + if (size <= 0) { + return createBuffer(size); + } + if (fill !== void 0) { + return typeof encoding === "string" ? createBuffer(size).fill(fill, encoding) : createBuffer(size).fill(fill); + } + return createBuffer(size); + } + Buffer2.alloc = function(size, fill, encoding) { + return alloc(size, fill, encoding); + }; + function allocUnsafe(size) { + assertSize(size); + return createBuffer(size < 0 ? 0 : checked(size) | 0); + } + Buffer2.allocUnsafe = function(size) { + return allocUnsafe(size); + }; + Buffer2.allocUnsafeSlow = function(size) { + return allocUnsafe(size); + }; + function fromString(string3, encoding) { + if (typeof encoding !== "string" || encoding === "") { + encoding = "utf8"; + } + if (!Buffer2.isEncoding(encoding)) { + throw new TypeError("Unknown encoding: " + encoding); + } + const length2 = byteLength(string3, encoding) | 0; + let buf = createBuffer(length2); + const actual = buf.write(string3, encoding); + if (actual !== length2) { + buf = buf.slice(0, actual); + } + return buf; + } + function fromArrayLike(array) { + const length2 = array.length < 0 ? 0 : checked(array.length) | 0; + const buf = createBuffer(length2); + for (let i = 0; i < length2; i += 1) { + buf[i] = array[i] & 255; + } + return buf; + } + function fromArrayView(arrayView) { + if (isInstance(arrayView, Uint8Array)) { + const copy = new Uint8Array(arrayView); + return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength); + } + return fromArrayLike(arrayView); + } + function fromArrayBuffer(array, byteOffset, length2) { + if (byteOffset < 0 || array.byteLength < byteOffset) { + throw new RangeError('"offset" is outside of buffer bounds'); + } + if (array.byteLength < byteOffset + (length2 || 0)) { + throw new RangeError('"length" is outside of buffer bounds'); + } + let buf; + if (byteOffset === void 0 && length2 === void 0) { + buf = new Uint8Array(array); + } else if (length2 === void 0) { + buf = new Uint8Array(array, byteOffset); + } else { + buf = new Uint8Array(array, byteOffset, length2); + } + Object.setPrototypeOf(buf, Buffer2.prototype); + return buf; + } + function fromObject(obj) { + if (Buffer2.isBuffer(obj)) { + const len = checked(obj.length) | 0; + const buf = createBuffer(len); + if (buf.length === 0) { + return buf; + } + obj.copy(buf, 0, 0, len); + return buf; + } + if (obj.length !== void 0) { + if (typeof obj.length !== "number" || numberIsNaN(obj.length)) { + return createBuffer(0); + } + return fromArrayLike(obj); + } + if (obj.type === "Buffer" && Array.isArray(obj.data)) { + return fromArrayLike(obj.data); + } + } + function checked(length2) { + if (length2 >= K_MAX_LENGTH) { + throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + K_MAX_LENGTH.toString(16) + " bytes"); + } + return length2 | 0; + } + function SlowBuffer(length2) { + if (+length2 != length2) { + length2 = 0; + } + return Buffer2.alloc(+length2); + } + Buffer2.isBuffer = function isBuffer(b) { + return b != null && b._isBuffer === true && b !== Buffer2.prototype; + }; + Buffer2.compare = function compare(a, b) { + if (isInstance(a, Uint8Array)) + a = Buffer2.from(a, a.offset, a.byteLength); + if (isInstance(b, Uint8Array)) + b = Buffer2.from(b, b.offset, b.byteLength); + if (!Buffer2.isBuffer(a) || !Buffer2.isBuffer(b)) { + throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'); + } + if (a === b) + return 0; + let x = a.length; + let y = b.length; + for (let i = 0, len = Math.min(x, y); i < len; ++i) { + if (a[i] !== b[i]) { + x = a[i]; + y = b[i]; + break; + } + } + if (x < y) + return -1; + if (y < x) + return 1; + return 0; + }; + Buffer2.isEncoding = function isEncoding(encoding) { + switch (String(encoding).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 true; + default: + return false; + } + }; + Buffer2.concat = function concat(list, length2) { + if (!Array.isArray(list)) { + throw new TypeError('"list" argument must be an Array of Buffers'); + } + if (list.length === 0) { + return Buffer2.alloc(0); + } + let i; + if (length2 === void 0) { + length2 = 0; + for (i = 0; i < list.length; ++i) { + length2 += list[i].length; + } + } + const buffer = Buffer2.allocUnsafe(length2); + let pos = 0; + for (i = 0; i < list.length; ++i) { + let buf = list[i]; + if (isInstance(buf, Uint8Array)) { + if (pos + buf.length > buffer.length) { + if (!Buffer2.isBuffer(buf)) + buf = Buffer2.from(buf); + buf.copy(buffer, pos); + } else { + Uint8Array.prototype.set.call(buffer, buf, pos); + } + } else if (!Buffer2.isBuffer(buf)) { + throw new TypeError('"list" argument must be an Array of Buffers'); + } else { + buf.copy(buffer, pos); + } + pos += buf.length; + } + return buffer; + }; + function byteLength(string3, encoding) { + if (Buffer2.isBuffer(string3)) { + return string3.length; + } + if (ArrayBuffer.isView(string3) || isInstance(string3, ArrayBuffer)) { + return string3.byteLength; + } + if (typeof string3 !== "string") { + throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof string3); + } + const len = string3.length; + const mustMatch = arguments.length > 2 && arguments[2] === true; + if (!mustMatch && len === 0) + return 0; + let loweredCase = false; + for (; ; ) { + switch (encoding) { + case "ascii": + case "latin1": + case "binary": + return len; + case "utf8": + case "utf-8": + return utf8ToBytes(string3).length; + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return len * 2; + case "hex": + return len >>> 1; + case "base64": + return base64ToBytes(string3).length; + default: + if (loweredCase) { + return mustMatch ? -1 : utf8ToBytes(string3).length; + } + encoding = ("" + encoding).toLowerCase(); + loweredCase = true; + } + } + } + Buffer2.byteLength = byteLength; + function slowToString(encoding, start, end) { + let loweredCase = false; + if (start === void 0 || start < 0) { + start = 0; + } + if (start > this.length) { + return ""; + } + if (end === void 0 || end > this.length) { + end = this.length; + } + if (end <= 0) { + return ""; + } + end >>>= 0; + start >>>= 0; + if (end <= start) { + return ""; + } + if (!encoding) + encoding = "utf8"; + while (true) { + switch (encoding) { + case "hex": + return hexSlice(this, start, end); + case "utf8": + case "utf-8": + return utf8Slice(this, start, end); + case "ascii": + return asciiSlice(this, start, end); + case "latin1": + case "binary": + return latin1Slice(this, start, end); + case "base64": + return base64Slice(this, start, end); + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return utf16leSlice(this, start, end); + default: + if (loweredCase) + throw new TypeError("Unknown encoding: " + encoding); + encoding = (encoding + "").toLowerCase(); + loweredCase = true; + } + } + } + Buffer2.prototype._isBuffer = true; + function swap(b, n, m) { + const i = b[n]; + b[n] = b[m]; + b[m] = i; + } + Buffer2.prototype.swap16 = function swap16() { + const len = this.length; + if (len % 2 !== 0) { + throw new RangeError("Buffer size must be a multiple of 16-bits"); + } + for (let i = 0; i < len; i += 2) { + swap(this, i, i + 1); + } + return this; + }; + Buffer2.prototype.swap32 = function swap32() { + const len = this.length; + if (len % 4 !== 0) { + throw new RangeError("Buffer size must be a multiple of 32-bits"); + } + for (let i = 0; i < len; i += 4) { + swap(this, i, i + 3); + swap(this, i + 1, i + 2); + } + return this; + }; + Buffer2.prototype.swap64 = function swap64() { + const len = this.length; + if (len % 8 !== 0) { + throw new RangeError("Buffer size must be a multiple of 64-bits"); + } + for (let i = 0; i < len; i += 8) { + swap(this, i, i + 7); + swap(this, i + 1, i + 6); + swap(this, i + 2, i + 5); + swap(this, i + 3, i + 4); + } + return this; + }; + Buffer2.prototype.toString = function toString() { + const length2 = this.length; + if (length2 === 0) + return ""; + if (arguments.length === 0) + return utf8Slice(this, 0, length2); + return slowToString.apply(this, arguments); + }; + Buffer2.prototype.toLocaleString = Buffer2.prototype.toString; + Buffer2.prototype.equals = function equals3(b) { + if (!Buffer2.isBuffer(b)) + throw new TypeError("Argument must be a Buffer"); + if (this === b) + return true; + return Buffer2.compare(this, b) === 0; + }; + Buffer2.prototype.inspect = function inspect() { + let str = ""; + const max = exports.INSPECT_MAX_BYTES; + str = this.toString("hex", 0, max).replace(/(.{2})/g, "$1 ").trim(); + if (this.length > max) + str += " ... "; + return ""; + }; + if (customInspectSymbol) { + Buffer2.prototype[customInspectSymbol] = Buffer2.prototype.inspect; + } + Buffer2.prototype.compare = function compare(target, start, end, thisStart, thisEnd) { + if (isInstance(target, Uint8Array)) { + target = Buffer2.from(target, target.offset, target.byteLength); + } + if (!Buffer2.isBuffer(target)) { + throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof target); + } + if (start === void 0) { + start = 0; + } + if (end === void 0) { + end = target ? target.length : 0; + } + if (thisStart === void 0) { + thisStart = 0; + } + if (thisEnd === void 0) { + thisEnd = this.length; + } + if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { + throw new RangeError("out of range index"); + } + if (thisStart >= thisEnd && start >= end) { + return 0; + } + if (thisStart >= thisEnd) { + return -1; + } + if (start >= end) { + return 1; + } + start >>>= 0; + end >>>= 0; + thisStart >>>= 0; + thisEnd >>>= 0; + if (this === target) + return 0; + let x = thisEnd - thisStart; + let y = end - start; + const len = Math.min(x, y); + const thisCopy = this.slice(thisStart, thisEnd); + const targetCopy = target.slice(start, end); + for (let i = 0; i < len; ++i) { + if (thisCopy[i] !== targetCopy[i]) { + x = thisCopy[i]; + y = targetCopy[i]; + break; + } + } + if (x < y) + return -1; + if (y < x) + return 1; + return 0; + }; + function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) { + if (buffer.length === 0) + return -1; + if (typeof byteOffset === "string") { + encoding = byteOffset; + byteOffset = 0; + } else if (byteOffset > 2147483647) { + byteOffset = 2147483647; + } else if (byteOffset < -2147483648) { + byteOffset = -2147483648; + } + byteOffset = +byteOffset; + if (numberIsNaN(byteOffset)) { + byteOffset = dir ? 0 : buffer.length - 1; + } + if (byteOffset < 0) + byteOffset = buffer.length + byteOffset; + if (byteOffset >= buffer.length) { + if (dir) + return -1; + else + byteOffset = buffer.length - 1; + } else if (byteOffset < 0) { + if (dir) + byteOffset = 0; + else + return -1; + } + if (typeof val === "string") { + val = Buffer2.from(val, encoding); + } + if (Buffer2.isBuffer(val)) { + if (val.length === 0) { + return -1; + } + return arrayIndexOf(buffer, val, byteOffset, encoding, dir); + } else if (typeof val === "number") { + val = val & 255; + if (typeof Uint8Array.prototype.indexOf === "function") { + if (dir) { + return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset); + } else { + return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset); + } + } + return arrayIndexOf(buffer, [val], byteOffset, encoding, dir); + } + throw new TypeError("val must be string, number or Buffer"); + } + function arrayIndexOf(arr, val, byteOffset, encoding, dir) { + let indexSize = 1; + let arrLength = arr.length; + let valLength = val.length; + if (encoding !== void 0) { + encoding = String(encoding).toLowerCase(); + if (encoding === "ucs2" || encoding === "ucs-2" || encoding === "utf16le" || encoding === "utf-16le") { + if (arr.length < 2 || val.length < 2) { + return -1; + } + indexSize = 2; + arrLength /= 2; + valLength /= 2; + byteOffset /= 2; + } + } + function read2(buf, i2) { + if (indexSize === 1) { + return buf[i2]; + } else { + return buf.readUInt16BE(i2 * indexSize); + } + } + let i; + if (dir) { + let foundIndex = -1; + for (i = byteOffset; i < arrLength; i++) { + if (read2(arr, i) === read2(val, foundIndex === -1 ? 0 : i - foundIndex)) { + if (foundIndex === -1) + foundIndex = i; + if (i - foundIndex + 1 === valLength) + return foundIndex * indexSize; + } else { + if (foundIndex !== -1) + i -= i - foundIndex; + foundIndex = -1; + } + } + } else { + if (byteOffset + valLength > arrLength) + byteOffset = arrLength - valLength; + for (i = byteOffset; i >= 0; i--) { + let found = true; + for (let j = 0; j < valLength; j++) { + if (read2(arr, i + j) !== read2(val, j)) { + found = false; + break; + } + } + if (found) + return i; + } + } + return -1; + } + Buffer2.prototype.includes = function includes(val, byteOffset, encoding) { + return this.indexOf(val, byteOffset, encoding) !== -1; + }; + Buffer2.prototype.indexOf = function indexOf(val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, true); + }; + Buffer2.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, false); + }; + function hexWrite(buf, string3, offset, length2) { + offset = Number(offset) || 0; + const remaining = buf.length - offset; + if (!length2) { + length2 = remaining; + } else { + length2 = Number(length2); + if (length2 > remaining) { + length2 = remaining; + } + } + const strLen = string3.length; + if (length2 > strLen / 2) { + length2 = strLen / 2; + } + let i; + for (i = 0; i < length2; ++i) { + const parsed = parseInt(string3.substr(i * 2, 2), 16); + if (numberIsNaN(parsed)) + return i; + buf[offset + i] = parsed; + } + return i; + } + function utf8Write(buf, string3, offset, length2) { + return blitBuffer(utf8ToBytes(string3, buf.length - offset), buf, offset, length2); + } + function asciiWrite(buf, string3, offset, length2) { + return blitBuffer(asciiToBytes(string3), buf, offset, length2); + } + function base64Write(buf, string3, offset, length2) { + return blitBuffer(base64ToBytes(string3), buf, offset, length2); + } + function ucs2Write(buf, string3, offset, length2) { + return blitBuffer(utf16leToBytes(string3, buf.length - offset), buf, offset, length2); + } + Buffer2.prototype.write = function write(string3, offset, length2, encoding) { + if (offset === void 0) { + encoding = "utf8"; + length2 = this.length; + offset = 0; + } else if (length2 === void 0 && typeof offset === "string") { + encoding = offset; + length2 = this.length; + offset = 0; + } else if (isFinite(offset)) { + offset = offset >>> 0; + if (isFinite(length2)) { + length2 = length2 >>> 0; + if (encoding === void 0) + encoding = "utf8"; + } else { + encoding = length2; + length2 = void 0; + } + } else { + throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported"); + } + const remaining = this.length - offset; + if (length2 === void 0 || length2 > remaining) + length2 = remaining; + if (string3.length > 0 && (length2 < 0 || offset < 0) || offset > this.length) { + throw new RangeError("Attempt to write outside buffer bounds"); + } + if (!encoding) + encoding = "utf8"; + let loweredCase = false; + for (; ; ) { + switch (encoding) { + case "hex": + return hexWrite(this, string3, offset, length2); + case "utf8": + case "utf-8": + return utf8Write(this, string3, offset, length2); + case "ascii": + case "latin1": + case "binary": + return asciiWrite(this, string3, offset, length2); + case "base64": + return base64Write(this, string3, offset, length2); + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return ucs2Write(this, string3, offset, length2); + default: + if (loweredCase) + throw new TypeError("Unknown encoding: " + encoding); + encoding = ("" + encoding).toLowerCase(); + loweredCase = true; + } + } + }; + Buffer2.prototype.toJSON = function toJSON() { + return { + type: "Buffer", + data: Array.prototype.slice.call(this._arr || this, 0) + }; + }; + function base64Slice(buf, start, end) { + if (start === 0 && end === buf.length) { + return base64.fromByteArray(buf); + } else { + return base64.fromByteArray(buf.slice(start, end)); + } + } + function utf8Slice(buf, start, end) { + end = Math.min(buf.length, end); + const res = []; + let i = start; + while (i < end) { + const firstByte = buf[i]; + let codePoint = null; + let bytesPerSequence = firstByte > 239 ? 4 : firstByte > 223 ? 3 : firstByte > 191 ? 2 : 1; + if (i + bytesPerSequence <= end) { + let secondByte, thirdByte, fourthByte, tempCodePoint; + switch (bytesPerSequence) { + case 1: + if (firstByte < 128) { + codePoint = firstByte; + } + break; + case 2: + secondByte = buf[i + 1]; + if ((secondByte & 192) === 128) { + tempCodePoint = (firstByte & 31) << 6 | secondByte & 63; + if (tempCodePoint > 127) { + codePoint = tempCodePoint; + } + } + break; + case 3: + secondByte = buf[i + 1]; + thirdByte = buf[i + 2]; + if ((secondByte & 192) === 128 && (thirdByte & 192) === 128) { + tempCodePoint = (firstByte & 15) << 12 | (secondByte & 63) << 6 | thirdByte & 63; + if (tempCodePoint > 2047 && (tempCodePoint < 55296 || tempCodePoint > 57343)) { + codePoint = tempCodePoint; + } + } + break; + case 4: + secondByte = buf[i + 1]; + thirdByte = buf[i + 2]; + fourthByte = buf[i + 3]; + if ((secondByte & 192) === 128 && (thirdByte & 192) === 128 && (fourthByte & 192) === 128) { + tempCodePoint = (firstByte & 15) << 18 | (secondByte & 63) << 12 | (thirdByte & 63) << 6 | fourthByte & 63; + if (tempCodePoint > 65535 && tempCodePoint < 1114112) { + codePoint = tempCodePoint; + } + } + } + } + if (codePoint === null) { + codePoint = 65533; + bytesPerSequence = 1; + } else if (codePoint > 65535) { + codePoint -= 65536; + res.push(codePoint >>> 10 & 1023 | 55296); + codePoint = 56320 | codePoint & 1023; + } + res.push(codePoint); + i += bytesPerSequence; + } + return decodeCodePointsArray(res); + } + var MAX_ARGUMENTS_LENGTH = 4096; + function decodeCodePointsArray(codePoints) { + const len = codePoints.length; + if (len <= MAX_ARGUMENTS_LENGTH) { + return String.fromCharCode.apply(String, codePoints); + } + let res = ""; + let i = 0; + while (i < len) { + res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)); + } + return res; + } + function asciiSlice(buf, start, end) { + let ret = ""; + end = Math.min(buf.length, end); + for (let i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i] & 127); + } + return ret; + } + function latin1Slice(buf, start, end) { + let ret = ""; + end = Math.min(buf.length, end); + for (let i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i]); + } + return ret; + } + function hexSlice(buf, start, end) { + const len = buf.length; + if (!start || start < 0) + start = 0; + if (!end || end < 0 || end > len) + end = len; + let out = ""; + for (let i = start; i < end; ++i) { + out += hexSliceLookupTable[buf[i]]; + } + return out; + } + function utf16leSlice(buf, start, end) { + const bytes = buf.slice(start, end); + let res = ""; + for (let i = 0; i < bytes.length - 1; i += 2) { + res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256); + } + return res; + } + Buffer2.prototype.slice = function slice(start, end) { + const len = this.length; + start = ~~start; + end = end === void 0 ? len : ~~end; + if (start < 0) { + start += len; + if (start < 0) + start = 0; + } else if (start > len) { + start = len; + } + if (end < 0) { + end += len; + if (end < 0) + end = 0; + } else if (end > len) { + end = len; + } + if (end < start) + end = start; + const newBuf = this.subarray(start, end); + Object.setPrototypeOf(newBuf, Buffer2.prototype); + return newBuf; + }; + function checkOffset(offset, ext, length2) { + if (offset % 1 !== 0 || offset < 0) + throw new RangeError("offset is not uint"); + if (offset + ext > length2) + throw new RangeError("Trying to access beyond buffer length"); + } + Buffer2.prototype.readUintLE = Buffer2.prototype.readUIntLE = function readUIntLE(offset, byteLength2, noAssert) { + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) + checkOffset(offset, byteLength2, this.length); + let val = this[offset]; + let mul = 1; + let i = 0; + while (++i < byteLength2 && (mul *= 256)) { + val += this[offset + i] * mul; + } + return val; + }; + Buffer2.prototype.readUintBE = Buffer2.prototype.readUIntBE = function readUIntBE(offset, byteLength2, noAssert) { + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) { + checkOffset(offset, byteLength2, this.length); + } + let val = this[offset + --byteLength2]; + let mul = 1; + while (byteLength2 > 0 && (mul *= 256)) { + val += this[offset + --byteLength2] * mul; + } + return val; + }; + Buffer2.prototype.readUint8 = Buffer2.prototype.readUInt8 = function readUInt8(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 1, this.length); + return this[offset]; + }; + Buffer2.prototype.readUint16LE = Buffer2.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 2, this.length); + return this[offset] | this[offset + 1] << 8; + }; + Buffer2.prototype.readUint16BE = Buffer2.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 2, this.length); + return this[offset] << 8 | this[offset + 1]; + }; + Buffer2.prototype.readUint32LE = Buffer2.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 16777216; + }; + Buffer2.prototype.readUint32BE = Buffer2.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return this[offset] * 16777216 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]); + }; + Buffer2.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE(offset) { + offset = offset >>> 0; + validateNumber(offset, "offset"); + const first = this[offset]; + const last = this[offset + 7]; + if (first === void 0 || last === void 0) { + boundsError(offset, this.length - 8); + } + const lo = first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24; + const hi = this[++offset] + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + last * 2 ** 24; + return BigInt(lo) + (BigInt(hi) << BigInt(32)); + }); + Buffer2.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE(offset) { + offset = offset >>> 0; + validateNumber(offset, "offset"); + const first = this[offset]; + const last = this[offset + 7]; + if (first === void 0 || last === void 0) { + boundsError(offset, this.length - 8); + } + const hi = first * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset]; + const lo = this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last; + return (BigInt(hi) << BigInt(32)) + BigInt(lo); + }); + Buffer2.prototype.readIntLE = function readIntLE(offset, byteLength2, noAssert) { + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) + checkOffset(offset, byteLength2, this.length); + let val = this[offset]; + let mul = 1; + let i = 0; + while (++i < byteLength2 && (mul *= 256)) { + val += this[offset + i] * mul; + } + mul *= 128; + if (val >= mul) + val -= Math.pow(2, 8 * byteLength2); + return val; + }; + Buffer2.prototype.readIntBE = function readIntBE(offset, byteLength2, noAssert) { + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) + checkOffset(offset, byteLength2, this.length); + let i = byteLength2; + let mul = 1; + let val = this[offset + --i]; + while (i > 0 && (mul *= 256)) { + val += this[offset + --i] * mul; + } + mul *= 128; + if (val >= mul) + val -= Math.pow(2, 8 * byteLength2); + return val; + }; + Buffer2.prototype.readInt8 = function readInt8(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 1, this.length); + if (!(this[offset] & 128)) + return this[offset]; + return (255 - this[offset] + 1) * -1; + }; + Buffer2.prototype.readInt16LE = function readInt16LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 2, this.length); + const val = this[offset] | this[offset + 1] << 8; + return val & 32768 ? val | 4294901760 : val; + }; + Buffer2.prototype.readInt16BE = function readInt16BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 2, this.length); + const val = this[offset + 1] | this[offset] << 8; + return val & 32768 ? val | 4294901760 : val; + }; + Buffer2.prototype.readInt32LE = function readInt32LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24; + }; + Buffer2.prototype.readInt32BE = function readInt32BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]; + }; + Buffer2.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE(offset) { + offset = offset >>> 0; + validateNumber(offset, "offset"); + const first = this[offset]; + const last = this[offset + 7]; + if (first === void 0 || last === void 0) { + boundsError(offset, this.length - 8); + } + const val = this[offset + 4] + this[offset + 5] * 2 ** 8 + this[offset + 6] * 2 ** 16 + (last << 24); + return (BigInt(val) << BigInt(32)) + BigInt(first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24); + }); + Buffer2.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE(offset) { + offset = offset >>> 0; + validateNumber(offset, "offset"); + const first = this[offset]; + const last = this[offset + 7]; + if (first === void 0 || last === void 0) { + boundsError(offset, this.length - 8); + } + const val = (first << 24) + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset]; + return (BigInt(val) << BigInt(32)) + BigInt(this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last); + }); + Buffer2.prototype.readFloatLE = function readFloatLE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return ieee754.read(this, offset, true, 23, 4); + }; + Buffer2.prototype.readFloatBE = function readFloatBE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return ieee754.read(this, offset, false, 23, 4); + }; + Buffer2.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 8, this.length); + return ieee754.read(this, offset, true, 52, 8); + }; + Buffer2.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 8, this.length); + return ieee754.read(this, offset, false, 52, 8); + }; + function checkInt(buf, value, offset, ext, max, min) { + if (!Buffer2.isBuffer(buf)) + throw new TypeError('"buffer" argument must be a Buffer instance'); + if (value > max || value < min) + throw new RangeError('"value" argument is out of bounds'); + if (offset + ext > buf.length) + throw new RangeError("Index out of range"); + } + Buffer2.prototype.writeUintLE = Buffer2.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength2, noAssert) { + value = +value; + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) { + const maxBytes = Math.pow(2, 8 * byteLength2) - 1; + checkInt(this, value, offset, byteLength2, maxBytes, 0); + } + let mul = 1; + let i = 0; + this[offset] = value & 255; + while (++i < byteLength2 && (mul *= 256)) { + this[offset + i] = value / mul & 255; + } + return offset + byteLength2; + }; + Buffer2.prototype.writeUintBE = Buffer2.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength2, noAssert) { + value = +value; + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) { + const maxBytes = Math.pow(2, 8 * byteLength2) - 1; + checkInt(this, value, offset, byteLength2, maxBytes, 0); + } + let i = byteLength2 - 1; + let mul = 1; + this[offset + i] = value & 255; + while (--i >= 0 && (mul *= 256)) { + this[offset + i] = value / mul & 255; + } + return offset + byteLength2; + }; + Buffer2.prototype.writeUint8 = Buffer2.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 1, 255, 0); + this[offset] = value & 255; + return offset + 1; + }; + Buffer2.prototype.writeUint16LE = Buffer2.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 2, 65535, 0); + this[offset] = value & 255; + this[offset + 1] = value >>> 8; + return offset + 2; + }; + Buffer2.prototype.writeUint16BE = Buffer2.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 2, 65535, 0); + this[offset] = value >>> 8; + this[offset + 1] = value & 255; + return offset + 2; + }; + Buffer2.prototype.writeUint32LE = Buffer2.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 4, 4294967295, 0); + this[offset + 3] = value >>> 24; + this[offset + 2] = value >>> 16; + this[offset + 1] = value >>> 8; + this[offset] = value & 255; + return offset + 4; + }; + Buffer2.prototype.writeUint32BE = Buffer2.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 4, 4294967295, 0); + this[offset] = value >>> 24; + this[offset + 1] = value >>> 16; + this[offset + 2] = value >>> 8; + this[offset + 3] = value & 255; + return offset + 4; + }; + function wrtBigUInt64LE(buf, value, offset, min, max) { + checkIntBI(value, min, max, buf, offset, 7); + let lo = Number(value & BigInt(4294967295)); + buf[offset++] = lo; + lo = lo >> 8; + buf[offset++] = lo; + lo = lo >> 8; + buf[offset++] = lo; + lo = lo >> 8; + buf[offset++] = lo; + let hi = Number(value >> BigInt(32) & BigInt(4294967295)); + buf[offset++] = hi; + hi = hi >> 8; + buf[offset++] = hi; + hi = hi >> 8; + buf[offset++] = hi; + hi = hi >> 8; + buf[offset++] = hi; + return offset; + } + function wrtBigUInt64BE(buf, value, offset, min, max) { + checkIntBI(value, min, max, buf, offset, 7); + let lo = Number(value & BigInt(4294967295)); + buf[offset + 7] = lo; + lo = lo >> 8; + buf[offset + 6] = lo; + lo = lo >> 8; + buf[offset + 5] = lo; + lo = lo >> 8; + buf[offset + 4] = lo; + let hi = Number(value >> BigInt(32) & BigInt(4294967295)); + buf[offset + 3] = hi; + hi = hi >> 8; + buf[offset + 2] = hi; + hi = hi >> 8; + buf[offset + 1] = hi; + hi = hi >> 8; + buf[offset] = hi; + return offset + 8; + } + Buffer2.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE(value, offset = 0) { + return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt("0xffffffffffffffff")); + }); + Buffer2.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE(value, offset = 0) { + return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt("0xffffffffffffffff")); + }); + Buffer2.prototype.writeIntLE = function writeIntLE(value, offset, byteLength2, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + const limit = Math.pow(2, 8 * byteLength2 - 1); + checkInt(this, value, offset, byteLength2, limit - 1, -limit); + } + let i = 0; + let mul = 1; + let sub = 0; + this[offset] = value & 255; + while (++i < byteLength2 && (mul *= 256)) { + if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { + sub = 1; + } + this[offset + i] = (value / mul >> 0) - sub & 255; + } + return offset + byteLength2; + }; + Buffer2.prototype.writeIntBE = function writeIntBE(value, offset, byteLength2, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + const limit = Math.pow(2, 8 * byteLength2 - 1); + checkInt(this, value, offset, byteLength2, limit - 1, -limit); + } + let i = byteLength2 - 1; + let mul = 1; + let sub = 0; + this[offset + i] = value & 255; + while (--i >= 0 && (mul *= 256)) { + if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { + sub = 1; + } + this[offset + i] = (value / mul >> 0) - sub & 255; + } + return offset + byteLength2; + }; + Buffer2.prototype.writeInt8 = function writeInt8(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 1, 127, -128); + if (value < 0) + value = 255 + value + 1; + this[offset] = value & 255; + return offset + 1; + }; + Buffer2.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 2, 32767, -32768); + this[offset] = value & 255; + this[offset + 1] = value >>> 8; + return offset + 2; + }; + Buffer2.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 2, 32767, -32768); + this[offset] = value >>> 8; + this[offset + 1] = value & 255; + return offset + 2; + }; + Buffer2.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 4, 2147483647, -2147483648); + this[offset] = value & 255; + this[offset + 1] = value >>> 8; + this[offset + 2] = value >>> 16; + this[offset + 3] = value >>> 24; + return offset + 4; + }; + Buffer2.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 4, 2147483647, -2147483648); + if (value < 0) + value = 4294967295 + value + 1; + this[offset] = value >>> 24; + this[offset + 1] = value >>> 16; + this[offset + 2] = value >>> 8; + this[offset + 3] = value & 255; + return offset + 4; + }; + Buffer2.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE(value, offset = 0) { + return wrtBigUInt64LE(this, value, offset, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff")); + }); + Buffer2.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE(value, offset = 0) { + return wrtBigUInt64BE(this, value, offset, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff")); + }); + function checkIEEE754(buf, value, offset, ext, max, min) { + if (offset + ext > buf.length) + throw new RangeError("Index out of range"); + if (offset < 0) + throw new RangeError("Index out of range"); + } + function writeFloat(buf, value, offset, littleEndian, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + checkIEEE754(buf, value, offset, 4, 34028234663852886e22, -34028234663852886e22); + } + ieee754.write(buf, value, offset, littleEndian, 23, 4); + return offset + 4; + } + Buffer2.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) { + return writeFloat(this, value, offset, true, noAssert); + }; + Buffer2.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) { + return writeFloat(this, value, offset, false, noAssert); + }; + function writeDouble(buf, value, offset, littleEndian, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + checkIEEE754(buf, value, offset, 8, 17976931348623157e292, -17976931348623157e292); + } + ieee754.write(buf, value, offset, littleEndian, 52, 8); + return offset + 8; + } + Buffer2.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) { + return writeDouble(this, value, offset, true, noAssert); + }; + Buffer2.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) { + return writeDouble(this, value, offset, false, noAssert); + }; + Buffer2.prototype.copy = function copy(target, targetStart, start, end) { + if (!Buffer2.isBuffer(target)) + throw new TypeError("argument should be a Buffer"); + if (!start) + start = 0; + if (!end && end !== 0) + end = this.length; + if (targetStart >= target.length) + targetStart = target.length; + if (!targetStart) + targetStart = 0; + if (end > 0 && end < start) + end = start; + if (end === start) + return 0; + if (target.length === 0 || this.length === 0) + return 0; + if (targetStart < 0) { + throw new RangeError("targetStart out of bounds"); + } + if (start < 0 || start >= this.length) + throw new RangeError("Index out of range"); + if (end < 0) + throw new RangeError("sourceEnd out of bounds"); + if (end > this.length) + end = this.length; + if (target.length - targetStart < end - start) { + end = target.length - targetStart + start; + } + const len = end - start; + if (this === target && typeof Uint8Array.prototype.copyWithin === "function") { + this.copyWithin(targetStart, start, end); + } else { + Uint8Array.prototype.set.call(target, this.subarray(start, end), targetStart); + } + return len; + }; + Buffer2.prototype.fill = function fill(val, start, end, encoding) { + if (typeof val === "string") { + if (typeof start === "string") { + encoding = start; + start = 0; + end = this.length; + } else if (typeof end === "string") { + encoding = end; + end = this.length; + } + if (encoding !== void 0 && typeof encoding !== "string") { + throw new TypeError("encoding must be a string"); + } + if (typeof encoding === "string" && !Buffer2.isEncoding(encoding)) { + throw new TypeError("Unknown encoding: " + encoding); + } + if (val.length === 1) { + const code = val.charCodeAt(0); + if (encoding === "utf8" && code < 128 || encoding === "latin1") { + val = code; + } + } + } else if (typeof val === "number") { + val = val & 255; + } else if (typeof val === "boolean") { + val = Number(val); + } + if (start < 0 || this.length < start || this.length < end) { + throw new RangeError("Out of range index"); + } + if (end <= start) { + return this; + } + start = start >>> 0; + end = end === void 0 ? this.length : end >>> 0; + if (!val) + val = 0; + let i; + if (typeof val === "number") { + for (i = start; i < end; ++i) { + this[i] = val; + } + } else { + const bytes = Buffer2.isBuffer(val) ? val : Buffer2.from(val, encoding); + const len = bytes.length; + if (len === 0) { + throw new TypeError('The value "' + val + '" is invalid for argument "value"'); + } + for (i = 0; i < end - start; ++i) { + this[i + start] = bytes[i % len]; + } + } + return this; + }; + var errors = {}; + function E(sym, getMessage, Base) { + errors[sym] = class NodeError extends Base { + constructor() { + super(); + Object.defineProperty(this, "message", { + value: getMessage.apply(this, arguments), + writable: true, + configurable: true + }); + this.name = `${this.name} [${sym}]`; + this.stack; + delete this.name; + } + get code() { + return sym; + } + set code(value) { + Object.defineProperty(this, "code", { + configurable: true, + enumerable: true, + value, + writable: true + }); + } + toString() { + return `${this.name} [${sym}]: ${this.message}`; + } + }; + } + E("ERR_BUFFER_OUT_OF_BOUNDS", function(name) { + if (name) { + return `${name} is outside of buffer bounds`; + } + return "Attempt to access memory outside buffer bounds"; + }, RangeError); + E("ERR_INVALID_ARG_TYPE", function(name, actual) { + return `The "${name}" argument must be of type number. Received type ${typeof actual}`; + }, TypeError); + E("ERR_OUT_OF_RANGE", function(str, range, input) { + let msg = `The value of "${str}" is out of range.`; + let received = input; + if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) { + received = addNumericalSeparator(String(input)); + } else if (typeof input === "bigint") { + received = String(input); + if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) { + received = addNumericalSeparator(received); + } + received += "n"; + } + msg += ` It must be ${range}. Received ${received}`; + return msg; + }, RangeError); + function addNumericalSeparator(val) { + let res = ""; + let i = val.length; + const start = val[0] === "-" ? 1 : 0; + for (; i >= start + 4; i -= 3) { + res = `_${val.slice(i - 3, i)}${res}`; + } + return `${val.slice(0, i)}${res}`; + } + function checkBounds(buf, offset, byteLength2) { + validateNumber(offset, "offset"); + if (buf[offset] === void 0 || buf[offset + byteLength2] === void 0) { + boundsError(offset, buf.length - (byteLength2 + 1)); + } + } + function checkIntBI(value, min, max, buf, offset, byteLength2) { + if (value > max || value < min) { + const n = typeof min === "bigint" ? "n" : ""; + let range; + if (byteLength2 > 3) { + if (min === 0 || min === BigInt(0)) { + range = `>= 0${n} and < 2${n} ** ${(byteLength2 + 1) * 8}${n}`; + } else { + range = `>= -(2${n} ** ${(byteLength2 + 1) * 8 - 1}${n}) and < 2 ** ${(byteLength2 + 1) * 8 - 1}${n}`; + } + } else { + range = `>= ${min}${n} and <= ${max}${n}`; + } + throw new errors.ERR_OUT_OF_RANGE("value", range, value); + } + checkBounds(buf, offset, byteLength2); + } + function validateNumber(value, name) { + if (typeof value !== "number") { + throw new errors.ERR_INVALID_ARG_TYPE(name, "number", value); + } + } + function boundsError(value, length2, type) { + if (Math.floor(value) !== value) { + validateNumber(value, type); + throw new errors.ERR_OUT_OF_RANGE(type || "offset", "an integer", value); + } + if (length2 < 0) { + throw new errors.ERR_BUFFER_OUT_OF_BOUNDS(); + } + throw new errors.ERR_OUT_OF_RANGE(type || "offset", `>= ${type ? 1 : 0} and <= ${length2}`, value); + } + var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g; + function base64clean(str) { + str = str.split("=")[0]; + str = str.trim().replace(INVALID_BASE64_RE, ""); + if (str.length < 2) + return ""; + while (str.length % 4 !== 0) { + str = str + "="; + } + return str; + } + function utf8ToBytes(string3, units) { + units = units || Infinity; + let codePoint; + const length2 = string3.length; + let leadSurrogate = null; + const bytes = []; + for (let i = 0; i < length2; ++i) { + codePoint = string3.charCodeAt(i); + if (codePoint > 55295 && codePoint < 57344) { + if (!leadSurrogate) { + if (codePoint > 56319) { + if ((units -= 3) > -1) + bytes.push(239, 191, 189); + continue; + } else if (i + 1 === length2) { + if ((units -= 3) > -1) + bytes.push(239, 191, 189); + continue; + } + leadSurrogate = codePoint; + continue; + } + if (codePoint < 56320) { + if ((units -= 3) > -1) + bytes.push(239, 191, 189); + leadSurrogate = codePoint; + continue; + } + codePoint = (leadSurrogate - 55296 << 10 | codePoint - 56320) + 65536; + } else if (leadSurrogate) { + if ((units -= 3) > -1) + bytes.push(239, 191, 189); + } + leadSurrogate = null; + if (codePoint < 128) { + if ((units -= 1) < 0) + break; + bytes.push(codePoint); + } else if (codePoint < 2048) { + if ((units -= 2) < 0) + break; + bytes.push(codePoint >> 6 | 192, codePoint & 63 | 128); + } else if (codePoint < 65536) { + if ((units -= 3) < 0) + break; + bytes.push(codePoint >> 12 | 224, codePoint >> 6 & 63 | 128, codePoint & 63 | 128); + } else if (codePoint < 1114112) { + if ((units -= 4) < 0) + break; + bytes.push(codePoint >> 18 | 240, codePoint >> 12 & 63 | 128, codePoint >> 6 & 63 | 128, codePoint & 63 | 128); + } else { + throw new Error("Invalid code point"); + } + } + return bytes; + } + function asciiToBytes(str) { + const byteArray = []; + for (let i = 0; i < str.length; ++i) { + byteArray.push(str.charCodeAt(i) & 255); + } + return byteArray; + } + function utf16leToBytes(str, units) { + let c, hi, lo; + const byteArray = []; + for (let i = 0; i < str.length; ++i) { + if ((units -= 2) < 0) + break; + c = str.charCodeAt(i); + hi = c >> 8; + lo = c % 256; + byteArray.push(lo); + byteArray.push(hi); + } + return byteArray; + } + function base64ToBytes(str) { + return base64.toByteArray(base64clean(str)); + } + function blitBuffer(src2, dst, offset, length2) { + let i; + for (i = 0; i < length2; ++i) { + if (i + offset >= dst.length || i >= src2.length) + break; + dst[i + offset] = src2[i]; + } + return i; + } + function isInstance(obj, type) { + return obj instanceof type || obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type.name; + } + function numberIsNaN(obj) { + return obj !== obj; + } + var hexSliceLookupTable = function() { + const alphabet = "0123456789abcdef"; + const table = new Array(256); + for (let i = 0; i < 16; ++i) { + const i16 = i * 16; + for (let j = 0; j < 16; ++j) { + table[i16 + j] = alphabet[i] + alphabet[j]; + } + } + return table; + }(); + function defineBigIntMethod(fn) { + return typeof BigInt === "undefined" ? BufferBigIntNotDefined : fn; + } + function BufferBigIntNotDefined() { + throw new Error("BigInt not supported"); + } + } + }); + + // (disabled):crypto + var require_crypto = __commonJS({ + "(disabled):crypto"() { + } + }); + + // node_modules/tweetnacl/nacl-fast.js + var require_nacl_fast = __commonJS({ + "node_modules/tweetnacl/nacl-fast.js"(exports, module) { + (function(nacl2) { + "use strict"; + var gf = function(init2) { + var i, r = new Float64Array(16); + if (init2) + for (i = 0; i < init2.length; i++) + r[i] = init2[i]; + return r; + }; + var randombytes = function() { + throw new Error("no PRNG"); + }; + var _0 = new Uint8Array(16); + var _9 = new Uint8Array(32); + _9[0] = 9; + var gf0 = gf(), gf1 = gf([1]), _121665 = gf([56129, 1]), D = gf([30883, 4953, 19914, 30187, 55467, 16705, 2637, 112, 59544, 30585, 16505, 36039, 65139, 11119, 27886, 20995]), D2 = gf([61785, 9906, 39828, 60374, 45398, 33411, 5274, 224, 53552, 61171, 33010, 6542, 64743, 22239, 55772, 9222]), X = gf([54554, 36645, 11616, 51542, 42930, 38181, 51040, 26924, 56412, 64982, 57905, 49316, 21502, 52590, 14035, 8553]), Y = gf([26200, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214]), I = gf([41136, 18958, 6951, 50414, 58488, 44335, 6150, 12099, 55207, 15867, 153, 11085, 57099, 20417, 9344, 11139]); + function ts64(x, i, h, l) { + x[i] = h >> 24 & 255; + x[i + 1] = h >> 16 & 255; + x[i + 2] = h >> 8 & 255; + x[i + 3] = h & 255; + x[i + 4] = l >> 24 & 255; + x[i + 5] = l >> 16 & 255; + x[i + 6] = l >> 8 & 255; + x[i + 7] = l & 255; + } + function vn(x, xi, y, yi, n) { + var i, d = 0; + for (i = 0; i < n; i++) + d |= x[xi + i] ^ y[yi + i]; + return (1 & d - 1 >>> 8) - 1; + } + function crypto_verify_16(x, xi, y, yi) { + return vn(x, xi, y, yi, 16); + } + function crypto_verify_32(x, xi, y, yi) { + return vn(x, xi, y, yi, 32); + } + function core_salsa20(o, p, k, c) { + var j0 = c[0] & 255 | (c[1] & 255) << 8 | (c[2] & 255) << 16 | (c[3] & 255) << 24, j1 = k[0] & 255 | (k[1] & 255) << 8 | (k[2] & 255) << 16 | (k[3] & 255) << 24, j2 = k[4] & 255 | (k[5] & 255) << 8 | (k[6] & 255) << 16 | (k[7] & 255) << 24, j3 = k[8] & 255 | (k[9] & 255) << 8 | (k[10] & 255) << 16 | (k[11] & 255) << 24, j4 = k[12] & 255 | (k[13] & 255) << 8 | (k[14] & 255) << 16 | (k[15] & 255) << 24, j5 = c[4] & 255 | (c[5] & 255) << 8 | (c[6] & 255) << 16 | (c[7] & 255) << 24, j6 = p[0] & 255 | (p[1] & 255) << 8 | (p[2] & 255) << 16 | (p[3] & 255) << 24, j7 = p[4] & 255 | (p[5] & 255) << 8 | (p[6] & 255) << 16 | (p[7] & 255) << 24, j8 = p[8] & 255 | (p[9] & 255) << 8 | (p[10] & 255) << 16 | (p[11] & 255) << 24, j9 = p[12] & 255 | (p[13] & 255) << 8 | (p[14] & 255) << 16 | (p[15] & 255) << 24, j10 = c[8] & 255 | (c[9] & 255) << 8 | (c[10] & 255) << 16 | (c[11] & 255) << 24, j11 = k[16] & 255 | (k[17] & 255) << 8 | (k[18] & 255) << 16 | (k[19] & 255) << 24, j12 = k[20] & 255 | (k[21] & 255) << 8 | (k[22] & 255) << 16 | (k[23] & 255) << 24, j13 = k[24] & 255 | (k[25] & 255) << 8 | (k[26] & 255) << 16 | (k[27] & 255) << 24, j14 = k[28] & 255 | (k[29] & 255) << 8 | (k[30] & 255) << 16 | (k[31] & 255) << 24, j15 = c[12] & 255 | (c[13] & 255) << 8 | (c[14] & 255) << 16 | (c[15] & 255) << 24; + var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7, x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14, x15 = j15, u; + for (var i = 0; i < 20; i += 2) { + u = x0 + x12 | 0; + x4 ^= u << 7 | u >>> 32 - 7; + u = x4 + x0 | 0; + x8 ^= u << 9 | u >>> 32 - 9; + u = x8 + x4 | 0; + x12 ^= u << 13 | u >>> 32 - 13; + u = x12 + x8 | 0; + x0 ^= u << 18 | u >>> 32 - 18; + u = x5 + x1 | 0; + x9 ^= u << 7 | u >>> 32 - 7; + u = x9 + x5 | 0; + x13 ^= u << 9 | u >>> 32 - 9; + u = x13 + x9 | 0; + x1 ^= u << 13 | u >>> 32 - 13; + u = x1 + x13 | 0; + x5 ^= u << 18 | u >>> 32 - 18; + u = x10 + x6 | 0; + x14 ^= u << 7 | u >>> 32 - 7; + u = x14 + x10 | 0; + x2 ^= u << 9 | u >>> 32 - 9; + u = x2 + x14 | 0; + x6 ^= u << 13 | u >>> 32 - 13; + u = x6 + x2 | 0; + x10 ^= u << 18 | u >>> 32 - 18; + u = x15 + x11 | 0; + x3 ^= u << 7 | u >>> 32 - 7; + u = x3 + x15 | 0; + x7 ^= u << 9 | u >>> 32 - 9; + u = x7 + x3 | 0; + x11 ^= u << 13 | u >>> 32 - 13; + u = x11 + x7 | 0; + x15 ^= u << 18 | u >>> 32 - 18; + u = x0 + x3 | 0; + x1 ^= u << 7 | u >>> 32 - 7; + u = x1 + x0 | 0; + x2 ^= u << 9 | u >>> 32 - 9; + u = x2 + x1 | 0; + x3 ^= u << 13 | u >>> 32 - 13; + u = x3 + x2 | 0; + x0 ^= u << 18 | u >>> 32 - 18; + u = x5 + x4 | 0; + x6 ^= u << 7 | u >>> 32 - 7; + u = x6 + x5 | 0; + x7 ^= u << 9 | u >>> 32 - 9; + u = x7 + x6 | 0; + x4 ^= u << 13 | u >>> 32 - 13; + u = x4 + x7 | 0; + x5 ^= u << 18 | u >>> 32 - 18; + u = x10 + x9 | 0; + x11 ^= u << 7 | u >>> 32 - 7; + u = x11 + x10 | 0; + x8 ^= u << 9 | u >>> 32 - 9; + u = x8 + x11 | 0; + x9 ^= u << 13 | u >>> 32 - 13; + u = x9 + x8 | 0; + x10 ^= u << 18 | u >>> 32 - 18; + u = x15 + x14 | 0; + x12 ^= u << 7 | u >>> 32 - 7; + u = x12 + x15 | 0; + x13 ^= u << 9 | u >>> 32 - 9; + u = x13 + x12 | 0; + x14 ^= u << 13 | u >>> 32 - 13; + u = x14 + x13 | 0; + x15 ^= u << 18 | u >>> 32 - 18; + } + x0 = x0 + j0 | 0; + x1 = x1 + j1 | 0; + x2 = x2 + j2 | 0; + x3 = x3 + j3 | 0; + x4 = x4 + j4 | 0; + x5 = x5 + j5 | 0; + x6 = x6 + j6 | 0; + x7 = x7 + j7 | 0; + x8 = x8 + j8 | 0; + x9 = x9 + j9 | 0; + x10 = x10 + j10 | 0; + x11 = x11 + j11 | 0; + x12 = x12 + j12 | 0; + x13 = x13 + j13 | 0; + x14 = x14 + j14 | 0; + x15 = x15 + j15 | 0; + o[0] = x0 >>> 0 & 255; + o[1] = x0 >>> 8 & 255; + o[2] = x0 >>> 16 & 255; + o[3] = x0 >>> 24 & 255; + o[4] = x1 >>> 0 & 255; + o[5] = x1 >>> 8 & 255; + o[6] = x1 >>> 16 & 255; + o[7] = x1 >>> 24 & 255; + o[8] = x2 >>> 0 & 255; + o[9] = x2 >>> 8 & 255; + o[10] = x2 >>> 16 & 255; + o[11] = x2 >>> 24 & 255; + o[12] = x3 >>> 0 & 255; + o[13] = x3 >>> 8 & 255; + o[14] = x3 >>> 16 & 255; + o[15] = x3 >>> 24 & 255; + o[16] = x4 >>> 0 & 255; + o[17] = x4 >>> 8 & 255; + o[18] = x4 >>> 16 & 255; + o[19] = x4 >>> 24 & 255; + o[20] = x5 >>> 0 & 255; + o[21] = x5 >>> 8 & 255; + o[22] = x5 >>> 16 & 255; + o[23] = x5 >>> 24 & 255; + o[24] = x6 >>> 0 & 255; + o[25] = x6 >>> 8 & 255; + o[26] = x6 >>> 16 & 255; + o[27] = x6 >>> 24 & 255; + o[28] = x7 >>> 0 & 255; + o[29] = x7 >>> 8 & 255; + o[30] = x7 >>> 16 & 255; + o[31] = x7 >>> 24 & 255; + o[32] = x8 >>> 0 & 255; + o[33] = x8 >>> 8 & 255; + o[34] = x8 >>> 16 & 255; + o[35] = x8 >>> 24 & 255; + o[36] = x9 >>> 0 & 255; + o[37] = x9 >>> 8 & 255; + o[38] = x9 >>> 16 & 255; + o[39] = x9 >>> 24 & 255; + o[40] = x10 >>> 0 & 255; + o[41] = x10 >>> 8 & 255; + o[42] = x10 >>> 16 & 255; + o[43] = x10 >>> 24 & 255; + o[44] = x11 >>> 0 & 255; + o[45] = x11 >>> 8 & 255; + o[46] = x11 >>> 16 & 255; + o[47] = x11 >>> 24 & 255; + o[48] = x12 >>> 0 & 255; + o[49] = x12 >>> 8 & 255; + o[50] = x12 >>> 16 & 255; + o[51] = x12 >>> 24 & 255; + o[52] = x13 >>> 0 & 255; + o[53] = x13 >>> 8 & 255; + o[54] = x13 >>> 16 & 255; + o[55] = x13 >>> 24 & 255; + o[56] = x14 >>> 0 & 255; + o[57] = x14 >>> 8 & 255; + o[58] = x14 >>> 16 & 255; + o[59] = x14 >>> 24 & 255; + o[60] = x15 >>> 0 & 255; + o[61] = x15 >>> 8 & 255; + o[62] = x15 >>> 16 & 255; + o[63] = x15 >>> 24 & 255; + } + function core_hsalsa20(o, p, k, c) { + var j0 = c[0] & 255 | (c[1] & 255) << 8 | (c[2] & 255) << 16 | (c[3] & 255) << 24, j1 = k[0] & 255 | (k[1] & 255) << 8 | (k[2] & 255) << 16 | (k[3] & 255) << 24, j2 = k[4] & 255 | (k[5] & 255) << 8 | (k[6] & 255) << 16 | (k[7] & 255) << 24, j3 = k[8] & 255 | (k[9] & 255) << 8 | (k[10] & 255) << 16 | (k[11] & 255) << 24, j4 = k[12] & 255 | (k[13] & 255) << 8 | (k[14] & 255) << 16 | (k[15] & 255) << 24, j5 = c[4] & 255 | (c[5] & 255) << 8 | (c[6] & 255) << 16 | (c[7] & 255) << 24, j6 = p[0] & 255 | (p[1] & 255) << 8 | (p[2] & 255) << 16 | (p[3] & 255) << 24, j7 = p[4] & 255 | (p[5] & 255) << 8 | (p[6] & 255) << 16 | (p[7] & 255) << 24, j8 = p[8] & 255 | (p[9] & 255) << 8 | (p[10] & 255) << 16 | (p[11] & 255) << 24, j9 = p[12] & 255 | (p[13] & 255) << 8 | (p[14] & 255) << 16 | (p[15] & 255) << 24, j10 = c[8] & 255 | (c[9] & 255) << 8 | (c[10] & 255) << 16 | (c[11] & 255) << 24, j11 = k[16] & 255 | (k[17] & 255) << 8 | (k[18] & 255) << 16 | (k[19] & 255) << 24, j12 = k[20] & 255 | (k[21] & 255) << 8 | (k[22] & 255) << 16 | (k[23] & 255) << 24, j13 = k[24] & 255 | (k[25] & 255) << 8 | (k[26] & 255) << 16 | (k[27] & 255) << 24, j14 = k[28] & 255 | (k[29] & 255) << 8 | (k[30] & 255) << 16 | (k[31] & 255) << 24, j15 = c[12] & 255 | (c[13] & 255) << 8 | (c[14] & 255) << 16 | (c[15] & 255) << 24; + var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7, x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14, x15 = j15, u; + for (var i = 0; i < 20; i += 2) { + u = x0 + x12 | 0; + x4 ^= u << 7 | u >>> 32 - 7; + u = x4 + x0 | 0; + x8 ^= u << 9 | u >>> 32 - 9; + u = x8 + x4 | 0; + x12 ^= u << 13 | u >>> 32 - 13; + u = x12 + x8 | 0; + x0 ^= u << 18 | u >>> 32 - 18; + u = x5 + x1 | 0; + x9 ^= u << 7 | u >>> 32 - 7; + u = x9 + x5 | 0; + x13 ^= u << 9 | u >>> 32 - 9; + u = x13 + x9 | 0; + x1 ^= u << 13 | u >>> 32 - 13; + u = x1 + x13 | 0; + x5 ^= u << 18 | u >>> 32 - 18; + u = x10 + x6 | 0; + x14 ^= u << 7 | u >>> 32 - 7; + u = x14 + x10 | 0; + x2 ^= u << 9 | u >>> 32 - 9; + u = x2 + x14 | 0; + x6 ^= u << 13 | u >>> 32 - 13; + u = x6 + x2 | 0; + x10 ^= u << 18 | u >>> 32 - 18; + u = x15 + x11 | 0; + x3 ^= u << 7 | u >>> 32 - 7; + u = x3 + x15 | 0; + x7 ^= u << 9 | u >>> 32 - 9; + u = x7 + x3 | 0; + x11 ^= u << 13 | u >>> 32 - 13; + u = x11 + x7 | 0; + x15 ^= u << 18 | u >>> 32 - 18; + u = x0 + x3 | 0; + x1 ^= u << 7 | u >>> 32 - 7; + u = x1 + x0 | 0; + x2 ^= u << 9 | u >>> 32 - 9; + u = x2 + x1 | 0; + x3 ^= u << 13 | u >>> 32 - 13; + u = x3 + x2 | 0; + x0 ^= u << 18 | u >>> 32 - 18; + u = x5 + x4 | 0; + x6 ^= u << 7 | u >>> 32 - 7; + u = x6 + x5 | 0; + x7 ^= u << 9 | u >>> 32 - 9; + u = x7 + x6 | 0; + x4 ^= u << 13 | u >>> 32 - 13; + u = x4 + x7 | 0; + x5 ^= u << 18 | u >>> 32 - 18; + u = x10 + x9 | 0; + x11 ^= u << 7 | u >>> 32 - 7; + u = x11 + x10 | 0; + x8 ^= u << 9 | u >>> 32 - 9; + u = x8 + x11 | 0; + x9 ^= u << 13 | u >>> 32 - 13; + u = x9 + x8 | 0; + x10 ^= u << 18 | u >>> 32 - 18; + u = x15 + x14 | 0; + x12 ^= u << 7 | u >>> 32 - 7; + u = x12 + x15 | 0; + x13 ^= u << 9 | u >>> 32 - 9; + u = x13 + x12 | 0; + x14 ^= u << 13 | u >>> 32 - 13; + u = x14 + x13 | 0; + x15 ^= u << 18 | u >>> 32 - 18; + } + o[0] = x0 >>> 0 & 255; + o[1] = x0 >>> 8 & 255; + o[2] = x0 >>> 16 & 255; + o[3] = x0 >>> 24 & 255; + o[4] = x5 >>> 0 & 255; + o[5] = x5 >>> 8 & 255; + o[6] = x5 >>> 16 & 255; + o[7] = x5 >>> 24 & 255; + o[8] = x10 >>> 0 & 255; + o[9] = x10 >>> 8 & 255; + o[10] = x10 >>> 16 & 255; + o[11] = x10 >>> 24 & 255; + o[12] = x15 >>> 0 & 255; + o[13] = x15 >>> 8 & 255; + o[14] = x15 >>> 16 & 255; + o[15] = x15 >>> 24 & 255; + o[16] = x6 >>> 0 & 255; + o[17] = x6 >>> 8 & 255; + o[18] = x6 >>> 16 & 255; + o[19] = x6 >>> 24 & 255; + o[20] = x7 >>> 0 & 255; + o[21] = x7 >>> 8 & 255; + o[22] = x7 >>> 16 & 255; + o[23] = x7 >>> 24 & 255; + o[24] = x8 >>> 0 & 255; + o[25] = x8 >>> 8 & 255; + o[26] = x8 >>> 16 & 255; + o[27] = x8 >>> 24 & 255; + o[28] = x9 >>> 0 & 255; + o[29] = x9 >>> 8 & 255; + o[30] = x9 >>> 16 & 255; + o[31] = x9 >>> 24 & 255; + } + function crypto_core_salsa20(out, inp, k, c) { + core_salsa20(out, inp, k, c); + } + function crypto_core_hsalsa20(out, inp, k, c) { + core_hsalsa20(out, inp, k, c); + } + var sigma = new Uint8Array([101, 120, 112, 97, 110, 100, 32, 51, 50, 45, 98, 121, 116, 101, 32, 107]); + function crypto_stream_salsa20_xor(c, cpos, m, mpos, b, n, k) { + var z = new Uint8Array(16), x = new Uint8Array(64); + var u, i; + for (i = 0; i < 16; i++) + z[i] = 0; + for (i = 0; i < 8; i++) + z[i] = n[i]; + while (b >= 64) { + crypto_core_salsa20(x, z, k, sigma); + for (i = 0; i < 64; i++) + c[cpos + i] = m[mpos + i] ^ x[i]; + u = 1; + for (i = 8; i < 16; i++) { + u = u + (z[i] & 255) | 0; + z[i] = u & 255; + u >>>= 8; + } + b -= 64; + cpos += 64; + mpos += 64; + } + if (b > 0) { + crypto_core_salsa20(x, z, k, sigma); + for (i = 0; i < b; i++) + c[cpos + i] = m[mpos + i] ^ x[i]; + } + return 0; + } + function crypto_stream_salsa20(c, cpos, b, n, k) { + var z = new Uint8Array(16), x = new Uint8Array(64); + var u, i; + for (i = 0; i < 16; i++) + z[i] = 0; + for (i = 0; i < 8; i++) + z[i] = n[i]; + while (b >= 64) { + crypto_core_salsa20(x, z, k, sigma); + for (i = 0; i < 64; i++) + c[cpos + i] = x[i]; + u = 1; + for (i = 8; i < 16; i++) { + u = u + (z[i] & 255) | 0; + z[i] = u & 255; + u >>>= 8; + } + b -= 64; + cpos += 64; + } + if (b > 0) { + crypto_core_salsa20(x, z, k, sigma); + for (i = 0; i < b; i++) + c[cpos + i] = x[i]; + } + return 0; + } + function crypto_stream(c, cpos, d, n, k) { + var s = new Uint8Array(32); + crypto_core_hsalsa20(s, n, k, sigma); + var sn = new Uint8Array(8); + for (var i = 0; i < 8; i++) + sn[i] = n[i + 16]; + return crypto_stream_salsa20(c, cpos, d, sn, s); + } + function crypto_stream_xor(c, cpos, m, mpos, d, n, k) { + var s = new Uint8Array(32); + crypto_core_hsalsa20(s, n, k, sigma); + var sn = new Uint8Array(8); + for (var i = 0; i < 8; i++) + sn[i] = n[i + 16]; + return crypto_stream_salsa20_xor(c, cpos, m, mpos, d, sn, s); + } + var poly1305 = function(key) { + this.buffer = new Uint8Array(16); + this.r = new Uint16Array(10); + this.h = new Uint16Array(10); + this.pad = new Uint16Array(8); + this.leftover = 0; + this.fin = 0; + var t0, t1, t2, t3, t4, t5, t6, t7; + t0 = key[0] & 255 | (key[1] & 255) << 8; + this.r[0] = t0 & 8191; + t1 = key[2] & 255 | (key[3] & 255) << 8; + this.r[1] = (t0 >>> 13 | t1 << 3) & 8191; + t2 = key[4] & 255 | (key[5] & 255) << 8; + this.r[2] = (t1 >>> 10 | t2 << 6) & 7939; + t3 = key[6] & 255 | (key[7] & 255) << 8; + this.r[3] = (t2 >>> 7 | t3 << 9) & 8191; + t4 = key[8] & 255 | (key[9] & 255) << 8; + this.r[4] = (t3 >>> 4 | t4 << 12) & 255; + this.r[5] = t4 >>> 1 & 8190; + t5 = key[10] & 255 | (key[11] & 255) << 8; + this.r[6] = (t4 >>> 14 | t5 << 2) & 8191; + t6 = key[12] & 255 | (key[13] & 255) << 8; + this.r[7] = (t5 >>> 11 | t6 << 5) & 8065; + t7 = key[14] & 255 | (key[15] & 255) << 8; + this.r[8] = (t6 >>> 8 | t7 << 8) & 8191; + this.r[9] = t7 >>> 5 & 127; + this.pad[0] = key[16] & 255 | (key[17] & 255) << 8; + this.pad[1] = key[18] & 255 | (key[19] & 255) << 8; + this.pad[2] = key[20] & 255 | (key[21] & 255) << 8; + this.pad[3] = key[22] & 255 | (key[23] & 255) << 8; + this.pad[4] = key[24] & 255 | (key[25] & 255) << 8; + this.pad[5] = key[26] & 255 | (key[27] & 255) << 8; + this.pad[6] = key[28] & 255 | (key[29] & 255) << 8; + this.pad[7] = key[30] & 255 | (key[31] & 255) << 8; + }; + poly1305.prototype.blocks = function(m, mpos, bytes) { + var hibit = this.fin ? 0 : 1 << 11; + var t0, t1, t2, t3, t4, t5, t6, t7, c; + var d0, d1, d2, d3, d4, d5, d6, d7, d8, d9; + var h0 = this.h[0], h1 = this.h[1], h2 = this.h[2], h3 = this.h[3], h4 = this.h[4], h5 = this.h[5], h6 = this.h[6], h7 = this.h[7], h8 = this.h[8], h9 = this.h[9]; + var r0 = this.r[0], r1 = this.r[1], r2 = this.r[2], r3 = this.r[3], r4 = this.r[4], r5 = this.r[5], r6 = this.r[6], r7 = this.r[7], r8 = this.r[8], r9 = this.r[9]; + while (bytes >= 16) { + t0 = m[mpos + 0] & 255 | (m[mpos + 1] & 255) << 8; + h0 += t0 & 8191; + t1 = m[mpos + 2] & 255 | (m[mpos + 3] & 255) << 8; + h1 += (t0 >>> 13 | t1 << 3) & 8191; + t2 = m[mpos + 4] & 255 | (m[mpos + 5] & 255) << 8; + h2 += (t1 >>> 10 | t2 << 6) & 8191; + t3 = m[mpos + 6] & 255 | (m[mpos + 7] & 255) << 8; + h3 += (t2 >>> 7 | t3 << 9) & 8191; + t4 = m[mpos + 8] & 255 | (m[mpos + 9] & 255) << 8; + h4 += (t3 >>> 4 | t4 << 12) & 8191; + h5 += t4 >>> 1 & 8191; + t5 = m[mpos + 10] & 255 | (m[mpos + 11] & 255) << 8; + h6 += (t4 >>> 14 | t5 << 2) & 8191; + t6 = m[mpos + 12] & 255 | (m[mpos + 13] & 255) << 8; + h7 += (t5 >>> 11 | t6 << 5) & 8191; + t7 = m[mpos + 14] & 255 | (m[mpos + 15] & 255) << 8; + h8 += (t6 >>> 8 | t7 << 8) & 8191; + h9 += t7 >>> 5 | hibit; + c = 0; + d0 = c; + d0 += h0 * r0; + d0 += h1 * (5 * r9); + d0 += h2 * (5 * r8); + d0 += h3 * (5 * r7); + d0 += h4 * (5 * r6); + c = d0 >>> 13; + d0 &= 8191; + d0 += h5 * (5 * r5); + d0 += h6 * (5 * r4); + d0 += h7 * (5 * r3); + d0 += h8 * (5 * r2); + d0 += h9 * (5 * r1); + c += d0 >>> 13; + d0 &= 8191; + d1 = c; + d1 += h0 * r1; + d1 += h1 * r0; + d1 += h2 * (5 * r9); + d1 += h3 * (5 * r8); + d1 += h4 * (5 * r7); + c = d1 >>> 13; + d1 &= 8191; + d1 += h5 * (5 * r6); + d1 += h6 * (5 * r5); + d1 += h7 * (5 * r4); + d1 += h8 * (5 * r3); + d1 += h9 * (5 * r2); + c += d1 >>> 13; + d1 &= 8191; + d2 = c; + d2 += h0 * r2; + d2 += h1 * r1; + d2 += h2 * r0; + d2 += h3 * (5 * r9); + d2 += h4 * (5 * r8); + c = d2 >>> 13; + d2 &= 8191; + d2 += h5 * (5 * r7); + d2 += h6 * (5 * r6); + d2 += h7 * (5 * r5); + d2 += h8 * (5 * r4); + d2 += h9 * (5 * r3); + c += d2 >>> 13; + d2 &= 8191; + d3 = c; + d3 += h0 * r3; + d3 += h1 * r2; + d3 += h2 * r1; + d3 += h3 * r0; + d3 += h4 * (5 * r9); + c = d3 >>> 13; + d3 &= 8191; + d3 += h5 * (5 * r8); + d3 += h6 * (5 * r7); + d3 += h7 * (5 * r6); + d3 += h8 * (5 * r5); + d3 += h9 * (5 * r4); + c += d3 >>> 13; + d3 &= 8191; + d4 = c; + d4 += h0 * r4; + d4 += h1 * r3; + d4 += h2 * r2; + d4 += h3 * r1; + d4 += h4 * r0; + c = d4 >>> 13; + d4 &= 8191; + d4 += h5 * (5 * r9); + d4 += h6 * (5 * r8); + d4 += h7 * (5 * r7); + d4 += h8 * (5 * r6); + d4 += h9 * (5 * r5); + c += d4 >>> 13; + d4 &= 8191; + d5 = c; + d5 += h0 * r5; + d5 += h1 * r4; + d5 += h2 * r3; + d5 += h3 * r2; + d5 += h4 * r1; + c = d5 >>> 13; + d5 &= 8191; + d5 += h5 * r0; + d5 += h6 * (5 * r9); + d5 += h7 * (5 * r8); + d5 += h8 * (5 * r7); + d5 += h9 * (5 * r6); + c += d5 >>> 13; + d5 &= 8191; + d6 = c; + d6 += h0 * r6; + d6 += h1 * r5; + d6 += h2 * r4; + d6 += h3 * r3; + d6 += h4 * r2; + c = d6 >>> 13; + d6 &= 8191; + d6 += h5 * r1; + d6 += h6 * r0; + d6 += h7 * (5 * r9); + d6 += h8 * (5 * r8); + d6 += h9 * (5 * r7); + c += d6 >>> 13; + d6 &= 8191; + d7 = c; + d7 += h0 * r7; + d7 += h1 * r6; + d7 += h2 * r5; + d7 += h3 * r4; + d7 += h4 * r3; + c = d7 >>> 13; + d7 &= 8191; + d7 += h5 * r2; + d7 += h6 * r1; + d7 += h7 * r0; + d7 += h8 * (5 * r9); + d7 += h9 * (5 * r8); + c += d7 >>> 13; + d7 &= 8191; + d8 = c; + d8 += h0 * r8; + d8 += h1 * r7; + d8 += h2 * r6; + d8 += h3 * r5; + d8 += h4 * r4; + c = d8 >>> 13; + d8 &= 8191; + d8 += h5 * r3; + d8 += h6 * r2; + d8 += h7 * r1; + d8 += h8 * r0; + d8 += h9 * (5 * r9); + c += d8 >>> 13; + d8 &= 8191; + d9 = c; + d9 += h0 * r9; + d9 += h1 * r8; + d9 += h2 * r7; + d9 += h3 * r6; + d9 += h4 * r5; + c = d9 >>> 13; + d9 &= 8191; + d9 += h5 * r4; + d9 += h6 * r3; + d9 += h7 * r2; + d9 += h8 * r1; + d9 += h9 * r0; + c += d9 >>> 13; + d9 &= 8191; + c = (c << 2) + c | 0; + c = c + d0 | 0; + d0 = c & 8191; + c = c >>> 13; + d1 += c; + h0 = d0; + h1 = d1; + h2 = d2; + h3 = d3; + h4 = d4; + h5 = d5; + h6 = d6; + h7 = d7; + h8 = d8; + h9 = d9; + mpos += 16; + bytes -= 16; + } + this.h[0] = h0; + this.h[1] = h1; + this.h[2] = h2; + this.h[3] = h3; + this.h[4] = h4; + this.h[5] = h5; + this.h[6] = h6; + this.h[7] = h7; + this.h[8] = h8; + this.h[9] = h9; + }; + poly1305.prototype.finish = function(mac, macpos) { + var g = new Uint16Array(10); + var c, mask, f, i; + if (this.leftover) { + i = this.leftover; + this.buffer[i++] = 1; + for (; i < 16; i++) + this.buffer[i] = 0; + this.fin = 1; + this.blocks(this.buffer, 0, 16); + } + c = this.h[1] >>> 13; + this.h[1] &= 8191; + for (i = 2; i < 10; i++) { + this.h[i] += c; + c = this.h[i] >>> 13; + this.h[i] &= 8191; + } + this.h[0] += c * 5; + c = this.h[0] >>> 13; + this.h[0] &= 8191; + this.h[1] += c; + c = this.h[1] >>> 13; + this.h[1] &= 8191; + this.h[2] += c; + g[0] = this.h[0] + 5; + c = g[0] >>> 13; + g[0] &= 8191; + for (i = 1; i < 10; i++) { + g[i] = this.h[i] + c; + c = g[i] >>> 13; + g[i] &= 8191; + } + g[9] -= 1 << 13; + mask = (c ^ 1) - 1; + for (i = 0; i < 10; i++) + g[i] &= mask; + mask = ~mask; + for (i = 0; i < 10; i++) + this.h[i] = this.h[i] & mask | g[i]; + this.h[0] = (this.h[0] | this.h[1] << 13) & 65535; + this.h[1] = (this.h[1] >>> 3 | this.h[2] << 10) & 65535; + this.h[2] = (this.h[2] >>> 6 | this.h[3] << 7) & 65535; + this.h[3] = (this.h[3] >>> 9 | this.h[4] << 4) & 65535; + this.h[4] = (this.h[4] >>> 12 | this.h[5] << 1 | this.h[6] << 14) & 65535; + this.h[5] = (this.h[6] >>> 2 | this.h[7] << 11) & 65535; + this.h[6] = (this.h[7] >>> 5 | this.h[8] << 8) & 65535; + this.h[7] = (this.h[8] >>> 8 | this.h[9] << 5) & 65535; + f = this.h[0] + this.pad[0]; + this.h[0] = f & 65535; + for (i = 1; i < 8; i++) { + f = (this.h[i] + this.pad[i] | 0) + (f >>> 16) | 0; + this.h[i] = f & 65535; + } + mac[macpos + 0] = this.h[0] >>> 0 & 255; + mac[macpos + 1] = this.h[0] >>> 8 & 255; + mac[macpos + 2] = this.h[1] >>> 0 & 255; + mac[macpos + 3] = this.h[1] >>> 8 & 255; + mac[macpos + 4] = this.h[2] >>> 0 & 255; + mac[macpos + 5] = this.h[2] >>> 8 & 255; + mac[macpos + 6] = this.h[3] >>> 0 & 255; + mac[macpos + 7] = this.h[3] >>> 8 & 255; + mac[macpos + 8] = this.h[4] >>> 0 & 255; + mac[macpos + 9] = this.h[4] >>> 8 & 255; + mac[macpos + 10] = this.h[5] >>> 0 & 255; + mac[macpos + 11] = this.h[5] >>> 8 & 255; + mac[macpos + 12] = this.h[6] >>> 0 & 255; + mac[macpos + 13] = this.h[6] >>> 8 & 255; + mac[macpos + 14] = this.h[7] >>> 0 & 255; + mac[macpos + 15] = this.h[7] >>> 8 & 255; + }; + poly1305.prototype.update = function(m, mpos, bytes) { + var i, want; + if (this.leftover) { + want = 16 - this.leftover; + if (want > bytes) + want = bytes; + for (i = 0; i < want; i++) + this.buffer[this.leftover + i] = m[mpos + i]; + bytes -= want; + mpos += want; + this.leftover += want; + if (this.leftover < 16) + return; + this.blocks(this.buffer, 0, 16); + this.leftover = 0; + } + if (bytes >= 16) { + want = bytes - bytes % 16; + this.blocks(m, mpos, want); + mpos += want; + bytes -= want; + } + if (bytes) { + for (i = 0; i < bytes; i++) + this.buffer[this.leftover + i] = m[mpos + i]; + this.leftover += bytes; + } + }; + function crypto_onetimeauth(out, outpos, m, mpos, n, k) { + var s = new poly1305(k); + s.update(m, mpos, n); + s.finish(out, outpos); + return 0; + } + function crypto_onetimeauth_verify(h, hpos, m, mpos, n, k) { + var x = new Uint8Array(16); + crypto_onetimeauth(x, 0, m, mpos, n, k); + return crypto_verify_16(h, hpos, x, 0); + } + function crypto_secretbox(c, m, d, n, k) { + var i; + if (d < 32) + return -1; + crypto_stream_xor(c, 0, m, 0, d, n, k); + crypto_onetimeauth(c, 16, c, 32, d - 32, c); + for (i = 0; i < 16; i++) + c[i] = 0; + return 0; + } + function crypto_secretbox_open(m, c, d, n, k) { + var i; + var x = new Uint8Array(32); + if (d < 32) + return -1; + crypto_stream(x, 0, 32, n, k); + if (crypto_onetimeauth_verify(c, 16, c, 32, d - 32, x) !== 0) + return -1; + crypto_stream_xor(m, 0, c, 0, d, n, k); + for (i = 0; i < 32; i++) + m[i] = 0; + return 0; + } + function set25519(r, a) { + var i; + for (i = 0; i < 16; i++) + r[i] = a[i] | 0; + } + function car25519(o) { + var i, v, c = 1; + for (i = 0; i < 16; i++) { + v = o[i] + c + 65535; + c = Math.floor(v / 65536); + o[i] = v - c * 65536; + } + o[0] += c - 1 + 37 * (c - 1); + } + function sel25519(p, q, b) { + var t, c = ~(b - 1); + for (var i = 0; i < 16; i++) { + t = c & (p[i] ^ q[i]); + p[i] ^= t; + q[i] ^= t; + } + } + function pack25519(o, n) { + var i, j, b; + var m = gf(), t = gf(); + for (i = 0; i < 16; i++) + t[i] = n[i]; + car25519(t); + car25519(t); + car25519(t); + for (j = 0; j < 2; j++) { + m[0] = t[0] - 65517; + for (i = 1; i < 15; i++) { + m[i] = t[i] - 65535 - (m[i - 1] >> 16 & 1); + m[i - 1] &= 65535; + } + m[15] = t[15] - 32767 - (m[14] >> 16 & 1); + b = m[15] >> 16 & 1; + m[14] &= 65535; + sel25519(t, m, 1 - b); + } + for (i = 0; i < 16; i++) { + o[2 * i] = t[i] & 255; + o[2 * i + 1] = t[i] >> 8; + } + } + function neq25519(a, b) { + var c = new Uint8Array(32), d = new Uint8Array(32); + pack25519(c, a); + pack25519(d, b); + return crypto_verify_32(c, 0, d, 0); + } + function par25519(a) { + var d = new Uint8Array(32); + pack25519(d, a); + return d[0] & 1; + } + function unpack25519(o, n) { + var i; + for (i = 0; i < 16; i++) + o[i] = n[2 * i] + (n[2 * i + 1] << 8); + o[15] &= 32767; + } + function A(o, a, b) { + for (var i = 0; i < 16; i++) + o[i] = a[i] + b[i]; + } + function Z(o, a, b) { + for (var i = 0; i < 16; i++) + o[i] = a[i] - b[i]; + } + function M(o, a, b) { + var v, c, t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, t10 = 0, t11 = 0, t12 = 0, t13 = 0, t14 = 0, t15 = 0, t16 = 0, t17 = 0, t18 = 0, t19 = 0, t20 = 0, t21 = 0, t22 = 0, t23 = 0, t24 = 0, t25 = 0, t26 = 0, t27 = 0, t28 = 0, t29 = 0, t30 = 0, b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3], b4 = b[4], b5 = b[5], b6 = b[6], b7 = b[7], b8 = b[8], b9 = b[9], b10 = b[10], b11 = b[11], b12 = b[12], b13 = b[13], b14 = b[14], b15 = b[15]; + v = a[0]; + t0 += v * b0; + t1 += v * b1; + t2 += v * b2; + t3 += v * b3; + t4 += v * b4; + t5 += v * b5; + t6 += v * b6; + t7 += v * b7; + t8 += v * b8; + t9 += v * b9; + t10 += v * b10; + t11 += v * b11; + t12 += v * b12; + t13 += v * b13; + t14 += v * b14; + t15 += v * b15; + v = a[1]; + t1 += v * b0; + t2 += v * b1; + t3 += v * b2; + t4 += v * b3; + t5 += v * b4; + t6 += v * b5; + t7 += v * b6; + t8 += v * b7; + t9 += v * b8; + t10 += v * b9; + t11 += v * b10; + t12 += v * b11; + t13 += v * b12; + t14 += v * b13; + t15 += v * b14; + t16 += v * b15; + v = a[2]; + t2 += v * b0; + t3 += v * b1; + t4 += v * b2; + t5 += v * b3; + t6 += v * b4; + t7 += v * b5; + t8 += v * b6; + t9 += v * b7; + t10 += v * b8; + t11 += v * b9; + t12 += v * b10; + t13 += v * b11; + t14 += v * b12; + t15 += v * b13; + t16 += v * b14; + t17 += v * b15; + v = a[3]; + t3 += v * b0; + t4 += v * b1; + t5 += v * b2; + t6 += v * b3; + t7 += v * b4; + t8 += v * b5; + t9 += v * b6; + t10 += v * b7; + t11 += v * b8; + t12 += v * b9; + t13 += v * b10; + t14 += v * b11; + t15 += v * b12; + t16 += v * b13; + t17 += v * b14; + t18 += v * b15; + v = a[4]; + t4 += v * b0; + t5 += v * b1; + t6 += v * b2; + t7 += v * b3; + t8 += v * b4; + t9 += v * b5; + t10 += v * b6; + t11 += v * b7; + t12 += v * b8; + t13 += v * b9; + t14 += v * b10; + t15 += v * b11; + t16 += v * b12; + t17 += v * b13; + t18 += v * b14; + t19 += v * b15; + v = a[5]; + t5 += v * b0; + t6 += v * b1; + t7 += v * b2; + t8 += v * b3; + t9 += v * b4; + t10 += v * b5; + t11 += v * b6; + t12 += v * b7; + t13 += v * b8; + t14 += v * b9; + t15 += v * b10; + t16 += v * b11; + t17 += v * b12; + t18 += v * b13; + t19 += v * b14; + t20 += v * b15; + v = a[6]; + t6 += v * b0; + t7 += v * b1; + t8 += v * b2; + t9 += v * b3; + t10 += v * b4; + t11 += v * b5; + t12 += v * b6; + t13 += v * b7; + t14 += v * b8; + t15 += v * b9; + t16 += v * b10; + t17 += v * b11; + t18 += v * b12; + t19 += v * b13; + t20 += v * b14; + t21 += v * b15; + v = a[7]; + t7 += v * b0; + t8 += v * b1; + t9 += v * b2; + t10 += v * b3; + t11 += v * b4; + t12 += v * b5; + t13 += v * b6; + t14 += v * b7; + t15 += v * b8; + t16 += v * b9; + t17 += v * b10; + t18 += v * b11; + t19 += v * b12; + t20 += v * b13; + t21 += v * b14; + t22 += v * b15; + v = a[8]; + t8 += v * b0; + t9 += v * b1; + t10 += v * b2; + t11 += v * b3; + t12 += v * b4; + t13 += v * b5; + t14 += v * b6; + t15 += v * b7; + t16 += v * b8; + t17 += v * b9; + t18 += v * b10; + t19 += v * b11; + t20 += v * b12; + t21 += v * b13; + t22 += v * b14; + t23 += v * b15; + v = a[9]; + t9 += v * b0; + t10 += v * b1; + t11 += v * b2; + t12 += v * b3; + t13 += v * b4; + t14 += v * b5; + t15 += v * b6; + t16 += v * b7; + t17 += v * b8; + t18 += v * b9; + t19 += v * b10; + t20 += v * b11; + t21 += v * b12; + t22 += v * b13; + t23 += v * b14; + t24 += v * b15; + v = a[10]; + t10 += v * b0; + t11 += v * b1; + t12 += v * b2; + t13 += v * b3; + t14 += v * b4; + t15 += v * b5; + t16 += v * b6; + t17 += v * b7; + t18 += v * b8; + t19 += v * b9; + t20 += v * b10; + t21 += v * b11; + t22 += v * b12; + t23 += v * b13; + t24 += v * b14; + t25 += v * b15; + v = a[11]; + t11 += v * b0; + t12 += v * b1; + t13 += v * b2; + t14 += v * b3; + t15 += v * b4; + t16 += v * b5; + t17 += v * b6; + t18 += v * b7; + t19 += v * b8; + t20 += v * b9; + t21 += v * b10; + t22 += v * b11; + t23 += v * b12; + t24 += v * b13; + t25 += v * b14; + t26 += v * b15; + v = a[12]; + t12 += v * b0; + t13 += v * b1; + t14 += v * b2; + t15 += v * b3; + t16 += v * b4; + t17 += v * b5; + t18 += v * b6; + t19 += v * b7; + t20 += v * b8; + t21 += v * b9; + t22 += v * b10; + t23 += v * b11; + t24 += v * b12; + t25 += v * b13; + t26 += v * b14; + t27 += v * b15; + v = a[13]; + t13 += v * b0; + t14 += v * b1; + t15 += v * b2; + t16 += v * b3; + t17 += v * b4; + t18 += v * b5; + t19 += v * b6; + t20 += v * b7; + t21 += v * b8; + t22 += v * b9; + t23 += v * b10; + t24 += v * b11; + t25 += v * b12; + t26 += v * b13; + t27 += v * b14; + t28 += v * b15; + v = a[14]; + t14 += v * b0; + t15 += v * b1; + t16 += v * b2; + t17 += v * b3; + t18 += v * b4; + t19 += v * b5; + t20 += v * b6; + t21 += v * b7; + t22 += v * b8; + t23 += v * b9; + t24 += v * b10; + t25 += v * b11; + t26 += v * b12; + t27 += v * b13; + t28 += v * b14; + t29 += v * b15; + v = a[15]; + t15 += v * b0; + t16 += v * b1; + t17 += v * b2; + t18 += v * b3; + t19 += v * b4; + t20 += v * b5; + t21 += v * b6; + t22 += v * b7; + t23 += v * b8; + t24 += v * b9; + t25 += v * b10; + t26 += v * b11; + t27 += v * b12; + t28 += v * b13; + t29 += v * b14; + t30 += v * b15; + t0 += 38 * t16; + t1 += 38 * t17; + t2 += 38 * t18; + t3 += 38 * t19; + t4 += 38 * t20; + t5 += 38 * t21; + t6 += 38 * t22; + t7 += 38 * t23; + t8 += 38 * t24; + t9 += 38 * t25; + t10 += 38 * t26; + t11 += 38 * t27; + t12 += 38 * t28; + t13 += 38 * t29; + t14 += 38 * t30; + c = 1; + v = t0 + c + 65535; + c = Math.floor(v / 65536); + t0 = v - c * 65536; + v = t1 + c + 65535; + c = Math.floor(v / 65536); + t1 = v - c * 65536; + v = t2 + c + 65535; + c = Math.floor(v / 65536); + t2 = v - c * 65536; + v = t3 + c + 65535; + c = Math.floor(v / 65536); + t3 = v - c * 65536; + v = t4 + c + 65535; + c = Math.floor(v / 65536); + t4 = v - c * 65536; + v = t5 + c + 65535; + c = Math.floor(v / 65536); + t5 = v - c * 65536; + v = t6 + c + 65535; + c = Math.floor(v / 65536); + t6 = v - c * 65536; + v = t7 + c + 65535; + c = Math.floor(v / 65536); + t7 = v - c * 65536; + v = t8 + c + 65535; + c = Math.floor(v / 65536); + t8 = v - c * 65536; + v = t9 + c + 65535; + c = Math.floor(v / 65536); + t9 = v - c * 65536; + v = t10 + c + 65535; + c = Math.floor(v / 65536); + t10 = v - c * 65536; + v = t11 + c + 65535; + c = Math.floor(v / 65536); + t11 = v - c * 65536; + v = t12 + c + 65535; + c = Math.floor(v / 65536); + t12 = v - c * 65536; + v = t13 + c + 65535; + c = Math.floor(v / 65536); + t13 = v - c * 65536; + v = t14 + c + 65535; + c = Math.floor(v / 65536); + t14 = v - c * 65536; + v = t15 + c + 65535; + c = Math.floor(v / 65536); + t15 = v - c * 65536; + t0 += c - 1 + 37 * (c - 1); + c = 1; + v = t0 + c + 65535; + c = Math.floor(v / 65536); + t0 = v - c * 65536; + v = t1 + c + 65535; + c = Math.floor(v / 65536); + t1 = v - c * 65536; + v = t2 + c + 65535; + c = Math.floor(v / 65536); + t2 = v - c * 65536; + v = t3 + c + 65535; + c = Math.floor(v / 65536); + t3 = v - c * 65536; + v = t4 + c + 65535; + c = Math.floor(v / 65536); + t4 = v - c * 65536; + v = t5 + c + 65535; + c = Math.floor(v / 65536); + t5 = v - c * 65536; + v = t6 + c + 65535; + c = Math.floor(v / 65536); + t6 = v - c * 65536; + v = t7 + c + 65535; + c = Math.floor(v / 65536); + t7 = v - c * 65536; + v = t8 + c + 65535; + c = Math.floor(v / 65536); + t8 = v - c * 65536; + v = t9 + c + 65535; + c = Math.floor(v / 65536); + t9 = v - c * 65536; + v = t10 + c + 65535; + c = Math.floor(v / 65536); + t10 = v - c * 65536; + v = t11 + c + 65535; + c = Math.floor(v / 65536); + t11 = v - c * 65536; + v = t12 + c + 65535; + c = Math.floor(v / 65536); + t12 = v - c * 65536; + v = t13 + c + 65535; + c = Math.floor(v / 65536); + t13 = v - c * 65536; + v = t14 + c + 65535; + c = Math.floor(v / 65536); + t14 = v - c * 65536; + v = t15 + c + 65535; + c = Math.floor(v / 65536); + t15 = v - c * 65536; + t0 += c - 1 + 37 * (c - 1); + o[0] = t0; + o[1] = t1; + o[2] = t2; + o[3] = t3; + o[4] = t4; + o[5] = t5; + o[6] = t6; + o[7] = t7; + o[8] = t8; + o[9] = t9; + o[10] = t10; + o[11] = t11; + o[12] = t12; + o[13] = t13; + o[14] = t14; + o[15] = t15; + } + function S(o, a) { + M(o, a, a); + } + function inv25519(o, i) { + var c = gf(); + var a; + for (a = 0; a < 16; a++) + c[a] = i[a]; + for (a = 253; a >= 0; a--) { + S(c, c); + if (a !== 2 && a !== 4) + M(c, c, i); + } + for (a = 0; a < 16; a++) + o[a] = c[a]; + } + function pow2523(o, i) { + var c = gf(); + var a; + for (a = 0; a < 16; a++) + c[a] = i[a]; + for (a = 250; a >= 0; a--) { + S(c, c); + if (a !== 1) + M(c, c, i); + } + for (a = 0; a < 16; a++) + o[a] = c[a]; + } + function crypto_scalarmult(q, n, p) { + var z = new Uint8Array(32); + var x = new Float64Array(80), r, i; + var a = gf(), b = gf(), c = gf(), d = gf(), e = gf(), f = gf(); + for (i = 0; i < 31; i++) + z[i] = n[i]; + z[31] = n[31] & 127 | 64; + z[0] &= 248; + unpack25519(x, p); + for (i = 0; i < 16; i++) { + b[i] = x[i]; + d[i] = a[i] = c[i] = 0; + } + a[0] = d[0] = 1; + for (i = 254; i >= 0; --i) { + r = z[i >>> 3] >>> (i & 7) & 1; + sel25519(a, b, r); + sel25519(c, d, r); + A(e, a, c); + Z(a, a, c); + A(c, b, d); + Z(b, b, d); + S(d, e); + S(f, a); + M(a, c, a); + M(c, b, e); + A(e, a, c); + Z(a, a, c); + S(b, a); + Z(c, d, f); + M(a, c, _121665); + A(a, a, d); + M(c, c, a); + M(a, d, f); + M(d, b, x); + S(b, e); + sel25519(a, b, r); + sel25519(c, d, r); + } + for (i = 0; i < 16; i++) { + x[i + 16] = a[i]; + x[i + 32] = c[i]; + x[i + 48] = b[i]; + x[i + 64] = d[i]; + } + var x32 = x.subarray(32); + var x16 = x.subarray(16); + inv25519(x32, x32); + M(x16, x16, x32); + pack25519(q, x16); + return 0; + } + function crypto_scalarmult_base(q, n) { + return crypto_scalarmult(q, n, _9); + } + function crypto_box_keypair(y, x) { + randombytes(x, 32); + return crypto_scalarmult_base(y, x); + } + function crypto_box_beforenm(k, y, x) { + var s = new Uint8Array(32); + crypto_scalarmult(s, x, y); + return crypto_core_hsalsa20(k, _0, s, sigma); + } + var crypto_box_afternm = crypto_secretbox; + var crypto_box_open_afternm = crypto_secretbox_open; + function crypto_box(c, m, d, n, y, x) { + var k = new Uint8Array(32); + crypto_box_beforenm(k, y, x); + return crypto_box_afternm(c, m, d, n, k); + } + function crypto_box_open(m, c, d, n, y, x) { + var k = new Uint8Array(32); + crypto_box_beforenm(k, y, x); + return crypto_box_open_afternm(m, c, d, n, k); + } + var K = [ + 1116352408, + 3609767458, + 1899447441, + 602891725, + 3049323471, + 3964484399, + 3921009573, + 2173295548, + 961987163, + 4081628472, + 1508970993, + 3053834265, + 2453635748, + 2937671579, + 2870763221, + 3664609560, + 3624381080, + 2734883394, + 310598401, + 1164996542, + 607225278, + 1323610764, + 1426881987, + 3590304994, + 1925078388, + 4068182383, + 2162078206, + 991336113, + 2614888103, + 633803317, + 3248222580, + 3479774868, + 3835390401, + 2666613458, + 4022224774, + 944711139, + 264347078, + 2341262773, + 604807628, + 2007800933, + 770255983, + 1495990901, + 1249150122, + 1856431235, + 1555081692, + 3175218132, + 1996064986, + 2198950837, + 2554220882, + 3999719339, + 2821834349, + 766784016, + 2952996808, + 2566594879, + 3210313671, + 3203337956, + 3336571891, + 1034457026, + 3584528711, + 2466948901, + 113926993, + 3758326383, + 338241895, + 168717936, + 666307205, + 1188179964, + 773529912, + 1546045734, + 1294757372, + 1522805485, + 1396182291, + 2643833823, + 1695183700, + 2343527390, + 1986661051, + 1014477480, + 2177026350, + 1206759142, + 2456956037, + 344077627, + 2730485921, + 1290863460, + 2820302411, + 3158454273, + 3259730800, + 3505952657, + 3345764771, + 106217008, + 3516065817, + 3606008344, + 3600352804, + 1432725776, + 4094571909, + 1467031594, + 275423344, + 851169720, + 430227734, + 3100823752, + 506948616, + 1363258195, + 659060556, + 3750685593, + 883997877, + 3785050280, + 958139571, + 3318307427, + 1322822218, + 3812723403, + 1537002063, + 2003034995, + 1747873779, + 3602036899, + 1955562222, + 1575990012, + 2024104815, + 1125592928, + 2227730452, + 2716904306, + 2361852424, + 442776044, + 2428436474, + 593698344, + 2756734187, + 3733110249, + 3204031479, + 2999351573, + 3329325298, + 3815920427, + 3391569614, + 3928383900, + 3515267271, + 566280711, + 3940187606, + 3454069534, + 4118630271, + 4000239992, + 116418474, + 1914138554, + 174292421, + 2731055270, + 289380356, + 3203993006, + 460393269, + 320620315, + 685471733, + 587496836, + 852142971, + 1086792851, + 1017036298, + 365543100, + 1126000580, + 2618297676, + 1288033470, + 3409855158, + 1501505948, + 4234509866, + 1607167915, + 987167468, + 1816402316, + 1246189591 + ]; + function crypto_hashblocks_hl(hh, hl, m, n) { + var wh = new Int32Array(16), wl = new Int32Array(16), bh0, bh1, bh2, bh3, bh4, bh5, bh6, bh7, bl0, bl1, bl2, bl3, bl4, bl5, bl6, bl7, th, tl, i, j, h, l, a, b, c, d; + var ah0 = hh[0], ah1 = hh[1], ah2 = hh[2], ah3 = hh[3], ah4 = hh[4], ah5 = hh[5], ah6 = hh[6], ah7 = hh[7], al0 = hl[0], al1 = hl[1], al2 = hl[2], al3 = hl[3], al4 = hl[4], al5 = hl[5], al6 = hl[6], al7 = hl[7]; + var pos = 0; + while (n >= 128) { + for (i = 0; i < 16; i++) { + j = 8 * i + pos; + wh[i] = m[j + 0] << 24 | m[j + 1] << 16 | m[j + 2] << 8 | m[j + 3]; + wl[i] = m[j + 4] << 24 | m[j + 5] << 16 | m[j + 6] << 8 | m[j + 7]; + } + for (i = 0; i < 80; i++) { + bh0 = ah0; + bh1 = ah1; + bh2 = ah2; + bh3 = ah3; + bh4 = ah4; + bh5 = ah5; + bh6 = ah6; + bh7 = ah7; + bl0 = al0; + bl1 = al1; + bl2 = al2; + bl3 = al3; + bl4 = al4; + bl5 = al5; + bl6 = al6; + bl7 = al7; + h = ah7; + l = al7; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = (ah4 >>> 14 | al4 << 32 - 14) ^ (ah4 >>> 18 | al4 << 32 - 18) ^ (al4 >>> 41 - 32 | ah4 << 32 - (41 - 32)); + l = (al4 >>> 14 | ah4 << 32 - 14) ^ (al4 >>> 18 | ah4 << 32 - 18) ^ (ah4 >>> 41 - 32 | al4 << 32 - (41 - 32)); + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + h = ah4 & ah5 ^ ~ah4 & ah6; + l = al4 & al5 ^ ~al4 & al6; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + h = K[i * 2]; + l = K[i * 2 + 1]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + h = wh[i % 16]; + l = wl[i % 16]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + th = c & 65535 | d << 16; + tl = a & 65535 | b << 16; + h = th; + l = tl; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = (ah0 >>> 28 | al0 << 32 - 28) ^ (al0 >>> 34 - 32 | ah0 << 32 - (34 - 32)) ^ (al0 >>> 39 - 32 | ah0 << 32 - (39 - 32)); + l = (al0 >>> 28 | ah0 << 32 - 28) ^ (ah0 >>> 34 - 32 | al0 << 32 - (34 - 32)) ^ (ah0 >>> 39 - 32 | al0 << 32 - (39 - 32)); + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + h = ah0 & ah1 ^ ah0 & ah2 ^ ah1 & ah2; + l = al0 & al1 ^ al0 & al2 ^ al1 & al2; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + bh7 = c & 65535 | d << 16; + bl7 = a & 65535 | b << 16; + h = bh3; + l = bl3; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = th; + l = tl; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + bh3 = c & 65535 | d << 16; + bl3 = a & 65535 | b << 16; + ah1 = bh0; + ah2 = bh1; + ah3 = bh2; + ah4 = bh3; + ah5 = bh4; + ah6 = bh5; + ah7 = bh6; + ah0 = bh7; + al1 = bl0; + al2 = bl1; + al3 = bl2; + al4 = bl3; + al5 = bl4; + al6 = bl5; + al7 = bl6; + al0 = bl7; + if (i % 16 === 15) { + for (j = 0; j < 16; j++) { + h = wh[j]; + l = wl[j]; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = wh[(j + 9) % 16]; + l = wl[(j + 9) % 16]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + th = wh[(j + 1) % 16]; + tl = wl[(j + 1) % 16]; + h = (th >>> 1 | tl << 32 - 1) ^ (th >>> 8 | tl << 32 - 8) ^ th >>> 7; + l = (tl >>> 1 | th << 32 - 1) ^ (tl >>> 8 | th << 32 - 8) ^ (tl >>> 7 | th << 32 - 7); + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + th = wh[(j + 14) % 16]; + tl = wl[(j + 14) % 16]; + h = (th >>> 19 | tl << 32 - 19) ^ (tl >>> 61 - 32 | th << 32 - (61 - 32)) ^ th >>> 6; + l = (tl >>> 19 | th << 32 - 19) ^ (th >>> 61 - 32 | tl << 32 - (61 - 32)) ^ (tl >>> 6 | th << 32 - 6); + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + wh[j] = c & 65535 | d << 16; + wl[j] = a & 65535 | b << 16; + } + } + } + h = ah0; + l = al0; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = hh[0]; + l = hl[0]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + hh[0] = ah0 = c & 65535 | d << 16; + hl[0] = al0 = a & 65535 | b << 16; + h = ah1; + l = al1; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = hh[1]; + l = hl[1]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + hh[1] = ah1 = c & 65535 | d << 16; + hl[1] = al1 = a & 65535 | b << 16; + h = ah2; + l = al2; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = hh[2]; + l = hl[2]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + hh[2] = ah2 = c & 65535 | d << 16; + hl[2] = al2 = a & 65535 | b << 16; + h = ah3; + l = al3; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = hh[3]; + l = hl[3]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + hh[3] = ah3 = c & 65535 | d << 16; + hl[3] = al3 = a & 65535 | b << 16; + h = ah4; + l = al4; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = hh[4]; + l = hl[4]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + hh[4] = ah4 = c & 65535 | d << 16; + hl[4] = al4 = a & 65535 | b << 16; + h = ah5; + l = al5; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = hh[5]; + l = hl[5]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + hh[5] = ah5 = c & 65535 | d << 16; + hl[5] = al5 = a & 65535 | b << 16; + h = ah6; + l = al6; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = hh[6]; + l = hl[6]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + hh[6] = ah6 = c & 65535 | d << 16; + hl[6] = al6 = a & 65535 | b << 16; + h = ah7; + l = al7; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = hh[7]; + l = hl[7]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + hh[7] = ah7 = c & 65535 | d << 16; + hl[7] = al7 = a & 65535 | b << 16; + pos += 128; + n -= 128; + } + return n; + } + function crypto_hash(out, m, n) { + var hh = new Int32Array(8), hl = new Int32Array(8), x = new Uint8Array(256), i, b = n; + hh[0] = 1779033703; + hh[1] = 3144134277; + hh[2] = 1013904242; + hh[3] = 2773480762; + hh[4] = 1359893119; + hh[5] = 2600822924; + hh[6] = 528734635; + hh[7] = 1541459225; + hl[0] = 4089235720; + hl[1] = 2227873595; + hl[2] = 4271175723; + hl[3] = 1595750129; + hl[4] = 2917565137; + hl[5] = 725511199; + hl[6] = 4215389547; + hl[7] = 327033209; + crypto_hashblocks_hl(hh, hl, m, n); + n %= 128; + for (i = 0; i < n; i++) + x[i] = m[b - n + i]; + x[n] = 128; + n = 256 - 128 * (n < 112 ? 1 : 0); + x[n - 9] = 0; + ts64(x, n - 8, b / 536870912 | 0, b << 3); + crypto_hashblocks_hl(hh, hl, x, n); + for (i = 0; i < 8; i++) + ts64(out, 8 * i, hh[i], hl[i]); + return 0; + } + function add(p, q) { + var a = gf(), b = gf(), c = gf(), d = gf(), e = gf(), f = gf(), g = gf(), h = gf(), t = gf(); + Z(a, p[1], p[0]); + Z(t, q[1], q[0]); + M(a, a, t); + A(b, p[0], p[1]); + A(t, q[0], q[1]); + M(b, b, t); + M(c, p[3], q[3]); + M(c, c, D2); + M(d, p[2], q[2]); + A(d, d, d); + Z(e, b, a); + Z(f, d, c); + A(g, d, c); + A(h, b, a); + M(p[0], e, f); + M(p[1], h, g); + M(p[2], g, f); + M(p[3], e, h); + } + function cswap(p, q, b) { + var i; + for (i = 0; i < 4; i++) { + sel25519(p[i], q[i], b); + } + } + function pack(r, p) { + var tx = gf(), ty = gf(), zi = gf(); + inv25519(zi, p[2]); + M(tx, p[0], zi); + M(ty, p[1], zi); + pack25519(r, ty); + r[31] ^= par25519(tx) << 7; + } + function scalarmult(p, q, s) { + var b, i; + set25519(p[0], gf0); + set25519(p[1], gf1); + set25519(p[2], gf1); + set25519(p[3], gf0); + for (i = 255; i >= 0; --i) { + b = s[i / 8 | 0] >> (i & 7) & 1; + cswap(p, q, b); + add(q, p); + add(p, p); + cswap(p, q, b); + } + } + function scalarbase(p, s) { + var q = [gf(), gf(), gf(), gf()]; + set25519(q[0], X); + set25519(q[1], Y); + set25519(q[2], gf1); + M(q[3], X, Y); + scalarmult(p, q, s); + } + function crypto_sign_keypair(pk, sk, seeded) { + var d = new Uint8Array(64); + var p = [gf(), gf(), gf(), gf()]; + var i; + if (!seeded) + randombytes(sk, 32); + crypto_hash(d, sk, 32); + d[0] &= 248; + d[31] &= 127; + d[31] |= 64; + scalarbase(p, d); + pack(pk, p); + for (i = 0; i < 32; i++) + sk[i + 32] = pk[i]; + return 0; + } + var L2 = new Float64Array([237, 211, 245, 92, 26, 99, 18, 88, 214, 156, 247, 162, 222, 249, 222, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16]); + function modL(r, x) { + var carry, i, j, k; + for (i = 63; i >= 32; --i) { + carry = 0; + for (j = i - 32, k = i - 12; j < k; ++j) { + x[j] += carry - 16 * x[i] * L2[j - (i - 32)]; + carry = Math.floor((x[j] + 128) / 256); + x[j] -= carry * 256; + } + x[j] += carry; + x[i] = 0; + } + carry = 0; + for (j = 0; j < 32; j++) { + x[j] += carry - (x[31] >> 4) * L2[j]; + carry = x[j] >> 8; + x[j] &= 255; + } + for (j = 0; j < 32; j++) + x[j] -= carry * L2[j]; + for (i = 0; i < 32; i++) { + x[i + 1] += x[i] >> 8; + r[i] = x[i] & 255; + } + } + function reduce(r) { + var x = new Float64Array(64), i; + for (i = 0; i < 64; i++) + x[i] = r[i]; + for (i = 0; i < 64; i++) + r[i] = 0; + modL(r, x); + } + function crypto_sign(sm, m, n, sk) { + var d = new Uint8Array(64), h = new Uint8Array(64), r = new Uint8Array(64); + var i, j, x = new Float64Array(64); + var p = [gf(), gf(), gf(), gf()]; + crypto_hash(d, sk, 32); + d[0] &= 248; + d[31] &= 127; + d[31] |= 64; + var smlen = n + 64; + for (i = 0; i < n; i++) + sm[64 + i] = m[i]; + for (i = 0; i < 32; i++) + sm[32 + i] = d[32 + i]; + crypto_hash(r, sm.subarray(32), n + 32); + reduce(r); + scalarbase(p, r); + pack(sm, p); + for (i = 32; i < 64; i++) + sm[i] = sk[i]; + crypto_hash(h, sm, n + 64); + reduce(h); + for (i = 0; i < 64; i++) + x[i] = 0; + for (i = 0; i < 32; i++) + x[i] = r[i]; + for (i = 0; i < 32; i++) { + for (j = 0; j < 32; j++) { + x[i + j] += h[i] * d[j]; + } + } + modL(sm.subarray(32), x); + return smlen; + } + function unpackneg(r, p) { + var t = gf(), chk = gf(), num = gf(), den = gf(), den2 = gf(), den4 = gf(), den6 = gf(); + set25519(r[2], gf1); + unpack25519(r[1], p); + S(num, r[1]); + M(den, num, D); + Z(num, num, r[2]); + A(den, r[2], den); + S(den2, den); + S(den4, den2); + M(den6, den4, den2); + M(t, den6, num); + M(t, t, den); + pow2523(t, t); + M(t, t, num); + M(t, t, den); + M(t, t, den); + M(r[0], t, den); + S(chk, r[0]); + M(chk, chk, den); + if (neq25519(chk, num)) + M(r[0], r[0], I); + S(chk, r[0]); + M(chk, chk, den); + if (neq25519(chk, num)) + return -1; + if (par25519(r[0]) === p[31] >> 7) + Z(r[0], gf0, r[0]); + M(r[3], r[0], r[1]); + return 0; + } + function crypto_sign_open(m, sm, n, pk) { + var i; + var t = new Uint8Array(32), h = new Uint8Array(64); + var p = [gf(), gf(), gf(), gf()], q = [gf(), gf(), gf(), gf()]; + if (n < 64) + return -1; + if (unpackneg(q, pk)) + return -1; + for (i = 0; i < n; i++) + m[i] = sm[i]; + for (i = 0; i < 32; i++) + m[i + 32] = pk[i]; + crypto_hash(h, m, n); + reduce(h); + scalarmult(p, q, h); + scalarbase(q, sm.subarray(32)); + add(p, q); + pack(t, p); + n -= 64; + if (crypto_verify_32(sm, 0, t, 0)) { + for (i = 0; i < n; i++) + m[i] = 0; + return -1; + } + for (i = 0; i < n; i++) + m[i] = sm[i + 64]; + return n; + } + var crypto_secretbox_KEYBYTES = 32, crypto_secretbox_NONCEBYTES = 24, crypto_secretbox_ZEROBYTES = 32, crypto_secretbox_BOXZEROBYTES = 16, crypto_scalarmult_BYTES = 32, crypto_scalarmult_SCALARBYTES = 32, crypto_box_PUBLICKEYBYTES = 32, crypto_box_SECRETKEYBYTES = 32, crypto_box_BEFORENMBYTES = 32, crypto_box_NONCEBYTES = crypto_secretbox_NONCEBYTES, crypto_box_ZEROBYTES = crypto_secretbox_ZEROBYTES, crypto_box_BOXZEROBYTES = crypto_secretbox_BOXZEROBYTES, crypto_sign_BYTES = 64, crypto_sign_PUBLICKEYBYTES = 32, crypto_sign_SECRETKEYBYTES = 64, crypto_sign_SEEDBYTES = 32, crypto_hash_BYTES = 64; + nacl2.lowlevel = { + crypto_core_hsalsa20, + crypto_stream_xor, + crypto_stream, + crypto_stream_salsa20_xor, + crypto_stream_salsa20, + crypto_onetimeauth, + crypto_onetimeauth_verify, + crypto_verify_16, + crypto_verify_32, + crypto_secretbox, + crypto_secretbox_open, + crypto_scalarmult, + crypto_scalarmult_base, + crypto_box_beforenm, + crypto_box_afternm, + crypto_box, + crypto_box_open, + crypto_box_keypair, + crypto_hash, + crypto_sign, + crypto_sign_keypair, + crypto_sign_open, + crypto_secretbox_KEYBYTES, + crypto_secretbox_NONCEBYTES, + crypto_secretbox_ZEROBYTES, + crypto_secretbox_BOXZEROBYTES, + crypto_scalarmult_BYTES, + crypto_scalarmult_SCALARBYTES, + crypto_box_PUBLICKEYBYTES, + crypto_box_SECRETKEYBYTES, + crypto_box_BEFORENMBYTES, + crypto_box_NONCEBYTES, + crypto_box_ZEROBYTES, + crypto_box_BOXZEROBYTES, + crypto_sign_BYTES, + crypto_sign_PUBLICKEYBYTES, + crypto_sign_SECRETKEYBYTES, + crypto_sign_SEEDBYTES, + crypto_hash_BYTES, + gf, + D, + L: L2, + pack25519, + unpack25519, + M, + A, + S, + Z, + pow2523, + add, + set25519, + modL, + scalarmult, + scalarbase + }; + function checkLengths(k, n) { + if (k.length !== crypto_secretbox_KEYBYTES) + throw new Error("bad key size"); + if (n.length !== crypto_secretbox_NONCEBYTES) + throw new Error("bad nonce size"); + } + function checkBoxLengths(pk, sk) { + if (pk.length !== crypto_box_PUBLICKEYBYTES) + throw new Error("bad public key size"); + if (sk.length !== crypto_box_SECRETKEYBYTES) + throw new Error("bad secret key size"); + } + function checkArrayTypes() { + for (var i = 0; i < arguments.length; i++) { + if (!(arguments[i] instanceof Uint8Array)) + throw new TypeError("unexpected type, use Uint8Array"); + } + } + function cleanup(arr) { + for (var i = 0; i < arr.length; i++) + arr[i] = 0; + } + nacl2.randomBytes = function(n) { + var b = new Uint8Array(n); + randombytes(b, n); + return b; + }; + nacl2.secretbox = function(msg, nonce, key) { + checkArrayTypes(msg, nonce, key); + checkLengths(key, nonce); + var m = new Uint8Array(crypto_secretbox_ZEROBYTES + msg.length); + var c = new Uint8Array(m.length); + for (var i = 0; i < msg.length; i++) + m[i + crypto_secretbox_ZEROBYTES] = msg[i]; + crypto_secretbox(c, m, m.length, nonce, key); + return c.subarray(crypto_secretbox_BOXZEROBYTES); + }; + nacl2.secretbox.open = function(box, nonce, key) { + checkArrayTypes(box, nonce, key); + checkLengths(key, nonce); + var c = new Uint8Array(crypto_secretbox_BOXZEROBYTES + box.length); + var m = new Uint8Array(c.length); + for (var i = 0; i < box.length; i++) + c[i + crypto_secretbox_BOXZEROBYTES] = box[i]; + if (c.length < 32) + return null; + if (crypto_secretbox_open(m, c, c.length, nonce, key) !== 0) + return null; + return m.subarray(crypto_secretbox_ZEROBYTES); + }; + nacl2.secretbox.keyLength = crypto_secretbox_KEYBYTES; + nacl2.secretbox.nonceLength = crypto_secretbox_NONCEBYTES; + nacl2.secretbox.overheadLength = crypto_secretbox_BOXZEROBYTES; + nacl2.scalarMult = function(n, p) { + checkArrayTypes(n, p); + if (n.length !== crypto_scalarmult_SCALARBYTES) + throw new Error("bad n size"); + if (p.length !== crypto_scalarmult_BYTES) + throw new Error("bad p size"); + var q = new Uint8Array(crypto_scalarmult_BYTES); + crypto_scalarmult(q, n, p); + return q; + }; + nacl2.scalarMult.base = function(n) { + checkArrayTypes(n); + if (n.length !== crypto_scalarmult_SCALARBYTES) + throw new Error("bad n size"); + var q = new Uint8Array(crypto_scalarmult_BYTES); + crypto_scalarmult_base(q, n); + return q; + }; + nacl2.scalarMult.scalarLength = crypto_scalarmult_SCALARBYTES; + nacl2.scalarMult.groupElementLength = crypto_scalarmult_BYTES; + nacl2.box = function(msg, nonce, publicKey, secretKey) { + var k = nacl2.box.before(publicKey, secretKey); + return nacl2.secretbox(msg, nonce, k); + }; + nacl2.box.before = function(publicKey, secretKey) { + checkArrayTypes(publicKey, secretKey); + checkBoxLengths(publicKey, secretKey); + var k = new Uint8Array(crypto_box_BEFORENMBYTES); + crypto_box_beforenm(k, publicKey, secretKey); + return k; + }; + nacl2.box.after = nacl2.secretbox; + nacl2.box.open = function(msg, nonce, publicKey, secretKey) { + var k = nacl2.box.before(publicKey, secretKey); + return nacl2.secretbox.open(msg, nonce, k); + }; + nacl2.box.open.after = nacl2.secretbox.open; + nacl2.box.keyPair = function() { + var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES); + var sk = new Uint8Array(crypto_box_SECRETKEYBYTES); + crypto_box_keypair(pk, sk); + return { publicKey: pk, secretKey: sk }; + }; + nacl2.box.keyPair.fromSecretKey = function(secretKey) { + checkArrayTypes(secretKey); + if (secretKey.length !== crypto_box_SECRETKEYBYTES) + throw new Error("bad secret key size"); + var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES); + crypto_scalarmult_base(pk, secretKey); + return { publicKey: pk, secretKey: new Uint8Array(secretKey) }; + }; + nacl2.box.publicKeyLength = crypto_box_PUBLICKEYBYTES; + nacl2.box.secretKeyLength = crypto_box_SECRETKEYBYTES; + nacl2.box.sharedKeyLength = crypto_box_BEFORENMBYTES; + nacl2.box.nonceLength = crypto_box_NONCEBYTES; + nacl2.box.overheadLength = nacl2.secretbox.overheadLength; + nacl2.sign = function(msg, secretKey) { + checkArrayTypes(msg, secretKey); + if (secretKey.length !== crypto_sign_SECRETKEYBYTES) + throw new Error("bad secret key size"); + var signedMsg = new Uint8Array(crypto_sign_BYTES + msg.length); + crypto_sign(signedMsg, msg, msg.length, secretKey); + return signedMsg; + }; + nacl2.sign.open = function(signedMsg, publicKey) { + checkArrayTypes(signedMsg, publicKey); + if (publicKey.length !== crypto_sign_PUBLICKEYBYTES) + throw new Error("bad public key size"); + var tmp = new Uint8Array(signedMsg.length); + var mlen = crypto_sign_open(tmp, signedMsg, signedMsg.length, publicKey); + if (mlen < 0) + return null; + var m = new Uint8Array(mlen); + for (var i = 0; i < m.length; i++) + m[i] = tmp[i]; + return m; + }; + nacl2.sign.detached = function(msg, secretKey) { + var signedMsg = nacl2.sign(msg, secretKey); + var sig = new Uint8Array(crypto_sign_BYTES); + for (var i = 0; i < sig.length; i++) + sig[i] = signedMsg[i]; + return sig; + }; + nacl2.sign.detached.verify = function(msg, sig, publicKey) { + checkArrayTypes(msg, sig, publicKey); + if (sig.length !== crypto_sign_BYTES) + throw new Error("bad signature size"); + if (publicKey.length !== crypto_sign_PUBLICKEYBYTES) + throw new Error("bad public key size"); + var sm = new Uint8Array(crypto_sign_BYTES + msg.length); + var m = new Uint8Array(crypto_sign_BYTES + msg.length); + var i; + for (i = 0; i < crypto_sign_BYTES; i++) + sm[i] = sig[i]; + for (i = 0; i < msg.length; i++) + sm[i + crypto_sign_BYTES] = msg[i]; + return crypto_sign_open(m, sm, sm.length, publicKey) >= 0; + }; + nacl2.sign.keyPair = function() { + var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES); + var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES); + crypto_sign_keypair(pk, sk); + return { publicKey: pk, secretKey: sk }; + }; + nacl2.sign.keyPair.fromSecretKey = function(secretKey) { + checkArrayTypes(secretKey); + if (secretKey.length !== crypto_sign_SECRETKEYBYTES) + throw new Error("bad secret key size"); + var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES); + for (var i = 0; i < pk.length; i++) + pk[i] = secretKey[32 + i]; + return { publicKey: pk, secretKey: new Uint8Array(secretKey) }; + }; + nacl2.sign.keyPair.fromSeed = function(seed) { + checkArrayTypes(seed); + if (seed.length !== crypto_sign_SEEDBYTES) + throw new Error("bad seed size"); + var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES); + var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES); + for (var i = 0; i < 32; i++) + sk[i] = seed[i]; + crypto_sign_keypair(pk, sk, true); + return { publicKey: pk, secretKey: sk }; + }; + nacl2.sign.publicKeyLength = crypto_sign_PUBLICKEYBYTES; + nacl2.sign.secretKeyLength = crypto_sign_SECRETKEYBYTES; + nacl2.sign.seedLength = crypto_sign_SEEDBYTES; + nacl2.sign.signatureLength = crypto_sign_BYTES; + nacl2.hash = function(msg) { + checkArrayTypes(msg); + var h = new Uint8Array(crypto_hash_BYTES); + crypto_hash(h, msg, msg.length); + return h; + }; + nacl2.hash.hashLength = crypto_hash_BYTES; + nacl2.verify = function(x, y) { + checkArrayTypes(x, y); + if (x.length === 0 || y.length === 0) + return false; + if (x.length !== y.length) + return false; + return vn(x, 0, y, 0, x.length) === 0 ? true : false; + }; + nacl2.setPRNG = function(fn) { + randombytes = fn; + }; + (function() { + var crypto2 = typeof self !== "undefined" ? self.crypto || self.msCrypto : null; + if (crypto2 && crypto2.getRandomValues) { + var QUOTA = 65536; + nacl2.setPRNG(function(x, n) { + var i, v = new Uint8Array(n); + for (i = 0; i < n; i += QUOTA) { + crypto2.getRandomValues(v.subarray(i, i + Math.min(n - i, QUOTA))); + } + for (i = 0; i < n; i++) + x[i] = v[i]; + cleanup(v); + }); + } else if (typeof __require !== "undefined") { + crypto2 = require_crypto(); + if (crypto2 && crypto2.randomBytes) { + nacl2.setPRNG(function(x, n) { + var i, v = crypto2.randomBytes(n); + for (i = 0; i < n; i++) + x[i] = v[i]; + cleanup(v); + }); + } + } + })(); + })(typeof module !== "undefined" && module.exports ? module.exports : self.nacl = self.nacl || {}); + } + }); + + // node_modules/scrypt-async/scrypt-async.js + var require_scrypt_async = __commonJS({ + "node_modules/scrypt-async/scrypt-async.js"(exports, module) { + function scrypt2(password, salt, logN, r, dkLen, interruptStep, callback, encoding) { + "use strict"; + function SHA256(m) { + var K = [ + 1116352408, + 1899447441, + 3049323471, + 3921009573, + 961987163, + 1508970993, + 2453635748, + 2870763221, + 3624381080, + 310598401, + 607225278, + 1426881987, + 1925078388, + 2162078206, + 2614888103, + 3248222580, + 3835390401, + 4022224774, + 264347078, + 604807628, + 770255983, + 1249150122, + 1555081692, + 1996064986, + 2554220882, + 2821834349, + 2952996808, + 3210313671, + 3336571891, + 3584528711, + 113926993, + 338241895, + 666307205, + 773529912, + 1294757372, + 1396182291, + 1695183700, + 1986661051, + 2177026350, + 2456956037, + 2730485921, + 2820302411, + 3259730800, + 3345764771, + 3516065817, + 3600352804, + 4094571909, + 275423344, + 430227734, + 506948616, + 659060556, + 883997877, + 958139571, + 1322822218, + 1537002063, + 1747873779, + 1955562222, + 2024104815, + 2227730452, + 2361852424, + 2428436474, + 2756734187, + 3204031479, + 3329325298 + ]; + var h0 = 1779033703, h1 = 3144134277, h2 = 1013904242, h3 = 2773480762, h4 = 1359893119, h5 = 2600822924, h6 = 528734635, h7 = 1541459225, w = new Array(64); + function blocks(p3) { + var off = 0, len = p3.length; + while (len >= 64) { + var a = h0, b = h1, c = h2, d = h3, e = h4, f = h5, g = h6, h = h7, u, i2, j, t1, t2; + for (i2 = 0; i2 < 16; i2++) { + j = off + i2 * 4; + w[i2] = (p3[j] & 255) << 24 | (p3[j + 1] & 255) << 16 | (p3[j + 2] & 255) << 8 | p3[j + 3] & 255; + } + for (i2 = 16; i2 < 64; i2++) { + u = w[i2 - 2]; + t1 = (u >>> 17 | u << 32 - 17) ^ (u >>> 19 | u << 32 - 19) ^ u >>> 10; + u = w[i2 - 15]; + t2 = (u >>> 7 | u << 32 - 7) ^ (u >>> 18 | u << 32 - 18) ^ u >>> 3; + w[i2] = (t1 + w[i2 - 7] | 0) + (t2 + w[i2 - 16] | 0) | 0; + } + for (i2 = 0; i2 < 64; i2++) { + t1 = (((e >>> 6 | e << 32 - 6) ^ (e >>> 11 | e << 32 - 11) ^ (e >>> 25 | e << 32 - 25)) + (e & f ^ ~e & g) | 0) + (h + (K[i2] + w[i2] | 0) | 0) | 0; + t2 = ((a >>> 2 | a << 32 - 2) ^ (a >>> 13 | a << 32 - 13) ^ (a >>> 22 | a << 32 - 22)) + (a & b ^ a & c ^ b & c) | 0; + h = g; + g = f; + f = e; + e = d + t1 | 0; + d = c; + c = b; + b = a; + a = t1 + t2 | 0; + } + h0 = h0 + a | 0; + h1 = h1 + b | 0; + h2 = h2 + c | 0; + h3 = h3 + d | 0; + h4 = h4 + e | 0; + h5 = h5 + f | 0; + h6 = h6 + g | 0; + h7 = h7 + h | 0; + off += 64; + len -= 64; + } + } + blocks(m); + var i, bytesLeft = m.length % 64, bitLenHi = m.length / 536870912 | 0, bitLenLo = m.length << 3, numZeros = bytesLeft < 56 ? 56 : 120, p2 = m.slice(m.length - bytesLeft, m.length); + p2.push(128); + for (i = bytesLeft + 1; i < numZeros; i++) + p2.push(0); + p2.push(bitLenHi >>> 24 & 255); + p2.push(bitLenHi >>> 16 & 255); + p2.push(bitLenHi >>> 8 & 255); + p2.push(bitLenHi >>> 0 & 255); + p2.push(bitLenLo >>> 24 & 255); + p2.push(bitLenLo >>> 16 & 255); + p2.push(bitLenLo >>> 8 & 255); + p2.push(bitLenLo >>> 0 & 255); + blocks(p2); + return [ + h0 >>> 24 & 255, + h0 >>> 16 & 255, + h0 >>> 8 & 255, + h0 >>> 0 & 255, + h1 >>> 24 & 255, + h1 >>> 16 & 255, + h1 >>> 8 & 255, + h1 >>> 0 & 255, + h2 >>> 24 & 255, + h2 >>> 16 & 255, + h2 >>> 8 & 255, + h2 >>> 0 & 255, + h3 >>> 24 & 255, + h3 >>> 16 & 255, + h3 >>> 8 & 255, + h3 >>> 0 & 255, + h4 >>> 24 & 255, + h4 >>> 16 & 255, + h4 >>> 8 & 255, + h4 >>> 0 & 255, + h5 >>> 24 & 255, + h5 >>> 16 & 255, + h5 >>> 8 & 255, + h5 >>> 0 & 255, + h6 >>> 24 & 255, + h6 >>> 16 & 255, + h6 >>> 8 & 255, + h6 >>> 0 & 255, + h7 >>> 24 & 255, + h7 >>> 16 & 255, + h7 >>> 8 & 255, + h7 >>> 0 & 255 + ]; + } + function PBKDF2_HMAC_SHA256_OneIter(password2, salt2, dkLen2) { + if (password2.length > 64) { + password2 = SHA256(password2.push ? password2 : Array.prototype.slice.call(password2, 0)); + } + var i, innerLen = 64 + salt2.length + 4, inner = new Array(innerLen), outerKey = new Array(64), dk = []; + for (i = 0; i < 64; i++) + inner[i] = 54; + for (i = 0; i < password2.length; i++) + inner[i] ^= password2[i]; + for (i = 0; i < salt2.length; i++) + inner[64 + i] = salt2[i]; + for (i = innerLen - 4; i < innerLen; i++) + inner[i] = 0; + for (i = 0; i < 64; i++) + outerKey[i] = 92; + for (i = 0; i < password2.length; i++) + outerKey[i] ^= password2[i]; + function incrementCounter() { + for (var i2 = innerLen - 1; i2 >= innerLen - 4; i2--) { + inner[i2]++; + if (inner[i2] <= 255) + return; + inner[i2] = 0; + } + } + while (dkLen2 >= 32) { + incrementCounter(); + dk = dk.concat(SHA256(outerKey.concat(SHA256(inner)))); + dkLen2 -= 32; + } + if (dkLen2 > 0) { + incrementCounter(); + dk = dk.concat(SHA256(outerKey.concat(SHA256(inner))).slice(0, dkLen2)); + } + return dk; + } + function salsaXOR(tmp2, B2, bin, bout) { + var j0 = tmp2[0] ^ B2[bin++], j1 = tmp2[1] ^ B2[bin++], j2 = tmp2[2] ^ B2[bin++], j3 = tmp2[3] ^ B2[bin++], j4 = tmp2[4] ^ B2[bin++], j5 = tmp2[5] ^ B2[bin++], j6 = tmp2[6] ^ B2[bin++], j7 = tmp2[7] ^ B2[bin++], j8 = tmp2[8] ^ B2[bin++], j9 = tmp2[9] ^ B2[bin++], j10 = tmp2[10] ^ B2[bin++], j11 = tmp2[11] ^ B2[bin++], j12 = tmp2[12] ^ B2[bin++], j13 = tmp2[13] ^ B2[bin++], j14 = tmp2[14] ^ B2[bin++], j15 = tmp2[15] ^ B2[bin++], u, i; + var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7, x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14, x15 = j15; + for (i = 0; i < 8; i += 2) { + u = x0 + x12; + x4 ^= u << 7 | u >>> 32 - 7; + u = x4 + x0; + x8 ^= u << 9 | u >>> 32 - 9; + u = x8 + x4; + x12 ^= u << 13 | u >>> 32 - 13; + u = x12 + x8; + x0 ^= u << 18 | u >>> 32 - 18; + u = x5 + x1; + x9 ^= u << 7 | u >>> 32 - 7; + u = x9 + x5; + x13 ^= u << 9 | u >>> 32 - 9; + u = x13 + x9; + x1 ^= u << 13 | u >>> 32 - 13; + u = x1 + x13; + x5 ^= u << 18 | u >>> 32 - 18; + u = x10 + x6; + x14 ^= u << 7 | u >>> 32 - 7; + u = x14 + x10; + x2 ^= u << 9 | u >>> 32 - 9; + u = x2 + x14; + x6 ^= u << 13 | u >>> 32 - 13; + u = x6 + x2; + x10 ^= u << 18 | u >>> 32 - 18; + u = x15 + x11; + x3 ^= u << 7 | u >>> 32 - 7; + u = x3 + x15; + x7 ^= u << 9 | u >>> 32 - 9; + u = x7 + x3; + x11 ^= u << 13 | u >>> 32 - 13; + u = x11 + x7; + x15 ^= u << 18 | u >>> 32 - 18; + u = x0 + x3; + x1 ^= u << 7 | u >>> 32 - 7; + u = x1 + x0; + x2 ^= u << 9 | u >>> 32 - 9; + u = x2 + x1; + x3 ^= u << 13 | u >>> 32 - 13; + u = x3 + x2; + x0 ^= u << 18 | u >>> 32 - 18; + u = x5 + x4; + x6 ^= u << 7 | u >>> 32 - 7; + u = x6 + x5; + x7 ^= u << 9 | u >>> 32 - 9; + u = x7 + x6; + x4 ^= u << 13 | u >>> 32 - 13; + u = x4 + x7; + x5 ^= u << 18 | u >>> 32 - 18; + u = x10 + x9; + x11 ^= u << 7 | u >>> 32 - 7; + u = x11 + x10; + x8 ^= u << 9 | u >>> 32 - 9; + u = x8 + x11; + x9 ^= u << 13 | u >>> 32 - 13; + u = x9 + x8; + x10 ^= u << 18 | u >>> 32 - 18; + u = x15 + x14; + x12 ^= u << 7 | u >>> 32 - 7; + u = x12 + x15; + x13 ^= u << 9 | u >>> 32 - 9; + u = x13 + x12; + x14 ^= u << 13 | u >>> 32 - 13; + u = x14 + x13; + x15 ^= u << 18 | u >>> 32 - 18; + } + B2[bout++] = tmp2[0] = x0 + j0 | 0; + B2[bout++] = tmp2[1] = x1 + j1 | 0; + B2[bout++] = tmp2[2] = x2 + j2 | 0; + B2[bout++] = tmp2[3] = x3 + j3 | 0; + B2[bout++] = tmp2[4] = x4 + j4 | 0; + B2[bout++] = tmp2[5] = x5 + j5 | 0; + B2[bout++] = tmp2[6] = x6 + j6 | 0; + B2[bout++] = tmp2[7] = x7 + j7 | 0; + B2[bout++] = tmp2[8] = x8 + j8 | 0; + B2[bout++] = tmp2[9] = x9 + j9 | 0; + B2[bout++] = tmp2[10] = x10 + j10 | 0; + B2[bout++] = tmp2[11] = x11 + j11 | 0; + B2[bout++] = tmp2[12] = x12 + j12 | 0; + B2[bout++] = tmp2[13] = x13 + j13 | 0; + B2[bout++] = tmp2[14] = x14 + j14 | 0; + B2[bout++] = tmp2[15] = x15 + j15 | 0; + } + function blockCopy(dst, di, src2, si, len) { + while (len--) + dst[di++] = src2[si++]; + } + function blockXOR(dst, di, src2, si, len) { + while (len--) + dst[di++] ^= src2[si++]; + } + function blockMix(tmp2, B2, bin, bout, r2) { + blockCopy(tmp2, 0, B2, bin + (2 * r2 - 1) * 16, 16); + for (var i = 0; i < 2 * r2; i += 2) { + salsaXOR(tmp2, B2, bin + i * 16, bout + i * 8); + salsaXOR(tmp2, B2, bin + i * 16 + 16, bout + i * 8 + r2 * 16); + } + } + function integerify(B2, bi, r2) { + return B2[bi + (2 * r2 - 1) * 16]; + } + function stringToUTF8Bytes(s) { + var arr = []; + for (var i = 0; i < s.length; i++) { + var c = s.charCodeAt(i); + if (c < 128) { + arr.push(c); + } else if (c < 2048) { + arr.push(192 | c >> 6); + arr.push(128 | c & 63); + } else if (c < 55296) { + arr.push(224 | c >> 12); + arr.push(128 | c >> 6 & 63); + arr.push(128 | c & 63); + } else { + if (i >= s.length - 1) { + throw new Error("invalid string"); + } + i++; + c = (c & 1023) << 10; + c |= s.charCodeAt(i) & 1023; + c += 65536; + arr.push(240 | c >> 18); + arr.push(128 | c >> 12 & 63); + arr.push(128 | c >> 6 & 63); + arr.push(128 | c & 63); + } + } + return arr; + } + function bytesToHex(p2) { + var enc = "0123456789abcdef".split(""); + var len = p2.length, arr = [], i = 0; + for (; i < len; i++) { + arr.push(enc[p2[i] >>> 4 & 15]); + arr.push(enc[p2[i] >>> 0 & 15]); + } + return arr.join(""); + } + function bytesToBase64(p2) { + var enc = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""); + var len = p2.length, arr = [], i = 0, a, b, c, t; + while (i < len) { + a = i < len ? p2[i++] : 0; + b = i < len ? p2[i++] : 0; + c = i < len ? p2[i++] : 0; + t = (a << 16) + (b << 8) + c; + arr.push(enc[t >>> 3 * 6 & 63]); + arr.push(enc[t >>> 2 * 6 & 63]); + arr.push(enc[t >>> 1 * 6 & 63]); + arr.push(enc[t >>> 0 * 6 & 63]); + } + if (len % 3 > 0) { + arr[arr.length - 1] = "="; + if (len % 3 === 1) + arr[arr.length - 2] = "="; + } + return arr.join(""); + } + var MAX_UINT = -1 >>> 0, p = 1; + if (typeof logN === "object") { + if (arguments.length > 4) { + throw new Error("scrypt: incorrect number of arguments"); + } + var opts = logN; + callback = r; + logN = opts.logN; + if (typeof logN === "undefined") { + if (typeof opts.N !== "undefined") { + if (opts.N < 2 || opts.N > MAX_UINT) + throw new Error("scrypt: N is out of range"); + if ((opts.N & opts.N - 1) !== 0) + throw new Error("scrypt: N is not a power of 2"); + logN = Math.log(opts.N) / Math.LN2; + } else { + throw new Error("scrypt: missing N parameter"); + } + } + p = opts.p || 1; + r = opts.r; + dkLen = opts.dkLen || 32; + interruptStep = opts.interruptStep || 0; + encoding = opts.encoding; + } + if (p < 1) + throw new Error("scrypt: invalid p"); + if (r <= 0) + throw new Error("scrypt: invalid r"); + if (logN < 1 || logN > 31) + throw new Error("scrypt: logN must be between 1 and 31"); + var N = 1 << logN >>> 0, XY, V, B, tmp; + if (r * p >= 1 << 30 || r > MAX_UINT / 128 / p || r > MAX_UINT / 256 || N > MAX_UINT / 128 / r) + throw new Error("scrypt: parameters are too large"); + if (typeof password === "string") + password = stringToUTF8Bytes(password); + if (typeof salt === "string") + salt = stringToUTF8Bytes(salt); + if (typeof Int32Array !== "undefined") { + XY = new Int32Array(64 * r); + V = new Int32Array(32 * N * r); + tmp = new Int32Array(16); + } else { + XY = []; + V = []; + tmp = new Array(16); + } + B = PBKDF2_HMAC_SHA256_OneIter(password, salt, p * 128 * r); + var xi = 0, yi = 32 * r; + function smixStart(pos) { + for (var i = 0; i < 32 * r; i++) { + var j = pos + i * 4; + XY[xi + i] = (B[j + 3] & 255) << 24 | (B[j + 2] & 255) << 16 | (B[j + 1] & 255) << 8 | (B[j + 0] & 255) << 0; + } + } + function smixStep1(start, end) { + for (var i = start; i < end; i += 2) { + blockCopy(V, i * (32 * r), XY, xi, 32 * r); + blockMix(tmp, XY, xi, yi, r); + blockCopy(V, (i + 1) * (32 * r), XY, yi, 32 * r); + blockMix(tmp, XY, yi, xi, r); + } + } + function smixStep2(start, end) { + for (var i = start; i < end; i += 2) { + var j = integerify(XY, xi, r) & N - 1; + blockXOR(XY, xi, V, j * (32 * r), 32 * r); + blockMix(tmp, XY, xi, yi, r); + j = integerify(XY, yi, r) & N - 1; + blockXOR(XY, yi, V, j * (32 * r), 32 * r); + blockMix(tmp, XY, yi, xi, r); + } + } + function smixFinish(pos) { + for (var i = 0; i < 32 * r; i++) { + var j = XY[xi + i]; + B[pos + i * 4 + 0] = j >>> 0 & 255; + B[pos + i * 4 + 1] = j >>> 8 & 255; + B[pos + i * 4 + 2] = j >>> 16 & 255; + B[pos + i * 4 + 3] = j >>> 24 & 255; + } + } + var nextTick = typeof setImmediate !== "undefined" ? setImmediate : setTimeout; + function interruptedFor(start, end, step, fn, donefn) { + (function performStep() { + nextTick(function() { + fn(start, start + step < end ? start + step : end); + start += step; + if (start < end) + performStep(); + else + donefn(); + }); + })(); + } + function getResult(enc) { + var result = PBKDF2_HMAC_SHA256_OneIter(password, B, dkLen); + if (enc === "base64") + return bytesToBase64(result); + else if (enc === "hex") + return bytesToHex(result); + else if (enc === "binary") + return new Uint8Array(result); + else + return result; + } + function calculateSync() { + for (var i = 0; i < p; i++) { + smixStart(i * 128 * r); + smixStep1(0, N); + smixStep2(0, N); + smixFinish(i * 128 * r); + } + callback(getResult(encoding)); + } + function calculateAsync(i) { + smixStart(i * 128 * r); + interruptedFor(0, N, interruptStep * 2, smixStep1, function() { + interruptedFor(0, N, interruptStep * 2, smixStep2, function() { + smixFinish(i * 128 * r); + if (i + 1 < p) { + nextTick(function() { + calculateAsync(i + 1); + }); + } else { + callback(getResult(encoding)); + } + }); + }); + } + if (typeof interruptStep === "function") { + encoding = callback; + callback = interruptStep; + interruptStep = 1e3; + } + if (interruptStep <= 0) { + calculateSync(); + } else { + calculateAsync(0); + } + } + if (typeof module !== "undefined") + module.exports = scrypt2; + } + }); + + // frontend/common/translations.js + var import_sbp = __toESM(__require("@sbp/sbp")); + + // frontend/common/stringTemplate.js + var nargs = /\{([0-9a-zA-Z_]+)\}/g; + function template(string3, ...args) { + const firstArg = args[0]; + const replacementsByKey = typeof firstArg === "object" && firstArg !== null ? firstArg : args; + return string3.replace(nargs, function replaceArg(match, capture, index) { + if (string3[index - 1] === "{" && string3[index + match.length] === "}") { + return capture; + } + const maybeReplacement = Object.prototype.hasOwnProperty.call(replacementsByKey, capture) ? replacementsByKey[capture] : void 0; + if (maybeReplacement === null || maybeReplacement === void 0) { + return ""; + } + return String(maybeReplacement); + }); + } + + // frontend/common/translations.js + var defaultLanguage = "en-US"; + var defaultLanguageCode = "en"; + var defaultTranslationTable = {}; + var currentLanguage = defaultLanguage; + var currentLanguageCode = defaultLanguage.split("-")[0]; + var currentTranslationTable = defaultTranslationTable; + var translations_default = (0, import_sbp.default)("sbp/selectors/register", { + "translations/init": async function init(language) { + const [languageCode] = language.toLowerCase().split("-"); + if (language.toLowerCase() === currentLanguage.toLowerCase()) + return; + if (languageCode === currentLanguageCode) + return; + if (languageCode === defaultLanguageCode) { + currentLanguage = defaultLanguage; + currentLanguageCode = defaultLanguageCode; + currentTranslationTable = defaultTranslationTable; + return; + } + try { + currentTranslationTable = await (0, import_sbp.default)("backend/translations/get", language) || defaultTranslationTable; + currentLanguage = language; + currentLanguageCode = languageCode; + } catch (error) { + console.error(error); + } + } + }); + function L(key, args) { + return template(currentTranslationTable[key] || key, args).replace(/\s(?=[;:?!])/g, "\xA0"); + } + + // frontend/common/errors.js + var errors_exports = {}; + __export(errors_exports, { + GIErrorIgnoreAndBan: () => GIErrorIgnoreAndBan, + GIErrorMissingSigningKeyError: () => GIErrorMissingSigningKeyError, + GIErrorUIRuntimeError: () => GIErrorUIRuntimeError + }); + + // shared/domains/chelonia/errors.js + var ChelErrorGenerator = (name, base2 = Error) => class extends base2 { + constructor(...params) { + super(...params); + this.name = name; + if (params[1]?.cause !== this.cause) { + Object.defineProperty(this, "cause", { value: params[1].cause }); + } + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + } + }; + var ChelErrorWarning = ChelErrorGenerator("ChelErrorWarning"); + var ChelErrorAlreadyProcessed = ChelErrorGenerator("ChelErrorAlreadyProcessed"); + var ChelErrorDBBadPreviousHEAD = ChelErrorGenerator("ChelErrorDBBadPreviousHEAD"); + var ChelErrorDBConnection = ChelErrorGenerator("ChelErrorDBConnection"); + var ChelErrorUnexpected = ChelErrorGenerator("ChelErrorUnexpected"); + var ChelErrorUnrecoverable = ChelErrorGenerator("ChelErrorUnrecoverable"); + var ChelErrorDecryptionError = ChelErrorGenerator("ChelErrorDecryptionError"); + var ChelErrorDecryptionKeyNotFound = ChelErrorGenerator("ChelErrorDecryptionKeyNotFound", ChelErrorDecryptionError); + var ChelErrorSignatureError = ChelErrorGenerator("ChelErrorSignatureError"); + var ChelErrorSignatureKeyUnauthorized = ChelErrorGenerator("ChelErrorSignatureKeyUnauthorized", ChelErrorSignatureError); + var ChelErrorSignatureKeyNotFound = ChelErrorGenerator("ChelErrorSignatureKeyNotFound", ChelErrorSignatureError); + var ChelErrorFetchServerTimeFailed = ChelErrorGenerator("ChelErrorFetchServerTimeFailed"); + + // frontend/common/errors.js + var GIErrorIgnoreAndBan = ChelErrorGenerator("GIErrorIgnoreAndBan"); + var GIErrorUIRuntimeError = ChelErrorGenerator("GIErrorUIRuntimeError"); + var GIErrorMissingSigningKeyError = ChelErrorGenerator("GIErrorMissingSigningKeyError"); + + // frontend/model/contracts/group.js + var import_sbp7 = __toESM(__require("@sbp/sbp")); + + // frontend/utils/events.js + var JOINED_GROUP = "joined-group"; + var LEFT_CHATROOM = "left-chatroom"; + var DELETED_CHATROOM = "deleted-chatroom"; + + // frontend/model/contracts/misc/flowTyper.js + var EMPTY_VALUE = Symbol("@@empty"); + var isEmpty = (v) => v === EMPTY_VALUE; + var isNil = (v) => v === null; + var isUndef = (v) => typeof v === "undefined"; + var isBoolean = (v) => typeof v === "boolean"; + var isNumber = (v) => typeof v === "number"; + var isString = (v) => typeof v === "string"; + var isObject = (v) => !isNil(v) && typeof v === "object"; + var isFunction = (v) => typeof v === "function"; + var getType = (typeFn, _options) => { + if (isFunction(typeFn.type)) + return typeFn.type(_options); + return typeFn.name || "?"; + }; + var TypeValidatorError = class extends Error { + expectedType; + valueType; + value; + typeScope; + sourceFile; + constructor(message, expectedType, valueType, value, typeName = "", typeScope = "") { + const errMessage = message || `invalid "${valueType}" value type; ${typeName || expectedType} type expected`; + super(errMessage); + this.expectedType = expectedType; + this.valueType = valueType; + this.value = value; + this.typeScope = typeScope || ""; + this.sourceFile = this.getSourceFile(); + this.message = `${errMessage} +${this.getErrorInfo()}`; + this.name = this.constructor.name; + if (Error.captureStackTrace) { + Error.captureStackTrace(this, TypeValidatorError); + } + } + getSourceFile() { + const fileNames = this.stack.match(/(\/[\w_\-.]+)+(\.\w+:\d+:\d+)/g) || []; + return fileNames.find((fileName) => fileName.indexOf("/flowTyper-js/dist/") === -1) || ""; + } + getErrorInfo() { + return ` + file ${this.sourceFile} + scope ${this.typeScope} + expected ${this.expectedType.replace(/\n/g, "")} + type ${this.valueType} + value ${this.value} +`; + } + }; + var validatorError = (typeFn, value, scope, message, expectedType, valueType) => { + return new TypeValidatorError(message, expectedType || getType(typeFn), valueType || typeof value, JSON.stringify(value), typeFn.name, scope); + }; + var arrayOf = (typeFn, _scope = "Array") => { + function array(value) { + if (isEmpty(value)) + return [typeFn(value)]; + if (Array.isArray(value)) { + let index = 0; + return value.map((v) => typeFn(v, `${_scope}[${index++}]`)); + } + throw validatorError(array, value, _scope); + } + array.type = () => `Array<${getType(typeFn)}>`; + return array; + }; + var literalOf = (primitive) => { + function literal(value, _scope = "") { + if (isEmpty(value) || value === primitive) + return primitive; + throw validatorError(literal, value, _scope); + } + literal.type = () => { + if (isBoolean(primitive)) + return `${primitive ? "true" : "false"}`; + else + return `"${primitive}"`; + }; + return literal; + }; + var mapOf = (keyTypeFn, typeFn) => { + function mapOf2(value) { + if (isEmpty(value)) + return {}; + const o = object(value); + const reducer = (acc, key) => Object.assign(acc, { + [keyTypeFn(key, "Map[_]")]: typeFn(o[key], `Map.${key}`) + }); + return Object.keys(o).reduce(reducer, {}); + } + mapOf2.type = () => `{ [_:${getType(keyTypeFn)}]: ${getType(typeFn)} }`; + return mapOf2; + }; + var object = function(value) { + if (isEmpty(value)) + return {}; + if (isObject(value) && !Array.isArray(value)) { + return Object.assign({}, value); + } + throw validatorError(object, value); + }; + var objectOf = (typeObj, _scope = "Object") => { + function object2(value) { + const o = object(value); + const typeAttrs = Object.keys(typeObj); + const unknownAttr = Object.keys(o).find((attr) => !typeAttrs.includes(attr)); + if (unknownAttr) { + throw validatorError(object2, value, _scope, `missing object property '${unknownAttr}' in ${_scope} type`); + } + const undefAttr = typeAttrs.find((property) => { + const propertyTypeFn = typeObj[property]; + return propertyTypeFn.name.includes("maybe") && !o.hasOwnProperty(property); + }); + if (undefAttr) { + throw validatorError(object2, o[undefAttr], `${_scope}.${undefAttr}`, `empty object property '${undefAttr}' for ${_scope} type`, `void | null | ${getType(typeObj[undefAttr]).substr(1)}`, "-"); + } + const reducer = isEmpty(value) ? (acc, key) => Object.assign(acc, { [key]: typeObj[key](value) }) : (acc, key) => { + const typeFn = typeObj[key]; + if (typeFn.name.includes("optional") && !o.hasOwnProperty(key)) { + return Object.assign(acc, {}); + } else { + return Object.assign(acc, { [key]: typeFn(o[key], `${_scope}.${key}`) }); + } + }; + return typeAttrs.reduce(reducer, {}); + } + object2.type = () => { + const props = Object.keys(typeObj).map((key) => { + const ret = typeObj[key].name.includes("optional") ? `${key}?: ${getType(typeObj[key], { noVoid: true })}` : `${key}: ${getType(typeObj[key])}`; + return ret; + }); + return `{| + ${props.join(",\n ")} +|}`; + }; + return object2; + }; + function objectMaybeOf(validations, _scope = "Object") { + return function(data) { + object(data); + for (const key in data) { + validations[key]?.(data[key], `${_scope}.${key}`); + } + return data; + }; + } + var optional = (typeFn) => { + const unionFn = unionOf(typeFn, undef); + function optional2(v) { + return unionFn(v); + } + optional2.type = ({ noVoid }) => !noVoid ? getType(unionFn) : getType(typeFn); + return optional2; + }; + function undef(value, _scope = "") { + if (isEmpty(value) || isUndef(value)) + return void 0; + throw validatorError(undef, value, _scope); + } + undef.type = () => "void"; + var boolean = function boolean2(value, _scope = "") { + if (isEmpty(value)) + return false; + if (isBoolean(value)) + return value; + throw validatorError(boolean2, value, _scope); + }; + var number = function number2(value, _scope = "") { + if (isEmpty(value)) + return 0; + if (isNumber(value)) + return value; + throw validatorError(number2, value, _scope); + }; + var numberRange = (from3, to, key = "") => { + if (!isNumber(from3) || !isNumber(to)) { + throw new TypeError("Params for numberRange must be numbers"); + } + if (from3 >= to) { + throw new TypeError('Params "to" should be bigger than "from"'); + } + function numberRange2(value, _scope = "") { + number(value, _scope); + if (value >= from3 && value <= to) + return value; + throw validatorError(numberRange2, value, _scope, key ? `number type '${key}' must be within the range of [${from3}, ${to}]` : `must be within the range of [${from3}, ${to}]`); + } + numberRange2.type = `number(range: [${from3}, ${to}])`; + return numberRange2; + }; + var string = function string2(value, _scope = "") { + if (isEmpty(value)) + return ""; + if (isString(value)) + return value; + throw validatorError(string2, value, _scope); + }; + var stringMax = (numChar, key = "") => { + if (!isNumber(numChar)) { + throw new Error("param for stringMax must be number"); + } + function stringMax2(value, _scope = "") { + string(value, _scope); + if (value.length <= numChar) + return value; + throw validatorError(stringMax2, value, _scope, key ? `string type '${key}' cannot exceed ${numChar} characters` : `cannot exceed ${numChar} characters`); + } + stringMax2.type = () => `string(max: ${numChar})`; + return stringMax2; + }; + function tupleOf_(...typeFuncs) { + function tuple(value, _scope = "") { + const cardinality = typeFuncs.length; + if (isEmpty(value)) + return typeFuncs.map((fn) => fn(value)); + if (Array.isArray(value) && value.length === cardinality) { + const tupleValue = []; + for (let i = 0; i < cardinality; i += 1) { + tupleValue.push(typeFuncs[i](value[i], _scope)); + } + return tupleValue; + } + throw validatorError(tuple, value, _scope); + } + tuple.type = () => `[${typeFuncs.map((fn) => getType(fn)).join(", ")}]`; + return tuple; + } + var tupleOf = tupleOf_; + function unionOf_(...typeFuncs) { + function union(value, _scope = "") { + for (const typeFn of typeFuncs) { + try { + return typeFn(value, _scope); + } catch (_) { + } + } + throw validatorError(union, value, _scope); + } + union.type = () => `(${typeFuncs.map((fn) => getType(fn)).join(" | ")})`; + return union; + } + var unionOf = unionOf_; + var actionRequireInnerSignature = (next) => (data, props) => { + const innerSigningContractID = props.message.innerSigningContractID; + if (!innerSigningContractID || innerSigningContractID === props.contractID) { + throw new Error("Missing inner signature"); + } + return next(data, props); + }; + var validatorFrom = (fn) => { + function customType(value, _scope = "") { + if (!fn(value)) { + throw validatorError(customType, value, _scope); + } + return value; + } + return customType; + }; + + // shared/domains/chelonia/utils.js + var import_sbp4 = __toESM(__require("@sbp/sbp")); + + // frontend/model/contracts/shared/giLodash.js + function omit(o, props) { + const x = {}; + for (const k in o) { + if (!props.includes(k)) { + x[k] = o[k]; + } + } + return x; + } + function cloneDeep(obj) { + return JSON.parse(JSON.stringify(obj)); + } + function isMergeableObject(val) { + const nonNullObject = val && typeof val === "object"; + return nonNullObject && Object.prototype.toString.call(val) !== "[object RegExp]" && Object.prototype.toString.call(val) !== "[object Date]"; + } + function merge(obj, src2) { + for (const key in src2) { + const clone = isMergeableObject(src2[key]) ? cloneDeep(src2[key]) : void 0; + if (clone && isMergeableObject(obj[key])) { + merge(obj[key], clone); + continue; + } + obj[key] = clone || src2[key]; + } + return obj; + } + function deepEqualJSONType(a, b) { + if (a === b) + return true; + if (a === null || b === null || typeof a !== typeof b) + return false; + if (typeof a !== "object") + return a === b; + if (Array.isArray(a)) { + if (a.length !== b.length) + return false; + } else if (a.constructor.name !== "Object") { + throw new Error(`not JSON type: ${a}`); + } + for (const key in a) { + if (!deepEqualJSONType(a[key], b[key])) + return false; + } + return true; + } + var has = Function.prototype.call.bind(Object.prototype.hasOwnProperty); + + // shared/blake2bstream.js + var import_blakejs = __toESM(require_blakejs()); + + // shared/multiformats/bytes.js + var empty = new Uint8Array(0); + function equals(aa, bb) { + if (aa === bb) { + return true; + } + if (aa.byteLength !== bb.byteLength) { + return false; + } + for (let ii = 0; ii < aa.byteLength; ii++) { + if (aa[ii] !== bb[ii]) { + return false; + } + } + return true; + } + function coerce(o) { + if (o instanceof Uint8Array && o.constructor.name === "Uint8Array") { + return o; + } + if (o instanceof ArrayBuffer) { + return new Uint8Array(o); + } + if (ArrayBuffer.isView(o)) { + return new Uint8Array(o.buffer, o.byteOffset, o.byteLength); + } + throw new Error("Unknown type, must be binary type"); + } + + // shared/multiformats/vendor/varint.js + var encode_1 = encode; + var MSB = 128; + var REST = 127; + var MSBALL = ~REST; + var INT = Math.pow(2, 31); + function encode(num, out, offset) { + out = out || []; + offset = offset || 0; + var oldOffset = offset; + while (num >= INT) { + out[offset++] = num & 255 | MSB; + num /= 128; + } + while (num & MSBALL) { + out[offset++] = num & 255 | MSB; + num >>>= 7; + } + out[offset] = num | 0; + encode.bytes = offset - oldOffset + 1; + return out; + } + var decode = read; + var MSB$1 = 128; + var REST$1 = 127; + function read(buf, offset) { + var res = 0, offset = offset || 0, shift = 0, counter = offset, b, l = buf.length; + do { + if (counter >= l) { + read.bytes = 0; + throw new RangeError("Could not decode varint"); + } + b = buf[counter++]; + res += shift < 28 ? (b & REST$1) << shift : (b & REST$1) * Math.pow(2, shift); + shift += 7; + } while (b >= MSB$1); + read.bytes = counter - offset; + return res; + } + var N1 = Math.pow(2, 7); + var N2 = Math.pow(2, 14); + var N3 = Math.pow(2, 21); + var N4 = Math.pow(2, 28); + var N5 = Math.pow(2, 35); + var N6 = Math.pow(2, 42); + var N7 = Math.pow(2, 49); + var N8 = Math.pow(2, 56); + var N9 = Math.pow(2, 63); + var length = function(value) { + return value < N1 ? 1 : value < N2 ? 2 : value < N3 ? 3 : value < N4 ? 4 : value < N5 ? 5 : value < N6 ? 6 : value < N7 ? 7 : value < N8 ? 8 : value < N9 ? 9 : 10; + }; + var varint = { + encode: encode_1, + decode, + encodingLength: length + }; + var _brrp_varint = varint; + var varint_default = _brrp_varint; + + // shared/multiformats/varint.js + function decode2(data, offset = 0) { + const code = varint_default.decode(data, offset); + return [code, varint_default.decode.bytes]; + } + function encodeTo(int, target, offset = 0) { + varint_default.encode(int, target, offset); + return target; + } + function encodingLength(int) { + return varint_default.encodingLength(int); + } + + // shared/multiformats/hashes/digest.js + function create(code, digest) { + const size = digest.byteLength; + const sizeOffset = encodingLength(code); + const digestOffset = sizeOffset + encodingLength(size); + const bytes = new Uint8Array(digestOffset + size); + encodeTo(code, bytes, 0); + encodeTo(size, bytes, sizeOffset); + bytes.set(digest, digestOffset); + return new Digest(code, size, digest, bytes); + } + function decode3(multihash) { + const bytes = coerce(multihash); + const [code, sizeOffset] = decode2(bytes); + const [size, digestOffset] = decode2(bytes.subarray(sizeOffset)); + const digest = bytes.subarray(sizeOffset + digestOffset); + if (digest.byteLength !== size) { + throw new Error("Incorrect length"); + } + return new Digest(code, size, digest, bytes); + } + function equals2(a, b) { + if (a === b) { + return true; + } else { + const data = b; + return a.code === data.code && a.size === data.size && data.bytes instanceof Uint8Array && equals(a.bytes, data.bytes); + } + } + var Digest = class { + code; + size; + digest; + bytes; + constructor(code, size, digest, bytes) { + this.code = code; + this.size = size; + this.digest = digest; + this.bytes = bytes; + } + }; + + // shared/multiformats/hasher.js + function from({ name, code, encode: encode3 }) { + return new Hasher(name, code, encode3); + } + var Hasher = class { + name; + code; + encode; + constructor(name, code, encode3) { + this.name = name; + this.code = code; + this.encode = encode3; + } + digest(input) { + if (input instanceof Uint8Array || input instanceof ReadableStream) { + const result = this.encode(input); + return result instanceof Uint8Array ? create(this.code, result) : result.then((digest) => create(this.code, digest)); + } else { + throw Error("Unknown type, must be binary type"); + } + } + }; + + // shared/blake2bstream.js + var { blake2b, blake2bInit, blake2bUpdate, blake2bFinal } = import_blakejs.default; + var blake2b256stream = from({ + name: "blake2b-256", + code: 45600, + encode: async (input) => { + if (input instanceof ReadableStream) { + const ctx = blake2bInit(32); + const reader = input.getReader(); + for (; ; ) { + const result = await reader.read(); + if (result.done) + break; + blake2bUpdate(ctx, coerce(result.value)); + } + return blake2bFinal(ctx); + } else { + return coerce(blake2b(input, void 0, 32)); + } + } + }); + + // shared/multiformats/base-x.js + function base(ALPHABET, name) { + if (ALPHABET.length >= 255) { + throw new TypeError("Alphabet too long"); + } + var BASE_MAP = new Uint8Array(256); + for (var j = 0; j < BASE_MAP.length; j++) { + BASE_MAP[j] = 255; + } + for (var i = 0; i < ALPHABET.length; i++) { + var x = ALPHABET.charAt(i); + var xc = x.charCodeAt(0); + if (BASE_MAP[xc] !== 255) { + throw new TypeError(x + " is ambiguous"); + } + BASE_MAP[xc] = i; + } + var BASE = ALPHABET.length; + var LEADER = ALPHABET.charAt(0); + var FACTOR = Math.log(BASE) / Math.log(256); + var iFACTOR = Math.log(256) / Math.log(BASE); + function encode3(source) { + if (source instanceof Uint8Array) + ; + else if (ArrayBuffer.isView(source)) { + source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength); + } else if (Array.isArray(source)) { + source = Uint8Array.from(source); + } + if (!(source instanceof Uint8Array)) { + throw new TypeError("Expected Uint8Array"); + } + if (source.length === 0) { + return ""; + } + var zeroes = 0; + var length2 = 0; + var pbegin = 0; + var pend = source.length; + while (pbegin !== pend && source[pbegin] === 0) { + pbegin++; + zeroes++; + } + var size = (pend - pbegin) * iFACTOR + 1 >>> 0; + var b58 = new Uint8Array(size); + while (pbegin !== pend) { + var carry = source[pbegin]; + var i2 = 0; + for (var it1 = size - 1; (carry !== 0 || i2 < length2) && it1 !== -1; it1--, i2++) { + carry += 256 * b58[it1] >>> 0; + b58[it1] = carry % BASE >>> 0; + carry = carry / BASE >>> 0; + } + if (carry !== 0) { + throw new Error("Non-zero carry"); + } + length2 = i2; + pbegin++; + } + var it2 = size - length2; + while (it2 !== size && b58[it2] === 0) { + it2++; + } + var str = LEADER.repeat(zeroes); + for (; it2 < size; ++it2) { + str += ALPHABET.charAt(b58[it2]); + } + return str; + } + function decodeUnsafe(source) { + if (typeof source !== "string") { + throw new TypeError("Expected String"); + } + if (source.length === 0) { + return new Uint8Array(); + } + var psz = 0; + if (source[psz] === " ") { + return; + } + var zeroes = 0; + var length2 = 0; + while (source[psz] === LEADER) { + zeroes++; + psz++; + } + var size = (source.length - psz) * FACTOR + 1 >>> 0; + var b256 = new Uint8Array(size); + while (source[psz]) { + var carry = BASE_MAP[source.charCodeAt(psz)]; + if (carry === 255) { + return; + } + var i2 = 0; + for (var it3 = size - 1; (carry !== 0 || i2 < length2) && it3 !== -1; it3--, i2++) { + carry += BASE * b256[it3] >>> 0; + b256[it3] = carry % 256 >>> 0; + carry = carry / 256 >>> 0; + } + if (carry !== 0) { + throw new Error("Non-zero carry"); + } + length2 = i2; + psz++; + } + if (source[psz] === " ") { + return; + } + var it4 = size - length2; + while (it4 !== size && b256[it4] === 0) { + it4++; + } + var vch = new Uint8Array(zeroes + (size - it4)); + var j2 = zeroes; + while (it4 !== size) { + vch[j2++] = b256[it4++]; + } + return vch; + } + function decode5(string3) { + var buffer = decodeUnsafe(string3); + if (buffer) { + return buffer; + } + throw new Error(`Non-${name} character`); + } + return { + encode: encode3, + decodeUnsafe, + decode: decode5 + }; + } + var src = base; + var _brrp__multiformats_scope_baseX = src; + var base_x_default = _brrp__multiformats_scope_baseX; + + // shared/multiformats/bases/base.js + var Encoder = class { + name; + prefix; + baseEncode; + constructor(name, prefix, baseEncode) { + this.name = name; + this.prefix = prefix; + this.baseEncode = baseEncode; + } + encode(bytes) { + if (bytes instanceof Uint8Array) { + return `${this.prefix}${this.baseEncode(bytes)}`; + } else { + throw Error("Unknown type, must be binary type"); + } + } + }; + var Decoder = class { + name; + prefix; + baseDecode; + prefixCodePoint; + constructor(name, prefix, baseDecode) { + this.name = name; + this.prefix = prefix; + if (prefix.codePointAt(0) === void 0) { + throw new Error("Invalid prefix character"); + } + this.prefixCodePoint = prefix.codePointAt(0); + this.baseDecode = baseDecode; + } + decode(text) { + if (typeof text === "string") { + if (text.codePointAt(0) !== this.prefixCodePoint) { + throw Error(`Unable to decode multibase string ${JSON.stringify(text)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`); + } + return this.baseDecode(text.slice(this.prefix.length)); + } else { + throw Error("Can only multibase decode strings"); + } + } + or(decoder) { + return or(this, decoder); + } + }; + var ComposedDecoder = class { + decoders; + constructor(decoders) { + this.decoders = decoders; + } + or(decoder) { + return or(this, decoder); + } + decode(input) { + const prefix = input[0]; + const decoder = this.decoders[prefix]; + if (decoder != null) { + return decoder.decode(input); + } else { + throw RangeError(`Unable to decode multibase string ${JSON.stringify(input)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`); + } + } + }; + function or(left, right) { + return new ComposedDecoder({ + ...left.decoders ?? { [left.prefix]: left }, + ...right.decoders ?? { [right.prefix]: right } + }); + } + var Codec = class { + name; + prefix; + baseEncode; + baseDecode; + encoder; + decoder; + constructor(name, prefix, baseEncode, baseDecode) { + this.name = name; + this.prefix = prefix; + this.baseEncode = baseEncode; + this.baseDecode = baseDecode; + this.encoder = new Encoder(name, prefix, baseEncode); + this.decoder = new Decoder(name, prefix, baseDecode); + } + encode(input) { + return this.encoder.encode(input); + } + decode(input) { + return this.decoder.decode(input); + } + }; + function from2({ name, prefix, encode: encode3, decode: decode5 }) { + return new Codec(name, prefix, encode3, decode5); + } + function baseX({ name, prefix, alphabet }) { + const { encode: encode3, decode: decode5 } = base_x_default(alphabet, name); + return from2({ + prefix, + name, + encode: encode3, + decode: (text) => coerce(decode5(text)) + }); + } + function decode4(string3, alphabet, bitsPerChar, name) { + const codes = {}; + for (let i = 0; i < alphabet.length; ++i) { + codes[alphabet[i]] = i; + } + let end = string3.length; + while (string3[end - 1] === "=") { + --end; + } + const out = new Uint8Array(end * bitsPerChar / 8 | 0); + let bits = 0; + let buffer = 0; + let written = 0; + for (let i = 0; i < end; ++i) { + const value = codes[string3[i]]; + if (value === void 0) { + throw new SyntaxError(`Non-${name} character`); + } + buffer = buffer << bitsPerChar | value; + bits += bitsPerChar; + if (bits >= 8) { + bits -= 8; + out[written++] = 255 & buffer >> bits; + } + } + if (bits >= bitsPerChar || (255 & buffer << 8 - bits) !== 0) { + throw new SyntaxError("Unexpected end of data"); + } + return out; + } + function encode2(data, alphabet, bitsPerChar) { + const pad = alphabet[alphabet.length - 1] === "="; + const mask = (1 << bitsPerChar) - 1; + let out = ""; + let bits = 0; + let buffer = 0; + for (let i = 0; i < data.length; ++i) { + buffer = buffer << 8 | data[i]; + bits += 8; + while (bits > bitsPerChar) { + bits -= bitsPerChar; + out += alphabet[mask & buffer >> bits]; + } + } + if (bits !== 0) { + out += alphabet[mask & buffer << bitsPerChar - bits]; + } + if (pad) { + while ((out.length * bitsPerChar & 7) !== 0) { + out += "="; + } + } + return out; + } + function rfc4648({ name, prefix, bitsPerChar, alphabet }) { + return from2({ + prefix, + name, + encode(input) { + return encode2(input, alphabet, bitsPerChar); + }, + decode(input) { + return decode4(input, alphabet, bitsPerChar, name); + } + }); + } + + // shared/multiformats/bases/base58.js + var base58btc = baseX({ + name: "base58btc", + prefix: "z", + alphabet: "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz" + }); + var base58flickr = baseX({ + name: "base58flickr", + prefix: "Z", + alphabet: "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ" + }); + + // shared/multiformats/blake2b.js + var import_blakejs2 = __toESM(require_blakejs()); + var { blake2b: blake2b2 } = import_blakejs2.default; + var blake2b8 = from({ + name: "blake2b-8", + code: 45569, + encode: (input) => coerce(blake2b2(input, void 0, 1)) + }); + var blake2b16 = from({ + name: "blake2b-16", + code: 45570, + encode: (input) => coerce(blake2b2(input, void 0, 2)) + }); + var blake2b24 = from({ + name: "blake2b-24", + code: 45571, + encode: (input) => coerce(blake2b2(input, void 0, 3)) + }); + var blake2b32 = from({ + name: "blake2b-32", + code: 45572, + encode: (input) => coerce(blake2b2(input, void 0, 4)) + }); + var blake2b40 = from({ + name: "blake2b-40", + code: 45573, + encode: (input) => coerce(blake2b2(input, void 0, 5)) + }); + var blake2b48 = from({ + name: "blake2b-48", + code: 45574, + encode: (input) => coerce(blake2b2(input, void 0, 6)) + }); + var blake2b56 = from({ + name: "blake2b-56", + code: 45575, + encode: (input) => coerce(blake2b2(input, void 0, 7)) + }); + var blake2b64 = from({ + name: "blake2b-64", + code: 45576, + encode: (input) => coerce(blake2b2(input, void 0, 8)) + }); + var blake2b72 = from({ + name: "blake2b-72", + code: 45577, + encode: (input) => coerce(blake2b2(input, void 0, 9)) + }); + var blake2b80 = from({ + name: "blake2b-80", + code: 45578, + encode: (input) => coerce(blake2b2(input, void 0, 10)) + }); + var blake2b88 = from({ + name: "blake2b-88", + code: 45579, + encode: (input) => coerce(blake2b2(input, void 0, 11)) + }); + var blake2b96 = from({ + name: "blake2b-96", + code: 45580, + encode: (input) => coerce(blake2b2(input, void 0, 12)) + }); + var blake2b104 = from({ + name: "blake2b-104", + code: 45581, + encode: (input) => coerce(blake2b2(input, void 0, 13)) + }); + var blake2b112 = from({ + name: "blake2b-112", + code: 45582, + encode: (input) => coerce(blake2b2(input, void 0, 14)) + }); + var blake2b120 = from({ + name: "blake2b-120", + code: 45583, + encode: (input) => coerce(blake2b2(input, void 0, 15)) + }); + var blake2b128 = from({ + name: "blake2b-128", + code: 45584, + encode: (input) => coerce(blake2b2(input, void 0, 16)) + }); + var blake2b136 = from({ + name: "blake2b-136", + code: 45585, + encode: (input) => coerce(blake2b2(input, void 0, 17)) + }); + var blake2b144 = from({ + name: "blake2b-144", + code: 45586, + encode: (input) => coerce(blake2b2(input, void 0, 18)) + }); + var blake2b152 = from({ + name: "blake2b-152", + code: 45587, + encode: (input) => coerce(blake2b2(input, void 0, 19)) + }); + var blake2b160 = from({ + name: "blake2b-160", + code: 45588, + encode: (input) => coerce(blake2b2(input, void 0, 20)) + }); + var blake2b168 = from({ + name: "blake2b-168", + code: 45589, + encode: (input) => coerce(blake2b2(input, void 0, 21)) + }); + var blake2b176 = from({ + name: "blake2b-176", + code: 45590, + encode: (input) => coerce(blake2b2(input, void 0, 22)) + }); + var blake2b184 = from({ + name: "blake2b-184", + code: 45591, + encode: (input) => coerce(blake2b2(input, void 0, 23)) + }); + var blake2b192 = from({ + name: "blake2b-192", + code: 45592, + encode: (input) => coerce(blake2b2(input, void 0, 24)) + }); + var blake2b200 = from({ + name: "blake2b-200", + code: 45593, + encode: (input) => coerce(blake2b2(input, void 0, 25)) + }); + var blake2b208 = from({ + name: "blake2b-208", + code: 45594, + encode: (input) => coerce(blake2b2(input, void 0, 26)) + }); + var blake2b216 = from({ + name: "blake2b-216", + code: 45595, + encode: (input) => coerce(blake2b2(input, void 0, 27)) + }); + var blake2b224 = from({ + name: "blake2b-224", + code: 45596, + encode: (input) => coerce(blake2b2(input, void 0, 28)) + }); + var blake2b232 = from({ + name: "blake2b-232", + code: 45597, + encode: (input) => coerce(blake2b2(input, void 0, 29)) + }); + var blake2b240 = from({ + name: "blake2b-240", + code: 45598, + encode: (input) => coerce(blake2b2(input, void 0, 30)) + }); + var blake2b248 = from({ + name: "blake2b-248", + code: 45599, + encode: (input) => coerce(blake2b2(input, void 0, 31)) + }); + var blake2b256 = from({ + name: "blake2b-256", + code: 45600, + encode: (input) => coerce(blake2b2(input, void 0, 32)) + }); + var blake2b264 = from({ + name: "blake2b-264", + code: 45601, + encode: (input) => coerce(blake2b2(input, void 0, 33)) + }); + var blake2b272 = from({ + name: "blake2b-272", + code: 45602, + encode: (input) => coerce(blake2b2(input, void 0, 34)) + }); + var blake2b280 = from({ + name: "blake2b-280", + code: 45603, + encode: (input) => coerce(blake2b2(input, void 0, 35)) + }); + var blake2b288 = from({ + name: "blake2b-288", + code: 45604, + encode: (input) => coerce(blake2b2(input, void 0, 36)) + }); + var blake2b296 = from({ + name: "blake2b-296", + code: 45605, + encode: (input) => coerce(blake2b2(input, void 0, 37)) + }); + var blake2b304 = from({ + name: "blake2b-304", + code: 45606, + encode: (input) => coerce(blake2b2(input, void 0, 38)) + }); + var blake2b312 = from({ + name: "blake2b-312", + code: 45607, + encode: (input) => coerce(blake2b2(input, void 0, 39)) + }); + var blake2b320 = from({ + name: "blake2b-320", + code: 45608, + encode: (input) => coerce(blake2b2(input, void 0, 40)) + }); + var blake2b328 = from({ + name: "blake2b-328", + code: 45609, + encode: (input) => coerce(blake2b2(input, void 0, 41)) + }); + var blake2b336 = from({ + name: "blake2b-336", + code: 45610, + encode: (input) => coerce(blake2b2(input, void 0, 42)) + }); + var blake2b344 = from({ + name: "blake2b-344", + code: 45611, + encode: (input) => coerce(blake2b2(input, void 0, 43)) + }); + var blake2b352 = from({ + name: "blake2b-352", + code: 45612, + encode: (input) => coerce(blake2b2(input, void 0, 44)) + }); + var blake2b360 = from({ + name: "blake2b-360", + code: 45613, + encode: (input) => coerce(blake2b2(input, void 0, 45)) + }); + var blake2b368 = from({ + name: "blake2b-368", + code: 45614, + encode: (input) => coerce(blake2b2(input, void 0, 46)) + }); + var blake2b376 = from({ + name: "blake2b-376", + code: 45615, + encode: (input) => coerce(blake2b2(input, void 0, 47)) + }); + var blake2b384 = from({ + name: "blake2b-384", + code: 45616, + encode: (input) => coerce(blake2b2(input, void 0, 48)) + }); + var blake2b392 = from({ + name: "blake2b-392", + code: 45617, + encode: (input) => coerce(blake2b2(input, void 0, 49)) + }); + var blake2b400 = from({ + name: "blake2b-400", + code: 45618, + encode: (input) => coerce(blake2b2(input, void 0, 50)) + }); + var blake2b408 = from({ + name: "blake2b-408", + code: 45619, + encode: (input) => coerce(blake2b2(input, void 0, 51)) + }); + var blake2b416 = from({ + name: "blake2b-416", + code: 45620, + encode: (input) => coerce(blake2b2(input, void 0, 52)) + }); + var blake2b424 = from({ + name: "blake2b-424", + code: 45621, + encode: (input) => coerce(blake2b2(input, void 0, 53)) + }); + var blake2b432 = from({ + name: "blake2b-432", + code: 45622, + encode: (input) => coerce(blake2b2(input, void 0, 54)) + }); + var blake2b440 = from({ + name: "blake2b-440", + code: 45623, + encode: (input) => coerce(blake2b2(input, void 0, 55)) + }); + var blake2b448 = from({ + name: "blake2b-448", + code: 45624, + encode: (input) => coerce(blake2b2(input, void 0, 56)) + }); + var blake2b456 = from({ + name: "blake2b-456", + code: 45625, + encode: (input) => coerce(blake2b2(input, void 0, 57)) + }); + var blake2b464 = from({ + name: "blake2b-464", + code: 45626, + encode: (input) => coerce(blake2b2(input, void 0, 58)) + }); + var blake2b472 = from({ + name: "blake2b-472", + code: 45627, + encode: (input) => coerce(blake2b2(input, void 0, 59)) + }); + var blake2b480 = from({ + name: "blake2b-480", + code: 45628, + encode: (input) => coerce(blake2b2(input, void 0, 60)) + }); + var blake2b488 = from({ + name: "blake2b-488", + code: 45629, + encode: (input) => coerce(blake2b2(input, void 0, 61)) + }); + var blake2b496 = from({ + name: "blake2b-496", + code: 45630, + encode: (input) => coerce(blake2b2(input, void 0, 62)) + }); + var blake2b504 = from({ + name: "blake2b-504", + code: 45631, + encode: (input) => coerce(blake2b2(input, void 0, 63)) + }); + var blake2b512 = from({ + name: "blake2b-512", + code: 45632, + encode: (input) => coerce(blake2b2(input, void 0, 64)) + }); + + // shared/multiformats/bases/base32.js + var base32 = rfc4648({ + prefix: "b", + name: "base32", + alphabet: "abcdefghijklmnopqrstuvwxyz234567", + bitsPerChar: 5 + }); + var base32upper = rfc4648({ + prefix: "B", + name: "base32upper", + alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567", + bitsPerChar: 5 + }); + var base32pad = rfc4648({ + prefix: "c", + name: "base32pad", + alphabet: "abcdefghijklmnopqrstuvwxyz234567=", + bitsPerChar: 5 + }); + var base32padupper = rfc4648({ + prefix: "C", + name: "base32padupper", + alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=", + bitsPerChar: 5 + }); + var base32hex = rfc4648({ + prefix: "v", + name: "base32hex", + alphabet: "0123456789abcdefghijklmnopqrstuv", + bitsPerChar: 5 + }); + var base32hexupper = rfc4648({ + prefix: "V", + name: "base32hexupper", + alphabet: "0123456789ABCDEFGHIJKLMNOPQRSTUV", + bitsPerChar: 5 + }); + var base32hexpad = rfc4648({ + prefix: "t", + name: "base32hexpad", + alphabet: "0123456789abcdefghijklmnopqrstuv=", + bitsPerChar: 5 + }); + var base32hexpadupper = rfc4648({ + prefix: "T", + name: "base32hexpadupper", + alphabet: "0123456789ABCDEFGHIJKLMNOPQRSTUV=", + bitsPerChar: 5 + }); + var base32z = rfc4648({ + prefix: "h", + name: "base32z", + alphabet: "ybndrfg8ejkmcpqxot1uwisza345h769", + bitsPerChar: 5 + }); + + // shared/multiformats/cid.js + function format(link, base2) { + const { bytes, version } = link; + switch (version) { + case 0: + return toStringV0(bytes, baseCache(link), base2 ?? base58btc.encoder); + default: + return toStringV1(bytes, baseCache(link), base2 ?? base32.encoder); + } + } + var cache = /* @__PURE__ */ new WeakMap(); + function baseCache(cid) { + const baseCache2 = cache.get(cid); + if (baseCache2 == null) { + const baseCache3 = /* @__PURE__ */ new Map(); + cache.set(cid, baseCache3); + return baseCache3; + } + return baseCache2; + } + var CID = class { + code; + version; + multihash; + bytes; + "/"; + constructor(version, code, multihash, bytes) { + this.code = code; + this.version = version; + this.multihash = multihash; + this.bytes = bytes; + this["/"] = bytes; + } + get asCID() { + return this; + } + get byteOffset() { + return this.bytes.byteOffset; + } + get byteLength() { + return this.bytes.byteLength; + } + toV0() { + switch (this.version) { + case 0: { + return this; + } + case 1: { + const { code, multihash } = this; + if (code !== DAG_PB_CODE) { + throw new Error("Cannot convert a non dag-pb CID to CIDv0"); + } + if (multihash.code !== SHA_256_CODE) { + throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0"); + } + return CID.createV0(multihash); + } + default: { + throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`); + } + } + } + toV1() { + switch (this.version) { + case 0: { + const { code, digest } = this.multihash; + const multihash = create(code, digest); + return CID.createV1(this.code, multihash); + } + case 1: { + return this; + } + default: { + throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`); + } + } + } + equals(other) { + return CID.equals(this, other); + } + static equals(self2, other) { + const unknown = other; + return unknown != null && self2.code === unknown.code && self2.version === unknown.version && equals2(self2.multihash, unknown.multihash); + } + toString(base2) { + return format(this, base2); + } + toJSON() { + return { "/": format(this) }; + } + link() { + return this; + } + [Symbol.toStringTag] = "CID"; + [Symbol.for("nodejs.util.inspect.custom")]() { + return `CID(${this.toString()})`; + } + static asCID(input) { + if (input == null) { + return null; + } + const value = input; + if (value instanceof CID) { + return value; + } else if (value["/"] != null && value["/"] === value.bytes || value.asCID === value) { + const { version, code, multihash, bytes } = value; + return new CID(version, code, multihash, bytes ?? encodeCID(version, code, multihash.bytes)); + } else if (value[cidSymbol] === true) { + const { version, multihash, code } = value; + const digest = decode3(multihash); + return CID.create(version, code, digest); + } else { + return null; + } + } + static create(version, code, digest) { + if (typeof code !== "number") { + throw new Error("String codecs are no longer supported"); + } + if (!(digest.bytes instanceof Uint8Array)) { + throw new Error("Invalid digest"); + } + switch (version) { + case 0: { + if (code !== DAG_PB_CODE) { + throw new Error(`Version 0 CID must use dag-pb (code: ${DAG_PB_CODE}) block encoding`); + } else { + return new CID(version, code, digest, digest.bytes); + } + } + case 1: { + const bytes = encodeCID(version, code, digest.bytes); + return new CID(version, code, digest, bytes); + } + default: { + throw new Error("Invalid version"); + } + } + } + static createV0(digest) { + return CID.create(0, DAG_PB_CODE, digest); + } + static createV1(code, digest) { + return CID.create(1, code, digest); + } + static decode(bytes) { + const [cid, remainder] = CID.decodeFirst(bytes); + if (remainder.length !== 0) { + throw new Error("Incorrect length"); + } + return cid; + } + static decodeFirst(bytes) { + const specs = CID.inspectBytes(bytes); + const prefixSize = specs.size - specs.multihashSize; + const multihashBytes = coerce(bytes.subarray(prefixSize, prefixSize + specs.multihashSize)); + if (multihashBytes.byteLength !== specs.multihashSize) { + throw new Error("Incorrect length"); + } + const digestBytes = multihashBytes.subarray(specs.multihashSize - specs.digestSize); + const digest = new Digest(specs.multihashCode, specs.digestSize, digestBytes, multihashBytes); + const cid = specs.version === 0 ? CID.createV0(digest) : CID.createV1(specs.codec, digest); + return [cid, bytes.subarray(specs.size)]; + } + static inspectBytes(initialBytes) { + let offset = 0; + const next = () => { + const [i, length2] = decode2(initialBytes.subarray(offset)); + offset += length2; + return i; + }; + let version = next(); + let codec = DAG_PB_CODE; + if (version === 18) { + version = 0; + offset = 0; + } else { + codec = next(); + } + if (version !== 0 && version !== 1) { + throw new RangeError(`Invalid CID version ${version}`); + } + const prefixSize = offset; + const multihashCode = next(); + const digestSize = next(); + const size = offset + digestSize; + const multihashSize = size - prefixSize; + return { version, codec, multihashCode, digestSize, multihashSize, size }; + } + static parse(source, base2) { + const [prefix, bytes] = parseCIDtoBytes(source, base2); + const cid = CID.decode(bytes); + if (cid.version === 0 && source[0] !== "Q") { + throw Error("Version 0 CID string must not include multibase prefix"); + } + baseCache(cid).set(prefix, source); + return cid; + } + }; + function parseCIDtoBytes(source, base2) { + switch (source[0]) { + case "Q": { + const decoder = base2 ?? base58btc; + return [ + base58btc.prefix, + decoder.decode(`${base58btc.prefix}${source}`) + ]; + } + case base58btc.prefix: { + const decoder = base2 ?? base58btc; + return [base58btc.prefix, decoder.decode(source)]; + } + case base32.prefix: { + const decoder = base2 ?? base32; + return [base32.prefix, decoder.decode(source)]; + } + default: { + if (base2 == null) { + throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided"); + } + return [source[0], base2.decode(source)]; + } + } + } + function toStringV0(bytes, cache2, base2) { + const { prefix } = base2; + if (prefix !== base58btc.prefix) { + throw Error(`Cannot string encode V0 in ${base2.name} encoding`); + } + const cid = cache2.get(prefix); + if (cid == null) { + const cid2 = base2.encode(bytes).slice(1); + cache2.set(prefix, cid2); + return cid2; + } else { + return cid; + } + } + function toStringV1(bytes, cache2, base2) { + const { prefix } = base2; + const cid = cache2.get(prefix); + if (cid == null) { + const cid2 = base2.encode(bytes); + cache2.set(prefix, cid2); + return cid2; + } else { + return cid; + } + } + var DAG_PB_CODE = 112; + var SHA_256_CODE = 18; + function encodeCID(version, code, multihash) { + const codeOffset = encodingLength(version); + const hashOffset = codeOffset + encodingLength(code); + const bytes = new Uint8Array(hashOffset + multihash.byteLength); + encodeTo(version, bytes, 0); + encodeTo(code, bytes, codeOffset); + bytes.set(multihash, hashOffset); + return bytes; + } + var cidSymbol = Symbol.for("@ipld/js-cid/CID"); + + // shared/functions.js + var multicodes = { JSON: 512, RAW: 0 }; + if (typeof globalThis === "object" && !has(globalThis, "Buffer")) { + const { Buffer: Buffer2 } = require_buffer(); + globalThis.Buffer = Buffer2; + } + function createCID(data, multicode = multicodes.RAW) { + const uint8array = typeof data === "string" ? new TextEncoder().encode(data) : data; + const digest = blake2b256.digest(uint8array); + return CID.create(1, multicode, digest).toString(base58btc.encoder); + } + function blake32Hash(data) { + const uint8array = typeof data === "string" ? new TextEncoder().encode(data) : data; + const digest = blake2b256.digest(uint8array); + return base58btc.encode(digest.bytes); + } + var b64ToBuf = (b64) => Buffer.from(b64, "base64"); + var strToBuf = (str) => Buffer.from(str, "utf8"); + var bytesToB64 = (ary) => Buffer.from(ary).toString("base64"); + + // shared/domains/chelonia/crypto.js + var import_tweetnacl = __toESM(require_nacl_fast()); + var import_scrypt_async = __toESM(require_scrypt_async()); + var EDWARDS25519SHA512BATCH = "edwards25519sha512batch"; + var CURVE25519XSALSA20POLY1305 = "curve25519xsalsa20poly1305"; + var XSALSA20POLY1305 = "xsalsa20poly1305"; + if (false) { + throw new Error("ENABLE_UNSAFE_NULL_CRYPTO cannot be enabled in production mode"); + } + var bytesOrObjectToB64 = (ary) => { + if (!(ary instanceof Uint8Array)) { + throw Error("Unsupported type"); + } + return bytesToB64(ary); + }; + var serializeKey = (key, saveSecretKey) => { + if (false) { + return JSON.stringify([ + key.type, + saveSecretKey ? null : key.publicKey, + saveSecretKey ? key.secretKey : null + ], void 0, 0); + } + if (key.type === EDWARDS25519SHA512BATCH || key.type === CURVE25519XSALSA20POLY1305) { + if (!saveSecretKey) { + if (!key.publicKey) { + throw new Error("Unsupported operation: no public key to export"); + } + return JSON.stringify([ + key.type, + bytesOrObjectToB64(key.publicKey), + null + ], void 0, 0); + } + if (!key.secretKey) { + throw new Error("Unsupported operation: no secret key to export"); + } + return JSON.stringify([ + key.type, + null, + bytesOrObjectToB64(key.secretKey) + ], void 0, 0); + } else if (key.type === XSALSA20POLY1305) { + if (!saveSecretKey) { + throw new Error("Unsupported operation: no public key to export"); + } + if (!key.secretKey) { + throw new Error("Unsupported operation: no secret key to export"); + } + return JSON.stringify([ + key.type, + null, + bytesOrObjectToB64(key.secretKey) + ], void 0, 0); + } + throw new Error("Unsupported key type"); + }; + var deserializeKey = (data) => { + const keyData = JSON.parse(data); + if (!keyData || keyData.length !== 3) { + throw new Error("Invalid key object"); + } + if (false) { + const res = { + type: keyData[0] + }; + if (keyData[2]) { + Object.defineProperty(res, "secretKey", { value: keyData[2] }); + res.publicKey = keyData[2]; + } else { + res.publicKey = keyData[1]; + } + return res; + } + if (keyData[0] === EDWARDS25519SHA512BATCH) { + if (keyData[2]) { + const key = import_tweetnacl.default.sign.keyPair.fromSecretKey(b64ToBuf(keyData[2])); + const res = { + type: keyData[0], + publicKey: key.publicKey + }; + Object.defineProperty(res, "secretKey", { value: key.secretKey }); + return res; + } else if (keyData[1]) { + return { + type: keyData[0], + publicKey: new Uint8Array(b64ToBuf(keyData[1])) + }; + } + throw new Error("Missing secret or public key"); + } else if (keyData[0] === CURVE25519XSALSA20POLY1305) { + if (keyData[2]) { + const key = import_tweetnacl.default.box.keyPair.fromSecretKey(b64ToBuf(keyData[2])); + const res = { + type: keyData[0], + publicKey: key.publicKey + }; + Object.defineProperty(res, "secretKey", { value: key.secretKey }); + return res; + } else if (keyData[1]) { + return { + type: keyData[0], + publicKey: new Uint8Array(b64ToBuf(keyData[1])) + }; + } + throw new Error("Missing secret or public key"); + } else if (keyData[0] === XSALSA20POLY1305) { + if (!keyData[2]) { + throw new Error("Secret key missing"); + } + const res = { + type: keyData[0] + }; + Object.defineProperty(res, "secretKey", { value: new Uint8Array(b64ToBuf(keyData[2])) }); + return res; + } + throw new Error("Unsupported key type"); + }; + var keyId = (inKey) => { + const key = Object(inKey) instanceof String ? deserializeKey(inKey) : inKey; + const serializedKey = serializeKey(key, !key.publicKey); + return blake32Hash(serializedKey); + }; + var verifySignature = (inKey, data, signature) => { + const key = Object(inKey) instanceof String ? deserializeKey(inKey) : inKey; + if (false) { + if (!key.publicKey) { + throw new Error("Public key missing"); + } + if (key.publicKey + ";" + blake32Hash(data) !== signature) { + throw new Error("Invalid signature"); + } + return; + } + if (key.type !== EDWARDS25519SHA512BATCH) { + throw new Error("Unsupported algorithm"); + } + if (!key.publicKey) { + throw new Error("Public key missing"); + } + const decodedSignature = b64ToBuf(signature); + const messageUint8 = strToBuf(data); + const result = import_tweetnacl.default.sign.detached.verify(messageUint8, decodedSignature, key.publicKey); + if (!result) { + throw new Error("Invalid signature"); + } + }; + var decrypt = (inKey, data, ad) => { + const key = Object(inKey) instanceof String ? deserializeKey(inKey) : inKey; + if (false) { + if (!key.secretKey) { + throw new Error("Secret key missing"); + } + if (!data.startsWith(key.secretKey + ";") || !data.endsWith(";" + (ad ?? ""))) { + throw new Error("Additional data mismatch"); + } + return data.slice(String(key.secretKey).length + 1, data.length - 1 - (ad ?? "").length); + } + if (key.type === XSALSA20POLY1305) { + if (!key.secretKey) { + throw new Error("Secret key missing"); + } + const messageWithNonceAsUint8Array = b64ToBuf(data); + const nonce = messageWithNonceAsUint8Array.slice(0, import_tweetnacl.default.secretbox.nonceLength); + const message = messageWithNonceAsUint8Array.slice(import_tweetnacl.default.secretbox.nonceLength, messageWithNonceAsUint8Array.length); + if (ad) { + const adHash = import_tweetnacl.default.hash(strToBuf(ad)); + const len = Math.min(adHash.length, nonce.length); + for (let i = 0; i < len; i++) { + nonce[i] ^= adHash[i]; + } + } + const decrypted = import_tweetnacl.default.secretbox.open(message, nonce, key.secretKey); + if (!decrypted) { + throw new Error("Could not decrypt message"); + } + return Buffer.from(decrypted).toString("utf-8"); + } else if (key.type === CURVE25519XSALSA20POLY1305) { + if (!key.secretKey) { + throw new Error("Secret key missing"); + } + const messageWithNonceAsUint8Array = b64ToBuf(data); + const ephemeralPublicKey = messageWithNonceAsUint8Array.slice(0, import_tweetnacl.default.box.publicKeyLength); + const nonce = messageWithNonceAsUint8Array.slice(import_tweetnacl.default.box.publicKeyLength, import_tweetnacl.default.box.publicKeyLength + import_tweetnacl.default.box.nonceLength); + const message = messageWithNonceAsUint8Array.slice(import_tweetnacl.default.box.publicKeyLength + import_tweetnacl.default.box.nonceLength); + if (ad) { + const adHash = import_tweetnacl.default.hash(strToBuf(ad)); + const len = Math.min(adHash.length, nonce.length); + for (let i = 0; i < len; i++) { + nonce[i] ^= adHash[i]; + } + } + const decrypted = import_tweetnacl.default.box.open(message, nonce, ephemeralPublicKey, key.secretKey); + if (!decrypted) { + throw new Error("Could not decrypt message"); + } + return Buffer.from(decrypted).toString("utf-8"); + } + throw new Error("Unsupported algorithm"); + }; + + // shared/domains/chelonia/encryptedData.js + var import_sbp3 = __toESM(__require("@sbp/sbp")); + + // shared/domains/chelonia/signedData.js + var import_sbp2 = __toESM(__require("@sbp/sbp")); + var rootStateFn = () => (0, import_sbp2.default)("chelonia/rootState"); + var proto = Object.create(null, { + _isSignedData: { + value: true + } + }); + var wrapper = (o) => { + return Object.setPrototypeOf(o, proto); + }; + var isSignedData = (o) => { + return !!o && !!Object.getPrototypeOf(o)?._isSignedData; + }; + var verifySignatureData = function(height, data, additionalData) { + if (!this) { + throw new ChelErrorSignatureError("Missing contract state"); + } + if (!isRawSignedData(data)) { + throw new ChelErrorSignatureError("Invalid message format"); + } + if (!Number.isSafeInteger(height) || height < 0) { + throw new ChelErrorSignatureError(`Height ${height} is invalid or out of range`); + } + const [serializedMessage, sKeyId, signature] = data._signedData; + const designatedKey = this._vm?.authorizedKeys?.[sKeyId]; + if (!designatedKey || height > designatedKey._notAfterHeight || height < designatedKey._notBeforeHeight || !designatedKey.purpose.includes("sig")) { + if ("") { + console.error(`Key ${sKeyId} is unauthorized or expired for the current contract`, { designatedKey, height, state: JSON.parse(JSON.stringify((0, import_sbp2.default)("state/vuex/state"))) }); + Promise.reject(new ChelErrorSignatureKeyUnauthorized(`Key ${sKeyId} is unauthorized or expired for the current contract`)); + } + throw new ChelErrorSignatureKeyUnauthorized(`Key ${sKeyId} is unauthorized or expired for the current contract`); + } + const deserializedKey = designatedKey.data; + const payloadToSign = blake32Hash(`${blake32Hash(additionalData)}${blake32Hash(serializedMessage)}`); + try { + verifySignature(deserializedKey, payloadToSign, signature); + const message = JSON.parse(serializedMessage); + return [sKeyId, message]; + } catch (e) { + throw new ChelErrorSignatureError(e?.message || e); + } + }; + var signedIncomingData = (contractID, state, data, height, additionalData, mapperFn) => { + const stringValueFn = () => data; + let verifySignedValue; + const verifySignedValueFn = () => { + if (verifySignedValue) { + return verifySignedValue[1]; + } + verifySignedValue = verifySignatureData.call(state || rootStateFn()[contractID], height, data, additionalData); + if (mapperFn) + verifySignedValue[1] = mapperFn(verifySignedValue[1]); + return verifySignedValue[1]; + }; + return wrapper({ + get signingKeyId() { + if (verifySignedValue) + return verifySignedValue[0]; + return signedDataKeyId(data); + }, + get serialize() { + return stringValueFn; + }, + get context() { + return [contractID, data, height, additionalData]; + }, + get toString() { + return () => JSON.stringify(this.serialize()); + }, + get valueOf() { + return verifySignedValueFn; + }, + get toJSON() { + return this.serialize; + }, + get get() { + return (k) => k !== "_signedData" ? data[k] : void 0; + } + }); + }; + var signedDataKeyId = (data) => { + if (!isRawSignedData(data)) { + throw new ChelErrorSignatureError("Invalid message format"); + } + return data._signedData[1]; + }; + var isRawSignedData = (data) => { + if (!data || typeof data !== "object" || !has(data, "_signedData") || !Array.isArray(data._signedData) || data._signedData.length !== 3 || data._signedData.map((v) => typeof v).filter((v) => v !== "string").length !== 0) { + return false; + } + return true; + }; + var rawSignedIncomingData = (data) => { + if (!isRawSignedData(data)) { + throw new ChelErrorSignatureError("Invalid message format"); + } + const stringValueFn = () => data; + let verifySignedValue; + const verifySignedValueFn = () => { + if (verifySignedValue) { + return verifySignedValue[1]; + } + verifySignedValue = [data._signedData[1], JSON.parse(data._signedData[0])]; + return verifySignedValue[1]; + }; + return wrapper({ + get signingKeyId() { + if (verifySignedValue) + return verifySignedValue[0]; + return signedDataKeyId(data); + }, + get serialize() { + return stringValueFn; + }, + get toString() { + return () => JSON.stringify(this.serialize()); + }, + get valueOf() { + return verifySignedValueFn; + }, + get toJSON() { + return this.serialize; + }, + get get() { + return (k) => k !== "_signedData" ? data[k] : void 0; + } + }); + }; + + // shared/domains/chelonia/encryptedData.js + var rootStateFn2 = () => (0, import_sbp3.default)("chelonia/rootState"); + var proto2 = Object.create(null, { + _isEncryptedData: { + value: true + } + }); + var wrapper2 = (o) => { + return Object.setPrototypeOf(o, proto2); + }; + var isEncryptedData = (o) => { + return !!o && !!Object.getPrototypeOf(o)?._isEncryptedData; + }; + var decryptData = function(height, data, additionalKeys, additionalData, validatorFn) { + if (!this) { + throw new ChelErrorDecryptionError("Missing contract state"); + } + if (typeof data.valueOf === "function") + data = data.valueOf(); + if (!isRawEncryptedData(data)) { + throw new ChelErrorDecryptionError("Invalid message format"); + } + const [eKeyId, message] = data; + const key = additionalKeys[eKeyId]; + if (!key) { + throw new ChelErrorDecryptionKeyNotFound(`Key ${eKeyId} not found`); + } + const designatedKey = this._vm?.authorizedKeys?.[eKeyId]; + if (!designatedKey || height > designatedKey._notAfterHeight || height < designatedKey._notBeforeHeight || !designatedKey.purpose.includes("enc")) { + throw new ChelErrorUnexpected(`Key ${eKeyId} is unauthorized or expired for the current contract`); + } + const deserializedKey = typeof key === "string" ? deserializeKey(key) : key; + try { + const result = JSON.parse(decrypt(deserializedKey, message, additionalData)); + if (typeof validatorFn === "function") + validatorFn(result, eKeyId); + return result; + } catch (e) { + throw new ChelErrorDecryptionError(e?.message || e); + } + }; + var encryptedIncomingData = (contractID, state, data, height, additionalKeys, additionalData, validatorFn) => { + let decryptedValue; + const decryptedValueFn = () => { + if (decryptedValue) { + return decryptedValue; + } + if (!state || !additionalKeys) { + const rootState = rootStateFn2(); + state = state || rootState[contractID]; + additionalKeys = additionalKeys ?? rootState.secretKeys; + } + decryptedValue = decryptData.call(state, height, data, additionalKeys, additionalData || "", validatorFn); + if (isRawSignedData(decryptedValue)) { + decryptedValue = signedIncomingData(contractID, state, decryptedValue, height, additionalData || ""); + } + return decryptedValue; + }; + return wrapper2({ + get encryptionKeyId() { + return encryptedDataKeyId(data); + }, + get serialize() { + return () => data; + }, + get toString() { + return () => JSON.stringify(this.serialize()); + }, + get valueOf() { + return decryptedValueFn; + }, + get toJSON() { + return this.serialize; + } + }); + }; + var encryptedIncomingForeignData = (contractID, _0, data, _1, additionalKeys, additionalData, validatorFn) => { + let decryptedValue; + const decryptedValueFn = () => { + if (decryptedValue) { + return decryptedValue; + } + const rootState = rootStateFn2(); + const state = rootState[contractID]; + decryptedValue = decryptData.call(state, NaN, data, additionalKeys ?? rootState.secretKeys, additionalData || "", validatorFn); + if (isRawSignedData(decryptedValue)) { + return signedIncomingData(contractID, state, decryptedValue, NaN, additionalData || ""); + } + return decryptedValue; + }; + return wrapper2({ + get encryptionKeyId() { + return encryptedDataKeyId(data); + }, + get serialize() { + return () => data; + }, + get toString() { + return () => JSON.stringify(this.serialize()); + }, + get valueOf() { + return decryptedValueFn; + }, + get toJSON() { + return this.serialize; + } + }); + }; + var encryptedDataKeyId = (data) => { + if (!isRawEncryptedData(data)) { + throw new ChelErrorDecryptionError("Invalid message format"); + } + return data[0]; + }; + var isRawEncryptedData = (data) => { + if (!Array.isArray(data) || data.length !== 2 || data.map((v) => typeof v).filter((v) => v !== "string").length !== 0) { + return false; + } + return true; + }; + var unwrapMaybeEncryptedData = (data) => { + if (isEncryptedData(data)) { + if (false) + return; + try { + return { + encryptionKeyId: data.encryptionKeyId, + data: data.valueOf() + }; + } catch (e) { + console.warn("unwrapMaybeEncryptedData: Unable to decrypt", e); + } + } else { + return { + encryptionKeyId: null, + data + }; + } + }; + var maybeEncryptedIncomingData = (contractID, state, data, height, additionalKeys, additionalData, validatorFn) => { + if (isRawEncryptedData(data)) { + return encryptedIncomingData(contractID, state, data, height, additionalKeys, additionalData, validatorFn); + } else { + validatorFn?.(data, ""); + return data; + } + }; + + // shared/serdes/index.js + var raw = Symbol("raw"); + var serdesTagSymbol = Symbol("tag"); + var serdesSerializeSymbol = Symbol("serialize"); + var serdesDeserializeSymbol = Symbol("deserialize"); + var rawResult = (obj) => { + Object.defineProperty(obj, raw, { value: true }); + return obj; + }; + var serializer = (data) => { + const verbatim = []; + const transferables = /* @__PURE__ */ new Set(); + const revokables = /* @__PURE__ */ new Set(); + const result = JSON.parse(JSON.stringify(data, (_key, value) => { + if (value && value[raw]) + return value; + if (value === void 0) + return rawResult(["_", "_"]); + if (!value) + return value; + if (Array.isArray(value) && value[0] === "_") + return rawResult(["_", "_", ...value]); + if (value instanceof Map) { + return rawResult(["_", "Map", Array.from(value.entries())]); + } + if (value instanceof Set) { + return rawResult(["_", "Set", Array.from(value.entries())]); + } + if (value instanceof Error || value instanceof Blob || value instanceof File) { + const pos = verbatim.length; + verbatim[verbatim.length] = value; + return rawResult(["_", "_ref", pos]); + } + if (value instanceof MessagePort || value instanceof ReadableStream || value instanceof WritableStream || value instanceof ArrayBuffer) { + const pos = verbatim.length; + verbatim[verbatim.length] = value; + transferables.add(value); + return rawResult(["_", "_ref", pos]); + } + if (ArrayBuffer.isView(value)) { + const pos = verbatim.length; + verbatim[verbatim.length] = value; + transferables.add(value.buffer); + return rawResult(["_", "_ref", pos]); + } + if (typeof value === "function") { + const mc = new MessageChannel(); + mc.port1.onmessage = async (ev) => { + try { + try { + const result2 = await value(...deserializer(ev.data[1])); + const { data: data2, transferables: transferables2 } = serializer(result2); + ev.data[0].postMessage([true, data2], transferables2); + } catch (e) { + const { data: data2, transferables: transferables2 } = serializer(e); + ev.data[0].postMessage([false, data2], transferables2); + } + } catch (e) { + console.error("Async error on onmessage handler", e); + } + }; + transferables.add(mc.port2); + revokables.add(mc.port1); + return rawResult(["_", "_fn", mc.port2]); + } + const proto3 = Object.getPrototypeOf(value); + if (proto3?.constructor?.[serdesTagSymbol] && proto3.constructor[serdesSerializeSymbol]) { + return rawResult(["_", "_custom", proto3.constructor[serdesTagSymbol], proto3.constructor[serdesSerializeSymbol](value)]); + } + return value; + }), (_key, value) => { + if (Array.isArray(value) && value[0] === "_" && value[1] === "_ref") { + return verbatim[value[2]]; + } + return value; + }); + return { + data: result, + transferables: Array.from(transferables), + revokables: Array.from(revokables) + }; + }; + var deserializerTable = /* @__PURE__ */ Object.create(null); + var deserializer = (data) => { + const verbatim = []; + return JSON.parse(JSON.stringify(data, (_key, value) => { + if (value && typeof value === "object" && !Array.isArray(value) && Object.getPrototypeOf(value) !== Object.prototype) { + const pos = verbatim.length; + verbatim[verbatim.length] = value; + return rawResult(["_", "_ref", pos]); + } + return value; + }), (_key, value) => { + if (Array.isArray(value) && value[0] === "_") { + switch (value[1]) { + case "_": + if (value.length >= 3) { + return value.slice(2); + } else { + return void 0; + } + case "Map": + return new Map(value[2]); + case "Set": + return new Set(value[2]); + case "_custom": + if (deserializerTable[value[2]]) { + return deserializerTable[value[2]](value[3]); + } else { + throw new Error("Invalid or unknown tag: " + value[2]); + } + case "_ref": + return verbatim[value[2]]; + case "_fn": { + const mp = value[2]; + return (...args) => { + return new Promise((resolve, reject) => { + const mc = new MessageChannel(); + const { data: data2, transferables } = serializer(args); + mc.port1.onmessage = (ev) => { + if (ev.data[0]) { + resolve(deserializer(ev.data[1])); + } else { + reject(deserializer(ev.data[1])); + } + }; + mp.postMessage([mc.port2, data2], [mc.port2, ...transferables]); + }); + }; + } + } + } + return value; + }); + }; + deserializer.register = (y) => { + if (typeof y === "function" && typeof y[serdesTagSymbol] === "string" && typeof y[serdesDeserializeSymbol] === "function") { + deserializerTable[y[serdesTagSymbol]] = y[serdesDeserializeSymbol].bind(y); + } + }; + + // shared/domains/chelonia/GIMessage.js + var decryptedAndVerifiedDeserializedMessage = (head, headJSON, contractID, parsedMessage, additionalKeys, state) => { + const op = head.op; + const height = head.height; + const message = op === GIMessage.OP_ACTION_ENCRYPTED ? encryptedIncomingData(contractID, state, parsedMessage, height, additionalKeys, headJSON, void 0) : parsedMessage; + if ([GIMessage.OP_KEY_ADD, GIMessage.OP_KEY_UPDATE].includes(op)) { + return message.map((key) => { + return maybeEncryptedIncomingData(contractID, state, key, height, additionalKeys, headJSON, (key2, eKeyId) => { + if (key2.meta?.private?.content) { + key2.meta.private.content = encryptedIncomingData(contractID, state, key2.meta.private.content, height, additionalKeys, headJSON, (value) => { + const computedKeyId = keyId(value); + if (computedKeyId !== key2.id) { + throw new Error(`Key ID mismatch. Expected to decrypt key ID ${key2.id} but got ${computedKeyId}`); + } + }); + } + if (key2.meta?.keyRequest?.reference) { + try { + key2.meta.keyRequest.reference = maybeEncryptedIncomingData(contractID, state, key2.meta.keyRequest.reference, height, additionalKeys, headJSON)?.valueOf(); + } catch { + delete key2.meta.keyRequest.reference; + } + } + if (key2.meta?.keyRequest?.contractID) { + try { + key2.meta.keyRequest.contractID = maybeEncryptedIncomingData(contractID, state, key2.meta.keyRequest.contractID, height, additionalKeys, headJSON)?.valueOf(); + } catch { + delete key2.meta.keyRequest.contractID; + } + } + }); + }); + } + if (op === GIMessage.OP_CONTRACT) { + message.keys = message.keys?.map((key, eKeyId) => { + return maybeEncryptedIncomingData(contractID, state, key, height, additionalKeys, headJSON, (key2) => { + if (!key2.meta?.private?.content) + return; + const decryptionFn = message.foreignContractID ? encryptedIncomingForeignData : encryptedIncomingData; + const decryptionContract = message.foreignContractID ? message.foreignContractID : contractID; + key2.meta.private.content = decryptionFn(decryptionContract, state, key2.meta.private.content, height, additionalKeys, headJSON, (value) => { + const computedKeyId = keyId(value); + if (computedKeyId !== key2.id) { + throw new Error(`Key ID mismatch. Expected to decrypt key ID ${key2.id} but got ${computedKeyId}`); + } + }); + }); + }); + } + if (op === GIMessage.OP_KEY_SHARE) { + return maybeEncryptedIncomingData(contractID, state, message, height, additionalKeys, headJSON, (message2) => { + message2.keys?.forEach((key) => { + if (!key.meta?.private?.content) + return; + const decryptionFn = message2.foreignContractID ? encryptedIncomingForeignData : encryptedIncomingData; + const decryptionContract = message2.foreignContractID || contractID; + key.meta.private.content = decryptionFn(decryptionContract, state, key.meta.private.content, height, additionalKeys, headJSON, (value) => { + const computedKeyId = keyId(value); + if (computedKeyId !== key.id) { + throw new Error(`Key ID mismatch. Expected to decrypt key ID ${key.id} but got ${computedKeyId}`); + } + }); + }); + }); + } + if (op === GIMessage.OP_KEY_REQUEST) { + return maybeEncryptedIncomingData(contractID, state, message, height, additionalKeys, headJSON, (msg) => { + msg.replyWith = signedIncomingData(msg.contractID, void 0, msg.replyWith, msg.height, headJSON); + }); + } + if (op === GIMessage.OP_ACTION_UNENCRYPTED && isRawSignedData(message)) { + return signedIncomingData(contractID, state, message, height, headJSON); + } + if (op === GIMessage.OP_ACTION_ENCRYPTED) { + return message; + } + if (op === GIMessage.OP_KEY_DEL) { + return message.map((key) => { + return maybeEncryptedIncomingData(contractID, state, key, height, additionalKeys, headJSON, void 0); + }); + } + if (op === GIMessage.OP_KEY_REQUEST_SEEN) { + return maybeEncryptedIncomingData(contractID, state, parsedMessage, height, additionalKeys, headJSON, void 0); + } + if (op === GIMessage.OP_ATOMIC) { + return message.map(([opT, opV]) => [ + opT, + decryptedAndVerifiedDeserializedMessage({ ...head, op: opT }, headJSON, contractID, opV, additionalKeys, state) + ]); + } + return message; + }; + var _GIMessage = class { + _mapping; + _head; + _message; + _signedMessageData; + _direction; + _decryptedValue; + _innerSigningKeyId; + static createV1_0({ + contractID, + previousHEAD = null, + height = Number.MAX_SAFE_INTEGER, + op, + manifest + }) { + const head = { + version: "1.0.0", + previousHEAD, + height, + contractID, + op: op[0], + manifest + }; + return new this(messageToParams(head, op[1])); + } + static cloneWith(targetHead, targetOp, sources) { + const head = Object.assign({}, targetHead, sources); + return new this(messageToParams(head, targetOp[1])); + } + static deserialize(value, additionalKeys, state) { + if (!value) + throw new Error(`deserialize bad value: ${value}`); + const { head: headJSON, ...parsedValue } = JSON.parse(value); + const head = JSON.parse(headJSON); + const contractID = head.op === _GIMessage.OP_CONTRACT ? createCID(value) : head.contractID; + if (!state?._vm?.authorizedKeys && head.op === _GIMessage.OP_CONTRACT) { + const value2 = rawSignedIncomingData(parsedValue); + const authorizedKeys = Object.fromEntries(value2.valueOf()?.keys.map((k) => [k.id, k])); + state = { + _vm: { + authorizedKeys + } + }; + } + const signedMessageData = signedIncomingData(contractID, state, parsedValue, head.height, headJSON, (message) => decryptedAndVerifiedDeserializedMessage(head, headJSON, contractID, message, additionalKeys, state)); + return new this({ + direction: "incoming", + mapping: { key: createCID(value), value }, + head, + signedMessageData + }); + } + static deserializeHEAD(value) { + if (!value) + throw new Error(`deserialize bad value: ${value}`); + let head, hash; + const result = { + get head() { + if (head === void 0) { + head = JSON.parse(JSON.parse(value).head); + } + return head; + }, + get hash() { + if (!hash) { + hash = createCID(value); + } + return hash; + }, + get contractID() { + return result.head?.contractID ?? result.hash; + }, + description() { + const type = this.head.op; + return ``; + }, + get isFirstMessage() { + return !result.head?.contractID; + } + }; + return result; + } + constructor(params) { + this._direction = params.direction; + this._mapping = params.mapping; + this._head = params.head; + this._signedMessageData = params.signedMessageData; + const type = this.opType(); + let atomicTopLevel = true; + const validate = (type2, message) => { + switch (type2) { + case _GIMessage.OP_CONTRACT: + if (!this.isFirstMessage() || !atomicTopLevel) + throw new Error("OP_CONTRACT: must be first message"); + break; + case _GIMessage.OP_ATOMIC: + if (!atomicTopLevel) { + throw new Error("OP_ATOMIC not allowed inside of OP_ATOMIC"); + } + if (!Array.isArray(message)) { + throw new TypeError("OP_ATOMIC must be of an array type"); + } + atomicTopLevel = false; + message.forEach(([t, m]) => validate(t, m)); + break; + case _GIMessage.OP_KEY_ADD: + case _GIMessage.OP_KEY_DEL: + case _GIMessage.OP_KEY_UPDATE: + if (!Array.isArray(message)) + throw new TypeError("OP_KEY_{ADD|DEL|UPDATE} must be of an array type"); + break; + case _GIMessage.OP_KEY_SHARE: + case _GIMessage.OP_KEY_REQUEST: + case _GIMessage.OP_KEY_REQUEST_SEEN: + case _GIMessage.OP_ACTION_ENCRYPTED: + case _GIMessage.OP_ACTION_UNENCRYPTED: + break; + default: + throw new Error(`unsupported op: ${type2}`); + } + }; + Object.defineProperty(this, "_message", { + get: ((validated) => () => { + const message = this._signedMessageData.valueOf(); + if (!validated) { + validate(type, message); + validated = true; + } + return message; + })() + }); + } + decryptedValue() { + if (this._decryptedValue) + return this._decryptedValue; + try { + const value = this.message(); + const data = unwrapMaybeEncryptedData(value); + if (data?.data) { + if (isSignedData(data.data)) { + this._innerSigningKeyId = data.data.signingKeyId; + this._decryptedValue = data.data.valueOf(); + } else { + this._decryptedValue = data.data; + } + } + return this._decryptedValue; + } catch { + return void 0; + } + } + innerSigningKeyId() { + if (!this._decryptedValue) { + this.decryptedValue(); + } + return this._innerSigningKeyId; + } + head() { + return this._head; + } + message() { + return this._message; + } + op() { + return [this.head().op, this.message()]; + } + rawOp() { + return [this.head().op, this._signedMessageData]; + } + opType() { + return this.head().op; + } + opValue() { + return this.message(); + } + signingKeyId() { + return this._signedMessageData.signingKeyId; + } + manifest() { + return this.head().manifest; + } + description() { + const type = this.opType(); + let desc = ``; + } + isFirstMessage() { + return !this.head().contractID; + } + contractID() { + return this.head().contractID || this.hash(); + } + serialize() { + return this._mapping.value; + } + hash() { + return this._mapping.key; + } + height() { + return this._head.height; + } + id() { + throw new Error("GIMessage.id() was called but it has been removed"); + } + direction() { + return this._direction; + } + static get [serdesTagSymbol]() { + return "GIMessage"; + } + static [serdesSerializeSymbol](m) { + return [m.serialize(), m.direction(), m.decryptedValue(), m.innerSigningKeyId()]; + } + static [serdesDeserializeSymbol]([serialized, direction, decryptedValue, innerSigningKeyId]) { + const m = _GIMessage.deserialize(serialized); + m._direction = direction; + m._decryptedValue = decryptedValue; + m._innerSigningKeyId = innerSigningKeyId; + return m; + } + }; + var GIMessage = _GIMessage; + __publicField(GIMessage, "OP_CONTRACT", "c"); + __publicField(GIMessage, "OP_ACTION_ENCRYPTED", "ae"); + __publicField(GIMessage, "OP_ACTION_UNENCRYPTED", "au"); + __publicField(GIMessage, "OP_KEY_ADD", "ka"); + __publicField(GIMessage, "OP_KEY_DEL", "kd"); + __publicField(GIMessage, "OP_KEY_UPDATE", "ku"); + __publicField(GIMessage, "OP_PROTOCOL_UPGRADE", "pu"); + __publicField(GIMessage, "OP_PROP_SET", "ps"); + __publicField(GIMessage, "OP_PROP_DEL", "pd"); + __publicField(GIMessage, "OP_CONTRACT_AUTH", "ca"); + __publicField(GIMessage, "OP_CONTRACT_DEAUTH", "cd"); + __publicField(GIMessage, "OP_ATOMIC", "a"); + __publicField(GIMessage, "OP_KEY_SHARE", "ks"); + __publicField(GIMessage, "OP_KEY_REQUEST", "kr"); + __publicField(GIMessage, "OP_KEY_REQUEST_SEEN", "krs"); + function messageToParams(head, message) { + let mapping; + return { + direction: has(message, "recreate") ? "outgoing" : "incoming", + get mapping() { + if (!mapping) { + const headJSON = JSON.stringify(head); + const messageJSON = { ...message.serialize(headJSON), head: headJSON }; + const value = JSON.stringify(messageJSON); + mapping = { + key: createCID(value), + value + }; + } + return mapping; + }, + head, + signedMessageData: message + }; + } + + // shared/domains/chelonia/Secret.js + var wm = /* @__PURE__ */ new WeakMap(); + var Secret = class { + static [serdesDeserializeSymbol](secret) { + return new this(secret); + } + static [serdesSerializeSymbol](secret) { + return wm.get(secret); + } + static get [serdesTagSymbol]() { + return "__chelonia_Secret"; + } + constructor(value) { + wm.set(this, value); + } + valueOf() { + return wm.get(this); + } + }; + + // shared/domains/chelonia/constants.js + var INVITE_STATUS = { + REVOKED: "revoked", + VALID: "valid", + USED: "used" + }; + + // shared/domains/chelonia/utils.js + var MAX_EVENTS_AFTER = Number.parseInt("", 10) || Infinity; + var findKeyIdByName = (state, name) => state._vm?.authorizedKeys && Object.values(state._vm.authorizedKeys).find((k) => k.name === name && k._notAfterHeight == null)?.id; + var findForeignKeysByContractID = (state, contractID) => state._vm?.authorizedKeys && Object.values(state._vm.authorizedKeys).filter((k) => k._notAfterHeight == null && k.foreignKey?.includes(contractID)).map((k) => k.id); + + // frontend/model/contracts/shared/constants.js + var MAX_HASH_LEN = 300; + var MAX_MEMO_LEN = 4096; + var INVITE_INITIAL_CREATOR = "invite-initial-creator"; + var PROFILE_STATUS = { + ACTIVE: "active", + PENDING: "pending", + REMOVED: "removed" + }; + var GROUP_NAME_MAX_CHAR = 50; + var GROUP_DESCRIPTION_MAX_CHAR = 500; + var GROUP_PAYMENT_METHOD_MAX_CHAR = 1024; + var GROUP_NON_MONETARY_CONTRIBUTION_MAX_CHAR = 150; + var GROUP_CURRENCY_MAX_CHAR = 10; + var GROUP_MAX_PLEDGE_AMOUNT = 1e9; + var GROUP_MINCOME_MAX = 1e9; + var GROUP_DISTRIBUTION_PERIOD_MAX_DAYS = 365; + var PROPOSAL_RESULT = "proposal-result"; + var PROPOSAL_INVITE_MEMBER = "invite-member"; + var PROPOSAL_REMOVE_MEMBER = "remove-member"; + var PROPOSAL_GROUP_SETTING_CHANGE = "group-setting-change"; + var PROPOSAL_PROPOSAL_SETTING_CHANGE = "proposal-setting-change"; + var PROPOSAL_GENERIC = "generic"; + var PROPOSAL_ARCHIVED = "proposal-archived"; + var MAX_ARCHIVED_PROPOSALS = 100; + var PAYMENTS_ARCHIVED = "payments-archived"; + var MAX_ARCHIVED_PERIODS = 100; + var MAX_SAVED_PERIODS = 2; + var STATUS_OPEN = "open"; + var STATUS_PASSED = "passed"; + var STATUS_FAILED = "failed"; + var STATUS_EXPIRING = "expiring"; + var STATUS_EXPIRED = "expired"; + var STATUS_CANCELLED = "cancelled"; + var CHATROOM_GENERAL_NAME = "general"; + var CHATROOM_NAME_LIMITS_IN_CHARS = 50; + var CHATROOM_DESCRIPTION_LIMITS_IN_CHARS = 280; + var CHATROOM_TYPES = { + DIRECT_MESSAGE: "direct-message", + GROUP: "group" + }; + var CHATROOM_PRIVACY_LEVEL = { + GROUP: "group", + PRIVATE: "private", + PUBLIC: "public" + }; + var MESSAGE_TYPES = { + POLL: "poll", + TEXT: "text", + INTERACTIVE: "interactive", + NOTIFICATION: "notification" + }; + var INVITE_EXPIRES_IN_DAYS = { + ON_BOARDING: null, + PROPOSAL: 7 + }; + var MESSAGE_NOTIFICATIONS = { + ADD_MEMBER: "add-member", + JOIN_MEMBER: "join-member", + LEAVE_MEMBER: "leave-member", + KICK_MEMBER: "kick-member", + UPDATE_DESCRIPTION: "update-description", + UPDATE_NAME: "update-name" + }; + var POLL_TYPES = { + SINGLE_CHOICE: "single-vote", + MULTIPLE_CHOICES: "multiple-votes" + }; + + // frontend/model/contracts/shared/distribution/mincome-proportional.js + function mincomeProportional(haveNeeds) { + let totalHave = 0; + let totalNeed = 0; + const havers = []; + const needers = []; + for (const haveNeed of haveNeeds) { + if (haveNeed.haveNeed > 0) { + havers.push(haveNeed); + totalHave += haveNeed.haveNeed; + } else if (haveNeed.haveNeed < 0) { + needers.push(haveNeed); + totalNeed += Math.abs(haveNeed.haveNeed); + } + } + const totalPercent = Math.min(1, totalNeed / totalHave); + const payments = []; + for (const haver of havers) { + const distributionAmount = totalPercent * haver.haveNeed; + for (const needer of needers) { + const belowPercentage = Math.abs(needer.haveNeed) / totalNeed; + payments.push({ + amount: distributionAmount * belowPercentage, + fromMemberID: haver.memberID, + toMemberID: needer.memberID + }); + } + } + return payments; + } + + // frontend/model/contracts/shared/distribution/payments-minimizer.js + function minimizeTotalPaymentsCount(distribution) { + const neederTotalReceived = {}; + const haverTotalHave = {}; + const haversSorted = []; + const needersSorted = []; + const minimizedDistribution = []; + for (const todo of distribution) { + neederTotalReceived[todo.toMemberID] = (neederTotalReceived[todo.toMemberID] || 0) + todo.amount; + haverTotalHave[todo.fromMemberID] = (haverTotalHave[todo.fromMemberID] || 0) + todo.amount; + } + for (const memberID in haverTotalHave) { + haversSorted.push({ memberID, amount: haverTotalHave[memberID] }); + } + for (const memberID in neederTotalReceived) { + needersSorted.push({ memberID, amount: neederTotalReceived[memberID] }); + } + haversSorted.sort((a, b) => b.amount - a.amount); + needersSorted.sort((a, b) => b.amount - a.amount); + while (haversSorted.length > 0 && needersSorted.length > 0) { + const mostHaver = haversSorted.pop(); + const mostNeeder = needersSorted.pop(); + const diff = mostHaver.amount - mostNeeder.amount; + if (diff < 0) { + minimizedDistribution.push({ amount: mostHaver.amount, fromMemberID: mostHaver.memberID, toMemberID: mostNeeder.memberID }); + mostNeeder.amount -= mostHaver.amount; + needersSorted.push(mostNeeder); + } else if (diff > 0) { + minimizedDistribution.push({ amount: mostNeeder.amount, fromMemberID: mostHaver.memberID, toMemberID: mostNeeder.memberID }); + mostHaver.amount -= mostNeeder.amount; + haversSorted.push(mostHaver); + } else { + minimizedDistribution.push({ amount: mostNeeder.amount, fromMemberID: mostHaver.memberID, toMemberID: mostNeeder.memberID }); + } + } + return minimizedDistribution; + } + + // frontend/model/contracts/shared/currencies.js + var DECIMALS_MAX = 8; + function commaToDots(value) { + return typeof value === "string" ? value.replace(/,/, ".") : value.toString(); + } + function isNumeric(nr) { + return !isNaN(nr - parseFloat(nr)); + } + function isInDecimalsLimit(nr, decimalsMax) { + const decimals = nr.split(".")[1]; + return !decimals || decimals.length <= decimalsMax; + } + function validateMincome(value, decimalsMax) { + const nr = commaToDots(value); + return isNumeric(nr) && isInDecimalsLimit(nr, decimalsMax); + } + function decimalsOrInt(num, decimalsMax) { + return num.toFixed(decimalsMax).replace(/\.0+$/, ""); + } + function saferFloat(value) { + return parseFloat(value.toFixed(DECIMALS_MAX)); + } + function makeCurrency(options) { + const { symbol, symbolWithCode, decimalsMax, formatCurrency } = options; + return { + symbol, + symbolWithCode, + decimalsMax, + displayWithCurrency: (n) => formatCurrency(decimalsOrInt(n, decimalsMax)), + displayWithoutCurrency: (n) => decimalsOrInt(n, decimalsMax), + validate: (n) => validateMincome(n, decimalsMax) + }; + } + var currencies = { + USD: makeCurrency({ + symbol: "$", + symbolWithCode: "$ USD", + decimalsMax: 2, + formatCurrency: (amount) => "$" + amount + }), + EUR: makeCurrency({ + symbol: "\u20AC", + symbolWithCode: "\u20AC EUR", + decimalsMax: 2, + formatCurrency: (amount) => "\u20AC" + amount + }), + BTC: makeCurrency({ + symbol: "\u0243", + symbolWithCode: "\u0243 BTC", + decimalsMax: DECIMALS_MAX, + formatCurrency: (amount) => amount + "\u0243" + }) + }; + var currencies_default = currencies; + + // frontend/model/contracts/shared/distribution/distribution.js + var tinyNum = 1 / Math.pow(10, DECIMALS_MAX); + function unadjustedDistribution({ haveNeeds = [], minimize = true }) { + const distribution = mincomeProportional(haveNeeds); + return minimize ? minimizeTotalPaymentsCount(distribution) : distribution; + } + function adjustedDistribution({ distribution, payments, dueOn }) { + distribution = cloneDeep(distribution); + for (const todo of distribution) { + todo.total = todo.amount; + } + distribution = subtractDistributions(distribution, payments).filter((todo) => todo.amount >= tinyNum); + for (const todo of distribution) { + todo.amount = saferFloat(todo.amount); + todo.total = saferFloat(todo.total); + todo.partial = todo.total !== todo.amount; + todo.isLate = false; + todo.dueOn = dueOn; + } + return distribution; + } + function reduceDistribution(payments) { + payments = cloneDeep(payments); + for (let i = 0; i < payments.length; i++) { + const paymentA = payments[i]; + for (let j = i + 1; j < payments.length; j++) { + const paymentB = payments[j]; + if (paymentA.fromMemberID === paymentB.fromMemberID && paymentA.toMemberID === paymentB.toMemberID || paymentA.toMemberID === paymentB.fromMemberID && paymentA.fromMemberID === paymentB.toMemberID) { + paymentA.amount += (paymentA.fromMemberID === paymentB.fromMemberID ? 1 : -1) * paymentB.amount; + paymentA.total += (paymentA.fromMemberID === paymentB.fromMemberID ? 1 : -1) * paymentB.total; + payments.splice(j, 1); + j--; + } + } + } + return payments; + } + function addDistributions(paymentsA, paymentsB) { + return reduceDistribution([...paymentsA, ...paymentsB]); + } + function subtractDistributions(paymentsA, paymentsB) { + paymentsB = cloneDeep(paymentsB); + for (const p of paymentsB) { + p.amount *= -1; + p.total *= -1; + } + return addDistributions(paymentsA, paymentsB); + } + + // frontend/model/contracts/shared/functions.js + var import_sbp5 = __toESM(__require("@sbp/sbp")); + + // frontend/model/contracts/shared/time.js + var MINS_MILLIS = 6e4; + var HOURS_MILLIS = 60 * MINS_MILLIS; + var DAYS_MILLIS = 24 * HOURS_MILLIS; + var MONTHS_MILLIS = 30 * DAYS_MILLIS; + var YEARS_MILLIS = 365 * DAYS_MILLIS; + var plusOnePeriodLength = (timestamp, periodLength) => dateToPeriodStamp(addTimeToDate(timestamp, periodLength)); + var minusOnePeriodLength = (timestamp, periodLength) => dateToPeriodStamp(addTimeToDate(timestamp, -periodLength)); + function periodStampsForDate(date, { knownSortedStamps, periodLength, guess }) { + if (!(isIsoString(date) || Object.prototype.toString.call(date) === "[object Date]")) { + throw new TypeError("must be ISO string or Date object"); + } + const timestamp = typeof date === "string" ? date : date.toISOString(); + let previous, current, next; + if (knownSortedStamps.length) { + const latest = knownSortedStamps[knownSortedStamps.length - 1]; + const earliest = knownSortedStamps[0]; + if (timestamp >= latest) { + current = periodStampGivenDate({ recentDate: timestamp, periodStart: latest, periodLength }); + next = plusOnePeriodLength(current, periodLength); + previous = current > latest ? minusOnePeriodLength(current, periodLength) : knownSortedStamps[knownSortedStamps.length - 2]; + } else if (guess && timestamp < earliest) { + current = periodStampGivenDate({ recentDate: timestamp, periodStart: earliest, periodLength }); + next = plusOnePeriodLength(current, periodLength); + previous = minusOnePeriodLength(current, periodLength); + } else { + for (let i = knownSortedStamps.length - 2; i >= 0; i--) { + if (timestamp >= knownSortedStamps[i]) { + current = knownSortedStamps[i]; + next = knownSortedStamps[i + 1]; + previous = i > 0 ? knownSortedStamps[i - 1] : guess ? minusOnePeriodLength(current, periodLength) : void 0; + break; + } + } + } + } + return { previous, current, next }; + } + function dateToPeriodStamp(date) { + return new Date(date).toISOString(); + } + function dateFromPeriodStamp(daystamp) { + return new Date(daystamp); + } + function periodStampGivenDate({ recentDate, periodStart, periodLength }) { + const periodStartDate = dateFromPeriodStamp(periodStart); + let nextPeriod = addTimeToDate(periodStartDate, periodLength); + const curDate = new Date(recentDate); + let curPeriod; + if (curDate < nextPeriod) { + if (curDate >= periodStartDate) { + return periodStart; + } else { + curPeriod = periodStartDate; + do { + curPeriod = addTimeToDate(curPeriod, -periodLength); + } while (curDate < curPeriod); + } + } else { + do { + curPeriod = nextPeriod; + nextPeriod = addTimeToDate(nextPeriod, periodLength); + } while (curDate >= nextPeriod); + } + return dateToPeriodStamp(curPeriod); + } + function dateIsWithinPeriod({ date, periodStart, periodLength }) { + const dateObj = new Date(date); + const start = dateFromPeriodStamp(periodStart); + return dateObj > start && dateObj < addTimeToDate(start, periodLength); + } + function addTimeToDate(date, timeMillis) { + const d = new Date(date); + d.setTime(d.getTime() + timeMillis); + return d; + } + function comparePeriodStamps(periodA, periodB) { + return dateFromPeriodStamp(periodA).getTime() - dateFromPeriodStamp(periodB).getTime(); + } + function isPeriodStamp(arg) { + return isIsoString(arg); + } + function isIsoString(arg) { + return typeof arg === "string" && /\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/.test(arg); + } + + // frontend/model/contracts/shared/functions.js + function paymentHashesFromPaymentPeriod(periodPayments) { + let hashes = []; + if (periodPayments) { + const { paymentsFrom } = periodPayments; + for (const fromMemberID in paymentsFrom) { + for (const toMemberID in paymentsFrom[fromMemberID]) { + hashes = hashes.concat(paymentsFrom[fromMemberID][toMemberID]); + } + } + } + return hashes; + } + function createPaymentInfo(paymentHash, payment) { + return { + fromMemberID: payment.data.fromMemberID, + toMemberID: payment.data.toMemberID, + hash: paymentHash, + amount: payment.data.amount, + isLate: !!payment.data.isLate, + when: payment.data.completedDate + }; + } + var referenceTally = (selector) => { + const delta = { + "retain": 1, + "release": -1 + }; + return { + [selector]: (parentContractID, childContractIDs, op) => { + if (!Array.isArray(childContractIDs)) + childContractIDs = [childContractIDs]; + if (op !== "retain" && op !== "release") + throw new Error("Invalid operation"); + for (const childContractID of childContractIDs) { + const key = `${selector}-${parentContractID}-${childContractID}`; + const count = (0, import_sbp5.default)("okTurtles.data/get", key); + (0, import_sbp5.default)("okTurtles.data/set", key, (count || 0) + delta[op]); + if (count != null) + return; + (0, import_sbp5.default)("chelonia/queueInvocation", parentContractID, () => { + const count2 = (0, import_sbp5.default)("okTurtles.data/get", key); + (0, import_sbp5.default)("okTurtles.data/delete", key); + if (count2 && count2 !== Math.sign(count2)) { + console.warn(`[${selector}] Unexpected value`, parentContractID, childContractID, count2); + if ("") { + Promise.reject(new Error(`[${selector}] Unexpected value ${parentContractID} ${childContractID}: ${count2}`)); + } + } + switch (Math.sign(count2)) { + case -1: + (0, import_sbp5.default)("chelonia/contract/release", childContractID).catch((e) => { + console.error(`[${selector}] Error calling release`, parentContractID, childContractID, e); + }); + break; + case 1: + (0, import_sbp5.default)("chelonia/contract/retain", childContractID).catch((e) => console.error(`[${selector}] Error calling retain`, parentContractID, childContractID, e)); + break; + } + }).catch((e) => { + console.error(`[${selector}] Error in queued invocation`, parentContractID, childContractID, e); + }); + } + } + }; + }; + + // frontend/model/contracts/shared/payments/index.js + var PAYMENT_PENDING = "pending"; + var PAYMENT_CANCELLED = "cancelled"; + var PAYMENT_ERROR = "error"; + var PAYMENT_NOT_RECEIVED = "not-received"; + var PAYMENT_COMPLETED = "completed"; + var paymentStatusType = unionOf(...[PAYMENT_PENDING, PAYMENT_CANCELLED, PAYMENT_ERROR, PAYMENT_NOT_RECEIVED, PAYMENT_COMPLETED].map((k) => literalOf(k))); + var PAYMENT_TYPE_MANUAL = "manual"; + var PAYMENT_TYPE_BITCOIN = "bitcoin"; + var PAYMENT_TYPE_PAYPAL = "paypal"; + var paymentType = unionOf(...[PAYMENT_TYPE_MANUAL, PAYMENT_TYPE_BITCOIN, PAYMENT_TYPE_PAYPAL].map((k) => literalOf(k))); + + // frontend/model/contracts/shared/getters/group.js + var group_default = { + currentGroupOwnerID(state, getters) { + return getters.currentGroupState.groupOwnerID; + }, + groupSettingsForGroup(state, getters) { + return (state2) => state2.settings || {}; + }, + groupSettings(state, getters) { + return getters.groupSettingsForGroup(getters.currentGroupState); + }, + profileActive(state, getters) { + return (member) => { + const profiles = getters.currentGroupState.profiles; + return profiles?.[member]?.status === PROFILE_STATUS.ACTIVE; + }; + }, + pendingAccept(state, getters) { + return (member) => { + const profiles = getters.currentGroupState.profiles; + return profiles?.[member]?.status === PROFILE_STATUS.PENDING; + }; + }, + groupProfileForGroup(state, getters) { + return (state2, member) => { + const profiles = state2.profiles; + return profiles && profiles[member] && { + ...profiles[member], + get lastLoggedIn() { + return getters.currentGroupLastLoggedIn[member] || this.joinedDate; + } + }; + }; + }, + groupProfile(state, getters) { + return (member) => getters.groupProfileForGroup(getters.currentGroupState, member); + }, + groupProfilesForGroup(state, getters) { + return (state2) => { + const profiles = {}; + for (const member in state2.profiles || {}) { + const profile = getters.groupProfileForGroup(state2, member); + if (profile.status === PROFILE_STATUS.ACTIVE) { + profiles[member] = profile; + } + } + return profiles; + }; + }, + groupProfiles(state, getters) { + return getters.groupProfilesForGroup(getters.currentGroupState); + }, + groupCreatedDate(state, getters) { + return getters.groupProfile(getters.currentGroupOwnerID).joinedDate; + }, + groupMincomeAmountForGroup(state, getters) { + return (state2) => getters.groupSettingsForGroup(state2).mincomeAmount; + }, + groupMincomeAmount(state, getters) { + return getters.groupMincomeAmountForGroup(getters.currentGroupState); + }, + groupMincomeCurrency(state, getters) { + return getters.groupSettings.mincomeCurrency; + }, + groupSortedPeriodKeysForGroup(state, getters) { + return (state2) => { + const { distributionDate, distributionPeriodLength } = getters.groupSettingsForGroup(state2); + if (!distributionDate) + return []; + const keys = Object.keys(getters.groupPeriodPaymentsForGroup(state2)).sort(); + if (!keys.length && MAX_SAVED_PERIODS > 0) { + keys.push(dateToPeriodStamp(addTimeToDate(distributionDate, -distributionPeriodLength))); + } + if (keys[keys.length - 1] !== distributionDate) { + keys.push(distributionDate); + } + return keys; + }; + }, + groupSortedPeriodKeys(state, getters) { + return getters.groupSortedPeriodKeysForGroup(getters.currentGroupState); + }, + periodStampGivenDateForGroup(state, getters) { + return (state2, date, periods) => { + return periodStampsForDate(date, { + knownSortedStamps: periods || getters.groupSortedPeriodKeysForGroup(state2), + periodLength: getters.groupSettingsForGroup(state2).distributionPeriodLength + }).current; + }; + }, + periodStampGivenDate(state, getters) { + return (date, periods) => { + return getters.periodStampGivenDateForGroup(getters.currentGroupState, date, periods); + }; + }, + periodBeforePeriodForGroup(state, getters) { + return (groupState, periodStamp, periods) => { + return periodStampsForDate(periodStamp, { + knownSortedStamps: periods || getters.groupSortedPeriodKeysForGroup(groupState), + periodLength: getters.groupSettingsForGroup(groupState).distributionPeriodLength + }).previous; + }; + }, + periodBeforePeriod(state, getters) { + return (periodStamp, periods) => getters.periodBeforePeriodForGroup(getters.currentGroupState, periodStamp, periods); + }, + periodAfterPeriodForGroup(state, getters) { + return (groupState, periodStamp, periods) => { + return periodStampsForDate(periodStamp, { + knownSortedStamps: periods || getters.groupSortedPeriodKeysForGroup(groupState), + periodLength: getters.groupSettingsForGroup(groupState).distributionPeriodLength + }).next; + }; + }, + periodAfterPeriod(state, getters) { + return (periodStamp, periods) => getters.periodAfterPeriodForGroup(getters.currentGroupState, periodStamp, periods); + }, + dueDateForPeriodForGroup(state, getters) { + return (state2, periodStamp, periods) => { + return getters.periodAfterPeriodForGroup(state2, periodStamp, periods); + }; + }, + dueDateForPeriod(state, getters) { + return (periodStamp, periods) => { + return getters.dueDateForPeriodForGroup(getters.currentGroupState, periodStamp, periods); + }; + }, + paymentHashesForPeriodForGroup(state, getters) { + return (state2, periodStamp) => { + const periodPayments = getters.groupPeriodPaymentsForGroup(state2)[periodStamp]; + if (periodPayments) { + return paymentHashesFromPaymentPeriod(periodPayments); + } + }; + }, + paymentHashesForPeriod(state, getters) { + return (periodStamp) => { + return getters.paymentHashesForPeriodForGroup(getters.currentGroupState, periodStamp); + }; + }, + groupMembersByContractID(state, getters) { + return Object.keys(getters.groupProfiles); + }, + groupMembersCount(state, getters) { + return getters.groupMembersByContractID.length; + }, + groupMembersPending(state, getters) { + const invites = getters.currentGroupState.invites; + const vmInvites = getters.currentGroupState._vm.invites; + const pendingMembers = /* @__PURE__ */ Object.create(null); + for (const inviteKeyId in invites) { + if (vmInvites[inviteKeyId].status === INVITE_STATUS.VALID && invites[inviteKeyId].creatorID !== INVITE_INITIAL_CREATOR) { + pendingMembers[inviteKeyId] = { + displayName: invites[inviteKeyId].invitee, + invitedBy: invites[inviteKeyId].creatorID, + expires: vmInvites[inviteKeyId].expires + }; + } + } + return pendingMembers; + }, + groupShouldPropose(state, getters) { + return getters.groupMembersCount >= 3; + }, + groupDistributionStarted(state, getters) { + return (currentDate) => currentDate >= getters.groupSettings?.distributionDate; + }, + groupProposalSettings(state, getters) { + return (proposalType2 = PROPOSAL_GENERIC) => { + return getters.groupSettings.proposals?.[proposalType2]; + }; + }, + groupCurrency(state, getters) { + const mincomeCurrency = getters.groupMincomeCurrency; + return mincomeCurrency && currencies_default[mincomeCurrency]; + }, + groupMincomeFormatted(state, getters) { + return getters.withGroupCurrency?.(getters.groupMincomeAmount); + }, + groupMincomeSymbolWithCode(state, getters) { + return getters.groupCurrency?.symbolWithCode; + }, + groupPeriodPaymentsForGroup(state, getters) { + return (state2) => { + return state2.paymentsByPeriod || {}; + }; + }, + groupPeriodPayments(state, getters) { + return getters.groupPeriodPaymentsForGroup(getters.currentGroupState); + }, + groupThankYousFrom(state, getters) { + return getters.currentGroupState.thankYousFrom || {}; + }, + groupStreaks(state, getters) { + return getters.currentGroupState.streaks || {}; + }, + groupTotalPledgeAmount(state, getters) { + return getters.currentGroupState.totalPledgeAmount || 0; + }, + withGroupCurrency(state, getters) { + return getters.groupCurrency?.displayWithCurrency; + }, + groupChatRooms(state, getters) { + return getters.currentGroupState.chatRooms; + }, + groupGeneralChatRoomId(state, getters) { + return getters.currentGroupState.generalChatRoomId; + }, + haveNeedsForThisPeriodForGroup(state, getters) { + return (state2, currentPeriod) => { + const groupProfiles = getters.groupProfilesForGroup(state2); + const haveNeeds = []; + for (const memberID in groupProfiles) { + const { incomeDetailsType, joinedDate } = groupProfiles[memberID]; + if (incomeDetailsType) { + const amount = groupProfiles[memberID][incomeDetailsType]; + const haveNeed = incomeDetailsType === "incomeAmount" ? amount - getters.groupMincomeAmountForGroup(state2) : amount; + let when = dateFromPeriodStamp(currentPeriod).toISOString(); + if (dateIsWithinPeriod({ + date: joinedDate, + periodStart: currentPeriod, + periodLength: getters.groupSettingsForGroup(state2).distributionPeriodLength + })) { + when = joinedDate; + } + haveNeeds.push({ memberID, haveNeed, when }); + } + } + return haveNeeds; + }; + }, + haveNeedsForThisPeriod(state, getters) { + return (currentPeriod) => { + return getters.haveNeedsForThisPeriodForGroup(getters.currentGroupState, currentPeriod); + }; + }, + paymentsForPeriodForGroup(state, getters) { + return (state2, periodStamp) => { + const hashes = getters.paymentHashesForPeriodForGroup(state2, periodStamp); + const events = []; + if (hashes && hashes.length > 0) { + const payments = state2.payments; + for (const paymentHash of hashes) { + const payment = payments[paymentHash]; + if (payment.data.status === PAYMENT_COMPLETED) { + events.push(createPaymentInfo(paymentHash, payment)); + } + } + } + return events; + }; + }, + paymentsForPeriod(state, getters) { + return (periodStamp) => { + return getters.paymentsForPeriodForGroup(getters.currentGroupState, periodStamp); + }; + } + }; + + // frontend/model/contracts/shared/types.js + var inviteType = objectOf({ + inviteKeyId: string, + creatorID: string, + invitee: optional(string) + }); + var chatRoomAttributesType = objectOf({ + name: stringMax(CHATROOM_NAME_LIMITS_IN_CHARS), + description: stringMax(CHATROOM_DESCRIPTION_LIMITS_IN_CHARS), + creatorID: optional(string), + adminIDs: optional(arrayOf(string)), + type: unionOf(...Object.values(CHATROOM_TYPES).map((v) => literalOf(v))), + privacyLevel: unionOf(...Object.values(CHATROOM_PRIVACY_LEVEL).map((v) => literalOf(v))) + }); + var messageType = objectMaybeOf({ + type: unionOf(...Object.values(MESSAGE_TYPES).map((v) => literalOf(v))), + text: string, + proposal: objectOf({ + proposalId: string, + proposalType: string, + proposalData: object, + expires_date_ms: number, + createdDate: string, + creatorID: string, + status: unionOf(...[ + STATUS_OPEN, + STATUS_PASSED, + STATUS_FAILED, + STATUS_EXPIRING, + STATUS_EXPIRED, + STATUS_CANCELLED + ].map((v) => literalOf(v))) + }), + notification: objectMaybeOf({ + type: unionOf(...Object.values(MESSAGE_NOTIFICATIONS).map((v) => literalOf(v))), + params: mapOf(string, string) + }), + attachments: optional(arrayOf(objectOf({ + name: string, + mimeType: string, + size: numberRange(1, Number.MAX_SAFE_INTEGER), + dimension: optional(objectOf({ + width: number, + height: number + })), + downloadData: objectOf({ + manifestCid: string, + downloadParams: optional(object) + }) + }))), + replyingMessage: objectOf({ + hash: string, + text: string + }), + pollData: objectOf({ + question: string, + options: arrayOf(objectOf({ id: string, value: string })), + expires_date_ms: number, + hideVoters: boolean, + pollType: unionOf(...Object.values(POLL_TYPES).map((v) => literalOf(v))) + }), + onlyVisibleTo: arrayOf(string) + }); + + // frontend/model/contracts/shared/voting/proposals.js + var import_sbp6 = __toESM(__require("@sbp/sbp")); + + // frontend/model/contracts/shared/voting/rules.js + var VOTE_AGAINST = ":against"; + var VOTE_INDIFFERENT = ":indifferent"; + var VOTE_UNDECIDED = ":undecided"; + var VOTE_FOR = ":for"; + var RULE_PERCENTAGE = "percentage"; + var RULE_DISAGREEMENT = "disagreement"; + var RULE_MULTI_CHOICE = "multi-choice"; + var getPopulation = (state) => Object.keys(state.profiles).filter((p) => state.profiles[p].status === PROFILE_STATUS.ACTIVE).length; + var rules = { + [RULE_PERCENTAGE]: function(state, proposalType2, votes) { + votes = Object.values(votes); + let population = getPopulation(state); + if (proposalType2 === PROPOSAL_REMOVE_MEMBER) + population -= 1; + const defaultThreshold = state.settings.proposals[proposalType2].ruleSettings[RULE_PERCENTAGE].threshold; + const threshold = getThresholdAdjusted(RULE_PERCENTAGE, defaultThreshold, population); + const totalIndifferent = votes.filter((x) => x === VOTE_INDIFFERENT).length; + const totalFor = votes.filter((x) => x === VOTE_FOR).length; + const totalAgainst = votes.filter((x) => x === VOTE_AGAINST).length; + const totalForOrAgainst = totalFor + totalAgainst; + const turnout = totalForOrAgainst + totalIndifferent; + const absent = population - turnout; + const neededToPass = Math.ceil(threshold * (population - totalIndifferent)); + console.debug(`votingRule ${RULE_PERCENTAGE} for ${proposalType2}:`, { neededToPass, totalFor, totalAgainst, totalIndifferent, threshold, absent, turnout, population }); + if (totalFor >= neededToPass) { + return VOTE_FOR; + } + return totalFor + absent < neededToPass ? VOTE_AGAINST : VOTE_UNDECIDED; + }, + [RULE_DISAGREEMENT]: function(state, proposalType2, votes) { + votes = Object.values(votes); + const population = getPopulation(state); + const minimumMax = proposalType2 === PROPOSAL_REMOVE_MEMBER ? 2 : 1; + const thresholdOriginal = Math.max(state.settings.proposals[proposalType2].ruleSettings[RULE_DISAGREEMENT].threshold, minimumMax); + const threshold = getThresholdAdjusted(RULE_DISAGREEMENT, thresholdOriginal, population); + const totalFor = votes.filter((x) => x === VOTE_FOR).length; + const totalAgainst = votes.filter((x) => x === VOTE_AGAINST).length; + const turnout = votes.length; + const absent = population - turnout; + console.debug(`votingRule ${RULE_DISAGREEMENT} for ${proposalType2}:`, { totalFor, totalAgainst, threshold, turnout, population, absent }); + if (totalAgainst >= threshold) { + return VOTE_AGAINST; + } + return totalAgainst + absent < threshold ? VOTE_FOR : VOTE_UNDECIDED; + }, + [RULE_MULTI_CHOICE]: function(state, proposalType2, votes) { + throw new Error("unimplemented!"); + } + }; + var rules_default = rules; + var ruleType = unionOf(...Object.keys(rules).map((k) => literalOf(k))); + var voteType = unionOf(...[VOTE_AGAINST, VOTE_INDIFFERENT, VOTE_UNDECIDED, VOTE_FOR].map((v) => literalOf(v))); + var getThresholdAdjusted = (rule, threshold, groupSize) => { + const groupSizeVoting = Math.max(3, groupSize); + return { + [RULE_DISAGREEMENT]: () => { + return Math.min(groupSizeVoting - 1, threshold); + }, + [RULE_PERCENTAGE]: () => { + const minThreshold = 2 / groupSizeVoting; + return Math.max(minThreshold, threshold); + } + }[rule](); + }; + + // frontend/model/contracts/shared/voting/proposals.js + function notifyAndArchiveProposal({ state, proposalHash, proposal, contractID, meta, height }) { + delete state.proposals[proposalHash]; + (0, import_sbp6.default)("gi.contracts/group/pushSideEffect", contractID, ["gi.contracts/group/makeNotificationWhenProposalClosed", state, contractID, meta, height, proposalHash, proposal]); + (0, import_sbp6.default)("gi.contracts/group/pushSideEffect", contractID, ["gi.contracts/group/archiveProposal", contractID, proposalHash, proposal]); + } + var proposalSettingsType = objectOf({ + rule: ruleType, + expires_ms: number, + ruleSettings: objectOf({ + [RULE_PERCENTAGE]: objectOf({ threshold: number }), + [RULE_DISAGREEMENT]: objectOf({ threshold: number }) + }) + }); + function voteAgainst(state, { meta, data, contractID, height }) { + const { proposalHash } = data; + const proposal = state.proposals[proposalHash]; + proposal.status = STATUS_FAILED; + (0, import_sbp6.default)("okTurtles.events/emit", PROPOSAL_RESULT, state, VOTE_AGAINST, data); + notifyAndArchiveProposal({ state, proposalHash, proposal, contractID, meta, height }); + } + var proposalDefaults = { + rule: RULE_PERCENTAGE, + expires_ms: 14 * DAYS_MILLIS, + ruleSettings: { + [RULE_PERCENTAGE]: { threshold: 0.66 }, + [RULE_DISAGREEMENT]: { threshold: 1 } + } + }; + var proposals = { + [PROPOSAL_INVITE_MEMBER]: { + defaults: proposalDefaults, + [VOTE_FOR]: async function(state, message) { + const { data, contractID, meta, height } = message; + const { proposalHash } = data; + const proposal = state.proposals[proposalHash]; + proposal.payload = data.passPayload; + proposal.status = STATUS_PASSED; + const forMessage = { ...message, data: data.passPayload }; + await (0, import_sbp6.default)("gi.contracts/group/invite/process", forMessage, state); + (0, import_sbp6.default)("okTurtles.events/emit", PROPOSAL_RESULT, state, VOTE_FOR, data); + notifyAndArchiveProposal({ state, proposalHash, proposal, contractID, meta, height }); + }, + [VOTE_AGAINST]: voteAgainst + }, + [PROPOSAL_REMOVE_MEMBER]: { + defaults: proposalDefaults, + [VOTE_FOR]: async function(state, message) { + const { data, contractID, meta, height } = message; + const { proposalHash, passPayload } = data; + const proposal = state.proposals[proposalHash]; + proposal.status = STATUS_PASSED; + proposal.payload = passPayload; + const messageData = proposal.data.proposalData; + const forMessage = { ...message, data: messageData, proposalHash }; + await (0, import_sbp6.default)("gi.contracts/group/removeMember/process", forMessage, state); + (0, import_sbp6.default)("gi.contracts/group/pushSideEffect", contractID, ["gi.contracts/group/removeMember/sideEffect", forMessage]); + notifyAndArchiveProposal({ state, proposalHash, proposal, contractID, meta, height }); + }, + [VOTE_AGAINST]: voteAgainst + }, + [PROPOSAL_GROUP_SETTING_CHANGE]: { + defaults: proposalDefaults, + [VOTE_FOR]: async function(state, message) { + const { data, contractID, meta, height } = message; + const { proposalHash } = data; + const proposal = state.proposals[proposalHash]; + proposal.status = STATUS_PASSED; + const { setting, proposedValue } = proposal.data.proposalData; + const forMessage = { + ...message, + data: { [setting]: proposedValue }, + proposalHash + }; + await (0, import_sbp6.default)("gi.contracts/group/updateSettings/process", forMessage, state); + (0, import_sbp6.default)("gi.contracts/group/pushSideEffect", contractID, ["gi.contracts/group/updateSettings/sideEffect", forMessage]); + notifyAndArchiveProposal({ state, proposalHash, proposal, contractID, meta, height }); + }, + [VOTE_AGAINST]: voteAgainst + }, + [PROPOSAL_PROPOSAL_SETTING_CHANGE]: { + defaults: proposalDefaults, + [VOTE_FOR]: async function(state, message) { + const { data, contractID, meta, height } = message; + const { proposalHash } = data; + const proposal = state.proposals[proposalHash]; + proposal.status = STATUS_PASSED; + const forMessage = { + ...message, + data: proposal.data.proposalData, + proposalHash + }; + await (0, import_sbp6.default)("gi.contracts/group/updateAllVotingRules/process", forMessage, state); + notifyAndArchiveProposal({ state, proposalHash, proposal, contractID, meta, height }); + }, + [VOTE_AGAINST]: voteAgainst + }, + [PROPOSAL_GENERIC]: { + defaults: proposalDefaults, + [VOTE_FOR]: function(state, { data, contractID, meta, height }) { + const { proposalHash } = data; + const proposal = state.proposals[proposalHash]; + proposal.status = STATUS_PASSED; + (0, import_sbp6.default)("okTurtles.events/emit", PROPOSAL_RESULT, state, VOTE_FOR, data); + notifyAndArchiveProposal({ state, proposalHash, proposal, contractID, meta, height }); + }, + [VOTE_AGAINST]: voteAgainst + } + }; + var proposals_default = proposals; + var proposalType = unionOf(...Object.keys(proposals).map((k) => literalOf(k))); + + // frontend/model/contracts/group.js + function fetchInitKV(obj, key, initialValue) { + let value = obj[key]; + if (!value) { + obj[key] = initialValue; + value = obj[key]; + } + return value; + } + function initGroupProfile(joinedDate, joinedHeight, reference) { + return { + globalUsername: "", + joinedDate, + joinedHeight, + reference, + nonMonetaryContributions: [], + status: PROFILE_STATUS.ACTIVE, + departedDate: null, + incomeDetailsLastUpdatedDate: null + }; + } + function initPaymentPeriod({ meta, getters }) { + const start = getters.periodStampGivenDate(meta.createdDate); + return { + start, + end: plusOnePeriodLength(start, getters.groupSettings.distributionPeriodLength), + initialCurrency: getters.groupMincomeCurrency, + mincomeExchangeRate: 1, + paymentsFrom: {}, + lastAdjustedDistribution: null, + haveNeedsSnapshot: null + }; + } + function clearOldPayments({ contractID, state, getters }) { + const sortedPeriodKeys = Object.keys(state.paymentsByPeriod).sort(); + const archivingPayments = { paymentsByPeriod: {}, payments: {} }; + while (sortedPeriodKeys.length > MAX_SAVED_PERIODS) { + const period = sortedPeriodKeys.shift(); + archivingPayments.paymentsByPeriod[period] = cloneDeep(state.paymentsByPeriod[period]); + for (const paymentHash of getters.paymentHashesForPeriod(period)) { + archivingPayments.payments[paymentHash] = cloneDeep(state.payments[paymentHash]); + delete state.payments[paymentHash]; + } + delete state.paymentsByPeriod[period]; + } + delete archivingPayments.paymentsByPeriod[state.waitingPeriod]; + (0, import_sbp7.default)("gi.contracts/group/pushSideEffect", contractID, ["gi.contracts/group/archivePayments", contractID, archivingPayments]); + } + function initFetchPeriodPayments({ contractID, meta, state, getters }) { + const period = getters.periodStampGivenDate(meta.createdDate); + const periodPayments = fetchInitKV(state.paymentsByPeriod, period, initPaymentPeriod({ meta, getters })); + const previousPeriod = getters.periodBeforePeriod(period); + if (previousPeriod in state.paymentsByPeriod) { + state.paymentsByPeriod[previousPeriod].end = period; + } + clearOldPayments({ contractID, state, getters }); + return periodPayments; + } + function initGroupStreaks() { + return { + lastStreakPeriod: null, + fullMonthlyPledges: 0, + fullMonthlySupport: 0, + onTimePayments: {}, + missedPayments: {}, + noVotes: {} + }; + } + function updateCurrentDistribution({ contractID, meta, state, getters }) { + const curPeriodPayments = initFetchPeriodPayments({ contractID, meta, state, getters }); + const period = getters.periodStampGivenDate(meta.createdDate); + const noPayments = Object.keys(curPeriodPayments.paymentsFrom).length === 0; + if (comparePeriodStamps(period, getters.groupSettings.distributionDate) > 0) { + updateGroupStreaks({ state, getters }); + getters.groupSettings.distributionDate = period; + } + if (noPayments || !curPeriodPayments.haveNeedsSnapshot) { + curPeriodPayments.haveNeedsSnapshot = getters.haveNeedsForThisPeriod(period); + } + if (!noPayments) { + updateAdjustedDistribution({ period, getters }); + } + } + function updateAdjustedDistribution({ period, getters }) { + const payments = getters.groupPeriodPayments[period]; + if (payments && payments.haveNeedsSnapshot) { + const minimize = getters.groupSettings.minimizeDistribution; + payments.lastAdjustedDistribution = adjustedDistribution({ + distribution: unadjustedDistribution({ haveNeeds: payments.haveNeedsSnapshot, minimize }), + payments: getters.paymentsForPeriod(period), + dueOn: getters.dueDateForPeriod(period) + }).filter((todo) => { + return getters.groupProfile(todo.toMemberID).status === PROFILE_STATUS.ACTIVE; + }); + } + } + function memberLeaves({ memberID, dateLeft, heightLeft, ourselvesLeaving }, { contractID, meta, state, getters }) { + if (!state.profiles[memberID] || state.profiles[memberID].status !== PROFILE_STATUS.ACTIVE) { + throw new Error(`[gi.contracts/group memberLeaves] Can't remove non-exisiting member ${memberID}`); + } + state.profiles[memberID].status = PROFILE_STATUS.REMOVED; + state.profiles[memberID].departedDate = dateLeft; + state.profiles[memberID].departedHeight = heightLeft; + updateCurrentDistribution({ contractID, meta, state, getters }); + Object.keys(state.chatRooms).forEach((chatroomID) => { + removeGroupChatroomProfile(state, chatroomID, memberID, ourselvesLeaving); + }); + if (!state._volatile) + state["_volatile"] = /* @__PURE__ */ Object.create(null); + if (!state._volatile.pendingKeyRevocations) + state._volatile["pendingKeyRevocations"] = /* @__PURE__ */ Object.create(null); + const CSKid = findKeyIdByName(state, "csk"); + const CEKid = findKeyIdByName(state, "cek"); + state._volatile.pendingKeyRevocations[CSKid] = true; + state._volatile.pendingKeyRevocations[CEKid] = true; + } + function isActionNewerThanUserJoinedDate(height, userProfile) { + if (!userProfile) { + return false; + } + return userProfile.status === PROFILE_STATUS.ACTIVE && userProfile.joinedHeight < height; + } + function updateGroupStreaks({ state, getters }) { + const streaks = fetchInitKV(state, "streaks", initGroupStreaks()); + const cPeriod = getters.groupSettings.distributionDate; + const thisPeriodPayments = getters.groupPeriodPayments[cPeriod]; + const noPaymentsAtAll = !thisPeriodPayments; + if (streaks.lastStreakPeriod === cPeriod) + return; + else { + streaks["lastStreakPeriod"] = cPeriod; + } + const thisPeriodDistribution = thisPeriodPayments?.lastAdjustedDistribution || adjustedDistribution({ + distribution: unadjustedDistribution({ + haveNeeds: getters.haveNeedsForThisPeriod(cPeriod), + minimize: getters.groupSettings.minimizeDistribution + }) || [], + payments: getters.paymentsForPeriod(cPeriod), + dueOn: getters.dueDateForPeriod(cPeriod) + }).filter((todo) => { + return getters.groupProfile(todo.toMemberID).status === PROFILE_STATUS.ACTIVE; + }); + streaks["fullMonthlyPledges"] = noPaymentsAtAll ? 0 : thisPeriodDistribution.length === 0 ? streaks.fullMonthlyPledges + 1 : 0; + const thisPeriodPaymentDetails = getters.paymentsForPeriod(cPeriod); + const thisPeriodHaveNeeds = thisPeriodPayments?.haveNeedsSnapshot || getters.haveNeedsForThisPeriod(cPeriod); + const filterMyItems = (array, member) => array.filter((item) => item.fromMemberID === member); + const isPledgingMember = (member) => thisPeriodHaveNeeds.some((entry) => entry.memberID === member && entry.haveNeed > 0); + const totalContributionGoal = thisPeriodHaveNeeds.reduce((total, item) => item.haveNeed < 0 ? total + -1 * item.haveNeed : total, 0); + const totalPledgesDone = thisPeriodPaymentDetails.reduce((total, paymentItem) => paymentItem.amount + total, 0); + const fullMonthlySupportCurrent = fetchInitKV(streaks, "fullMonthlySupport", 0); + streaks["fullMonthlySupport"] = totalPledgesDone > 0 && totalPledgesDone >= totalContributionGoal ? fullMonthlySupportCurrent + 1 : 0; + for (const memberID in getters.groupProfiles) { + if (!isPledgingMember(memberID)) + continue; + const myMissedPaymentsInThisPeriod = filterMyItems(thisPeriodDistribution, memberID); + const userCurrentStreak = fetchInitKV(streaks.onTimePayments, memberID, 0); + streaks.onTimePayments[memberID] = noPaymentsAtAll ? 0 : myMissedPaymentsInThisPeriod.length === 0 && filterMyItems(thisPeriodPaymentDetails, memberID).every((p) => p.isLate === false) ? userCurrentStreak + 1 : 0; + const myMissedPaymentsStreak = fetchInitKV(streaks.missedPayments, memberID, 0); + streaks.missedPayments[memberID] = noPaymentsAtAll ? myMissedPaymentsStreak + 1 : myMissedPaymentsInThisPeriod.length >= 1 ? myMissedPaymentsStreak + 1 : 0; + } + } + var removeGroupChatroomProfile = (state, chatRoomID, memberID, ourselvesLeaving) => { + if (!state.chatRooms[chatRoomID].members[memberID]) + return; + state.chatRooms[chatRoomID].members[memberID].status = PROFILE_STATUS.REMOVED; + }; + var leaveChatRoomAction = async (groupID, state, chatRoomID, memberID, actorID, leavingGroup) => { + const sendingData = leavingGroup || actorID !== memberID ? { memberID } : {}; + if (state?.chatRooms?.[chatRoomID]?.members?.[memberID]?.status !== PROFILE_STATUS.REMOVED) { + return; + } + const extraParams = {}; + if (leavingGroup) { + const encryptionKeyId = await (0, import_sbp7.default)("chelonia/contract/currentKeyIdByName", state, "cek", true); + const signingKeyId = await (0, import_sbp7.default)("chelonia/contract/currentKeyIdByName", state, "csk", true); + if (!signingKeyId) { + return; + } + extraParams.encryptionKeyId = encryptionKeyId; + extraParams.signingKeyId = signingKeyId; + extraParams.innerSigningContractID = null; + } + (0, import_sbp7.default)("gi.actions/chatroom/leave", { + contractID: chatRoomID, + data: sendingData, + ...extraParams + }).catch((e) => { + if (leavingGroup && (e?.name === "ChelErrorSignatureKeyNotFound" || e?.name === "GIErrorUIRuntimeError" && (["ChelErrorSignatureKeyNotFound", "GIErrorMissingSigningKeyError"].includes(e?.cause?.name) || e?.cause?.name === "GIChatroomNotMemberError"))) { + return; + } + console.warn("[gi.contracts/group] Error sending chatroom leave action", e); + }); + }; + var leaveAllChatRoomsUponLeaving = (groupID, state, memberID, actorID) => { + const chatRooms = state.chatRooms; + return Promise.all(Object.keys(chatRooms).filter((cID) => chatRooms[cID].members?.[memberID]?.status === PROFILE_STATUS.REMOVED).map((chatRoomID) => leaveChatRoomAction(groupID, state, chatRoomID, memberID, actorID, true))); + }; + var actionRequireActiveMember = (next) => (data, props) => { + const innerSigningContractID = props.message.innerSigningContractID; + if (!innerSigningContractID || innerSigningContractID === props.contractID) { + throw new Error("Missing inner signature"); + } + return next(data, props); + }; + var GIGroupAlreadyJoinedError = ChelErrorGenerator("GIGroupAlreadyJoinedError"); + var GIGroupNotJoinedError = ChelErrorGenerator("GIGroupNotJoinedError"); + (0, import_sbp7.default)("chelonia/defineContract", { + name: "gi.contracts/group", + metadata: { + validate: objectOf({ + createdDate: string + }), + async create() { + return { + createdDate: await fetchServerTime() + }; + } + }, + getters: { + currentGroupState(state) { + return state; + }, + currentGroupLastLoggedIn() { + return {}; + }, + ...group_default + }, + actions: { + "gi.contracts/group": { + validate: objectMaybeOf({ + settings: objectMaybeOf({ + groupName: stringMax(GROUP_NAME_MAX_CHAR, "groupName"), + groupPicture: unionOf(string, objectOf({ + manifestCid: stringMax(MAX_HASH_LEN, "manifestCid"), + downloadParams: optional(object) + })), + sharedValues: stringMax(GROUP_DESCRIPTION_MAX_CHAR, "sharedValues"), + mincomeAmount: numberRange(1, GROUP_MINCOME_MAX), + mincomeCurrency: stringMax(GROUP_CURRENCY_MAX_CHAR, "mincomeCurrency"), + distributionDate: validatorFrom(isPeriodStamp), + distributionPeriodLength: numberRange(1 * DAYS_MILLIS, GROUP_DISTRIBUTION_PERIOD_MAX_DAYS * DAYS_MILLIS), + minimizeDistribution: boolean, + proposals: objectOf({ + [PROPOSAL_INVITE_MEMBER]: proposalSettingsType, + [PROPOSAL_REMOVE_MEMBER]: proposalSettingsType, + [PROPOSAL_GROUP_SETTING_CHANGE]: proposalSettingsType, + [PROPOSAL_PROPOSAL_SETTING_CHANGE]: proposalSettingsType, + [PROPOSAL_GENERIC]: proposalSettingsType + }) + }) + }), + process({ data, meta, contractID }, { state, getters }) { + const initialState = merge({ + payments: {}, + paymentsByPeriod: {}, + thankYousFrom: {}, + invites: {}, + proposals: {}, + settings: { + distributionPeriodLength: 30 * DAYS_MILLIS, + inviteExpiryOnboarding: INVITE_EXPIRES_IN_DAYS.ON_BOARDING, + inviteExpiryProposal: INVITE_EXPIRES_IN_DAYS.PROPOSAL, + allowPublicChannels: false + }, + streaks: initGroupStreaks(), + profiles: {}, + chatRooms: {}, + totalPledgeAmount: 0 + }, data); + for (const key in initialState) { + state[key] = initialState[key]; + } + initFetchPeriodPayments({ contractID, meta, state, getters }); + state.waitingPeriod = getters.periodStampGivenDate(meta.createdDate); + }, + sideEffect({ contractID }, { state }) { + if (!state.generalChatRoomId) { + (0, import_sbp7.default)("chelonia/queueInvocation", contractID, async () => { + const state2 = await (0, import_sbp7.default)("chelonia/contract/state", contractID); + if (!state2 || state2.generalChatRoomId) + return; + const CSKid = findKeyIdByName(state2, "csk"); + const CEKid = findKeyIdByName(state2, "cek"); + (0, import_sbp7.default)("gi.actions/group/addChatRoom", { + contractID, + data: { + attributes: { + name: CHATROOM_GENERAL_NAME, + type: CHATROOM_TYPES.GROUP, + description: "", + privacyLevel: CHATROOM_PRIVACY_LEVEL.GROUP + } + }, + signingKeyId: CSKid, + encryptionKeyId: CEKid, + innerSigningContractID: null + }).catch((e) => { + console.error(`[gi.contracts/group/sideEffect] Error creating #General chatroom for ${contractID} (unable to send action)`, e); + }); + }).catch((e) => { + console.error(`[gi.contracts/group/sideEffect] Error creating #General chatroom for ${contractID}`, e); + }); + } + } + }, + "gi.contracts/group/payment": { + validate: actionRequireActiveMember(objectMaybeOf({ + toMemberID: stringMax(MAX_HASH_LEN, "toMemberID"), + amount: numberRange(0, GROUP_MINCOME_MAX), + currencyFromTo: tupleOf(string, string), + exchangeRate: numberRange(0, GROUP_MINCOME_MAX), + txid: stringMax(MAX_HASH_LEN, "txid"), + status: paymentStatusType, + paymentType, + details: optional(object), + memo: optional(stringMax(MAX_MEMO_LEN, "memo")) + })), + process({ data, meta, hash, contractID, height, innerSigningContractID }, { state, getters }) { + if (data.status === PAYMENT_COMPLETED) { + console.error(`payment: payment ${hash} cannot have status = 'completed'!`, { data, meta, hash }); + throw new errors_exports.GIErrorIgnoreAndBan("payments cannot be instantly completed!"); + } + state.payments[hash] = { + data: { + ...data, + fromMemberID: innerSigningContractID, + groupMincome: getters.groupMincomeAmount + }, + height, + meta, + history: [[meta.createdDate, hash]] + }; + const { paymentsFrom } = initFetchPeriodPayments({ contractID, meta, state, getters }); + const fromMemberID = fetchInitKV(paymentsFrom, innerSigningContractID, {}); + const toMemberID = fetchInitKV(fromMemberID, data.toMemberID, []); + toMemberID.push(hash); + } + }, + "gi.contracts/group/paymentUpdate": { + validate: actionRequireActiveMember(objectMaybeOf({ + paymentHash: stringMax(MAX_HASH_LEN, "paymentHash"), + updatedProperties: objectMaybeOf({ + status: paymentStatusType, + details: object, + memo: stringMax(MAX_MEMO_LEN, "memo") + }) + })), + process({ data, meta, hash, contractID, innerSigningContractID }, { state, getters }) { + const payment = state.payments[data.paymentHash]; + if (!payment) { + console.error(`paymentUpdate: no payment ${data.paymentHash}`, { data, meta, hash }); + throw new errors_exports.GIErrorIgnoreAndBan("paymentUpdate without existing payment"); + } + if (innerSigningContractID !== payment.data.fromMemberID && innerSigningContractID !== payment.data.toMemberID) { + console.error(`paymentUpdate: bad member ${innerSigningContractID} != ${payment.data.fromMemberID} != ${payment.data.toMemberID}`, { data, meta, hash }); + throw new errors_exports.GIErrorIgnoreAndBan("paymentUpdate from bad user!"); + } + payment.history.push([meta.createdDate, hash]); + merge(payment.data, data.updatedProperties); + if (data.updatedProperties.status === PAYMENT_COMPLETED) { + payment.data.completedDate = meta.createdDate; + const updatePeriodStamp = getters.periodStampGivenDate(meta.createdDate); + const paymentPeriodStamp = getters.periodStampGivenDate(payment.meta.createdDate); + if (comparePeriodStamps(updatePeriodStamp, paymentPeriodStamp) > 0) { + updateAdjustedDistribution({ period: paymentPeriodStamp, getters }); + } else { + updateCurrentDistribution({ contractID, meta, state, getters }); + } + const currentTotalPledgeAmount = fetchInitKV(state, "totalPledgeAmount", 0); + state.totalPledgeAmount = currentTotalPledgeAmount + payment.data.amount; + } + }, + sideEffect({ meta, contractID, height, data, innerSigningContractID }, { state, getters }) { + if (data.updatedProperties.status === PAYMENT_COMPLETED) { + const { loggedIn } = (0, import_sbp7.default)("state/vuex/state"); + const payment = state.payments[data.paymentHash]; + if (loggedIn.identityContractID === payment.data.toMemberID) { + const myProfile = getters.groupProfile(loggedIn.identityContractID); + if (isActionNewerThanUserJoinedDate(height, myProfile)) { + (0, import_sbp7.default)("gi.notifications/emit", "PAYMENT_RECEIVED", { + createdDate: meta.createdDate, + groupID: contractID, + creatorID: innerSigningContractID, + paymentHash: data.paymentHash, + amount: getters.withGroupCurrency(payment.data.amount) + }); + } + } + } + } + }, + "gi.contracts/group/sendPaymentThankYou": { + validate: actionRequireActiveMember(objectOf({ + toMemberID: stringMax(MAX_HASH_LEN, "toMemberID"), + memo: stringMax(MAX_MEMO_LEN, "memo") + })), + process({ data, innerSigningContractID }, { state }) { + const fromMemberID = fetchInitKV(state.thankYousFrom, innerSigningContractID, {}); + fromMemberID[data.toMemberID] = data.memo; + }, + sideEffect({ contractID, meta, height, data, innerSigningContractID }, { getters }) { + const { loggedIn } = (0, import_sbp7.default)("state/vuex/state"); + if (data.toMemberID === loggedIn.identityContractID) { + const myProfile = getters.groupProfile(loggedIn.identityContractID); + if (isActionNewerThanUserJoinedDate(height, myProfile)) { + (0, import_sbp7.default)("gi.notifications/emit", "PAYMENT_THANKYOU_SENT", { + createdDate: meta.createdDate, + groupID: contractID, + fromMemberID: innerSigningContractID, + toMemberID: data.toMemberID + }); + } + } + } + }, + "gi.contracts/group/proposal": { + validate: actionRequireActiveMember((data, { state }) => { + objectOf({ + proposalType, + proposalData: object, + votingRule: ruleType, + expires_date_ms: numberRange(0, Number.MAX_SAFE_INTEGER) + })(data); + const dataToCompare = omit(data.proposalData, ["reason"]); + for (const hash in state.proposals) { + const prop = state.proposals[hash]; + if (prop.status !== STATUS_OPEN || prop.data.proposalType !== data.proposalType) { + continue; + } + if (deepEqualJSONType(omit(prop.data.proposalData, ["reason"]), dataToCompare)) { + throw new TypeError(L("There is an identical open proposal.")); + } + } + }), + process({ data, meta, hash, height, innerSigningContractID }, { state }) { + state.proposals[hash] = { + data, + meta, + height, + creatorID: innerSigningContractID, + votes: { [innerSigningContractID]: VOTE_FOR }, + status: STATUS_OPEN, + notifiedBeforeExpire: false, + payload: null + }; + }, + sideEffect({ contractID, meta, hash, data, height, innerSigningContractID }, { getters }) { + const { loggedIn } = (0, import_sbp7.default)("state/vuex/state"); + const typeToSubTypeMap = { + [PROPOSAL_INVITE_MEMBER]: "ADD_MEMBER", + [PROPOSAL_REMOVE_MEMBER]: "REMOVE_MEMBER", + [PROPOSAL_GROUP_SETTING_CHANGE]: { + mincomeAmount: "CHANGE_MINCOME", + distributionDate: "CHANGE_DISTRIBUTION_DATE" + }[data.proposalData.setting], + [PROPOSAL_PROPOSAL_SETTING_CHANGE]: "CHANGE_VOTING_RULE", + [PROPOSAL_GENERIC]: "GENERIC" + }; + const myProfile = getters.groupProfile(loggedIn.identityContractID); + if (isActionNewerThanUserJoinedDate(height, myProfile)) { + (0, import_sbp7.default)("gi.notifications/emit", "NEW_PROPOSAL", { + createdDate: meta.createdDate, + groupID: contractID, + creatorID: innerSigningContractID, + proposalHash: hash, + subtype: typeToSubTypeMap[data.proposalType] + }); + } + } + }, + "gi.contracts/group/proposalVote": { + validate: actionRequireActiveMember(objectOf({ + proposalHash: stringMax(MAX_HASH_LEN, "proposalHash"), + vote: voteType, + passPayload: optional(unionOf(object, string)) + })), + async process(message, { state, getters }) { + const { data, hash, meta, innerSigningContractID } = message; + const proposal = state.proposals[data.proposalHash]; + if (!proposal) { + console.error(`proposalVote: no proposal for ${data.proposalHash}!`, { data, meta, hash }); + throw new errors_exports.GIErrorIgnoreAndBan("proposalVote without existing proposal"); + } + proposal.votes[innerSigningContractID] = data.vote; + if (new Date(meta.createdDate).getTime() > proposal.data.expires_date_ms) { + console.warn("proposalVote: vote on expired proposal!", { proposal, data, meta }); + return; + } + const result = rules_default[proposal.data.votingRule](state, proposal.data.proposalType, proposal.votes); + if (result === VOTE_FOR || result === VOTE_AGAINST) { + proposal["dateClosed"] = meta.createdDate; + await proposals_default[proposal.data.proposalType][result](state, message); + const votedMemberIDs = Object.keys(proposal.votes); + for (const memberID of getters.groupMembersByContractID) { + const memberCurrentStreak = fetchInitKV(getters.groupStreaks.noVotes, memberID, 0); + const memberHasVoted = votedMemberIDs.includes(memberID); + getters.groupStreaks.noVotes[memberID] = memberHasVoted ? 0 : memberCurrentStreak + 1; + } + } + } + }, + "gi.contracts/group/proposalCancel": { + validate: actionRequireActiveMember(objectOf({ + proposalHash: stringMax(MAX_HASH_LEN, "proposalHash") + })), + process({ data, meta, contractID, innerSigningContractID, height }, { state }) { + const proposal = state.proposals[data.proposalHash]; + if (!proposal) { + console.error(`proposalCancel: no proposal for ${data.proposalHash}!`, { data, meta }); + throw new errors_exports.GIErrorIgnoreAndBan("proposalVote without existing proposal"); + } else if (proposal.creatorID !== innerSigningContractID) { + console.error(`proposalCancel: proposal ${data.proposalHash} belongs to ${proposal.creatorID} not ${innerSigningContractID}!`, { data, meta }); + throw new errors_exports.GIErrorIgnoreAndBan("proposalWithdraw for wrong user!"); + } + proposal["status"] = STATUS_CANCELLED; + proposal["dateClosed"] = meta.createdDate; + notifyAndArchiveProposal({ state, proposalHash: data.proposalHash, proposal, contractID, meta, height }); + } + }, + "gi.contracts/group/markProposalsExpired": { + validate: actionRequireActiveMember(objectOf({ + proposalIds: arrayOf(stringMax(MAX_HASH_LEN)) + })), + process({ data, meta, contractID, height }, { state }) { + if (data.proposalIds.length) { + for (const proposalId of data.proposalIds) { + const proposal = state.proposals[proposalId]; + if (proposal) { + proposal["status"] = STATUS_EXPIRED; + proposal["dateClosed"] = meta.createdDate; + notifyAndArchiveProposal({ state, proposalHash: proposalId, proposal, contractID, meta, height }); + } + } + } + } + }, + "gi.contracts/group/notifyExpiringProposals": { + validate: actionRequireActiveMember(objectOf({ + proposalIds: arrayOf(string) + })), + process({ data }, { state }) { + for (const proposalId of data.proposalIds) { + state.proposals[proposalId]["notifiedBeforeExpire"] = true; + } + }, + sideEffect({ data, height, contractID }, { state, getters }) { + const { loggedIn } = (0, import_sbp7.default)("state/vuex/state"); + const myProfile = getters.groupProfile(loggedIn.identityContractID); + if (isActionNewerThanUserJoinedDate(height, myProfile)) { + for (const proposalId of data.proposalIds) { + const proposal = state.proposals[proposalId]; + (0, import_sbp7.default)("gi.notifications/emit", "PROPOSAL_EXPIRING", { + groupID: contractID, + proposal, + proposalId + }); + } + } + } + }, + "gi.contracts/group/removeMember": { + validate: actionRequireActiveMember((data, { state, getters, message: { innerSigningContractID, proposalHash } }) => { + objectOf({ + memberID: optional(stringMax(MAX_HASH_LEN)), + reason: optional(stringMax(GROUP_DESCRIPTION_MAX_CHAR)), + automated: optional(boolean) + })(data); + const memberToRemove = data.memberID || innerSigningContractID; + const membersCount = getters.groupMembersCount; + const isGroupCreator = innerSigningContractID === getters.currentGroupOwnerID; + if (!state.profiles[memberToRemove]) { + throw new GIGroupNotJoinedError(L("Not part of the group.")); + } + if (membersCount === 1) { + throw new TypeError(L("Cannot remove the last member.")); + } + if (memberToRemove === innerSigningContractID) { + return true; + } + if (isGroupCreator) { + return true; + } else if (membersCount < 3) { + throw new TypeError(L("Only the group creator can remove members.")); + } else { + const proposal = state.proposals[proposalHash]; + if (!proposal) { + throw new TypeError(L("Admin credentials needed and not implemented yet.")); + } + } + }), + process({ data, meta, contractID, height, innerSigningContractID }, { state, getters }) { + const memberID = data.memberID || innerSigningContractID; + const identityContractID = (0, import_sbp7.default)("state/vuex/state").loggedIn?.identityContractID; + if (memberID === identityContractID) { + const ourChatrooms = Object.entries(state?.chatRooms || {}).filter(([, state2]) => state2.members[identityContractID]?.status === PROFILE_STATUS.ACTIVE).map(([cID]) => cID); + if (ourChatrooms.length) { + (0, import_sbp7.default)("gi.contracts/group/pushSideEffect", contractID, ["gi.contracts/group/referenceTally", contractID, ourChatrooms, "release"]); + } + } + memberLeaves({ memberID, dateLeft: meta.createdDate, heightLeft: height, ourselvesLeaving: memberID === identityContractID }, { contractID, meta, state, getters }); + }, + sideEffect({ data, meta, contractID, height, innerSigningContractID, proposalHash }, { state, getters }) { + const memberID = data.memberID || innerSigningContractID; + (0, import_sbp7.default)("gi.contracts/group/referenceTally", contractID, memberID, "release"); + (0, import_sbp7.default)("chelonia/queueInvocation", contractID, () => (0, import_sbp7.default)("gi.contracts/group/leaveGroup", { + data, + meta, + contractID, + getters, + height, + innerSigningContractID, + proposalHash + })).catch((e) => { + console.warn(`[gi.contracts/group/removeMember/sideEffect] Error ${e.name} during queueInvocation for ${contractID}`, e); + }); + } + }, + "gi.contracts/group/invite": { + validate: actionRequireActiveMember(inviteType), + process({ data }, { state }) { + state.invites[data.inviteKeyId] = data; + } + }, + "gi.contracts/group/inviteAccept": { + validate: actionRequireInnerSignature(objectOf({ reference: string })), + process({ data, meta, height, innerSigningContractID }, { state }) { + if (state.profiles[innerSigningContractID]?.status === PROFILE_STATUS.ACTIVE) { + throw new Error(`[gi.contracts/group/inviteAccept] Existing members can't accept invites: ${innerSigningContractID}`); + } + state.profiles[innerSigningContractID] = initGroupProfile(meta.createdDate, height, data.reference); + }, + sideEffect({ meta, contractID, height, innerSigningContractID }) { + const { loggedIn } = (0, import_sbp7.default)("state/vuex/state"); + (0, import_sbp7.default)("gi.contracts/group/referenceTally", contractID, innerSigningContractID, "retain"); + (0, import_sbp7.default)("chelonia/queueInvocation", contractID, async () => { + const state = await (0, import_sbp7.default)("chelonia/contract/state", contractID); + if (!state) { + console.info(`[gi.contracts/group/inviteAccept] Contract ${contractID} has been removed`); + return; + } + const { profiles = {} } = state; + if (profiles[innerSigningContractID].status !== PROFILE_STATUS.ACTIVE) { + return; + } + const userID = loggedIn.identityContractID; + if (innerSigningContractID === userID) { + await (0, import_sbp7.default)("gi.actions/identity/addJoinDirectMessageKey", userID, contractID, "csk"); + const generalChatRoomId = state.generalChatRoomId; + if (generalChatRoomId) { + if (state.chatRooms[generalChatRoomId]?.members?.[userID]?.status !== PROFILE_STATUS.ACTIVE) { + (0, import_sbp7.default)("gi.actions/group/joinChatRoom", { + contractID, + data: { chatRoomID: generalChatRoomId } + }).catch((e) => { + if (e?.name === "GIErrorUIRuntimeError" && e.cause?.name === "GIGroupAlreadyJoinedError") + return; + console.error("Error while joining the #General chatroom", e); + const errMsg = L("Couldn't join the #{chatroomName} in the group. An error occurred: {error}", { chatroomName: CHATROOM_GENERAL_NAME, error: e?.message || e }); + const promptOptions = { + heading: L("Error while joining a chatroom"), + question: errMsg, + primaryButton: L("Close") + }; + (0, import_sbp7.default)("gi.ui/prompt", promptOptions); + }); + } + } else { + (async () => { + alert(L("Couldn't join the #{chatroomName} in the group. Doesn't exist.", { chatroomName: CHATROOM_GENERAL_NAME })); + })(); + } + (0, import_sbp7.default)("okTurtles.events/emit", JOINED_GROUP, { identityContractID: userID, groupContractID: contractID }); + } else if (isActionNewerThanUserJoinedDate(height, state?.profiles?.[userID])) { + (0, import_sbp7.default)("gi.notifications/emit", "MEMBER_ADDED", { + createdDate: meta.createdDate, + groupID: contractID, + memberID: innerSigningContractID + }); + } + }).catch((e) => { + console.error("[gi.contracts/group/inviteAccept/sideEffect]: An error occurred", e); + }); + } + }, + "gi.contracts/group/inviteRevoke": { + validate: actionRequireActiveMember((data, { state }) => { + objectOf({ + inviteKeyId: stringMax(MAX_HASH_LEN, "inviteKeyId") + })(data); + if (!state._vm.invites[data.inviteKeyId]) { + throw new TypeError(L("The link does not exist.")); + } + }), + process() { + } + }, + "gi.contracts/group/updateSettings": { + validate: actionRequireActiveMember((data, { getters, meta, message: { innerSigningContractID } }) => { + objectMaybeOf({ + groupName: stringMax(GROUP_NAME_MAX_CHAR, "groupName"), + groupPicture: unionOf(string, objectOf({ + manifestCid: stringMax(MAX_HASH_LEN, "manifestCid"), + downloadParams: optional(object) + })), + sharedValues: stringMax(GROUP_DESCRIPTION_MAX_CHAR, "sharedValues"), + mincomeAmount: numberRange(Number.EPSILON, Number.MAX_VALUE), + mincomeCurrency: stringMax(GROUP_CURRENCY_MAX_CHAR, "mincomeCurrency"), + distributionDate: string, + allowPublicChannels: boolean + })(data); + const isGroupCreator = innerSigningContractID === getters.currentGroupOwnerID; + if ("allowPublicChannels" in data && !isGroupCreator) { + throw new TypeError(L("Only group creator can allow public channels.")); + } else if ("distributionDate" in data && !isGroupCreator) { + throw new TypeError(L("Only group creator can update distribution date.")); + } else if ("distributionDate" in data && (getters.groupDistributionStarted(meta.createdDate) || Object.keys(getters.groupPeriodPayments).length > 1)) { + throw new TypeError(L("Can't change distribution date because distribution period has already started.")); + } + }), + process({ contractID, meta, data, height, innerSigningContractID, proposalHash }, { state, getters }) { + const mincomeCache = "mincomeAmount" in data ? state.settings.mincomeAmount : null; + for (const key in data) { + state.settings[key] = data[key]; + } + if ("distributionDate" in data) { + state["paymentsByPeriod"] = {}; + initFetchPeriodPayments({ contractID, meta, state, getters }); + } + if (mincomeCache !== null && !proposalHash) { + (0, import_sbp7.default)("gi.contracts/group/pushSideEffect", contractID, [ + "gi.contracts/group/sendMincomeChangedNotification", + contractID, + meta, + { + toAmount: data.mincomeAmount, + fromAmount: mincomeCache + }, + height, + innerSigningContractID + ]); + } + } + }, + "gi.contracts/group/groupProfileUpdate": { + validate: actionRequireActiveMember(objectMaybeOf({ + incomeDetailsType: validatorFrom((x) => ["incomeAmount", "pledgeAmount"].includes(x)), + incomeAmount: numberRange(0, Number.MAX_VALUE), + pledgeAmount: numberRange(0, GROUP_MAX_PLEDGE_AMOUNT, "pledgeAmount"), + nonMonetaryAdd: stringMax(GROUP_NON_MONETARY_CONTRIBUTION_MAX_CHAR, "nonMonetaryAdd"), + nonMonetaryEdit: objectOf({ + replace: stringMax(GROUP_NON_MONETARY_CONTRIBUTION_MAX_CHAR, "replace"), + with: stringMax(GROUP_NON_MONETARY_CONTRIBUTION_MAX_CHAR, "with") + }), + nonMonetaryRemove: stringMax(GROUP_NON_MONETARY_CONTRIBUTION_MAX_CHAR, "nonMonetaryRemove"), + nonMonetaryReplace: arrayOf(stringMax(GROUP_NON_MONETARY_CONTRIBUTION_MAX_CHAR)), + paymentMethods: arrayOf(objectOf({ + name: stringMax(GROUP_NAME_MAX_CHAR), + value: stringMax(GROUP_PAYMENT_METHOD_MAX_CHAR, "paymentMethods.value") + })) + })), + process({ data, meta, contractID, height, innerSigningContractID }, { state, getters }) { + const groupProfile = state.profiles[innerSigningContractID]; + const nonMonetary = groupProfile.nonMonetaryContributions; + const isUpdatingNonMonetary = Object.keys(data).some((key) => ["nonMonetaryAdd", "nonMonetaryRemove", "nonMonetaryEdit", "nonMonetaryReplace"].includes(key)); + const prevNonMonetary = nonMonetary.slice(); + for (const key in data) { + const value = data[key]; + switch (key) { + case "nonMonetaryAdd": + nonMonetary.push(value); + break; + case "nonMonetaryRemove": + nonMonetary.splice(nonMonetary.indexOf(value), 1); + break; + case "nonMonetaryEdit": + nonMonetary.splice(nonMonetary.indexOf(value.replace), 1, value.with); + break; + case "nonMonetaryReplace": + groupProfile.nonMonetaryContributions = cloneDeep(value); + break; + default: + groupProfile[key] = value; + } + } + if (isUpdatingNonMonetary && (prevNonMonetary.length || groupProfile.nonMonetaryContributions.length)) { + (0, import_sbp7.default)("gi.contracts/group/pushSideEffect", contractID, ["gi.contracts/group/sendNonMonetaryUpdateNotification", { + contractID, + innerSigningContractID, + meta, + height, + getters, + updateData: { + prev: prevNonMonetary, + after: groupProfile.nonMonetaryContributions.slice() + } + }]); + } + if (data.incomeDetailsType) { + groupProfile["incomeDetailsLastUpdatedDate"] = meta.createdDate; + updateCurrentDistribution({ contractID, meta, state, getters }); + } + } + }, + "gi.contracts/group/updateAllVotingRules": { + validate: actionRequireActiveMember(objectMaybeOf({ + ruleName: (x) => [RULE_PERCENTAGE, RULE_DISAGREEMENT].includes(x), + ruleThreshold: number, + expires_ms: number + })), + process({ data }, { state }) { + if (data.ruleName && data.ruleThreshold) { + for (const proposalSettings in state.settings.proposals) { + state.settings.proposals[proposalSettings]["rule"] = data.ruleName; + state.settings.proposals[proposalSettings].ruleSettings[data.ruleName]["threshold"] = data.ruleThreshold; + } + } + } + }, + "gi.contracts/group/addChatRoom": { + validate: (data) => { + objectOf({ + chatRoomID: stringMax(MAX_HASH_LEN, "chatRoomID"), + attributes: chatRoomAttributesType + })(data); + const chatroomName = data.attributes.name; + const nameValidationMap = { + [L("Chatroom name cannot contain white-space")]: (v) => /\s/g.test(v), + [L("Chatroom name must be lower-case only")]: (v) => /[A-Z]/g.test(v) + }; + for (const key in nameValidationMap) { + const check = nameValidationMap[key]; + if (check(chatroomName)) { + throw new TypeError(key); + } + } + }, + process({ data, contractID, innerSigningContractID }, { state }) { + const { name, type, privacyLevel, description } = data.attributes; + if (!!innerSigningContractID === (data.attributes.name === CHATROOM_GENERAL_NAME)) { + throw new Error("All chatrooms other than #General must have an inner signature and the #General chatroom must have no inner signature"); + } + state.chatRooms[data.chatRoomID] = { + creatorID: innerSigningContractID || contractID, + name, + description, + type, + privacyLevel, + deletedDate: null, + members: {} + }; + if (!state.generalChatRoomId) { + state["generalChatRoomId"] = data.chatRoomID; + } + }, + sideEffect({ contractID, data }, { state }) { + if (data.chatRoomID === state.generalChatRoomId) { + (0, import_sbp7.default)("chelonia/queueInvocation", contractID, () => { + const { identityContractID } = (0, import_sbp7.default)("state/vuex/state").loggedIn; + if (state.profiles?.[identityContractID]?.status === PROFILE_STATUS.ACTIVE && state.chatRooms?.[contractID]?.members[identityContractID]?.status !== PROFILE_STATUS.ACTIVE) { + (0, import_sbp7.default)("gi.actions/group/joinChatRoom", { + contractID, + data: { + chatRoomID: data.chatRoomID + } + }).catch((e) => { + console.error("Unable to add ourselves to the #General chatroom", e); + }); + } + }); + } + } + }, + "gi.contracts/group/deleteChatRoom": { + validate: actionRequireActiveMember((data, { getters, message: { innerSigningContractID } }) => { + objectOf({ chatRoomID: stringMax(MAX_HASH_LEN, "chatRoomID") })(data); + if (getters.groupChatRooms[data.chatRoomID].creatorID !== innerSigningContractID) { + throw new TypeError(L("Only the channel creator can delete channel.")); + } + }), + process({ contractID, data }, { state }) { + const identityContractID = (0, import_sbp7.default)("state/vuex/state").loggedIn?.identityContractID; + if (identityContractID && state?.chatRooms[data.chatRoomID]?.members[identityContractID]?.status === PROFILE_STATUS.ACTIVE) { + (0, import_sbp7.default)("gi.contracts/group/pushSideEffect", contractID, ["gi.contracts/group/referenceTally", contractID, data.chatRoomID, "release"]); + } + delete state.chatRooms[data.chatRoomID]; + }, + sideEffect({ data, contractID, innerSigningContractID }) { + (0, import_sbp7.default)("okTurtles.events/emit", DELETED_CHATROOM, { groupContractID: contractID, chatRoomID: data.chatRoomID }); + const { identityContractID } = (0, import_sbp7.default)("state/vuex/state").loggedIn; + if (identityContractID === innerSigningContractID) { + (0, import_sbp7.default)("gi.actions/chatroom/delete", { contractID: data.chatRoomID, data: {} }).catch((e) => { + console.log(`Error sending chatroom removal action for ${data.chatRoomID}`, e); + }); + } + } + }, + "gi.contracts/group/leaveChatRoom": { + validate: actionRequireActiveMember(objectOf({ + chatRoomID: stringMax(MAX_HASH_LEN, "chatRoomID"), + memberID: optional(stringMax(MAX_HASH_LEN), "memberID"), + joinedHeight: numberRange(1, Number.MAX_SAFE_INTEGER) + })), + process({ data, innerSigningContractID }, { state }) { + if (!state.chatRooms[data.chatRoomID]) { + throw new Error("Cannot leave a chatroom which isn't part of the group"); + } + const memberID = data.memberID || innerSigningContractID; + if (state.chatRooms[data.chatRoomID].members[memberID]?.status !== PROFILE_STATUS.ACTIVE || state.chatRooms[data.chatRoomID].members[memberID].joinedHeight !== data.joinedHeight) { + throw new Error("Cannot leave a chatroom that you're not part of"); + } + removeGroupChatroomProfile(state, data.chatRoomID, memberID); + }, + sideEffect({ data, contractID, innerSigningContractID }, { state }) { + const memberID = data.memberID || innerSigningContractID; + const { identityContractID } = (0, import_sbp7.default)("state/vuex/state").loggedIn; + if (innerSigningContractID === identityContractID) { + (0, import_sbp7.default)("chelonia/queueInvocation", contractID, async () => { + const state2 = await (0, import_sbp7.default)("chelonia/contract/state", contractID); + if (state2?.profiles?.[innerSigningContractID]?.status === PROFILE_STATUS.ACTIVE && state2.chatRooms?.[data.chatRoomID]?.members[memberID]?.status === PROFILE_STATUS.REMOVED && state2.chatRooms[data.chatRoomID].members[memberID].joinedHeight === data.joinedHeight) { + await leaveChatRoomAction(contractID, state2, data.chatRoomID, memberID, innerSigningContractID); + } + }).catch((e) => { + console.error(`[gi.contracts/group/leaveChatRoom/sideEffect] Error for ${contractID}`, { contractID, data, error: e }); + }); + } + if (memberID === identityContractID) { + (0, import_sbp7.default)("gi.contracts/group/referenceTally", contractID, data.chatRoomID, "release"); + (0, import_sbp7.default)("okTurtles.events/emit", LEFT_CHATROOM, { + identityContractID, + groupContractID: contractID, + chatRoomID: data.chatRoomID + }); + } + } + }, + "gi.contracts/group/joinChatRoom": { + validate: actionRequireActiveMember(objectMaybeOf({ + memberID: optional(stringMax(MAX_HASH_LEN, "memberID")), + chatRoomID: stringMax(MAX_HASH_LEN, "chatRoomID") + })), + process({ data, height, innerSigningContractID }, { state }) { + const memberID = data.memberID || innerSigningContractID; + const { chatRoomID } = data; + if (state.profiles[memberID]?.status !== PROFILE_STATUS.ACTIVE) { + throw new Error("Cannot join a chatroom for a group you're not a member of"); + } + if (!state.chatRooms[chatRoomID]) { + throw new Error("Cannot join a chatroom which isn't part of the group"); + } + if (state.chatRooms[chatRoomID].members[memberID]?.status === PROFILE_STATUS.ACTIVE) { + throw new GIGroupAlreadyJoinedError("Cannot join a chatroom that you're already part of"); + } + state.chatRooms[chatRoomID].members[memberID] = { status: PROFILE_STATUS.ACTIVE, joinedHeight: height }; + }, + sideEffect({ data, contractID, height, innerSigningContractID }) { + const memberID = data.memberID || innerSigningContractID; + const { identityContractID } = (0, import_sbp7.default)("state/vuex/state").loggedIn; + if (memberID === identityContractID) { + (0, import_sbp7.default)("gi.contracts/group/referenceTally", contractID, data.chatRoomID, "retain"); + } + if (innerSigningContractID === identityContractID) { + (0, import_sbp7.default)("chelonia/queueInvocation", contractID, () => (0, import_sbp7.default)("gi.contracts/group/joinGroupChatrooms", contractID, data.chatRoomID, identityContractID, memberID, height)).catch((e) => { + console.warn(`[gi.contracts/group/joinChatRoom/sideEffect] Error adding member to group chatroom for ${contractID}`, { e, data }); + }); + } + } + }, + "gi.contracts/group/renameChatRoom": { + validate: actionRequireActiveMember(objectOf({ + chatRoomID: stringMax(MAX_HASH_LEN, "chatRoomID"), + name: stringMax(CHATROOM_NAME_LIMITS_IN_CHARS, "name") + })), + process({ data }, { state }) { + state.chatRooms[data.chatRoomID]["name"] = data.name; + } + }, + "gi.contracts/group/changeChatRoomDescription": { + validate: actionRequireActiveMember(objectOf({ + chatRoomID: stringMax(MAX_HASH_LEN, "chatRoomID"), + description: stringMax(CHATROOM_DESCRIPTION_LIMITS_IN_CHARS, "description") + })), + process({ data }, { state }) { + state.chatRooms[data.chatRoomID]["description"] = data.description; + } + }, + "gi.contracts/group/updateDistributionDate": { + validate: actionRequireActiveMember(optional), + process({ meta }, { state, getters }) { + const period = getters.periodStampGivenDate(meta.createdDate); + const current = state.settings?.distributionDate; + if (current !== period) { + updateGroupStreaks({ state, getters }); + state.settings.distributionDate = period; + } + } + }, + "gi.contracts/group/upgradeFrom1.0.7": { + validate: actionRequireActiveMember(optional), + process({ height }, { state }) { + let changed = false; + Object.values(state.chatRooms).forEach((chatroom) => { + Object.values(chatroom.members).forEach((member) => { + if (member.status === PROFILE_STATUS.ACTIVE && member.joinedHeight == null) { + member.joinedHeight = height; + changed = true; + } + }); + }); + if (!changed) { + throw new Error("[gi.contracts/group/upgradeFrom1.0.7/process] Invalid or duplicate upgrade action"); + } + } + }, + ..."" + }, + methods: { + "gi.contracts/group/_cleanup": ({ contractID, state }) => { + const { identityContractID } = (0, import_sbp7.default)("state/vuex/state").loggedIn; + const dependentContractIDs = [ + ...Object.entries(state?.profiles || {}).filter(([, state2]) => state2.status === PROFILE_STATUS.ACTIVE).map(([cID]) => cID), + ...Object.entries(state?.chatRooms || {}).filter(([, state2]) => state2.members[identityContractID]?.status === PROFILE_STATUS.ACTIVE).map(([cID]) => cID) + ]; + if (dependentContractIDs.length) { + (0, import_sbp7.default)("chelonia/contract/release", dependentContractIDs).catch((e) => { + console.error("[gi.contracts/group/_cleanup] Error calling release", contractID, e); + }); + } + Promise.all([ + () => (0, import_sbp7.default)("gi.contracts/group/removeArchivedProposals", contractID), + () => (0, import_sbp7.default)("gi.contracts/group/removeArchivedPayments", contractID) + ]).catch((e) => { + console.error(`[gi.contracts/group/_cleanup] Error removing entries for archive for ${contractID}`, e); + }); + }, + "gi.contracts/group/archiveProposal": async function(contractID, proposalHash, proposal) { + const { identityContractID } = (0, import_sbp7.default)("state/vuex/state").loggedIn; + const key = `proposals/${identityContractID}/${contractID}`; + const proposals2 = await (0, import_sbp7.default)("gi.db/archive/load", key) || []; + if (proposals2.some(([archivedProposalHash]) => archivedProposalHash === proposalHash)) { + return; + } + proposals2.unshift([proposalHash, proposal]); + while (proposals2.length > MAX_ARCHIVED_PROPOSALS) { + proposals2.pop(); + } + await (0, import_sbp7.default)("gi.db/archive/save", key, proposals2); + (0, import_sbp7.default)("okTurtles.events/emit", PROPOSAL_ARCHIVED, contractID, proposalHash, proposal); + }, + "gi.contracts/group/archivePayments": async function(contractID, archivingPayments) { + const { paymentsByPeriod, payments } = archivingPayments; + const { identityContractID } = (0, import_sbp7.default)("state/vuex/state").loggedIn; + const archPaymentsByPeriodKey = `paymentsByPeriod/${identityContractID}/${contractID}`; + const archPaymentsByPeriod = await (0, import_sbp7.default)("gi.db/archive/load", archPaymentsByPeriodKey) || {}; + const archSentOrReceivedPaymentsKey = `sentOrReceivedPayments/${identityContractID}/${contractID}`; + const archSentOrReceivedPayments = await (0, import_sbp7.default)("gi.db/archive/load", archSentOrReceivedPaymentsKey) || { sent: [], received: [] }; + const sortPayments = (payments2) => payments2.sort((f, l) => l.height - f.height); + for (const period of Object.keys(paymentsByPeriod).sort()) { + archPaymentsByPeriod[period] = paymentsByPeriod[period]; + const newSentOrReceivedPayments = { sent: [], received: [] }; + const { paymentsFrom } = paymentsByPeriod[period]; + for (const fromMemberID of Object.keys(paymentsFrom)) { + for (const toMemberID of Object.keys(paymentsFrom[fromMemberID])) { + if (toMemberID === identityContractID || fromMemberID === identityContractID) { + const receivedOrSent = toMemberID === identityContractID ? "received" : "sent"; + for (const hash of paymentsFrom[fromMemberID][toMemberID]) { + const { data, meta, height } = payments[hash]; + newSentOrReceivedPayments[receivedOrSent].push({ hash, period, height, data, meta, amount: data.amount }); + } + } + } + } + archSentOrReceivedPayments.sent = [...sortPayments(newSentOrReceivedPayments.sent), ...archSentOrReceivedPayments.sent]; + archSentOrReceivedPayments.received = [...sortPayments(newSentOrReceivedPayments.received), ...archSentOrReceivedPayments.received]; + const archPaymentsKey = `payments/${identityContractID}/${period}/${contractID}`; + const hashes = paymentHashesFromPaymentPeriod(paymentsByPeriod[period]); + const archPayments = Object.fromEntries(hashes.map((hash) => [hash, payments[hash]])); + while (Object.keys(archPaymentsByPeriod).length > MAX_ARCHIVED_PERIODS) { + const shouldBeDeletedPeriod = Object.keys(archPaymentsByPeriod).sort().shift(); + const paymentHashes = paymentHashesFromPaymentPeriod(archPaymentsByPeriod[shouldBeDeletedPeriod]); + await (0, import_sbp7.default)("gi.db/archive/delete", `payments/${shouldBeDeletedPeriod}/${identityContractID}/${contractID}`); + delete archPaymentsByPeriod[shouldBeDeletedPeriod]; + archSentOrReceivedPayments.sent = archSentOrReceivedPayments.sent.filter((payment) => !paymentHashes.includes(payment.hash)); + archSentOrReceivedPayments.received = archSentOrReceivedPayments.received.filter((payment) => !paymentHashes.includes(payment.hash)); + } + await (0, import_sbp7.default)("gi.db/archive/save", archPaymentsKey, archPayments); + } + await (0, import_sbp7.default)("gi.db/archive/save", archPaymentsByPeriodKey, archPaymentsByPeriod); + await (0, import_sbp7.default)("gi.db/archive/save", archSentOrReceivedPaymentsKey, archSentOrReceivedPayments); + (0, import_sbp7.default)("okTurtles.events/emit", PAYMENTS_ARCHIVED, { paymentsByPeriod, payments }); + }, + "gi.contracts/group/removeArchivedProposals": async function(contractID) { + const { identityContractID } = (0, import_sbp7.default)("state/vuex/state").loggedIn; + const key = `proposals/${identityContractID}/${contractID}`; + await (0, import_sbp7.default)("gi.db/archive/delete", key); + }, + "gi.contracts/group/removeArchivedPayments": async function(contractID) { + const { identityContractID } = (0, import_sbp7.default)("state/vuex/state").loggedIn; + const archPaymentsByPeriodKey = `paymentsByPeriod/${identityContractID}/${contractID}`; + const periods = Object.keys(await (0, import_sbp7.default)("gi.db/archive/load", archPaymentsByPeriodKey) || {}); + const archSentOrReceivedPaymentsKey = `sentOrReceivedPayments/${identityContractID}/${contractID}`; + for (const period of periods) { + const archPaymentsKey = `payments/${identityContractID}/${period}/${contractID}`; + await (0, import_sbp7.default)("gi.db/archive/delete", archPaymentsKey); + } + await (0, import_sbp7.default)("gi.db/archive/delete", archPaymentsByPeriodKey); + await (0, import_sbp7.default)("gi.db/archive/delete", archSentOrReceivedPaymentsKey); + }, + "gi.contracts/group/makeNotificationWhenProposalClosed": function(state, contractID, meta, height, proposalHash, proposal) { + const { loggedIn } = (0, import_sbp7.default)("state/vuex/state"); + if (isActionNewerThanUserJoinedDate(height, state.profiles[loggedIn.identityContractID])) { + (0, import_sbp7.default)("gi.notifications/emit", "PROPOSAL_CLOSED", { createdDate: meta.createdDate, groupID: contractID, proposalHash, proposal }); + } + }, + "gi.contracts/group/sendMincomeChangedNotification": async function(contractID, meta, data, height, innerSigningContractID) { + const { identityContractID } = (0, import_sbp7.default)("state/vuex/state").loggedIn; + const myProfile = (await (0, import_sbp7.default)("chelonia/contract/state", contractID)).profiles[identityContractID]; + const { fromAmount, toAmount } = data; + if (isActionNewerThanUserJoinedDate(height, myProfile) && myProfile.incomeDetailsType) { + const memberType = myProfile.incomeDetailsType === "pledgeAmount" ? "pledging" : "receiving"; + const mincomeIncreased = toAmount > fromAmount; + const actionNeeded = mincomeIncreased || memberType === "receiving" && !mincomeIncreased && myProfile.incomeAmount < fromAmount && myProfile.incomeAmount > toAmount; + if (!actionNeeded) { + return; + } + if (memberType === "receiving" && !mincomeIncreased) { + await (0, import_sbp7.default)("gi.actions/group/groupProfileUpdate", { + contractID, + data: { + incomeDetailsType: "pledgeAmount", + pledgeAmount: 0 + } + }); + } + (0, import_sbp7.default)("gi.notifications/emit", "MINCOME_CHANGED", { + createdDate: meta.createdDate, + groupID: contractID, + creatorID: innerSigningContractID, + to: toAmount, + memberType, + increased: mincomeIncreased + }); + } + }, + "gi.contracts/group/joinGroupChatrooms": async function(contractID, chatRoomID, originalActorID, memberID, height) { + const state = await (0, import_sbp7.default)("chelonia/contract/state", contractID); + const actorID = (0, import_sbp7.default)("state/vuex/state").loggedIn.identityContractID; + if (actorID !== originalActorID) { + return; + } + if (state?.profiles?.[actorID]?.status !== PROFILE_STATUS.ACTIVE || state?.profiles?.[memberID]?.status !== PROFILE_STATUS.ACTIVE || state?.chatRooms?.[chatRoomID]?.members[memberID]?.status !== PROFILE_STATUS.ACTIVE || state?.chatRooms?.[chatRoomID]?.members[memberID]?.joinedHeight !== height) { + (0, import_sbp7.default)("okTurtles.data/set", `gi.contracts/group/chatroom-skipped-${contractID}-${chatRoomID}-${height}`, true); + return; + } + { + await (0, import_sbp7.default)("chelonia/contract/retain", chatRoomID, { ephemeral: true }); + if (!await (0, import_sbp7.default)("chelonia/contract/hasKeysToPerformOperation", chatRoomID, "gi.contracts/chatroom/join")) { + throw new Error(`Missing keys to join chatroom ${chatRoomID}`); + } + const encryptionKeyId = (0, import_sbp7.default)("chelonia/contract/currentKeyIdByName", state, "cek", true); + (0, import_sbp7.default)("gi.actions/chatroom/join", { + contractID: chatRoomID, + data: actorID === memberID ? {} : { memberID }, + encryptionKeyId + }).catch((e) => { + if (e.name === "GIErrorUIRuntimeError" && e.cause?.name === "GIChatroomAlreadyMemberError") { + return; + } + console.warn(`Unable to join ${memberID} to chatroom ${chatRoomID} for group ${contractID}`, e); + }).finally(() => { + (0, import_sbp7.default)("chelonia/contract/release", chatRoomID, { ephemeral: true }).catch((e) => console.error("[gi.contracts/group/joinGroupChatrooms] Error during release", e)); + }); + } + }, + "gi.contracts/group/leaveGroup": async ({ data, meta, contractID, height, getters, innerSigningContractID, proposalHash }) => { + const { identityContractID } = (0, import_sbp7.default)("state/vuex/state").loggedIn; + const memberID = data.memberID || innerSigningContractID; + const state = await (0, import_sbp7.default)("chelonia/contract/state", contractID); + if (!state) { + console.info(`[gi.contracts/group/leaveGroup] for ${contractID}: contract has been removed`); + return; + } + if (state.profiles?.[memberID]?.status !== PROFILE_STATUS.REMOVED) { + console.info(`[gi.contracts/group/leaveGroup] for ${contractID}: member has not left`, { contractID, memberID, status: state.profiles?.[memberID]?.status }); + return; + } + if (memberID === identityContractID) { + const areWeRejoining = async () => { + const pendingKeyShares = await (0, import_sbp7.default)("chelonia/contract/waitingForKeyShareTo", state, identityContractID); + if (pendingKeyShares) { + console.info("[gi.contracts/group/leaveGroup] Not removing group contract because it has a pending key share for ourselves", contractID); + return true; + } + const sentKeyShares = await (0, import_sbp7.default)("chelonia/contract/successfulKeySharesByContractID", state, identityContractID); + if (sentKeyShares?.[identityContractID]?.[0].height > state.profiles[memberID].departedHeight) { + console.info("[gi.contracts/group/leaveGroup] Not removing group contract because it has shared keys with ourselves after we left", contractID); + return true; + } + return false; + }; + if (await areWeRejoining()) { + console.info("[gi.contracts/group/leaveGroup] aborting as we're rejoining", contractID); + return; + } + } + leaveAllChatRoomsUponLeaving(contractID, state, memberID, innerSigningContractID).catch((e) => { + console.warn("[gi.contracts/group/leaveGroup]: Error while leaving all chatrooms", e); + }); + if (memberID === identityContractID) { + (0, import_sbp7.default)("gi.actions/identity/leaveGroup", { + contractID: identityContractID, + data: { + groupContractID: contractID, + reference: state.profiles[identityContractID].reference + } + }).catch((e) => { + console.warn(`[gi.contracts/group/leaveGroup] ${e.name} thrown by gi.contracts/identity/leaveGroup ${identityContractID} for ${contractID}:`, e); + }); + } else { + const myProfile = getters.groupProfile(identityContractID); + if (isActionNewerThanUserJoinedDate(height, myProfile)) { + if (!proposalHash) { + const memberRemovedThemselves = memberID === innerSigningContractID; + (0, import_sbp7.default)("gi.notifications/emit", memberRemovedThemselves ? "MEMBER_LEFT" : "MEMBER_REMOVED", { + createdDate: meta.createdDate, + groupID: contractID, + memberID + }); + } + Promise.resolve().then(() => (0, import_sbp7.default)("gi.contracts/group/rotateKeys", contractID)).then(() => (0, import_sbp7.default)("gi.contracts/group/revokeGroupKeyAndRotateOurPEK", contractID)).catch((e) => { + console.warn(`[gi.contracts/group/leaveGroup] for ${contractID}: Error rotating group keys or our PEK`, e); + }); + (0, import_sbp7.default)("gi.contracts/group/removeForeignKeys", contractID, memberID, state); + } + } + }, + "gi.contracts/group/rotateKeys": async (contractID) => { + const state = await (0, import_sbp7.default)("chelonia/contract/state", contractID); + const pendingKeyRevocations = state?._volatile?.pendingKeyRevocations; + if (!pendingKeyRevocations || Object.keys(pendingKeyRevocations).length === 0) { + return; + } + (0, import_sbp7.default)("gi.actions/out/rotateKeys", contractID, "gi.contracts/group", "pending", "gi.actions/group/shareNewKeys").catch((e) => { + console.warn(`rotateKeys: ${e.name} thrown:`, e); + }); + }, + "gi.contracts/group/revokeGroupKeyAndRotateOurPEK": (groupContractID) => { + const rootState = (0, import_sbp7.default)("state/vuex/state"); + const { identityContractID } = rootState.loggedIn; + const state = rootState[identityContractID]; + if (!state._volatile) + state["_volatile"] = /* @__PURE__ */ Object.create(null); + if (!state._volatile.pendingKeyRevocations) + state._volatile["pendingKeyRevocations"] = /* @__PURE__ */ Object.create(null); + const PEKid = findKeyIdByName(state, "pek"); + state._volatile.pendingKeyRevocations[PEKid] = true; + (0, import_sbp7.default)("chelonia/queueInvocation", identityContractID, ["gi.actions/out/rotateKeys", identityContractID, "gi.contracts/identity", "pending", "gi.actions/identity/shareNewPEK"]).catch((e) => { + console.warn(`revokeGroupKeyAndRotateOurPEK: ${e.name} thrown during queueEvent to ${identityContractID}:`, e); + }); + }, + "gi.contracts/group/removeForeignKeys": (contractID, userID, state) => { + const keyIds = findForeignKeysByContractID(state, userID); + if (!keyIds?.length) + return; + const CSKid = findKeyIdByName(state, "csk"); + (0, import_sbp7.default)("chelonia/out/keyDel", { + contractID, + contractName: "gi.contracts/group", + data: keyIds, + signingKeyId: CSKid + }).catch((e) => { + console.warn(`removeForeignKeys: ${e.name} error thrown:`, e); + }); + }, + "gi.contracts/group/sendNonMonetaryUpdateNotification": ({ + contractID, + innerSigningContractID, + meta, + height, + updateData, + getters + }) => { + const { loggedIn } = (0, import_sbp7.default)("state/vuex/state"); + const isUpdatingMyself = loggedIn.identityContractID === innerSigningContractID; + if (!isUpdatingMyself) { + const myProfile = getters.groupProfile(loggedIn.identityContractID); + if (isActionNewerThanUserJoinedDate(height, myProfile)) { + (0, import_sbp7.default)("gi.notifications/emit", "NONMONETARY_CONTRIBUTION_UPDATE", { + createdDate: meta.createdDate, + groupID: contractID, + creatorID: innerSigningContractID, + updateData + }); + } + } + }, + ...referenceTally("gi.contracts/group/referenceTally") + } + }); +})(); +/*! + * Fast "async" scrypt implementation in JavaScript. + * Copyright (c) 2013-2016 Dmitry Chestnykh | BSD License + * https://github.com/dchest/scrypt-async-js + */ +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ +/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ diff --git a/contracts/1.2.0/identity-slim.js b/contracts/1.2.0/identity-slim.js new file mode 100644 index 000000000..af1b6cbd7 --- /dev/null +++ b/contracts/1.2.0/identity-slim.js @@ -0,0 +1,8358 @@ +"use strict"; +(() => { + var __create = Object.create; + var __defProp = Object.defineProperty; + var __getOwnPropDesc = Object.getOwnPropertyDescriptor; + var __getOwnPropNames = Object.getOwnPropertyNames; + var __getProtoOf = Object.getPrototypeOf; + var __hasOwnProp = Object.prototype.hasOwnProperty; + var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; + var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { + get: (a, b) => (typeof require !== "undefined" ? require : a)[b] + }) : x)(function(x) { + if (typeof require !== "undefined") + return require.apply(this, arguments); + throw new Error('Dynamic require of "' + x + '" is not supported'); + }); + var __commonJS = (cb, mod) => function __require2() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; + }; + var __copyProps = (to, from3, except, desc) => { + if (from3 && typeof from3 === "object" || typeof from3 === "function") { + for (let key of __getOwnPropNames(from3)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from3[key], enumerable: !(desc = __getOwnPropDesc(from3, key)) || desc.enumerable }); + } + return to; + }; + var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod)); + var __publicField = (obj, key, value) => { + __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); + return value; + }; + + // node_modules/blakejs/util.js + var require_util = __commonJS({ + "node_modules/blakejs/util.js"(exports, module) { + var ERROR_MSG_INPUT = "Input must be an string, Buffer or Uint8Array"; + function normalizeInput(input) { + let ret; + if (input instanceof Uint8Array) { + ret = input; + } else if (typeof input === "string") { + const encoder = new TextEncoder(); + ret = encoder.encode(input); + } else { + throw new Error(ERROR_MSG_INPUT); + } + return ret; + } + function toHex(bytes) { + return Array.prototype.map.call(bytes, function(n) { + return (n < 16 ? "0" : "") + n.toString(16); + }).join(""); + } + function uint32ToHex(val) { + return (4294967296 + val).toString(16).substring(1); + } + function debugPrint(label, arr, size) { + let msg = "\n" + label + " = "; + for (let i = 0; i < arr.length; i += 2) { + if (size === 32) { + msg += uint32ToHex(arr[i]).toUpperCase(); + msg += " "; + msg += uint32ToHex(arr[i + 1]).toUpperCase(); + } else if (size === 64) { + msg += uint32ToHex(arr[i + 1]).toUpperCase(); + msg += uint32ToHex(arr[i]).toUpperCase(); + } else + throw new Error("Invalid size " + size); + if (i % 6 === 4) { + msg += "\n" + new Array(label.length + 4).join(" "); + } else if (i < arr.length - 2) { + msg += " "; + } + } + console.log(msg); + } + function testSpeed(hashFn, N, M) { + let startMs = new Date().getTime(); + const input = new Uint8Array(N); + for (let i = 0; i < N; i++) { + input[i] = i % 256; + } + const genMs = new Date().getTime(); + console.log("Generated random input in " + (genMs - startMs) + "ms"); + startMs = genMs; + for (let i = 0; i < M; i++) { + const hashHex = hashFn(input); + const hashMs = new Date().getTime(); + const ms = hashMs - startMs; + startMs = hashMs; + console.log("Hashed in " + ms + "ms: " + hashHex.substring(0, 20) + "..."); + console.log(Math.round(N / (1 << 20) / (ms / 1e3) * 100) / 100 + " MB PER SECOND"); + } + } + module.exports = { + normalizeInput, + toHex, + debugPrint, + testSpeed + }; + } + }); + + // node_modules/blakejs/blake2b.js + var require_blake2b = __commonJS({ + "node_modules/blakejs/blake2b.js"(exports, module) { + var util = require_util(); + function ADD64AA(v2, a, b) { + const o0 = v2[a] + v2[b]; + let o1 = v2[a + 1] + v2[b + 1]; + if (o0 >= 4294967296) { + o1++; + } + v2[a] = o0; + v2[a + 1] = o1; + } + function ADD64AC(v2, a, b0, b1) { + let o0 = v2[a] + b0; + if (b0 < 0) { + o0 += 4294967296; + } + let o1 = v2[a + 1] + b1; + if (o0 >= 4294967296) { + o1++; + } + v2[a] = o0; + v2[a + 1] = o1; + } + function B2B_GET32(arr, i) { + return arr[i] ^ arr[i + 1] << 8 ^ arr[i + 2] << 16 ^ arr[i + 3] << 24; + } + function B2B_G(a, b, c, d, ix, iy) { + const x0 = m[ix]; + const x1 = m[ix + 1]; + const y0 = m[iy]; + const y1 = m[iy + 1]; + ADD64AA(v, a, b); + ADD64AC(v, a, x0, x1); + let xor0 = v[d] ^ v[a]; + let xor1 = v[d + 1] ^ v[a + 1]; + v[d] = xor1; + v[d + 1] = xor0; + ADD64AA(v, c, d); + xor0 = v[b] ^ v[c]; + xor1 = v[b + 1] ^ v[c + 1]; + v[b] = xor0 >>> 24 ^ xor1 << 8; + v[b + 1] = xor1 >>> 24 ^ xor0 << 8; + ADD64AA(v, a, b); + ADD64AC(v, a, y0, y1); + xor0 = v[d] ^ v[a]; + xor1 = v[d + 1] ^ v[a + 1]; + v[d] = xor0 >>> 16 ^ xor1 << 16; + v[d + 1] = xor1 >>> 16 ^ xor0 << 16; + ADD64AA(v, c, d); + xor0 = v[b] ^ v[c]; + xor1 = v[b + 1] ^ v[c + 1]; + v[b] = xor1 >>> 31 ^ xor0 << 1; + v[b + 1] = xor0 >>> 31 ^ xor1 << 1; + } + var BLAKE2B_IV32 = new Uint32Array([ + 4089235720, + 1779033703, + 2227873595, + 3144134277, + 4271175723, + 1013904242, + 1595750129, + 2773480762, + 2917565137, + 1359893119, + 725511199, + 2600822924, + 4215389547, + 528734635, + 327033209, + 1541459225 + ]); + var SIGMA8 = [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 14, + 10, + 4, + 8, + 9, + 15, + 13, + 6, + 1, + 12, + 0, + 2, + 11, + 7, + 5, + 3, + 11, + 8, + 12, + 0, + 5, + 2, + 15, + 13, + 10, + 14, + 3, + 6, + 7, + 1, + 9, + 4, + 7, + 9, + 3, + 1, + 13, + 12, + 11, + 14, + 2, + 6, + 5, + 10, + 4, + 0, + 15, + 8, + 9, + 0, + 5, + 7, + 2, + 4, + 10, + 15, + 14, + 1, + 11, + 12, + 6, + 8, + 3, + 13, + 2, + 12, + 6, + 10, + 0, + 11, + 8, + 3, + 4, + 13, + 7, + 5, + 15, + 14, + 1, + 9, + 12, + 5, + 1, + 15, + 14, + 13, + 4, + 10, + 0, + 7, + 6, + 3, + 9, + 2, + 8, + 11, + 13, + 11, + 7, + 14, + 12, + 1, + 3, + 9, + 5, + 0, + 15, + 4, + 8, + 6, + 2, + 10, + 6, + 15, + 14, + 9, + 11, + 3, + 0, + 8, + 12, + 2, + 13, + 7, + 1, + 4, + 10, + 5, + 10, + 2, + 8, + 4, + 7, + 6, + 1, + 5, + 15, + 11, + 9, + 14, + 3, + 12, + 13, + 0, + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 14, + 10, + 4, + 8, + 9, + 15, + 13, + 6, + 1, + 12, + 0, + 2, + 11, + 7, + 5, + 3 + ]; + var SIGMA82 = new Uint8Array(SIGMA8.map(function(x) { + return x * 2; + })); + var v = new Uint32Array(32); + var m = new Uint32Array(32); + function blake2bCompress(ctx, last) { + let i = 0; + for (i = 0; i < 16; i++) { + v[i] = ctx.h[i]; + v[i + 16] = BLAKE2B_IV32[i]; + } + v[24] = v[24] ^ ctx.t; + v[25] = v[25] ^ ctx.t / 4294967296; + if (last) { + v[28] = ~v[28]; + v[29] = ~v[29]; + } + for (i = 0; i < 32; i++) { + m[i] = B2B_GET32(ctx.b, 4 * i); + } + for (i = 0; i < 12; i++) { + B2B_G(0, 8, 16, 24, SIGMA82[i * 16 + 0], SIGMA82[i * 16 + 1]); + B2B_G(2, 10, 18, 26, SIGMA82[i * 16 + 2], SIGMA82[i * 16 + 3]); + B2B_G(4, 12, 20, 28, SIGMA82[i * 16 + 4], SIGMA82[i * 16 + 5]); + B2B_G(6, 14, 22, 30, SIGMA82[i * 16 + 6], SIGMA82[i * 16 + 7]); + B2B_G(0, 10, 20, 30, SIGMA82[i * 16 + 8], SIGMA82[i * 16 + 9]); + B2B_G(2, 12, 22, 24, SIGMA82[i * 16 + 10], SIGMA82[i * 16 + 11]); + B2B_G(4, 14, 16, 26, SIGMA82[i * 16 + 12], SIGMA82[i * 16 + 13]); + B2B_G(6, 8, 18, 28, SIGMA82[i * 16 + 14], SIGMA82[i * 16 + 15]); + } + for (i = 0; i < 16; i++) { + ctx.h[i] = ctx.h[i] ^ v[i] ^ v[i + 16]; + } + } + var parameterBlock = new Uint8Array([ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ]); + function blake2bInit2(outlen, key, salt, personal) { + if (outlen === 0 || outlen > 64) { + throw new Error("Illegal output length, expected 0 < length <= 64"); + } + if (key && key.length > 64) { + throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64"); + } + if (salt && salt.length !== 16) { + throw new Error("Illegal salt, expected Uint8Array with length is 16"); + } + if (personal && personal.length !== 16) { + throw new Error("Illegal personal, expected Uint8Array with length is 16"); + } + const ctx = { + b: new Uint8Array(128), + h: new Uint32Array(16), + t: 0, + c: 0, + outlen + }; + parameterBlock.fill(0); + parameterBlock[0] = outlen; + if (key) + parameterBlock[1] = key.length; + parameterBlock[2] = 1; + parameterBlock[3] = 1; + if (salt) + parameterBlock.set(salt, 32); + if (personal) + parameterBlock.set(personal, 48); + for (let i = 0; i < 16; i++) { + ctx.h[i] = BLAKE2B_IV32[i] ^ B2B_GET32(parameterBlock, i * 4); + } + if (key) { + blake2bUpdate2(ctx, key); + ctx.c = 128; + } + return ctx; + } + function blake2bUpdate2(ctx, input) { + for (let i = 0; i < input.length; i++) { + if (ctx.c === 128) { + ctx.t += ctx.c; + blake2bCompress(ctx, false); + ctx.c = 0; + } + ctx.b[ctx.c++] = input[i]; + } + } + function blake2bFinal2(ctx) { + ctx.t += ctx.c; + while (ctx.c < 128) { + ctx.b[ctx.c++] = 0; + } + blake2bCompress(ctx, true); + const out = new Uint8Array(ctx.outlen); + for (let i = 0; i < ctx.outlen; i++) { + out[i] = ctx.h[i >> 2] >> 8 * (i & 3); + } + return out; + } + function blake2b3(input, key, outlen, salt, personal) { + outlen = outlen || 64; + input = util.normalizeInput(input); + if (salt) { + salt = util.normalizeInput(salt); + } + if (personal) { + personal = util.normalizeInput(personal); + } + const ctx = blake2bInit2(outlen, key, salt, personal); + blake2bUpdate2(ctx, input); + return blake2bFinal2(ctx); + } + function blake2bHex(input, key, outlen, salt, personal) { + const output = blake2b3(input, key, outlen, salt, personal); + return util.toHex(output); + } + module.exports = { + blake2b: blake2b3, + blake2bHex, + blake2bInit: blake2bInit2, + blake2bUpdate: blake2bUpdate2, + blake2bFinal: blake2bFinal2 + }; + } + }); + + // node_modules/blakejs/blake2s.js + var require_blake2s = __commonJS({ + "node_modules/blakejs/blake2s.js"(exports, module) { + var util = require_util(); + function B2S_GET32(v2, i) { + return v2[i] ^ v2[i + 1] << 8 ^ v2[i + 2] << 16 ^ v2[i + 3] << 24; + } + function B2S_G(a, b, c, d, x, y) { + v[a] = v[a] + v[b] + x; + v[d] = ROTR32(v[d] ^ v[a], 16); + v[c] = v[c] + v[d]; + v[b] = ROTR32(v[b] ^ v[c], 12); + v[a] = v[a] + v[b] + y; + v[d] = ROTR32(v[d] ^ v[a], 8); + v[c] = v[c] + v[d]; + v[b] = ROTR32(v[b] ^ v[c], 7); + } + function ROTR32(x, y) { + return x >>> y ^ x << 32 - y; + } + var BLAKE2S_IV = new Uint32Array([ + 1779033703, + 3144134277, + 1013904242, + 2773480762, + 1359893119, + 2600822924, + 528734635, + 1541459225 + ]); + var SIGMA = new Uint8Array([ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 14, + 10, + 4, + 8, + 9, + 15, + 13, + 6, + 1, + 12, + 0, + 2, + 11, + 7, + 5, + 3, + 11, + 8, + 12, + 0, + 5, + 2, + 15, + 13, + 10, + 14, + 3, + 6, + 7, + 1, + 9, + 4, + 7, + 9, + 3, + 1, + 13, + 12, + 11, + 14, + 2, + 6, + 5, + 10, + 4, + 0, + 15, + 8, + 9, + 0, + 5, + 7, + 2, + 4, + 10, + 15, + 14, + 1, + 11, + 12, + 6, + 8, + 3, + 13, + 2, + 12, + 6, + 10, + 0, + 11, + 8, + 3, + 4, + 13, + 7, + 5, + 15, + 14, + 1, + 9, + 12, + 5, + 1, + 15, + 14, + 13, + 4, + 10, + 0, + 7, + 6, + 3, + 9, + 2, + 8, + 11, + 13, + 11, + 7, + 14, + 12, + 1, + 3, + 9, + 5, + 0, + 15, + 4, + 8, + 6, + 2, + 10, + 6, + 15, + 14, + 9, + 11, + 3, + 0, + 8, + 12, + 2, + 13, + 7, + 1, + 4, + 10, + 5, + 10, + 2, + 8, + 4, + 7, + 6, + 1, + 5, + 15, + 11, + 9, + 14, + 3, + 12, + 13, + 0 + ]); + var v = new Uint32Array(16); + var m = new Uint32Array(16); + function blake2sCompress(ctx, last) { + let i = 0; + for (i = 0; i < 8; i++) { + v[i] = ctx.h[i]; + v[i + 8] = BLAKE2S_IV[i]; + } + v[12] ^= ctx.t; + v[13] ^= ctx.t / 4294967296; + if (last) { + v[14] = ~v[14]; + } + for (i = 0; i < 16; i++) { + m[i] = B2S_GET32(ctx.b, 4 * i); + } + for (i = 0; i < 10; i++) { + B2S_G(0, 4, 8, 12, m[SIGMA[i * 16 + 0]], m[SIGMA[i * 16 + 1]]); + B2S_G(1, 5, 9, 13, m[SIGMA[i * 16 + 2]], m[SIGMA[i * 16 + 3]]); + B2S_G(2, 6, 10, 14, m[SIGMA[i * 16 + 4]], m[SIGMA[i * 16 + 5]]); + B2S_G(3, 7, 11, 15, m[SIGMA[i * 16 + 6]], m[SIGMA[i * 16 + 7]]); + B2S_G(0, 5, 10, 15, m[SIGMA[i * 16 + 8]], m[SIGMA[i * 16 + 9]]); + B2S_G(1, 6, 11, 12, m[SIGMA[i * 16 + 10]], m[SIGMA[i * 16 + 11]]); + B2S_G(2, 7, 8, 13, m[SIGMA[i * 16 + 12]], m[SIGMA[i * 16 + 13]]); + B2S_G(3, 4, 9, 14, m[SIGMA[i * 16 + 14]], m[SIGMA[i * 16 + 15]]); + } + for (i = 0; i < 8; i++) { + ctx.h[i] ^= v[i] ^ v[i + 8]; + } + } + function blake2sInit(outlen, key) { + if (!(outlen > 0 && outlen <= 32)) { + throw new Error("Incorrect output length, should be in [1, 32]"); + } + const keylen = key ? key.length : 0; + if (key && !(keylen > 0 && keylen <= 32)) { + throw new Error("Incorrect key length, should be in [1, 32]"); + } + const ctx = { + h: new Uint32Array(BLAKE2S_IV), + b: new Uint8Array(64), + c: 0, + t: 0, + outlen + }; + ctx.h[0] ^= 16842752 ^ keylen << 8 ^ outlen; + if (keylen > 0) { + blake2sUpdate(ctx, key); + ctx.c = 64; + } + return ctx; + } + function blake2sUpdate(ctx, input) { + for (let i = 0; i < input.length; i++) { + if (ctx.c === 64) { + ctx.t += ctx.c; + blake2sCompress(ctx, false); + ctx.c = 0; + } + ctx.b[ctx.c++] = input[i]; + } + } + function blake2sFinal(ctx) { + ctx.t += ctx.c; + while (ctx.c < 64) { + ctx.b[ctx.c++] = 0; + } + blake2sCompress(ctx, true); + const out = new Uint8Array(ctx.outlen); + for (let i = 0; i < ctx.outlen; i++) { + out[i] = ctx.h[i >> 2] >> 8 * (i & 3) & 255; + } + return out; + } + function blake2s(input, key, outlen) { + outlen = outlen || 32; + input = util.normalizeInput(input); + const ctx = blake2sInit(outlen, key); + blake2sUpdate(ctx, input); + return blake2sFinal(ctx); + } + function blake2sHex(input, key, outlen) { + const output = blake2s(input, key, outlen); + return util.toHex(output); + } + module.exports = { + blake2s, + blake2sHex, + blake2sInit, + blake2sUpdate, + blake2sFinal + }; + } + }); + + // node_modules/blakejs/index.js + var require_blakejs = __commonJS({ + "node_modules/blakejs/index.js"(exports, module) { + var b2b = require_blake2b(); + var b2s = require_blake2s(); + module.exports = { + blake2b: b2b.blake2b, + blake2bHex: b2b.blake2bHex, + blake2bInit: b2b.blake2bInit, + blake2bUpdate: b2b.blake2bUpdate, + blake2bFinal: b2b.blake2bFinal, + blake2s: b2s.blake2s, + blake2sHex: b2s.blake2sHex, + blake2sInit: b2s.blake2sInit, + blake2sUpdate: b2s.blake2sUpdate, + blake2sFinal: b2s.blake2sFinal + }; + } + }); + + // node_modules/base64-js/index.js + var require_base64_js = __commonJS({ + "node_modules/base64-js/index.js"(exports) { + "use strict"; + exports.byteLength = byteLength; + exports.toByteArray = toByteArray; + exports.fromByteArray = fromByteArray; + var lookup = []; + var revLookup = []; + var Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array; + var code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + for (i = 0, len = code.length; i < len; ++i) { + lookup[i] = code[i]; + revLookup[code.charCodeAt(i)] = i; + } + var i; + var len; + revLookup["-".charCodeAt(0)] = 62; + revLookup["_".charCodeAt(0)] = 63; + function getLens(b64) { + var len2 = b64.length; + if (len2 % 4 > 0) { + throw new Error("Invalid string. Length must be a multiple of 4"); + } + var validLen = b64.indexOf("="); + if (validLen === -1) + validLen = len2; + var placeHoldersLen = validLen === len2 ? 0 : 4 - validLen % 4; + return [validLen, placeHoldersLen]; + } + function byteLength(b64) { + var lens = getLens(b64); + var validLen = lens[0]; + var placeHoldersLen = lens[1]; + return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; + } + function _byteLength(b64, validLen, placeHoldersLen) { + return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; + } + function toByteArray(b64) { + var tmp; + var lens = getLens(b64); + var validLen = lens[0]; + var placeHoldersLen = lens[1]; + var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)); + var curByte = 0; + var len2 = placeHoldersLen > 0 ? validLen - 4 : validLen; + var i2; + for (i2 = 0; i2 < len2; i2 += 4) { + tmp = revLookup[b64.charCodeAt(i2)] << 18 | revLookup[b64.charCodeAt(i2 + 1)] << 12 | revLookup[b64.charCodeAt(i2 + 2)] << 6 | revLookup[b64.charCodeAt(i2 + 3)]; + arr[curByte++] = tmp >> 16 & 255; + arr[curByte++] = tmp >> 8 & 255; + arr[curByte++] = tmp & 255; + } + if (placeHoldersLen === 2) { + tmp = revLookup[b64.charCodeAt(i2)] << 2 | revLookup[b64.charCodeAt(i2 + 1)] >> 4; + arr[curByte++] = tmp & 255; + } + if (placeHoldersLen === 1) { + tmp = revLookup[b64.charCodeAt(i2)] << 10 | revLookup[b64.charCodeAt(i2 + 1)] << 4 | revLookup[b64.charCodeAt(i2 + 2)] >> 2; + arr[curByte++] = tmp >> 8 & 255; + arr[curByte++] = tmp & 255; + } + return arr; + } + function tripletToBase64(num) { + return lookup[num >> 18 & 63] + lookup[num >> 12 & 63] + lookup[num >> 6 & 63] + lookup[num & 63]; + } + function encodeChunk(uint8, start, end) { + var tmp; + var output = []; + for (var i2 = start; i2 < end; i2 += 3) { + tmp = (uint8[i2] << 16 & 16711680) + (uint8[i2 + 1] << 8 & 65280) + (uint8[i2 + 2] & 255); + output.push(tripletToBase64(tmp)); + } + return output.join(""); + } + function fromByteArray(uint8) { + var tmp; + var len2 = uint8.length; + var extraBytes = len2 % 3; + var parts = []; + var maxChunkLength = 16383; + for (var i2 = 0, len22 = len2 - extraBytes; i2 < len22; i2 += maxChunkLength) { + parts.push(encodeChunk(uint8, i2, i2 + maxChunkLength > len22 ? len22 : i2 + maxChunkLength)); + } + if (extraBytes === 1) { + tmp = uint8[len2 - 1]; + parts.push(lookup[tmp >> 2] + lookup[tmp << 4 & 63] + "=="); + } else if (extraBytes === 2) { + tmp = (uint8[len2 - 2] << 8) + uint8[len2 - 1]; + parts.push(lookup[tmp >> 10] + lookup[tmp >> 4 & 63] + lookup[tmp << 2 & 63] + "="); + } + return parts.join(""); + } + } + }); + + // node_modules/ieee754/index.js + var require_ieee754 = __commonJS({ + "node_modules/ieee754/index.js"(exports) { + exports.read = function(buffer, offset, isLE, mLen, nBytes) { + var e, m; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var nBits = -7; + var i = isLE ? nBytes - 1 : 0; + var d = isLE ? -1 : 1; + var s = buffer[offset + i]; + i += d; + e = s & (1 << -nBits) - 1; + s >>= -nBits; + nBits += eLen; + for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) { + } + m = e & (1 << -nBits) - 1; + e >>= -nBits; + nBits += mLen; + for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) { + } + if (e === 0) { + e = 1 - eBias; + } else if (e === eMax) { + return m ? NaN : (s ? -1 : 1) * Infinity; + } else { + m = m + Math.pow(2, mLen); + e = e - eBias; + } + return (s ? -1 : 1) * m * Math.pow(2, e - mLen); + }; + exports.write = function(buffer, value, offset, isLE, mLen, nBytes) { + var e, m, c; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0; + var i = isLE ? 0 : nBytes - 1; + var d = isLE ? 1 : -1; + var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; + value = Math.abs(value); + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0; + e = eMax; + } else { + e = Math.floor(Math.log(value) / Math.LN2); + if (value * (c = Math.pow(2, -e)) < 1) { + e--; + c *= 2; + } + if (e + eBias >= 1) { + value += rt / c; + } else { + value += rt * Math.pow(2, 1 - eBias); + } + if (value * c >= 2) { + e++; + c /= 2; + } + if (e + eBias >= eMax) { + m = 0; + e = eMax; + } else if (e + eBias >= 1) { + m = (value * c - 1) * Math.pow(2, mLen); + e = e + eBias; + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); + e = 0; + } + } + for (; mLen >= 8; buffer[offset + i] = m & 255, i += d, m /= 256, mLen -= 8) { + } + e = e << mLen | m; + eLen += mLen; + for (; eLen > 0; buffer[offset + i] = e & 255, i += d, e /= 256, eLen -= 8) { + } + buffer[offset + i - d] |= s * 128; + }; + } + }); + + // node_modules/buffer/index.js + var require_buffer = __commonJS({ + "node_modules/buffer/index.js"(exports) { + "use strict"; + var base64 = require_base64_js(); + var ieee754 = require_ieee754(); + var customInspectSymbol = typeof Symbol === "function" && typeof Symbol["for"] === "function" ? Symbol["for"]("nodejs.util.inspect.custom") : null; + exports.Buffer = Buffer2; + exports.SlowBuffer = SlowBuffer; + exports.INSPECT_MAX_BYTES = 50; + var K_MAX_LENGTH = 2147483647; + exports.kMaxLength = K_MAX_LENGTH; + Buffer2.TYPED_ARRAY_SUPPORT = typedArraySupport(); + if (!Buffer2.TYPED_ARRAY_SUPPORT && typeof console !== "undefined" && 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 typedArraySupport() { + try { + const arr = new Uint8Array(1); + const proto3 = { foo: function() { + return 42; + } }; + Object.setPrototypeOf(proto3, Uint8Array.prototype); + Object.setPrototypeOf(arr, proto3); + return arr.foo() === 42; + } catch (e) { + return false; + } + } + Object.defineProperty(Buffer2.prototype, "parent", { + enumerable: true, + get: function() { + if (!Buffer2.isBuffer(this)) + return void 0; + return this.buffer; + } + }); + Object.defineProperty(Buffer2.prototype, "offset", { + enumerable: true, + get: function() { + if (!Buffer2.isBuffer(this)) + return void 0; + return this.byteOffset; + } + }); + function createBuffer(length2) { + if (length2 > K_MAX_LENGTH) { + throw new RangeError('The value "' + length2 + '" is invalid for option "size"'); + } + const buf = new Uint8Array(length2); + Object.setPrototypeOf(buf, Buffer2.prototype); + return buf; + } + function Buffer2(arg, encodingOrOffset, length2) { + if (typeof arg === "number") { + if (typeof encodingOrOffset === "string") { + throw new TypeError('The "string" argument must be of type string. Received type number'); + } + return allocUnsafe(arg); + } + return from3(arg, encodingOrOffset, length2); + } + Buffer2.poolSize = 8192; + function from3(value, encodingOrOffset, length2) { + if (typeof value === "string") { + return fromString(value, encodingOrOffset); + } + if (ArrayBuffer.isView(value)) { + return fromArrayView(value); + } + if (value == null) { + throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value); + } + if (isInstance(value, ArrayBuffer) || value && isInstance(value.buffer, ArrayBuffer)) { + return fromArrayBuffer(value, encodingOrOffset, length2); + } + if (typeof SharedArrayBuffer !== "undefined" && (isInstance(value, SharedArrayBuffer) || value && isInstance(value.buffer, SharedArrayBuffer))) { + return fromArrayBuffer(value, encodingOrOffset, length2); + } + if (typeof value === "number") { + throw new TypeError('The "value" argument must not be of type number. Received type number'); + } + const valueOf = value.valueOf && value.valueOf(); + if (valueOf != null && valueOf !== value) { + return Buffer2.from(valueOf, encodingOrOffset, length2); + } + const b = fromObject(value); + if (b) + return b; + if (typeof Symbol !== "undefined" && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === "function") { + return Buffer2.from(value[Symbol.toPrimitive]("string"), encodingOrOffset, length2); + } + throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value); + } + Buffer2.from = function(value, encodingOrOffset, length2) { + return from3(value, encodingOrOffset, length2); + }; + Object.setPrototypeOf(Buffer2.prototype, Uint8Array.prototype); + Object.setPrototypeOf(Buffer2, Uint8Array); + function assertSize(size) { + if (typeof size !== "number") { + throw new TypeError('"size" argument must be of type number'); + } else if (size < 0) { + throw new RangeError('The value "' + size + '" is invalid for option "size"'); + } + } + function alloc(size, fill, encoding) { + assertSize(size); + if (size <= 0) { + return createBuffer(size); + } + if (fill !== void 0) { + return typeof encoding === "string" ? createBuffer(size).fill(fill, encoding) : createBuffer(size).fill(fill); + } + return createBuffer(size); + } + Buffer2.alloc = function(size, fill, encoding) { + return alloc(size, fill, encoding); + }; + function allocUnsafe(size) { + assertSize(size); + return createBuffer(size < 0 ? 0 : checked(size) | 0); + } + Buffer2.allocUnsafe = function(size) { + return allocUnsafe(size); + }; + Buffer2.allocUnsafeSlow = function(size) { + return allocUnsafe(size); + }; + function fromString(string3, encoding) { + if (typeof encoding !== "string" || encoding === "") { + encoding = "utf8"; + } + if (!Buffer2.isEncoding(encoding)) { + throw new TypeError("Unknown encoding: " + encoding); + } + const length2 = byteLength(string3, encoding) | 0; + let buf = createBuffer(length2); + const actual = buf.write(string3, encoding); + if (actual !== length2) { + buf = buf.slice(0, actual); + } + return buf; + } + function fromArrayLike(array) { + const length2 = array.length < 0 ? 0 : checked(array.length) | 0; + const buf = createBuffer(length2); + for (let i = 0; i < length2; i += 1) { + buf[i] = array[i] & 255; + } + return buf; + } + function fromArrayView(arrayView) { + if (isInstance(arrayView, Uint8Array)) { + const copy = new Uint8Array(arrayView); + return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength); + } + return fromArrayLike(arrayView); + } + function fromArrayBuffer(array, byteOffset, length2) { + if (byteOffset < 0 || array.byteLength < byteOffset) { + throw new RangeError('"offset" is outside of buffer bounds'); + } + if (array.byteLength < byteOffset + (length2 || 0)) { + throw new RangeError('"length" is outside of buffer bounds'); + } + let buf; + if (byteOffset === void 0 && length2 === void 0) { + buf = new Uint8Array(array); + } else if (length2 === void 0) { + buf = new Uint8Array(array, byteOffset); + } else { + buf = new Uint8Array(array, byteOffset, length2); + } + Object.setPrototypeOf(buf, Buffer2.prototype); + return buf; + } + function fromObject(obj) { + if (Buffer2.isBuffer(obj)) { + const len = checked(obj.length) | 0; + const buf = createBuffer(len); + if (buf.length === 0) { + return buf; + } + obj.copy(buf, 0, 0, len); + return buf; + } + if (obj.length !== void 0) { + if (typeof obj.length !== "number" || numberIsNaN(obj.length)) { + return createBuffer(0); + } + return fromArrayLike(obj); + } + if (obj.type === "Buffer" && Array.isArray(obj.data)) { + return fromArrayLike(obj.data); + } + } + function checked(length2) { + if (length2 >= K_MAX_LENGTH) { + throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + K_MAX_LENGTH.toString(16) + " bytes"); + } + return length2 | 0; + } + function SlowBuffer(length2) { + if (+length2 != length2) { + length2 = 0; + } + return Buffer2.alloc(+length2); + } + Buffer2.isBuffer = function isBuffer(b) { + return b != null && b._isBuffer === true && b !== Buffer2.prototype; + }; + Buffer2.compare = function compare(a, b) { + if (isInstance(a, Uint8Array)) + a = Buffer2.from(a, a.offset, a.byteLength); + if (isInstance(b, Uint8Array)) + b = Buffer2.from(b, b.offset, b.byteLength); + if (!Buffer2.isBuffer(a) || !Buffer2.isBuffer(b)) { + throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'); + } + if (a === b) + return 0; + let x = a.length; + let y = b.length; + for (let i = 0, len = Math.min(x, y); i < len; ++i) { + if (a[i] !== b[i]) { + x = a[i]; + y = b[i]; + break; + } + } + if (x < y) + return -1; + if (y < x) + return 1; + return 0; + }; + Buffer2.isEncoding = function isEncoding(encoding) { + switch (String(encoding).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 true; + default: + return false; + } + }; + Buffer2.concat = function concat(list, length2) { + if (!Array.isArray(list)) { + throw new TypeError('"list" argument must be an Array of Buffers'); + } + if (list.length === 0) { + return Buffer2.alloc(0); + } + let i; + if (length2 === void 0) { + length2 = 0; + for (i = 0; i < list.length; ++i) { + length2 += list[i].length; + } + } + const buffer = Buffer2.allocUnsafe(length2); + let pos = 0; + for (i = 0; i < list.length; ++i) { + let buf = list[i]; + if (isInstance(buf, Uint8Array)) { + if (pos + buf.length > buffer.length) { + if (!Buffer2.isBuffer(buf)) + buf = Buffer2.from(buf); + buf.copy(buffer, pos); + } else { + Uint8Array.prototype.set.call(buffer, buf, pos); + } + } else if (!Buffer2.isBuffer(buf)) { + throw new TypeError('"list" argument must be an Array of Buffers'); + } else { + buf.copy(buffer, pos); + } + pos += buf.length; + } + return buffer; + }; + function byteLength(string3, encoding) { + if (Buffer2.isBuffer(string3)) { + return string3.length; + } + if (ArrayBuffer.isView(string3) || isInstance(string3, ArrayBuffer)) { + return string3.byteLength; + } + if (typeof string3 !== "string") { + throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof string3); + } + const len = string3.length; + const mustMatch = arguments.length > 2 && arguments[2] === true; + if (!mustMatch && len === 0) + return 0; + let loweredCase = false; + for (; ; ) { + switch (encoding) { + case "ascii": + case "latin1": + case "binary": + return len; + case "utf8": + case "utf-8": + return utf8ToBytes(string3).length; + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return len * 2; + case "hex": + return len >>> 1; + case "base64": + return base64ToBytes(string3).length; + default: + if (loweredCase) { + return mustMatch ? -1 : utf8ToBytes(string3).length; + } + encoding = ("" + encoding).toLowerCase(); + loweredCase = true; + } + } + } + Buffer2.byteLength = byteLength; + function slowToString(encoding, start, end) { + let loweredCase = false; + if (start === void 0 || start < 0) { + start = 0; + } + if (start > this.length) { + return ""; + } + if (end === void 0 || end > this.length) { + end = this.length; + } + if (end <= 0) { + return ""; + } + end >>>= 0; + start >>>= 0; + if (end <= start) { + return ""; + } + if (!encoding) + encoding = "utf8"; + while (true) { + switch (encoding) { + case "hex": + return hexSlice(this, start, end); + case "utf8": + case "utf-8": + return utf8Slice(this, start, end); + case "ascii": + return asciiSlice(this, start, end); + case "latin1": + case "binary": + return latin1Slice(this, start, end); + case "base64": + return base64Slice(this, start, end); + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return utf16leSlice(this, start, end); + default: + if (loweredCase) + throw new TypeError("Unknown encoding: " + encoding); + encoding = (encoding + "").toLowerCase(); + loweredCase = true; + } + } + } + Buffer2.prototype._isBuffer = true; + function swap(b, n, m) { + const i = b[n]; + b[n] = b[m]; + b[m] = i; + } + Buffer2.prototype.swap16 = function swap16() { + const len = this.length; + if (len % 2 !== 0) { + throw new RangeError("Buffer size must be a multiple of 16-bits"); + } + for (let i = 0; i < len; i += 2) { + swap(this, i, i + 1); + } + return this; + }; + Buffer2.prototype.swap32 = function swap32() { + const len = this.length; + if (len % 4 !== 0) { + throw new RangeError("Buffer size must be a multiple of 32-bits"); + } + for (let i = 0; i < len; i += 4) { + swap(this, i, i + 3); + swap(this, i + 1, i + 2); + } + return this; + }; + Buffer2.prototype.swap64 = function swap64() { + const len = this.length; + if (len % 8 !== 0) { + throw new RangeError("Buffer size must be a multiple of 64-bits"); + } + for (let i = 0; i < len; i += 8) { + swap(this, i, i + 7); + swap(this, i + 1, i + 6); + swap(this, i + 2, i + 5); + swap(this, i + 3, i + 4); + } + return this; + }; + Buffer2.prototype.toString = function toString() { + const length2 = this.length; + if (length2 === 0) + return ""; + if (arguments.length === 0) + return utf8Slice(this, 0, length2); + return slowToString.apply(this, arguments); + }; + Buffer2.prototype.toLocaleString = Buffer2.prototype.toString; + Buffer2.prototype.equals = function equals3(b) { + if (!Buffer2.isBuffer(b)) + throw new TypeError("Argument must be a Buffer"); + if (this === b) + return true; + return Buffer2.compare(this, b) === 0; + }; + Buffer2.prototype.inspect = function inspect() { + let str = ""; + const max = exports.INSPECT_MAX_BYTES; + str = this.toString("hex", 0, max).replace(/(.{2})/g, "$1 ").trim(); + if (this.length > max) + str += " ... "; + return ""; + }; + if (customInspectSymbol) { + Buffer2.prototype[customInspectSymbol] = Buffer2.prototype.inspect; + } + Buffer2.prototype.compare = function compare(target, start, end, thisStart, thisEnd) { + if (isInstance(target, Uint8Array)) { + target = Buffer2.from(target, target.offset, target.byteLength); + } + if (!Buffer2.isBuffer(target)) { + throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof target); + } + if (start === void 0) { + start = 0; + } + if (end === void 0) { + end = target ? target.length : 0; + } + if (thisStart === void 0) { + thisStart = 0; + } + if (thisEnd === void 0) { + thisEnd = this.length; + } + if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { + throw new RangeError("out of range index"); + } + if (thisStart >= thisEnd && start >= end) { + return 0; + } + if (thisStart >= thisEnd) { + return -1; + } + if (start >= end) { + return 1; + } + start >>>= 0; + end >>>= 0; + thisStart >>>= 0; + thisEnd >>>= 0; + if (this === target) + return 0; + let x = thisEnd - thisStart; + let y = end - start; + const len = Math.min(x, y); + const thisCopy = this.slice(thisStart, thisEnd); + const targetCopy = target.slice(start, end); + for (let i = 0; i < len; ++i) { + if (thisCopy[i] !== targetCopy[i]) { + x = thisCopy[i]; + y = targetCopy[i]; + break; + } + } + if (x < y) + return -1; + if (y < x) + return 1; + return 0; + }; + function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) { + if (buffer.length === 0) + return -1; + if (typeof byteOffset === "string") { + encoding = byteOffset; + byteOffset = 0; + } else if (byteOffset > 2147483647) { + byteOffset = 2147483647; + } else if (byteOffset < -2147483648) { + byteOffset = -2147483648; + } + byteOffset = +byteOffset; + if (numberIsNaN(byteOffset)) { + byteOffset = dir ? 0 : buffer.length - 1; + } + if (byteOffset < 0) + byteOffset = buffer.length + byteOffset; + if (byteOffset >= buffer.length) { + if (dir) + return -1; + else + byteOffset = buffer.length - 1; + } else if (byteOffset < 0) { + if (dir) + byteOffset = 0; + else + return -1; + } + if (typeof val === "string") { + val = Buffer2.from(val, encoding); + } + if (Buffer2.isBuffer(val)) { + if (val.length === 0) { + return -1; + } + return arrayIndexOf(buffer, val, byteOffset, encoding, dir); + } else if (typeof val === "number") { + val = val & 255; + if (typeof Uint8Array.prototype.indexOf === "function") { + if (dir) { + return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset); + } else { + return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset); + } + } + return arrayIndexOf(buffer, [val], byteOffset, encoding, dir); + } + throw new TypeError("val must be string, number or Buffer"); + } + function arrayIndexOf(arr, val, byteOffset, encoding, dir) { + let indexSize = 1; + let arrLength = arr.length; + let valLength = val.length; + if (encoding !== void 0) { + encoding = String(encoding).toLowerCase(); + if (encoding === "ucs2" || encoding === "ucs-2" || encoding === "utf16le" || encoding === "utf-16le") { + if (arr.length < 2 || val.length < 2) { + return -1; + } + indexSize = 2; + arrLength /= 2; + valLength /= 2; + byteOffset /= 2; + } + } + function read2(buf, i2) { + if (indexSize === 1) { + return buf[i2]; + } else { + return buf.readUInt16BE(i2 * indexSize); + } + } + let i; + if (dir) { + let foundIndex = -1; + for (i = byteOffset; i < arrLength; i++) { + if (read2(arr, i) === read2(val, foundIndex === -1 ? 0 : i - foundIndex)) { + if (foundIndex === -1) + foundIndex = i; + if (i - foundIndex + 1 === valLength) + return foundIndex * indexSize; + } else { + if (foundIndex !== -1) + i -= i - foundIndex; + foundIndex = -1; + } + } + } else { + if (byteOffset + valLength > arrLength) + byteOffset = arrLength - valLength; + for (i = byteOffset; i >= 0; i--) { + let found = true; + for (let j = 0; j < valLength; j++) { + if (read2(arr, i + j) !== read2(val, j)) { + found = false; + break; + } + } + if (found) + return i; + } + } + return -1; + } + Buffer2.prototype.includes = function includes(val, byteOffset, encoding) { + return this.indexOf(val, byteOffset, encoding) !== -1; + }; + Buffer2.prototype.indexOf = function indexOf(val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, true); + }; + Buffer2.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, false); + }; + function hexWrite(buf, string3, offset, length2) { + offset = Number(offset) || 0; + const remaining = buf.length - offset; + if (!length2) { + length2 = remaining; + } else { + length2 = Number(length2); + if (length2 > remaining) { + length2 = remaining; + } + } + const strLen = string3.length; + if (length2 > strLen / 2) { + length2 = strLen / 2; + } + let i; + for (i = 0; i < length2; ++i) { + const parsed = parseInt(string3.substr(i * 2, 2), 16); + if (numberIsNaN(parsed)) + return i; + buf[offset + i] = parsed; + } + return i; + } + function utf8Write(buf, string3, offset, length2) { + return blitBuffer(utf8ToBytes(string3, buf.length - offset), buf, offset, length2); + } + function asciiWrite(buf, string3, offset, length2) { + return blitBuffer(asciiToBytes(string3), buf, offset, length2); + } + function base64Write(buf, string3, offset, length2) { + return blitBuffer(base64ToBytes(string3), buf, offset, length2); + } + function ucs2Write(buf, string3, offset, length2) { + return blitBuffer(utf16leToBytes(string3, buf.length - offset), buf, offset, length2); + } + Buffer2.prototype.write = function write(string3, offset, length2, encoding) { + if (offset === void 0) { + encoding = "utf8"; + length2 = this.length; + offset = 0; + } else if (length2 === void 0 && typeof offset === "string") { + encoding = offset; + length2 = this.length; + offset = 0; + } else if (isFinite(offset)) { + offset = offset >>> 0; + if (isFinite(length2)) { + length2 = length2 >>> 0; + if (encoding === void 0) + encoding = "utf8"; + } else { + encoding = length2; + length2 = void 0; + } + } else { + throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported"); + } + const remaining = this.length - offset; + if (length2 === void 0 || length2 > remaining) + length2 = remaining; + if (string3.length > 0 && (length2 < 0 || offset < 0) || offset > this.length) { + throw new RangeError("Attempt to write outside buffer bounds"); + } + if (!encoding) + encoding = "utf8"; + let loweredCase = false; + for (; ; ) { + switch (encoding) { + case "hex": + return hexWrite(this, string3, offset, length2); + case "utf8": + case "utf-8": + return utf8Write(this, string3, offset, length2); + case "ascii": + case "latin1": + case "binary": + return asciiWrite(this, string3, offset, length2); + case "base64": + return base64Write(this, string3, offset, length2); + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return ucs2Write(this, string3, offset, length2); + default: + if (loweredCase) + throw new TypeError("Unknown encoding: " + encoding); + encoding = ("" + encoding).toLowerCase(); + loweredCase = true; + } + } + }; + Buffer2.prototype.toJSON = function toJSON() { + return { + type: "Buffer", + data: Array.prototype.slice.call(this._arr || this, 0) + }; + }; + function base64Slice(buf, start, end) { + if (start === 0 && end === buf.length) { + return base64.fromByteArray(buf); + } else { + return base64.fromByteArray(buf.slice(start, end)); + } + } + function utf8Slice(buf, start, end) { + end = Math.min(buf.length, end); + const res = []; + let i = start; + while (i < end) { + const firstByte = buf[i]; + let codePoint = null; + let bytesPerSequence = firstByte > 239 ? 4 : firstByte > 223 ? 3 : firstByte > 191 ? 2 : 1; + if (i + bytesPerSequence <= end) { + let secondByte, thirdByte, fourthByte, tempCodePoint; + switch (bytesPerSequence) { + case 1: + if (firstByte < 128) { + codePoint = firstByte; + } + break; + case 2: + secondByte = buf[i + 1]; + if ((secondByte & 192) === 128) { + tempCodePoint = (firstByte & 31) << 6 | secondByte & 63; + if (tempCodePoint > 127) { + codePoint = tempCodePoint; + } + } + break; + case 3: + secondByte = buf[i + 1]; + thirdByte = buf[i + 2]; + if ((secondByte & 192) === 128 && (thirdByte & 192) === 128) { + tempCodePoint = (firstByte & 15) << 12 | (secondByte & 63) << 6 | thirdByte & 63; + if (tempCodePoint > 2047 && (tempCodePoint < 55296 || tempCodePoint > 57343)) { + codePoint = tempCodePoint; + } + } + break; + case 4: + secondByte = buf[i + 1]; + thirdByte = buf[i + 2]; + fourthByte = buf[i + 3]; + if ((secondByte & 192) === 128 && (thirdByte & 192) === 128 && (fourthByte & 192) === 128) { + tempCodePoint = (firstByte & 15) << 18 | (secondByte & 63) << 12 | (thirdByte & 63) << 6 | fourthByte & 63; + if (tempCodePoint > 65535 && tempCodePoint < 1114112) { + codePoint = tempCodePoint; + } + } + } + } + if (codePoint === null) { + codePoint = 65533; + bytesPerSequence = 1; + } else if (codePoint > 65535) { + codePoint -= 65536; + res.push(codePoint >>> 10 & 1023 | 55296); + codePoint = 56320 | codePoint & 1023; + } + res.push(codePoint); + i += bytesPerSequence; + } + return decodeCodePointsArray(res); + } + var MAX_ARGUMENTS_LENGTH = 4096; + function decodeCodePointsArray(codePoints) { + const len = codePoints.length; + if (len <= MAX_ARGUMENTS_LENGTH) { + return String.fromCharCode.apply(String, codePoints); + } + let res = ""; + let i = 0; + while (i < len) { + res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)); + } + return res; + } + function asciiSlice(buf, start, end) { + let ret = ""; + end = Math.min(buf.length, end); + for (let i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i] & 127); + } + return ret; + } + function latin1Slice(buf, start, end) { + let ret = ""; + end = Math.min(buf.length, end); + for (let i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i]); + } + return ret; + } + function hexSlice(buf, start, end) { + const len = buf.length; + if (!start || start < 0) + start = 0; + if (!end || end < 0 || end > len) + end = len; + let out = ""; + for (let i = start; i < end; ++i) { + out += hexSliceLookupTable[buf[i]]; + } + return out; + } + function utf16leSlice(buf, start, end) { + const bytes = buf.slice(start, end); + let res = ""; + for (let i = 0; i < bytes.length - 1; i += 2) { + res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256); + } + return res; + } + Buffer2.prototype.slice = function slice(start, end) { + const len = this.length; + start = ~~start; + end = end === void 0 ? len : ~~end; + if (start < 0) { + start += len; + if (start < 0) + start = 0; + } else if (start > len) { + start = len; + } + if (end < 0) { + end += len; + if (end < 0) + end = 0; + } else if (end > len) { + end = len; + } + if (end < start) + end = start; + const newBuf = this.subarray(start, end); + Object.setPrototypeOf(newBuf, Buffer2.prototype); + return newBuf; + }; + function checkOffset(offset, ext, length2) { + if (offset % 1 !== 0 || offset < 0) + throw new RangeError("offset is not uint"); + if (offset + ext > length2) + throw new RangeError("Trying to access beyond buffer length"); + } + Buffer2.prototype.readUintLE = Buffer2.prototype.readUIntLE = function readUIntLE(offset, byteLength2, noAssert) { + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) + checkOffset(offset, byteLength2, this.length); + let val = this[offset]; + let mul = 1; + let i = 0; + while (++i < byteLength2 && (mul *= 256)) { + val += this[offset + i] * mul; + } + return val; + }; + Buffer2.prototype.readUintBE = Buffer2.prototype.readUIntBE = function readUIntBE(offset, byteLength2, noAssert) { + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) { + checkOffset(offset, byteLength2, this.length); + } + let val = this[offset + --byteLength2]; + let mul = 1; + while (byteLength2 > 0 && (mul *= 256)) { + val += this[offset + --byteLength2] * mul; + } + return val; + }; + Buffer2.prototype.readUint8 = Buffer2.prototype.readUInt8 = function readUInt8(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 1, this.length); + return this[offset]; + }; + Buffer2.prototype.readUint16LE = Buffer2.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 2, this.length); + return this[offset] | this[offset + 1] << 8; + }; + Buffer2.prototype.readUint16BE = Buffer2.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 2, this.length); + return this[offset] << 8 | this[offset + 1]; + }; + Buffer2.prototype.readUint32LE = Buffer2.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 16777216; + }; + Buffer2.prototype.readUint32BE = Buffer2.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return this[offset] * 16777216 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]); + }; + Buffer2.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE(offset) { + offset = offset >>> 0; + validateNumber(offset, "offset"); + const first = this[offset]; + const last = this[offset + 7]; + if (first === void 0 || last === void 0) { + boundsError(offset, this.length - 8); + } + const lo = first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24; + const hi = this[++offset] + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + last * 2 ** 24; + return BigInt(lo) + (BigInt(hi) << BigInt(32)); + }); + Buffer2.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE(offset) { + offset = offset >>> 0; + validateNumber(offset, "offset"); + const first = this[offset]; + const last = this[offset + 7]; + if (first === void 0 || last === void 0) { + boundsError(offset, this.length - 8); + } + const hi = first * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset]; + const lo = this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last; + return (BigInt(hi) << BigInt(32)) + BigInt(lo); + }); + Buffer2.prototype.readIntLE = function readIntLE(offset, byteLength2, noAssert) { + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) + checkOffset(offset, byteLength2, this.length); + let val = this[offset]; + let mul = 1; + let i = 0; + while (++i < byteLength2 && (mul *= 256)) { + val += this[offset + i] * mul; + } + mul *= 128; + if (val >= mul) + val -= Math.pow(2, 8 * byteLength2); + return val; + }; + Buffer2.prototype.readIntBE = function readIntBE(offset, byteLength2, noAssert) { + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) + checkOffset(offset, byteLength2, this.length); + let i = byteLength2; + let mul = 1; + let val = this[offset + --i]; + while (i > 0 && (mul *= 256)) { + val += this[offset + --i] * mul; + } + mul *= 128; + if (val >= mul) + val -= Math.pow(2, 8 * byteLength2); + return val; + }; + Buffer2.prototype.readInt8 = function readInt8(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 1, this.length); + if (!(this[offset] & 128)) + return this[offset]; + return (255 - this[offset] + 1) * -1; + }; + Buffer2.prototype.readInt16LE = function readInt16LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 2, this.length); + const val = this[offset] | this[offset + 1] << 8; + return val & 32768 ? val | 4294901760 : val; + }; + Buffer2.prototype.readInt16BE = function readInt16BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 2, this.length); + const val = this[offset + 1] | this[offset] << 8; + return val & 32768 ? val | 4294901760 : val; + }; + Buffer2.prototype.readInt32LE = function readInt32LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24; + }; + Buffer2.prototype.readInt32BE = function readInt32BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]; + }; + Buffer2.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE(offset) { + offset = offset >>> 0; + validateNumber(offset, "offset"); + const first = this[offset]; + const last = this[offset + 7]; + if (first === void 0 || last === void 0) { + boundsError(offset, this.length - 8); + } + const val = this[offset + 4] + this[offset + 5] * 2 ** 8 + this[offset + 6] * 2 ** 16 + (last << 24); + return (BigInt(val) << BigInt(32)) + BigInt(first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24); + }); + Buffer2.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE(offset) { + offset = offset >>> 0; + validateNumber(offset, "offset"); + const first = this[offset]; + const last = this[offset + 7]; + if (first === void 0 || last === void 0) { + boundsError(offset, this.length - 8); + } + const val = (first << 24) + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset]; + return (BigInt(val) << BigInt(32)) + BigInt(this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last); + }); + Buffer2.prototype.readFloatLE = function readFloatLE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return ieee754.read(this, offset, true, 23, 4); + }; + Buffer2.prototype.readFloatBE = function readFloatBE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return ieee754.read(this, offset, false, 23, 4); + }; + Buffer2.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 8, this.length); + return ieee754.read(this, offset, true, 52, 8); + }; + Buffer2.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 8, this.length); + return ieee754.read(this, offset, false, 52, 8); + }; + function checkInt(buf, value, offset, ext, max, min) { + if (!Buffer2.isBuffer(buf)) + throw new TypeError('"buffer" argument must be a Buffer instance'); + if (value > max || value < min) + throw new RangeError('"value" argument is out of bounds'); + if (offset + ext > buf.length) + throw new RangeError("Index out of range"); + } + Buffer2.prototype.writeUintLE = Buffer2.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength2, noAssert) { + value = +value; + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) { + const maxBytes = Math.pow(2, 8 * byteLength2) - 1; + checkInt(this, value, offset, byteLength2, maxBytes, 0); + } + let mul = 1; + let i = 0; + this[offset] = value & 255; + while (++i < byteLength2 && (mul *= 256)) { + this[offset + i] = value / mul & 255; + } + return offset + byteLength2; + }; + Buffer2.prototype.writeUintBE = Buffer2.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength2, noAssert) { + value = +value; + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) { + const maxBytes = Math.pow(2, 8 * byteLength2) - 1; + checkInt(this, value, offset, byteLength2, maxBytes, 0); + } + let i = byteLength2 - 1; + let mul = 1; + this[offset + i] = value & 255; + while (--i >= 0 && (mul *= 256)) { + this[offset + i] = value / mul & 255; + } + return offset + byteLength2; + }; + Buffer2.prototype.writeUint8 = Buffer2.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 1, 255, 0); + this[offset] = value & 255; + return offset + 1; + }; + Buffer2.prototype.writeUint16LE = Buffer2.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 2, 65535, 0); + this[offset] = value & 255; + this[offset + 1] = value >>> 8; + return offset + 2; + }; + Buffer2.prototype.writeUint16BE = Buffer2.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 2, 65535, 0); + this[offset] = value >>> 8; + this[offset + 1] = value & 255; + return offset + 2; + }; + Buffer2.prototype.writeUint32LE = Buffer2.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 4, 4294967295, 0); + this[offset + 3] = value >>> 24; + this[offset + 2] = value >>> 16; + this[offset + 1] = value >>> 8; + this[offset] = value & 255; + return offset + 4; + }; + Buffer2.prototype.writeUint32BE = Buffer2.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 4, 4294967295, 0); + this[offset] = value >>> 24; + this[offset + 1] = value >>> 16; + this[offset + 2] = value >>> 8; + this[offset + 3] = value & 255; + return offset + 4; + }; + function wrtBigUInt64LE(buf, value, offset, min, max) { + checkIntBI(value, min, max, buf, offset, 7); + let lo = Number(value & BigInt(4294967295)); + buf[offset++] = lo; + lo = lo >> 8; + buf[offset++] = lo; + lo = lo >> 8; + buf[offset++] = lo; + lo = lo >> 8; + buf[offset++] = lo; + let hi = Number(value >> BigInt(32) & BigInt(4294967295)); + buf[offset++] = hi; + hi = hi >> 8; + buf[offset++] = hi; + hi = hi >> 8; + buf[offset++] = hi; + hi = hi >> 8; + buf[offset++] = hi; + return offset; + } + function wrtBigUInt64BE(buf, value, offset, min, max) { + checkIntBI(value, min, max, buf, offset, 7); + let lo = Number(value & BigInt(4294967295)); + buf[offset + 7] = lo; + lo = lo >> 8; + buf[offset + 6] = lo; + lo = lo >> 8; + buf[offset + 5] = lo; + lo = lo >> 8; + buf[offset + 4] = lo; + let hi = Number(value >> BigInt(32) & BigInt(4294967295)); + buf[offset + 3] = hi; + hi = hi >> 8; + buf[offset + 2] = hi; + hi = hi >> 8; + buf[offset + 1] = hi; + hi = hi >> 8; + buf[offset] = hi; + return offset + 8; + } + Buffer2.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE(value, offset = 0) { + return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt("0xffffffffffffffff")); + }); + Buffer2.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE(value, offset = 0) { + return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt("0xffffffffffffffff")); + }); + Buffer2.prototype.writeIntLE = function writeIntLE(value, offset, byteLength2, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + const limit = Math.pow(2, 8 * byteLength2 - 1); + checkInt(this, value, offset, byteLength2, limit - 1, -limit); + } + let i = 0; + let mul = 1; + let sub = 0; + this[offset] = value & 255; + while (++i < byteLength2 && (mul *= 256)) { + if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { + sub = 1; + } + this[offset + i] = (value / mul >> 0) - sub & 255; + } + return offset + byteLength2; + }; + Buffer2.prototype.writeIntBE = function writeIntBE(value, offset, byteLength2, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + const limit = Math.pow(2, 8 * byteLength2 - 1); + checkInt(this, value, offset, byteLength2, limit - 1, -limit); + } + let i = byteLength2 - 1; + let mul = 1; + let sub = 0; + this[offset + i] = value & 255; + while (--i >= 0 && (mul *= 256)) { + if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { + sub = 1; + } + this[offset + i] = (value / mul >> 0) - sub & 255; + } + return offset + byteLength2; + }; + Buffer2.prototype.writeInt8 = function writeInt8(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 1, 127, -128); + if (value < 0) + value = 255 + value + 1; + this[offset] = value & 255; + return offset + 1; + }; + Buffer2.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 2, 32767, -32768); + this[offset] = value & 255; + this[offset + 1] = value >>> 8; + return offset + 2; + }; + Buffer2.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 2, 32767, -32768); + this[offset] = value >>> 8; + this[offset + 1] = value & 255; + return offset + 2; + }; + Buffer2.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 4, 2147483647, -2147483648); + this[offset] = value & 255; + this[offset + 1] = value >>> 8; + this[offset + 2] = value >>> 16; + this[offset + 3] = value >>> 24; + return offset + 4; + }; + Buffer2.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 4, 2147483647, -2147483648); + if (value < 0) + value = 4294967295 + value + 1; + this[offset] = value >>> 24; + this[offset + 1] = value >>> 16; + this[offset + 2] = value >>> 8; + this[offset + 3] = value & 255; + return offset + 4; + }; + Buffer2.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE(value, offset = 0) { + return wrtBigUInt64LE(this, value, offset, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff")); + }); + Buffer2.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE(value, offset = 0) { + return wrtBigUInt64BE(this, value, offset, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff")); + }); + function checkIEEE754(buf, value, offset, ext, max, min) { + if (offset + ext > buf.length) + throw new RangeError("Index out of range"); + if (offset < 0) + throw new RangeError("Index out of range"); + } + function writeFloat(buf, value, offset, littleEndian, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + checkIEEE754(buf, value, offset, 4, 34028234663852886e22, -34028234663852886e22); + } + ieee754.write(buf, value, offset, littleEndian, 23, 4); + return offset + 4; + } + Buffer2.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) { + return writeFloat(this, value, offset, true, noAssert); + }; + Buffer2.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) { + return writeFloat(this, value, offset, false, noAssert); + }; + function writeDouble(buf, value, offset, littleEndian, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + checkIEEE754(buf, value, offset, 8, 17976931348623157e292, -17976931348623157e292); + } + ieee754.write(buf, value, offset, littleEndian, 52, 8); + return offset + 8; + } + Buffer2.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) { + return writeDouble(this, value, offset, true, noAssert); + }; + Buffer2.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) { + return writeDouble(this, value, offset, false, noAssert); + }; + Buffer2.prototype.copy = function copy(target, targetStart, start, end) { + if (!Buffer2.isBuffer(target)) + throw new TypeError("argument should be a Buffer"); + if (!start) + start = 0; + if (!end && end !== 0) + end = this.length; + if (targetStart >= target.length) + targetStart = target.length; + if (!targetStart) + targetStart = 0; + if (end > 0 && end < start) + end = start; + if (end === start) + return 0; + if (target.length === 0 || this.length === 0) + return 0; + if (targetStart < 0) { + throw new RangeError("targetStart out of bounds"); + } + if (start < 0 || start >= this.length) + throw new RangeError("Index out of range"); + if (end < 0) + throw new RangeError("sourceEnd out of bounds"); + if (end > this.length) + end = this.length; + if (target.length - targetStart < end - start) { + end = target.length - targetStart + start; + } + const len = end - start; + if (this === target && typeof Uint8Array.prototype.copyWithin === "function") { + this.copyWithin(targetStart, start, end); + } else { + Uint8Array.prototype.set.call(target, this.subarray(start, end), targetStart); + } + return len; + }; + Buffer2.prototype.fill = function fill(val, start, end, encoding) { + if (typeof val === "string") { + if (typeof start === "string") { + encoding = start; + start = 0; + end = this.length; + } else if (typeof end === "string") { + encoding = end; + end = this.length; + } + if (encoding !== void 0 && typeof encoding !== "string") { + throw new TypeError("encoding must be a string"); + } + if (typeof encoding === "string" && !Buffer2.isEncoding(encoding)) { + throw new TypeError("Unknown encoding: " + encoding); + } + if (val.length === 1) { + const code = val.charCodeAt(0); + if (encoding === "utf8" && code < 128 || encoding === "latin1") { + val = code; + } + } + } else if (typeof val === "number") { + val = val & 255; + } else if (typeof val === "boolean") { + val = Number(val); + } + if (start < 0 || this.length < start || this.length < end) { + throw new RangeError("Out of range index"); + } + if (end <= start) { + return this; + } + start = start >>> 0; + end = end === void 0 ? this.length : end >>> 0; + if (!val) + val = 0; + let i; + if (typeof val === "number") { + for (i = start; i < end; ++i) { + this[i] = val; + } + } else { + const bytes = Buffer2.isBuffer(val) ? val : Buffer2.from(val, encoding); + const len = bytes.length; + if (len === 0) { + throw new TypeError('The value "' + val + '" is invalid for argument "value"'); + } + for (i = 0; i < end - start; ++i) { + this[i + start] = bytes[i % len]; + } + } + return this; + }; + var errors = {}; + function E(sym, getMessage, Base) { + errors[sym] = class NodeError extends Base { + constructor() { + super(); + Object.defineProperty(this, "message", { + value: getMessage.apply(this, arguments), + writable: true, + configurable: true + }); + this.name = `${this.name} [${sym}]`; + this.stack; + delete this.name; + } + get code() { + return sym; + } + set code(value) { + Object.defineProperty(this, "code", { + configurable: true, + enumerable: true, + value, + writable: true + }); + } + toString() { + return `${this.name} [${sym}]: ${this.message}`; + } + }; + } + E("ERR_BUFFER_OUT_OF_BOUNDS", function(name) { + if (name) { + return `${name} is outside of buffer bounds`; + } + return "Attempt to access memory outside buffer bounds"; + }, RangeError); + E("ERR_INVALID_ARG_TYPE", function(name, actual) { + return `The "${name}" argument must be of type number. Received type ${typeof actual}`; + }, TypeError); + E("ERR_OUT_OF_RANGE", function(str, range, input) { + let msg = `The value of "${str}" is out of range.`; + let received = input; + if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) { + received = addNumericalSeparator(String(input)); + } else if (typeof input === "bigint") { + received = String(input); + if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) { + received = addNumericalSeparator(received); + } + received += "n"; + } + msg += ` It must be ${range}. Received ${received}`; + return msg; + }, RangeError); + function addNumericalSeparator(val) { + let res = ""; + let i = val.length; + const start = val[0] === "-" ? 1 : 0; + for (; i >= start + 4; i -= 3) { + res = `_${val.slice(i - 3, i)}${res}`; + } + return `${val.slice(0, i)}${res}`; + } + function checkBounds(buf, offset, byteLength2) { + validateNumber(offset, "offset"); + if (buf[offset] === void 0 || buf[offset + byteLength2] === void 0) { + boundsError(offset, buf.length - (byteLength2 + 1)); + } + } + function checkIntBI(value, min, max, buf, offset, byteLength2) { + if (value > max || value < min) { + const n = typeof min === "bigint" ? "n" : ""; + let range; + if (byteLength2 > 3) { + if (min === 0 || min === BigInt(0)) { + range = `>= 0${n} and < 2${n} ** ${(byteLength2 + 1) * 8}${n}`; + } else { + range = `>= -(2${n} ** ${(byteLength2 + 1) * 8 - 1}${n}) and < 2 ** ${(byteLength2 + 1) * 8 - 1}${n}`; + } + } else { + range = `>= ${min}${n} and <= ${max}${n}`; + } + throw new errors.ERR_OUT_OF_RANGE("value", range, value); + } + checkBounds(buf, offset, byteLength2); + } + function validateNumber(value, name) { + if (typeof value !== "number") { + throw new errors.ERR_INVALID_ARG_TYPE(name, "number", value); + } + } + function boundsError(value, length2, type) { + if (Math.floor(value) !== value) { + validateNumber(value, type); + throw new errors.ERR_OUT_OF_RANGE(type || "offset", "an integer", value); + } + if (length2 < 0) { + throw new errors.ERR_BUFFER_OUT_OF_BOUNDS(); + } + throw new errors.ERR_OUT_OF_RANGE(type || "offset", `>= ${type ? 1 : 0} and <= ${length2}`, value); + } + var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g; + function base64clean(str) { + str = str.split("=")[0]; + str = str.trim().replace(INVALID_BASE64_RE, ""); + if (str.length < 2) + return ""; + while (str.length % 4 !== 0) { + str = str + "="; + } + return str; + } + function utf8ToBytes(string3, units) { + units = units || Infinity; + let codePoint; + const length2 = string3.length; + let leadSurrogate = null; + const bytes = []; + for (let i = 0; i < length2; ++i) { + codePoint = string3.charCodeAt(i); + if (codePoint > 55295 && codePoint < 57344) { + if (!leadSurrogate) { + if (codePoint > 56319) { + if ((units -= 3) > -1) + bytes.push(239, 191, 189); + continue; + } else if (i + 1 === length2) { + if ((units -= 3) > -1) + bytes.push(239, 191, 189); + continue; + } + leadSurrogate = codePoint; + continue; + } + if (codePoint < 56320) { + if ((units -= 3) > -1) + bytes.push(239, 191, 189); + leadSurrogate = codePoint; + continue; + } + codePoint = (leadSurrogate - 55296 << 10 | codePoint - 56320) + 65536; + } else if (leadSurrogate) { + if ((units -= 3) > -1) + bytes.push(239, 191, 189); + } + leadSurrogate = null; + if (codePoint < 128) { + if ((units -= 1) < 0) + break; + bytes.push(codePoint); + } else if (codePoint < 2048) { + if ((units -= 2) < 0) + break; + bytes.push(codePoint >> 6 | 192, codePoint & 63 | 128); + } else if (codePoint < 65536) { + if ((units -= 3) < 0) + break; + bytes.push(codePoint >> 12 | 224, codePoint >> 6 & 63 | 128, codePoint & 63 | 128); + } else if (codePoint < 1114112) { + if ((units -= 4) < 0) + break; + bytes.push(codePoint >> 18 | 240, codePoint >> 12 & 63 | 128, codePoint >> 6 & 63 | 128, codePoint & 63 | 128); + } else { + throw new Error("Invalid code point"); + } + } + return bytes; + } + function asciiToBytes(str) { + const byteArray = []; + for (let i = 0; i < str.length; ++i) { + byteArray.push(str.charCodeAt(i) & 255); + } + return byteArray; + } + function utf16leToBytes(str, units) { + let c, hi, lo; + const byteArray = []; + for (let i = 0; i < str.length; ++i) { + if ((units -= 2) < 0) + break; + c = str.charCodeAt(i); + hi = c >> 8; + lo = c % 256; + byteArray.push(lo); + byteArray.push(hi); + } + return byteArray; + } + function base64ToBytes(str) { + return base64.toByteArray(base64clean(str)); + } + function blitBuffer(src2, dst, offset, length2) { + let i; + for (i = 0; i < length2; ++i) { + if (i + offset >= dst.length || i >= src2.length) + break; + dst[i + offset] = src2[i]; + } + return i; + } + function isInstance(obj, type) { + return obj instanceof type || obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type.name; + } + function numberIsNaN(obj) { + return obj !== obj; + } + var hexSliceLookupTable = function() { + const alphabet = "0123456789abcdef"; + const table = new Array(256); + for (let i = 0; i < 16; ++i) { + const i16 = i * 16; + for (let j = 0; j < 16; ++j) { + table[i16 + j] = alphabet[i] + alphabet[j]; + } + } + return table; + }(); + function defineBigIntMethod(fn) { + return typeof BigInt === "undefined" ? BufferBigIntNotDefined : fn; + } + function BufferBigIntNotDefined() { + throw new Error("BigInt not supported"); + } + } + }); + + // (disabled):crypto + var require_crypto = __commonJS({ + "(disabled):crypto"() { + } + }); + + // node_modules/tweetnacl/nacl-fast.js + var require_nacl_fast = __commonJS({ + "node_modules/tweetnacl/nacl-fast.js"(exports, module) { + (function(nacl2) { + "use strict"; + var gf = function(init) { + var i, r = new Float64Array(16); + if (init) + for (i = 0; i < init.length; i++) + r[i] = init[i]; + return r; + }; + var randombytes = function() { + throw new Error("no PRNG"); + }; + var _0 = new Uint8Array(16); + var _9 = new Uint8Array(32); + _9[0] = 9; + var gf0 = gf(), gf1 = gf([1]), _121665 = gf([56129, 1]), D = gf([30883, 4953, 19914, 30187, 55467, 16705, 2637, 112, 59544, 30585, 16505, 36039, 65139, 11119, 27886, 20995]), D2 = gf([61785, 9906, 39828, 60374, 45398, 33411, 5274, 224, 53552, 61171, 33010, 6542, 64743, 22239, 55772, 9222]), X = gf([54554, 36645, 11616, 51542, 42930, 38181, 51040, 26924, 56412, 64982, 57905, 49316, 21502, 52590, 14035, 8553]), Y = gf([26200, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214]), I = gf([41136, 18958, 6951, 50414, 58488, 44335, 6150, 12099, 55207, 15867, 153, 11085, 57099, 20417, 9344, 11139]); + function ts64(x, i, h, l) { + x[i] = h >> 24 & 255; + x[i + 1] = h >> 16 & 255; + x[i + 2] = h >> 8 & 255; + x[i + 3] = h & 255; + x[i + 4] = l >> 24 & 255; + x[i + 5] = l >> 16 & 255; + x[i + 6] = l >> 8 & 255; + x[i + 7] = l & 255; + } + function vn(x, xi, y, yi, n) { + var i, d = 0; + for (i = 0; i < n; i++) + d |= x[xi + i] ^ y[yi + i]; + return (1 & d - 1 >>> 8) - 1; + } + function crypto_verify_16(x, xi, y, yi) { + return vn(x, xi, y, yi, 16); + } + function crypto_verify_32(x, xi, y, yi) { + return vn(x, xi, y, yi, 32); + } + function core_salsa20(o, p, k, c) { + var j0 = c[0] & 255 | (c[1] & 255) << 8 | (c[2] & 255) << 16 | (c[3] & 255) << 24, j1 = k[0] & 255 | (k[1] & 255) << 8 | (k[2] & 255) << 16 | (k[3] & 255) << 24, j2 = k[4] & 255 | (k[5] & 255) << 8 | (k[6] & 255) << 16 | (k[7] & 255) << 24, j3 = k[8] & 255 | (k[9] & 255) << 8 | (k[10] & 255) << 16 | (k[11] & 255) << 24, j4 = k[12] & 255 | (k[13] & 255) << 8 | (k[14] & 255) << 16 | (k[15] & 255) << 24, j5 = c[4] & 255 | (c[5] & 255) << 8 | (c[6] & 255) << 16 | (c[7] & 255) << 24, j6 = p[0] & 255 | (p[1] & 255) << 8 | (p[2] & 255) << 16 | (p[3] & 255) << 24, j7 = p[4] & 255 | (p[5] & 255) << 8 | (p[6] & 255) << 16 | (p[7] & 255) << 24, j8 = p[8] & 255 | (p[9] & 255) << 8 | (p[10] & 255) << 16 | (p[11] & 255) << 24, j9 = p[12] & 255 | (p[13] & 255) << 8 | (p[14] & 255) << 16 | (p[15] & 255) << 24, j10 = c[8] & 255 | (c[9] & 255) << 8 | (c[10] & 255) << 16 | (c[11] & 255) << 24, j11 = k[16] & 255 | (k[17] & 255) << 8 | (k[18] & 255) << 16 | (k[19] & 255) << 24, j12 = k[20] & 255 | (k[21] & 255) << 8 | (k[22] & 255) << 16 | (k[23] & 255) << 24, j13 = k[24] & 255 | (k[25] & 255) << 8 | (k[26] & 255) << 16 | (k[27] & 255) << 24, j14 = k[28] & 255 | (k[29] & 255) << 8 | (k[30] & 255) << 16 | (k[31] & 255) << 24, j15 = c[12] & 255 | (c[13] & 255) << 8 | (c[14] & 255) << 16 | (c[15] & 255) << 24; + var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7, x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14, x15 = j15, u; + for (var i = 0; i < 20; i += 2) { + u = x0 + x12 | 0; + x4 ^= u << 7 | u >>> 32 - 7; + u = x4 + x0 | 0; + x8 ^= u << 9 | u >>> 32 - 9; + u = x8 + x4 | 0; + x12 ^= u << 13 | u >>> 32 - 13; + u = x12 + x8 | 0; + x0 ^= u << 18 | u >>> 32 - 18; + u = x5 + x1 | 0; + x9 ^= u << 7 | u >>> 32 - 7; + u = x9 + x5 | 0; + x13 ^= u << 9 | u >>> 32 - 9; + u = x13 + x9 | 0; + x1 ^= u << 13 | u >>> 32 - 13; + u = x1 + x13 | 0; + x5 ^= u << 18 | u >>> 32 - 18; + u = x10 + x6 | 0; + x14 ^= u << 7 | u >>> 32 - 7; + u = x14 + x10 | 0; + x2 ^= u << 9 | u >>> 32 - 9; + u = x2 + x14 | 0; + x6 ^= u << 13 | u >>> 32 - 13; + u = x6 + x2 | 0; + x10 ^= u << 18 | u >>> 32 - 18; + u = x15 + x11 | 0; + x3 ^= u << 7 | u >>> 32 - 7; + u = x3 + x15 | 0; + x7 ^= u << 9 | u >>> 32 - 9; + u = x7 + x3 | 0; + x11 ^= u << 13 | u >>> 32 - 13; + u = x11 + x7 | 0; + x15 ^= u << 18 | u >>> 32 - 18; + u = x0 + x3 | 0; + x1 ^= u << 7 | u >>> 32 - 7; + u = x1 + x0 | 0; + x2 ^= u << 9 | u >>> 32 - 9; + u = x2 + x1 | 0; + x3 ^= u << 13 | u >>> 32 - 13; + u = x3 + x2 | 0; + x0 ^= u << 18 | u >>> 32 - 18; + u = x5 + x4 | 0; + x6 ^= u << 7 | u >>> 32 - 7; + u = x6 + x5 | 0; + x7 ^= u << 9 | u >>> 32 - 9; + u = x7 + x6 | 0; + x4 ^= u << 13 | u >>> 32 - 13; + u = x4 + x7 | 0; + x5 ^= u << 18 | u >>> 32 - 18; + u = x10 + x9 | 0; + x11 ^= u << 7 | u >>> 32 - 7; + u = x11 + x10 | 0; + x8 ^= u << 9 | u >>> 32 - 9; + u = x8 + x11 | 0; + x9 ^= u << 13 | u >>> 32 - 13; + u = x9 + x8 | 0; + x10 ^= u << 18 | u >>> 32 - 18; + u = x15 + x14 | 0; + x12 ^= u << 7 | u >>> 32 - 7; + u = x12 + x15 | 0; + x13 ^= u << 9 | u >>> 32 - 9; + u = x13 + x12 | 0; + x14 ^= u << 13 | u >>> 32 - 13; + u = x14 + x13 | 0; + x15 ^= u << 18 | u >>> 32 - 18; + } + x0 = x0 + j0 | 0; + x1 = x1 + j1 | 0; + x2 = x2 + j2 | 0; + x3 = x3 + j3 | 0; + x4 = x4 + j4 | 0; + x5 = x5 + j5 | 0; + x6 = x6 + j6 | 0; + x7 = x7 + j7 | 0; + x8 = x8 + j8 | 0; + x9 = x9 + j9 | 0; + x10 = x10 + j10 | 0; + x11 = x11 + j11 | 0; + x12 = x12 + j12 | 0; + x13 = x13 + j13 | 0; + x14 = x14 + j14 | 0; + x15 = x15 + j15 | 0; + o[0] = x0 >>> 0 & 255; + o[1] = x0 >>> 8 & 255; + o[2] = x0 >>> 16 & 255; + o[3] = x0 >>> 24 & 255; + o[4] = x1 >>> 0 & 255; + o[5] = x1 >>> 8 & 255; + o[6] = x1 >>> 16 & 255; + o[7] = x1 >>> 24 & 255; + o[8] = x2 >>> 0 & 255; + o[9] = x2 >>> 8 & 255; + o[10] = x2 >>> 16 & 255; + o[11] = x2 >>> 24 & 255; + o[12] = x3 >>> 0 & 255; + o[13] = x3 >>> 8 & 255; + o[14] = x3 >>> 16 & 255; + o[15] = x3 >>> 24 & 255; + o[16] = x4 >>> 0 & 255; + o[17] = x4 >>> 8 & 255; + o[18] = x4 >>> 16 & 255; + o[19] = x4 >>> 24 & 255; + o[20] = x5 >>> 0 & 255; + o[21] = x5 >>> 8 & 255; + o[22] = x5 >>> 16 & 255; + o[23] = x5 >>> 24 & 255; + o[24] = x6 >>> 0 & 255; + o[25] = x6 >>> 8 & 255; + o[26] = x6 >>> 16 & 255; + o[27] = x6 >>> 24 & 255; + o[28] = x7 >>> 0 & 255; + o[29] = x7 >>> 8 & 255; + o[30] = x7 >>> 16 & 255; + o[31] = x7 >>> 24 & 255; + o[32] = x8 >>> 0 & 255; + o[33] = x8 >>> 8 & 255; + o[34] = x8 >>> 16 & 255; + o[35] = x8 >>> 24 & 255; + o[36] = x9 >>> 0 & 255; + o[37] = x9 >>> 8 & 255; + o[38] = x9 >>> 16 & 255; + o[39] = x9 >>> 24 & 255; + o[40] = x10 >>> 0 & 255; + o[41] = x10 >>> 8 & 255; + o[42] = x10 >>> 16 & 255; + o[43] = x10 >>> 24 & 255; + o[44] = x11 >>> 0 & 255; + o[45] = x11 >>> 8 & 255; + o[46] = x11 >>> 16 & 255; + o[47] = x11 >>> 24 & 255; + o[48] = x12 >>> 0 & 255; + o[49] = x12 >>> 8 & 255; + o[50] = x12 >>> 16 & 255; + o[51] = x12 >>> 24 & 255; + o[52] = x13 >>> 0 & 255; + o[53] = x13 >>> 8 & 255; + o[54] = x13 >>> 16 & 255; + o[55] = x13 >>> 24 & 255; + o[56] = x14 >>> 0 & 255; + o[57] = x14 >>> 8 & 255; + o[58] = x14 >>> 16 & 255; + o[59] = x14 >>> 24 & 255; + o[60] = x15 >>> 0 & 255; + o[61] = x15 >>> 8 & 255; + o[62] = x15 >>> 16 & 255; + o[63] = x15 >>> 24 & 255; + } + function core_hsalsa20(o, p, k, c) { + var j0 = c[0] & 255 | (c[1] & 255) << 8 | (c[2] & 255) << 16 | (c[3] & 255) << 24, j1 = k[0] & 255 | (k[1] & 255) << 8 | (k[2] & 255) << 16 | (k[3] & 255) << 24, j2 = k[4] & 255 | (k[5] & 255) << 8 | (k[6] & 255) << 16 | (k[7] & 255) << 24, j3 = k[8] & 255 | (k[9] & 255) << 8 | (k[10] & 255) << 16 | (k[11] & 255) << 24, j4 = k[12] & 255 | (k[13] & 255) << 8 | (k[14] & 255) << 16 | (k[15] & 255) << 24, j5 = c[4] & 255 | (c[5] & 255) << 8 | (c[6] & 255) << 16 | (c[7] & 255) << 24, j6 = p[0] & 255 | (p[1] & 255) << 8 | (p[2] & 255) << 16 | (p[3] & 255) << 24, j7 = p[4] & 255 | (p[5] & 255) << 8 | (p[6] & 255) << 16 | (p[7] & 255) << 24, j8 = p[8] & 255 | (p[9] & 255) << 8 | (p[10] & 255) << 16 | (p[11] & 255) << 24, j9 = p[12] & 255 | (p[13] & 255) << 8 | (p[14] & 255) << 16 | (p[15] & 255) << 24, j10 = c[8] & 255 | (c[9] & 255) << 8 | (c[10] & 255) << 16 | (c[11] & 255) << 24, j11 = k[16] & 255 | (k[17] & 255) << 8 | (k[18] & 255) << 16 | (k[19] & 255) << 24, j12 = k[20] & 255 | (k[21] & 255) << 8 | (k[22] & 255) << 16 | (k[23] & 255) << 24, j13 = k[24] & 255 | (k[25] & 255) << 8 | (k[26] & 255) << 16 | (k[27] & 255) << 24, j14 = k[28] & 255 | (k[29] & 255) << 8 | (k[30] & 255) << 16 | (k[31] & 255) << 24, j15 = c[12] & 255 | (c[13] & 255) << 8 | (c[14] & 255) << 16 | (c[15] & 255) << 24; + var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7, x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14, x15 = j15, u; + for (var i = 0; i < 20; i += 2) { + u = x0 + x12 | 0; + x4 ^= u << 7 | u >>> 32 - 7; + u = x4 + x0 | 0; + x8 ^= u << 9 | u >>> 32 - 9; + u = x8 + x4 | 0; + x12 ^= u << 13 | u >>> 32 - 13; + u = x12 + x8 | 0; + x0 ^= u << 18 | u >>> 32 - 18; + u = x5 + x1 | 0; + x9 ^= u << 7 | u >>> 32 - 7; + u = x9 + x5 | 0; + x13 ^= u << 9 | u >>> 32 - 9; + u = x13 + x9 | 0; + x1 ^= u << 13 | u >>> 32 - 13; + u = x1 + x13 | 0; + x5 ^= u << 18 | u >>> 32 - 18; + u = x10 + x6 | 0; + x14 ^= u << 7 | u >>> 32 - 7; + u = x14 + x10 | 0; + x2 ^= u << 9 | u >>> 32 - 9; + u = x2 + x14 | 0; + x6 ^= u << 13 | u >>> 32 - 13; + u = x6 + x2 | 0; + x10 ^= u << 18 | u >>> 32 - 18; + u = x15 + x11 | 0; + x3 ^= u << 7 | u >>> 32 - 7; + u = x3 + x15 | 0; + x7 ^= u << 9 | u >>> 32 - 9; + u = x7 + x3 | 0; + x11 ^= u << 13 | u >>> 32 - 13; + u = x11 + x7 | 0; + x15 ^= u << 18 | u >>> 32 - 18; + u = x0 + x3 | 0; + x1 ^= u << 7 | u >>> 32 - 7; + u = x1 + x0 | 0; + x2 ^= u << 9 | u >>> 32 - 9; + u = x2 + x1 | 0; + x3 ^= u << 13 | u >>> 32 - 13; + u = x3 + x2 | 0; + x0 ^= u << 18 | u >>> 32 - 18; + u = x5 + x4 | 0; + x6 ^= u << 7 | u >>> 32 - 7; + u = x6 + x5 | 0; + x7 ^= u << 9 | u >>> 32 - 9; + u = x7 + x6 | 0; + x4 ^= u << 13 | u >>> 32 - 13; + u = x4 + x7 | 0; + x5 ^= u << 18 | u >>> 32 - 18; + u = x10 + x9 | 0; + x11 ^= u << 7 | u >>> 32 - 7; + u = x11 + x10 | 0; + x8 ^= u << 9 | u >>> 32 - 9; + u = x8 + x11 | 0; + x9 ^= u << 13 | u >>> 32 - 13; + u = x9 + x8 | 0; + x10 ^= u << 18 | u >>> 32 - 18; + u = x15 + x14 | 0; + x12 ^= u << 7 | u >>> 32 - 7; + u = x12 + x15 | 0; + x13 ^= u << 9 | u >>> 32 - 9; + u = x13 + x12 | 0; + x14 ^= u << 13 | u >>> 32 - 13; + u = x14 + x13 | 0; + x15 ^= u << 18 | u >>> 32 - 18; + } + o[0] = x0 >>> 0 & 255; + o[1] = x0 >>> 8 & 255; + o[2] = x0 >>> 16 & 255; + o[3] = x0 >>> 24 & 255; + o[4] = x5 >>> 0 & 255; + o[5] = x5 >>> 8 & 255; + o[6] = x5 >>> 16 & 255; + o[7] = x5 >>> 24 & 255; + o[8] = x10 >>> 0 & 255; + o[9] = x10 >>> 8 & 255; + o[10] = x10 >>> 16 & 255; + o[11] = x10 >>> 24 & 255; + o[12] = x15 >>> 0 & 255; + o[13] = x15 >>> 8 & 255; + o[14] = x15 >>> 16 & 255; + o[15] = x15 >>> 24 & 255; + o[16] = x6 >>> 0 & 255; + o[17] = x6 >>> 8 & 255; + o[18] = x6 >>> 16 & 255; + o[19] = x6 >>> 24 & 255; + o[20] = x7 >>> 0 & 255; + o[21] = x7 >>> 8 & 255; + o[22] = x7 >>> 16 & 255; + o[23] = x7 >>> 24 & 255; + o[24] = x8 >>> 0 & 255; + o[25] = x8 >>> 8 & 255; + o[26] = x8 >>> 16 & 255; + o[27] = x8 >>> 24 & 255; + o[28] = x9 >>> 0 & 255; + o[29] = x9 >>> 8 & 255; + o[30] = x9 >>> 16 & 255; + o[31] = x9 >>> 24 & 255; + } + function crypto_core_salsa20(out, inp, k, c) { + core_salsa20(out, inp, k, c); + } + function crypto_core_hsalsa20(out, inp, k, c) { + core_hsalsa20(out, inp, k, c); + } + var sigma = new Uint8Array([101, 120, 112, 97, 110, 100, 32, 51, 50, 45, 98, 121, 116, 101, 32, 107]); + function crypto_stream_salsa20_xor(c, cpos, m, mpos, b, n, k) { + var z = new Uint8Array(16), x = new Uint8Array(64); + var u, i; + for (i = 0; i < 16; i++) + z[i] = 0; + for (i = 0; i < 8; i++) + z[i] = n[i]; + while (b >= 64) { + crypto_core_salsa20(x, z, k, sigma); + for (i = 0; i < 64; i++) + c[cpos + i] = m[mpos + i] ^ x[i]; + u = 1; + for (i = 8; i < 16; i++) { + u = u + (z[i] & 255) | 0; + z[i] = u & 255; + u >>>= 8; + } + b -= 64; + cpos += 64; + mpos += 64; + } + if (b > 0) { + crypto_core_salsa20(x, z, k, sigma); + for (i = 0; i < b; i++) + c[cpos + i] = m[mpos + i] ^ x[i]; + } + return 0; + } + function crypto_stream_salsa20(c, cpos, b, n, k) { + var z = new Uint8Array(16), x = new Uint8Array(64); + var u, i; + for (i = 0; i < 16; i++) + z[i] = 0; + for (i = 0; i < 8; i++) + z[i] = n[i]; + while (b >= 64) { + crypto_core_salsa20(x, z, k, sigma); + for (i = 0; i < 64; i++) + c[cpos + i] = x[i]; + u = 1; + for (i = 8; i < 16; i++) { + u = u + (z[i] & 255) | 0; + z[i] = u & 255; + u >>>= 8; + } + b -= 64; + cpos += 64; + } + if (b > 0) { + crypto_core_salsa20(x, z, k, sigma); + for (i = 0; i < b; i++) + c[cpos + i] = x[i]; + } + return 0; + } + function crypto_stream(c, cpos, d, n, k) { + var s = new Uint8Array(32); + crypto_core_hsalsa20(s, n, k, sigma); + var sn = new Uint8Array(8); + for (var i = 0; i < 8; i++) + sn[i] = n[i + 16]; + return crypto_stream_salsa20(c, cpos, d, sn, s); + } + function crypto_stream_xor(c, cpos, m, mpos, d, n, k) { + var s = new Uint8Array(32); + crypto_core_hsalsa20(s, n, k, sigma); + var sn = new Uint8Array(8); + for (var i = 0; i < 8; i++) + sn[i] = n[i + 16]; + return crypto_stream_salsa20_xor(c, cpos, m, mpos, d, sn, s); + } + var poly1305 = function(key) { + this.buffer = new Uint8Array(16); + this.r = new Uint16Array(10); + this.h = new Uint16Array(10); + this.pad = new Uint16Array(8); + this.leftover = 0; + this.fin = 0; + var t0, t1, t2, t3, t4, t5, t6, t7; + t0 = key[0] & 255 | (key[1] & 255) << 8; + this.r[0] = t0 & 8191; + t1 = key[2] & 255 | (key[3] & 255) << 8; + this.r[1] = (t0 >>> 13 | t1 << 3) & 8191; + t2 = key[4] & 255 | (key[5] & 255) << 8; + this.r[2] = (t1 >>> 10 | t2 << 6) & 7939; + t3 = key[6] & 255 | (key[7] & 255) << 8; + this.r[3] = (t2 >>> 7 | t3 << 9) & 8191; + t4 = key[8] & 255 | (key[9] & 255) << 8; + this.r[4] = (t3 >>> 4 | t4 << 12) & 255; + this.r[5] = t4 >>> 1 & 8190; + t5 = key[10] & 255 | (key[11] & 255) << 8; + this.r[6] = (t4 >>> 14 | t5 << 2) & 8191; + t6 = key[12] & 255 | (key[13] & 255) << 8; + this.r[7] = (t5 >>> 11 | t6 << 5) & 8065; + t7 = key[14] & 255 | (key[15] & 255) << 8; + this.r[8] = (t6 >>> 8 | t7 << 8) & 8191; + this.r[9] = t7 >>> 5 & 127; + this.pad[0] = key[16] & 255 | (key[17] & 255) << 8; + this.pad[1] = key[18] & 255 | (key[19] & 255) << 8; + this.pad[2] = key[20] & 255 | (key[21] & 255) << 8; + this.pad[3] = key[22] & 255 | (key[23] & 255) << 8; + this.pad[4] = key[24] & 255 | (key[25] & 255) << 8; + this.pad[5] = key[26] & 255 | (key[27] & 255) << 8; + this.pad[6] = key[28] & 255 | (key[29] & 255) << 8; + this.pad[7] = key[30] & 255 | (key[31] & 255) << 8; + }; + poly1305.prototype.blocks = function(m, mpos, bytes) { + var hibit = this.fin ? 0 : 1 << 11; + var t0, t1, t2, t3, t4, t5, t6, t7, c; + var d0, d1, d2, d3, d4, d5, d6, d7, d8, d9; + var h0 = this.h[0], h1 = this.h[1], h2 = this.h[2], h3 = this.h[3], h4 = this.h[4], h5 = this.h[5], h6 = this.h[6], h7 = this.h[7], h8 = this.h[8], h9 = this.h[9]; + var r0 = this.r[0], r1 = this.r[1], r2 = this.r[2], r3 = this.r[3], r4 = this.r[4], r5 = this.r[5], r6 = this.r[6], r7 = this.r[7], r8 = this.r[8], r9 = this.r[9]; + while (bytes >= 16) { + t0 = m[mpos + 0] & 255 | (m[mpos + 1] & 255) << 8; + h0 += t0 & 8191; + t1 = m[mpos + 2] & 255 | (m[mpos + 3] & 255) << 8; + h1 += (t0 >>> 13 | t1 << 3) & 8191; + t2 = m[mpos + 4] & 255 | (m[mpos + 5] & 255) << 8; + h2 += (t1 >>> 10 | t2 << 6) & 8191; + t3 = m[mpos + 6] & 255 | (m[mpos + 7] & 255) << 8; + h3 += (t2 >>> 7 | t3 << 9) & 8191; + t4 = m[mpos + 8] & 255 | (m[mpos + 9] & 255) << 8; + h4 += (t3 >>> 4 | t4 << 12) & 8191; + h5 += t4 >>> 1 & 8191; + t5 = m[mpos + 10] & 255 | (m[mpos + 11] & 255) << 8; + h6 += (t4 >>> 14 | t5 << 2) & 8191; + t6 = m[mpos + 12] & 255 | (m[mpos + 13] & 255) << 8; + h7 += (t5 >>> 11 | t6 << 5) & 8191; + t7 = m[mpos + 14] & 255 | (m[mpos + 15] & 255) << 8; + h8 += (t6 >>> 8 | t7 << 8) & 8191; + h9 += t7 >>> 5 | hibit; + c = 0; + d0 = c; + d0 += h0 * r0; + d0 += h1 * (5 * r9); + d0 += h2 * (5 * r8); + d0 += h3 * (5 * r7); + d0 += h4 * (5 * r6); + c = d0 >>> 13; + d0 &= 8191; + d0 += h5 * (5 * r5); + d0 += h6 * (5 * r4); + d0 += h7 * (5 * r3); + d0 += h8 * (5 * r2); + d0 += h9 * (5 * r1); + c += d0 >>> 13; + d0 &= 8191; + d1 = c; + d1 += h0 * r1; + d1 += h1 * r0; + d1 += h2 * (5 * r9); + d1 += h3 * (5 * r8); + d1 += h4 * (5 * r7); + c = d1 >>> 13; + d1 &= 8191; + d1 += h5 * (5 * r6); + d1 += h6 * (5 * r5); + d1 += h7 * (5 * r4); + d1 += h8 * (5 * r3); + d1 += h9 * (5 * r2); + c += d1 >>> 13; + d1 &= 8191; + d2 = c; + d2 += h0 * r2; + d2 += h1 * r1; + d2 += h2 * r0; + d2 += h3 * (5 * r9); + d2 += h4 * (5 * r8); + c = d2 >>> 13; + d2 &= 8191; + d2 += h5 * (5 * r7); + d2 += h6 * (5 * r6); + d2 += h7 * (5 * r5); + d2 += h8 * (5 * r4); + d2 += h9 * (5 * r3); + c += d2 >>> 13; + d2 &= 8191; + d3 = c; + d3 += h0 * r3; + d3 += h1 * r2; + d3 += h2 * r1; + d3 += h3 * r0; + d3 += h4 * (5 * r9); + c = d3 >>> 13; + d3 &= 8191; + d3 += h5 * (5 * r8); + d3 += h6 * (5 * r7); + d3 += h7 * (5 * r6); + d3 += h8 * (5 * r5); + d3 += h9 * (5 * r4); + c += d3 >>> 13; + d3 &= 8191; + d4 = c; + d4 += h0 * r4; + d4 += h1 * r3; + d4 += h2 * r2; + d4 += h3 * r1; + d4 += h4 * r0; + c = d4 >>> 13; + d4 &= 8191; + d4 += h5 * (5 * r9); + d4 += h6 * (5 * r8); + d4 += h7 * (5 * r7); + d4 += h8 * (5 * r6); + d4 += h9 * (5 * r5); + c += d4 >>> 13; + d4 &= 8191; + d5 = c; + d5 += h0 * r5; + d5 += h1 * r4; + d5 += h2 * r3; + d5 += h3 * r2; + d5 += h4 * r1; + c = d5 >>> 13; + d5 &= 8191; + d5 += h5 * r0; + d5 += h6 * (5 * r9); + d5 += h7 * (5 * r8); + d5 += h8 * (5 * r7); + d5 += h9 * (5 * r6); + c += d5 >>> 13; + d5 &= 8191; + d6 = c; + d6 += h0 * r6; + d6 += h1 * r5; + d6 += h2 * r4; + d6 += h3 * r3; + d6 += h4 * r2; + c = d6 >>> 13; + d6 &= 8191; + d6 += h5 * r1; + d6 += h6 * r0; + d6 += h7 * (5 * r9); + d6 += h8 * (5 * r8); + d6 += h9 * (5 * r7); + c += d6 >>> 13; + d6 &= 8191; + d7 = c; + d7 += h0 * r7; + d7 += h1 * r6; + d7 += h2 * r5; + d7 += h3 * r4; + d7 += h4 * r3; + c = d7 >>> 13; + d7 &= 8191; + d7 += h5 * r2; + d7 += h6 * r1; + d7 += h7 * r0; + d7 += h8 * (5 * r9); + d7 += h9 * (5 * r8); + c += d7 >>> 13; + d7 &= 8191; + d8 = c; + d8 += h0 * r8; + d8 += h1 * r7; + d8 += h2 * r6; + d8 += h3 * r5; + d8 += h4 * r4; + c = d8 >>> 13; + d8 &= 8191; + d8 += h5 * r3; + d8 += h6 * r2; + d8 += h7 * r1; + d8 += h8 * r0; + d8 += h9 * (5 * r9); + c += d8 >>> 13; + d8 &= 8191; + d9 = c; + d9 += h0 * r9; + d9 += h1 * r8; + d9 += h2 * r7; + d9 += h3 * r6; + d9 += h4 * r5; + c = d9 >>> 13; + d9 &= 8191; + d9 += h5 * r4; + d9 += h6 * r3; + d9 += h7 * r2; + d9 += h8 * r1; + d9 += h9 * r0; + c += d9 >>> 13; + d9 &= 8191; + c = (c << 2) + c | 0; + c = c + d0 | 0; + d0 = c & 8191; + c = c >>> 13; + d1 += c; + h0 = d0; + h1 = d1; + h2 = d2; + h3 = d3; + h4 = d4; + h5 = d5; + h6 = d6; + h7 = d7; + h8 = d8; + h9 = d9; + mpos += 16; + bytes -= 16; + } + this.h[0] = h0; + this.h[1] = h1; + this.h[2] = h2; + this.h[3] = h3; + this.h[4] = h4; + this.h[5] = h5; + this.h[6] = h6; + this.h[7] = h7; + this.h[8] = h8; + this.h[9] = h9; + }; + poly1305.prototype.finish = function(mac, macpos) { + var g = new Uint16Array(10); + var c, mask, f, i; + if (this.leftover) { + i = this.leftover; + this.buffer[i++] = 1; + for (; i < 16; i++) + this.buffer[i] = 0; + this.fin = 1; + this.blocks(this.buffer, 0, 16); + } + c = this.h[1] >>> 13; + this.h[1] &= 8191; + for (i = 2; i < 10; i++) { + this.h[i] += c; + c = this.h[i] >>> 13; + this.h[i] &= 8191; + } + this.h[0] += c * 5; + c = this.h[0] >>> 13; + this.h[0] &= 8191; + this.h[1] += c; + c = this.h[1] >>> 13; + this.h[1] &= 8191; + this.h[2] += c; + g[0] = this.h[0] + 5; + c = g[0] >>> 13; + g[0] &= 8191; + for (i = 1; i < 10; i++) { + g[i] = this.h[i] + c; + c = g[i] >>> 13; + g[i] &= 8191; + } + g[9] -= 1 << 13; + mask = (c ^ 1) - 1; + for (i = 0; i < 10; i++) + g[i] &= mask; + mask = ~mask; + for (i = 0; i < 10; i++) + this.h[i] = this.h[i] & mask | g[i]; + this.h[0] = (this.h[0] | this.h[1] << 13) & 65535; + this.h[1] = (this.h[1] >>> 3 | this.h[2] << 10) & 65535; + this.h[2] = (this.h[2] >>> 6 | this.h[3] << 7) & 65535; + this.h[3] = (this.h[3] >>> 9 | this.h[4] << 4) & 65535; + this.h[4] = (this.h[4] >>> 12 | this.h[5] << 1 | this.h[6] << 14) & 65535; + this.h[5] = (this.h[6] >>> 2 | this.h[7] << 11) & 65535; + this.h[6] = (this.h[7] >>> 5 | this.h[8] << 8) & 65535; + this.h[7] = (this.h[8] >>> 8 | this.h[9] << 5) & 65535; + f = this.h[0] + this.pad[0]; + this.h[0] = f & 65535; + for (i = 1; i < 8; i++) { + f = (this.h[i] + this.pad[i] | 0) + (f >>> 16) | 0; + this.h[i] = f & 65535; + } + mac[macpos + 0] = this.h[0] >>> 0 & 255; + mac[macpos + 1] = this.h[0] >>> 8 & 255; + mac[macpos + 2] = this.h[1] >>> 0 & 255; + mac[macpos + 3] = this.h[1] >>> 8 & 255; + mac[macpos + 4] = this.h[2] >>> 0 & 255; + mac[macpos + 5] = this.h[2] >>> 8 & 255; + mac[macpos + 6] = this.h[3] >>> 0 & 255; + mac[macpos + 7] = this.h[3] >>> 8 & 255; + mac[macpos + 8] = this.h[4] >>> 0 & 255; + mac[macpos + 9] = this.h[4] >>> 8 & 255; + mac[macpos + 10] = this.h[5] >>> 0 & 255; + mac[macpos + 11] = this.h[5] >>> 8 & 255; + mac[macpos + 12] = this.h[6] >>> 0 & 255; + mac[macpos + 13] = this.h[6] >>> 8 & 255; + mac[macpos + 14] = this.h[7] >>> 0 & 255; + mac[macpos + 15] = this.h[7] >>> 8 & 255; + }; + poly1305.prototype.update = function(m, mpos, bytes) { + var i, want; + if (this.leftover) { + want = 16 - this.leftover; + if (want > bytes) + want = bytes; + for (i = 0; i < want; i++) + this.buffer[this.leftover + i] = m[mpos + i]; + bytes -= want; + mpos += want; + this.leftover += want; + if (this.leftover < 16) + return; + this.blocks(this.buffer, 0, 16); + this.leftover = 0; + } + if (bytes >= 16) { + want = bytes - bytes % 16; + this.blocks(m, mpos, want); + mpos += want; + bytes -= want; + } + if (bytes) { + for (i = 0; i < bytes; i++) + this.buffer[this.leftover + i] = m[mpos + i]; + this.leftover += bytes; + } + }; + function crypto_onetimeauth(out, outpos, m, mpos, n, k) { + var s = new poly1305(k); + s.update(m, mpos, n); + s.finish(out, outpos); + return 0; + } + function crypto_onetimeauth_verify(h, hpos, m, mpos, n, k) { + var x = new Uint8Array(16); + crypto_onetimeauth(x, 0, m, mpos, n, k); + return crypto_verify_16(h, hpos, x, 0); + } + function crypto_secretbox(c, m, d, n, k) { + var i; + if (d < 32) + return -1; + crypto_stream_xor(c, 0, m, 0, d, n, k); + crypto_onetimeauth(c, 16, c, 32, d - 32, c); + for (i = 0; i < 16; i++) + c[i] = 0; + return 0; + } + function crypto_secretbox_open(m, c, d, n, k) { + var i; + var x = new Uint8Array(32); + if (d < 32) + return -1; + crypto_stream(x, 0, 32, n, k); + if (crypto_onetimeauth_verify(c, 16, c, 32, d - 32, x) !== 0) + return -1; + crypto_stream_xor(m, 0, c, 0, d, n, k); + for (i = 0; i < 32; i++) + m[i] = 0; + return 0; + } + function set25519(r, a) { + var i; + for (i = 0; i < 16; i++) + r[i] = a[i] | 0; + } + function car25519(o) { + var i, v, c = 1; + for (i = 0; i < 16; i++) { + v = o[i] + c + 65535; + c = Math.floor(v / 65536); + o[i] = v - c * 65536; + } + o[0] += c - 1 + 37 * (c - 1); + } + function sel25519(p, q, b) { + var t, c = ~(b - 1); + for (var i = 0; i < 16; i++) { + t = c & (p[i] ^ q[i]); + p[i] ^= t; + q[i] ^= t; + } + } + function pack25519(o, n) { + var i, j, b; + var m = gf(), t = gf(); + for (i = 0; i < 16; i++) + t[i] = n[i]; + car25519(t); + car25519(t); + car25519(t); + for (j = 0; j < 2; j++) { + m[0] = t[0] - 65517; + for (i = 1; i < 15; i++) { + m[i] = t[i] - 65535 - (m[i - 1] >> 16 & 1); + m[i - 1] &= 65535; + } + m[15] = t[15] - 32767 - (m[14] >> 16 & 1); + b = m[15] >> 16 & 1; + m[14] &= 65535; + sel25519(t, m, 1 - b); + } + for (i = 0; i < 16; i++) { + o[2 * i] = t[i] & 255; + o[2 * i + 1] = t[i] >> 8; + } + } + function neq25519(a, b) { + var c = new Uint8Array(32), d = new Uint8Array(32); + pack25519(c, a); + pack25519(d, b); + return crypto_verify_32(c, 0, d, 0); + } + function par25519(a) { + var d = new Uint8Array(32); + pack25519(d, a); + return d[0] & 1; + } + function unpack25519(o, n) { + var i; + for (i = 0; i < 16; i++) + o[i] = n[2 * i] + (n[2 * i + 1] << 8); + o[15] &= 32767; + } + function A(o, a, b) { + for (var i = 0; i < 16; i++) + o[i] = a[i] + b[i]; + } + function Z(o, a, b) { + for (var i = 0; i < 16; i++) + o[i] = a[i] - b[i]; + } + function M(o, a, b) { + var v, c, t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, t10 = 0, t11 = 0, t12 = 0, t13 = 0, t14 = 0, t15 = 0, t16 = 0, t17 = 0, t18 = 0, t19 = 0, t20 = 0, t21 = 0, t22 = 0, t23 = 0, t24 = 0, t25 = 0, t26 = 0, t27 = 0, t28 = 0, t29 = 0, t30 = 0, b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3], b4 = b[4], b5 = b[5], b6 = b[6], b7 = b[7], b8 = b[8], b9 = b[9], b10 = b[10], b11 = b[11], b12 = b[12], b13 = b[13], b14 = b[14], b15 = b[15]; + v = a[0]; + t0 += v * b0; + t1 += v * b1; + t2 += v * b2; + t3 += v * b3; + t4 += v * b4; + t5 += v * b5; + t6 += v * b6; + t7 += v * b7; + t8 += v * b8; + t9 += v * b9; + t10 += v * b10; + t11 += v * b11; + t12 += v * b12; + t13 += v * b13; + t14 += v * b14; + t15 += v * b15; + v = a[1]; + t1 += v * b0; + t2 += v * b1; + t3 += v * b2; + t4 += v * b3; + t5 += v * b4; + t6 += v * b5; + t7 += v * b6; + t8 += v * b7; + t9 += v * b8; + t10 += v * b9; + t11 += v * b10; + t12 += v * b11; + t13 += v * b12; + t14 += v * b13; + t15 += v * b14; + t16 += v * b15; + v = a[2]; + t2 += v * b0; + t3 += v * b1; + t4 += v * b2; + t5 += v * b3; + t6 += v * b4; + t7 += v * b5; + t8 += v * b6; + t9 += v * b7; + t10 += v * b8; + t11 += v * b9; + t12 += v * b10; + t13 += v * b11; + t14 += v * b12; + t15 += v * b13; + t16 += v * b14; + t17 += v * b15; + v = a[3]; + t3 += v * b0; + t4 += v * b1; + t5 += v * b2; + t6 += v * b3; + t7 += v * b4; + t8 += v * b5; + t9 += v * b6; + t10 += v * b7; + t11 += v * b8; + t12 += v * b9; + t13 += v * b10; + t14 += v * b11; + t15 += v * b12; + t16 += v * b13; + t17 += v * b14; + t18 += v * b15; + v = a[4]; + t4 += v * b0; + t5 += v * b1; + t6 += v * b2; + t7 += v * b3; + t8 += v * b4; + t9 += v * b5; + t10 += v * b6; + t11 += v * b7; + t12 += v * b8; + t13 += v * b9; + t14 += v * b10; + t15 += v * b11; + t16 += v * b12; + t17 += v * b13; + t18 += v * b14; + t19 += v * b15; + v = a[5]; + t5 += v * b0; + t6 += v * b1; + t7 += v * b2; + t8 += v * b3; + t9 += v * b4; + t10 += v * b5; + t11 += v * b6; + t12 += v * b7; + t13 += v * b8; + t14 += v * b9; + t15 += v * b10; + t16 += v * b11; + t17 += v * b12; + t18 += v * b13; + t19 += v * b14; + t20 += v * b15; + v = a[6]; + t6 += v * b0; + t7 += v * b1; + t8 += v * b2; + t9 += v * b3; + t10 += v * b4; + t11 += v * b5; + t12 += v * b6; + t13 += v * b7; + t14 += v * b8; + t15 += v * b9; + t16 += v * b10; + t17 += v * b11; + t18 += v * b12; + t19 += v * b13; + t20 += v * b14; + t21 += v * b15; + v = a[7]; + t7 += v * b0; + t8 += v * b1; + t9 += v * b2; + t10 += v * b3; + t11 += v * b4; + t12 += v * b5; + t13 += v * b6; + t14 += v * b7; + t15 += v * b8; + t16 += v * b9; + t17 += v * b10; + t18 += v * b11; + t19 += v * b12; + t20 += v * b13; + t21 += v * b14; + t22 += v * b15; + v = a[8]; + t8 += v * b0; + t9 += v * b1; + t10 += v * b2; + t11 += v * b3; + t12 += v * b4; + t13 += v * b5; + t14 += v * b6; + t15 += v * b7; + t16 += v * b8; + t17 += v * b9; + t18 += v * b10; + t19 += v * b11; + t20 += v * b12; + t21 += v * b13; + t22 += v * b14; + t23 += v * b15; + v = a[9]; + t9 += v * b0; + t10 += v * b1; + t11 += v * b2; + t12 += v * b3; + t13 += v * b4; + t14 += v * b5; + t15 += v * b6; + t16 += v * b7; + t17 += v * b8; + t18 += v * b9; + t19 += v * b10; + t20 += v * b11; + t21 += v * b12; + t22 += v * b13; + t23 += v * b14; + t24 += v * b15; + v = a[10]; + t10 += v * b0; + t11 += v * b1; + t12 += v * b2; + t13 += v * b3; + t14 += v * b4; + t15 += v * b5; + t16 += v * b6; + t17 += v * b7; + t18 += v * b8; + t19 += v * b9; + t20 += v * b10; + t21 += v * b11; + t22 += v * b12; + t23 += v * b13; + t24 += v * b14; + t25 += v * b15; + v = a[11]; + t11 += v * b0; + t12 += v * b1; + t13 += v * b2; + t14 += v * b3; + t15 += v * b4; + t16 += v * b5; + t17 += v * b6; + t18 += v * b7; + t19 += v * b8; + t20 += v * b9; + t21 += v * b10; + t22 += v * b11; + t23 += v * b12; + t24 += v * b13; + t25 += v * b14; + t26 += v * b15; + v = a[12]; + t12 += v * b0; + t13 += v * b1; + t14 += v * b2; + t15 += v * b3; + t16 += v * b4; + t17 += v * b5; + t18 += v * b6; + t19 += v * b7; + t20 += v * b8; + t21 += v * b9; + t22 += v * b10; + t23 += v * b11; + t24 += v * b12; + t25 += v * b13; + t26 += v * b14; + t27 += v * b15; + v = a[13]; + t13 += v * b0; + t14 += v * b1; + t15 += v * b2; + t16 += v * b3; + t17 += v * b4; + t18 += v * b5; + t19 += v * b6; + t20 += v * b7; + t21 += v * b8; + t22 += v * b9; + t23 += v * b10; + t24 += v * b11; + t25 += v * b12; + t26 += v * b13; + t27 += v * b14; + t28 += v * b15; + v = a[14]; + t14 += v * b0; + t15 += v * b1; + t16 += v * b2; + t17 += v * b3; + t18 += v * b4; + t19 += v * b5; + t20 += v * b6; + t21 += v * b7; + t22 += v * b8; + t23 += v * b9; + t24 += v * b10; + t25 += v * b11; + t26 += v * b12; + t27 += v * b13; + t28 += v * b14; + t29 += v * b15; + v = a[15]; + t15 += v * b0; + t16 += v * b1; + t17 += v * b2; + t18 += v * b3; + t19 += v * b4; + t20 += v * b5; + t21 += v * b6; + t22 += v * b7; + t23 += v * b8; + t24 += v * b9; + t25 += v * b10; + t26 += v * b11; + t27 += v * b12; + t28 += v * b13; + t29 += v * b14; + t30 += v * b15; + t0 += 38 * t16; + t1 += 38 * t17; + t2 += 38 * t18; + t3 += 38 * t19; + t4 += 38 * t20; + t5 += 38 * t21; + t6 += 38 * t22; + t7 += 38 * t23; + t8 += 38 * t24; + t9 += 38 * t25; + t10 += 38 * t26; + t11 += 38 * t27; + t12 += 38 * t28; + t13 += 38 * t29; + t14 += 38 * t30; + c = 1; + v = t0 + c + 65535; + c = Math.floor(v / 65536); + t0 = v - c * 65536; + v = t1 + c + 65535; + c = Math.floor(v / 65536); + t1 = v - c * 65536; + v = t2 + c + 65535; + c = Math.floor(v / 65536); + t2 = v - c * 65536; + v = t3 + c + 65535; + c = Math.floor(v / 65536); + t3 = v - c * 65536; + v = t4 + c + 65535; + c = Math.floor(v / 65536); + t4 = v - c * 65536; + v = t5 + c + 65535; + c = Math.floor(v / 65536); + t5 = v - c * 65536; + v = t6 + c + 65535; + c = Math.floor(v / 65536); + t6 = v - c * 65536; + v = t7 + c + 65535; + c = Math.floor(v / 65536); + t7 = v - c * 65536; + v = t8 + c + 65535; + c = Math.floor(v / 65536); + t8 = v - c * 65536; + v = t9 + c + 65535; + c = Math.floor(v / 65536); + t9 = v - c * 65536; + v = t10 + c + 65535; + c = Math.floor(v / 65536); + t10 = v - c * 65536; + v = t11 + c + 65535; + c = Math.floor(v / 65536); + t11 = v - c * 65536; + v = t12 + c + 65535; + c = Math.floor(v / 65536); + t12 = v - c * 65536; + v = t13 + c + 65535; + c = Math.floor(v / 65536); + t13 = v - c * 65536; + v = t14 + c + 65535; + c = Math.floor(v / 65536); + t14 = v - c * 65536; + v = t15 + c + 65535; + c = Math.floor(v / 65536); + t15 = v - c * 65536; + t0 += c - 1 + 37 * (c - 1); + c = 1; + v = t0 + c + 65535; + c = Math.floor(v / 65536); + t0 = v - c * 65536; + v = t1 + c + 65535; + c = Math.floor(v / 65536); + t1 = v - c * 65536; + v = t2 + c + 65535; + c = Math.floor(v / 65536); + t2 = v - c * 65536; + v = t3 + c + 65535; + c = Math.floor(v / 65536); + t3 = v - c * 65536; + v = t4 + c + 65535; + c = Math.floor(v / 65536); + t4 = v - c * 65536; + v = t5 + c + 65535; + c = Math.floor(v / 65536); + t5 = v - c * 65536; + v = t6 + c + 65535; + c = Math.floor(v / 65536); + t6 = v - c * 65536; + v = t7 + c + 65535; + c = Math.floor(v / 65536); + t7 = v - c * 65536; + v = t8 + c + 65535; + c = Math.floor(v / 65536); + t8 = v - c * 65536; + v = t9 + c + 65535; + c = Math.floor(v / 65536); + t9 = v - c * 65536; + v = t10 + c + 65535; + c = Math.floor(v / 65536); + t10 = v - c * 65536; + v = t11 + c + 65535; + c = Math.floor(v / 65536); + t11 = v - c * 65536; + v = t12 + c + 65535; + c = Math.floor(v / 65536); + t12 = v - c * 65536; + v = t13 + c + 65535; + c = Math.floor(v / 65536); + t13 = v - c * 65536; + v = t14 + c + 65535; + c = Math.floor(v / 65536); + t14 = v - c * 65536; + v = t15 + c + 65535; + c = Math.floor(v / 65536); + t15 = v - c * 65536; + t0 += c - 1 + 37 * (c - 1); + o[0] = t0; + o[1] = t1; + o[2] = t2; + o[3] = t3; + o[4] = t4; + o[5] = t5; + o[6] = t6; + o[7] = t7; + o[8] = t8; + o[9] = t9; + o[10] = t10; + o[11] = t11; + o[12] = t12; + o[13] = t13; + o[14] = t14; + o[15] = t15; + } + function S(o, a) { + M(o, a, a); + } + function inv25519(o, i) { + var c = gf(); + var a; + for (a = 0; a < 16; a++) + c[a] = i[a]; + for (a = 253; a >= 0; a--) { + S(c, c); + if (a !== 2 && a !== 4) + M(c, c, i); + } + for (a = 0; a < 16; a++) + o[a] = c[a]; + } + function pow2523(o, i) { + var c = gf(); + var a; + for (a = 0; a < 16; a++) + c[a] = i[a]; + for (a = 250; a >= 0; a--) { + S(c, c); + if (a !== 1) + M(c, c, i); + } + for (a = 0; a < 16; a++) + o[a] = c[a]; + } + function crypto_scalarmult(q, n, p) { + var z = new Uint8Array(32); + var x = new Float64Array(80), r, i; + var a = gf(), b = gf(), c = gf(), d = gf(), e = gf(), f = gf(); + for (i = 0; i < 31; i++) + z[i] = n[i]; + z[31] = n[31] & 127 | 64; + z[0] &= 248; + unpack25519(x, p); + for (i = 0; i < 16; i++) { + b[i] = x[i]; + d[i] = a[i] = c[i] = 0; + } + a[0] = d[0] = 1; + for (i = 254; i >= 0; --i) { + r = z[i >>> 3] >>> (i & 7) & 1; + sel25519(a, b, r); + sel25519(c, d, r); + A(e, a, c); + Z(a, a, c); + A(c, b, d); + Z(b, b, d); + S(d, e); + S(f, a); + M(a, c, a); + M(c, b, e); + A(e, a, c); + Z(a, a, c); + S(b, a); + Z(c, d, f); + M(a, c, _121665); + A(a, a, d); + M(c, c, a); + M(a, d, f); + M(d, b, x); + S(b, e); + sel25519(a, b, r); + sel25519(c, d, r); + } + for (i = 0; i < 16; i++) { + x[i + 16] = a[i]; + x[i + 32] = c[i]; + x[i + 48] = b[i]; + x[i + 64] = d[i]; + } + var x32 = x.subarray(32); + var x16 = x.subarray(16); + inv25519(x32, x32); + M(x16, x16, x32); + pack25519(q, x16); + return 0; + } + function crypto_scalarmult_base(q, n) { + return crypto_scalarmult(q, n, _9); + } + function crypto_box_keypair(y, x) { + randombytes(x, 32); + return crypto_scalarmult_base(y, x); + } + function crypto_box_beforenm(k, y, x) { + var s = new Uint8Array(32); + crypto_scalarmult(s, x, y); + return crypto_core_hsalsa20(k, _0, s, sigma); + } + var crypto_box_afternm = crypto_secretbox; + var crypto_box_open_afternm = crypto_secretbox_open; + function crypto_box(c, m, d, n, y, x) { + var k = new Uint8Array(32); + crypto_box_beforenm(k, y, x); + return crypto_box_afternm(c, m, d, n, k); + } + function crypto_box_open(m, c, d, n, y, x) { + var k = new Uint8Array(32); + crypto_box_beforenm(k, y, x); + return crypto_box_open_afternm(m, c, d, n, k); + } + var K = [ + 1116352408, + 3609767458, + 1899447441, + 602891725, + 3049323471, + 3964484399, + 3921009573, + 2173295548, + 961987163, + 4081628472, + 1508970993, + 3053834265, + 2453635748, + 2937671579, + 2870763221, + 3664609560, + 3624381080, + 2734883394, + 310598401, + 1164996542, + 607225278, + 1323610764, + 1426881987, + 3590304994, + 1925078388, + 4068182383, + 2162078206, + 991336113, + 2614888103, + 633803317, + 3248222580, + 3479774868, + 3835390401, + 2666613458, + 4022224774, + 944711139, + 264347078, + 2341262773, + 604807628, + 2007800933, + 770255983, + 1495990901, + 1249150122, + 1856431235, + 1555081692, + 3175218132, + 1996064986, + 2198950837, + 2554220882, + 3999719339, + 2821834349, + 766784016, + 2952996808, + 2566594879, + 3210313671, + 3203337956, + 3336571891, + 1034457026, + 3584528711, + 2466948901, + 113926993, + 3758326383, + 338241895, + 168717936, + 666307205, + 1188179964, + 773529912, + 1546045734, + 1294757372, + 1522805485, + 1396182291, + 2643833823, + 1695183700, + 2343527390, + 1986661051, + 1014477480, + 2177026350, + 1206759142, + 2456956037, + 344077627, + 2730485921, + 1290863460, + 2820302411, + 3158454273, + 3259730800, + 3505952657, + 3345764771, + 106217008, + 3516065817, + 3606008344, + 3600352804, + 1432725776, + 4094571909, + 1467031594, + 275423344, + 851169720, + 430227734, + 3100823752, + 506948616, + 1363258195, + 659060556, + 3750685593, + 883997877, + 3785050280, + 958139571, + 3318307427, + 1322822218, + 3812723403, + 1537002063, + 2003034995, + 1747873779, + 3602036899, + 1955562222, + 1575990012, + 2024104815, + 1125592928, + 2227730452, + 2716904306, + 2361852424, + 442776044, + 2428436474, + 593698344, + 2756734187, + 3733110249, + 3204031479, + 2999351573, + 3329325298, + 3815920427, + 3391569614, + 3928383900, + 3515267271, + 566280711, + 3940187606, + 3454069534, + 4118630271, + 4000239992, + 116418474, + 1914138554, + 174292421, + 2731055270, + 289380356, + 3203993006, + 460393269, + 320620315, + 685471733, + 587496836, + 852142971, + 1086792851, + 1017036298, + 365543100, + 1126000580, + 2618297676, + 1288033470, + 3409855158, + 1501505948, + 4234509866, + 1607167915, + 987167468, + 1816402316, + 1246189591 + ]; + function crypto_hashblocks_hl(hh, hl, m, n) { + var wh = new Int32Array(16), wl = new Int32Array(16), bh0, bh1, bh2, bh3, bh4, bh5, bh6, bh7, bl0, bl1, bl2, bl3, bl4, bl5, bl6, bl7, th, tl, i, j, h, l, a, b, c, d; + var ah0 = hh[0], ah1 = hh[1], ah2 = hh[2], ah3 = hh[3], ah4 = hh[4], ah5 = hh[5], ah6 = hh[6], ah7 = hh[7], al0 = hl[0], al1 = hl[1], al2 = hl[2], al3 = hl[3], al4 = hl[4], al5 = hl[5], al6 = hl[6], al7 = hl[7]; + var pos = 0; + while (n >= 128) { + for (i = 0; i < 16; i++) { + j = 8 * i + pos; + wh[i] = m[j + 0] << 24 | m[j + 1] << 16 | m[j + 2] << 8 | m[j + 3]; + wl[i] = m[j + 4] << 24 | m[j + 5] << 16 | m[j + 6] << 8 | m[j + 7]; + } + for (i = 0; i < 80; i++) { + bh0 = ah0; + bh1 = ah1; + bh2 = ah2; + bh3 = ah3; + bh4 = ah4; + bh5 = ah5; + bh6 = ah6; + bh7 = ah7; + bl0 = al0; + bl1 = al1; + bl2 = al2; + bl3 = al3; + bl4 = al4; + bl5 = al5; + bl6 = al6; + bl7 = al7; + h = ah7; + l = al7; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = (ah4 >>> 14 | al4 << 32 - 14) ^ (ah4 >>> 18 | al4 << 32 - 18) ^ (al4 >>> 41 - 32 | ah4 << 32 - (41 - 32)); + l = (al4 >>> 14 | ah4 << 32 - 14) ^ (al4 >>> 18 | ah4 << 32 - 18) ^ (ah4 >>> 41 - 32 | al4 << 32 - (41 - 32)); + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + h = ah4 & ah5 ^ ~ah4 & ah6; + l = al4 & al5 ^ ~al4 & al6; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + h = K[i * 2]; + l = K[i * 2 + 1]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + h = wh[i % 16]; + l = wl[i % 16]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + th = c & 65535 | d << 16; + tl = a & 65535 | b << 16; + h = th; + l = tl; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = (ah0 >>> 28 | al0 << 32 - 28) ^ (al0 >>> 34 - 32 | ah0 << 32 - (34 - 32)) ^ (al0 >>> 39 - 32 | ah0 << 32 - (39 - 32)); + l = (al0 >>> 28 | ah0 << 32 - 28) ^ (ah0 >>> 34 - 32 | al0 << 32 - (34 - 32)) ^ (ah0 >>> 39 - 32 | al0 << 32 - (39 - 32)); + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + h = ah0 & ah1 ^ ah0 & ah2 ^ ah1 & ah2; + l = al0 & al1 ^ al0 & al2 ^ al1 & al2; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + bh7 = c & 65535 | d << 16; + bl7 = a & 65535 | b << 16; + h = bh3; + l = bl3; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = th; + l = tl; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + bh3 = c & 65535 | d << 16; + bl3 = a & 65535 | b << 16; + ah1 = bh0; + ah2 = bh1; + ah3 = bh2; + ah4 = bh3; + ah5 = bh4; + ah6 = bh5; + ah7 = bh6; + ah0 = bh7; + al1 = bl0; + al2 = bl1; + al3 = bl2; + al4 = bl3; + al5 = bl4; + al6 = bl5; + al7 = bl6; + al0 = bl7; + if (i % 16 === 15) { + for (j = 0; j < 16; j++) { + h = wh[j]; + l = wl[j]; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = wh[(j + 9) % 16]; + l = wl[(j + 9) % 16]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + th = wh[(j + 1) % 16]; + tl = wl[(j + 1) % 16]; + h = (th >>> 1 | tl << 32 - 1) ^ (th >>> 8 | tl << 32 - 8) ^ th >>> 7; + l = (tl >>> 1 | th << 32 - 1) ^ (tl >>> 8 | th << 32 - 8) ^ (tl >>> 7 | th << 32 - 7); + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + th = wh[(j + 14) % 16]; + tl = wl[(j + 14) % 16]; + h = (th >>> 19 | tl << 32 - 19) ^ (tl >>> 61 - 32 | th << 32 - (61 - 32)) ^ th >>> 6; + l = (tl >>> 19 | th << 32 - 19) ^ (th >>> 61 - 32 | tl << 32 - (61 - 32)) ^ (tl >>> 6 | th << 32 - 6); + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + wh[j] = c & 65535 | d << 16; + wl[j] = a & 65535 | b << 16; + } + } + } + h = ah0; + l = al0; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = hh[0]; + l = hl[0]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + hh[0] = ah0 = c & 65535 | d << 16; + hl[0] = al0 = a & 65535 | b << 16; + h = ah1; + l = al1; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = hh[1]; + l = hl[1]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + hh[1] = ah1 = c & 65535 | d << 16; + hl[1] = al1 = a & 65535 | b << 16; + h = ah2; + l = al2; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = hh[2]; + l = hl[2]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + hh[2] = ah2 = c & 65535 | d << 16; + hl[2] = al2 = a & 65535 | b << 16; + h = ah3; + l = al3; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = hh[3]; + l = hl[3]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + hh[3] = ah3 = c & 65535 | d << 16; + hl[3] = al3 = a & 65535 | b << 16; + h = ah4; + l = al4; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = hh[4]; + l = hl[4]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + hh[4] = ah4 = c & 65535 | d << 16; + hl[4] = al4 = a & 65535 | b << 16; + h = ah5; + l = al5; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = hh[5]; + l = hl[5]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + hh[5] = ah5 = c & 65535 | d << 16; + hl[5] = al5 = a & 65535 | b << 16; + h = ah6; + l = al6; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = hh[6]; + l = hl[6]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + hh[6] = ah6 = c & 65535 | d << 16; + hl[6] = al6 = a & 65535 | b << 16; + h = ah7; + l = al7; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = hh[7]; + l = hl[7]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + hh[7] = ah7 = c & 65535 | d << 16; + hl[7] = al7 = a & 65535 | b << 16; + pos += 128; + n -= 128; + } + return n; + } + function crypto_hash(out, m, n) { + var hh = new Int32Array(8), hl = new Int32Array(8), x = new Uint8Array(256), i, b = n; + hh[0] = 1779033703; + hh[1] = 3144134277; + hh[2] = 1013904242; + hh[3] = 2773480762; + hh[4] = 1359893119; + hh[5] = 2600822924; + hh[6] = 528734635; + hh[7] = 1541459225; + hl[0] = 4089235720; + hl[1] = 2227873595; + hl[2] = 4271175723; + hl[3] = 1595750129; + hl[4] = 2917565137; + hl[5] = 725511199; + hl[6] = 4215389547; + hl[7] = 327033209; + crypto_hashblocks_hl(hh, hl, m, n); + n %= 128; + for (i = 0; i < n; i++) + x[i] = m[b - n + i]; + x[n] = 128; + n = 256 - 128 * (n < 112 ? 1 : 0); + x[n - 9] = 0; + ts64(x, n - 8, b / 536870912 | 0, b << 3); + crypto_hashblocks_hl(hh, hl, x, n); + for (i = 0; i < 8; i++) + ts64(out, 8 * i, hh[i], hl[i]); + return 0; + } + function add(p, q) { + var a = gf(), b = gf(), c = gf(), d = gf(), e = gf(), f = gf(), g = gf(), h = gf(), t = gf(); + Z(a, p[1], p[0]); + Z(t, q[1], q[0]); + M(a, a, t); + A(b, p[0], p[1]); + A(t, q[0], q[1]); + M(b, b, t); + M(c, p[3], q[3]); + M(c, c, D2); + M(d, p[2], q[2]); + A(d, d, d); + Z(e, b, a); + Z(f, d, c); + A(g, d, c); + A(h, b, a); + M(p[0], e, f); + M(p[1], h, g); + M(p[2], g, f); + M(p[3], e, h); + } + function cswap(p, q, b) { + var i; + for (i = 0; i < 4; i++) { + sel25519(p[i], q[i], b); + } + } + function pack(r, p) { + var tx = gf(), ty = gf(), zi = gf(); + inv25519(zi, p[2]); + M(tx, p[0], zi); + M(ty, p[1], zi); + pack25519(r, ty); + r[31] ^= par25519(tx) << 7; + } + function scalarmult(p, q, s) { + var b, i; + set25519(p[0], gf0); + set25519(p[1], gf1); + set25519(p[2], gf1); + set25519(p[3], gf0); + for (i = 255; i >= 0; --i) { + b = s[i / 8 | 0] >> (i & 7) & 1; + cswap(p, q, b); + add(q, p); + add(p, p); + cswap(p, q, b); + } + } + function scalarbase(p, s) { + var q = [gf(), gf(), gf(), gf()]; + set25519(q[0], X); + set25519(q[1], Y); + set25519(q[2], gf1); + M(q[3], X, Y); + scalarmult(p, q, s); + } + function crypto_sign_keypair(pk, sk, seeded) { + var d = new Uint8Array(64); + var p = [gf(), gf(), gf(), gf()]; + var i; + if (!seeded) + randombytes(sk, 32); + crypto_hash(d, sk, 32); + d[0] &= 248; + d[31] &= 127; + d[31] |= 64; + scalarbase(p, d); + pack(pk, p); + for (i = 0; i < 32; i++) + sk[i + 32] = pk[i]; + return 0; + } + var L4 = new Float64Array([237, 211, 245, 92, 26, 99, 18, 88, 214, 156, 247, 162, 222, 249, 222, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16]); + function modL(r, x) { + var carry, i, j, k; + for (i = 63; i >= 32; --i) { + carry = 0; + for (j = i - 32, k = i - 12; j < k; ++j) { + x[j] += carry - 16 * x[i] * L4[j - (i - 32)]; + carry = Math.floor((x[j] + 128) / 256); + x[j] -= carry * 256; + } + x[j] += carry; + x[i] = 0; + } + carry = 0; + for (j = 0; j < 32; j++) { + x[j] += carry - (x[31] >> 4) * L4[j]; + carry = x[j] >> 8; + x[j] &= 255; + } + for (j = 0; j < 32; j++) + x[j] -= carry * L4[j]; + for (i = 0; i < 32; i++) { + x[i + 1] += x[i] >> 8; + r[i] = x[i] & 255; + } + } + function reduce(r) { + var x = new Float64Array(64), i; + for (i = 0; i < 64; i++) + x[i] = r[i]; + for (i = 0; i < 64; i++) + r[i] = 0; + modL(r, x); + } + function crypto_sign(sm, m, n, sk) { + var d = new Uint8Array(64), h = new Uint8Array(64), r = new Uint8Array(64); + var i, j, x = new Float64Array(64); + var p = [gf(), gf(), gf(), gf()]; + crypto_hash(d, sk, 32); + d[0] &= 248; + d[31] &= 127; + d[31] |= 64; + var smlen = n + 64; + for (i = 0; i < n; i++) + sm[64 + i] = m[i]; + for (i = 0; i < 32; i++) + sm[32 + i] = d[32 + i]; + crypto_hash(r, sm.subarray(32), n + 32); + reduce(r); + scalarbase(p, r); + pack(sm, p); + for (i = 32; i < 64; i++) + sm[i] = sk[i]; + crypto_hash(h, sm, n + 64); + reduce(h); + for (i = 0; i < 64; i++) + x[i] = 0; + for (i = 0; i < 32; i++) + x[i] = r[i]; + for (i = 0; i < 32; i++) { + for (j = 0; j < 32; j++) { + x[i + j] += h[i] * d[j]; + } + } + modL(sm.subarray(32), x); + return smlen; + } + function unpackneg(r, p) { + var t = gf(), chk = gf(), num = gf(), den = gf(), den2 = gf(), den4 = gf(), den6 = gf(); + set25519(r[2], gf1); + unpack25519(r[1], p); + S(num, r[1]); + M(den, num, D); + Z(num, num, r[2]); + A(den, r[2], den); + S(den2, den); + S(den4, den2); + M(den6, den4, den2); + M(t, den6, num); + M(t, t, den); + pow2523(t, t); + M(t, t, num); + M(t, t, den); + M(t, t, den); + M(r[0], t, den); + S(chk, r[0]); + M(chk, chk, den); + if (neq25519(chk, num)) + M(r[0], r[0], I); + S(chk, r[0]); + M(chk, chk, den); + if (neq25519(chk, num)) + return -1; + if (par25519(r[0]) === p[31] >> 7) + Z(r[0], gf0, r[0]); + M(r[3], r[0], r[1]); + return 0; + } + function crypto_sign_open(m, sm, n, pk) { + var i; + var t = new Uint8Array(32), h = new Uint8Array(64); + var p = [gf(), gf(), gf(), gf()], q = [gf(), gf(), gf(), gf()]; + if (n < 64) + return -1; + if (unpackneg(q, pk)) + return -1; + for (i = 0; i < n; i++) + m[i] = sm[i]; + for (i = 0; i < 32; i++) + m[i + 32] = pk[i]; + crypto_hash(h, m, n); + reduce(h); + scalarmult(p, q, h); + scalarbase(q, sm.subarray(32)); + add(p, q); + pack(t, p); + n -= 64; + if (crypto_verify_32(sm, 0, t, 0)) { + for (i = 0; i < n; i++) + m[i] = 0; + return -1; + } + for (i = 0; i < n; i++) + m[i] = sm[i + 64]; + return n; + } + var crypto_secretbox_KEYBYTES = 32, crypto_secretbox_NONCEBYTES = 24, crypto_secretbox_ZEROBYTES = 32, crypto_secretbox_BOXZEROBYTES = 16, crypto_scalarmult_BYTES = 32, crypto_scalarmult_SCALARBYTES = 32, crypto_box_PUBLICKEYBYTES = 32, crypto_box_SECRETKEYBYTES = 32, crypto_box_BEFORENMBYTES = 32, crypto_box_NONCEBYTES = crypto_secretbox_NONCEBYTES, crypto_box_ZEROBYTES = crypto_secretbox_ZEROBYTES, crypto_box_BOXZEROBYTES = crypto_secretbox_BOXZEROBYTES, crypto_sign_BYTES = 64, crypto_sign_PUBLICKEYBYTES = 32, crypto_sign_SECRETKEYBYTES = 64, crypto_sign_SEEDBYTES = 32, crypto_hash_BYTES = 64; + nacl2.lowlevel = { + crypto_core_hsalsa20, + crypto_stream_xor, + crypto_stream, + crypto_stream_salsa20_xor, + crypto_stream_salsa20, + crypto_onetimeauth, + crypto_onetimeauth_verify, + crypto_verify_16, + crypto_verify_32, + crypto_secretbox, + crypto_secretbox_open, + crypto_scalarmult, + crypto_scalarmult_base, + crypto_box_beforenm, + crypto_box_afternm, + crypto_box, + crypto_box_open, + crypto_box_keypair, + crypto_hash, + crypto_sign, + crypto_sign_keypair, + crypto_sign_open, + crypto_secretbox_KEYBYTES, + crypto_secretbox_NONCEBYTES, + crypto_secretbox_ZEROBYTES, + crypto_secretbox_BOXZEROBYTES, + crypto_scalarmult_BYTES, + crypto_scalarmult_SCALARBYTES, + crypto_box_PUBLICKEYBYTES, + crypto_box_SECRETKEYBYTES, + crypto_box_BEFORENMBYTES, + crypto_box_NONCEBYTES, + crypto_box_ZEROBYTES, + crypto_box_BOXZEROBYTES, + crypto_sign_BYTES, + crypto_sign_PUBLICKEYBYTES, + crypto_sign_SECRETKEYBYTES, + crypto_sign_SEEDBYTES, + crypto_hash_BYTES, + gf, + D, + L: L4, + pack25519, + unpack25519, + M, + A, + S, + Z, + pow2523, + add, + set25519, + modL, + scalarmult, + scalarbase + }; + function checkLengths(k, n) { + if (k.length !== crypto_secretbox_KEYBYTES) + throw new Error("bad key size"); + if (n.length !== crypto_secretbox_NONCEBYTES) + throw new Error("bad nonce size"); + } + function checkBoxLengths(pk, sk) { + if (pk.length !== crypto_box_PUBLICKEYBYTES) + throw new Error("bad public key size"); + if (sk.length !== crypto_box_SECRETKEYBYTES) + throw new Error("bad secret key size"); + } + function checkArrayTypes() { + for (var i = 0; i < arguments.length; i++) { + if (!(arguments[i] instanceof Uint8Array)) + throw new TypeError("unexpected type, use Uint8Array"); + } + } + function cleanup(arr) { + for (var i = 0; i < arr.length; i++) + arr[i] = 0; + } + nacl2.randomBytes = function(n) { + var b = new Uint8Array(n); + randombytes(b, n); + return b; + }; + nacl2.secretbox = function(msg, nonce, key) { + checkArrayTypes(msg, nonce, key); + checkLengths(key, nonce); + var m = new Uint8Array(crypto_secretbox_ZEROBYTES + msg.length); + var c = new Uint8Array(m.length); + for (var i = 0; i < msg.length; i++) + m[i + crypto_secretbox_ZEROBYTES] = msg[i]; + crypto_secretbox(c, m, m.length, nonce, key); + return c.subarray(crypto_secretbox_BOXZEROBYTES); + }; + nacl2.secretbox.open = function(box, nonce, key) { + checkArrayTypes(box, nonce, key); + checkLengths(key, nonce); + var c = new Uint8Array(crypto_secretbox_BOXZEROBYTES + box.length); + var m = new Uint8Array(c.length); + for (var i = 0; i < box.length; i++) + c[i + crypto_secretbox_BOXZEROBYTES] = box[i]; + if (c.length < 32) + return null; + if (crypto_secretbox_open(m, c, c.length, nonce, key) !== 0) + return null; + return m.subarray(crypto_secretbox_ZEROBYTES); + }; + nacl2.secretbox.keyLength = crypto_secretbox_KEYBYTES; + nacl2.secretbox.nonceLength = crypto_secretbox_NONCEBYTES; + nacl2.secretbox.overheadLength = crypto_secretbox_BOXZEROBYTES; + nacl2.scalarMult = function(n, p) { + checkArrayTypes(n, p); + if (n.length !== crypto_scalarmult_SCALARBYTES) + throw new Error("bad n size"); + if (p.length !== crypto_scalarmult_BYTES) + throw new Error("bad p size"); + var q = new Uint8Array(crypto_scalarmult_BYTES); + crypto_scalarmult(q, n, p); + return q; + }; + nacl2.scalarMult.base = function(n) { + checkArrayTypes(n); + if (n.length !== crypto_scalarmult_SCALARBYTES) + throw new Error("bad n size"); + var q = new Uint8Array(crypto_scalarmult_BYTES); + crypto_scalarmult_base(q, n); + return q; + }; + nacl2.scalarMult.scalarLength = crypto_scalarmult_SCALARBYTES; + nacl2.scalarMult.groupElementLength = crypto_scalarmult_BYTES; + nacl2.box = function(msg, nonce, publicKey, secretKey) { + var k = nacl2.box.before(publicKey, secretKey); + return nacl2.secretbox(msg, nonce, k); + }; + nacl2.box.before = function(publicKey, secretKey) { + checkArrayTypes(publicKey, secretKey); + checkBoxLengths(publicKey, secretKey); + var k = new Uint8Array(crypto_box_BEFORENMBYTES); + crypto_box_beforenm(k, publicKey, secretKey); + return k; + }; + nacl2.box.after = nacl2.secretbox; + nacl2.box.open = function(msg, nonce, publicKey, secretKey) { + var k = nacl2.box.before(publicKey, secretKey); + return nacl2.secretbox.open(msg, nonce, k); + }; + nacl2.box.open.after = nacl2.secretbox.open; + nacl2.box.keyPair = function() { + var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES); + var sk = new Uint8Array(crypto_box_SECRETKEYBYTES); + crypto_box_keypair(pk, sk); + return { publicKey: pk, secretKey: sk }; + }; + nacl2.box.keyPair.fromSecretKey = function(secretKey) { + checkArrayTypes(secretKey); + if (secretKey.length !== crypto_box_SECRETKEYBYTES) + throw new Error("bad secret key size"); + var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES); + crypto_scalarmult_base(pk, secretKey); + return { publicKey: pk, secretKey: new Uint8Array(secretKey) }; + }; + nacl2.box.publicKeyLength = crypto_box_PUBLICKEYBYTES; + nacl2.box.secretKeyLength = crypto_box_SECRETKEYBYTES; + nacl2.box.sharedKeyLength = crypto_box_BEFORENMBYTES; + nacl2.box.nonceLength = crypto_box_NONCEBYTES; + nacl2.box.overheadLength = nacl2.secretbox.overheadLength; + nacl2.sign = function(msg, secretKey) { + checkArrayTypes(msg, secretKey); + if (secretKey.length !== crypto_sign_SECRETKEYBYTES) + throw new Error("bad secret key size"); + var signedMsg = new Uint8Array(crypto_sign_BYTES + msg.length); + crypto_sign(signedMsg, msg, msg.length, secretKey); + return signedMsg; + }; + nacl2.sign.open = function(signedMsg, publicKey) { + checkArrayTypes(signedMsg, publicKey); + if (publicKey.length !== crypto_sign_PUBLICKEYBYTES) + throw new Error("bad public key size"); + var tmp = new Uint8Array(signedMsg.length); + var mlen = crypto_sign_open(tmp, signedMsg, signedMsg.length, publicKey); + if (mlen < 0) + return null; + var m = new Uint8Array(mlen); + for (var i = 0; i < m.length; i++) + m[i] = tmp[i]; + return m; + }; + nacl2.sign.detached = function(msg, secretKey) { + var signedMsg = nacl2.sign(msg, secretKey); + var sig = new Uint8Array(crypto_sign_BYTES); + for (var i = 0; i < sig.length; i++) + sig[i] = signedMsg[i]; + return sig; + }; + nacl2.sign.detached.verify = function(msg, sig, publicKey) { + checkArrayTypes(msg, sig, publicKey); + if (sig.length !== crypto_sign_BYTES) + throw new Error("bad signature size"); + if (publicKey.length !== crypto_sign_PUBLICKEYBYTES) + throw new Error("bad public key size"); + var sm = new Uint8Array(crypto_sign_BYTES + msg.length); + var m = new Uint8Array(crypto_sign_BYTES + msg.length); + var i; + for (i = 0; i < crypto_sign_BYTES; i++) + sm[i] = sig[i]; + for (i = 0; i < msg.length; i++) + sm[i + crypto_sign_BYTES] = msg[i]; + return crypto_sign_open(m, sm, sm.length, publicKey) >= 0; + }; + nacl2.sign.keyPair = function() { + var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES); + var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES); + crypto_sign_keypair(pk, sk); + return { publicKey: pk, secretKey: sk }; + }; + nacl2.sign.keyPair.fromSecretKey = function(secretKey) { + checkArrayTypes(secretKey); + if (secretKey.length !== crypto_sign_SECRETKEYBYTES) + throw new Error("bad secret key size"); + var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES); + for (var i = 0; i < pk.length; i++) + pk[i] = secretKey[32 + i]; + return { publicKey: pk, secretKey: new Uint8Array(secretKey) }; + }; + nacl2.sign.keyPair.fromSeed = function(seed) { + checkArrayTypes(seed); + if (seed.length !== crypto_sign_SEEDBYTES) + throw new Error("bad seed size"); + var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES); + var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES); + for (var i = 0; i < 32; i++) + sk[i] = seed[i]; + crypto_sign_keypair(pk, sk, true); + return { publicKey: pk, secretKey: sk }; + }; + nacl2.sign.publicKeyLength = crypto_sign_PUBLICKEYBYTES; + nacl2.sign.secretKeyLength = crypto_sign_SECRETKEYBYTES; + nacl2.sign.seedLength = crypto_sign_SEEDBYTES; + nacl2.sign.signatureLength = crypto_sign_BYTES; + nacl2.hash = function(msg) { + checkArrayTypes(msg); + var h = new Uint8Array(crypto_hash_BYTES); + crypto_hash(h, msg, msg.length); + return h; + }; + nacl2.hash.hashLength = crypto_hash_BYTES; + nacl2.verify = function(x, y) { + checkArrayTypes(x, y); + if (x.length === 0 || y.length === 0) + return false; + if (x.length !== y.length) + return false; + return vn(x, 0, y, 0, x.length) === 0 ? true : false; + }; + nacl2.setPRNG = function(fn) { + randombytes = fn; + }; + (function() { + var crypto2 = typeof self !== "undefined" ? self.crypto || self.msCrypto : null; + if (crypto2 && crypto2.getRandomValues) { + var QUOTA = 65536; + nacl2.setPRNG(function(x, n) { + var i, v = new Uint8Array(n); + for (i = 0; i < n; i += QUOTA) { + crypto2.getRandomValues(v.subarray(i, i + Math.min(n - i, QUOTA))); + } + for (i = 0; i < n; i++) + x[i] = v[i]; + cleanup(v); + }); + } else if (typeof __require !== "undefined") { + crypto2 = require_crypto(); + if (crypto2 && crypto2.randomBytes) { + nacl2.setPRNG(function(x, n) { + var i, v = crypto2.randomBytes(n); + for (i = 0; i < n; i++) + x[i] = v[i]; + cleanup(v); + }); + } + } + })(); + })(typeof module !== "undefined" && module.exports ? module.exports : self.nacl = self.nacl || {}); + } + }); + + // node_modules/scrypt-async/scrypt-async.js + var require_scrypt_async = __commonJS({ + "node_modules/scrypt-async/scrypt-async.js"(exports, module) { + function scrypt2(password, salt, logN, r, dkLen, interruptStep, callback, encoding) { + "use strict"; + function SHA256(m) { + var K = [ + 1116352408, + 1899447441, + 3049323471, + 3921009573, + 961987163, + 1508970993, + 2453635748, + 2870763221, + 3624381080, + 310598401, + 607225278, + 1426881987, + 1925078388, + 2162078206, + 2614888103, + 3248222580, + 3835390401, + 4022224774, + 264347078, + 604807628, + 770255983, + 1249150122, + 1555081692, + 1996064986, + 2554220882, + 2821834349, + 2952996808, + 3210313671, + 3336571891, + 3584528711, + 113926993, + 338241895, + 666307205, + 773529912, + 1294757372, + 1396182291, + 1695183700, + 1986661051, + 2177026350, + 2456956037, + 2730485921, + 2820302411, + 3259730800, + 3345764771, + 3516065817, + 3600352804, + 4094571909, + 275423344, + 430227734, + 506948616, + 659060556, + 883997877, + 958139571, + 1322822218, + 1537002063, + 1747873779, + 1955562222, + 2024104815, + 2227730452, + 2361852424, + 2428436474, + 2756734187, + 3204031479, + 3329325298 + ]; + var h0 = 1779033703, h1 = 3144134277, h2 = 1013904242, h3 = 2773480762, h4 = 1359893119, h5 = 2600822924, h6 = 528734635, h7 = 1541459225, w = new Array(64); + function blocks(p3) { + var off = 0, len = p3.length; + while (len >= 64) { + var a = h0, b = h1, c = h2, d = h3, e = h4, f = h5, g = h6, h = h7, u, i2, j, t1, t2; + for (i2 = 0; i2 < 16; i2++) { + j = off + i2 * 4; + w[i2] = (p3[j] & 255) << 24 | (p3[j + 1] & 255) << 16 | (p3[j + 2] & 255) << 8 | p3[j + 3] & 255; + } + for (i2 = 16; i2 < 64; i2++) { + u = w[i2 - 2]; + t1 = (u >>> 17 | u << 32 - 17) ^ (u >>> 19 | u << 32 - 19) ^ u >>> 10; + u = w[i2 - 15]; + t2 = (u >>> 7 | u << 32 - 7) ^ (u >>> 18 | u << 32 - 18) ^ u >>> 3; + w[i2] = (t1 + w[i2 - 7] | 0) + (t2 + w[i2 - 16] | 0) | 0; + } + for (i2 = 0; i2 < 64; i2++) { + t1 = (((e >>> 6 | e << 32 - 6) ^ (e >>> 11 | e << 32 - 11) ^ (e >>> 25 | e << 32 - 25)) + (e & f ^ ~e & g) | 0) + (h + (K[i2] + w[i2] | 0) | 0) | 0; + t2 = ((a >>> 2 | a << 32 - 2) ^ (a >>> 13 | a << 32 - 13) ^ (a >>> 22 | a << 32 - 22)) + (a & b ^ a & c ^ b & c) | 0; + h = g; + g = f; + f = e; + e = d + t1 | 0; + d = c; + c = b; + b = a; + a = t1 + t2 | 0; + } + h0 = h0 + a | 0; + h1 = h1 + b | 0; + h2 = h2 + c | 0; + h3 = h3 + d | 0; + h4 = h4 + e | 0; + h5 = h5 + f | 0; + h6 = h6 + g | 0; + h7 = h7 + h | 0; + off += 64; + len -= 64; + } + } + blocks(m); + var i, bytesLeft = m.length % 64, bitLenHi = m.length / 536870912 | 0, bitLenLo = m.length << 3, numZeros = bytesLeft < 56 ? 56 : 120, p2 = m.slice(m.length - bytesLeft, m.length); + p2.push(128); + for (i = bytesLeft + 1; i < numZeros; i++) + p2.push(0); + p2.push(bitLenHi >>> 24 & 255); + p2.push(bitLenHi >>> 16 & 255); + p2.push(bitLenHi >>> 8 & 255); + p2.push(bitLenHi >>> 0 & 255); + p2.push(bitLenLo >>> 24 & 255); + p2.push(bitLenLo >>> 16 & 255); + p2.push(bitLenLo >>> 8 & 255); + p2.push(bitLenLo >>> 0 & 255); + blocks(p2); + return [ + h0 >>> 24 & 255, + h0 >>> 16 & 255, + h0 >>> 8 & 255, + h0 >>> 0 & 255, + h1 >>> 24 & 255, + h1 >>> 16 & 255, + h1 >>> 8 & 255, + h1 >>> 0 & 255, + h2 >>> 24 & 255, + h2 >>> 16 & 255, + h2 >>> 8 & 255, + h2 >>> 0 & 255, + h3 >>> 24 & 255, + h3 >>> 16 & 255, + h3 >>> 8 & 255, + h3 >>> 0 & 255, + h4 >>> 24 & 255, + h4 >>> 16 & 255, + h4 >>> 8 & 255, + h4 >>> 0 & 255, + h5 >>> 24 & 255, + h5 >>> 16 & 255, + h5 >>> 8 & 255, + h5 >>> 0 & 255, + h6 >>> 24 & 255, + h6 >>> 16 & 255, + h6 >>> 8 & 255, + h6 >>> 0 & 255, + h7 >>> 24 & 255, + h7 >>> 16 & 255, + h7 >>> 8 & 255, + h7 >>> 0 & 255 + ]; + } + function PBKDF2_HMAC_SHA256_OneIter(password2, salt2, dkLen2) { + if (password2.length > 64) { + password2 = SHA256(password2.push ? password2 : Array.prototype.slice.call(password2, 0)); + } + var i, innerLen = 64 + salt2.length + 4, inner = new Array(innerLen), outerKey = new Array(64), dk = []; + for (i = 0; i < 64; i++) + inner[i] = 54; + for (i = 0; i < password2.length; i++) + inner[i] ^= password2[i]; + for (i = 0; i < salt2.length; i++) + inner[64 + i] = salt2[i]; + for (i = innerLen - 4; i < innerLen; i++) + inner[i] = 0; + for (i = 0; i < 64; i++) + outerKey[i] = 92; + for (i = 0; i < password2.length; i++) + outerKey[i] ^= password2[i]; + function incrementCounter() { + for (var i2 = innerLen - 1; i2 >= innerLen - 4; i2--) { + inner[i2]++; + if (inner[i2] <= 255) + return; + inner[i2] = 0; + } + } + while (dkLen2 >= 32) { + incrementCounter(); + dk = dk.concat(SHA256(outerKey.concat(SHA256(inner)))); + dkLen2 -= 32; + } + if (dkLen2 > 0) { + incrementCounter(); + dk = dk.concat(SHA256(outerKey.concat(SHA256(inner))).slice(0, dkLen2)); + } + return dk; + } + function salsaXOR(tmp2, B2, bin, bout) { + var j0 = tmp2[0] ^ B2[bin++], j1 = tmp2[1] ^ B2[bin++], j2 = tmp2[2] ^ B2[bin++], j3 = tmp2[3] ^ B2[bin++], j4 = tmp2[4] ^ B2[bin++], j5 = tmp2[5] ^ B2[bin++], j6 = tmp2[6] ^ B2[bin++], j7 = tmp2[7] ^ B2[bin++], j8 = tmp2[8] ^ B2[bin++], j9 = tmp2[9] ^ B2[bin++], j10 = tmp2[10] ^ B2[bin++], j11 = tmp2[11] ^ B2[bin++], j12 = tmp2[12] ^ B2[bin++], j13 = tmp2[13] ^ B2[bin++], j14 = tmp2[14] ^ B2[bin++], j15 = tmp2[15] ^ B2[bin++], u, i; + var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7, x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14, x15 = j15; + for (i = 0; i < 8; i += 2) { + u = x0 + x12; + x4 ^= u << 7 | u >>> 32 - 7; + u = x4 + x0; + x8 ^= u << 9 | u >>> 32 - 9; + u = x8 + x4; + x12 ^= u << 13 | u >>> 32 - 13; + u = x12 + x8; + x0 ^= u << 18 | u >>> 32 - 18; + u = x5 + x1; + x9 ^= u << 7 | u >>> 32 - 7; + u = x9 + x5; + x13 ^= u << 9 | u >>> 32 - 9; + u = x13 + x9; + x1 ^= u << 13 | u >>> 32 - 13; + u = x1 + x13; + x5 ^= u << 18 | u >>> 32 - 18; + u = x10 + x6; + x14 ^= u << 7 | u >>> 32 - 7; + u = x14 + x10; + x2 ^= u << 9 | u >>> 32 - 9; + u = x2 + x14; + x6 ^= u << 13 | u >>> 32 - 13; + u = x6 + x2; + x10 ^= u << 18 | u >>> 32 - 18; + u = x15 + x11; + x3 ^= u << 7 | u >>> 32 - 7; + u = x3 + x15; + x7 ^= u << 9 | u >>> 32 - 9; + u = x7 + x3; + x11 ^= u << 13 | u >>> 32 - 13; + u = x11 + x7; + x15 ^= u << 18 | u >>> 32 - 18; + u = x0 + x3; + x1 ^= u << 7 | u >>> 32 - 7; + u = x1 + x0; + x2 ^= u << 9 | u >>> 32 - 9; + u = x2 + x1; + x3 ^= u << 13 | u >>> 32 - 13; + u = x3 + x2; + x0 ^= u << 18 | u >>> 32 - 18; + u = x5 + x4; + x6 ^= u << 7 | u >>> 32 - 7; + u = x6 + x5; + x7 ^= u << 9 | u >>> 32 - 9; + u = x7 + x6; + x4 ^= u << 13 | u >>> 32 - 13; + u = x4 + x7; + x5 ^= u << 18 | u >>> 32 - 18; + u = x10 + x9; + x11 ^= u << 7 | u >>> 32 - 7; + u = x11 + x10; + x8 ^= u << 9 | u >>> 32 - 9; + u = x8 + x11; + x9 ^= u << 13 | u >>> 32 - 13; + u = x9 + x8; + x10 ^= u << 18 | u >>> 32 - 18; + u = x15 + x14; + x12 ^= u << 7 | u >>> 32 - 7; + u = x12 + x15; + x13 ^= u << 9 | u >>> 32 - 9; + u = x13 + x12; + x14 ^= u << 13 | u >>> 32 - 13; + u = x14 + x13; + x15 ^= u << 18 | u >>> 32 - 18; + } + B2[bout++] = tmp2[0] = x0 + j0 | 0; + B2[bout++] = tmp2[1] = x1 + j1 | 0; + B2[bout++] = tmp2[2] = x2 + j2 | 0; + B2[bout++] = tmp2[3] = x3 + j3 | 0; + B2[bout++] = tmp2[4] = x4 + j4 | 0; + B2[bout++] = tmp2[5] = x5 + j5 | 0; + B2[bout++] = tmp2[6] = x6 + j6 | 0; + B2[bout++] = tmp2[7] = x7 + j7 | 0; + B2[bout++] = tmp2[8] = x8 + j8 | 0; + B2[bout++] = tmp2[9] = x9 + j9 | 0; + B2[bout++] = tmp2[10] = x10 + j10 | 0; + B2[bout++] = tmp2[11] = x11 + j11 | 0; + B2[bout++] = tmp2[12] = x12 + j12 | 0; + B2[bout++] = tmp2[13] = x13 + j13 | 0; + B2[bout++] = tmp2[14] = x14 + j14 | 0; + B2[bout++] = tmp2[15] = x15 + j15 | 0; + } + function blockCopy(dst, di, src2, si, len) { + while (len--) + dst[di++] = src2[si++]; + } + function blockXOR(dst, di, src2, si, len) { + while (len--) + dst[di++] ^= src2[si++]; + } + function blockMix(tmp2, B2, bin, bout, r2) { + blockCopy(tmp2, 0, B2, bin + (2 * r2 - 1) * 16, 16); + for (var i = 0; i < 2 * r2; i += 2) { + salsaXOR(tmp2, B2, bin + i * 16, bout + i * 8); + salsaXOR(tmp2, B2, bin + i * 16 + 16, bout + i * 8 + r2 * 16); + } + } + function integerify(B2, bi, r2) { + return B2[bi + (2 * r2 - 1) * 16]; + } + function stringToUTF8Bytes(s) { + var arr = []; + for (var i = 0; i < s.length; i++) { + var c = s.charCodeAt(i); + if (c < 128) { + arr.push(c); + } else if (c < 2048) { + arr.push(192 | c >> 6); + arr.push(128 | c & 63); + } else if (c < 55296) { + arr.push(224 | c >> 12); + arr.push(128 | c >> 6 & 63); + arr.push(128 | c & 63); + } else { + if (i >= s.length - 1) { + throw new Error("invalid string"); + } + i++; + c = (c & 1023) << 10; + c |= s.charCodeAt(i) & 1023; + c += 65536; + arr.push(240 | c >> 18); + arr.push(128 | c >> 12 & 63); + arr.push(128 | c >> 6 & 63); + arr.push(128 | c & 63); + } + } + return arr; + } + function bytesToHex(p2) { + var enc = "0123456789abcdef".split(""); + var len = p2.length, arr = [], i = 0; + for (; i < len; i++) { + arr.push(enc[p2[i] >>> 4 & 15]); + arr.push(enc[p2[i] >>> 0 & 15]); + } + return arr.join(""); + } + function bytesToBase64(p2) { + var enc = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""); + var len = p2.length, arr = [], i = 0, a, b, c, t; + while (i < len) { + a = i < len ? p2[i++] : 0; + b = i < len ? p2[i++] : 0; + c = i < len ? p2[i++] : 0; + t = (a << 16) + (b << 8) + c; + arr.push(enc[t >>> 3 * 6 & 63]); + arr.push(enc[t >>> 2 * 6 & 63]); + arr.push(enc[t >>> 1 * 6 & 63]); + arr.push(enc[t >>> 0 * 6 & 63]); + } + if (len % 3 > 0) { + arr[arr.length - 1] = "="; + if (len % 3 === 1) + arr[arr.length - 2] = "="; + } + return arr.join(""); + } + var MAX_UINT = -1 >>> 0, p = 1; + if (typeof logN === "object") { + if (arguments.length > 4) { + throw new Error("scrypt: incorrect number of arguments"); + } + var opts = logN; + callback = r; + logN = opts.logN; + if (typeof logN === "undefined") { + if (typeof opts.N !== "undefined") { + if (opts.N < 2 || opts.N > MAX_UINT) + throw new Error("scrypt: N is out of range"); + if ((opts.N & opts.N - 1) !== 0) + throw new Error("scrypt: N is not a power of 2"); + logN = Math.log(opts.N) / Math.LN2; + } else { + throw new Error("scrypt: missing N parameter"); + } + } + p = opts.p || 1; + r = opts.r; + dkLen = opts.dkLen || 32; + interruptStep = opts.interruptStep || 0; + encoding = opts.encoding; + } + if (p < 1) + throw new Error("scrypt: invalid p"); + if (r <= 0) + throw new Error("scrypt: invalid r"); + if (logN < 1 || logN > 31) + throw new Error("scrypt: logN must be between 1 and 31"); + var N = 1 << logN >>> 0, XY, V, B, tmp; + if (r * p >= 1 << 30 || r > MAX_UINT / 128 / p || r > MAX_UINT / 256 || N > MAX_UINT / 128 / r) + throw new Error("scrypt: parameters are too large"); + if (typeof password === "string") + password = stringToUTF8Bytes(password); + if (typeof salt === "string") + salt = stringToUTF8Bytes(salt); + if (typeof Int32Array !== "undefined") { + XY = new Int32Array(64 * r); + V = new Int32Array(32 * N * r); + tmp = new Int32Array(16); + } else { + XY = []; + V = []; + tmp = new Array(16); + } + B = PBKDF2_HMAC_SHA256_OneIter(password, salt, p * 128 * r); + var xi = 0, yi = 32 * r; + function smixStart(pos) { + for (var i = 0; i < 32 * r; i++) { + var j = pos + i * 4; + XY[xi + i] = (B[j + 3] & 255) << 24 | (B[j + 2] & 255) << 16 | (B[j + 1] & 255) << 8 | (B[j + 0] & 255) << 0; + } + } + function smixStep1(start, end) { + for (var i = start; i < end; i += 2) { + blockCopy(V, i * (32 * r), XY, xi, 32 * r); + blockMix(tmp, XY, xi, yi, r); + blockCopy(V, (i + 1) * (32 * r), XY, yi, 32 * r); + blockMix(tmp, XY, yi, xi, r); + } + } + function smixStep2(start, end) { + for (var i = start; i < end; i += 2) { + var j = integerify(XY, xi, r) & N - 1; + blockXOR(XY, xi, V, j * (32 * r), 32 * r); + blockMix(tmp, XY, xi, yi, r); + j = integerify(XY, yi, r) & N - 1; + blockXOR(XY, yi, V, j * (32 * r), 32 * r); + blockMix(tmp, XY, yi, xi, r); + } + } + function smixFinish(pos) { + for (var i = 0; i < 32 * r; i++) { + var j = XY[xi + i]; + B[pos + i * 4 + 0] = j >>> 0 & 255; + B[pos + i * 4 + 1] = j >>> 8 & 255; + B[pos + i * 4 + 2] = j >>> 16 & 255; + B[pos + i * 4 + 3] = j >>> 24 & 255; + } + } + var nextTick = typeof setImmediate !== "undefined" ? setImmediate : setTimeout; + function interruptedFor(start, end, step, fn, donefn) { + (function performStep() { + nextTick(function() { + fn(start, start + step < end ? start + step : end); + start += step; + if (start < end) + performStep(); + else + donefn(); + }); + })(); + } + function getResult(enc) { + var result = PBKDF2_HMAC_SHA256_OneIter(password, B, dkLen); + if (enc === "base64") + return bytesToBase64(result); + else if (enc === "hex") + return bytesToHex(result); + else if (enc === "binary") + return new Uint8Array(result); + else + return result; + } + function calculateSync() { + for (var i = 0; i < p; i++) { + smixStart(i * 128 * r); + smixStep1(0, N); + smixStep2(0, N); + smixFinish(i * 128 * r); + } + callback(getResult(encoding)); + } + function calculateAsync(i) { + smixStart(i * 128 * r); + interruptedFor(0, N, interruptStep * 2, smixStep1, function() { + interruptedFor(0, N, interruptStep * 2, smixStep2, function() { + smixFinish(i * 128 * r); + if (i + 1 < p) { + nextTick(function() { + calculateAsync(i + 1); + }); + } else { + callback(getResult(encoding)); + } + }); + }); + } + if (typeof interruptStep === "function") { + encoding = callback; + callback = interruptStep; + interruptStep = 1e3; + } + if (interruptStep <= 0) { + calculateSync(); + } else { + calculateAsync(0); + } + } + if (typeof module !== "undefined") + module.exports = scrypt2; + } + }); + + // frontend/model/contracts/identity.js + var import_common3 = __require("@common/common.js"); + var import_sbp5 = __toESM(__require("@sbp/sbp")); + + // frontend/model/contracts/misc/flowTyper.js + var EMPTY_VALUE = Symbol("@@empty"); + var isEmpty = (v) => v === EMPTY_VALUE; + var isNil = (v) => v === null; + var isUndef = (v) => typeof v === "undefined"; + var isBoolean = (v) => typeof v === "boolean"; + var isNumber = (v) => typeof v === "number"; + var isString = (v) => typeof v === "string"; + var isObject = (v) => !isNil(v) && typeof v === "object"; + var isFunction = (v) => typeof v === "function"; + var getType = (typeFn, _options) => { + if (isFunction(typeFn.type)) + return typeFn.type(_options); + return typeFn.name || "?"; + }; + var TypeValidatorError = class extends Error { + expectedType; + valueType; + value; + typeScope; + sourceFile; + constructor(message, expectedType, valueType, value, typeName = "", typeScope = "") { + const errMessage = message || `invalid "${valueType}" value type; ${typeName || expectedType} type expected`; + super(errMessage); + this.expectedType = expectedType; + this.valueType = valueType; + this.value = value; + this.typeScope = typeScope || ""; + this.sourceFile = this.getSourceFile(); + this.message = `${errMessage} +${this.getErrorInfo()}`; + this.name = this.constructor.name; + if (Error.captureStackTrace) { + Error.captureStackTrace(this, TypeValidatorError); + } + } + getSourceFile() { + const fileNames = this.stack.match(/(\/[\w_\-.]+)+(\.\w+:\d+:\d+)/g) || []; + return fileNames.find((fileName) => fileName.indexOf("/flowTyper-js/dist/") === -1) || ""; + } + getErrorInfo() { + return ` + file ${this.sourceFile} + scope ${this.typeScope} + expected ${this.expectedType.replace(/\n/g, "")} + type ${this.valueType} + value ${this.value} +`; + } + }; + var validatorError = (typeFn, value, scope, message, expectedType, valueType) => { + return new TypeValidatorError(message, expectedType || getType(typeFn), valueType || typeof value, JSON.stringify(value), typeFn.name, scope); + }; + var arrayOf = (typeFn, _scope = "Array") => { + function array(value) { + if (isEmpty(value)) + return [typeFn(value)]; + if (Array.isArray(value)) { + let index = 0; + return value.map((v) => typeFn(v, `${_scope}[${index++}]`)); + } + throw validatorError(array, value, _scope); + } + array.type = () => `Array<${getType(typeFn)}>`; + return array; + }; + var object = function(value) { + if (isEmpty(value)) + return {}; + if (isObject(value) && !Array.isArray(value)) { + return Object.assign({}, value); + } + throw validatorError(object, value); + }; + var objectOf = (typeObj, _scope = "Object") => { + function object2(value) { + const o = object(value); + const typeAttrs = Object.keys(typeObj); + const unknownAttr = Object.keys(o).find((attr) => !typeAttrs.includes(attr)); + if (unknownAttr) { + throw validatorError(object2, value, _scope, `missing object property '${unknownAttr}' in ${_scope} type`); + } + const undefAttr = typeAttrs.find((property) => { + const propertyTypeFn = typeObj[property]; + return propertyTypeFn.name.includes("maybe") && !o.hasOwnProperty(property); + }); + if (undefAttr) { + throw validatorError(object2, o[undefAttr], `${_scope}.${undefAttr}`, `empty object property '${undefAttr}' for ${_scope} type`, `void | null | ${getType(typeObj[undefAttr]).substr(1)}`, "-"); + } + const reducer = isEmpty(value) ? (acc, key) => Object.assign(acc, { [key]: typeObj[key](value) }) : (acc, key) => { + const typeFn = typeObj[key]; + if (typeFn.name.includes("optional") && !o.hasOwnProperty(key)) { + return Object.assign(acc, {}); + } else { + return Object.assign(acc, { [key]: typeFn(o[key], `${_scope}.${key}`) }); + } + }; + return typeAttrs.reduce(reducer, {}); + } + object2.type = () => { + const props = Object.keys(typeObj).map((key) => { + const ret = typeObj[key].name.includes("optional") ? `${key}?: ${getType(typeObj[key], { noVoid: true })}` : `${key}: ${getType(typeObj[key])}`; + return ret; + }); + return `{| + ${props.join(",\n ")} +|}`; + }; + return object2; + }; + function objectMaybeOf(validations, _scope = "Object") { + return function(data) { + object(data); + for (const key in data) { + validations[key]?.(data[key], `${_scope}.${key}`); + } + return data; + }; + } + var optional = (typeFn) => { + const unionFn = unionOf(typeFn, undef); + function optional2(v) { + return unionFn(v); + } + optional2.type = ({ noVoid }) => !noVoid ? getType(unionFn) : getType(typeFn); + return optional2; + }; + function undef(value, _scope = "") { + if (isEmpty(value) || isUndef(value)) + return void 0; + throw validatorError(undef, value, _scope); + } + undef.type = () => "void"; + var boolean = function boolean2(value, _scope = "") { + if (isEmpty(value)) + return false; + if (isBoolean(value)) + return value; + throw validatorError(boolean2, value, _scope); + }; + var string = function string2(value, _scope = "") { + if (isEmpty(value)) + return ""; + if (isString(value)) + return value; + throw validatorError(string2, value, _scope); + }; + var stringMax = (numChar, key = "") => { + if (!isNumber(numChar)) { + throw new Error("param for stringMax must be number"); + } + function stringMax2(value, _scope = "") { + string(value, _scope); + if (value.length <= numChar) + return value; + throw validatorError(stringMax2, value, _scope, key ? `string type '${key}' cannot exceed ${numChar} characters` : `cannot exceed ${numChar} characters`); + } + stringMax2.type = () => `string(max: ${numChar})`; + return stringMax2; + }; + function unionOf_(...typeFuncs) { + function union(value, _scope = "") { + for (const typeFn of typeFuncs) { + try { + return typeFn(value, _scope); + } catch (_) { + } + } + throw validatorError(union, value, _scope); + } + union.type = () => `(${typeFuncs.map((fn) => getType(fn)).join(" | ")})`; + return union; + } + var unionOf = unionOf_; + var validatorFrom = (fn) => { + function customType(value, _scope = "") { + if (!fn(value)) { + throw validatorError(customType, value, _scope); + } + return value; + } + return customType; + }; + + // frontend/utils/events.js + var LEFT_GROUP = "left-group"; + + // shared/serdes/index.js + var raw = Symbol("raw"); + var serdesTagSymbol = Symbol("tag"); + var serdesSerializeSymbol = Symbol("serialize"); + var serdesDeserializeSymbol = Symbol("deserialize"); + var rawResult = (obj) => { + Object.defineProperty(obj, raw, { value: true }); + return obj; + }; + var serializer = (data) => { + const verbatim = []; + const transferables = /* @__PURE__ */ new Set(); + const revokables = /* @__PURE__ */ new Set(); + const result = JSON.parse(JSON.stringify(data, (_key, value) => { + if (value && value[raw]) + return value; + if (value === void 0) + return rawResult(["_", "_"]); + if (!value) + return value; + if (Array.isArray(value) && value[0] === "_") + return rawResult(["_", "_", ...value]); + if (value instanceof Map) { + return rawResult(["_", "Map", Array.from(value.entries())]); + } + if (value instanceof Set) { + return rawResult(["_", "Set", Array.from(value.entries())]); + } + if (value instanceof Error || value instanceof Blob || value instanceof File) { + const pos = verbatim.length; + verbatim[verbatim.length] = value; + return rawResult(["_", "_ref", pos]); + } + if (value instanceof MessagePort || value instanceof ReadableStream || value instanceof WritableStream || value instanceof ArrayBuffer) { + const pos = verbatim.length; + verbatim[verbatim.length] = value; + transferables.add(value); + return rawResult(["_", "_ref", pos]); + } + if (ArrayBuffer.isView(value)) { + const pos = verbatim.length; + verbatim[verbatim.length] = value; + transferables.add(value.buffer); + return rawResult(["_", "_ref", pos]); + } + if (typeof value === "function") { + const mc = new MessageChannel(); + mc.port1.onmessage = async (ev) => { + try { + try { + const result2 = await value(...deserializer(ev.data[1])); + const { data: data2, transferables: transferables2 } = serializer(result2); + ev.data[0].postMessage([true, data2], transferables2); + } catch (e) { + const { data: data2, transferables: transferables2 } = serializer(e); + ev.data[0].postMessage([false, data2], transferables2); + } + } catch (e) { + console.error("Async error on onmessage handler", e); + } + }; + transferables.add(mc.port2); + revokables.add(mc.port1); + return rawResult(["_", "_fn", mc.port2]); + } + const proto3 = Object.getPrototypeOf(value); + if (proto3?.constructor?.[serdesTagSymbol] && proto3.constructor[serdesSerializeSymbol]) { + return rawResult(["_", "_custom", proto3.constructor[serdesTagSymbol], proto3.constructor[serdesSerializeSymbol](value)]); + } + return value; + }), (_key, value) => { + if (Array.isArray(value) && value[0] === "_" && value[1] === "_ref") { + return verbatim[value[2]]; + } + return value; + }); + return { + data: result, + transferables: Array.from(transferables), + revokables: Array.from(revokables) + }; + }; + var deserializerTable = /* @__PURE__ */ Object.create(null); + var deserializer = (data) => { + const verbatim = []; + return JSON.parse(JSON.stringify(data, (_key, value) => { + if (value && typeof value === "object" && !Array.isArray(value) && Object.getPrototypeOf(value) !== Object.prototype) { + const pos = verbatim.length; + verbatim[verbatim.length] = value; + return rawResult(["_", "_ref", pos]); + } + return value; + }), (_key, value) => { + if (Array.isArray(value) && value[0] === "_") { + switch (value[1]) { + case "_": + if (value.length >= 3) { + return value.slice(2); + } else { + return void 0; + } + case "Map": + return new Map(value[2]); + case "Set": + return new Set(value[2]); + case "_custom": + if (deserializerTable[value[2]]) { + return deserializerTable[value[2]](value[3]); + } else { + throw new Error("Invalid or unknown tag: " + value[2]); + } + case "_ref": + return verbatim[value[2]]; + case "_fn": { + const mp = value[2]; + return (...args) => { + return new Promise((resolve, reject) => { + const mc = new MessageChannel(); + const { data: data2, transferables } = serializer(args); + mc.port1.onmessage = (ev) => { + if (ev.data[0]) { + resolve(deserializer(ev.data[1])); + } else { + reject(deserializer(ev.data[1])); + } + }; + mp.postMessage([mc.port2, data2], [mc.port2, ...transferables]); + }); + }; + } + } + } + return value; + }); + }; + deserializer.register = (y) => { + if (typeof y === "function" && typeof y[serdesTagSymbol] === "string" && typeof y[serdesDeserializeSymbol] === "function") { + deserializerTable[y[serdesTagSymbol]] = y[serdesDeserializeSymbol].bind(y); + } + }; + + // shared/domains/chelonia/Secret.js + var wm = /* @__PURE__ */ new WeakMap(); + var Secret = class { + static [serdesDeserializeSymbol](secret) { + return new this(secret); + } + static [serdesSerializeSymbol](secret) { + return wm.get(secret); + } + static get [serdesTagSymbol]() { + return "__chelonia_Secret"; + } + constructor(value) { + wm.set(this, value); + } + valueOf() { + return wm.get(this); + } + }; + + // shared/domains/chelonia/utils.js + var import_sbp3 = __toESM(__require("@sbp/sbp")); + + // frontend/model/contracts/shared/giLodash.js + function cloneDeep(obj) { + return JSON.parse(JSON.stringify(obj)); + } + function isMergeableObject(val) { + const nonNullObject = val && typeof val === "object"; + return nonNullObject && Object.prototype.toString.call(val) !== "[object RegExp]" && Object.prototype.toString.call(val) !== "[object Date]"; + } + function merge(obj, src2) { + for (const key in src2) { + const clone = isMergeableObject(src2[key]) ? cloneDeep(src2[key]) : void 0; + if (clone && isMergeableObject(obj[key])) { + merge(obj[key], clone); + continue; + } + obj[key] = clone || src2[key]; + } + return obj; + } + var has = Function.prototype.call.bind(Object.prototype.hasOwnProperty); + + // shared/blake2bstream.js + var import_blakejs = __toESM(require_blakejs()); + + // shared/multiformats/bytes.js + var empty = new Uint8Array(0); + function equals(aa, bb) { + if (aa === bb) { + return true; + } + if (aa.byteLength !== bb.byteLength) { + return false; + } + for (let ii = 0; ii < aa.byteLength; ii++) { + if (aa[ii] !== bb[ii]) { + return false; + } + } + return true; + } + function coerce(o) { + if (o instanceof Uint8Array && o.constructor.name === "Uint8Array") { + return o; + } + if (o instanceof ArrayBuffer) { + return new Uint8Array(o); + } + if (ArrayBuffer.isView(o)) { + return new Uint8Array(o.buffer, o.byteOffset, o.byteLength); + } + throw new Error("Unknown type, must be binary type"); + } + + // shared/multiformats/vendor/varint.js + var encode_1 = encode; + var MSB = 128; + var REST = 127; + var MSBALL = ~REST; + var INT = Math.pow(2, 31); + function encode(num, out, offset) { + out = out || []; + offset = offset || 0; + var oldOffset = offset; + while (num >= INT) { + out[offset++] = num & 255 | MSB; + num /= 128; + } + while (num & MSBALL) { + out[offset++] = num & 255 | MSB; + num >>>= 7; + } + out[offset] = num | 0; + encode.bytes = offset - oldOffset + 1; + return out; + } + var decode = read; + var MSB$1 = 128; + var REST$1 = 127; + function read(buf, offset) { + var res = 0, offset = offset || 0, shift = 0, counter = offset, b, l = buf.length; + do { + if (counter >= l) { + read.bytes = 0; + throw new RangeError("Could not decode varint"); + } + b = buf[counter++]; + res += shift < 28 ? (b & REST$1) << shift : (b & REST$1) * Math.pow(2, shift); + shift += 7; + } while (b >= MSB$1); + read.bytes = counter - offset; + return res; + } + var N1 = Math.pow(2, 7); + var N2 = Math.pow(2, 14); + var N3 = Math.pow(2, 21); + var N4 = Math.pow(2, 28); + var N5 = Math.pow(2, 35); + var N6 = Math.pow(2, 42); + var N7 = Math.pow(2, 49); + var N8 = Math.pow(2, 56); + var N9 = Math.pow(2, 63); + var length = function(value) { + return value < N1 ? 1 : value < N2 ? 2 : value < N3 ? 3 : value < N4 ? 4 : value < N5 ? 5 : value < N6 ? 6 : value < N7 ? 7 : value < N8 ? 8 : value < N9 ? 9 : 10; + }; + var varint = { + encode: encode_1, + decode, + encodingLength: length + }; + var _brrp_varint = varint; + var varint_default = _brrp_varint; + + // shared/multiformats/varint.js + function decode2(data, offset = 0) { + const code = varint_default.decode(data, offset); + return [code, varint_default.decode.bytes]; + } + function encodeTo(int, target, offset = 0) { + varint_default.encode(int, target, offset); + return target; + } + function encodingLength(int) { + return varint_default.encodingLength(int); + } + + // shared/multiformats/hashes/digest.js + function create(code, digest) { + const size = digest.byteLength; + const sizeOffset = encodingLength(code); + const digestOffset = sizeOffset + encodingLength(size); + const bytes = new Uint8Array(digestOffset + size); + encodeTo(code, bytes, 0); + encodeTo(size, bytes, sizeOffset); + bytes.set(digest, digestOffset); + return new Digest(code, size, digest, bytes); + } + function decode3(multihash) { + const bytes = coerce(multihash); + const [code, sizeOffset] = decode2(bytes); + const [size, digestOffset] = decode2(bytes.subarray(sizeOffset)); + const digest = bytes.subarray(sizeOffset + digestOffset); + if (digest.byteLength !== size) { + throw new Error("Incorrect length"); + } + return new Digest(code, size, digest, bytes); + } + function equals2(a, b) { + if (a === b) { + return true; + } else { + const data = b; + return a.code === data.code && a.size === data.size && data.bytes instanceof Uint8Array && equals(a.bytes, data.bytes); + } + } + var Digest = class { + code; + size; + digest; + bytes; + constructor(code, size, digest, bytes) { + this.code = code; + this.size = size; + this.digest = digest; + this.bytes = bytes; + } + }; + + // shared/multiformats/hasher.js + function from({ name, code, encode: encode3 }) { + return new Hasher(name, code, encode3); + } + var Hasher = class { + name; + code; + encode; + constructor(name, code, encode3) { + this.name = name; + this.code = code; + this.encode = encode3; + } + digest(input) { + if (input instanceof Uint8Array || input instanceof ReadableStream) { + const result = this.encode(input); + return result instanceof Uint8Array ? create(this.code, result) : result.then((digest) => create(this.code, digest)); + } else { + throw Error("Unknown type, must be binary type"); + } + } + }; + + // shared/blake2bstream.js + var { blake2b, blake2bInit, blake2bUpdate, blake2bFinal } = import_blakejs.default; + var blake2b256stream = from({ + name: "blake2b-256", + code: 45600, + encode: async (input) => { + if (input instanceof ReadableStream) { + const ctx = blake2bInit(32); + const reader = input.getReader(); + for (; ; ) { + const result = await reader.read(); + if (result.done) + break; + blake2bUpdate(ctx, coerce(result.value)); + } + return blake2bFinal(ctx); + } else { + return coerce(blake2b(input, void 0, 32)); + } + } + }); + + // shared/multiformats/base-x.js + function base(ALPHABET, name) { + if (ALPHABET.length >= 255) { + throw new TypeError("Alphabet too long"); + } + var BASE_MAP = new Uint8Array(256); + for (var j = 0; j < BASE_MAP.length; j++) { + BASE_MAP[j] = 255; + } + for (var i = 0; i < ALPHABET.length; i++) { + var x = ALPHABET.charAt(i); + var xc = x.charCodeAt(0); + if (BASE_MAP[xc] !== 255) { + throw new TypeError(x + " is ambiguous"); + } + BASE_MAP[xc] = i; + } + var BASE = ALPHABET.length; + var LEADER = ALPHABET.charAt(0); + var FACTOR = Math.log(BASE) / Math.log(256); + var iFACTOR = Math.log(256) / Math.log(BASE); + function encode3(source) { + if (source instanceof Uint8Array) + ; + else if (ArrayBuffer.isView(source)) { + source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength); + } else if (Array.isArray(source)) { + source = Uint8Array.from(source); + } + if (!(source instanceof Uint8Array)) { + throw new TypeError("Expected Uint8Array"); + } + if (source.length === 0) { + return ""; + } + var zeroes = 0; + var length2 = 0; + var pbegin = 0; + var pend = source.length; + while (pbegin !== pend && source[pbegin] === 0) { + pbegin++; + zeroes++; + } + var size = (pend - pbegin) * iFACTOR + 1 >>> 0; + var b58 = new Uint8Array(size); + while (pbegin !== pend) { + var carry = source[pbegin]; + var i2 = 0; + for (var it1 = size - 1; (carry !== 0 || i2 < length2) && it1 !== -1; it1--, i2++) { + carry += 256 * b58[it1] >>> 0; + b58[it1] = carry % BASE >>> 0; + carry = carry / BASE >>> 0; + } + if (carry !== 0) { + throw new Error("Non-zero carry"); + } + length2 = i2; + pbegin++; + } + var it2 = size - length2; + while (it2 !== size && b58[it2] === 0) { + it2++; + } + var str = LEADER.repeat(zeroes); + for (; it2 < size; ++it2) { + str += ALPHABET.charAt(b58[it2]); + } + return str; + } + function decodeUnsafe(source) { + if (typeof source !== "string") { + throw new TypeError("Expected String"); + } + if (source.length === 0) { + return new Uint8Array(); + } + var psz = 0; + if (source[psz] === " ") { + return; + } + var zeroes = 0; + var length2 = 0; + while (source[psz] === LEADER) { + zeroes++; + psz++; + } + var size = (source.length - psz) * FACTOR + 1 >>> 0; + var b256 = new Uint8Array(size); + while (source[psz]) { + var carry = BASE_MAP[source.charCodeAt(psz)]; + if (carry === 255) { + return; + } + var i2 = 0; + for (var it3 = size - 1; (carry !== 0 || i2 < length2) && it3 !== -1; it3--, i2++) { + carry += BASE * b256[it3] >>> 0; + b256[it3] = carry % 256 >>> 0; + carry = carry / 256 >>> 0; + } + if (carry !== 0) { + throw new Error("Non-zero carry"); + } + length2 = i2; + psz++; + } + if (source[psz] === " ") { + return; + } + var it4 = size - length2; + while (it4 !== size && b256[it4] === 0) { + it4++; + } + var vch = new Uint8Array(zeroes + (size - it4)); + var j2 = zeroes; + while (it4 !== size) { + vch[j2++] = b256[it4++]; + } + return vch; + } + function decode5(string3) { + var buffer = decodeUnsafe(string3); + if (buffer) { + return buffer; + } + throw new Error(`Non-${name} character`); + } + return { + encode: encode3, + decodeUnsafe, + decode: decode5 + }; + } + var src = base; + var _brrp__multiformats_scope_baseX = src; + var base_x_default = _brrp__multiformats_scope_baseX; + + // shared/multiformats/bases/base.js + var Encoder = class { + name; + prefix; + baseEncode; + constructor(name, prefix, baseEncode) { + this.name = name; + this.prefix = prefix; + this.baseEncode = baseEncode; + } + encode(bytes) { + if (bytes instanceof Uint8Array) { + return `${this.prefix}${this.baseEncode(bytes)}`; + } else { + throw Error("Unknown type, must be binary type"); + } + } + }; + var Decoder = class { + name; + prefix; + baseDecode; + prefixCodePoint; + constructor(name, prefix, baseDecode) { + this.name = name; + this.prefix = prefix; + if (prefix.codePointAt(0) === void 0) { + throw new Error("Invalid prefix character"); + } + this.prefixCodePoint = prefix.codePointAt(0); + this.baseDecode = baseDecode; + } + decode(text) { + if (typeof text === "string") { + if (text.codePointAt(0) !== this.prefixCodePoint) { + throw Error(`Unable to decode multibase string ${JSON.stringify(text)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`); + } + return this.baseDecode(text.slice(this.prefix.length)); + } else { + throw Error("Can only multibase decode strings"); + } + } + or(decoder) { + return or(this, decoder); + } + }; + var ComposedDecoder = class { + decoders; + constructor(decoders) { + this.decoders = decoders; + } + or(decoder) { + return or(this, decoder); + } + decode(input) { + const prefix = input[0]; + const decoder = this.decoders[prefix]; + if (decoder != null) { + return decoder.decode(input); + } else { + throw RangeError(`Unable to decode multibase string ${JSON.stringify(input)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`); + } + } + }; + function or(left, right) { + return new ComposedDecoder({ + ...left.decoders ?? { [left.prefix]: left }, + ...right.decoders ?? { [right.prefix]: right } + }); + } + var Codec = class { + name; + prefix; + baseEncode; + baseDecode; + encoder; + decoder; + constructor(name, prefix, baseEncode, baseDecode) { + this.name = name; + this.prefix = prefix; + this.baseEncode = baseEncode; + this.baseDecode = baseDecode; + this.encoder = new Encoder(name, prefix, baseEncode); + this.decoder = new Decoder(name, prefix, baseDecode); + } + encode(input) { + return this.encoder.encode(input); + } + decode(input) { + return this.decoder.decode(input); + } + }; + function from2({ name, prefix, encode: encode3, decode: decode5 }) { + return new Codec(name, prefix, encode3, decode5); + } + function baseX({ name, prefix, alphabet }) { + const { encode: encode3, decode: decode5 } = base_x_default(alphabet, name); + return from2({ + prefix, + name, + encode: encode3, + decode: (text) => coerce(decode5(text)) + }); + } + function decode4(string3, alphabet, bitsPerChar, name) { + const codes = {}; + for (let i = 0; i < alphabet.length; ++i) { + codes[alphabet[i]] = i; + } + let end = string3.length; + while (string3[end - 1] === "=") { + --end; + } + const out = new Uint8Array(end * bitsPerChar / 8 | 0); + let bits = 0; + let buffer = 0; + let written = 0; + for (let i = 0; i < end; ++i) { + const value = codes[string3[i]]; + if (value === void 0) { + throw new SyntaxError(`Non-${name} character`); + } + buffer = buffer << bitsPerChar | value; + bits += bitsPerChar; + if (bits >= 8) { + bits -= 8; + out[written++] = 255 & buffer >> bits; + } + } + if (bits >= bitsPerChar || (255 & buffer << 8 - bits) !== 0) { + throw new SyntaxError("Unexpected end of data"); + } + return out; + } + function encode2(data, alphabet, bitsPerChar) { + const pad = alphabet[alphabet.length - 1] === "="; + const mask = (1 << bitsPerChar) - 1; + let out = ""; + let bits = 0; + let buffer = 0; + for (let i = 0; i < data.length; ++i) { + buffer = buffer << 8 | data[i]; + bits += 8; + while (bits > bitsPerChar) { + bits -= bitsPerChar; + out += alphabet[mask & buffer >> bits]; + } + } + if (bits !== 0) { + out += alphabet[mask & buffer << bitsPerChar - bits]; + } + if (pad) { + while ((out.length * bitsPerChar & 7) !== 0) { + out += "="; + } + } + return out; + } + function rfc4648({ name, prefix, bitsPerChar, alphabet }) { + return from2({ + prefix, + name, + encode(input) { + return encode2(input, alphabet, bitsPerChar); + }, + decode(input) { + return decode4(input, alphabet, bitsPerChar, name); + } + }); + } + + // shared/multiformats/bases/base58.js + var base58btc = baseX({ + name: "base58btc", + prefix: "z", + alphabet: "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz" + }); + var base58flickr = baseX({ + name: "base58flickr", + prefix: "Z", + alphabet: "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ" + }); + + // shared/multiformats/blake2b.js + var import_blakejs2 = __toESM(require_blakejs()); + var { blake2b: blake2b2 } = import_blakejs2.default; + var blake2b8 = from({ + name: "blake2b-8", + code: 45569, + encode: (input) => coerce(blake2b2(input, void 0, 1)) + }); + var blake2b16 = from({ + name: "blake2b-16", + code: 45570, + encode: (input) => coerce(blake2b2(input, void 0, 2)) + }); + var blake2b24 = from({ + name: "blake2b-24", + code: 45571, + encode: (input) => coerce(blake2b2(input, void 0, 3)) + }); + var blake2b32 = from({ + name: "blake2b-32", + code: 45572, + encode: (input) => coerce(blake2b2(input, void 0, 4)) + }); + var blake2b40 = from({ + name: "blake2b-40", + code: 45573, + encode: (input) => coerce(blake2b2(input, void 0, 5)) + }); + var blake2b48 = from({ + name: "blake2b-48", + code: 45574, + encode: (input) => coerce(blake2b2(input, void 0, 6)) + }); + var blake2b56 = from({ + name: "blake2b-56", + code: 45575, + encode: (input) => coerce(blake2b2(input, void 0, 7)) + }); + var blake2b64 = from({ + name: "blake2b-64", + code: 45576, + encode: (input) => coerce(blake2b2(input, void 0, 8)) + }); + var blake2b72 = from({ + name: "blake2b-72", + code: 45577, + encode: (input) => coerce(blake2b2(input, void 0, 9)) + }); + var blake2b80 = from({ + name: "blake2b-80", + code: 45578, + encode: (input) => coerce(blake2b2(input, void 0, 10)) + }); + var blake2b88 = from({ + name: "blake2b-88", + code: 45579, + encode: (input) => coerce(blake2b2(input, void 0, 11)) + }); + var blake2b96 = from({ + name: "blake2b-96", + code: 45580, + encode: (input) => coerce(blake2b2(input, void 0, 12)) + }); + var blake2b104 = from({ + name: "blake2b-104", + code: 45581, + encode: (input) => coerce(blake2b2(input, void 0, 13)) + }); + var blake2b112 = from({ + name: "blake2b-112", + code: 45582, + encode: (input) => coerce(blake2b2(input, void 0, 14)) + }); + var blake2b120 = from({ + name: "blake2b-120", + code: 45583, + encode: (input) => coerce(blake2b2(input, void 0, 15)) + }); + var blake2b128 = from({ + name: "blake2b-128", + code: 45584, + encode: (input) => coerce(blake2b2(input, void 0, 16)) + }); + var blake2b136 = from({ + name: "blake2b-136", + code: 45585, + encode: (input) => coerce(blake2b2(input, void 0, 17)) + }); + var blake2b144 = from({ + name: "blake2b-144", + code: 45586, + encode: (input) => coerce(blake2b2(input, void 0, 18)) + }); + var blake2b152 = from({ + name: "blake2b-152", + code: 45587, + encode: (input) => coerce(blake2b2(input, void 0, 19)) + }); + var blake2b160 = from({ + name: "blake2b-160", + code: 45588, + encode: (input) => coerce(blake2b2(input, void 0, 20)) + }); + var blake2b168 = from({ + name: "blake2b-168", + code: 45589, + encode: (input) => coerce(blake2b2(input, void 0, 21)) + }); + var blake2b176 = from({ + name: "blake2b-176", + code: 45590, + encode: (input) => coerce(blake2b2(input, void 0, 22)) + }); + var blake2b184 = from({ + name: "blake2b-184", + code: 45591, + encode: (input) => coerce(blake2b2(input, void 0, 23)) + }); + var blake2b192 = from({ + name: "blake2b-192", + code: 45592, + encode: (input) => coerce(blake2b2(input, void 0, 24)) + }); + var blake2b200 = from({ + name: "blake2b-200", + code: 45593, + encode: (input) => coerce(blake2b2(input, void 0, 25)) + }); + var blake2b208 = from({ + name: "blake2b-208", + code: 45594, + encode: (input) => coerce(blake2b2(input, void 0, 26)) + }); + var blake2b216 = from({ + name: "blake2b-216", + code: 45595, + encode: (input) => coerce(blake2b2(input, void 0, 27)) + }); + var blake2b224 = from({ + name: "blake2b-224", + code: 45596, + encode: (input) => coerce(blake2b2(input, void 0, 28)) + }); + var blake2b232 = from({ + name: "blake2b-232", + code: 45597, + encode: (input) => coerce(blake2b2(input, void 0, 29)) + }); + var blake2b240 = from({ + name: "blake2b-240", + code: 45598, + encode: (input) => coerce(blake2b2(input, void 0, 30)) + }); + var blake2b248 = from({ + name: "blake2b-248", + code: 45599, + encode: (input) => coerce(blake2b2(input, void 0, 31)) + }); + var blake2b256 = from({ + name: "blake2b-256", + code: 45600, + encode: (input) => coerce(blake2b2(input, void 0, 32)) + }); + var blake2b264 = from({ + name: "blake2b-264", + code: 45601, + encode: (input) => coerce(blake2b2(input, void 0, 33)) + }); + var blake2b272 = from({ + name: "blake2b-272", + code: 45602, + encode: (input) => coerce(blake2b2(input, void 0, 34)) + }); + var blake2b280 = from({ + name: "blake2b-280", + code: 45603, + encode: (input) => coerce(blake2b2(input, void 0, 35)) + }); + var blake2b288 = from({ + name: "blake2b-288", + code: 45604, + encode: (input) => coerce(blake2b2(input, void 0, 36)) + }); + var blake2b296 = from({ + name: "blake2b-296", + code: 45605, + encode: (input) => coerce(blake2b2(input, void 0, 37)) + }); + var blake2b304 = from({ + name: "blake2b-304", + code: 45606, + encode: (input) => coerce(blake2b2(input, void 0, 38)) + }); + var blake2b312 = from({ + name: "blake2b-312", + code: 45607, + encode: (input) => coerce(blake2b2(input, void 0, 39)) + }); + var blake2b320 = from({ + name: "blake2b-320", + code: 45608, + encode: (input) => coerce(blake2b2(input, void 0, 40)) + }); + var blake2b328 = from({ + name: "blake2b-328", + code: 45609, + encode: (input) => coerce(blake2b2(input, void 0, 41)) + }); + var blake2b336 = from({ + name: "blake2b-336", + code: 45610, + encode: (input) => coerce(blake2b2(input, void 0, 42)) + }); + var blake2b344 = from({ + name: "blake2b-344", + code: 45611, + encode: (input) => coerce(blake2b2(input, void 0, 43)) + }); + var blake2b352 = from({ + name: "blake2b-352", + code: 45612, + encode: (input) => coerce(blake2b2(input, void 0, 44)) + }); + var blake2b360 = from({ + name: "blake2b-360", + code: 45613, + encode: (input) => coerce(blake2b2(input, void 0, 45)) + }); + var blake2b368 = from({ + name: "blake2b-368", + code: 45614, + encode: (input) => coerce(blake2b2(input, void 0, 46)) + }); + var blake2b376 = from({ + name: "blake2b-376", + code: 45615, + encode: (input) => coerce(blake2b2(input, void 0, 47)) + }); + var blake2b384 = from({ + name: "blake2b-384", + code: 45616, + encode: (input) => coerce(blake2b2(input, void 0, 48)) + }); + var blake2b392 = from({ + name: "blake2b-392", + code: 45617, + encode: (input) => coerce(blake2b2(input, void 0, 49)) + }); + var blake2b400 = from({ + name: "blake2b-400", + code: 45618, + encode: (input) => coerce(blake2b2(input, void 0, 50)) + }); + var blake2b408 = from({ + name: "blake2b-408", + code: 45619, + encode: (input) => coerce(blake2b2(input, void 0, 51)) + }); + var blake2b416 = from({ + name: "blake2b-416", + code: 45620, + encode: (input) => coerce(blake2b2(input, void 0, 52)) + }); + var blake2b424 = from({ + name: "blake2b-424", + code: 45621, + encode: (input) => coerce(blake2b2(input, void 0, 53)) + }); + var blake2b432 = from({ + name: "blake2b-432", + code: 45622, + encode: (input) => coerce(blake2b2(input, void 0, 54)) + }); + var blake2b440 = from({ + name: "blake2b-440", + code: 45623, + encode: (input) => coerce(blake2b2(input, void 0, 55)) + }); + var blake2b448 = from({ + name: "blake2b-448", + code: 45624, + encode: (input) => coerce(blake2b2(input, void 0, 56)) + }); + var blake2b456 = from({ + name: "blake2b-456", + code: 45625, + encode: (input) => coerce(blake2b2(input, void 0, 57)) + }); + var blake2b464 = from({ + name: "blake2b-464", + code: 45626, + encode: (input) => coerce(blake2b2(input, void 0, 58)) + }); + var blake2b472 = from({ + name: "blake2b-472", + code: 45627, + encode: (input) => coerce(blake2b2(input, void 0, 59)) + }); + var blake2b480 = from({ + name: "blake2b-480", + code: 45628, + encode: (input) => coerce(blake2b2(input, void 0, 60)) + }); + var blake2b488 = from({ + name: "blake2b-488", + code: 45629, + encode: (input) => coerce(blake2b2(input, void 0, 61)) + }); + var blake2b496 = from({ + name: "blake2b-496", + code: 45630, + encode: (input) => coerce(blake2b2(input, void 0, 62)) + }); + var blake2b504 = from({ + name: "blake2b-504", + code: 45631, + encode: (input) => coerce(blake2b2(input, void 0, 63)) + }); + var blake2b512 = from({ + name: "blake2b-512", + code: 45632, + encode: (input) => coerce(blake2b2(input, void 0, 64)) + }); + + // shared/multiformats/bases/base32.js + var base32 = rfc4648({ + prefix: "b", + name: "base32", + alphabet: "abcdefghijklmnopqrstuvwxyz234567", + bitsPerChar: 5 + }); + var base32upper = rfc4648({ + prefix: "B", + name: "base32upper", + alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567", + bitsPerChar: 5 + }); + var base32pad = rfc4648({ + prefix: "c", + name: "base32pad", + alphabet: "abcdefghijklmnopqrstuvwxyz234567=", + bitsPerChar: 5 + }); + var base32padupper = rfc4648({ + prefix: "C", + name: "base32padupper", + alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=", + bitsPerChar: 5 + }); + var base32hex = rfc4648({ + prefix: "v", + name: "base32hex", + alphabet: "0123456789abcdefghijklmnopqrstuv", + bitsPerChar: 5 + }); + var base32hexupper = rfc4648({ + prefix: "V", + name: "base32hexupper", + alphabet: "0123456789ABCDEFGHIJKLMNOPQRSTUV", + bitsPerChar: 5 + }); + var base32hexpad = rfc4648({ + prefix: "t", + name: "base32hexpad", + alphabet: "0123456789abcdefghijklmnopqrstuv=", + bitsPerChar: 5 + }); + var base32hexpadupper = rfc4648({ + prefix: "T", + name: "base32hexpadupper", + alphabet: "0123456789ABCDEFGHIJKLMNOPQRSTUV=", + bitsPerChar: 5 + }); + var base32z = rfc4648({ + prefix: "h", + name: "base32z", + alphabet: "ybndrfg8ejkmcpqxot1uwisza345h769", + bitsPerChar: 5 + }); + + // shared/multiformats/cid.js + function format(link, base2) { + const { bytes, version } = link; + switch (version) { + case 0: + return toStringV0(bytes, baseCache(link), base2 ?? base58btc.encoder); + default: + return toStringV1(bytes, baseCache(link), base2 ?? base32.encoder); + } + } + var cache = /* @__PURE__ */ new WeakMap(); + function baseCache(cid) { + const baseCache2 = cache.get(cid); + if (baseCache2 == null) { + const baseCache3 = /* @__PURE__ */ new Map(); + cache.set(cid, baseCache3); + return baseCache3; + } + return baseCache2; + } + var CID = class { + code; + version; + multihash; + bytes; + "/"; + constructor(version, code, multihash, bytes) { + this.code = code; + this.version = version; + this.multihash = multihash; + this.bytes = bytes; + this["/"] = bytes; + } + get asCID() { + return this; + } + get byteOffset() { + return this.bytes.byteOffset; + } + get byteLength() { + return this.bytes.byteLength; + } + toV0() { + switch (this.version) { + case 0: { + return this; + } + case 1: { + const { code, multihash } = this; + if (code !== DAG_PB_CODE) { + throw new Error("Cannot convert a non dag-pb CID to CIDv0"); + } + if (multihash.code !== SHA_256_CODE) { + throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0"); + } + return CID.createV0(multihash); + } + default: { + throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`); + } + } + } + toV1() { + switch (this.version) { + case 0: { + const { code, digest } = this.multihash; + const multihash = create(code, digest); + return CID.createV1(this.code, multihash); + } + case 1: { + return this; + } + default: { + throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`); + } + } + } + equals(other) { + return CID.equals(this, other); + } + static equals(self2, other) { + const unknown = other; + return unknown != null && self2.code === unknown.code && self2.version === unknown.version && equals2(self2.multihash, unknown.multihash); + } + toString(base2) { + return format(this, base2); + } + toJSON() { + return { "/": format(this) }; + } + link() { + return this; + } + [Symbol.toStringTag] = "CID"; + [Symbol.for("nodejs.util.inspect.custom")]() { + return `CID(${this.toString()})`; + } + static asCID(input) { + if (input == null) { + return null; + } + const value = input; + if (value instanceof CID) { + return value; + } else if (value["/"] != null && value["/"] === value.bytes || value.asCID === value) { + const { version, code, multihash, bytes } = value; + return new CID(version, code, multihash, bytes ?? encodeCID(version, code, multihash.bytes)); + } else if (value[cidSymbol] === true) { + const { version, multihash, code } = value; + const digest = decode3(multihash); + return CID.create(version, code, digest); + } else { + return null; + } + } + static create(version, code, digest) { + if (typeof code !== "number") { + throw new Error("String codecs are no longer supported"); + } + if (!(digest.bytes instanceof Uint8Array)) { + throw new Error("Invalid digest"); + } + switch (version) { + case 0: { + if (code !== DAG_PB_CODE) { + throw new Error(`Version 0 CID must use dag-pb (code: ${DAG_PB_CODE}) block encoding`); + } else { + return new CID(version, code, digest, digest.bytes); + } + } + case 1: { + const bytes = encodeCID(version, code, digest.bytes); + return new CID(version, code, digest, bytes); + } + default: { + throw new Error("Invalid version"); + } + } + } + static createV0(digest) { + return CID.create(0, DAG_PB_CODE, digest); + } + static createV1(code, digest) { + return CID.create(1, code, digest); + } + static decode(bytes) { + const [cid, remainder] = CID.decodeFirst(bytes); + if (remainder.length !== 0) { + throw new Error("Incorrect length"); + } + return cid; + } + static decodeFirst(bytes) { + const specs = CID.inspectBytes(bytes); + const prefixSize = specs.size - specs.multihashSize; + const multihashBytes = coerce(bytes.subarray(prefixSize, prefixSize + specs.multihashSize)); + if (multihashBytes.byteLength !== specs.multihashSize) { + throw new Error("Incorrect length"); + } + const digestBytes = multihashBytes.subarray(specs.multihashSize - specs.digestSize); + const digest = new Digest(specs.multihashCode, specs.digestSize, digestBytes, multihashBytes); + const cid = specs.version === 0 ? CID.createV0(digest) : CID.createV1(specs.codec, digest); + return [cid, bytes.subarray(specs.size)]; + } + static inspectBytes(initialBytes) { + let offset = 0; + const next = () => { + const [i, length2] = decode2(initialBytes.subarray(offset)); + offset += length2; + return i; + }; + let version = next(); + let codec = DAG_PB_CODE; + if (version === 18) { + version = 0; + offset = 0; + } else { + codec = next(); + } + if (version !== 0 && version !== 1) { + throw new RangeError(`Invalid CID version ${version}`); + } + const prefixSize = offset; + const multihashCode = next(); + const digestSize = next(); + const size = offset + digestSize; + const multihashSize = size - prefixSize; + return { version, codec, multihashCode, digestSize, multihashSize, size }; + } + static parse(source, base2) { + const [prefix, bytes] = parseCIDtoBytes(source, base2); + const cid = CID.decode(bytes); + if (cid.version === 0 && source[0] !== "Q") { + throw Error("Version 0 CID string must not include multibase prefix"); + } + baseCache(cid).set(prefix, source); + return cid; + } + }; + function parseCIDtoBytes(source, base2) { + switch (source[0]) { + case "Q": { + const decoder = base2 ?? base58btc; + return [ + base58btc.prefix, + decoder.decode(`${base58btc.prefix}${source}`) + ]; + } + case base58btc.prefix: { + const decoder = base2 ?? base58btc; + return [base58btc.prefix, decoder.decode(source)]; + } + case base32.prefix: { + const decoder = base2 ?? base32; + return [base32.prefix, decoder.decode(source)]; + } + default: { + if (base2 == null) { + throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided"); + } + return [source[0], base2.decode(source)]; + } + } + } + function toStringV0(bytes, cache2, base2) { + const { prefix } = base2; + if (prefix !== base58btc.prefix) { + throw Error(`Cannot string encode V0 in ${base2.name} encoding`); + } + const cid = cache2.get(prefix); + if (cid == null) { + const cid2 = base2.encode(bytes).slice(1); + cache2.set(prefix, cid2); + return cid2; + } else { + return cid; + } + } + function toStringV1(bytes, cache2, base2) { + const { prefix } = base2; + const cid = cache2.get(prefix); + if (cid == null) { + const cid2 = base2.encode(bytes); + cache2.set(prefix, cid2); + return cid2; + } else { + return cid; + } + } + var DAG_PB_CODE = 112; + var SHA_256_CODE = 18; + function encodeCID(version, code, multihash) { + const codeOffset = encodingLength(version); + const hashOffset = codeOffset + encodingLength(code); + const bytes = new Uint8Array(hashOffset + multihash.byteLength); + encodeTo(version, bytes, 0); + encodeTo(code, bytes, codeOffset); + bytes.set(multihash, hashOffset); + return bytes; + } + var cidSymbol = Symbol.for("@ipld/js-cid/CID"); + + // shared/functions.js + var multicodes = { JSON: 512, RAW: 0 }; + if (typeof globalThis === "object" && !has(globalThis, "Buffer")) { + const { Buffer: Buffer2 } = require_buffer(); + globalThis.Buffer = Buffer2; + } + function createCID(data, multicode = multicodes.RAW) { + const uint8array = typeof data === "string" ? new TextEncoder().encode(data) : data; + const digest = blake2b256.digest(uint8array); + return CID.create(1, multicode, digest).toString(base58btc.encoder); + } + function blake32Hash(data) { + const uint8array = typeof data === "string" ? new TextEncoder().encode(data) : data; + const digest = blake2b256.digest(uint8array); + return base58btc.encode(digest.bytes); + } + var b64ToBuf = (b64) => Buffer.from(b64, "base64"); + var strToBuf = (str) => Buffer.from(str, "utf8"); + var bytesToB64 = (ary) => Buffer.from(ary).toString("base64"); + + // shared/domains/chelonia/crypto.js + var import_tweetnacl = __toESM(require_nacl_fast()); + var import_scrypt_async = __toESM(require_scrypt_async()); + var EDWARDS25519SHA512BATCH = "edwards25519sha512batch"; + var CURVE25519XSALSA20POLY1305 = "curve25519xsalsa20poly1305"; + var XSALSA20POLY1305 = "xsalsa20poly1305"; + if (false) { + throw new Error("ENABLE_UNSAFE_NULL_CRYPTO cannot be enabled in production mode"); + } + var bytesOrObjectToB64 = (ary) => { + if (!(ary instanceof Uint8Array)) { + throw Error("Unsupported type"); + } + return bytesToB64(ary); + }; + var serializeKey = (key, saveSecretKey) => { + if (false) { + return JSON.stringify([ + key.type, + saveSecretKey ? null : key.publicKey, + saveSecretKey ? key.secretKey : null + ], void 0, 0); + } + if (key.type === EDWARDS25519SHA512BATCH || key.type === CURVE25519XSALSA20POLY1305) { + if (!saveSecretKey) { + if (!key.publicKey) { + throw new Error("Unsupported operation: no public key to export"); + } + return JSON.stringify([ + key.type, + bytesOrObjectToB64(key.publicKey), + null + ], void 0, 0); + } + if (!key.secretKey) { + throw new Error("Unsupported operation: no secret key to export"); + } + return JSON.stringify([ + key.type, + null, + bytesOrObjectToB64(key.secretKey) + ], void 0, 0); + } else if (key.type === XSALSA20POLY1305) { + if (!saveSecretKey) { + throw new Error("Unsupported operation: no public key to export"); + } + if (!key.secretKey) { + throw new Error("Unsupported operation: no secret key to export"); + } + return JSON.stringify([ + key.type, + null, + bytesOrObjectToB64(key.secretKey) + ], void 0, 0); + } + throw new Error("Unsupported key type"); + }; + var deserializeKey = (data) => { + const keyData = JSON.parse(data); + if (!keyData || keyData.length !== 3) { + throw new Error("Invalid key object"); + } + if (false) { + const res = { + type: keyData[0] + }; + if (keyData[2]) { + Object.defineProperty(res, "secretKey", { value: keyData[2] }); + res.publicKey = keyData[2]; + } else { + res.publicKey = keyData[1]; + } + return res; + } + if (keyData[0] === EDWARDS25519SHA512BATCH) { + if (keyData[2]) { + const key = import_tweetnacl.default.sign.keyPair.fromSecretKey(b64ToBuf(keyData[2])); + const res = { + type: keyData[0], + publicKey: key.publicKey + }; + Object.defineProperty(res, "secretKey", { value: key.secretKey }); + return res; + } else if (keyData[1]) { + return { + type: keyData[0], + publicKey: new Uint8Array(b64ToBuf(keyData[1])) + }; + } + throw new Error("Missing secret or public key"); + } else if (keyData[0] === CURVE25519XSALSA20POLY1305) { + if (keyData[2]) { + const key = import_tweetnacl.default.box.keyPair.fromSecretKey(b64ToBuf(keyData[2])); + const res = { + type: keyData[0], + publicKey: key.publicKey + }; + Object.defineProperty(res, "secretKey", { value: key.secretKey }); + return res; + } else if (keyData[1]) { + return { + type: keyData[0], + publicKey: new Uint8Array(b64ToBuf(keyData[1])) + }; + } + throw new Error("Missing secret or public key"); + } else if (keyData[0] === XSALSA20POLY1305) { + if (!keyData[2]) { + throw new Error("Secret key missing"); + } + const res = { + type: keyData[0] + }; + Object.defineProperty(res, "secretKey", { value: new Uint8Array(b64ToBuf(keyData[2])) }); + return res; + } + throw new Error("Unsupported key type"); + }; + var keyId = (inKey) => { + const key = Object(inKey) instanceof String ? deserializeKey(inKey) : inKey; + const serializedKey = serializeKey(key, !key.publicKey); + return blake32Hash(serializedKey); + }; + var verifySignature = (inKey, data, signature) => { + const key = Object(inKey) instanceof String ? deserializeKey(inKey) : inKey; + if (false) { + if (!key.publicKey) { + throw new Error("Public key missing"); + } + if (key.publicKey + ";" + blake32Hash(data) !== signature) { + throw new Error("Invalid signature"); + } + return; + } + if (key.type !== EDWARDS25519SHA512BATCH) { + throw new Error("Unsupported algorithm"); + } + if (!key.publicKey) { + throw new Error("Public key missing"); + } + const decodedSignature = b64ToBuf(signature); + const messageUint8 = strToBuf(data); + const result = import_tweetnacl.default.sign.detached.verify(messageUint8, decodedSignature, key.publicKey); + if (!result) { + throw new Error("Invalid signature"); + } + }; + var decrypt = (inKey, data, ad) => { + const key = Object(inKey) instanceof String ? deserializeKey(inKey) : inKey; + if (false) { + if (!key.secretKey) { + throw new Error("Secret key missing"); + } + if (!data.startsWith(key.secretKey + ";") || !data.endsWith(";" + (ad ?? ""))) { + throw new Error("Additional data mismatch"); + } + return data.slice(String(key.secretKey).length + 1, data.length - 1 - (ad ?? "").length); + } + if (key.type === XSALSA20POLY1305) { + if (!key.secretKey) { + throw new Error("Secret key missing"); + } + const messageWithNonceAsUint8Array = b64ToBuf(data); + const nonce = messageWithNonceAsUint8Array.slice(0, import_tweetnacl.default.secretbox.nonceLength); + const message = messageWithNonceAsUint8Array.slice(import_tweetnacl.default.secretbox.nonceLength, messageWithNonceAsUint8Array.length); + if (ad) { + const adHash = import_tweetnacl.default.hash(strToBuf(ad)); + const len = Math.min(adHash.length, nonce.length); + for (let i = 0; i < len; i++) { + nonce[i] ^= adHash[i]; + } + } + const decrypted = import_tweetnacl.default.secretbox.open(message, nonce, key.secretKey); + if (!decrypted) { + throw new Error("Could not decrypt message"); + } + return Buffer.from(decrypted).toString("utf-8"); + } else if (key.type === CURVE25519XSALSA20POLY1305) { + if (!key.secretKey) { + throw new Error("Secret key missing"); + } + const messageWithNonceAsUint8Array = b64ToBuf(data); + const ephemeralPublicKey = messageWithNonceAsUint8Array.slice(0, import_tweetnacl.default.box.publicKeyLength); + const nonce = messageWithNonceAsUint8Array.slice(import_tweetnacl.default.box.publicKeyLength, import_tweetnacl.default.box.publicKeyLength + import_tweetnacl.default.box.nonceLength); + const message = messageWithNonceAsUint8Array.slice(import_tweetnacl.default.box.publicKeyLength + import_tweetnacl.default.box.nonceLength); + if (ad) { + const adHash = import_tweetnacl.default.hash(strToBuf(ad)); + const len = Math.min(adHash.length, nonce.length); + for (let i = 0; i < len; i++) { + nonce[i] ^= adHash[i]; + } + } + const decrypted = import_tweetnacl.default.box.open(message, nonce, ephemeralPublicKey, key.secretKey); + if (!decrypted) { + throw new Error("Could not decrypt message"); + } + return Buffer.from(decrypted).toString("utf-8"); + } + throw new Error("Unsupported algorithm"); + }; + + // shared/domains/chelonia/encryptedData.js + var import_sbp2 = __toESM(__require("@sbp/sbp")); + + // shared/domains/chelonia/errors.js + var ChelErrorGenerator = (name, base2 = Error) => class extends base2 { + constructor(...params) { + super(...params); + this.name = name; + if (params[1]?.cause !== this.cause) { + Object.defineProperty(this, "cause", { value: params[1].cause }); + } + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + } + }; + var ChelErrorWarning = ChelErrorGenerator("ChelErrorWarning"); + var ChelErrorAlreadyProcessed = ChelErrorGenerator("ChelErrorAlreadyProcessed"); + var ChelErrorDBBadPreviousHEAD = ChelErrorGenerator("ChelErrorDBBadPreviousHEAD"); + var ChelErrorDBConnection = ChelErrorGenerator("ChelErrorDBConnection"); + var ChelErrorUnexpected = ChelErrorGenerator("ChelErrorUnexpected"); + var ChelErrorUnrecoverable = ChelErrorGenerator("ChelErrorUnrecoverable"); + var ChelErrorDecryptionError = ChelErrorGenerator("ChelErrorDecryptionError"); + var ChelErrorDecryptionKeyNotFound = ChelErrorGenerator("ChelErrorDecryptionKeyNotFound", ChelErrorDecryptionError); + var ChelErrorSignatureError = ChelErrorGenerator("ChelErrorSignatureError"); + var ChelErrorSignatureKeyUnauthorized = ChelErrorGenerator("ChelErrorSignatureKeyUnauthorized", ChelErrorSignatureError); + var ChelErrorSignatureKeyNotFound = ChelErrorGenerator("ChelErrorSignatureKeyNotFound", ChelErrorSignatureError); + var ChelErrorFetchServerTimeFailed = ChelErrorGenerator("ChelErrorFetchServerTimeFailed"); + + // shared/domains/chelonia/signedData.js + var import_sbp = __toESM(__require("@sbp/sbp")); + var rootStateFn = () => (0, import_sbp.default)("chelonia/rootState"); + var proto = Object.create(null, { + _isSignedData: { + value: true + } + }); + var wrapper = (o) => { + return Object.setPrototypeOf(o, proto); + }; + var isSignedData = (o) => { + return !!o && !!Object.getPrototypeOf(o)?._isSignedData; + }; + var verifySignatureData = function(height, data, additionalData) { + if (!this) { + throw new ChelErrorSignatureError("Missing contract state"); + } + if (!isRawSignedData(data)) { + throw new ChelErrorSignatureError("Invalid message format"); + } + if (!Number.isSafeInteger(height) || height < 0) { + throw new ChelErrorSignatureError(`Height ${height} is invalid or out of range`); + } + const [serializedMessage, sKeyId, signature] = data._signedData; + const designatedKey = this._vm?.authorizedKeys?.[sKeyId]; + if (!designatedKey || height > designatedKey._notAfterHeight || height < designatedKey._notBeforeHeight || !designatedKey.purpose.includes("sig")) { + if ("") { + console.error(`Key ${sKeyId} is unauthorized or expired for the current contract`, { designatedKey, height, state: JSON.parse(JSON.stringify((0, import_sbp.default)("state/vuex/state"))) }); + Promise.reject(new ChelErrorSignatureKeyUnauthorized(`Key ${sKeyId} is unauthorized or expired for the current contract`)); + } + throw new ChelErrorSignatureKeyUnauthorized(`Key ${sKeyId} is unauthorized or expired for the current contract`); + } + const deserializedKey = designatedKey.data; + const payloadToSign = blake32Hash(`${blake32Hash(additionalData)}${blake32Hash(serializedMessage)}`); + try { + verifySignature(deserializedKey, payloadToSign, signature); + const message = JSON.parse(serializedMessage); + return [sKeyId, message]; + } catch (e) { + throw new ChelErrorSignatureError(e?.message || e); + } + }; + var signedIncomingData = (contractID, state, data, height, additionalData, mapperFn) => { + const stringValueFn = () => data; + let verifySignedValue; + const verifySignedValueFn = () => { + if (verifySignedValue) { + return verifySignedValue[1]; + } + verifySignedValue = verifySignatureData.call(state || rootStateFn()[contractID], height, data, additionalData); + if (mapperFn) + verifySignedValue[1] = mapperFn(verifySignedValue[1]); + return verifySignedValue[1]; + }; + return wrapper({ + get signingKeyId() { + if (verifySignedValue) + return verifySignedValue[0]; + return signedDataKeyId(data); + }, + get serialize() { + return stringValueFn; + }, + get context() { + return [contractID, data, height, additionalData]; + }, + get toString() { + return () => JSON.stringify(this.serialize()); + }, + get valueOf() { + return verifySignedValueFn; + }, + get toJSON() { + return this.serialize; + }, + get get() { + return (k) => k !== "_signedData" ? data[k] : void 0; + } + }); + }; + var signedDataKeyId = (data) => { + if (!isRawSignedData(data)) { + throw new ChelErrorSignatureError("Invalid message format"); + } + return data._signedData[1]; + }; + var isRawSignedData = (data) => { + if (!data || typeof data !== "object" || !has(data, "_signedData") || !Array.isArray(data._signedData) || data._signedData.length !== 3 || data._signedData.map((v) => typeof v).filter((v) => v !== "string").length !== 0) { + return false; + } + return true; + }; + var rawSignedIncomingData = (data) => { + if (!isRawSignedData(data)) { + throw new ChelErrorSignatureError("Invalid message format"); + } + const stringValueFn = () => data; + let verifySignedValue; + const verifySignedValueFn = () => { + if (verifySignedValue) { + return verifySignedValue[1]; + } + verifySignedValue = [data._signedData[1], JSON.parse(data._signedData[0])]; + return verifySignedValue[1]; + }; + return wrapper({ + get signingKeyId() { + if (verifySignedValue) + return verifySignedValue[0]; + return signedDataKeyId(data); + }, + get serialize() { + return stringValueFn; + }, + get toString() { + return () => JSON.stringify(this.serialize()); + }, + get valueOf() { + return verifySignedValueFn; + }, + get toJSON() { + return this.serialize; + }, + get get() { + return (k) => k !== "_signedData" ? data[k] : void 0; + } + }); + }; + + // shared/domains/chelonia/encryptedData.js + var rootStateFn2 = () => (0, import_sbp2.default)("chelonia/rootState"); + var proto2 = Object.create(null, { + _isEncryptedData: { + value: true + } + }); + var wrapper2 = (o) => { + return Object.setPrototypeOf(o, proto2); + }; + var isEncryptedData = (o) => { + return !!o && !!Object.getPrototypeOf(o)?._isEncryptedData; + }; + var decryptData = function(height, data, additionalKeys, additionalData, validatorFn) { + if (!this) { + throw new ChelErrorDecryptionError("Missing contract state"); + } + if (typeof data.valueOf === "function") + data = data.valueOf(); + if (!isRawEncryptedData(data)) { + throw new ChelErrorDecryptionError("Invalid message format"); + } + const [eKeyId, message] = data; + const key = additionalKeys[eKeyId]; + if (!key) { + throw new ChelErrorDecryptionKeyNotFound(`Key ${eKeyId} not found`); + } + const designatedKey = this._vm?.authorizedKeys?.[eKeyId]; + if (!designatedKey || height > designatedKey._notAfterHeight || height < designatedKey._notBeforeHeight || !designatedKey.purpose.includes("enc")) { + throw new ChelErrorUnexpected(`Key ${eKeyId} is unauthorized or expired for the current contract`); + } + const deserializedKey = typeof key === "string" ? deserializeKey(key) : key; + try { + const result = JSON.parse(decrypt(deserializedKey, message, additionalData)); + if (typeof validatorFn === "function") + validatorFn(result, eKeyId); + return result; + } catch (e) { + throw new ChelErrorDecryptionError(e?.message || e); + } + }; + var encryptedIncomingData = (contractID, state, data, height, additionalKeys, additionalData, validatorFn) => { + let decryptedValue; + const decryptedValueFn = () => { + if (decryptedValue) { + return decryptedValue; + } + if (!state || !additionalKeys) { + const rootState = rootStateFn2(); + state = state || rootState[contractID]; + additionalKeys = additionalKeys ?? rootState.secretKeys; + } + decryptedValue = decryptData.call(state, height, data, additionalKeys, additionalData || "", validatorFn); + if (isRawSignedData(decryptedValue)) { + decryptedValue = signedIncomingData(contractID, state, decryptedValue, height, additionalData || ""); + } + return decryptedValue; + }; + return wrapper2({ + get encryptionKeyId() { + return encryptedDataKeyId(data); + }, + get serialize() { + return () => data; + }, + get toString() { + return () => JSON.stringify(this.serialize()); + }, + get valueOf() { + return decryptedValueFn; + }, + get toJSON() { + return this.serialize; + } + }); + }; + var encryptedIncomingForeignData = (contractID, _0, data, _1, additionalKeys, additionalData, validatorFn) => { + let decryptedValue; + const decryptedValueFn = () => { + if (decryptedValue) { + return decryptedValue; + } + const rootState = rootStateFn2(); + const state = rootState[contractID]; + decryptedValue = decryptData.call(state, NaN, data, additionalKeys ?? rootState.secretKeys, additionalData || "", validatorFn); + if (isRawSignedData(decryptedValue)) { + return signedIncomingData(contractID, state, decryptedValue, NaN, additionalData || ""); + } + return decryptedValue; + }; + return wrapper2({ + get encryptionKeyId() { + return encryptedDataKeyId(data); + }, + get serialize() { + return () => data; + }, + get toString() { + return () => JSON.stringify(this.serialize()); + }, + get valueOf() { + return decryptedValueFn; + }, + get toJSON() { + return this.serialize; + } + }); + }; + var encryptedDataKeyId = (data) => { + if (!isRawEncryptedData(data)) { + throw new ChelErrorDecryptionError("Invalid message format"); + } + return data[0]; + }; + var isRawEncryptedData = (data) => { + if (!Array.isArray(data) || data.length !== 2 || data.map((v) => typeof v).filter((v) => v !== "string").length !== 0) { + return false; + } + return true; + }; + var unwrapMaybeEncryptedData = (data) => { + if (isEncryptedData(data)) { + if (false) + return; + try { + return { + encryptionKeyId: data.encryptionKeyId, + data: data.valueOf() + }; + } catch (e) { + console.warn("unwrapMaybeEncryptedData: Unable to decrypt", e); + } + } else { + return { + encryptionKeyId: null, + data + }; + } + }; + var maybeEncryptedIncomingData = (contractID, state, data, height, additionalKeys, additionalData, validatorFn) => { + if (isRawEncryptedData(data)) { + return encryptedIncomingData(contractID, state, data, height, additionalKeys, additionalData, validatorFn); + } else { + validatorFn?.(data, ""); + return data; + } + }; + + // shared/domains/chelonia/GIMessage.js + var decryptedAndVerifiedDeserializedMessage = (head, headJSON, contractID, parsedMessage, additionalKeys, state) => { + const op = head.op; + const height = head.height; + const message = op === GIMessage.OP_ACTION_ENCRYPTED ? encryptedIncomingData(contractID, state, parsedMessage, height, additionalKeys, headJSON, void 0) : parsedMessage; + if ([GIMessage.OP_KEY_ADD, GIMessage.OP_KEY_UPDATE].includes(op)) { + return message.map((key) => { + return maybeEncryptedIncomingData(contractID, state, key, height, additionalKeys, headJSON, (key2, eKeyId) => { + if (key2.meta?.private?.content) { + key2.meta.private.content = encryptedIncomingData(contractID, state, key2.meta.private.content, height, additionalKeys, headJSON, (value) => { + const computedKeyId = keyId(value); + if (computedKeyId !== key2.id) { + throw new Error(`Key ID mismatch. Expected to decrypt key ID ${key2.id} but got ${computedKeyId}`); + } + }); + } + if (key2.meta?.keyRequest?.reference) { + try { + key2.meta.keyRequest.reference = maybeEncryptedIncomingData(contractID, state, key2.meta.keyRequest.reference, height, additionalKeys, headJSON)?.valueOf(); + } catch { + delete key2.meta.keyRequest.reference; + } + } + if (key2.meta?.keyRequest?.contractID) { + try { + key2.meta.keyRequest.contractID = maybeEncryptedIncomingData(contractID, state, key2.meta.keyRequest.contractID, height, additionalKeys, headJSON)?.valueOf(); + } catch { + delete key2.meta.keyRequest.contractID; + } + } + }); + }); + } + if (op === GIMessage.OP_CONTRACT) { + message.keys = message.keys?.map((key, eKeyId) => { + return maybeEncryptedIncomingData(contractID, state, key, height, additionalKeys, headJSON, (key2) => { + if (!key2.meta?.private?.content) + return; + const decryptionFn = message.foreignContractID ? encryptedIncomingForeignData : encryptedIncomingData; + const decryptionContract = message.foreignContractID ? message.foreignContractID : contractID; + key2.meta.private.content = decryptionFn(decryptionContract, state, key2.meta.private.content, height, additionalKeys, headJSON, (value) => { + const computedKeyId = keyId(value); + if (computedKeyId !== key2.id) { + throw new Error(`Key ID mismatch. Expected to decrypt key ID ${key2.id} but got ${computedKeyId}`); + } + }); + }); + }); + } + if (op === GIMessage.OP_KEY_SHARE) { + return maybeEncryptedIncomingData(contractID, state, message, height, additionalKeys, headJSON, (message2) => { + message2.keys?.forEach((key) => { + if (!key.meta?.private?.content) + return; + const decryptionFn = message2.foreignContractID ? encryptedIncomingForeignData : encryptedIncomingData; + const decryptionContract = message2.foreignContractID || contractID; + key.meta.private.content = decryptionFn(decryptionContract, state, key.meta.private.content, height, additionalKeys, headJSON, (value) => { + const computedKeyId = keyId(value); + if (computedKeyId !== key.id) { + throw new Error(`Key ID mismatch. Expected to decrypt key ID ${key.id} but got ${computedKeyId}`); + } + }); + }); + }); + } + if (op === GIMessage.OP_KEY_REQUEST) { + return maybeEncryptedIncomingData(contractID, state, message, height, additionalKeys, headJSON, (msg) => { + msg.replyWith = signedIncomingData(msg.contractID, void 0, msg.replyWith, msg.height, headJSON); + }); + } + if (op === GIMessage.OP_ACTION_UNENCRYPTED && isRawSignedData(message)) { + return signedIncomingData(contractID, state, message, height, headJSON); + } + if (op === GIMessage.OP_ACTION_ENCRYPTED) { + return message; + } + if (op === GIMessage.OP_KEY_DEL) { + return message.map((key) => { + return maybeEncryptedIncomingData(contractID, state, key, height, additionalKeys, headJSON, void 0); + }); + } + if (op === GIMessage.OP_KEY_REQUEST_SEEN) { + return maybeEncryptedIncomingData(contractID, state, parsedMessage, height, additionalKeys, headJSON, void 0); + } + if (op === GIMessage.OP_ATOMIC) { + return message.map(([opT, opV]) => [ + opT, + decryptedAndVerifiedDeserializedMessage({ ...head, op: opT }, headJSON, contractID, opV, additionalKeys, state) + ]); + } + return message; + }; + var _GIMessage = class { + _mapping; + _head; + _message; + _signedMessageData; + _direction; + _decryptedValue; + _innerSigningKeyId; + static createV1_0({ + contractID, + previousHEAD = null, + height = Number.MAX_SAFE_INTEGER, + op, + manifest + }) { + const head = { + version: "1.0.0", + previousHEAD, + height, + contractID, + op: op[0], + manifest + }; + return new this(messageToParams(head, op[1])); + } + static cloneWith(targetHead, targetOp, sources) { + const head = Object.assign({}, targetHead, sources); + return new this(messageToParams(head, targetOp[1])); + } + static deserialize(value, additionalKeys, state) { + if (!value) + throw new Error(`deserialize bad value: ${value}`); + const { head: headJSON, ...parsedValue } = JSON.parse(value); + const head = JSON.parse(headJSON); + const contractID = head.op === _GIMessage.OP_CONTRACT ? createCID(value) : head.contractID; + if (!state?._vm?.authorizedKeys && head.op === _GIMessage.OP_CONTRACT) { + const value2 = rawSignedIncomingData(parsedValue); + const authorizedKeys = Object.fromEntries(value2.valueOf()?.keys.map((k) => [k.id, k])); + state = { + _vm: { + authorizedKeys + } + }; + } + const signedMessageData = signedIncomingData(contractID, state, parsedValue, head.height, headJSON, (message) => decryptedAndVerifiedDeserializedMessage(head, headJSON, contractID, message, additionalKeys, state)); + return new this({ + direction: "incoming", + mapping: { key: createCID(value), value }, + head, + signedMessageData + }); + } + static deserializeHEAD(value) { + if (!value) + throw new Error(`deserialize bad value: ${value}`); + let head, hash; + const result = { + get head() { + if (head === void 0) { + head = JSON.parse(JSON.parse(value).head); + } + return head; + }, + get hash() { + if (!hash) { + hash = createCID(value); + } + return hash; + }, + get contractID() { + return result.head?.contractID ?? result.hash; + }, + description() { + const type = this.head.op; + return ``; + }, + get isFirstMessage() { + return !result.head?.contractID; + } + }; + return result; + } + constructor(params) { + this._direction = params.direction; + this._mapping = params.mapping; + this._head = params.head; + this._signedMessageData = params.signedMessageData; + const type = this.opType(); + let atomicTopLevel = true; + const validate = (type2, message) => { + switch (type2) { + case _GIMessage.OP_CONTRACT: + if (!this.isFirstMessage() || !atomicTopLevel) + throw new Error("OP_CONTRACT: must be first message"); + break; + case _GIMessage.OP_ATOMIC: + if (!atomicTopLevel) { + throw new Error("OP_ATOMIC not allowed inside of OP_ATOMIC"); + } + if (!Array.isArray(message)) { + throw new TypeError("OP_ATOMIC must be of an array type"); + } + atomicTopLevel = false; + message.forEach(([t, m]) => validate(t, m)); + break; + case _GIMessage.OP_KEY_ADD: + case _GIMessage.OP_KEY_DEL: + case _GIMessage.OP_KEY_UPDATE: + if (!Array.isArray(message)) + throw new TypeError("OP_KEY_{ADD|DEL|UPDATE} must be of an array type"); + break; + case _GIMessage.OP_KEY_SHARE: + case _GIMessage.OP_KEY_REQUEST: + case _GIMessage.OP_KEY_REQUEST_SEEN: + case _GIMessage.OP_ACTION_ENCRYPTED: + case _GIMessage.OP_ACTION_UNENCRYPTED: + break; + default: + throw new Error(`unsupported op: ${type2}`); + } + }; + Object.defineProperty(this, "_message", { + get: ((validated) => () => { + const message = this._signedMessageData.valueOf(); + if (!validated) { + validate(type, message); + validated = true; + } + return message; + })() + }); + } + decryptedValue() { + if (this._decryptedValue) + return this._decryptedValue; + try { + const value = this.message(); + const data = unwrapMaybeEncryptedData(value); + if (data?.data) { + if (isSignedData(data.data)) { + this._innerSigningKeyId = data.data.signingKeyId; + this._decryptedValue = data.data.valueOf(); + } else { + this._decryptedValue = data.data; + } + } + return this._decryptedValue; + } catch { + return void 0; + } + } + innerSigningKeyId() { + if (!this._decryptedValue) { + this.decryptedValue(); + } + return this._innerSigningKeyId; + } + head() { + return this._head; + } + message() { + return this._message; + } + op() { + return [this.head().op, this.message()]; + } + rawOp() { + return [this.head().op, this._signedMessageData]; + } + opType() { + return this.head().op; + } + opValue() { + return this.message(); + } + signingKeyId() { + return this._signedMessageData.signingKeyId; + } + manifest() { + return this.head().manifest; + } + description() { + const type = this.opType(); + let desc = ``; + } + isFirstMessage() { + return !this.head().contractID; + } + contractID() { + return this.head().contractID || this.hash(); + } + serialize() { + return this._mapping.value; + } + hash() { + return this._mapping.key; + } + height() { + return this._head.height; + } + id() { + throw new Error("GIMessage.id() was called but it has been removed"); + } + direction() { + return this._direction; + } + static get [serdesTagSymbol]() { + return "GIMessage"; + } + static [serdesSerializeSymbol](m) { + return [m.serialize(), m.direction(), m.decryptedValue(), m.innerSigningKeyId()]; + } + static [serdesDeserializeSymbol]([serialized, direction, decryptedValue, innerSigningKeyId]) { + const m = _GIMessage.deserialize(serialized); + m._direction = direction; + m._decryptedValue = decryptedValue; + m._innerSigningKeyId = innerSigningKeyId; + return m; + } + }; + var GIMessage = _GIMessage; + __publicField(GIMessage, "OP_CONTRACT", "c"); + __publicField(GIMessage, "OP_ACTION_ENCRYPTED", "ae"); + __publicField(GIMessage, "OP_ACTION_UNENCRYPTED", "au"); + __publicField(GIMessage, "OP_KEY_ADD", "ka"); + __publicField(GIMessage, "OP_KEY_DEL", "kd"); + __publicField(GIMessage, "OP_KEY_UPDATE", "ku"); + __publicField(GIMessage, "OP_PROTOCOL_UPGRADE", "pu"); + __publicField(GIMessage, "OP_PROP_SET", "ps"); + __publicField(GIMessage, "OP_PROP_DEL", "pd"); + __publicField(GIMessage, "OP_CONTRACT_AUTH", "ca"); + __publicField(GIMessage, "OP_CONTRACT_DEAUTH", "cd"); + __publicField(GIMessage, "OP_ATOMIC", "a"); + __publicField(GIMessage, "OP_KEY_SHARE", "ks"); + __publicField(GIMessage, "OP_KEY_REQUEST", "kr"); + __publicField(GIMessage, "OP_KEY_REQUEST_SEEN", "krs"); + function messageToParams(head, message) { + let mapping; + return { + direction: has(message, "recreate") ? "outgoing" : "incoming", + get mapping() { + if (!mapping) { + const headJSON = JSON.stringify(head); + const messageJSON = { ...message.serialize(headJSON), head: headJSON }; + const value = JSON.stringify(messageJSON); + mapping = { + key: createCID(value), + value + }; + } + return mapping; + }, + head, + signedMessageData: message + }; + } + + // shared/domains/chelonia/utils.js + var MAX_EVENTS_AFTER = Number.parseInt("", 10) || Infinity; + var findKeyIdByName = (state, name) => state._vm?.authorizedKeys && Object.values(state._vm.authorizedKeys).find((k) => k.name === name && k._notAfterHeight == null)?.id; + var findForeignKeysByContractID = (state, contractID) => state._vm?.authorizedKeys && Object.values(state._vm.authorizedKeys).filter((k) => k._notAfterHeight == null && k.foreignKey?.includes(contractID)).map((k) => k.id); + + // frontend/model/contracts/shared/constants.js + var MAX_HASH_LEN = 300; + var MAX_URL_LEN = 2048; + var IDENTITY_USERNAME_MAX_CHARS = 80; + var IDENTITY_EMAIL_MAX_CHARS = 320; + var IDENTITY_BIO_MAX_CHARS = 500; + + // frontend/model/contracts/shared/functions.js + var import_sbp4 = __toESM(__require("@sbp/sbp")); + var import_common2 = __require("@common/common.js"); + + // frontend/model/contracts/shared/time.js + var import_common = __require("@common/common.js"); + var MINS_MILLIS = 6e4; + var HOURS_MILLIS = 60 * MINS_MILLIS; + var DAYS_MILLIS = 24 * HOURS_MILLIS; + var MONTHS_MILLIS = 30 * DAYS_MILLIS; + var YEARS_MILLIS = 365 * DAYS_MILLIS; + + // frontend/model/contracts/shared/functions.js + var referenceTally = (selector) => { + const delta = { + "retain": 1, + "release": -1 + }; + return { + [selector]: (parentContractID, childContractIDs, op) => { + if (!Array.isArray(childContractIDs)) + childContractIDs = [childContractIDs]; + if (op !== "retain" && op !== "release") + throw new Error("Invalid operation"); + for (const childContractID of childContractIDs) { + const key = `${selector}-${parentContractID}-${childContractID}`; + const count = (0, import_sbp4.default)("okTurtles.data/get", key); + (0, import_sbp4.default)("okTurtles.data/set", key, (count || 0) + delta[op]); + if (count != null) + return; + (0, import_sbp4.default)("chelonia/queueInvocation", parentContractID, () => { + const count2 = (0, import_sbp4.default)("okTurtles.data/get", key); + (0, import_sbp4.default)("okTurtles.data/delete", key); + if (count2 && count2 !== Math.sign(count2)) { + console.warn(`[${selector}] Unexpected value`, parentContractID, childContractID, count2); + if ("") { + Promise.reject(new Error(`[${selector}] Unexpected value ${parentContractID} ${childContractID}: ${count2}`)); + } + } + switch (Math.sign(count2)) { + case -1: + (0, import_sbp4.default)("chelonia/contract/release", childContractID).catch((e) => { + console.error(`[${selector}] Error calling release`, parentContractID, childContractID, e); + }); + break; + case 1: + (0, import_sbp4.default)("chelonia/contract/retain", childContractID).catch((e) => console.error(`[${selector}] Error calling retain`, parentContractID, childContractID, e)); + break; + } + }).catch((e) => { + console.error(`[${selector}] Error in queued invocation`, parentContractID, childContractID, e); + }); + } + } + }; + }; + + // frontend/model/contracts/shared/getters/identity.js + var identity_default = { + loginState(state, getters) { + return getters.currentIdentityState.loginState; + }, + ourDirectMessages(state, getters) { + return getters.currentIdentityState.chatRooms || {}; + } + }; + + // frontend/model/contracts/shared/validators.js + var allowedUsernameCharacters = (value) => /^[\w-]*$/.test(value); + var noConsecutiveHyphensOrUnderscores = (value) => !value.includes("--") && !value.includes("__"); + var noLeadingOrTrailingHyphen = (value) => !value.startsWith("-") && !value.endsWith("-"); + var noLeadingOrTrailingUnderscore = (value) => !value.startsWith("_") && !value.endsWith("_"); + var noUppercase = (value) => value.toLowerCase() === value; + + // frontend/model/contracts/identity.js + var attributesType = objectMaybeOf({ + username: stringMax(IDENTITY_USERNAME_MAX_CHARS, "username"), + displayName: optional(stringMax(IDENTITY_USERNAME_MAX_CHARS, "displayName")), + email: optional(stringMax(IDENTITY_EMAIL_MAX_CHARS, "email")), + bio: optional(stringMax(IDENTITY_BIO_MAX_CHARS, "bio")), + picture: unionOf(stringMax(MAX_URL_LEN), objectOf({ + manifestCid: stringMax(MAX_HASH_LEN, "manifestCid"), + downloadParams: optional(object) + })) + }); + var validateUsername = (username) => { + if (!username) { + throw new TypeError("A username is required"); + } + if (!allowedUsernameCharacters(username)) { + throw new TypeError("A username cannot contain disallowed characters."); + } + if (!noConsecutiveHyphensOrUnderscores(username)) { + throw new TypeError("A username cannot contain two consecutive hyphens or underscores."); + } + if (!noLeadingOrTrailingHyphen(username)) { + throw new TypeError("A username cannot start or end with a hyphen."); + } + if (!noLeadingOrTrailingUnderscore(username)) { + throw new TypeError("A username cannot start or end with an underscore."); + } + if (!noUppercase(username)) { + throw new TypeError("A username cannot contain uppercase letters."); + } + }; + var checkUsernameConsistency = async (contractID, username) => { + const lookupResult = await (0, import_sbp5.default)("namespace/lookup", username, { skipCache: true }); + if (lookupResult === contractID) + return; + console.error(`Mismatched username. The lookup result was ${lookupResult} instead of ${contractID}`); + (0, import_sbp5.default)("chelonia/queueInvocation", contractID, async () => { + const state = await (0, import_sbp5.default)("chelonia/contract/state", contractID); + if (!state) + return; + const username2 = state[contractID].attributes.username; + if (await (0, import_sbp5.default)("namespace/lookupCached", username2) !== contractID) { + (0, import_sbp5.default)("gi.notifications/emit", "WARNING", { + contractID, + message: (0, import_common3.L)("Unable to confirm that the username {username} belongs to this identity contract", { username: username2 }) + }); + } + }); + }; + (0, import_sbp5.default)("chelonia/defineContract", { + name: "gi.contracts/identity", + getters: { + currentIdentityState(state) { + return state; + }, + ...identity_default + }, + actions: { + "gi.contracts/identity": { + validate: (data) => { + objectMaybeOf({ + attributes: attributesType + })(data); + const { username } = data.attributes; + if (!username) { + throw new TypeError("A username is required"); + } + validateUsername(username); + }, + process({ data }, { state }) { + const initialState = merge({ + settings: {}, + attributes: {}, + chatRooms: {}, + groups: {}, + fileDeleteTokens: {} + }, data); + for (const key in initialState) { + state[key] = initialState[key]; + } + }, + async sideEffect({ contractID, data }) { + await checkUsernameConsistency(contractID, data.attributes.username); + } + }, + "gi.contracts/identity/setAttributes": { + validate: (data) => { + attributesType(data); + if (has(data, "username")) { + validateUsername(data.username); + } + }, + process({ data }, { state }) { + for (const key in data) { + state.attributes[key] = data[key]; + } + }, + async sideEffect({ contractID, data }) { + if (has(data, "username")) { + await checkUsernameConsistency(contractID, data.username); + } + } + }, + "gi.contracts/identity/deleteAttributes": { + validate: (data) => { + arrayOf(string)(data); + if (data.includes("username")) { + throw new Error("Username can't be deleted"); + } + }, + process({ data }, { state }) { + for (const attribute of data) { + delete state.attributes[attribute]; + } + } + }, + "gi.contracts/identity/updateSettings": { + validate: object, + process({ data }, { state }) { + for (const key in data) { + state.settings[key] = data[key]; + } + } + }, + "gi.contracts/identity/createDirectMessage": { + validate: (data) => { + objectOf({ + contractID: stringMax(MAX_HASH_LEN, "contractID") + })(data); + }, + process({ data }, { state }) { + const { contractID } = data; + state.chatRooms[contractID] = { + visible: true + }; + }, + sideEffect({ data }) { + (0, import_sbp5.default)("chelonia/contract/retain", data.contractID).catch((e) => { + console.error("[gi.contracts/identity/createDirectMessage/sideEffect] Error calling retain", e); + }); + } + }, + "gi.contracts/identity/joinDirectMessage": { + validate: objectOf({ + contractID: stringMax(MAX_HASH_LEN, "contractID") + }), + process({ data }, { state }) { + const { contractID } = data; + if (state.chatRooms[contractID]) { + throw new TypeError((0, import_common3.L)("Already joined direct message.")); + } + state.chatRooms[contractID] = { + visible: true + }; + }, + sideEffect({ data }, { state }) { + if (state.chatRooms[data.contractID].visible) { + (0, import_sbp5.default)("chelonia/contract/retain", data.contractID).catch((e) => { + console.error("[gi.contracts/identity/createDirectMessage/sideEffect] Error calling retain", e); + }); + } + } + }, + "gi.contracts/identity/joinGroup": { + validate: objectMaybeOf({ + groupContractID: stringMax(MAX_HASH_LEN, "groupContractID"), + inviteSecret: string, + creatorID: optional(boolean) + }), + async process({ hash, data }, { state }) { + const { groupContractID, inviteSecret } = data; + if (has(state.groups, groupContractID) && !state.groups[groupContractID].hasLeft) { + throw new Error(`Cannot join already joined group ${groupContractID}`); + } + const inviteSecretId = await (0, import_sbp5.default)("chelonia/crypto/keyId", new Secret(inviteSecret)); + state.groups[groupContractID] = { hash, inviteSecretId }; + }, + async sideEffect({ hash, data, contractID }, { state }) { + const { groupContractID, inviteSecret } = data; + await (0, import_sbp5.default)("chelonia/storeSecretKeys", new Secret([{ + key: inviteSecret, + transient: true + }])); + (0, import_sbp5.default)("gi.contracts/identity/referenceTally", contractID, groupContractID, "retain"); + (0, import_sbp5.default)("chelonia/queueInvocation", contractID, async () => { + const state2 = await (0, import_sbp5.default)("chelonia/contract/state", contractID); + if (!state2 || contractID !== (0, import_sbp5.default)("state/vuex/state").loggedIn.identityContractID) { + return; + } + if (!has(state2.groups, groupContractID) || state2.groups[groupContractID].hasLeft || state2.groups[groupContractID].hash !== hash) { + (0, import_sbp5.default)("okTurtles.data/set", `gi.contracts/identity/group-skipped-${groupContractID}-${hash}`, true); + return; + } + const inviteSecretId = (0, import_sbp5.default)("chelonia/crypto/keyId", new Secret(inviteSecret)); + return inviteSecretId; + }).then(async (inviteSecretId) => { + if (!inviteSecretId) + return; + (0, import_sbp5.default)("gi.actions/group/join", { + originatingContractID: contractID, + originatingContractName: "gi.contracts/identity", + contractID: data.groupContractID, + contractName: "gi.contracts/group", + reference: hash, + signingKeyId: inviteSecretId, + innerSigningKeyId: await (0, import_sbp5.default)("chelonia/contract/currentKeyIdByName", state, "csk"), + encryptionKeyId: await (0, import_sbp5.default)("chelonia/contract/currentKeyIdByName", state, "cek") + }).catch((e) => { + console.warn(`[gi.contracts/identity/joinGroup/sideEffect] Error sending gi.actions/group/join action for group ${data.groupContractID}`, e); + }); + }).catch((e) => { + console.error(`[gi.contracts/identity/joinGroup/sideEffect] Error at queueInvocation group ${data.groupContractID}`, e); + }); + } + }, + "gi.contracts/identity/leaveGroup": { + validate: objectOf({ + groupContractID: stringMax(MAX_HASH_LEN, "groupContractID"), + reference: string + }), + process({ data }, { state }) { + const { groupContractID, reference } = data; + if (!has(state.groups, groupContractID) || state.groups[groupContractID].hasLeft) { + throw new Error(`Cannot leave group which hasn't been joined ${groupContractID}`); + } + if (state.groups[groupContractID].hash !== reference) { + throw new Error(`Cannot leave group ${groupContractID} because the reference hash does not match the latest`); + } + state.groups[groupContractID] = { hash: reference, hasLeft: true }; + }, + sideEffect({ data, contractID }) { + (0, import_sbp5.default)("gi.contracts/identity/referenceTally", contractID, data.groupContractID, "release"); + (0, import_sbp5.default)("chelonia/queueInvocation", contractID, async () => { + const state = await (0, import_sbp5.default)("chelonia/contract/state", contractID); + if (!state || contractID !== (0, import_sbp5.default)("state/vuex/state").loggedIn.identityContractID) { + return; + } + const { groupContractID, reference } = data; + if (!has(state.groups, groupContractID) || !state.groups[groupContractID].hasLeft || state.groups[groupContractID].hash !== reference) { + return; + } + (0, import_sbp5.default)("gi.actions/group/removeOurselves", { + contractID: groupContractID + }).catch((e) => { + if (e?.name === "GIErrorUIRuntimeError" && e.cause?.name === "GIGroupNotJoinedError") + return; + console.warn(`[gi.contracts/identity/leaveGroup/sideEffect] Error removing ourselves from group contract ${data.groupContractID}`, e); + }); + if ((0, import_sbp5.default)("state/vuex/state").lastLoggedIn?.[contractID]) { + delete (0, import_sbp5.default)("state/vuex/state").lastLoggedIn[contractID]; + } + (0, import_sbp5.default)("gi.contracts/identity/revokeGroupKeyAndRotateOurPEK", contractID, state, data.groupContractID); + (0, import_sbp5.default)("okTurtles.events/emit", LEFT_GROUP, { identityContractID: contractID, groupContractID: data.groupContractID }); + }).catch((e) => { + console.error(`[gi.contracts/identity/leaveGroup/sideEffect] Error leaving group ${data.groupContractID}`, e); + }); + } + }, + "gi.contracts/identity/setDirectMessageVisibility": { + validate: (data, { state }) => { + objectOf({ + contractID: stringMax(MAX_HASH_LEN, "contractID"), + visible: boolean + })(data); + if (!state.chatRooms[data.contractID]) { + throw new TypeError((0, import_common3.L)("Not existing direct message.")); + } + }, + process({ data }, { state }) { + state.chatRooms[data.contractID]["visible"] = data.visible; + } + }, + "gi.contracts/identity/saveFileDeleteToken": { + validate: objectOf({ + tokensByManifestCid: arrayOf(objectOf({ + manifestCid: stringMax(MAX_HASH_LEN, "manifestCid"), + token: string + })) + }), + process({ data }, { state }) { + for (const { manifestCid, token } of data.tokensByManifestCid) { + state.fileDeleteTokens[manifestCid] = token; + } + } + }, + "gi.contracts/identity/removeFileDeleteToken": { + validate: objectOf({ + manifestCids: arrayOf(string) + }), + process({ data }, { state }) { + for (const manifestCid of data.manifestCids) { + delete state.fileDeleteTokens[manifestCid]; + } + } + }, + "gi.contracts/identity/setGroupAttributes": { + validate: objectOf({ + groupContractID: string, + attributes: objectMaybeOf({ + seenWelcomeScreen: validatorFrom((v) => v === true) + }) + }), + process({ data }, { state }) { + const { groupContractID, attributes } = data; + if (!has(state.groups, groupContractID) || state.groups[groupContractID].hasLeft) { + throw new Error("Can't set attributes of groups you're not a member of"); + } + if (attributes.seenWelcomeScreen) { + if (state.groups[groupContractID].seenWelcomeScreen) { + throw new Error("seenWelcomeScreen already set"); + } + state.groups[groupContractID].seenWelcomeScreen = attributes.seenWelcomeScreen; + } + } + } + }, + methods: { + "gi.contracts/identity/revokeGroupKeyAndRotateOurPEK": (identityContractID, state, groupContractID) => { + if (!state._volatile) + state["_volatile"] = /* @__PURE__ */ Object.create(null); + if (!state._volatile.pendingKeyRevocations) + state._volatile["pendingKeyRevocations"] = /* @__PURE__ */ Object.create(null); + const CSKid = findKeyIdByName(state, "csk"); + const CEKid = findKeyIdByName(state, "cek"); + const PEKid = findKeyIdByName(state, "pek"); + state._volatile.pendingKeyRevocations[PEKid] = true; + const groupCSKids = findForeignKeysByContractID(state, groupContractID); + if (groupCSKids?.length) { + if (!CEKid) { + throw new Error("Identity CEK not found"); + } + (0, import_sbp5.default)("chelonia/queueInvocation", identityContractID, ["chelonia/out/keyDel", { + contractID: identityContractID, + contractName: "gi.contracts/identity", + data: groupCSKids, + signingKeyId: CSKid + }]).catch((e) => { + console.warn(`revokeGroupKeyAndRotateOurPEK: ${e.name} thrown during keyDel to ${identityContractID}:`, e); + }); + } + (0, import_sbp5.default)("chelonia/queueInvocation", identityContractID, ["chelonia/contract/disconnect", identityContractID, groupContractID]).catch((e) => { + console.warn(`revokeGroupKeyAndRotateOurPEK: ${e.name} thrown during queueEvent to ${identityContractID}:`, e); + }); + (0, import_sbp5.default)("chelonia/queueInvocation", identityContractID, ["gi.actions/out/rotateKeys", identityContractID, "gi.contracts/identity", "pending", "gi.actions/identity/shareNewPEK"]).catch((e) => { + console.warn(`revokeGroupKeyAndRotateOurPEK: ${e.name} thrown during queueEvent to ${identityContractID}:`, e); + }); + }, + ...referenceTally("gi.contracts/identity/referenceTally") + } + }); +})(); +/*! + * Fast "async" scrypt implementation in JavaScript. + * Copyright (c) 2013-2016 Dmitry Chestnykh | BSD License + * https://github.com/dchest/scrypt-async-js + */ +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ +/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ diff --git a/contracts/1.2.0/identity.1.2.0.manifest.json b/contracts/1.2.0/identity.1.2.0.manifest.json new file mode 100644 index 000000000..77da91c60 --- /dev/null +++ b/contracts/1.2.0/identity.1.2.0.manifest.json @@ -0,0 +1 @@ +{"head":"{\"manifestVersion\":\"1.0.0\"}","body":"{\"name\":\"gi.contracts/identity\",\"version\":\"1.2.0\",\"contract\":{\"hash\":\"z9brRu3VMn6Sw6wyv4R35keucLkXDYgAroHuTtv184AbwiykUzD7\",\"file\":\"identity.js\"},\"signingKeys\":[\"[\\\"edwards25519sha512batch\\\",\\\"IjAFp6gIzHW2HOIXXS9b4A3EKf8t9NNa5nndHcROiDk=\\\",null]\"],\"contractSlim\":{\"file\":\"identity-slim.js\",\"hash\":\"z9brRu3VRnrYaRQi7VYa31X2hquXKNgB6nf9UgDrYiFaksA5epTB\"}}","signature":{"keyId":"z2DrjgbCDg34SaBhFjNEF45AVodCUu7QwcFBksz3BDgN4BekrdN","value":"4JQGD/+GtpWGzoUBmAQvxz6k1zl1tYZ2hb2izJ40/Qvuzh1byBbnsA9RDGgZdhi/Th9AWQyM6x40iVh6OtxTCA=="}} \ No newline at end of file diff --git a/contracts/1.2.0/identity.js b/contracts/1.2.0/identity.js new file mode 100644 index 000000000..6cf72d989 --- /dev/null +++ b/contracts/1.2.0/identity.js @@ -0,0 +1,8413 @@ +"use strict"; +(() => { + var __create = Object.create; + var __defProp = Object.defineProperty; + var __getOwnPropDesc = Object.getOwnPropertyDescriptor; + var __getOwnPropNames = Object.getOwnPropertyNames; + var __getProtoOf = Object.getPrototypeOf; + var __hasOwnProp = Object.prototype.hasOwnProperty; + var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; + var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { + get: (a, b) => (typeof require !== "undefined" ? require : a)[b] + }) : x)(function(x) { + if (typeof require !== "undefined") + return require.apply(this, arguments); + throw new Error('Dynamic require of "' + x + '" is not supported'); + }); + var __commonJS = (cb, mod) => function __require2() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; + }; + var __copyProps = (to, from3, except, desc) => { + if (from3 && typeof from3 === "object" || typeof from3 === "function") { + for (let key of __getOwnPropNames(from3)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from3[key], enumerable: !(desc = __getOwnPropDesc(from3, key)) || desc.enumerable }); + } + return to; + }; + var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod)); + var __publicField = (obj, key, value) => { + __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); + return value; + }; + + // node_modules/blakejs/util.js + var require_util = __commonJS({ + "node_modules/blakejs/util.js"(exports, module) { + var ERROR_MSG_INPUT = "Input must be an string, Buffer or Uint8Array"; + function normalizeInput(input) { + let ret; + if (input instanceof Uint8Array) { + ret = input; + } else if (typeof input === "string") { + const encoder = new TextEncoder(); + ret = encoder.encode(input); + } else { + throw new Error(ERROR_MSG_INPUT); + } + return ret; + } + function toHex(bytes) { + return Array.prototype.map.call(bytes, function(n) { + return (n < 16 ? "0" : "") + n.toString(16); + }).join(""); + } + function uint32ToHex(val) { + return (4294967296 + val).toString(16).substring(1); + } + function debugPrint(label, arr, size) { + let msg = "\n" + label + " = "; + for (let i = 0; i < arr.length; i += 2) { + if (size === 32) { + msg += uint32ToHex(arr[i]).toUpperCase(); + msg += " "; + msg += uint32ToHex(arr[i + 1]).toUpperCase(); + } else if (size === 64) { + msg += uint32ToHex(arr[i + 1]).toUpperCase(); + msg += uint32ToHex(arr[i]).toUpperCase(); + } else + throw new Error("Invalid size " + size); + if (i % 6 === 4) { + msg += "\n" + new Array(label.length + 4).join(" "); + } else if (i < arr.length - 2) { + msg += " "; + } + } + console.log(msg); + } + function testSpeed(hashFn, N, M) { + let startMs = new Date().getTime(); + const input = new Uint8Array(N); + for (let i = 0; i < N; i++) { + input[i] = i % 256; + } + const genMs = new Date().getTime(); + console.log("Generated random input in " + (genMs - startMs) + "ms"); + startMs = genMs; + for (let i = 0; i < M; i++) { + const hashHex = hashFn(input); + const hashMs = new Date().getTime(); + const ms = hashMs - startMs; + startMs = hashMs; + console.log("Hashed in " + ms + "ms: " + hashHex.substring(0, 20) + "..."); + console.log(Math.round(N / (1 << 20) / (ms / 1e3) * 100) / 100 + " MB PER SECOND"); + } + } + module.exports = { + normalizeInput, + toHex, + debugPrint, + testSpeed + }; + } + }); + + // node_modules/blakejs/blake2b.js + var require_blake2b = __commonJS({ + "node_modules/blakejs/blake2b.js"(exports, module) { + var util = require_util(); + function ADD64AA(v2, a, b) { + const o0 = v2[a] + v2[b]; + let o1 = v2[a + 1] + v2[b + 1]; + if (o0 >= 4294967296) { + o1++; + } + v2[a] = o0; + v2[a + 1] = o1; + } + function ADD64AC(v2, a, b0, b1) { + let o0 = v2[a] + b0; + if (b0 < 0) { + o0 += 4294967296; + } + let o1 = v2[a + 1] + b1; + if (o0 >= 4294967296) { + o1++; + } + v2[a] = o0; + v2[a + 1] = o1; + } + function B2B_GET32(arr, i) { + return arr[i] ^ arr[i + 1] << 8 ^ arr[i + 2] << 16 ^ arr[i + 3] << 24; + } + function B2B_G(a, b, c, d, ix, iy) { + const x0 = m[ix]; + const x1 = m[ix + 1]; + const y0 = m[iy]; + const y1 = m[iy + 1]; + ADD64AA(v, a, b); + ADD64AC(v, a, x0, x1); + let xor0 = v[d] ^ v[a]; + let xor1 = v[d + 1] ^ v[a + 1]; + v[d] = xor1; + v[d + 1] = xor0; + ADD64AA(v, c, d); + xor0 = v[b] ^ v[c]; + xor1 = v[b + 1] ^ v[c + 1]; + v[b] = xor0 >>> 24 ^ xor1 << 8; + v[b + 1] = xor1 >>> 24 ^ xor0 << 8; + ADD64AA(v, a, b); + ADD64AC(v, a, y0, y1); + xor0 = v[d] ^ v[a]; + xor1 = v[d + 1] ^ v[a + 1]; + v[d] = xor0 >>> 16 ^ xor1 << 16; + v[d + 1] = xor1 >>> 16 ^ xor0 << 16; + ADD64AA(v, c, d); + xor0 = v[b] ^ v[c]; + xor1 = v[b + 1] ^ v[c + 1]; + v[b] = xor1 >>> 31 ^ xor0 << 1; + v[b + 1] = xor0 >>> 31 ^ xor1 << 1; + } + var BLAKE2B_IV32 = new Uint32Array([ + 4089235720, + 1779033703, + 2227873595, + 3144134277, + 4271175723, + 1013904242, + 1595750129, + 2773480762, + 2917565137, + 1359893119, + 725511199, + 2600822924, + 4215389547, + 528734635, + 327033209, + 1541459225 + ]); + var SIGMA8 = [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 14, + 10, + 4, + 8, + 9, + 15, + 13, + 6, + 1, + 12, + 0, + 2, + 11, + 7, + 5, + 3, + 11, + 8, + 12, + 0, + 5, + 2, + 15, + 13, + 10, + 14, + 3, + 6, + 7, + 1, + 9, + 4, + 7, + 9, + 3, + 1, + 13, + 12, + 11, + 14, + 2, + 6, + 5, + 10, + 4, + 0, + 15, + 8, + 9, + 0, + 5, + 7, + 2, + 4, + 10, + 15, + 14, + 1, + 11, + 12, + 6, + 8, + 3, + 13, + 2, + 12, + 6, + 10, + 0, + 11, + 8, + 3, + 4, + 13, + 7, + 5, + 15, + 14, + 1, + 9, + 12, + 5, + 1, + 15, + 14, + 13, + 4, + 10, + 0, + 7, + 6, + 3, + 9, + 2, + 8, + 11, + 13, + 11, + 7, + 14, + 12, + 1, + 3, + 9, + 5, + 0, + 15, + 4, + 8, + 6, + 2, + 10, + 6, + 15, + 14, + 9, + 11, + 3, + 0, + 8, + 12, + 2, + 13, + 7, + 1, + 4, + 10, + 5, + 10, + 2, + 8, + 4, + 7, + 6, + 1, + 5, + 15, + 11, + 9, + 14, + 3, + 12, + 13, + 0, + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 14, + 10, + 4, + 8, + 9, + 15, + 13, + 6, + 1, + 12, + 0, + 2, + 11, + 7, + 5, + 3 + ]; + var SIGMA82 = new Uint8Array(SIGMA8.map(function(x) { + return x * 2; + })); + var v = new Uint32Array(32); + var m = new Uint32Array(32); + function blake2bCompress(ctx, last) { + let i = 0; + for (i = 0; i < 16; i++) { + v[i] = ctx.h[i]; + v[i + 16] = BLAKE2B_IV32[i]; + } + v[24] = v[24] ^ ctx.t; + v[25] = v[25] ^ ctx.t / 4294967296; + if (last) { + v[28] = ~v[28]; + v[29] = ~v[29]; + } + for (i = 0; i < 32; i++) { + m[i] = B2B_GET32(ctx.b, 4 * i); + } + for (i = 0; i < 12; i++) { + B2B_G(0, 8, 16, 24, SIGMA82[i * 16 + 0], SIGMA82[i * 16 + 1]); + B2B_G(2, 10, 18, 26, SIGMA82[i * 16 + 2], SIGMA82[i * 16 + 3]); + B2B_G(4, 12, 20, 28, SIGMA82[i * 16 + 4], SIGMA82[i * 16 + 5]); + B2B_G(6, 14, 22, 30, SIGMA82[i * 16 + 6], SIGMA82[i * 16 + 7]); + B2B_G(0, 10, 20, 30, SIGMA82[i * 16 + 8], SIGMA82[i * 16 + 9]); + B2B_G(2, 12, 22, 24, SIGMA82[i * 16 + 10], SIGMA82[i * 16 + 11]); + B2B_G(4, 14, 16, 26, SIGMA82[i * 16 + 12], SIGMA82[i * 16 + 13]); + B2B_G(6, 8, 18, 28, SIGMA82[i * 16 + 14], SIGMA82[i * 16 + 15]); + } + for (i = 0; i < 16; i++) { + ctx.h[i] = ctx.h[i] ^ v[i] ^ v[i + 16]; + } + } + var parameterBlock = new Uint8Array([ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ]); + function blake2bInit2(outlen, key, salt, personal) { + if (outlen === 0 || outlen > 64) { + throw new Error("Illegal output length, expected 0 < length <= 64"); + } + if (key && key.length > 64) { + throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64"); + } + if (salt && salt.length !== 16) { + throw new Error("Illegal salt, expected Uint8Array with length is 16"); + } + if (personal && personal.length !== 16) { + throw new Error("Illegal personal, expected Uint8Array with length is 16"); + } + const ctx = { + b: new Uint8Array(128), + h: new Uint32Array(16), + t: 0, + c: 0, + outlen + }; + parameterBlock.fill(0); + parameterBlock[0] = outlen; + if (key) + parameterBlock[1] = key.length; + parameterBlock[2] = 1; + parameterBlock[3] = 1; + if (salt) + parameterBlock.set(salt, 32); + if (personal) + parameterBlock.set(personal, 48); + for (let i = 0; i < 16; i++) { + ctx.h[i] = BLAKE2B_IV32[i] ^ B2B_GET32(parameterBlock, i * 4); + } + if (key) { + blake2bUpdate2(ctx, key); + ctx.c = 128; + } + return ctx; + } + function blake2bUpdate2(ctx, input) { + for (let i = 0; i < input.length; i++) { + if (ctx.c === 128) { + ctx.t += ctx.c; + blake2bCompress(ctx, false); + ctx.c = 0; + } + ctx.b[ctx.c++] = input[i]; + } + } + function blake2bFinal2(ctx) { + ctx.t += ctx.c; + while (ctx.c < 128) { + ctx.b[ctx.c++] = 0; + } + blake2bCompress(ctx, true); + const out = new Uint8Array(ctx.outlen); + for (let i = 0; i < ctx.outlen; i++) { + out[i] = ctx.h[i >> 2] >> 8 * (i & 3); + } + return out; + } + function blake2b3(input, key, outlen, salt, personal) { + outlen = outlen || 64; + input = util.normalizeInput(input); + if (salt) { + salt = util.normalizeInput(salt); + } + if (personal) { + personal = util.normalizeInput(personal); + } + const ctx = blake2bInit2(outlen, key, salt, personal); + blake2bUpdate2(ctx, input); + return blake2bFinal2(ctx); + } + function blake2bHex(input, key, outlen, salt, personal) { + const output = blake2b3(input, key, outlen, salt, personal); + return util.toHex(output); + } + module.exports = { + blake2b: blake2b3, + blake2bHex, + blake2bInit: blake2bInit2, + blake2bUpdate: blake2bUpdate2, + blake2bFinal: blake2bFinal2 + }; + } + }); + + // node_modules/blakejs/blake2s.js + var require_blake2s = __commonJS({ + "node_modules/blakejs/blake2s.js"(exports, module) { + var util = require_util(); + function B2S_GET32(v2, i) { + return v2[i] ^ v2[i + 1] << 8 ^ v2[i + 2] << 16 ^ v2[i + 3] << 24; + } + function B2S_G(a, b, c, d, x, y) { + v[a] = v[a] + v[b] + x; + v[d] = ROTR32(v[d] ^ v[a], 16); + v[c] = v[c] + v[d]; + v[b] = ROTR32(v[b] ^ v[c], 12); + v[a] = v[a] + v[b] + y; + v[d] = ROTR32(v[d] ^ v[a], 8); + v[c] = v[c] + v[d]; + v[b] = ROTR32(v[b] ^ v[c], 7); + } + function ROTR32(x, y) { + return x >>> y ^ x << 32 - y; + } + var BLAKE2S_IV = new Uint32Array([ + 1779033703, + 3144134277, + 1013904242, + 2773480762, + 1359893119, + 2600822924, + 528734635, + 1541459225 + ]); + var SIGMA = new Uint8Array([ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 14, + 10, + 4, + 8, + 9, + 15, + 13, + 6, + 1, + 12, + 0, + 2, + 11, + 7, + 5, + 3, + 11, + 8, + 12, + 0, + 5, + 2, + 15, + 13, + 10, + 14, + 3, + 6, + 7, + 1, + 9, + 4, + 7, + 9, + 3, + 1, + 13, + 12, + 11, + 14, + 2, + 6, + 5, + 10, + 4, + 0, + 15, + 8, + 9, + 0, + 5, + 7, + 2, + 4, + 10, + 15, + 14, + 1, + 11, + 12, + 6, + 8, + 3, + 13, + 2, + 12, + 6, + 10, + 0, + 11, + 8, + 3, + 4, + 13, + 7, + 5, + 15, + 14, + 1, + 9, + 12, + 5, + 1, + 15, + 14, + 13, + 4, + 10, + 0, + 7, + 6, + 3, + 9, + 2, + 8, + 11, + 13, + 11, + 7, + 14, + 12, + 1, + 3, + 9, + 5, + 0, + 15, + 4, + 8, + 6, + 2, + 10, + 6, + 15, + 14, + 9, + 11, + 3, + 0, + 8, + 12, + 2, + 13, + 7, + 1, + 4, + 10, + 5, + 10, + 2, + 8, + 4, + 7, + 6, + 1, + 5, + 15, + 11, + 9, + 14, + 3, + 12, + 13, + 0 + ]); + var v = new Uint32Array(16); + var m = new Uint32Array(16); + function blake2sCompress(ctx, last) { + let i = 0; + for (i = 0; i < 8; i++) { + v[i] = ctx.h[i]; + v[i + 8] = BLAKE2S_IV[i]; + } + v[12] ^= ctx.t; + v[13] ^= ctx.t / 4294967296; + if (last) { + v[14] = ~v[14]; + } + for (i = 0; i < 16; i++) { + m[i] = B2S_GET32(ctx.b, 4 * i); + } + for (i = 0; i < 10; i++) { + B2S_G(0, 4, 8, 12, m[SIGMA[i * 16 + 0]], m[SIGMA[i * 16 + 1]]); + B2S_G(1, 5, 9, 13, m[SIGMA[i * 16 + 2]], m[SIGMA[i * 16 + 3]]); + B2S_G(2, 6, 10, 14, m[SIGMA[i * 16 + 4]], m[SIGMA[i * 16 + 5]]); + B2S_G(3, 7, 11, 15, m[SIGMA[i * 16 + 6]], m[SIGMA[i * 16 + 7]]); + B2S_G(0, 5, 10, 15, m[SIGMA[i * 16 + 8]], m[SIGMA[i * 16 + 9]]); + B2S_G(1, 6, 11, 12, m[SIGMA[i * 16 + 10]], m[SIGMA[i * 16 + 11]]); + B2S_G(2, 7, 8, 13, m[SIGMA[i * 16 + 12]], m[SIGMA[i * 16 + 13]]); + B2S_G(3, 4, 9, 14, m[SIGMA[i * 16 + 14]], m[SIGMA[i * 16 + 15]]); + } + for (i = 0; i < 8; i++) { + ctx.h[i] ^= v[i] ^ v[i + 8]; + } + } + function blake2sInit(outlen, key) { + if (!(outlen > 0 && outlen <= 32)) { + throw new Error("Incorrect output length, should be in [1, 32]"); + } + const keylen = key ? key.length : 0; + if (key && !(keylen > 0 && keylen <= 32)) { + throw new Error("Incorrect key length, should be in [1, 32]"); + } + const ctx = { + h: new Uint32Array(BLAKE2S_IV), + b: new Uint8Array(64), + c: 0, + t: 0, + outlen + }; + ctx.h[0] ^= 16842752 ^ keylen << 8 ^ outlen; + if (keylen > 0) { + blake2sUpdate(ctx, key); + ctx.c = 64; + } + return ctx; + } + function blake2sUpdate(ctx, input) { + for (let i = 0; i < input.length; i++) { + if (ctx.c === 64) { + ctx.t += ctx.c; + blake2sCompress(ctx, false); + ctx.c = 0; + } + ctx.b[ctx.c++] = input[i]; + } + } + function blake2sFinal(ctx) { + ctx.t += ctx.c; + while (ctx.c < 64) { + ctx.b[ctx.c++] = 0; + } + blake2sCompress(ctx, true); + const out = new Uint8Array(ctx.outlen); + for (let i = 0; i < ctx.outlen; i++) { + out[i] = ctx.h[i >> 2] >> 8 * (i & 3) & 255; + } + return out; + } + function blake2s(input, key, outlen) { + outlen = outlen || 32; + input = util.normalizeInput(input); + const ctx = blake2sInit(outlen, key); + blake2sUpdate(ctx, input); + return blake2sFinal(ctx); + } + function blake2sHex(input, key, outlen) { + const output = blake2s(input, key, outlen); + return util.toHex(output); + } + module.exports = { + blake2s, + blake2sHex, + blake2sInit, + blake2sUpdate, + blake2sFinal + }; + } + }); + + // node_modules/blakejs/index.js + var require_blakejs = __commonJS({ + "node_modules/blakejs/index.js"(exports, module) { + var b2b = require_blake2b(); + var b2s = require_blake2s(); + module.exports = { + blake2b: b2b.blake2b, + blake2bHex: b2b.blake2bHex, + blake2bInit: b2b.blake2bInit, + blake2bUpdate: b2b.blake2bUpdate, + blake2bFinal: b2b.blake2bFinal, + blake2s: b2s.blake2s, + blake2sHex: b2s.blake2sHex, + blake2sInit: b2s.blake2sInit, + blake2sUpdate: b2s.blake2sUpdate, + blake2sFinal: b2s.blake2sFinal + }; + } + }); + + // node_modules/base64-js/index.js + var require_base64_js = __commonJS({ + "node_modules/base64-js/index.js"(exports) { + "use strict"; + exports.byteLength = byteLength; + exports.toByteArray = toByteArray; + exports.fromByteArray = fromByteArray; + var lookup = []; + var revLookup = []; + var Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array; + var code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + for (i = 0, len = code.length; i < len; ++i) { + lookup[i] = code[i]; + revLookup[code.charCodeAt(i)] = i; + } + var i; + var len; + revLookup["-".charCodeAt(0)] = 62; + revLookup["_".charCodeAt(0)] = 63; + function getLens(b64) { + var len2 = b64.length; + if (len2 % 4 > 0) { + throw new Error("Invalid string. Length must be a multiple of 4"); + } + var validLen = b64.indexOf("="); + if (validLen === -1) + validLen = len2; + var placeHoldersLen = validLen === len2 ? 0 : 4 - validLen % 4; + return [validLen, placeHoldersLen]; + } + function byteLength(b64) { + var lens = getLens(b64); + var validLen = lens[0]; + var placeHoldersLen = lens[1]; + return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; + } + function _byteLength(b64, validLen, placeHoldersLen) { + return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; + } + function toByteArray(b64) { + var tmp; + var lens = getLens(b64); + var validLen = lens[0]; + var placeHoldersLen = lens[1]; + var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)); + var curByte = 0; + var len2 = placeHoldersLen > 0 ? validLen - 4 : validLen; + var i2; + for (i2 = 0; i2 < len2; i2 += 4) { + tmp = revLookup[b64.charCodeAt(i2)] << 18 | revLookup[b64.charCodeAt(i2 + 1)] << 12 | revLookup[b64.charCodeAt(i2 + 2)] << 6 | revLookup[b64.charCodeAt(i2 + 3)]; + arr[curByte++] = tmp >> 16 & 255; + arr[curByte++] = tmp >> 8 & 255; + arr[curByte++] = tmp & 255; + } + if (placeHoldersLen === 2) { + tmp = revLookup[b64.charCodeAt(i2)] << 2 | revLookup[b64.charCodeAt(i2 + 1)] >> 4; + arr[curByte++] = tmp & 255; + } + if (placeHoldersLen === 1) { + tmp = revLookup[b64.charCodeAt(i2)] << 10 | revLookup[b64.charCodeAt(i2 + 1)] << 4 | revLookup[b64.charCodeAt(i2 + 2)] >> 2; + arr[curByte++] = tmp >> 8 & 255; + arr[curByte++] = tmp & 255; + } + return arr; + } + function tripletToBase64(num) { + return lookup[num >> 18 & 63] + lookup[num >> 12 & 63] + lookup[num >> 6 & 63] + lookup[num & 63]; + } + function encodeChunk(uint8, start, end) { + var tmp; + var output = []; + for (var i2 = start; i2 < end; i2 += 3) { + tmp = (uint8[i2] << 16 & 16711680) + (uint8[i2 + 1] << 8 & 65280) + (uint8[i2 + 2] & 255); + output.push(tripletToBase64(tmp)); + } + return output.join(""); + } + function fromByteArray(uint8) { + var tmp; + var len2 = uint8.length; + var extraBytes = len2 % 3; + var parts = []; + var maxChunkLength = 16383; + for (var i2 = 0, len22 = len2 - extraBytes; i2 < len22; i2 += maxChunkLength) { + parts.push(encodeChunk(uint8, i2, i2 + maxChunkLength > len22 ? len22 : i2 + maxChunkLength)); + } + if (extraBytes === 1) { + tmp = uint8[len2 - 1]; + parts.push(lookup[tmp >> 2] + lookup[tmp << 4 & 63] + "=="); + } else if (extraBytes === 2) { + tmp = (uint8[len2 - 2] << 8) + uint8[len2 - 1]; + parts.push(lookup[tmp >> 10] + lookup[tmp >> 4 & 63] + lookup[tmp << 2 & 63] + "="); + } + return parts.join(""); + } + } + }); + + // node_modules/ieee754/index.js + var require_ieee754 = __commonJS({ + "node_modules/ieee754/index.js"(exports) { + exports.read = function(buffer, offset, isLE, mLen, nBytes) { + var e, m; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var nBits = -7; + var i = isLE ? nBytes - 1 : 0; + var d = isLE ? -1 : 1; + var s = buffer[offset + i]; + i += d; + e = s & (1 << -nBits) - 1; + s >>= -nBits; + nBits += eLen; + for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) { + } + m = e & (1 << -nBits) - 1; + e >>= -nBits; + nBits += mLen; + for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) { + } + if (e === 0) { + e = 1 - eBias; + } else if (e === eMax) { + return m ? NaN : (s ? -1 : 1) * Infinity; + } else { + m = m + Math.pow(2, mLen); + e = e - eBias; + } + return (s ? -1 : 1) * m * Math.pow(2, e - mLen); + }; + exports.write = function(buffer, value, offset, isLE, mLen, nBytes) { + var e, m, c; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0; + var i = isLE ? 0 : nBytes - 1; + var d = isLE ? 1 : -1; + var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; + value = Math.abs(value); + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0; + e = eMax; + } else { + e = Math.floor(Math.log(value) / Math.LN2); + if (value * (c = Math.pow(2, -e)) < 1) { + e--; + c *= 2; + } + if (e + eBias >= 1) { + value += rt / c; + } else { + value += rt * Math.pow(2, 1 - eBias); + } + if (value * c >= 2) { + e++; + c /= 2; + } + if (e + eBias >= eMax) { + m = 0; + e = eMax; + } else if (e + eBias >= 1) { + m = (value * c - 1) * Math.pow(2, mLen); + e = e + eBias; + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); + e = 0; + } + } + for (; mLen >= 8; buffer[offset + i] = m & 255, i += d, m /= 256, mLen -= 8) { + } + e = e << mLen | m; + eLen += mLen; + for (; eLen > 0; buffer[offset + i] = e & 255, i += d, e /= 256, eLen -= 8) { + } + buffer[offset + i - d] |= s * 128; + }; + } + }); + + // node_modules/buffer/index.js + var require_buffer = __commonJS({ + "node_modules/buffer/index.js"(exports) { + "use strict"; + var base64 = require_base64_js(); + var ieee754 = require_ieee754(); + var customInspectSymbol = typeof Symbol === "function" && typeof Symbol["for"] === "function" ? Symbol["for"]("nodejs.util.inspect.custom") : null; + exports.Buffer = Buffer2; + exports.SlowBuffer = SlowBuffer; + exports.INSPECT_MAX_BYTES = 50; + var K_MAX_LENGTH = 2147483647; + exports.kMaxLength = K_MAX_LENGTH; + Buffer2.TYPED_ARRAY_SUPPORT = typedArraySupport(); + if (!Buffer2.TYPED_ARRAY_SUPPORT && typeof console !== "undefined" && 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 typedArraySupport() { + try { + const arr = new Uint8Array(1); + const proto3 = { foo: function() { + return 42; + } }; + Object.setPrototypeOf(proto3, Uint8Array.prototype); + Object.setPrototypeOf(arr, proto3); + return arr.foo() === 42; + } catch (e) { + return false; + } + } + Object.defineProperty(Buffer2.prototype, "parent", { + enumerable: true, + get: function() { + if (!Buffer2.isBuffer(this)) + return void 0; + return this.buffer; + } + }); + Object.defineProperty(Buffer2.prototype, "offset", { + enumerable: true, + get: function() { + if (!Buffer2.isBuffer(this)) + return void 0; + return this.byteOffset; + } + }); + function createBuffer(length2) { + if (length2 > K_MAX_LENGTH) { + throw new RangeError('The value "' + length2 + '" is invalid for option "size"'); + } + const buf = new Uint8Array(length2); + Object.setPrototypeOf(buf, Buffer2.prototype); + return buf; + } + function Buffer2(arg, encodingOrOffset, length2) { + if (typeof arg === "number") { + if (typeof encodingOrOffset === "string") { + throw new TypeError('The "string" argument must be of type string. Received type number'); + } + return allocUnsafe(arg); + } + return from3(arg, encodingOrOffset, length2); + } + Buffer2.poolSize = 8192; + function from3(value, encodingOrOffset, length2) { + if (typeof value === "string") { + return fromString(value, encodingOrOffset); + } + if (ArrayBuffer.isView(value)) { + return fromArrayView(value); + } + if (value == null) { + throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value); + } + if (isInstance(value, ArrayBuffer) || value && isInstance(value.buffer, ArrayBuffer)) { + return fromArrayBuffer(value, encodingOrOffset, length2); + } + if (typeof SharedArrayBuffer !== "undefined" && (isInstance(value, SharedArrayBuffer) || value && isInstance(value.buffer, SharedArrayBuffer))) { + return fromArrayBuffer(value, encodingOrOffset, length2); + } + if (typeof value === "number") { + throw new TypeError('The "value" argument must not be of type number. Received type number'); + } + const valueOf = value.valueOf && value.valueOf(); + if (valueOf != null && valueOf !== value) { + return Buffer2.from(valueOf, encodingOrOffset, length2); + } + const b = fromObject(value); + if (b) + return b; + if (typeof Symbol !== "undefined" && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === "function") { + return Buffer2.from(value[Symbol.toPrimitive]("string"), encodingOrOffset, length2); + } + throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value); + } + Buffer2.from = function(value, encodingOrOffset, length2) { + return from3(value, encodingOrOffset, length2); + }; + Object.setPrototypeOf(Buffer2.prototype, Uint8Array.prototype); + Object.setPrototypeOf(Buffer2, Uint8Array); + function assertSize(size) { + if (typeof size !== "number") { + throw new TypeError('"size" argument must be of type number'); + } else if (size < 0) { + throw new RangeError('The value "' + size + '" is invalid for option "size"'); + } + } + function alloc(size, fill, encoding) { + assertSize(size); + if (size <= 0) { + return createBuffer(size); + } + if (fill !== void 0) { + return typeof encoding === "string" ? createBuffer(size).fill(fill, encoding) : createBuffer(size).fill(fill); + } + return createBuffer(size); + } + Buffer2.alloc = function(size, fill, encoding) { + return alloc(size, fill, encoding); + }; + function allocUnsafe(size) { + assertSize(size); + return createBuffer(size < 0 ? 0 : checked(size) | 0); + } + Buffer2.allocUnsafe = function(size) { + return allocUnsafe(size); + }; + Buffer2.allocUnsafeSlow = function(size) { + return allocUnsafe(size); + }; + function fromString(string3, encoding) { + if (typeof encoding !== "string" || encoding === "") { + encoding = "utf8"; + } + if (!Buffer2.isEncoding(encoding)) { + throw new TypeError("Unknown encoding: " + encoding); + } + const length2 = byteLength(string3, encoding) | 0; + let buf = createBuffer(length2); + const actual = buf.write(string3, encoding); + if (actual !== length2) { + buf = buf.slice(0, actual); + } + return buf; + } + function fromArrayLike(array) { + const length2 = array.length < 0 ? 0 : checked(array.length) | 0; + const buf = createBuffer(length2); + for (let i = 0; i < length2; i += 1) { + buf[i] = array[i] & 255; + } + return buf; + } + function fromArrayView(arrayView) { + if (isInstance(arrayView, Uint8Array)) { + const copy = new Uint8Array(arrayView); + return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength); + } + return fromArrayLike(arrayView); + } + function fromArrayBuffer(array, byteOffset, length2) { + if (byteOffset < 0 || array.byteLength < byteOffset) { + throw new RangeError('"offset" is outside of buffer bounds'); + } + if (array.byteLength < byteOffset + (length2 || 0)) { + throw new RangeError('"length" is outside of buffer bounds'); + } + let buf; + if (byteOffset === void 0 && length2 === void 0) { + buf = new Uint8Array(array); + } else if (length2 === void 0) { + buf = new Uint8Array(array, byteOffset); + } else { + buf = new Uint8Array(array, byteOffset, length2); + } + Object.setPrototypeOf(buf, Buffer2.prototype); + return buf; + } + function fromObject(obj) { + if (Buffer2.isBuffer(obj)) { + const len = checked(obj.length) | 0; + const buf = createBuffer(len); + if (buf.length === 0) { + return buf; + } + obj.copy(buf, 0, 0, len); + return buf; + } + if (obj.length !== void 0) { + if (typeof obj.length !== "number" || numberIsNaN(obj.length)) { + return createBuffer(0); + } + return fromArrayLike(obj); + } + if (obj.type === "Buffer" && Array.isArray(obj.data)) { + return fromArrayLike(obj.data); + } + } + function checked(length2) { + if (length2 >= K_MAX_LENGTH) { + throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + K_MAX_LENGTH.toString(16) + " bytes"); + } + return length2 | 0; + } + function SlowBuffer(length2) { + if (+length2 != length2) { + length2 = 0; + } + return Buffer2.alloc(+length2); + } + Buffer2.isBuffer = function isBuffer(b) { + return b != null && b._isBuffer === true && b !== Buffer2.prototype; + }; + Buffer2.compare = function compare(a, b) { + if (isInstance(a, Uint8Array)) + a = Buffer2.from(a, a.offset, a.byteLength); + if (isInstance(b, Uint8Array)) + b = Buffer2.from(b, b.offset, b.byteLength); + if (!Buffer2.isBuffer(a) || !Buffer2.isBuffer(b)) { + throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'); + } + if (a === b) + return 0; + let x = a.length; + let y = b.length; + for (let i = 0, len = Math.min(x, y); i < len; ++i) { + if (a[i] !== b[i]) { + x = a[i]; + y = b[i]; + break; + } + } + if (x < y) + return -1; + if (y < x) + return 1; + return 0; + }; + Buffer2.isEncoding = function isEncoding(encoding) { + switch (String(encoding).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 true; + default: + return false; + } + }; + Buffer2.concat = function concat(list, length2) { + if (!Array.isArray(list)) { + throw new TypeError('"list" argument must be an Array of Buffers'); + } + if (list.length === 0) { + return Buffer2.alloc(0); + } + let i; + if (length2 === void 0) { + length2 = 0; + for (i = 0; i < list.length; ++i) { + length2 += list[i].length; + } + } + const buffer = Buffer2.allocUnsafe(length2); + let pos = 0; + for (i = 0; i < list.length; ++i) { + let buf = list[i]; + if (isInstance(buf, Uint8Array)) { + if (pos + buf.length > buffer.length) { + if (!Buffer2.isBuffer(buf)) + buf = Buffer2.from(buf); + buf.copy(buffer, pos); + } else { + Uint8Array.prototype.set.call(buffer, buf, pos); + } + } else if (!Buffer2.isBuffer(buf)) { + throw new TypeError('"list" argument must be an Array of Buffers'); + } else { + buf.copy(buffer, pos); + } + pos += buf.length; + } + return buffer; + }; + function byteLength(string3, encoding) { + if (Buffer2.isBuffer(string3)) { + return string3.length; + } + if (ArrayBuffer.isView(string3) || isInstance(string3, ArrayBuffer)) { + return string3.byteLength; + } + if (typeof string3 !== "string") { + throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof string3); + } + const len = string3.length; + const mustMatch = arguments.length > 2 && arguments[2] === true; + if (!mustMatch && len === 0) + return 0; + let loweredCase = false; + for (; ; ) { + switch (encoding) { + case "ascii": + case "latin1": + case "binary": + return len; + case "utf8": + case "utf-8": + return utf8ToBytes(string3).length; + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return len * 2; + case "hex": + return len >>> 1; + case "base64": + return base64ToBytes(string3).length; + default: + if (loweredCase) { + return mustMatch ? -1 : utf8ToBytes(string3).length; + } + encoding = ("" + encoding).toLowerCase(); + loweredCase = true; + } + } + } + Buffer2.byteLength = byteLength; + function slowToString(encoding, start, end) { + let loweredCase = false; + if (start === void 0 || start < 0) { + start = 0; + } + if (start > this.length) { + return ""; + } + if (end === void 0 || end > this.length) { + end = this.length; + } + if (end <= 0) { + return ""; + } + end >>>= 0; + start >>>= 0; + if (end <= start) { + return ""; + } + if (!encoding) + encoding = "utf8"; + while (true) { + switch (encoding) { + case "hex": + return hexSlice(this, start, end); + case "utf8": + case "utf-8": + return utf8Slice(this, start, end); + case "ascii": + return asciiSlice(this, start, end); + case "latin1": + case "binary": + return latin1Slice(this, start, end); + case "base64": + return base64Slice(this, start, end); + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return utf16leSlice(this, start, end); + default: + if (loweredCase) + throw new TypeError("Unknown encoding: " + encoding); + encoding = (encoding + "").toLowerCase(); + loweredCase = true; + } + } + } + Buffer2.prototype._isBuffer = true; + function swap(b, n, m) { + const i = b[n]; + b[n] = b[m]; + b[m] = i; + } + Buffer2.prototype.swap16 = function swap16() { + const len = this.length; + if (len % 2 !== 0) { + throw new RangeError("Buffer size must be a multiple of 16-bits"); + } + for (let i = 0; i < len; i += 2) { + swap(this, i, i + 1); + } + return this; + }; + Buffer2.prototype.swap32 = function swap32() { + const len = this.length; + if (len % 4 !== 0) { + throw new RangeError("Buffer size must be a multiple of 32-bits"); + } + for (let i = 0; i < len; i += 4) { + swap(this, i, i + 3); + swap(this, i + 1, i + 2); + } + return this; + }; + Buffer2.prototype.swap64 = function swap64() { + const len = this.length; + if (len % 8 !== 0) { + throw new RangeError("Buffer size must be a multiple of 64-bits"); + } + for (let i = 0; i < len; i += 8) { + swap(this, i, i + 7); + swap(this, i + 1, i + 6); + swap(this, i + 2, i + 5); + swap(this, i + 3, i + 4); + } + return this; + }; + Buffer2.prototype.toString = function toString() { + const length2 = this.length; + if (length2 === 0) + return ""; + if (arguments.length === 0) + return utf8Slice(this, 0, length2); + return slowToString.apply(this, arguments); + }; + Buffer2.prototype.toLocaleString = Buffer2.prototype.toString; + Buffer2.prototype.equals = function equals3(b) { + if (!Buffer2.isBuffer(b)) + throw new TypeError("Argument must be a Buffer"); + if (this === b) + return true; + return Buffer2.compare(this, b) === 0; + }; + Buffer2.prototype.inspect = function inspect() { + let str = ""; + const max = exports.INSPECT_MAX_BYTES; + str = this.toString("hex", 0, max).replace(/(.{2})/g, "$1 ").trim(); + if (this.length > max) + str += " ... "; + return ""; + }; + if (customInspectSymbol) { + Buffer2.prototype[customInspectSymbol] = Buffer2.prototype.inspect; + } + Buffer2.prototype.compare = function compare(target, start, end, thisStart, thisEnd) { + if (isInstance(target, Uint8Array)) { + target = Buffer2.from(target, target.offset, target.byteLength); + } + if (!Buffer2.isBuffer(target)) { + throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof target); + } + if (start === void 0) { + start = 0; + } + if (end === void 0) { + end = target ? target.length : 0; + } + if (thisStart === void 0) { + thisStart = 0; + } + if (thisEnd === void 0) { + thisEnd = this.length; + } + if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { + throw new RangeError("out of range index"); + } + if (thisStart >= thisEnd && start >= end) { + return 0; + } + if (thisStart >= thisEnd) { + return -1; + } + if (start >= end) { + return 1; + } + start >>>= 0; + end >>>= 0; + thisStart >>>= 0; + thisEnd >>>= 0; + if (this === target) + return 0; + let x = thisEnd - thisStart; + let y = end - start; + const len = Math.min(x, y); + const thisCopy = this.slice(thisStart, thisEnd); + const targetCopy = target.slice(start, end); + for (let i = 0; i < len; ++i) { + if (thisCopy[i] !== targetCopy[i]) { + x = thisCopy[i]; + y = targetCopy[i]; + break; + } + } + if (x < y) + return -1; + if (y < x) + return 1; + return 0; + }; + function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) { + if (buffer.length === 0) + return -1; + if (typeof byteOffset === "string") { + encoding = byteOffset; + byteOffset = 0; + } else if (byteOffset > 2147483647) { + byteOffset = 2147483647; + } else if (byteOffset < -2147483648) { + byteOffset = -2147483648; + } + byteOffset = +byteOffset; + if (numberIsNaN(byteOffset)) { + byteOffset = dir ? 0 : buffer.length - 1; + } + if (byteOffset < 0) + byteOffset = buffer.length + byteOffset; + if (byteOffset >= buffer.length) { + if (dir) + return -1; + else + byteOffset = buffer.length - 1; + } else if (byteOffset < 0) { + if (dir) + byteOffset = 0; + else + return -1; + } + if (typeof val === "string") { + val = Buffer2.from(val, encoding); + } + if (Buffer2.isBuffer(val)) { + if (val.length === 0) { + return -1; + } + return arrayIndexOf(buffer, val, byteOffset, encoding, dir); + } else if (typeof val === "number") { + val = val & 255; + if (typeof Uint8Array.prototype.indexOf === "function") { + if (dir) { + return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset); + } else { + return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset); + } + } + return arrayIndexOf(buffer, [val], byteOffset, encoding, dir); + } + throw new TypeError("val must be string, number or Buffer"); + } + function arrayIndexOf(arr, val, byteOffset, encoding, dir) { + let indexSize = 1; + let arrLength = arr.length; + let valLength = val.length; + if (encoding !== void 0) { + encoding = String(encoding).toLowerCase(); + if (encoding === "ucs2" || encoding === "ucs-2" || encoding === "utf16le" || encoding === "utf-16le") { + if (arr.length < 2 || val.length < 2) { + return -1; + } + indexSize = 2; + arrLength /= 2; + valLength /= 2; + byteOffset /= 2; + } + } + function read2(buf, i2) { + if (indexSize === 1) { + return buf[i2]; + } else { + return buf.readUInt16BE(i2 * indexSize); + } + } + let i; + if (dir) { + let foundIndex = -1; + for (i = byteOffset; i < arrLength; i++) { + if (read2(arr, i) === read2(val, foundIndex === -1 ? 0 : i - foundIndex)) { + if (foundIndex === -1) + foundIndex = i; + if (i - foundIndex + 1 === valLength) + return foundIndex * indexSize; + } else { + if (foundIndex !== -1) + i -= i - foundIndex; + foundIndex = -1; + } + } + } else { + if (byteOffset + valLength > arrLength) + byteOffset = arrLength - valLength; + for (i = byteOffset; i >= 0; i--) { + let found = true; + for (let j = 0; j < valLength; j++) { + if (read2(arr, i + j) !== read2(val, j)) { + found = false; + break; + } + } + if (found) + return i; + } + } + return -1; + } + Buffer2.prototype.includes = function includes(val, byteOffset, encoding) { + return this.indexOf(val, byteOffset, encoding) !== -1; + }; + Buffer2.prototype.indexOf = function indexOf(val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, true); + }; + Buffer2.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, false); + }; + function hexWrite(buf, string3, offset, length2) { + offset = Number(offset) || 0; + const remaining = buf.length - offset; + if (!length2) { + length2 = remaining; + } else { + length2 = Number(length2); + if (length2 > remaining) { + length2 = remaining; + } + } + const strLen = string3.length; + if (length2 > strLen / 2) { + length2 = strLen / 2; + } + let i; + for (i = 0; i < length2; ++i) { + const parsed = parseInt(string3.substr(i * 2, 2), 16); + if (numberIsNaN(parsed)) + return i; + buf[offset + i] = parsed; + } + return i; + } + function utf8Write(buf, string3, offset, length2) { + return blitBuffer(utf8ToBytes(string3, buf.length - offset), buf, offset, length2); + } + function asciiWrite(buf, string3, offset, length2) { + return blitBuffer(asciiToBytes(string3), buf, offset, length2); + } + function base64Write(buf, string3, offset, length2) { + return blitBuffer(base64ToBytes(string3), buf, offset, length2); + } + function ucs2Write(buf, string3, offset, length2) { + return blitBuffer(utf16leToBytes(string3, buf.length - offset), buf, offset, length2); + } + Buffer2.prototype.write = function write(string3, offset, length2, encoding) { + if (offset === void 0) { + encoding = "utf8"; + length2 = this.length; + offset = 0; + } else if (length2 === void 0 && typeof offset === "string") { + encoding = offset; + length2 = this.length; + offset = 0; + } else if (isFinite(offset)) { + offset = offset >>> 0; + if (isFinite(length2)) { + length2 = length2 >>> 0; + if (encoding === void 0) + encoding = "utf8"; + } else { + encoding = length2; + length2 = void 0; + } + } else { + throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported"); + } + const remaining = this.length - offset; + if (length2 === void 0 || length2 > remaining) + length2 = remaining; + if (string3.length > 0 && (length2 < 0 || offset < 0) || offset > this.length) { + throw new RangeError("Attempt to write outside buffer bounds"); + } + if (!encoding) + encoding = "utf8"; + let loweredCase = false; + for (; ; ) { + switch (encoding) { + case "hex": + return hexWrite(this, string3, offset, length2); + case "utf8": + case "utf-8": + return utf8Write(this, string3, offset, length2); + case "ascii": + case "latin1": + case "binary": + return asciiWrite(this, string3, offset, length2); + case "base64": + return base64Write(this, string3, offset, length2); + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return ucs2Write(this, string3, offset, length2); + default: + if (loweredCase) + throw new TypeError("Unknown encoding: " + encoding); + encoding = ("" + encoding).toLowerCase(); + loweredCase = true; + } + } + }; + Buffer2.prototype.toJSON = function toJSON() { + return { + type: "Buffer", + data: Array.prototype.slice.call(this._arr || this, 0) + }; + }; + function base64Slice(buf, start, end) { + if (start === 0 && end === buf.length) { + return base64.fromByteArray(buf); + } else { + return base64.fromByteArray(buf.slice(start, end)); + } + } + function utf8Slice(buf, start, end) { + end = Math.min(buf.length, end); + const res = []; + let i = start; + while (i < end) { + const firstByte = buf[i]; + let codePoint = null; + let bytesPerSequence = firstByte > 239 ? 4 : firstByte > 223 ? 3 : firstByte > 191 ? 2 : 1; + if (i + bytesPerSequence <= end) { + let secondByte, thirdByte, fourthByte, tempCodePoint; + switch (bytesPerSequence) { + case 1: + if (firstByte < 128) { + codePoint = firstByte; + } + break; + case 2: + secondByte = buf[i + 1]; + if ((secondByte & 192) === 128) { + tempCodePoint = (firstByte & 31) << 6 | secondByte & 63; + if (tempCodePoint > 127) { + codePoint = tempCodePoint; + } + } + break; + case 3: + secondByte = buf[i + 1]; + thirdByte = buf[i + 2]; + if ((secondByte & 192) === 128 && (thirdByte & 192) === 128) { + tempCodePoint = (firstByte & 15) << 12 | (secondByte & 63) << 6 | thirdByte & 63; + if (tempCodePoint > 2047 && (tempCodePoint < 55296 || tempCodePoint > 57343)) { + codePoint = tempCodePoint; + } + } + break; + case 4: + secondByte = buf[i + 1]; + thirdByte = buf[i + 2]; + fourthByte = buf[i + 3]; + if ((secondByte & 192) === 128 && (thirdByte & 192) === 128 && (fourthByte & 192) === 128) { + tempCodePoint = (firstByte & 15) << 18 | (secondByte & 63) << 12 | (thirdByte & 63) << 6 | fourthByte & 63; + if (tempCodePoint > 65535 && tempCodePoint < 1114112) { + codePoint = tempCodePoint; + } + } + } + } + if (codePoint === null) { + codePoint = 65533; + bytesPerSequence = 1; + } else if (codePoint > 65535) { + codePoint -= 65536; + res.push(codePoint >>> 10 & 1023 | 55296); + codePoint = 56320 | codePoint & 1023; + } + res.push(codePoint); + i += bytesPerSequence; + } + return decodeCodePointsArray(res); + } + var MAX_ARGUMENTS_LENGTH = 4096; + function decodeCodePointsArray(codePoints) { + const len = codePoints.length; + if (len <= MAX_ARGUMENTS_LENGTH) { + return String.fromCharCode.apply(String, codePoints); + } + let res = ""; + let i = 0; + while (i < len) { + res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)); + } + return res; + } + function asciiSlice(buf, start, end) { + let ret = ""; + end = Math.min(buf.length, end); + for (let i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i] & 127); + } + return ret; + } + function latin1Slice(buf, start, end) { + let ret = ""; + end = Math.min(buf.length, end); + for (let i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i]); + } + return ret; + } + function hexSlice(buf, start, end) { + const len = buf.length; + if (!start || start < 0) + start = 0; + if (!end || end < 0 || end > len) + end = len; + let out = ""; + for (let i = start; i < end; ++i) { + out += hexSliceLookupTable[buf[i]]; + } + return out; + } + function utf16leSlice(buf, start, end) { + const bytes = buf.slice(start, end); + let res = ""; + for (let i = 0; i < bytes.length - 1; i += 2) { + res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256); + } + return res; + } + Buffer2.prototype.slice = function slice(start, end) { + const len = this.length; + start = ~~start; + end = end === void 0 ? len : ~~end; + if (start < 0) { + start += len; + if (start < 0) + start = 0; + } else if (start > len) { + start = len; + } + if (end < 0) { + end += len; + if (end < 0) + end = 0; + } else if (end > len) { + end = len; + } + if (end < start) + end = start; + const newBuf = this.subarray(start, end); + Object.setPrototypeOf(newBuf, Buffer2.prototype); + return newBuf; + }; + function checkOffset(offset, ext, length2) { + if (offset % 1 !== 0 || offset < 0) + throw new RangeError("offset is not uint"); + if (offset + ext > length2) + throw new RangeError("Trying to access beyond buffer length"); + } + Buffer2.prototype.readUintLE = Buffer2.prototype.readUIntLE = function readUIntLE(offset, byteLength2, noAssert) { + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) + checkOffset(offset, byteLength2, this.length); + let val = this[offset]; + let mul = 1; + let i = 0; + while (++i < byteLength2 && (mul *= 256)) { + val += this[offset + i] * mul; + } + return val; + }; + Buffer2.prototype.readUintBE = Buffer2.prototype.readUIntBE = function readUIntBE(offset, byteLength2, noAssert) { + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) { + checkOffset(offset, byteLength2, this.length); + } + let val = this[offset + --byteLength2]; + let mul = 1; + while (byteLength2 > 0 && (mul *= 256)) { + val += this[offset + --byteLength2] * mul; + } + return val; + }; + Buffer2.prototype.readUint8 = Buffer2.prototype.readUInt8 = function readUInt8(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 1, this.length); + return this[offset]; + }; + Buffer2.prototype.readUint16LE = Buffer2.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 2, this.length); + return this[offset] | this[offset + 1] << 8; + }; + Buffer2.prototype.readUint16BE = Buffer2.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 2, this.length); + return this[offset] << 8 | this[offset + 1]; + }; + Buffer2.prototype.readUint32LE = Buffer2.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 16777216; + }; + Buffer2.prototype.readUint32BE = Buffer2.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return this[offset] * 16777216 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]); + }; + Buffer2.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE(offset) { + offset = offset >>> 0; + validateNumber(offset, "offset"); + const first = this[offset]; + const last = this[offset + 7]; + if (first === void 0 || last === void 0) { + boundsError(offset, this.length - 8); + } + const lo = first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24; + const hi = this[++offset] + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + last * 2 ** 24; + return BigInt(lo) + (BigInt(hi) << BigInt(32)); + }); + Buffer2.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE(offset) { + offset = offset >>> 0; + validateNumber(offset, "offset"); + const first = this[offset]; + const last = this[offset + 7]; + if (first === void 0 || last === void 0) { + boundsError(offset, this.length - 8); + } + const hi = first * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset]; + const lo = this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last; + return (BigInt(hi) << BigInt(32)) + BigInt(lo); + }); + Buffer2.prototype.readIntLE = function readIntLE(offset, byteLength2, noAssert) { + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) + checkOffset(offset, byteLength2, this.length); + let val = this[offset]; + let mul = 1; + let i = 0; + while (++i < byteLength2 && (mul *= 256)) { + val += this[offset + i] * mul; + } + mul *= 128; + if (val >= mul) + val -= Math.pow(2, 8 * byteLength2); + return val; + }; + Buffer2.prototype.readIntBE = function readIntBE(offset, byteLength2, noAssert) { + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) + checkOffset(offset, byteLength2, this.length); + let i = byteLength2; + let mul = 1; + let val = this[offset + --i]; + while (i > 0 && (mul *= 256)) { + val += this[offset + --i] * mul; + } + mul *= 128; + if (val >= mul) + val -= Math.pow(2, 8 * byteLength2); + return val; + }; + Buffer2.prototype.readInt8 = function readInt8(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 1, this.length); + if (!(this[offset] & 128)) + return this[offset]; + return (255 - this[offset] + 1) * -1; + }; + Buffer2.prototype.readInt16LE = function readInt16LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 2, this.length); + const val = this[offset] | this[offset + 1] << 8; + return val & 32768 ? val | 4294901760 : val; + }; + Buffer2.prototype.readInt16BE = function readInt16BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 2, this.length); + const val = this[offset + 1] | this[offset] << 8; + return val & 32768 ? val | 4294901760 : val; + }; + Buffer2.prototype.readInt32LE = function readInt32LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24; + }; + Buffer2.prototype.readInt32BE = function readInt32BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]; + }; + Buffer2.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE(offset) { + offset = offset >>> 0; + validateNumber(offset, "offset"); + const first = this[offset]; + const last = this[offset + 7]; + if (first === void 0 || last === void 0) { + boundsError(offset, this.length - 8); + } + const val = this[offset + 4] + this[offset + 5] * 2 ** 8 + this[offset + 6] * 2 ** 16 + (last << 24); + return (BigInt(val) << BigInt(32)) + BigInt(first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24); + }); + Buffer2.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE(offset) { + offset = offset >>> 0; + validateNumber(offset, "offset"); + const first = this[offset]; + const last = this[offset + 7]; + if (first === void 0 || last === void 0) { + boundsError(offset, this.length - 8); + } + const val = (first << 24) + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset]; + return (BigInt(val) << BigInt(32)) + BigInt(this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last); + }); + Buffer2.prototype.readFloatLE = function readFloatLE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return ieee754.read(this, offset, true, 23, 4); + }; + Buffer2.prototype.readFloatBE = function readFloatBE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return ieee754.read(this, offset, false, 23, 4); + }; + Buffer2.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 8, this.length); + return ieee754.read(this, offset, true, 52, 8); + }; + Buffer2.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 8, this.length); + return ieee754.read(this, offset, false, 52, 8); + }; + function checkInt(buf, value, offset, ext, max, min) { + if (!Buffer2.isBuffer(buf)) + throw new TypeError('"buffer" argument must be a Buffer instance'); + if (value > max || value < min) + throw new RangeError('"value" argument is out of bounds'); + if (offset + ext > buf.length) + throw new RangeError("Index out of range"); + } + Buffer2.prototype.writeUintLE = Buffer2.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength2, noAssert) { + value = +value; + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) { + const maxBytes = Math.pow(2, 8 * byteLength2) - 1; + checkInt(this, value, offset, byteLength2, maxBytes, 0); + } + let mul = 1; + let i = 0; + this[offset] = value & 255; + while (++i < byteLength2 && (mul *= 256)) { + this[offset + i] = value / mul & 255; + } + return offset + byteLength2; + }; + Buffer2.prototype.writeUintBE = Buffer2.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength2, noAssert) { + value = +value; + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) { + const maxBytes = Math.pow(2, 8 * byteLength2) - 1; + checkInt(this, value, offset, byteLength2, maxBytes, 0); + } + let i = byteLength2 - 1; + let mul = 1; + this[offset + i] = value & 255; + while (--i >= 0 && (mul *= 256)) { + this[offset + i] = value / mul & 255; + } + return offset + byteLength2; + }; + Buffer2.prototype.writeUint8 = Buffer2.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 1, 255, 0); + this[offset] = value & 255; + return offset + 1; + }; + Buffer2.prototype.writeUint16LE = Buffer2.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 2, 65535, 0); + this[offset] = value & 255; + this[offset + 1] = value >>> 8; + return offset + 2; + }; + Buffer2.prototype.writeUint16BE = Buffer2.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 2, 65535, 0); + this[offset] = value >>> 8; + this[offset + 1] = value & 255; + return offset + 2; + }; + Buffer2.prototype.writeUint32LE = Buffer2.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 4, 4294967295, 0); + this[offset + 3] = value >>> 24; + this[offset + 2] = value >>> 16; + this[offset + 1] = value >>> 8; + this[offset] = value & 255; + return offset + 4; + }; + Buffer2.prototype.writeUint32BE = Buffer2.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 4, 4294967295, 0); + this[offset] = value >>> 24; + this[offset + 1] = value >>> 16; + this[offset + 2] = value >>> 8; + this[offset + 3] = value & 255; + return offset + 4; + }; + function wrtBigUInt64LE(buf, value, offset, min, max) { + checkIntBI(value, min, max, buf, offset, 7); + let lo = Number(value & BigInt(4294967295)); + buf[offset++] = lo; + lo = lo >> 8; + buf[offset++] = lo; + lo = lo >> 8; + buf[offset++] = lo; + lo = lo >> 8; + buf[offset++] = lo; + let hi = Number(value >> BigInt(32) & BigInt(4294967295)); + buf[offset++] = hi; + hi = hi >> 8; + buf[offset++] = hi; + hi = hi >> 8; + buf[offset++] = hi; + hi = hi >> 8; + buf[offset++] = hi; + return offset; + } + function wrtBigUInt64BE(buf, value, offset, min, max) { + checkIntBI(value, min, max, buf, offset, 7); + let lo = Number(value & BigInt(4294967295)); + buf[offset + 7] = lo; + lo = lo >> 8; + buf[offset + 6] = lo; + lo = lo >> 8; + buf[offset + 5] = lo; + lo = lo >> 8; + buf[offset + 4] = lo; + let hi = Number(value >> BigInt(32) & BigInt(4294967295)); + buf[offset + 3] = hi; + hi = hi >> 8; + buf[offset + 2] = hi; + hi = hi >> 8; + buf[offset + 1] = hi; + hi = hi >> 8; + buf[offset] = hi; + return offset + 8; + } + Buffer2.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE(value, offset = 0) { + return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt("0xffffffffffffffff")); + }); + Buffer2.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE(value, offset = 0) { + return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt("0xffffffffffffffff")); + }); + Buffer2.prototype.writeIntLE = function writeIntLE(value, offset, byteLength2, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + const limit = Math.pow(2, 8 * byteLength2 - 1); + checkInt(this, value, offset, byteLength2, limit - 1, -limit); + } + let i = 0; + let mul = 1; + let sub = 0; + this[offset] = value & 255; + while (++i < byteLength2 && (mul *= 256)) { + if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { + sub = 1; + } + this[offset + i] = (value / mul >> 0) - sub & 255; + } + return offset + byteLength2; + }; + Buffer2.prototype.writeIntBE = function writeIntBE(value, offset, byteLength2, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + const limit = Math.pow(2, 8 * byteLength2 - 1); + checkInt(this, value, offset, byteLength2, limit - 1, -limit); + } + let i = byteLength2 - 1; + let mul = 1; + let sub = 0; + this[offset + i] = value & 255; + while (--i >= 0 && (mul *= 256)) { + if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { + sub = 1; + } + this[offset + i] = (value / mul >> 0) - sub & 255; + } + return offset + byteLength2; + }; + Buffer2.prototype.writeInt8 = function writeInt8(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 1, 127, -128); + if (value < 0) + value = 255 + value + 1; + this[offset] = value & 255; + return offset + 1; + }; + Buffer2.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 2, 32767, -32768); + this[offset] = value & 255; + this[offset + 1] = value >>> 8; + return offset + 2; + }; + Buffer2.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 2, 32767, -32768); + this[offset] = value >>> 8; + this[offset + 1] = value & 255; + return offset + 2; + }; + Buffer2.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 4, 2147483647, -2147483648); + this[offset] = value & 255; + this[offset + 1] = value >>> 8; + this[offset + 2] = value >>> 16; + this[offset + 3] = value >>> 24; + return offset + 4; + }; + Buffer2.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 4, 2147483647, -2147483648); + if (value < 0) + value = 4294967295 + value + 1; + this[offset] = value >>> 24; + this[offset + 1] = value >>> 16; + this[offset + 2] = value >>> 8; + this[offset + 3] = value & 255; + return offset + 4; + }; + Buffer2.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE(value, offset = 0) { + return wrtBigUInt64LE(this, value, offset, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff")); + }); + Buffer2.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE(value, offset = 0) { + return wrtBigUInt64BE(this, value, offset, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff")); + }); + function checkIEEE754(buf, value, offset, ext, max, min) { + if (offset + ext > buf.length) + throw new RangeError("Index out of range"); + if (offset < 0) + throw new RangeError("Index out of range"); + } + function writeFloat(buf, value, offset, littleEndian, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + checkIEEE754(buf, value, offset, 4, 34028234663852886e22, -34028234663852886e22); + } + ieee754.write(buf, value, offset, littleEndian, 23, 4); + return offset + 4; + } + Buffer2.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) { + return writeFloat(this, value, offset, true, noAssert); + }; + Buffer2.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) { + return writeFloat(this, value, offset, false, noAssert); + }; + function writeDouble(buf, value, offset, littleEndian, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + checkIEEE754(buf, value, offset, 8, 17976931348623157e292, -17976931348623157e292); + } + ieee754.write(buf, value, offset, littleEndian, 52, 8); + return offset + 8; + } + Buffer2.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) { + return writeDouble(this, value, offset, true, noAssert); + }; + Buffer2.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) { + return writeDouble(this, value, offset, false, noAssert); + }; + Buffer2.prototype.copy = function copy(target, targetStart, start, end) { + if (!Buffer2.isBuffer(target)) + throw new TypeError("argument should be a Buffer"); + if (!start) + start = 0; + if (!end && end !== 0) + end = this.length; + if (targetStart >= target.length) + targetStart = target.length; + if (!targetStart) + targetStart = 0; + if (end > 0 && end < start) + end = start; + if (end === start) + return 0; + if (target.length === 0 || this.length === 0) + return 0; + if (targetStart < 0) { + throw new RangeError("targetStart out of bounds"); + } + if (start < 0 || start >= this.length) + throw new RangeError("Index out of range"); + if (end < 0) + throw new RangeError("sourceEnd out of bounds"); + if (end > this.length) + end = this.length; + if (target.length - targetStart < end - start) { + end = target.length - targetStart + start; + } + const len = end - start; + if (this === target && typeof Uint8Array.prototype.copyWithin === "function") { + this.copyWithin(targetStart, start, end); + } else { + Uint8Array.prototype.set.call(target, this.subarray(start, end), targetStart); + } + return len; + }; + Buffer2.prototype.fill = function fill(val, start, end, encoding) { + if (typeof val === "string") { + if (typeof start === "string") { + encoding = start; + start = 0; + end = this.length; + } else if (typeof end === "string") { + encoding = end; + end = this.length; + } + if (encoding !== void 0 && typeof encoding !== "string") { + throw new TypeError("encoding must be a string"); + } + if (typeof encoding === "string" && !Buffer2.isEncoding(encoding)) { + throw new TypeError("Unknown encoding: " + encoding); + } + if (val.length === 1) { + const code = val.charCodeAt(0); + if (encoding === "utf8" && code < 128 || encoding === "latin1") { + val = code; + } + } + } else if (typeof val === "number") { + val = val & 255; + } else if (typeof val === "boolean") { + val = Number(val); + } + if (start < 0 || this.length < start || this.length < end) { + throw new RangeError("Out of range index"); + } + if (end <= start) { + return this; + } + start = start >>> 0; + end = end === void 0 ? this.length : end >>> 0; + if (!val) + val = 0; + let i; + if (typeof val === "number") { + for (i = start; i < end; ++i) { + this[i] = val; + } + } else { + const bytes = Buffer2.isBuffer(val) ? val : Buffer2.from(val, encoding); + const len = bytes.length; + if (len === 0) { + throw new TypeError('The value "' + val + '" is invalid for argument "value"'); + } + for (i = 0; i < end - start; ++i) { + this[i + start] = bytes[i % len]; + } + } + return this; + }; + var errors = {}; + function E(sym, getMessage, Base) { + errors[sym] = class NodeError extends Base { + constructor() { + super(); + Object.defineProperty(this, "message", { + value: getMessage.apply(this, arguments), + writable: true, + configurable: true + }); + this.name = `${this.name} [${sym}]`; + this.stack; + delete this.name; + } + get code() { + return sym; + } + set code(value) { + Object.defineProperty(this, "code", { + configurable: true, + enumerable: true, + value, + writable: true + }); + } + toString() { + return `${this.name} [${sym}]: ${this.message}`; + } + }; + } + E("ERR_BUFFER_OUT_OF_BOUNDS", function(name) { + if (name) { + return `${name} is outside of buffer bounds`; + } + return "Attempt to access memory outside buffer bounds"; + }, RangeError); + E("ERR_INVALID_ARG_TYPE", function(name, actual) { + return `The "${name}" argument must be of type number. Received type ${typeof actual}`; + }, TypeError); + E("ERR_OUT_OF_RANGE", function(str, range, input) { + let msg = `The value of "${str}" is out of range.`; + let received = input; + if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) { + received = addNumericalSeparator(String(input)); + } else if (typeof input === "bigint") { + received = String(input); + if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) { + received = addNumericalSeparator(received); + } + received += "n"; + } + msg += ` It must be ${range}. Received ${received}`; + return msg; + }, RangeError); + function addNumericalSeparator(val) { + let res = ""; + let i = val.length; + const start = val[0] === "-" ? 1 : 0; + for (; i >= start + 4; i -= 3) { + res = `_${val.slice(i - 3, i)}${res}`; + } + return `${val.slice(0, i)}${res}`; + } + function checkBounds(buf, offset, byteLength2) { + validateNumber(offset, "offset"); + if (buf[offset] === void 0 || buf[offset + byteLength2] === void 0) { + boundsError(offset, buf.length - (byteLength2 + 1)); + } + } + function checkIntBI(value, min, max, buf, offset, byteLength2) { + if (value > max || value < min) { + const n = typeof min === "bigint" ? "n" : ""; + let range; + if (byteLength2 > 3) { + if (min === 0 || min === BigInt(0)) { + range = `>= 0${n} and < 2${n} ** ${(byteLength2 + 1) * 8}${n}`; + } else { + range = `>= -(2${n} ** ${(byteLength2 + 1) * 8 - 1}${n}) and < 2 ** ${(byteLength2 + 1) * 8 - 1}${n}`; + } + } else { + range = `>= ${min}${n} and <= ${max}${n}`; + } + throw new errors.ERR_OUT_OF_RANGE("value", range, value); + } + checkBounds(buf, offset, byteLength2); + } + function validateNumber(value, name) { + if (typeof value !== "number") { + throw new errors.ERR_INVALID_ARG_TYPE(name, "number", value); + } + } + function boundsError(value, length2, type) { + if (Math.floor(value) !== value) { + validateNumber(value, type); + throw new errors.ERR_OUT_OF_RANGE(type || "offset", "an integer", value); + } + if (length2 < 0) { + throw new errors.ERR_BUFFER_OUT_OF_BOUNDS(); + } + throw new errors.ERR_OUT_OF_RANGE(type || "offset", `>= ${type ? 1 : 0} and <= ${length2}`, value); + } + var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g; + function base64clean(str) { + str = str.split("=")[0]; + str = str.trim().replace(INVALID_BASE64_RE, ""); + if (str.length < 2) + return ""; + while (str.length % 4 !== 0) { + str = str + "="; + } + return str; + } + function utf8ToBytes(string3, units) { + units = units || Infinity; + let codePoint; + const length2 = string3.length; + let leadSurrogate = null; + const bytes = []; + for (let i = 0; i < length2; ++i) { + codePoint = string3.charCodeAt(i); + if (codePoint > 55295 && codePoint < 57344) { + if (!leadSurrogate) { + if (codePoint > 56319) { + if ((units -= 3) > -1) + bytes.push(239, 191, 189); + continue; + } else if (i + 1 === length2) { + if ((units -= 3) > -1) + bytes.push(239, 191, 189); + continue; + } + leadSurrogate = codePoint; + continue; + } + if (codePoint < 56320) { + if ((units -= 3) > -1) + bytes.push(239, 191, 189); + leadSurrogate = codePoint; + continue; + } + codePoint = (leadSurrogate - 55296 << 10 | codePoint - 56320) + 65536; + } else if (leadSurrogate) { + if ((units -= 3) > -1) + bytes.push(239, 191, 189); + } + leadSurrogate = null; + if (codePoint < 128) { + if ((units -= 1) < 0) + break; + bytes.push(codePoint); + } else if (codePoint < 2048) { + if ((units -= 2) < 0) + break; + bytes.push(codePoint >> 6 | 192, codePoint & 63 | 128); + } else if (codePoint < 65536) { + if ((units -= 3) < 0) + break; + bytes.push(codePoint >> 12 | 224, codePoint >> 6 & 63 | 128, codePoint & 63 | 128); + } else if (codePoint < 1114112) { + if ((units -= 4) < 0) + break; + bytes.push(codePoint >> 18 | 240, codePoint >> 12 & 63 | 128, codePoint >> 6 & 63 | 128, codePoint & 63 | 128); + } else { + throw new Error("Invalid code point"); + } + } + return bytes; + } + function asciiToBytes(str) { + const byteArray = []; + for (let i = 0; i < str.length; ++i) { + byteArray.push(str.charCodeAt(i) & 255); + } + return byteArray; + } + function utf16leToBytes(str, units) { + let c, hi, lo; + const byteArray = []; + for (let i = 0; i < str.length; ++i) { + if ((units -= 2) < 0) + break; + c = str.charCodeAt(i); + hi = c >> 8; + lo = c % 256; + byteArray.push(lo); + byteArray.push(hi); + } + return byteArray; + } + function base64ToBytes(str) { + return base64.toByteArray(base64clean(str)); + } + function blitBuffer(src2, dst, offset, length2) { + let i; + for (i = 0; i < length2; ++i) { + if (i + offset >= dst.length || i >= src2.length) + break; + dst[i + offset] = src2[i]; + } + return i; + } + function isInstance(obj, type) { + return obj instanceof type || obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type.name; + } + function numberIsNaN(obj) { + return obj !== obj; + } + var hexSliceLookupTable = function() { + const alphabet = "0123456789abcdef"; + const table = new Array(256); + for (let i = 0; i < 16; ++i) { + const i16 = i * 16; + for (let j = 0; j < 16; ++j) { + table[i16 + j] = alphabet[i] + alphabet[j]; + } + } + return table; + }(); + function defineBigIntMethod(fn) { + return typeof BigInt === "undefined" ? BufferBigIntNotDefined : fn; + } + function BufferBigIntNotDefined() { + throw new Error("BigInt not supported"); + } + } + }); + + // (disabled):crypto + var require_crypto = __commonJS({ + "(disabled):crypto"() { + } + }); + + // node_modules/tweetnacl/nacl-fast.js + var require_nacl_fast = __commonJS({ + "node_modules/tweetnacl/nacl-fast.js"(exports, module) { + (function(nacl2) { + "use strict"; + var gf = function(init2) { + var i, r = new Float64Array(16); + if (init2) + for (i = 0; i < init2.length; i++) + r[i] = init2[i]; + return r; + }; + var randombytes = function() { + throw new Error("no PRNG"); + }; + var _0 = new Uint8Array(16); + var _9 = new Uint8Array(32); + _9[0] = 9; + var gf0 = gf(), gf1 = gf([1]), _121665 = gf([56129, 1]), D = gf([30883, 4953, 19914, 30187, 55467, 16705, 2637, 112, 59544, 30585, 16505, 36039, 65139, 11119, 27886, 20995]), D2 = gf([61785, 9906, 39828, 60374, 45398, 33411, 5274, 224, 53552, 61171, 33010, 6542, 64743, 22239, 55772, 9222]), X = gf([54554, 36645, 11616, 51542, 42930, 38181, 51040, 26924, 56412, 64982, 57905, 49316, 21502, 52590, 14035, 8553]), Y = gf([26200, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214]), I = gf([41136, 18958, 6951, 50414, 58488, 44335, 6150, 12099, 55207, 15867, 153, 11085, 57099, 20417, 9344, 11139]); + function ts64(x, i, h, l) { + x[i] = h >> 24 & 255; + x[i + 1] = h >> 16 & 255; + x[i + 2] = h >> 8 & 255; + x[i + 3] = h & 255; + x[i + 4] = l >> 24 & 255; + x[i + 5] = l >> 16 & 255; + x[i + 6] = l >> 8 & 255; + x[i + 7] = l & 255; + } + function vn(x, xi, y, yi, n) { + var i, d = 0; + for (i = 0; i < n; i++) + d |= x[xi + i] ^ y[yi + i]; + return (1 & d - 1 >>> 8) - 1; + } + function crypto_verify_16(x, xi, y, yi) { + return vn(x, xi, y, yi, 16); + } + function crypto_verify_32(x, xi, y, yi) { + return vn(x, xi, y, yi, 32); + } + function core_salsa20(o, p, k, c) { + var j0 = c[0] & 255 | (c[1] & 255) << 8 | (c[2] & 255) << 16 | (c[3] & 255) << 24, j1 = k[0] & 255 | (k[1] & 255) << 8 | (k[2] & 255) << 16 | (k[3] & 255) << 24, j2 = k[4] & 255 | (k[5] & 255) << 8 | (k[6] & 255) << 16 | (k[7] & 255) << 24, j3 = k[8] & 255 | (k[9] & 255) << 8 | (k[10] & 255) << 16 | (k[11] & 255) << 24, j4 = k[12] & 255 | (k[13] & 255) << 8 | (k[14] & 255) << 16 | (k[15] & 255) << 24, j5 = c[4] & 255 | (c[5] & 255) << 8 | (c[6] & 255) << 16 | (c[7] & 255) << 24, j6 = p[0] & 255 | (p[1] & 255) << 8 | (p[2] & 255) << 16 | (p[3] & 255) << 24, j7 = p[4] & 255 | (p[5] & 255) << 8 | (p[6] & 255) << 16 | (p[7] & 255) << 24, j8 = p[8] & 255 | (p[9] & 255) << 8 | (p[10] & 255) << 16 | (p[11] & 255) << 24, j9 = p[12] & 255 | (p[13] & 255) << 8 | (p[14] & 255) << 16 | (p[15] & 255) << 24, j10 = c[8] & 255 | (c[9] & 255) << 8 | (c[10] & 255) << 16 | (c[11] & 255) << 24, j11 = k[16] & 255 | (k[17] & 255) << 8 | (k[18] & 255) << 16 | (k[19] & 255) << 24, j12 = k[20] & 255 | (k[21] & 255) << 8 | (k[22] & 255) << 16 | (k[23] & 255) << 24, j13 = k[24] & 255 | (k[25] & 255) << 8 | (k[26] & 255) << 16 | (k[27] & 255) << 24, j14 = k[28] & 255 | (k[29] & 255) << 8 | (k[30] & 255) << 16 | (k[31] & 255) << 24, j15 = c[12] & 255 | (c[13] & 255) << 8 | (c[14] & 255) << 16 | (c[15] & 255) << 24; + var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7, x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14, x15 = j15, u; + for (var i = 0; i < 20; i += 2) { + u = x0 + x12 | 0; + x4 ^= u << 7 | u >>> 32 - 7; + u = x4 + x0 | 0; + x8 ^= u << 9 | u >>> 32 - 9; + u = x8 + x4 | 0; + x12 ^= u << 13 | u >>> 32 - 13; + u = x12 + x8 | 0; + x0 ^= u << 18 | u >>> 32 - 18; + u = x5 + x1 | 0; + x9 ^= u << 7 | u >>> 32 - 7; + u = x9 + x5 | 0; + x13 ^= u << 9 | u >>> 32 - 9; + u = x13 + x9 | 0; + x1 ^= u << 13 | u >>> 32 - 13; + u = x1 + x13 | 0; + x5 ^= u << 18 | u >>> 32 - 18; + u = x10 + x6 | 0; + x14 ^= u << 7 | u >>> 32 - 7; + u = x14 + x10 | 0; + x2 ^= u << 9 | u >>> 32 - 9; + u = x2 + x14 | 0; + x6 ^= u << 13 | u >>> 32 - 13; + u = x6 + x2 | 0; + x10 ^= u << 18 | u >>> 32 - 18; + u = x15 + x11 | 0; + x3 ^= u << 7 | u >>> 32 - 7; + u = x3 + x15 | 0; + x7 ^= u << 9 | u >>> 32 - 9; + u = x7 + x3 | 0; + x11 ^= u << 13 | u >>> 32 - 13; + u = x11 + x7 | 0; + x15 ^= u << 18 | u >>> 32 - 18; + u = x0 + x3 | 0; + x1 ^= u << 7 | u >>> 32 - 7; + u = x1 + x0 | 0; + x2 ^= u << 9 | u >>> 32 - 9; + u = x2 + x1 | 0; + x3 ^= u << 13 | u >>> 32 - 13; + u = x3 + x2 | 0; + x0 ^= u << 18 | u >>> 32 - 18; + u = x5 + x4 | 0; + x6 ^= u << 7 | u >>> 32 - 7; + u = x6 + x5 | 0; + x7 ^= u << 9 | u >>> 32 - 9; + u = x7 + x6 | 0; + x4 ^= u << 13 | u >>> 32 - 13; + u = x4 + x7 | 0; + x5 ^= u << 18 | u >>> 32 - 18; + u = x10 + x9 | 0; + x11 ^= u << 7 | u >>> 32 - 7; + u = x11 + x10 | 0; + x8 ^= u << 9 | u >>> 32 - 9; + u = x8 + x11 | 0; + x9 ^= u << 13 | u >>> 32 - 13; + u = x9 + x8 | 0; + x10 ^= u << 18 | u >>> 32 - 18; + u = x15 + x14 | 0; + x12 ^= u << 7 | u >>> 32 - 7; + u = x12 + x15 | 0; + x13 ^= u << 9 | u >>> 32 - 9; + u = x13 + x12 | 0; + x14 ^= u << 13 | u >>> 32 - 13; + u = x14 + x13 | 0; + x15 ^= u << 18 | u >>> 32 - 18; + } + x0 = x0 + j0 | 0; + x1 = x1 + j1 | 0; + x2 = x2 + j2 | 0; + x3 = x3 + j3 | 0; + x4 = x4 + j4 | 0; + x5 = x5 + j5 | 0; + x6 = x6 + j6 | 0; + x7 = x7 + j7 | 0; + x8 = x8 + j8 | 0; + x9 = x9 + j9 | 0; + x10 = x10 + j10 | 0; + x11 = x11 + j11 | 0; + x12 = x12 + j12 | 0; + x13 = x13 + j13 | 0; + x14 = x14 + j14 | 0; + x15 = x15 + j15 | 0; + o[0] = x0 >>> 0 & 255; + o[1] = x0 >>> 8 & 255; + o[2] = x0 >>> 16 & 255; + o[3] = x0 >>> 24 & 255; + o[4] = x1 >>> 0 & 255; + o[5] = x1 >>> 8 & 255; + o[6] = x1 >>> 16 & 255; + o[7] = x1 >>> 24 & 255; + o[8] = x2 >>> 0 & 255; + o[9] = x2 >>> 8 & 255; + o[10] = x2 >>> 16 & 255; + o[11] = x2 >>> 24 & 255; + o[12] = x3 >>> 0 & 255; + o[13] = x3 >>> 8 & 255; + o[14] = x3 >>> 16 & 255; + o[15] = x3 >>> 24 & 255; + o[16] = x4 >>> 0 & 255; + o[17] = x4 >>> 8 & 255; + o[18] = x4 >>> 16 & 255; + o[19] = x4 >>> 24 & 255; + o[20] = x5 >>> 0 & 255; + o[21] = x5 >>> 8 & 255; + o[22] = x5 >>> 16 & 255; + o[23] = x5 >>> 24 & 255; + o[24] = x6 >>> 0 & 255; + o[25] = x6 >>> 8 & 255; + o[26] = x6 >>> 16 & 255; + o[27] = x6 >>> 24 & 255; + o[28] = x7 >>> 0 & 255; + o[29] = x7 >>> 8 & 255; + o[30] = x7 >>> 16 & 255; + o[31] = x7 >>> 24 & 255; + o[32] = x8 >>> 0 & 255; + o[33] = x8 >>> 8 & 255; + o[34] = x8 >>> 16 & 255; + o[35] = x8 >>> 24 & 255; + o[36] = x9 >>> 0 & 255; + o[37] = x9 >>> 8 & 255; + o[38] = x9 >>> 16 & 255; + o[39] = x9 >>> 24 & 255; + o[40] = x10 >>> 0 & 255; + o[41] = x10 >>> 8 & 255; + o[42] = x10 >>> 16 & 255; + o[43] = x10 >>> 24 & 255; + o[44] = x11 >>> 0 & 255; + o[45] = x11 >>> 8 & 255; + o[46] = x11 >>> 16 & 255; + o[47] = x11 >>> 24 & 255; + o[48] = x12 >>> 0 & 255; + o[49] = x12 >>> 8 & 255; + o[50] = x12 >>> 16 & 255; + o[51] = x12 >>> 24 & 255; + o[52] = x13 >>> 0 & 255; + o[53] = x13 >>> 8 & 255; + o[54] = x13 >>> 16 & 255; + o[55] = x13 >>> 24 & 255; + o[56] = x14 >>> 0 & 255; + o[57] = x14 >>> 8 & 255; + o[58] = x14 >>> 16 & 255; + o[59] = x14 >>> 24 & 255; + o[60] = x15 >>> 0 & 255; + o[61] = x15 >>> 8 & 255; + o[62] = x15 >>> 16 & 255; + o[63] = x15 >>> 24 & 255; + } + function core_hsalsa20(o, p, k, c) { + var j0 = c[0] & 255 | (c[1] & 255) << 8 | (c[2] & 255) << 16 | (c[3] & 255) << 24, j1 = k[0] & 255 | (k[1] & 255) << 8 | (k[2] & 255) << 16 | (k[3] & 255) << 24, j2 = k[4] & 255 | (k[5] & 255) << 8 | (k[6] & 255) << 16 | (k[7] & 255) << 24, j3 = k[8] & 255 | (k[9] & 255) << 8 | (k[10] & 255) << 16 | (k[11] & 255) << 24, j4 = k[12] & 255 | (k[13] & 255) << 8 | (k[14] & 255) << 16 | (k[15] & 255) << 24, j5 = c[4] & 255 | (c[5] & 255) << 8 | (c[6] & 255) << 16 | (c[7] & 255) << 24, j6 = p[0] & 255 | (p[1] & 255) << 8 | (p[2] & 255) << 16 | (p[3] & 255) << 24, j7 = p[4] & 255 | (p[5] & 255) << 8 | (p[6] & 255) << 16 | (p[7] & 255) << 24, j8 = p[8] & 255 | (p[9] & 255) << 8 | (p[10] & 255) << 16 | (p[11] & 255) << 24, j9 = p[12] & 255 | (p[13] & 255) << 8 | (p[14] & 255) << 16 | (p[15] & 255) << 24, j10 = c[8] & 255 | (c[9] & 255) << 8 | (c[10] & 255) << 16 | (c[11] & 255) << 24, j11 = k[16] & 255 | (k[17] & 255) << 8 | (k[18] & 255) << 16 | (k[19] & 255) << 24, j12 = k[20] & 255 | (k[21] & 255) << 8 | (k[22] & 255) << 16 | (k[23] & 255) << 24, j13 = k[24] & 255 | (k[25] & 255) << 8 | (k[26] & 255) << 16 | (k[27] & 255) << 24, j14 = k[28] & 255 | (k[29] & 255) << 8 | (k[30] & 255) << 16 | (k[31] & 255) << 24, j15 = c[12] & 255 | (c[13] & 255) << 8 | (c[14] & 255) << 16 | (c[15] & 255) << 24; + var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7, x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14, x15 = j15, u; + for (var i = 0; i < 20; i += 2) { + u = x0 + x12 | 0; + x4 ^= u << 7 | u >>> 32 - 7; + u = x4 + x0 | 0; + x8 ^= u << 9 | u >>> 32 - 9; + u = x8 + x4 | 0; + x12 ^= u << 13 | u >>> 32 - 13; + u = x12 + x8 | 0; + x0 ^= u << 18 | u >>> 32 - 18; + u = x5 + x1 | 0; + x9 ^= u << 7 | u >>> 32 - 7; + u = x9 + x5 | 0; + x13 ^= u << 9 | u >>> 32 - 9; + u = x13 + x9 | 0; + x1 ^= u << 13 | u >>> 32 - 13; + u = x1 + x13 | 0; + x5 ^= u << 18 | u >>> 32 - 18; + u = x10 + x6 | 0; + x14 ^= u << 7 | u >>> 32 - 7; + u = x14 + x10 | 0; + x2 ^= u << 9 | u >>> 32 - 9; + u = x2 + x14 | 0; + x6 ^= u << 13 | u >>> 32 - 13; + u = x6 + x2 | 0; + x10 ^= u << 18 | u >>> 32 - 18; + u = x15 + x11 | 0; + x3 ^= u << 7 | u >>> 32 - 7; + u = x3 + x15 | 0; + x7 ^= u << 9 | u >>> 32 - 9; + u = x7 + x3 | 0; + x11 ^= u << 13 | u >>> 32 - 13; + u = x11 + x7 | 0; + x15 ^= u << 18 | u >>> 32 - 18; + u = x0 + x3 | 0; + x1 ^= u << 7 | u >>> 32 - 7; + u = x1 + x0 | 0; + x2 ^= u << 9 | u >>> 32 - 9; + u = x2 + x1 | 0; + x3 ^= u << 13 | u >>> 32 - 13; + u = x3 + x2 | 0; + x0 ^= u << 18 | u >>> 32 - 18; + u = x5 + x4 | 0; + x6 ^= u << 7 | u >>> 32 - 7; + u = x6 + x5 | 0; + x7 ^= u << 9 | u >>> 32 - 9; + u = x7 + x6 | 0; + x4 ^= u << 13 | u >>> 32 - 13; + u = x4 + x7 | 0; + x5 ^= u << 18 | u >>> 32 - 18; + u = x10 + x9 | 0; + x11 ^= u << 7 | u >>> 32 - 7; + u = x11 + x10 | 0; + x8 ^= u << 9 | u >>> 32 - 9; + u = x8 + x11 | 0; + x9 ^= u << 13 | u >>> 32 - 13; + u = x9 + x8 | 0; + x10 ^= u << 18 | u >>> 32 - 18; + u = x15 + x14 | 0; + x12 ^= u << 7 | u >>> 32 - 7; + u = x12 + x15 | 0; + x13 ^= u << 9 | u >>> 32 - 9; + u = x13 + x12 | 0; + x14 ^= u << 13 | u >>> 32 - 13; + u = x14 + x13 | 0; + x15 ^= u << 18 | u >>> 32 - 18; + } + o[0] = x0 >>> 0 & 255; + o[1] = x0 >>> 8 & 255; + o[2] = x0 >>> 16 & 255; + o[3] = x0 >>> 24 & 255; + o[4] = x5 >>> 0 & 255; + o[5] = x5 >>> 8 & 255; + o[6] = x5 >>> 16 & 255; + o[7] = x5 >>> 24 & 255; + o[8] = x10 >>> 0 & 255; + o[9] = x10 >>> 8 & 255; + o[10] = x10 >>> 16 & 255; + o[11] = x10 >>> 24 & 255; + o[12] = x15 >>> 0 & 255; + o[13] = x15 >>> 8 & 255; + o[14] = x15 >>> 16 & 255; + o[15] = x15 >>> 24 & 255; + o[16] = x6 >>> 0 & 255; + o[17] = x6 >>> 8 & 255; + o[18] = x6 >>> 16 & 255; + o[19] = x6 >>> 24 & 255; + o[20] = x7 >>> 0 & 255; + o[21] = x7 >>> 8 & 255; + o[22] = x7 >>> 16 & 255; + o[23] = x7 >>> 24 & 255; + o[24] = x8 >>> 0 & 255; + o[25] = x8 >>> 8 & 255; + o[26] = x8 >>> 16 & 255; + o[27] = x8 >>> 24 & 255; + o[28] = x9 >>> 0 & 255; + o[29] = x9 >>> 8 & 255; + o[30] = x9 >>> 16 & 255; + o[31] = x9 >>> 24 & 255; + } + function crypto_core_salsa20(out, inp, k, c) { + core_salsa20(out, inp, k, c); + } + function crypto_core_hsalsa20(out, inp, k, c) { + core_hsalsa20(out, inp, k, c); + } + var sigma = new Uint8Array([101, 120, 112, 97, 110, 100, 32, 51, 50, 45, 98, 121, 116, 101, 32, 107]); + function crypto_stream_salsa20_xor(c, cpos, m, mpos, b, n, k) { + var z = new Uint8Array(16), x = new Uint8Array(64); + var u, i; + for (i = 0; i < 16; i++) + z[i] = 0; + for (i = 0; i < 8; i++) + z[i] = n[i]; + while (b >= 64) { + crypto_core_salsa20(x, z, k, sigma); + for (i = 0; i < 64; i++) + c[cpos + i] = m[mpos + i] ^ x[i]; + u = 1; + for (i = 8; i < 16; i++) { + u = u + (z[i] & 255) | 0; + z[i] = u & 255; + u >>>= 8; + } + b -= 64; + cpos += 64; + mpos += 64; + } + if (b > 0) { + crypto_core_salsa20(x, z, k, sigma); + for (i = 0; i < b; i++) + c[cpos + i] = m[mpos + i] ^ x[i]; + } + return 0; + } + function crypto_stream_salsa20(c, cpos, b, n, k) { + var z = new Uint8Array(16), x = new Uint8Array(64); + var u, i; + for (i = 0; i < 16; i++) + z[i] = 0; + for (i = 0; i < 8; i++) + z[i] = n[i]; + while (b >= 64) { + crypto_core_salsa20(x, z, k, sigma); + for (i = 0; i < 64; i++) + c[cpos + i] = x[i]; + u = 1; + for (i = 8; i < 16; i++) { + u = u + (z[i] & 255) | 0; + z[i] = u & 255; + u >>>= 8; + } + b -= 64; + cpos += 64; + } + if (b > 0) { + crypto_core_salsa20(x, z, k, sigma); + for (i = 0; i < b; i++) + c[cpos + i] = x[i]; + } + return 0; + } + function crypto_stream(c, cpos, d, n, k) { + var s = new Uint8Array(32); + crypto_core_hsalsa20(s, n, k, sigma); + var sn = new Uint8Array(8); + for (var i = 0; i < 8; i++) + sn[i] = n[i + 16]; + return crypto_stream_salsa20(c, cpos, d, sn, s); + } + function crypto_stream_xor(c, cpos, m, mpos, d, n, k) { + var s = new Uint8Array(32); + crypto_core_hsalsa20(s, n, k, sigma); + var sn = new Uint8Array(8); + for (var i = 0; i < 8; i++) + sn[i] = n[i + 16]; + return crypto_stream_salsa20_xor(c, cpos, m, mpos, d, sn, s); + } + var poly1305 = function(key) { + this.buffer = new Uint8Array(16); + this.r = new Uint16Array(10); + this.h = new Uint16Array(10); + this.pad = new Uint16Array(8); + this.leftover = 0; + this.fin = 0; + var t0, t1, t2, t3, t4, t5, t6, t7; + t0 = key[0] & 255 | (key[1] & 255) << 8; + this.r[0] = t0 & 8191; + t1 = key[2] & 255 | (key[3] & 255) << 8; + this.r[1] = (t0 >>> 13 | t1 << 3) & 8191; + t2 = key[4] & 255 | (key[5] & 255) << 8; + this.r[2] = (t1 >>> 10 | t2 << 6) & 7939; + t3 = key[6] & 255 | (key[7] & 255) << 8; + this.r[3] = (t2 >>> 7 | t3 << 9) & 8191; + t4 = key[8] & 255 | (key[9] & 255) << 8; + this.r[4] = (t3 >>> 4 | t4 << 12) & 255; + this.r[5] = t4 >>> 1 & 8190; + t5 = key[10] & 255 | (key[11] & 255) << 8; + this.r[6] = (t4 >>> 14 | t5 << 2) & 8191; + t6 = key[12] & 255 | (key[13] & 255) << 8; + this.r[7] = (t5 >>> 11 | t6 << 5) & 8065; + t7 = key[14] & 255 | (key[15] & 255) << 8; + this.r[8] = (t6 >>> 8 | t7 << 8) & 8191; + this.r[9] = t7 >>> 5 & 127; + this.pad[0] = key[16] & 255 | (key[17] & 255) << 8; + this.pad[1] = key[18] & 255 | (key[19] & 255) << 8; + this.pad[2] = key[20] & 255 | (key[21] & 255) << 8; + this.pad[3] = key[22] & 255 | (key[23] & 255) << 8; + this.pad[4] = key[24] & 255 | (key[25] & 255) << 8; + this.pad[5] = key[26] & 255 | (key[27] & 255) << 8; + this.pad[6] = key[28] & 255 | (key[29] & 255) << 8; + this.pad[7] = key[30] & 255 | (key[31] & 255) << 8; + }; + poly1305.prototype.blocks = function(m, mpos, bytes) { + var hibit = this.fin ? 0 : 1 << 11; + var t0, t1, t2, t3, t4, t5, t6, t7, c; + var d0, d1, d2, d3, d4, d5, d6, d7, d8, d9; + var h0 = this.h[0], h1 = this.h[1], h2 = this.h[2], h3 = this.h[3], h4 = this.h[4], h5 = this.h[5], h6 = this.h[6], h7 = this.h[7], h8 = this.h[8], h9 = this.h[9]; + var r0 = this.r[0], r1 = this.r[1], r2 = this.r[2], r3 = this.r[3], r4 = this.r[4], r5 = this.r[5], r6 = this.r[6], r7 = this.r[7], r8 = this.r[8], r9 = this.r[9]; + while (bytes >= 16) { + t0 = m[mpos + 0] & 255 | (m[mpos + 1] & 255) << 8; + h0 += t0 & 8191; + t1 = m[mpos + 2] & 255 | (m[mpos + 3] & 255) << 8; + h1 += (t0 >>> 13 | t1 << 3) & 8191; + t2 = m[mpos + 4] & 255 | (m[mpos + 5] & 255) << 8; + h2 += (t1 >>> 10 | t2 << 6) & 8191; + t3 = m[mpos + 6] & 255 | (m[mpos + 7] & 255) << 8; + h3 += (t2 >>> 7 | t3 << 9) & 8191; + t4 = m[mpos + 8] & 255 | (m[mpos + 9] & 255) << 8; + h4 += (t3 >>> 4 | t4 << 12) & 8191; + h5 += t4 >>> 1 & 8191; + t5 = m[mpos + 10] & 255 | (m[mpos + 11] & 255) << 8; + h6 += (t4 >>> 14 | t5 << 2) & 8191; + t6 = m[mpos + 12] & 255 | (m[mpos + 13] & 255) << 8; + h7 += (t5 >>> 11 | t6 << 5) & 8191; + t7 = m[mpos + 14] & 255 | (m[mpos + 15] & 255) << 8; + h8 += (t6 >>> 8 | t7 << 8) & 8191; + h9 += t7 >>> 5 | hibit; + c = 0; + d0 = c; + d0 += h0 * r0; + d0 += h1 * (5 * r9); + d0 += h2 * (5 * r8); + d0 += h3 * (5 * r7); + d0 += h4 * (5 * r6); + c = d0 >>> 13; + d0 &= 8191; + d0 += h5 * (5 * r5); + d0 += h6 * (5 * r4); + d0 += h7 * (5 * r3); + d0 += h8 * (5 * r2); + d0 += h9 * (5 * r1); + c += d0 >>> 13; + d0 &= 8191; + d1 = c; + d1 += h0 * r1; + d1 += h1 * r0; + d1 += h2 * (5 * r9); + d1 += h3 * (5 * r8); + d1 += h4 * (5 * r7); + c = d1 >>> 13; + d1 &= 8191; + d1 += h5 * (5 * r6); + d1 += h6 * (5 * r5); + d1 += h7 * (5 * r4); + d1 += h8 * (5 * r3); + d1 += h9 * (5 * r2); + c += d1 >>> 13; + d1 &= 8191; + d2 = c; + d2 += h0 * r2; + d2 += h1 * r1; + d2 += h2 * r0; + d2 += h3 * (5 * r9); + d2 += h4 * (5 * r8); + c = d2 >>> 13; + d2 &= 8191; + d2 += h5 * (5 * r7); + d2 += h6 * (5 * r6); + d2 += h7 * (5 * r5); + d2 += h8 * (5 * r4); + d2 += h9 * (5 * r3); + c += d2 >>> 13; + d2 &= 8191; + d3 = c; + d3 += h0 * r3; + d3 += h1 * r2; + d3 += h2 * r1; + d3 += h3 * r0; + d3 += h4 * (5 * r9); + c = d3 >>> 13; + d3 &= 8191; + d3 += h5 * (5 * r8); + d3 += h6 * (5 * r7); + d3 += h7 * (5 * r6); + d3 += h8 * (5 * r5); + d3 += h9 * (5 * r4); + c += d3 >>> 13; + d3 &= 8191; + d4 = c; + d4 += h0 * r4; + d4 += h1 * r3; + d4 += h2 * r2; + d4 += h3 * r1; + d4 += h4 * r0; + c = d4 >>> 13; + d4 &= 8191; + d4 += h5 * (5 * r9); + d4 += h6 * (5 * r8); + d4 += h7 * (5 * r7); + d4 += h8 * (5 * r6); + d4 += h9 * (5 * r5); + c += d4 >>> 13; + d4 &= 8191; + d5 = c; + d5 += h0 * r5; + d5 += h1 * r4; + d5 += h2 * r3; + d5 += h3 * r2; + d5 += h4 * r1; + c = d5 >>> 13; + d5 &= 8191; + d5 += h5 * r0; + d5 += h6 * (5 * r9); + d5 += h7 * (5 * r8); + d5 += h8 * (5 * r7); + d5 += h9 * (5 * r6); + c += d5 >>> 13; + d5 &= 8191; + d6 = c; + d6 += h0 * r6; + d6 += h1 * r5; + d6 += h2 * r4; + d6 += h3 * r3; + d6 += h4 * r2; + c = d6 >>> 13; + d6 &= 8191; + d6 += h5 * r1; + d6 += h6 * r0; + d6 += h7 * (5 * r9); + d6 += h8 * (5 * r8); + d6 += h9 * (5 * r7); + c += d6 >>> 13; + d6 &= 8191; + d7 = c; + d7 += h0 * r7; + d7 += h1 * r6; + d7 += h2 * r5; + d7 += h3 * r4; + d7 += h4 * r3; + c = d7 >>> 13; + d7 &= 8191; + d7 += h5 * r2; + d7 += h6 * r1; + d7 += h7 * r0; + d7 += h8 * (5 * r9); + d7 += h9 * (5 * r8); + c += d7 >>> 13; + d7 &= 8191; + d8 = c; + d8 += h0 * r8; + d8 += h1 * r7; + d8 += h2 * r6; + d8 += h3 * r5; + d8 += h4 * r4; + c = d8 >>> 13; + d8 &= 8191; + d8 += h5 * r3; + d8 += h6 * r2; + d8 += h7 * r1; + d8 += h8 * r0; + d8 += h9 * (5 * r9); + c += d8 >>> 13; + d8 &= 8191; + d9 = c; + d9 += h0 * r9; + d9 += h1 * r8; + d9 += h2 * r7; + d9 += h3 * r6; + d9 += h4 * r5; + c = d9 >>> 13; + d9 &= 8191; + d9 += h5 * r4; + d9 += h6 * r3; + d9 += h7 * r2; + d9 += h8 * r1; + d9 += h9 * r0; + c += d9 >>> 13; + d9 &= 8191; + c = (c << 2) + c | 0; + c = c + d0 | 0; + d0 = c & 8191; + c = c >>> 13; + d1 += c; + h0 = d0; + h1 = d1; + h2 = d2; + h3 = d3; + h4 = d4; + h5 = d5; + h6 = d6; + h7 = d7; + h8 = d8; + h9 = d9; + mpos += 16; + bytes -= 16; + } + this.h[0] = h0; + this.h[1] = h1; + this.h[2] = h2; + this.h[3] = h3; + this.h[4] = h4; + this.h[5] = h5; + this.h[6] = h6; + this.h[7] = h7; + this.h[8] = h8; + this.h[9] = h9; + }; + poly1305.prototype.finish = function(mac, macpos) { + var g = new Uint16Array(10); + var c, mask, f, i; + if (this.leftover) { + i = this.leftover; + this.buffer[i++] = 1; + for (; i < 16; i++) + this.buffer[i] = 0; + this.fin = 1; + this.blocks(this.buffer, 0, 16); + } + c = this.h[1] >>> 13; + this.h[1] &= 8191; + for (i = 2; i < 10; i++) { + this.h[i] += c; + c = this.h[i] >>> 13; + this.h[i] &= 8191; + } + this.h[0] += c * 5; + c = this.h[0] >>> 13; + this.h[0] &= 8191; + this.h[1] += c; + c = this.h[1] >>> 13; + this.h[1] &= 8191; + this.h[2] += c; + g[0] = this.h[0] + 5; + c = g[0] >>> 13; + g[0] &= 8191; + for (i = 1; i < 10; i++) { + g[i] = this.h[i] + c; + c = g[i] >>> 13; + g[i] &= 8191; + } + g[9] -= 1 << 13; + mask = (c ^ 1) - 1; + for (i = 0; i < 10; i++) + g[i] &= mask; + mask = ~mask; + for (i = 0; i < 10; i++) + this.h[i] = this.h[i] & mask | g[i]; + this.h[0] = (this.h[0] | this.h[1] << 13) & 65535; + this.h[1] = (this.h[1] >>> 3 | this.h[2] << 10) & 65535; + this.h[2] = (this.h[2] >>> 6 | this.h[3] << 7) & 65535; + this.h[3] = (this.h[3] >>> 9 | this.h[4] << 4) & 65535; + this.h[4] = (this.h[4] >>> 12 | this.h[5] << 1 | this.h[6] << 14) & 65535; + this.h[5] = (this.h[6] >>> 2 | this.h[7] << 11) & 65535; + this.h[6] = (this.h[7] >>> 5 | this.h[8] << 8) & 65535; + this.h[7] = (this.h[8] >>> 8 | this.h[9] << 5) & 65535; + f = this.h[0] + this.pad[0]; + this.h[0] = f & 65535; + for (i = 1; i < 8; i++) { + f = (this.h[i] + this.pad[i] | 0) + (f >>> 16) | 0; + this.h[i] = f & 65535; + } + mac[macpos + 0] = this.h[0] >>> 0 & 255; + mac[macpos + 1] = this.h[0] >>> 8 & 255; + mac[macpos + 2] = this.h[1] >>> 0 & 255; + mac[macpos + 3] = this.h[1] >>> 8 & 255; + mac[macpos + 4] = this.h[2] >>> 0 & 255; + mac[macpos + 5] = this.h[2] >>> 8 & 255; + mac[macpos + 6] = this.h[3] >>> 0 & 255; + mac[macpos + 7] = this.h[3] >>> 8 & 255; + mac[macpos + 8] = this.h[4] >>> 0 & 255; + mac[macpos + 9] = this.h[4] >>> 8 & 255; + mac[macpos + 10] = this.h[5] >>> 0 & 255; + mac[macpos + 11] = this.h[5] >>> 8 & 255; + mac[macpos + 12] = this.h[6] >>> 0 & 255; + mac[macpos + 13] = this.h[6] >>> 8 & 255; + mac[macpos + 14] = this.h[7] >>> 0 & 255; + mac[macpos + 15] = this.h[7] >>> 8 & 255; + }; + poly1305.prototype.update = function(m, mpos, bytes) { + var i, want; + if (this.leftover) { + want = 16 - this.leftover; + if (want > bytes) + want = bytes; + for (i = 0; i < want; i++) + this.buffer[this.leftover + i] = m[mpos + i]; + bytes -= want; + mpos += want; + this.leftover += want; + if (this.leftover < 16) + return; + this.blocks(this.buffer, 0, 16); + this.leftover = 0; + } + if (bytes >= 16) { + want = bytes - bytes % 16; + this.blocks(m, mpos, want); + mpos += want; + bytes -= want; + } + if (bytes) { + for (i = 0; i < bytes; i++) + this.buffer[this.leftover + i] = m[mpos + i]; + this.leftover += bytes; + } + }; + function crypto_onetimeauth(out, outpos, m, mpos, n, k) { + var s = new poly1305(k); + s.update(m, mpos, n); + s.finish(out, outpos); + return 0; + } + function crypto_onetimeauth_verify(h, hpos, m, mpos, n, k) { + var x = new Uint8Array(16); + crypto_onetimeauth(x, 0, m, mpos, n, k); + return crypto_verify_16(h, hpos, x, 0); + } + function crypto_secretbox(c, m, d, n, k) { + var i; + if (d < 32) + return -1; + crypto_stream_xor(c, 0, m, 0, d, n, k); + crypto_onetimeauth(c, 16, c, 32, d - 32, c); + for (i = 0; i < 16; i++) + c[i] = 0; + return 0; + } + function crypto_secretbox_open(m, c, d, n, k) { + var i; + var x = new Uint8Array(32); + if (d < 32) + return -1; + crypto_stream(x, 0, 32, n, k); + if (crypto_onetimeauth_verify(c, 16, c, 32, d - 32, x) !== 0) + return -1; + crypto_stream_xor(m, 0, c, 0, d, n, k); + for (i = 0; i < 32; i++) + m[i] = 0; + return 0; + } + function set25519(r, a) { + var i; + for (i = 0; i < 16; i++) + r[i] = a[i] | 0; + } + function car25519(o) { + var i, v, c = 1; + for (i = 0; i < 16; i++) { + v = o[i] + c + 65535; + c = Math.floor(v / 65536); + o[i] = v - c * 65536; + } + o[0] += c - 1 + 37 * (c - 1); + } + function sel25519(p, q, b) { + var t, c = ~(b - 1); + for (var i = 0; i < 16; i++) { + t = c & (p[i] ^ q[i]); + p[i] ^= t; + q[i] ^= t; + } + } + function pack25519(o, n) { + var i, j, b; + var m = gf(), t = gf(); + for (i = 0; i < 16; i++) + t[i] = n[i]; + car25519(t); + car25519(t); + car25519(t); + for (j = 0; j < 2; j++) { + m[0] = t[0] - 65517; + for (i = 1; i < 15; i++) { + m[i] = t[i] - 65535 - (m[i - 1] >> 16 & 1); + m[i - 1] &= 65535; + } + m[15] = t[15] - 32767 - (m[14] >> 16 & 1); + b = m[15] >> 16 & 1; + m[14] &= 65535; + sel25519(t, m, 1 - b); + } + for (i = 0; i < 16; i++) { + o[2 * i] = t[i] & 255; + o[2 * i + 1] = t[i] >> 8; + } + } + function neq25519(a, b) { + var c = new Uint8Array(32), d = new Uint8Array(32); + pack25519(c, a); + pack25519(d, b); + return crypto_verify_32(c, 0, d, 0); + } + function par25519(a) { + var d = new Uint8Array(32); + pack25519(d, a); + return d[0] & 1; + } + function unpack25519(o, n) { + var i; + for (i = 0; i < 16; i++) + o[i] = n[2 * i] + (n[2 * i + 1] << 8); + o[15] &= 32767; + } + function A(o, a, b) { + for (var i = 0; i < 16; i++) + o[i] = a[i] + b[i]; + } + function Z(o, a, b) { + for (var i = 0; i < 16; i++) + o[i] = a[i] - b[i]; + } + function M(o, a, b) { + var v, c, t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, t10 = 0, t11 = 0, t12 = 0, t13 = 0, t14 = 0, t15 = 0, t16 = 0, t17 = 0, t18 = 0, t19 = 0, t20 = 0, t21 = 0, t22 = 0, t23 = 0, t24 = 0, t25 = 0, t26 = 0, t27 = 0, t28 = 0, t29 = 0, t30 = 0, b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3], b4 = b[4], b5 = b[5], b6 = b[6], b7 = b[7], b8 = b[8], b9 = b[9], b10 = b[10], b11 = b[11], b12 = b[12], b13 = b[13], b14 = b[14], b15 = b[15]; + v = a[0]; + t0 += v * b0; + t1 += v * b1; + t2 += v * b2; + t3 += v * b3; + t4 += v * b4; + t5 += v * b5; + t6 += v * b6; + t7 += v * b7; + t8 += v * b8; + t9 += v * b9; + t10 += v * b10; + t11 += v * b11; + t12 += v * b12; + t13 += v * b13; + t14 += v * b14; + t15 += v * b15; + v = a[1]; + t1 += v * b0; + t2 += v * b1; + t3 += v * b2; + t4 += v * b3; + t5 += v * b4; + t6 += v * b5; + t7 += v * b6; + t8 += v * b7; + t9 += v * b8; + t10 += v * b9; + t11 += v * b10; + t12 += v * b11; + t13 += v * b12; + t14 += v * b13; + t15 += v * b14; + t16 += v * b15; + v = a[2]; + t2 += v * b0; + t3 += v * b1; + t4 += v * b2; + t5 += v * b3; + t6 += v * b4; + t7 += v * b5; + t8 += v * b6; + t9 += v * b7; + t10 += v * b8; + t11 += v * b9; + t12 += v * b10; + t13 += v * b11; + t14 += v * b12; + t15 += v * b13; + t16 += v * b14; + t17 += v * b15; + v = a[3]; + t3 += v * b0; + t4 += v * b1; + t5 += v * b2; + t6 += v * b3; + t7 += v * b4; + t8 += v * b5; + t9 += v * b6; + t10 += v * b7; + t11 += v * b8; + t12 += v * b9; + t13 += v * b10; + t14 += v * b11; + t15 += v * b12; + t16 += v * b13; + t17 += v * b14; + t18 += v * b15; + v = a[4]; + t4 += v * b0; + t5 += v * b1; + t6 += v * b2; + t7 += v * b3; + t8 += v * b4; + t9 += v * b5; + t10 += v * b6; + t11 += v * b7; + t12 += v * b8; + t13 += v * b9; + t14 += v * b10; + t15 += v * b11; + t16 += v * b12; + t17 += v * b13; + t18 += v * b14; + t19 += v * b15; + v = a[5]; + t5 += v * b0; + t6 += v * b1; + t7 += v * b2; + t8 += v * b3; + t9 += v * b4; + t10 += v * b5; + t11 += v * b6; + t12 += v * b7; + t13 += v * b8; + t14 += v * b9; + t15 += v * b10; + t16 += v * b11; + t17 += v * b12; + t18 += v * b13; + t19 += v * b14; + t20 += v * b15; + v = a[6]; + t6 += v * b0; + t7 += v * b1; + t8 += v * b2; + t9 += v * b3; + t10 += v * b4; + t11 += v * b5; + t12 += v * b6; + t13 += v * b7; + t14 += v * b8; + t15 += v * b9; + t16 += v * b10; + t17 += v * b11; + t18 += v * b12; + t19 += v * b13; + t20 += v * b14; + t21 += v * b15; + v = a[7]; + t7 += v * b0; + t8 += v * b1; + t9 += v * b2; + t10 += v * b3; + t11 += v * b4; + t12 += v * b5; + t13 += v * b6; + t14 += v * b7; + t15 += v * b8; + t16 += v * b9; + t17 += v * b10; + t18 += v * b11; + t19 += v * b12; + t20 += v * b13; + t21 += v * b14; + t22 += v * b15; + v = a[8]; + t8 += v * b0; + t9 += v * b1; + t10 += v * b2; + t11 += v * b3; + t12 += v * b4; + t13 += v * b5; + t14 += v * b6; + t15 += v * b7; + t16 += v * b8; + t17 += v * b9; + t18 += v * b10; + t19 += v * b11; + t20 += v * b12; + t21 += v * b13; + t22 += v * b14; + t23 += v * b15; + v = a[9]; + t9 += v * b0; + t10 += v * b1; + t11 += v * b2; + t12 += v * b3; + t13 += v * b4; + t14 += v * b5; + t15 += v * b6; + t16 += v * b7; + t17 += v * b8; + t18 += v * b9; + t19 += v * b10; + t20 += v * b11; + t21 += v * b12; + t22 += v * b13; + t23 += v * b14; + t24 += v * b15; + v = a[10]; + t10 += v * b0; + t11 += v * b1; + t12 += v * b2; + t13 += v * b3; + t14 += v * b4; + t15 += v * b5; + t16 += v * b6; + t17 += v * b7; + t18 += v * b8; + t19 += v * b9; + t20 += v * b10; + t21 += v * b11; + t22 += v * b12; + t23 += v * b13; + t24 += v * b14; + t25 += v * b15; + v = a[11]; + t11 += v * b0; + t12 += v * b1; + t13 += v * b2; + t14 += v * b3; + t15 += v * b4; + t16 += v * b5; + t17 += v * b6; + t18 += v * b7; + t19 += v * b8; + t20 += v * b9; + t21 += v * b10; + t22 += v * b11; + t23 += v * b12; + t24 += v * b13; + t25 += v * b14; + t26 += v * b15; + v = a[12]; + t12 += v * b0; + t13 += v * b1; + t14 += v * b2; + t15 += v * b3; + t16 += v * b4; + t17 += v * b5; + t18 += v * b6; + t19 += v * b7; + t20 += v * b8; + t21 += v * b9; + t22 += v * b10; + t23 += v * b11; + t24 += v * b12; + t25 += v * b13; + t26 += v * b14; + t27 += v * b15; + v = a[13]; + t13 += v * b0; + t14 += v * b1; + t15 += v * b2; + t16 += v * b3; + t17 += v * b4; + t18 += v * b5; + t19 += v * b6; + t20 += v * b7; + t21 += v * b8; + t22 += v * b9; + t23 += v * b10; + t24 += v * b11; + t25 += v * b12; + t26 += v * b13; + t27 += v * b14; + t28 += v * b15; + v = a[14]; + t14 += v * b0; + t15 += v * b1; + t16 += v * b2; + t17 += v * b3; + t18 += v * b4; + t19 += v * b5; + t20 += v * b6; + t21 += v * b7; + t22 += v * b8; + t23 += v * b9; + t24 += v * b10; + t25 += v * b11; + t26 += v * b12; + t27 += v * b13; + t28 += v * b14; + t29 += v * b15; + v = a[15]; + t15 += v * b0; + t16 += v * b1; + t17 += v * b2; + t18 += v * b3; + t19 += v * b4; + t20 += v * b5; + t21 += v * b6; + t22 += v * b7; + t23 += v * b8; + t24 += v * b9; + t25 += v * b10; + t26 += v * b11; + t27 += v * b12; + t28 += v * b13; + t29 += v * b14; + t30 += v * b15; + t0 += 38 * t16; + t1 += 38 * t17; + t2 += 38 * t18; + t3 += 38 * t19; + t4 += 38 * t20; + t5 += 38 * t21; + t6 += 38 * t22; + t7 += 38 * t23; + t8 += 38 * t24; + t9 += 38 * t25; + t10 += 38 * t26; + t11 += 38 * t27; + t12 += 38 * t28; + t13 += 38 * t29; + t14 += 38 * t30; + c = 1; + v = t0 + c + 65535; + c = Math.floor(v / 65536); + t0 = v - c * 65536; + v = t1 + c + 65535; + c = Math.floor(v / 65536); + t1 = v - c * 65536; + v = t2 + c + 65535; + c = Math.floor(v / 65536); + t2 = v - c * 65536; + v = t3 + c + 65535; + c = Math.floor(v / 65536); + t3 = v - c * 65536; + v = t4 + c + 65535; + c = Math.floor(v / 65536); + t4 = v - c * 65536; + v = t5 + c + 65535; + c = Math.floor(v / 65536); + t5 = v - c * 65536; + v = t6 + c + 65535; + c = Math.floor(v / 65536); + t6 = v - c * 65536; + v = t7 + c + 65535; + c = Math.floor(v / 65536); + t7 = v - c * 65536; + v = t8 + c + 65535; + c = Math.floor(v / 65536); + t8 = v - c * 65536; + v = t9 + c + 65535; + c = Math.floor(v / 65536); + t9 = v - c * 65536; + v = t10 + c + 65535; + c = Math.floor(v / 65536); + t10 = v - c * 65536; + v = t11 + c + 65535; + c = Math.floor(v / 65536); + t11 = v - c * 65536; + v = t12 + c + 65535; + c = Math.floor(v / 65536); + t12 = v - c * 65536; + v = t13 + c + 65535; + c = Math.floor(v / 65536); + t13 = v - c * 65536; + v = t14 + c + 65535; + c = Math.floor(v / 65536); + t14 = v - c * 65536; + v = t15 + c + 65535; + c = Math.floor(v / 65536); + t15 = v - c * 65536; + t0 += c - 1 + 37 * (c - 1); + c = 1; + v = t0 + c + 65535; + c = Math.floor(v / 65536); + t0 = v - c * 65536; + v = t1 + c + 65535; + c = Math.floor(v / 65536); + t1 = v - c * 65536; + v = t2 + c + 65535; + c = Math.floor(v / 65536); + t2 = v - c * 65536; + v = t3 + c + 65535; + c = Math.floor(v / 65536); + t3 = v - c * 65536; + v = t4 + c + 65535; + c = Math.floor(v / 65536); + t4 = v - c * 65536; + v = t5 + c + 65535; + c = Math.floor(v / 65536); + t5 = v - c * 65536; + v = t6 + c + 65535; + c = Math.floor(v / 65536); + t6 = v - c * 65536; + v = t7 + c + 65535; + c = Math.floor(v / 65536); + t7 = v - c * 65536; + v = t8 + c + 65535; + c = Math.floor(v / 65536); + t8 = v - c * 65536; + v = t9 + c + 65535; + c = Math.floor(v / 65536); + t9 = v - c * 65536; + v = t10 + c + 65535; + c = Math.floor(v / 65536); + t10 = v - c * 65536; + v = t11 + c + 65535; + c = Math.floor(v / 65536); + t11 = v - c * 65536; + v = t12 + c + 65535; + c = Math.floor(v / 65536); + t12 = v - c * 65536; + v = t13 + c + 65535; + c = Math.floor(v / 65536); + t13 = v - c * 65536; + v = t14 + c + 65535; + c = Math.floor(v / 65536); + t14 = v - c * 65536; + v = t15 + c + 65535; + c = Math.floor(v / 65536); + t15 = v - c * 65536; + t0 += c - 1 + 37 * (c - 1); + o[0] = t0; + o[1] = t1; + o[2] = t2; + o[3] = t3; + o[4] = t4; + o[5] = t5; + o[6] = t6; + o[7] = t7; + o[8] = t8; + o[9] = t9; + o[10] = t10; + o[11] = t11; + o[12] = t12; + o[13] = t13; + o[14] = t14; + o[15] = t15; + } + function S(o, a) { + M(o, a, a); + } + function inv25519(o, i) { + var c = gf(); + var a; + for (a = 0; a < 16; a++) + c[a] = i[a]; + for (a = 253; a >= 0; a--) { + S(c, c); + if (a !== 2 && a !== 4) + M(c, c, i); + } + for (a = 0; a < 16; a++) + o[a] = c[a]; + } + function pow2523(o, i) { + var c = gf(); + var a; + for (a = 0; a < 16; a++) + c[a] = i[a]; + for (a = 250; a >= 0; a--) { + S(c, c); + if (a !== 1) + M(c, c, i); + } + for (a = 0; a < 16; a++) + o[a] = c[a]; + } + function crypto_scalarmult(q, n, p) { + var z = new Uint8Array(32); + var x = new Float64Array(80), r, i; + var a = gf(), b = gf(), c = gf(), d = gf(), e = gf(), f = gf(); + for (i = 0; i < 31; i++) + z[i] = n[i]; + z[31] = n[31] & 127 | 64; + z[0] &= 248; + unpack25519(x, p); + for (i = 0; i < 16; i++) { + b[i] = x[i]; + d[i] = a[i] = c[i] = 0; + } + a[0] = d[0] = 1; + for (i = 254; i >= 0; --i) { + r = z[i >>> 3] >>> (i & 7) & 1; + sel25519(a, b, r); + sel25519(c, d, r); + A(e, a, c); + Z(a, a, c); + A(c, b, d); + Z(b, b, d); + S(d, e); + S(f, a); + M(a, c, a); + M(c, b, e); + A(e, a, c); + Z(a, a, c); + S(b, a); + Z(c, d, f); + M(a, c, _121665); + A(a, a, d); + M(c, c, a); + M(a, d, f); + M(d, b, x); + S(b, e); + sel25519(a, b, r); + sel25519(c, d, r); + } + for (i = 0; i < 16; i++) { + x[i + 16] = a[i]; + x[i + 32] = c[i]; + x[i + 48] = b[i]; + x[i + 64] = d[i]; + } + var x32 = x.subarray(32); + var x16 = x.subarray(16); + inv25519(x32, x32); + M(x16, x16, x32); + pack25519(q, x16); + return 0; + } + function crypto_scalarmult_base(q, n) { + return crypto_scalarmult(q, n, _9); + } + function crypto_box_keypair(y, x) { + randombytes(x, 32); + return crypto_scalarmult_base(y, x); + } + function crypto_box_beforenm(k, y, x) { + var s = new Uint8Array(32); + crypto_scalarmult(s, x, y); + return crypto_core_hsalsa20(k, _0, s, sigma); + } + var crypto_box_afternm = crypto_secretbox; + var crypto_box_open_afternm = crypto_secretbox_open; + function crypto_box(c, m, d, n, y, x) { + var k = new Uint8Array(32); + crypto_box_beforenm(k, y, x); + return crypto_box_afternm(c, m, d, n, k); + } + function crypto_box_open(m, c, d, n, y, x) { + var k = new Uint8Array(32); + crypto_box_beforenm(k, y, x); + return crypto_box_open_afternm(m, c, d, n, k); + } + var K = [ + 1116352408, + 3609767458, + 1899447441, + 602891725, + 3049323471, + 3964484399, + 3921009573, + 2173295548, + 961987163, + 4081628472, + 1508970993, + 3053834265, + 2453635748, + 2937671579, + 2870763221, + 3664609560, + 3624381080, + 2734883394, + 310598401, + 1164996542, + 607225278, + 1323610764, + 1426881987, + 3590304994, + 1925078388, + 4068182383, + 2162078206, + 991336113, + 2614888103, + 633803317, + 3248222580, + 3479774868, + 3835390401, + 2666613458, + 4022224774, + 944711139, + 264347078, + 2341262773, + 604807628, + 2007800933, + 770255983, + 1495990901, + 1249150122, + 1856431235, + 1555081692, + 3175218132, + 1996064986, + 2198950837, + 2554220882, + 3999719339, + 2821834349, + 766784016, + 2952996808, + 2566594879, + 3210313671, + 3203337956, + 3336571891, + 1034457026, + 3584528711, + 2466948901, + 113926993, + 3758326383, + 338241895, + 168717936, + 666307205, + 1188179964, + 773529912, + 1546045734, + 1294757372, + 1522805485, + 1396182291, + 2643833823, + 1695183700, + 2343527390, + 1986661051, + 1014477480, + 2177026350, + 1206759142, + 2456956037, + 344077627, + 2730485921, + 1290863460, + 2820302411, + 3158454273, + 3259730800, + 3505952657, + 3345764771, + 106217008, + 3516065817, + 3606008344, + 3600352804, + 1432725776, + 4094571909, + 1467031594, + 275423344, + 851169720, + 430227734, + 3100823752, + 506948616, + 1363258195, + 659060556, + 3750685593, + 883997877, + 3785050280, + 958139571, + 3318307427, + 1322822218, + 3812723403, + 1537002063, + 2003034995, + 1747873779, + 3602036899, + 1955562222, + 1575990012, + 2024104815, + 1125592928, + 2227730452, + 2716904306, + 2361852424, + 442776044, + 2428436474, + 593698344, + 2756734187, + 3733110249, + 3204031479, + 2999351573, + 3329325298, + 3815920427, + 3391569614, + 3928383900, + 3515267271, + 566280711, + 3940187606, + 3454069534, + 4118630271, + 4000239992, + 116418474, + 1914138554, + 174292421, + 2731055270, + 289380356, + 3203993006, + 460393269, + 320620315, + 685471733, + 587496836, + 852142971, + 1086792851, + 1017036298, + 365543100, + 1126000580, + 2618297676, + 1288033470, + 3409855158, + 1501505948, + 4234509866, + 1607167915, + 987167468, + 1816402316, + 1246189591 + ]; + function crypto_hashblocks_hl(hh, hl, m, n) { + var wh = new Int32Array(16), wl = new Int32Array(16), bh0, bh1, bh2, bh3, bh4, bh5, bh6, bh7, bl0, bl1, bl2, bl3, bl4, bl5, bl6, bl7, th, tl, i, j, h, l, a, b, c, d; + var ah0 = hh[0], ah1 = hh[1], ah2 = hh[2], ah3 = hh[3], ah4 = hh[4], ah5 = hh[5], ah6 = hh[6], ah7 = hh[7], al0 = hl[0], al1 = hl[1], al2 = hl[2], al3 = hl[3], al4 = hl[4], al5 = hl[5], al6 = hl[6], al7 = hl[7]; + var pos = 0; + while (n >= 128) { + for (i = 0; i < 16; i++) { + j = 8 * i + pos; + wh[i] = m[j + 0] << 24 | m[j + 1] << 16 | m[j + 2] << 8 | m[j + 3]; + wl[i] = m[j + 4] << 24 | m[j + 5] << 16 | m[j + 6] << 8 | m[j + 7]; + } + for (i = 0; i < 80; i++) { + bh0 = ah0; + bh1 = ah1; + bh2 = ah2; + bh3 = ah3; + bh4 = ah4; + bh5 = ah5; + bh6 = ah6; + bh7 = ah7; + bl0 = al0; + bl1 = al1; + bl2 = al2; + bl3 = al3; + bl4 = al4; + bl5 = al5; + bl6 = al6; + bl7 = al7; + h = ah7; + l = al7; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = (ah4 >>> 14 | al4 << 32 - 14) ^ (ah4 >>> 18 | al4 << 32 - 18) ^ (al4 >>> 41 - 32 | ah4 << 32 - (41 - 32)); + l = (al4 >>> 14 | ah4 << 32 - 14) ^ (al4 >>> 18 | ah4 << 32 - 18) ^ (ah4 >>> 41 - 32 | al4 << 32 - (41 - 32)); + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + h = ah4 & ah5 ^ ~ah4 & ah6; + l = al4 & al5 ^ ~al4 & al6; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + h = K[i * 2]; + l = K[i * 2 + 1]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + h = wh[i % 16]; + l = wl[i % 16]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + th = c & 65535 | d << 16; + tl = a & 65535 | b << 16; + h = th; + l = tl; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = (ah0 >>> 28 | al0 << 32 - 28) ^ (al0 >>> 34 - 32 | ah0 << 32 - (34 - 32)) ^ (al0 >>> 39 - 32 | ah0 << 32 - (39 - 32)); + l = (al0 >>> 28 | ah0 << 32 - 28) ^ (ah0 >>> 34 - 32 | al0 << 32 - (34 - 32)) ^ (ah0 >>> 39 - 32 | al0 << 32 - (39 - 32)); + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + h = ah0 & ah1 ^ ah0 & ah2 ^ ah1 & ah2; + l = al0 & al1 ^ al0 & al2 ^ al1 & al2; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + bh7 = c & 65535 | d << 16; + bl7 = a & 65535 | b << 16; + h = bh3; + l = bl3; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = th; + l = tl; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + bh3 = c & 65535 | d << 16; + bl3 = a & 65535 | b << 16; + ah1 = bh0; + ah2 = bh1; + ah3 = bh2; + ah4 = bh3; + ah5 = bh4; + ah6 = bh5; + ah7 = bh6; + ah0 = bh7; + al1 = bl0; + al2 = bl1; + al3 = bl2; + al4 = bl3; + al5 = bl4; + al6 = bl5; + al7 = bl6; + al0 = bl7; + if (i % 16 === 15) { + for (j = 0; j < 16; j++) { + h = wh[j]; + l = wl[j]; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = wh[(j + 9) % 16]; + l = wl[(j + 9) % 16]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + th = wh[(j + 1) % 16]; + tl = wl[(j + 1) % 16]; + h = (th >>> 1 | tl << 32 - 1) ^ (th >>> 8 | tl << 32 - 8) ^ th >>> 7; + l = (tl >>> 1 | th << 32 - 1) ^ (tl >>> 8 | th << 32 - 8) ^ (tl >>> 7 | th << 32 - 7); + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + th = wh[(j + 14) % 16]; + tl = wl[(j + 14) % 16]; + h = (th >>> 19 | tl << 32 - 19) ^ (tl >>> 61 - 32 | th << 32 - (61 - 32)) ^ th >>> 6; + l = (tl >>> 19 | th << 32 - 19) ^ (th >>> 61 - 32 | tl << 32 - (61 - 32)) ^ (tl >>> 6 | th << 32 - 6); + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + wh[j] = c & 65535 | d << 16; + wl[j] = a & 65535 | b << 16; + } + } + } + h = ah0; + l = al0; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = hh[0]; + l = hl[0]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + hh[0] = ah0 = c & 65535 | d << 16; + hl[0] = al0 = a & 65535 | b << 16; + h = ah1; + l = al1; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = hh[1]; + l = hl[1]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + hh[1] = ah1 = c & 65535 | d << 16; + hl[1] = al1 = a & 65535 | b << 16; + h = ah2; + l = al2; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = hh[2]; + l = hl[2]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + hh[2] = ah2 = c & 65535 | d << 16; + hl[2] = al2 = a & 65535 | b << 16; + h = ah3; + l = al3; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = hh[3]; + l = hl[3]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + hh[3] = ah3 = c & 65535 | d << 16; + hl[3] = al3 = a & 65535 | b << 16; + h = ah4; + l = al4; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = hh[4]; + l = hl[4]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + hh[4] = ah4 = c & 65535 | d << 16; + hl[4] = al4 = a & 65535 | b << 16; + h = ah5; + l = al5; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = hh[5]; + l = hl[5]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + hh[5] = ah5 = c & 65535 | d << 16; + hl[5] = al5 = a & 65535 | b << 16; + h = ah6; + l = al6; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = hh[6]; + l = hl[6]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + hh[6] = ah6 = c & 65535 | d << 16; + hl[6] = al6 = a & 65535 | b << 16; + h = ah7; + l = al7; + a = l & 65535; + b = l >>> 16; + c = h & 65535; + d = h >>> 16; + h = hh[7]; + l = hl[7]; + a += l & 65535; + b += l >>> 16; + c += h & 65535; + d += h >>> 16; + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + hh[7] = ah7 = c & 65535 | d << 16; + hl[7] = al7 = a & 65535 | b << 16; + pos += 128; + n -= 128; + } + return n; + } + function crypto_hash(out, m, n) { + var hh = new Int32Array(8), hl = new Int32Array(8), x = new Uint8Array(256), i, b = n; + hh[0] = 1779033703; + hh[1] = 3144134277; + hh[2] = 1013904242; + hh[3] = 2773480762; + hh[4] = 1359893119; + hh[5] = 2600822924; + hh[6] = 528734635; + hh[7] = 1541459225; + hl[0] = 4089235720; + hl[1] = 2227873595; + hl[2] = 4271175723; + hl[3] = 1595750129; + hl[4] = 2917565137; + hl[5] = 725511199; + hl[6] = 4215389547; + hl[7] = 327033209; + crypto_hashblocks_hl(hh, hl, m, n); + n %= 128; + for (i = 0; i < n; i++) + x[i] = m[b - n + i]; + x[n] = 128; + n = 256 - 128 * (n < 112 ? 1 : 0); + x[n - 9] = 0; + ts64(x, n - 8, b / 536870912 | 0, b << 3); + crypto_hashblocks_hl(hh, hl, x, n); + for (i = 0; i < 8; i++) + ts64(out, 8 * i, hh[i], hl[i]); + return 0; + } + function add(p, q) { + var a = gf(), b = gf(), c = gf(), d = gf(), e = gf(), f = gf(), g = gf(), h = gf(), t = gf(); + Z(a, p[1], p[0]); + Z(t, q[1], q[0]); + M(a, a, t); + A(b, p[0], p[1]); + A(t, q[0], q[1]); + M(b, b, t); + M(c, p[3], q[3]); + M(c, c, D2); + M(d, p[2], q[2]); + A(d, d, d); + Z(e, b, a); + Z(f, d, c); + A(g, d, c); + A(h, b, a); + M(p[0], e, f); + M(p[1], h, g); + M(p[2], g, f); + M(p[3], e, h); + } + function cswap(p, q, b) { + var i; + for (i = 0; i < 4; i++) { + sel25519(p[i], q[i], b); + } + } + function pack(r, p) { + var tx = gf(), ty = gf(), zi = gf(); + inv25519(zi, p[2]); + M(tx, p[0], zi); + M(ty, p[1], zi); + pack25519(r, ty); + r[31] ^= par25519(tx) << 7; + } + function scalarmult(p, q, s) { + var b, i; + set25519(p[0], gf0); + set25519(p[1], gf1); + set25519(p[2], gf1); + set25519(p[3], gf0); + for (i = 255; i >= 0; --i) { + b = s[i / 8 | 0] >> (i & 7) & 1; + cswap(p, q, b); + add(q, p); + add(p, p); + cswap(p, q, b); + } + } + function scalarbase(p, s) { + var q = [gf(), gf(), gf(), gf()]; + set25519(q[0], X); + set25519(q[1], Y); + set25519(q[2], gf1); + M(q[3], X, Y); + scalarmult(p, q, s); + } + function crypto_sign_keypair(pk, sk, seeded) { + var d = new Uint8Array(64); + var p = [gf(), gf(), gf(), gf()]; + var i; + if (!seeded) + randombytes(sk, 32); + crypto_hash(d, sk, 32); + d[0] &= 248; + d[31] &= 127; + d[31] |= 64; + scalarbase(p, d); + pack(pk, p); + for (i = 0; i < 32; i++) + sk[i + 32] = pk[i]; + return 0; + } + var L2 = new Float64Array([237, 211, 245, 92, 26, 99, 18, 88, 214, 156, 247, 162, 222, 249, 222, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16]); + function modL(r, x) { + var carry, i, j, k; + for (i = 63; i >= 32; --i) { + carry = 0; + for (j = i - 32, k = i - 12; j < k; ++j) { + x[j] += carry - 16 * x[i] * L2[j - (i - 32)]; + carry = Math.floor((x[j] + 128) / 256); + x[j] -= carry * 256; + } + x[j] += carry; + x[i] = 0; + } + carry = 0; + for (j = 0; j < 32; j++) { + x[j] += carry - (x[31] >> 4) * L2[j]; + carry = x[j] >> 8; + x[j] &= 255; + } + for (j = 0; j < 32; j++) + x[j] -= carry * L2[j]; + for (i = 0; i < 32; i++) { + x[i + 1] += x[i] >> 8; + r[i] = x[i] & 255; + } + } + function reduce(r) { + var x = new Float64Array(64), i; + for (i = 0; i < 64; i++) + x[i] = r[i]; + for (i = 0; i < 64; i++) + r[i] = 0; + modL(r, x); + } + function crypto_sign(sm, m, n, sk) { + var d = new Uint8Array(64), h = new Uint8Array(64), r = new Uint8Array(64); + var i, j, x = new Float64Array(64); + var p = [gf(), gf(), gf(), gf()]; + crypto_hash(d, sk, 32); + d[0] &= 248; + d[31] &= 127; + d[31] |= 64; + var smlen = n + 64; + for (i = 0; i < n; i++) + sm[64 + i] = m[i]; + for (i = 0; i < 32; i++) + sm[32 + i] = d[32 + i]; + crypto_hash(r, sm.subarray(32), n + 32); + reduce(r); + scalarbase(p, r); + pack(sm, p); + for (i = 32; i < 64; i++) + sm[i] = sk[i]; + crypto_hash(h, sm, n + 64); + reduce(h); + for (i = 0; i < 64; i++) + x[i] = 0; + for (i = 0; i < 32; i++) + x[i] = r[i]; + for (i = 0; i < 32; i++) { + for (j = 0; j < 32; j++) { + x[i + j] += h[i] * d[j]; + } + } + modL(sm.subarray(32), x); + return smlen; + } + function unpackneg(r, p) { + var t = gf(), chk = gf(), num = gf(), den = gf(), den2 = gf(), den4 = gf(), den6 = gf(); + set25519(r[2], gf1); + unpack25519(r[1], p); + S(num, r[1]); + M(den, num, D); + Z(num, num, r[2]); + A(den, r[2], den); + S(den2, den); + S(den4, den2); + M(den6, den4, den2); + M(t, den6, num); + M(t, t, den); + pow2523(t, t); + M(t, t, num); + M(t, t, den); + M(t, t, den); + M(r[0], t, den); + S(chk, r[0]); + M(chk, chk, den); + if (neq25519(chk, num)) + M(r[0], r[0], I); + S(chk, r[0]); + M(chk, chk, den); + if (neq25519(chk, num)) + return -1; + if (par25519(r[0]) === p[31] >> 7) + Z(r[0], gf0, r[0]); + M(r[3], r[0], r[1]); + return 0; + } + function crypto_sign_open(m, sm, n, pk) { + var i; + var t = new Uint8Array(32), h = new Uint8Array(64); + var p = [gf(), gf(), gf(), gf()], q = [gf(), gf(), gf(), gf()]; + if (n < 64) + return -1; + if (unpackneg(q, pk)) + return -1; + for (i = 0; i < n; i++) + m[i] = sm[i]; + for (i = 0; i < 32; i++) + m[i + 32] = pk[i]; + crypto_hash(h, m, n); + reduce(h); + scalarmult(p, q, h); + scalarbase(q, sm.subarray(32)); + add(p, q); + pack(t, p); + n -= 64; + if (crypto_verify_32(sm, 0, t, 0)) { + for (i = 0; i < n; i++) + m[i] = 0; + return -1; + } + for (i = 0; i < n; i++) + m[i] = sm[i + 64]; + return n; + } + var crypto_secretbox_KEYBYTES = 32, crypto_secretbox_NONCEBYTES = 24, crypto_secretbox_ZEROBYTES = 32, crypto_secretbox_BOXZEROBYTES = 16, crypto_scalarmult_BYTES = 32, crypto_scalarmult_SCALARBYTES = 32, crypto_box_PUBLICKEYBYTES = 32, crypto_box_SECRETKEYBYTES = 32, crypto_box_BEFORENMBYTES = 32, crypto_box_NONCEBYTES = crypto_secretbox_NONCEBYTES, crypto_box_ZEROBYTES = crypto_secretbox_ZEROBYTES, crypto_box_BOXZEROBYTES = crypto_secretbox_BOXZEROBYTES, crypto_sign_BYTES = 64, crypto_sign_PUBLICKEYBYTES = 32, crypto_sign_SECRETKEYBYTES = 64, crypto_sign_SEEDBYTES = 32, crypto_hash_BYTES = 64; + nacl2.lowlevel = { + crypto_core_hsalsa20, + crypto_stream_xor, + crypto_stream, + crypto_stream_salsa20_xor, + crypto_stream_salsa20, + crypto_onetimeauth, + crypto_onetimeauth_verify, + crypto_verify_16, + crypto_verify_32, + crypto_secretbox, + crypto_secretbox_open, + crypto_scalarmult, + crypto_scalarmult_base, + crypto_box_beforenm, + crypto_box_afternm, + crypto_box, + crypto_box_open, + crypto_box_keypair, + crypto_hash, + crypto_sign, + crypto_sign_keypair, + crypto_sign_open, + crypto_secretbox_KEYBYTES, + crypto_secretbox_NONCEBYTES, + crypto_secretbox_ZEROBYTES, + crypto_secretbox_BOXZEROBYTES, + crypto_scalarmult_BYTES, + crypto_scalarmult_SCALARBYTES, + crypto_box_PUBLICKEYBYTES, + crypto_box_SECRETKEYBYTES, + crypto_box_BEFORENMBYTES, + crypto_box_NONCEBYTES, + crypto_box_ZEROBYTES, + crypto_box_BOXZEROBYTES, + crypto_sign_BYTES, + crypto_sign_PUBLICKEYBYTES, + crypto_sign_SECRETKEYBYTES, + crypto_sign_SEEDBYTES, + crypto_hash_BYTES, + gf, + D, + L: L2, + pack25519, + unpack25519, + M, + A, + S, + Z, + pow2523, + add, + set25519, + modL, + scalarmult, + scalarbase + }; + function checkLengths(k, n) { + if (k.length !== crypto_secretbox_KEYBYTES) + throw new Error("bad key size"); + if (n.length !== crypto_secretbox_NONCEBYTES) + throw new Error("bad nonce size"); + } + function checkBoxLengths(pk, sk) { + if (pk.length !== crypto_box_PUBLICKEYBYTES) + throw new Error("bad public key size"); + if (sk.length !== crypto_box_SECRETKEYBYTES) + throw new Error("bad secret key size"); + } + function checkArrayTypes() { + for (var i = 0; i < arguments.length; i++) { + if (!(arguments[i] instanceof Uint8Array)) + throw new TypeError("unexpected type, use Uint8Array"); + } + } + function cleanup(arr) { + for (var i = 0; i < arr.length; i++) + arr[i] = 0; + } + nacl2.randomBytes = function(n) { + var b = new Uint8Array(n); + randombytes(b, n); + return b; + }; + nacl2.secretbox = function(msg, nonce, key) { + checkArrayTypes(msg, nonce, key); + checkLengths(key, nonce); + var m = new Uint8Array(crypto_secretbox_ZEROBYTES + msg.length); + var c = new Uint8Array(m.length); + for (var i = 0; i < msg.length; i++) + m[i + crypto_secretbox_ZEROBYTES] = msg[i]; + crypto_secretbox(c, m, m.length, nonce, key); + return c.subarray(crypto_secretbox_BOXZEROBYTES); + }; + nacl2.secretbox.open = function(box, nonce, key) { + checkArrayTypes(box, nonce, key); + checkLengths(key, nonce); + var c = new Uint8Array(crypto_secretbox_BOXZEROBYTES + box.length); + var m = new Uint8Array(c.length); + for (var i = 0; i < box.length; i++) + c[i + crypto_secretbox_BOXZEROBYTES] = box[i]; + if (c.length < 32) + return null; + if (crypto_secretbox_open(m, c, c.length, nonce, key) !== 0) + return null; + return m.subarray(crypto_secretbox_ZEROBYTES); + }; + nacl2.secretbox.keyLength = crypto_secretbox_KEYBYTES; + nacl2.secretbox.nonceLength = crypto_secretbox_NONCEBYTES; + nacl2.secretbox.overheadLength = crypto_secretbox_BOXZEROBYTES; + nacl2.scalarMult = function(n, p) { + checkArrayTypes(n, p); + if (n.length !== crypto_scalarmult_SCALARBYTES) + throw new Error("bad n size"); + if (p.length !== crypto_scalarmult_BYTES) + throw new Error("bad p size"); + var q = new Uint8Array(crypto_scalarmult_BYTES); + crypto_scalarmult(q, n, p); + return q; + }; + nacl2.scalarMult.base = function(n) { + checkArrayTypes(n); + if (n.length !== crypto_scalarmult_SCALARBYTES) + throw new Error("bad n size"); + var q = new Uint8Array(crypto_scalarmult_BYTES); + crypto_scalarmult_base(q, n); + return q; + }; + nacl2.scalarMult.scalarLength = crypto_scalarmult_SCALARBYTES; + nacl2.scalarMult.groupElementLength = crypto_scalarmult_BYTES; + nacl2.box = function(msg, nonce, publicKey, secretKey) { + var k = nacl2.box.before(publicKey, secretKey); + return nacl2.secretbox(msg, nonce, k); + }; + nacl2.box.before = function(publicKey, secretKey) { + checkArrayTypes(publicKey, secretKey); + checkBoxLengths(publicKey, secretKey); + var k = new Uint8Array(crypto_box_BEFORENMBYTES); + crypto_box_beforenm(k, publicKey, secretKey); + return k; + }; + nacl2.box.after = nacl2.secretbox; + nacl2.box.open = function(msg, nonce, publicKey, secretKey) { + var k = nacl2.box.before(publicKey, secretKey); + return nacl2.secretbox.open(msg, nonce, k); + }; + nacl2.box.open.after = nacl2.secretbox.open; + nacl2.box.keyPair = function() { + var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES); + var sk = new Uint8Array(crypto_box_SECRETKEYBYTES); + crypto_box_keypair(pk, sk); + return { publicKey: pk, secretKey: sk }; + }; + nacl2.box.keyPair.fromSecretKey = function(secretKey) { + checkArrayTypes(secretKey); + if (secretKey.length !== crypto_box_SECRETKEYBYTES) + throw new Error("bad secret key size"); + var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES); + crypto_scalarmult_base(pk, secretKey); + return { publicKey: pk, secretKey: new Uint8Array(secretKey) }; + }; + nacl2.box.publicKeyLength = crypto_box_PUBLICKEYBYTES; + nacl2.box.secretKeyLength = crypto_box_SECRETKEYBYTES; + nacl2.box.sharedKeyLength = crypto_box_BEFORENMBYTES; + nacl2.box.nonceLength = crypto_box_NONCEBYTES; + nacl2.box.overheadLength = nacl2.secretbox.overheadLength; + nacl2.sign = function(msg, secretKey) { + checkArrayTypes(msg, secretKey); + if (secretKey.length !== crypto_sign_SECRETKEYBYTES) + throw new Error("bad secret key size"); + var signedMsg = new Uint8Array(crypto_sign_BYTES + msg.length); + crypto_sign(signedMsg, msg, msg.length, secretKey); + return signedMsg; + }; + nacl2.sign.open = function(signedMsg, publicKey) { + checkArrayTypes(signedMsg, publicKey); + if (publicKey.length !== crypto_sign_PUBLICKEYBYTES) + throw new Error("bad public key size"); + var tmp = new Uint8Array(signedMsg.length); + var mlen = crypto_sign_open(tmp, signedMsg, signedMsg.length, publicKey); + if (mlen < 0) + return null; + var m = new Uint8Array(mlen); + for (var i = 0; i < m.length; i++) + m[i] = tmp[i]; + return m; + }; + nacl2.sign.detached = function(msg, secretKey) { + var signedMsg = nacl2.sign(msg, secretKey); + var sig = new Uint8Array(crypto_sign_BYTES); + for (var i = 0; i < sig.length; i++) + sig[i] = signedMsg[i]; + return sig; + }; + nacl2.sign.detached.verify = function(msg, sig, publicKey) { + checkArrayTypes(msg, sig, publicKey); + if (sig.length !== crypto_sign_BYTES) + throw new Error("bad signature size"); + if (publicKey.length !== crypto_sign_PUBLICKEYBYTES) + throw new Error("bad public key size"); + var sm = new Uint8Array(crypto_sign_BYTES + msg.length); + var m = new Uint8Array(crypto_sign_BYTES + msg.length); + var i; + for (i = 0; i < crypto_sign_BYTES; i++) + sm[i] = sig[i]; + for (i = 0; i < msg.length; i++) + sm[i + crypto_sign_BYTES] = msg[i]; + return crypto_sign_open(m, sm, sm.length, publicKey) >= 0; + }; + nacl2.sign.keyPair = function() { + var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES); + var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES); + crypto_sign_keypair(pk, sk); + return { publicKey: pk, secretKey: sk }; + }; + nacl2.sign.keyPair.fromSecretKey = function(secretKey) { + checkArrayTypes(secretKey); + if (secretKey.length !== crypto_sign_SECRETKEYBYTES) + throw new Error("bad secret key size"); + var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES); + for (var i = 0; i < pk.length; i++) + pk[i] = secretKey[32 + i]; + return { publicKey: pk, secretKey: new Uint8Array(secretKey) }; + }; + nacl2.sign.keyPair.fromSeed = function(seed) { + checkArrayTypes(seed); + if (seed.length !== crypto_sign_SEEDBYTES) + throw new Error("bad seed size"); + var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES); + var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES); + for (var i = 0; i < 32; i++) + sk[i] = seed[i]; + crypto_sign_keypair(pk, sk, true); + return { publicKey: pk, secretKey: sk }; + }; + nacl2.sign.publicKeyLength = crypto_sign_PUBLICKEYBYTES; + nacl2.sign.secretKeyLength = crypto_sign_SECRETKEYBYTES; + nacl2.sign.seedLength = crypto_sign_SEEDBYTES; + nacl2.sign.signatureLength = crypto_sign_BYTES; + nacl2.hash = function(msg) { + checkArrayTypes(msg); + var h = new Uint8Array(crypto_hash_BYTES); + crypto_hash(h, msg, msg.length); + return h; + }; + nacl2.hash.hashLength = crypto_hash_BYTES; + nacl2.verify = function(x, y) { + checkArrayTypes(x, y); + if (x.length === 0 || y.length === 0) + return false; + if (x.length !== y.length) + return false; + return vn(x, 0, y, 0, x.length) === 0 ? true : false; + }; + nacl2.setPRNG = function(fn) { + randombytes = fn; + }; + (function() { + var crypto2 = typeof self !== "undefined" ? self.crypto || self.msCrypto : null; + if (crypto2 && crypto2.getRandomValues) { + var QUOTA = 65536; + nacl2.setPRNG(function(x, n) { + var i, v = new Uint8Array(n); + for (i = 0; i < n; i += QUOTA) { + crypto2.getRandomValues(v.subarray(i, i + Math.min(n - i, QUOTA))); + } + for (i = 0; i < n; i++) + x[i] = v[i]; + cleanup(v); + }); + } else if (typeof __require !== "undefined") { + crypto2 = require_crypto(); + if (crypto2 && crypto2.randomBytes) { + nacl2.setPRNG(function(x, n) { + var i, v = crypto2.randomBytes(n); + for (i = 0; i < n; i++) + x[i] = v[i]; + cleanup(v); + }); + } + } + })(); + })(typeof module !== "undefined" && module.exports ? module.exports : self.nacl = self.nacl || {}); + } + }); + + // node_modules/scrypt-async/scrypt-async.js + var require_scrypt_async = __commonJS({ + "node_modules/scrypt-async/scrypt-async.js"(exports, module) { + function scrypt2(password, salt, logN, r, dkLen, interruptStep, callback, encoding) { + "use strict"; + function SHA256(m) { + var K = [ + 1116352408, + 1899447441, + 3049323471, + 3921009573, + 961987163, + 1508970993, + 2453635748, + 2870763221, + 3624381080, + 310598401, + 607225278, + 1426881987, + 1925078388, + 2162078206, + 2614888103, + 3248222580, + 3835390401, + 4022224774, + 264347078, + 604807628, + 770255983, + 1249150122, + 1555081692, + 1996064986, + 2554220882, + 2821834349, + 2952996808, + 3210313671, + 3336571891, + 3584528711, + 113926993, + 338241895, + 666307205, + 773529912, + 1294757372, + 1396182291, + 1695183700, + 1986661051, + 2177026350, + 2456956037, + 2730485921, + 2820302411, + 3259730800, + 3345764771, + 3516065817, + 3600352804, + 4094571909, + 275423344, + 430227734, + 506948616, + 659060556, + 883997877, + 958139571, + 1322822218, + 1537002063, + 1747873779, + 1955562222, + 2024104815, + 2227730452, + 2361852424, + 2428436474, + 2756734187, + 3204031479, + 3329325298 + ]; + var h0 = 1779033703, h1 = 3144134277, h2 = 1013904242, h3 = 2773480762, h4 = 1359893119, h5 = 2600822924, h6 = 528734635, h7 = 1541459225, w = new Array(64); + function blocks(p3) { + var off = 0, len = p3.length; + while (len >= 64) { + var a = h0, b = h1, c = h2, d = h3, e = h4, f = h5, g = h6, h = h7, u, i2, j, t1, t2; + for (i2 = 0; i2 < 16; i2++) { + j = off + i2 * 4; + w[i2] = (p3[j] & 255) << 24 | (p3[j + 1] & 255) << 16 | (p3[j + 2] & 255) << 8 | p3[j + 3] & 255; + } + for (i2 = 16; i2 < 64; i2++) { + u = w[i2 - 2]; + t1 = (u >>> 17 | u << 32 - 17) ^ (u >>> 19 | u << 32 - 19) ^ u >>> 10; + u = w[i2 - 15]; + t2 = (u >>> 7 | u << 32 - 7) ^ (u >>> 18 | u << 32 - 18) ^ u >>> 3; + w[i2] = (t1 + w[i2 - 7] | 0) + (t2 + w[i2 - 16] | 0) | 0; + } + for (i2 = 0; i2 < 64; i2++) { + t1 = (((e >>> 6 | e << 32 - 6) ^ (e >>> 11 | e << 32 - 11) ^ (e >>> 25 | e << 32 - 25)) + (e & f ^ ~e & g) | 0) + (h + (K[i2] + w[i2] | 0) | 0) | 0; + t2 = ((a >>> 2 | a << 32 - 2) ^ (a >>> 13 | a << 32 - 13) ^ (a >>> 22 | a << 32 - 22)) + (a & b ^ a & c ^ b & c) | 0; + h = g; + g = f; + f = e; + e = d + t1 | 0; + d = c; + c = b; + b = a; + a = t1 + t2 | 0; + } + h0 = h0 + a | 0; + h1 = h1 + b | 0; + h2 = h2 + c | 0; + h3 = h3 + d | 0; + h4 = h4 + e | 0; + h5 = h5 + f | 0; + h6 = h6 + g | 0; + h7 = h7 + h | 0; + off += 64; + len -= 64; + } + } + blocks(m); + var i, bytesLeft = m.length % 64, bitLenHi = m.length / 536870912 | 0, bitLenLo = m.length << 3, numZeros = bytesLeft < 56 ? 56 : 120, p2 = m.slice(m.length - bytesLeft, m.length); + p2.push(128); + for (i = bytesLeft + 1; i < numZeros; i++) + p2.push(0); + p2.push(bitLenHi >>> 24 & 255); + p2.push(bitLenHi >>> 16 & 255); + p2.push(bitLenHi >>> 8 & 255); + p2.push(bitLenHi >>> 0 & 255); + p2.push(bitLenLo >>> 24 & 255); + p2.push(bitLenLo >>> 16 & 255); + p2.push(bitLenLo >>> 8 & 255); + p2.push(bitLenLo >>> 0 & 255); + blocks(p2); + return [ + h0 >>> 24 & 255, + h0 >>> 16 & 255, + h0 >>> 8 & 255, + h0 >>> 0 & 255, + h1 >>> 24 & 255, + h1 >>> 16 & 255, + h1 >>> 8 & 255, + h1 >>> 0 & 255, + h2 >>> 24 & 255, + h2 >>> 16 & 255, + h2 >>> 8 & 255, + h2 >>> 0 & 255, + h3 >>> 24 & 255, + h3 >>> 16 & 255, + h3 >>> 8 & 255, + h3 >>> 0 & 255, + h4 >>> 24 & 255, + h4 >>> 16 & 255, + h4 >>> 8 & 255, + h4 >>> 0 & 255, + h5 >>> 24 & 255, + h5 >>> 16 & 255, + h5 >>> 8 & 255, + h5 >>> 0 & 255, + h6 >>> 24 & 255, + h6 >>> 16 & 255, + h6 >>> 8 & 255, + h6 >>> 0 & 255, + h7 >>> 24 & 255, + h7 >>> 16 & 255, + h7 >>> 8 & 255, + h7 >>> 0 & 255 + ]; + } + function PBKDF2_HMAC_SHA256_OneIter(password2, salt2, dkLen2) { + if (password2.length > 64) { + password2 = SHA256(password2.push ? password2 : Array.prototype.slice.call(password2, 0)); + } + var i, innerLen = 64 + salt2.length + 4, inner = new Array(innerLen), outerKey = new Array(64), dk = []; + for (i = 0; i < 64; i++) + inner[i] = 54; + for (i = 0; i < password2.length; i++) + inner[i] ^= password2[i]; + for (i = 0; i < salt2.length; i++) + inner[64 + i] = salt2[i]; + for (i = innerLen - 4; i < innerLen; i++) + inner[i] = 0; + for (i = 0; i < 64; i++) + outerKey[i] = 92; + for (i = 0; i < password2.length; i++) + outerKey[i] ^= password2[i]; + function incrementCounter() { + for (var i2 = innerLen - 1; i2 >= innerLen - 4; i2--) { + inner[i2]++; + if (inner[i2] <= 255) + return; + inner[i2] = 0; + } + } + while (dkLen2 >= 32) { + incrementCounter(); + dk = dk.concat(SHA256(outerKey.concat(SHA256(inner)))); + dkLen2 -= 32; + } + if (dkLen2 > 0) { + incrementCounter(); + dk = dk.concat(SHA256(outerKey.concat(SHA256(inner))).slice(0, dkLen2)); + } + return dk; + } + function salsaXOR(tmp2, B2, bin, bout) { + var j0 = tmp2[0] ^ B2[bin++], j1 = tmp2[1] ^ B2[bin++], j2 = tmp2[2] ^ B2[bin++], j3 = tmp2[3] ^ B2[bin++], j4 = tmp2[4] ^ B2[bin++], j5 = tmp2[5] ^ B2[bin++], j6 = tmp2[6] ^ B2[bin++], j7 = tmp2[7] ^ B2[bin++], j8 = tmp2[8] ^ B2[bin++], j9 = tmp2[9] ^ B2[bin++], j10 = tmp2[10] ^ B2[bin++], j11 = tmp2[11] ^ B2[bin++], j12 = tmp2[12] ^ B2[bin++], j13 = tmp2[13] ^ B2[bin++], j14 = tmp2[14] ^ B2[bin++], j15 = tmp2[15] ^ B2[bin++], u, i; + var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7, x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14, x15 = j15; + for (i = 0; i < 8; i += 2) { + u = x0 + x12; + x4 ^= u << 7 | u >>> 32 - 7; + u = x4 + x0; + x8 ^= u << 9 | u >>> 32 - 9; + u = x8 + x4; + x12 ^= u << 13 | u >>> 32 - 13; + u = x12 + x8; + x0 ^= u << 18 | u >>> 32 - 18; + u = x5 + x1; + x9 ^= u << 7 | u >>> 32 - 7; + u = x9 + x5; + x13 ^= u << 9 | u >>> 32 - 9; + u = x13 + x9; + x1 ^= u << 13 | u >>> 32 - 13; + u = x1 + x13; + x5 ^= u << 18 | u >>> 32 - 18; + u = x10 + x6; + x14 ^= u << 7 | u >>> 32 - 7; + u = x14 + x10; + x2 ^= u << 9 | u >>> 32 - 9; + u = x2 + x14; + x6 ^= u << 13 | u >>> 32 - 13; + u = x6 + x2; + x10 ^= u << 18 | u >>> 32 - 18; + u = x15 + x11; + x3 ^= u << 7 | u >>> 32 - 7; + u = x3 + x15; + x7 ^= u << 9 | u >>> 32 - 9; + u = x7 + x3; + x11 ^= u << 13 | u >>> 32 - 13; + u = x11 + x7; + x15 ^= u << 18 | u >>> 32 - 18; + u = x0 + x3; + x1 ^= u << 7 | u >>> 32 - 7; + u = x1 + x0; + x2 ^= u << 9 | u >>> 32 - 9; + u = x2 + x1; + x3 ^= u << 13 | u >>> 32 - 13; + u = x3 + x2; + x0 ^= u << 18 | u >>> 32 - 18; + u = x5 + x4; + x6 ^= u << 7 | u >>> 32 - 7; + u = x6 + x5; + x7 ^= u << 9 | u >>> 32 - 9; + u = x7 + x6; + x4 ^= u << 13 | u >>> 32 - 13; + u = x4 + x7; + x5 ^= u << 18 | u >>> 32 - 18; + u = x10 + x9; + x11 ^= u << 7 | u >>> 32 - 7; + u = x11 + x10; + x8 ^= u << 9 | u >>> 32 - 9; + u = x8 + x11; + x9 ^= u << 13 | u >>> 32 - 13; + u = x9 + x8; + x10 ^= u << 18 | u >>> 32 - 18; + u = x15 + x14; + x12 ^= u << 7 | u >>> 32 - 7; + u = x12 + x15; + x13 ^= u << 9 | u >>> 32 - 9; + u = x13 + x12; + x14 ^= u << 13 | u >>> 32 - 13; + u = x14 + x13; + x15 ^= u << 18 | u >>> 32 - 18; + } + B2[bout++] = tmp2[0] = x0 + j0 | 0; + B2[bout++] = tmp2[1] = x1 + j1 | 0; + B2[bout++] = tmp2[2] = x2 + j2 | 0; + B2[bout++] = tmp2[3] = x3 + j3 | 0; + B2[bout++] = tmp2[4] = x4 + j4 | 0; + B2[bout++] = tmp2[5] = x5 + j5 | 0; + B2[bout++] = tmp2[6] = x6 + j6 | 0; + B2[bout++] = tmp2[7] = x7 + j7 | 0; + B2[bout++] = tmp2[8] = x8 + j8 | 0; + B2[bout++] = tmp2[9] = x9 + j9 | 0; + B2[bout++] = tmp2[10] = x10 + j10 | 0; + B2[bout++] = tmp2[11] = x11 + j11 | 0; + B2[bout++] = tmp2[12] = x12 + j12 | 0; + B2[bout++] = tmp2[13] = x13 + j13 | 0; + B2[bout++] = tmp2[14] = x14 + j14 | 0; + B2[bout++] = tmp2[15] = x15 + j15 | 0; + } + function blockCopy(dst, di, src2, si, len) { + while (len--) + dst[di++] = src2[si++]; + } + function blockXOR(dst, di, src2, si, len) { + while (len--) + dst[di++] ^= src2[si++]; + } + function blockMix(tmp2, B2, bin, bout, r2) { + blockCopy(tmp2, 0, B2, bin + (2 * r2 - 1) * 16, 16); + for (var i = 0; i < 2 * r2; i += 2) { + salsaXOR(tmp2, B2, bin + i * 16, bout + i * 8); + salsaXOR(tmp2, B2, bin + i * 16 + 16, bout + i * 8 + r2 * 16); + } + } + function integerify(B2, bi, r2) { + return B2[bi + (2 * r2 - 1) * 16]; + } + function stringToUTF8Bytes(s) { + var arr = []; + for (var i = 0; i < s.length; i++) { + var c = s.charCodeAt(i); + if (c < 128) { + arr.push(c); + } else if (c < 2048) { + arr.push(192 | c >> 6); + arr.push(128 | c & 63); + } else if (c < 55296) { + arr.push(224 | c >> 12); + arr.push(128 | c >> 6 & 63); + arr.push(128 | c & 63); + } else { + if (i >= s.length - 1) { + throw new Error("invalid string"); + } + i++; + c = (c & 1023) << 10; + c |= s.charCodeAt(i) & 1023; + c += 65536; + arr.push(240 | c >> 18); + arr.push(128 | c >> 12 & 63); + arr.push(128 | c >> 6 & 63); + arr.push(128 | c & 63); + } + } + return arr; + } + function bytesToHex(p2) { + var enc = "0123456789abcdef".split(""); + var len = p2.length, arr = [], i = 0; + for (; i < len; i++) { + arr.push(enc[p2[i] >>> 4 & 15]); + arr.push(enc[p2[i] >>> 0 & 15]); + } + return arr.join(""); + } + function bytesToBase64(p2) { + var enc = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""); + var len = p2.length, arr = [], i = 0, a, b, c, t; + while (i < len) { + a = i < len ? p2[i++] : 0; + b = i < len ? p2[i++] : 0; + c = i < len ? p2[i++] : 0; + t = (a << 16) + (b << 8) + c; + arr.push(enc[t >>> 3 * 6 & 63]); + arr.push(enc[t >>> 2 * 6 & 63]); + arr.push(enc[t >>> 1 * 6 & 63]); + arr.push(enc[t >>> 0 * 6 & 63]); + } + if (len % 3 > 0) { + arr[arr.length - 1] = "="; + if (len % 3 === 1) + arr[arr.length - 2] = "="; + } + return arr.join(""); + } + var MAX_UINT = -1 >>> 0, p = 1; + if (typeof logN === "object") { + if (arguments.length > 4) { + throw new Error("scrypt: incorrect number of arguments"); + } + var opts = logN; + callback = r; + logN = opts.logN; + if (typeof logN === "undefined") { + if (typeof opts.N !== "undefined") { + if (opts.N < 2 || opts.N > MAX_UINT) + throw new Error("scrypt: N is out of range"); + if ((opts.N & opts.N - 1) !== 0) + throw new Error("scrypt: N is not a power of 2"); + logN = Math.log(opts.N) / Math.LN2; + } else { + throw new Error("scrypt: missing N parameter"); + } + } + p = opts.p || 1; + r = opts.r; + dkLen = opts.dkLen || 32; + interruptStep = opts.interruptStep || 0; + encoding = opts.encoding; + } + if (p < 1) + throw new Error("scrypt: invalid p"); + if (r <= 0) + throw new Error("scrypt: invalid r"); + if (logN < 1 || logN > 31) + throw new Error("scrypt: logN must be between 1 and 31"); + var N = 1 << logN >>> 0, XY, V, B, tmp; + if (r * p >= 1 << 30 || r > MAX_UINT / 128 / p || r > MAX_UINT / 256 || N > MAX_UINT / 128 / r) + throw new Error("scrypt: parameters are too large"); + if (typeof password === "string") + password = stringToUTF8Bytes(password); + if (typeof salt === "string") + salt = stringToUTF8Bytes(salt); + if (typeof Int32Array !== "undefined") { + XY = new Int32Array(64 * r); + V = new Int32Array(32 * N * r); + tmp = new Int32Array(16); + } else { + XY = []; + V = []; + tmp = new Array(16); + } + B = PBKDF2_HMAC_SHA256_OneIter(password, salt, p * 128 * r); + var xi = 0, yi = 32 * r; + function smixStart(pos) { + for (var i = 0; i < 32 * r; i++) { + var j = pos + i * 4; + XY[xi + i] = (B[j + 3] & 255) << 24 | (B[j + 2] & 255) << 16 | (B[j + 1] & 255) << 8 | (B[j + 0] & 255) << 0; + } + } + function smixStep1(start, end) { + for (var i = start; i < end; i += 2) { + blockCopy(V, i * (32 * r), XY, xi, 32 * r); + blockMix(tmp, XY, xi, yi, r); + blockCopy(V, (i + 1) * (32 * r), XY, yi, 32 * r); + blockMix(tmp, XY, yi, xi, r); + } + } + function smixStep2(start, end) { + for (var i = start; i < end; i += 2) { + var j = integerify(XY, xi, r) & N - 1; + blockXOR(XY, xi, V, j * (32 * r), 32 * r); + blockMix(tmp, XY, xi, yi, r); + j = integerify(XY, yi, r) & N - 1; + blockXOR(XY, yi, V, j * (32 * r), 32 * r); + blockMix(tmp, XY, yi, xi, r); + } + } + function smixFinish(pos) { + for (var i = 0; i < 32 * r; i++) { + var j = XY[xi + i]; + B[pos + i * 4 + 0] = j >>> 0 & 255; + B[pos + i * 4 + 1] = j >>> 8 & 255; + B[pos + i * 4 + 2] = j >>> 16 & 255; + B[pos + i * 4 + 3] = j >>> 24 & 255; + } + } + var nextTick = typeof setImmediate !== "undefined" ? setImmediate : setTimeout; + function interruptedFor(start, end, step, fn, donefn) { + (function performStep() { + nextTick(function() { + fn(start, start + step < end ? start + step : end); + start += step; + if (start < end) + performStep(); + else + donefn(); + }); + })(); + } + function getResult(enc) { + var result = PBKDF2_HMAC_SHA256_OneIter(password, B, dkLen); + if (enc === "base64") + return bytesToBase64(result); + else if (enc === "hex") + return bytesToHex(result); + else if (enc === "binary") + return new Uint8Array(result); + else + return result; + } + function calculateSync() { + for (var i = 0; i < p; i++) { + smixStart(i * 128 * r); + smixStep1(0, N); + smixStep2(0, N); + smixFinish(i * 128 * r); + } + callback(getResult(encoding)); + } + function calculateAsync(i) { + smixStart(i * 128 * r); + interruptedFor(0, N, interruptStep * 2, smixStep1, function() { + interruptedFor(0, N, interruptStep * 2, smixStep2, function() { + smixFinish(i * 128 * r); + if (i + 1 < p) { + nextTick(function() { + calculateAsync(i + 1); + }); + } else { + callback(getResult(encoding)); + } + }); + }); + } + if (typeof interruptStep === "function") { + encoding = callback; + callback = interruptStep; + interruptStep = 1e3; + } + if (interruptStep <= 0) { + calculateSync(); + } else { + calculateAsync(0); + } + } + if (typeof module !== "undefined") + module.exports = scrypt2; + } + }); + + // frontend/common/translations.js + var import_sbp = __toESM(__require("@sbp/sbp")); + + // frontend/common/stringTemplate.js + var nargs = /\{([0-9a-zA-Z_]+)\}/g; + function template(string3, ...args) { + const firstArg = args[0]; + const replacementsByKey = typeof firstArg === "object" && firstArg !== null ? firstArg : args; + return string3.replace(nargs, function replaceArg(match, capture, index) { + if (string3[index - 1] === "{" && string3[index + match.length] === "}") { + return capture; + } + const maybeReplacement = Object.prototype.hasOwnProperty.call(replacementsByKey, capture) ? replacementsByKey[capture] : void 0; + if (maybeReplacement === null || maybeReplacement === void 0) { + return ""; + } + return String(maybeReplacement); + }); + } + + // frontend/common/translations.js + var defaultLanguage = "en-US"; + var defaultLanguageCode = "en"; + var defaultTranslationTable = {}; + var currentLanguage = defaultLanguage; + var currentLanguageCode = defaultLanguage.split("-")[0]; + var currentTranslationTable = defaultTranslationTable; + var translations_default = (0, import_sbp.default)("sbp/selectors/register", { + "translations/init": async function init(language) { + const [languageCode] = language.toLowerCase().split("-"); + if (language.toLowerCase() === currentLanguage.toLowerCase()) + return; + if (languageCode === currentLanguageCode) + return; + if (languageCode === defaultLanguageCode) { + currentLanguage = defaultLanguage; + currentLanguageCode = defaultLanguageCode; + currentTranslationTable = defaultTranslationTable; + return; + } + try { + currentTranslationTable = await (0, import_sbp.default)("backend/translations/get", language) || defaultTranslationTable; + currentLanguage = language; + currentLanguageCode = languageCode; + } catch (error) { + console.error(error); + } + } + }); + function L(key, args) { + return template(currentTranslationTable[key] || key, args).replace(/\s(?=[;:?!])/g, "\xA0"); + } + + // shared/domains/chelonia/errors.js + var ChelErrorGenerator = (name, base2 = Error) => class extends base2 { + constructor(...params) { + super(...params); + this.name = name; + if (params[1]?.cause !== this.cause) { + Object.defineProperty(this, "cause", { value: params[1].cause }); + } + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + } + }; + var ChelErrorWarning = ChelErrorGenerator("ChelErrorWarning"); + var ChelErrorAlreadyProcessed = ChelErrorGenerator("ChelErrorAlreadyProcessed"); + var ChelErrorDBBadPreviousHEAD = ChelErrorGenerator("ChelErrorDBBadPreviousHEAD"); + var ChelErrorDBConnection = ChelErrorGenerator("ChelErrorDBConnection"); + var ChelErrorUnexpected = ChelErrorGenerator("ChelErrorUnexpected"); + var ChelErrorUnrecoverable = ChelErrorGenerator("ChelErrorUnrecoverable"); + var ChelErrorDecryptionError = ChelErrorGenerator("ChelErrorDecryptionError"); + var ChelErrorDecryptionKeyNotFound = ChelErrorGenerator("ChelErrorDecryptionKeyNotFound", ChelErrorDecryptionError); + var ChelErrorSignatureError = ChelErrorGenerator("ChelErrorSignatureError"); + var ChelErrorSignatureKeyUnauthorized = ChelErrorGenerator("ChelErrorSignatureKeyUnauthorized", ChelErrorSignatureError); + var ChelErrorSignatureKeyNotFound = ChelErrorGenerator("ChelErrorSignatureKeyNotFound", ChelErrorSignatureError); + var ChelErrorFetchServerTimeFailed = ChelErrorGenerator("ChelErrorFetchServerTimeFailed"); + + // frontend/common/errors.js + var GIErrorIgnoreAndBan = ChelErrorGenerator("GIErrorIgnoreAndBan"); + var GIErrorUIRuntimeError = ChelErrorGenerator("GIErrorUIRuntimeError"); + var GIErrorMissingSigningKeyError = ChelErrorGenerator("GIErrorMissingSigningKeyError"); + + // frontend/model/contracts/identity.js + var import_sbp6 = __toESM(__require("@sbp/sbp")); + + // frontend/model/contracts/misc/flowTyper.js + var EMPTY_VALUE = Symbol("@@empty"); + var isEmpty = (v) => v === EMPTY_VALUE; + var isNil = (v) => v === null; + var isUndef = (v) => typeof v === "undefined"; + var isBoolean = (v) => typeof v === "boolean"; + var isNumber = (v) => typeof v === "number"; + var isString = (v) => typeof v === "string"; + var isObject = (v) => !isNil(v) && typeof v === "object"; + var isFunction = (v) => typeof v === "function"; + var getType = (typeFn, _options) => { + if (isFunction(typeFn.type)) + return typeFn.type(_options); + return typeFn.name || "?"; + }; + var TypeValidatorError = class extends Error { + expectedType; + valueType; + value; + typeScope; + sourceFile; + constructor(message, expectedType, valueType, value, typeName = "", typeScope = "") { + const errMessage = message || `invalid "${valueType}" value type; ${typeName || expectedType} type expected`; + super(errMessage); + this.expectedType = expectedType; + this.valueType = valueType; + this.value = value; + this.typeScope = typeScope || ""; + this.sourceFile = this.getSourceFile(); + this.message = `${errMessage} +${this.getErrorInfo()}`; + this.name = this.constructor.name; + if (Error.captureStackTrace) { + Error.captureStackTrace(this, TypeValidatorError); + } + } + getSourceFile() { + const fileNames = this.stack.match(/(\/[\w_\-.]+)+(\.\w+:\d+:\d+)/g) || []; + return fileNames.find((fileName) => fileName.indexOf("/flowTyper-js/dist/") === -1) || ""; + } + getErrorInfo() { + return ` + file ${this.sourceFile} + scope ${this.typeScope} + expected ${this.expectedType.replace(/\n/g, "")} + type ${this.valueType} + value ${this.value} +`; + } + }; + var validatorError = (typeFn, value, scope, message, expectedType, valueType) => { + return new TypeValidatorError(message, expectedType || getType(typeFn), valueType || typeof value, JSON.stringify(value), typeFn.name, scope); + }; + var arrayOf = (typeFn, _scope = "Array") => { + function array(value) { + if (isEmpty(value)) + return [typeFn(value)]; + if (Array.isArray(value)) { + let index = 0; + return value.map((v) => typeFn(v, `${_scope}[${index++}]`)); + } + throw validatorError(array, value, _scope); + } + array.type = () => `Array<${getType(typeFn)}>`; + return array; + }; + var object = function(value) { + if (isEmpty(value)) + return {}; + if (isObject(value) && !Array.isArray(value)) { + return Object.assign({}, value); + } + throw validatorError(object, value); + }; + var objectOf = (typeObj, _scope = "Object") => { + function object2(value) { + const o = object(value); + const typeAttrs = Object.keys(typeObj); + const unknownAttr = Object.keys(o).find((attr) => !typeAttrs.includes(attr)); + if (unknownAttr) { + throw validatorError(object2, value, _scope, `missing object property '${unknownAttr}' in ${_scope} type`); + } + const undefAttr = typeAttrs.find((property) => { + const propertyTypeFn = typeObj[property]; + return propertyTypeFn.name.includes("maybe") && !o.hasOwnProperty(property); + }); + if (undefAttr) { + throw validatorError(object2, o[undefAttr], `${_scope}.${undefAttr}`, `empty object property '${undefAttr}' for ${_scope} type`, `void | null | ${getType(typeObj[undefAttr]).substr(1)}`, "-"); + } + const reducer = isEmpty(value) ? (acc, key) => Object.assign(acc, { [key]: typeObj[key](value) }) : (acc, key) => { + const typeFn = typeObj[key]; + if (typeFn.name.includes("optional") && !o.hasOwnProperty(key)) { + return Object.assign(acc, {}); + } else { + return Object.assign(acc, { [key]: typeFn(o[key], `${_scope}.${key}`) }); + } + }; + return typeAttrs.reduce(reducer, {}); + } + object2.type = () => { + const props = Object.keys(typeObj).map((key) => { + const ret = typeObj[key].name.includes("optional") ? `${key}?: ${getType(typeObj[key], { noVoid: true })}` : `${key}: ${getType(typeObj[key])}`; + return ret; + }); + return `{| + ${props.join(",\n ")} +|}`; + }; + return object2; + }; + function objectMaybeOf(validations, _scope = "Object") { + return function(data) { + object(data); + for (const key in data) { + validations[key]?.(data[key], `${_scope}.${key}`); + } + return data; + }; + } + var optional = (typeFn) => { + const unionFn = unionOf(typeFn, undef); + function optional2(v) { + return unionFn(v); + } + optional2.type = ({ noVoid }) => !noVoid ? getType(unionFn) : getType(typeFn); + return optional2; + }; + function undef(value, _scope = "") { + if (isEmpty(value) || isUndef(value)) + return void 0; + throw validatorError(undef, value, _scope); + } + undef.type = () => "void"; + var boolean = function boolean2(value, _scope = "") { + if (isEmpty(value)) + return false; + if (isBoolean(value)) + return value; + throw validatorError(boolean2, value, _scope); + }; + var string = function string2(value, _scope = "") { + if (isEmpty(value)) + return ""; + if (isString(value)) + return value; + throw validatorError(string2, value, _scope); + }; + var stringMax = (numChar, key = "") => { + if (!isNumber(numChar)) { + throw new Error("param for stringMax must be number"); + } + function stringMax2(value, _scope = "") { + string(value, _scope); + if (value.length <= numChar) + return value; + throw validatorError(stringMax2, value, _scope, key ? `string type '${key}' cannot exceed ${numChar} characters` : `cannot exceed ${numChar} characters`); + } + stringMax2.type = () => `string(max: ${numChar})`; + return stringMax2; + }; + function unionOf_(...typeFuncs) { + function union(value, _scope = "") { + for (const typeFn of typeFuncs) { + try { + return typeFn(value, _scope); + } catch (_) { + } + } + throw validatorError(union, value, _scope); + } + union.type = () => `(${typeFuncs.map((fn) => getType(fn)).join(" | ")})`; + return union; + } + var unionOf = unionOf_; + var validatorFrom = (fn) => { + function customType(value, _scope = "") { + if (!fn(value)) { + throw validatorError(customType, value, _scope); + } + return value; + } + return customType; + }; + + // frontend/utils/events.js + var LEFT_GROUP = "left-group"; + + // shared/serdes/index.js + var raw = Symbol("raw"); + var serdesTagSymbol = Symbol("tag"); + var serdesSerializeSymbol = Symbol("serialize"); + var serdesDeserializeSymbol = Symbol("deserialize"); + var rawResult = (obj) => { + Object.defineProperty(obj, raw, { value: true }); + return obj; + }; + var serializer = (data) => { + const verbatim = []; + const transferables = /* @__PURE__ */ new Set(); + const revokables = /* @__PURE__ */ new Set(); + const result = JSON.parse(JSON.stringify(data, (_key, value) => { + if (value && value[raw]) + return value; + if (value === void 0) + return rawResult(["_", "_"]); + if (!value) + return value; + if (Array.isArray(value) && value[0] === "_") + return rawResult(["_", "_", ...value]); + if (value instanceof Map) { + return rawResult(["_", "Map", Array.from(value.entries())]); + } + if (value instanceof Set) { + return rawResult(["_", "Set", Array.from(value.entries())]); + } + if (value instanceof Error || value instanceof Blob || value instanceof File) { + const pos = verbatim.length; + verbatim[verbatim.length] = value; + return rawResult(["_", "_ref", pos]); + } + if (value instanceof MessagePort || value instanceof ReadableStream || value instanceof WritableStream || value instanceof ArrayBuffer) { + const pos = verbatim.length; + verbatim[verbatim.length] = value; + transferables.add(value); + return rawResult(["_", "_ref", pos]); + } + if (ArrayBuffer.isView(value)) { + const pos = verbatim.length; + verbatim[verbatim.length] = value; + transferables.add(value.buffer); + return rawResult(["_", "_ref", pos]); + } + if (typeof value === "function") { + const mc = new MessageChannel(); + mc.port1.onmessage = async (ev) => { + try { + try { + const result2 = await value(...deserializer(ev.data[1])); + const { data: data2, transferables: transferables2 } = serializer(result2); + ev.data[0].postMessage([true, data2], transferables2); + } catch (e) { + const { data: data2, transferables: transferables2 } = serializer(e); + ev.data[0].postMessage([false, data2], transferables2); + } + } catch (e) { + console.error("Async error on onmessage handler", e); + } + }; + transferables.add(mc.port2); + revokables.add(mc.port1); + return rawResult(["_", "_fn", mc.port2]); + } + const proto3 = Object.getPrototypeOf(value); + if (proto3?.constructor?.[serdesTagSymbol] && proto3.constructor[serdesSerializeSymbol]) { + return rawResult(["_", "_custom", proto3.constructor[serdesTagSymbol], proto3.constructor[serdesSerializeSymbol](value)]); + } + return value; + }), (_key, value) => { + if (Array.isArray(value) && value[0] === "_" && value[1] === "_ref") { + return verbatim[value[2]]; + } + return value; + }); + return { + data: result, + transferables: Array.from(transferables), + revokables: Array.from(revokables) + }; + }; + var deserializerTable = /* @__PURE__ */ Object.create(null); + var deserializer = (data) => { + const verbatim = []; + return JSON.parse(JSON.stringify(data, (_key, value) => { + if (value && typeof value === "object" && !Array.isArray(value) && Object.getPrototypeOf(value) !== Object.prototype) { + const pos = verbatim.length; + verbatim[verbatim.length] = value; + return rawResult(["_", "_ref", pos]); + } + return value; + }), (_key, value) => { + if (Array.isArray(value) && value[0] === "_") { + switch (value[1]) { + case "_": + if (value.length >= 3) { + return value.slice(2); + } else { + return void 0; + } + case "Map": + return new Map(value[2]); + case "Set": + return new Set(value[2]); + case "_custom": + if (deserializerTable[value[2]]) { + return deserializerTable[value[2]](value[3]); + } else { + throw new Error("Invalid or unknown tag: " + value[2]); + } + case "_ref": + return verbatim[value[2]]; + case "_fn": { + const mp = value[2]; + return (...args) => { + return new Promise((resolve, reject) => { + const mc = new MessageChannel(); + const { data: data2, transferables } = serializer(args); + mc.port1.onmessage = (ev) => { + if (ev.data[0]) { + resolve(deserializer(ev.data[1])); + } else { + reject(deserializer(ev.data[1])); + } + }; + mp.postMessage([mc.port2, data2], [mc.port2, ...transferables]); + }); + }; + } + } + } + return value; + }); + }; + deserializer.register = (y) => { + if (typeof y === "function" && typeof y[serdesTagSymbol] === "string" && typeof y[serdesDeserializeSymbol] === "function") { + deserializerTable[y[serdesTagSymbol]] = y[serdesDeserializeSymbol].bind(y); + } + }; + + // shared/domains/chelonia/Secret.js + var wm = /* @__PURE__ */ new WeakMap(); + var Secret = class { + static [serdesDeserializeSymbol](secret) { + return new this(secret); + } + static [serdesSerializeSymbol](secret) { + return wm.get(secret); + } + static get [serdesTagSymbol]() { + return "__chelonia_Secret"; + } + constructor(value) { + wm.set(this, value); + } + valueOf() { + return wm.get(this); + } + }; + + // shared/domains/chelonia/utils.js + var import_sbp4 = __toESM(__require("@sbp/sbp")); + + // frontend/model/contracts/shared/giLodash.js + function cloneDeep(obj) { + return JSON.parse(JSON.stringify(obj)); + } + function isMergeableObject(val) { + const nonNullObject = val && typeof val === "object"; + return nonNullObject && Object.prototype.toString.call(val) !== "[object RegExp]" && Object.prototype.toString.call(val) !== "[object Date]"; + } + function merge(obj, src2) { + for (const key in src2) { + const clone = isMergeableObject(src2[key]) ? cloneDeep(src2[key]) : void 0; + if (clone && isMergeableObject(obj[key])) { + merge(obj[key], clone); + continue; + } + obj[key] = clone || src2[key]; + } + return obj; + } + var has = Function.prototype.call.bind(Object.prototype.hasOwnProperty); + + // shared/blake2bstream.js + var import_blakejs = __toESM(require_blakejs()); + + // shared/multiformats/bytes.js + var empty = new Uint8Array(0); + function equals(aa, bb) { + if (aa === bb) { + return true; + } + if (aa.byteLength !== bb.byteLength) { + return false; + } + for (let ii = 0; ii < aa.byteLength; ii++) { + if (aa[ii] !== bb[ii]) { + return false; + } + } + return true; + } + function coerce(o) { + if (o instanceof Uint8Array && o.constructor.name === "Uint8Array") { + return o; + } + if (o instanceof ArrayBuffer) { + return new Uint8Array(o); + } + if (ArrayBuffer.isView(o)) { + return new Uint8Array(o.buffer, o.byteOffset, o.byteLength); + } + throw new Error("Unknown type, must be binary type"); + } + + // shared/multiformats/vendor/varint.js + var encode_1 = encode; + var MSB = 128; + var REST = 127; + var MSBALL = ~REST; + var INT = Math.pow(2, 31); + function encode(num, out, offset) { + out = out || []; + offset = offset || 0; + var oldOffset = offset; + while (num >= INT) { + out[offset++] = num & 255 | MSB; + num /= 128; + } + while (num & MSBALL) { + out[offset++] = num & 255 | MSB; + num >>>= 7; + } + out[offset] = num | 0; + encode.bytes = offset - oldOffset + 1; + return out; + } + var decode = read; + var MSB$1 = 128; + var REST$1 = 127; + function read(buf, offset) { + var res = 0, offset = offset || 0, shift = 0, counter = offset, b, l = buf.length; + do { + if (counter >= l) { + read.bytes = 0; + throw new RangeError("Could not decode varint"); + } + b = buf[counter++]; + res += shift < 28 ? (b & REST$1) << shift : (b & REST$1) * Math.pow(2, shift); + shift += 7; + } while (b >= MSB$1); + read.bytes = counter - offset; + return res; + } + var N1 = Math.pow(2, 7); + var N2 = Math.pow(2, 14); + var N3 = Math.pow(2, 21); + var N4 = Math.pow(2, 28); + var N5 = Math.pow(2, 35); + var N6 = Math.pow(2, 42); + var N7 = Math.pow(2, 49); + var N8 = Math.pow(2, 56); + var N9 = Math.pow(2, 63); + var length = function(value) { + return value < N1 ? 1 : value < N2 ? 2 : value < N3 ? 3 : value < N4 ? 4 : value < N5 ? 5 : value < N6 ? 6 : value < N7 ? 7 : value < N8 ? 8 : value < N9 ? 9 : 10; + }; + var varint = { + encode: encode_1, + decode, + encodingLength: length + }; + var _brrp_varint = varint; + var varint_default = _brrp_varint; + + // shared/multiformats/varint.js + function decode2(data, offset = 0) { + const code = varint_default.decode(data, offset); + return [code, varint_default.decode.bytes]; + } + function encodeTo(int, target, offset = 0) { + varint_default.encode(int, target, offset); + return target; + } + function encodingLength(int) { + return varint_default.encodingLength(int); + } + + // shared/multiformats/hashes/digest.js + function create(code, digest) { + const size = digest.byteLength; + const sizeOffset = encodingLength(code); + const digestOffset = sizeOffset + encodingLength(size); + const bytes = new Uint8Array(digestOffset + size); + encodeTo(code, bytes, 0); + encodeTo(size, bytes, sizeOffset); + bytes.set(digest, digestOffset); + return new Digest(code, size, digest, bytes); + } + function decode3(multihash) { + const bytes = coerce(multihash); + const [code, sizeOffset] = decode2(bytes); + const [size, digestOffset] = decode2(bytes.subarray(sizeOffset)); + const digest = bytes.subarray(sizeOffset + digestOffset); + if (digest.byteLength !== size) { + throw new Error("Incorrect length"); + } + return new Digest(code, size, digest, bytes); + } + function equals2(a, b) { + if (a === b) { + return true; + } else { + const data = b; + return a.code === data.code && a.size === data.size && data.bytes instanceof Uint8Array && equals(a.bytes, data.bytes); + } + } + var Digest = class { + code; + size; + digest; + bytes; + constructor(code, size, digest, bytes) { + this.code = code; + this.size = size; + this.digest = digest; + this.bytes = bytes; + } + }; + + // shared/multiformats/hasher.js + function from({ name, code, encode: encode3 }) { + return new Hasher(name, code, encode3); + } + var Hasher = class { + name; + code; + encode; + constructor(name, code, encode3) { + this.name = name; + this.code = code; + this.encode = encode3; + } + digest(input) { + if (input instanceof Uint8Array || input instanceof ReadableStream) { + const result = this.encode(input); + return result instanceof Uint8Array ? create(this.code, result) : result.then((digest) => create(this.code, digest)); + } else { + throw Error("Unknown type, must be binary type"); + } + } + }; + + // shared/blake2bstream.js + var { blake2b, blake2bInit, blake2bUpdate, blake2bFinal } = import_blakejs.default; + var blake2b256stream = from({ + name: "blake2b-256", + code: 45600, + encode: async (input) => { + if (input instanceof ReadableStream) { + const ctx = blake2bInit(32); + const reader = input.getReader(); + for (; ; ) { + const result = await reader.read(); + if (result.done) + break; + blake2bUpdate(ctx, coerce(result.value)); + } + return blake2bFinal(ctx); + } else { + return coerce(blake2b(input, void 0, 32)); + } + } + }); + + // shared/multiformats/base-x.js + function base(ALPHABET, name) { + if (ALPHABET.length >= 255) { + throw new TypeError("Alphabet too long"); + } + var BASE_MAP = new Uint8Array(256); + for (var j = 0; j < BASE_MAP.length; j++) { + BASE_MAP[j] = 255; + } + for (var i = 0; i < ALPHABET.length; i++) { + var x = ALPHABET.charAt(i); + var xc = x.charCodeAt(0); + if (BASE_MAP[xc] !== 255) { + throw new TypeError(x + " is ambiguous"); + } + BASE_MAP[xc] = i; + } + var BASE = ALPHABET.length; + var LEADER = ALPHABET.charAt(0); + var FACTOR = Math.log(BASE) / Math.log(256); + var iFACTOR = Math.log(256) / Math.log(BASE); + function encode3(source) { + if (source instanceof Uint8Array) + ; + else if (ArrayBuffer.isView(source)) { + source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength); + } else if (Array.isArray(source)) { + source = Uint8Array.from(source); + } + if (!(source instanceof Uint8Array)) { + throw new TypeError("Expected Uint8Array"); + } + if (source.length === 0) { + return ""; + } + var zeroes = 0; + var length2 = 0; + var pbegin = 0; + var pend = source.length; + while (pbegin !== pend && source[pbegin] === 0) { + pbegin++; + zeroes++; + } + var size = (pend - pbegin) * iFACTOR + 1 >>> 0; + var b58 = new Uint8Array(size); + while (pbegin !== pend) { + var carry = source[pbegin]; + var i2 = 0; + for (var it1 = size - 1; (carry !== 0 || i2 < length2) && it1 !== -1; it1--, i2++) { + carry += 256 * b58[it1] >>> 0; + b58[it1] = carry % BASE >>> 0; + carry = carry / BASE >>> 0; + } + if (carry !== 0) { + throw new Error("Non-zero carry"); + } + length2 = i2; + pbegin++; + } + var it2 = size - length2; + while (it2 !== size && b58[it2] === 0) { + it2++; + } + var str = LEADER.repeat(zeroes); + for (; it2 < size; ++it2) { + str += ALPHABET.charAt(b58[it2]); + } + return str; + } + function decodeUnsafe(source) { + if (typeof source !== "string") { + throw new TypeError("Expected String"); + } + if (source.length === 0) { + return new Uint8Array(); + } + var psz = 0; + if (source[psz] === " ") { + return; + } + var zeroes = 0; + var length2 = 0; + while (source[psz] === LEADER) { + zeroes++; + psz++; + } + var size = (source.length - psz) * FACTOR + 1 >>> 0; + var b256 = new Uint8Array(size); + while (source[psz]) { + var carry = BASE_MAP[source.charCodeAt(psz)]; + if (carry === 255) { + return; + } + var i2 = 0; + for (var it3 = size - 1; (carry !== 0 || i2 < length2) && it3 !== -1; it3--, i2++) { + carry += BASE * b256[it3] >>> 0; + b256[it3] = carry % 256 >>> 0; + carry = carry / 256 >>> 0; + } + if (carry !== 0) { + throw new Error("Non-zero carry"); + } + length2 = i2; + psz++; + } + if (source[psz] === " ") { + return; + } + var it4 = size - length2; + while (it4 !== size && b256[it4] === 0) { + it4++; + } + var vch = new Uint8Array(zeroes + (size - it4)); + var j2 = zeroes; + while (it4 !== size) { + vch[j2++] = b256[it4++]; + } + return vch; + } + function decode5(string3) { + var buffer = decodeUnsafe(string3); + if (buffer) { + return buffer; + } + throw new Error(`Non-${name} character`); + } + return { + encode: encode3, + decodeUnsafe, + decode: decode5 + }; + } + var src = base; + var _brrp__multiformats_scope_baseX = src; + var base_x_default = _brrp__multiformats_scope_baseX; + + // shared/multiformats/bases/base.js + var Encoder = class { + name; + prefix; + baseEncode; + constructor(name, prefix, baseEncode) { + this.name = name; + this.prefix = prefix; + this.baseEncode = baseEncode; + } + encode(bytes) { + if (bytes instanceof Uint8Array) { + return `${this.prefix}${this.baseEncode(bytes)}`; + } else { + throw Error("Unknown type, must be binary type"); + } + } + }; + var Decoder = class { + name; + prefix; + baseDecode; + prefixCodePoint; + constructor(name, prefix, baseDecode) { + this.name = name; + this.prefix = prefix; + if (prefix.codePointAt(0) === void 0) { + throw new Error("Invalid prefix character"); + } + this.prefixCodePoint = prefix.codePointAt(0); + this.baseDecode = baseDecode; + } + decode(text) { + if (typeof text === "string") { + if (text.codePointAt(0) !== this.prefixCodePoint) { + throw Error(`Unable to decode multibase string ${JSON.stringify(text)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`); + } + return this.baseDecode(text.slice(this.prefix.length)); + } else { + throw Error("Can only multibase decode strings"); + } + } + or(decoder) { + return or(this, decoder); + } + }; + var ComposedDecoder = class { + decoders; + constructor(decoders) { + this.decoders = decoders; + } + or(decoder) { + return or(this, decoder); + } + decode(input) { + const prefix = input[0]; + const decoder = this.decoders[prefix]; + if (decoder != null) { + return decoder.decode(input); + } else { + throw RangeError(`Unable to decode multibase string ${JSON.stringify(input)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`); + } + } + }; + function or(left, right) { + return new ComposedDecoder({ + ...left.decoders ?? { [left.prefix]: left }, + ...right.decoders ?? { [right.prefix]: right } + }); + } + var Codec = class { + name; + prefix; + baseEncode; + baseDecode; + encoder; + decoder; + constructor(name, prefix, baseEncode, baseDecode) { + this.name = name; + this.prefix = prefix; + this.baseEncode = baseEncode; + this.baseDecode = baseDecode; + this.encoder = new Encoder(name, prefix, baseEncode); + this.decoder = new Decoder(name, prefix, baseDecode); + } + encode(input) { + return this.encoder.encode(input); + } + decode(input) { + return this.decoder.decode(input); + } + }; + function from2({ name, prefix, encode: encode3, decode: decode5 }) { + return new Codec(name, prefix, encode3, decode5); + } + function baseX({ name, prefix, alphabet }) { + const { encode: encode3, decode: decode5 } = base_x_default(alphabet, name); + return from2({ + prefix, + name, + encode: encode3, + decode: (text) => coerce(decode5(text)) + }); + } + function decode4(string3, alphabet, bitsPerChar, name) { + const codes = {}; + for (let i = 0; i < alphabet.length; ++i) { + codes[alphabet[i]] = i; + } + let end = string3.length; + while (string3[end - 1] === "=") { + --end; + } + const out = new Uint8Array(end * bitsPerChar / 8 | 0); + let bits = 0; + let buffer = 0; + let written = 0; + for (let i = 0; i < end; ++i) { + const value = codes[string3[i]]; + if (value === void 0) { + throw new SyntaxError(`Non-${name} character`); + } + buffer = buffer << bitsPerChar | value; + bits += bitsPerChar; + if (bits >= 8) { + bits -= 8; + out[written++] = 255 & buffer >> bits; + } + } + if (bits >= bitsPerChar || (255 & buffer << 8 - bits) !== 0) { + throw new SyntaxError("Unexpected end of data"); + } + return out; + } + function encode2(data, alphabet, bitsPerChar) { + const pad = alphabet[alphabet.length - 1] === "="; + const mask = (1 << bitsPerChar) - 1; + let out = ""; + let bits = 0; + let buffer = 0; + for (let i = 0; i < data.length; ++i) { + buffer = buffer << 8 | data[i]; + bits += 8; + while (bits > bitsPerChar) { + bits -= bitsPerChar; + out += alphabet[mask & buffer >> bits]; + } + } + if (bits !== 0) { + out += alphabet[mask & buffer << bitsPerChar - bits]; + } + if (pad) { + while ((out.length * bitsPerChar & 7) !== 0) { + out += "="; + } + } + return out; + } + function rfc4648({ name, prefix, bitsPerChar, alphabet }) { + return from2({ + prefix, + name, + encode(input) { + return encode2(input, alphabet, bitsPerChar); + }, + decode(input) { + return decode4(input, alphabet, bitsPerChar, name); + } + }); + } + + // shared/multiformats/bases/base58.js + var base58btc = baseX({ + name: "base58btc", + prefix: "z", + alphabet: "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz" + }); + var base58flickr = baseX({ + name: "base58flickr", + prefix: "Z", + alphabet: "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ" + }); + + // shared/multiformats/blake2b.js + var import_blakejs2 = __toESM(require_blakejs()); + var { blake2b: blake2b2 } = import_blakejs2.default; + var blake2b8 = from({ + name: "blake2b-8", + code: 45569, + encode: (input) => coerce(blake2b2(input, void 0, 1)) + }); + var blake2b16 = from({ + name: "blake2b-16", + code: 45570, + encode: (input) => coerce(blake2b2(input, void 0, 2)) + }); + var blake2b24 = from({ + name: "blake2b-24", + code: 45571, + encode: (input) => coerce(blake2b2(input, void 0, 3)) + }); + var blake2b32 = from({ + name: "blake2b-32", + code: 45572, + encode: (input) => coerce(blake2b2(input, void 0, 4)) + }); + var blake2b40 = from({ + name: "blake2b-40", + code: 45573, + encode: (input) => coerce(blake2b2(input, void 0, 5)) + }); + var blake2b48 = from({ + name: "blake2b-48", + code: 45574, + encode: (input) => coerce(blake2b2(input, void 0, 6)) + }); + var blake2b56 = from({ + name: "blake2b-56", + code: 45575, + encode: (input) => coerce(blake2b2(input, void 0, 7)) + }); + var blake2b64 = from({ + name: "blake2b-64", + code: 45576, + encode: (input) => coerce(blake2b2(input, void 0, 8)) + }); + var blake2b72 = from({ + name: "blake2b-72", + code: 45577, + encode: (input) => coerce(blake2b2(input, void 0, 9)) + }); + var blake2b80 = from({ + name: "blake2b-80", + code: 45578, + encode: (input) => coerce(blake2b2(input, void 0, 10)) + }); + var blake2b88 = from({ + name: "blake2b-88", + code: 45579, + encode: (input) => coerce(blake2b2(input, void 0, 11)) + }); + var blake2b96 = from({ + name: "blake2b-96", + code: 45580, + encode: (input) => coerce(blake2b2(input, void 0, 12)) + }); + var blake2b104 = from({ + name: "blake2b-104", + code: 45581, + encode: (input) => coerce(blake2b2(input, void 0, 13)) + }); + var blake2b112 = from({ + name: "blake2b-112", + code: 45582, + encode: (input) => coerce(blake2b2(input, void 0, 14)) + }); + var blake2b120 = from({ + name: "blake2b-120", + code: 45583, + encode: (input) => coerce(blake2b2(input, void 0, 15)) + }); + var blake2b128 = from({ + name: "blake2b-128", + code: 45584, + encode: (input) => coerce(blake2b2(input, void 0, 16)) + }); + var blake2b136 = from({ + name: "blake2b-136", + code: 45585, + encode: (input) => coerce(blake2b2(input, void 0, 17)) + }); + var blake2b144 = from({ + name: "blake2b-144", + code: 45586, + encode: (input) => coerce(blake2b2(input, void 0, 18)) + }); + var blake2b152 = from({ + name: "blake2b-152", + code: 45587, + encode: (input) => coerce(blake2b2(input, void 0, 19)) + }); + var blake2b160 = from({ + name: "blake2b-160", + code: 45588, + encode: (input) => coerce(blake2b2(input, void 0, 20)) + }); + var blake2b168 = from({ + name: "blake2b-168", + code: 45589, + encode: (input) => coerce(blake2b2(input, void 0, 21)) + }); + var blake2b176 = from({ + name: "blake2b-176", + code: 45590, + encode: (input) => coerce(blake2b2(input, void 0, 22)) + }); + var blake2b184 = from({ + name: "blake2b-184", + code: 45591, + encode: (input) => coerce(blake2b2(input, void 0, 23)) + }); + var blake2b192 = from({ + name: "blake2b-192", + code: 45592, + encode: (input) => coerce(blake2b2(input, void 0, 24)) + }); + var blake2b200 = from({ + name: "blake2b-200", + code: 45593, + encode: (input) => coerce(blake2b2(input, void 0, 25)) + }); + var blake2b208 = from({ + name: "blake2b-208", + code: 45594, + encode: (input) => coerce(blake2b2(input, void 0, 26)) + }); + var blake2b216 = from({ + name: "blake2b-216", + code: 45595, + encode: (input) => coerce(blake2b2(input, void 0, 27)) + }); + var blake2b224 = from({ + name: "blake2b-224", + code: 45596, + encode: (input) => coerce(blake2b2(input, void 0, 28)) + }); + var blake2b232 = from({ + name: "blake2b-232", + code: 45597, + encode: (input) => coerce(blake2b2(input, void 0, 29)) + }); + var blake2b240 = from({ + name: "blake2b-240", + code: 45598, + encode: (input) => coerce(blake2b2(input, void 0, 30)) + }); + var blake2b248 = from({ + name: "blake2b-248", + code: 45599, + encode: (input) => coerce(blake2b2(input, void 0, 31)) + }); + var blake2b256 = from({ + name: "blake2b-256", + code: 45600, + encode: (input) => coerce(blake2b2(input, void 0, 32)) + }); + var blake2b264 = from({ + name: "blake2b-264", + code: 45601, + encode: (input) => coerce(blake2b2(input, void 0, 33)) + }); + var blake2b272 = from({ + name: "blake2b-272", + code: 45602, + encode: (input) => coerce(blake2b2(input, void 0, 34)) + }); + var blake2b280 = from({ + name: "blake2b-280", + code: 45603, + encode: (input) => coerce(blake2b2(input, void 0, 35)) + }); + var blake2b288 = from({ + name: "blake2b-288", + code: 45604, + encode: (input) => coerce(blake2b2(input, void 0, 36)) + }); + var blake2b296 = from({ + name: "blake2b-296", + code: 45605, + encode: (input) => coerce(blake2b2(input, void 0, 37)) + }); + var blake2b304 = from({ + name: "blake2b-304", + code: 45606, + encode: (input) => coerce(blake2b2(input, void 0, 38)) + }); + var blake2b312 = from({ + name: "blake2b-312", + code: 45607, + encode: (input) => coerce(blake2b2(input, void 0, 39)) + }); + var blake2b320 = from({ + name: "blake2b-320", + code: 45608, + encode: (input) => coerce(blake2b2(input, void 0, 40)) + }); + var blake2b328 = from({ + name: "blake2b-328", + code: 45609, + encode: (input) => coerce(blake2b2(input, void 0, 41)) + }); + var blake2b336 = from({ + name: "blake2b-336", + code: 45610, + encode: (input) => coerce(blake2b2(input, void 0, 42)) + }); + var blake2b344 = from({ + name: "blake2b-344", + code: 45611, + encode: (input) => coerce(blake2b2(input, void 0, 43)) + }); + var blake2b352 = from({ + name: "blake2b-352", + code: 45612, + encode: (input) => coerce(blake2b2(input, void 0, 44)) + }); + var blake2b360 = from({ + name: "blake2b-360", + code: 45613, + encode: (input) => coerce(blake2b2(input, void 0, 45)) + }); + var blake2b368 = from({ + name: "blake2b-368", + code: 45614, + encode: (input) => coerce(blake2b2(input, void 0, 46)) + }); + var blake2b376 = from({ + name: "blake2b-376", + code: 45615, + encode: (input) => coerce(blake2b2(input, void 0, 47)) + }); + var blake2b384 = from({ + name: "blake2b-384", + code: 45616, + encode: (input) => coerce(blake2b2(input, void 0, 48)) + }); + var blake2b392 = from({ + name: "blake2b-392", + code: 45617, + encode: (input) => coerce(blake2b2(input, void 0, 49)) + }); + var blake2b400 = from({ + name: "blake2b-400", + code: 45618, + encode: (input) => coerce(blake2b2(input, void 0, 50)) + }); + var blake2b408 = from({ + name: "blake2b-408", + code: 45619, + encode: (input) => coerce(blake2b2(input, void 0, 51)) + }); + var blake2b416 = from({ + name: "blake2b-416", + code: 45620, + encode: (input) => coerce(blake2b2(input, void 0, 52)) + }); + var blake2b424 = from({ + name: "blake2b-424", + code: 45621, + encode: (input) => coerce(blake2b2(input, void 0, 53)) + }); + var blake2b432 = from({ + name: "blake2b-432", + code: 45622, + encode: (input) => coerce(blake2b2(input, void 0, 54)) + }); + var blake2b440 = from({ + name: "blake2b-440", + code: 45623, + encode: (input) => coerce(blake2b2(input, void 0, 55)) + }); + var blake2b448 = from({ + name: "blake2b-448", + code: 45624, + encode: (input) => coerce(blake2b2(input, void 0, 56)) + }); + var blake2b456 = from({ + name: "blake2b-456", + code: 45625, + encode: (input) => coerce(blake2b2(input, void 0, 57)) + }); + var blake2b464 = from({ + name: "blake2b-464", + code: 45626, + encode: (input) => coerce(blake2b2(input, void 0, 58)) + }); + var blake2b472 = from({ + name: "blake2b-472", + code: 45627, + encode: (input) => coerce(blake2b2(input, void 0, 59)) + }); + var blake2b480 = from({ + name: "blake2b-480", + code: 45628, + encode: (input) => coerce(blake2b2(input, void 0, 60)) + }); + var blake2b488 = from({ + name: "blake2b-488", + code: 45629, + encode: (input) => coerce(blake2b2(input, void 0, 61)) + }); + var blake2b496 = from({ + name: "blake2b-496", + code: 45630, + encode: (input) => coerce(blake2b2(input, void 0, 62)) + }); + var blake2b504 = from({ + name: "blake2b-504", + code: 45631, + encode: (input) => coerce(blake2b2(input, void 0, 63)) + }); + var blake2b512 = from({ + name: "blake2b-512", + code: 45632, + encode: (input) => coerce(blake2b2(input, void 0, 64)) + }); + + // shared/multiformats/bases/base32.js + var base32 = rfc4648({ + prefix: "b", + name: "base32", + alphabet: "abcdefghijklmnopqrstuvwxyz234567", + bitsPerChar: 5 + }); + var base32upper = rfc4648({ + prefix: "B", + name: "base32upper", + alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567", + bitsPerChar: 5 + }); + var base32pad = rfc4648({ + prefix: "c", + name: "base32pad", + alphabet: "abcdefghijklmnopqrstuvwxyz234567=", + bitsPerChar: 5 + }); + var base32padupper = rfc4648({ + prefix: "C", + name: "base32padupper", + alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=", + bitsPerChar: 5 + }); + var base32hex = rfc4648({ + prefix: "v", + name: "base32hex", + alphabet: "0123456789abcdefghijklmnopqrstuv", + bitsPerChar: 5 + }); + var base32hexupper = rfc4648({ + prefix: "V", + name: "base32hexupper", + alphabet: "0123456789ABCDEFGHIJKLMNOPQRSTUV", + bitsPerChar: 5 + }); + var base32hexpad = rfc4648({ + prefix: "t", + name: "base32hexpad", + alphabet: "0123456789abcdefghijklmnopqrstuv=", + bitsPerChar: 5 + }); + var base32hexpadupper = rfc4648({ + prefix: "T", + name: "base32hexpadupper", + alphabet: "0123456789ABCDEFGHIJKLMNOPQRSTUV=", + bitsPerChar: 5 + }); + var base32z = rfc4648({ + prefix: "h", + name: "base32z", + alphabet: "ybndrfg8ejkmcpqxot1uwisza345h769", + bitsPerChar: 5 + }); + + // shared/multiformats/cid.js + function format(link, base2) { + const { bytes, version } = link; + switch (version) { + case 0: + return toStringV0(bytes, baseCache(link), base2 ?? base58btc.encoder); + default: + return toStringV1(bytes, baseCache(link), base2 ?? base32.encoder); + } + } + var cache = /* @__PURE__ */ new WeakMap(); + function baseCache(cid) { + const baseCache2 = cache.get(cid); + if (baseCache2 == null) { + const baseCache3 = /* @__PURE__ */ new Map(); + cache.set(cid, baseCache3); + return baseCache3; + } + return baseCache2; + } + var CID = class { + code; + version; + multihash; + bytes; + "/"; + constructor(version, code, multihash, bytes) { + this.code = code; + this.version = version; + this.multihash = multihash; + this.bytes = bytes; + this["/"] = bytes; + } + get asCID() { + return this; + } + get byteOffset() { + return this.bytes.byteOffset; + } + get byteLength() { + return this.bytes.byteLength; + } + toV0() { + switch (this.version) { + case 0: { + return this; + } + case 1: { + const { code, multihash } = this; + if (code !== DAG_PB_CODE) { + throw new Error("Cannot convert a non dag-pb CID to CIDv0"); + } + if (multihash.code !== SHA_256_CODE) { + throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0"); + } + return CID.createV0(multihash); + } + default: { + throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`); + } + } + } + toV1() { + switch (this.version) { + case 0: { + const { code, digest } = this.multihash; + const multihash = create(code, digest); + return CID.createV1(this.code, multihash); + } + case 1: { + return this; + } + default: { + throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`); + } + } + } + equals(other) { + return CID.equals(this, other); + } + static equals(self2, other) { + const unknown = other; + return unknown != null && self2.code === unknown.code && self2.version === unknown.version && equals2(self2.multihash, unknown.multihash); + } + toString(base2) { + return format(this, base2); + } + toJSON() { + return { "/": format(this) }; + } + link() { + return this; + } + [Symbol.toStringTag] = "CID"; + [Symbol.for("nodejs.util.inspect.custom")]() { + return `CID(${this.toString()})`; + } + static asCID(input) { + if (input == null) { + return null; + } + const value = input; + if (value instanceof CID) { + return value; + } else if (value["/"] != null && value["/"] === value.bytes || value.asCID === value) { + const { version, code, multihash, bytes } = value; + return new CID(version, code, multihash, bytes ?? encodeCID(version, code, multihash.bytes)); + } else if (value[cidSymbol] === true) { + const { version, multihash, code } = value; + const digest = decode3(multihash); + return CID.create(version, code, digest); + } else { + return null; + } + } + static create(version, code, digest) { + if (typeof code !== "number") { + throw new Error("String codecs are no longer supported"); + } + if (!(digest.bytes instanceof Uint8Array)) { + throw new Error("Invalid digest"); + } + switch (version) { + case 0: { + if (code !== DAG_PB_CODE) { + throw new Error(`Version 0 CID must use dag-pb (code: ${DAG_PB_CODE}) block encoding`); + } else { + return new CID(version, code, digest, digest.bytes); + } + } + case 1: { + const bytes = encodeCID(version, code, digest.bytes); + return new CID(version, code, digest, bytes); + } + default: { + throw new Error("Invalid version"); + } + } + } + static createV0(digest) { + return CID.create(0, DAG_PB_CODE, digest); + } + static createV1(code, digest) { + return CID.create(1, code, digest); + } + static decode(bytes) { + const [cid, remainder] = CID.decodeFirst(bytes); + if (remainder.length !== 0) { + throw new Error("Incorrect length"); + } + return cid; + } + static decodeFirst(bytes) { + const specs = CID.inspectBytes(bytes); + const prefixSize = specs.size - specs.multihashSize; + const multihashBytes = coerce(bytes.subarray(prefixSize, prefixSize + specs.multihashSize)); + if (multihashBytes.byteLength !== specs.multihashSize) { + throw new Error("Incorrect length"); + } + const digestBytes = multihashBytes.subarray(specs.multihashSize - specs.digestSize); + const digest = new Digest(specs.multihashCode, specs.digestSize, digestBytes, multihashBytes); + const cid = specs.version === 0 ? CID.createV0(digest) : CID.createV1(specs.codec, digest); + return [cid, bytes.subarray(specs.size)]; + } + static inspectBytes(initialBytes) { + let offset = 0; + const next = () => { + const [i, length2] = decode2(initialBytes.subarray(offset)); + offset += length2; + return i; + }; + let version = next(); + let codec = DAG_PB_CODE; + if (version === 18) { + version = 0; + offset = 0; + } else { + codec = next(); + } + if (version !== 0 && version !== 1) { + throw new RangeError(`Invalid CID version ${version}`); + } + const prefixSize = offset; + const multihashCode = next(); + const digestSize = next(); + const size = offset + digestSize; + const multihashSize = size - prefixSize; + return { version, codec, multihashCode, digestSize, multihashSize, size }; + } + static parse(source, base2) { + const [prefix, bytes] = parseCIDtoBytes(source, base2); + const cid = CID.decode(bytes); + if (cid.version === 0 && source[0] !== "Q") { + throw Error("Version 0 CID string must not include multibase prefix"); + } + baseCache(cid).set(prefix, source); + return cid; + } + }; + function parseCIDtoBytes(source, base2) { + switch (source[0]) { + case "Q": { + const decoder = base2 ?? base58btc; + return [ + base58btc.prefix, + decoder.decode(`${base58btc.prefix}${source}`) + ]; + } + case base58btc.prefix: { + const decoder = base2 ?? base58btc; + return [base58btc.prefix, decoder.decode(source)]; + } + case base32.prefix: { + const decoder = base2 ?? base32; + return [base32.prefix, decoder.decode(source)]; + } + default: { + if (base2 == null) { + throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided"); + } + return [source[0], base2.decode(source)]; + } + } + } + function toStringV0(bytes, cache2, base2) { + const { prefix } = base2; + if (prefix !== base58btc.prefix) { + throw Error(`Cannot string encode V0 in ${base2.name} encoding`); + } + const cid = cache2.get(prefix); + if (cid == null) { + const cid2 = base2.encode(bytes).slice(1); + cache2.set(prefix, cid2); + return cid2; + } else { + return cid; + } + } + function toStringV1(bytes, cache2, base2) { + const { prefix } = base2; + const cid = cache2.get(prefix); + if (cid == null) { + const cid2 = base2.encode(bytes); + cache2.set(prefix, cid2); + return cid2; + } else { + return cid; + } + } + var DAG_PB_CODE = 112; + var SHA_256_CODE = 18; + function encodeCID(version, code, multihash) { + const codeOffset = encodingLength(version); + const hashOffset = codeOffset + encodingLength(code); + const bytes = new Uint8Array(hashOffset + multihash.byteLength); + encodeTo(version, bytes, 0); + encodeTo(code, bytes, codeOffset); + bytes.set(multihash, hashOffset); + return bytes; + } + var cidSymbol = Symbol.for("@ipld/js-cid/CID"); + + // shared/functions.js + var multicodes = { JSON: 512, RAW: 0 }; + if (typeof globalThis === "object" && !has(globalThis, "Buffer")) { + const { Buffer: Buffer2 } = require_buffer(); + globalThis.Buffer = Buffer2; + } + function createCID(data, multicode = multicodes.RAW) { + const uint8array = typeof data === "string" ? new TextEncoder().encode(data) : data; + const digest = blake2b256.digest(uint8array); + return CID.create(1, multicode, digest).toString(base58btc.encoder); + } + function blake32Hash(data) { + const uint8array = typeof data === "string" ? new TextEncoder().encode(data) : data; + const digest = blake2b256.digest(uint8array); + return base58btc.encode(digest.bytes); + } + var b64ToBuf = (b64) => Buffer.from(b64, "base64"); + var strToBuf = (str) => Buffer.from(str, "utf8"); + var bytesToB64 = (ary) => Buffer.from(ary).toString("base64"); + + // shared/domains/chelonia/crypto.js + var import_tweetnacl = __toESM(require_nacl_fast()); + var import_scrypt_async = __toESM(require_scrypt_async()); + var EDWARDS25519SHA512BATCH = "edwards25519sha512batch"; + var CURVE25519XSALSA20POLY1305 = "curve25519xsalsa20poly1305"; + var XSALSA20POLY1305 = "xsalsa20poly1305"; + if (false) { + throw new Error("ENABLE_UNSAFE_NULL_CRYPTO cannot be enabled in production mode"); + } + var bytesOrObjectToB64 = (ary) => { + if (!(ary instanceof Uint8Array)) { + throw Error("Unsupported type"); + } + return bytesToB64(ary); + }; + var serializeKey = (key, saveSecretKey) => { + if (false) { + return JSON.stringify([ + key.type, + saveSecretKey ? null : key.publicKey, + saveSecretKey ? key.secretKey : null + ], void 0, 0); + } + if (key.type === EDWARDS25519SHA512BATCH || key.type === CURVE25519XSALSA20POLY1305) { + if (!saveSecretKey) { + if (!key.publicKey) { + throw new Error("Unsupported operation: no public key to export"); + } + return JSON.stringify([ + key.type, + bytesOrObjectToB64(key.publicKey), + null + ], void 0, 0); + } + if (!key.secretKey) { + throw new Error("Unsupported operation: no secret key to export"); + } + return JSON.stringify([ + key.type, + null, + bytesOrObjectToB64(key.secretKey) + ], void 0, 0); + } else if (key.type === XSALSA20POLY1305) { + if (!saveSecretKey) { + throw new Error("Unsupported operation: no public key to export"); + } + if (!key.secretKey) { + throw new Error("Unsupported operation: no secret key to export"); + } + return JSON.stringify([ + key.type, + null, + bytesOrObjectToB64(key.secretKey) + ], void 0, 0); + } + throw new Error("Unsupported key type"); + }; + var deserializeKey = (data) => { + const keyData = JSON.parse(data); + if (!keyData || keyData.length !== 3) { + throw new Error("Invalid key object"); + } + if (false) { + const res = { + type: keyData[0] + }; + if (keyData[2]) { + Object.defineProperty(res, "secretKey", { value: keyData[2] }); + res.publicKey = keyData[2]; + } else { + res.publicKey = keyData[1]; + } + return res; + } + if (keyData[0] === EDWARDS25519SHA512BATCH) { + if (keyData[2]) { + const key = import_tweetnacl.default.sign.keyPair.fromSecretKey(b64ToBuf(keyData[2])); + const res = { + type: keyData[0], + publicKey: key.publicKey + }; + Object.defineProperty(res, "secretKey", { value: key.secretKey }); + return res; + } else if (keyData[1]) { + return { + type: keyData[0], + publicKey: new Uint8Array(b64ToBuf(keyData[1])) + }; + } + throw new Error("Missing secret or public key"); + } else if (keyData[0] === CURVE25519XSALSA20POLY1305) { + if (keyData[2]) { + const key = import_tweetnacl.default.box.keyPair.fromSecretKey(b64ToBuf(keyData[2])); + const res = { + type: keyData[0], + publicKey: key.publicKey + }; + Object.defineProperty(res, "secretKey", { value: key.secretKey }); + return res; + } else if (keyData[1]) { + return { + type: keyData[0], + publicKey: new Uint8Array(b64ToBuf(keyData[1])) + }; + } + throw new Error("Missing secret or public key"); + } else if (keyData[0] === XSALSA20POLY1305) { + if (!keyData[2]) { + throw new Error("Secret key missing"); + } + const res = { + type: keyData[0] + }; + Object.defineProperty(res, "secretKey", { value: new Uint8Array(b64ToBuf(keyData[2])) }); + return res; + } + throw new Error("Unsupported key type"); + }; + var keyId = (inKey) => { + const key = Object(inKey) instanceof String ? deserializeKey(inKey) : inKey; + const serializedKey = serializeKey(key, !key.publicKey); + return blake32Hash(serializedKey); + }; + var verifySignature = (inKey, data, signature) => { + const key = Object(inKey) instanceof String ? deserializeKey(inKey) : inKey; + if (false) { + if (!key.publicKey) { + throw new Error("Public key missing"); + } + if (key.publicKey + ";" + blake32Hash(data) !== signature) { + throw new Error("Invalid signature"); + } + return; + } + if (key.type !== EDWARDS25519SHA512BATCH) { + throw new Error("Unsupported algorithm"); + } + if (!key.publicKey) { + throw new Error("Public key missing"); + } + const decodedSignature = b64ToBuf(signature); + const messageUint8 = strToBuf(data); + const result = import_tweetnacl.default.sign.detached.verify(messageUint8, decodedSignature, key.publicKey); + if (!result) { + throw new Error("Invalid signature"); + } + }; + var decrypt = (inKey, data, ad) => { + const key = Object(inKey) instanceof String ? deserializeKey(inKey) : inKey; + if (false) { + if (!key.secretKey) { + throw new Error("Secret key missing"); + } + if (!data.startsWith(key.secretKey + ";") || !data.endsWith(";" + (ad ?? ""))) { + throw new Error("Additional data mismatch"); + } + return data.slice(String(key.secretKey).length + 1, data.length - 1 - (ad ?? "").length); + } + if (key.type === XSALSA20POLY1305) { + if (!key.secretKey) { + throw new Error("Secret key missing"); + } + const messageWithNonceAsUint8Array = b64ToBuf(data); + const nonce = messageWithNonceAsUint8Array.slice(0, import_tweetnacl.default.secretbox.nonceLength); + const message = messageWithNonceAsUint8Array.slice(import_tweetnacl.default.secretbox.nonceLength, messageWithNonceAsUint8Array.length); + if (ad) { + const adHash = import_tweetnacl.default.hash(strToBuf(ad)); + const len = Math.min(adHash.length, nonce.length); + for (let i = 0; i < len; i++) { + nonce[i] ^= adHash[i]; + } + } + const decrypted = import_tweetnacl.default.secretbox.open(message, nonce, key.secretKey); + if (!decrypted) { + throw new Error("Could not decrypt message"); + } + return Buffer.from(decrypted).toString("utf-8"); + } else if (key.type === CURVE25519XSALSA20POLY1305) { + if (!key.secretKey) { + throw new Error("Secret key missing"); + } + const messageWithNonceAsUint8Array = b64ToBuf(data); + const ephemeralPublicKey = messageWithNonceAsUint8Array.slice(0, import_tweetnacl.default.box.publicKeyLength); + const nonce = messageWithNonceAsUint8Array.slice(import_tweetnacl.default.box.publicKeyLength, import_tweetnacl.default.box.publicKeyLength + import_tweetnacl.default.box.nonceLength); + const message = messageWithNonceAsUint8Array.slice(import_tweetnacl.default.box.publicKeyLength + import_tweetnacl.default.box.nonceLength); + if (ad) { + const adHash = import_tweetnacl.default.hash(strToBuf(ad)); + const len = Math.min(adHash.length, nonce.length); + for (let i = 0; i < len; i++) { + nonce[i] ^= adHash[i]; + } + } + const decrypted = import_tweetnacl.default.box.open(message, nonce, ephemeralPublicKey, key.secretKey); + if (!decrypted) { + throw new Error("Could not decrypt message"); + } + return Buffer.from(decrypted).toString("utf-8"); + } + throw new Error("Unsupported algorithm"); + }; + + // shared/domains/chelonia/encryptedData.js + var import_sbp3 = __toESM(__require("@sbp/sbp")); + + // shared/domains/chelonia/signedData.js + var import_sbp2 = __toESM(__require("@sbp/sbp")); + var rootStateFn = () => (0, import_sbp2.default)("chelonia/rootState"); + var proto = Object.create(null, { + _isSignedData: { + value: true + } + }); + var wrapper = (o) => { + return Object.setPrototypeOf(o, proto); + }; + var isSignedData = (o) => { + return !!o && !!Object.getPrototypeOf(o)?._isSignedData; + }; + var verifySignatureData = function(height, data, additionalData) { + if (!this) { + throw new ChelErrorSignatureError("Missing contract state"); + } + if (!isRawSignedData(data)) { + throw new ChelErrorSignatureError("Invalid message format"); + } + if (!Number.isSafeInteger(height) || height < 0) { + throw new ChelErrorSignatureError(`Height ${height} is invalid or out of range`); + } + const [serializedMessage, sKeyId, signature] = data._signedData; + const designatedKey = this._vm?.authorizedKeys?.[sKeyId]; + if (!designatedKey || height > designatedKey._notAfterHeight || height < designatedKey._notBeforeHeight || !designatedKey.purpose.includes("sig")) { + if ("") { + console.error(`Key ${sKeyId} is unauthorized or expired for the current contract`, { designatedKey, height, state: JSON.parse(JSON.stringify((0, import_sbp2.default)("state/vuex/state"))) }); + Promise.reject(new ChelErrorSignatureKeyUnauthorized(`Key ${sKeyId} is unauthorized or expired for the current contract`)); + } + throw new ChelErrorSignatureKeyUnauthorized(`Key ${sKeyId} is unauthorized or expired for the current contract`); + } + const deserializedKey = designatedKey.data; + const payloadToSign = blake32Hash(`${blake32Hash(additionalData)}${blake32Hash(serializedMessage)}`); + try { + verifySignature(deserializedKey, payloadToSign, signature); + const message = JSON.parse(serializedMessage); + return [sKeyId, message]; + } catch (e) { + throw new ChelErrorSignatureError(e?.message || e); + } + }; + var signedIncomingData = (contractID, state, data, height, additionalData, mapperFn) => { + const stringValueFn = () => data; + let verifySignedValue; + const verifySignedValueFn = () => { + if (verifySignedValue) { + return verifySignedValue[1]; + } + verifySignedValue = verifySignatureData.call(state || rootStateFn()[contractID], height, data, additionalData); + if (mapperFn) + verifySignedValue[1] = mapperFn(verifySignedValue[1]); + return verifySignedValue[1]; + }; + return wrapper({ + get signingKeyId() { + if (verifySignedValue) + return verifySignedValue[0]; + return signedDataKeyId(data); + }, + get serialize() { + return stringValueFn; + }, + get context() { + return [contractID, data, height, additionalData]; + }, + get toString() { + return () => JSON.stringify(this.serialize()); + }, + get valueOf() { + return verifySignedValueFn; + }, + get toJSON() { + return this.serialize; + }, + get get() { + return (k) => k !== "_signedData" ? data[k] : void 0; + } + }); + }; + var signedDataKeyId = (data) => { + if (!isRawSignedData(data)) { + throw new ChelErrorSignatureError("Invalid message format"); + } + return data._signedData[1]; + }; + var isRawSignedData = (data) => { + if (!data || typeof data !== "object" || !has(data, "_signedData") || !Array.isArray(data._signedData) || data._signedData.length !== 3 || data._signedData.map((v) => typeof v).filter((v) => v !== "string").length !== 0) { + return false; + } + return true; + }; + var rawSignedIncomingData = (data) => { + if (!isRawSignedData(data)) { + throw new ChelErrorSignatureError("Invalid message format"); + } + const stringValueFn = () => data; + let verifySignedValue; + const verifySignedValueFn = () => { + if (verifySignedValue) { + return verifySignedValue[1]; + } + verifySignedValue = [data._signedData[1], JSON.parse(data._signedData[0])]; + return verifySignedValue[1]; + }; + return wrapper({ + get signingKeyId() { + if (verifySignedValue) + return verifySignedValue[0]; + return signedDataKeyId(data); + }, + get serialize() { + return stringValueFn; + }, + get toString() { + return () => JSON.stringify(this.serialize()); + }, + get valueOf() { + return verifySignedValueFn; + }, + get toJSON() { + return this.serialize; + }, + get get() { + return (k) => k !== "_signedData" ? data[k] : void 0; + } + }); + }; + + // shared/domains/chelonia/encryptedData.js + var rootStateFn2 = () => (0, import_sbp3.default)("chelonia/rootState"); + var proto2 = Object.create(null, { + _isEncryptedData: { + value: true + } + }); + var wrapper2 = (o) => { + return Object.setPrototypeOf(o, proto2); + }; + var isEncryptedData = (o) => { + return !!o && !!Object.getPrototypeOf(o)?._isEncryptedData; + }; + var decryptData = function(height, data, additionalKeys, additionalData, validatorFn) { + if (!this) { + throw new ChelErrorDecryptionError("Missing contract state"); + } + if (typeof data.valueOf === "function") + data = data.valueOf(); + if (!isRawEncryptedData(data)) { + throw new ChelErrorDecryptionError("Invalid message format"); + } + const [eKeyId, message] = data; + const key = additionalKeys[eKeyId]; + if (!key) { + throw new ChelErrorDecryptionKeyNotFound(`Key ${eKeyId} not found`); + } + const designatedKey = this._vm?.authorizedKeys?.[eKeyId]; + if (!designatedKey || height > designatedKey._notAfterHeight || height < designatedKey._notBeforeHeight || !designatedKey.purpose.includes("enc")) { + throw new ChelErrorUnexpected(`Key ${eKeyId} is unauthorized or expired for the current contract`); + } + const deserializedKey = typeof key === "string" ? deserializeKey(key) : key; + try { + const result = JSON.parse(decrypt(deserializedKey, message, additionalData)); + if (typeof validatorFn === "function") + validatorFn(result, eKeyId); + return result; + } catch (e) { + throw new ChelErrorDecryptionError(e?.message || e); + } + }; + var encryptedIncomingData = (contractID, state, data, height, additionalKeys, additionalData, validatorFn) => { + let decryptedValue; + const decryptedValueFn = () => { + if (decryptedValue) { + return decryptedValue; + } + if (!state || !additionalKeys) { + const rootState = rootStateFn2(); + state = state || rootState[contractID]; + additionalKeys = additionalKeys ?? rootState.secretKeys; + } + decryptedValue = decryptData.call(state, height, data, additionalKeys, additionalData || "", validatorFn); + if (isRawSignedData(decryptedValue)) { + decryptedValue = signedIncomingData(contractID, state, decryptedValue, height, additionalData || ""); + } + return decryptedValue; + }; + return wrapper2({ + get encryptionKeyId() { + return encryptedDataKeyId(data); + }, + get serialize() { + return () => data; + }, + get toString() { + return () => JSON.stringify(this.serialize()); + }, + get valueOf() { + return decryptedValueFn; + }, + get toJSON() { + return this.serialize; + } + }); + }; + var encryptedIncomingForeignData = (contractID, _0, data, _1, additionalKeys, additionalData, validatorFn) => { + let decryptedValue; + const decryptedValueFn = () => { + if (decryptedValue) { + return decryptedValue; + } + const rootState = rootStateFn2(); + const state = rootState[contractID]; + decryptedValue = decryptData.call(state, NaN, data, additionalKeys ?? rootState.secretKeys, additionalData || "", validatorFn); + if (isRawSignedData(decryptedValue)) { + return signedIncomingData(contractID, state, decryptedValue, NaN, additionalData || ""); + } + return decryptedValue; + }; + return wrapper2({ + get encryptionKeyId() { + return encryptedDataKeyId(data); + }, + get serialize() { + return () => data; + }, + get toString() { + return () => JSON.stringify(this.serialize()); + }, + get valueOf() { + return decryptedValueFn; + }, + get toJSON() { + return this.serialize; + } + }); + }; + var encryptedDataKeyId = (data) => { + if (!isRawEncryptedData(data)) { + throw new ChelErrorDecryptionError("Invalid message format"); + } + return data[0]; + }; + var isRawEncryptedData = (data) => { + if (!Array.isArray(data) || data.length !== 2 || data.map((v) => typeof v).filter((v) => v !== "string").length !== 0) { + return false; + } + return true; + }; + var unwrapMaybeEncryptedData = (data) => { + if (isEncryptedData(data)) { + if (false) + return; + try { + return { + encryptionKeyId: data.encryptionKeyId, + data: data.valueOf() + }; + } catch (e) { + console.warn("unwrapMaybeEncryptedData: Unable to decrypt", e); + } + } else { + return { + encryptionKeyId: null, + data + }; + } + }; + var maybeEncryptedIncomingData = (contractID, state, data, height, additionalKeys, additionalData, validatorFn) => { + if (isRawEncryptedData(data)) { + return encryptedIncomingData(contractID, state, data, height, additionalKeys, additionalData, validatorFn); + } else { + validatorFn?.(data, ""); + return data; + } + }; + + // shared/domains/chelonia/GIMessage.js + var decryptedAndVerifiedDeserializedMessage = (head, headJSON, contractID, parsedMessage, additionalKeys, state) => { + const op = head.op; + const height = head.height; + const message = op === GIMessage.OP_ACTION_ENCRYPTED ? encryptedIncomingData(contractID, state, parsedMessage, height, additionalKeys, headJSON, void 0) : parsedMessage; + if ([GIMessage.OP_KEY_ADD, GIMessage.OP_KEY_UPDATE].includes(op)) { + return message.map((key) => { + return maybeEncryptedIncomingData(contractID, state, key, height, additionalKeys, headJSON, (key2, eKeyId) => { + if (key2.meta?.private?.content) { + key2.meta.private.content = encryptedIncomingData(contractID, state, key2.meta.private.content, height, additionalKeys, headJSON, (value) => { + const computedKeyId = keyId(value); + if (computedKeyId !== key2.id) { + throw new Error(`Key ID mismatch. Expected to decrypt key ID ${key2.id} but got ${computedKeyId}`); + } + }); + } + if (key2.meta?.keyRequest?.reference) { + try { + key2.meta.keyRequest.reference = maybeEncryptedIncomingData(contractID, state, key2.meta.keyRequest.reference, height, additionalKeys, headJSON)?.valueOf(); + } catch { + delete key2.meta.keyRequest.reference; + } + } + if (key2.meta?.keyRequest?.contractID) { + try { + key2.meta.keyRequest.contractID = maybeEncryptedIncomingData(contractID, state, key2.meta.keyRequest.contractID, height, additionalKeys, headJSON)?.valueOf(); + } catch { + delete key2.meta.keyRequest.contractID; + } + } + }); + }); + } + if (op === GIMessage.OP_CONTRACT) { + message.keys = message.keys?.map((key, eKeyId) => { + return maybeEncryptedIncomingData(contractID, state, key, height, additionalKeys, headJSON, (key2) => { + if (!key2.meta?.private?.content) + return; + const decryptionFn = message.foreignContractID ? encryptedIncomingForeignData : encryptedIncomingData; + const decryptionContract = message.foreignContractID ? message.foreignContractID : contractID; + key2.meta.private.content = decryptionFn(decryptionContract, state, key2.meta.private.content, height, additionalKeys, headJSON, (value) => { + const computedKeyId = keyId(value); + if (computedKeyId !== key2.id) { + throw new Error(`Key ID mismatch. Expected to decrypt key ID ${key2.id} but got ${computedKeyId}`); + } + }); + }); + }); + } + if (op === GIMessage.OP_KEY_SHARE) { + return maybeEncryptedIncomingData(contractID, state, message, height, additionalKeys, headJSON, (message2) => { + message2.keys?.forEach((key) => { + if (!key.meta?.private?.content) + return; + const decryptionFn = message2.foreignContractID ? encryptedIncomingForeignData : encryptedIncomingData; + const decryptionContract = message2.foreignContractID || contractID; + key.meta.private.content = decryptionFn(decryptionContract, state, key.meta.private.content, height, additionalKeys, headJSON, (value) => { + const computedKeyId = keyId(value); + if (computedKeyId !== key.id) { + throw new Error(`Key ID mismatch. Expected to decrypt key ID ${key.id} but got ${computedKeyId}`); + } + }); + }); + }); + } + if (op === GIMessage.OP_KEY_REQUEST) { + return maybeEncryptedIncomingData(contractID, state, message, height, additionalKeys, headJSON, (msg) => { + msg.replyWith = signedIncomingData(msg.contractID, void 0, msg.replyWith, msg.height, headJSON); + }); + } + if (op === GIMessage.OP_ACTION_UNENCRYPTED && isRawSignedData(message)) { + return signedIncomingData(contractID, state, message, height, headJSON); + } + if (op === GIMessage.OP_ACTION_ENCRYPTED) { + return message; + } + if (op === GIMessage.OP_KEY_DEL) { + return message.map((key) => { + return maybeEncryptedIncomingData(contractID, state, key, height, additionalKeys, headJSON, void 0); + }); + } + if (op === GIMessage.OP_KEY_REQUEST_SEEN) { + return maybeEncryptedIncomingData(contractID, state, parsedMessage, height, additionalKeys, headJSON, void 0); + } + if (op === GIMessage.OP_ATOMIC) { + return message.map(([opT, opV]) => [ + opT, + decryptedAndVerifiedDeserializedMessage({ ...head, op: opT }, headJSON, contractID, opV, additionalKeys, state) + ]); + } + return message; + }; + var _GIMessage = class { + _mapping; + _head; + _message; + _signedMessageData; + _direction; + _decryptedValue; + _innerSigningKeyId; + static createV1_0({ + contractID, + previousHEAD = null, + height = Number.MAX_SAFE_INTEGER, + op, + manifest + }) { + const head = { + version: "1.0.0", + previousHEAD, + height, + contractID, + op: op[0], + manifest + }; + return new this(messageToParams(head, op[1])); + } + static cloneWith(targetHead, targetOp, sources) { + const head = Object.assign({}, targetHead, sources); + return new this(messageToParams(head, targetOp[1])); + } + static deserialize(value, additionalKeys, state) { + if (!value) + throw new Error(`deserialize bad value: ${value}`); + const { head: headJSON, ...parsedValue } = JSON.parse(value); + const head = JSON.parse(headJSON); + const contractID = head.op === _GIMessage.OP_CONTRACT ? createCID(value) : head.contractID; + if (!state?._vm?.authorizedKeys && head.op === _GIMessage.OP_CONTRACT) { + const value2 = rawSignedIncomingData(parsedValue); + const authorizedKeys = Object.fromEntries(value2.valueOf()?.keys.map((k) => [k.id, k])); + state = { + _vm: { + authorizedKeys + } + }; + } + const signedMessageData = signedIncomingData(contractID, state, parsedValue, head.height, headJSON, (message) => decryptedAndVerifiedDeserializedMessage(head, headJSON, contractID, message, additionalKeys, state)); + return new this({ + direction: "incoming", + mapping: { key: createCID(value), value }, + head, + signedMessageData + }); + } + static deserializeHEAD(value) { + if (!value) + throw new Error(`deserialize bad value: ${value}`); + let head, hash; + const result = { + get head() { + if (head === void 0) { + head = JSON.parse(JSON.parse(value).head); + } + return head; + }, + get hash() { + if (!hash) { + hash = createCID(value); + } + return hash; + }, + get contractID() { + return result.head?.contractID ?? result.hash; + }, + description() { + const type = this.head.op; + return ``; + }, + get isFirstMessage() { + return !result.head?.contractID; + } + }; + return result; + } + constructor(params) { + this._direction = params.direction; + this._mapping = params.mapping; + this._head = params.head; + this._signedMessageData = params.signedMessageData; + const type = this.opType(); + let atomicTopLevel = true; + const validate = (type2, message) => { + switch (type2) { + case _GIMessage.OP_CONTRACT: + if (!this.isFirstMessage() || !atomicTopLevel) + throw new Error("OP_CONTRACT: must be first message"); + break; + case _GIMessage.OP_ATOMIC: + if (!atomicTopLevel) { + throw new Error("OP_ATOMIC not allowed inside of OP_ATOMIC"); + } + if (!Array.isArray(message)) { + throw new TypeError("OP_ATOMIC must be of an array type"); + } + atomicTopLevel = false; + message.forEach(([t, m]) => validate(t, m)); + break; + case _GIMessage.OP_KEY_ADD: + case _GIMessage.OP_KEY_DEL: + case _GIMessage.OP_KEY_UPDATE: + if (!Array.isArray(message)) + throw new TypeError("OP_KEY_{ADD|DEL|UPDATE} must be of an array type"); + break; + case _GIMessage.OP_KEY_SHARE: + case _GIMessage.OP_KEY_REQUEST: + case _GIMessage.OP_KEY_REQUEST_SEEN: + case _GIMessage.OP_ACTION_ENCRYPTED: + case _GIMessage.OP_ACTION_UNENCRYPTED: + break; + default: + throw new Error(`unsupported op: ${type2}`); + } + }; + Object.defineProperty(this, "_message", { + get: ((validated) => () => { + const message = this._signedMessageData.valueOf(); + if (!validated) { + validate(type, message); + validated = true; + } + return message; + })() + }); + } + decryptedValue() { + if (this._decryptedValue) + return this._decryptedValue; + try { + const value = this.message(); + const data = unwrapMaybeEncryptedData(value); + if (data?.data) { + if (isSignedData(data.data)) { + this._innerSigningKeyId = data.data.signingKeyId; + this._decryptedValue = data.data.valueOf(); + } else { + this._decryptedValue = data.data; + } + } + return this._decryptedValue; + } catch { + return void 0; + } + } + innerSigningKeyId() { + if (!this._decryptedValue) { + this.decryptedValue(); + } + return this._innerSigningKeyId; + } + head() { + return this._head; + } + message() { + return this._message; + } + op() { + return [this.head().op, this.message()]; + } + rawOp() { + return [this.head().op, this._signedMessageData]; + } + opType() { + return this.head().op; + } + opValue() { + return this.message(); + } + signingKeyId() { + return this._signedMessageData.signingKeyId; + } + manifest() { + return this.head().manifest; + } + description() { + const type = this.opType(); + let desc = ``; + } + isFirstMessage() { + return !this.head().contractID; + } + contractID() { + return this.head().contractID || this.hash(); + } + serialize() { + return this._mapping.value; + } + hash() { + return this._mapping.key; + } + height() { + return this._head.height; + } + id() { + throw new Error("GIMessage.id() was called but it has been removed"); + } + direction() { + return this._direction; + } + static get [serdesTagSymbol]() { + return "GIMessage"; + } + static [serdesSerializeSymbol](m) { + return [m.serialize(), m.direction(), m.decryptedValue(), m.innerSigningKeyId()]; + } + static [serdesDeserializeSymbol]([serialized, direction, decryptedValue, innerSigningKeyId]) { + const m = _GIMessage.deserialize(serialized); + m._direction = direction; + m._decryptedValue = decryptedValue; + m._innerSigningKeyId = innerSigningKeyId; + return m; + } + }; + var GIMessage = _GIMessage; + __publicField(GIMessage, "OP_CONTRACT", "c"); + __publicField(GIMessage, "OP_ACTION_ENCRYPTED", "ae"); + __publicField(GIMessage, "OP_ACTION_UNENCRYPTED", "au"); + __publicField(GIMessage, "OP_KEY_ADD", "ka"); + __publicField(GIMessage, "OP_KEY_DEL", "kd"); + __publicField(GIMessage, "OP_KEY_UPDATE", "ku"); + __publicField(GIMessage, "OP_PROTOCOL_UPGRADE", "pu"); + __publicField(GIMessage, "OP_PROP_SET", "ps"); + __publicField(GIMessage, "OP_PROP_DEL", "pd"); + __publicField(GIMessage, "OP_CONTRACT_AUTH", "ca"); + __publicField(GIMessage, "OP_CONTRACT_DEAUTH", "cd"); + __publicField(GIMessage, "OP_ATOMIC", "a"); + __publicField(GIMessage, "OP_KEY_SHARE", "ks"); + __publicField(GIMessage, "OP_KEY_REQUEST", "kr"); + __publicField(GIMessage, "OP_KEY_REQUEST_SEEN", "krs"); + function messageToParams(head, message) { + let mapping; + return { + direction: has(message, "recreate") ? "outgoing" : "incoming", + get mapping() { + if (!mapping) { + const headJSON = JSON.stringify(head); + const messageJSON = { ...message.serialize(headJSON), head: headJSON }; + const value = JSON.stringify(messageJSON); + mapping = { + key: createCID(value), + value + }; + } + return mapping; + }, + head, + signedMessageData: message + }; + } + + // shared/domains/chelonia/utils.js + var MAX_EVENTS_AFTER = Number.parseInt("", 10) || Infinity; + var findKeyIdByName = (state, name) => state._vm?.authorizedKeys && Object.values(state._vm.authorizedKeys).find((k) => k.name === name && k._notAfterHeight == null)?.id; + var findForeignKeysByContractID = (state, contractID) => state._vm?.authorizedKeys && Object.values(state._vm.authorizedKeys).filter((k) => k._notAfterHeight == null && k.foreignKey?.includes(contractID)).map((k) => k.id); + + // frontend/model/contracts/shared/constants.js + var MAX_HASH_LEN = 300; + var MAX_URL_LEN = 2048; + var IDENTITY_USERNAME_MAX_CHARS = 80; + var IDENTITY_EMAIL_MAX_CHARS = 320; + var IDENTITY_BIO_MAX_CHARS = 500; + + // frontend/model/contracts/shared/functions.js + var import_sbp5 = __toESM(__require("@sbp/sbp")); + + // frontend/model/contracts/shared/time.js + var MINS_MILLIS = 6e4; + var HOURS_MILLIS = 60 * MINS_MILLIS; + var DAYS_MILLIS = 24 * HOURS_MILLIS; + var MONTHS_MILLIS = 30 * DAYS_MILLIS; + var YEARS_MILLIS = 365 * DAYS_MILLIS; + + // frontend/model/contracts/shared/functions.js + var referenceTally = (selector) => { + const delta = { + "retain": 1, + "release": -1 + }; + return { + [selector]: (parentContractID, childContractIDs, op) => { + if (!Array.isArray(childContractIDs)) + childContractIDs = [childContractIDs]; + if (op !== "retain" && op !== "release") + throw new Error("Invalid operation"); + for (const childContractID of childContractIDs) { + const key = `${selector}-${parentContractID}-${childContractID}`; + const count = (0, import_sbp5.default)("okTurtles.data/get", key); + (0, import_sbp5.default)("okTurtles.data/set", key, (count || 0) + delta[op]); + if (count != null) + return; + (0, import_sbp5.default)("chelonia/queueInvocation", parentContractID, () => { + const count2 = (0, import_sbp5.default)("okTurtles.data/get", key); + (0, import_sbp5.default)("okTurtles.data/delete", key); + if (count2 && count2 !== Math.sign(count2)) { + console.warn(`[${selector}] Unexpected value`, parentContractID, childContractID, count2); + if ("") { + Promise.reject(new Error(`[${selector}] Unexpected value ${parentContractID} ${childContractID}: ${count2}`)); + } + } + switch (Math.sign(count2)) { + case -1: + (0, import_sbp5.default)("chelonia/contract/release", childContractID).catch((e) => { + console.error(`[${selector}] Error calling release`, parentContractID, childContractID, e); + }); + break; + case 1: + (0, import_sbp5.default)("chelonia/contract/retain", childContractID).catch((e) => console.error(`[${selector}] Error calling retain`, parentContractID, childContractID, e)); + break; + } + }).catch((e) => { + console.error(`[${selector}] Error in queued invocation`, parentContractID, childContractID, e); + }); + } + } + }; + }; + + // frontend/model/contracts/shared/getters/identity.js + var identity_default = { + loginState(state, getters) { + return getters.currentIdentityState.loginState; + }, + ourDirectMessages(state, getters) { + return getters.currentIdentityState.chatRooms || {}; + } + }; + + // frontend/model/contracts/shared/validators.js + var allowedUsernameCharacters = (value) => /^[\w-]*$/.test(value); + var noConsecutiveHyphensOrUnderscores = (value) => !value.includes("--") && !value.includes("__"); + var noLeadingOrTrailingHyphen = (value) => !value.startsWith("-") && !value.endsWith("-"); + var noLeadingOrTrailingUnderscore = (value) => !value.startsWith("_") && !value.endsWith("_"); + var noUppercase = (value) => value.toLowerCase() === value; + + // frontend/model/contracts/identity.js + var attributesType = objectMaybeOf({ + username: stringMax(IDENTITY_USERNAME_MAX_CHARS, "username"), + displayName: optional(stringMax(IDENTITY_USERNAME_MAX_CHARS, "displayName")), + email: optional(stringMax(IDENTITY_EMAIL_MAX_CHARS, "email")), + bio: optional(stringMax(IDENTITY_BIO_MAX_CHARS, "bio")), + picture: unionOf(stringMax(MAX_URL_LEN), objectOf({ + manifestCid: stringMax(MAX_HASH_LEN, "manifestCid"), + downloadParams: optional(object) + })) + }); + var validateUsername = (username) => { + if (!username) { + throw new TypeError("A username is required"); + } + if (!allowedUsernameCharacters(username)) { + throw new TypeError("A username cannot contain disallowed characters."); + } + if (!noConsecutiveHyphensOrUnderscores(username)) { + throw new TypeError("A username cannot contain two consecutive hyphens or underscores."); + } + if (!noLeadingOrTrailingHyphen(username)) { + throw new TypeError("A username cannot start or end with a hyphen."); + } + if (!noLeadingOrTrailingUnderscore(username)) { + throw new TypeError("A username cannot start or end with an underscore."); + } + if (!noUppercase(username)) { + throw new TypeError("A username cannot contain uppercase letters."); + } + }; + var checkUsernameConsistency = async (contractID, username) => { + const lookupResult = await (0, import_sbp6.default)("namespace/lookup", username, { skipCache: true }); + if (lookupResult === contractID) + return; + console.error(`Mismatched username. The lookup result was ${lookupResult} instead of ${contractID}`); + (0, import_sbp6.default)("chelonia/queueInvocation", contractID, async () => { + const state = await (0, import_sbp6.default)("chelonia/contract/state", contractID); + if (!state) + return; + const username2 = state[contractID].attributes.username; + if (await (0, import_sbp6.default)("namespace/lookupCached", username2) !== contractID) { + (0, import_sbp6.default)("gi.notifications/emit", "WARNING", { + contractID, + message: L("Unable to confirm that the username {username} belongs to this identity contract", { username: username2 }) + }); + } + }); + }; + (0, import_sbp6.default)("chelonia/defineContract", { + name: "gi.contracts/identity", + getters: { + currentIdentityState(state) { + return state; + }, + ...identity_default + }, + actions: { + "gi.contracts/identity": { + validate: (data) => { + objectMaybeOf({ + attributes: attributesType + })(data); + const { username } = data.attributes; + if (!username) { + throw new TypeError("A username is required"); + } + validateUsername(username); + }, + process({ data }, { state }) { + const initialState = merge({ + settings: {}, + attributes: {}, + chatRooms: {}, + groups: {}, + fileDeleteTokens: {} + }, data); + for (const key in initialState) { + state[key] = initialState[key]; + } + }, + async sideEffect({ contractID, data }) { + await checkUsernameConsistency(contractID, data.attributes.username); + } + }, + "gi.contracts/identity/setAttributes": { + validate: (data) => { + attributesType(data); + if (has(data, "username")) { + validateUsername(data.username); + } + }, + process({ data }, { state }) { + for (const key in data) { + state.attributes[key] = data[key]; + } + }, + async sideEffect({ contractID, data }) { + if (has(data, "username")) { + await checkUsernameConsistency(contractID, data.username); + } + } + }, + "gi.contracts/identity/deleteAttributes": { + validate: (data) => { + arrayOf(string)(data); + if (data.includes("username")) { + throw new Error("Username can't be deleted"); + } + }, + process({ data }, { state }) { + for (const attribute of data) { + delete state.attributes[attribute]; + } + } + }, + "gi.contracts/identity/updateSettings": { + validate: object, + process({ data }, { state }) { + for (const key in data) { + state.settings[key] = data[key]; + } + } + }, + "gi.contracts/identity/createDirectMessage": { + validate: (data) => { + objectOf({ + contractID: stringMax(MAX_HASH_LEN, "contractID") + })(data); + }, + process({ data }, { state }) { + const { contractID } = data; + state.chatRooms[contractID] = { + visible: true + }; + }, + sideEffect({ data }) { + (0, import_sbp6.default)("chelonia/contract/retain", data.contractID).catch((e) => { + console.error("[gi.contracts/identity/createDirectMessage/sideEffect] Error calling retain", e); + }); + } + }, + "gi.contracts/identity/joinDirectMessage": { + validate: objectOf({ + contractID: stringMax(MAX_HASH_LEN, "contractID") + }), + process({ data }, { state }) { + const { contractID } = data; + if (state.chatRooms[contractID]) { + throw new TypeError(L("Already joined direct message.")); + } + state.chatRooms[contractID] = { + visible: true + }; + }, + sideEffect({ data }, { state }) { + if (state.chatRooms[data.contractID].visible) { + (0, import_sbp6.default)("chelonia/contract/retain", data.contractID).catch((e) => { + console.error("[gi.contracts/identity/createDirectMessage/sideEffect] Error calling retain", e); + }); + } + } + }, + "gi.contracts/identity/joinGroup": { + validate: objectMaybeOf({ + groupContractID: stringMax(MAX_HASH_LEN, "groupContractID"), + inviteSecret: string, + creatorID: optional(boolean) + }), + async process({ hash, data }, { state }) { + const { groupContractID, inviteSecret } = data; + if (has(state.groups, groupContractID) && !state.groups[groupContractID].hasLeft) { + throw new Error(`Cannot join already joined group ${groupContractID}`); + } + const inviteSecretId = await (0, import_sbp6.default)("chelonia/crypto/keyId", new Secret(inviteSecret)); + state.groups[groupContractID] = { hash, inviteSecretId }; + }, + async sideEffect({ hash, data, contractID }, { state }) { + const { groupContractID, inviteSecret } = data; + await (0, import_sbp6.default)("chelonia/storeSecretKeys", new Secret([{ + key: inviteSecret, + transient: true + }])); + (0, import_sbp6.default)("gi.contracts/identity/referenceTally", contractID, groupContractID, "retain"); + (0, import_sbp6.default)("chelonia/queueInvocation", contractID, async () => { + const state2 = await (0, import_sbp6.default)("chelonia/contract/state", contractID); + if (!state2 || contractID !== (0, import_sbp6.default)("state/vuex/state").loggedIn.identityContractID) { + return; + } + if (!has(state2.groups, groupContractID) || state2.groups[groupContractID].hasLeft || state2.groups[groupContractID].hash !== hash) { + (0, import_sbp6.default)("okTurtles.data/set", `gi.contracts/identity/group-skipped-${groupContractID}-${hash}`, true); + return; + } + const inviteSecretId = (0, import_sbp6.default)("chelonia/crypto/keyId", new Secret(inviteSecret)); + return inviteSecretId; + }).then(async (inviteSecretId) => { + if (!inviteSecretId) + return; + (0, import_sbp6.default)("gi.actions/group/join", { + originatingContractID: contractID, + originatingContractName: "gi.contracts/identity", + contractID: data.groupContractID, + contractName: "gi.contracts/group", + reference: hash, + signingKeyId: inviteSecretId, + innerSigningKeyId: await (0, import_sbp6.default)("chelonia/contract/currentKeyIdByName", state, "csk"), + encryptionKeyId: await (0, import_sbp6.default)("chelonia/contract/currentKeyIdByName", state, "cek") + }).catch((e) => { + console.warn(`[gi.contracts/identity/joinGroup/sideEffect] Error sending gi.actions/group/join action for group ${data.groupContractID}`, e); + }); + }).catch((e) => { + console.error(`[gi.contracts/identity/joinGroup/sideEffect] Error at queueInvocation group ${data.groupContractID}`, e); + }); + } + }, + "gi.contracts/identity/leaveGroup": { + validate: objectOf({ + groupContractID: stringMax(MAX_HASH_LEN, "groupContractID"), + reference: string + }), + process({ data }, { state }) { + const { groupContractID, reference } = data; + if (!has(state.groups, groupContractID) || state.groups[groupContractID].hasLeft) { + throw new Error(`Cannot leave group which hasn't been joined ${groupContractID}`); + } + if (state.groups[groupContractID].hash !== reference) { + throw new Error(`Cannot leave group ${groupContractID} because the reference hash does not match the latest`); + } + state.groups[groupContractID] = { hash: reference, hasLeft: true }; + }, + sideEffect({ data, contractID }) { + (0, import_sbp6.default)("gi.contracts/identity/referenceTally", contractID, data.groupContractID, "release"); + (0, import_sbp6.default)("chelonia/queueInvocation", contractID, async () => { + const state = await (0, import_sbp6.default)("chelonia/contract/state", contractID); + if (!state || contractID !== (0, import_sbp6.default)("state/vuex/state").loggedIn.identityContractID) { + return; + } + const { groupContractID, reference } = data; + if (!has(state.groups, groupContractID) || !state.groups[groupContractID].hasLeft || state.groups[groupContractID].hash !== reference) { + return; + } + (0, import_sbp6.default)("gi.actions/group/removeOurselves", { + contractID: groupContractID + }).catch((e) => { + if (e?.name === "GIErrorUIRuntimeError" && e.cause?.name === "GIGroupNotJoinedError") + return; + console.warn(`[gi.contracts/identity/leaveGroup/sideEffect] Error removing ourselves from group contract ${data.groupContractID}`, e); + }); + if ((0, import_sbp6.default)("state/vuex/state").lastLoggedIn?.[contractID]) { + delete (0, import_sbp6.default)("state/vuex/state").lastLoggedIn[contractID]; + } + (0, import_sbp6.default)("gi.contracts/identity/revokeGroupKeyAndRotateOurPEK", contractID, state, data.groupContractID); + (0, import_sbp6.default)("okTurtles.events/emit", LEFT_GROUP, { identityContractID: contractID, groupContractID: data.groupContractID }); + }).catch((e) => { + console.error(`[gi.contracts/identity/leaveGroup/sideEffect] Error leaving group ${data.groupContractID}`, e); + }); + } + }, + "gi.contracts/identity/setDirectMessageVisibility": { + validate: (data, { state }) => { + objectOf({ + contractID: stringMax(MAX_HASH_LEN, "contractID"), + visible: boolean + })(data); + if (!state.chatRooms[data.contractID]) { + throw new TypeError(L("Not existing direct message.")); + } + }, + process({ data }, { state }) { + state.chatRooms[data.contractID]["visible"] = data.visible; + } + }, + "gi.contracts/identity/saveFileDeleteToken": { + validate: objectOf({ + tokensByManifestCid: arrayOf(objectOf({ + manifestCid: stringMax(MAX_HASH_LEN, "manifestCid"), + token: string + })) + }), + process({ data }, { state }) { + for (const { manifestCid, token } of data.tokensByManifestCid) { + state.fileDeleteTokens[manifestCid] = token; + } + } + }, + "gi.contracts/identity/removeFileDeleteToken": { + validate: objectOf({ + manifestCids: arrayOf(string) + }), + process({ data }, { state }) { + for (const manifestCid of data.manifestCids) { + delete state.fileDeleteTokens[manifestCid]; + } + } + }, + "gi.contracts/identity/setGroupAttributes": { + validate: objectOf({ + groupContractID: string, + attributes: objectMaybeOf({ + seenWelcomeScreen: validatorFrom((v) => v === true) + }) + }), + process({ data }, { state }) { + const { groupContractID, attributes } = data; + if (!has(state.groups, groupContractID) || state.groups[groupContractID].hasLeft) { + throw new Error("Can't set attributes of groups you're not a member of"); + } + if (attributes.seenWelcomeScreen) { + if (state.groups[groupContractID].seenWelcomeScreen) { + throw new Error("seenWelcomeScreen already set"); + } + state.groups[groupContractID].seenWelcomeScreen = attributes.seenWelcomeScreen; + } + } + } + }, + methods: { + "gi.contracts/identity/revokeGroupKeyAndRotateOurPEK": (identityContractID, state, groupContractID) => { + if (!state._volatile) + state["_volatile"] = /* @__PURE__ */ Object.create(null); + if (!state._volatile.pendingKeyRevocations) + state._volatile["pendingKeyRevocations"] = /* @__PURE__ */ Object.create(null); + const CSKid = findKeyIdByName(state, "csk"); + const CEKid = findKeyIdByName(state, "cek"); + const PEKid = findKeyIdByName(state, "pek"); + state._volatile.pendingKeyRevocations[PEKid] = true; + const groupCSKids = findForeignKeysByContractID(state, groupContractID); + if (groupCSKids?.length) { + if (!CEKid) { + throw new Error("Identity CEK not found"); + } + (0, import_sbp6.default)("chelonia/queueInvocation", identityContractID, ["chelonia/out/keyDel", { + contractID: identityContractID, + contractName: "gi.contracts/identity", + data: groupCSKids, + signingKeyId: CSKid + }]).catch((e) => { + console.warn(`revokeGroupKeyAndRotateOurPEK: ${e.name} thrown during keyDel to ${identityContractID}:`, e); + }); + } + (0, import_sbp6.default)("chelonia/queueInvocation", identityContractID, ["chelonia/contract/disconnect", identityContractID, groupContractID]).catch((e) => { + console.warn(`revokeGroupKeyAndRotateOurPEK: ${e.name} thrown during queueEvent to ${identityContractID}:`, e); + }); + (0, import_sbp6.default)("chelonia/queueInvocation", identityContractID, ["gi.actions/out/rotateKeys", identityContractID, "gi.contracts/identity", "pending", "gi.actions/identity/shareNewPEK"]).catch((e) => { + console.warn(`revokeGroupKeyAndRotateOurPEK: ${e.name} thrown during queueEvent to ${identityContractID}:`, e); + }); + }, + ...referenceTally("gi.contracts/identity/referenceTally") + } + }); +})(); +/*! + * Fast "async" scrypt implementation in JavaScript. + * Copyright (c) 2013-2016 Dmitry Chestnykh | BSD License + * https://github.com/dchest/scrypt-async-js + */ +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ +/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ diff --git a/frontend/views/containers/global-dashboard/NewsAndUpdates.vue b/frontend/views/containers/global-dashboard/NewsAndUpdates.vue index 4d083d06d..28b559091 100644 --- a/frontend/views/containers/global-dashboard/NewsAndUpdates.vue +++ b/frontend/views/containers/global-dashboard/NewsAndUpdates.vue @@ -22,6 +22,43 @@ import Avatar from '@components/Avatar.vue' import RenderMessageWithMarkdown from '@containers/chatroom/chat-mentions/RenderMessageWithMarkdown.js' const dummyPosts = [ + { + createdAt: new Date('2025-01-23T00:00:01'), + title: 'Version 1.2.0 + The coming server wipe!', + content: + '**New Features in 1.2.0:**\n\n' + + '- Push notifications! This version includes full support for end-to-end encrypted web push notifications. ' + + 'Works best on mobile as a [PWA](https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Guides/Installing). ' + + 'Please see [our blog](https://groupincome.org/blog/) for this release for more details and caveats about push notifications, especially on iOS.\n' + + '- Push notifications are now used for important in-group events and reminders.\n' + + '- You can now change your password!\n' + + '- Image compression: uploaded images will take up a maximum of ~400KB each to speed up loading times and save server space.\n' + + '- Image viewer now supports left/right arrow keys to switch between multiple image attachments.\n' + + '- Chat file attachments now show their size.\n' + + '- You can now use the paste feature to add an image attachment.\n' + + '- Mobile: `` key creates newline instead of sending message\n' + + '- Chelonia now runs in a service worker to support push notifications and better state management with multiple open tabs.\n\n' + + '**Bugfixes**\n\n' + + '- Prevent accidental creation of multiple DMs.\n' + + '- Fixed rendering of payment table rows.\n' + + '- Fixes for forced-color mode.\n' + + '- Fixed remaining issues related to showing not-logged-in users under group inactivity.\n' + + '- "See proposal" link should always lead to proposal.\n' + + '- Fixed chat auto-scroll issue.\n' + + '- Fixed various markdown rendering bugs in chat.\n' + + '- Miscellaneous bug fixes.\n\n' + + '**Improvements**\n\n' + + '- Added download/delete buttons to the image viewer.\n' + + '- Emojis rendered slightly larger in chat now.\n' + + '- Increased the maximum length of payment details to support long Lightning payment addresses.\n' + + '- Various UI/UX improvements. See the 1.2.0 release [here](https://github.com/okTurtles/group-income/releases) for a complete list.\n\n' + + 'Congratulations to [@Vayras](https://github.com/Vayras) on making their first contribution to the project!\n\n' + + '**Server Wipe Coming in Version 2.0!**\n\n' + + 'Version 2.0 is coming soon, and with it some major backwards-incompatible changes to the internals of Group Income. ' + + 'We will be forced to wipe all data on the groupincome.app site. Therefore, **please backup** any ' + + 'important data before the release to your computer. We will host a temporary backup site where users will be able ' + + 'to access their data for a period of time after the new version launches.' + }, { createdAt: new Date('2024-10-29T00:00:01'), title: '1.1.0 Released!', @@ -30,7 +67,7 @@ const dummyPosts = [ '- "Notes to self": can create DM\'s to yourself now\n' + '- Notifications for non-monetary contributions updates\n' + '- Anyone-can-join invite links are now updated to support maximum 150 invitations\n\n' + - ' NOTE: old anyone-can-join invite links are expired, please use the new one!\n' + + 'NOTE: old anyone-can-join invite links are expired, please use the new one!\n\n' + '**Bugfixes**\n\n' + '- The emoji selector\'s search field is now selected when you open it\n' + '- Fix for usernames in app notifications when user is removed\n' + @@ -104,7 +141,7 @@ export default ({ display: flex; align-items: flex-start; gap: 0.75rem; - padding: 1rem; + padding: 1.5rem; .c-post-img-container { display: inline-flex; @@ -121,7 +158,7 @@ export default ({ flex-grow: 1; h3 { - margin-bottom: 0.25rem; + margin-bottom: 0.5rem; } } } diff --git a/package.json b/package.json index 633de33f1..c0c418329 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "group-income", - "version": "1.1.0", - "contractsVersion": "1.1.0", + "version": "1.2.0", + "contractsVersion": "1.2.0", "private": true, "description": "Group Income is a decentralized and private (end-to-end encrypted) financial safety net for you and your friends.", "scripts": { From b1b27083391389ab1980b87de199707f24054bcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Iv=C3=A1n=20Vieitez=20Parra?= <3857362+corrideat@users.noreply.github.com> Date: Fri, 24 Jan 2025 00:46:12 +0200 Subject: [PATCH 08/24] Fix #2537 & #2538 (#2539) --- .../controller/serviceworkers/sw-primary.js | 3 +++ frontend/model/getters.js | 2 +- frontend/model/state.js | 20 +++++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/frontend/controller/serviceworkers/sw-primary.js b/frontend/controller/serviceworkers/sw-primary.js index f707346d1..d08f0b60d 100644 --- a/frontend/controller/serviceworkers/sw-primary.js +++ b/frontend/controller/serviceworkers/sw-primary.js @@ -88,6 +88,9 @@ const setupRootState = () => { lastRun: Object.create(null) // { notificationKey: number }, } } + + if (!rootState.namespaceLookups) rootState.namespaceLookups = Object.create(null) + if (!rootState.reverseNamespaceLookups) rootState.reverseNamespaceLookups = Object.create(null) } sbp('okTurtles.events/on', CHELONIA_RESET, setupRootState) diff --git a/frontend/model/getters.js b/frontend/model/getters.js index 981039ffd..dbab27600 100644 --- a/frontend/model/getters.js +++ b/frontend/model/getters.js @@ -8,7 +8,7 @@ import groupGetters from './contracts/shared/getters/group.js' import identityGetters from './contracts/shared/getters/identity.js' const checkedUsername = (state: Object, username: string, userID: string) => { - if (username && state.namespaceLookups[username] === userID) { + if (username && state.namespaceLookups?.[username] === userID) { return username } } diff --git a/frontend/model/state.js b/frontend/model/state.js index dfc8681f9..84a75af91 100644 --- a/frontend/model/state.js +++ b/frontend/model/state.js @@ -253,6 +253,26 @@ sbp('sbp/selectors/register', { sbp('gi.actions/group/fixAnyoneCanJoinLink', { contractID }).catch(e => console.error(`[state/vuex/postUpgradeVerification] Error during gi.actions/group/fixAnyoneCanJoinLink for ${contractID}:`, e)) }) }, 'gi.contracts/group') + + // Fix missing `namespaceLookups`. See issue + // Promise.resolve to coerce into a promise, making `then` safe + Promise.resolve(sbp('chelonia/rootState')).then((state) => { + if (state.namespaceLookups) return + + const identityContractIDs = Object.entries(state.contracts) + // $FlowFixMe[incompatible-use] + .filter(([, { type }]) => type === 'gi.contracts/identity') + .map(([id]) => id) + console.info('Fixing missing lookup entries', identityContractIDs) + + return Promise.all(identityContractIDs.map((id) => { + const username = state[id].attributes?.username + if (!username) return undefined + return sbp('namespace/lookup', username, { skipCache: true }) + })).catch(e => { + console.error('[state/vuex/postUpgradeVerification] Error during lookup', e) + }) + }) }, 'state/vuex/save': (encrypted: ?boolean, state: ?Object) => { return sbp('okTurtles.eventQueue/queueEvent', 'state/vuex/save', async function () { From dae6ad647324c4ae269a5d2914796b4f9aded5ab Mon Sep 17 00:00:00 2001 From: Greg Slepak Date: Thu, 23 Jan 2025 14:49:47 -0800 Subject: [PATCH 09/24] v1.2.1 prep --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c0c418329..dc3432a91 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "group-income", - "version": "1.2.0", + "version": "1.2.1", "contractsVersion": "1.2.0", "private": true, "description": "Group Income is a decentralized and private (end-to-end encrypted) financial safety net for you and your friends.", From 4b8263d115b76ce7ba9d3c22ca330fd3b2707a9f Mon Sep 17 00:00:00 2001 From: Greg Slepak Date: Sun, 26 Jan 2025 11:42:44 -0800 Subject: [PATCH 10/24] Fixes slow build issue Co-authored-by: snowteamer <64228468+snowteamer@users.noreply.github.com> --- package-lock.json | 308 +--------------------------------------------- 1 file changed, 2 insertions(+), 306 deletions(-) diff --git a/package-lock.json b/package-lock.json index ce740b0ed..f62f3c1d2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "group-income", - "version": "1.1.0", + "version": "1.2.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "group-income", - "version": "1.1.0", + "version": "1.2.1", "license": "AGPL-3.0", "dependencies": { "@apeleghq/rfc8188": "1.0.7", @@ -6283,54 +6283,6 @@ "esbuild-windows-arm64": "0.14.47" } }, - "node_modules/esbuild-android-64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.14.47.tgz", - "integrity": "sha512-R13Bd9+tqLVFndncMHssZrPWe6/0Kpv2/dt4aA69soX4PRxlzsVpCvoJeFE8sOEoeVEiBkI0myjlkDodXlHa0g==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-android-arm64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.14.47.tgz", - "integrity": "sha512-OkwOjj7ts4lBp/TL6hdd8HftIzOy/pdtbrNA4+0oVWgGG64HrdVzAF5gxtJufAPOsEjkyh1oIYvKAUinKKQRSQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-darwin-64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.14.47.tgz", - "integrity": "sha512-R6oaW0y5/u6Eccti/TS6c/2c1xYTb1izwK3gajJwi4vIfNs1s8B1dQzI1UiC9T61YovOQVuePDcfqHLT3mUZJA==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, "node_modules/esbuild-darwin-arm64": { "version": "0.14.47", "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.47.tgz", @@ -6347,198 +6299,6 @@ "node": ">=12" } }, - "node_modules/esbuild-freebsd-64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.47.tgz", - "integrity": "sha512-ZH8K2Q8/Ux5kXXvQMDsJcxvkIwut69KVrYQhza/ptkW50DC089bCVrJZZ3sKzIoOx+YPTrmsZvqeZERjyYrlvQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-freebsd-arm64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.47.tgz", - "integrity": "sha512-ZJMQAJQsIOhn3XTm7MPQfCzEu5b9STNC+s90zMWe2afy9EwnHV7Ov7ohEMv2lyWlc2pjqLW8QJnz2r0KZmeAEQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-linux-32": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.14.47.tgz", - "integrity": "sha512-FxZOCKoEDPRYvq300lsWCTv1kcHgiiZfNrPtEhFAiqD7QZaXrad8LxyJ8fXGcWzIFzRiYZVtB3ttvITBvAFhKw==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-linux-64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.14.47.tgz", - "integrity": "sha512-nFNOk9vWVfvWYF9YNYksZptgQAdstnDCMtR6m42l5Wfugbzu11VpMCY9XrD4yFxvPo9zmzcoUL/88y0lfJZJJw==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-linux-arm": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.14.47.tgz", - "integrity": "sha512-ZGE1Bqg/gPRXrBpgpvH81tQHpiaGxa8c9Rx/XOylkIl2ypLuOcawXEAo8ls+5DFCcRGt/o3sV+PzpAFZobOsmA==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-linux-arm64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.47.tgz", - "integrity": "sha512-ywfme6HVrhWcevzmsufjd4iT3PxTfCX9HOdxA7Hd+/ZM23Y9nXeb+vG6AyA6jgq/JovkcqRHcL9XwRNpWG6XRw==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-linux-mips64le": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.47.tgz", - "integrity": "sha512-mg3D8YndZ1LvUiEdDYR3OsmeyAew4MA/dvaEJxvyygahWmpv1SlEEnhEZlhPokjsUMfRagzsEF/d/2XF+kTQGg==", - "cpu": [ - "mips64el" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-linux-ppc64le": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.47.tgz", - "integrity": "sha512-WER+f3+szmnZiWoK6AsrTKGoJoErG2LlauSmk73LEZFQ/iWC+KhhDsOkn1xBUpzXWsxN9THmQFltLoaFEH8F8w==", - "cpu": [ - "ppc64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-linux-riscv64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.14.47.tgz", - "integrity": "sha512-1fI6bP3A3rvI9BsaaXbMoaOjLE3lVkJtLxsgLHqlBhLlBVY7UqffWBvkrX/9zfPhhVMd9ZRFiaqXnB1T7BsL2g==", - "cpu": [ - "riscv64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-linux-s390x": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.47.tgz", - "integrity": "sha512-eZrWzy0xFAhki1CWRGnhsHVz7IlSKX6yT2tj2Eg8lhAwlRE5E96Hsb0M1mPSE1dHGpt1QVwwVivXIAacF/G6mw==", - "cpu": [ - "s390x" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-netbsd-64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.47.tgz", - "integrity": "sha512-Qjdjr+KQQVH5Q2Q1r6HBYswFTToPpss3gqCiSw2Fpq/ua8+eXSQyAMG+UvULPqXceOwpnPo4smyZyHdlkcPppQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-openbsd-64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.47.tgz", - "integrity": "sha512-QpgN8ofL7B9z8g5zZqJE+eFvD1LehRlxr25PBkjyyasakm4599iroUpaj96rdqRlO2ShuyqwJdr+oNqWwTUmQw==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=12" - } - }, "node_modules/esbuild-sass-plugin": { "version": "2.2.6", "resolved": "https://registry.npmjs.org/esbuild-sass-plugin/-/esbuild-sass-plugin-2.2.6.tgz", @@ -6572,70 +6332,6 @@ "node": ">=14.0.0" } }, - "node_modules/esbuild-sunos-64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.14.47.tgz", - "integrity": "sha512-uOeSgLUwukLioAJOiGYm3kNl+1wJjgJA8R671GYgcPgCx7QR73zfvYqXFFcIO93/nBdIbt5hd8RItqbbf3HtAQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-windows-32": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.14.47.tgz", - "integrity": "sha512-H0fWsLTp2WBfKLBgwYT4OTfFly4Im/8B5f3ojDv1Kx//kiubVY0IQunP2Koc/fr/0wI7hj3IiBDbSrmKlrNgLQ==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-windows-64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.14.47.tgz", - "integrity": "sha512-/Pk5jIEH34T68r8PweKRi77W49KwanZ8X6lr3vDAtOlH5EumPE4pBHqkCUdELanvsT14yMXLQ/C/8XPi1pAtkQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/esbuild-windows-arm64": { - "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.47.tgz", - "integrity": "sha512-HFSW2lnp62fl86/qPQlqw6asIwCnEsEoNIL1h2uVMgakddf+vUuMcCbtUY1i8sst7KkgHrVKCJQB33YhhOweCQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, "node_modules/escalade": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", From e9f4ce364ae4802902490554daa80920edf68dad Mon Sep 17 00:00:00 2001 From: Greg Slepak Date: Mon, 27 Jan 2025 10:41:23 -0800 Subject: [PATCH 11/24] attempt to fix package-lock.json by deleting node_modules --- package-lock.json | 5645 +++++++++++++++++++++++++++++++++------------ 1 file changed, 4208 insertions(+), 1437 deletions(-) diff --git a/package-lock.json b/package-lock.json index f62f3c1d2..ea2c356f9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -105,6 +105,7 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", + "license": "Apache-2.0", "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.24" @@ -120,11 +121,13 @@ "license": "ISC" }, "node_modules/@babel/code-frame": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz", - "integrity": "sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==", + "version": "7.26.2", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", + "integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==", + "license": "MIT", "dependencies": { - "@babel/highlight": "^7.24.7", + "@babel/helper-validator-identifier": "^7.25.9", + "js-tokens": "^4.0.0", "picocolors": "^1.0.0" }, "engines": { @@ -132,9 +135,10 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.25.4", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.25.4.tgz", - "integrity": "sha512-+LGRog6RAsCJrrrg/IO6LGmpphNe5DiK30dGjCoxxeGv49B10/3XYGxPsAwrDlMFcFEvdAUavDT8r9k/hSyQqQ==", + "version": "7.26.5", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.5.tgz", + "integrity": "sha512-XvcZi1KWf88RVbF9wn8MN6tYFloU5qX8KjuF3E1PVBmJ9eypXfs4GRiJwLuTZL0iSnJUKn1BFPa5BPZZJyFzPg==", + "license": "MIT", "engines": { "node": ">=6.9.0" } @@ -143,6 +147,7 @@ "version": "7.23.7", "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.7.tgz", "integrity": "sha512-+UpDgowcmqe36d4NwqvKsyPMlOLNGMsfMmQ5WGCu+siCe3t3dfe9njrzGfdN4qq+bcNUt0+Vw6haRxBOycs4dw==", + "license": "MIT", "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.23.5", @@ -172,6 +177,7 @@ "version": "7.16.0", "resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.16.0.tgz", "integrity": "sha512-c+AsYOHjI+FgCa+ifLd8sDXp4U4mjkfFgL9NdQWhuA731kAUJs0WdJIXET4A14EJAR9Jv9FFF/MzPWJfV9Oirw==", + "license": "MIT", "dependencies": { "eslint-scope": "^5.1.1", "eslint-visitor-keys": "^2.1.0", @@ -186,50 +192,42 @@ } }, "node_modules/@babel/generator": { - "version": "7.25.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.25.5.tgz", - "integrity": "sha512-abd43wyLfbWoxC6ahM8xTkqLpGB2iWBVyuKC9/srhFunCd1SDNrV1s72bBpK4hLj8KLzHBBcOblvLQZBNw9r3w==", + "version": "7.26.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.5.tgz", + "integrity": "sha512-2caSP6fN9I7HOe6nqhtft7V4g7/V/gfDsC3Ag4W7kEzzvRGKqiv0pu0HogPiZ3KaVSoNDhUws6IJjDjpfmYIXw==", + "license": "MIT", "dependencies": { - "@babel/types": "^7.25.4", + "@babel/parser": "^7.26.5", + "@babel/types": "^7.26.5", "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.25", - "jsesc": "^2.5.1" + "jsesc": "^3.0.2" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-annotate-as-pure": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.24.7.tgz", - "integrity": "sha512-BaDeOonYvhdKw+JoMVkAixAAJzG2jVPIwWoKBPdYuY9b452e2rPuI9QPYh3KpofZ3pW2akOmwZLOiOsHMiqRAg==", - "dependencies": { - "@babel/types": "^7.24.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-builder-binary-assignment-operator-visitor": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.24.7.tgz", - "integrity": "sha512-xZeCVVdwb4MsDBkkyZ64tReWYrLRHlMN72vP7Bdm3OUOuyFZExhsHUUnuWnm2/XOlAJzR0LfPpB56WXZn0X/lA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.25.9.tgz", + "integrity": "sha512-gv7320KBUFJz1RnylIg5WWYPRXKZ884AGkYpgpWW02TH66Dl+HaC1t1CKd0z3R4b6hdYEcmrNZHUmfCP+1u3/g==", + "license": "MIT", "dependencies": { - "@babel/traverse": "^7.24.7", - "@babel/types": "^7.24.7" + "@babel/types": "^7.25.9" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.25.2", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.2.tgz", - "integrity": "sha512-U2U5LsSaZ7TAt3cfaymQ8WHh0pxvdHoEk6HVpaexxixjyEquMh0L0YNJNM6CTGKMXV1iksi0iZkGw4AcFkPaaw==", + "version": "7.26.5", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.26.5.tgz", + "integrity": "sha512-IXuyn5EkouFJscIDuFF5EsiSolseme1s0CZB+QxVugqJLYmKdxI1VfIBOst0SUu4rnk2Z7kqTwmoO1lp3HIfnA==", + "license": "MIT", "dependencies": { - "@babel/compat-data": "^7.25.2", - "@babel/helper-validator-option": "^7.24.8", - "browserslist": "^4.23.1", + "@babel/compat-data": "^7.26.5", + "@babel/helper-validator-option": "^7.25.9", + "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" }, @@ -241,6 +239,7 @@ "version": "5.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "license": "ISC", "dependencies": { "yallist": "^3.0.2" } @@ -248,19 +247,21 @@ "node_modules/@babel/helper-compilation-targets/node_modules/yallist": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "license": "ISC" }, "node_modules/@babel/helper-create-class-features-plugin": { - "version": "7.25.4", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.25.4.tgz", - "integrity": "sha512-ro/bFs3/84MDgDmMwbcHgDa8/E6J3QKNTk4xJJnVeFtGE+tL0K26E3pNxhYz2b67fJpt7Aphw5XcploKXuCvCQ==", - "dependencies": { - "@babel/helper-annotate-as-pure": "^7.24.7", - "@babel/helper-member-expression-to-functions": "^7.24.8", - "@babel/helper-optimise-call-expression": "^7.24.7", - "@babel/helper-replace-supers": "^7.25.0", - "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7", - "@babel/traverse": "^7.25.4", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.25.9.tgz", + "integrity": "sha512-UTZQMvt0d/rSz6KI+qdu7GQze5TIajwTS++GUozlw8VBJDEOAqSXwm1WvmYEZwqdqSGQshRocPDqrt4HBZB3fQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.25.9", + "@babel/helper-member-expression-to-functions": "^7.25.9", + "@babel/helper-optimise-call-expression": "^7.25.9", + "@babel/helper-replace-supers": "^7.25.9", + "@babel/helper-skip-transparent-expression-wrappers": "^7.25.9", + "@babel/traverse": "^7.25.9", "semver": "^6.3.1" }, "engines": { @@ -271,12 +272,13 @@ } }, "node_modules/@babel/helper-create-regexp-features-plugin": { - "version": "7.25.2", - "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.25.2.tgz", - "integrity": "sha512-+wqVGP+DFmqwFD3EH6TMTfUNeqDehV3E/dl+Sd54eaXqm17tEUNbEIn4sVivVowbvUpOtIGxdo3GoXyDH9N/9g==", + "version": "7.26.3", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.26.3.tgz", + "integrity": "sha512-G7ZRb40uUgdKOQqPLjfD12ZmGA54PzqDFUv2BKImnC9QIfGhIHKvVML0oN8IUiDq4iRqpq74ABpvOaerfWdong==", + "license": "MIT", "dependencies": { - "@babel/helper-annotate-as-pure": "^7.24.7", - "regexpu-core": "^5.3.1", + "@babel/helper-annotate-as-pure": "^7.25.9", + "regexpu-core": "^6.2.0", "semver": "^6.3.1" }, "engines": { @@ -287,9 +289,10 @@ } }, "node_modules/@babel/helper-define-polyfill-provider": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.6.2.tgz", - "integrity": "sha512-LV76g+C502biUK6AyZ3LK10vDpDyCzZnhZFXkH1L75zHPj68+qc8Zfpx2th+gzwA2MzyK+1g/3EPl62yFnVttQ==", + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.6.3.tgz", + "integrity": "sha512-HK7Bi+Hj6H+VTHA3ZvBis7V/6hu9QuTrnMXNybfUf2iiuU/N97I8VjB+KbhFF8Rld/Lx5MzoCwPCpPjfK+n8Cg==", + "license": "MIT", "dependencies": { "@babel/helper-compilation-targets": "^7.22.6", "@babel/helper-plugin-utils": "^7.22.5", @@ -302,38 +305,40 @@ } }, "node_modules/@babel/helper-member-expression-to-functions": { - "version": "7.24.8", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.24.8.tgz", - "integrity": "sha512-LABppdt+Lp/RlBxqrh4qgf1oEH/WxdzQNDJIu5gC/W1GyvPVrOBiItmmM8wan2fm4oYqFuFfkXmlGpLQhPY8CA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.25.9.tgz", + "integrity": "sha512-wbfdZ9w5vk0C0oyHqAJbc62+vet5prjj01jjJ8sKn3j9h3MQQlflEdXYvuqRWjHnM12coDEqiC1IRCi0U/EKwQ==", + "license": "MIT", "dependencies": { - "@babel/traverse": "^7.24.8", - "@babel/types": "^7.24.8" + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.25.9" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-imports": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.24.7.tgz", - "integrity": "sha512-8AyH3C+74cgCVVXow/myrynrAGv+nTVg5vKu2nZph9x7RcRwzmh0VFallJuFTZ9mx6u4eSdXZfcOzSqTUm0HCA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz", + "integrity": "sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw==", + "license": "MIT", "dependencies": { - "@babel/traverse": "^7.24.7", - "@babel/types": "^7.24.7" + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.25.9" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.25.2", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.25.2.tgz", - "integrity": "sha512-BjyRAbix6j/wv83ftcVJmBt72QtHI56C7JXZoG2xATiLpmoC7dpd8WnkikExHDVPpi/3qCmO6WY1EaXOluiecQ==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.26.0.tgz", + "integrity": "sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw==", + "license": "MIT", "dependencies": { - "@babel/helper-module-imports": "^7.24.7", - "@babel/helper-simple-access": "^7.24.7", - "@babel/helper-validator-identifier": "^7.24.7", - "@babel/traverse": "^7.25.2" + "@babel/helper-module-imports": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9", + "@babel/traverse": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -343,32 +348,35 @@ } }, "node_modules/@babel/helper-optimise-call-expression": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.24.7.tgz", - "integrity": "sha512-jKiTsW2xmWwxT1ixIdfXUZp+P5yURx2suzLZr5Hi64rURpDYdMW0pv+Uf17EYk2Rd428Lx4tLsnjGJzYKDM/6A==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.25.9.tgz", + "integrity": "sha512-FIpuNaz5ow8VyrYcnXQTDRGvV6tTjkNtCK/RYNDXGSLlUD6cBuQTSw43CShGxjvfBTfcUA/r6UhUCbtYqkhcuQ==", + "license": "MIT", "dependencies": { - "@babel/types": "^7.24.7" + "@babel/types": "^7.25.9" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-plugin-utils": { - "version": "7.24.8", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.8.tgz", - "integrity": "sha512-FFWx5142D8h2Mgr/iPVGH5G7w6jDn4jUSpZTyDnQO0Yn7Ks2Kuz6Pci8H6MPCoUJegd/UZQ3tAvfLCxQSnWWwg==", + "version": "7.26.5", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.26.5.tgz", + "integrity": "sha512-RS+jZcRdZdRFzMyr+wcsaqOmld1/EqTghfaBGQQd/WnRdzdlvSZ//kF7U8VQTxf1ynZ4cjUcYgjVGx13ewNPMg==", + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-remap-async-to-generator": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.25.0.tgz", - "integrity": "sha512-NhavI2eWEIz/H9dbrG0TuOicDhNexze43i5z7lEqwYm0WEZVTwnPpA0EafUTP7+6/W79HWIP2cTe3Z5NiSTVpw==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.25.9.tgz", + "integrity": "sha512-IZtukuUeBbhgOcaW2s06OXTzVNJR0ybm4W5xC1opWFFJMZbwRj5LCk+ByYH7WdZPZTt8KnFwA8pvjN2yqcPlgw==", + "license": "MIT", "dependencies": { - "@babel/helper-annotate-as-pure": "^7.24.7", - "@babel/helper-wrap-function": "^7.25.0", - "@babel/traverse": "^7.25.0" + "@babel/helper-annotate-as-pure": "^7.25.9", + "@babel/helper-wrap-function": "^7.25.9", + "@babel/traverse": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -378,13 +386,14 @@ } }, "node_modules/@babel/helper-replace-supers": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.25.0.tgz", - "integrity": "sha512-q688zIvQVYtZu+i2PsdIu/uWGRpfxzr5WESsfpShfZECkO+d2o+WROWezCi/Q6kJ0tfPa5+pUGUlfx2HhrA3Bg==", + "version": "7.26.5", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.26.5.tgz", + "integrity": "sha512-bJ6iIVdYX1YooY2X7w1q6VITt+LnUILtNk7zT78ykuwStx8BauCzxvFqFaHjOpW1bVnSUM1PN1f0p5P21wHxvg==", + "license": "MIT", "dependencies": { - "@babel/helper-member-expression-to-functions": "^7.24.8", - "@babel/helper-optimise-call-expression": "^7.24.7", - "@babel/traverse": "^7.25.0" + "@babel/helper-member-expression-to-functions": "^7.25.9", + "@babel/helper-optimise-call-expression": "^7.25.9", + "@babel/traverse": "^7.26.5" }, "engines": { "node": ">=6.9.0" @@ -393,85 +402,80 @@ "@babel/core": "^7.0.0" } }, - "node_modules/@babel/helper-simple-access": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.24.7.tgz", - "integrity": "sha512-zBAIvbCMh5Ts+b86r/CjU+4XGYIs+R1j951gxI3KmmxBMhCg4oQMsv6ZXQ64XOm/cvzfU1FmoCyt6+owc5QMYg==", - "dependencies": { - "@babel/traverse": "^7.24.7", - "@babel/types": "^7.24.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/@babel/helper-skip-transparent-expression-wrappers": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.24.7.tgz", - "integrity": "sha512-IO+DLT3LQUElMbpzlatRASEyQtfhSE0+m465v++3jyyXeBTBUjtVZg28/gHeV5mrTJqvEKhKroBGAvhW+qPHiQ==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.25.9.tgz", + "integrity": "sha512-K4Du3BFa3gvyhzgPcntrkDgZzQaq6uozzcpGbOO1OEJaI+EJdqWIMTLgFgQf6lrfiDFo5FU+BxKepI9RmZqahA==", + "license": "MIT", "dependencies": { - "@babel/traverse": "^7.24.7", - "@babel/types": "^7.24.7" + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.25.9" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-string-parser": { - "version": "7.24.8", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.8.tgz", - "integrity": "sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", + "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==", + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz", - "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", + "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-option": { - "version": "7.24.8", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.24.8.tgz", - "integrity": "sha512-xb8t9tD1MHLungh/AIoWYN+gVHaB9kwlu8gffXGSt3FFEIT7RjS+xWbc2vUD1UTZdIpKj/ab3rdqJ7ufngyi2Q==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz", + "integrity": "sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw==", + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-wrap-function": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.25.0.tgz", - "integrity": "sha512-s6Q1ebqutSiZnEjaofc/UKDyC4SbzV5n5SrA2Gq8UawLycr3i04f1dX4OzoQVnexm6aOCh37SQNYlJ/8Ku+PMQ==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.25.9.tgz", + "integrity": "sha512-ETzz9UTjQSTmw39GboatdymDq4XIQbR8ySgVrylRhPOFpsd+JrKHIuF0de7GCWmem+T4uC5z7EZguod7Wj4A4g==", + "license": "MIT", "dependencies": { - "@babel/template": "^7.25.0", - "@babel/traverse": "^7.25.0", - "@babel/types": "^7.25.0" + "@babel/template": "^7.25.9", + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.25.9" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helpers": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.25.0.tgz", - "integrity": "sha512-MjgLZ42aCm0oGjJj8CtSM3DB8NOOf8h2l7DCTePJs29u+v7yO/RBX9nShlKMgFnRks/Q4tBAe7Hxnov9VkGwLw==", + "version": "7.26.7", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.26.7.tgz", + "integrity": "sha512-8NHiL98vsi0mbPQmYAGWwfcFaOy4j2HY49fXJCfuDcdE7fMIsH9a7GdaeXpIBsbT7307WU8KCMp5pUVDNL4f9A==", + "license": "MIT", "dependencies": { - "@babel/template": "^7.25.0", - "@babel/types": "^7.25.0" + "@babel/template": "^7.25.9", + "@babel/types": "^7.26.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/highlight": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.7.tgz", - "integrity": "sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.25.9.tgz", + "integrity": "sha512-llL88JShoCsth8fF8R4SJnIn+WLvR6ccFxu1H3FlMhDontdcmZWf2HgIZ7AIqV3Xcck1idlohrN4EUBQz6klbw==", + "license": "MIT", "dependencies": { - "@babel/helper-validator-identifier": "^7.24.7", + "@babel/helper-validator-identifier": "^7.25.9", "chalk": "^2.4.2", "js-tokens": "^4.0.0", "picocolors": "^1.0.0" @@ -484,6 +488,7 @@ "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "license": "MIT", "dependencies": { "color-convert": "^1.9.0" }, @@ -495,6 +500,7 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "license": "MIT", "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -508,6 +514,7 @@ "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "license": "MIT", "dependencies": { "color-name": "1.1.3" } @@ -515,12 +522,14 @@ "node_modules/@babel/highlight/node_modules/color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "license": "MIT" }, "node_modules/@babel/highlight/node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "license": "MIT", "engines": { "node": ">=0.8.0" } @@ -529,6 +538,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "license": "MIT", "engines": { "node": ">=4" } @@ -537,6 +547,7 @@ "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "license": "MIT", "dependencies": { "has-flag": "^3.0.0" }, @@ -545,11 +556,12 @@ } }, "node_modules/@babel/parser": { - "version": "7.25.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.4.tgz", - "integrity": "sha512-nq+eWrOgdtu3jG5Os4TQP3x3cLA8hR8TvJNjD8vnPa20WGycimcparWnLK4jJhElTK6SDyuJo1weMKO/5LpmLA==", + "version": "7.26.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.7.tgz", + "integrity": "sha512-kEvgGGgEjRUutvdVvZhbn/BxVt+5VSpwXz1j3WYXQbXDo8KzFOPNG2GQbdAiNq8g6wn1yKk7C/qrke03a84V+w==", + "license": "MIT", "dependencies": { - "@babel/types": "^7.25.4" + "@babel/types": "^7.26.7" }, "bin": { "parser": "bin/babel-parser.js" @@ -559,11 +571,12 @@ } }, "node_modules/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.25.0.tgz", - "integrity": "sha512-lXwdNZtTmeVOOFtwM/WDe7yg1PL8sYhRk/XH0FzbR2HDQ0xC+EnQ/JHeoMYSavtU115tnUk0q9CDyq8si+LMAA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.25.9.tgz", + "integrity": "sha512-2qUwwfAFpJLZqxd02YW9btUCZHl+RFvdDkNfZwaIJrvB8Tesjsk8pEQkTvGwZXLqXUx/2oyY3ySRhm6HOXuCug==", + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.8" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -573,13 +586,14 @@ } }, "node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.24.7.tgz", - "integrity": "sha512-+izXIbke1T33mY4MSNnrqhPXDz01WYhEf3yF5NbnUtkiNnm+XBZJl3kNfoK6NKmYlz/D07+l2GWVK/QfDkNCuQ==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.25.9.tgz", + "integrity": "sha512-6xWgLZTJXwilVjlnV7ospI3xi+sl8lN8rXXbBD6vYn3UYDlGsag8wrZkKcSI8G6KgqKP7vNFaDgeDnfAABq61g==", + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7", - "@babel/plugin-transform-optional-chaining": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/helper-skip-transparent-expression-wrappers": "^7.25.9", + "@babel/plugin-transform-optional-chaining": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -589,12 +603,13 @@ } }, "node_modules/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/-/plugin-bugfix-v8-static-class-fields-redefine-readonly-7.25.0.tgz", - "integrity": "sha512-tggFrk1AIShG/RUQbEwt2Tr/E+ObkfwrPjR6BjbRvsx24+PSjK8zrq0GWPNCjo8qpRx4DuJzlcvWJqlm+0h3kw==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/-/plugin-bugfix-v8-static-class-fields-redefine-readonly-7.25.9.tgz", + "integrity": "sha512-aLnMXYPnzwwqhYSCyXfKkIkYgJ8zv9RK+roo9DkTXz38ynIhd9XCbN08s3MGvqL2MYGVUGdRQLL/JqBIeJhJBg==", + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.8", - "@babel/traverse": "^7.25.0" + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/traverse": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -607,6 +622,7 @@ "version": "7.21.0-placeholder-for-preset-env.2", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz", "integrity": "sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w==", + "license": "MIT", "engines": { "node": ">=6.9.0" }, @@ -618,6 +634,7 @@ "version": "7.8.4", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", + "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -629,6 +646,7 @@ "version": "7.12.13", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", + "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.12.13" }, @@ -640,6 +658,7 @@ "version": "7.14.5", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz", "integrity": "sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==", + "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.14.5" }, @@ -654,6 +673,7 @@ "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==", + "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -665,6 +685,7 @@ "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz", "integrity": "sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==", + "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.8.3" }, @@ -673,11 +694,12 @@ } }, "node_modules/@babel/plugin-syntax-flow": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.24.7.tgz", - "integrity": "sha512-9G8GYT/dxn/D1IIKOUBmGX0mnmj46mGH9NnZyJLwtCpgh5f7D2VbuKodb+2s9m1Yavh1s7ASQN8lf0eqrb1LTw==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.26.0.tgz", + "integrity": "sha512-B+O2DnPc0iG+YXFqOxv2WNuNU97ToWjOomUQ78DouOENWUaM5sVrmet9mcomUGQFwpJd//gvUagXBSdzO1fRKg==", + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -687,11 +709,12 @@ } }, "node_modules/@babel/plugin-syntax-import-assertions": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.24.7.tgz", - "integrity": "sha512-Ec3NRUMoi8gskrkBe3fNmEQfxDvY8bgfQpz6jlk/41kX9eUjvpyqWU7PBP/pLAvMaSQjbMNKJmvX57jP+M6bPg==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.26.0.tgz", + "integrity": "sha512-QCWT5Hh830hK5EQa7XzuqIkQU9tT/whqbDz7kuaZMHFl1inRRg7JnuAEOQ0Ur0QUl0NufCk1msK2BeY79Aj/eg==", + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -701,11 +724,12 @@ } }, "node_modules/@babel/plugin-syntax-import-attributes": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.24.7.tgz", - "integrity": "sha512-hbX+lKKeUMGihnK8nvKqmXBInriT3GVjzXKFriV3YC6APGxMbP8RZNFwy91+hocLXq90Mta+HshoB31802bb8A==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.26.0.tgz", + "integrity": "sha512-e2dttdsJ1ZTpi3B9UYGLw41hifAubg19AtCu/2I/F1QNVclOBr1dYpTdmdyZ84Xiz43BS/tCUkMAZNLv12Pi+A==", + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -718,6 +742,7 @@ "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", + "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.10.4" }, @@ -729,6 +754,7 @@ "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", + "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -740,6 +766,7 @@ "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", + "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.10.4" }, @@ -751,6 +778,7 @@ "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", + "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -762,6 +790,7 @@ "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", + "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.10.4" }, @@ -773,6 +802,7 @@ "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", + "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -784,6 +814,7 @@ "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", + "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -795,6 +826,7 @@ "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", + "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -806,6 +838,7 @@ "version": "7.14.5", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz", "integrity": "sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==", + "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.14.5" }, @@ -820,6 +853,7 @@ "version": "7.14.5", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", + "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.14.5" }, @@ -834,6 +868,7 @@ "version": "7.18.6", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-unicode-sets-regex/-/plugin-syntax-unicode-sets-regex-7.18.6.tgz", "integrity": "sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg==", + "license": "MIT", "dependencies": { "@babel/helper-create-regexp-features-plugin": "^7.18.6", "@babel/helper-plugin-utils": "^7.18.6" @@ -846,11 +881,12 @@ } }, "node_modules/@babel/plugin-transform-arrow-functions": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.24.7.tgz", - "integrity": "sha512-Dt9LQs6iEY++gXUwY03DNFat5C2NbO48jj+j/bSAz6b3HgPs39qcPiYt77fDObIcFwj3/C2ICX9YMwGflUoSHQ==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.25.9.tgz", + "integrity": "sha512-6jmooXYIwn9ca5/RylZADJ+EnSxVUS5sjeJ9UPk6RWRzXCmOJCy6dqItPJFpw2cuCangPK4OYr5uhGKcmrm5Qg==", + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -860,14 +896,14 @@ } }, "node_modules/@babel/plugin-transform-async-generator-functions": { - "version": "7.25.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.25.4.tgz", - "integrity": "sha512-jz8cV2XDDTqjKPwVPJBIjORVEmSGYhdRa8e5k5+vN+uwcjSrSxUaebBRa4ko1jqNF2uxyg8G6XYk30Jv285xzg==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.25.9.tgz", + "integrity": "sha512-RXV6QAzTBbhDMO9fWwOmwwTuYaiPbggWQ9INdZqAYeSHyG7FzQ+nOZaUUjNwKv9pV3aE4WFqFm1Hnbci5tBCAw==", + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.8", - "@babel/helper-remap-async-to-generator": "^7.25.0", - "@babel/plugin-syntax-async-generators": "^7.8.4", - "@babel/traverse": "^7.25.4" + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/helper-remap-async-to-generator": "^7.25.9", + "@babel/traverse": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -877,13 +913,14 @@ } }, "node_modules/@babel/plugin-transform-async-to-generator": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.24.7.tgz", - "integrity": "sha512-SQY01PcJfmQ+4Ash7NE+rpbLFbmqA2GPIgqzxfFTL4t1FKRq4zTms/7htKpoCUI9OcFYgzqfmCdH53s6/jn5fA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.25.9.tgz", + "integrity": "sha512-NT7Ejn7Z/LjUH0Gv5KsBCxh7BH3fbLTV0ptHvpeMvrt3cPThHfJfst9Wrb7S8EvJ7vRTFI7z+VAvFVEQn/m5zQ==", + "license": "MIT", "dependencies": { - "@babel/helper-module-imports": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/helper-remap-async-to-generator": "^7.24.7" + "@babel/helper-module-imports": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/helper-remap-async-to-generator": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -893,11 +930,12 @@ } }, "node_modules/@babel/plugin-transform-block-scoped-functions": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.24.7.tgz", - "integrity": "sha512-yO7RAz6EsVQDaBH18IDJcMB1HnrUn2FJ/Jslc/WtPPWcjhpUJXU/rjbwmluzp7v/ZzWcEhTMXELnnsz8djWDwQ==", + "version": "7.26.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.26.5.tgz", + "integrity": "sha512-chuTSY+hq09+/f5lMj8ZSYgCFpppV2CbYrhNFJ1BFoXpiWPnnAb7R0MqrafCpN8E1+YRrtM1MXZHJdIx8B6rMQ==", + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.26.5" }, "engines": { "node": ">=6.9.0" @@ -907,11 +945,12 @@ } }, "node_modules/@babel/plugin-transform-block-scoping": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.25.0.tgz", - "integrity": "sha512-yBQjYoOjXlFv9nlXb3f1casSHOZkWr29NX+zChVanLg5Nc157CrbEX9D7hxxtTpuFy7Q0YzmmWfJxzvps4kXrQ==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.25.9.tgz", + "integrity": "sha512-1F05O7AYjymAtqbsFETboN1NvBdcnzMerO+zlMyJBEz6WkMdejvGWw9p05iTSjC85RLlBseHHQpYaM4gzJkBGg==", + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.8" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -924,6 +963,7 @@ "version": "7.23.3", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.23.3.tgz", "integrity": "sha512-uM+AN8yCIjDPccsKGlw271xjJtGii+xQIF/uMPS8H15L12jZTsLfF4o5vNO7d/oUguOyfdikHGc/yi9ge4SGIg==", + "license": "MIT", "dependencies": { "@babel/helper-create-class-features-plugin": "^7.22.15", "@babel/helper-plugin-utils": "^7.22.5" @@ -936,13 +976,13 @@ } }, "node_modules/@babel/plugin-transform-class-static-block": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.24.7.tgz", - "integrity": "sha512-HMXK3WbBPpZQufbMG4B46A90PkuuhN9vBCb5T8+VAHqvAqvcLi+2cKoukcpmUYkszLhScU3l1iudhrks3DggRQ==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.26.0.tgz", + "integrity": "sha512-6J2APTs7BDDm+UMqP1useWqhcRAXo0WIoVj26N7kPFB6S73Lgvyka4KTZYIxtgYXiN5HTyRObA72N2iu628iTQ==", + "license": "MIT", "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/plugin-syntax-class-static-block": "^7.14.5" + "@babel/helper-create-class-features-plugin": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -952,15 +992,16 @@ } }, "node_modules/@babel/plugin-transform-classes": { - "version": "7.25.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.25.4.tgz", - "integrity": "sha512-oexUfaQle2pF/b6E0dwsxQtAol9TLSO88kQvym6HHBWFliV2lGdrPieX+WgMRLSJDVzdYywk7jXbLPuO2KLTLg==", - "dependencies": { - "@babel/helper-annotate-as-pure": "^7.24.7", - "@babel/helper-compilation-targets": "^7.25.2", - "@babel/helper-plugin-utils": "^7.24.8", - "@babel/helper-replace-supers": "^7.25.0", - "@babel/traverse": "^7.25.4", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.25.9.tgz", + "integrity": "sha512-mD8APIXmseE7oZvZgGABDyM34GUmK45Um2TXiBUt7PnuAxrgoSVf123qUzPxEr/+/BHrRn5NMZCdE2m/1F8DGg==", + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.25.9", + "@babel/helper-compilation-targets": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/helper-replace-supers": "^7.25.9", + "@babel/traverse": "^7.25.9", "globals": "^11.1.0" }, "engines": { @@ -971,12 +1012,13 @@ } }, "node_modules/@babel/plugin-transform-computed-properties": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.24.7.tgz", - "integrity": "sha512-25cS7v+707Gu6Ds2oY6tCkUwsJ9YIDbggd9+cu9jzzDgiNq7hR/8dkzxWfKWnTic26vsI3EsCXNd4iEB6e8esQ==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.25.9.tgz", + "integrity": "sha512-HnBegGqXZR12xbcTHlJ9HGxw1OniltT26J5YpfruGqtUHlz/xKf/G2ak9e+t0rVqrjXa9WOhvYPz1ERfMj23AA==", + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/template": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/template": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -986,11 +1028,12 @@ } }, "node_modules/@babel/plugin-transform-destructuring": { - "version": "7.24.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.24.8.tgz", - "integrity": "sha512-36e87mfY8TnRxc7yc6M9g9gOB7rKgSahqkIKwLpz4Ppk2+zC2Cy1is0uwtuSG6AE4zlTOUa+7JGz9jCJGLqQFQ==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.25.9.tgz", + "integrity": "sha512-WkCGb/3ZxXepmMiX101nnGiU+1CAdut8oHyEOHxkKuS1qKpU2SMXE2uSvfz8PBuLd49V6LEsbtyPhWC7fnkgvQ==", + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.8" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1000,12 +1043,13 @@ } }, "node_modules/@babel/plugin-transform-dotall-regex": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.24.7.tgz", - "integrity": "sha512-ZOA3W+1RRTSWvyqcMJDLqbchh7U4NRGqwRfFSVbOLS/ePIP4vHB5e8T8eXcuqyN1QkgKyj5wuW0lcS85v4CrSw==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.25.9.tgz", + "integrity": "sha512-t7ZQ7g5trIgSRYhI9pIJtRl64KHotutUJsh4Eze5l7olJv+mRSg4/MmbZ0tv1eeqRbdvo/+trvJD/Oc5DmW2cA==", + "license": "MIT", "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-create-regexp-features-plugin": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1015,11 +1059,12 @@ } }, "node_modules/@babel/plugin-transform-duplicate-keys": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.24.7.tgz", - "integrity": "sha512-JdYfXyCRihAe46jUIliuL2/s0x0wObgwwiGxw/UbgJBr20gQBThrokO4nYKgWkD7uBaqM7+9x5TU7NkExZJyzw==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.25.9.tgz", + "integrity": "sha512-LZxhJ6dvBb/f3x8xwWIuyiAHy56nrRG3PeYTpBkkzkYRRQ6tJLu68lEF5VIqMUZiAV7a8+Tb78nEoMCMcqjXBw==", + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1029,12 +1074,12 @@ } }, "node_modules/@babel/plugin-transform-dynamic-import": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.24.7.tgz", - "integrity": "sha512-sc3X26PhZQDb3JhORmakcbvkeInvxz+A8oda99lj7J60QRuPZvNAk9wQlTBS1ZynelDrDmTU4pw1tyc5d5ZMUg==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.25.9.tgz", + "integrity": "sha512-GCggjexbmSLaFhqsojeugBpeaRIgWNTcgKVq/0qIteFEqY2A+b9QidYadrWlnbWQUrW5fn+mCvf3tr7OeBFTyg==", + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/plugin-syntax-dynamic-import": "^7.8.3" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1044,12 +1089,12 @@ } }, "node_modules/@babel/plugin-transform-exponentiation-operator": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.24.7.tgz", - "integrity": "sha512-Rqe/vSc9OYgDajNIK35u7ot+KeCoetqQYFXM4Epf7M7ez3lWlOjrDjrwMei6caCVhfdw+mIKD4cgdGNy5JQotQ==", + "version": "7.26.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.26.3.tgz", + "integrity": "sha512-7CAHcQ58z2chuXPWblnn1K6rLDnDWieghSOEmqQsrBenH0P9InCUtOJYD89pvngljmZlJcz3fcmgYsXFNGa1ZQ==", + "license": "MIT", "dependencies": { - "@babel/helper-builder-binary-assignment-operator-visitor": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1059,12 +1104,12 @@ } }, "node_modules/@babel/plugin-transform-export-namespace-from": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.24.7.tgz", - "integrity": "sha512-v0K9uNYsPL3oXZ/7F9NNIbAj2jv1whUEtyA6aujhekLs56R++JDQuzRcP2/z4WX5Vg/c5lE9uWZA0/iUoFhLTA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.25.9.tgz", + "integrity": "sha512-2NsEz+CxzJIVOPx2o9UsW1rXLqtChtLoVnwYHHiB04wS5sgn7mrV45fWMBX0Kk+ub9uXytVYfNP2HjbVbCB3Ww==", + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/plugin-syntax-export-namespace-from": "^7.8.3" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1074,12 +1119,13 @@ } }, "node_modules/@babel/plugin-transform-flow-strip-types": { - "version": "7.25.2", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.25.2.tgz", - "integrity": "sha512-InBZ0O8tew5V0K6cHcQ+wgxlrjOw1W4wDXLkOTjLRD8GYhTSkxTVBtdy3MMtvYBrbAWa1Qm3hNoTc1620Yj+Mg==", + "version": "7.26.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.26.5.tgz", + "integrity": "sha512-eGK26RsbIkYUns3Y8qKl362juDDYK+wEdPGHGrhzUl6CewZFo55VZ7hg+CyMFU4dd5QQakBN86nBMpRsFpRvbQ==", + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.8", - "@babel/plugin-syntax-flow": "^7.24.7" + "@babel/helper-plugin-utils": "^7.26.5", + "@babel/plugin-syntax-flow": "^7.26.0" }, "engines": { "node": ">=6.9.0" @@ -1089,12 +1135,13 @@ } }, "node_modules/@babel/plugin-transform-for-of": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.24.7.tgz", - "integrity": "sha512-wo9ogrDG1ITTTBsy46oGiN1dS9A7MROBTcYsfS8DtsImMkHk9JXJ3EWQM6X2SUw4x80uGPlwj0o00Uoc6nEE3g==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.25.9.tgz", + "integrity": "sha512-LqHxduHoaGELJl2uhImHwRQudhCM50pT46rIBNvtT/Oql3nqiS3wOwP+5ten7NpYSXrrVLgtZU3DZmPtWZo16A==", + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/helper-skip-transparent-expression-wrappers": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1104,13 +1151,14 @@ } }, "node_modules/@babel/plugin-transform-function-name": { - "version": "7.25.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.25.1.tgz", - "integrity": "sha512-TVVJVdW9RKMNgJJlLtHsKDTydjZAbwIsn6ySBPQaEAUU5+gVvlJt/9nRmqVbsV/IBanRjzWoaAQKLoamWVOUuA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.25.9.tgz", + "integrity": "sha512-8lP+Yxjv14Vc5MuWBpJsoUCd3hD6V9DgBon2FVYL4jJgbnVQ9fTgYmonchzZJOVNgzEgbxp4OwAf6xz6M/14XA==", + "license": "MIT", "dependencies": { - "@babel/helper-compilation-targets": "^7.24.8", - "@babel/helper-plugin-utils": "^7.24.8", - "@babel/traverse": "^7.25.1" + "@babel/helper-compilation-targets": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/traverse": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1120,12 +1168,12 @@ } }, "node_modules/@babel/plugin-transform-json-strings": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.24.7.tgz", - "integrity": "sha512-2yFnBGDvRuxAaE/f0vfBKvtnvvqU8tGpMHqMNpTN2oWMKIR3NqFkjaAgGwawhqK/pIN2T3XdjGPdaG0vDhOBGw==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.25.9.tgz", + "integrity": "sha512-xoTMk0WXceiiIvsaquQQUaLLXSW1KJ159KP87VilruQm0LNNGxWzahxSS6T6i4Zg3ezp4vA4zuwiNUR53qmQAw==", + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/plugin-syntax-json-strings": "^7.8.3" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1135,11 +1183,12 @@ } }, "node_modules/@babel/plugin-transform-literals": { - "version": "7.25.2", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.25.2.tgz", - "integrity": "sha512-HQI+HcTbm9ur3Z2DkO+jgESMAMcYLuN/A7NRw9juzxAezN9AvqvUTnpKP/9kkYANz6u7dFlAyOu44ejuGySlfw==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.25.9.tgz", + "integrity": "sha512-9N7+2lFziW8W9pBl2TzaNht3+pgMIRP74zizeCSrtnSKVdUl8mAjjOP2OOVQAfZ881P2cNjDj1uAMEdeD50nuQ==", + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.8" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1149,12 +1198,12 @@ } }, "node_modules/@babel/plugin-transform-logical-assignment-operators": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.24.7.tgz", - "integrity": "sha512-4D2tpwlQ1odXmTEIFWy9ELJcZHqrStlzK/dAOWYyxX3zT0iXQB6banjgeOJQXzEc4S0E0a5A+hahxPaEFYftsw==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.25.9.tgz", + "integrity": "sha512-wI4wRAzGko551Y8eVf6iOY9EouIDTtPb0ByZx+ktDGHwv6bHFimrgJM/2T021txPZ2s4c7bqvHbd+vXG6K948Q==", + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1164,11 +1213,12 @@ } }, "node_modules/@babel/plugin-transform-member-expression-literals": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.24.7.tgz", - "integrity": "sha512-T/hRC1uqrzXMKLQ6UCwMT85S3EvqaBXDGf0FaMf4446Qx9vKwlghvee0+uuZcDUCZU5RuNi4781UQ7R308zzBw==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.25.9.tgz", + "integrity": "sha512-PYazBVfofCQkkMzh2P6IdIUaCEWni3iYEerAsRWuVd8+jlM1S9S9cz1dF9hIzyoZ8IA3+OwVYIp9v9e+GbgZhA==", + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1178,12 +1228,13 @@ } }, "node_modules/@babel/plugin-transform-modules-amd": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.24.7.tgz", - "integrity": "sha512-9+pB1qxV3vs/8Hdmz/CulFB8w2tuu6EB94JZFsjdqxQokwGa9Unap7Bo2gGBGIvPmDIVvQrom7r5m/TCDMURhg==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.25.9.tgz", + "integrity": "sha512-g5T11tnI36jVClQlMlt4qKDLlWnG5pP9CSM4GhdRciTNMRgkfpo5cR6b4rGIOYPgRRuFAvwjPQ/Yk+ql4dyhbw==", + "license": "MIT", "dependencies": { - "@babel/helper-module-transforms": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-module-transforms": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1193,13 +1244,13 @@ } }, "node_modules/@babel/plugin-transform-modules-commonjs": { - "version": "7.24.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.24.8.tgz", - "integrity": "sha512-WHsk9H8XxRs3JXKWFiqtQebdh9b/pTk4EgueygFzYlTKAg0Ud985mSevdNjdXdFBATSKVJGQXP1tv6aGbssLKA==", + "version": "7.26.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.26.3.tgz", + "integrity": "sha512-MgR55l4q9KddUDITEzEFYn5ZsGDXMSsU9E+kh7fjRXTIC3RHqfCo8RPRbyReYJh44HQ/yomFkqbOFohXvDCiIQ==", + "license": "MIT", "dependencies": { - "@babel/helper-module-transforms": "^7.24.8", - "@babel/helper-plugin-utils": "^7.24.8", - "@babel/helper-simple-access": "^7.24.7" + "@babel/helper-module-transforms": "^7.26.0", + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1209,14 +1260,15 @@ } }, "node_modules/@babel/plugin-transform-modules-systemjs": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.25.0.tgz", - "integrity": "sha512-YPJfjQPDXxyQWg/0+jHKj1llnY5f/R6a0p/vP4lPymxLu7Lvl4k2WMitqi08yxwQcCVUUdG9LCUj4TNEgAp3Jw==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.25.9.tgz", + "integrity": "sha512-hyss7iIlH/zLHaehT+xwiymtPOpsiwIIRlCAOwBB04ta5Tt+lNItADdlXw3jAWZ96VJ2jlhl/c+PNIQPKNfvcA==", + "license": "MIT", "dependencies": { - "@babel/helper-module-transforms": "^7.25.0", - "@babel/helper-plugin-utils": "^7.24.8", - "@babel/helper-validator-identifier": "^7.24.7", - "@babel/traverse": "^7.25.0" + "@babel/helper-module-transforms": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9", + "@babel/traverse": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1226,12 +1278,13 @@ } }, "node_modules/@babel/plugin-transform-modules-umd": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.24.7.tgz", - "integrity": "sha512-3aytQvqJ/h9z4g8AsKPLvD4Zqi2qT+L3j7XoFFu1XBlZWEl2/1kWnhmAbxpLgPrHSY0M6UA02jyTiwUVtiKR6A==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.25.9.tgz", + "integrity": "sha512-bS9MVObUgE7ww36HEfwe6g9WakQ0KF07mQF74uuXdkoziUPfKyu/nIm663kz//e5O1nPInPFx36z7WJmJ4yNEw==", + "license": "MIT", "dependencies": { - "@babel/helper-module-transforms": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-module-transforms": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1241,12 +1294,13 @@ } }, "node_modules/@babel/plugin-transform-named-capturing-groups-regex": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.24.7.tgz", - "integrity": "sha512-/jr7h/EWeJtk1U/uz2jlsCioHkZk1JJZVcc8oQsJ1dUlaJD83f4/6Zeh2aHt9BIFokHIsSeDfhUmju0+1GPd6g==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.25.9.tgz", + "integrity": "sha512-oqB6WHdKTGl3q/ItQhpLSnWWOpjUJLsOCLVyeFgeTktkBSCiurvPOsyt93gibI9CmuKvTUEtWmG5VhZD+5T/KA==", + "license": "MIT", "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-create-regexp-features-plugin": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1256,11 +1310,12 @@ } }, "node_modules/@babel/plugin-transform-new-target": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.24.7.tgz", - "integrity": "sha512-RNKwfRIXg4Ls/8mMTza5oPF5RkOW8Wy/WgMAp1/F1yZ8mMbtwXW+HDoJiOsagWrAhI5f57Vncrmr9XeT4CVapA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.25.9.tgz", + "integrity": "sha512-U/3p8X1yCSoKyUj2eOBIx3FOn6pElFOKvAAGf8HTtItuPyB+ZeOqfn+mvTtg9ZlOAjsPdK3ayQEjqHjU/yLeVQ==", + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1270,12 +1325,12 @@ } }, "node_modules/@babel/plugin-transform-nullish-coalescing-operator": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.24.7.tgz", - "integrity": "sha512-Ts7xQVk1OEocqzm8rHMXHlxvsfZ0cEF2yomUqpKENHWMF4zKk175Y4q8H5knJes6PgYad50uuRmt3UJuhBw8pQ==", + "version": "7.26.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.26.6.tgz", + "integrity": "sha512-CKW8Vu+uUZneQCPtXmSBUC6NCAUdya26hWCElAWh5mVSlSRsmiCPUUDKb3Z0szng1hiAJa098Hkhg9o4SE35Qw==", + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" + "@babel/helper-plugin-utils": "^7.26.5" }, "engines": { "node": ">=6.9.0" @@ -1285,12 +1340,12 @@ } }, "node_modules/@babel/plugin-transform-numeric-separator": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.24.7.tgz", - "integrity": "sha512-e6q1TiVUzvH9KRvicuxdBTUj4AdKSRwzIyFFnfnezpCfP2/7Qmbb8qbU2j7GODbl4JMkblitCQjKYUaX/qkkwA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.25.9.tgz", + "integrity": "sha512-TlprrJ1GBZ3r6s96Yq8gEQv82s8/5HnCVHtEJScUj90thHQbwe+E5MLhi2bbNHBEJuzrvltXSru+BUxHDoog7Q==", + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/plugin-syntax-numeric-separator": "^7.10.4" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1303,6 +1358,7 @@ "version": "7.23.4", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.23.4.tgz", "integrity": "sha512-9x9K1YyeQVw0iOXJlIzwm8ltobIIv7j2iLyP2jIhEbqPRQ7ScNgwQufU2I0Gq11VjyG4gI4yMXt2VFags+1N3g==", + "license": "MIT", "dependencies": { "@babel/compat-data": "^7.23.3", "@babel/helper-compilation-targets": "^7.22.15", @@ -1318,12 +1374,13 @@ } }, "node_modules/@babel/plugin-transform-object-super": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.24.7.tgz", - "integrity": "sha512-A/vVLwN6lBrMFmMDmPPz0jnE6ZGx7Jq7d6sT/Ev4H65RER6pZ+kczlf1DthF5N0qaPHBsI7UXiE8Zy66nmAovg==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.25.9.tgz", + "integrity": "sha512-Kj/Gh+Rw2RNLbCK1VAWj2U48yxxqL2x0k10nPtSdRa0O2xnHXalD0s+o1A6a0W43gJ00ANo38jxkQreckOzv5A==", + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/helper-replace-supers": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/helper-replace-supers": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1333,12 +1390,12 @@ } }, "node_modules/@babel/plugin-transform-optional-catch-binding": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.24.7.tgz", - "integrity": "sha512-uLEndKqP5BfBbC/5jTwPxLh9kqPWWgzN/f8w6UwAIirAEqiIVJWWY312X72Eub09g5KF9+Zn7+hT7sDxmhRuKA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.25.9.tgz", + "integrity": "sha512-qM/6m6hQZzDcZF3onzIhZeDHDO43bkNNlOX0i8n3lR6zLbu0GN2d8qfM/IERJZYauhAHSLHy39NF0Ctdvcid7g==", + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/plugin-syntax-optional-catch-binding": "^7.8.3" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1348,13 +1405,13 @@ } }, "node_modules/@babel/plugin-transform-optional-chaining": { - "version": "7.24.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.24.8.tgz", - "integrity": "sha512-5cTOLSMs9eypEy8JUVvIKOu6NgvbJMnpG62VpIHrTmROdQ+L5mDAaI40g25k5vXti55JWNX5jCkq3HZxXBQANw==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.25.9.tgz", + "integrity": "sha512-6AvV0FsLULbpnXeBjrY4dmWF8F7gf8QnvTEoO/wX/5xm/xE1Xo8oPuD3MPS+KS9f9XBEAWN7X1aWr4z9HdOr7A==", + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.8", - "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7", - "@babel/plugin-syntax-optional-chaining": "^7.8.3" + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/helper-skip-transparent-expression-wrappers": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1364,11 +1421,12 @@ } }, "node_modules/@babel/plugin-transform-parameters": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.24.7.tgz", - "integrity": "sha512-yGWW5Rr+sQOhK0Ot8hjDJuxU3XLRQGflvT4lhlSY0DFvdb3TwKaY26CJzHtYllU0vT9j58hc37ndFPsqT1SrzA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.25.9.tgz", + "integrity": "sha512-wzz6MKwpnshBAiRmn4jR8LYz/g8Ksg0o80XmwZDlordjwEk9SxBzTWC7F5ef1jhbrbOW2DJ5J6ayRukrJmnr0g==", + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1378,12 +1436,13 @@ } }, "node_modules/@babel/plugin-transform-private-methods": { - "version": "7.25.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.25.4.tgz", - "integrity": "sha512-ao8BG7E2b/URaUQGqN3Tlsg+M3KlHY6rJ1O1gXAEUnZoyNQnvKyH87Kfg+FoxSeyWUB8ISZZsC91C44ZuBFytw==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.25.9.tgz", + "integrity": "sha512-D/JUozNpQLAPUVusvqMxyvjzllRaF8/nSrP1s2YGQT/W4LHK4xxsMcHjhOGTS01mp9Hda8nswb+FblLdJornQw==", + "license": "MIT", "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.25.4", - "@babel/helper-plugin-utils": "^7.24.8" + "@babel/helper-create-class-features-plugin": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1393,14 +1452,14 @@ } }, "node_modules/@babel/plugin-transform-private-property-in-object": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.24.7.tgz", - "integrity": "sha512-9z76mxwnwFxMyxZWEgdgECQglF2Q7cFLm0kMf8pGwt+GSJsY0cONKj/UuO4bOH0w/uAel3ekS4ra5CEAyJRmDA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.25.9.tgz", + "integrity": "sha512-Evf3kcMqzXA3xfYJmZ9Pg1OvKdtqsDMSWBDzZOPLvHiTt36E75jLDQo5w1gtRU95Q4E5PDttrTf25Fw8d/uWLw==", + "license": "MIT", "dependencies": { - "@babel/helper-annotate-as-pure": "^7.24.7", - "@babel/helper-create-class-features-plugin": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/plugin-syntax-private-property-in-object": "^7.14.5" + "@babel/helper-annotate-as-pure": "^7.25.9", + "@babel/helper-create-class-features-plugin": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1410,11 +1469,12 @@ } }, "node_modules/@babel/plugin-transform-property-literals": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.24.7.tgz", - "integrity": "sha512-EMi4MLQSHfd2nrCqQEWxFdha2gBCqU4ZcCng4WBGZ5CJL4bBRW0ptdqqDdeirGZcpALazVVNJqRmsO8/+oNCBA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.25.9.tgz", + "integrity": "sha512-IvIUeV5KrS/VPavfSM/Iu+RE6llrHrYIKY1yfCzyO/lMXHQ+p7uGhonmGVisv6tSBSVgWzMBohTcvkC9vQcQFA==", + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1424,11 +1484,12 @@ } }, "node_modules/@babel/plugin-transform-regenerator": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.24.7.tgz", - "integrity": "sha512-lq3fvXPdimDrlg6LWBoqj+r/DEWgONuwjuOuQCSYgRroXDH/IdM1C0IZf59fL5cHLpjEH/O6opIRBbqv7ELnuA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.25.9.tgz", + "integrity": "sha512-vwDcDNsgMPDGP0nMqzahDWE5/MLcX8sv96+wfX7as7LoF/kr97Bo/7fI00lXY4wUXYfVmwIIyG80fGZ1uvt2qg==", + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-plugin-utils": "^7.25.9", "regenerator-transform": "^0.15.2" }, "engines": { @@ -1439,11 +1500,12 @@ } }, "node_modules/@babel/plugin-transform-reserved-words": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.24.7.tgz", - "integrity": "sha512-0DUq0pHcPKbjFZCfTss/pGkYMfy3vFWydkUBd9r0GHpIyfs2eCDENvqadMycRS9wZCXR41wucAfJHJmwA0UmoQ==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.25.9.tgz", + "integrity": "sha512-7DL7DKYjn5Su++4RXu8puKZm2XBPHyjWLUidaPEkCUBbE7IPcsrkRHggAOOKydH1dASWdcUBxrkOGNxUv5P3Jg==", + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1456,6 +1518,7 @@ "version": "7.12.1", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.12.1.tgz", "integrity": "sha512-Ac/H6G9FEIkS2tXsZjL4RAdS3L3WHxci0usAnz7laPWUmFiGtj7tIASChqKZMHTSQTQY6xDbOq+V1/vIq3QrWg==", + "license": "MIT", "dependencies": { "@babel/helper-module-imports": "^7.12.1", "@babel/helper-plugin-utils": "^7.10.4", @@ -1470,16 +1533,18 @@ "version": "5.7.2", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "license": "ISC", "bin": { "semver": "bin/semver" } }, "node_modules/@babel/plugin-transform-shorthand-properties": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.24.7.tgz", - "integrity": "sha512-KsDsevZMDsigzbA09+vacnLpmPH4aWjcZjXdyFKGzpplxhbeB4wYtury3vglQkg6KM/xEPKt73eCjPPf1PgXBA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.25.9.tgz", + "integrity": "sha512-MUv6t0FhO5qHnS/W8XCbHmiRWOphNufpE1IVxhK5kuN3Td9FT1x4rx4K42s3RYdMXCXpfWkGSbCSd0Z64xA7Ng==", + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1489,12 +1554,13 @@ } }, "node_modules/@babel/plugin-transform-spread": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.24.7.tgz", - "integrity": "sha512-x96oO0I09dgMDxJaANcRyD4ellXFLLiWhuwDxKZX5g2rWP1bTPkBSwCYv96VDXVT1bD9aPj8tppr5ITIh8hBng==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.25.9.tgz", + "integrity": "sha512-oNknIB0TbURU5pqJFVbOOFspVlrpVwo2H1+HUIsVDvp5VauGGDP1ZEvO8Nn5xyMEs3dakajOxlmkNW7kNgSm6A==", + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/helper-skip-transparent-expression-wrappers": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1504,11 +1570,12 @@ } }, "node_modules/@babel/plugin-transform-sticky-regex": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.24.7.tgz", - "integrity": "sha512-kHPSIJc9v24zEml5geKg9Mjx5ULpfncj0wRpYtxbvKyTtHCYDkVE3aHQ03FrpEo4gEe2vrJJS1Y9CJTaThA52g==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.25.9.tgz", + "integrity": "sha512-WqBUSgeVwucYDP9U/xNRQam7xV8W5Zf+6Eo7T2SRVUFlhRiMNFdFz58u0KZmCVVqs2i7SHgpRnAhzRNmKfi2uA==", + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1518,11 +1585,12 @@ } }, "node_modules/@babel/plugin-transform-template-literals": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.24.7.tgz", - "integrity": "sha512-AfDTQmClklHCOLxtGoP7HkeMw56k1/bTQjwsfhL6pppo/M4TOBSq+jjBUBLmV/4oeFg4GWMavIl44ZeCtmmZTw==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.25.9.tgz", + "integrity": "sha512-o97AE4syN71M/lxrCtQByzphAdlYluKPDBzDVzMmfCobUjjhAryZV0AIpRPrxN0eAkxXO6ZLEScmt+PNhj2OTw==", + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1532,11 +1600,12 @@ } }, "node_modules/@babel/plugin-transform-typeof-symbol": { - "version": "7.24.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.24.8.tgz", - "integrity": "sha512-adNTUpDCVnmAE58VEqKlAA6ZBlNkMnWD0ZcW76lyNFN3MJniyGFZfNwERVk8Ap56MCnXztmDr19T4mPTztcuaw==", + "version": "7.26.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.26.7.tgz", + "integrity": "sha512-jfoTXXZTgGg36BmhqT3cAYK5qkmqvJpvNrPhaK/52Vgjhw4Rq29s9UqpWWV0D6yuRmgiFH/BUVlkl96zJWqnaw==", + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.8" + "@babel/helper-plugin-utils": "^7.26.5" }, "engines": { "node": ">=6.9.0" @@ -1546,11 +1615,12 @@ } }, "node_modules/@babel/plugin-transform-unicode-escapes": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.24.7.tgz", - "integrity": "sha512-U3ap1gm5+4edc2Q/P+9VrBNhGkfnf+8ZqppY71Bo/pzZmXhhLdqgaUl6cuB07O1+AQJtCLfaOmswiNbSQ9ivhw==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.25.9.tgz", + "integrity": "sha512-s5EDrE6bW97LtxOcGj1Khcx5AaXwiMmi4toFWRDP9/y0Woo6pXC+iyPu/KuhKtfSrNFd7jJB+/fkOtZy6aIC6Q==", + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1560,12 +1630,13 @@ } }, "node_modules/@babel/plugin-transform-unicode-property-regex": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.24.7.tgz", - "integrity": "sha512-uH2O4OV5M9FZYQrwc7NdVmMxQJOCCzFeYudlZSzUAHRFeOujQefa92E74TQDVskNHCzOXoigEuoyzHDhaEaK5w==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.25.9.tgz", + "integrity": "sha512-Jt2d8Ga+QwRluxRQ307Vlxa6dMrYEMZCgGxoPR8V52rxPyldHu3hdlHspxaqYmE7oID5+kB+UKUB/eWS+DkkWg==", + "license": "MIT", "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-create-regexp-features-plugin": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1575,12 +1646,13 @@ } }, "node_modules/@babel/plugin-transform-unicode-regex": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.24.7.tgz", - "integrity": "sha512-hlQ96MBZSAXUq7ltkjtu3FJCCSMx/j629ns3hA3pXnBXjanNP0LHi+JpPeA81zaWgVK1VGH95Xuy7u0RyQ8kMg==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.25.9.tgz", + "integrity": "sha512-yoxstj7Rg9dlNn9UQxzk4fcNivwv4nUYz7fYXBaKxvw/lnmPuOm/ikoELygbYq68Bls3D/D+NBPHiLwZdZZ4HA==", + "license": "MIT", "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-create-regexp-features-plugin": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1590,12 +1662,13 @@ } }, "node_modules/@babel/plugin-transform-unicode-sets-regex": { - "version": "7.25.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.25.4.tgz", - "integrity": "sha512-qesBxiWkgN1Q+31xUE9RcMk79eOXXDCv6tfyGMRSs4RGlioSg2WVyQAm07k726cSE56pa+Kb0y9epX2qaXzTvA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.25.9.tgz", + "integrity": "sha512-8BYqO3GeVNHtx69fdPshN3fnzUNLrWdHhk/icSwigksJGczKSizZ+Z6SBCxTs723Fr5VSNorTIK7a+R2tISvwQ==", + "license": "MIT", "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.25.2", - "@babel/helper-plugin-utils": "^7.24.8" + "@babel/helper-create-regexp-features-plugin": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1609,6 +1682,7 @@ "resolved": "https://registry.npmjs.org/@babel/polyfill/-/polyfill-7.2.5.tgz", "integrity": "sha512-8Y/t3MWThtMLYr0YNC/Q76tqN1w30+b0uQMeFUYauG2UGTR19zyUtFrAzT23zNtBxPp+LbE5E/nwV/q/r3y6ug==", "deprecated": "🚨 This package has been deprecated in favor of separate inclusion of a polyfill and regenerator-runtime (when needed). See the @babel/polyfill docs (https://babeljs.io/docs/en/babel-polyfill) for more information.", + "license": "MIT", "dependencies": { "core-js": "^2.5.7", "regenerator-runtime": "^0.12.0" @@ -1617,12 +1691,14 @@ "node_modules/@babel/polyfill/node_modules/regenerator-runtime": { "version": "0.12.1", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz", - "integrity": "sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg==" + "integrity": "sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg==", + "license": "MIT" }, "node_modules/@babel/preset-env": { "version": "7.23.8", "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.23.8.tgz", "integrity": "sha512-lFlpmkApLkEP6woIKprO6DO60RImpatTQKtz4sUcDjVcK8M8mQ4sZsuxaTMNOZf0sqAq/ReYW1ZBHnOQwKpLWA==", + "license": "MIT", "dependencies": { "@babel/compat-data": "^7.23.5", "@babel/helper-compilation-targets": "^7.23.6", @@ -1716,6 +1792,7 @@ "version": "7.12.1", "resolved": "https://registry.npmjs.org/@babel/preset-flow/-/preset-flow-7.12.1.tgz", "integrity": "sha512-UAoyMdioAhM6H99qPoKvpHMzxmNVXno8GYU/7vZmGaHk6/KqfDYL1W0NxszVbJ2EP271b7e6Ox+Vk2A9QsB3Sw==", + "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.10.4", "@babel/plugin-transform-flow-strip-types": "^7.12.1" @@ -1728,6 +1805,7 @@ "version": "0.1.6-no-external-plugins", "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.6-no-external-plugins.tgz", "integrity": "sha512-HrcgcIESLm9aIR842yhJ5RWan/gebQUJ6E/E5+rf0y9o6oj7w0Br+sWuL6kEQ/o/AdfvR1Je9jG18/gnpwjEyA==", + "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", "@babel/types": "^7.4.4", @@ -1741,6 +1819,7 @@ "version": "7.23.7", "resolved": "https://registry.npmjs.org/@babel/register/-/register-7.23.7.tgz", "integrity": "sha512-EjJeB6+kvpk+Y5DAkEAmbOBEFkh9OASx0huoEkqYTFxAZHzOAX2Oh5uwAUuL2rUddqfM0SA+KPXV2TbzoZ2kvQ==", + "license": "MIT", "dependencies": { "clone-deep": "^4.0.1", "find-cache-dir": "^2.0.0", @@ -1755,15 +1834,11 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/regjsgen": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/@babel/regjsgen/-/regjsgen-0.8.0.tgz", - "integrity": "sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA==" - }, "node_modules/@babel/runtime": { "version": "7.23.8", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.8.tgz", "integrity": "sha512-Y7KbAP984rn1VGMbGqKmBLio9V7y5Je9GvU4rQPCPinCyNfUcToxIXl06d59URp/F3LwinvODxab5N/G6qggkw==", + "license": "MIT", "dependencies": { "regenerator-runtime": "^0.14.0" }, @@ -1772,28 +1847,30 @@ } }, "node_modules/@babel/template": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.0.tgz", - "integrity": "sha512-aOOgh1/5XzKvg1jvVz7AVrx2piJ2XBi227DHmbY6y+bM9H2FlN+IfecYu4Xl0cNiiVejlsCri89LUsbj8vJD9Q==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.9.tgz", + "integrity": "sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg==", + "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.24.7", - "@babel/parser": "^7.25.0", - "@babel/types": "^7.25.0" + "@babel/code-frame": "^7.25.9", + "@babel/parser": "^7.25.9", + "@babel/types": "^7.25.9" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.25.4", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.4.tgz", - "integrity": "sha512-VJ4XsrD+nOvlXyLzmLzUs/0qjFS4sK30te5yEFlvbbUNEgKaVb2BHZUpAL+ttLPQAHNrsI3zZisbfha5Cvr8vg==", - "dependencies": { - "@babel/code-frame": "^7.24.7", - "@babel/generator": "^7.25.4", - "@babel/parser": "^7.25.4", - "@babel/template": "^7.25.0", - "@babel/types": "^7.25.4", + "version": "7.26.7", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.26.7.tgz", + "integrity": "sha512-1x1sgeyRLC3r5fQOM0/xtQKsYjyxmFjaOrLJNtZ81inNjyJHGIolTULPiSc/2qe1/qfpFLisLQYFnnZl7QoedA==", + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.26.2", + "@babel/generator": "^7.26.5", + "@babel/parser": "^7.26.7", + "@babel/template": "^7.25.9", + "@babel/types": "^7.26.7", "debug": "^4.3.1", "globals": "^11.1.0" }, @@ -1802,13 +1879,13 @@ } }, "node_modules/@babel/types": { - "version": "7.25.4", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.4.tgz", - "integrity": "sha512-zQ1ijeeCXVEh+aNL0RlmkPkG8HUiDcU2pzQQFjtbntgAczRASFzj4H+6+bV+dy1ntKR14I/DypeuRG1uma98iQ==", + "version": "7.26.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.7.tgz", + "integrity": "sha512-t8kDRGrKXyp6+tjUh7hw2RLyclsW4TRoRvRHtSyAX9Bb5ldlFh+90YAYY6awRXrlB4G5G2izNeGySpATlFzmOg==", + "license": "MIT", "dependencies": { - "@babel/helper-string-parser": "^7.24.8", - "@babel/helper-validator-identifier": "^7.24.7", - "to-fast-properties": "^2.0.0" + "@babel/helper-string-parser": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -1819,6 +1896,7 @@ "resolved": "https://registry.npmjs.org/@chelonia/cli/-/cli-2.2.3.tgz", "integrity": "sha512-pu6BQlMWSnqfsewVWhPHUHpkSRqyWQkZsRyKoGZYxchRsycWPNWwi/TAfhH+aMP7uTs10lvZubabF9MK+6bKKQ==", "hasInstallScript": true, + "license": "AGPL-3.0", "dependencies": { "axios": "0.27.2", "rimraf": "3.0.2", @@ -1833,16 +1911,18 @@ "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", "dev": true, + "license": "MIT", "optional": true, "engines": { "node": ">=0.1.90" } }, "node_modules/@cypress/request": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@cypress/request/-/request-3.0.1.tgz", - "integrity": "sha512-TWivJlJi8ZDx2wGOw1dbLuHJKUYX7bWySw377nlnGOW3hP9/MUKIsEdXT/YngWxVdgNCHRBmFlBipE+5/2ZZlQ==", + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@cypress/request/-/request-3.0.7.tgz", + "integrity": "sha512-LzxlLEMbBOPYB85uXrDqvD4MgcenjRBLIns3zyhx7vTPj/0u2eQhzXvPiGcaJrV38Q9dbkExWp6cOHPJ+EtFYg==", "dev": true, + "license": "Apache-2.0", "dependencies": { "aws-sign2": "~0.7.0", "aws4": "^1.8.0", @@ -1850,16 +1930,16 @@ "combined-stream": "~1.0.6", "extend": "~3.0.2", "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "http-signature": "~1.3.6", + "form-data": "~4.0.0", + "http-signature": "~1.4.0", "is-typedarray": "~1.0.0", "isstream": "~0.1.2", "json-stringify-safe": "~5.0.1", "mime-types": "~2.1.19", "performance-now": "^2.1.0", - "qs": "6.10.4", + "qs": "6.13.1", "safe-buffer": "^5.1.2", - "tough-cookie": "^4.1.3", + "tough-cookie": "^5.0.0", "tunnel-agent": "^0.6.0", "uuid": "^8.3.2" }, @@ -1867,27 +1947,14 @@ "node": ">= 6" } }, - "node_modules/@cypress/request/node_modules/form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "dev": true, - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 0.12" - } - }, "node_modules/@cypress/request/node_modules/qs": { - "version": "6.10.4", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.4.tgz", - "integrity": "sha512-OQiU+C+Ds5qiH91qh/mg0w+8nwQuLjM4F4M/PbmhDOoYehPh+Fb0bDjtR1sOvy7YKxvj28Y/M0PhP5uVX0kB+g==", + "version": "6.13.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.1.tgz", + "integrity": "sha512-EJPeIn0CYrGu+hli1xilKAPXODtJ12T0sP63Ijx2/khC2JtuaN3JyNIpvmnkmaEtha9ocbG4A4cMcr+TvqvwQg==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { - "side-channel": "^1.0.4" + "side-channel": "^1.0.6" }, "engines": { "node": ">=0.6" @@ -1901,6 +1968,7 @@ "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", "dev": true, + "license": "MIT", "bin": { "uuid": "dist/bin/uuid" } @@ -1910,6 +1978,7 @@ "resolved": "https://registry.npmjs.org/@cypress/xvfb/-/xvfb-1.2.4.tgz", "integrity": "sha512-skbBzPggOVYCbnGgV+0dmBdW/s77ZkAOXIC1knS8NagwDjBrNC1LuXtQJeiN6l+m7lzmHtaoUw/ctJKdqkG57Q==", "dev": true, + "license": "MIT", "dependencies": { "debug": "^3.1.0", "lodash.once": "^4.1.1" @@ -1920,6 +1989,7 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, + "license": "MIT", "dependencies": { "ms": "^2.1.1" } @@ -1928,6 +1998,7 @@ "version": "0.4.3", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", "integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==", + "license": "MIT", "dependencies": { "ajv": "^6.12.4", "debug": "^4.1.1", @@ -1947,6 +2018,7 @@ "version": "13.24.0", "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "license": "MIT", "dependencies": { "type-fest": "^0.20.2" }, @@ -1961,6 +2033,7 @@ "version": "0.20.2", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=10" }, @@ -1972,6 +2045,8 @@ "version": "1.0.12", "resolved": "https://registry.npmjs.org/@exact-realty/multipart-parser/-/multipart-parser-1.0.12.tgz", "integrity": "sha512-HTIbhEQg+llTPpVsoUJzAkv8ClZwMJAGv03FY/6kL7nTcQuJ6vOiylQt5J761MrXrxLYshQy9bQMBLSuD2hDtQ==", + "deprecated": "Package has moved to @apeleghq/multipart-parser", + "license": "ISC", "engines": { "node": ">=16.0.0", "npm": ">=8.0.0" @@ -1981,12 +2056,14 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz", "integrity": "sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==", + "license": "MIT", "optional": true }, "node_modules/@hapi/accept": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/@hapi/accept/-/accept-5.0.2.tgz", "integrity": "sha512-CmzBx/bXUR8451fnZRuZAJRlzgm0Jgu5dltTX/bszmR2lheb9BpyN47Q1RbaGTsvFzn0PXAEs+lXDKfshccYZw==", + "license": "BSD-3-Clause", "dependencies": { "@hapi/boom": "9.x.x", "@hapi/hoek": "9.x.x" @@ -1997,6 +2074,7 @@ "resolved": "https://registry.npmjs.org/@hapi/address/-/address-4.1.0.tgz", "integrity": "sha512-SkszZf13HVgGmChdHo/PxchnSaCJ6cetVqLzyciudzZRT0jcOouIF/Q93mgjw8cce+D+4F4C1Z/WrfFN+O3VHQ==", "deprecated": "Moved to 'npm install @sideway/address'", + "license": "BSD-3-Clause", "dependencies": { "@hapi/hoek": "^9.0.0" } @@ -2005,6 +2083,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/@hapi/ammo/-/ammo-5.0.1.tgz", "integrity": "sha512-FbCNwcTbnQP4VYYhLNGZmA76xb2aHg9AMPiy18NZyWMG310P5KdFGyA9v2rm5ujrIny77dEEIkMOwl0Xv+fSSA==", + "license": "BSD-3-Clause", "dependencies": { "@hapi/hoek": "9.x.x" } @@ -2013,6 +2092,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/@hapi/b64/-/b64-5.0.0.tgz", "integrity": "sha512-ngu0tSEmrezoiIaNGG6rRvKOUkUuDdf4XTPnONHGYfSGRmDqPZX5oJL6HAdKTo1UQHECbdB4OzhWrfgVppjHUw==", + "license": "BSD-3-Clause", "dependencies": { "@hapi/hoek": "9.x.x" } @@ -2021,6 +2101,7 @@ "version": "9.1.0", "resolved": "https://registry.npmjs.org/@hapi/boom/-/boom-9.1.0.tgz", "integrity": "sha512-4nZmpp4tXbm162LaZT45P7F7sgiem8dwAh2vHWT6XX24dozNjGMg6BvKCRvtCUcmcXqeMIUqWN8Rc5X8yKuROQ==", + "license": "BSD-3-Clause", "dependencies": { "@hapi/hoek": "9.x.x" } @@ -2029,6 +2110,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/@hapi/bounce/-/bounce-2.0.0.tgz", "integrity": "sha512-JesW92uyzOOyuzJKjoLHM1ThiOvHPOLDHw01YV8yh5nCso7sDwJho1h0Ad2N+E62bZyz46TG3xhAi/78Gsct6A==", + "license": "BSD-3-Clause", "dependencies": { "@hapi/boom": "9.x.x", "@hapi/hoek": "9.x.x" @@ -2037,12 +2119,14 @@ "node_modules/@hapi/bourne": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/@hapi/bourne/-/bourne-2.1.0.tgz", - "integrity": "sha512-i1BpaNDVLJdRBEKeJWkVO6tYX6DMFBuwMhSuWqLsY4ufeTKGVuV5rBsUhxPayXqnnWHgXUAmWK16H/ykO5Wj4Q==" + "integrity": "sha512-i1BpaNDVLJdRBEKeJWkVO6tYX6DMFBuwMhSuWqLsY4ufeTKGVuV5rBsUhxPayXqnnWHgXUAmWK16H/ykO5Wj4Q==", + "license": "BSD-3-Clause" }, "node_modules/@hapi/call": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/@hapi/call/-/call-8.0.1.tgz", "integrity": "sha512-bOff6GTdOnoe5b8oXRV3lwkQSb/LAWylvDMae6RgEWWntd0SHtkYbQukDHKlfaYtVnSAgIavJ0kqszF/AIBb6g==", + "license": "BSD-3-Clause", "dependencies": { "@hapi/boom": "9.x.x", "@hapi/hoek": "9.x.x" @@ -2052,6 +2136,7 @@ "version": "11.1.1", "resolved": "https://registry.npmjs.org/@hapi/catbox/-/catbox-11.1.1.tgz", "integrity": "sha512-u/8HvB7dD/6X8hsZIpskSDo4yMKpHxFd7NluoylhGrL6cUfYxdQPnvUp9YU2C6F9hsyBVLGulBd9vBN1ebfXOQ==", + "license": "BSD-3-Clause", "dependencies": { "@hapi/boom": "9.x.x", "@hapi/hoek": "9.x.x", @@ -2063,6 +2148,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/@hapi/catbox-memory/-/catbox-memory-5.0.1.tgz", "integrity": "sha512-QWw9nOYJq5PlvChLWV8i6hQHJYfvdqiXdvTupJFh0eqLZ64Xir7mKNi96d5/ZMUAqXPursfNDIDxjFgoEDUqeQ==", + "license": "BSD-3-Clause", "dependencies": { "@hapi/boom": "9.x.x", "@hapi/hoek": "9.x.x" @@ -2072,6 +2158,7 @@ "version": "5.0.2", "resolved": "https://registry.npmjs.org/@hapi/content/-/content-5.0.2.tgz", "integrity": "sha512-mre4dl1ygd4ZyOH3tiYBrOUBzV7Pu/EOs8VLGf58vtOEECWed8Uuw6B4iR9AN/8uQt42tB04qpVaMyoMQh0oMw==", + "license": "BSD-3-Clause", "dependencies": { "@hapi/boom": "9.x.x" } @@ -2080,6 +2167,7 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/@hapi/cryptiles/-/cryptiles-5.1.0.tgz", "integrity": "sha512-fo9+d1Ba5/FIoMySfMqPBR/7Pa29J2RsiPrl7bkwo5W5o+AN1dAYQRi4SPrPwwVxVGKjgLOEWrsvt1BonJSfLA==", + "license": "BSD-3-Clause", "dependencies": { "@hapi/boom": "9.x.x" }, @@ -2090,18 +2178,21 @@ "node_modules/@hapi/file": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@hapi/file/-/file-2.0.0.tgz", - "integrity": "sha512-WSrlgpvEqgPWkI18kkGELEZfXr0bYLtr16iIN4Krh9sRnzBZN6nnWxHFxtsnP684wueEySBbXPDg/WfA9xJdBQ==" + "integrity": "sha512-WSrlgpvEqgPWkI18kkGELEZfXr0bYLtr16iIN4Krh9sRnzBZN6nnWxHFxtsnP684wueEySBbXPDg/WfA9xJdBQ==", + "license": "BSD-3-Clause" }, "node_modules/@hapi/formula": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@hapi/formula/-/formula-2.0.0.tgz", "integrity": "sha512-V87P8fv7PI0LH7LiVi8Lkf3x+KCO7pQozXRssAHNXXL9L1K+uyu4XypLXwxqVDKgyQai6qj3/KteNlrqDx4W5A==", - "deprecated": "Moved to 'npm install @sideway/formula'" + "deprecated": "Moved to 'npm install @sideway/formula'", + "license": "BSD-3-Clause" }, "node_modules/@hapi/hapi": { "version": "20.1.2", "resolved": "https://registry.npmjs.org/@hapi/hapi/-/hapi-20.1.2.tgz", "integrity": "sha512-yLppH93as7vw+uaAMVcHEB13eBojuzGhcX948y/CGukNRAlnPV+c1EJGbYPLXVffpH8wCNsI7TrTaeifSFS6Vw==", + "license": "BSD-3-Clause", "dependencies": { "@hapi/accept": "^5.0.1", "@hapi/ammo": "^5.0.1", @@ -2130,6 +2221,7 @@ "version": "7.0.1", "resolved": "https://registry.npmjs.org/@hapi/heavy/-/heavy-7.0.1.tgz", "integrity": "sha512-vJ/vzRQ13MtRzz6Qd4zRHWS3FaUc/5uivV2TIuExGTM9Qk+7Zzqj0e2G7EpE6KztO9SalTbiIkTh7qFKj/33cA==", + "license": "BSD-3-Clause", "dependencies": { "@hapi/boom": "9.x.x", "@hapi/hoek": "9.x.x", @@ -2139,12 +2231,14 @@ "node_modules/@hapi/hoek": { "version": "9.3.0", "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.3.0.tgz", - "integrity": "sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==" + "integrity": "sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==", + "license": "BSD-3-Clause" }, "node_modules/@hapi/inert": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/@hapi/inert/-/inert-6.0.3.tgz", "integrity": "sha512-Z6Pi0Wsn2pJex5CmBaq+Dky9q40LGzXLUIUFrYpDtReuMkmfy9UuUeYc4064jQ1Xe9uuw7kbwE6Fq6rqKAdjAg==", + "license": "BSD-3-Clause", "dependencies": { "@hapi/ammo": "5.x.x", "@hapi/boom": "9.x.x", @@ -2158,6 +2252,7 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "license": "ISC", "dependencies": { "yallist": "^4.0.0" }, @@ -2169,6 +2264,7 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/@hapi/iron/-/iron-6.0.0.tgz", "integrity": "sha512-zvGvWDufiTGpTJPG1Y/McN8UqWBu0k/xs/7l++HVU535NLHXsHhy54cfEMdW7EjwKfbBfM9Xy25FmTiobb7Hvw==", + "license": "BSD-3-Clause", "dependencies": { "@hapi/b64": "5.x.x", "@hapi/boom": "9.x.x", @@ -2182,6 +2278,7 @@ "resolved": "https://registry.npmjs.org/@hapi/joi/-/joi-17.1.1.tgz", "integrity": "sha512-p4DKeZAoeZW4g3u7ZeRo+vCDuSDgSvtsB/NpfjXEHTUjSeINAi/RrVOWiVQ1isaoLzMvFEhe8n5065mQq1AdQg==", "deprecated": "Switch to 'npm install joi'", + "license": "BSD-3-Clause", "dependencies": { "@hapi/address": "^4.0.1", "@hapi/formula": "^2.0.0", @@ -2194,6 +2291,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/@hapi/mimos/-/mimos-5.0.0.tgz", "integrity": "sha512-EVS6wJYeE73InTlPWt+2e3Izn319iIvffDreci3qDNT+t3lA5ylJ0/SoTaID8e0TPNUkHUSsgJZXEmLHvoYzrA==", + "license": "BSD-3-Clause", "dependencies": { "@hapi/hoek": "9.x.x", "mime-db": "1.x.x" @@ -2203,6 +2301,7 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/@hapi/nigel/-/nigel-4.0.2.tgz", "integrity": "sha512-ht2KoEsDW22BxQOEkLEJaqfpoKPXxi7tvabXy7B/77eFtOyG5ZEstfZwxHQcqAiZhp58Ae5vkhEqI03kawkYNw==", + "license": "BSD-3-Clause", "dependencies": { "@hapi/hoek": "^9.0.4", "@hapi/vise": "^4.0.0" @@ -2215,6 +2314,7 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/@hapi/pez/-/pez-5.1.0.tgz", "integrity": "sha512-YfB0btnkLB3lb6Ry/1KifnMPBm5ZPfaAHWFskzOMAgDgXgcBgA+zjpIynyEiBfWEz22DBT8o1e2tAaBdlt8zbw==", + "license": "BSD-3-Clause", "dependencies": { "@hapi/b64": "5.x.x", "@hapi/boom": "9.x.x", @@ -2226,12 +2326,14 @@ "node_modules/@hapi/pinpoint": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/@hapi/pinpoint/-/pinpoint-2.0.1.tgz", - "integrity": "sha512-EKQmr16tM8s16vTT3cA5L0kZZcTMU5DUOZTuvpnY738m+jyP3JIUj+Mm1xc1rsLkGBQ/gVnfKYPwOmPg1tUR4Q==" + "integrity": "sha512-EKQmr16tM8s16vTT3cA5L0kZZcTMU5DUOZTuvpnY738m+jyP3JIUj+Mm1xc1rsLkGBQ/gVnfKYPwOmPg1tUR4Q==", + "license": "BSD-3-Clause" }, "node_modules/@hapi/podium": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/@hapi/podium/-/podium-4.1.3.tgz", "integrity": "sha512-ljsKGQzLkFqnQxE7qeanvgGj4dejnciErYd30dbrYzUOF/FyS/DOF97qcrT3bhoVwCYmxa6PEMhxfCPlnUcD2g==", + "license": "BSD-3-Clause", "dependencies": { "@hapi/hoek": "9.x.x", "@hapi/teamwork": "5.x.x", @@ -2242,6 +2344,7 @@ "version": "5.0.5", "resolved": "https://registry.npmjs.org/@hapi/shot/-/shot-5.0.5.tgz", "integrity": "sha512-x5AMSZ5+j+Paa8KdfCoKh+klB78otxF+vcJR/IoN91Vo2e5ulXIW6HUsFTCU+4W6P/Etaip9nmdAx2zWDimB2A==", + "license": "BSD-3-Clause", "dependencies": { "@hapi/hoek": "9.x.x", "@hapi/validate": "1.x.x" @@ -2251,6 +2354,7 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/@hapi/somever/-/somever-3.0.1.tgz", "integrity": "sha512-4ZTSN3YAHtgpY/M4GOtHUXgi6uZtG9nEZfNI6QrArhK0XN/RDVgijlb9kOmXwCR5VclDSkBul9FBvhSuKXx9+w==", + "license": "BSD-3-Clause", "dependencies": { "@hapi/bounce": "2.x.x", "@hapi/hoek": "9.x.x" @@ -2260,6 +2364,7 @@ "version": "7.0.4", "resolved": "https://registry.npmjs.org/@hapi/statehood/-/statehood-7.0.4.tgz", "integrity": "sha512-Fia6atroOVmc5+2bNOxF6Zv9vpbNAjEXNcUbWXavDqhnJDlchwUUwKS5LCi5mGtCTxRhUKKHwuxuBZJkmLZ7fw==", + "license": "BSD-3-Clause", "dependencies": { "@hapi/boom": "9.x.x", "@hapi/bounce": "2.x.x", @@ -2274,6 +2379,7 @@ "version": "7.1.0", "resolved": "https://registry.npmjs.org/@hapi/subtext/-/subtext-7.1.0.tgz", "integrity": "sha512-n94cU6hlvsNRIpXaROzBNEJGwxC+HA69q769pChzej84On8vsU14guHDub7Pphr/pqn5b93zV3IkMPDU5AUiXA==", + "license": "BSD-3-Clause", "dependencies": { "@hapi/boom": "9.x.x", "@hapi/bourne": "2.x.x", @@ -2288,6 +2394,7 @@ "version": "5.1.1", "resolved": "https://registry.npmjs.org/@hapi/teamwork/-/teamwork-5.1.1.tgz", "integrity": "sha512-1oPx9AE5TIv+V6Ih54RP9lTZBso3rP8j4Xhb6iSVwPXtAM+sDopl5TFMv5Paw73UnpZJ9gjcrTE1BXrWt9eQrg==", + "license": "BSD-3-Clause", "engines": { "node": ">=12.0.0" } @@ -2296,6 +2403,7 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-5.1.0.tgz", "integrity": "sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==", + "license": "BSD-3-Clause", "dependencies": { "@hapi/hoek": "^9.0.0" } @@ -2304,6 +2412,7 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/@hapi/validate/-/validate-1.1.3.tgz", "integrity": "sha512-/XMR0N0wjw0Twzq2pQOzPBZlDzkekGcoCtzO314BpIEsbXdYGthQUbxgkGDf4nhk1+IPDAsXqWjMohRQYO06UA==", + "license": "BSD-3-Clause", "dependencies": { "@hapi/hoek": "^9.0.0", "@hapi/topo": "^5.0.0" @@ -2313,6 +2422,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/@hapi/vise/-/vise-4.0.0.tgz", "integrity": "sha512-eYyLkuUiFZTer59h+SGy7hUm+qE9p+UemePTHLlIWppEd+wExn3Df5jO04bFQTm7nleF5V8CtuYQYb+VFpZ6Sg==", + "license": "BSD-3-Clause", "dependencies": { "@hapi/hoek": "9.x.x" } @@ -2321,6 +2431,7 @@ "version": "17.2.0", "resolved": "https://registry.npmjs.org/@hapi/wreck/-/wreck-17.2.0.tgz", "integrity": "sha512-pJ5kjYoRPYDv+eIuiLQqhGon341fr2bNIYZjuotuPJG/3Ilzr/XtI+JAp0A86E2bYfsS3zBPABuS2ICkaXFT8g==", + "license": "BSD-3-Clause", "dependencies": { "@hapi/boom": "9.x.x", "@hapi/bourne": "2.x.x", @@ -2332,6 +2443,7 @@ "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", "deprecated": "Use @eslint/config-array instead", + "license": "Apache-2.0", "dependencies": { "@humanwhocodes/object-schema": "^1.2.0", "debug": "^4.1.1", @@ -2345,12 +2457,14 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", - "deprecated": "Use @eslint/object-schema instead" + "deprecated": "Use @eslint/object-schema instead", + "license": "BSD-3-Clause" }, "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", - "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz", + "integrity": "sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==", + "license": "MIT", "dependencies": { "@jridgewell/set-array": "^1.2.1", "@jridgewell/sourcemap-codec": "^1.4.10", @@ -2364,6 +2478,7 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "license": "MIT", "engines": { "node": ">=6.0.0" } @@ -2372,6 +2487,7 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "license": "MIT", "engines": { "node": ">=6.0.0" } @@ -2381,6 +2497,7 @@ "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz", "integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", @@ -2390,12 +2507,14 @@ "node_modules/@jridgewell/sourcemap-codec": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", - "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==" + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", + "license": "MIT" }, "node_modules/@jridgewell/trace-mapping": { "version": "0.3.25", "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "license": "MIT", "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" @@ -2406,6 +2525,7 @@ "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "dev": true, + "license": "MIT", "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" @@ -2419,6 +2539,7 @@ "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "dev": true, + "license": "MIT", "engines": { "node": ">= 8" } @@ -2428,6 +2549,7 @@ "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "dev": true, + "license": "MIT", "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" @@ -2440,6 +2562,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-1.1.1.tgz", "integrity": "sha512-8KG5RD0GVP4ydEzRn/I4BNDuxDtqVbOdm8675T49OIG/NGhaK0pjPX7ZcDlvKYbA+ulvVK3ztfcF4uBdOxuJbQ==", + "license": "ISC", "optional": true, "dependencies": { "@gar/promisify": "^1.0.1", @@ -2450,6 +2573,7 @@ "version": "7.6.3", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "license": "ISC", "optional": true, "bin": { "semver": "bin/semver.js" @@ -2463,6 +2587,7 @@ "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-1.1.2.tgz", "integrity": "sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg==", "deprecated": "This functionality has been moved to @npmcli/fs", + "license": "MIT", "optional": true, "dependencies": { "mkdirp": "^1.0.4", @@ -2472,65 +2597,395 @@ "node": ">=10" } }, - "node_modules/@sbp/okturtles.data": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/@sbp/okturtles.data/-/okturtles.data-0.1.5.tgz", - "integrity": "sha512-VmLukcI7wxdWguKmvH6u04A4UUeyNBaWihMqwnnh9pohtSHNU7CLrLRr3s7ODEZaUx+WLWBOYiRubzEAzGMguA==", - "peerDependencies": { - "@sbp/sbp": "2.x" - } - }, - "node_modules/@sbp/okturtles.eventqueue": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@sbp/okturtles.eventqueue/-/okturtles.eventqueue-1.2.0.tgz", - "integrity": "sha512-u+ErtLInzVXs3eUV9I7B2l7Jj0NxDBJD9erCGmIZmgNwJfkH3B8iLk6HMyA3nGe/PHgv6GbBBC1tKjNuazhXNg==", + "node_modules/@parcel/watcher": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.5.1.tgz", + "integrity": "sha512-dfUnCxiN9H4ap84DvD2ubjw+3vUNpstxa0TneY/Paat8a3R4uQZDLSvWjmznAY/DoahqTHl9V46HF/Zs3F29pg==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, "dependencies": { - "@sbp/okturtles.data": "^0.1.5" + "detect-libc": "^1.0.3", + "is-glob": "^4.0.3", + "micromatch": "^4.0.5", + "node-addon-api": "^7.0.0" }, - "peerDependencies": { - "@sbp/sbp": "2.x" - } - }, - "node_modules/@sbp/okturtles.events": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@sbp/okturtles.events/-/okturtles.events-1.0.0.tgz", - "integrity": "sha512-5Yv0xwgo79rGC84oDYCqvbY857SxqntfYVh4645HuAzQsbjuHdjaao2/0/zU/QptiVd7a9tgkzIDFEqFlsHdZw==", + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "@parcel/watcher-android-arm64": "2.5.1", + "@parcel/watcher-darwin-arm64": "2.5.1", + "@parcel/watcher-darwin-x64": "2.5.1", + "@parcel/watcher-freebsd-x64": "2.5.1", + "@parcel/watcher-linux-arm-glibc": "2.5.1", + "@parcel/watcher-linux-arm-musl": "2.5.1", + "@parcel/watcher-linux-arm64-glibc": "2.5.1", + "@parcel/watcher-linux-arm64-musl": "2.5.1", + "@parcel/watcher-linux-x64-glibc": "2.5.1", + "@parcel/watcher-linux-x64-musl": "2.5.1", + "@parcel/watcher-win32-arm64": "2.5.1", + "@parcel/watcher-win32-ia32": "2.5.1", + "@parcel/watcher-win32-x64": "2.5.1" + } + }, + "node_modules/@parcel/watcher-android-arm64": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.5.1.tgz", + "integrity": "sha512-KF8+j9nNbUN8vzOFDpRMsaKBHZ/mcjEjMToVMJOhTozkDonQFFrRcfdLWn6yWKCmJKmdVxSgHiYvTCef4/qcBA==", + "cpu": [ + "arm64" + ], + "dev": true, "license": "MIT", - "dependencies": { - "@sbp/okturtles.data": "^0.1.5" + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10.0.0" }, - "peerDependencies": { - "@sbp/sbp": "2.x" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, - "node_modules/@sbp/sbp": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@sbp/sbp/-/sbp-2.4.0.tgz", - "integrity": "sha512-hioFSzRuZl4q5bnFRZrpXFYH8zLkRWl3wOJFaZRKEm9etiX6FGcyiwyLjiawD/fpaHjKXCoi9oi4tAr8TZZ/sQ==" - }, - "node_modules/@sinonjs/commons": { - "version": "1.8.6", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.6.tgz", - "integrity": "sha512-Ky+XkAkqPZSm3NLBeUng77EBQl3cmeJhITaGHdYH8kjVB+aun3S4XBRti2zt17mtt0mIUDiNxYeoJm6drVvBJQ==", + "node_modules/@parcel/watcher-darwin-arm64": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-arm64/-/watcher-darwin-arm64-2.5.1.tgz", + "integrity": "sha512-eAzPv5osDmZyBhou8PoF4i6RQXAfeKL9tjb3QzYuccXFMQU0ruIc/POh30ePnaOyD1UXdlKguHBmsTs53tVoPw==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "type-detect": "4.0.8" + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, - "node_modules/@sinonjs/fake-timers": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-6.0.1.tgz", - "integrity": "sha512-MZPUxrmFubI36XS1DI3qmI0YdN1gks62JtFZvxR67ljjSNCeK6U08Zx4msEWOXuofgqUt6zPHSi1H9fbjR/NRA==", + "node_modules/@parcel/watcher-darwin-x64": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-x64/-/watcher-darwin-x64-2.5.1.tgz", + "integrity": "sha512-1ZXDthrnNmwv10A0/3AJNZ9JGlzrF82i3gNQcWOzd7nJ8aj+ILyW1MTxVk35Db0u91oD5Nlk9MBiujMlwmeXZg==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "@sinonjs/commons": "^1.7.0" + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, - "node_modules/@sinonjs/formatio": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-5.0.1.tgz", - "integrity": "sha512-KaiQ5pBf1MpS09MuA0kp6KBQt2JUOQycqVG1NZXvzeaXe5LGFqAKueIS0bw4w0P9r7KuBSVdUk5QjXsUdu2CxQ==", - "dev": true, + "node_modules/@parcel/watcher-freebsd-x64": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-freebsd-x64/-/watcher-freebsd-x64-2.5.1.tgz", + "integrity": "sha512-SI4eljM7Flp9yPuKi8W0ird8TI/JK6CSxju3NojVI6BjHsTyK7zxA9urjVjEKJ5MBYC+bLmMcbAWlZ+rFkLpJQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm-glibc": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-glibc/-/watcher-linux-arm-glibc-2.5.1.tgz", + "integrity": "sha512-RCdZlEyTs8geyBkkcnPWvtXLY44BCeZKmGYRtSgtwwnHR4dxfHRG3gR99XdMEdQ7KeiDdasJwwvNSF5jKtDwdA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm-musl": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-musl/-/watcher-linux-arm-musl-2.5.1.tgz", + "integrity": "sha512-6E+m/Mm1t1yhB8X412stiKFG3XykmgdIOqhjWj+VL8oHkKABfu/gjFj8DvLrYVHSBNC+/u5PeNrujiSQ1zwd1Q==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm64-glibc": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-glibc/-/watcher-linux-arm64-glibc-2.5.1.tgz", + "integrity": "sha512-LrGp+f02yU3BN9A+DGuY3v3bmnFUggAITBGriZHUREfNEzZh/GO06FF5u2kx8x+GBEUYfyTGamol4j3m9ANe8w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm64-musl": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-musl/-/watcher-linux-arm64-musl-2.5.1.tgz", + "integrity": "sha512-cFOjABi92pMYRXS7AcQv9/M1YuKRw8SZniCDw0ssQb/noPkRzA+HBDkwmyOJYp5wXcsTrhxO0zq1U11cK9jsFg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-x64-glibc": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-glibc/-/watcher-linux-x64-glibc-2.5.1.tgz", + "integrity": "sha512-GcESn8NZySmfwlTsIur+49yDqSny2IhPeZfXunQi48DMugKeZ7uy1FX83pO0X22sHntJ4Ub+9k34XQCX+oHt2A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-x64-musl": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-musl/-/watcher-linux-x64-musl-2.5.1.tgz", + "integrity": "sha512-n0E2EQbatQ3bXhcH2D1XIAANAcTZkQICBPVaxMeaCVBtOpBZpWJuf7LwyWPSBDITb7In8mqQgJ7gH8CILCURXg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-win32-arm64": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-arm64/-/watcher-win32-arm64-2.5.1.tgz", + "integrity": "sha512-RFzklRvmc3PkjKjry3hLF9wD7ppR4AKcWNzH7kXR7GUe0Igb3Nz8fyPwtZCSquGrhU5HhUNDr/mKBqj7tqA2Vw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-win32-ia32": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-ia32/-/watcher-win32-ia32-2.5.1.tgz", + "integrity": "sha512-c2KkcVN+NJmuA7CGlaGD1qJh1cLfDnQsHjE89E60vUEMlqduHGCdCLJCID5geFVM0dOtA3ZiIO8BoEQmzQVfpQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-win32-x64": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-x64/-/watcher-win32-x64-2.5.1.tgz", + "integrity": "sha512-9lHBdJITeNR++EvSQVUcaZoWupyHfXe1jZvGZ06O/5MflPcuPLtEphScIBL+AiCWBO46tDSHzWyD0uDmmZqsgA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher/node_modules/detect-libc": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", + "integrity": "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==", + "dev": true, + "license": "Apache-2.0", + "optional": true, + "bin": { + "detect-libc": "bin/detect-libc.js" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/@sbp/okturtles.data": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/@sbp/okturtles.data/-/okturtles.data-0.1.5.tgz", + "integrity": "sha512-VmLukcI7wxdWguKmvH6u04A4UUeyNBaWihMqwnnh9pohtSHNU7CLrLRr3s7ODEZaUx+WLWBOYiRubzEAzGMguA==", + "license": "MIT", + "peerDependencies": { + "@sbp/sbp": "2.x" + } + }, + "node_modules/@sbp/okturtles.eventqueue": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@sbp/okturtles.eventqueue/-/okturtles.eventqueue-1.2.0.tgz", + "integrity": "sha512-u+ErtLInzVXs3eUV9I7B2l7Jj0NxDBJD9erCGmIZmgNwJfkH3B8iLk6HMyA3nGe/PHgv6GbBBC1tKjNuazhXNg==", + "license": "MIT", + "dependencies": { + "@sbp/okturtles.data": "^0.1.5" + }, + "peerDependencies": { + "@sbp/sbp": "2.x" + } + }, + "node_modules/@sbp/okturtles.events": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@sbp/okturtles.events/-/okturtles.events-1.0.0.tgz", + "integrity": "sha512-5Yv0xwgo79rGC84oDYCqvbY857SxqntfYVh4645HuAzQsbjuHdjaao2/0/zU/QptiVd7a9tgkzIDFEqFlsHdZw==", + "license": "MIT", + "dependencies": { + "@sbp/okturtles.data": "^0.1.5" + }, + "peerDependencies": { + "@sbp/sbp": "2.x" + } + }, + "node_modules/@sbp/sbp": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@sbp/sbp/-/sbp-2.4.0.tgz", + "integrity": "sha512-hioFSzRuZl4q5bnFRZrpXFYH8zLkRWl3wOJFaZRKEm9etiX6FGcyiwyLjiawD/fpaHjKXCoi9oi4tAr8TZZ/sQ==", + "license": "MIT" + }, + "node_modules/@sinonjs/commons": { + "version": "1.8.6", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.6.tgz", + "integrity": "sha512-Ky+XkAkqPZSm3NLBeUng77EBQl3cmeJhITaGHdYH8kjVB+aun3S4XBRti2zt17mtt0mIUDiNxYeoJm6drVvBJQ==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "type-detect": "4.0.8" + } + }, + "node_modules/@sinonjs/fake-timers": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-6.0.1.tgz", + "integrity": "sha512-MZPUxrmFubI36XS1DI3qmI0YdN1gks62JtFZvxR67ljjSNCeK6U08Zx4msEWOXuofgqUt6zPHSi1H9fbjR/NRA==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@sinonjs/commons": "^1.7.0" + } + }, + "node_modules/@sinonjs/formatio": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-5.0.1.tgz", + "integrity": "sha512-KaiQ5pBf1MpS09MuA0kp6KBQt2JUOQycqVG1NZXvzeaXe5LGFqAKueIS0bw4w0P9r7KuBSVdUk5QjXsUdu2CxQ==", + "dev": true, + "license": "BSD-3-Clause", "dependencies": { "@sinonjs/commons": "^1", "@sinonjs/samsam": "^5.0.2" @@ -2541,6 +2996,7 @@ "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-5.3.1.tgz", "integrity": "sha512-1Hc0b1TtyfBu8ixF/tpfSHTVWKwCBLY4QJbkgnE7HcwyvT2xArDxb4K7dMgqRm3szI+LJbzmW/s4xxEhv6hwDg==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "@sinonjs/commons": "^1.6.0", "lodash.get": "^4.4.2", @@ -2551,13 +3007,15 @@ "version": "0.7.3", "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.3.tgz", "integrity": "sha512-DE427ROAphMQzU4ENbliGYrBSYPXF+TtLg9S8vzeA+OF4ZKzoDdzfL8sxuMUGS/lgRhM6j1URSk9ghf7Xo1tyA==", - "dev": true + "dev": true, + "license": "(Unlicense OR Apache-2.0)" }, "node_modules/@socket.io/component-emitter": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.2.tgz", "integrity": "sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@stylelint/postcss-css-in-js": { "version": "0.37.3", @@ -2565,6 +3023,7 @@ "integrity": "sha512-scLk3cSH1H9KggSniseb2KNAU5D9FWc3H7BxCSAIdtU9OWIyw0zkEZ9qEKHryRM+SExYXRKNb7tOOVNAsQ3iwg==", "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", "dev": true, + "license": "MIT", "dependencies": { "@babel/core": "^7.17.9" }, @@ -2579,6 +3038,7 @@ "integrity": "sha512-2kGbqUVJUGE8dM+bMzXG/PYUWKkjLIkRLWNh39OaADkiabDRdw8ATFCgbMz5xdIcvwspPAluSL7uY+ZiTWdWmQ==", "deprecated": "Use the original unforked package instead: postcss-markdown", "dev": true, + "license": "MIT", "dependencies": { "remark": "^13.0.0", "unist-util-find-all-after": "^3.0.2" @@ -2592,65 +3052,91 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", + "license": "MIT", "optional": true, "engines": { "node": ">= 6" } }, "node_modules/@types/babel-types": { - "version": "7.0.15", - "resolved": "https://registry.npmjs.org/@types/babel-types/-/babel-types-7.0.15.tgz", - "integrity": "sha512-JUgfZHUOMbtjopxiOQaaF+Uovk5wpDqpXR+XLWiOivCWSy1FccO30lvNNpCt8geFwq8VmGT2y9OMkOpA0g5O5g==", - "dev": true + "version": "7.0.16", + "resolved": "https://registry.npmjs.org/@types/babel-types/-/babel-types-7.0.16.tgz", + "integrity": "sha512-5QXs9GBFTNTmilLlWBhnsprqpjfrotyrnzUdwDrywEL/DA4LuCWQT300BTOXA3Y9ngT9F2uvmCoIxI6z8DlJEA==", + "dev": true, + "license": "MIT" }, "node_modules/@types/babylon": { "version": "6.16.9", "resolved": "https://registry.npmjs.org/@types/babylon/-/babylon-6.16.9.tgz", "integrity": "sha512-sEKyxMVEowhcr8WLfN0jJYe4gS4Z9KC2DGz0vqfC7+MXFbmvOF7jSjALC77thvAO2TLgFUPa9vDeOak+AcUrZA==", "dev": true, + "license": "MIT", "dependencies": { "@types/babel-types": "*" } }, - "node_modules/@types/cookie": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.4.1.tgz", - "integrity": "sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==", - "dev": true - }, "node_modules/@types/cors": { "version": "2.8.17", "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.17.tgz", "integrity": "sha512-8CGDvrBj1zgo2qE+oS3pOCyYNqCPryMWY2bGfwA0dcfopWGgxs+78df0Rs3rc9THP4JkOhLsAa+15VdpAqkcUA==", "dev": true, + "license": "MIT", "dependencies": { "@types/node": "*" } }, + "node_modules/@types/eslint": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-9.6.1.tgz", + "integrity": "sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@types/estree": "*", + "@types/json-schema": "*" + } + }, + "node_modules/@types/eslint-scope": { + "version": "3.7.7", + "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.7.tgz", + "integrity": "sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@types/eslint": "*", + "@types/estree": "*" + } + }, "node_modules/@types/estree": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", - "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", "dev": true, + "license": "MIT", "peer": true }, "node_modules/@types/json-schema": { "version": "7.0.15", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/mdast": { "version": "3.0.15", "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.15.tgz", "integrity": "sha512-LnwD+mUEfxWMa1QpDraczIn6k0Ee3SMicuYSSzS6ZYl2gKS09EClnJYGd8Du6rfc5r/GZEk5o1mRb8TaTj03sQ==", "dev": true, + "license": "MIT", "dependencies": { "@types/unist": "^2" } @@ -2658,55 +3144,67 @@ "node_modules/@types/minimatch": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz", - "integrity": "sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==" + "integrity": "sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==", + "license": "MIT" }, "node_modules/@types/minimist": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.5.tgz", "integrity": "sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/node": { - "version": "14.18.63", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.63.tgz", - "integrity": "sha512-fAtCfv4jJg+ExtXhvCkCqUKZ+4ok/JQk01qDKhL5BDDoS3AxKXhV5/MAVUZyQnSEd2GT92fkgZl0pz0Q0AzcIQ==", - "dev": true + "version": "22.10.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.10.tgz", + "integrity": "sha512-X47y/mPNzxviAGY5TcYPtYL8JsY3kAq2n8fMmKoRCxq/c4v4pyGNCzM2R6+M5/umG4ZfHuT+sgqDYqWc9rJ6ww==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.20.0" + } }, "node_modules/@types/normalize-package-data": { "version": "2.4.4", "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz", "integrity": "sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/parse-json": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.2.tgz", "integrity": "sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/sinonjs__fake-timers": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.1.tgz", "integrity": "sha512-0kSuKjAS0TrGLJ0M/+8MaFkGsQhZpB6pxOmvS3K8FYI72K//YmdfoW9X2qPsAKh1mkwxGD5zib9s1FIFed6E8g==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/sizzle": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.8.tgz", - "integrity": "sha512-0vWLNK2D5MT9dg0iOo8GlKguPAU02QjmZitPEsXRuJXU/OGIOt9vT9Fc26wtYuavLxtO45v9PGleoL9Z0k1LHg==", - "dev": true + "version": "2.3.9", + "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.9.tgz", + "integrity": "sha512-xzLEyKB50yqCUPUJkIsrVvoWNfFUbIZI+RspLWt8u+tIW/BetMBZtgV2LY/2o+tYH8dRvQ+eoPf3NdhQCcLE2w==", + "dev": true, + "license": "MIT" }, "node_modules/@types/unist": { "version": "2.0.11", "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.11.tgz", "integrity": "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/yauzl": { "version": "2.10.3", "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.3.tgz", "integrity": "sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==", "dev": true, + "license": "MIT", "optional": true, "dependencies": { "@types/node": "*" @@ -2716,13 +3214,15 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/@vue/component-compiler": { "version": "4.2.4", "resolved": "https://registry.npmjs.org/@vue/component-compiler/-/component-compiler-4.2.4.tgz", "integrity": "sha512-tFGw3h3+nxiqnyborwWQ+rUgKAwSFl0Sdg+BCZkWTyFfkEF5fqunTNoklEUDdtRQMmVqsajn1pOZdm0zh4Uicw==", "dev": true, + "license": "MIT", "dependencies": { "@vue/component-compiler-utils": "^3.0.0", "clean-css": "^4.1.11", @@ -2746,6 +3246,7 @@ "resolved": "https://registry.npmjs.org/@vue/component-compiler-utils/-/component-compiler-utils-3.3.0.tgz", "integrity": "sha512-97sfH2mYNU+2PzGrmK2haqffDpVASuib9/w2/noxiFi31Z54hW+q3izKQXXQZSNhtiUpAI36uSuYepeBe4wpHQ==", "dev": true, + "license": "MIT", "dependencies": { "consolidate": "^0.15.1", "hash-sum": "^1.0.2", @@ -2765,6 +3266,7 @@ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", "dev": true, + "license": "ISC", "dependencies": { "pseudomap": "^1.0.2", "yallist": "^2.1.2" @@ -2774,13 +3276,15 @@ "version": "0.2.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-0.2.1.tgz", "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/@vue/component-compiler-utils/node_modules/postcss": { "version": "7.0.39", "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.39.tgz", "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", "dev": true, + "license": "MIT", "dependencies": { "picocolors": "^0.2.1", "source-map": "^0.6.1" @@ -2797,166 +3301,182 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", "integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/@webassemblyjs/ast": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.12.1.tgz", - "integrity": "sha512-EKfMUOPRRUTy5UII4qJDGPpqfwjOmZ5jeGFwid9mnoqIFK+e0vqoi1qH56JpmZSzEL53jKnNzScdmftJyG5xWg==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.14.1.tgz", + "integrity": "sha512-nuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+PLwr6X1Nhw6OLme5usuBWYBvuQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "@webassemblyjs/helper-numbers": "1.11.6", - "@webassemblyjs/helper-wasm-bytecode": "1.11.6" + "@webassemblyjs/helper-numbers": "1.13.2", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2" } }, "node_modules/@webassemblyjs/floating-point-hex-parser": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.6.tgz", - "integrity": "sha512-ejAj9hfRJ2XMsNHk/v6Fu2dGS+i4UaXBXGemOfQ/JfQ6mdQg/WXtwleQRLLS4OvfDhv8rYnVwH27YJLMyYsxhw==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.13.2.tgz", + "integrity": "sha512-6oXyTOzbKxGH4steLbLNOu71Oj+C8Lg34n6CqRvqfS2O71BxY6ByfMDRhBytzknj9yGUPVJ1qIKhRlAwO1AovA==", "dev": true, + "license": "MIT", "peer": true }, "node_modules/@webassemblyjs/helper-api-error": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.6.tgz", - "integrity": "sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2Txg//Q==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.13.2.tgz", + "integrity": "sha512-U56GMYxy4ZQCbDZd6JuvvNV/WFildOjsaWD3Tzzvmw/mas3cXzRJPMjP83JqEsgSbyrmaGjBfDtV7KDXV9UzFQ==", "dev": true, + "license": "MIT", "peer": true }, "node_modules/@webassemblyjs/helper-buffer": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.12.1.tgz", - "integrity": "sha512-nzJwQw99DNDKr9BVCOZcLuJJUlqkJh+kVzVl6Fmq/tI5ZtEyWT1KZMyOXltXLZJmDtvLCDgwsyrkohEtopTXCw==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.14.1.tgz", + "integrity": "sha512-jyH7wtcHiKssDtFPRB+iQdxlDf96m0E39yb0k5uJVhFGleZFoNw1c4aeIcVUPPbXUVJ94wwnMOAqUHyzoEPVMA==", "dev": true, + "license": "MIT", "peer": true }, "node_modules/@webassemblyjs/helper-numbers": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.6.tgz", - "integrity": "sha512-vUIhZ8LZoIWHBohiEObxVm6hwP034jwmc9kuq5GdHZH0wiLVLIPcMCdpJzG4C11cHoQ25TFIQj9kaVADVX7N3g==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.13.2.tgz", + "integrity": "sha512-FE8aCmS5Q6eQYcV3gI35O4J789wlQA+7JrqTTpJqn5emA4U2hvwJmvFRC0HODS+3Ye6WioDklgd6scJ3+PLnEA==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "@webassemblyjs/floating-point-hex-parser": "1.11.6", - "@webassemblyjs/helper-api-error": "1.11.6", + "@webassemblyjs/floating-point-hex-parser": "1.13.2", + "@webassemblyjs/helper-api-error": "1.13.2", "@xtuc/long": "4.2.2" } }, "node_modules/@webassemblyjs/helper-wasm-bytecode": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.6.tgz", - "integrity": "sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.13.2.tgz", + "integrity": "sha512-3QbLKy93F0EAIXLh0ogEVR6rOubA9AoZ+WRYhNbFyuB70j3dRdwH9g+qXhLAO0kiYGlg3TxDV+I4rQTr/YNXkA==", "dev": true, + "license": "MIT", "peer": true }, "node_modules/@webassemblyjs/helper-wasm-section": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.12.1.tgz", - "integrity": "sha512-Jif4vfB6FJlUlSbgEMHUyk1j234GTNG9dBJ4XJdOySoj518Xj0oGsNi59cUQF4RRMS9ouBUxDDdyBVfPTypa5g==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.14.1.tgz", + "integrity": "sha512-ds5mXEqTJ6oxRoqjhWDU83OgzAYjwsCV8Lo/N+oRsNDmx/ZDpqalmrtgOMkHwxsG0iI//3BwWAErYRHtgn0dZw==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "@webassemblyjs/ast": "1.12.1", - "@webassemblyjs/helper-buffer": "1.12.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.6", - "@webassemblyjs/wasm-gen": "1.12.1" + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-buffer": "1.14.1", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2", + "@webassemblyjs/wasm-gen": "1.14.1" } }, "node_modules/@webassemblyjs/ieee754": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.6.tgz", - "integrity": "sha512-LM4p2csPNvbij6U1f19v6WR56QZ8JcHg3QIJTlSwzFcmx6WSORicYj6I63f9yU1kEUtrpG+kjkiIAkevHpDXrg==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.13.2.tgz", + "integrity": "sha512-4LtOzh58S/5lX4ITKxnAK2USuNEvpdVV9AlgGQb8rJDHaLeHciwG4zlGr0j/SNWlr7x3vO1lDEsuePvtcDNCkw==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "@xtuc/ieee754": "^1.2.0" } }, "node_modules/@webassemblyjs/leb128": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.6.tgz", - "integrity": "sha512-m7a0FhE67DQXgouf1tbN5XQcdWoNgaAuoULHIfGFIEVKA6tu/edls6XnIlkmS6FrXAquJRPni3ZZKjw6FSPjPQ==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.13.2.tgz", + "integrity": "sha512-Lde1oNoIdzVzdkNEAWZ1dZ5orIbff80YPdHx20mrHwHrVNNTjNr8E3xz9BdpcGqRQbAEa+fkrCb+fRFTl/6sQw==", "dev": true, + "license": "Apache-2.0", "peer": true, "dependencies": { "@xtuc/long": "4.2.2" } }, "node_modules/@webassemblyjs/utf8": { - "version": "1.11.6", - "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.6.tgz", - "integrity": "sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.13.2.tgz", + "integrity": "sha512-3NQWGjKTASY1xV5m7Hr0iPeXD9+RDobLll3T9d2AO+g3my8xy5peVyjSag4I50mR1bBSN/Ct12lo+R9tJk0NZQ==", "dev": true, + "license": "MIT", "peer": true }, "node_modules/@webassemblyjs/wasm-edit": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.12.1.tgz", - "integrity": "sha512-1DuwbVvADvS5mGnXbE+c9NfA8QRcZ6iKquqjjmR10k6o+zzsRVesil54DKexiowcFCPdr/Q0qaMgB01+SQ1u6g==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.14.1.tgz", + "integrity": "sha512-RNJUIQH/J8iA/1NzlE4N7KtyZNHi3w7at7hDjvRNm5rcUXa00z1vRz3glZoULfJ5mpvYhLybmVcwcjGrC1pRrQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "@webassemblyjs/ast": "1.12.1", - "@webassemblyjs/helper-buffer": "1.12.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.6", - "@webassemblyjs/helper-wasm-section": "1.12.1", - "@webassemblyjs/wasm-gen": "1.12.1", - "@webassemblyjs/wasm-opt": "1.12.1", - "@webassemblyjs/wasm-parser": "1.12.1", - "@webassemblyjs/wast-printer": "1.12.1" + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-buffer": "1.14.1", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2", + "@webassemblyjs/helper-wasm-section": "1.14.1", + "@webassemblyjs/wasm-gen": "1.14.1", + "@webassemblyjs/wasm-opt": "1.14.1", + "@webassemblyjs/wasm-parser": "1.14.1", + "@webassemblyjs/wast-printer": "1.14.1" } }, "node_modules/@webassemblyjs/wasm-gen": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.12.1.tgz", - "integrity": "sha512-TDq4Ojh9fcohAw6OIMXqiIcTq5KUXTGRkVxbSo1hQnSy6lAM5GSdfwWeSxpAo0YzgsgF182E/U0mDNhuA0tW7w==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.14.1.tgz", + "integrity": "sha512-AmomSIjP8ZbfGQhumkNvgC33AY7qtMCXnN6bL2u2Js4gVCg8fp735aEiMSBbDR7UQIj90n4wKAFUSEd0QN2Ukg==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "@webassemblyjs/ast": "1.12.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.6", - "@webassemblyjs/ieee754": "1.11.6", - "@webassemblyjs/leb128": "1.11.6", - "@webassemblyjs/utf8": "1.11.6" + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2", + "@webassemblyjs/ieee754": "1.13.2", + "@webassemblyjs/leb128": "1.13.2", + "@webassemblyjs/utf8": "1.13.2" } }, "node_modules/@webassemblyjs/wasm-opt": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.12.1.tgz", - "integrity": "sha512-Jg99j/2gG2iaz3hijw857AVYekZe2SAskcqlWIZXjji5WStnOpVoat3gQfT/Q5tb2djnCjBtMocY/Su1GfxPBg==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.14.1.tgz", + "integrity": "sha512-PTcKLUNvBqnY2U6E5bdOQcSM+oVP/PmrDY9NzowJjislEjwP/C4an2303MCVS2Mg9d3AJpIGdUFIQQWbPds0Sw==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "@webassemblyjs/ast": "1.12.1", - "@webassemblyjs/helper-buffer": "1.12.1", - "@webassemblyjs/wasm-gen": "1.12.1", - "@webassemblyjs/wasm-parser": "1.12.1" + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-buffer": "1.14.1", + "@webassemblyjs/wasm-gen": "1.14.1", + "@webassemblyjs/wasm-parser": "1.14.1" } }, "node_modules/@webassemblyjs/wasm-parser": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.12.1.tgz", - "integrity": "sha512-xikIi7c2FHXysxXe3COrVUPSheuBtpcfhbpFj4gmu7KRLYOzANztwUU0IbsqvMqzuNK2+glRGWCEqZo1WCLyAQ==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.14.1.tgz", + "integrity": "sha512-JLBl+KZ0R5qB7mCnud/yyX08jWFw5MsoalJ1pQ4EdFlgj9VdXKGuENGsiCIjegI1W7p91rUlcB/LB5yRJKNTcQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "@webassemblyjs/ast": "1.12.1", - "@webassemblyjs/helper-api-error": "1.11.6", - "@webassemblyjs/helper-wasm-bytecode": "1.11.6", - "@webassemblyjs/ieee754": "1.11.6", - "@webassemblyjs/leb128": "1.11.6", - "@webassemblyjs/utf8": "1.11.6" + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-api-error": "1.13.2", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2", + "@webassemblyjs/ieee754": "1.13.2", + "@webassemblyjs/leb128": "1.13.2", + "@webassemblyjs/utf8": "1.13.2" } }, "node_modules/@webassemblyjs/wast-printer": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.12.1.tgz", - "integrity": "sha512-+X4WAlOisVWQMikjbcvY2e0rwPsKQ9F688lksZhBcPycBBuii3O7m8FACbDMWDojpAqvjIncrG8J0XHKyQfVeA==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.14.1.tgz", + "integrity": "sha512-kPSSXE6De1XOR820C90RIo2ogvZG+c3KiHzqUoO/F34Y2shGzesfqv7o57xrxovZJH/MetF5UjroJ/R/3isoiw==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/ast": "1.14.1", "@xtuc/long": "4.2.2" } }, @@ -2965,6 +3485,7 @@ "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", "dev": true, + "license": "BSD-3-Clause", "peer": true }, "node_modules/@xtuc/long": { @@ -2972,17 +3493,20 @@ "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", "dev": true, + "license": "Apache-2.0", "peer": true }, "node_modules/abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "license": "ISC" }, "node_modules/abort-controller": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "license": "MIT", "dependencies": { "event-target-shim": "^5.0.0" }, @@ -2995,6 +3519,7 @@ "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", "dev": true, + "license": "MIT", "dependencies": { "mime-types": "~2.1.34", "negotiator": "0.6.3" @@ -3007,6 +3532,7 @@ "version": "8.0.4", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.0.4.tgz", "integrity": "sha512-XNP0PqF1XD19ZlLKvB7cMmnZswW4C/03pRHgirB30uSJTaS3A3V1/P4sS3HPvFmjoriPCJQs+JDSbm4bL1TxGQ==", + "license": "MIT", "bin": { "acorn": "bin/acorn" }, @@ -3014,20 +3540,11 @@ "node": ">=0.4.0" } }, - "node_modules/acorn-import-attributes": { - "version": "1.9.5", - "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz", - "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==", - "dev": true, - "peer": true, - "peerDependencies": { - "acorn": "^8" - } - }, "node_modules/acorn-jsx": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "license": "MIT", "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } @@ -3036,6 +3553,7 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "license": "MIT", "optional": true, "dependencies": { "debug": "4" @@ -3045,9 +3563,10 @@ } }, "node_modules/agentkeepalive": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.5.0.tgz", - "integrity": "sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew==", + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.6.0.tgz", + "integrity": "sha512-kja8j7PjmncONqaTsB8fQ+wE2mSU2DJ9D4XKoJ5PFWIdRMa6SLSN1ff4mOr4jCbfRSsxR4keIiySJU0N9T5hIQ==", + "license": "MIT", "optional": true, "dependencies": { "humanize-ms": "^1.2.1" @@ -3061,6 +3580,7 @@ "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", "devOptional": true, + "license": "MIT", "dependencies": { "clean-stack": "^2.0.0", "indent-string": "^4.0.0" @@ -3073,6 +3593,7 @@ "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -3084,11 +3605,57 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/ajv-formats": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz", + "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, + "node_modules/ajv-formats/node_modules/ajv": { + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", + "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv-formats/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true, + "license": "MIT", + "peer": true + }, "node_modules/ajv-keywords": { "version": "3.5.2", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", "dev": true, + "license": "MIT", "peerDependencies": { "ajv": "^6.9.1" } @@ -3097,6 +3664,7 @@ "version": "4.1.3", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", + "license": "MIT", "engines": { "node": ">=6" } @@ -3106,6 +3674,7 @@ "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", "dev": true, + "license": "MIT", "dependencies": { "type-fest": "^0.21.3" }, @@ -3120,6 +3689,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", "engines": { "node": ">=8" } @@ -3128,6 +3698,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -3143,6 +3714,7 @@ "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", "dev": true, + "license": "ISC", "dependencies": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" @@ -3155,6 +3727,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", + "license": "ISC", "optional": true }, "node_modules/arch": { @@ -3175,13 +3748,15 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "MIT" }, "node_modules/are-we-there-yet": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.1.tgz", "integrity": "sha512-QZW4EDmGwlYur0Yyf/b2uGucHQMa8aFUP7eu9ddR73vvhFyt4V0Vl3QHPcTNJ8l6qYOBdxgXdnBXQrHilfRQBg==", "deprecated": "This package is no longer supported.", + "license": "ISC", "optional": true, "dependencies": { "delegates": "^1.0.0", @@ -3195,6 +3770,7 @@ "version": "3.6.2", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "license": "MIT", "optional": true, "dependencies": { "inherits": "^2.0.3", @@ -3209,6 +3785,7 @@ "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "license": "MIT", "dependencies": { "sprintf-js": "~1.0.2" } @@ -3217,6 +3794,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", "integrity": "sha512-YVIQ82gZPGBebQV/a8dar4AitzCQs0jjXwMPZllpXMaGjXPYVUawSxQrRsjhjupyVxEvbHgUmIhKVlND+j02kA==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -3225,6 +3803,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -3233,18 +3812,20 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", "integrity": "sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q==", + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/array-buffer-byte-length": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", - "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz", + "integrity": "sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.5", - "is-array-buffer": "^3.0.4" + "call-bound": "^1.0.3", + "is-array-buffer": "^3.0.5" }, "engines": { "node": ">= 0.4" @@ -3257,6 +3838,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-3.0.0.tgz", "integrity": "sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==", + "license": "MIT", "engines": { "node": ">=8" } @@ -3265,6 +3847,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz", "integrity": "sha512-zHjL5SZa68hkKHBFBK6DJCTtr9sfTCPCaph/L7tMSLcTFgy+zX7E+6q5UArbtOtMBCtxdICpfTCspRse+ywyXA==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -3274,6 +3857,7 @@ "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.8.tgz", "integrity": "sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", @@ -3293,6 +3877,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz", "integrity": "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -3301,6 +3886,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "license": "MIT", "engines": { "node": ">=8" } @@ -3309,20 +3895,22 @@ "version": "0.3.2", "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", "integrity": "sha512-SleRWjh9JUud2wH1hPs9rZBZ33H6T9HOiL0uwGnGx9FpE6wKGyfWugmbkEOIs6qWrZhg0LWeLziLrEwQJhs5mQ==", + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/array.prototype.flat": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz", - "integrity": "sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.3.tgz", + "integrity": "sha512-rwG/ja1neyLqCuGZ5YYrznA62D4mZXg0i1cIskIUKSiqF3Cje9/wXAls9B9s1Wa2fomMsIv8czB8jZcPmxCXFg==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "es-shim-unscopables": "^1.0.0" + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-shim-unscopables": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -3332,19 +3920,19 @@ } }, "node_modules/arraybuffer.prototype.slice": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz", - "integrity": "sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.4.tgz", + "integrity": "sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==", "dev": true, + "license": "MIT", "dependencies": { "array-buffer-byte-length": "^1.0.1", - "call-bind": "^1.0.5", + "call-bind": "^1.0.8", "define-properties": "^1.2.1", - "es-abstract": "^1.22.3", - "es-errors": "^1.2.1", - "get-intrinsic": "^1.2.3", - "is-array-buffer": "^3.0.4", - "is-shared-array-buffer": "^1.0.2" + "es-abstract": "^1.23.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "is-array-buffer": "^3.0.4" }, "engines": { "node": ">= 0.4" @@ -3357,6 +3945,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", + "license": "MIT", "engines": { "node": ">=8" } @@ -3365,28 +3954,32 @@ "version": "2.0.6", "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/asn1": { "version": "0.2.6", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", "dev": true, + "license": "MIT", "dependencies": { "safer-buffer": "~2.1.0" } }, "node_modules/assert-never": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/assert-never/-/assert-never-1.3.0.tgz", - "integrity": "sha512-9Z3vxQ+berkL/JJo0dK+EY3Lp0s3NtSnP3VCLsh5HDcZPrh0M+KQRK5sWhUeyPPH+/RCxZqOxLMR+YC6vlviEQ==", - "dev": true + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/assert-never/-/assert-never-1.4.0.tgz", + "integrity": "sha512-5oJg84os6NMQNl27T9LnZkvvqzvAnHu03ShCnoj6bsJwS7L8AO4lf+C/XjK/nvzEqQB744moC6V128RucQd1jA==", + "dev": true, + "license": "MIT" }, "node_modules/assert-plus": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.8" } @@ -3395,6 +3988,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", "integrity": "sha512-Q+JC7Whu8HhmTdBph/Tq59IoRtoy6KAm5zzPv00WdujX82lbAL8K7WVjne7vdCsAmbF4AYaDOPyO3k0kl8qIrw==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -3403,6 +3997,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "license": "MIT", "engines": { "node": ">=8" } @@ -3410,27 +4005,41 @@ "node_modules/async": { "version": "3.2.6", "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", - "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==" + "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", + "license": "MIT" }, "node_modules/async-each-series": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/async-each-series/-/async-each-series-0.1.1.tgz", "integrity": "sha512-p4jj6Fws4Iy2m0iCmI2am2ZNZCgbdgE+P8F/8csmn2vx7ixXrO2zGcuNsD46X5uZSVecmkEy/M06X2vG8KD6dQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.8.0" } }, + "node_modules/async-function": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async-function/-/async-function-1.0.0.tgz", + "integrity": "sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "license": "MIT" }, "node_modules/at-least-node": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", "dev": true, + "license": "ISC", "engines": { "node": ">= 4.0.0" } @@ -3439,6 +4048,7 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "license": "(MIT OR Apache-2.0)", "bin": { "atob": "bin/atob.js" }, @@ -3450,6 +4060,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/atomic-sleep/-/atomic-sleep-1.0.0.tgz", "integrity": "sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==", + "license": "MIT", "engines": { "node": ">=8.0.0" } @@ -3459,6 +4070,7 @@ "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-9.8.8.tgz", "integrity": "sha512-eM9d/swFopRt5gdJ7jrpCwgvEMIayITpojhkkSMRsFHYuH5bkSQ4p/9qTEHtmNudUZh22Tehu7I6CxAW0IXTKA==", "dev": true, + "license": "MIT", "dependencies": { "browserslist": "^4.12.0", "caniuse-lite": "^1.0.30001109", @@ -3480,13 +4092,15 @@ "version": "0.2.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-0.2.1.tgz", "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/autoprefixer/node_modules/postcss": { "version": "7.0.39", "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.39.tgz", "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", "dev": true, + "license": "MIT", "dependencies": { "picocolors": "^0.2.1", "source-map": "^0.6.1" @@ -3504,6 +4118,7 @@ "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", "dev": true, + "license": "MIT", "dependencies": { "possible-typed-array-names": "^1.0.0" }, @@ -3519,20 +4134,23 @@ "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", "integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==", "dev": true, + "license": "Apache-2.0", "engines": { "node": "*" } }, "node_modules/aws4": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.13.1.tgz", - "integrity": "sha512-u5w79Rd7SU4JaIlA/zFqG+gOiuq25q5VLyZ8E+ijJeILuTxVzZgp2CaGw/UTw6pXYN9XMO9yiqj/nEHmhTG5CA==", - "dev": true + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.13.2.tgz", + "integrity": "sha512-lHe62zvbTB5eEABUVi/AwVh0ZKY9rMMDhmm+eeyuuUQbQ3+J+fONVQOZyj+DdrvD4BY33uYniyRJ4UJIaSKAfw==", + "dev": true, + "license": "MIT" }, "node_modules/axios": { "version": "0.27.2", "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", + "license": "MIT", "dependencies": { "follow-redirects": "^1.14.9", "form-data": "^4.0.0" @@ -3542,6 +4160,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/babel-plugin-module-resolver/-/babel-plugin-module-resolver-5.0.0.tgz", "integrity": "sha512-g0u+/ChLSJ5+PzYwLwP8Rp8Rcfowz58TJNCe+L/ui4rpzE/mg//JVX0EWBUYoxaextqnwuGHzfGp2hh0PPV25Q==", + "license": "MIT", "dependencies": { "find-babel-config": "^2.0.0", "glob": "^8.0.3", @@ -3554,12 +4173,13 @@ } }, "node_modules/babel-plugin-polyfill-corejs2": { - "version": "0.4.11", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.11.tgz", - "integrity": "sha512-sMEJ27L0gRHShOh5G54uAAPaiCOygY/5ratXuiyb2G46FmlSpc9eFCzYVyDiPxfNbwzA7mYahmjQc5q+CZQ09Q==", + "version": "0.4.12", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.12.tgz", + "integrity": "sha512-CPWT6BwvhrTO2d8QVorhTCQw9Y43zOu7G9HigcfxvepOU6b8o3tcWad6oVgZIsZCTt42FFv97aA7ZJsbM4+8og==", + "license": "MIT", "dependencies": { "@babel/compat-data": "^7.22.6", - "@babel/helper-define-polyfill-provider": "^0.6.2", + "@babel/helper-define-polyfill-provider": "^0.6.3", "semver": "^6.3.1" }, "peerDependencies": { @@ -3570,6 +4190,7 @@ "version": "0.8.7", "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.8.7.tgz", "integrity": "sha512-KyDvZYxAzkC0Aj2dAPyDzi2Ym15e5JKZSK+maI7NAwSqofvuFglbSsxE7wUOvTg9oFVnHMzVzBKcqEb4PJgtOA==", + "license": "MIT", "dependencies": { "@babel/helper-define-polyfill-provider": "^0.4.4", "core-js-compat": "^3.33.1" @@ -3582,6 +4203,7 @@ "version": "0.4.4", "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.4.4.tgz", "integrity": "sha512-QcJMILQCu2jm5TFPGA3lCpJJTeEP+mqeXooG/NZbg/h5FTFi6V0+99ahlRsW8/kRLyb24LZVCCiclDedhLKcBA==", + "license": "MIT", "dependencies": { "@babel/helper-compilation-targets": "^7.22.6", "@babel/helper-plugin-utils": "^7.22.5", @@ -3597,6 +4219,7 @@ "version": "0.5.5", "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.5.5.tgz", "integrity": "sha512-OJGYZlhLqBh2DDHeqAxWB1XIvr49CxiJ2gIt61/PU55CQK4Z58OzMqjDe1zwQdQk+rBYsRc+1rJmdajM3gimHg==", + "license": "MIT", "dependencies": { "@babel/helper-define-polyfill-provider": "^0.5.0" }, @@ -3608,6 +4231,7 @@ "version": "0.5.0", "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.5.0.tgz", "integrity": "sha512-NovQquuQLAQ5HuyjCz7WQP9MjRj7dx++yspwiyUiGl9ZyadHRSql1HZh5ogRd8W8w6YM6EQ/NTB8rgjLt5W65Q==", + "license": "MIT", "dependencies": { "@babel/helper-compilation-targets": "^7.22.6", "@babel/helper-plugin-utils": "^7.22.5", @@ -3623,6 +4247,7 @@ "version": "6.6.0", "resolved": "https://registry.npmjs.org/babel-plugin-root-import/-/babel-plugin-root-import-6.6.0.tgz", "integrity": "sha512-SPzVOHd7nDh5loZwZBxtX/oOu1MXeKjTkz+1VnnzLWC0dk8sJIGC2IDQ2uWIBjE5mUtXlQ35MTHSqN0Xn7qHrg==", + "license": "MIT", "dependencies": { "slash": "^3.0.0" } @@ -3632,6 +4257,7 @@ "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", "integrity": "sha512-ITKNuq2wKlW1fJg9sSW52eepoYgZBggvOAHC0u/CYu/qxQ9EVzThCgR69BnSXLHjy2f7SY5zaQ4yt7H9ZVxY2g==", "dev": true, + "license": "MIT", "dependencies": { "core-js": "^2.4.0", "regenerator-runtime": "^0.11.0" @@ -3641,13 +4267,15 @@ "version": "0.11.1", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/babel-types": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", "integrity": "sha512-zhe3V/26rCWsEZK8kZN+HaQj5yQ1CilTObixFzKW1UWjqG7618Twz6YEsCnjfg5gBcJh02DrpCkS9h98ZqDY+g==", "dev": true, + "license": "MIT", "dependencies": { "babel-runtime": "^6.26.0", "esutils": "^2.0.2", @@ -3655,20 +4283,12 @@ "to-fast-properties": "^1.0.3" } }, - "node_modules/babel-types/node_modules/to-fast-properties": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", - "integrity": "sha512-lxrWP8ejsq+7E3nNjwYmUBMAgjMTZoTI+sdBOpvNyijeDLa29LUn9QaoXAHv4+Z578hbmHHJKZknzxVtvo77og==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/babel-walk": { "version": "3.0.0-canary-5", "resolved": "https://registry.npmjs.org/babel-walk/-/babel-walk-3.0.0-canary-5.tgz", "integrity": "sha512-GAwkz0AihzY5bkwIY5QDR+LvsRQgB/B+1foMPvi0FZPMl5fjD7ICiznUiBdLYMH1QYe6vqu4gWYytZOccLouFw==", "dev": true, + "license": "MIT", "dependencies": { "@babel/types": "^7.9.6" }, @@ -3681,6 +4301,7 @@ "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", "dev": true, + "license": "MIT", "bin": { "babylon": "bin/babylon.js" } @@ -3690,6 +4311,7 @@ "resolved": "https://registry.npmjs.org/bail/-/bail-1.0.5.tgz", "integrity": "sha512-xFbRxM1tahm08yHBP16MMjVUAvDaBMD38zsM9EMAUN61omwLmKlOpB/Zku5QkjZ8TZ4vn53pj+t518cH0S03RQ==", "dev": true, + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -3698,12 +4320,14 @@ "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "license": "MIT" }, "node_modules/base": { "version": "0.11.2", "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "license": "MIT", "dependencies": { "cache-base": "^1.0.1", "class-utils": "^0.3.5", @@ -3721,6 +4345,7 @@ "version": "3.0.10", "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.10.tgz", "integrity": "sha512-7d0s06rR9rYaIWHkpfLIFICM/tkSVdoPC9qYAQRpxn9DdKNWNsKC0uk++akckyLq16Tx2WIinnZ6WRriAt6njQ==", + "license": "MIT", "dependencies": { "safe-buffer": "^5.0.1" } @@ -3729,6 +4354,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", "integrity": "sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==", + "license": "MIT", "dependencies": { "is-descriptor": "^1.0.0" }, @@ -3753,13 +4379,15 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "MIT" }, "node_modules/base64id": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz", "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==", "dev": true, + "license": "MIT", "engines": { "node": "^4.5.0 || >= 5.9" } @@ -3768,13 +4396,15 @@ "version": "0.6.1", "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz", "integrity": "sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/bcrypt-pbkdf": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "tweetnacl": "^0.14.3" } @@ -3783,13 +4413,15 @@ "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==", - "dev": true + "dev": true, + "license": "Unlicense" }, "node_modules/big.js": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/big.js/-/big.js-3.2.0.tgz", "integrity": "sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q==", "dev": true, + "license": "MIT", "engines": { "node": "*" } @@ -3799,6 +4431,7 @@ "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" }, @@ -3810,6 +4443,7 @@ "version": "1.5.0", "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "license": "MIT", "dependencies": { "file-uri-to-path": "1.0.0" } @@ -3818,6 +4452,7 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "license": "MIT", "dependencies": { "buffer": "^5.5.0", "inherits": "^2.0.4", @@ -3842,6 +4477,7 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" @@ -3851,6 +4487,7 @@ "version": "3.6.2", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "license": "MIT", "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -3863,35 +4500,41 @@ "node_modules/blakejs": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.2.1.tgz", - "integrity": "sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==" + "integrity": "sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==", + "license": "MIT" }, "node_modules/blob-util": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/blob-util/-/blob-util-2.0.2.tgz", "integrity": "sha512-T7JQa+zsXXEa6/8ZhHcQEW1UFfVM49Ts65uBkFL6fz2QmrElqmbajIDJvuA0tEhRe5eIjpV9ZF+0RfZR9voJFQ==", - "dev": true + "dev": true, + "license": "Apache-2.0" }, "node_modules/bluebird": { "version": "3.7.2", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/boolbase": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/bottleneck": { "version": "2.19.5", "resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.19.5.tgz", - "integrity": "sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw==" + "integrity": "sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw==", + "license": "MIT" }, "node_modules/bower-config": { "version": "1.4.3", "resolved": "https://registry.npmjs.org/bower-config/-/bower-config-1.4.3.tgz", "integrity": "sha512-MVyyUk3d1S7d2cl6YISViwJBc2VXCkxF5AUFykvN0PQj5FsUiMNSgAYTso18oRFfyZ6XEtjrgg9MAaufHbOwNw==", + "license": "MIT", "dependencies": { "graceful-fs": "^4.1.3", "minimist": "^0.2.1", @@ -3908,6 +4551,7 @@ "version": "0.2.4", "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.2.4.tgz", "integrity": "sha512-Pkrrm8NjyQ8yVt8Am9M+yUt74zE3iokhzbG1bFVNjLB92vwM71hf40RkEsryg98BujhVOncKm/C1xROxZ030LQ==", + "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -3916,6 +4560,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/untildify/-/untildify-2.1.0.tgz", "integrity": "sha512-sJjbDp2GodvkB0FZZcn7k6afVisqX5BZD7Yq3xp4nN2O15BBK0cLm3Vwn2vQaF7UDS0UUsrQMkkplmDI5fskig==", + "license": "MIT", "dependencies": { "os-homedir": "^1.0.0" }, @@ -3927,6 +4572,7 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -3936,6 +4582,7 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "license": "MIT", "dependencies": { "fill-range": "^7.1.1" }, @@ -3947,13 +4594,15 @@ "version": "1.3.1", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/browser-sync": { "version": "2.27.10", "resolved": "https://registry.npmjs.org/browser-sync/-/browser-sync-2.27.10.tgz", "integrity": "sha512-xKm+6KJmJu6RuMWWbFkKwOCSqQOxYe3nOrFkKI5Tr/ZzjPxyU3pFShKK3tWnazBo/3lYQzN7fzjixG8fwJh1Xw==", "dev": true, + "license": "Apache-2.0", "dependencies": { "browser-sync-client": "^2.27.10", "browser-sync-ui": "^2.27.10", @@ -3998,6 +4647,7 @@ "resolved": "https://registry.npmjs.org/browser-sync-client/-/browser-sync-client-2.29.3.tgz", "integrity": "sha512-4tK5JKCl7v/3aLbmCBMzpufiYLsB1+UI+7tUXCCp5qF0AllHy/jAqYu6k7hUF3hYtlClKpxExWaR+rH+ny07wQ==", "dev": true, + "license": "ISC", "dependencies": { "etag": "1.8.1", "fresh": "0.5.2", @@ -4012,6 +4662,7 @@ "resolved": "https://registry.npmjs.org/browser-sync-ui/-/browser-sync-ui-2.29.3.tgz", "integrity": "sha512-kBYOIQjU/D/3kYtUIJtj82e797Egk1FB2broqItkr3i4eF1qiHbFCG6srksu9gWhfmuM/TNG76jMfzAdxEPakg==", "dev": true, + "license": "Apache-2.0", "dependencies": { "async-each-series": "0.1.1", "chalk": "4.1.2", @@ -4027,6 +4678,7 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -4039,9 +4691,9 @@ } }, "node_modules/browserslist": { - "version": "4.23.3", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.3.tgz", - "integrity": "sha512-btwCFJVjI4YWDNfau8RhZ+B1Q/VLoUITrm3RlP6y1tYGWIOa+InuYiRGXUBXo8nA1qKmHMyLB/iVQg5TT4eFoA==", + "version": "4.24.4", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.4.tgz", + "integrity": "sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A==", "funding": [ { "type": "opencollective", @@ -4056,11 +4708,12 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "dependencies": { - "caniuse-lite": "^1.0.30001646", - "electron-to-chromium": "^1.5.4", - "node-releases": "^2.0.18", - "update-browserslist-db": "^1.1.0" + "caniuse-lite": "^1.0.30001688", + "electron-to-chromium": "^1.5.73", + "node-releases": "^2.0.19", + "update-browserslist-db": "^1.1.1" }, "bin": { "browserslist": "cli.js" @@ -4073,18 +4726,21 @@ "version": "1.3.4", "resolved": "https://registry.npmjs.org/bs-recipes/-/bs-recipes-1.3.4.tgz", "integrity": "sha512-BXvDkqhDNxXEjeGM8LFkSbR+jzmP/CYpCiVKYn+soB1dDldeU15EBNDkwVXndKuX35wnNUaPd0qSoQEAkmQtMw==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/bs-snippet-injector": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/bs-snippet-injector/-/bs-snippet-injector-2.0.1.tgz", "integrity": "sha512-4u8IgB+L9L+S5hknOj3ddNSb42436gsnGm1AuM15B7CdbkpQTyVWgIM5/JUBiKiRwGOR86uo0Lu/OsX+SAlJmw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/bs58": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", + "license": "MIT", "dependencies": { "base-x": "^3.0.2" } @@ -4107,6 +4763,7 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" @@ -4117,6 +4774,7 @@ "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", "dev": true, + "license": "MIT", "engines": { "node": "*" } @@ -4124,13 +4782,15 @@ "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "license": "MIT" }, "node_modules/bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.8" } @@ -4139,6 +4799,7 @@ "version": "15.3.0", "resolved": "https://registry.npmjs.org/cacache/-/cacache-15.3.0.tgz", "integrity": "sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ==", + "license": "ISC", "optional": true, "dependencies": { "@npmcli/fs": "^1.0.0", @@ -4169,6 +4830,7 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "deprecated": "Glob versions prior to v9 are no longer supported", + "license": "ISC", "optional": true, "dependencies": { "fs.realpath": "^1.0.0", @@ -4189,6 +4851,7 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "license": "ISC", "optional": true, "dependencies": { "yallist": "^4.0.0" @@ -4201,6 +4864,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "license": "MIT", "dependencies": { "collection-visit": "^1.0.0", "component-emitter": "^1.2.1", @@ -4221,21 +4885,53 @@ "resolved": "https://registry.npmjs.org/cachedir/-/cachedir-2.4.0.tgz", "integrity": "sha512-9EtFOZR8g22CL7BWjJ9BUx1+A/djkofnyW3aOXZORNW2kxoUpx2h+uN2cOqwPmFhnpVmxg+KW2OjOSgChTEvsQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/call-bind": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", - "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", "dev": true, + "license": "MIT", "dependencies": { + "call-bind-apply-helpers": "^1.0.0", "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", "get-intrinsic": "^1.2.4", - "set-function-length": "^1.2.1" + "set-function-length": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", + "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.3.tgz", + "integrity": "sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "get-intrinsic": "^1.2.6" }, "engines": { "node": ">= 0.4" @@ -4248,6 +4944,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "license": "MIT", "engines": { "node": ">=6" } @@ -4257,6 +4954,7 @@ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } @@ -4266,6 +4964,7 @@ "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz", "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", "dev": true, + "license": "MIT", "dependencies": { "camelcase": "^5.3.1", "map-obj": "^4.0.0", @@ -4279,9 +4978,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001653", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001653.tgz", - "integrity": "sha512-XGWQVB8wFQ2+9NZwZ10GxTYC5hk0Fa+q8cSkr0tgvMhYhMHP/QC+WTgrePMDBWiWc/pV+1ik82Al20XOK25Gcw==", + "version": "1.0.30001695", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001695.tgz", + "integrity": "sha512-vHyLade6wTgI2u1ec3WQBxv+2BrTERV28UXQu9LO6lZ9pYeMk34vjXFLOxo1A4UBA8XTL4njRQZdno/yYaSmWw==", "funding": [ { "type": "opencollective", @@ -4295,18 +4994,21 @@ "type": "github", "url": "https://github.com/sponsors/ai" } - ] + ], + "license": "CC-BY-4.0" }, "node_modules/caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==", - "dev": true + "dev": true, + "license": "Apache-2.0" }, "node_modules/chalk": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -4323,6 +5025,7 @@ "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-1.2.4.tgz", "integrity": "sha512-iBMyeEHxfVnIakwOuDXpVkc54HijNgCyQB2w0VfGQThle6NXn50zU6V/u+LDhxHcDUPojn6Kpga3PTAD8W1bQw==", "dev": true, + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -4333,6 +5036,7 @@ "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-1.1.4.tgz", "integrity": "sha512-3Xnr+7ZFS1uxeiUDvV02wQ+QDbc55o97tIV5zHScSPJpcLm/r0DFPcoY3tYRp+VZukxuMeKgXYmsXQHO05zQeA==", "dev": true, + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -4343,6 +5047,7 @@ "resolved": "https://registry.npmjs.org/character-parser/-/character-parser-2.2.0.tgz", "integrity": "sha512-+UqJQjFEFaTAs3bNsF2j2kEN1baG/zghZbdqoYEDxGZtJo9LBzl1A+m0D4n3qKx8N2FNv8/Xp6yV9mQmBuptaw==", "dev": true, + "license": "MIT", "dependencies": { "is-regex": "^1.0.3" } @@ -4352,6 +5057,7 @@ "resolved": "https://registry.npmjs.org/character-reference-invalid/-/character-reference-invalid-1.1.4.tgz", "integrity": "sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==", "dev": true, + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -4361,6 +5067,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/check-dependencies/-/check-dependencies-1.1.1.tgz", "integrity": "sha512-XJv5tlruYgsekdiDOCaSSe/PqpRVFWj50f6oJyI0VTsfzu6ZLpf+fTiNyqwIPjgAgzGjOXGJuLUCbP1HFZC/lQ==", + "license": "MIT", "dependencies": { "bower-config": "^1.4.0", "chalk": "^2.4.1", @@ -4380,6 +5087,7 @@ "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "license": "MIT", "dependencies": { "color-convert": "^1.9.0" }, @@ -4391,6 +5099,7 @@ "version": "2.3.2", "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "license": "MIT", "dependencies": { "arr-flatten": "^1.1.0", "array-unique": "^0.3.2", @@ -4411,6 +5120,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "license": "MIT", "dependencies": { "is-extendable": "^0.1.0" }, @@ -4422,6 +5132,7 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "license": "MIT", "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -4435,6 +5146,7 @@ "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "license": "MIT", "dependencies": { "color-name": "1.1.3" } @@ -4442,12 +5154,14 @@ "node_modules/check-dependencies/node_modules/color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "license": "MIT" }, "node_modules/check-dependencies/node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "license": "MIT", "engines": { "node": ">=0.8.0" } @@ -4456,6 +5170,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", "integrity": "sha512-VcpLTWqWDiTerugjj8e3+esbg+skS3M9e54UuR3iCeIDMXCLTsAH8hTSzDQU/X6/6t3eYkOKoZSef2PlU6U1XQ==", + "license": "MIT", "dependencies": { "extend-shallow": "^2.0.1", "is-number": "^3.0.0", @@ -4470,6 +5185,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "license": "MIT", "dependencies": { "is-extendable": "^0.1.0" }, @@ -4481,6 +5197,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-2.0.0.tgz", "integrity": "sha512-vs+3unmJT45eczmcAZ6zMJtxN3l/QXeccaXQx5cu/MeJMhewVfoWZqibRkOxPnmoR59+Zy5hjabfQc6JLSah4g==", + "license": "MIT", "dependencies": { "detect-file": "^1.0.0", "is-glob": "^3.1.0", @@ -4495,6 +5212,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "license": "MIT", "engines": { "node": ">=4" } @@ -4502,12 +5220,14 @@ "node_modules/check-dependencies/node_modules/is-buffer": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "license": "MIT" }, "node_modules/check-dependencies/node_modules/is-extendable": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -4516,6 +5236,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", "integrity": "sha512-UFpDDrPgM6qpnFNI+rh/p3bUaq9hKLZN8bMUWzxmcnZVS3omf4IPK+BrewlnWjO1WmUsMYuSjKh4UJuV4+Lqmw==", + "license": "MIT", "dependencies": { "is-extglob": "^2.1.0" }, @@ -4527,6 +5248,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", "integrity": "sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg==", + "license": "MIT", "dependencies": { "kind-of": "^3.0.2" }, @@ -4538,6 +5260,7 @@ "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "license": "MIT", "dependencies": { "is-buffer": "^1.1.5" }, @@ -4549,6 +5272,7 @@ "version": "3.1.10", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "license": "MIT", "dependencies": { "arr-diff": "^4.0.0", "array-unique": "^0.3.2", @@ -4572,6 +5296,7 @@ "version": "5.7.2", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "license": "ISC", "bin": { "semver": "bin/semver" } @@ -4580,6 +5305,7 @@ "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "license": "MIT", "dependencies": { "has-flag": "^3.0.0" }, @@ -4591,6 +5317,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", "integrity": "sha512-ZZWNfCjUokXXDGXFpZehJIkZqq91BcULFq/Pi7M5i4JnxXdhMKAK682z8bCW3o8Hj1wuuzoKcW3DfVzaP6VuNg==", + "license": "MIT", "dependencies": { "is-number": "^3.0.0", "repeat-string": "^1.6.1" @@ -4604,6 +5331,7 @@ "resolved": "https://registry.npmjs.org/check-more-types/-/check-more-types-2.24.0.tgz", "integrity": "sha512-Pj779qHxV2tuapviy1bSZNEL1maXr13bPYpsvSDB68HlYcYuhlDrmGd63i0JHMCLKzc7rUSNIrpdJlhVlNwrxA==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.8.0" } @@ -4613,6 +5341,7 @@ "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0.tgz", "integrity": "sha512-quS9HgjQpdaXOvsZz82Oz7uxtXiy6UIsIQcpBj7HRw2M63Skasm9qlDocAM7jNuaxdhpPU7c4kJN+gA5MCu4ww==", "dev": true, + "license": "MIT", "dependencies": { "cheerio-select": "^2.1.0", "dom-serializer": "^2.0.0", @@ -4638,6 +5367,7 @@ "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-2.1.0.tgz", "integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "boolbase": "^1.0.0", "css-select": "^5.1.0", @@ -4662,6 +5392,7 @@ "url": "https://github.com/sponsors/fb55" } ], + "license": "MIT", "dependencies": { "domelementtype": "^2.3.0", "domhandler": "^5.0.3", @@ -4674,6 +5405,7 @@ "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", "dev": true, + "license": "MIT", "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", @@ -4697,6 +5429,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "license": "ISC", "engines": { "node": ">=10" } @@ -4706,6 +5439,7 @@ "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.4.tgz", "integrity": "sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ==", "dev": true, + "license": "MIT", "peer": true, "engines": { "node": ">=6.0" @@ -4722,6 +5456,7 @@ "url": "https://github.com/sponsors/sibiraj-s" } ], + "license": "MIT", "engines": { "node": ">=8" } @@ -4730,6 +5465,7 @@ "version": "0.3.6", "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "license": "MIT", "dependencies": { "arr-union": "^3.1.0", "define-property": "^0.2.5", @@ -4744,6 +5480,7 @@ "version": "0.2.5", "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", + "license": "MIT", "dependencies": { "is-descriptor": "^0.1.0" }, @@ -4755,6 +5492,7 @@ "version": "0.1.7", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.7.tgz", "integrity": "sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg==", + "license": "MIT", "dependencies": { "is-accessor-descriptor": "^1.0.1", "is-data-descriptor": "^1.0.1" @@ -4768,6 +5506,7 @@ "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.4.tgz", "integrity": "sha512-EJUDT7nDVFDvaQgAo2G/PJvxmp1o/c6iXLbswsBbUFXi1Nr+AjA2cKmfbKDMjMvzEe75g3P6JkaDDAKk96A85A==", "dev": true, + "license": "MIT", "dependencies": { "source-map": "~0.6.0" }, @@ -4780,6 +5519,7 @@ "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", "devOptional": true, + "license": "MIT", "engines": { "node": ">=6" } @@ -4789,6 +5529,7 @@ "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", "dev": true, + "license": "MIT", "dependencies": { "restore-cursor": "^3.1.0" }, @@ -4801,6 +5542,7 @@ "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.5.tgz", "integrity": "sha512-+W/5efTR7y5HRD7gACw9yQjqMVvEMLBHmboM/kPWam+H+Hmyrgjh6YncVKK122YZkXrLudzTuAukUw9FnMf7IQ==", "dev": true, + "license": "MIT", "dependencies": { "string-width": "^4.2.0" }, @@ -4816,6 +5558,7 @@ "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-2.1.0.tgz", "integrity": "sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==", "dev": true, + "license": "MIT", "dependencies": { "slice-ansi": "^3.0.0", "string-width": "^4.2.0" @@ -4832,6 +5575,7 @@ "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", "dev": true, + "license": "ISC", "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.1", @@ -4845,6 +5589,7 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", + "license": "MIT", "dependencies": { "is-plain-object": "^2.0.4", "kind-of": "^6.0.2", @@ -4859,6 +5604,7 @@ "resolved": "https://registry.npmjs.org/clone-regexp/-/clone-regexp-2.2.0.tgz", "integrity": "sha512-beMpP7BOtTipFuW8hrJvREQ2DrRu3BE7by0ZpibtfBA+qfHYvMGTc2Yb1JMYPKg/JUw0CHYvpg796aNTSW9z7Q==", "dev": true, + "license": "MIT", "dependencies": { "is-regexp": "^2.0.0" }, @@ -4870,6 +5616,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", "integrity": "sha512-lNkKvzEeMBBjUGHZ+q6z9pSJla0KWAQPvtzhEV9+iGyQYG+pBpl7xKDhxoNSOZH2hhv0v5k0y2yAM4o4SjoSkw==", + "license": "MIT", "dependencies": { "map-visit": "^1.0.0", "object-visit": "^1.0.0" @@ -4882,6 +5629,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "license": "MIT", "dependencies": { "color-name": "~1.1.4" }, @@ -4892,12 +5640,14 @@ "node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "license": "MIT" }, "node_modules/color-support": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "license": "ISC", "optional": true, "bin": { "color-support": "bin.js" @@ -4906,12 +5656,14 @@ "node_modules/colorette": { "version": "2.0.20", "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", - "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==" + "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", + "license": "MIT" }, "node_modules/colors": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz", "integrity": "sha512-ENwblkFQpqqia6b++zLD/KUWafYlVY/UNnAp7oz7LY7E924wmpye416wBOmvv/HMWzl8gL1kJlfvId/1Dg176w==", + "license": "MIT", "engines": { "node": ">=0.1.90" } @@ -4920,6 +5672,7 @@ "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "license": "MIT", "dependencies": { "delayed-stream": "~1.0.0" }, @@ -4932,6 +5685,7 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", "dev": true, + "license": "MIT", "engines": { "node": ">= 6" } @@ -4941,6 +5695,7 @@ "resolved": "https://registry.npmjs.org/common-tags/-/common-tags-1.8.2.tgz", "integrity": "sha512-gk/Z852D2Wtb//0I+kRFNKKE9dIIVirjoqPoA1wJU+XePVXZfGeBpk45+A1rKO4Q43prqWBNY/MiIeRLbPWUaA==", "dev": true, + "license": "MIT", "engines": { "node": ">=4.0.0" } @@ -4948,12 +5703,14 @@ "node_modules/commondir": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==" + "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", + "license": "MIT" }, "node_modules/component-emitter": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.1.tgz", "integrity": "sha512-T0+barUSQRTUQASh8bx02dl+DhF54GtIDY13Y3m9oWTklKbb3Wv974meRpeZ3lp1JpLVECWWNHC4vaG2XHXouQ==", + "license": "MIT", "funding": { "url": "https://github.com/sponsors/sindresorhus" } @@ -4961,13 +5718,15 @@ "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "license": "MIT" }, "node_modules/connect": { "version": "3.6.6", "resolved": "https://registry.npmjs.org/connect/-/connect-3.6.6.tgz", "integrity": "sha512-OO7axMmPpu/2XuX1+2Yrg0ddju31B6xLZMWkJ5rYBu4YRmRVlOjvlY6kw2FJKiAzyxGwnrDUAG4s1Pf0sbBMCQ==", "dev": true, + "license": "MIT", "dependencies": { "debug": "2.6.9", "finalhandler": "1.1.0", @@ -4983,6 +5742,7 @@ "resolved": "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-1.6.0.tgz", "integrity": "sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.8" } @@ -4992,6 +5752,7 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, + "license": "MIT", "dependencies": { "ms": "2.0.0" } @@ -5000,12 +5761,14 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/console-control-strings": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==", + "license": "ISC", "optional": true }, "node_modules/consolidate": { @@ -5014,6 +5777,7 @@ "integrity": "sha512-DW46nrsMJgy9kqAbPt5rKaCr7uFtpo4mSUvLHIUbJEjm0vo+aY5QLwBUq3FK4tRnJr/X0Psc0C4jf/h+HtXSMw==", "deprecated": "Please upgrade to consolidate v1.0.0+ as it has been modernized with several long-awaited fixes implemented. Maintenance is supported by Forward Email at https://forwardemail.net ; follow/watch https://github.com/ladjs/consolidate for updates and release changelog", "dev": true, + "license": "MIT", "dependencies": { "bluebird": "^3.1.1" }, @@ -5026,6 +5790,7 @@ "resolved": "https://registry.npmjs.org/constantinople/-/constantinople-4.0.1.tgz", "integrity": "sha512-vCrqcSIq4//Gx74TXXCGnHpulY1dskqLTFGDmhrGxzeXL8lF8kvXv6mpNWlJj1uD4DW23D4ljAqbY4RRaaUZIw==", "dev": true, + "license": "MIT", "dependencies": { "@babel/parser": "^7.6.0", "@babel/types": "^7.6.1" @@ -5036,6 +5801,7 @@ "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", "integrity": "sha512-OKZnPGeMQy2RPaUIBPFFd71iNf4791H12MCRuVQDnzGRwCYNYmTDy5pdafo2SLAcEMKzTOQnLWG4QdcjeJUMEg==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -5043,15 +5809,17 @@ "node_modules/convert-source-map": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", - "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==" + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "license": "MIT" }, "node_modules/cookie": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", - "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.0.2.tgz", + "integrity": "sha512-9Kr/j4O16ISv8zBBhJoi4bXOYNTkFLOqSL3UDB0njXxCXNezjeyVrJyGOWtgfs/q2km1gwBcfH8q1yEGoMYunA==", "dev": true, + "license": "MIT", "engines": { - "node": ">= 0.6" + "node": ">=18" } }, "node_modules/copy-anything": { @@ -5059,6 +5827,7 @@ "resolved": "https://registry.npmjs.org/copy-anything/-/copy-anything-2.0.6.tgz", "integrity": "sha512-1j20GZTsvKNkc4BY3NpMOM8tt///wY3FpIzozTOFO2ffuZcV61nojHXVKIy3WM+7ADCy5FVhdZYHYDdgTU0yJw==", "dev": true, + "license": "MIT", "optional": true, "dependencies": { "is-what": "^3.14.1" @@ -5071,6 +5840,7 @@ "version": "0.1.1", "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", "integrity": "sha512-XgZ0pFcakEUlbwQEVNg3+QAis1FyTL3Qel9FYy8pSkQqoG3PNoT0bOCQtOXcOkur21r2Eq2kI+IE+gsmAEVlYw==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -5080,14 +5850,16 @@ "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", "deprecated": "core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.", - "hasInstallScript": true + "hasInstallScript": true, + "license": "MIT" }, "node_modules/core-js-compat": { - "version": "3.38.1", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.38.1.tgz", - "integrity": "sha512-JRH6gfXxGmrzF3tZ57lFx97YARxCXPaMzPo6jELZhv88pBH5VXpQ+y0znKGlFnzuaihqhLbefxSJxWJMPtfDzw==", + "version": "3.40.0", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.40.0.tgz", + "integrity": "sha512-0XEDpr5y5mijvw8Lbc6E5AkjrHfp7eEoPlu36SWeAbcL8fn1G1ANe8DBlo2XoNN89oVpxWwOjYIPVzR4ZvsKCQ==", + "license": "MIT", "dependencies": { - "browserslist": "^4.23.3" + "browserslist": "^4.24.3" }, "funding": { "type": "opencollective", @@ -5098,13 +5870,15 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/cors": { "version": "2.8.5", "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", "dev": true, + "license": "MIT", "dependencies": { "object-assign": "^4", "vary": "^1" @@ -5118,6 +5892,7 @@ "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz", "integrity": "sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==", "dev": true, + "license": "MIT", "dependencies": { "@types/parse-json": "^4.0.0", "import-fresh": "^3.2.1", @@ -5134,6 +5909,7 @@ "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", "dev": true, + "license": "MIT", "dependencies": { "@babel/code-frame": "^7.0.0", "error-ex": "^1.3.1", @@ -5152,14 +5928,16 @@ "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "license": "MIT", "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -5174,6 +5952,7 @@ "resolved": "https://registry.npmjs.org/css/-/css-2.2.4.tgz", "integrity": "sha512-oUnjmWpy0niI3x/mPL8dVEI1l7MnG3+HHyRPHf+YFSbK+svOhXpmSOcDURUh2aOCgl2grzrOPt1nHLuCVFULLw==", "dev": true, + "license": "MIT", "optional": true, "dependencies": { "inherits": "^2.0.3", @@ -5187,6 +5966,7 @@ "resolved": "https://registry.npmjs.org/css-parse/-/css-parse-2.0.0.tgz", "integrity": "sha512-UNIFik2RgSbiTwIW1IsFwXWn6vs+bYdq83LKTSOsx7NJR7WII9dxewkHLltfTLVppoUApHV0118a4RZRI9FLwA==", "dev": true, + "license": "MIT", "optional": true, "dependencies": { "css": "^2.0.0" @@ -5197,6 +5977,7 @@ "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "boolbase": "^1.0.0", "css-what": "^6.1.0", @@ -5212,13 +5993,15 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/css-selector-parser/-/css-selector-parser-1.4.1.tgz", "integrity": "sha512-HYPSb7y/Z7BNDCOrakL4raGO2zltZkbeXyAd6Tg9obzix6QhzxCotdBl6VT0Dv4vZfJGVz3WL/xaEI9Ly3ul0g==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/css-selector-tokenizer": { "version": "0.7.3", "resolved": "https://registry.npmjs.org/css-selector-tokenizer/-/css-selector-tokenizer-0.7.3.tgz", "integrity": "sha512-jWQv3oCEL5kMErj4wRnK/OPoBi0D+P1FR2cDCKYPaMeD2eW3/mttav8HT4hT1CKopiJI/psEULjkClhvJo4Lvg==", "dev": true, + "license": "MIT", "dependencies": { "cssesc": "^3.0.0", "fastparse": "^1.1.2" @@ -5229,6 +6012,7 @@ "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==", "dev": true, + "license": "BSD-2-Clause", "engines": { "node": ">= 6" }, @@ -5241,6 +6025,7 @@ "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", "dev": true, + "license": "MIT", "bin": { "cssesc": "bin/cssesc" }, @@ -5254,6 +6039,7 @@ "integrity": "sha512-lsiQrN17vHMB2fnvxIrKLAjOr9bPwsNbPZNrWf99s4u+DVmCY6U+w7O3GGG9FvP4EUVYaDu+guWeNLiUzBrqvA==", "dev": true, "hasInstallScript": true, + "license": "MIT", "dependencies": { "@cypress/request": "^3.0.1", "@cypress/xvfb": "^1.2.4", @@ -5310,6 +6096,7 @@ "resolved": "https://registry.npmjs.org/cypress-file-upload/-/cypress-file-upload-5.0.8.tgz", "integrity": "sha512-+8VzNabRk3zG6x8f8BWArF/xA/W0VK4IZNx3MV0jFWrJS/qKn8eHfa5nU73P9fOQAgwHFJx7zjg4lwOnljMO8g==", "dev": true, + "license": "MIT", "engines": { "node": ">=8.2.1" }, @@ -5321,7 +6108,8 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/cypress-pipe/-/cypress-pipe-2.0.0.tgz", "integrity": "sha512-KW9s+bz4tFLucH3rBGfjW+Q12n7S4QpUSSyxiGrgPOfoHlbYWzAGB3H26MO0VTojqf9NVvfd5Kt0MH5XMgbfyg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/cypress/node_modules/buffer": { "version": "5.7.1", @@ -5342,6 +6130,7 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" @@ -5352,6 +6141,7 @@ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", "dev": true, + "license": "MIT", "dependencies": { "at-least-node": "^1.0.0", "graceful-fs": "^4.2.0", @@ -5367,6 +6157,7 @@ "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", "dev": true, + "license": "MIT", "dependencies": { "universalify": "^2.0.0" }, @@ -5379,6 +6170,7 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "dev": true, + "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -5391,6 +6183,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -5406,6 +6199,7 @@ "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", "dev": true, + "license": "MIT", "engines": { "node": ">= 10.0.0" } @@ -5415,6 +6209,7 @@ "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", "dev": true, + "license": "MIT", "dependencies": { "assert-plus": "^1.0.0" }, @@ -5423,14 +6218,15 @@ } }, "node_modules/data-view-buffer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", - "integrity": "sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz", + "integrity": "sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.6", + "call-bound": "^1.0.3", "es-errors": "^1.3.0", - "is-data-view": "^1.0.1" + "is-data-view": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -5440,29 +6236,31 @@ } }, "node_modules/data-view-byte-length": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz", - "integrity": "sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.2.tgz", + "integrity": "sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", + "call-bound": "^1.0.3", "es-errors": "^1.3.0", - "is-data-view": "^1.0.1" + "is-data-view": "^1.0.2" }, "engines": { "node": ">= 0.4" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/inspect-js" } }, "node_modules/data-view-byte-offset": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz", - "integrity": "sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.1.tgz", + "integrity": "sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.6", + "call-bound": "^1.0.2", "es-errors": "^1.3.0", "is-data-view": "^1.0.1" }, @@ -5477,6 +6275,7 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", "integrity": "sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==", + "license": "MIT", "engines": { "node": "*" } @@ -5485,20 +6284,23 @@ "version": "1.11.13", "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.13.tgz", "integrity": "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/de-indent": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/de-indent/-/de-indent-1.0.2.tgz", "integrity": "sha512-e/1zu3xH5MQryN2zdVaF0OrdNLUbvWxzMbi+iNA6Bky7l1RoP8a2fIbRocyHclXt/arDrrR6lL3TqFD9pMQTsg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/debug": { - "version": "4.3.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", - "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "license": "MIT", "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -5514,6 +6316,7 @@ "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -5523,6 +6326,7 @@ "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.1.tgz", "integrity": "sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==", "dev": true, + "license": "MIT", "dependencies": { "decamelize": "^1.1.0", "map-obj": "^1.0.0" @@ -5539,6 +6343,7 @@ "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", "integrity": "sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -5547,6 +6352,7 @@ "version": "0.2.2", "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz", "integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==", + "license": "MIT", "engines": { "node": ">=0.10" } @@ -5555,6 +6361,7 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "license": "MIT", "dependencies": { "mimic-response": "^3.1.0" }, @@ -5569,6 +6376,7 @@ "version": "0.6.0", "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "license": "MIT", "engines": { "node": ">=4.0.0" } @@ -5576,13 +6384,15 @@ "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==" + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "license": "MIT" }, "node_modules/define-data-property": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", "dev": true, + "license": "MIT", "dependencies": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", @@ -5600,6 +6410,7 @@ "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", "dev": true, + "license": "MIT", "dependencies": { "define-data-property": "^1.0.1", "has-property-descriptors": "^1.0.0", @@ -5616,6 +6427,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "license": "MIT", "dependencies": { "is-descriptor": "^1.0.2", "isobject": "^3.0.1" @@ -5628,6 +6440,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "license": "MIT", "engines": { "node": ">=0.4.0" } @@ -5636,6 +6449,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", + "license": "MIT", "optional": true }, "node_modules/depd": { @@ -5643,6 +6457,7 @@ "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.8" } @@ -5651,12 +6466,14 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", "integrity": "sha512-3NdhDuEXnfun/z7x9GOElY49LoqVHoGScmOKwmxhsS8N5Y+Z8KyPPDnaSzqWgYt/ji4mqwfTS34Htrk0zPIXVg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/detect-file": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", "integrity": "sha512-DtCOLG98P007x7wiiOmfI0fi3eIKyWiLTGJ2MDnVi/E04lWGbf+JzrRHMm0rgIIZJGtHpKpbVgLWHrv8xXpc3Q==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -5665,6 +6482,7 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz", "integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==", + "license": "Apache-2.0", "engines": { "node": ">=8" } @@ -5686,6 +6504,7 @@ "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.3.1" } @@ -5695,6 +6514,7 @@ "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", "dev": true, + "license": "MIT", "dependencies": { "path-type": "^4.0.0" }, @@ -5707,6 +6527,7 @@ "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -5715,12 +6536,14 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz", "integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "license": "Apache-2.0", "dependencies": { "esutils": "^2.0.2" }, @@ -5732,13 +6555,15 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/doctypes/-/doctypes-1.1.0.tgz", "integrity": "sha512-LLBi6pEqS6Do3EKQ3J0NqHWV5hhb78Pi8vvESYwyOy2c31ZEZVdtitdzsQsKb7878PEERhzUk0ftqGhG6Mz+pQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/dom-serializer": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", "dev": true, + "license": "MIT", "dependencies": { "domelementtype": "^2.3.0", "domhandler": "^5.0.2", @@ -5758,13 +6583,15 @@ "type": "github", "url": "https://github.com/sponsors/fb55" } - ] + ], + "license": "BSD-2-Clause" }, "node_modules/domhandler": { "version": "5.0.3", "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "domelementtype": "^2.3.0" }, @@ -5778,13 +6605,15 @@ "node_modules/dompurify": { "version": "2.2.7", "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.2.7.tgz", - "integrity": "sha512-jdtDffdGNY+C76jvodNTu9jt5yYj59vuTUyx+wXdzcSwAGTYZDAQkQ7Iwx9zcGrA4ixC1syU4H3RZROqRxokxg==" + "integrity": "sha512-jdtDffdGNY+C76jvodNTu9jt5yYj59vuTUyx+wXdzcSwAGTYZDAQkQ7Iwx9zcGrA4ixC1syU4H3RZROqRxokxg==", + "license": "(MPL-2.0 OR Apache-2.0)" }, "node_modules/domutils": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", - "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.2.2.tgz", + "integrity": "sha512-6kZKyUajlDuqlHKVX1w7gyslj9MPIXzIFiz/rGu35uC1wMi+kMhQwGhl4lt9unC9Vb9INnY9Z3/ZA3+FhASLaw==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "dom-serializer": "^2.0.0", "domelementtype": "^2.3.0", @@ -5794,6 +6623,21 @@ "url": "https://github.com/fb55/domutils?sponsor=1" } }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/easy-extender": { "version": "2.3.4", "resolved": "https://registry.npmjs.org/easy-extender/-/easy-extender-2.3.4.tgz", @@ -5823,6 +6667,7 @@ "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", "dev": true, + "license": "MIT", "dependencies": { "jsbn": "~0.1.0", "safer-buffer": "^2.1.0" @@ -5832,23 +6677,27 @@ "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.5.13", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.13.tgz", - "integrity": "sha512-lbBcvtIJ4J6sS4tb5TLp1b4LyfCdMkwStzXPyAgVgTRAsep4bvrAGaBOP7ZJtQMNJpSQ9SqG4brWOroNaQtm7Q==" + "version": "1.5.88", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.88.tgz", + "integrity": "sha512-K3C2qf1o+bGzbilTDCTBhTQcMS9KW60yTAaTeeXsfvQuTDDwlokLam/AdqlqcSy9u4UainDgsHV23ksXAOgamw==", + "license": "ISC" }, "node_modules/emoji-mart-vue-fast": { "version": "7.0.7", "resolved": "https://registry.npmjs.org/emoji-mart-vue-fast/-/emoji-mart-vue-fast-7.0.7.tgz", "integrity": "sha512-Nrk4IOjKcKKYyMnRm4lreEiPpvDX+h3FKI86SYs05dCFZ0WZIMTGok26dtWvJqseTThS1UghsNEjM4HrfDjIJg==", + "license": "BSD-3-Clause", "dependencies": { "@babel/polyfill": "7.2.5", "@babel/runtime": "7.3.4", @@ -5862,6 +6711,7 @@ "version": "7.3.4", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.3.4.tgz", "integrity": "sha512-IvfvnMdSaLBateu0jfsYIpZTxAc2cKEXEMiezGGN75QcBcecDUKd3PgLAncT0oOgxKy8dd8hrJKj9MfzgfZd6g==", + "license": "MIT", "dependencies": { "regenerator-runtime": "^0.12.0" } @@ -5869,18 +6719,21 @@ "node_modules/emoji-mart-vue-fast/node_modules/regenerator-runtime": { "version": "0.12.1", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz", - "integrity": "sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg==" + "integrity": "sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg==", + "license": "MIT" }, "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT" }, "node_modules/emojis-list": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", "integrity": "sha512-knHEZMgs8BB+MInokmNTg/OyPlAddghe1YBgNwJBc5zsJi/uyIcXoSDsL/W9ymOsBoBGdPIHXYJ9+qKFwRwDng==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.10" } @@ -5890,6 +6743,7 @@ "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.8" } @@ -5898,6 +6752,7 @@ "version": "0.1.13", "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", + "license": "MIT", "optional": true, "dependencies": { "iconv-lite": "^0.6.2" @@ -5908,6 +6763,7 @@ "resolved": "https://registry.npmjs.org/encoding-sniffer/-/encoding-sniffer-0.2.0.tgz", "integrity": "sha512-ju7Wq1kg04I3HtiYIOrUrdfdDvkyO9s5XM8QAj/bN61Yo/Vb4vgJxy5vi4Yxk01gWHbrofpPtpxM8bKger9jhg==", "dev": true, + "license": "MIT", "dependencies": { "iconv-lite": "^0.6.3", "whatwg-encoding": "^3.1.1" @@ -5921,6 +6777,7 @@ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", "dev": true, + "license": "MIT", "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" }, @@ -5932,6 +6789,7 @@ "version": "0.6.3", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "license": "MIT", "optional": true, "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" @@ -5944,22 +6802,23 @@ "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "license": "MIT", "dependencies": { "once": "^1.4.0" } }, "node_modules/engine.io": { - "version": "6.5.5", - "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.5.5.tgz", - "integrity": "sha512-C5Pn8Wk+1vKBoHghJODM63yk8MvrO9EWZUfkAt5HAqIgPE4/8FF0PEGHXtEd40l223+cE5ABWuPzm38PHFXfMA==", + "version": "6.6.3", + "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.6.3.tgz", + "integrity": "sha512-2hkLItQMBkoYSagneiisupWGvsQlWXqzhSMvsjaM8GYbnfUsX7tzYQq9QARnate5LRedVTX+MbkSZAANAr3NtQ==", "dev": true, + "license": "MIT", "dependencies": { - "@types/cookie": "^0.4.1", "@types/cors": "^2.8.12", "@types/node": ">=10.0.0", "accepts": "~1.3.4", "base64id": "2.0.0", - "cookie": "~0.4.1", + "cookie": "~1.0.2", "cors": "~2.8.5", "debug": "~4.3.1", "engine.io-parser": "~5.2.1", @@ -5970,16 +6829,35 @@ } }, "node_modules/engine.io-client": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-6.5.4.tgz", - "integrity": "sha512-GeZeeRjpD2qf49cZQ0Wvh/8NJNfeXkXXcoGh+F77oEAgo9gUHwT1fCRxSNU+YEEaysOJTnsFHmM5oAcPy4ntvQ==", + "version": "6.6.3", + "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-6.6.3.tgz", + "integrity": "sha512-T0iLjnyNWahNyv/lcjS2y4oE358tVS/SYQNxYXGAJ9/GLgH4VCvOQ/mhTjqU88mLZCQgiG8RIegFHYCdVC+j5w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@socket.io/component-emitter": "~3.1.0", + "debug": "~4.3.1", + "engine.io-parser": "~5.2.1", + "ws": "~8.17.1", + "xmlhttprequest-ssl": "~2.1.1" + } + }, + "node_modules/engine.io-client/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", "dev": true, + "license": "MIT", "dependencies": { - "@socket.io/component-emitter": "~3.1.0", - "debug": "~4.3.1", - "engine.io-parser": "~5.2.1", - "ws": "~8.17.1", - "xmlhttprequest-ssl": "~2.0.0" + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, "node_modules/engine.io-client/node_modules/ws": { @@ -5987,6 +6865,7 @@ "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=10.0.0" }, @@ -6008,15 +6887,35 @@ "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.2.3.tgz", "integrity": "sha512-HqD3yTBfnBxIrbnM1DoD6Pcq8NECnh8d4As1Qgh0z5Gg3jRRIqijury0CL3ghu/edArpUYiYqQiDUQBIs4np3Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=10.0.0" } }, + "node_modules/engine.io/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, "node_modules/engine.io/node_modules/ws": { "version": "8.17.1", "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=10.0.0" }, @@ -6034,10 +6933,11 @@ } }, "node_modules/enhanced-resolve": { - "version": "5.17.1", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz", - "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==", + "version": "5.18.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.0.tgz", + "integrity": "sha512-0/r0MySGYG8YqlayBZ6MuCfECmHFdJ5qyPh8s8wa5Hnm6SaFLSK1VYCbj+NKp090Nm1caZhD+QTnmxO7esYGyQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "graceful-fs": "^4.2.4", @@ -6051,6 +6951,7 @@ "version": "2.4.1", "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.4.1.tgz", "integrity": "sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==", + "license": "MIT", "dependencies": { "ansi-colors": "^4.1.1", "strip-ansi": "^6.0.1" @@ -6064,6 +6965,7 @@ "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", "dev": true, + "license": "BSD-2-Clause", "engines": { "node": ">=0.12" }, @@ -6075,6 +6977,7 @@ "version": "2.2.1", "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "license": "MIT", "optional": true, "engines": { "node": ">=6" @@ -6084,6 +6987,7 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==", + "license": "MIT", "optional": true }, "node_modules/errno": { @@ -6091,6 +6995,7 @@ "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz", "integrity": "sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==", "dev": true, + "license": "MIT", "optional": true, "dependencies": { "prr": "~1.0.1" @@ -6104,62 +7009,69 @@ "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", "dev": true, + "license": "MIT", "dependencies": { "is-arrayish": "^0.2.1" } }, "node_modules/es-abstract": { - "version": "1.23.3", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.3.tgz", - "integrity": "sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==", + "version": "1.23.9", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.9.tgz", + "integrity": "sha512-py07lI0wjxAC/DcfK1S6G7iANonniZwTISvdPzk9hzeH0IZIshbuuFxLIU96OyF89Yb9hiqWn8M/bY83KY5vzA==", "dev": true, + "license": "MIT", "dependencies": { - "array-buffer-byte-length": "^1.0.1", - "arraybuffer.prototype.slice": "^1.0.3", + "array-buffer-byte-length": "^1.0.2", + "arraybuffer.prototype.slice": "^1.0.4", "available-typed-arrays": "^1.0.7", - "call-bind": "^1.0.7", - "data-view-buffer": "^1.0.1", - "data-view-byte-length": "^1.0.1", - "data-view-byte-offset": "^1.0.0", - "es-define-property": "^1.0.0", + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "data-view-buffer": "^1.0.2", + "data-view-byte-length": "^1.0.2", + "data-view-byte-offset": "^1.0.1", + "es-define-property": "^1.0.1", "es-errors": "^1.3.0", "es-object-atoms": "^1.0.0", - "es-set-tostringtag": "^2.0.3", - "es-to-primitive": "^1.2.1", - "function.prototype.name": "^1.1.6", - "get-intrinsic": "^1.2.4", - "get-symbol-description": "^1.0.2", - "globalthis": "^1.0.3", - "gopd": "^1.0.1", + "es-set-tostringtag": "^2.1.0", + "es-to-primitive": "^1.3.0", + "function.prototype.name": "^1.1.8", + "get-intrinsic": "^1.2.7", + "get-proto": "^1.0.0", + "get-symbol-description": "^1.1.0", + "globalthis": "^1.0.4", + "gopd": "^1.2.0", "has-property-descriptors": "^1.0.2", - "has-proto": "^1.0.3", - "has-symbols": "^1.0.3", + "has-proto": "^1.2.0", + "has-symbols": "^1.1.0", "hasown": "^2.0.2", - "internal-slot": "^1.0.7", - "is-array-buffer": "^3.0.4", + "internal-slot": "^1.1.0", + "is-array-buffer": "^3.0.5", "is-callable": "^1.2.7", - "is-data-view": "^1.0.1", - "is-negative-zero": "^2.0.3", - "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.3", - "is-string": "^1.0.7", - "is-typed-array": "^1.1.13", - "is-weakref": "^1.0.2", - "object-inspect": "^1.13.1", + "is-data-view": "^1.0.2", + "is-regex": "^1.2.1", + "is-shared-array-buffer": "^1.0.4", + "is-string": "^1.1.1", + "is-typed-array": "^1.1.15", + "is-weakref": "^1.1.0", + "math-intrinsics": "^1.1.0", + "object-inspect": "^1.13.3", "object-keys": "^1.1.1", - "object.assign": "^4.1.5", - "regexp.prototype.flags": "^1.5.2", - "safe-array-concat": "^1.1.2", - "safe-regex-test": "^1.0.3", - "string.prototype.trim": "^1.2.9", - "string.prototype.trimend": "^1.0.8", + "object.assign": "^4.1.7", + "own-keys": "^1.0.1", + "regexp.prototype.flags": "^1.5.3", + "safe-array-concat": "^1.1.3", + "safe-push-apply": "^1.0.0", + "safe-regex-test": "^1.1.0", + "set-proto": "^1.0.0", + "string.prototype.trim": "^1.2.10", + "string.prototype.trimend": "^1.0.9", "string.prototype.trimstart": "^1.0.8", - "typed-array-buffer": "^1.0.2", - "typed-array-byte-length": "^1.0.1", - "typed-array-byte-offset": "^1.0.2", - "typed-array-length": "^1.0.6", - "unbox-primitive": "^1.0.2", - "which-typed-array": "^1.1.15" + "typed-array-buffer": "^1.0.3", + "typed-array-byte-length": "^1.0.3", + "typed-array-byte-offset": "^1.0.4", + "typed-array-length": "^1.0.7", + "unbox-primitive": "^1.1.0", + "which-typed-array": "^1.1.18" }, "engines": { "node": ">= 0.4" @@ -6169,13 +7081,11 @@ } }, "node_modules/es-define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", - "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", "dev": true, - "dependencies": { - "get-intrinsic": "^1.2.4" - }, + "license": "MIT", "engines": { "node": ">= 0.4" } @@ -6185,22 +7095,25 @@ "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" } }, "node_modules/es-module-lexer": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.4.tgz", - "integrity": "sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.6.0.tgz", + "integrity": "sha512-qqnD1yMU6tk/jnaMosogGySTZP8YtUgAffA9nMN+E/rjxcfRQ6IEk7IiozUjgxKoFHBGjTLnrHB/YC45r/59EQ==", "dev": true, + "license": "MIT", "peer": true }, "node_modules/es-object-atoms": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", - "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", "dev": true, + "license": "MIT", "dependencies": { "es-errors": "^1.3.0" }, @@ -6209,14 +7122,16 @@ } }, "node_modules/es-set-tostringtag": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz", - "integrity": "sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", "dev": true, + "license": "MIT", "dependencies": { - "get-intrinsic": "^1.2.4", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", "has-tostringtag": "^1.0.2", - "hasown": "^2.0.1" + "hasown": "^2.0.2" }, "engines": { "node": ">= 0.4" @@ -6227,19 +7142,21 @@ "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.2.tgz", "integrity": "sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==", "dev": true, + "license": "MIT", "dependencies": { "hasown": "^2.0.0" } }, "node_modules/es-to-primitive": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", - "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.3.0.tgz", + "integrity": "sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==", "dev": true, + "license": "MIT", "dependencies": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" + "is-callable": "^1.2.7", + "is-date-object": "^1.0.5", + "is-symbol": "^1.0.4" }, "engines": { "node": ">= 0.4" @@ -6254,6 +7171,7 @@ "integrity": "sha512-wI4ZiIfFxpkuxB8ju4MHrGwGLyp1+awEHAHVpx6w7a+1pmYIq8T9FGEVVwFo0iFierDoMj++Xq69GXWYn2EiwA==", "dev": true, "hasInstallScript": true, + "license": "MIT", "bin": { "esbuild": "bin/esbuild" }, @@ -6283,17 +7201,273 @@ "esbuild-windows-arm64": "0.14.47" } }, + "node_modules/esbuild-android-64": { + "version": "0.14.47", + "resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.14.47.tgz", + "integrity": "sha512-R13Bd9+tqLVFndncMHssZrPWe6/0Kpv2/dt4aA69soX4PRxlzsVpCvoJeFE8sOEoeVEiBkI0myjlkDodXlHa0g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-android-arm64": { + "version": "0.14.47", + "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.14.47.tgz", + "integrity": "sha512-OkwOjj7ts4lBp/TL6hdd8HftIzOy/pdtbrNA4+0oVWgGG64HrdVzAF5gxtJufAPOsEjkyh1oIYvKAUinKKQRSQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-darwin-64": { + "version": "0.14.47", + "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.14.47.tgz", + "integrity": "sha512-R6oaW0y5/u6Eccti/TS6c/2c1xYTb1izwK3gajJwi4vIfNs1s8B1dQzI1UiC9T61YovOQVuePDcfqHLT3mUZJA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/esbuild-darwin-arm64": { "version": "0.14.47", - "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.47.tgz", - "integrity": "sha512-seCmearlQyvdvM/noz1L9+qblC5vcBrhUaOoLEDDoLInF/VQ9IkobGiLlyTPYP5dW1YD4LXhtBgOyevoIHGGnw==", + "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.47.tgz", + "integrity": "sha512-seCmearlQyvdvM/noz1L9+qblC5vcBrhUaOoLEDDoLInF/VQ9IkobGiLlyTPYP5dW1YD4LXhtBgOyevoIHGGnw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-freebsd-64": { + "version": "0.14.47", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.47.tgz", + "integrity": "sha512-ZH8K2Q8/Ux5kXXvQMDsJcxvkIwut69KVrYQhza/ptkW50DC089bCVrJZZ3sKzIoOx+YPTrmsZvqeZERjyYrlvQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-freebsd-arm64": { + "version": "0.14.47", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.47.tgz", + "integrity": "sha512-ZJMQAJQsIOhn3XTm7MPQfCzEu5b9STNC+s90zMWe2afy9EwnHV7Ov7ohEMv2lyWlc2pjqLW8QJnz2r0KZmeAEQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-32": { + "version": "0.14.47", + "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.14.47.tgz", + "integrity": "sha512-FxZOCKoEDPRYvq300lsWCTv1kcHgiiZfNrPtEhFAiqD7QZaXrad8LxyJ8fXGcWzIFzRiYZVtB3ttvITBvAFhKw==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-64": { + "version": "0.14.47", + "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.14.47.tgz", + "integrity": "sha512-nFNOk9vWVfvWYF9YNYksZptgQAdstnDCMtR6m42l5Wfugbzu11VpMCY9XrD4yFxvPo9zmzcoUL/88y0lfJZJJw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-arm": { + "version": "0.14.47", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.14.47.tgz", + "integrity": "sha512-ZGE1Bqg/gPRXrBpgpvH81tQHpiaGxa8c9Rx/XOylkIl2ypLuOcawXEAo8ls+5DFCcRGt/o3sV+PzpAFZobOsmA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-arm64": { + "version": "0.14.47", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.47.tgz", + "integrity": "sha512-ywfme6HVrhWcevzmsufjd4iT3PxTfCX9HOdxA7Hd+/ZM23Y9nXeb+vG6AyA6jgq/JovkcqRHcL9XwRNpWG6XRw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-mips64le": { + "version": "0.14.47", + "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.47.tgz", + "integrity": "sha512-mg3D8YndZ1LvUiEdDYR3OsmeyAew4MA/dvaEJxvyygahWmpv1SlEEnhEZlhPokjsUMfRagzsEF/d/2XF+kTQGg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-ppc64le": { + "version": "0.14.47", + "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.47.tgz", + "integrity": "sha512-WER+f3+szmnZiWoK6AsrTKGoJoErG2LlauSmk73LEZFQ/iWC+KhhDsOkn1xBUpzXWsxN9THmQFltLoaFEH8F8w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-riscv64": { + "version": "0.14.47", + "resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.14.47.tgz", + "integrity": "sha512-1fI6bP3A3rvI9BsaaXbMoaOjLE3lVkJtLxsgLHqlBhLlBVY7UqffWBvkrX/9zfPhhVMd9ZRFiaqXnB1T7BsL2g==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-s390x": { + "version": "0.14.47", + "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.47.tgz", + "integrity": "sha512-eZrWzy0xFAhki1CWRGnhsHVz7IlSKX6yT2tj2Eg8lhAwlRE5E96Hsb0M1mPSE1dHGpt1QVwwVivXIAacF/G6mw==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-netbsd-64": { + "version": "0.14.47", + "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.47.tgz", + "integrity": "sha512-Qjdjr+KQQVH5Q2Q1r6HBYswFTToPpss3gqCiSw2Fpq/ua8+eXSQyAMG+UvULPqXceOwpnPo4smyZyHdlkcPppQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-openbsd-64": { + "version": "0.14.47", + "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.47.tgz", + "integrity": "sha512-QpgN8ofL7B9z8g5zZqJE+eFvD1LehRlxr25PBkjyyasakm4599iroUpaj96rdqRlO2ShuyqwJdr+oNqWwTUmQw==", "cpu": [ - "arm64" + "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ - "darwin" + "openbsd" ], "engines": { "node": ">=12" @@ -6304,25 +7478,58 @@ "resolved": "https://registry.npmjs.org/esbuild-sass-plugin/-/esbuild-sass-plugin-2.2.6.tgz", "integrity": "sha512-WVREJhOS6UlZNoS2FhkOA5980VVKjS6ocUK7YFghJt/94rWDNXxPI+XfkOKlSMbJF/n5wAotr37P8/9KhgkgPQ==", "dev": true, + "license": "MIT", "dependencies": { "esbuild": "^0.14.13", "sass": "^1.49.0" } }, + "node_modules/esbuild-sass-plugin/node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/esbuild-sass-plugin/node_modules/immutable": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.7.tgz", - "integrity": "sha512-1hqclzwYwjRDFLjcFxOM5AYkkG0rpFPpr1RLPMEuGczoS7YA8gLhy8SWXYRAA/XwfEHpfo3cw5JGioS32fnMRw==", - "dev": true + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-5.0.3.tgz", + "integrity": "sha512-P8IdPQHq3lA1xVeBRi5VPqUm5HDgKnx0Ru51wZz5mjxHr5n3RWhjIpOFU7ybkUxfB+5IToy+OLaHYDBIWsv+uw==", + "dev": true, + "license": "MIT" + }, + "node_modules/esbuild-sass-plugin/node_modules/readdirp": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.1.tgz", + "integrity": "sha512-h80JrZu/MHUZCyHu5ciuoI0+WxsCxzxJTILn6Fs8rxSnFPh+UVHYfeIxK1nVGugMqkfC4vJcBOYbkfkwYK0+gw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } }, "node_modules/esbuild-sass-plugin/node_modules/sass": { - "version": "1.77.8", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.77.8.tgz", - "integrity": "sha512-4UHg6prsrycW20fqLGPShtEvo/WyHRVRHwOP4DzkUrObWoWI05QBSfzU71TVB7PFaL104TwNaHpjlWXAZbQiNQ==", + "version": "1.83.4", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.83.4.tgz", + "integrity": "sha512-B1bozCeNQiOgDcLd33e2Cs2U60wZwjUUXzh900ZyQF5qUasvMdDZYbQ566LJu7cqR+sAHlAfO6RMkaID5s6qpA==", "dev": true, + "license": "MIT", "dependencies": { - "chokidar": ">=3.0.0 <4.0.0", - "immutable": "^4.0.0", + "chokidar": "^4.0.0", + "immutable": "^5.0.2", "source-map-js": ">=0.6.2 <2.0.0" }, "bin": { @@ -6330,12 +7537,84 @@ }, "engines": { "node": ">=14.0.0" + }, + "optionalDependencies": { + "@parcel/watcher": "^2.4.1" + } + }, + "node_modules/esbuild-sunos-64": { + "version": "0.14.47", + "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.14.47.tgz", + "integrity": "sha512-uOeSgLUwukLioAJOiGYm3kNl+1wJjgJA8R671GYgcPgCx7QR73zfvYqXFFcIO93/nBdIbt5hd8RItqbbf3HtAQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-windows-32": { + "version": "0.14.47", + "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.14.47.tgz", + "integrity": "sha512-H0fWsLTp2WBfKLBgwYT4OTfFly4Im/8B5f3ojDv1Kx//kiubVY0IQunP2Koc/fr/0wI7hj3IiBDbSrmKlrNgLQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-windows-64": { + "version": "0.14.47", + "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.14.47.tgz", + "integrity": "sha512-/Pk5jIEH34T68r8PweKRi77W49KwanZ8X6lr3vDAtOlH5EumPE4pBHqkCUdELanvsT14yMXLQ/C/8XPi1pAtkQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-windows-arm64": { + "version": "0.14.47", + "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.47.tgz", + "integrity": "sha512-HFSW2lnp62fl86/qPQlqw6asIwCnEsEoNIL1h2uVMgakddf+vUuMcCbtUY1i8sst7KkgHrVKCJQB33YhhOweCQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" } }, "node_modules/escalade": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", - "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "license": "MIT", "engines": { "node": ">=6" } @@ -6344,12 +7623,14 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "license": "MIT", "engines": { "node": ">=10" }, @@ -6361,6 +7642,8 @@ "version": "7.32.0", "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.32.0.tgz", "integrity": "sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==", + "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", + "license": "MIT", "dependencies": { "@babel/code-frame": "7.12.11", "@eslint/eslintrc": "^0.4.3", @@ -6432,6 +7715,7 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "peerDependencies": { "eslint": "^7.12.1", "eslint-plugin-import": "^2.22.1", @@ -6444,6 +7728,7 @@ "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", "dev": true, + "license": "MIT", "dependencies": { "debug": "^3.2.7", "is-core-module": "^2.13.0", @@ -6455,15 +7740,17 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, + "license": "MIT", "dependencies": { "ms": "^2.1.1" } }, "node_modules/eslint-module-utils": { - "version": "2.8.2", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.2.tgz", - "integrity": "sha512-3XnC5fDyc8M4J2E8pt8pmSVRX2M+5yWMCfI/kDZwauQeFgzQOuhcRBFKjTeJagqgk4sFKxe1mvNVnaWwImx/Tg==", + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.12.0.tgz", + "integrity": "sha512-wALZ0HFoytlyh/1+4wuZ9FJCD/leWHQzzrxJ8+rebyReSLk7LApMyd3WJaLVoN+D5+WIdJyDK1c6JnE65V4Zyg==", "dev": true, + "license": "MIT", "dependencies": { "debug": "^3.2.7" }, @@ -6481,6 +7768,7 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, + "license": "MIT", "dependencies": { "ms": "^2.1.1" } @@ -6490,6 +7778,7 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-cypress/-/eslint-plugin-cypress-2.11.3.tgz", "integrity": "sha512-hOoAid+XNFtpvOzZSNWP5LDrQBEJwbZwjib4XJ1KcRYKjeVj0mAmPmucG4Egli4j/aruv+Ow/acacoloWWCl9Q==", "dev": true, + "license": "MIT", "dependencies": { "globals": "^11.12.0" }, @@ -6502,6 +7791,7 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-3.0.1.tgz", "integrity": "sha512-GUmAsJaN4Fc7Gbtl8uOBlayo2DqhwWvEzykMHSCZHU3XdJ+NSzzZcVhXh3VxX5icqQ+oQdIEawXX8xkR3mIFmQ==", "dev": true, + "license": "MIT", "dependencies": { "eslint-utils": "^2.0.0", "regexpp": "^3.0.0" @@ -6521,6 +7811,7 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-flowtype/-/eslint-plugin-flowtype-5.7.2.tgz", "integrity": "sha512-7Oq/N0+3nijBnYWQYzz/Mp/7ZCpwxYvClRyW/PLAmimY9uLCBvoXsNsERcJdkKceyOjgRbFhhxs058KTrne9Mg==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "lodash": "^4.17.15", "string-natural-compare": "^3.0.1" @@ -6537,6 +7828,7 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-flowtype-errors/-/eslint-plugin-flowtype-errors-4.4.0.tgz", "integrity": "sha512-vlDxFUaAWRtI1Koc2YOWLTdORV5dmvqChkKyySE6b5VXxiWH7C0Ax7RJ4s3yRdt8TOk968OU7jEwRKL2l8aTIQ==", "dev": true, + "license": "MIT", "dependencies": { "@babel/runtime": "^7.12.5", "core-js": "3.8.1", @@ -6559,6 +7851,7 @@ "deprecated": "core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.", "dev": true, "hasInstallScript": true, + "license": "MIT", "funding": { "type": "opencollective", "url": "https://opencollective.com/core-js" @@ -6569,6 +7862,7 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.22.1.tgz", "integrity": "sha512-8K7JjINHOpH64ozkAhpT3sd+FswIZTfMZTjdx052pnWrgRCVfp8op9tbjpAk3DdUeI/Ba4C8OjdC0r90erHEOw==", "dev": true, + "license": "MIT", "dependencies": { "array-includes": "^3.1.1", "array.prototype.flat": "^1.2.3", @@ -6596,6 +7890,7 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, + "license": "MIT", "dependencies": { "ms": "2.0.0" } @@ -6617,19 +7912,22 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/eslint-plugin-import/node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/eslint-plugin-node": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-11.1.0.tgz", "integrity": "sha512-oUwtPJ1W0SKD0Tr+wqu92c5xuCeQqB3hSCHasn/ZgjFdA9iDGNkNf2Zi9ztY7X+hNuMib23LNGRm6+uN+KLE3g==", "dev": true, + "license": "MIT", "dependencies": { "eslint-plugin-es": "^3.0.0", "eslint-utils": "^2.0.0", @@ -6650,6 +7948,7 @@ "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", "dev": true, + "license": "MIT", "engines": { "node": ">= 4" } @@ -6659,6 +7958,7 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-4.2.1.tgz", "integrity": "sha512-VoM09vT7bfA7D+upt+FjeBO5eHIJQBUWki1aPvB+vbNiHS3+oGIJGIeyBtKQTME6UPXXy3vV07OL1tHd3ANuDw==", "dev": true, + "license": "ISC", "engines": { "node": ">=6" } @@ -6668,6 +7968,7 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-7.20.0.tgz", "integrity": "sha512-oVNDqzBC9h3GO+NTgWeLMhhGigy6/bQaQbHS+0z7C4YEu/qK/yxHvca/2PTZtGNPsCrHwOTgKMrwu02A9iPBmw==", "dev": true, + "license": "MIT", "dependencies": { "eslint-utils": "^2.1.0", "natural-compare": "^1.4.0", @@ -6685,6 +7986,7 @@ "version": "5.1.1", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "license": "BSD-2-Clause", "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^4.1.1" @@ -6697,6 +7999,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "license": "MIT", "dependencies": { "eslint-visitor-keys": "^1.1.0" }, @@ -6711,6 +8014,7 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "license": "Apache-2.0", "engines": { "node": ">=4" } @@ -6719,6 +8023,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "license": "Apache-2.0", "engines": { "node": ">=10" } @@ -6727,6 +8032,7 @@ "version": "7.12.11", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", + "license": "MIT", "dependencies": { "@babel/highlight": "^7.10.4" } @@ -6735,6 +8041,7 @@ "version": "13.24.0", "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "license": "MIT", "dependencies": { "type-fest": "^0.20.2" }, @@ -6749,6 +8056,7 @@ "version": "7.6.3", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -6760,6 +8068,7 @@ "version": "0.20.2", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=10" }, @@ -6771,6 +8080,7 @@ "version": "7.3.1", "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", + "license": "BSD-2-Clause", "dependencies": { "acorn": "^7.4.0", "acorn-jsx": "^5.3.1", @@ -6784,6 +8094,7 @@ "version": "7.4.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "license": "MIT", "bin": { "acorn": "bin/acorn" }, @@ -6795,6 +8106,7 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "license": "Apache-2.0", "engines": { "node": ">=4" } @@ -6803,6 +8115,7 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "license": "BSD-2-Clause", "bin": { "esparse": "bin/esparse.js", "esvalidate": "bin/esvalidate.js" @@ -6815,6 +8128,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", + "license": "BSD-3-Clause", "dependencies": { "estraverse": "^5.1.0" }, @@ -6826,6 +8140,7 @@ "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "license": "BSD-2-Clause", "engines": { "node": ">=4.0" } @@ -6834,6 +8149,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "license": "BSD-2-Clause", "dependencies": { "estraverse": "^5.2.0" }, @@ -6845,6 +8161,7 @@ "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "license": "BSD-2-Clause", "engines": { "node": ">=4.0" } @@ -6853,6 +8170,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "license": "BSD-2-Clause", "engines": { "node": ">=4.0" } @@ -6861,6 +8179,7 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "license": "BSD-2-Clause", "engines": { "node": ">=0.10.0" } @@ -6870,6 +8189,7 @@ "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.6" } @@ -6878,6 +8198,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", + "license": "MIT", "engines": { "node": ">=6" } @@ -6886,18 +8207,21 @@ "version": "6.4.7", "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-6.4.7.tgz", "integrity": "sha512-tYUSVOGeQPKt/eC1ABfhHy5Xd96N3oIijJvN3O9+TsC28T5V9yX9oEfEK5faP0EFSNVOG97qtAS68GBrQB2hDg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/eventemitter3": { "version": "4.0.7", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/events": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "license": "MIT", "engines": { "node": ">=0.8.x" } @@ -6907,6 +8231,7 @@ "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==", "dev": true, + "license": "MIT", "dependencies": { "cross-spawn": "^7.0.0", "get-stream": "^5.0.0", @@ -6930,6 +8255,7 @@ "resolved": "https://registry.npmjs.org/execall/-/execall-2.0.0.tgz", "integrity": "sha512-0FU2hZ5Hh6iQnarpRtQurM/aAvp3RIbfvgLHrcqJYzhXyV2KFruhuChf9NC6waAhiUR7FFtlugkI4p7f2Fqlow==", "dev": true, + "license": "MIT", "dependencies": { "clone-regexp": "^2.1.0" }, @@ -6942,6 +8268,7 @@ "resolved": "https://registry.npmjs.org/executable/-/executable-4.1.1.tgz", "integrity": "sha512-8iA79xD3uAch729dUG8xaaBBFGaEa0wdD2VkYLFHwlqosEj/jT66AzcreRDSgV7ehnNLBW2WR5jIXwGKjVdTLg==", "dev": true, + "license": "MIT", "dependencies": { "pify": "^2.2.0" }, @@ -6961,6 +8288,7 @@ "version": "2.1.4", "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", "integrity": "sha512-w/ozOKR9Obk3qoWeY/WDi6MFta9AoMR+zud60mdnbniMcBxRuFJyDt2LdX/14A1UABeqk+Uk+LDfUpvoGKppZA==", + "license": "MIT", "dependencies": { "debug": "^2.3.3", "define-property": "^0.2.5", @@ -6978,6 +8306,7 @@ "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", "dependencies": { "ms": "2.0.0" } @@ -6986,6 +8315,7 @@ "version": "0.2.5", "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", + "license": "MIT", "dependencies": { "is-descriptor": "^0.1.0" }, @@ -6997,6 +8327,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "license": "MIT", "dependencies": { "is-extendable": "^0.1.0" }, @@ -7008,6 +8339,7 @@ "version": "0.1.7", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.7.tgz", "integrity": "sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg==", + "license": "MIT", "dependencies": { "is-accessor-descriptor": "^1.0.1", "is-data-descriptor": "^1.0.1" @@ -7020,6 +8352,7 @@ "version": "0.1.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -7027,12 +8360,14 @@ "node_modules/expand-brackets/node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" }, "node_modules/expand-template": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", + "license": "(MIT OR WTFPL)", "engines": { "node": ">=6" } @@ -7041,6 +8376,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", "integrity": "sha512-A5EmesHW6rfnZ9ysHQjPdJRni0SRar0tjtG5MNtm9n5TUvsYU8oozprtRD4AqHxcZWWlVuAmQo2nWKfN9oyjTw==", + "license": "MIT", "dependencies": { "homedir-polyfill": "^1.0.1" }, @@ -7051,12 +8387,14 @@ "node_modules/extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "license": "MIT" }, "node_modules/extend-shallow": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", "integrity": "sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q==", + "license": "MIT", "dependencies": { "assign-symbols": "^1.0.0", "is-extendable": "^1.0.1" @@ -7069,6 +8407,7 @@ "version": "2.0.4", "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "license": "MIT", "dependencies": { "array-unique": "^0.3.2", "define-property": "^1.0.0", @@ -7087,6 +8426,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", "integrity": "sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==", + "license": "MIT", "dependencies": { "is-descriptor": "^1.0.0" }, @@ -7098,6 +8438,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "license": "MIT", "dependencies": { "is-extendable": "^0.1.0" }, @@ -7109,6 +8450,7 @@ "version": "0.1.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -7118,6 +8460,7 @@ "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "debug": "^4.1.1", "get-stream": "^5.1.0", @@ -7140,29 +8483,33 @@ "dev": true, "engines": [ "node >=0.6.0" - ] + ], + "license": "MIT" }, "node_modules/fast-copy": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/fast-copy/-/fast-copy-3.0.2.tgz", - "integrity": "sha512-dl0O9Vhju8IrcLndv2eU4ldt1ftXMqqfgN4H1cpmGV7P6jeB9FwpN9a2c8DPGE1Ys88rNUJVYDHq73CGAGOPfQ==" + "integrity": "sha512-dl0O9Vhju8IrcLndv2eU4ldt1ftXMqqfgN4H1cpmGV7P6jeB9FwpN9a2c8DPGE1Ys88rNUJVYDHq73CGAGOPfQ==", + "license": "MIT" }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "license": "MIT" }, "node_modules/fast-glob": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", - "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", "dev": true, + "license": "MIT", "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", "glob-parent": "^5.1.2", "merge2": "^1.3.0", - "micromatch": "^4.0.4" + "micromatch": "^4.0.8" }, "engines": { "node": ">=8.6.0" @@ -7171,17 +8518,20 @@ "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "license": "MIT" }, "node_modules/fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==" + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "license": "MIT" }, "node_modules/fast-redact": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/fast-redact/-/fast-redact-3.5.0.tgz", "integrity": "sha512-dwsoQlS7h9hMeYUq1W++23NDcBLV4KqONnITDV9DjfS3q1SgDGVrBdvvTLUotWtPSD7asWDV9/CmsZPy8Hf70A==", + "license": "MIT", "engines": { "node": ">=6" } @@ -7189,18 +8539,31 @@ "node_modules/fast-safe-stringify": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", - "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==" + "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==", + "license": "MIT" }, "node_modules/fast-uri": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.1.tgz", - "integrity": "sha512-MWipKbbYiYI0UC7cl8m/i/IWTqfC8YXsqjzybjddLsFjStroQzsHXkc73JutMvBiXmOvapk+axIl79ig5t55Bw==" + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.6.tgz", + "integrity": "sha512-Atfo14OibSv5wAp4VWNsFYE1AchQRTv9cBGWET4pZWHzYshFSS9NQI6I57rdKn9croWVMbYFbLhJ+yJvmZIIHw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "BSD-3-Clause" }, "node_modules/fastest-levenshtein": { "version": "1.0.16", "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz", "integrity": "sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 4.9.1" } @@ -7209,13 +8572,15 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/fastparse/-/fastparse-1.1.2.tgz", "integrity": "sha512-483XLLxTVIwWK3QTrMGRqUfUpoOs/0hbQrl2oz4J0pAcm3A3bu84wxTFqGqkJzewCLdME38xJLJAxBABfQT8sQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/fastq": { - "version": "1.17.1", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", - "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.18.0.tgz", + "integrity": "sha512-QKHXPW0hD8g4UET03SdOdunzSouc9N4AuHdsX8XNcTsuz+yYFILVNIX4l9yHABMhiEI9Db0JTTIpu0wB+Y1QQw==", "dev": true, + "license": "ISC", "dependencies": { "reusify": "^1.0.4" } @@ -7225,6 +8590,7 @@ "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", "dev": true, + "license": "MIT", "dependencies": { "pend": "~1.2.0" } @@ -7234,6 +8600,7 @@ "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", "dev": true, + "license": "MIT", "dependencies": { "escape-string-regexp": "^1.0.5" }, @@ -7249,6 +8616,7 @@ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.8.0" } @@ -7257,6 +8625,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "license": "MIT", "dependencies": { "flat-cache": "^3.0.4" }, @@ -7267,17 +8636,20 @@ "node_modules/file-sync-cmp": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/file-sync-cmp/-/file-sync-cmp-0.1.1.tgz", - "integrity": "sha512-0k45oWBokCqh2MOexeYKpyqmGKG+8mQ2Wd8iawx+uWd/weWJQAZ6SoPybagdCI4xFisag8iAR77WPm4h3pTfxA==" + "integrity": "sha512-0k45oWBokCqh2MOexeYKpyqmGKG+8mQ2Wd8iawx+uWd/weWJQAZ6SoPybagdCI4xFisag8iAR77WPm4h3pTfxA==", + "license": "MIT" }, "node_modules/file-uri-to-path": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "license": "MIT" }, "node_modules/fill-range": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "license": "MIT", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -7290,6 +8662,7 @@ "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.0.tgz", "integrity": "sha512-ejnvM9ZXYzp6PUPUyQBMBf0Co5VX2gr5H2VQe2Ui2jWXNlxv+PYZo8wpAymJNJdLsG1R4p+M4aynF8KuoUEwRw==", "dev": true, + "license": "MIT", "dependencies": { "debug": "2.6.9", "encodeurl": "~1.0.1", @@ -7308,6 +8681,7 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, + "license": "MIT", "dependencies": { "ms": "2.0.0" } @@ -7316,21 +8690,23 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/find-babel-config": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/find-babel-config/-/find-babel-config-2.1.1.tgz", - "integrity": "sha512-5Ji+EAysHGe1OipH7GN4qDjok5Z1uw5KAwDCbicU/4wyTZY7CqOCzcWbG7J5ad9mazq67k89fXlbc1MuIfl9uA==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/find-babel-config/-/find-babel-config-2.1.2.tgz", + "integrity": "sha512-ZfZp1rQyp4gyuxqt1ZqjFGVeVBvmpURMqdIWXbPRfB97Bf6BzdK/xSIbylEINzQ0kB5tlDQfn9HkNXXWsqTqLg==", + "license": "MIT", "dependencies": { - "json5": "^2.2.3", - "path-exists": "^4.0.0" + "json5": "^2.2.3" } }, "node_modules/find-cache-dir": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", + "license": "MIT", "dependencies": { "commondir": "^1.0.1", "make-dir": "^2.0.0", @@ -7344,13 +8720,15 @@ "version": "0.5.2", "resolved": "https://registry.npmjs.org/find-line-column/-/find-line-column-0.5.2.tgz", "integrity": "sha512-eNhNkDt5RbxY4X++JwyDURP62FYhV1bh9LF4dfOiwpVCTk5vvfEANhnui5ypUEELGR02QZSrWFtaTgd4ulW5tw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/find-up": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, + "license": "MIT", "dependencies": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" @@ -7378,6 +8756,7 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", "integrity": "sha512-c9IPMazfRITpmAAKi22dK1VKxGDX9ehhqfABDriL/lzO92xcUKEJPQHrVA/2YHSNFB4iFlykVmWvwo48nr3OxA==", "deprecated": "Glob versions prior to v9 are no longer supported", + "license": "ISC", "dependencies": { "inflight": "^1.0.4", "inherits": "2", @@ -7393,6 +8772,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/fined/-/fined-1.2.0.tgz", "integrity": "sha512-ZYDqPLGxDkDhDZBjZBb+oD1+j0rA4E0pXY50eplAAOPg2N/gUBSSk5IM1/QhPfyVo19lJ+CvXpqfvk+b2p/8Ng==", + "license": "MIT", "dependencies": { "expand-tilde": "^2.0.2", "is-plain-object": "^2.0.3", @@ -7408,6 +8788,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-1.0.1.tgz", "integrity": "sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q==", + "license": "MIT", "engines": { "node": ">= 0.10" } @@ -7417,6 +8798,7 @@ "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", "dev": true, + "license": "BSD-3-Clause", "bin": { "flat": "cli.js" } @@ -7425,6 +8807,7 @@ "version": "3.2.0", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "license": "MIT", "dependencies": { "flatted": "^3.2.9", "keyv": "^4.5.3", @@ -7435,15 +8818,17 @@ } }, "node_modules/flatted": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", - "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==" + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.2.tgz", + "integrity": "sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA==", + "license": "ISC" }, "node_modules/flow-bin": { "version": "0.154.0", "resolved": "https://registry.npmjs.org/flow-bin/-/flow-bin-0.154.0.tgz", "integrity": "sha512-I6u2ETdkAyard+8C5na6bfZp4EM0zIMB7O5zH4GKzBLv9/y8/NYRTxEXQe5T0hvj9R9DxFBUoPsFK76ziweUFw==", "dev": true, + "license": "MIT", "bin": { "flow": "cli.js" }, @@ -7456,6 +8841,7 @@ "resolved": "https://registry.npmjs.org/flow-parser/-/flow-parser-0.181.2.tgz", "integrity": "sha512-+QzNZEmhYNF9SHrKI8M2lzT07UGkJW6Zoeg7wP+aGkFxh0Mh/wx8eyS/lcwY9bd3B4azS6K50ZjyIjzMWpowGg==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.4.0" } @@ -7465,6 +8851,7 @@ "resolved": "https://registry.npmjs.org/flow-remove-types/-/flow-remove-types-2.181.0.tgz", "integrity": "sha512-wBxPyNjAocqWBVEpLcpF6qcd586L+VJyfJwuRGckyVgoj3yN2tQ7UCslJ9e8qOQrLOywa83Y8bDbAiLDbY254Q==", "dev": true, + "license": "MIT", "dependencies": { "flow-parser": "^0.181.0", "pirates": "^3.0.2", @@ -7483,6 +8870,7 @@ "resolved": "https://registry.npmjs.org/pirates/-/pirates-3.0.2.tgz", "integrity": "sha512-c5CgUJq6H2k6MJz72Ak1F5sN9n9wlSlJyEnwvpm9/y3WB4E3pHBDT2c6PEiS1vyJvq2bUxUAIu0EGf8Cx4Ic7Q==", "dev": true, + "license": "MIT", "dependencies": { "node-modules-regexp": "^1.0.0" }, @@ -7491,15 +8879,16 @@ } }, "node_modules/follow-redirects": { - "version": "1.15.6", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", - "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", + "version": "1.15.9", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", + "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", "funding": [ { "type": "individual", "url": "https://github.com/sponsors/RubenVerborgh" } ], + "license": "MIT", "engines": { "node": ">=4.0" }, @@ -7510,18 +8899,26 @@ } }, "node_modules/for-each": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", - "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.4.tgz", + "integrity": "sha512-kKaIINnFpzW6ffJNDjjyjrk21BkDx38c0xa/klsT8VzLCaMEefv4ZTacrcVR4DmgTeBra++jMDAfS/tS799YDw==", "dev": true, + "license": "MIT", "dependencies": { - "is-callable": "^1.1.3" + "is-callable": "^1.2.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/for-in": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", "integrity": "sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -7530,6 +8927,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz", "integrity": "sha512-0OABksIGrxKK8K4kynWkQ7y1zounQxP+CWnyclVwj81KW3vlLlGUx57DKGcP/LH216GzqnstnPocF16Nxs0Ycg==", + "license": "MIT", "dependencies": { "for-in": "^1.0.1" }, @@ -7541,21 +8939,24 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/foreachasync/-/foreachasync-3.0.0.tgz", "integrity": "sha512-J+ler7Ta54FwwNcx6wQRDhTIbNeyDcARMkOcguEqnEdtm0jKvN3Li3PDAb2Du3ubJYEWfYL83XMROXdsXAXycw==", - "dev": true + "dev": true, + "license": "Apache2" }, "node_modules/forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==", "dev": true, + "license": "Apache-2.0", "engines": { "node": "*" } }, "node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", + "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==", + "license": "MIT", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", @@ -7569,6 +8970,7 @@ "version": "0.2.1", "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", "integrity": "sha512-GMBAbW9antB8iZRHLoGw0b3HANt57diZYFO/HL1JGIC1MjKrdmhxvrJbupnVvpys0zsz7yBApXdQyfepKly2kA==", + "license": "MIT", "dependencies": { "map-cache": "^0.2.2" }, @@ -7581,6 +8983,7 @@ "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.6" } @@ -7588,13 +8991,15 @@ "node_modules/fs-constants": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", - "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", + "license": "MIT" }, "node_modules/fs-extra": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-3.0.1.tgz", "integrity": "sha512-V3Z3WZWVUYd8hoCL5xfXJCaHWYzmtwW5XWYSlLgERi8PWd8bx1kUHUk8L1BT57e49oKnDDD180mjfrHc1yA9rg==", "dev": true, + "license": "MIT", "dependencies": { "graceful-fs": "^4.1.2", "jsonfile": "^3.0.0", @@ -7605,6 +9010,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "license": "ISC", "dependencies": { "minipass": "^3.0.0" }, @@ -7615,7 +9021,8 @@ "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "license": "ISC" }, "node_modules/fsevents": { "version": "2.3.3", @@ -7623,6 +9030,7 @@ "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", "dev": true, "hasInstallScript": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -7635,20 +9043,24 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/function.prototype.name": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", - "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.8.tgz", + "integrity": "sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "functions-have-names": "^1.2.3" + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "functions-have-names": "^1.2.3", + "hasown": "^2.0.2", + "is-callable": "^1.2.7" }, "engines": { "node": ">= 0.4" @@ -7660,13 +9072,15 @@ "node_modules/functional-red-black-tree": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==" + "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", + "license": "MIT" }, "node_modules/functions-have-names": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", "dev": true, + "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -7676,6 +9090,7 @@ "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.4.tgz", "integrity": "sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==", "deprecated": "This package is no longer supported.", + "license": "ISC", "optional": true, "dependencies": { "aproba": "^1.0.3 || ^2.0.0", @@ -7695,6 +9110,7 @@ "version": "1.1.5", "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", + "license": "ISC", "optional": true, "dependencies": { "string-width": "^1.0.2 || 2 || 3 || 4" @@ -7705,6 +9121,7 @@ "resolved": "https://registry.npmjs.org/generic-names/-/generic-names-1.0.3.tgz", "integrity": "sha512-b6OHfQuKasIKM9b6YPkX+KUj/TLBTx3B/1aT1T5F12FEuEqyFMdr59OMS53aoaSw8eVtapdqieX6lbg5opaOhA==", "dev": true, + "license": "MIT", "dependencies": { "loader-utils": "^0.2.16" } @@ -7713,6 +9130,7 @@ "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "license": "MIT", "engines": { "node": ">=6.9.0" } @@ -7722,21 +9140,28 @@ "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true, + "license": "ISC", "engines": { "node": "6.* || 8.* || >= 10.*" } }, "node_modules/get-intrinsic": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", - "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.7.tgz", + "integrity": "sha512-VW6Pxhsrk0KAOqs3WEd0klDiF/+V7gQOpAvY1jVU/LHmaD/kQO4523aiJuikX/QAKYiW6x8Jh+RJej1almdtCA==", "dev": true, + "license": "MIT", "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-define-property": "^1.0.1", "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" + "get-proto": "^1.0.0", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" }, "engines": { "node": ">= 0.4" @@ -7745,11 +9170,26 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/get-stdin": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-8.0.0.tgz", "integrity": "sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, @@ -7762,6 +9202,7 @@ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", "dev": true, + "license": "MIT", "dependencies": { "pump": "^3.0.0" }, @@ -7773,14 +9214,15 @@ } }, "node_modules/get-symbol-description": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz", - "integrity": "sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.1.0.tgz", + "integrity": "sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.5", + "call-bound": "^1.0.3", "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.4" + "get-intrinsic": "^1.2.6" }, "engines": { "node": ">= 0.4" @@ -7793,6 +9235,7 @@ "version": "2.0.6", "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", "integrity": "sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -7810,6 +9253,7 @@ "resolved": "https://registry.npmjs.org/getos/-/getos-3.2.1.tgz", "integrity": "sha512-U56CfOK17OKgTVqozZjUKNdkfEv6jk5WISBJ8SHoagjE6L69zOwl3Z+O8myjY9MEW3i2HPWQBt/LTbCgcC973Q==", "dev": true, + "license": "MIT", "dependencies": { "async": "^3.2.0" } @@ -7819,6 +9263,7 @@ "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", "dev": true, + "license": "MIT", "dependencies": { "assert-plus": "^1.0.0" } @@ -7826,13 +9271,15 @@ "node_modules/github-from-package": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", - "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==" + "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==", + "license": "MIT" }, "node_modules/glob": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", "deprecated": "Glob versions prior to v9 are no longer supported", + "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -7851,6 +9298,7 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "license": "ISC", "dependencies": { "is-glob": "^4.0.1" }, @@ -7863,12 +9311,14 @@ "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", "dev": true, + "license": "BSD-2-Clause", "peer": true }, "node_modules/glob/node_modules/brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } @@ -7877,6 +9327,7 @@ "version": "5.1.6", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -7889,6 +9340,7 @@ "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.1.tgz", "integrity": "sha512-NBcGGFbBA9s1VzD41QXDG+3++t9Mn5t1FpLdhESY6oKY4gYTFpX4wO3sqGUa0Srjtbfj3szX0RnemmrVRUdULA==", "dev": true, + "license": "MIT", "dependencies": { "ini": "2.0.0" }, @@ -7904,6 +9356,7 @@ "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz", "integrity": "sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==", "dev": true, + "license": "MIT", "dependencies": { "global-prefix": "^3.0.0" }, @@ -7916,6 +9369,7 @@ "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz", "integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==", "dev": true, + "license": "MIT", "dependencies": { "ini": "^1.3.5", "kind-of": "^6.0.2", @@ -7929,13 +9383,15 @@ "version": "1.3.8", "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/global-prefix/node_modules/which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, + "license": "ISC", "dependencies": { "isexe": "^2.0.0" }, @@ -7947,6 +9403,7 @@ "version": "11.12.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "license": "MIT", "engines": { "node": ">=4" } @@ -7956,6 +9413,7 @@ "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", "dev": true, + "license": "MIT", "dependencies": { "define-properties": "^1.2.1", "gopd": "^1.0.1" @@ -7972,6 +9430,7 @@ "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", "dev": true, + "license": "MIT", "dependencies": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", @@ -7992,6 +9451,7 @@ "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", "dev": true, + "license": "MIT", "engines": { "node": ">= 4" } @@ -8000,13 +9460,15 @@ "version": "0.1.4", "resolved": "https://registry.npmjs.org/globjoin/-/globjoin-0.1.4.tgz", "integrity": "sha512-xYfnw62CKG8nLkZBfWbhWwDw02CHty86jfPcc2cr3ZfeuK9ysoVPPEUxf21bAD/rWAgk52SuBrLJlefNy8mvFg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/gonzales-pe": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/gonzales-pe/-/gonzales-pe-4.3.0.tgz", "integrity": "sha512-otgSPpUmdWJ43VXyiNgEYE4luzHCL2pz4wQ0OnDluC6Eg4Ko3Vexy/SrSynglw/eR+OhkzmqFCZa/OFa/RgAOQ==", "dev": true, + "license": "MIT", "dependencies": { "minimist": "^1.2.5" }, @@ -8018,12 +9480,13 @@ } }, "node_modules/gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", "dev": true, - "dependencies": { - "get-intrinsic": "^1.1.3" + "license": "MIT", + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -8032,13 +9495,15 @@ "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "license": "ISC" }, "node_modules/growl": { "version": "1.10.5", "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", "dev": true, + "license": "MIT", "engines": { "node": ">=4.x" } @@ -8047,6 +9512,7 @@ "version": "1.5.3", "resolved": "https://registry.npmjs.org/grunt/-/grunt-1.5.3.tgz", "integrity": "sha512-mKwmo4X2d8/4c/BmcOETHek675uOqw0RuA/zy12jaspWqvTp4+ZeQF1W+OTpcbncnaBsfbQJ6l0l4j+Sn/GmaQ==", + "license": "MIT", "dependencies": { "dateformat": "~3.0.3", "eventemitter2": "~0.4.13", @@ -8076,6 +9542,7 @@ "resolved": "https://registry.npmjs.org/grunt-check-dependencies/-/grunt-check-dependencies-1.0.0.tgz", "integrity": "sha512-fUITsJBJ3GwtCRQbzlbVe/WuljZQcjftfGCh4onBDDOomNpmgKCsUTi2T5gfshjZDNt0+6CPXcQLDfL413UThQ==", "deprecated": "`grunt-check-dependencies` is no longer maintained. Consider switching to a pure-JS `check-dependencies` package.", + "license": "MIT", "dependencies": { "check-dependencies": "^1.0.1", "lodash.clonedeep": "^4.5.0" @@ -8091,6 +9558,7 @@ "version": "1.4.3", "resolved": "https://registry.npmjs.org/grunt-cli/-/grunt-cli-1.4.3.tgz", "integrity": "sha512-9Dtx/AhVeB4LYzsViCjUQkd0Kw0McN2gYpdmGYKtE2a5Yt7v1Q+HYZVWhqXc/kGnxlMtqKDxSwotiGeFmkrCoQ==", + "license": "MIT", "dependencies": { "grunt-known-options": "~2.0.0", "interpret": "~1.1.0", @@ -8109,6 +9577,7 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz", "integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==", + "license": "ISC", "dependencies": { "abbrev": "1", "osenv": "^0.1.4" @@ -8121,6 +9590,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/grunt-contrib-clean/-/grunt-contrib-clean-2.0.0.tgz", "integrity": "sha512-g5ZD3ORk6gMa5ugZosLDQl3dZO7cI3R14U75hTM+dVLVxdMNJCPVmwf9OUt4v4eWgpKKWWoVK9DZc1amJp4nQw==", + "license": "MIT", "dependencies": { "async": "^2.6.1", "rimraf": "^2.6.2" @@ -8136,6 +9606,7 @@ "version": "2.6.4", "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", "integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==", + "license": "MIT", "dependencies": { "lodash": "^4.17.14" } @@ -8145,6 +9616,7 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "deprecated": "Glob versions prior to v9 are no longer supported", + "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -8165,6 +9637,7 @@ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", "deprecated": "Rimraf versions prior to v4 are no longer supported", + "license": "ISC", "dependencies": { "glob": "^7.1.3" }, @@ -8176,6 +9649,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/grunt-contrib-copy/-/grunt-contrib-copy-1.0.0.tgz", "integrity": "sha512-gFRFUB0ZbLcjKb67Magz1yOHGBkyU6uL29hiEW1tdQ9gQt72NuMKIy/kS6dsCbV0cZ0maNCb0s6y+uT1FKU7jA==", + "license": "MIT", "dependencies": { "chalk": "^1.1.1", "file-sync-cmp": "^0.1.0" @@ -8188,6 +9662,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -8196,6 +9671,7 @@ "version": "2.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -8204,6 +9680,7 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", + "license": "MIT", "dependencies": { "ansi-styles": "^2.2.1", "escape-string-regexp": "^1.0.2", @@ -8219,6 +9696,7 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "license": "MIT", "engines": { "node": ">=0.8.0" } @@ -8227,6 +9705,7 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", + "license": "MIT", "dependencies": { "ansi-regex": "^2.0.0" }, @@ -8238,6 +9717,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==", + "license": "MIT", "engines": { "node": ">=0.8.0" } @@ -8246,6 +9726,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/grunt-exec/-/grunt-exec-3.0.0.tgz", "integrity": "sha512-cgAlreXf3muSYS5LzW0Cc4xHK03BjFOYk0MqCQ/MZ3k1Xz2GU7D+IAJg4UKicxpO+XdONJdx/NJ6kpy2wI+uHg==", + "license": "MIT", "engines": { "node": ">=0.8.0" }, @@ -8257,6 +9738,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/grunt-known-options/-/grunt-known-options-2.0.0.tgz", "integrity": "sha512-GD7cTz0I4SAede1/+pAbmJRG44zFLPipVtdL9o3vqx9IEyb7b4/Y3s7r6ofI3CchR5GvYJ+8buCSioDv5dQLiA==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -8265,6 +9747,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/grunt-legacy-log/-/grunt-legacy-log-3.0.0.tgz", "integrity": "sha512-GHZQzZmhyq0u3hr7aHW4qUH0xDzwp2YXldLPZTCjlOeGscAOWWPftZG3XioW8MasGp+OBRIu39LFx14SLjXRcA==", + "license": "MIT", "dependencies": { "colors": "~1.1.2", "grunt-legacy-log-utils": "~2.1.0", @@ -8279,6 +9762,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/grunt-legacy-log-utils/-/grunt-legacy-log-utils-2.1.0.tgz", "integrity": "sha512-lwquaPXJtKQk0rUM1IQAop5noEpwFqOXasVoedLeNzaibf/OPWjKYvvdqnEHNmU+0T0CaReAXIbGo747ZD+Aaw==", + "license": "MIT", "dependencies": { "chalk": "~4.1.0", "lodash": "~4.17.19" @@ -8291,6 +9775,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/grunt-legacy-util/-/grunt-legacy-util-2.0.1.tgz", "integrity": "sha512-2bQiD4fzXqX8rhNdXkAywCadeqiPiay0oQny77wA2F3WF4grPJXCvAcyoWUJV+po/b15glGkxuSiQCK299UC2w==", + "license": "MIT", "dependencies": { "async": "~3.2.0", "exit": "~0.1.2", @@ -8307,13 +9792,15 @@ "node_modules/grunt/node_modules/eventemitter2": { "version": "0.4.14", "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-0.4.14.tgz", - "integrity": "sha512-K7J4xq5xAD5jHsGM5ReWXRTFa3JRGofHiMcVgQ8PRwgWxzjHpMWCIzsmyf60+mh8KLsqYPcjUMa0AC4hd6lPyQ==" + "integrity": "sha512-K7J4xq5xAD5jHsGM5ReWXRTFa3JRGofHiMcVgQ8PRwgWxzjHpMWCIzsmyf60+mh8KLsqYPcjUMa0AC4hd6lPyQ==", + "license": "MIT" }, "node_modules/grunt/node_modules/glob": { "version": "7.1.7", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", "deprecated": "Glob versions prior to v9 are no longer supported", + "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -8333,6 +9820,7 @@ "version": "3.0.8", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.8.tgz", "integrity": "sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q==", + "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -8345,6 +9833,7 @@ "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } @@ -8354,6 +9843,7 @@ "resolved": "https://registry.npmjs.org/has/-/has-1.0.4.tgz", "integrity": "sha512-qdSAmqLF6209RFj4VVItywPMbm3vWylknmB3nvNiUIs72xAimcM8nVYxYr7ncvZq5qzk9MKIZR8ijqD/1QuYjQ==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4.0" } @@ -8362,6 +9852,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", "integrity": "sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==", + "license": "MIT", "dependencies": { "ansi-regex": "^2.0.0" }, @@ -8373,15 +9864,20 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/has-bigints": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", - "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.1.0.tgz", + "integrity": "sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg==", "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -8390,6 +9886,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "license": "MIT", "engines": { "node": ">=8" } @@ -8399,6 +9896,7 @@ "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", "dev": true, + "license": "MIT", "dependencies": { "es-define-property": "^1.0.0" }, @@ -8407,10 +9905,14 @@ } }, "node_modules/has-proto": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", - "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.2.0.tgz", + "integrity": "sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ==", "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.0" + }, "engines": { "node": ">= 0.4" }, @@ -8419,10 +9921,11 @@ } }, "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -8435,6 +9938,7 @@ "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", "dev": true, + "license": "MIT", "dependencies": { "has-symbols": "^1.0.3" }, @@ -8449,12 +9953,14 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", + "license": "ISC", "optional": true }, "node_modules/has-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", "integrity": "sha512-IBXk4GTsLYdQ7Rvt+GRBrFSVEkmuOUy4re0Xjd9kJSUQpnTrWR4/y9RpfexN9vkAPMFuQoeWKwqzPozRTlasGw==", + "license": "MIT", "dependencies": { "get-value": "^2.0.6", "has-values": "^1.0.0", @@ -8468,6 +9974,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", "integrity": "sha512-ODYZC64uqzmtfGMEAX/FvZiRyWLpAC3vYnNunURUnkGVTS+mI0smVsWaPydRBsE3g+ok7h960jChO8mFcWlHaQ==", + "license": "MIT", "dependencies": { "is-number": "^3.0.0", "kind-of": "^4.0.0" @@ -8479,12 +9986,14 @@ "node_modules/has-values/node_modules/is-buffer": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "license": "MIT" }, "node_modules/has-values/node_modules/is-number": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", "integrity": "sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg==", + "license": "MIT", "dependencies": { "kind-of": "^3.0.2" }, @@ -8496,6 +10005,7 @@ "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "license": "MIT", "dependencies": { "is-buffer": "^1.1.5" }, @@ -8507,6 +10017,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", "integrity": "sha512-24XsCxmEbRwEDbz/qz3stgin8TTzZ1ESR56OMCN0ujYg+vRutNSiOj9bHH9u85DKgXguraugV5sFuvbD4FW/hw==", + "license": "MIT", "dependencies": { "is-buffer": "^1.1.5" }, @@ -8518,12 +10029,14 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-1.0.2.tgz", "integrity": "sha512-fUs4B4L+mlt8/XAtSOGMUO1TXmAelItBPtJG7CyHJfYTdDjwisntGO2JQz7oUsatOY9o68+57eziUVNw/mRHmA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/hasown": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", "dependencies": { "function-bind": "^1.1.2" }, @@ -8536,6 +10049,7 @@ "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", "dev": true, + "license": "MIT", "bin": { "he": "bin/he" } @@ -8543,12 +10057,14 @@ "node_modules/help-me": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/help-me/-/help-me-5.0.0.tgz", - "integrity": "sha512-7xgomUX6ADmcYzFik0HzAxh/73YlKR9bmFzf51CZwR+b6YtzU2m0u49hQCqV6SvlqIqsaxovfwdvbnsw3b/zpg==" + "integrity": "sha512-7xgomUX6ADmcYzFik0HzAxh/73YlKR9bmFzf51CZwR+b6YtzU2m0u49hQCqV6SvlqIqsaxovfwdvbnsw3b/zpg==", + "license": "MIT" }, "node_modules/homedir-polyfill": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", + "license": "MIT", "dependencies": { "parse-passwd": "^1.0.0" }, @@ -8568,13 +10084,15 @@ "version": "2.8.9", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/html-tags": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/html-tags/-/html-tags-3.3.1.tgz", "integrity": "sha512-ztqyC3kLto0e9WbNp0aeP+M3kTt+nbaIveGmUxAtZa+8iFgKLUOD4YKM5j+f3QD89bra7UeumolZHKuOXnTmeQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" }, @@ -8587,6 +10105,7 @@ "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-4.1.0.tgz", "integrity": "sha512-4zDq1a1zhE4gQso/c5LP1OtrhYTncXNSpvJYtWJBtXAETPlMfi3IFNjGuQbYLuVY4ZR0QMqRVvo4Pdy9KLyP8Q==", "dev": true, + "license": "MIT", "dependencies": { "domelementtype": "^2.0.1", "domhandler": "^3.0.0", @@ -8599,6 +10118,7 @@ "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.4.1.tgz", "integrity": "sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==", "dev": true, + "license": "MIT", "dependencies": { "domelementtype": "^2.0.1", "domhandler": "^4.2.0", @@ -8613,6 +10133,7 @@ "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.3.1.tgz", "integrity": "sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "domelementtype": "^2.2.0" }, @@ -8628,6 +10149,7 @@ "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-3.3.0.tgz", "integrity": "sha512-J1C5rIANUbuYK+FuFL98650rihynUOEzRLxW+90bKZRWB6A1X1Tf82GxR1qAWLyfNPRvjqfip3Q5tdYlmAa9lA==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "domelementtype": "^2.0.1" }, @@ -8643,6 +10165,7 @@ "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.8.0.tgz", "integrity": "sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "dom-serializer": "^1.0.1", "domelementtype": "^2.2.0", @@ -8657,6 +10180,7 @@ "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.3.1.tgz", "integrity": "sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "domelementtype": "^2.2.0" }, @@ -8672,6 +10196,7 @@ "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz", "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==", "dev": true, + "license": "BSD-2-Clause", "funding": { "url": "https://github.com/fb55/entities?sponsor=1" } @@ -8680,6 +10205,7 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", + "license": "BSD-2-Clause", "optional": true }, "node_modules/http-errors": { @@ -8687,6 +10213,7 @@ "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", "dev": true, + "license": "MIT", "dependencies": { "depd": "2.0.0", "inherits": "2.0.4", @@ -8703,6 +10230,7 @@ "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.8" } @@ -8712,6 +10240,7 @@ "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", "dev": true, + "license": "MIT", "dependencies": { "eventemitter3": "^4.0.0", "follow-redirects": "^1.0.0", @@ -8725,6 +10254,7 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "license": "MIT", "optional": true, "dependencies": { "@tootallnate/once": "1", @@ -8736,14 +10266,15 @@ } }, "node_modules/http-signature": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.3.6.tgz", - "integrity": "sha512-3adrsD6zqo4GsTqtO7FyrejHNv+NgiIfAfv68+jVlFmSr9OGy7zrxONceFRLKvnnZA5jbxQBX1u9PpB6Wi32Gw==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.4.0.tgz", + "integrity": "sha512-G5akfn7eKbpDN+8nPS/cb57YeA1jLTVxjpCj7tmm3QKPdyDy7T+qSC40e9ptydSWvkwjSXw1VbkpyEm39ukeAg==", "dev": true, + "license": "MIT", "dependencies": { "assert-plus": "^1.0.0", "jsprim": "^2.0.2", - "sshpk": "^1.14.1" + "sshpk": "^1.18.0" }, "engines": { "node": ">=0.10" @@ -8753,6 +10284,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "license": "MIT", "optional": true, "dependencies": { "agent-base": "6", @@ -8767,6 +10299,7 @@ "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==", "dev": true, + "license": "Apache-2.0", "engines": { "node": ">=8.12.0" } @@ -8775,6 +10308,7 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", + "license": "MIT", "optional": true, "dependencies": { "ms": "^2.0.0" @@ -8784,6 +10318,7 @@ "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "license": "MIT", "dependencies": { "safer-buffer": ">= 2.1.2 < 3" }, @@ -8795,17 +10330,20 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/icss-replace-symbols/-/icss-replace-symbols-1.1.0.tgz", "integrity": "sha512-chIaY3Vh2mh2Q3RGXttaDIzeiPvaVXJ+C4DAh/w3c37SKZ/U6PGMmuicR2EQQp9bKG8zLMCl7I+PtIoOOPp8Gg==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/idle-js": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/idle-js/-/idle-js-0.1.3.tgz", - "integrity": "sha512-Hvd+OLMUWfVJUv/HoX7wtBgPwx2OdcEd2TzXcBQJyuINXcf7Ig2SgxRMuq2wZNkarf/+DrzV7NxwjKcexIfWBg==" + "integrity": "sha512-Hvd+OLMUWfVJUv/HoX7wtBgPwx2OdcEd2TzXcBQJyuINXcf7Ig2SgxRMuq2wZNkarf/+DrzV7NxwjKcexIfWBg==", + "license": "MIT" }, "node_modules/idle-vue": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/idle-vue/-/idle-vue-2.0.5.tgz", "integrity": "sha512-2UwNr8VZNg/AuNLBUEj2K3cdKYL1Er1EJobLHlVIqyrx/c0B1+DQi9x0B5rgZHH3fbTbM8QjmrgTse1k5sRaNg==", + "license": "MIT", "dependencies": { "idle-js": "^0.1.3" }, @@ -8831,12 +10369,14 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "BSD-3-Clause" }, "node_modules/ignore": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "license": "MIT", "engines": { "node": ">= 4" } @@ -8846,6 +10386,7 @@ "resolved": "https://registry.npmjs.org/image-size/-/image-size-0.5.5.tgz", "integrity": "sha512-6TDAlDPZxUFCv+fuOkIoXT/V/f3Qbq8e37p+YOiYrUv3v9cc3/6x78VdfPgFVaB9dZYeLUfKgHRebpkm/oP2VQ==", "dev": true, + "license": "MIT", "optional": true, "bin": { "image-size": "bin/image-size.js" @@ -8859,6 +10400,7 @@ "resolved": "https://registry.npmjs.org/immutable/-/immutable-3.8.2.tgz", "integrity": "sha512-15gZoQ38eYjEjxkorfbcgBKBL6R7T459OuK+CpcWt7O3KF4uPCx2tD0uFETlUDIyo+1789crbMhTvQBSR5yBMg==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -8867,6 +10409,7 @@ "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "license": "MIT", "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" @@ -8883,6 +10426,7 @@ "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-4.0.0.tgz", "integrity": "sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -8891,6 +10435,7 @@ "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "license": "MIT", "engines": { "node": ">=0.8.19" } @@ -8900,6 +10445,7 @@ "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", "devOptional": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -8908,6 +10454,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", + "license": "ISC", "optional": true }, "node_modules/inflight": { @@ -8915,6 +10462,7 @@ "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "license": "ISC", "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -8923,26 +10471,29 @@ "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" }, "node_modules/ini": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", "dev": true, + "license": "ISC", "engines": { "node": ">=10" } }, "node_modules/internal-slot": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", - "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz", + "integrity": "sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==", "dev": true, + "license": "MIT", "dependencies": { "es-errors": "^1.3.0", - "hasown": "^2.0.0", - "side-channel": "^1.0.4" + "hasown": "^2.0.2", + "side-channel": "^1.1.0" }, "engines": { "node": ">= 0.4" @@ -8951,12 +10502,14 @@ "node_modules/interpret": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.1.0.tgz", - "integrity": "sha512-CLM8SNMDu7C5psFCn6Wg/tgpj/bKAg7hc2gWqcuR9OD5Ft9PhBpIu8PLicPeis+xDd6YX2ncI8MCA64I9tftIA==" + "integrity": "sha512-CLM8SNMDu7C5psFCn6Wg/tgpj/bKAg7hc2gWqcuR9OD5Ft9PhBpIu8PLicPeis+xDd6YX2ncI8MCA64I9tftIA==", + "license": "MIT" }, "node_modules/ip-address": { "version": "9.0.5", "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz", "integrity": "sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==", + "license": "MIT", "optional": true, "dependencies": { "jsbn": "1.1.0", @@ -8970,12 +10523,14 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==", + "license": "BSD-3-Clause", "optional": true }, "node_modules/is-absolute": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", + "license": "MIT", "dependencies": { "is-relative": "^1.0.0", "is-windows": "^1.0.1" @@ -8988,6 +10543,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.1.tgz", "integrity": "sha512-YBUanLI8Yoihw923YeFUS5fs0fF2f5TSFTNiYAAzhhDscDa3lEqYuz1pDOEP5KvX94I9ey3vsqjJcLVFVU+3QA==", + "license": "MIT", "dependencies": { "hasown": "^2.0.0" }, @@ -9000,6 +10556,7 @@ "resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-1.0.4.tgz", "integrity": "sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg==", "dev": true, + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -9010,6 +10567,7 @@ "resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-1.0.4.tgz", "integrity": "sha512-UzoZUr+XfVz3t3v4KyGEniVL9BDRoQtY7tOyrRybkVNjDFWyo1yhXNGrrBTQxp3ib9BLAWs7k2YKBQsFRkZG9A==", "dev": true, + "license": "MIT", "dependencies": { "is-alphabetical": "^1.0.0", "is-decimal": "^1.0.0" @@ -9020,13 +10578,15 @@ } }, "node_modules/is-array-buffer": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", - "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz", + "integrity": "sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.1" + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" }, "engines": { "node": ">= 0.4" @@ -9039,15 +10599,40 @@ "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", - "dev": true + "dev": true, + "license": "MIT" + }, + "node_modules/is-async-function": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.1.1.tgz", + "integrity": "sha512-9dgM/cZBnNvjzaMYHVoxxfPj2QXt22Ev7SuuPrs+xav0ukGB0S6d4ydZdEiM48kLx5kDV+QBPrpVnFyefL8kkQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "async-function": "^1.0.0", + "call-bound": "^1.0.3", + "get-proto": "^1.0.1", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/is-bigint": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", - "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.1.0.tgz", + "integrity": "sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==", "dev": true, + "license": "MIT", "dependencies": { - "has-bigints": "^1.0.1" + "has-bigints": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -9058,6 +10643,7 @@ "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", "dev": true, + "license": "MIT", "dependencies": { "binary-extensions": "^2.0.0" }, @@ -9066,13 +10652,14 @@ } }, "node_modules/is-boolean-object": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", - "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.2.1.tgz", + "integrity": "sha512-l9qO6eFlUETHtuihLcYOaLKByJ1f+N4kthcU9YjHy3N+B3hWv0y/2Nd0mu/7lTFnRQHTrSdXF50HQ3bl5fEnng==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" + "call-bound": "^1.0.2", + "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -9100,6 +10687,7 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "engines": { "node": ">=4" } @@ -9109,6 +10697,7 @@ "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -9121,6 +10710,7 @@ "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-3.0.1.tgz", "integrity": "sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==", "dev": true, + "license": "MIT", "dependencies": { "ci-info": "^3.2.0" }, @@ -9129,9 +10719,10 @@ } }, "node_modules/is-core-module": { - "version": "2.15.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz", - "integrity": "sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==", + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", + "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", + "license": "MIT", "dependencies": { "hasown": "^2.0.2" }, @@ -9146,6 +10737,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.1.tgz", "integrity": "sha512-bc4NlCDiCr28U4aEsQ3Qs2491gVq4V8G7MQyws968ImqjKuYtTJXrl7Vq7jsN7Ly/C3xj5KWFrY7sHNeDkAzXw==", + "license": "MIT", "dependencies": { "hasown": "^2.0.0" }, @@ -9154,11 +10746,14 @@ } }, "node_modules/is-data-view": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.1.tgz", - "integrity": "sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.2.tgz", + "integrity": "sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw==", "dev": true, + "license": "MIT", "dependencies": { + "call-bound": "^1.0.2", + "get-intrinsic": "^1.2.6", "is-typed-array": "^1.1.13" }, "engines": { @@ -9169,12 +10764,14 @@ } }, "node_modules/is-date-object": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", - "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.1.0.tgz", + "integrity": "sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==", "dev": true, + "license": "MIT", "dependencies": { - "has-tostringtag": "^1.0.0" + "call-bound": "^1.0.2", + "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -9188,6 +10785,7 @@ "resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-1.0.4.tgz", "integrity": "sha512-RGdriMmQQvZ2aqaQq3awNA6dCGtKpiDFcOzrTWrDAT2MiWrKQVPmxLGHl7Y2nNu6led0kEyoX0enY0qXYsv9zw==", "dev": true, + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -9197,6 +10795,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.3.tgz", "integrity": "sha512-JCNNGbwWZEVaSPtS45mdtrneRWJFp07LLmykxeFV5F6oBvNF8vHSfJuJgoT472pSfk+Mf8VnlrspaFBHWM8JAw==", + "license": "MIT", "dependencies": { "is-accessor-descriptor": "^1.0.1", "is-data-descriptor": "^1.0.1" @@ -9210,6 +10809,7 @@ "resolved": "https://registry.npmjs.org/is-expression/-/is-expression-4.0.0.tgz", "integrity": "sha512-zMIXX63sxzG3XrkHkrAPvm/OVZVSCPNkwMHU8oTX7/U3AL78I0QXCEICXUM13BIa8TYGZ68PiTKfQz3yaTNr4A==", "dev": true, + "license": "MIT", "dependencies": { "acorn": "^7.1.1", "object-assign": "^4.1.1" @@ -9220,6 +10820,7 @@ "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", "dev": true, + "license": "MIT", "bin": { "acorn": "bin/acorn" }, @@ -9231,6 +10832,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "license": "MIT", "dependencies": { "is-plain-object": "^2.0.4" }, @@ -9242,22 +10844,60 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "license": "MIT", "engines": { "node": ">=0.10.0" } }, + "node_modules/is-finalizationregistry": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.1.1.tgz", + "integrity": "sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", "engines": { "node": ">=8" } }, + "node_modules/is-generator-function": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.0.tgz", + "integrity": "sha512-nPUB5km40q9e8UfN/Zc24eLlzdSf9OfKByBw9CIdw4H1giPMeA0OIJvbchsCu4npfI2QcMVBsGEBHKZ7wLTWmQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "get-proto": "^1.0.0", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "license": "MIT", "dependencies": { "is-extglob": "^2.1.1" }, @@ -9270,6 +10910,7 @@ "resolved": "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-1.0.4.tgz", "integrity": "sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw==", "dev": true, + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -9280,6 +10921,7 @@ "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.4.0.tgz", "integrity": "sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ==", "dev": true, + "license": "MIT", "dependencies": { "global-dirs": "^3.0.0", "is-path-inside": "^3.0.2" @@ -9295,13 +10937,15 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz", "integrity": "sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==", + "license": "MIT", "optional": true }, - "node_modules/is-negative-zero": { + "node_modules/is-map": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", - "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", + "integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -9313,6 +10957,7 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "license": "MIT", "engines": { "node": ">=0.12.0" } @@ -9322,17 +10967,20 @@ "resolved": "https://registry.npmjs.org/is-number-like/-/is-number-like-1.0.8.tgz", "integrity": "sha512-6rZi3ezCyFcn5L71ywzz2bS5b2Igl1En3eTlZlvKjpz1n3IZLAYMbKYAIQgFmEu0GENg92ziU/faEOA/aixjbA==", "dev": true, + "license": "ISC", "dependencies": { "lodash.isfinite": "^3.3.2" } }, "node_modules/is-number-object": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", - "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.1.1.tgz", + "integrity": "sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==", "dev": true, + "license": "MIT", "dependencies": { - "has-tostringtag": "^1.0.0" + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -9346,6 +10994,7 @@ "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -9355,6 +11004,7 @@ "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -9363,6 +11013,7 @@ "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "license": "MIT", "dependencies": { "isobject": "^3.0.1" }, @@ -9374,16 +11025,20 @@ "version": "2.2.2", "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz", "integrity": "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/is-regex": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", - "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", + "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" + "call-bound": "^1.0.2", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" }, "engines": { "node": ">= 0.4" @@ -9397,6 +11052,7 @@ "resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-2.1.0.tgz", "integrity": "sha512-OZ4IlER3zmRIoB9AqNhEggVxqIH4ofDns5nRrPS6yQxXE1TPCUpFznBfRQmQa8uC+pXqjMnukiJBxCisIxiLGA==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } @@ -9405,6 +11061,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", + "license": "MIT", "dependencies": { "is-unc-path": "^1.0.0" }, @@ -9412,13 +11069,27 @@ "node": ">=0.10.0" } }, + "node_modules/is-set": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz", + "integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-shared-array-buffer": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", - "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.4.tgz", + "integrity": "sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.7" + "call-bound": "^1.0.3" }, "engines": { "node": ">= 0.4" @@ -9432,6 +11103,7 @@ "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" }, @@ -9440,12 +11112,14 @@ } }, "node_modules/is-string": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", - "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.1.1.tgz", + "integrity": "sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==", "dev": true, + "license": "MIT", "dependencies": { - "has-tostringtag": "^1.0.0" + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -9455,12 +11129,15 @@ } }, "node_modules/is-symbol": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", - "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.1.1.tgz", + "integrity": "sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==", "dev": true, + "license": "MIT", "dependencies": { - "has-symbols": "^1.0.2" + "call-bound": "^1.0.2", + "has-symbols": "^1.1.0", + "safe-regex-test": "^1.1.0" }, "engines": { "node": ">= 0.4" @@ -9470,12 +11147,13 @@ } }, "node_modules/is-typed-array": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", - "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.15.tgz", + "integrity": "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==", "dev": true, + "license": "MIT", "dependencies": { - "which-typed-array": "^1.1.14" + "which-typed-array": "^1.1.16" }, "engines": { "node": ">= 0.4" @@ -9488,12 +11166,14 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/is-unc-path": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", + "license": "MIT", "dependencies": { "unc-path-regex": "^0.1.2" }, @@ -9506,6 +11186,7 @@ "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, @@ -9513,13 +11194,47 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/is-weakmap": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", + "integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-weakref": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", - "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.1.0.tgz", + "integrity": "sha512-SXM8Nwyys6nT5WP6pltOwKytLV7FqQ4UiibxVmW+EIosHcmCqkkjViTb5SNssDlkCiEYRP1/pdWUKVvZBmsR2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakset": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.4.tgz", + "integrity": "sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.2" + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -9530,12 +11245,14 @@ "resolved": "https://registry.npmjs.org/is-what/-/is-what-3.14.1.tgz", "integrity": "sha512-sNxgpk9793nzSs7bA6JQJGeIuRBQhAaNGG77kzYQgMkrID+lS6SlK07K5LaptscDlSaIgH+GPFzf+d75FVxozA==", "dev": true, + "license": "MIT", "optional": true }, "node_modules/is-windows": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -9545,6 +11262,7 @@ "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", "integrity": "sha512-gfygJYZ2gLTDlmbWMI0CE2MwnFzSN/2SZfkMlItC4K/JBlsWVDB0bO6XhqcY13YXE7iMcAJnzTCJjPiTeJJ0Mw==", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } @@ -9553,17 +11271,20 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "license": "ISC" }, "node_modules/isobject": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -9572,13 +11293,15 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/jest-worker": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", "integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "@types/node": "*", @@ -9594,6 +11317,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "has-flag": "^4.0.0" @@ -9609,6 +11333,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/joycon/-/joycon-3.1.1.tgz", "integrity": "sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==", + "license": "MIT", "engines": { "node": ">=10" } @@ -9617,23 +11342,27 @@ "version": "2.6.4", "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.6.4.tgz", "integrity": "sha512-pZe//GGmwJndub7ZghVHz7vjb2LgC1m8B07Au3eYqeqv9emhESByMXxaEgkUkEqJe87oBbSniGYoQNIBklc7IQ==", - "dev": true + "dev": true, + "license": "BSD-3-Clause" }, "node_modules/js-stringify": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/js-stringify/-/js-stringify-1.0.2.tgz", "integrity": "sha512-rtS5ATOo2Q5k1G+DADISilDA6lv79zIiwFd6CcjuIxGKLFm5C+RLImRscVap9k55i+MOZwgliw+NejvkLuGD5g==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "license": "MIT" }, "node_modules/js-yaml": { "version": "3.14.1", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "license": "MIT", "dependencies": { "argparse": "^1.0.7", "esprima": "^4.0.0" @@ -9646,56 +11375,65 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz", "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==", + "license": "MIT", "optional": true }, "node_modules/jsesc": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "license": "MIT", "bin": { "jsesc": "bin/jsesc" }, "engines": { - "node": ">=4" + "node": ">=6" } }, "node_modules/json-buffer": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", - "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==" + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "license": "MIT" }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/json-schema": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", - "dev": true + "dev": true, + "license": "(AFL-2.1 OR BSD-3-Clause)" }, "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "license": "MIT" }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==" + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "license": "MIT" }, "node_modules/json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/json5": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "license": "MIT", "bin": { "json5": "lib/cli.js" }, @@ -9708,6 +11446,7 @@ "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-3.0.1.tgz", "integrity": "sha512-oBko6ZHlubVB5mRFkur5vgYR1UyqX+S6Y/oCfLhqNdcc2fYFlDpIoNc7AfKS1KOGcnNAkvsr0grLck9ANM815w==", "dev": true, + "license": "MIT", "optionalDependencies": { "graceful-fs": "^4.1.6" } @@ -9720,6 +11459,7 @@ "engines": [ "node >=0.6.0" ], + "license": "MIT", "dependencies": { "assert-plus": "1.0.0", "extsprintf": "1.3.0", @@ -9732,6 +11472,7 @@ "resolved": "https://registry.npmjs.org/jstransformer/-/jstransformer-1.0.0.tgz", "integrity": "sha512-C9YK3Rf8q6VAPDCCU9fnqo3mAfOH6vUGnMcP4AQAYIEpWtfGLpwOTmZ+igtdK5y+VvI2n3CyYSzy4Qh34eq24A==", "dev": true, + "license": "MIT", "dependencies": { "is-promise": "^2.0.0", "promise": "^7.0.1" @@ -9741,12 +11482,14 @@ "version": "4.2.1", "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.2.1.tgz", "integrity": "sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/keyv": { "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "license": "MIT", "dependencies": { "json-buffer": "3.0.1" } @@ -9755,6 +11498,7 @@ "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -9763,13 +11507,15 @@ "version": "0.20.0", "resolved": "https://registry.npmjs.org/known-css-properties/-/known-css-properties-0.20.0.tgz", "integrity": "sha512-URvsjaA9ypfreqJ2/ylDr5MUERhJZ+DhguoWRr2xgS5C7aGCalXo+ewL+GixgKBfhT2vuL02nbIgNGqVWgTOYw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/lazy-ass": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/lazy-ass/-/lazy-ass-1.6.0.tgz", "integrity": "sha512-cc8oEVoctTvsFZ/Oje/kGnHbpWHYBe8IAJe4C0QNc3t8uM/0Y8+erSz/7Y1ALuXTEZTMvxXwO6YbX1ey3ujiZw==", "dev": true, + "license": "MIT", "engines": { "node": "> 0.8" } @@ -9779,6 +11525,7 @@ "resolved": "https://registry.npmjs.org/less/-/less-3.13.1.tgz", "integrity": "sha512-SwA1aQXGUvp+P5XdZslUOhhLnClSLIjWvJhmd+Vgib5BFIr9lMNlQwmwUNOjXThF/A0x+MCYYPeWEfeWiLRnTw==", "dev": true, + "license": "Apache-2.0", "optional": true, "dependencies": { "copy-anything": "^2.0.1", @@ -9804,6 +11551,7 @@ "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "license": "MIT", "dependencies": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" @@ -9816,6 +11564,7 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/liftup/-/liftup-3.0.1.tgz", "integrity": "sha512-yRHaiQDizWSzoXk3APcA71eOI/UuhEkNN9DiW2Tt44mhYzX4joFoCZlxsSOF7RyeLlfqzFLQI1ngFq3ggMPhOw==", + "license": "MIT", "dependencies": { "extend": "^3.0.2", "findup-sync": "^4.0.0", @@ -9834,6 +11583,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-4.0.0.tgz", "integrity": "sha512-6jvvn/12IC4quLBL1KNokxC7wWTvYncaVUYSoxWw7YykPLuRrnv4qdHcSOywOI5RpkOVGeQRtWM8/q+G6W6qfQ==", + "license": "MIT", "dependencies": { "detect-file": "^1.0.0", "is-glob": "^4.0.0", @@ -9854,13 +11604,15 @@ "version": "1.2.4", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/listr2": { "version": "3.14.0", "resolved": "https://registry.npmjs.org/listr2/-/listr2-3.14.0.tgz", "integrity": "sha512-TyWI8G99GX9GjE54cJ+RrNMcIFBfwMPxc3XTFiAYGN4s10hWROGtOg7+O6u6LE3mNkyld7RSLE6nrKBvTfcs3g==", "dev": true, + "license": "MIT", "dependencies": { "cli-truncate": "^2.1.0", "colorette": "^2.0.16", @@ -9887,6 +11639,7 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/load-grunt-tasks/-/load-grunt-tasks-5.1.0.tgz", "integrity": "sha512-oNj0Jlka1TsfDe+9He0kcA1cRln+TMoTsEByW7ij6kyktNLxBKJtslCFEvFrLC2Dj0S19IWJh3fOCIjLby2Xrg==", + "license": "MIT", "dependencies": { "arrify": "^2.0.1", "multimatch": "^4.0.0", @@ -9905,6 +11658,7 @@ "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", "integrity": "sha512-3p6ZOGNbiX4CdvEd1VcE6yi78UrGNpjHO33noGwHCnT/o2fyllJDepsm8+mFFv/DvtwFHht5HIHSyOy5a+ChVQ==", "dev": true, + "license": "MIT", "dependencies": { "graceful-fs": "^4.1.2", "parse-json": "^2.2.0", @@ -9920,6 +11674,7 @@ "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz", "integrity": "sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==", "dev": true, + "license": "MIT", "peer": true, "engines": { "node": ">=6.11.5" @@ -9930,6 +11685,7 @@ "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-0.2.17.tgz", "integrity": "sha512-tiv66G0SmiOx+pLWMtGEkfSEejxvb6N6uRrQjfWJIT79W9GMpgKeCAmm9aVBKtd4WEgntciI8CsGqjpDoCWJug==", "dev": true, + "license": "MIT", "dependencies": { "big.js": "^3.1.3", "emojis-list": "^2.0.0", @@ -9942,6 +11698,7 @@ "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", "integrity": "sha512-4xrs1aW+6N5DalkqSVA8fxh458CXvR99WU8WLKmq4v8eWAL86Xo3BVqyd3SkA9wEVjCMqyvvRRkshAdOnBp5rw==", "dev": true, + "license": "MIT", "bin": { "json5": "lib/cli.js" } @@ -9951,6 +11708,7 @@ "resolved": "https://registry.npmjs.org/localtunnel/-/localtunnel-2.0.2.tgz", "integrity": "sha512-n418Cn5ynvJd7m/N1d9WVJISLJF/ellZnfsLnx8WBWGzxv/ntNcFkJ1o6se5quUhCplfLGBNL5tYHiq5WF3Nug==", "dev": true, + "license": "MIT", "dependencies": { "axios": "0.21.4", "debug": "4.3.2", @@ -9969,6 +11727,7 @@ "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", "dev": true, + "license": "MIT", "dependencies": { "follow-redirects": "^1.14.0" } @@ -9978,6 +11737,7 @@ "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", "dev": true, + "license": "ISC", "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.0", @@ -9989,6 +11749,7 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", "dev": true, + "license": "MIT", "dependencies": { "ms": "2.1.2" }, @@ -10001,11 +11762,19 @@ } } }, + "node_modules/localtunnel/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true, + "license": "MIT" + }, "node_modules/localtunnel/node_modules/yargs": { "version": "17.1.1", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.1.1.tgz", "integrity": "sha512-c2k48R0PwKIqKhPMWjeiF6y2xY/gPMUlro0sgxqXpbOIohWiLNXWslsootttv7E1e73QPAMQSg5FeySbVcpsPQ==", "dev": true, + "license": "MIT", "dependencies": { "cliui": "^7.0.2", "escalade": "^3.1.1", @@ -10024,6 +11793,7 @@ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, + "license": "MIT", "dependencies": { "p-locate": "^5.0.0" }, @@ -10037,56 +11807,67 @@ "node_modules/lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "license": "MIT" }, "node_modules/lodash.camelcase": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", - "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==" + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", + "license": "MIT" }, "node_modules/lodash.clonedeep": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==" + "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==", + "license": "MIT" }, "node_modules/lodash.debounce": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", - "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==" + "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==", + "license": "MIT" }, "node_modules/lodash.get": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", "integrity": "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==", - "dev": true + "deprecated": "This package is deprecated. Use the optional chaining (?.) operator instead.", + "dev": true, + "license": "MIT" }, "node_modules/lodash.isfinite": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/lodash.isfinite/-/lodash.isfinite-3.3.2.tgz", "integrity": "sha512-7FGG40uhC8Mm633uKW1r58aElFlBlxCrg9JfSi3P6aYiWmfiWF0PgMd86ZUsxE5GwWPdHoS2+48bwTh2VPkIQA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "license": "MIT" }, "node_modules/lodash.once": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/lodash.truncate": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", - "integrity": "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==" + "integrity": "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==", + "license": "MIT" }, "node_modules/log-symbols": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", "dev": true, + "license": "MIT", "dependencies": { "chalk": "^4.1.0", "is-unicode-supported": "^0.1.0" @@ -10103,6 +11884,7 @@ "resolved": "https://registry.npmjs.org/log-update/-/log-update-4.0.0.tgz", "integrity": "sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg==", "dev": true, + "license": "MIT", "dependencies": { "ansi-escapes": "^4.3.0", "cli-cursor": "^3.1.0", @@ -10121,6 +11903,7 @@ "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", "astral-regex": "^2.0.0", @@ -10138,6 +11921,7 @@ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -10152,6 +11936,7 @@ "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-2.0.4.tgz", "integrity": "sha512-vM6rUVCVUJJt33bnmHiZEvr7wPT78ztX7rojL+LW51bHtLh6HTjx84LA5W4+oa6aKEJA7jJu5LR6vQRBpA5DVg==", "dev": true, + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -10161,6 +11946,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "license": "MIT", "dependencies": { "js-tokens": "^3.0.0 || ^4.0.0" }, @@ -10172,6 +11958,7 @@ "version": "7.14.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.14.0.tgz", "integrity": "sha512-EIRtP1GrSJny0dqb50QXRUNBxHJhcpxHC++M5tD7RYbvLLn5KVWKsbyswSSqDuU15UFi3bgTQIY8nhDMeF6aDQ==", + "license": "ISC", "engines": { "node": ">=12" } @@ -10180,6 +11967,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "license": "MIT", "dependencies": { "pify": "^4.0.1", "semver": "^5.6.0" @@ -10192,6 +11980,7 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "license": "MIT", "engines": { "node": ">=6" } @@ -10200,6 +11989,7 @@ "version": "5.7.2", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "license": "ISC", "bin": { "semver": "bin/semver" } @@ -10208,6 +11998,7 @@ "version": "9.1.0", "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-9.1.0.tgz", "integrity": "sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg==", + "license": "ISC", "optional": true, "dependencies": { "agentkeepalive": "^4.1.3", @@ -10235,6 +12026,7 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "license": "ISC", "optional": true, "dependencies": { "yallist": "^4.0.0" @@ -10247,6 +12039,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz", "integrity": "sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==", + "license": "MIT", "dependencies": { "kind-of": "^6.0.2" }, @@ -10258,6 +12051,7 @@ "version": "0.2.2", "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", "integrity": "sha512-8y/eV9QQZCiyn1SprXSrCmqJN0yNRATe+PO8ztwqrvrbdRLA3eYJF0yaR0YayLWkMbsQSKWS9N2gPcGEc4UsZg==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -10267,6 +12061,7 @@ "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz", "integrity": "sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" }, @@ -10278,6 +12073,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", "integrity": "sha512-4y7uGv8bd2WdM9vpQsiQNo41Ln1NvhvDRuVt0k2JZQ+ezN2uaQes7lZeZ+QQUHOLQAtDaBJ+7wCbi+ab/KFs+w==", + "license": "MIT", "dependencies": { "object-visit": "^1.0.0" }, @@ -10289,6 +12085,7 @@ "version": "11.1.1", "resolved": "https://registry.npmjs.org/marked/-/marked-11.1.1.tgz", "integrity": "sha512-EgxRjgK9axsQuUa/oKMx5DEY8oXpKJfk61rT5iY3aRlgU6QJtUcxU5OAymdhCvWvhYcd9FKmO5eQoX8m9VGJXg==", + "license": "MIT", "bin": { "marked": "bin/marked.js" }, @@ -10296,11 +12093,22 @@ "node": ">= 18" } }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/mathml-tag-names": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz", "integrity": "sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg==", "dev": true, + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -10311,6 +12119,7 @@ "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-0.8.5.tgz", "integrity": "sha512-2hkTXtYYnr+NubD/g6KGBS/0mFmBcifAsI0yIWRiRo0PjVs6SSOSOdtzbp6kSGnShDN6G5aWZpKQ2lWRy27mWQ==", "dev": true, + "license": "MIT", "dependencies": { "@types/mdast": "^3.0.0", "mdast-util-to-string": "^2.0.0", @@ -10328,6 +12137,7 @@ "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-0.6.5.tgz", "integrity": "sha512-XeV9sDE7ZlOQvs45C9UKMtfTcctcaj/pGwH8YLbMHoMOXNNCn2LsqVQOqrF1+/NU8lKDAqozme9SCXWyo9oAcQ==", "dev": true, + "license": "MIT", "dependencies": { "@types/unist": "^2.0.0", "longest-streak": "^2.0.0", @@ -10346,6 +12156,7 @@ "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-2.0.0.tgz", "integrity": "sha512-AW4DRS3QbBayY/jJmD8437V1Gombjf8RSOUCMFBuo5iHi58AGEgVCKQ+ezHkZZDpAQS75hcBMpLqjpJTjtUL7w==", "dev": true, + "license": "MIT", "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" @@ -10356,6 +12167,7 @@ "resolved": "https://registry.npmjs.org/meow/-/meow-8.1.2.tgz", "integrity": "sha512-r85E3NdZ+mpYk1C6RjPFEMSE+s1iZMuHtsHAqY0DT3jZczl0diWUZ8g6oU7h0M9cD2EL+PzaYghhCLzR0ZNn5Q==", "dev": true, + "license": "MIT", "dependencies": { "@types/minimist": "^1.2.0", "camelcase-keys": "^6.2.2", @@ -10381,6 +12193,7 @@ "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, + "license": "MIT", "dependencies": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" @@ -10394,6 +12207,7 @@ "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", "dev": true, + "license": "ISC", "dependencies": { "lru-cache": "^6.0.0" }, @@ -10406,6 +12220,7 @@ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, + "license": "MIT", "dependencies": { "p-locate": "^4.1.0" }, @@ -10418,6 +12233,7 @@ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, + "license": "ISC", "dependencies": { "yallist": "^4.0.0" }, @@ -10430,6 +12246,7 @@ "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz", "integrity": "sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "hosted-git-info": "^4.0.1", "is-core-module": "^2.5.0", @@ -10445,6 +12262,7 @@ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, + "license": "MIT", "dependencies": { "p-try": "^2.0.0" }, @@ -10460,6 +12278,7 @@ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, + "license": "MIT", "dependencies": { "p-limit": "^2.2.0" }, @@ -10472,6 +12291,7 @@ "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", "dev": true, + "license": "MIT", "dependencies": { "@babel/code-frame": "^7.0.0", "error-ex": "^1.3.1", @@ -10490,6 +12310,7 @@ "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", "dev": true, + "license": "MIT", "dependencies": { "@types/normalize-package-data": "^2.4.0", "normalize-package-data": "^2.5.0", @@ -10505,6 +12326,7 @@ "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", "dev": true, + "license": "MIT", "dependencies": { "find-up": "^4.1.0", "read-pkg": "^5.2.0", @@ -10522,6 +12344,7 @@ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", "dev": true, + "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=8" } @@ -10530,13 +12353,15 @@ "version": "2.8.9", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/meow/node_modules/read-pkg/node_modules/normalize-package-data": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "hosted-git-info": "^2.1.4", "resolve": "^1.10.0", @@ -10549,6 +12374,7 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true, + "license": "ISC", "bin": { "semver": "bin/semver" } @@ -10558,6 +12384,7 @@ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", "dev": true, + "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=8" } @@ -10567,6 +12394,7 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "dev": true, + "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -10579,6 +12407,7 @@ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.18.1.tgz", "integrity": "sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw==", "dev": true, + "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=10" }, @@ -10591,6 +12420,7 @@ "resolved": "https://registry.npmjs.org/merge-source-map/-/merge-source-map-1.1.0.tgz", "integrity": "sha512-Qkcp7P2ygktpMPh2mCQZaf3jhN6D3Z/qVZHSdWvQ+2Ef5HgRAPBO57A77+ENm0CPx2+1Ce/MYKi3ymqdfuqibw==", "dev": true, + "license": "MIT", "dependencies": { "source-map": "^0.6.1" } @@ -10599,13 +12429,15 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 8" } @@ -10625,6 +12457,7 @@ "url": "https://opencollective.com/unified" } ], + "license": "MIT", "dependencies": { "debug": "^4.0.0", "parse-entities": "^2.0.0" @@ -10634,6 +12467,7 @@ "version": "4.0.8", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "license": "MIT", "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" @@ -10647,6 +12481,7 @@ "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", "dev": true, + "license": "MIT", "optional": true, "bin": { "mime": "cli.js" @@ -10659,6 +12494,7 @@ "version": "1.53.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.53.0.tgz", "integrity": "sha512-oHlN/w+3MQ3rba9rqFr6V/ypF10LSkdwUysQL7GkXoTgIWeV+tcXGA852TBxH+gsh8UWoyhR1hKcoMJTuWflpg==", + "license": "MIT", "engines": { "node": ">= 0.6" } @@ -10667,6 +12503,7 @@ "version": "2.1.35", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", "dependencies": { "mime-db": "1.52.0" }, @@ -10678,6 +12515,7 @@ "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", "engines": { "node": ">= 0.6" } @@ -10687,6 +12525,7 @@ "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } @@ -10695,6 +12534,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", + "license": "MIT", "engines": { "node": ">=10" }, @@ -10707,6 +12547,7 @@ "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } @@ -10715,6 +12556,7 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -10726,6 +12568,7 @@ "version": "1.2.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -10735,6 +12578,7 @@ "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", "dev": true, + "license": "MIT", "dependencies": { "arrify": "^1.0.1", "is-plain-obj": "^1.1.0", @@ -10749,6 +12593,7 @@ "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", "integrity": "sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -10757,6 +12602,7 @@ "version": "3.3.6", "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "license": "ISC", "dependencies": { "yallist": "^4.0.0" }, @@ -10768,6 +12614,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-1.0.2.tgz", "integrity": "sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==", + "license": "ISC", "optional": true, "dependencies": { "minipass": "^3.0.0" @@ -10780,6 +12627,7 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-1.4.1.tgz", "integrity": "sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw==", + "license": "MIT", "optional": true, "dependencies": { "minipass": "^3.1.0", @@ -10797,6 +12645,7 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz", "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==", + "license": "ISC", "optional": true, "dependencies": { "minipass": "^3.0.0" @@ -10809,6 +12658,7 @@ "version": "1.2.4", "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==", + "license": "ISC", "optional": true, "dependencies": { "minipass": "^3.0.0" @@ -10821,6 +12671,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz", "integrity": "sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==", + "license": "ISC", "optional": true, "dependencies": { "minipass": "^3.0.0" @@ -10833,6 +12684,7 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "license": "MIT", "dependencies": { "minipass": "^3.0.0", "yallist": "^4.0.0" @@ -10845,12 +12697,14 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/mitt/-/mitt-1.2.0.tgz", "integrity": "sha512-r6lj77KlwqLhIUku9UWYes7KJtsczvolZkzp8hbaDPPaE24OmWl5s539Mytlj22siEQKosZ26qCBgda2PKwoJw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/mixin-deep": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", + "license": "MIT", "dependencies": { "for-in": "^1.0.2", "is-extendable": "^1.0.1" @@ -10863,6 +12717,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "license": "MIT", "bin": { "mkdirp": "bin/cmd.js" }, @@ -10873,13 +12728,15 @@ "node_modules/mkdirp-classic": { "version": "0.5.3", "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", - "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==" + "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", + "license": "MIT" }, "node_modules/mocha": { "version": "8.4.0", "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.4.0.tgz", "integrity": "sha512-hJaO0mwDXmZS4ghXsvPVriOhsxQ7ofcpQdm8dE+jISUOKopitvnXFQmpRR7jd2K6VBG6E26gU3IAbXXGIbu4sQ==", "dev": true, + "license": "MIT", "dependencies": { "@ungap/promise-all-settled": "1.1.2", "ansi-colors": "4.1.1", @@ -10924,6 +12781,7 @@ "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } @@ -10932,13 +12790,15 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true + "dev": true, + "license": "Python-2.0" }, "node_modules/mocha/node_modules/chokidar": { "version": "3.5.1", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.1.tgz", "integrity": "sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw==", "dev": true, + "license": "MIT", "dependencies": { "anymatch": "~3.1.1", "braces": "~3.0.2", @@ -10960,6 +12820,7 @@ "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", "dev": true, + "license": "ISC", "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.0", @@ -10971,6 +12832,7 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", "dev": true, + "license": "MIT", "dependencies": { "ms": "2.1.2" }, @@ -10987,7 +12849,8 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/mocha/node_modules/glob": { "version": "7.1.6", @@ -10995,6 +12858,7 @@ "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, + "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -11015,6 +12879,7 @@ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.0.0.tgz", "integrity": "sha512-pqon0s+4ScYUvX30wxQi3PogGFAlUyH0awepWvwkj4jD4v+ova3RiYw8bmA6x2rDrEaj8i/oWKoRxpVNW+Re8Q==", "dev": true, + "license": "MIT", "dependencies": { "argparse": "^2.0.1" }, @@ -11027,6 +12892,7 @@ "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.0.0.tgz", "integrity": "sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA==", "dev": true, + "license": "MIT", "dependencies": { "chalk": "^4.0.0" }, @@ -11039,6 +12905,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -11046,17 +12913,12 @@ "node": "*" } }, - "node_modules/mocha/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - }, "node_modules/mocha/node_modules/readdirp": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz", "integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==", "dev": true, + "license": "MIT", "dependencies": { "picomatch": "^2.2.1" }, @@ -11069,6 +12931,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -11084,6 +12947,7 @@ "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", "dev": true, + "license": "MIT", "dependencies": { "cliui": "^7.0.2", "escalade": "^3.1.1", @@ -11100,17 +12964,20 @@ "node_modules/mout": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/mout/-/mout-1.2.4.tgz", - "integrity": "sha512-mZb9uOruMWgn/fw28DG4/yE3Kehfk1zKCLhuDU2O3vlKdnBBr4XaOCqVTflJ5aODavGUPqFHZgrFX3NJVuxGhQ==" + "integrity": "sha512-mZb9uOruMWgn/fw28DG4/yE3Kehfk1zKCLhuDU2O3vlKdnBBr4XaOCqVTflJ5aODavGUPqFHZgrFX3NJVuxGhQ==", + "license": "MIT" }, "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" }, "node_modules/multihashes": { "version": "0.4.15", "resolved": "https://registry.npmjs.org/multihashes/-/multihashes-0.4.15.tgz", "integrity": "sha512-G/Smj1GWqw1RQP3dRuRRPe3oyLqvPqUaEDIaoi7JF7Loxl4WAWvhJNk84oyDEodSucv0MmSW/ZT0RKUrsIFD3g==", + "license": "MIT", "dependencies": { "bs58": "^4.0.1", "varint": "^5.0.0" @@ -11120,6 +12987,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-4.0.0.tgz", "integrity": "sha512-lDmx79y1z6i7RNx0ZGCPq1bzJ6ZoDDKbvh7jxr9SJcWLkShMzXrHbYVpTdnhNM5MXpDUxCQ4DgqVttVXlBgiBQ==", + "license": "MIT", "dependencies": { "@types/minimatch": "^3.0.3", "array-differ": "^3.0.0", @@ -11136,6 +13004,7 @@ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.20.tgz", "integrity": "sha512-a1cQNyczgKbLX9jwbS/+d7W8fX/RfgYR7lVWwWOGIPNgK2m0MWvrGF6/m4kk6U3QcFMnZf3RIhL0v2Jgh/0Uxw==", "dev": true, + "license": "MIT", "bin": { "nanoid": "bin/nanoid.cjs" }, @@ -11147,6 +13016,7 @@ "version": "1.2.13", "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "license": "MIT", "dependencies": { "arr-diff": "^4.0.0", "array-unique": "^0.3.2", @@ -11165,27 +13035,31 @@ } }, "node_modules/napi-build-utils": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", - "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-2.0.0.tgz", + "integrity": "sha512-GEbrYkbfF7MoNaoh2iGG84Mnf/WZfB0GdGEsM8wz7Expx/LlWf5U8t9nvJKXSp3qr5IsEbK04cBGhol/KwOsWA==", + "license": "MIT" }, "node_modules/native-request": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/native-request/-/native-request-1.1.2.tgz", "integrity": "sha512-/etjwrK0J4Ebbcnt35VMWnfiUX/B04uwGJxyJInagxDqf2z5drSt/lsOvEMWGYunz1kaLZAFrV4NDAbOoDKvAQ==", "dev": true, + "license": "MIT", "optional": true }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==" + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "license": "MIT" }, "node_modules/negotiator": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", "devOptional": true, + "license": "MIT", "engines": { "node": ">= 0.6" } @@ -11195,6 +13069,7 @@ "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "dev": true, + "license": "MIT", "peer": true }, "node_modules/nise": { @@ -11202,6 +13077,7 @@ "resolved": "https://registry.npmjs.org/nise/-/nise-4.1.0.tgz", "integrity": "sha512-eQMEmGN/8arp0xsvGoQ+B1qvSkR73B1nWSCh7nOt5neMCtwcQVYQGdzQMhcNscktTsWB54xnlSQFzOAPJD8nXA==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "@sinonjs/commons": "^1.7.0", "@sinonjs/fake-timers": "^6.0.0", @@ -11211,9 +13087,10 @@ } }, "node_modules/node-abi": { - "version": "3.67.0", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.67.0.tgz", - "integrity": "sha512-bLn/fU/ALVBE9wj+p4Y21ZJWYFjUXLXPi/IewyLZkx3ApxKDNBWCKdReeKOtD8dWpOdDCeMyLh6ZewzcLsG2Nw==", + "version": "3.73.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.73.0.tgz", + "integrity": "sha512-z8iYzQGBu35ZkTQ9mtR8RqugJZ9RCLn8fv3d7LsgDBzOijGQP3RdKTX4LA7LXw03ZhU5z0l4xfhIMgSES31+cg==", + "license": "MIT", "dependencies": { "semver": "^7.3.5" }, @@ -11225,6 +13102,7 @@ "version": "7.6.3", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -11235,12 +13113,14 @@ "node_modules/node-addon-api": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.1.tgz", - "integrity": "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==" + "integrity": "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==", + "license": "MIT" }, "node_modules/node-gyp": { "version": "8.4.1", "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-8.4.1.tgz", "integrity": "sha512-olTJRgUtAb/hOXG0E93wZDs5YiJlgbXxTwQAFHyNlRsXQnYzUaF2aGgujZbw+hR8aF4ZG/rST57bWMWD16jr9w==", + "license": "MIT", "optional": true, "dependencies": { "env-paths": "^2.2.0", @@ -11266,6 +13146,7 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "deprecated": "Glob versions prior to v9 are no longer supported", + "license": "ISC", "optional": true, "dependencies": { "fs.realpath": "^1.0.0", @@ -11286,6 +13167,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "license": "ISC", "optional": true, "dependencies": { "abbrev": "1" @@ -11301,6 +13183,7 @@ "version": "7.6.3", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "license": "ISC", "optional": true, "bin": { "semver": "bin/semver.js" @@ -11314,19 +13197,22 @@ "resolved": "https://registry.npmjs.org/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz", "integrity": "sha512-JMaRS9L4wSRIR+6PTVEikTrq/lMGEZR43a48ETeilY0Q0iMwVnccMFrUM1k+tNzmYuIU0Vh710bCUqHX+/+ctQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/node-releases": { - "version": "2.0.18", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz", - "integrity": "sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==" + "version": "2.0.19", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz", + "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==", + "license": "MIT" }, "node_modules/nopt": { "version": "3.0.6", "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", "integrity": "sha512-4GUt3kSEYmk4ITxzB/b9vaIDfUVWN/Ml1Fwl11IlnIG2iaJ9O6WXZ9SrYM9NLI8OCBieN2Y8SWC2oJV0RQ7qYg==", + "license": "ISC", "dependencies": { "abbrev": "1" }, @@ -11339,6 +13225,7 @@ "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "hosted-git-info": "^2.1.4", "resolve": "^1.10.0", @@ -11351,6 +13238,7 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true, + "license": "ISC", "bin": { "semver": "bin/semver" } @@ -11360,6 +13248,7 @@ "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -11369,6 +13258,7 @@ "resolved": "https://registry.npmjs.org/normalize-range/-/normalize-range-0.1.2.tgz", "integrity": "sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -11377,13 +13267,15 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/normalize-selector/-/normalize-selector-0.2.0.tgz", "integrity": "sha512-dxvWdI8gw6eAvk9BlPffgEoGfM7AdijoCwOEJge3e3ulT2XLgmU7KvvxprOaCu05Q1uGRHmOhHe1r6emZoKyFw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/npm-run-path": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", "dev": true, + "license": "MIT", "dependencies": { "path-key": "^3.0.0" }, @@ -11396,6 +13288,7 @@ "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-6.0.2.tgz", "integrity": "sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==", "deprecated": "This package is no longer supported.", + "license": "ISC", "optional": true, "dependencies": { "are-we-there-yet": "^3.0.0", @@ -11412,6 +13305,7 @@ "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "boolbase": "^1.0.0" }, @@ -11423,13 +13317,15 @@ "version": "1.2.2", "resolved": "https://registry.npmjs.org/num2fraction/-/num2fraction-1.2.2.tgz", "integrity": "sha512-Y1wZESM7VUThYY+4W+X4ySH2maqcA+p7UR+w8VWNWVAd6lwuXXWz/w/Cz43J/dI2I+PS6wD5N+bJUF+gjWvIqg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -11438,6 +13334,7 @@ "version": "0.1.0", "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", "integrity": "sha512-79LYn6VAb63zgtmAteVOWo9Vdj71ZVBy3Pbse+VqxDpEP83XuujMrGqHIwAXJ5I/aM0zU7dIyIAhifVTPrNItQ==", + "license": "MIT", "dependencies": { "copy-descriptor": "^0.1.0", "define-property": "^0.2.5", @@ -11451,6 +13348,7 @@ "version": "0.2.5", "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", + "license": "MIT", "dependencies": { "is-descriptor": "^0.1.0" }, @@ -11461,12 +13359,14 @@ "node_modules/object-copy/node_modules/is-buffer": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "license": "MIT" }, "node_modules/object-copy/node_modules/is-descriptor": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.7.tgz", "integrity": "sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg==", + "license": "MIT", "dependencies": { "is-accessor-descriptor": "^1.0.1", "is-data-descriptor": "^1.0.1" @@ -11479,6 +13379,7 @@ "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "license": "MIT", "dependencies": { "is-buffer": "^1.1.5" }, @@ -11487,10 +13388,11 @@ } }, "node_modules/object-inspect": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", - "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", + "version": "1.13.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz", + "integrity": "sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -11503,6 +13405,7 @@ "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" } @@ -11511,6 +13414,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", "integrity": "sha512-GBaMwwAVK9qbQN3Scdo0OyvgPW7l3lnaVMj84uTOZlswkX0KpF6fyDBJhtTthf7pymztoN36/KEr1DyhF96zEA==", + "license": "MIT", "dependencies": { "isobject": "^3.0.0" }, @@ -11519,14 +13423,17 @@ } }, "node_modules/object.assign": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", - "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.7.tgz", + "integrity": "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.5", + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", "define-properties": "^1.2.1", - "has-symbols": "^1.0.3", + "es-object-atoms": "^1.0.0", + "has-symbols": "^1.1.0", "object-keys": "^1.1.1" }, "engines": { @@ -11540,6 +13447,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz", "integrity": "sha512-c/K0mw/F11k4dEUBMW8naXUuBuhxRCfG7W+yFy8EcijU/rSmazOUd1XAEEe6bC0OuXY4HUKjTJv7xbxIMqdxrA==", + "license": "MIT", "dependencies": { "array-each": "^1.0.1", "array-slice": "^1.0.0", @@ -11554,6 +13462,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/object.map/-/object.map-1.0.1.tgz", "integrity": "sha512-3+mAJu2PLfnSVGHwIWubpOFLscJANBKuB/6A4CxBstc4aqwQY0FWcsppuy4jU5GSB95yES5JHSI+33AWuS4k6w==", + "license": "MIT", "dependencies": { "for-own": "^1.0.0", "make-iterator": "^1.0.0" @@ -11566,6 +13475,7 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", "integrity": "sha512-tqa/UMy/CCoYmj+H5qc07qvSL9dqcs/WZENZ1JbtWBlATP+iVOe778gE6MSijnyCnORzDuX6hU+LA4SZ09YjFQ==", + "license": "MIT", "dependencies": { "isobject": "^3.0.1" }, @@ -11574,12 +13484,14 @@ } }, "node_modules/object.values": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.0.tgz", - "integrity": "sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.1.tgz", + "integrity": "sha512-gXah6aZrcUxjWg2zR2MwouP2eHlCBzdV4pygudehaKXSGW4v2AsRQUK+lwwXhii6KFZcunEnmSUoYp5CXibxtA==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", "define-properties": "^1.2.1", "es-object-atoms": "^1.0.0" }, @@ -11594,6 +13506,7 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/on-exit-leak-free/-/on-exit-leak-free-2.1.2.tgz", "integrity": "sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA==", + "license": "MIT", "engines": { "node": ">=14.0.0" } @@ -11603,6 +13516,7 @@ "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", "integrity": "sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==", "dev": true, + "license": "MIT", "dependencies": { "ee-first": "1.1.1" }, @@ -11614,6 +13528,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "license": "ISC", "dependencies": { "wrappy": "1" } @@ -11623,6 +13538,7 @@ "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", "dev": true, + "license": "MIT", "dependencies": { "mimic-fn": "^2.1.0" }, @@ -11637,13 +13553,15 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/openurl/-/openurl-1.1.1.tgz", "integrity": "sha512-d/gTkTb1i1GKz5k3XE3XFV/PxQ1k45zDqGP2OA7YhgsaLoqm6qRvARAZOFer1fcXritWlGBRCu/UgeS4HAnXAA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/opn": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/opn/-/opn-5.3.0.tgz", "integrity": "sha512-bYJHo/LOmoTd+pfiYhfZDnf9zekVJrY+cnS2a5F2x+w5ppvTqObojTP7WiFG+kVZs9Inw+qQ/lw7TroWwhdd2g==", "dev": true, + "license": "MIT", "dependencies": { "is-wsl": "^1.1.0" }, @@ -11655,6 +13573,7 @@ "version": "0.9.4", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "license": "MIT", "dependencies": { "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", @@ -11671,6 +13590,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", "integrity": "sha512-B5JU3cabzk8c67mRRd3ECmROafjYMXbuzlwtqdM8IbS8ktlTix8aFGb2bAGKrSRIlnfKwovGUUr72JUPyOb6kQ==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -11679,6 +13599,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -11688,6 +13609,7 @@ "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", "deprecated": "This package is no longer supported.", + "license": "ISC", "dependencies": { "os-homedir": "^1.0.0", "os-tmpdir": "^1.0.0" @@ -11697,13 +13619,33 @@ "version": "1.2.2", "resolved": "https://registry.npmjs.org/ospath/-/ospath-1.2.2.tgz", "integrity": "sha512-o6E5qJV5zkAbIDNhGSIlyOhScKXgQrSRMilfph0clDfM0nEnBOlKlH4sWDmG95BW/CvwNz0vmm7dJVtU2KlMiA==", - "dev": true + "dev": true, + "license": "MIT" + }, + "node_modules/own-keys": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/own-keys/-/own-keys-1.0.1.tgz", + "integrity": "sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.2.6", + "object-keys": "^1.1.1", + "safe-push-apply": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, + "license": "MIT", "dependencies": { "yocto-queue": "^0.1.0" }, @@ -11719,6 +13661,7 @@ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, + "license": "MIT", "dependencies": { "p-limit": "^3.0.2" }, @@ -11734,6 +13677,7 @@ "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", "devOptional": true, + "license": "MIT", "dependencies": { "aggregate-error": "^3.0.0" }, @@ -11748,6 +13692,7 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "license": "MIT", "engines": { "node": ">=6" } @@ -11756,6 +13701,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "license": "MIT", "dependencies": { "callsites": "^3.0.0" }, @@ -11768,6 +13714,7 @@ "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-2.0.0.tgz", "integrity": "sha512-kkywGpCcRYhqQIchaWqZ875wzpS/bMKhz5HnN3p7wveJTkTtyAB/AlnS0f8DFSqYW1T82t6yEAkEcB+A1I3MbQ==", "dev": true, + "license": "MIT", "dependencies": { "character-entities": "^1.0.0", "character-entities-legacy": "^1.0.0", @@ -11785,6 +13732,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.2.tgz", "integrity": "sha512-FwdRXKCohSVeXqwtYonZTXtbGJKrn+HNyWDYVcp5yuJlesTwNH4rsmRZ+GrKAPJ5bLpRxESMeS+Rl0VCHRvB2Q==", + "license": "MIT", "dependencies": { "is-absolute": "^1.0.0", "map-cache": "^0.2.0", @@ -11799,6 +13747,7 @@ "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", "integrity": "sha512-QR/GGaKCkhwk1ePQNYDRKYZ3mwU9ypsKhB0XyFnLQdomyEqk3e8wpW3V5Jp88zbxK4n5ST1nqo+g9juTpownhQ==", "dev": true, + "license": "MIT", "dependencies": { "error-ex": "^1.2.0" }, @@ -11810,29 +13759,32 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", "integrity": "sha512-1Y1A//QUXEZK7YKz+rD9WydcE1+EuPr6ZBgKecAB8tmoW6UFv0NREVJe1p+jRxtThkcbbKkfwIbWJe/IeE6m2Q==", + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/parse5": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", - "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.2.1.tgz", + "integrity": "sha512-BuBYQYlv1ckiPdQi/ohiivi9Sagc9JG+Ozs0r7b/0iK3sKmrb0b9FdWdBbOdx6hBCM/F9Ir82ofnBhtZOjCRPQ==", "dev": true, + "license": "MIT", "dependencies": { - "entities": "^4.4.0" + "entities": "^4.5.0" }, "funding": { "url": "https://github.com/inikulin/parse5?sponsor=1" } }, "node_modules/parse5-htmlparser2-tree-adapter": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.0.0.tgz", - "integrity": "sha512-B77tOZrqqfUfnVcOrUvfdLbz4pu4RopLD/4vmu3HUPswwTA8OH0EMW9BlWR2B0RCoiZRAHEUu7IxeP1Pd1UU+g==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.1.0.tgz", + "integrity": "sha512-ruw5xyKs6lrpo9x9rCZqZZnIUntICjQAd0Wsmp396Ul9lN/h+ifgVV1x1gZHi8euej6wTfpqX8j+BFQxF0NS/g==", "dev": true, + "license": "MIT", "dependencies": { - "domhandler": "^5.0.2", + "domhandler": "^5.0.3", "parse5": "^7.0.0" }, "funding": { @@ -11844,6 +13796,7 @@ "resolved": "https://registry.npmjs.org/parse5-parser-stream/-/parse5-parser-stream-7.1.2.tgz", "integrity": "sha512-JyeQc9iwFLn5TbvvqACIF/VXG6abODeB3Fwmv/TGdLk2LfbWkaySGY72at4+Ty7EkPZj854u4CrICqNk2qIbow==", "dev": true, + "license": "MIT", "dependencies": { "parse5": "^7.0.0" }, @@ -11856,6 +13809,7 @@ "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.8" } @@ -11864,6 +13818,7 @@ "version": "0.1.1", "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", "integrity": "sha512-XHXfu/yOQRy9vYOtUDVMN60OEJjW013GoObG1o+xwQTpB9eYJX/BjXMsdW13ZDPruFhYYn0AG22w0xgQMwl3Nw==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -11872,6 +13827,8 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -11880,6 +13837,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -11888,6 +13846,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "license": "MIT", "engines": { "node": ">=8" } @@ -11895,12 +13854,14 @@ "node_modules/path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "license": "MIT" }, "node_modules/path-root": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/path-root/-/path-root-0.1.1.tgz", "integrity": "sha512-QLcPegTHF11axjfojBIoDygmS2E3Lf+8+jI6wOVmNVenrKSo3mFdSGiIgdSHenczw3wPtlVMQaFVwGmM7BJdtg==", + "license": "MIT", "dependencies": { "path-root-regex": "^0.1.0" }, @@ -11912,15 +13873,17 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/path-root-regex/-/path-root-regex-0.1.2.tgz", "integrity": "sha512-4GlJ6rZDhQZFE0DPVKh0e9jmZ5egZfxTkp7bcRDuPlJXbAwhxcl2dINPUAsjLdejqaLsCeg8axcLjIbvBjN4pQ==", + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/path-to-regexp": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", - "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.9.0.tgz", + "integrity": "sha512-xIp7/apCFJuUHdDLWe8O1HIkb0kQrOMb/0u6FXQjemHn/ii5LrIzU6bdECnsiTF/GjZkMEKg1xdiZwNqDYlZ6g==", "dev": true, + "license": "MIT", "dependencies": { "isarray": "0.0.1" } @@ -11929,13 +13892,15 @@ "version": "0.0.1", "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/path-type": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", "integrity": "sha512-dUnb5dXUf+kzhC/W/F4e5/SkluXIFf5VUHolW1Eg1irn1hGWjPGdsRcvYJ1nD6lhk8Ir7VM0bHJKsYTx8Jx9OQ==", "dev": true, + "license": "MIT", "dependencies": { "pify": "^2.0.0" }, @@ -11947,23 +13912,27 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/picocolors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", - "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==" + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" }, "node_modules/picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "license": "MIT", "engines": { "node": ">=8.6" }, @@ -11976,6 +13945,7 @@ "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -11984,6 +13954,7 @@ "version": "8.19.0", "resolved": "https://registry.npmjs.org/pino/-/pino-8.19.0.tgz", "integrity": "sha512-oswmokxkav9bADfJ2ifrvfHUwad6MLp73Uat0IkQWY3iAw5xTRoznXbXksZs8oaOUMpmhVWD+PZogNzllWpJaA==", + "license": "MIT", "dependencies": { "atomic-sleep": "^1.0.0", "fast-redact": "^3.1.1", @@ -12005,6 +13976,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/pino-abstract-transport/-/pino-abstract-transport-1.1.0.tgz", "integrity": "sha512-lsleG3/2a/JIWUtf9Q5gUNErBqwIu1tUKTT3dUzaf5DySw9ra1wcqKjJjLX1VTY64Wk1eEOYsVGSaGfCK85ekA==", + "license": "MIT", "dependencies": { "readable-stream": "^4.0.0", "split2": "^4.0.0" @@ -12014,6 +13986,7 @@ "version": "10.3.1", "resolved": "https://registry.npmjs.org/pino-pretty/-/pino-pretty-10.3.1.tgz", "integrity": "sha512-az8JbIYeN/1iLj2t0jR9DV48/LQ3RC6hZPpapKPkb84Q+yTidMCpgWxIT3N0flnBDilyBQ1luWNpOeJptjdp/g==", + "license": "MIT", "dependencies": { "colorette": "^2.0.7", "dateformat": "^4.6.3", @@ -12038,6 +14011,7 @@ "version": "4.6.3", "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-4.6.3.tgz", "integrity": "sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA==", + "license": "MIT", "engines": { "node": "*" } @@ -12045,12 +14019,14 @@ "node_modules/pino-std-serializers": { "version": "6.2.2", "resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-6.2.2.tgz", - "integrity": "sha512-cHjPPsE+vhj/tnhCy/wiMh3M3z3h/j15zHQX+S9GkTBgqJuTuJzYJ4gUyACLhDaJ7kk9ba9iRDmbH2tJU03OiA==" + "integrity": "sha512-cHjPPsE+vhj/tnhCy/wiMh3M3z3h/j15zHQX+S9GkTBgqJuTuJzYJ4gUyACLhDaJ7kk9ba9iRDmbH2tJU03OiA==", + "license": "MIT" }, "node_modules/pirates": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==", + "license": "MIT", "engines": { "node": ">= 6" } @@ -12059,6 +14035,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "license": "MIT", "dependencies": { "find-up": "^3.0.0" }, @@ -12070,6 +14047,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "license": "MIT", "dependencies": { "locate-path": "^3.0.0" }, @@ -12081,6 +14059,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "license": "MIT", "dependencies": { "p-locate": "^3.0.0", "path-exists": "^3.0.0" @@ -12093,6 +14072,7 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "license": "MIT", "dependencies": { "p-try": "^2.0.0" }, @@ -12107,6 +14087,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "license": "MIT", "dependencies": { "p-limit": "^2.0.0" }, @@ -12118,6 +14099,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", + "license": "MIT", "engines": { "node": ">=4" } @@ -12126,6 +14108,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-3.1.0.tgz", "integrity": "sha512-nDywThFk1i4BQK4twPQ6TA4RT8bDY96yeuCVBWL3ePARCiEKDRSrNGbFIgUJpLp+XeIR65v8ra7WuJOFUBtkMA==", + "license": "MIT", "dependencies": { "find-up": "^3.0.0" }, @@ -12137,6 +14120,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "license": "MIT", "dependencies": { "locate-path": "^3.0.0" }, @@ -12148,6 +14132,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "license": "MIT", "dependencies": { "p-locate": "^3.0.0", "path-exists": "^3.0.0" @@ -12160,6 +14145,7 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "license": "MIT", "dependencies": { "p-try": "^2.0.0" }, @@ -12174,6 +14160,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "license": "MIT", "dependencies": { "p-limit": "^2.0.0" }, @@ -12185,6 +14172,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", + "license": "MIT", "engines": { "node": ">=4" } @@ -12194,6 +14182,7 @@ "resolved": "https://registry.npmjs.org/portscanner/-/portscanner-2.2.0.tgz", "integrity": "sha512-IFroCz/59Lqa2uBvzK3bKDbDDIEaAY8XJ1jFxcLWTqosrsc32//P4VuSB2vZXoHiHqOmx8B5L5hnKOxL/7FlPw==", "dev": true, + "license": "MIT", "dependencies": { "async": "^2.6.0", "is-number-like": "^1.0.3" @@ -12208,6 +14197,7 @@ "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", "integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==", "dev": true, + "license": "MIT", "dependencies": { "lodash": "^4.17.14" } @@ -12216,6 +14206,7 @@ "version": "0.1.1", "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", "integrity": "sha512-xTgYBc3fuo7Yt7JbiuFxSYGToMoz8fLoE6TC9Wx1P/u+LfeThMOAqmuyECnlBaaJb+u1m9hHiXUEtwW4OzfUJg==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -12225,14 +14216,15 @@ "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" } }, "node_modules/postcss": { - "version": "8.4.41", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.41.tgz", - "integrity": "sha512-TesUflQ0WKZqAvg52PWL6kHgLKP6xB6heTOdoYM0Wt2UHyxNa4K25EZZMgKns3BH1RLVbZCREPpLY0rhnNoHVQ==", + "version": "8.5.1", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.1.tgz", + "integrity": "sha512-6oz2beyjc5VMn/KV1pPw8fliQkhBXrVn1Z3TVyqZxU8kZpzEKhBdmCFqI6ZbmGtamQvQGuU1sgPTk8ZrXDD7jQ==", "dev": true, "funding": [ { @@ -12248,11 +14240,12 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "peer": true, "dependencies": { - "nanoid": "^3.3.7", - "picocolors": "^1.0.1", - "source-map-js": "^1.2.0" + "nanoid": "^3.3.8", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" }, "engines": { "node": "^10 || ^12 || >=14" @@ -12263,6 +14256,7 @@ "resolved": "https://registry.npmjs.org/postcss-html/-/postcss-html-0.36.0.tgz", "integrity": "sha512-HeiOxGcuwID0AFsNAL0ox3mW6MHH5cstWN1Z3Y+n6H+g12ih7LHdYxWwEA/QmrebctLjo79xz9ouK3MroHwOJw==", "dev": true, + "license": "MIT", "dependencies": { "htmlparser2": "^3.10.0" }, @@ -12276,6 +14270,7 @@ "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.2.tgz", "integrity": "sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g==", "dev": true, + "license": "MIT", "dependencies": { "domelementtype": "^2.0.1", "entities": "^2.0.0" @@ -12291,13 +14286,15 @@ "type": "github", "url": "https://github.com/sponsors/fb55" } - ] + ], + "license": "BSD-2-Clause" }, "node_modules/postcss-html/node_modules/dom-serializer/node_modules/entities": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz", "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==", "dev": true, + "license": "BSD-2-Clause", "funding": { "url": "https://github.com/fb55/entities?sponsor=1" } @@ -12306,13 +14303,15 @@ "version": "1.3.1", "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz", "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==", - "dev": true + "dev": true, + "license": "BSD-2-Clause" }, "node_modules/postcss-html/node_modules/domhandler": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.2.tgz", "integrity": "sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "domelementtype": "1" } @@ -12322,6 +14321,7 @@ "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.7.0.tgz", "integrity": "sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "dom-serializer": "0", "domelementtype": "1" @@ -12331,13 +14331,15 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==", - "dev": true + "dev": true, + "license": "BSD-2-Clause" }, "node_modules/postcss-html/node_modules/htmlparser2": { "version": "3.10.1", "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.1.tgz", "integrity": "sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ==", "dev": true, + "license": "MIT", "dependencies": { "domelementtype": "^1.3.1", "domhandler": "^2.3.0", @@ -12352,6 +14354,7 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dev": true, + "license": "MIT", "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -12366,6 +14369,7 @@ "resolved": "https://registry.npmjs.org/postcss-less/-/postcss-less-3.1.4.tgz", "integrity": "sha512-7TvleQWNM2QLcHqvudt3VYjULVB49uiW6XzEUFmvwHzvsOEF5MwBrIXZDJQvJNFGjJQTzSzZnDoCJ8h/ljyGXA==", "dev": true, + "license": "MIT", "dependencies": { "postcss": "^7.0.14" }, @@ -12377,13 +14381,15 @@ "version": "0.2.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-0.2.1.tgz", "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/postcss-less/node_modules/postcss": { "version": "7.0.39", "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.39.tgz", "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", "dev": true, + "license": "MIT", "dependencies": { "picocolors": "^0.2.1", "source-map": "^0.6.1" @@ -12400,13 +14406,15 @@ "version": "0.2.3", "resolved": "https://registry.npmjs.org/postcss-media-query-parser/-/postcss-media-query-parser-0.2.3.tgz", "integrity": "sha512-3sOlxmbKcSHMjlUXQZKQ06jOswE7oVkXPxmZdoB1r5l0q6gTFTQSHxNxOrCccElbW7dxNytifNEo8qidX2Vsig==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/postcss-modules-local-by-default": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-1.2.0.tgz", "integrity": "sha512-X4cquUPIaAd86raVrBwO8fwRfkIdbwFu7CTfEOjiZQHVQwlHRSkTgH5NLDmMm5+1hQO8u6dZ+TOOJDbay1hYpA==", "dev": true, + "license": "MIT", "dependencies": { "css-selector-tokenizer": "^0.7.0", "postcss": "^6.0.1" @@ -12417,6 +14425,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^1.9.0" }, @@ -12429,6 +14438,7 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -12443,6 +14453,7 @@ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, + "license": "MIT", "dependencies": { "color-name": "1.1.3" } @@ -12451,13 +14462,15 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/postcss-modules-local-by-default/node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.8.0" } @@ -12467,6 +14480,7 @@ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } @@ -12476,6 +14490,7 @@ "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.23.tgz", "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", "dev": true, + "license": "MIT", "dependencies": { "chalk": "^2.4.1", "source-map": "^0.6.1", @@ -12490,6 +14505,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^3.0.0" }, @@ -12502,6 +14518,7 @@ "resolved": "https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-1.1.0.tgz", "integrity": "sha512-LTYwnA4C1He1BKZXIx1CYiHixdSe9LWYVKadq9lK5aCCMkoOkFyZ7aigt+srfjlRplJY3gIol6KUNefdMQJdlw==", "dev": true, + "license": "ISC", "dependencies": { "css-selector-tokenizer": "^0.7.0", "postcss": "^6.0.1" @@ -12512,6 +14529,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^1.9.0" }, @@ -12524,6 +14542,7 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -12538,6 +14557,7 @@ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, + "license": "MIT", "dependencies": { "color-name": "1.1.3" } @@ -12546,13 +14566,15 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/postcss-modules-scope/node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.8.0" } @@ -12562,6 +14584,7 @@ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } @@ -12571,6 +14594,7 @@ "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.23.tgz", "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", "dev": true, + "license": "MIT", "dependencies": { "chalk": "^2.4.1", "source-map": "^0.6.1", @@ -12585,6 +14609,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^3.0.0" }, @@ -12597,6 +14622,7 @@ "resolved": "https://registry.npmjs.org/postcss-modules-sync/-/postcss-modules-sync-1.0.0.tgz", "integrity": "sha512-kIDk2NYmxHshqUbjtFf1WdBij08IsvRdgDT0nOGWhvwkr8/z1piLSzxVrPt56J4DU6ON986h2H+5xcBnFhT8UQ==", "dev": true, + "license": "MIT", "dependencies": { "generic-names": "^1.0.2", "icss-replace-symbols": "^1.0.2", @@ -12611,6 +14637,7 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -12620,6 +14647,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -12629,6 +14657,7 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^2.2.1", "escape-string-regexp": "^1.0.2", @@ -12645,6 +14674,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.8.0" } @@ -12654,6 +14684,7 @@ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.8.0" } @@ -12663,6 +14694,7 @@ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", "integrity": "sha512-DyYHfIYwAJmjAjSSPKANxI8bFY9YtFrgkAfinBojQ8YJTOuOuav64tMUJv584SES4xl74PmuaevIyaLESHdTAA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -12672,6 +14704,7 @@ "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", "dev": true, + "license": "MIT", "dependencies": { "chalk": "^1.1.3", "js-base64": "^2.1.9", @@ -12687,6 +14720,7 @@ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } @@ -12696,6 +14730,7 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", "dev": true, + "license": "MIT", "dependencies": { "ansi-regex": "^2.0.0" }, @@ -12708,6 +14743,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", "integrity": "sha512-Jds2VIYDrlp5ui7t8abHN2bjAu4LV/q4N2KivFPpGH0lrka0BMq/33AmECUXlKPcHigkNaqfXRENFju+rlcy+A==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^1.0.0" }, @@ -12719,13 +14755,15 @@ "version": "0.1.6", "resolved": "https://registry.npmjs.org/postcss-resolve-nested-selector/-/postcss-resolve-nested-selector-0.1.6.tgz", "integrity": "sha512-0sglIs9Wmkzbr8lQwEyIzlDOOC9bGmfVKcJTaxv3vMmd3uo4o4DerC3En0bnmgceeql9BfC8hRkp7cg0fjdVqw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/postcss-safe-parser": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/postcss-safe-parser/-/postcss-safe-parser-4.0.2.tgz", "integrity": "sha512-Uw6ekxSWNLCPesSv/cmqf2bY/77z11O7jZGPax3ycZMFU/oi2DMH9i89AdHc1tRwFg/arFoEwX0IS3LCUxJh1g==", "dev": true, + "license": "MIT", "dependencies": { "postcss": "^7.0.26" }, @@ -12737,13 +14775,15 @@ "version": "0.2.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-0.2.1.tgz", "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/postcss-safe-parser/node_modules/postcss": { "version": "7.0.39", "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.39.tgz", "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", "dev": true, + "license": "MIT", "dependencies": { "picocolors": "^0.2.1", "source-map": "^0.6.1" @@ -12761,6 +14801,7 @@ "resolved": "https://registry.npmjs.org/postcss-sass/-/postcss-sass-0.4.4.tgz", "integrity": "sha512-BYxnVYx4mQooOhr+zer0qWbSPYnarAy8ZT7hAQtbxtgVf8gy+LSLT/hHGe35h14/pZDTw1DsxdbrwxBN++H+fg==", "dev": true, + "license": "MIT", "dependencies": { "gonzales-pe": "^4.3.0", "postcss": "^7.0.21" @@ -12770,13 +14811,15 @@ "version": "0.2.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-0.2.1.tgz", "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/postcss-sass/node_modules/postcss": { "version": "7.0.39", "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.39.tgz", "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", "dev": true, + "license": "MIT", "dependencies": { "picocolors": "^0.2.1", "source-map": "^0.6.1" @@ -12794,6 +14837,7 @@ "resolved": "https://registry.npmjs.org/postcss-scss/-/postcss-scss-2.1.1.tgz", "integrity": "sha512-jQmGnj0hSGLd9RscFw9LyuSVAa5Bl1/KBPqG1NQw9w8ND55nY4ZEsdlVuYJvLPpV+y0nwTV5v/4rHPzZRihQbA==", "dev": true, + "license": "MIT", "dependencies": { "postcss": "^7.0.6" }, @@ -12805,13 +14849,15 @@ "version": "0.2.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-0.2.1.tgz", "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/postcss-scss/node_modules/postcss": { "version": "7.0.39", "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.39.tgz", "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", "dev": true, + "license": "MIT", "dependencies": { "picocolors": "^0.2.1", "source-map": "^0.6.1" @@ -12829,6 +14875,7 @@ "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.2.tgz", "integrity": "sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==", "dev": true, + "license": "MIT", "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" @@ -12842,6 +14889,7 @@ "resolved": "https://registry.npmjs.org/postcss-syntax/-/postcss-syntax-0.36.2.tgz", "integrity": "sha512-nBRg/i7E3SOHWxF3PpF5WnJM/jQ1YpY9000OaVXlAQj6Zp/kIqJxEDWIZ67tAd7NLuk7zqN4yqe9nc0oNAOs1w==", "dev": true, + "license": "MIT", "peerDependencies": { "postcss": ">=5.0.0" } @@ -12850,12 +14898,13 @@ "version": "4.2.0", "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/postcss/node_modules/nanoid": { - "version": "3.3.7", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", - "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "version": "3.3.8", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz", + "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", "dev": true, "funding": [ { @@ -12863,6 +14912,7 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "peer": true, "bin": { "nanoid": "bin/nanoid.cjs" @@ -12872,16 +14922,17 @@ } }, "node_modules/prebuild-install": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.2.tgz", - "integrity": "sha512-UnNke3IQb6sgarcZIDU3gbMeTp/9SSU1DAIkil7PrqG1vZlBtY5msYccSKSHDqa3hNg436IXK+SNImReuA1wEQ==", + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.3.tgz", + "integrity": "sha512-8Mf2cbV7x1cXPUILADGI3wuhfqWvtiLA1iclTDbFRZkgRQS0NqsPZphna9V+HyTEadheuPmjaJMsbzKQFOzLug==", + "license": "MIT", "dependencies": { "detect-libc": "^2.0.0", "expand-template": "^2.0.3", "github-from-package": "0.0.0", "minimist": "^1.2.3", "mkdirp-classic": "^0.5.3", - "napi-build-utils": "^1.0.1", + "napi-build-utils": "^2.0.0", "node-abi": "^3.3.0", "pump": "^3.0.0", "rc": "^1.2.7", @@ -12900,6 +14951,7 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "license": "MIT", "engines": { "node": ">= 0.8.0" } @@ -12909,6 +14961,7 @@ "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", "dev": true, + "license": "MIT", "optional": true, "bin": { "prettier": "bin-prettier.js" @@ -12925,6 +14978,7 @@ "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz", "integrity": "sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" }, @@ -12936,6 +14990,7 @@ "version": "0.11.10", "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", + "license": "MIT", "engines": { "node": ">= 0.6.0" } @@ -12943,12 +14998,14 @@ "node_modules/process-warning": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/process-warning/-/process-warning-3.0.0.tgz", - "integrity": "sha512-mqn0kFRl0EoqhnL0GQ0veqFHyIN1yig9RHh/InzORTUiZHFRAur+aMtRkELNwGs9aNwKS6tg/An4NYBPGwvtzQ==" + "integrity": "sha512-mqn0kFRl0EoqhnL0GQ0veqFHyIN1yig9RHh/InzORTUiZHFRAur+aMtRkELNwGs9aNwKS6tg/An4NYBPGwvtzQ==", + "license": "MIT" }, "node_modules/progress": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "license": "MIT", "engines": { "node": ">=0.4.0" } @@ -12958,6 +15015,7 @@ "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", "integrity": "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==", "dev": true, + "license": "MIT", "dependencies": { "asap": "~2.0.3" } @@ -12966,12 +15024,14 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", "integrity": "sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==", + "license": "ISC", "optional": true }, "node_modules/promise-retry": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==", + "license": "MIT", "optional": true, "dependencies": { "err-code": "^2.0.2", @@ -12985,32 +15045,30 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.0.0.tgz", "integrity": "sha512-F2JHgJQ1iqwnHDcQjVBsq3n/uoaFL+iPW/eAeL7kVxy/2RrWaN4WroKjjvbsoRtv0ftelNyC01bjRhn/bhcf4A==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/prr": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", "integrity": "sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==", "dev": true, + "license": "MIT", "optional": true }, "node_modules/pseudomap": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", "integrity": "sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==", - "dev": true - }, - "node_modules/psl": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", - "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/pug": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/pug/-/pug-3.0.3.tgz", "integrity": "sha512-uBi6kmc9f3SZ3PXxqcHiUZLmIXgfgWooKWXcwSGwQd2Zi5Rb0bT14+8CJjJgI8AB+nndLaNgHGrcc6bPIB665g==", "dev": true, + "license": "MIT", "dependencies": { "pug-code-gen": "^3.0.3", "pug-filters": "^4.0.0", @@ -13027,6 +15085,7 @@ "resolved": "https://registry.npmjs.org/pug-attrs/-/pug-attrs-3.0.0.tgz", "integrity": "sha512-azINV9dUtzPMFQktvTXciNAfAuVh/L/JCl0vtPCwvOA21uZrC08K/UnmrL+SXGEVc1FwzjW62+xw5S/uaLj6cA==", "dev": true, + "license": "MIT", "dependencies": { "constantinople": "^4.0.1", "js-stringify": "^1.0.2", @@ -13038,6 +15097,7 @@ "resolved": "https://registry.npmjs.org/pug-code-gen/-/pug-code-gen-3.0.3.tgz", "integrity": "sha512-cYQg0JW0w32Ux+XTeZnBEeuWrAY7/HNE6TWnhiHGnnRYlCgyAUPoyh9KzCMa9WhcJlJ1AtQqpEYHc+vbCzA+Aw==", "dev": true, + "license": "MIT", "dependencies": { "constantinople": "^4.0.1", "doctypes": "^1.1.0", @@ -13053,13 +15113,15 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/pug-error/-/pug-error-2.1.0.tgz", "integrity": "sha512-lv7sU9e5Jk8IeUheHata6/UThZ7RK2jnaaNztxfPYUY+VxZyk/ePVaNZ/vwmH8WqGvDz3LrNYt/+gA55NDg6Pg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/pug-filters": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/pug-filters/-/pug-filters-4.0.0.tgz", "integrity": "sha512-yeNFtq5Yxmfz0f9z2rMXGw/8/4i1cCFecw/Q7+D0V2DdtII5UvqE12VaZ2AY7ri6o5RNXiweGH79OCq+2RQU4A==", "dev": true, + "license": "MIT", "dependencies": { "constantinople": "^4.0.1", "jstransformer": "1.0.0", @@ -13073,6 +15135,7 @@ "resolved": "https://registry.npmjs.org/pug-lexer/-/pug-lexer-5.0.1.tgz", "integrity": "sha512-0I6C62+keXlZPZkOJeVam9aBLVP2EnbeDw3An+k0/QlqdwH6rv8284nko14Na7c0TtqtogfWXcRoFE4O4Ff20w==", "dev": true, + "license": "MIT", "dependencies": { "character-parser": "^2.2.0", "is-expression": "^4.0.0", @@ -13084,6 +15147,7 @@ "resolved": "https://registry.npmjs.org/pug-linker/-/pug-linker-4.0.0.tgz", "integrity": "sha512-gjD1yzp0yxbQqnzBAdlhbgoJL5qIFJw78juN1NpTLt/mfPJ5VgC4BvkoD3G23qKzJtIIXBbcCt6FioLSFLOHdw==", "dev": true, + "license": "MIT", "dependencies": { "pug-error": "^2.0.0", "pug-walk": "^2.0.0" @@ -13094,6 +15158,7 @@ "resolved": "https://registry.npmjs.org/pug-lint/-/pug-lint-2.7.0.tgz", "integrity": "sha512-CcFFU9+cXu/0xXXQbE1Zus0u9l3OCXqU+2sw4NcnFGEml8RoCUqrSdVNoVkg2SYcNvcfcnV6h+ctmE5+Ptgj1w==", "dev": true, + "license": "ISC", "dependencies": { "acorn": "^4.0.1", "commander": "^2.9.0", @@ -13118,6 +15183,7 @@ "resolved": "git+https://git@github.com/okTurtles/pug-lint-vue.git#619952b834296a98e807691019ef6c2f70540df0", "integrity": "sha512-9xyQr/pLNM97ny4I9CXPUZoPea/+WN0XZTX7VD3F6S7jPS3yCZr857PldSjbtsr78hXcUoIxoU/fLRrWg9v1+g==", "dev": true, + "license": "MIT", "dependencies": { "chalk": "^4.0.0", "cheerio": "^1.0.0-rc.3", @@ -13136,6 +15202,7 @@ "resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.13.tgz", "integrity": "sha512-fu2ygVGuMmlzG8ZeRJ0bvR41nsAkxxhbyk8bZ1SS521Z7vmgJFTQQlfz/Mp/nJexGBz+v8sC9bM6+lNgskt4Ug==", "dev": true, + "license": "MIT", "bin": { "acorn": "bin/acorn" }, @@ -13147,13 +15214,15 @@ "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/pug-lint/node_modules/constantinople": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/constantinople/-/constantinople-3.1.2.tgz", "integrity": "sha512-yePcBqEFhLOqSBtwYOGGS1exHo/s1xjekXiinh4itpNQGCu4KA1euPh1fg07N2wMITZXQkBz75Ntdt1ctGZouw==", "dev": true, + "license": "MIT", "dependencies": { "@types/babel-types": "^7.0.0", "@types/babylon": "^6.16.2", @@ -13167,6 +15236,7 @@ "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, + "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -13187,6 +15257,7 @@ "resolved": "https://registry.npmjs.org/is-expression/-/is-expression-3.0.0.tgz", "integrity": "sha512-vyMeQMq+AiH5uUnoBfMTwf18tO3bM6k1QXBE9D6ueAAquEfCZe3AJPtud9g6qS0+4X8xA7ndpZiDyeb2l2qOBw==", "dev": true, + "license": "MIT", "dependencies": { "acorn": "~4.0.2", "object-assign": "^4.0.1" @@ -13197,6 +15268,7 @@ "resolved": "https://registry.npmjs.org/pug-attrs/-/pug-attrs-2.0.4.tgz", "integrity": "sha512-TaZ4Z2TWUPDJcV3wjU3RtUXMrd3kM4Wzjbe3EWnSsZPsJ3LDI0F3yCnf2/W7PPFF+edUFQ0HgDL1IoxSz5K8EQ==", "dev": true, + "license": "MIT", "dependencies": { "constantinople": "^3.0.1", "js-stringify": "^1.0.1", @@ -13207,13 +15279,15 @@ "version": "1.3.3", "resolved": "https://registry.npmjs.org/pug-error/-/pug-error-1.3.3.tgz", "integrity": "sha512-qE3YhESP2mRAWMFJgKdtT5D7ckThRScXRwkfo+Erqga7dyJdY3ZquspprMCj/9sJ2ijm5hXFWQE/A3l4poMWiQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/pug-lint/node_modules/pug-lexer": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/pug-lexer/-/pug-lexer-4.1.0.tgz", "integrity": "sha512-i55yzEBtjm0mlplW4LoANq7k3S8gDdfC6+LThGEvsK4FuobcKfDAwt6V4jKPH9RtiE3a2Akfg5UpafZ1OksaPA==", "dev": true, + "license": "MIT", "dependencies": { "character-parser": "^2.1.1", "is-expression": "^3.0.0", @@ -13224,13 +15298,15 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/pug-runtime/-/pug-runtime-2.0.5.tgz", "integrity": "sha512-P+rXKn9un4fQY77wtpcuFyvFaBww7/91f3jHa154qU26qFAnOe6SW1CbIDcxiG5lLK9HazYrMCCuDvNgDQNptw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/pug-lint/node_modules/strip-json-comments": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -13240,6 +15316,7 @@ "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-2.0.1.tgz", "integrity": "sha512-qZKX4RnBzH2ugr8Lxa7x+0V6XD9Sb/ouARtiasEQCHB1EVU4NXtmHsDDrx1dO4ne5fc3J6EW05BP1Dl0z0iung==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -13249,6 +15326,7 @@ "resolved": "https://registry.npmjs.org/pug-load/-/pug-load-3.0.0.tgz", "integrity": "sha512-OCjTEnhLWZBvS4zni/WUMjH2YSUosnsmjGBB1An7CsKQarYSWQ0GCVyd4eQPMFJqZ8w9xgs01QdiZXKVjk92EQ==", "dev": true, + "license": "MIT", "dependencies": { "object-assign": "^4.1.1", "pug-walk": "^2.0.0" @@ -13259,6 +15337,7 @@ "resolved": "https://registry.npmjs.org/pug-parser/-/pug-parser-6.0.0.tgz", "integrity": "sha512-ukiYM/9cH6Cml+AOl5kETtM9NR3WulyVP2y4HOU45DyMim1IeP/OOiyEWRr6qk5I5klpsBnbuHpwKmTx6WURnw==", "dev": true, + "license": "MIT", "dependencies": { "pug-error": "^2.0.0", "token-stream": "1.0.0" @@ -13269,6 +15348,7 @@ "resolved": "https://registry.npmjs.org/pug-plain-loader/-/pug-plain-loader-1.1.0.tgz", "integrity": "sha512-1nYgIJLaahRuHJHhzSPODV44aZfb00bO7kiJiMkke6Hj4SVZftuvx6shZ4BOokk50dJc2RSFqNUBOlus0dniFQ==", "dev": true, + "license": "MIT", "dependencies": { "loader-utils": "^1.1.0" }, @@ -13281,6 +15361,7 @@ "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", "dev": true, + "license": "MIT", "engines": { "node": "*" } @@ -13290,6 +15371,7 @@ "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", "dev": true, + "license": "MIT", "engines": { "node": ">= 4" } @@ -13299,6 +15381,7 @@ "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", "dev": true, + "license": "MIT", "dependencies": { "minimist": "^1.2.0" }, @@ -13311,6 +15394,7 @@ "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.2.tgz", "integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==", "dev": true, + "license": "MIT", "dependencies": { "big.js": "^5.2.2", "emojis-list": "^3.0.0", @@ -13324,13 +15408,15 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/pug-runtime/-/pug-runtime-3.0.1.tgz", "integrity": "sha512-L50zbvrQ35TkpHwv0G6aLSuueDRwc/97XdY8kL3tOT0FmhgG7UypU3VztfV/LATAvmUfYi4wNxSajhSAeNN+Kg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/pug-strip-comments": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/pug-strip-comments/-/pug-strip-comments-2.0.0.tgz", "integrity": "sha512-zo8DsDpH7eTkPHCXFeAk1xZXJbyoTfdPlNR0bK7rpOMuhBYb0f5qUVCO1xlsitYd3w5FQTK7zpNVKb3rZoUrrQ==", "dev": true, + "license": "MIT", "dependencies": { "pug-error": "^2.0.0" } @@ -13339,12 +15425,14 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/pug-walk/-/pug-walk-2.0.0.tgz", "integrity": "sha512-yYELe9Q5q9IQhuvqsZNwA5hfPkMJ8u92bQLIMcsMxf/VADjNtEYptU+inlufAFYcWdHlwNfZOEnOOQrZrcyJCQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.2.tgz", + "integrity": "sha512-tUPXtzlGM8FE3P0ZL6DVs/3P58k9nk8/jZeQCurTJylQA8qFYzHFfhBJkuqyE0FifOsQ0uKWekiZ5g8wtr28cw==", + "license": "MIT", "dependencies": { "end-of-stream": "^1.1.0", "once": "^1.3.1" @@ -13354,6 +15442,7 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "license": "MIT", "engines": { "node": ">=6" } @@ -13361,23 +15450,19 @@ "node_modules/qrious": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/qrious/-/qrious-4.0.2.tgz", - "integrity": "sha512-xWPJIrK1zu5Ypn898fBp8RHkT/9ibquV2Kv24S/JY9VYEhMBMKur1gHVsOiNUh7PHP9uCgejjpZUHUIXXKoU/g==" + "integrity": "sha512-xWPJIrK1zu5Ypn898fBp8RHkT/9ibquV2Kv24S/JY9VYEhMBMKur1gHVsOiNUh7PHP9uCgejjpZUHUIXXKoU/g==", + "license": "GPL-3.0" }, "node_modules/qs": { "version": "6.2.3", "resolved": "https://registry.npmjs.org/qs/-/qs-6.2.3.tgz", "integrity": "sha512-AY4g8t3LMboim0t6XWFdz6J5OuJ1ZNYu54SXihS/OMpgyCqYmcAJnWqkNSOjSjWmq3xxy+GF9uWQI2lI/7tKIA==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.6" } }, - "node_modules/querystringify": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", - "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", - "dev": true - }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -13396,18 +15481,21 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "MIT" }, "node_modules/quick-format-unescaped": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz", - "integrity": "sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==" + "integrity": "sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==", + "license": "MIT" }, "node_modules/quick-lru": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -13417,6 +15505,7 @@ "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", "dev": true, + "license": "MIT", "dependencies": { "safe-buffer": "^5.1.0" } @@ -13426,6 +15515,7 @@ "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.6" } @@ -13435,6 +15525,7 @@ "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", "dev": true, + "license": "MIT", "dependencies": { "bytes": "3.1.2", "http-errors": "2.0.0", @@ -13450,6 +15541,7 @@ "resolved": "https://registry.npmjs.org/raw-loader/-/raw-loader-4.0.2.tgz", "integrity": "sha512-ZnScIV3ag9A4wPX/ZayxL/jZH+euYb6FcUinPcgiQW0+UBtEv0O6Q3lGd3cqJ+GHH+rksEv3Pj99oxJ3u3VIKA==", "dev": true, + "license": "MIT", "dependencies": { "loader-utils": "^2.0.0", "schema-utils": "^3.0.0" @@ -13470,6 +15562,7 @@ "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", "dev": true, + "license": "MIT", "engines": { "node": "*" } @@ -13479,6 +15572,7 @@ "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", "dev": true, + "license": "MIT", "engines": { "node": ">= 4" } @@ -13488,6 +15582,7 @@ "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", "dev": true, + "license": "MIT", "dependencies": { "big.js": "^5.2.2", "emojis-list": "^3.0.0", @@ -13501,6 +15596,7 @@ "version": "1.2.8", "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "license": "(BSD-2-Clause OR MIT OR Apache-2.0)", "dependencies": { "deep-extend": "^0.6.0", "ini": "~1.3.0", @@ -13514,12 +15610,14 @@ "node_modules/rc/node_modules/ini": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "license": "ISC" }, "node_modules/rc/node_modules/strip-json-comments": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -13529,6 +15627,7 @@ "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", "integrity": "sha512-eFIBOPW7FGjzBuk3hdXEuNSiTZS/xEMlH49HxMyzb0hyPfu4EhVjT2DH32K1hSSmVq4sebAWnZuuY5auISUTGA==", "dev": true, + "license": "MIT", "dependencies": { "load-json-file": "^2.0.0", "normalize-package-data": "^2.3.2", @@ -13543,6 +15642,7 @@ "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", "integrity": "sha512-1orxQfbWGUiTn9XsPlChs6rLie/AV9jwZTGmu2NZw/CUDJQchXJFYE0Fq5j7+n558T1JhDWLdhyd1Zj+wLY//w==", "dev": true, + "license": "MIT", "dependencies": { "find-up": "^2.0.0", "read-pkg": "^2.0.0" @@ -13556,6 +15656,7 @@ "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", "integrity": "sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==", "dev": true, + "license": "MIT", "dependencies": { "locate-path": "^2.0.0" }, @@ -13568,6 +15669,7 @@ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", "integrity": "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==", "dev": true, + "license": "MIT", "dependencies": { "p-locate": "^2.0.0", "path-exists": "^3.0.0" @@ -13581,6 +15683,7 @@ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", "dev": true, + "license": "MIT", "dependencies": { "p-try": "^1.0.0" }, @@ -13593,6 +15696,7 @@ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", "integrity": "sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==", "dev": true, + "license": "MIT", "dependencies": { "p-limit": "^1.1.0" }, @@ -13605,6 +15709,7 @@ "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", "integrity": "sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } @@ -13614,14 +15719,16 @@ "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/readable-stream": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz", - "integrity": "sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.7.0.tgz", + "integrity": "sha512-oIGGmcpTLwPga8Bn6/Z75SVaH1z5dUut2ibSyAMVhmUggWpmDn2dapB0n7f8nwaSiRtepAsfJyfXIO5DCVAODg==", + "license": "MIT", "dependencies": { "abort-controller": "^3.0.0", "buffer": "^6.0.3", @@ -13638,6 +15745,7 @@ "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", "dev": true, + "license": "MIT", "dependencies": { "picomatch": "^2.2.1" }, @@ -13649,6 +15757,7 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/real-require/-/real-require-0.2.0.tgz", "integrity": "sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg==", + "license": "MIT", "engines": { "node": ">= 12.13.0" } @@ -13657,6 +15766,7 @@ "version": "0.7.1", "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.1.tgz", "integrity": "sha512-/njmZ8s1wVeR6pjTZ+0nCnv8SpZNRMT2D1RLOJQESlYFDBvwpTA4KWJpZ+sBJ4+vhjILRcK7JIFdGCdxEAAitg==", + "license": "MIT", "dependencies": { "resolve": "^1.9.0" }, @@ -13669,6 +15779,7 @@ "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", "dev": true, + "license": "MIT", "dependencies": { "indent-string": "^4.0.0", "strip-indent": "^3.0.0" @@ -13677,15 +15788,40 @@ "node": ">=8" } }, + "node_modules/reflect.getprototypeof": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz", + "integrity": "sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.9", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.7", + "get-proto": "^1.0.1", + "which-builtin-type": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/regenerate": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", - "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==" + "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==", + "license": "MIT" }, "node_modules/regenerate-unicode-properties": { - "version": "10.1.1", - "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.1.1.tgz", - "integrity": "sha512-X007RyZLsCJVVrjgEFVpLUTZwyOZk3oiL75ZcuYjlIWd6rNJtOjkBwQc5AsRrpbKVkxN6sklw/k/9m2jJYOf8Q==", + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.2.0.tgz", + "integrity": "sha512-DqHn3DwbmmPVzeKj9woBadqmXxLvQoQIwu7nopMc72ztvxVmVk2SBhSnx67zuye5TP+lJsb/TBQsjLKhnDf3MA==", + "license": "MIT", "dependencies": { "regenerate": "^1.4.2" }, @@ -13696,12 +15832,14 @@ "node_modules/regenerator-runtime": { "version": "0.14.1", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", - "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==" + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", + "license": "MIT" }, "node_modules/regenerator-transform": { "version": "0.15.2", "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.15.2.tgz", "integrity": "sha512-hfMp2BoF0qOk3uc5V20ALGDS2ddjQaLrdl7xrGXvAIow7qeWRM2VA2HuCHkUKk9slq3VwEwLNK3DFBqDfPGYtg==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.8.4" } @@ -13710,6 +15848,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "license": "MIT", "dependencies": { "extend-shallow": "^3.0.2", "safe-regex": "^1.1.0" @@ -13719,15 +15858,18 @@ } }, "node_modules/regexp.prototype.flags": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", - "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==", + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz", + "integrity": "sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.6", + "call-bind": "^1.0.8", "define-properties": "^1.2.1", "es-errors": "^1.3.0", - "set-function-name": "^2.0.1" + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "set-function-name": "^2.0.2" }, "engines": { "node": ">= 0.4" @@ -13740,6 +15882,7 @@ "version": "3.2.0", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", + "license": "MIT", "engines": { "node": ">=8" }, @@ -13748,14 +15891,15 @@ } }, "node_modules/regexpu-core": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-5.3.2.tgz", - "integrity": "sha512-RAM5FlZz+Lhmo7db9L298p2vHP5ZywrVXmVXpmAD9GuL5MPH6t9ROw1iA/wfHkQ76Qe7AaPF0nGuim96/IrQMQ==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-6.2.0.tgz", + "integrity": "sha512-H66BPQMrv+V16t8xtmq+UC0CBpiTBA60V8ibS1QVReIp8T1z8hwFxqcGzm9K6lgsN7sB5edVH8a+ze6Fqm4weA==", + "license": "MIT", "dependencies": { - "@babel/regjsgen": "^0.8.0", "regenerate": "^1.4.2", - "regenerate-unicode-properties": "^10.1.0", - "regjsparser": "^0.9.1", + "regenerate-unicode-properties": "^10.2.0", + "regjsgen": "^0.8.0", + "regjsparser": "^0.12.0", "unicode-match-property-ecmascript": "^2.0.0", "unicode-match-property-value-ecmascript": "^2.1.0" }, @@ -13763,23 +15907,34 @@ "node": ">=4" } }, + "node_modules/regjsgen": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.8.0.tgz", + "integrity": "sha512-RvwtGe3d7LvWiDQXeQw8p5asZUmfU1G/l6WbUXeHta7Y2PEIvBTwH6E2EfmYUK8pxcxEdEmaomqyp0vZZ7C+3Q==", + "license": "MIT" + }, "node_modules/regjsparser": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.9.1.tgz", - "integrity": "sha512-dQUtn90WanSNl+7mQKcXAgZxvUe7Z0SqXlgzv0za4LwiUhyzBC58yQO3liFoUgu8GiJVInAhJjkj1N0EtQ5nkQ==", + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.12.0.tgz", + "integrity": "sha512-cnE+y8bz4NhMjISKbgeVJtqNbtf5QpjZP+Bslo+UqkIt9QPnX9q095eiRRASJG1/tz6dlNr6Z5NsBiWYokp6EQ==", + "license": "BSD-2-Clause", "dependencies": { - "jsesc": "~0.5.0" + "jsesc": "~3.0.2" }, "bin": { "regjsparser": "bin/parser" } }, "node_modules/regjsparser/node_modules/jsesc": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", - "integrity": "sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz", + "integrity": "sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==", + "license": "MIT", "bin": { "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" } }, "node_modules/remark": { @@ -13787,6 +15942,7 @@ "resolved": "https://registry.npmjs.org/remark/-/remark-13.0.0.tgz", "integrity": "sha512-HDz1+IKGtOyWN+QgBiAT0kn+2s6ovOxHyPAFGKVE81VSzJ+mq7RwHFledEvB5F1p4iJvOah/LOKdFuzvRnNLCA==", "dev": true, + "license": "MIT", "dependencies": { "remark-parse": "^9.0.0", "remark-stringify": "^9.0.0", @@ -13802,6 +15958,7 @@ "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-9.0.0.tgz", "integrity": "sha512-geKatMwSzEXKHuzBNU1z676sGcDcFoChMK38TgdHJNAYfFtsfHDQG7MoJAjs6sgYMqyLduCYWDIWZIxiPeafEw==", "dev": true, + "license": "MIT", "dependencies": { "mdast-util-from-markdown": "^0.8.0" }, @@ -13815,6 +15972,7 @@ "resolved": "https://registry.npmjs.org/remark-stringify/-/remark-stringify-9.0.1.tgz", "integrity": "sha512-mWmNg3ZtESvZS8fv5PTvaPckdL4iNlCHTt8/e/8oN08nArHRHjNZMKzA/YW3+p7/lYqIw4nx1XsjCBo/AxNChg==", "dev": true, + "license": "MIT", "dependencies": { "mdast-util-to-markdown": "^0.6.0" }, @@ -13827,6 +15985,7 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.4.tgz", "integrity": "sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -13835,6 +15994,7 @@ "version": "1.6.1", "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", "integrity": "sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==", + "license": "MIT", "engines": { "node": ">=0.10" } @@ -13844,6 +16004,7 @@ "resolved": "https://registry.npmjs.org/request-progress/-/request-progress-3.0.0.tgz", "integrity": "sha512-MnWzEHHaxHO2iWiQuHrUPBi/1WeBf5PkxQqNyNvLl9VAYSdXkP8tQ3pBSeCPD+yw0v0Aq1zosWLz0BdeXpWwZg==", "dev": true, + "license": "MIT", "dependencies": { "throttleit": "^1.0.0" } @@ -13853,6 +16014,7 @@ "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -13861,6 +16023,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -13869,25 +16032,31 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/reselect": { "version": "4.1.8", "resolved": "https://registry.npmjs.org/reselect/-/reselect-4.1.8.tgz", - "integrity": "sha512-ab9EmR80F/zQTMNeneUr4cv+jSwPJgIlvEmVwLerwrWVbpLlBuls9XHzIeTFy4cegU2NHBp3va0LKOzU5qFEYQ==" + "integrity": "sha512-ab9EmR80F/zQTMNeneUr4cv+jSwPJgIlvEmVwLerwrWVbpLlBuls9XHzIeTFy4cegU2NHBp3va0LKOzU5qFEYQ==", + "license": "MIT" }, "node_modules/resolve": { - "version": "1.22.8", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", - "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "version": "1.22.10", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz", + "integrity": "sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==", + "license": "MIT", "dependencies": { - "is-core-module": "^2.13.0", + "is-core-module": "^2.16.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, "bin": { "resolve": "bin/resolve" }, + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -13896,6 +16065,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", "integrity": "sha512-R7uiTjECzvOsWSfdM0QKFNBVFcK27aHOUwdvK53BcW8zqnGdYp0Fbj82cy54+2A4P2tFM22J5kRfe1R+lM/1yg==", + "license": "MIT", "dependencies": { "expand-tilde": "^2.0.0", "global-modules": "^1.0.0" @@ -13908,6 +16078,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", + "license": "MIT", "dependencies": { "global-prefix": "^1.0.1", "is-windows": "^1.0.1", @@ -13921,6 +16092,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", "integrity": "sha512-5lsx1NUDHtSjfg0eHlmYvZKv8/nVqX4ckFbM+FrGcQ+04KWcWFo9P5MxPZYSzUvyzmdTbI7Eix8Q4IbELDqzKg==", + "license": "MIT", "dependencies": { "expand-tilde": "^2.0.2", "homedir-polyfill": "^1.0.1", @@ -13935,12 +16107,14 @@ "node_modules/resolve-dir/node_modules/ini": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "license": "ISC" }, "node_modules/resolve-dir/node_modules/which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "license": "ISC", "dependencies": { "isexe": "^2.0.0" }, @@ -13952,6 +16126,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "license": "MIT", "engines": { "node": ">=4" } @@ -13960,6 +16135,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/resolve-pkg/-/resolve-pkg-2.0.0.tgz", "integrity": "sha512-+1lzwXehGCXSeryaISr6WujZzowloigEofRB+dj75y9RRa/obVcYgbHJd53tdYw8pvZj8GojXaaENws8Ktw/hQ==", + "license": "MIT", "dependencies": { "resolve-from": "^5.0.0" }, @@ -13971,6 +16147,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "license": "MIT", "engines": { "node": ">=8" } @@ -13979,7 +16156,8 @@ "version": "0.2.1", "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", "integrity": "sha512-ZuF55hVUQaaczgOIwqWzkEcEidmlD/xl44x1UZnhOXcYuFN2S6+rcxpG+C1N3So0wvNI3DmJICUFfu2SxhBmvg==", - "deprecated": "https://github.com/lydell/resolve-url#deprecated" + "deprecated": "https://github.com/lydell/resolve-url#deprecated", + "license": "MIT" }, "node_modules/resp-modifier": { "version": "6.0.2", @@ -13999,6 +16177,7 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, + "license": "MIT", "dependencies": { "ms": "2.0.0" } @@ -14007,13 +16186,15 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/restore-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", "dev": true, + "license": "MIT", "dependencies": { "onetime": "^5.1.0", "signal-exit": "^3.0.2" @@ -14026,6 +16207,7 @@ "version": "0.1.15", "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "license": "MIT", "engines": { "node": ">=0.12" } @@ -14034,6 +16216,7 @@ "version": "0.12.0", "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==", + "license": "MIT", "optional": true, "engines": { "node": ">= 4" @@ -14044,6 +16227,7 @@ "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", "dev": true, + "license": "MIT", "engines": { "iojs": ">=1.0.0", "node": ">=0.10.0" @@ -14053,13 +16237,15 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz", "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "deprecated": "Rimraf versions prior to v4 are no longer supported", + "license": "ISC", "dependencies": { "glob": "^7.1.3" }, @@ -14075,6 +16261,7 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "deprecated": "Glob versions prior to v9 are no longer supported", + "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -14109,6 +16296,7 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "dependencies": { "queue-microtask": "^1.2.2" } @@ -14117,32 +16305,37 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/rx/-/rx-4.1.0.tgz", "integrity": "sha512-CiaiuN6gapkdl+cZUr67W6I8jquN4lkak3vtIsIWCl4XIPP8ffsoyN6/+PuGXnQy8Cu8W2y9Xxh31Rq4M6wUug==", - "dev": true + "dev": true, + "license": "Apache-2.0" }, "node_modules/rxjs": { "version": "7.8.1", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", "dev": true, + "license": "Apache-2.0", "dependencies": { "tslib": "^2.1.0" } }, "node_modules/rxjs/node_modules/tslib": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", - "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", - "dev": true + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true, + "license": "0BSD" }, "node_modules/safe-array-concat": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz", - "integrity": "sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.3.tgz", + "integrity": "sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", - "get-intrinsic": "^1.2.4", - "has-symbols": "^1.0.3", + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "get-intrinsic": "^1.2.6", + "has-symbols": "^1.1.0", "isarray": "^2.0.5" }, "engines": { @@ -14169,25 +16362,45 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "MIT" + }, + "node_modules/safe-push-apply": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-push-apply/-/safe-push-apply-1.0.0.tgz", + "integrity": "sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/safe-regex": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", "integrity": "sha512-aJXcif4xnaNUzvUuC5gcb46oTS7zvg4jpMTnuqtrEPlR3vFr4pxtdTwaF1Qs3Enjn9HK+ZlwQui+a7z0SywIzg==", + "license": "MIT", "dependencies": { "ret": "~0.1.10" } }, "node_modules/safe-regex-test": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz", - "integrity": "sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz", + "integrity": "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.6", + "call-bound": "^1.0.2", "es-errors": "^1.3.0", - "is-regex": "^1.1.4" + "is-regex": "^1.2.1" }, "engines": { "node": ">= 0.4" @@ -14200,6 +16413,7 @@ "version": "2.5.0", "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.5.0.tgz", "integrity": "sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==", + "license": "MIT", "engines": { "node": ">=10" } @@ -14207,13 +16421,15 @@ "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" }, "node_modules/sass": { "version": "1.37.5", "resolved": "https://registry.npmjs.org/sass/-/sass-1.37.5.tgz", "integrity": "sha512-Cx3ewxz9QB/ErnVIiWg2cH0kiYZ0FPvheDTVC6BsiEGBTZKKZJ1Gq5Kq6jy3PKtL6+EJ8NIoaBW/RSd2R6cZOA==", "dev": true, + "license": "MIT", "dependencies": { "chokidar": ">=3.0.0 <4.0.0" }, @@ -14229,6 +16445,7 @@ "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", "dev": true, + "license": "ISC", "optional": true }, "node_modules/schema-utils": { @@ -14236,6 +16453,7 @@ "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", "dev": true, + "license": "MIT", "dependencies": { "@types/json-schema": "^7.0.8", "ajv": "^6.12.5", @@ -14252,22 +16470,26 @@ "node_modules/scrollparent": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/scrollparent/-/scrollparent-2.1.0.tgz", - "integrity": "sha512-bnnvJL28/Rtz/kz2+4wpBjHzWoEzXhVg/TE8BeVGJHUqE8THNIRnDxDWMktwM+qahvlRdvlLdsQfYe+cuqfZeA==" + "integrity": "sha512-bnnvJL28/Rtz/kz2+4wpBjHzWoEzXhVg/TE8BeVGJHUqE8THNIRnDxDWMktwM+qahvlRdvlLdsQfYe+cuqfZeA==", + "license": "ISC" }, "node_modules/scrypt-async": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/scrypt-async/-/scrypt-async-2.0.1.tgz", - "integrity": "sha512-wHR032jldwZNy7Tzrfu7RccOgGf8r5hyDMSP2uV6DpLiBUsR8JsDcx/in73o2UGVVrH5ivRFdNsFPcjtl3LErQ==" + "integrity": "sha512-wHR032jldwZNy7Tzrfu7RccOgGf8r5hyDMSP2uV6DpLiBUsR8JsDcx/in73o2UGVVrH5ivRFdNsFPcjtl3LErQ==", + "license": "BSD" }, "node_modules/secure-json-parse": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/secure-json-parse/-/secure-json-parse-2.7.0.tgz", - "integrity": "sha512-6aU+Rwsezw7VR8/nyvKTx8QpWH9FrcYiXXlqC4z5d5XQBDRqtbfsRjnwGyqbi3gddNtWHuEk9OANUotL26qKUw==" + "integrity": "sha512-6aU+Rwsezw7VR8/nyvKTx8QpWH9FrcYiXXlqC4z5d5XQBDRqtbfsRjnwGyqbi3gddNtWHuEk9OANUotL26qKUw==", + "license": "BSD-3-Clause" }, "node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "license": "ISC", "bin": { "semver": "bin/semver.js" } @@ -14277,6 +16499,7 @@ "resolved": "https://registry.npmjs.org/send/-/send-0.16.2.tgz", "integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==", "dev": true, + "license": "MIT", "dependencies": { "debug": "2.6.9", "depd": "~1.1.2", @@ -14301,6 +16524,7 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, + "license": "MIT", "dependencies": { "ms": "2.0.0" } @@ -14310,6 +16534,7 @@ "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.6" } @@ -14319,6 +16544,7 @@ "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", "integrity": "sha512-lks+lVC8dgGyh97jxvxeYTWQFvh4uw4yC12gVl63Cg30sjPX4wuGcdkICVXDAESr6OJGjqGA8Iz5mkeN6zlD7A==", "dev": true, + "license": "MIT", "dependencies": { "depd": "~1.1.2", "inherits": "2.0.3", @@ -14333,13 +16559,15 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", "integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/send/node_modules/mime": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==", "dev": true, + "license": "MIT", "bin": { "mime": "cli.js" } @@ -14348,19 +16576,22 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/send/node_modules/setprototypeof": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/send/node_modules/statuses": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.6" } @@ -14370,6 +16601,7 @@ "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-5.0.1.tgz", "integrity": "sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "randombytes": "^2.1.0" } @@ -14379,6 +16611,7 @@ "resolved": "https://registry.npmjs.org/serve-index/-/serve-index-1.9.1.tgz", "integrity": "sha512-pXHfKNP4qujrtteMrSBb0rc8HJ9Ms/GrXwcUtUtD5s4ewDJI8bT3Cz2zTVRMKtri49pLx2e0Ya8ziP5Ya2pZZw==", "dev": true, + "license": "MIT", "dependencies": { "accepts": "~1.3.4", "batch": "0.6.1", @@ -14397,6 +16630,7 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, + "license": "MIT", "dependencies": { "ms": "2.0.0" } @@ -14406,6 +16640,7 @@ "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.6" } @@ -14415,6 +16650,7 @@ "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", "integrity": "sha512-lks+lVC8dgGyh97jxvxeYTWQFvh4uw4yC12gVl63Cg30sjPX4wuGcdkICVXDAESr6OJGjqGA8Iz5mkeN6zlD7A==", "dev": true, + "license": "MIT", "dependencies": { "depd": "~1.1.2", "inherits": "2.0.3", @@ -14429,25 +16665,29 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", "integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/serve-index/node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/serve-index/node_modules/setprototypeof": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/serve-index/node_modules/statuses": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.6" } @@ -14457,6 +16697,7 @@ "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz", "integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==", "dev": true, + "license": "MIT", "dependencies": { "encodeurl": "~1.0.2", "escape-html": "~1.0.3", @@ -14471,12 +16712,14 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/server-destroy/-/server-destroy-1.0.1.tgz", "integrity": "sha512-rb+9B5YBIEzYcD6x2VKidaa+cqYBJQKnU4oe4E3ANwRRN56yk/ua1YCJT1n21NTS8w6CcOclAKNP3PhdCXKYtQ==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", + "license": "ISC", "optional": true }, "node_modules/set-function-length": { @@ -14484,6 +16727,7 @@ "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", "dev": true, + "license": "MIT", "dependencies": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", @@ -14501,6 +16745,7 @@ "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", "dev": true, + "license": "MIT", "dependencies": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", @@ -14511,10 +16756,26 @@ "node": ">= 0.4" } }, + "node_modules/set-proto": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/set-proto/-/set-proto-1.0.0.tgz", + "integrity": "sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/set-value": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", + "license": "MIT", "dependencies": { "extend-shallow": "^2.0.1", "is-extendable": "^0.1.1", @@ -14529,6 +16790,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "license": "MIT", "dependencies": { "is-extendable": "^0.1.0" }, @@ -14540,6 +16802,7 @@ "version": "0.1.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -14548,12 +16811,14 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/shallow-clone": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", + "license": "MIT", "dependencies": { "kind-of": "^6.0.2" }, @@ -14565,6 +16830,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "license": "MIT", "dependencies": { "shebang-regex": "^3.0.0" }, @@ -14576,6 +16842,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "license": "MIT", "engines": { "node": ">=8" } @@ -14585,6 +16852,7 @@ "resolved": "https://registry.npmjs.org/should/-/should-13.2.3.tgz", "integrity": "sha512-ggLesLtu2xp+ZxI+ysJTmNjh2U0TsC+rQ/pfED9bUZZ4DKefP27D+7YJVVTvKsmjLpIi9jAa7itwDGkDDmt1GQ==", "dev": true, + "license": "MIT", "dependencies": { "should-equal": "^2.0.0", "should-format": "^3.0.3", @@ -14598,6 +16866,7 @@ "resolved": "https://registry.npmjs.org/should-equal/-/should-equal-2.0.0.tgz", "integrity": "sha512-ZP36TMrK9euEuWQYBig9W55WPC7uo37qzAEmbjHz4gfyuXrEUgF8cUvQVO+w+d3OMfPvSRQJ22lSm8MQJ43LTA==", "dev": true, + "license": "MIT", "dependencies": { "should-type": "^1.4.0" } @@ -14607,6 +16876,7 @@ "resolved": "https://registry.npmjs.org/should-format/-/should-format-3.0.3.tgz", "integrity": "sha512-hZ58adtulAk0gKtua7QxevgUaXTTXxIi8t41L3zo9AHvjXO1/7sdLECuHeIN2SRtYXpNkmhoUP2pdeWgricQ+Q==", "dev": true, + "license": "MIT", "dependencies": { "should-type": "^1.3.0", "should-type-adaptors": "^1.0.1" @@ -14617,6 +16887,7 @@ "resolved": "https://registry.npmjs.org/should-sinon/-/should-sinon-0.0.6.tgz", "integrity": "sha512-ScBOH5uW5QVFaONmUnIXANSR6z5B8IKzEmBP3HE5sPOCDuZ88oTMdUdnKoCVQdLcCIrRrhRLPS5YT+7H40a04g==", "dev": true, + "license": "MIT", "peerDependencies": { "should": ">= 8.x" } @@ -14625,13 +16896,15 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/should-type/-/should-type-1.4.0.tgz", "integrity": "sha512-MdAsTu3n25yDbIe1NeN69G4n6mUnJGtSJHygX3+oN0ZbO3DTiATnf7XnYJdGT42JCXurTb1JI0qOBR65shvhPQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/should-type-adaptors": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/should-type-adaptors/-/should-type-adaptors-1.1.0.tgz", "integrity": "sha512-JA4hdoLnN+kebEp2Vs8eBe9g7uy0zbRo+RMcU0EsNy+R+k049Ki+N5tT5Jagst2g7EAja+euFuoXFCa8vIklfA==", "dev": true, + "license": "MIT", "dependencies": { "should-type": "^1.3.0", "should-util": "^1.0.0" @@ -14641,18 +16914,77 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/should-util/-/should-util-1.0.1.tgz", "integrity": "sha512-oXF8tfxx5cDk8r2kYqlkUJzZpDBqVY/II2WhvU0n9Y3XYvAYRmeaf1PvvIvTgPnv4KJ+ES5M0PyDq5Jp+Ygy2g==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/side-channel": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", - "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.4", - "object-inspect": "^1.13.1" + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" }, "engines": { "node": ">= 0.4" @@ -14665,7 +16997,8 @@ "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "devOptional": true + "devOptional": true, + "license": "ISC" }, "node_modules/simple-concat": { "version": "1.0.1", @@ -14684,7 +17017,8 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "MIT" }, "node_modules/simple-get": { "version": "4.0.1", @@ -14704,6 +17038,7 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "dependencies": { "decompress-response": "^6.0.0", "once": "^1.3.1", @@ -14716,6 +17051,7 @@ "integrity": "sha512-naPfsamB5KEE1aiioaoqJ6MEhdUs/2vtI5w1hPAXX/UwvoPjXcwh1m5HiKx0HGgKR8lQSoFIgY5jM6KK8VrS9w==", "deprecated": "16.1.1", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "@sinonjs/commons": "^1.8.1", "@sinonjs/fake-timers": "^6.0.1", @@ -14735,6 +17071,7 @@ "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.3.1" } @@ -14743,6 +17080,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "license": "MIT", "engines": { "node": ">=8" } @@ -14752,6 +17090,7 @@ "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-3.0.0.tgz", "integrity": "sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", "astral-regex": "^2.0.0", @@ -14765,6 +17104,7 @@ "version": "4.2.0", "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "license": "MIT", "optional": true, "engines": { "node": ">= 6.0.0", @@ -14775,6 +17115,7 @@ "version": "0.8.2", "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "license": "MIT", "dependencies": { "base": "^0.11.1", "debug": "^2.2.0", @@ -14793,6 +17134,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "license": "MIT", "dependencies": { "define-property": "^1.0.0", "isobject": "^3.0.0", @@ -14806,6 +17148,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", "integrity": "sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==", + "license": "MIT", "dependencies": { "is-descriptor": "^1.0.0" }, @@ -14817,6 +17160,7 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "license": "MIT", "dependencies": { "kind-of": "^3.2.0" }, @@ -14827,12 +17171,14 @@ "node_modules/snapdragon-util/node_modules/is-buffer": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "license": "MIT" }, "node_modules/snapdragon-util/node_modules/kind-of": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "license": "MIT", "dependencies": { "is-buffer": "^1.1.5" }, @@ -14844,6 +17190,7 @@ "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", "dependencies": { "ms": "2.0.0" } @@ -14852,6 +17199,7 @@ "version": "0.2.5", "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", + "license": "MIT", "dependencies": { "is-descriptor": "^0.1.0" }, @@ -14863,6 +17211,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "license": "MIT", "dependencies": { "is-extendable": "^0.1.0" }, @@ -14874,6 +17223,7 @@ "version": "0.1.7", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.7.tgz", "integrity": "sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg==", + "license": "MIT", "dependencies": { "is-accessor-descriptor": "^1.0.1", "is-data-descriptor": "^1.0.1" @@ -14886,6 +17236,7 @@ "version": "0.1.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -14893,27 +17244,30 @@ "node_modules/snapdragon/node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" }, "node_modules/snapdragon/node_modules/source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } }, "node_modules/socket.io": { - "version": "4.7.5", - "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.7.5.tgz", - "integrity": "sha512-DmeAkF6cwM9jSfmp6Dr/5/mfMwb5Z5qRrSXLpo3Fq5SqyU8CMF15jIN4ZhfSwu35ksM1qmHZDQ/DK5XTccSTvA==", + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.8.1.tgz", + "integrity": "sha512-oZ7iUCxph8WYRHHcjBEc9unw3adt5CmSNlppj/5Q4k2RIrhl8Z5yY2Xr4j9zj0+wzVZ0bxmYoGSzKJnRl6A4yg==", "dev": true, + "license": "MIT", "dependencies": { "accepts": "~1.3.4", "base64id": "~2.0.0", "cors": "~2.8.5", "debug": "~4.3.2", - "engine.io": "~6.5.2", + "engine.io": "~6.6.0", "socket.io-adapter": "~2.5.2", "socket.io-parser": "~4.2.4" }, @@ -14926,16 +17280,36 @@ "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.5.5.tgz", "integrity": "sha512-eLDQas5dzPgOWCk9GuuJC2lBqItuhKI4uxGgo9aIV7MYbk2h9Q6uULEh8WBzThoI7l+qU9Ast9fVUmkqPP9wYg==", "dev": true, + "license": "MIT", "dependencies": { "debug": "~4.3.4", "ws": "~8.17.1" } }, + "node_modules/socket.io-adapter/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, "node_modules/socket.io-adapter/node_modules/ws": { "version": "8.17.1", "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=10.0.0" }, @@ -14953,25 +17327,45 @@ } }, "node_modules/socket.io-client": { - "version": "4.7.5", - "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-4.7.5.tgz", - "integrity": "sha512-sJ/tqHOCe7Z50JCBCXrsY3I2k03iOiUe+tj1OmKeD2lXPiGH/RUCdTZFoqVyN7l1MnpIzPrGtLcijffmeouNlQ==", + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-4.8.1.tgz", + "integrity": "sha512-hJVXfu3E28NmzGk8o1sHhN3om52tRvwYeidbj7xKy2eIIse5IoKX3USlS6Tqt3BHAtflLIkCQBkzVrEEfWUyYQ==", "dev": true, + "license": "MIT", "dependencies": { "@socket.io/component-emitter": "~3.1.0", "debug": "~4.3.2", - "engine.io-client": "~6.5.2", + "engine.io-client": "~6.6.1", "socket.io-parser": "~4.2.4" }, "engines": { "node": ">=10.0.0" } }, + "node_modules/socket.io-client/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, "node_modules/socket.io-parser": { "version": "4.2.4", "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.4.tgz", "integrity": "sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew==", "dev": true, + "license": "MIT", "dependencies": { "@socket.io/component-emitter": "~3.1.0", "debug": "~4.3.1" @@ -14980,10 +17374,47 @@ "node": ">=10.0.0" } }, + "node_modules/socket.io-parser/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/socket.io/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, "node_modules/socks": { "version": "2.8.3", "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.3.tgz", "integrity": "sha512-l5x7VUUWbjVFbafGLxPWkYsHIhEvmF85tbIeFZWc8ZPtoMyybuEhL7Jye/ooC4/d48FgOjSJXgsF/AJPYCW8Zw==", + "license": "MIT", "optional": true, "dependencies": { "ip-address": "^9.0.5", @@ -14998,6 +17429,7 @@ "version": "6.2.1", "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-6.2.1.tgz", "integrity": "sha512-a6KW9G+6B3nWZ1yB8G7pJwL3ggLy1uTzKAgCb7ttblwqdz9fMGJUuTy3uFzEP48FAs9FLILlmzDlE2JJhVQaXQ==", + "license": "MIT", "optional": true, "dependencies": { "agent-base": "^6.0.2", @@ -15012,6 +17444,7 @@ "version": "3.8.1", "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-3.8.1.tgz", "integrity": "sha512-y4Z8LCDBuum+PBP3lSV7RHrXscqksve/bi0as7mhwVnBW+/wUqKT/2Kb7um8yqcFy0duYbbPxzt89Zy2nOCaxg==", + "license": "MIT", "dependencies": { "atomic-sleep": "^1.0.0" } @@ -15020,15 +17453,17 @@ "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } }, "node_modules/source-map-js": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", - "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } @@ -15038,6 +17473,7 @@ "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", "deprecated": "See https://github.com/lydell/source-map-resolve#deprecated", + "license": "MIT", "dependencies": { "atob": "^2.1.2", "decode-uri-component": "^0.2.0", @@ -15050,6 +17486,7 @@ "version": "0.5.21", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "license": "MIT", "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" @@ -15059,13 +17496,15 @@ "version": "0.4.1", "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.1.tgz", "integrity": "sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==", - "deprecated": "See https://github.com/lydell/source-map-url#deprecated" + "deprecated": "See https://github.com/lydell/source-map-url#deprecated", + "license": "MIT" }, "node_modules/spdx-correct": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", "dev": true, + "license": "Apache-2.0", "dependencies": { "spdx-expression-parse": "^3.0.0", "spdx-license-ids": "^3.0.0" @@ -15075,29 +17514,33 @@ "version": "2.5.0", "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", - "dev": true + "dev": true, + "license": "CC-BY-3.0" }, "node_modules/spdx-expression-parse": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", "dev": true, + "license": "MIT", "dependencies": { "spdx-exceptions": "^2.1.0", "spdx-license-ids": "^3.0.0" } }, "node_modules/spdx-license-ids": { - "version": "3.0.20", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.20.tgz", - "integrity": "sha512-jg25NiDV/1fLtSgEgyvVyDunvaNHbuwF9lfNV17gSmPFAlYzdfNBlLtLzXTevwkPj7DhGbmN9VnmJIgLnhvaBw==", - "dev": true + "version": "3.0.21", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.21.tgz", + "integrity": "sha512-Bvg/8F5XephndSK3JffaRqdT+gyhfqIPwDHpX80tJrF8QQRYMo8sNMeaZ2Dp5+jhwKnUmIOyFFQfHRkjJm5nXg==", + "dev": true, + "license": "CC0-1.0" }, "node_modules/specificity": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/specificity/-/specificity-0.4.1.tgz", "integrity": "sha512-1klA3Gi5PD1Wv9Q0wUoOQN1IWAuPu0D1U03ThXTr0cJ20+/iq2tHSDnK7Kk/0LXJ1ztUB2/1Os0wKmfyNgUQfg==", "dev": true, + "license": "MIT", "bin": { "specificity": "bin/specificity" } @@ -15106,6 +17549,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "license": "MIT", "dependencies": { "extend-shallow": "^3.0.0" }, @@ -15117,6 +17561,7 @@ "version": "4.2.0", "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", + "license": "ISC", "engines": { "node": ">= 10.x" } @@ -15124,13 +17569,15 @@ "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==" + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "license": "BSD-3-Clause" }, "node_modules/sqlite3": { "version": "5.1.7", "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-5.1.7.tgz", "integrity": "sha512-GGIyOiFaG+TUra3JIfkI/zGP8yZYLPQ0pl1bH+ODjiX57sPhrLU5sQJn1y9bDKZUFYkX1crlrPfSYt0BKKdkog==", "hasInstallScript": true, + "license": "BSD-3-Clause", "dependencies": { "bindings": "^1.5.0", "node-addon-api": "^7.0.0", @@ -15154,6 +17601,7 @@ "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz", "integrity": "sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==", "dev": true, + "license": "MIT", "dependencies": { "asn1": "~0.2.3", "assert-plus": "^1.0.0", @@ -15178,18 +17626,21 @@ "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/sshpk/node_modules/tweetnacl": { "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==", - "dev": true + "dev": true, + "license": "Unlicense" }, "node_modules/ssri": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz", "integrity": "sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==", + "license": "ISC", "optional": true, "dependencies": { "minipass": "^3.1.1" @@ -15202,6 +17653,7 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", "integrity": "sha512-72E9+uLc27Mt718pMHt9VMNiAL4LMsmDbBva8mxWUCkT07fSzEGMYUCk0XWY6lp0j6RBAG4cJ3mWuZv2OE3s0g==", + "license": "MIT", "dependencies": { "define-property": "^0.2.5", "object-copy": "^0.1.0" @@ -15214,6 +17666,7 @@ "version": "0.2.5", "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", + "license": "MIT", "dependencies": { "is-descriptor": "^0.1.0" }, @@ -15225,6 +17678,7 @@ "version": "0.1.7", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.7.tgz", "integrity": "sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg==", + "license": "MIT", "dependencies": { "is-accessor-descriptor": "^1.0.1", "is-data-descriptor": "^1.0.1" @@ -15238,6 +17692,7 @@ "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", "integrity": "sha512-wuTCPGlJONk/a1kqZ4fQM2+908lC7fa7nPYpTC1EhnvqLX/IICbeP1OZGDtA374trpSq68YubKUMo8oRhN46yg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.6" } @@ -15247,6 +17702,7 @@ "resolved": "https://registry.npmjs.org/stream-throttle/-/stream-throttle-0.1.3.tgz", "integrity": "sha512-889+B9vN9dq7/vLbGyuHeZ6/ctf5sNuGWsDy89uNxkFTAgzy0eK7+w5fL3KLNRTkLle7EgZGvHUphZW0Q26MnQ==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "commander": "^2.2.0", "limiter": "^1.0.5" @@ -15262,12 +17718,14 @@ "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "license": "MIT", "dependencies": { "safe-buffer": "~5.2.0" } @@ -15276,18 +17734,21 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/string-hash/-/string-hash-1.1.3.tgz", "integrity": "sha512-kJUvRUFK49aub+a7T1nNE66EJbZBMnBgoC1UbCZ5n6bsZKBRga4KgBRTMn/pFkeCZSYtNeSyMxPDM0AXWELk2A==", - "dev": true + "dev": true, + "license": "CC0-1.0" }, "node_modules/string-natural-compare": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/string-natural-compare/-/string-natural-compare-3.0.1.tgz", "integrity": "sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -15298,15 +17759,19 @@ } }, "node_modules/string.prototype.trim": { - "version": "1.2.9", - "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", - "integrity": "sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==", + "version": "1.2.10", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.10.tgz", + "integrity": "sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "define-data-property": "^1.1.4", "define-properties": "^1.2.1", - "es-abstract": "^1.23.0", - "es-object-atoms": "^1.0.0" + "es-abstract": "^1.23.5", + "es-object-atoms": "^1.0.0", + "has-property-descriptors": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -15316,15 +17781,20 @@ } }, "node_modules/string.prototype.trimend": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz", - "integrity": "sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==", + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.9.tgz", + "integrity": "sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", "define-properties": "^1.2.1", "es-object-atoms": "^1.0.0" }, + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -15334,6 +17804,7 @@ "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", @@ -15350,6 +17821,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -15362,6 +17834,7 @@ "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } @@ -15371,6 +17844,7 @@ "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } @@ -15380,6 +17854,7 @@ "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", "dev": true, + "license": "MIT", "dependencies": { "min-indent": "^1.0.0" }, @@ -15391,6 +17866,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "license": "MIT", "engines": { "node": ">=8" }, @@ -15402,13 +17878,15 @@ "version": "0.1.0", "resolved": "https://registry.npmjs.org/style-search/-/style-search-0.1.0.tgz", "integrity": "sha512-Dj1Okke1C3uKKwQcetra4jSuk0DqbzbYtXipzFlFMZtowbF1x7BKJwB9AayVMyFARvU8EDrZdcax4At/452cAg==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/stylelint": { "version": "13.8.0", "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-13.8.0.tgz", "integrity": "sha512-iHH3dv3UI23SLDrH4zMQDjLT9/dDIz/IpoFeuNxZmEx86KtfpjDOscxLTFioQyv+2vQjPlRZnK0UoJtfxLICXQ==", "dev": true, + "license": "MIT", "dependencies": { "@stylelint/postcss-css-in-js": "^0.37.2", "@stylelint/postcss-markdown": "^0.36.2", @@ -15475,6 +17953,7 @@ "resolved": "https://registry.npmjs.org/stylelint-config-recommended/-/stylelint-config-recommended-3.0.0.tgz", "integrity": "sha512-F6yTRuc06xr1h5Qw/ykb2LuFynJ2IxkKfCMf+1xqPffkxh0S09Zc902XCffcsw/XMFq/OzQ1w54fLIDtmRNHnQ==", "dev": true, + "license": "MIT", "peerDependencies": { "stylelint": ">=10.1.0" } @@ -15484,6 +17963,7 @@ "resolved": "https://registry.npmjs.org/stylelint-config-standard/-/stylelint-config-standard-20.0.0.tgz", "integrity": "sha512-IB2iFdzOTA/zS4jSVav6z+wGtin08qfj+YyExHB3LF9lnouQht//YyB0KZq9gGz5HNPkddHOzcY8HsUey6ZUlA==", "dev": true, + "license": "MIT", "dependencies": { "stylelint-config-recommended": "^3.0.0" }, @@ -15496,6 +17976,7 @@ "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", "dev": true, + "license": "MIT", "engines": { "node": ">= 4" } @@ -15504,13 +17985,15 @@ "version": "0.2.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-0.2.1.tgz", "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/stylelint/node_modules/postcss": { "version": "7.0.39", "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.39.tgz", "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", "dev": true, + "license": "MIT", "dependencies": { "picocolors": "^0.2.1", "source-map": "^0.6.1" @@ -15528,6 +18011,7 @@ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -15537,6 +18021,7 @@ "resolved": "https://registry.npmjs.org/stylus/-/stylus-0.54.8.tgz", "integrity": "sha512-vr54Or4BZ7pJafo2mpf0ZcwA74rpuYCZbxrHBsH8kbcXOwSfvBFwsRfpGO5OD5fhG5HDCFW737PKaawI7OqEAg==", "dev": true, + "license": "MIT", "optional": true, "dependencies": { "css-parse": "~2.0.0", @@ -15560,6 +18045,7 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", "dev": true, + "license": "MIT", "optional": true, "dependencies": { "ms": "2.0.0" @@ -15571,6 +18057,7 @@ "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, + "license": "ISC", "optional": true, "dependencies": { "fs.realpath": "^1.0.0", @@ -15592,6 +18079,7 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "dev": true, + "license": "MIT", "optional": true }, "node_modules/stylus/node_modules/source-map": { @@ -15599,6 +18087,7 @@ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==", "dev": true, + "license": "BSD-3-Clause", "optional": true, "engines": { "node": ">= 8" @@ -15609,6 +18098,7 @@ "resolved": "https://registry.npmjs.org/sugarss/-/sugarss-2.0.0.tgz", "integrity": "sha512-WfxjozUk0UVA4jm+U1d736AUpzSrNsQcIbyOkoE364GrtWmIrFdk5lksEupgWMD4VaT/0kVx1dobpiDumSgmJQ==", "dev": true, + "license": "MIT", "dependencies": { "postcss": "^7.0.2" } @@ -15617,13 +18107,15 @@ "version": "0.2.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-0.2.1.tgz", "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/sugarss/node_modules/postcss": { "version": "7.0.39", "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.39.tgz", "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", "dev": true, + "license": "MIT", "dependencies": { "picocolors": "^0.2.1", "source-map": "^0.6.1" @@ -15640,6 +18132,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -15651,6 +18144,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -15665,9 +18159,10 @@ "dev": true }, "node_modules/table": { - "version": "6.8.2", - "resolved": "https://registry.npmjs.org/table/-/table-6.8.2.tgz", - "integrity": "sha512-w2sfv80nrAh2VCbqR5AK27wswXhqcck2AhfnNW76beQXskGZ1V12GwS//yYVa3d3fcvAip2OUnbDAjW2k3v9fA==", + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/table/-/table-6.9.0.tgz", + "integrity": "sha512-9kY+CygyYM6j02t5YFHbNz2FN5QmYGv9zAjVp4lCDjlCw7amdckXlEt/bjMhUIfj4ThGRE4gCUH5+yGnNuPo5A==", + "license": "BSD-3-Clause", "dependencies": { "ajv": "^8.0.1", "lodash.truncate": "^4.4.2", @@ -15683,6 +18178,7 @@ "version": "8.17.1", "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", + "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", @@ -15697,12 +18193,14 @@ "node_modules/table/node_modules/json-schema-traverse": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "license": "MIT" }, "node_modules/table/node_modules/slice-ansi": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", "astral-regex": "^2.0.0", @@ -15720,6 +18218,7 @@ "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", "dev": true, + "license": "MIT", "peer": true, "engines": { "node": ">=6" @@ -15729,6 +18228,7 @@ "version": "6.1.11", "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz", "integrity": "sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==", + "license": "ISC", "dependencies": { "chownr": "^2.0.0", "fs-minipass": "^2.0.0", @@ -15742,9 +18242,10 @@ } }, "node_modules/tar-fs": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", - "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.2.tgz", + "integrity": "sha512-EsaAXwxmx8UB7FRKqeozqEPop69DXcmYwTQwXvyAPF352HJsPdkVhvTaDPYqfNgruveJIJy3TA2l+2zj8LJIJA==", + "license": "MIT", "dependencies": { "chownr": "^1.1.1", "mkdirp-classic": "^0.5.2", @@ -15755,12 +18256,14 @@ "node_modules/tar-fs/node_modules/chownr": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", - "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==" + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", + "license": "ISC" }, "node_modules/tar-stream": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "license": "MIT", "dependencies": { "bl": "^4.0.3", "end-of-stream": "^1.4.1", @@ -15776,6 +18279,7 @@ "version": "3.6.2", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "license": "MIT", "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -15786,10 +18290,11 @@ } }, "node_modules/terser": { - "version": "5.31.6", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.31.6.tgz", - "integrity": "sha512-PQ4DAriWzKj+qgehQ7LK5bQqCFNMmlhjR2PFFLuqGCpuCAauxemVBWwWOxo3UIwWQx8+Pr61Df++r76wDmkQBg==", + "version": "5.37.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.37.0.tgz", + "integrity": "sha512-B8wRRkmre4ERucLM/uXx4MOV5cbnOlVAqUst+1+iLKPI0dOgFO28f84ptoQt9HEI537PMzfYa/d+GEPKTRXmYA==", "dev": true, + "license": "BSD-2-Clause", "peer": true, "dependencies": { "@jridgewell/source-map": "^0.3.3", @@ -15805,17 +18310,18 @@ } }, "node_modules/terser-webpack-plugin": { - "version": "5.3.10", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.10.tgz", - "integrity": "sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w==", + "version": "5.3.11", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.11.tgz", + "integrity": "sha512-RVCsMfuD0+cTt3EwX8hSl2Ks56EbFHWmhluwcqoPKtBnfjiT6olaq7PRIRfhyU8nnC2MrnDrBLfrD/RGE+cVXQ==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "@jridgewell/trace-mapping": "^0.3.20", + "@jridgewell/trace-mapping": "^0.3.25", "jest-worker": "^27.4.5", - "schema-utils": "^3.1.1", - "serialize-javascript": "^6.0.1", - "terser": "^5.26.0" + "schema-utils": "^4.3.0", + "serialize-javascript": "^6.0.2", + "terser": "^5.31.1" }, "engines": { "node": ">= 10.13.0" @@ -15839,21 +18345,84 @@ } } }, + "node_modules/terser-webpack-plugin/node_modules/ajv": { + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", + "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/terser-webpack-plugin/node_modules/ajv-keywords": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", + "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "fast-deep-equal": "^3.1.3" + }, + "peerDependencies": { + "ajv": "^8.8.2" + } + }, + "node_modules/terser-webpack-plugin/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/terser-webpack-plugin/node_modules/schema-utils": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.0.tgz", + "integrity": "sha512-Gf9qqc58SpCA/xdziiHz35F4GNIWYWZrEshUc/G/r5BnLph6xpKuLeoJoQuj5WfBIx/eQLf+hmVPYHaxJu7V2g==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@types/json-schema": "^7.0.9", + "ajv": "^8.9.0", + "ajv-formats": "^2.1.1", + "ajv-keywords": "^5.1.0" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, "node_modules/terser-webpack-plugin/node_modules/serialize-javascript": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", "dev": true, + "license": "BSD-3-Clause", "peer": true, "dependencies": { "randombytes": "^2.1.0" } }, "node_modules/terser/node_modules/acorn": { - "version": "8.12.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", - "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", "dev": true, + "license": "MIT", "peer": true, "bin": { "acorn": "bin/acorn" @@ -15867,18 +18436,21 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true, + "license": "MIT", "peer": true }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==" + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "license": "MIT" }, "node_modules/tfunk": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/tfunk/-/tfunk-4.0.0.tgz", "integrity": "sha512-eJQ0dGfDIzWNiFNYFVjJ+Ezl/GmwHaFTBTjrtqNPW0S7cuVDBrZrmzUz6VkMeCR4DZFqhd4YtLwsw3i2wYHswQ==", "dev": true, + "license": "MIT", "dependencies": { "chalk": "^1.1.3", "dlv": "^1.1.3" @@ -15889,6 +18461,7 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -15898,6 +18471,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -15907,6 +18481,7 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^2.2.1", "escape-string-regexp": "^1.0.2", @@ -15923,6 +18498,7 @@ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.8.0" } @@ -15932,6 +18508,7 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", "dev": true, + "license": "MIT", "dependencies": { "ansi-regex": "^2.0.0" }, @@ -15944,6 +18521,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.8.0" } @@ -15952,6 +18530,7 @@ "version": "2.7.0", "resolved": "https://registry.npmjs.org/thread-stream/-/thread-stream-2.7.0.tgz", "integrity": "sha512-qQiRWsU/wvNolI6tbbCKd9iKaTnCXsTwVxhhKM6nctPdujTyztjlbUkUTUymidWcMnZ5pWR0ej4a0tjsW021vw==", + "license": "MIT", "dependencies": { "real-require": "^0.2.0" } @@ -15959,13 +18538,15 @@ "node_modules/three": { "version": "0.151.3", "resolved": "https://registry.npmjs.org/three/-/three-0.151.3.tgz", - "integrity": "sha512-+vbuqxFy8kzLeO5MgpBHUvP/EAiecaDwDuOPPDe6SbrZr96kccF0ktLngXc7xA7bzyd3N0t2f6mw3Z9y6JCojQ==" + "integrity": "sha512-+vbuqxFy8kzLeO5MgpBHUvP/EAiecaDwDuOPPDe6SbrZr96kccF0ktLngXc7xA7bzyd3N0t2f6mw3Z9y6JCojQ==", + "license": "MIT" }, "node_modules/throttleit": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/throttleit/-/throttleit-1.0.1.tgz", "integrity": "sha512-vDZpf9Chs9mAdfY046mcPt8fg5QSZr37hEH4TXYBnDF+izxgrbRGUAAaBvIk/fJm9aOFCGFd1EsNg5AZCbnQCQ==", "dev": true, + "license": "MIT", "funding": { "url": "https://github.com/sponsors/sindresorhus" } @@ -15974,29 +18555,54 @@ "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", - "dev": true + "dev": true, + "license": "MIT" + }, + "node_modules/tldts": { + "version": "6.1.75", + "resolved": "https://registry.npmjs.org/tldts/-/tldts-6.1.75.tgz", + "integrity": "sha512-+lFzEXhpl7JXgWYaXcB6DqTYXbUArvrWAE/5ioq/X3CdWLbDjpPP4XTrQBmEJ91y3xbe4Fkw7Lxv4P3GWeJaNg==", + "dev": true, + "license": "MIT", + "dependencies": { + "tldts-core": "^6.1.75" + }, + "bin": { + "tldts": "bin/cli.js" + } + }, + "node_modules/tldts-core": { + "version": "6.1.75", + "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-6.1.75.tgz", + "integrity": "sha512-AOvV5YYIAFFBfransBzSTyztkc3IMfz5Eq3YluaRiEu55nn43Fzaufx70UqEKYr8BoLCach4q8g/bg6e5+/aFw==", + "dev": true, + "license": "MIT" }, "node_modules/tmp": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.3.tgz", "integrity": "sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w==", "dev": true, + "license": "MIT", "engines": { "node": ">=14.14" } }, "node_modules/to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", + "integrity": "sha512-lxrWP8ejsq+7E3nNjwYmUBMAgjMTZoTI+sdBOpvNyijeDLa29LUn9QaoXAHv4+Z578hbmHHJKZknzxVtvo77og==", + "dev": true, + "license": "MIT", "engines": { - "node": ">=4" + "node": ">=0.10.0" } }, "node_modules/to-object-path": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", "integrity": "sha512-9mWHdnGRuh3onocaHzukyvCZhzvr6tiflAy/JRFXcJX0TjgfWA9pk9t8CMbzmBE4Jfw58pXbkngtBtqYxzNEyg==", + "license": "MIT", "dependencies": { "kind-of": "^3.0.2" }, @@ -16007,12 +18613,14 @@ "node_modules/to-object-path/node_modules/is-buffer": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "license": "MIT" }, "node_modules/to-object-path/node_modules/kind-of": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "license": "MIT", "dependencies": { "is-buffer": "^1.1.5" }, @@ -16024,6 +18632,7 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "license": "MIT", "dependencies": { "define-property": "^2.0.2", "extend-shallow": "^3.0.2", @@ -16038,6 +18647,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "license": "MIT", "dependencies": { "is-number": "^7.0.0" }, @@ -16050,6 +18660,7 @@ "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.6" } @@ -16058,30 +18669,20 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/token-stream/-/token-stream-1.0.0.tgz", "integrity": "sha512-VSsyNPPW74RpHwR8Fc21uubwHY7wMDeJLys2IX5zJNih+OnAnaifKHo+1LHT7DAdloQ7apeaaWg8l7qnf/TnEg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/tough-cookie": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.4.tgz", - "integrity": "sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-5.1.0.tgz", + "integrity": "sha512-rvZUv+7MoBYTiDmFPBrhL7Ujx9Sk+q9wwm22x8c8T5IJaR+Wsyc7TNxbVxo84kZoRJZZMazowFLqpankBEQrGg==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { - "psl": "^1.1.33", - "punycode": "^2.1.1", - "universalify": "^0.2.0", - "url-parse": "^1.5.3" + "tldts": "^6.1.32" }, "engines": { - "node": ">=6" - } - }, - "node_modules/tough-cookie/node_modules/universalify": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", - "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", - "dev": true, - "engines": { - "node": ">= 4.0.0" + "node": ">=16" } }, "node_modules/trim-newlines": { @@ -16089,6 +18690,7 @@ "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz", "integrity": "sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -16098,6 +18700,7 @@ "resolved": "https://registry.npmjs.org/trough/-/trough-1.0.5.tgz", "integrity": "sha512-rvuRbTarPXmMb79SmzEp8aqXNKcK+y0XaB298IXueQ8I2PsrATcPBCSPyK/dDNa2iWOhKlfNnOjdAOTBU/nkFA==", "dev": true, + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -16108,6 +18711,7 @@ "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", "dev": true, + "license": "MIT", "dependencies": { "@types/json5": "^0.0.29", "json5": "^1.0.2", @@ -16120,6 +18724,7 @@ "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", "dev": true, + "license": "MIT", "dependencies": { "minimist": "^1.2.0" }, @@ -16132,12 +18737,14 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", "dev": true, + "license": "0BSD", "optional": true }, "node_modules/tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", + "license": "Apache-2.0", "dependencies": { "safe-buffer": "^5.0.1" }, @@ -16148,17 +18755,20 @@ "node_modules/tweetnacl": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", - "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==" + "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==", + "license": "Unlicense" }, "node_modules/tweetnacl-util": { "version": "0.15.1", "resolved": "https://registry.npmjs.org/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz", - "integrity": "sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw==" + "integrity": "sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw==", + "license": "Unlicense" }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "license": "MIT", "dependencies": { "prelude-ls": "^1.2.1" }, @@ -16171,6 +18781,7 @@ "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } @@ -16180,6 +18791,7 @@ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", "dev": true, + "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=10" }, @@ -16188,30 +18800,32 @@ } }, "node_modules/typed-array-buffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz", - "integrity": "sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz", + "integrity": "sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", + "call-bound": "^1.0.3", "es-errors": "^1.3.0", - "is-typed-array": "^1.1.13" + "is-typed-array": "^1.1.14" }, "engines": { "node": ">= 0.4" } }, "node_modules/typed-array-byte-length": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz", - "integrity": "sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.3.tgz", + "integrity": "sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", + "call-bind": "^1.0.8", "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-proto": "^1.0.3", - "is-typed-array": "^1.1.13" + "gopd": "^1.2.0", + "has-proto": "^1.2.0", + "is-typed-array": "^1.1.14" }, "engines": { "node": ">= 0.4" @@ -16221,17 +18835,19 @@ } }, "node_modules/typed-array-byte-offset": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.2.tgz", - "integrity": "sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.4.tgz", + "integrity": "sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ==", "dev": true, + "license": "MIT", "dependencies": { "available-typed-arrays": "^1.0.7", - "call-bind": "^1.0.7", + "call-bind": "^1.0.8", "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-proto": "^1.0.3", - "is-typed-array": "^1.1.13" + "gopd": "^1.2.0", + "has-proto": "^1.2.0", + "is-typed-array": "^1.1.15", + "reflect.getprototypeof": "^1.0.9" }, "engines": { "node": ">= 0.4" @@ -16241,17 +18857,18 @@ } }, "node_modules/typed-array-length": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.6.tgz", - "integrity": "sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.7.tgz", + "integrity": "sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "for-each": "^0.3.3", "gopd": "^1.0.1", - "has-proto": "^1.0.3", "is-typed-array": "^1.1.13", - "possible-typed-array-names": "^1.0.0" + "possible-typed-array-names": "^1.0.0", + "reflect.getprototypeof": "^1.0.6" }, "engines": { "node": ">= 0.4" @@ -16265,6 +18882,7 @@ "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", "dev": true, + "license": "MIT", "dependencies": { "is-typedarray": "^1.0.0" } @@ -16284,20 +18902,25 @@ "url": "https://paypal.me/faisalman" } ], + "license": "MIT", "engines": { "node": "*" } }, "node_modules/unbox-primitive": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", - "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.1.0.tgz", + "integrity": "sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==", "dev": true, + "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", + "call-bound": "^1.0.3", "has-bigints": "^1.0.2", - "has-symbols": "^1.0.3", - "which-boxed-primitive": "^1.0.2" + "has-symbols": "^1.1.0", + "which-boxed-primitive": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -16307,6 +18930,7 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", "integrity": "sha512-eXL4nmJT7oCpkZsHZUOJo8hcX3GbsiDOa0Qu9F646fi8dT3XuSVopVqAcEiVzSKKH7UoDti23wNX3qGFxcW5Qg==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -16315,6 +18939,7 @@ "version": "3.3.6", "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-3.3.6.tgz", "integrity": "sha512-VoC83HWXmCrF6rgkyxS9GHv8W9Q5nhMKho+OadDJGzL2oDYbYEppBaCMH6pFlwLeqj2QS+hhkw2kpXkSdD1JxQ==", + "license": "MIT", "dependencies": { "sprintf-js": "^1.1.1", "util-deprecate": "^1.0.2" @@ -16326,21 +18951,31 @@ "node_modules/underscore.string/node_modules/sprintf-js": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", - "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==" + "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==", + "license": "BSD-3-Clause" }, "node_modules/undici": { - "version": "6.19.8", - "resolved": "https://registry.npmjs.org/undici/-/undici-6.19.8.tgz", - "integrity": "sha512-U8uCCl2x9TK3WANvmBavymRzxbfFYG+tAu+fgx3zxQy3qdagQqBLwJVrdyO1TBfUXvfKveMKJZhpvUYoOjM+4g==", + "version": "6.21.1", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.21.1.tgz", + "integrity": "sha512-q/1rj5D0/zayJB2FraXdaWxbhWiNKDvu8naDT2dl1yTlvJp4BLtOcp2a5BvgGNQpYYJzau7tf1WgKv3b+7mqpQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=18.17" } }, + "node_modules/undici-types": { + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", + "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", + "dev": true, + "license": "MIT" + }, "node_modules/unicode-canonical-property-names-ecmascript": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", - "integrity": "sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.1.tgz", + "integrity": "sha512-dA8WbNeb2a6oQzAQ55YlT5vQAWGV9WXOsi3SskE3bcCdM0P4SDd+24zS/OCacdRq5BkdsRj9q3Pg6YyQoxIGqg==", + "license": "MIT", "engines": { "node": ">=4" } @@ -16349,6 +18984,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz", "integrity": "sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q==", + "license": "MIT", "dependencies": { "unicode-canonical-property-names-ecmascript": "^2.0.0", "unicode-property-aliases-ecmascript": "^2.0.0" @@ -16358,9 +18994,10 @@ } }, "node_modules/unicode-match-property-value-ecmascript": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.1.0.tgz", - "integrity": "sha512-qxkjQt6qjg/mYscYMC0XKRn3Rh0wFPlfxB0xkt9CfyTvpX1Ra0+rAmdX2QyAobptSEvuy4RtpPRui6XkV+8wjA==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.2.0.tgz", + "integrity": "sha512-4IehN3V/+kkr5YeSSDDQG8QLqO26XpL2XP3GQtqwlT/QYSECAwFztxVHjlbh0+gjJ3XmNLS0zDsbgs9jWKExLg==", + "license": "MIT", "engines": { "node": ">=4" } @@ -16369,6 +19006,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz", "integrity": "sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w==", + "license": "MIT", "engines": { "node": ">=4" } @@ -16378,6 +19016,7 @@ "resolved": "https://registry.npmjs.org/unified/-/unified-9.2.2.tgz", "integrity": "sha512-Sg7j110mtefBD+qunSLO1lqOEKdrwBFBrR6Qd8f4uwkhWNlbkaqwHse6e7QvD3AP/MNoJdEDLaf8OxYyoWgorQ==", "dev": true, + "license": "MIT", "dependencies": { "bail": "^1.0.0", "extend": "^3.0.0", @@ -16396,6 +19035,7 @@ "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -16404,6 +19044,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", + "license": "MIT", "dependencies": { "arr-union": "^3.1.0", "get-value": "^2.0.6", @@ -16418,6 +19059,7 @@ "version": "0.1.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -16426,6 +19068,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", + "license": "ISC", "optional": true, "dependencies": { "unique-slug": "^2.0.0" @@ -16435,6 +19078,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", + "license": "ISC", "optional": true, "dependencies": { "imurmurhash": "^0.1.4" @@ -16445,6 +19089,7 @@ "resolved": "https://registry.npmjs.org/unist-util-find-all-after/-/unist-util-find-all-after-3.0.2.tgz", "integrity": "sha512-xaTC/AGZ0rIM2gM28YVRAFPIZpzbpDtU3dRmp7EXlNVA8ziQc4hY3H7BHXM1J49nEmiqc3svnqMReW+PGqbZKQ==", "dev": true, + "license": "MIT", "dependencies": { "unist-util-is": "^4.0.0" }, @@ -16458,6 +19103,7 @@ "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.1.0.tgz", "integrity": "sha512-ZOQSsnce92GrxSqlnEEseX0gi7GH9zTJZ0p9dtu87WRb/37mMPO2Ilx1s/t9vBHrFhbgweUwb+t7cIn5dxPhZg==", "dev": true, + "license": "MIT", "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" @@ -16468,6 +19114,7 @@ "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-2.0.3.tgz", "integrity": "sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g==", "dev": true, + "license": "MIT", "dependencies": { "@types/unist": "^2.0.2" }, @@ -16481,6 +19128,7 @@ "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 4.0.0" } @@ -16490,6 +19138,7 @@ "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.8" } @@ -16498,6 +19147,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", "integrity": "sha512-PcA2tsuGSF9cnySLHTLSh2qrQiJ70mn+r+Glzxv2TWZblxsxCC52BDlZoPCsz7STd9pN7EZetkWZBAvk4cgZdQ==", + "license": "MIT", "dependencies": { "has-value": "^0.3.1", "isobject": "^3.0.0" @@ -16510,6 +19160,7 @@ "version": "0.3.1", "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", "integrity": "sha512-gpG936j8/MzaeID5Yif+577c17TxaDmhuyVgSwtnL/q8UUTySg8Mecb+8Cf1otgLoD7DDH75axp86ER7LFsf3Q==", + "license": "MIT", "dependencies": { "get-value": "^2.0.3", "has-values": "^0.1.4", @@ -16523,6 +19174,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", "integrity": "sha512-+OUdGJlgjOBZDfxnDjYYG6zp487z0JGNQq3cYQYg5f5hKR+syHMsaztzGeml/4kGG55CSpKSpWTY+jYGgsHLgA==", + "license": "MIT", "dependencies": { "isarray": "1.0.0" }, @@ -16534,6 +19186,7 @@ "version": "0.1.4", "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", "integrity": "sha512-J8S0cEdWuQbqD9//tlZxiMuMNmxB8PlEwvYwuxsTmR1G5RXUePEX/SJn7aD0GMLieuZYSwNH0cQuJGwnYunXRQ==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -16541,21 +19194,23 @@ "node_modules/unset-value/node_modules/isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "license": "MIT" }, "node_modules/untildify": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", "integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/update-browserslist-db": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.0.tgz", - "integrity": "sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.2.tgz", + "integrity": "sha512-PPypAm5qvlD7XMZC3BujecnaOxwhrtoFR+Dqkk5Aa/6DssiH0ibKoketaj9w8LP7Bont1rYeoV5plxD7RTEPRg==", "funding": [ { "type": "opencollective", @@ -16570,9 +19225,10 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "dependencies": { - "escalade": "^3.1.2", - "picocolors": "^1.0.1" + "escalade": "^3.2.0", + "picocolors": "^1.1.1" }, "bin": { "update-browserslist-db": "cli.js" @@ -16585,6 +19241,7 @@ "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "license": "BSD-2-Clause", "dependencies": { "punycode": "^2.1.0" } @@ -16593,22 +19250,14 @@ "version": "0.1.0", "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", "integrity": "sha512-Am1ousAhSLBeB9cG/7k7r2R0zj50uDRlZHPGbazid5s9rlF1F/QKYObEKSIunSjIOkJZqwRRLpvewjEkM7pSqg==", - "deprecated": "Please see https://github.com/lydell/urix#deprecated" - }, - "node_modules/url-parse": { - "version": "1.5.10", - "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", - "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", - "dev": true, - "dependencies": { - "querystringify": "^2.1.1", - "requires-port": "^1.0.0" - } + "deprecated": "Please see https://github.com/lydell/urix#deprecated", + "license": "MIT" }, "node_modules/use": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -16616,13 +19265,15 @@ "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "license": "MIT" }, "node_modules/utils-merge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4.0" } @@ -16631,6 +19282,7 @@ "version": "9.0.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", + "license": "MIT", "bin": { "uuid": "dist/bin/uuid" } @@ -16638,12 +19290,14 @@ "node_modules/v8-compile-cache": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.4.0.tgz", - "integrity": "sha512-ocyWc3bAHBB/guyqJQVI5o4BZkPhznPYUG2ea80Gond/BgNWpap8TOmLSeeQG7bnh2KMISxskdADG59j7zruhw==" + "integrity": "sha512-ocyWc3bAHBB/guyqJQVI5o4BZkPhznPYUG2ea80Gond/BgNWpap8TOmLSeeQG7bnh2KMISxskdADG59j7zruhw==", + "license": "MIT" }, "node_modules/v8flags": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.2.0.tgz", "integrity": "sha512-mH8etigqMfiGWdeXpaaqGfs6BndypxusHHcv2qSHyZkGEznCd/qAXCWWRzeowtL54147cktFOC4P5y+kl8d8Jg==", + "license": "MIT", "dependencies": { "homedir-polyfill": "^1.0.1" }, @@ -16656,6 +19310,7 @@ "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", "dev": true, + "license": "Apache-2.0", "dependencies": { "spdx-correct": "^3.0.0", "spdx-expression-parse": "^3.0.0" @@ -16664,13 +19319,15 @@ "node_modules/varint": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/varint/-/varint-5.0.2.tgz", - "integrity": "sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow==" + "integrity": "sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow==", + "license": "MIT" }, "node_modules/vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.8" } @@ -16683,6 +19340,7 @@ "engines": [ "node >=0.6.0" ], + "license": "MIT", "dependencies": { "assert-plus": "^1.0.0", "core-util-is": "1.0.2", @@ -16694,6 +19352,7 @@ "resolved": "https://registry.npmjs.org/vfile/-/vfile-4.2.1.tgz", "integrity": "sha512-O6AE4OskCG5S1emQ/4gl8zK586RqA3srz3nfK/Viy0UPToBc5Trp9BVFb1u0CjsKrAWwnpr4ifM/KBXPWwJbCA==", "dev": true, + "license": "MIT", "dependencies": { "@types/unist": "^2.0.0", "is-buffer": "^2.0.0", @@ -16710,6 +19369,7 @@ "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-2.0.4.tgz", "integrity": "sha512-DjssxRGkMvifUOJre00juHoP9DPWuzjxKuMDrhNbk2TdaYYBNMStsNhEOt3idrtI12VQYM/1+iM0KOzXi4pxwQ==", "dev": true, + "license": "MIT", "dependencies": { "@types/unist": "^2.0.0", "unist-util-stringify-position": "^2.0.0" @@ -16723,13 +19383,15 @@ "version": "0.2.3", "resolved": "https://registry.npmjs.org/vlq/-/vlq-0.2.3.tgz", "integrity": "sha512-DRibZL6DsNhIgYQ+wNdWDL2SL3bKPlVrRiBqV5yuMm++op8W4kGFtaQfCs4KEJn0wBZcHVHJ3eoywX8983k1ow==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/void-elements": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-3.1.0.tgz", "integrity": "sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -16738,12 +19400,14 @@ "version": "2.6.12", "resolved": "https://registry.npmjs.org/vue/-/vue-2.6.12.tgz", "integrity": "sha512-uhmLFETqPPNyuLLbsKz6ioJ4q7AZHzD8ZVFNATNyICSZouqP2Sz0rotWQC8UNBF6VGSCs5abnKJoStA6JbCbfg==", - "deprecated": "Vue 2 has reached EOL and is no longer actively maintained. See https://v2.vuejs.org/eol/ for more details." + "deprecated": "Vue 2 has reached EOL and is no longer actively maintained. See https://v2.vuejs.org/eol/ for more details.", + "license": "MIT" }, "node_modules/vue-class-component": { "version": "7.2.6", "resolved": "https://registry.npmjs.org/vue-class-component/-/vue-class-component-7.2.6.tgz", "integrity": "sha512-+eaQXVrAm/LldalI272PpDe3+i4mPis0ORiMYxF6Ae4hyuCh15W8Idet7wPUEs4N4YptgFHGys4UrgNQOMyO6w==", + "license": "MIT", "peerDependencies": { "vue": "^2.0.0" } @@ -16753,6 +19417,7 @@ "resolved": "https://registry.npmjs.org/vue-cli-plugin-pug/-/vue-cli-plugin-pug-2.0.0.tgz", "integrity": "sha512-Nnl5pkHqNDMkPTvOX4iidFSUs0sn2A5JGsQBVZ70Wm2aXqbK/B3jvEFOWok5/y9U/aWeZLU05PwYVYc7nTUK2Q==", "dev": true, + "license": "MIT", "dependencies": { "pug": "^3.0.0", "pug-plain-loader": "^1.0.0", @@ -16763,6 +19428,7 @@ "version": "2.2.2", "resolved": "https://registry.npmjs.org/vue-clickaway/-/vue-clickaway-2.2.2.tgz", "integrity": "sha512-25SpjXKetL06GLYoLoC8pqAV6Cur9cQ//2g35GRFBV4FgoljbZZjTINR8g2NuVXXDMLSUXaKx5dutgO4PaDE7A==", + "license": "MIT", "dependencies": { "loose-envify": "^1.2.0" }, @@ -16775,6 +19441,7 @@ "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-7.11.0.tgz", "integrity": "sha512-qh3VhDLeh773wjgNTl7ss0VejY9bMMa0GoDG2fQVyDzRFdiU3L7fw74tWZDHNQXdZqxO3EveQroa9ct39D2nqg==", "dev": true, + "license": "MIT", "dependencies": { "debug": "^4.1.1", "eslint-scope": "^5.1.1", @@ -16799,6 +19466,7 @@ "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", "dev": true, + "license": "MIT", "bin": { "acorn": "bin/acorn" }, @@ -16811,6 +19479,7 @@ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", "dev": true, + "license": "Apache-2.0", "engines": { "node": ">=4" } @@ -16820,6 +19489,7 @@ "resolved": "https://registry.npmjs.org/espree/-/espree-6.2.1.tgz", "integrity": "sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "acorn": "^7.1.1", "acorn-jsx": "^5.2.0", @@ -16833,6 +19503,7 @@ "version": "2.4.5", "resolved": "https://registry.npmjs.org/vue-infinite-loading/-/vue-infinite-loading-2.4.5.tgz", "integrity": "sha512-xhq95Mxun060bRnsOoLE2Be6BR7jYwuC89kDe18+GmCLVrRA/dU0jrGb12Xu6NjmKs+iTW0AA6saSEmEW4cR7g==", + "license": "MIT", "peerDependencies": { "vue": "^2.6.10" } @@ -16840,12 +19511,14 @@ "node_modules/vue-observe-visibility": { "version": "0.4.6", "resolved": "https://registry.npmjs.org/vue-observe-visibility/-/vue-observe-visibility-0.4.6.tgz", - "integrity": "sha512-xo0CEVdkjSjhJoDdLSvoZoQrw/H2BlzB5jrCBKGZNXN2zdZgMuZ9BKrxXDjNP2AxlcCoKc8OahI3F3r3JGLv2Q==" + "integrity": "sha512-xo0CEVdkjSjhJoDdLSvoZoQrw/H2BlzB5jrCBKGZNXN2zdZgMuZ9BKrxXDjNP2AxlcCoKc8OahI3F3r3JGLv2Q==", + "license": "MIT" }, "node_modules/vue-property-decorator": { "version": "8.5.1", "resolved": "https://registry.npmjs.org/vue-property-decorator/-/vue-property-decorator-8.5.1.tgz", "integrity": "sha512-O6OUN2OMsYTGPvgFtXeBU3jPnX5ffQ9V4I1WfxFQ6dqz6cOUbR3Usou7kgFpfiXDvV7dJQSFcJ5yUPgOtPPm1Q==", + "license": "MIT", "dependencies": { "vue-class-component": "^7.1.0" }, @@ -16857,6 +19530,7 @@ "version": "0.4.5", "resolved": "https://registry.npmjs.org/vue-resize/-/vue-resize-0.4.5.tgz", "integrity": "sha512-bhP7MlgJQ8TIkZJXAfDf78uJO+mEI3CaLABLjv0WNzr4CcGRGPIAItyWYnP6LsPA4Oq0WE+suidNs6dgpO4RHg==", + "license": "MIT", "peerDependencies": { "vue": "^2.3.0" } @@ -16864,22 +19538,25 @@ "node_modules/vue-router": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.5.3.tgz", - "integrity": "sha512-FUlILrW3DGitS2h+Xaw8aRNvGTwtuaxrRkNSHWTizOfLUie7wuYwezeZ50iflRn8YPV5kxmU2LQuu3nM/b3Zsg==" + "integrity": "sha512-FUlILrW3DGitS2h+Xaw8aRNvGTwtuaxrRkNSHWTizOfLUie7wuYwezeZ50iflRn8YPV5kxmU2LQuu3nM/b3Zsg==", + "license": "MIT" }, "node_modules/vue-slider-component": { "version": "3.2.11", "resolved": "https://registry.npmjs.org/vue-slider-component/-/vue-slider-component-3.2.11.tgz", "integrity": "sha512-2YyJW6TFnYk5FUvqQLvZcCJ+hthBXB819qNHtwnEUyDbOcTXV0n3Ou1ZphOi5FX9phlQIiC2NvjLuRAVmNq+Zw==", + "license": "MIT", "dependencies": { "core-js": "^3.6.5", "vue-property-decorator": "^8.0.0" } }, "node_modules/vue-slider-component/node_modules/core-js": { - "version": "3.38.1", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.38.1.tgz", - "integrity": "sha512-OP35aUorbU3Zvlx7pjsFdu1rGNnD4pgw/CWoYzRY3t2EzoVT7shKHY1dlAy3f41cGIO7ZDPQimhGFTlEYkG/Hw==", + "version": "3.40.0", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.40.0.tgz", + "integrity": "sha512-7vsMc/Lty6AGnn7uFpYT56QesI5D2Y/UkgKounk87OP9Z2H9Z8kj6jzcSGAxFmUtDOS0ntK6lbQz+Nsa0Jj6mQ==", "hasInstallScript": true, + "license": "MIT", "funding": { "type": "opencollective", "url": "https://opencollective.com/core-js" @@ -16890,6 +19567,7 @@ "resolved": "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.6.12.tgz", "integrity": "sha512-OzzZ52zS41YUbkCBfdXShQTe69j1gQDZ9HIX8miuC9C3rBCk9wIRjLiZZLrmX9V+Ftq/YEyv1JaVr5Y/hNtByg==", "dev": true, + "license": "MIT", "dependencies": { "de-indent": "^1.0.2", "he": "^1.1.0" @@ -16899,12 +19577,14 @@ "version": "1.9.1", "resolved": "https://registry.npmjs.org/vue-template-es2015-compiler/-/vue-template-es2015-compiler-1.9.1.tgz", "integrity": "sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/vue-virtual-scroller": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vue-virtual-scroller/-/vue-virtual-scroller-1.1.2.tgz", "integrity": "sha512-SkUyc7QHCJFB5h1Fya7LxVizlVzOZZuFVipBGHYoTK8dwLs08bIz/tclvRApYhksaJIm/nn51inzO2UjpGJPMQ==", + "license": "MIT", "dependencies": { "scrollparent": "^2.0.1", "vue-observe-visibility": "^0.4.4", @@ -16917,12 +19597,14 @@ "node_modules/vue2-touch-events": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/vue2-touch-events/-/vue2-touch-events-3.0.0.tgz", - "integrity": "sha512-0n5Nc88PL3L4/qOKpQkF0ggjNFjdnVkf+50Nc8SrOpKgYMRrjrEngDadWF8lzLZNKPgDupXfPbSdtzYfbyXO1Q==" + "integrity": "sha512-0n5Nc88PL3L4/qOKpQkF0ggjNFjdnVkf+50Nc8SrOpKgYMRrjrEngDadWF8lzLZNKPgDupXfPbSdtzYfbyXO1Q==", + "license": "MIT" }, "node_modules/vuelidate": { "version": "0.7.6", "resolved": "https://registry.npmjs.org/vuelidate/-/vuelidate-0.7.6.tgz", "integrity": "sha512-suzIuet1jGcyZ4oUSW8J27R2tNrJ9cIfklAh63EbAkFjE380iv97BAiIeolRYoB9bF9usBXCu4BxftWN1Dkn3g==", + "license": "MIT", "engines": { "node": ">= 4.0.0", "npm": ">= 3.0.0" @@ -16932,6 +19614,7 @@ "version": "3.6.0", "resolved": "https://registry.npmjs.org/vuex/-/vuex-3.6.0.tgz", "integrity": "sha512-W74OO2vCJPs9/YjNjW8lLbj+jzT24waTo2KShI8jLvJW8OaIkgb3wuAMA7D+ZiUxDOx3ubwSZTaJBip9G8a3aQ==", + "license": "MIT", "peerDependencies": { "vue": "^2.0.0" } @@ -16941,6 +19624,7 @@ "resolved": "https://registry.npmjs.org/walk/-/walk-2.3.15.tgz", "integrity": "sha512-4eRTBZljBfIISK1Vnt69Gvr2w/wc3U6Vtrw7qiN5iqYJPH7LElcYh/iU4XWhdCy2dZqv1ToMyYlybDylfG/5Vg==", "dev": true, + "license": "(MIT OR Apache-2.0)", "dependencies": { "foreachasync": "^3.0.0" } @@ -16950,6 +19634,7 @@ "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.2.tgz", "integrity": "sha512-TnbFSbcOCcDgjZ4piURLCbJ3nJhznVh9kw6F6iokjiFPl8ONxe9A6nMDVXDiNbrSfLILs6vB07F7wLBrwPYzJw==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { "glob-to-regexp": "^0.4.1", @@ -16960,19 +19645,20 @@ } }, "node_modules/webpack": { - "version": "5.94.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.94.0.tgz", - "integrity": "sha512-KcsGn50VT+06JH/iunZJedYGUJS5FGjow8wb9c0v5n1Om8O1g4L6LjtfxwlXIATopoQu+vOXXa7gYisWxCoPyg==", + "version": "5.97.1", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.97.1.tgz", + "integrity": "sha512-EksG6gFY3L1eFMROS/7Wzgrii5mBAFe4rIr3r2BTfo7bcc+DWwFZ4OJ/miOuHJO/A85HwyI4eQ0F6IKXesO7Fg==", "dev": true, + "license": "MIT", "peer": true, "dependencies": { - "@types/estree": "^1.0.5", - "@webassemblyjs/ast": "^1.12.1", - "@webassemblyjs/wasm-edit": "^1.12.1", - "@webassemblyjs/wasm-parser": "^1.12.1", - "acorn": "^8.7.1", - "acorn-import-attributes": "^1.9.5", - "browserslist": "^4.21.10", + "@types/eslint-scope": "^3.7.7", + "@types/estree": "^1.0.6", + "@webassemblyjs/ast": "^1.14.1", + "@webassemblyjs/wasm-edit": "^1.14.1", + "@webassemblyjs/wasm-parser": "^1.14.1", + "acorn": "^8.14.0", + "browserslist": "^4.24.0", "chrome-trace-event": "^1.0.2", "enhanced-resolve": "^5.17.1", "es-module-lexer": "^1.2.1", @@ -17011,16 +19697,18 @@ "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz", "integrity": "sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==", "dev": true, + "license": "MIT", "peer": true, "engines": { "node": ">=10.13.0" } }, "node_modules/webpack/node_modules/acorn": { - "version": "8.12.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", - "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", "dev": true, + "license": "MIT", "peer": true, "bin": { "acorn": "bin/acorn" @@ -17034,6 +19722,7 @@ "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz", "integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==", "dev": true, + "license": "MIT", "dependencies": { "iconv-lite": "0.6.3" }, @@ -17046,6 +19735,7 @@ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", "dev": true, + "license": "MIT", "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" }, @@ -17058,6 +19748,7 @@ "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz", "integrity": "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==", "dev": true, + "license": "MIT", "engines": { "node": ">=18" } @@ -17066,6 +19757,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "license": "ISC", "dependencies": { "isexe": "^2.0.0" }, @@ -17077,31 +19769,84 @@ } }, "node_modules/which-boxed-primitive": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.1.1.tgz", + "integrity": "sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-bigint": "^1.1.0", + "is-boolean-object": "^1.2.1", + "is-number-object": "^1.1.1", + "is-string": "^1.1.1", + "is-symbol": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-builtin-type": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.2.1.tgz", + "integrity": "sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "function.prototype.name": "^1.1.6", + "has-tostringtag": "^1.0.2", + "is-async-function": "^2.0.0", + "is-date-object": "^1.1.0", + "is-finalizationregistry": "^1.1.0", + "is-generator-function": "^1.0.10", + "is-regex": "^1.2.1", + "is-weakref": "^1.0.2", + "isarray": "^2.0.5", + "which-boxed-primitive": "^1.1.0", + "which-collection": "^1.0.2", + "which-typed-array": "^1.1.16" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-collection": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", - "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.2.tgz", + "integrity": "sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==", "dev": true, + "license": "MIT", "dependencies": { - "is-bigint": "^1.0.1", - "is-boolean-object": "^1.1.0", - "is-number-object": "^1.0.4", - "is-string": "^1.0.5", - "is-symbol": "^1.0.3" + "is-map": "^2.0.3", + "is-set": "^2.0.3", + "is-weakmap": "^2.0.2", + "is-weakset": "^2.0.3" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/which-typed-array": { - "version": "1.1.15", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", - "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", + "version": "1.1.18", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.18.tgz", + "integrity": "sha512-qEcY+KJYlWyLH9vNbsr6/5j59AXk5ni5aakf8ldzBvGde6Iz4sxZGkJyWSAueTG7QhOvNRYb1lDdFmL5Td0QKA==", "dev": true, + "license": "MIT", "dependencies": { "available-typed-arrays": "^1.0.7", - "call-bind": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", "for-each": "^0.3.3", - "gopd": "^1.0.1", + "gopd": "^1.2.0", "has-tostringtag": "^1.0.2" }, "engines": { @@ -17121,6 +19866,7 @@ "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", "dev": true, + "license": "ISC", "dependencies": { "string-width": "^1.0.2 || 2" } @@ -17130,6 +19876,7 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } @@ -17139,6 +19886,7 @@ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } @@ -17148,6 +19896,7 @@ "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "dev": true, + "license": "MIT", "dependencies": { "is-fullwidth-code-point": "^2.0.0", "strip-ansi": "^4.0.0" @@ -17161,6 +19910,7 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", "integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==", "dev": true, + "license": "MIT", "dependencies": { "ansi-regex": "^3.0.0" }, @@ -17173,6 +19923,7 @@ "resolved": "https://registry.npmjs.org/with/-/with-7.0.2.tgz", "integrity": "sha512-RNGKj82nUPg3g5ygxkQl0R937xLyho1J24ItRCBTr/m1YnZkzJy1hUiHUJrc/VlsDQzsCnInEGSg3bci0Lmd4w==", "dev": true, + "license": "MIT", "dependencies": { "@babel/parser": "^7.9.6", "@babel/types": "^7.9.6", @@ -17187,6 +19938,7 @@ "version": "1.2.5", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -17195,6 +19947,7 @@ "version": "0.0.3", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", "integrity": "sha512-1tMA907+V4QmxV7dbRvb4/8MaRALK6q9Abid3ndMYnbyo8piisCmeONVqVSXqQA3KaP4SLt5b7ud6E2sqP8TFw==", + "license": "MIT", "engines": { "node": ">=0.4.0" } @@ -17203,13 +19956,15 @@ "version": "6.1.0", "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.1.0.tgz", "integrity": "sha512-toV7q9rWNYha963Pl/qyeZ6wG+3nnsyvolaNUS8+R5Wtw6qJPTxIlOP1ZSvcGhEJw+l3HMMmtiNo9Gl61G4GVg==", - "dev": true + "dev": true, + "license": "Apache-2.0" }, "node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -17225,13 +19980,15 @@ "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "license": "ISC" }, "node_modules/write-file-atomic": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", "dev": true, + "license": "ISC", "dependencies": { "imurmurhash": "^0.1.4", "is-typedarray": "^1.0.0", @@ -17243,6 +20000,7 @@ "version": "8.5.0", "resolved": "https://registry.npmjs.org/ws/-/ws-8.5.0.tgz", "integrity": "sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==", + "license": "MIT", "engines": { "node": ">=10.0.0" }, @@ -17260,9 +20018,9 @@ } }, "node_modules/xmlhttprequest-ssl": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-2.0.0.tgz", - "integrity": "sha512-QKxVRxiRACQcVuQEYFsI1hhkrMlrXHPegbbd1yn9UHOmRxY+si12nQYzri3vbzt8VdTTRviqcKxcyllFas5z2A==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-2.1.2.tgz", + "integrity": "sha512-TEU+nJVUUnA4CYJFLvK5X9AOeH4KvDvhIfm0vV1GaQRtchnG0hgK5p8hw/xjv8cunWYCsiPCSDzObPyhEwq3KQ==", "dev": true, "engines": { "node": ">=0.4.0" @@ -17273,6 +20031,7 @@ "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", "dev": true, + "license": "ISC", "engines": { "node": ">=10" } @@ -17280,13 +20039,15 @@ "node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "license": "ISC" }, "node_modules/yaml": { "version": "1.10.2", "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", "dev": true, + "license": "ISC", "engines": { "node": ">= 6" } @@ -17296,6 +20057,7 @@ "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", "dev": true, + "license": "MIT", "dependencies": { "cliui": "^8.0.1", "escalade": "^3.1.1", @@ -17314,6 +20076,7 @@ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", "dev": true, + "license": "ISC", "engines": { "node": ">=10" } @@ -17323,6 +20086,7 @@ "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", "dev": true, + "license": "MIT", "dependencies": { "camelcase": "^6.0.0", "decamelize": "^4.0.0", @@ -17338,6 +20102,7 @@ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, @@ -17350,6 +20115,7 @@ "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, @@ -17362,6 +20128,7 @@ "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -17371,6 +20138,7 @@ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", "dev": true, + "license": "ISC", "engines": { "node": ">=12" } @@ -17380,6 +20148,7 @@ "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", "dev": true, + "license": "MIT", "dependencies": { "buffer-crc32": "~0.2.3", "fd-slicer": "~1.1.0" @@ -17390,6 +20159,7 @@ "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, @@ -17402,6 +20172,7 @@ "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-1.0.5.tgz", "integrity": "sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw==", "dev": true, + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" From cbe37a19a71f62b4b4511f9b9939eb54d88c63c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Iv=C3=A1n=20Vieitez=20Parra?= <3857362+corrideat@users.noreply.github.com> Date: Mon, 27 Jan 2025 20:52:42 +0200 Subject: [PATCH 12/24] Address infinite loop when fetching events (#2544) * Address infinite loop when fetching events * Handle forked chains * Feedback * Feedback based on Claud * Types and bugfixes --- frontend/main.js | 16 +- frontend/setupChelonia.js | 13 +- shared/domains/chelonia/errors.js | 1 + shared/domains/chelonia/internals.js | 12 +- shared/domains/chelonia/utils.js | 240 +++++++++++++++------------ shared/serdes/index.js | 14 +- 6 files changed, 178 insertions(+), 118 deletions(-) diff --git a/frontend/main.js b/frontend/main.js index 2acc28f83..6951266a8 100644 --- a/frontend/main.js +++ b/frontend/main.js @@ -104,8 +104,22 @@ async function startApp () { Vue.set(reverseCache, value, name) }) - sbp('okTurtles.events/on', SERIOUS_ERROR, (error) => { + sbp('okTurtles.events/on', SERIOUS_ERROR, (error, { contractID }) => { sbp('gi.ui/seriousErrorBanner', error) + if (error?.name === 'ChelErrorForkedChain') { + const rootState = sbp('state/vuex/state') + const type = rootState.contracts[contractID].type || '(unknown)' + console.error('Forked chain detected', { contractID, type }, error) + + const retry = confirm(L("The server's history for '{type}' has diverged from ours. This can happen in extremely rare circumstances due to either malicious activity or a bug.\n\nTo fix this, the contract needs to be resynced, and some recent events may be missing. Would you like to do so now?\n\n(If problems persist, please open the Troubleshooting page under the User Settings and resync all contracts.)", { type })) + + if (retry) { + sbp('chelonia/contract/sync', contractID, { resync: true }).catch((e) => { + console.error('Error during re-sync', contractID, e) + alert(L('There was a problem resyncing the contract: {errMsg}\n\nPlease see the Application Logs under User Settings for more details. The Troubleshooting page in User Settings may be another way to fix the problem.', { errMsg: e?.message || e })) + }) + } + } if (process.env.CI) { Promise.reject(error) } diff --git a/frontend/setupChelonia.js b/frontend/setupChelonia.js index 77b5520d7..04cf39fe3 100644 --- a/frontend/setupChelonia.js +++ b/frontend/setupChelonia.js @@ -139,9 +139,15 @@ const setupChelonia = async (): Promise<*> => { } }, hooks: { + syncContractError: (e: Error, contractID: string) => { + if (['ChelErrorUnrecoverable', 'ChelErrorForkedChain'].includes(e?.name)) { + sbp('okTurtles.events/emit', SERIOUS_ERROR, e, { contractID }) + } + }, handleEventError: (e: Error, message: GIMessage) => { - if (e.name === 'ChelErrorUnrecoverable') { - sbp('okTurtles.events/emit', SERIOUS_ERROR, e) + if (['ChelErrorUnrecoverable', 'ChelErrorForkedChain'].includes(e?.name)) { + const contractID = message.contractID() + sbp('okTurtles.events/emit', SERIOUS_ERROR, e, { contractID, message }) } if (sbp('okTurtles.data/get', 'sideEffectError') !== message.hash()) { // Avoid duplicate notifications for the same message. @@ -161,7 +167,8 @@ const setupChelonia = async (): Promise<*> => { errorNotification('process', e, message) }, sideEffectError: (e: Error, message: GIMessage) => { - sbp('okTurtles.events/emit', SERIOUS_ERROR, e) + const contractID = message.contractID() + sbp('okTurtles.events/emit', SERIOUS_ERROR, e, { contractID, message }) sbp('okTurtles.data/set', 'sideEffectError', message.hash()) errorNotification('sideEffect', e, message) } diff --git a/shared/domains/chelonia/errors.js b/shared/domains/chelonia/errors.js index 381c485ed..bf5923fd6 100644 --- a/shared/domains/chelonia/errors.js +++ b/shared/domains/chelonia/errors.js @@ -28,6 +28,7 @@ export const ChelErrorDBBadPreviousHEAD: typeof Error = ChelErrorGenerator('Chel export const ChelErrorDBConnection: typeof Error = ChelErrorGenerator('ChelErrorDBConnection') export const ChelErrorUnexpected: typeof Error = ChelErrorGenerator('ChelErrorUnexpected') export const ChelErrorUnrecoverable: typeof Error = ChelErrorGenerator('ChelErrorUnrecoverable') +export const ChelErrorForkedChain: typeof Error = ChelErrorGenerator('ChelErrorForkedChain') export const ChelErrorDecryptionError: typeof Error = ChelErrorGenerator('ChelErrorDecryptionError') export const ChelErrorDecryptionKeyNotFound: typeof Error = ChelErrorGenerator('ChelErrorDecryptionKeyNotFound', ChelErrorDecryptionError) export const ChelErrorSignatureError: typeof Error = ChelErrorGenerator('ChelErrorSignatureError') diff --git a/shared/domains/chelonia/internals.js b/shared/domains/chelonia/internals.js index a378be996..750ef82c6 100644 --- a/shared/domains/chelonia/internals.js +++ b/shared/domains/chelonia/internals.js @@ -12,7 +12,7 @@ import { deserializeKey, keyId, verifySignature } from './crypto.js' import './db.js' import { encryptedIncomingData, encryptedOutgoingData, unwrapMaybeEncryptedData } from './encryptedData.js' import type { EncryptedData } from './encryptedData.js' -import { ChelErrorUnrecoverable, ChelErrorWarning, ChelErrorDBBadPreviousHEAD, ChelErrorAlreadyProcessed, ChelErrorFetchServerTimeFailed } from './errors.js' +import { ChelErrorUnrecoverable, ChelErrorWarning, ChelErrorDBBadPreviousHEAD, ChelErrorAlreadyProcessed, ChelErrorFetchServerTimeFailed, ChelErrorForkedChain } from './errors.js' import { CONTRACTS_MODIFIED, CONTRACT_HAS_RECEIVED_KEYS, CONTRACT_IS_SYNCING, EVENT_HANDLED, EVENT_PUBLISHED, EVENT_PUBLISHING_ERROR } from './events.js' import { buildShelterAuthorizationHeader, findKeyIdByName, findSuitablePublicKeyIds, findSuitableSecretKeyId, getContractIDfromKeyId, keyAdditionProcessor, recreateEvent, validateKeyPermissions, validateKeyAddPermissions, validateKeyDelPermissions, validateKeyUpdatePermissions } from './utils.js' import { isSignedData, signedIncomingData } from './signedData.js' @@ -1286,7 +1286,7 @@ export default (sbp('sbp/selectors/register', { const { done, value: event } = await eventReader.read() if (done) { if (!latestHashFound) { - throw new ChelErrorUnrecoverable(`expected hash ${latestHEAD} in list of events for contract ${contractID}`) + throw new ChelErrorForkedChain(`expected hash ${latestHEAD} in list of events for contract ${contractID}`) } break } @@ -1864,7 +1864,13 @@ export default (sbp('sbp/selectors/register', { processingErrored = e?.name !== 'ChelErrorWarning' this.config.hooks.processError?.(e, message, getMsgMeta(message, contractID, state)) // special error that prevents the head from being updated, effectively killing the contract - if (e.name === 'ChelErrorUnrecoverable' || message.isFirstMessage()) throw e + if ( + e.name === 'ChelErrorUnrecoverable' || + e.name === 'ChelErrorForkedChain' || + message.isFirstMessage() + ) { + throw e + } } // process any side-effects (these must never result in any mutation to the contract state!) diff --git a/shared/domains/chelonia/utils.js b/shared/domains/chelonia/utils.js index bc904f9ad..5338ade14 100644 --- a/shared/domains/chelonia/utils.js +++ b/shared/domains/chelonia/utils.js @@ -8,7 +8,7 @@ import { INVITE_STATUS } from './constants.js' import { deserializeKey, serializeKey, sign, verifySignature } from './crypto.js' import type { EncryptedData } from './encryptedData.js' import { unwrapMaybeEncryptedData } from './encryptedData.js' -import { ChelErrorWarning } from './errors.js' +import { ChelErrorForkedChain, ChelErrorWarning } from './errors.js' import { CONTRACT_IS_PENDING_KEY_REQUESTS } from './events.js' import type { SignedData } from './signedData.js' import { isSignedData } from './signedData.js' @@ -585,7 +585,7 @@ export function eventsAfter (contractID: string, sinceHeight: number, limit?: nu let remainingEvents = limit ?? Number.POSITIVE_INFINITY let eventsStreamReader let latestHeight - let state: 'fetch' | 'read-eos' | 'read-new-response' | 'read' | 'events' = 'fetch' + let state: 'fetch' | 'read-eos' | 'read-new-response' | 'read' | 'events' | 'eod' = 'fetch' let requestLimit: number let count: number let buffer: string = '' @@ -595,143 +595,163 @@ export function eventsAfter (contractID: string, sinceHeight: number, limit?: nu // The pull function is called whenever the internal buffer of the stream // becomes empty and needs more data. async pull (controller) { - for (;;) { + try { + for (;;) { // Handle different states of the stream reading process. - switch (state) { + switch (state) { // When in 'fetch' state, initiate a new fetch request to obtain a // stream reader for events. - case 'fetch': { - eventsStreamReader = await fetchEventsStreamReader() - // Transition to reading the new response and reset the processed - // events counter - state = 'read-new-response' - count = 0 - break - } - case 'read-eos': // End of stream case - case 'read-new-response': // Just started reading a new response - case 'read': { // Reading from the response stream - const { done, value } = await eventsStreamReader.read() - // If done, determine if the stream should close or fetch more - // data by making a new request - if (done) { + case 'fetch': { + eventsStreamReader = await fetchEventsStreamReader() + // Transition to reading the new response and reset the processed + // events counter + state = 'read-new-response' + count = 0 + break + } + case 'read-eos': // End of stream case + case 'read-new-response': // Just started reading a new response + case 'read': { // Reading from the response stream + const { done, value } = await eventsStreamReader.read() + // If done, determine if the stream should close or fetch more + // data by making a new request + if (done) { // No more events to process or reached the latest event - if (remainingEvents === 0 || sinceHeight === latestHeight) { - controller.close() - return - } else if (state === 'read-new-response' || buffer) { + // Using `>=` instead of `===` to avoid an infinite loop in the + // event of data loss on the server. + if (remainingEvents === 0 || sinceHeight >= latestHeight) { + controller.close() + return + } else if (state === 'read-new-response' || buffer) { // If done prematurely, throw an error - controller.error(new Error('Invalid response: done too early')) - return - } else { + throw new Error('Invalid response: done too early') + } else { // If there are still events to fetch, switch state to fetch - state = 'fetch' - break + state = 'fetch' + break + } } - } - if (!value) { + if (!value) { // If there's no value (e.g., empty response), throw an error - controller.error(new Error('Invalid response: missing body')) - return - } - // Concatenate new data to the buffer, trimming any - // leading/trailing whitespace (the response is a JSON array of - // base64-encoded data, meaning that whitespace is not significant) - buffer = buffer + Buffer.from(value).toString().trim() - // If there was only whitespace, try reading again - if (!buffer) break - if (state === 'read-new-response') { + throw new Error('Invalid response: missing body') + } + // Concatenate new data to the buffer, trimming any + // leading/trailing whitespace (the response is a JSON array of + // base64-encoded data, meaning that whitespace is not significant) + buffer = buffer + Buffer.from(value).toString().trim() + // If there was only whitespace, try reading again + if (!buffer) break + if (state === 'read-new-response') { // Response is in JSON format, so we look for the start of an // array (`[`) - if (buffer[0] !== '[') { - controller.error(new Error('Invalid response: no array start delimiter')) - return - } - // Trim the array start delimiter from the buffer - buffer = buffer.slice(1) - } else if (state === 'read-eos') { + if (buffer[0] !== '[') { + throw new Error('Invalid response: no array start delimiter') + } + // Trim the array start delimiter from the buffer + buffer = buffer.slice(1) + } else if (state === 'read-eos') { // If in 'read-eos' state and still reading data, it's an error // because the response isn't valid JSON (there should be // nothing other than whitespace after `]`) - controller.error(new Error('Invalid data at the end of response')) - return + throw new Error('Invalid data at the end of response') + } + // If not handling new response or end-of-stream, switch to + // processing events + state = 'events' + break } - // If not handling new response or end-of-stream, switch to - // processing events - state = 'events' - break - } - case 'events': { + case 'events': { // Process events by looking for a comma or closing bracket that // indicates the end of an event - const nextIdx = buffer.search(/(?<=\s*)[,\]]/) - // If the end of the event isn't found, go back to reading more - // data - if (nextIdx < 0) { - state = 'read' - break - } - let enqueued = false - try { + const nextIdx = buffer.search(/(?<=\s*)[,\]]/) + // If the end of the event isn't found, go back to reading more + // data + if (nextIdx < 0) { + state = 'read' + break + } + let enqueued = false + try { // Extract the current event's value and trim whitespace - const eventValue = buffer.slice(0, nextIdx).trim() - if (eventValue) { + const eventValue = buffer.slice(0, nextIdx).trim() + if (eventValue) { // Check if the event limit is reached; if so, throw an error - if (count === requestLimit) { - controller.error(new Error('Received too many events')) - return + if (count === requestLimit) { + throw new Error('Received too many events') + } + currentEvent = b64ToStr(JSON.parse(eventValue)) + if (count === 0) { + const hash = GIMessage.deserializeHEAD(currentEvent).hash + const height = GIMessage.deserializeHEAD(currentEvent).head.height + if (height !== sinceHeight || (sinceHash && sinceHash !== hash)) { + if (height === sinceHeight && sinceHash && sinceHash !== hash) { + throw new ChelErrorForkedChain(`Forked chain: hash(${hash}) !== since(${sinceHash})`) + } else { + throw new Error(`Unexpected data: hash(${hash}) !== since(${sinceHash || ''}) or height(${height}) !== since(${sinceHeight})`) + } + } + } + // If this is the first event in a second or later request, + // drop the event because it's already been included in + // a previous response + if (count++ !== 0 || requestCount !== 0) { + controller.enqueue(currentEvent) + enqueued = true + remainingEvents-- + } } - currentEvent = b64ToStr(JSON.parse(eventValue)) - if (count === 0) { - const hash = GIMessage.deserializeHEAD(currentEvent).hash - const height = GIMessage.deserializeHEAD(currentEvent).head.height - if (height !== sinceHeight || (sinceHash && sinceHash !== hash)) { - controller.error(new Error('hash() !== since')) - return + // If the stream is finished (indicated by a closing bracket), + // update `since` (to make the next request if needed) and + // switch to 'read-eos'. + if (buffer[nextIdx] === ']') { + if (currentEvent) { + const deserialized = GIMessage.deserializeHEAD(currentEvent) + sinceHeight = deserialized.head.height + sinceHash = deserialized.hash + state = 'read-eos' + } else { + // If the response came empty, assume there are no more events + // after. Mostly this prevents infinite loops if a server is + // claiming there are more events than it's willing to return + // data for. + state = 'eod' } + // This should be an empty string now + buffer = buffer.slice(nextIdx + 1).trim() + } else if (currentEvent) { + // Otherwise, move the buffer pointer to the next event + buffer = buffer.slice(nextIdx + 1).trimStart() + } else { + // If the end delimiter (`]`) is missing, throw an error + throw new Error('Missing end delimiter') } - // If this is the first event in a second or later request, - // drop the event because it's already been included in - // a previous response - if (count++ !== 0 || requestCount !== 0) { - controller.enqueue(currentEvent) - enqueued = true - remainingEvents-- + // If an event was successfully enqueued, exit the loop to wait + // for the next pull request + if (enqueued) { + return } + } catch (e) { + console.error('[chelonia] Error during event parsing', e) + throw e } - // If the stream is finished (indicated by a closing bracket), - // update `since` (to make the next request if needed) and - // switch to 'read-eos'. - if (buffer[nextIdx] === ']') { - if (currentEvent) { - const deserialized = GIMessage.deserializeHEAD(currentEvent) - sinceHeight = deserialized.head.height - sinceHash = deserialized.hash - } - state = 'read-eos' - // This should be an empty string now - buffer = buffer.slice(nextIdx + 1).trim() - } else if (currentEvent) { - // Otherwise, move the buffer pointer to the next event - buffer = buffer.slice(nextIdx + 1).trimStart() + break + } + case 'eod': { + if (remainingEvents === 0 || sinceHeight >= latestHeight) { + controller.close() } else { - // If the end delimiter (`]`) is missing, throw an error - controller.error(new Error('Missing end delimiter')) - return + throw new Error('Unexpected end of data') } - // If an event was successfully enqueued, exit the loop to wait - // for the next pull request - if (enqueued) { - return - } - } catch (e) { - console.error('[chelonia] Error during event parsing', e) - controller.error(e) return } - break } } + } catch (e) { + // $FlowFixMe[incompatible-use] + eventsStreamReader?.cancel('Error during pull').catch(e2 => { + console.error('Error canceling underlying event stream reader on error', e, e2) + }) + throw e } } }) diff --git a/shared/serdes/index.js b/shared/serdes/index.js index d30e70e16..b4c992016 100644 --- a/shared/serdes/index.js +++ b/shared/serdes/index.js @@ -59,11 +59,17 @@ export const serializer = (data: any): any => { } // Error, Blob, File, etc. are supported by structuredClone but not by JSON // We mark these as 'refs', so that the reviver can undo this transformation - if (value instanceof Error || value instanceof Blob || value instanceof File) { + if (value instanceof Blob || value instanceof File) { const pos = verbatim.length verbatim[verbatim.length] = value return rawResult(['_', '_ref', pos]) } + // However, Error cloning doesn't preserve `.name` + if (value instanceof Error) { + const pos = verbatim.length + verbatim[verbatim.length] = value + return rawResult(['_', '_err', rawResult(['_', '_ref', pos]), value.name]) + } // Same for other types supported by structuredClone but not JSON if (value instanceof MessagePort || value instanceof ReadableStream || value instanceof WritableStream || value instanceof ArrayBuffer) { const pos = verbatim.length @@ -167,6 +173,12 @@ export const deserializer = (data: any): any => { // These are literal values, return them case '_ref': return verbatim[value[2]] + case '_err': { + if (value[2].name !== value[3]) { + value[2].name = value[3] + } + return value[2] + } // These were functions converted to a MessagePort. Convert them on this // end back into functions using that port. case '_fn': { From ad1c3e0fd490549b536e08cad84e2c5955c8ef16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Iv=C3=A1n=20Vieitez=20Parra?= <3857362+corrideat@users.noreply.github.com> Date: Mon, 27 Jan 2025 20:53:25 +0200 Subject: [PATCH 13/24] Fix #2536. Also closes #2541. (#2545) --- .../views/containers/chatroom/ChatMain.vue | 44 ++++++++++--------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/frontend/views/containers/chatroom/ChatMain.vue b/frontend/views/containers/chatroom/ChatMain.vue index 69547e370..0d3784808 100644 --- a/frontend/views/containers/chatroom/ChatMain.vue +++ b/frontend/views/containers/chatroom/ChatMain.vue @@ -280,7 +280,9 @@ export default ({ if (this.currentChatRoomId && this.isJoinedChatRoom(this.currentChatRoomId)) { // NOTE: this.currentChatRoomId could be null when enter group chat page very soon // after the first opening the Group Income application - this.setInitMessages() + this.setInitMessages().catch(e => { + console.error('[ChatMain.vue] mounted error', e) + }) } sbp('okTurtles.events/on', EVENT_HANDLED, this.listenChatRoomActions) window.addEventListener('resize', this.resizeEventHandler) @@ -755,8 +757,8 @@ export default ({ console.error(`Error while adding emotion for ${contractID}`, e) }) }, - generateNewChatRoomState (shouldClearMessages = false, height) { - const state = sbp('chelonia/contract/state', this.renderingChatRoomId, height) || {} + async generateNewChatRoomState (shouldClearMessages = false, height) { + const state = await sbp('chelonia/contract/state', this.renderingChatRoomId, height) || {} return { settings: state.settings || {}, attributes: state.attributes || {}, @@ -767,11 +769,11 @@ export default ({ renderingContext: true // NOTE: DO NOT RENAME THIS OR CHATROOM WOULD BREAK } }, - initializeState (forceClearMessages = false) { + async initializeState (forceClearMessages = false) { // NOTE: this state is rendered using the chatroom contract functions // so should be CAREFUL of updating the fields this.latestEvents = [] - Vue.set(this.messageState, 'contract', this.generateNewChatRoomState(forceClearMessages)) + Vue.set(this.messageState, 'contract', await this.generateNewChatRoomState(forceClearMessages)) }, /** * Load/render events for one or more pages @@ -866,7 +868,7 @@ export default ({ if (this.latestEvents.length > 0) { const entryHeight = GIMessage.deserializeHEAD(this.latestEvents[0]).head.height - let state = this.generateNewChatRoomState(true, entryHeight) + let state = await this.generateNewChatRoomState(true, entryHeight) for (const event of this.latestEvents) { state = await sbp('chelonia/in/processMessage', event, state) @@ -875,14 +877,14 @@ export default ({ Vue.set(this.messageState, 'contract', state) } }, - setInitMessages () { + async setInitMessages () { if (this.renderingChatRoomId === this.currentChatRoomId) { return } // NOTE: since the state is initialized based on the renderingChatRoomId // need to set renderingChatRoomId here, before calling initializeState this.renderingChatRoomId = this.currentChatRoomId - this.initializeState() + await this.initializeState() this.ephemeral.messagesInitiated = false this.ephemeral.unprocessedEvents = [] if (this.ephemeral.infiniteLoading) { @@ -1119,7 +1121,9 @@ export default ({ // doesn't need to be flushed refreshContent: debounce(function () { // NOTE: using debounce we can skip unnecessary rendering contents - this.setInitMessages() + this.setInitMessages().catch(e => { + console.error('[ChatMain.vue] refreshContent error', e) + }) }, 250), // Handlers for file-upload via drag & drop action dragStartHandler (e) { @@ -1161,30 +1165,28 @@ export default ({ const initAfterSynced = (toChatRoomId) => { if (toChatRoomId !== this.summary.chatRoomID || this.ephemeral.messagesInitiated) return - this.setInitMessages() + return this.setInitMessages() } if (toChatRoomId !== fromChatRoomId) { this.ephemeral.onChatScroll?.flush() - this.initializeState(true) - this.ephemeral.messagesInitiated = false - this.ephemeral.scrolledDistance = 0 - // Coerce 'chelonia/contract/isSyncing' into a Promise - // This may seem weird, but it's needed because the result may be a - // boolean when Chelonia is running in the browsing context, or it may - // be a promise when Chelonia is proxied using the 'chelonia/*' selector, - // like when using a SW. - // We also don't use `await`, which would be more straightforward because + // We don't use `await`, which would be more straightforward because // that'd require this entire function to be `async`, which could result // in race conditions as this is a watcher. - Promise.resolve(sbp('chelonia/contract/isSyncing', toChatRoomId)).then((isSyncing) => { + this.initializeState(true).then(async () => { + this.checkEventSourceConsistency(toChatRoomId) + this.ephemeral.messagesInitiated = false + this.ephemeral.scrolledDistance = 0 + const isSyncing = await sbp('chelonia/contract/isSyncing', toChatRoomId) // If the chatroom has changed since, return if (this.summary.chatRoomID !== toChatRoomId) return if (isSyncing) { - toIsJoined && sbp('chelonia/queueInvocation', toChatRoomId, () => initAfterSynced(toChatRoomId)) + return toIsJoined && sbp('chelonia/queueInvocation', toChatRoomId, () => initAfterSynced(toChatRoomId)) } else { this.refreshContent() } + }).catch(e => { + console.error('[ChatMain.vue] summary watcher error', e) }) } else if (toIsJoined && toIsJoined !== fromIsJoined) { sbp('chelonia/queueInvocation', toChatRoomId, () => initAfterSynced(toChatRoomId)) From 83b7f81ae5e14ab58b244dc69f2f995e5c2602db Mon Sep 17 00:00:00 2001 From: Greg Slepak Date: Tue, 28 Jan 2025 10:44:04 -0800 Subject: [PATCH 14/24] Fix Cypress bug in tests --- frontend/views/containers/chatroom/SendArea.vue | 1 + test/cypress/support/commands.js | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/views/containers/chatroom/SendArea.vue b/frontend/views/containers/chatroom/SendArea.vue index d07852c6c..c7d121265 100644 --- a/frontend/views/containers/chatroom/SendArea.vue +++ b/frontend/views/containers/chatroom/SendArea.vue @@ -251,6 +251,7 @@ .c-send-button( id='mobileSendButton' tag='button' + data-test='sendMessageButton' :class='{ isActive }' @click='sendMessage' ) diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js index ac9ff7186..24927a609 100644 --- a/test/cypress/support/commands.js +++ b/test/cypress/support/commands.js @@ -874,7 +874,11 @@ Cypress.Commands.add('giSendMessage', (sender, message) => { // The following is to ensure the chatroom has finished loading (no spinner) cy.giWaitUntilMessagesLoaded(false) cy.getByDT('messageInputWrapper').within(() => { - cy.get('textarea').type(`{selectall}{del}${message}{enter}`, { force: true }) + // NOTE: Cypress bug: for some reason this {enter} thing is causing the tests to fail + // Instead we manually click the send button. + // cy.get('textarea').type(`{selectall}{del}${message}{enter}`, { force: true }) + cy.get('textarea').type(`{selectall}{del}${message}`, { force: true }) + cy.getByDT('sendMessageButton').click() cy.get('textarea').should('be.empty') }) cy.getByDT('conversationWrapper').within(() => { From 34156c8d373c0d04c25fcbd66e3c80a7e6650f71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Iv=C3=A1n=20Vieitez=20Parra?= <3857362+corrideat@users.noreply.github.com> Date: Tue, 28 Jan 2025 23:58:58 +0200 Subject: [PATCH 15/24] Close #2553 (#2555) * Close #2544 * ChatMain additional checks * Add nonReactive key * Use reference object after isSyncing check * Add consistency check * Fixes * Empty --- Gruntfile.js | 6 +- .../controller/serviceworkers/sw-primary.js | 6 ++ frontend/main.js | 2 + .../views/containers/chatroom/ChatMain.vue | 94 ++++++++++++------- shared/domains/chelonia/utils.js | 5 +- 5 files changed, 79 insertions(+), 34 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index ccf8b46db..e8e6a8e0f 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -17,7 +17,7 @@ const util = require('util') const chalk = require('chalk') const crypto = require('crypto') -const { exec, fork } = require('child_process') +const { exec, execSync, fork } = require('child_process') const execP = util.promisify(exec) const { readdir, cp, mkdir, access, rm, copyFile, readFile } = require('fs/promises') const fs = require('fs') @@ -84,6 +84,9 @@ if (!process.env.DB_PATH) { module.exports = (grunt) => { require('load-grunt-tasks')(grunt) + const GI_GIT_VERSION = process.env.CI ? process.env.GI_VERSION : execSync('git describe --dirty').toString('ascii') + Object.assign(process.env, { GI_GIT_VERSION }) + // Ensure API_PORT and API_URL envars are defined and available to subprocesses. ;(function defineApiEnvars () { const API_PORT = Number.parseInt(grunt.option('port') ?? process.env.API_PORT ?? '8000', 10) @@ -220,6 +223,7 @@ module.exports = (grunt) => { 'process.env.CI': `'${CI}'`, 'process.env.CONTRACTS_VERSION': `'${CONTRACTS_VERSION}'`, 'process.env.GI_VERSION': `'${GI_VERSION}'`, + 'process.env.GI_GIT_VERSION': `'${GI_GIT_VERSION}'`, 'process.env.LIGHTWEIGHT_CLIENT': `'${LIGHTWEIGHT_CLIENT}'`, 'process.env.MAX_EVENTS_AFTER': `'${MAX_EVENTS_AFTER}'`, 'process.env.NODE_ENV': `'${NODE_ENV}'`, diff --git a/frontend/controller/serviceworkers/sw-primary.js b/frontend/controller/serviceworkers/sw-primary.js index d08f0b60d..2882b80eb 100644 --- a/frontend/controller/serviceworkers/sw-primary.js +++ b/frontend/controller/serviceworkers/sw-primary.js @@ -32,6 +32,12 @@ import { import './push.js' import './sw-namespace.js' +console.info('GI_VERSION:', process.env.GI_VERSION) +console.info('GI_GIT_VERSION:', process.env.GI_GIT_VERSION) +console.info('CONTRACTS_VERSION:', process.env.CONTRACTS_VERSION) +console.info('LIGHTWEIGHT_CLIENT:', process.env.LIGHTWEIGHT_CLIENT) +console.info('NODE_ENV:', process.env.NODE_ENV) + deserializer.register(GIMessage) deserializer.register(Secret) diff --git a/frontend/main.js b/frontend/main.js index 6951266a8..0b09877b2 100644 --- a/frontend/main.js +++ b/frontend/main.js @@ -44,6 +44,7 @@ import { showNavMixin } from './views/utils/misc.js' import './views/utils/vStyle.js' console.info('GI_VERSION:', process.env.GI_VERSION) +console.info('GI_GIT_VERSION:', process.env.GI_GIT_VERSION) console.info('CONTRACTS_VERSION:', process.env.CONTRACTS_VERSION) console.info('LIGHTWEIGHT_CLIENT:', process.env.LIGHTWEIGHT_CLIENT) console.info('NODE_ENV:', process.env.NODE_ENV) @@ -114,6 +115,7 @@ async function startApp () { const retry = confirm(L("The server's history for '{type}' has diverged from ours. This can happen in extremely rare circumstances due to either malicious activity or a bug.\n\nTo fix this, the contract needs to be resynced, and some recent events may be missing. Would you like to do so now?\n\n(If problems persist, please open the Troubleshooting page under the User Settings and resync all contracts.)", { type })) if (retry) { + sbp('gi.ui/clearBanner') sbp('chelonia/contract/sync', contractID, { resync: true }).catch((e) => { console.error('Error during re-sync', contractID, e) alert(L('There was a problem resyncing the contract: {errMsg}\n\nPlease see the Application Logs under User Settings for more details. The Troubleshooting page in User Settings may be another way to fix the problem.', { errMsg: e?.message || e })) diff --git a/frontend/views/containers/chatroom/ChatMain.vue b/frontend/views/containers/chatroom/ChatMain.vue index 0d3784808..8c2a571c5 100644 --- a/frontend/views/containers/chatroom/ChatMain.vue +++ b/frontend/views/containers/chatroom/ChatMain.vue @@ -184,7 +184,7 @@ const onChatScroll = function () { } } - if (!this.ephemeral.messagesInitiated && this.renderingChatRoomId) { + if (!this.ephemeral.messagesInitiated && this.nonReactive.renderingChatRoomId) { return } @@ -197,7 +197,7 @@ const onChatScroll = function () { const scrollMarginTop = parseFloat(window.getComputedStyle(this.$refs[msg.hash][0].$el).scrollMarginTop || 0) if (offsetTop - scrollMarginTop > curScrollTop) { sbp('okTurtles.events/emit', NEW_CHATROOM_UNREAD_POSITION, { - chatRoomID: this.renderingChatRoomId, + chatRoomID: this.nonReactive.renderingChatRoomId, messageHash: msg.hash }) break @@ -205,7 +205,7 @@ const onChatScroll = function () { } } else if (this.currentChatRoomScrollPosition) { sbp('okTurtles.events/emit', NEW_CHATROOM_UNREAD_POSITION, { - chatRoomID: this.renderingChatRoomId, + chatRoomID: this.nonReactive.renderingChatRoomId, messageHash: null }) } @@ -239,6 +239,16 @@ export default ({ isPhone: null }, latestEvents: [], + // keys here are meant to be used without Vue.set as they're not directly + // connected to rendering + nonReactive: { + // NOTE: Since the this.currentChatRoomId is a getter which can be changed anytime. + // We can not use this.currentChatRoomId to point the current-rendering-chatRoomID + // because it takes some time to render the chatroom which is enough for this.currentChatRoomId to be changed + // We initiate the chatroom state when we open or switch a chatroom, so we can say that + // the current-rendering-chatroom is the chatroom whose state is initiated for the last time. + renderingChatRoomId: null + }, ephemeral: { startedUnreadMessageHash: null, scrolledDistance: 0, @@ -247,12 +257,6 @@ export default ({ // NOTE: messagesInitiated describes if the messages are fully re-rendered // according to this, we could display loading/skeleton component messagesInitiated: undefined, - // NOTE: Since the this.currentChatRoomId is a getter which can be changed anytime. - // We can not use this.currentChatRoomId to point the current-rendering-chatRoomID - // because it takes some time to render the chatroom which is enough for this.currentChatRoomId to be changed - // We initiate the chatroom state when we open or switch a chatroom, so we can say that - // the current-rendering-chatroom is the chatroom whose state is initiated for the last time. - renderingChatRoomId: null, replyingMessage: null, replyingTo: null, unprocessedEvents: [] @@ -391,7 +395,7 @@ export default ({ }, handleSendMessage (text, attachments, replyingMessage) { const hasAttachments = attachments?.length > 0 - const contractID = this.renderingChatRoomId + const contractID = this.nonReactive.renderingChatRoomId const data = { type: MESSAGE_TYPES.TEXT, text } if (replyingMessage) { @@ -636,7 +640,7 @@ export default ({ editMessage (message, newMessage) { message.text = newMessage message.pending = true - const contractID = this.renderingChatRoomId + const contractID = this.nonReactive.renderingChatRoomId sbp('gi.actions/chatroom/editMessage', { contractID, data: { @@ -649,7 +653,7 @@ export default ({ }) }, pinToChannel (message) { - const contractID = this.renderingChatRoomId + const contractID = this.nonReactive.renderingChatRoomId sbp('gi.actions/chatroom/pinMessage', { contractID, data: { message } @@ -658,7 +662,7 @@ export default ({ }) }, async unpinFromChannel (hash) { - const contractID = this.renderingChatRoomId + const contractID = this.nonReactive.renderingChatRoomId const promptConfig = { heading: L('Remove pinned message'), @@ -679,7 +683,7 @@ export default ({ } }, async deleteMessage (message) { - const contractID = this.renderingChatRoomId + const contractID = this.nonReactive.renderingChatRoomId const manifestCids = (message.attachments || []).map(attachment => attachment.downloadData.manifestCid) const question = message.attachments?.length ? L('Are you sure you want to delete this message and it\'s file attachments permanently?') @@ -749,7 +753,7 @@ export default ({ return this.ephemeral.startedUnreadMessageHash === msgHash }, addEmoticon (message, emoticon) { - const contractID = this.renderingChatRoomId + const contractID = this.nonReactive.renderingChatRoomId sbp('gi.actions/chatroom/makeEmotion', { contractID, data: { hash: message.hash, emoticon } @@ -758,7 +762,7 @@ export default ({ }) }, async generateNewChatRoomState (shouldClearMessages = false, height) { - const state = await sbp('chelonia/contract/state', this.renderingChatRoomId, height) || {} + const state = await sbp('chelonia/contract/state', this.nonReactive.renderingChatRoomId, height) || {} return { settings: state.settings || {}, attributes: state.attributes || {}, @@ -772,8 +776,27 @@ export default ({ async initializeState (forceClearMessages = false) { // NOTE: this state is rendered using the chatroom contract functions // so should be CAREFUL of updating the fields + const chatroomID = this.nonReactive.renderingChatRoomId + const messageState = await this.generateNewChatRoomState(forceClearMessages) + if (!this.checkEventSourceConsistency(chatroomID)) return + this.latestEvents = [] + Vue.set(this.messageState, 'contract', messageState) + }, + // Similar to calling initializeState(true), except that it's synchronous + // and doesn't rely on `renderingChatRoomId`, which isn't set yet. + skeletonState (chatRoomId) { + const state = sbp('state/vuex/state')[chatRoomId] || {} + const messageState = { + settings: state.settings || {}, + attributes: state.attributes || {}, + members: state.members || {}, + _vm: state._vm, + messages: [], + pinnedMessages: [], + renderingContext: true + } this.latestEvents = [] - Vue.set(this.messageState, 'contract', await this.generateNewChatRoomState(forceClearMessages)) + Vue.set(this.messageState, 'contract', messageState) }, /** * Load/render events for one or more pages @@ -786,11 +809,11 @@ export default ({ * when user switches channels very fast. */ async renderMoreMessages () { - // NOTE: 'this.renderingChatRoomId' can be changed while running this function + // NOTE: 'this.nonReactive.renderingChatRoomId' can be changed while running this function // we save it in the contant variable 'chatRoomID' // 'this.ephemeral.messagesInitiated' describes if the messages should be fully removed and re-rendered // it's true when user gets entered channel page or switches to another channel - const chatRoomID = this.renderingChatRoomId + const chatRoomID = this.nonReactive.renderingChatRoomId if (!this.checkEventSourceConsistency(chatRoomID)) return const limit = this.chatRoomSettings?.actionsPerPage || CHATROOM_ACTIONS_PER_PAGE @@ -878,13 +901,16 @@ export default ({ } }, async setInitMessages () { - if (this.renderingChatRoomId === this.currentChatRoomId) { + if (this.nonReactive.renderingChatRoomId === this.currentChatRoomId) { return } // NOTE: since the state is initialized based on the renderingChatRoomId // need to set renderingChatRoomId here, before calling initializeState - this.renderingChatRoomId = this.currentChatRoomId + this.nonReactive.renderingChatRoomId = this.currentChatRoomId await this.initializeState() + if (this.nonReactive.renderingChatRoomId !== this.currentChatRoomId) { + return + } this.ephemeral.messagesInitiated = false this.ephemeral.unprocessedEvents = [] if (this.ephemeral.infiniteLoading) { @@ -913,7 +939,7 @@ export default ({ } }, updateReadUntilMessageHash ({ messageHash, createdHeight }) { - const chatRoomID = this.renderingChatRoomId + const chatRoomID = this.nonReactive.renderingChatRoomId if (chatRoomID && this.isJoinedChatRoom(chatRoomID)) { if (this.currentChatRoomReadUntil?.createdHeight >= createdHeight) { // NOTE: skip adding useless invocations in KV_QUEUE queue @@ -1068,7 +1094,7 @@ export default ({ // NOTE: this infinite handler is being called once which should be ignored // before calling the setInitMessages function return - } else if (this.currentChatRoomId !== this.renderingChatRoomId) { + } else if (this.currentChatRoomId !== this.nonReactive.renderingChatRoomId) { // NOTE: should ignore to render messages before chatroom state is initiated return } @@ -1170,23 +1196,27 @@ export default ({ if (toChatRoomId !== fromChatRoomId) { this.ephemeral.onChatScroll?.flush() - // We don't use `await`, which would be more straightforward because + // Skeleton state is to render what basic information we can get + // synchronously. + this.skeletonState(toChatRoomId) + this.ephemeral.messagesInitiated = false + this.ephemeral.scrolledDistance = 0 + // Coerce 'chelonia/contract/isSyncing' into a Promise + // This may seem weird, but it's needed because the result may be a + // boolean when Chelonia is running in the browsing context, or it may + // be a promise when Chelonia is proxied using the 'chelonia/*' selector, + // like when using a SW. + // We also don't use `await`, which would be more straightforward because // that'd require this entire function to be `async`, which could result // in race conditions as this is a watcher. - this.initializeState(true).then(async () => { - this.checkEventSourceConsistency(toChatRoomId) - this.ephemeral.messagesInitiated = false - this.ephemeral.scrolledDistance = 0 - const isSyncing = await sbp('chelonia/contract/isSyncing', toChatRoomId) + Promise.resolve(sbp('chelonia/contract/isSyncing', toChatRoomId)).then((isSyncing) => { // If the chatroom has changed since, return if (this.summary.chatRoomID !== toChatRoomId) return if (isSyncing) { - return toIsJoined && sbp('chelonia/queueInvocation', toChatRoomId, () => initAfterSynced(toChatRoomId)) + toIsJoined && sbp('chelonia/queueInvocation', toChatRoomId, () => initAfterSynced(toChatRoomId)) } else { this.refreshContent() } - }).catch(e => { - console.error('[ChatMain.vue] summary watcher error', e) }) } else if (toIsJoined && toIsJoined !== fromIsJoined) { sbp('chelonia/queueInvocation', toChatRoomId, () => initAfterSynced(toChatRoomId)) diff --git a/shared/domains/chelonia/utils.js b/shared/domains/chelonia/utils.js index 5338ade14..983b6760e 100644 --- a/shared/domains/chelonia/utils.js +++ b/shared/domains/chelonia/utils.js @@ -566,9 +566,11 @@ export function eventsAfter (contractID: string, sinceHeight: number, limit?: nu throw new Error('Missing contract ID') } + let lastUrl const fetchEventsStreamReader = async () => { requestLimit = Math.min(limit ?? MAX_EVENTS_AFTER, remainingEvents) - const eventsResponse = await fetch(`${this.config.connectionURL}/eventsAfter/${contractID}/${sinceHeight}${Number.isInteger(requestLimit) ? `/${requestLimit}` : ''}`, { signal }) + lastUrl = `${this.config.connectionURL}/eventsAfter/${contractID}/${sinceHeight}${Number.isInteger(requestLimit) ? `/${requestLimit}` : ''}` + const eventsResponse = await fetch(lastUrl, { signal }) if (!eventsResponse.ok) throw new Error('Unexpected status code') if (!eventsResponse.body) throw new Error('Missing body') latestHeight = parseInt(eventsResponse.headers.get('shelter-headinfo-height'), 10) @@ -747,6 +749,7 @@ export function eventsAfter (contractID: string, sinceHeight: number, limit?: nu } } } catch (e) { + console.error('[eventsAfter] Error', { lastUrl }, e) // $FlowFixMe[incompatible-use] eventsStreamReader?.cancel('Error during pull').catch(e2 => { console.error('Error canceling underlying event stream reader on error', e, e2) From 0df721a568ca810c0a736e14204024d68e63b222 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Iv=C3=A1n=20Vieitez=20Parra?= <3857362+corrideat@users.noreply.github.com> Date: Wed, 29 Jan 2025 03:33:42 +0200 Subject: [PATCH 16/24] 2080 implement troubleshooting page re sync contracts (#2552) * WIP * Implement state wiping (closes #2080) * fixed GI_GIT_VERSION issue * update strings on Troubleshooting page --------- Co-authored-by: Greg Slepak --- Gruntfile.js | 2 +- frontend/controller/app/identity.js | 20 +++- .../user-settings/Troubleshooting.vue | 76 +++------------- strings/english.json | 17 +--- strings/english.strings | 53 ++++------- strings/french.json | 19 ++-- strings/french.strings | 91 +++++++++++-------- 7 files changed, 109 insertions(+), 169 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index e8e6a8e0f..91dd7183a 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -84,7 +84,7 @@ if (!process.env.DB_PATH) { module.exports = (grunt) => { require('load-grunt-tasks')(grunt) - const GI_GIT_VERSION = process.env.CI ? process.env.GI_VERSION : execSync('git describe --dirty').toString('ascii') + const GI_GIT_VERSION = process.env.CI ? process.env.GI_VERSION : execSync('git describe --dirty').toString('utf8').trim() Object.assign(process.env, { GI_GIT_VERSION }) // Ensure API_PORT and API_URL envars are defined and available to subprocesses. diff --git a/frontend/controller/app/identity.js b/frontend/controller/app/identity.js index 6b9cacf35..1b8fdb48c 100644 --- a/frontend/controller/app/identity.js +++ b/frontend/controller/app/identity.js @@ -8,6 +8,7 @@ import { LOGIN, LOGIN_COMPLETE, LOGIN_ERROR, NEW_PREFERENCES, NEW_UNREAD_MESSAGE import { Secret } from '~/shared/domains/chelonia/Secret.js' import { EVENT_HANDLED } from '~/shared/domains/chelonia/events.js' import { boxKeyPair, buildRegisterSaltRequest, buildUpdateSaltRequestEc, computeCAndHc, decryptContractSalt, hash, hashPassword, randomNonce } from '~/shared/zkpp.js' +import { SETTING_CHELONIA_STATE } from '@model/database.js' // Using relative path to crypto.js instead of ~-path to workaround some esbuild bug import { CURVE25519XSALSA20POLY1305, EDWARDS25519SHA512BATCH, deriveKeyFromPassword, serializeKey } from '../../../shared/domains/chelonia/crypto.js' import { handleFetchResult } from '../utils/misc.js' @@ -462,24 +463,35 @@ export default (sbp('sbp/selectors/register', { // Unlike the login function, the wrapper for logging out is used using a // dedicated selector to allow it to be called from the login selector (if // error occurs) - 'gi.app/identity/_private/logout': async function (errorState: ?Object) { + 'gi.app/identity/_private/logout': async function (errorState: ?Object, wipeOut?: boolean) { try { const state = errorState || cloneDeep(sbp('state/vuex/state')) if (!state.loggedIn) return const cheloniaState = await sbp('gi.actions/identity/logout') - const { encryptionParams } = state.loggedIn + const { identityContractID, encryptionParams } = state.loggedIn if (encryptionParams) { // If we're logging out, save the current Chelonia state under the // `.cheloniaState` key. This will be used later when logging in // to restore both the Vuex and Chelonia states - state.cheloniaState = cheloniaState + if (!wipeOut) { + state.cheloniaState = cheloniaState - await sbp('state/vuex/save', true, state) + await sbp('state/vuex/save', true, state) + } await sbp('gi.db/settings/deleteStateEncryptionKey', encryptionParams) await sbp('appLogs/pauseCapture', { wipeOut: true }) // clear stored logs to prevent someone else accessing sensitve data } + // These should already be deleted, but we attempt to delete them again, + // just in case. + if (wipeOut) { + await Promise.all([ + sbp('gi.db/settings/delete', identityContractID), + sbp('gi.db/settings/deleteEncrypted', identityContractID), + sbp('gi.db/settings/delete', SETTING_CHELONIA_STATE) + ]) + } } catch (e) { console.error(`${e.name} during logout: ${e.message}`, e) } diff --git a/frontend/views/containers/user-settings/Troubleshooting.vue b/frontend/views/containers/user-settings/Troubleshooting.vue index 281280112..c9b5d80ea 100644 --- a/frontend/views/containers/user-settings/Troubleshooting.vue +++ b/frontend/views/containers/user-settings/Troubleshooting.vue @@ -3,29 +3,8 @@ section.card i18n.is-title-3(tag='h3') Re-sync and rebuild data p.c-desc.has-text-1 - i18n All of your information is stored locally, on your personal device, and encrypted when sent {over the network, to other group members}. Re-syncing will download the latest version of the group's information. - |   - i18n.link(tag='button' @click='openAppLogs') See application logs - - ul.c-legend - li.c-legend-item - i18n Total space used - strong.c-legend-dd {{ ephemeral.sizeMb }} - li.c-legend-item - i18n Status - strong.c-legend-dd {{ ephemeral.statusText }} - .c-marker(:class='`has-background-${ephemeral.style}-solid`') - - template(v-if='ephemeral.status === "corrupted"') - banner-simple.c-banner(data-test='corruptedMsg' severity='danger') - i18n Please use the re-sync option below to restore functionality. - - template(v-else-if='ephemeral.status === "recovering"') - .c-progress - progress-bar(:max='1' :value='ephemeral.progress.percentage') - .c-progress-desc.has-text-1(aria-label='polite') - span {{ephemeral.progress.part}} - span {{ephemeral.progress.percentage * 100}} % + i18n If you're having trouble with the app, you can try resetting Group Income. This will delete the current app state, and log you out. After you log back in, it may take a few minutes for the app to reset, but that should fix most problems. THIS WILL LOG YOU OUT. + i18n.link(tag='button' @click='openAppLogs') For diagnostic info, see application logs. banner-scoped(ref='doneMsg' data-test='doneMsg') @@ -33,17 +12,13 @@ i18n.c-cta( v-if='ephemeral.status !== "recovering"' tag='button' - :disabled='true' @click='startResync' - ) Re-sync - - .c-coming-soon - i.icon-info-circle - i18n Feature coming soon + ) Reset Group Income