diff --git a/docs/next.config.mjs b/docs/next.config.mjs index b73b4e6..798fa4a 100644 --- a/docs/next.config.mjs +++ b/docs/next.config.mjs @@ -1,14 +1,30 @@ /** @type {import('next').NextConfig} */ // import MillionLint from "@million/lint"; +import path from 'path'; +import { fileURLToPath } from 'url'; + +const __dirname = path.dirname(fileURLToPath(import.meta.url)); const nextConfig = { webpack: (config) => { config.module.rules.push({ test: /\.json$/, type: 'json', - }) + }); + + config.resolve.alias = { + ...config.resolve.alias, + "sharp$": false, + "onnxruntime-node$": false, + } + + config.resolve.alias['@huggingface/transformers'] = path.resolve(__dirname, 'node_modules/@huggingface/transformers'); + return config }, + experimental: { + esmExternals: true // Enable ES modules + }, // i18n: { // locales: ['en', 'es', 'fr', 'de'], // defaultLocale: 'en', diff --git a/docs/package-lock.json b/docs/package-lock.json index f48f35a..3c80bc7 100644 --- a/docs/package-lock.json +++ b/docs/package-lock.json @@ -1,12 +1,12 @@ { "name": "akiradocs", - "version": "1.0.1", + "version": "1.0.52", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "akiradocs", - "version": "1.0.1", + "version": "1.0.52", "dependencies": { "@ai-sdk/anthropic": "^1.0.1", "@dnd-kit/core": "^6.1.0", @@ -14,6 +14,7 @@ "@dnd-kit/utilities": "^3.2.2", "@google/generative-ai": "^0.2.1", "@heroicons/react": "^2.1.5", + "@huggingface/transformers": "^3.2.3", "@mdx-js/loader": "^3.1.0", "@mdx-js/react": "^3.1.0", "@million/lint": "^1.0.12", @@ -36,7 +37,9 @@ "@radix-ui/react-toggle": "^1.1.0", "@radix-ui/react-toggle-group": "^1.1.0", "@radix-ui/react-tooltip": "^1.1.3", + "@xenova/transformers": "^2.17.2", "ai": "^4.0.2", + "better-sqlite3": "^11.7.0", "class-variance-authority": "^0.7.0", "clsx": "^2.1.1", "cross-spawn": "^7.0.6", @@ -56,7 +59,11 @@ "react-error-boundary": "^4.1.2", "react-markdown": "^9.0.1", "react-syntax-highlighter": "^15.6.1", + "remark-gfm": "^4.0.0", + "sharp": "^0.33.5", "sonner": "^1.7.0", + "sql.js-httpvfs": "^0.8.12", + "sqlite-vss": "^0.1.2", "styled-components": "^6.1.13", "tailwind-merge": "^2.5.4", "tailwindcss-animate": "^1.0.7" @@ -529,7 +536,6 @@ }, "node_modules/@clack/prompts/node_modules/is-unicode-supported": { "version": "1.3.0", - "extraneous": true, "inBundle": true, "license": "MIT", "engines": { @@ -610,6 +616,16 @@ "react": ">=16.8.0" } }, + "node_modules/@emnapi/runtime": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.3.1.tgz", + "integrity": "sha512-kEBmG8KyqtxJZv+ygbEim+KCGtIq1fC22Ms3S4ziXmYKm8uyoLX0MHONVKwp+9opg390VaKRNt4a7A9NwmpNhw==", + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, "node_modules/@emotion/is-prop-valid": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-1.2.2.tgz", @@ -1118,6 +1134,108 @@ "hono": "^4" } }, + "node_modules/@huggingface/jinja": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@huggingface/jinja/-/jinja-0.2.2.tgz", + "integrity": "sha512-/KPde26khDUIPkTGU82jdtTW9UAuvUTumCAbFs/7giR0SxsvZC4hru51PBvpijH6BVkHcROcvZM/lpy5h1jRRA==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/@huggingface/transformers": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/@huggingface/transformers/-/transformers-3.2.3.tgz", + "integrity": "sha512-o7QZphrCH3a3m0kF/MaSNv3DMDZCpTifdZ9k4Lwl2n9QhY8JIGOOtZDVa+Wv2cqKU6iJm1SiCqDdZpo8H20c8g==", + "license": "Apache-2.0", + "dependencies": { + "@huggingface/jinja": "^0.3.2", + "onnxruntime-node": "1.20.1", + "onnxruntime-web": "1.21.0-dev.20241205-d27fecd3d3", + "sharp": "^0.33.5" + } + }, + "node_modules/@huggingface/transformers/node_modules/@huggingface/jinja": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@huggingface/jinja/-/jinja-0.3.2.tgz", + "integrity": "sha512-F2FvuIc+w1blGsaqJI/OErRbWH6bVJDCBI8Rm5D86yZ2wlwrGERsfIaru7XUv9eYC3DMP3ixDRRtF0h6d8AZcQ==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/@huggingface/transformers/node_modules/long": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", + "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==", + "license": "Apache-2.0" + }, + "node_modules/@huggingface/transformers/node_modules/onnxruntime-common": { + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/onnxruntime-common/-/onnxruntime-common-1.20.1.tgz", + "integrity": "sha512-YiU0s0IzYYC+gWvqD1HzLc46Du1sXpSiwzKb63PACIJr6LfL27VsXSXQvt68EzD3V0D5Bc0vyJTjmMxp0ylQiw==", + "license": "MIT" + }, + "node_modules/@huggingface/transformers/node_modules/onnxruntime-node": { + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/onnxruntime-node/-/onnxruntime-node-1.20.1.tgz", + "integrity": "sha512-di/I4HDXRw+FLgq+TyHmQEDd3cEp9iFFZm0r4uJ1Wd7b/WE1VXtKWo8yemex347c6GNF/3Pv86ZfPhIWxORr0w==", + "hasInstallScript": true, + "license": "MIT", + "os": [ + "win32", + "darwin", + "linux" + ], + "dependencies": { + "onnxruntime-common": "1.20.1", + "tar": "^7.0.1" + } + }, + "node_modules/@huggingface/transformers/node_modules/onnxruntime-web": { + "version": "1.21.0-dev.20241205-d27fecd3d3", + "resolved": "https://registry.npmjs.org/onnxruntime-web/-/onnxruntime-web-1.21.0-dev.20241205-d27fecd3d3.tgz", + "integrity": "sha512-neeC9mv1sFWjUFrTaDl7enufNxbtSSTwR5V2i35ga4yXWS6r1MbpUwWwD1X+VKANujbSG8M5pk/ohRAOm2QhMQ==", + "license": "MIT", + "dependencies": { + "flatbuffers": "^1.12.0", + "guid-typescript": "^1.0.9", + "long": "^5.2.3", + "onnxruntime-common": "1.21.0-dev.20241205-6ed77cc374", + "platform": "^1.3.6", + "protobufjs": "^7.2.4" + } + }, + "node_modules/@huggingface/transformers/node_modules/onnxruntime-web/node_modules/onnxruntime-common": { + "version": "1.21.0-dev.20241205-6ed77cc374", + "resolved": "https://registry.npmjs.org/onnxruntime-common/-/onnxruntime-common-1.21.0-dev.20241205-6ed77cc374.tgz", + "integrity": "sha512-U4DGq/dZiboIEK0Zv1KUuWJesJ/txUALpWSXwI8kqOCSxe8GrI65xfRFeMbqYFhPVGAWZPsBpT1zo1s4ksrlrg==", + "license": "MIT" + }, + "node_modules/@huggingface/transformers/node_modules/protobufjs": { + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.4.0.tgz", + "integrity": "sha512-mRUWCc3KUU4w1jU8sGxICXH/gNS94DvI1gxqDvBzhj1JpcsimQkYiOJfwsPUykUI5ZaspFbSgmBLER8IrQ3tqw==", + "hasInstallScript": true, + "license": "BSD-3-Clause", + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/node": ">=13.7.0", + "long": "^5.0.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/@humanwhocodes/config-array": { "version": "0.13.0", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", @@ -1174,6 +1292,28 @@ "@img/sharp-libvips-darwin-arm64": "1.0.4" } }, + "node_modules/@img/sharp-darwin-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.33.5.tgz", + "integrity": "sha512-fyHac4jIc1ANYGRDxtiqelIbdWkIuQaI84Mv45KvGRRxSAa7o7d1ZKAOBaYbnepLC1WqxfpimdeWfvqqSGwR2Q==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-x64": "1.0.4" + } + }, "node_modules/@img/sharp-libvips-darwin-arm64": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.0.4.tgz", @@ -1189,118 +1329,431 @@ "url": "https://opencollective.com/libvips" } }, - "node_modules/@isaacs/cliui": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", - "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", - "dependencies": { - "string-width": "^5.1.2", - "string-width-cjs": "npm:string-width@^4.2.0", - "strip-ansi": "^7.0.1", - "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", - "wrap-ansi": "^8.1.0", - "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" - }, - "engines": { - "node": ">=12" + "node_modules/@img/sharp-libvips-darwin-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.0.4.tgz", + "integrity": "sha512-xnGR8YuZYfJGmWPvmlunFaWJsb9T/AO2ykoP3Fz/0X5XV2aoYBPkX6xqCQvUTKKiLddarLaxpzNe+b1hjeWHAQ==", + "cpu": [ + "x64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" } }, - "node_modules/@isaacs/cliui/node_modules/ansi-regex": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", - "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", - "engines": { - "node": ">=12" - }, + "node_modules/@img/sharp-libvips-linux-arm": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.0.5.tgz", + "integrity": "sha512-gvcC4ACAOPRNATg/ov8/MnbxFDJqf/pDePbBnuBDcjsI8PssmjoKMAz4LtLaVi+OnSb5FK/yIOamqDwGmXW32g==", + "cpu": [ + "arm" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" + "url": "https://opencollective.com/libvips" } }, - "node_modules/@isaacs/cliui/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, + "node_modules/@img/sharp-libvips-linux-arm64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.0.4.tgz", + "integrity": "sha512-9B+taZ8DlyyqzZQnoeIvDVR/2F4EbMepXMc/NdVbkzsJbzkUjhXv/70GQJ7tdLA4YJgNP25zukcxpX2/SueNrA==", + "cpu": [ + "arm64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" + "url": "https://opencollective.com/libvips" } }, - "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==", - "dependencies": { - "@jridgewell/set-array": "^1.2.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.24" - }, - "engines": { - "node": ">=6.0.0" + "node_modules/@img/sharp-libvips-linux-s390x": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.0.4.tgz", + "integrity": "sha512-u7Wz6ntiSSgGSGcjZ55im6uvTrOxSIS8/dgoVMoiGE9I6JAfU50yH5BoDlYA1tcuGS7g/QNtetJnxA6QEsCVTA==", + "cpu": [ + "s390x" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" } }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", - "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", - "engines": { - "node": ">=6.0.0" + "node_modules/@img/sharp-libvips-linux-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.0.4.tgz", + "integrity": "sha512-MmWmQ3iPFZr0Iev+BAgVMb3ZyC4KeFc3jFxnNbEPas60e1cIfevbtuyf9nDGIzOaW9PdnDciJm+wFFaTlj5xYw==", + "cpu": [ + "x64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" } }, - "node_modules/@jridgewell/set-array": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", - "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", - "engines": { - "node": ">=6.0.0" + "node_modules/@img/sharp-libvips-linuxmusl-arm64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.0.4.tgz", + "integrity": "sha512-9Ti+BbTYDcsbp4wfYib8Ctm1ilkugkA/uscUn6UXK1ldpC1JjiXbLfFZtRlBhjPZ5o1NCLiDbg8fhUPKStHoTA==", + "cpu": [ + "arm64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" } }, - "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==" - }, - "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==", - "dependencies": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" + "node_modules/@img/sharp-libvips-linuxmusl-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.0.4.tgz", + "integrity": "sha512-viYN1KX9m+/hGkJtvYYp+CCLgnJXwiQB39damAO7WMdKWlIhmYTfHjwSbQeUK/20vY154mwezd9HflVFM1wVSw==", + "cpu": [ + "x64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" } }, - "node_modules/@mdx-js/loader": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@mdx-js/loader/-/loader-3.1.0.tgz", - "integrity": "sha512-xU/lwKdOyfXtQGqn3VnJjlDrmKXEvMi1mgYxVmukEUtVycIz1nh7oQ40bKTd4cA7rLStqu0740pnhGYxGoqsCg==", - "dependencies": { - "@mdx-js/mdx": "^3.0.0", - "source-map": "^0.7.0" + "node_modules/@img/sharp-linux-arm": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.33.5.tgz", + "integrity": "sha512-JTS1eldqZbJxjvKaAkxhZmBqPRGmxgu+qFKSInv8moZ2AmT5Yib3EQ1c6gp493HvrvV8QgdOXdyaIBrhvFhBMQ==", + "cpu": [ + "arm" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "url": "https://opencollective.com/libvips" }, - "peerDependencies": { - "webpack": ">=5" + "optionalDependencies": { + "@img/sharp-libvips-linux-arm": "1.0.5" + } + }, + "node_modules/@img/sharp-linux-arm64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.33.5.tgz", + "integrity": "sha512-JMVv+AMRyGOHtO1RFBiJy/MBsgz0x4AWrT6QoEVVTyh1E39TrCUpTRI7mx9VksGX4awWASxqCYLCV4wBZHAYxA==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" }, - "peerDependenciesMeta": { - "webpack": { - "optional": true - } + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm64": "1.0.4" } }, - "node_modules/@mdx-js/mdx": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@mdx-js/mdx/-/mdx-3.1.0.tgz", - "integrity": "sha512-/QxEhPAvGwbQmy1Px8F899L5Uc2KZ6JtXwlCgJmjSTBedwOZkByYcBG4GceIGPXRDsmfxhHazuS+hlOShRLeDw==", - "dependencies": { - "@types/estree": "^1.0.0", - "@types/estree-jsx": "^1.0.0", + "node_modules/@img/sharp-linux-s390x": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.33.5.tgz", + "integrity": "sha512-y/5PCd+mP4CA/sPDKl2961b+C9d+vPAveS33s6Z3zfASk2j5upL6fXVPZi7ztePZ5CuH+1kW8JtvxgbuXHRa4Q==", + "cpu": [ + "s390x" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-s390x": "1.0.4" + } + }, + "node_modules/@img/sharp-linux-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.33.5.tgz", + "integrity": "sha512-opC+Ok5pRNAzuvq1AG0ar+1owsu842/Ab+4qvU879ippJBHvyY5n2mxF1izXqkPYlGuP/M556uh53jRLJmzTWA==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-x64": "1.0.4" + } + }, + "node_modules/@img/sharp-linuxmusl-arm64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.33.5.tgz", + "integrity": "sha512-XrHMZwGQGvJg2V/oRSUfSAfjfPxO+4DkiRh6p2AFjLQztWUuY/o8Mq0eMQVIY7HJ1CDQUJlxGGZRw1a5bqmd1g==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-arm64": "1.0.4" + } + }, + "node_modules/@img/sharp-linuxmusl-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.33.5.tgz", + "integrity": "sha512-WT+d/cgqKkkKySYmqoZ8y3pxx7lx9vVejxW/W4DOFMYVSkErR+w7mf2u8m/y4+xHe7yY9DAXQMWQhpnMuFfScw==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-x64": "1.0.4" + } + }, + "node_modules/@img/sharp-wasm32": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.33.5.tgz", + "integrity": "sha512-ykUW4LVGaMcU9lu9thv85CbRMAwfeadCJHRsg2GmeRa/cJxsVY9Rbd57JcMxBkKHag5U/x7TSBpScF4U8ElVzg==", + "cpu": [ + "wasm32" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT", + "optional": true, + "dependencies": { + "@emnapi/runtime": "^1.2.0" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-ia32": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.33.5.tgz", + "integrity": "sha512-T36PblLaTwuVJ/zw/LaH0PdZkRz5rd3SmMHX8GSmR7vtNSP5Z6bQkExdSK7xGWyxLw4sUknBuugTelgw2faBbQ==", + "cpu": [ + "ia32" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.33.5.tgz", + "integrity": "sha512-MpY/o8/8kj+EcnxwvrP4aTJSWw/aZ7JIGR4aBeZkZw5B7/Jn+tY9/VNwtcoGmdT7GfggGIU4kygOMSbYnOrAbg==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/@isaacs/fs-minipass": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@isaacs/fs-minipass/-/fs-minipass-4.0.1.tgz", + "integrity": "sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==", + "license": "ISC", + "dependencies": { + "minipass": "^7.0.4" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "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==", + "dependencies": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "engines": { + "node": ">=6.0.0" + } + }, + "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==" + }, + "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==", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@mdx-js/loader": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@mdx-js/loader/-/loader-3.1.0.tgz", + "integrity": "sha512-xU/lwKdOyfXtQGqn3VnJjlDrmKXEvMi1mgYxVmukEUtVycIz1nh7oQ40bKTd4cA7rLStqu0740pnhGYxGoqsCg==", + "dependencies": { + "@mdx-js/mdx": "^3.0.0", + "source-map": "^0.7.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "peerDependencies": { + "webpack": ">=5" + }, + "peerDependenciesMeta": { + "webpack": { + "optional": true + } + } + }, + "node_modules/@mdx-js/mdx": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@mdx-js/mdx/-/mdx-3.1.0.tgz", + "integrity": "sha512-/QxEhPAvGwbQmy1Px8F899L5Uc2KZ6JtXwlCgJmjSTBedwOZkByYcBG4GceIGPXRDsmfxhHazuS+hlOShRLeDw==", + "dependencies": { + "@types/estree": "^1.0.0", + "@types/estree-jsx": "^1.0.0", "@types/hast": "^3.0.0", "@types/mdx": "^2.0.0", "collapse-white-space": "^2.0.0", @@ -1391,9 +1844,9 @@ } }, "node_modules/@million/install/node_modules/nanoid": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-5.0.8.tgz", - "integrity": "sha512-TcJPw+9RV9dibz1hHUzlLVy8N4X9TnwirAjrU08Juo6BNKggzVfP2ZJ/3ZUSq15Xl5i85i+Z89XBO90pB2PghQ==", + "version": "5.0.9", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-5.0.9.tgz", + "integrity": "sha512-Aooyr6MXU6HpvvWXKoVoXwKMs/KyVakWwg7xQfv5/S/RIgJMy0Ifa45H9qqYy7pTCszrHzP21Uk4PZq2HpEM8Q==", "funding": [ { "type": "github", @@ -1445,9 +1898,9 @@ } }, "node_modules/@million/lint/node_modules/nanoid": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-5.0.8.tgz", - "integrity": "sha512-TcJPw+9RV9dibz1hHUzlLVy8N4X9TnwirAjrU08Juo6BNKggzVfP2ZJ/3ZUSq15Xl5i85i+Z89XBO90pB2PghQ==", + "version": "5.0.9", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-5.0.9.tgz", + "integrity": "sha512-Aooyr6MXU6HpvvWXKoVoXwKMs/KyVakWwg7xQfv5/S/RIgJMy0Ifa45H9qqYy7pTCszrHzP21Uk4PZq2HpEM8Q==", "funding": [ { "type": "github", @@ -2098,15 +2551,79 @@ "node": ">=12" } }, - "node_modules/@radix-ui/number": { + "node_modules/@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/eventemitter": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@radix-ui/number/-/number-1.1.0.tgz", - "integrity": "sha512-V3gRzhVNU1ldS5XhAPTom1fOIo4ccrjjJgmE+LI2h/WaFpHmx0MQApT+KZHnx8abG6Avtfcz4WoEciMnpFT3HQ==" + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==", + "license": "BSD-3-Clause" }, - "node_modules/@radix-ui/primitive": { + "node_modules/@protobufjs/fetch": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@radix-ui/primitive/-/primitive-1.1.0.tgz", - "integrity": "sha512-4Z8dn6Upk0qk4P74xBhZ6Hd/w0mPEzOOLxy4xiPXOXqjF7jZS0VAKk7/x/H6FyY2zCkYJqePf1G5KmkmNJ4RBA==" + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", + "license": "BSD-3-Clause", + "dependencies": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "node_modules/@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==", + "license": "BSD-3-Clause" + }, + "node_modules/@radix-ui/number": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@radix-ui/number/-/number-1.1.0.tgz", + "integrity": "sha512-V3gRzhVNU1ldS5XhAPTom1fOIo4ccrjjJgmE+LI2h/WaFpHmx0MQApT+KZHnx8abG6Avtfcz4WoEciMnpFT3HQ==" + }, + "node_modules/@radix-ui/primitive": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@radix-ui/primitive/-/primitive-1.1.0.tgz", + "integrity": "sha512-4Z8dn6Upk0qk4P74xBhZ6Hd/w0mPEzOOLxy4xiPXOXqjF7jZS0VAKk7/x/H6FyY2zCkYJqePf1G5KmkmNJ4RBA==" }, "node_modules/@radix-ui/react-accordion": { "version": "1.2.1", @@ -3331,6 +3848,12 @@ "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, + "node_modules/@types/long": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", + "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==", + "license": "MIT" + }, "node_modules/@types/mdast": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz", @@ -3626,6 +4149,68 @@ "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==" }, + "node_modules/@xenova/transformers": { + "version": "2.17.2", + "resolved": "https://registry.npmjs.org/@xenova/transformers/-/transformers-2.17.2.tgz", + "integrity": "sha512-lZmHqzrVIkSvZdKZEx7IYY51TK0WDrC8eR0c5IMnBsO8di8are1zzw8BlLhyO2TklZKLN5UffNGs1IJwT6oOqQ==", + "license": "Apache-2.0", + "dependencies": { + "@huggingface/jinja": "^0.2.2", + "onnxruntime-web": "1.14.0", + "sharp": "^0.32.0" + }, + "optionalDependencies": { + "onnxruntime-node": "1.14.0" + } + }, + "node_modules/@xenova/transformers/node_modules/sharp": { + "version": "0.32.6", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.32.6.tgz", + "integrity": "sha512-KyLTWwgcR9Oe4d9HwCwNM2l7+J0dUQwn/yf7S0EnTtb0eVS4RxO0eUSvxPtzT4F3SY+C4K6fqdv/DO27sJ/v/w==", + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "color": "^4.2.3", + "detect-libc": "^2.0.2", + "node-addon-api": "^6.1.0", + "prebuild-install": "^7.1.1", + "semver": "^7.5.4", + "simple-get": "^4.0.1", + "tar-fs": "^3.0.4", + "tunnel-agent": "^0.6.0" + }, + "engines": { + "node": ">=14.15.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@xenova/transformers/node_modules/tar-fs": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.0.6.tgz", + "integrity": "sha512-iokBDQQkUyeXhgPYaZxmczGPhnhXZ0CmrqI+MOb/WFGS9DW5wnfrLgtjUJBvz50vQ3qfRwJ62QVoCFu8mPVu5w==", + "license": "MIT", + "dependencies": { + "pump": "^3.0.0", + "tar-stream": "^3.1.5" + }, + "optionalDependencies": { + "bare-fs": "^2.1.1", + "bare-path": "^2.1.0" + } + }, + "node_modules/@xenova/transformers/node_modules/tar-stream": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.7.tgz", + "integrity": "sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ==", + "license": "MIT", + "dependencies": { + "b4a": "^1.6.4", + "fast-fifo": "^1.2.0", + "streamx": "^2.15.0" + } + }, "node_modules/@xstate/fsm": { "version": "1.6.5", "resolved": "https://registry.npmjs.org/@xstate/fsm/-/fsm-1.6.5.tgz", @@ -4047,6 +4632,12 @@ "node": ">= 0.4" } }, + "node_modules/b4a": { + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.7.tgz", + "integrity": "sha512-OnAYlL5b7LEkALw87fUVafQw5rVR9RjwGd4KUwNQ6DrrNmaVaUCgLipfVlzrPQ4tWOR9P0IXGNOx50jYCCdSJg==", + "license": "Apache-2.0" + }, "node_modules/babel-plugin-syntax-hermes-parser": { "version": "0.21.1", "resolved": "https://registry.npmjs.org/babel-plugin-syntax-hermes-parser/-/babel-plugin-syntax-hermes-parser-0.21.1.tgz", @@ -4070,6 +4661,52 @@ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, + "node_modules/bare-events": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.5.0.tgz", + "integrity": "sha512-/E8dDe9dsbLyh2qrZ64PEPadOQ0F4gbl1sUJOrmph7xOiIxfY8vwab/4bFLh4Y88/Hk/ujKcrQKc+ps0mv873A==", + "license": "Apache-2.0", + "optional": true + }, + "node_modules/bare-fs": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-2.3.5.tgz", + "integrity": "sha512-SlE9eTxifPDJrT6YgemQ1WGFleevzwY+XAP1Xqgl56HtcrisC2CHCZ2tq6dBpcH2TnNxwUEUGhweo+lrQtYuiw==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "bare-events": "^2.0.0", + "bare-path": "^2.0.0", + "bare-stream": "^2.0.0" + } + }, + "node_modules/bare-os": { + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/bare-os/-/bare-os-2.4.4.tgz", + "integrity": "sha512-z3UiI2yi1mK0sXeRdc4O1Kk8aOa/e+FNWZcTiPB/dfTWyLypuE99LibgRaQki914Jq//yAWylcAt+mknKdixRQ==", + "license": "Apache-2.0", + "optional": true + }, + "node_modules/bare-path": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/bare-path/-/bare-path-2.1.3.tgz", + "integrity": "sha512-lh/eITfU8hrj9Ru5quUp0Io1kJWIk1bTjzo7JH1P5dWmQ2EL4hFUlfI8FonAhSlgIfhn63p84CDY/x+PisgcXA==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "bare-os": "^2.1.0" + } + }, + "node_modules/bare-stream": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/bare-stream/-/bare-stream-2.6.1.tgz", + "integrity": "sha512-eVZbtKM+4uehzrsj49KtCy3Pbg7kO1pJ3SKZ1SFrIH/0pnj9scuGGgUlNDf/7qS8WKtGdiJY5Kyhs/ivYPTB/g==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "streamx": "^2.21.0" + } + }, "node_modules/base64-arraybuffer": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz", @@ -4079,6 +4716,37 @@ "node": ">= 0.6.0" } }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/better-sqlite3": { + "version": "11.7.0", + "resolved": "https://registry.npmjs.org/better-sqlite3/-/better-sqlite3-11.7.0.tgz", + "integrity": "sha512-mXpa5jnIKKHeoGzBrUJrc65cXFKcILGZpU3FXR0pradUEm9MA7UZz02qfEejaMcm9iXrSOCenwwYMJ/tZ1y5Ig==", + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "bindings": "^1.5.0", + "prebuild-install": "^7.1.1" + } + }, "node_modules/binary-extensions": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", @@ -4090,6 +4758,26 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/bindings": { + "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" + } + }, + "node_modules/bl": { + "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", + "readable-stream": "^3.4.0" + } + }, "node_modules/boxen": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/boxen/-/boxen-5.1.2.tgz", @@ -4202,6 +4890,30 @@ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, "node_modules/busboy": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", @@ -4382,6 +5094,12 @@ "node": ">= 6" } }, + "node_modules/chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", + "license": "ISC" + }, "node_modules/ci-info": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.1.0.tgz", @@ -4523,7 +5241,6 @@ "version": "4.2.3", "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz", "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==", - "optional": true, "dependencies": { "color-convert": "^2.0.1", "color-string": "^1.9.0" @@ -4552,7 +5269,6 @@ "version": "1.9.1", "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", - "optional": true, "dependencies": { "color-name": "^1.0.0", "simple-swizzle": "^0.2.2" @@ -4570,6 +5286,12 @@ "node": ">= 0.8" } }, + "node_modules/comlink": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/comlink/-/comlink-4.4.2.tgz", + "integrity": "sha512-OxGdvBmJuNKSCMO4NTl1L47VRp6xn2wG4F/2hYzB6tiCb709otOxtEYCSvK80PtjODfXXZu8ds+Nw5kVCjqd2g==", + "license": "Apache-2.0" + }, "node_modules/comma-separated-tokens": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz", @@ -4789,6 +5511,21 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/decompress-response": { + "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" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/deep-extend": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", @@ -4859,7 +5596,6 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz", "integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==", - "optional": true, "engines": { "node": ">=8" } @@ -4981,6 +5717,15 @@ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" }, + "node_modules/end-of-stream": { + "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-client": { "version": "6.6.2", "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-6.6.2.tgz", @@ -5812,6 +6557,15 @@ "node": ">=18.0.0" } }, + "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" + } + }, "node_modules/extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", @@ -5856,6 +6610,12 @@ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, + "node_modules/fast-fifo": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz", + "integrity": "sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==", + "license": "MIT" + }, "node_modules/fast-glob": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", @@ -5918,6 +6678,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/fault/-/fault-1.0.4.tgz", "integrity": "sha512-CJ0HCB5tL5fYTEA7ToAq5+kTwd++Borf1/bifxd9iT70QcXr4MRrO3Llf8Ifs70q+SJcGHFtnIE/Nw6giCtECA==", + "license": "MIT", "dependencies": { "format": "^0.2.0" }, @@ -5950,6 +6711,12 @@ "node": "^10.12.0 || >=12.0.0" } }, + "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==", + "license": "MIT" + }, "node_modules/fill-range": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", @@ -5996,6 +6763,12 @@ "node": "^10.12.0 || >=12.0.0" } }, + "node_modules/flatbuffers": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/flatbuffers/-/flatbuffers-1.12.0.tgz", + "integrity": "sha512-c7CZADjRcl6j0PlvFy0ZqXQ67qSEZfrVPynmnL+2zPc+NtMvrF8Y0QceMo7QqnSPc7+uWjUIAbvCQ5WIKlMVdQ==", + "license": "SEE LICENSE IN LICENSE.txt" + }, "node_modules/flatted": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", @@ -6091,6 +6864,12 @@ } } }, + "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==", + "license": "MIT" + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -6206,6 +6985,12 @@ "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" } }, + "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==", + "license": "MIT" + }, "node_modules/glob": { "version": "11.0.0", "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.0.tgz", @@ -6364,6 +7149,12 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/guid-typescript": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/guid-typescript/-/guid-typescript-1.0.9.tgz", + "integrity": "sha512-Y8T4vYhEfwJOTbouREvG+3XDsjr8E3kIr7uf+JZ0BYloFsttiHU0WfvANVsR7TxNUJa/WpCnw/Ino/p+DeBhBQ==", + "license": "ISC" + }, "node_modules/has-bigints": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", @@ -6456,6 +7247,7 @@ "version": "2.2.5", "resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-2.2.5.tgz", "integrity": "sha512-7j6mrk/qqkSehsM92wQjdIgWM2/BW61u/53G6xmC8i1OmEdKLHbk419QKQUjz6LglWsfqoiHmyMRkP1BGjecNQ==", + "license": "MIT", "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" @@ -6543,6 +7335,7 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/hastscript/-/hastscript-6.0.0.tgz", "integrity": "sha512-nDM6bvd7lIqDUiYEiu5Sl/+6ReP0BMk/2f4U/Rooccxkj0P5nm+acM5PrGJ/t5I8qPGiqZSE6hVAwZEdZIvP4w==", + "license": "MIT", "dependencies": { "@types/hast": "^2.0.0", "comma-separated-tokens": "^1.0.0", @@ -6559,6 +7352,7 @@ "version": "2.3.10", "resolved": "https://registry.npmjs.org/@types/hast/-/hast-2.3.10.tgz", "integrity": "sha512-McWspRw8xx8J9HurkVBfYj0xKoE25tOFlHGdx4MJ5xORQrMGZNqJhVQWaIbm6Oyla5kYOXtDiopzKRJzEOkwJw==", + "license": "MIT", "dependencies": { "@types/unist": "^2" } @@ -6566,12 +7360,14 @@ "node_modules/hastscript/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==" + "integrity": "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==", + "license": "MIT" }, "node_modules/hastscript/node_modules/comma-separated-tokens": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-1.0.8.tgz", "integrity": "sha512-GHuDRO12Sypu2cV70d1dkA2EUmXHgntrzbpvOB+Qy+49ypNfGgFQIC2fhhXbnyrJRynDCAARsT7Ou0M6hirpfw==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -6581,6 +7377,7 @@ "version": "5.6.0", "resolved": "https://registry.npmjs.org/property-information/-/property-information-5.6.0.tgz", "integrity": "sha512-YUHSPk+A30YPv+0Qf8i9Mbfe/C0hdPXk1s1jPVToV8pk8BQtpw10ct89Eo7OWkutrwqvT0eicAxlOg3dOAu8JA==", + "license": "MIT", "dependencies": { "xtend": "^4.0.0" }, @@ -6593,6 +7390,7 @@ "version": "1.1.5", "resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-1.1.5.tgz", "integrity": "sha512-q/JSVd1Lptzhf5bkYm4ob4iWPjx0KiRe3sRFBNrVqbJkFaBm5vbbowy1mymoPNLRa52+oadOhJ+K49wsSeSjTA==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -6617,6 +7415,7 @@ "version": "10.7.3", "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz", "integrity": "sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==", + "license": "BSD-3-Clause", "engines": { "node": "*" } @@ -6624,7 +7423,8 @@ "node_modules/highlightjs-vue": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/highlightjs-vue/-/highlightjs-vue-1.0.0.tgz", - "integrity": "sha512-PDEfEF102G23vHmPhLyPboFCD+BkMGu+GuJe2d9/eH4FsCwvgBpnc9n0pGE+ffKdph38s6foEZiEjdgHdzp+IA==" + "integrity": "sha512-PDEfEF102G23vHmPhLyPboFCD+BkMGu+GuJe2d9/eH4FsCwvgBpnc9n0pGE+ffKdph38s6foEZiEjdgHdzp+IA==", + "license": "CC0-1.0" }, "node_modules/hono": { "version": "4.6.11", @@ -6653,6 +7453,26 @@ "ms": "^2.0.0" } }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, "node_modules/ignore": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", @@ -6709,8 +7529,7 @@ "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "node_modules/ini": { "version": "2.0.0", @@ -6789,8 +7608,7 @@ "node_modules/is-arrayish": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", - "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==", - "optional": true + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==" }, "node_modules/is-async-function": { "version": "2.0.0", @@ -7534,6 +8352,12 @@ "url": "https://tidelift.com/funding/github/npm/loglevel" } }, + "node_modules/long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==", + "license": "Apache-2.0" + }, "node_modules/longest-streak": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-3.1.0.tgz", @@ -7558,6 +8382,7 @@ "version": "1.20.0", "resolved": "https://registry.npmjs.org/lowlight/-/lowlight-1.20.0.tgz", "integrity": "sha512-8Ktj+prEb1RoCPkEOrPMYUN/nCggB7qAWe3a7OpMjWQkh3l2RD5wKRQ+o8Q8YuI9RG/xs95waaI/E6ym/7NsTw==", + "license": "MIT", "dependencies": { "fault": "^1.0.0", "highlight.js": "~10.7.0" @@ -7624,6 +8449,44 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/markdown-table": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-3.0.4.tgz", + "integrity": "sha512-wiYz4+JrLyb/DqW2hkFJxP7Vd7JuTDm77fvbM8VfEQdmSMqcImWeeRbHwZjBjIFki/VaMK2BhFi7oUUZeM5bqw==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/mdast-util-find-and-replace": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-find-and-replace/-/mdast-util-find-and-replace-3.0.1.tgz", + "integrity": "sha512-SG21kZHGC3XRTSUhtofZkBzZTJNM5ecCi0SK2IMKmSXR8vO3peL+kb1O0z7Zl83jKtutG4k5Wv/W7V3/YHvzPA==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "escape-string-regexp": "^5.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/mdast-util-from-markdown": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.2.tgz", @@ -7647,15 +8510,18 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/mdast-util-mdx": { + "node_modules/mdast-util-gfm": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/mdast-util-mdx/-/mdast-util-mdx-3.0.0.tgz", - "integrity": "sha512-JfbYLAW7XnYTTbUsmpu0kdBUVe+yKVJZBItEjwyYJiDJuZ9w4eeaqks4HQO+R7objWgS2ymV60GYpI14Ug554w==", + "resolved": "https://registry.npmjs.org/mdast-util-gfm/-/mdast-util-gfm-3.0.0.tgz", + "integrity": "sha512-dgQEX5Amaq+DuUqf26jJqSK9qgixgd6rYDHAv4aTBuA92cTknZlKpPfa86Z/s8Dj8xsAQpFfBmPUHWJBWqS4Bw==", + "license": "MIT", "dependencies": { "mdast-util-from-markdown": "^2.0.0", - "mdast-util-mdx-expression": "^2.0.0", - "mdast-util-mdx-jsx": "^3.0.0", - "mdast-util-mdxjs-esm": "^2.0.0", + "mdast-util-gfm-autolink-literal": "^2.0.0", + "mdast-util-gfm-footnote": "^2.0.0", + "mdast-util-gfm-strikethrough": "^2.0.0", + "mdast-util-gfm-table": "^2.0.0", + "mdast-util-gfm-task-list-item": "^2.0.0", "mdast-util-to-markdown": "^2.0.0" }, "funding": { @@ -7663,30 +8529,128 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/mdast-util-mdx-expression": { + "node_modules/mdast-util-gfm-autolink-literal": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/mdast-util-mdx-expression/-/mdast-util-mdx-expression-2.0.1.tgz", - "integrity": "sha512-J6f+9hUp+ldTZqKRSg7Vw5V6MqjATc+3E4gf3CFNcuZNWD8XdyI6zQ8GqH7f8169MM6P7hMBRDVGnn7oHB9kXQ==", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-2.0.1.tgz", + "integrity": "sha512-5HVP2MKaP6L+G6YaxPNjuL0BPrq9orG3TsrZ9YXbA3vDw/ACI4MEsnoDpn6ZNm7GnZgtAcONJyPhOP8tNJQavQ==", + "license": "MIT", "dependencies": { - "@types/estree-jsx": "^1.0.0", - "@types/hast": "^3.0.0", "@types/mdast": "^4.0.0", + "ccount": "^2.0.0", "devlop": "^1.0.0", - "mdast-util-from-markdown": "^2.0.0", - "mdast-util-to-markdown": "^2.0.0" + "mdast-util-find-and-replace": "^3.0.0", + "micromark-util-character": "^2.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/mdast-util-mdx-jsx": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/mdast-util-mdx-jsx/-/mdast-util-mdx-jsx-3.1.3.tgz", - "integrity": "sha512-bfOjvNt+1AcbPLTFMFWY149nJz0OjmewJs3LQQ5pIyVGxP4CdOqNVJL6kTaM5c68p8q82Xv3nCyFfUnuEcH3UQ==", + "node_modules/mdast-util-gfm-footnote": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-footnote/-/mdast-util-gfm-footnote-2.0.0.tgz", + "integrity": "sha512-5jOT2boTSVkMnQ7LTrd6n/18kqwjmuYqo7JUPe+tRCY6O7dAuTFMtTPauYYrMPpox9hlN0uOx/FL8XvEfG9/mQ==", + "license": "MIT", "dependencies": { - "@types/estree-jsx": "^1.0.0", - "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "devlop": "^1.1.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-strikethrough": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-2.0.0.tgz", + "integrity": "sha512-mKKb915TF+OC5ptj5bJ7WFRPdYtuHv0yTRxK2tJvi+BDqbkiG7h7u/9SI89nRAYcmap2xHQL9D+QG/6wSrTtXg==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-table": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-table/-/mdast-util-gfm-table-2.0.0.tgz", + "integrity": "sha512-78UEvebzz/rJIxLvE7ZtDd/vIQ0RHv+3Mh5DR96p7cS7HsBhYIICDBCu8csTNWNO6tBWfqXPWekRuj2FNOGOZg==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "markdown-table": "^3.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-task-list-item": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-2.0.0.tgz", + "integrity": "sha512-IrtvNvjxC1o06taBAVJznEnkiHxLFTzgonUdy8hzFVeDun0uTjxxrRGVaNFqkU1wJR3RBPEfsxmU6jDWPofrTQ==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdx": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-mdx/-/mdast-util-mdx-3.0.0.tgz", + "integrity": "sha512-JfbYLAW7XnYTTbUsmpu0kdBUVe+yKVJZBItEjwyYJiDJuZ9w4eeaqks4HQO+R7objWgS2ymV60GYpI14Ug554w==", + "dependencies": { + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-mdx-expression": "^2.0.0", + "mdast-util-mdx-jsx": "^3.0.0", + "mdast-util-mdxjs-esm": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdx-expression": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-mdx-expression/-/mdast-util-mdx-expression-2.0.1.tgz", + "integrity": "sha512-J6f+9hUp+ldTZqKRSg7Vw5V6MqjATc+3E4gf3CFNcuZNWD8XdyI6zQ8GqH7f8169MM6P7hMBRDVGnn7oHB9kXQ==", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdx-jsx": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/mdast-util-mdx-jsx/-/mdast-util-mdx-jsx-3.1.3.tgz", + "integrity": "sha512-bfOjvNt+1AcbPLTFMFWY149nJz0OjmewJs3LQQ5pIyVGxP4CdOqNVJL6kTaM5c68p8q82Xv3nCyFfUnuEcH3UQ==", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", "@types/mdast": "^4.0.0", "@types/unist": "^3.0.0", "ccount": "^2.0.0", @@ -7860,6 +8824,127 @@ "micromark-util-types": "^2.0.0" } }, + "node_modules/micromark-extension-gfm": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm/-/micromark-extension-gfm-3.0.0.tgz", + "integrity": "sha512-vsKArQsicm7t0z2GugkCKtZehqUm31oeGBV/KVSorWSy8ZlNAv7ytjFhvaryUiCUJYqs+NoE6AFhpQvBTM6Q4w==", + "license": "MIT", + "dependencies": { + "micromark-extension-gfm-autolink-literal": "^2.0.0", + "micromark-extension-gfm-footnote": "^2.0.0", + "micromark-extension-gfm-strikethrough": "^2.0.0", + "micromark-extension-gfm-table": "^2.0.0", + "micromark-extension-gfm-tagfilter": "^2.0.0", + "micromark-extension-gfm-task-list-item": "^2.0.0", + "micromark-util-combine-extensions": "^2.0.0", + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-autolink-literal": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-2.1.0.tgz", + "integrity": "sha512-oOg7knzhicgQ3t4QCjCWgTmfNhvQbDDnJeVu9v81r7NltNCVmhPy1fJRX27pISafdjL+SVc4d3l48Gb6pbRypw==", + "license": "MIT", + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-footnote": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-footnote/-/micromark-extension-gfm-footnote-2.1.0.tgz", + "integrity": "sha512-/yPhxI1ntnDNsiHtzLKYnE3vf9JZ6cAisqVDauhp4CEHxlb4uoOTxOCJ+9s51bIB8U1N1FJ1RXOKTIlD5B/gqw==", + "license": "MIT", + "dependencies": { + "devlop": "^1.0.0", + "micromark-core-commonmark": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-strikethrough": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-2.1.0.tgz", + "integrity": "sha512-ADVjpOOkjz1hhkZLlBiYA9cR2Anf8F4HqZUO6e5eDcPQd0Txw5fxLzzxnEkSkfnD0wziSGiv7sYhk/ktvbf1uw==", + "license": "MIT", + "dependencies": { + "devlop": "^1.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-classify-character": "^2.0.0", + "micromark-util-resolve-all": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-table": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-2.1.0.tgz", + "integrity": "sha512-Ub2ncQv+fwD70/l4ou27b4YzfNaCJOvyX4HxXU15m7mpYY+rjuWzsLIPZHJL253Z643RpbcP1oeIJlQ/SKW67g==", + "license": "MIT", + "dependencies": { + "devlop": "^1.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-tagfilter": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-tagfilter/-/micromark-extension-gfm-tagfilter-2.0.0.tgz", + "integrity": "sha512-xHlTOmuCSotIA8TW1mDIM6X2O1SiX5P9IuDtqGonFhEK0qgRI4yeC6vMxEV2dgyr2TiD+2PQ10o+cOhdVAcwfg==", + "license": "MIT", + "dependencies": { + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-task-list-item": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-2.1.0.tgz", + "integrity": "sha512-qIBZhqxqI6fjLDYFTBIa4eivDMnP+OZqsNwmQ3xNLE4Cxwc+zfQEfbs6tzAo2Hjq+bh6q5F+Z8/cksrLFYWQQw==", + "license": "MIT", + "dependencies": { + "devlop": "^1.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/micromark-extension-mdx-expression": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/micromark-extension-mdx-expression/-/micromark-extension-mdx-expression-3.0.0.tgz", @@ -8396,6 +9481,18 @@ "node": ">= 0.6" } }, + "node_modules/mimic-response": { + "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" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -8424,10 +9521,140 @@ "node": ">=16 || 14 >=14.17" } }, - "node_modules/mitt": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/mitt/-/mitt-3.0.1.tgz", - "integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==", + "node_modules/minizlib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-3.0.1.tgz", + "integrity": "sha512-umcy022ILvb5/3Djuu8LWeqUa8D68JaBzlttKeMWen48SjabqS3iY5w/vzeMzMUNhLDifyhbOwKDSznB1vvrwg==", + "license": "MIT", + "dependencies": { + "minipass": "^7.0.4", + "rimraf": "^5.0.5" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/minizlib/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" + } + }, + "node_modules/minizlib/node_modules/glob": { + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/minizlib/node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/minizlib/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "license": "ISC" + }, + "node_modules/minizlib/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/minizlib/node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/minizlib/node_modules/rimraf": { + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.10.tgz", + "integrity": "sha512-l0OE8wL34P4nJH/H2ffoaniAokM2qSmrtXHmlpvYr5AVVX8msAyW0l8NVJFDxlSK4u3Uh/f41cQheDVdnYijwQ==", + "license": "ISC", + "dependencies": { + "glob": "^10.3.7" + }, + "bin": { + "rimraf": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/mitt": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mitt/-/mitt-3.0.1.tgz", + "integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==", + "license": "MIT" + }, + "node_modules/mkdirp": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", + "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", + "license": "MIT", + "bin": { + "mkdirp": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "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==", "license": "MIT" }, "node_modules/ms": { @@ -8446,15 +9673,16 @@ } }, "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==", "funding": [ { "type": "github", "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "bin": { "nanoid": "bin/nanoid.cjs" }, @@ -8462,6 +9690,12 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, + "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==", + "license": "MIT" + }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -8557,6 +9791,24 @@ "node": "^10 || ^12 || >=14" } }, + "node_modules/node-abi": { + "version": "3.71.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.71.0.tgz", + "integrity": "sha512-SZ40vRiy/+wRTf21hxkkEjPJZpARzUMVcJoQse2EF8qkUWbbO2z7vd5oA/H6bVH6SZQ5STGcu0KRDS7biNRfxw==", + "license": "MIT", + "dependencies": { + "semver": "^7.3.5" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/node-addon-api": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-6.1.0.tgz", + "integrity": "sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA==", + "license": "MIT" + }, "node_modules/node-domexception": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", @@ -8732,11 +9984,54 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, "dependencies": { "wrappy": "1" } }, + "node_modules/onnx-proto": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/onnx-proto/-/onnx-proto-4.0.4.tgz", + "integrity": "sha512-aldMOB3HRoo6q/phyB6QRQxSt895HNNw82BNyZ2CMh4bjeKv7g/c+VpAFtJuEMVfYLMbRx61hbuqnKceLeDcDA==", + "license": "MIT", + "dependencies": { + "protobufjs": "^6.8.8" + } + }, + "node_modules/onnxruntime-common": { + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/onnxruntime-common/-/onnxruntime-common-1.14.0.tgz", + "integrity": "sha512-3LJpegM2iMNRX2wUmtYfeX/ytfOzNwAWKSq1HbRrKc9+uqG/FsEA0bbKZl1btQeZaXhC26l44NWpNUeXPII7Ew==", + "license": "MIT" + }, + "node_modules/onnxruntime-node": { + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/onnxruntime-node/-/onnxruntime-node-1.14.0.tgz", + "integrity": "sha512-5ba7TWomIV/9b6NH/1x/8QEeowsb+jBEvFzU6z0T4mNsFwdPqXeFUM7uxC6QeSRkEbWu3qEB0VMjrvzN/0S9+w==", + "license": "MIT", + "optional": true, + "os": [ + "win32", + "darwin", + "linux" + ], + "dependencies": { + "onnxruntime-common": "~1.14.0" + } + }, + "node_modules/onnxruntime-web": { + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/onnxruntime-web/-/onnxruntime-web-1.14.0.tgz", + "integrity": "sha512-Kcqf43UMfW8mCydVGcX9OMXI2VN17c0p6XvR7IPSZzBf/6lteBzXHvcEVWDPmCKuGombl997HgLqj91F11DzXw==", + "license": "MIT", + "dependencies": { + "flatbuffers": "^1.12.0", + "guid-typescript": "^1.0.9", + "long": "^4.0.0", + "onnx-proto": "^4.0.4", + "onnxruntime-common": "~1.14.0", + "platform": "^1.3.6" + } + }, "node_modules/openai": { "version": "4.76.0", "resolved": "https://registry.npmjs.org/openai/-/openai-4.76.0.tgz", @@ -8977,6 +10272,12 @@ "@napi-rs/nice": "^1.0.1" } }, + "node_modules/platform": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/platform/-/platform-1.3.6.tgz", + "integrity": "sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg==", + "license": "MIT" + }, "node_modules/possible-typed-array-names": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", @@ -9133,6 +10434,32 @@ "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==" }, + "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==", + "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", + "node-abi": "^3.3.0", + "pump": "^3.0.0", + "rc": "^1.2.7", + "simple-get": "^4.0.0", + "tar-fs": "^2.0.0", + "tunnel-agent": "^0.6.0" + }, + "bin": { + "prebuild-install": "bin.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -9161,6 +10488,7 @@ "version": "1.29.0", "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.29.0.tgz", "integrity": "sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==", + "license": "MIT", "engines": { "node": ">=6" } @@ -9191,6 +10519,42 @@ "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==", "license": "ISC" }, + "node_modules/protobufjs": { + "version": "6.11.4", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", + "integrity": "sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==", + "hasInstallScript": true, + "license": "BSD-3-Clause", + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/long": "^4.0.1", + "@types/node": ">=13.7.0", + "long": "^4.0.0" + }, + "bin": { + "pbjs": "bin/pbjs", + "pbts": "bin/pbts" + } + }, + "node_modules/pump": { + "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" + } + }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", @@ -9247,6 +10611,12 @@ } ] }, + "node_modules/queue-tick": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/queue-tick/-/queue-tick-1.0.1.tgz", + "integrity": "sha512-kJt5qhMxoszgU/62PLP1CJytzd2NKetjSRnyuj31fDd3Rlcz3fzlFdFLD1SItunPwyqEOkca6GbV612BWfaBag==", + "license": "MIT" + }, "node_modules/rc": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", @@ -9413,6 +10783,7 @@ "version": "15.6.1", "resolved": "https://registry.npmjs.org/react-syntax-highlighter/-/react-syntax-highlighter-15.6.1.tgz", "integrity": "sha512-OqJ2/vL7lEeV5zTJyG7kmARppUjiB9h9udl4qHQjjgEos66z00Ia0OckwYfRxCSFrW8RJIBnsBwQsHZbVPspqg==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.3.1", "highlight.js": "^10.4.1", @@ -9433,6 +10804,20 @@ "pify": "^2.3.0" } }, + "node_modules/readable-stream": { + "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", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", @@ -9566,6 +10951,7 @@ "version": "3.6.0", "resolved": "https://registry.npmjs.org/refractor/-/refractor-3.6.0.tgz", "integrity": "sha512-MY9W41IOWxxk31o+YvFCNyNzdkc9M20NoZK5vq6jkv4I/uh2zkWcfudj0Q1fovjUQJrNewS9NMzeTtqPf+n5EA==", + "license": "MIT", "dependencies": { "hastscript": "^6.0.0", "parse-entities": "^2.0.0", @@ -9580,6 +10966,7 @@ "version": "1.2.4", "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-1.2.4.tgz", "integrity": "sha512-iBMyeEHxfVnIakwOuDXpVkc54HijNgCyQB2w0VfGQThle6NXn50zU6V/u+LDhxHcDUPojn6Kpga3PTAD8W1bQw==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -9589,6 +10976,7 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-1.1.4.tgz", "integrity": "sha512-3Xnr+7ZFS1uxeiUDvV02wQ+QDbc55o97tIV5zHScSPJpcLm/r0DFPcoY3tYRp+VZukxuMeKgXYmsXQHO05zQeA==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -9598,6 +10986,7 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/character-reference-invalid/-/character-reference-invalid-1.1.4.tgz", "integrity": "sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -9607,6 +10996,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-1.0.4.tgz", "integrity": "sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -9616,6 +11006,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-1.0.4.tgz", "integrity": "sha512-UzoZUr+XfVz3t3v4KyGEniVL9BDRoQtY7tOyrRybkVNjDFWyo1yhXNGrrBTQxp3ib9BLAWs7k2YKBQsFRkZG9A==", + "license": "MIT", "dependencies": { "is-alphabetical": "^1.0.0", "is-decimal": "^1.0.0" @@ -9629,6 +11020,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-1.0.4.tgz", "integrity": "sha512-RGdriMmQQvZ2aqaQq3awNA6dCGtKpiDFcOzrTWrDAT2MiWrKQVPmxLGHl7Y2nNu6led0kEyoX0enY0qXYsv9zw==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -9638,6 +11030,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-1.0.4.tgz", "integrity": "sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -9647,6 +11040,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-2.0.0.tgz", "integrity": "sha512-kkywGpCcRYhqQIchaWqZ875wzpS/bMKhz5HnN3p7wveJTkTtyAB/AlnS0f8DFSqYW1T82t6yEAkEcB+A1I3MbQ==", + "license": "MIT", "dependencies": { "character-entities": "^1.0.0", "character-entities-legacy": "^1.0.0", @@ -9664,6 +11058,7 @@ "version": "1.27.0", "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.27.0.tgz", "integrity": "sha512-t13BGPUlFDR7wRB5kQDG4jjl7XeuH6jbJGt11JHPL96qwsEHNX2+68tFXqc1/k+/jALsbSWJKUOT/hcYAZ5LkA==", + "license": "MIT", "engines": { "node": ">=6" } @@ -9729,6 +11124,24 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/remark-gfm": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/remark-gfm/-/remark-gfm-4.0.0.tgz", + "integrity": "sha512-U92vJgBPkbw4Zfu/IiW2oTZLSL3Zpv+uI7My2eq8JxKgqraFdU8YUGicEJCEgSbeaG+QDFqIcwwfMTOEelPxuA==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-gfm": "^3.0.0", + "micromark-extension-gfm": "^3.0.0", + "remark-parse": "^11.0.0", + "remark-stringify": "^11.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/remark-mdx": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/remark-mdx/-/remark-mdx-3.1.0.tgz", @@ -9773,6 +11186,21 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/remark-stringify": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/remark-stringify/-/remark-stringify-11.0.0.tgz", + "integrity": "sha512-1OSmLd3awB/t8qdoEOMazZkNsfVTeY4fTsgzcQFdXNq8ToTN4ZGwrMnlda4K6smTFKD+GRV6O48i6Z4iKgPPpw==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-to-markdown": "^2.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -9946,6 +11374,26 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, "node_modules/safe-regex-test": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz", @@ -10063,7 +11511,7 @@ "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.33.5.tgz", "integrity": "sha512-haPVm1EkS9pgvHrQ/F3Xy+hgcuMV0Wm9vfIBSiwZ05k+xgb0PkBQpGsAA/oWdDobNaZTH5ppvHtzCFbnSEwHVw==", "hasInstallScript": true, - "optional": true, + "license": "Apache-2.0", "dependencies": { "color": "^4.2.3", "detect-libc": "^2.0.3", @@ -10145,11 +11593,55 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/simple-get": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz", + "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "decompress-response": "^6.0.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, "node_modules/simple-swizzle": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", - "optional": true, "dependencies": { "is-arrayish": "^0.3.1" } @@ -10227,6 +11719,62 @@ "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==" }, + "node_modules/sql.js-httpvfs": { + "version": "0.8.12", + "resolved": "https://registry.npmjs.org/sql.js-httpvfs/-/sql.js-httpvfs-0.8.12.tgz", + "integrity": "sha512-lcEBc2q0psFRfdCx8Di22oUIkkv5MUIaVO/fGCj/Jjx6YQDKVylQEcjd7NSSbmINHTRwVkm/vWP8uuevT7Rkkw==", + "license": "Apache-2.0", + "dependencies": { + "comlink": "^4.3.0" + } + }, + "node_modules/sqlite-vss": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/sqlite-vss/-/sqlite-vss-0.1.2.tgz", + "integrity": "sha512-MgTz3GLT04ckv1kaesbrsUU6/kcVsA6vGeCS/HO5d/8zKqCuZFCD0QlJaQnS6zwaMyPG++BO/uu40MMrMa0cow==", + "license": "(MIT OR Apache-2.0)", + "optionalDependencies": { + "sqlite-vss-darwin-arm64": "0.1.2", + "sqlite-vss-darwin-x64": "0.1.2", + "sqlite-vss-linux-x64": "0.1.2" + } + }, + "node_modules/sqlite-vss-darwin-arm64": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/sqlite-vss-darwin-arm64/-/sqlite-vss-darwin-arm64-0.1.2.tgz", + "integrity": "sha512-zyDk9eg33nBABrUC4cqQ7el8KJaRPzsqp8Y/nGZ0CAt7o1PMqLoCOgREorill5MGiZEBmLqxdAgw0O2MFwq4mw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/sqlite-vss-darwin-x64": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/sqlite-vss-darwin-x64/-/sqlite-vss-darwin-x64-0.1.2.tgz", + "integrity": "sha512-w+ODOH2dNkyO6UaGclwC0jwNf/FBsKaE53XKJ7dFmpOvlvO0/9sA1stkWXygykRVWwa3UD8ow0qbQpRwdOFyqg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/sqlite-vss-linux-x64": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/sqlite-vss-linux-x64/-/sqlite-vss-linux-x64-0.1.2.tgz", + "integrity": "sha512-y1qktcHAZcfN1nYMcF5os/cCRRyaisaNc2C9I3ceLKLPAqUWIocsOdD5nNK/dIeGPag/QeT2ZItJ6uYWciLiAg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ] + }, "node_modules/streamsearch": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", @@ -10235,6 +11783,29 @@ "node": ">=10.0.0" } }, + "node_modules/streamx": { + "version": "2.21.1", + "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.21.1.tgz", + "integrity": "sha512-PhP9wUnFLa+91CPy3N6tiQsK+gnYyUNuk15S3YG/zjYE7RuPeCjJngqnzpC31ow0lzBHQ+QGO4cNJnd0djYUsw==", + "license": "MIT", + "dependencies": { + "fast-fifo": "^1.3.2", + "queue-tick": "^1.0.1", + "text-decoder": "^1.1.0" + }, + "optionalDependencies": { + "bare-events": "^2.2.0" + } + }, + "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" + } + }, "node_modules/string-width": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", @@ -10752,6 +12323,78 @@ "node": ">=6" } }, + "node_modules/tar": { + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/tar/-/tar-7.4.3.tgz", + "integrity": "sha512-5S7Va8hKfV7W5U6g3aYxXmlPoZVAwUMy9AOKyF2fVuZa2UD3qZjg578OrLRt8PcNN1PleVaL/5/yYATNL0ICUw==", + "license": "ISC", + "dependencies": { + "@isaacs/fs-minipass": "^4.0.0", + "chownr": "^3.0.0", + "minipass": "^7.1.2", + "minizlib": "^3.0.1", + "mkdirp": "^3.0.1", + "yallist": "^5.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "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==", + "license": "MIT", + "dependencies": { + "chownr": "^1.1.1", + "mkdirp-classic": "^0.5.2", + "pump": "^3.0.0", + "tar-stream": "^2.1.4" + } + }, + "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", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/tar/node_modules/chownr": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-3.0.0.tgz", + "integrity": "sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==", + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=18" + } + }, + "node_modules/tar/node_modules/yallist": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-5.0.0.tgz", + "integrity": "sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==", + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=18" + } + }, + "node_modules/text-decoder": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.2.3.tgz", + "integrity": "sha512-3/o9z3X0X0fTupwsYvR03pJ/DjWuqqrfwBgTQzdWDiQSm9KitAyz/9WqsT2JQW7KV2m+bC2ol/zqpW37NHxLaA==", + "license": "Apache-2.0", + "dependencies": { + "b4a": "^1.6.4" + } + }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -10931,6 +12574,18 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==" }, + "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" + }, + "engines": { + "node": "*" + } + }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -11610,8 +13265,7 @@ "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==", - "dev": true + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, "node_modules/write-file-atomic": { "version": "3.0.3", @@ -11673,6 +13327,7 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "license": "MIT", "engines": { "node": ">=0.4" } diff --git a/docs/package.json b/docs/package.json index 0287ffb..6908e7e 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,6 +1,6 @@ { "name": "akiradocs", - "version": "1.0.52", + "version": "1.0.53", "private": true, "scripts": { "translate": "npm run compile && node scripts/translate.js", @@ -20,6 +20,7 @@ "@dnd-kit/utilities": "^3.2.2", "@google/generative-ai": "^0.2.1", "@heroicons/react": "^2.1.5", + "@huggingface/transformers": "^3.2.3", "@mdx-js/loader": "^3.1.0", "@mdx-js/react": "^3.1.0", "@million/lint": "^1.0.12", @@ -42,7 +43,9 @@ "@radix-ui/react-toggle": "^1.1.0", "@radix-ui/react-toggle-group": "^1.1.0", "@radix-ui/react-tooltip": "^1.1.3", + "@xenova/transformers": "^2.17.2", "ai": "^4.0.2", + "better-sqlite3": "^11.7.0", "class-variance-authority": "^0.7.0", "clsx": "^2.1.1", "cross-spawn": "^7.0.6", @@ -62,7 +65,11 @@ "react-error-boundary": "^4.1.2", "react-markdown": "^9.0.1", "react-syntax-highlighter": "^15.6.1", + "remark-gfm": "^4.0.0", + "sharp": "^0.33.5", "sonner": "^1.7.0", + "sql.js-httpvfs": "^0.8.12", + "sqlite-vss": "^0.1.2", "styled-components": "^6.1.13", "tailwind-merge": "^2.5.4", "tailwindcss-animate": "^1.0.7" @@ -81,4 +88,4 @@ "ts-node": "^10.9.2", "typescript": "^5.6.3" } -} \ No newline at end of file +} diff --git a/docs/public/context/docs.db b/docs/public/context/docs.db new file mode 100644 index 0000000..1ac6b70 Binary files /dev/null and b/docs/public/context/docs.db differ diff --git a/docs/public/sql.js-httpvfs/sql-wasm.wasm b/docs/public/sql.js-httpvfs/sql-wasm.wasm new file mode 100644 index 0000000..66d4a5d Binary files /dev/null and b/docs/public/sql.js-httpvfs/sql-wasm.wasm differ diff --git a/docs/public/sql.js-httpvfs/sqlite.worker.js b/docs/public/sql.js-httpvfs/sqlite.worker.js new file mode 100644 index 0000000..b905898 --- /dev/null +++ b/docs/public/sql.js-httpvfs/sqlite.worker.js @@ -0,0 +1,5 @@ +!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(this,function(){return(()=>{var __webpack_modules__={870:(e,t,r)=>{"use strict";r.r(t),r.d(t,{createEndpoint:()=>o,expose:()=>l,proxy:()=>g,proxyMarker:()=>n,releaseProxy:()=>i,transfer:()=>v,transferHandlers:()=>u,windowEndpoint:()=>y,wrap:()=>f});let n=Symbol("Comlink.proxy"),o=Symbol("Comlink.endpoint"),i=Symbol("Comlink.releaseProxy"),s=Symbol("Comlink.thrown"),a=e=>"object"==typeof e&&null!==e||"function"==typeof e,u=new Map([["proxy",{canHandle:e=>a(e)&&e[n],serialize(e){let{port1:t,port2:r}=new MessageChannel;return l(e,t),[r,[r]]},deserialize:e=>(e.start(),f(e))}],["throw",{canHandle:e=>a(e)&&s in e,serialize:({value:e})=>[e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[]],deserialize(e){if(e.isError)throw Object.assign(Error(e.value.message),e.value);throw e.value}}]]);function l(e,t=self){t.addEventListener("message",function r(n){let o;if(!n||!n.data)return;let{id:i,type:a,path:u}=Object.assign({path:[]},n.data),f=(n.data.argumentList||[]).map(_);try{let t=u.slice(0,-1).reduce((e,t)=>e[t],e),r=u.reduce((e,t)=>e[t],e);switch(a){case 0:o=r;break;case 1:t[u.slice(-1)[0]]=_(n.data.value),o=!0;break;case 2:o=r.apply(t,f);break;case 3:o=g(new r(...f));break;case 4:{let{port1:t,port2:r}=new MessageChannel;l(e,r),o=v(t,[t])}break;case 5:o=void 0}}catch(e){o={value:e,[s]:0}}Promise.resolve(o).catch(e=>({value:e,[s]:0})).then(e=>{let[n,o]=b(e);t.postMessage(Object.assign(Object.assign({},n),{id:i}),o),5===a&&(t.removeEventListener("message",r),c(t))})}),t.start&&t.start()}function c(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function f(e,t){return h(e,[],t)}function d(e){if(e)throw Error("Proxy has been released and is not useable")}function h(e,t=[],r=function(){}){let n=!1,s=new Proxy(r,{get(r,o){if(d(n),o===i)return()=>w(e,{type:5,path:t.map(e=>e.toString())}).then(()=>{c(e),n=!0});if("then"===o){if(0===t.length)return{then:()=>s};let r=w(e,{type:0,path:t.map(e=>e.toString())}).then(_);return r.then.bind(r)}return h(e,[...t,o])},set(r,o,i){d(n);let[s,a]=b(i);return w(e,{type:1,path:[...t,o].map(e=>e.toString()),value:s},a).then(_)},apply(r,i,s){d(n);let a=t[t.length-1];if(a===o)return w(e,{type:4}).then(_);if("bind"===a)return h(e,t.slice(0,-1));let[u,l]=m(s);return w(e,{type:2,path:t.map(e=>e.toString()),argumentList:u},l).then(_)},construct(r,o){d(n);let[i,s]=m(o);return w(e,{type:3,path:t.map(e=>e.toString()),argumentList:i},s).then(_)}});return s}function m(e){var t;let r=e.map(b);return[r.map(e=>e[0]),(t=r.map(e=>e[1]),Array.prototype.concat.apply([],t))]}let p=new WeakMap;function v(e,t){return p.set(e,t),e}function g(e){return Object.assign(e,{[n]:!0})}function y(e,t=self,r="*"){return{postMessage:(t,n)=>e.postMessage(t,r,n),addEventListener:t.addEventListener.bind(t),removeEventListener:t.removeEventListener.bind(t)}}function b(e){for(let[t,r]of u)if(r.canHandle(e)){let[n,o]=r.serialize(e);return[{type:3,name:t,value:n},o]}return[{type:0,value:e},p.get(e)||[]]}function _(e){switch(e.type){case 3:return u.get(e.name).deserialize(e.value);case 0:return e.value}}function w(e,t,r){return new Promise(n=>{let o=[,,,,].fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-");e.addEventListener("message",function t(r){r.data&&r.data.id&&r.data.id===o&&(e.removeEventListener("message",t),n(r.data))}),e.start&&e.start(),e.postMessage(Object.assign({id:o},t),r)})}},794:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createLazyFile=t.LazyUint8Array=void 0;class r{constructor(e){this.serverChecked=!1,this.chunks=[],this.totalFetchedBytes=0,this.totalRequests=0,this.readPages=[],this.readHeads=[],this.lastGet=-1,this._chunkSize=e.requestChunkSize,this.maxSpeed=Math.round((e.maxReadSpeed||5242880)/this._chunkSize),this.maxReadHeads=e.maxReadHeads??3,this.rangeMapper=e.rangeMapper,this.logPageReads=e.logPageReads??!1,e.fileLength&&(this._length=e.fileLength),this.requestLimiter=null==e.requestLimiter?e=>{}:e.requestLimiter}copyInto(e,t,r,n){if(n>=this.length)return 0;let o=n+(r=Math.min(this.length-n,r)),i=0;for(;i=n&&ethis.maxReadHeads;)this.readHeads.pop();return t}getChunk(e){let t=!0;if(void 0===this.chunks[e]){t=!1;let r=this.moveReadHead(e),n=r.speed,o=r.startChunk*this.chunkSize,i=(r.startChunk+n)*this.chunkSize-1;i=Math.min(i,this.length-1);let s=this.doXHR(o,i);for(let e=0;e=s.byteLength)break;let n=(e+1)*this.chunkSize>s.byteLength?s.byteLength-e*this.chunkSize:this.chunkSize;this.chunks[t]=new Uint8Array(s,e*this.chunkSize,n)}}if(void 0===this.chunks[e])throw Error("doXHR failed (bug)!");return this.logPageReads&&this.lastGet!=e&&(this.lastGet=e,this.readPages.push({pageno:e,wasCached:t,prefetch:t?0:this.readHeads[0].speed-1})),this.chunks[e]}checkServer(){var e=new XMLHttpRequest;let t=this.rangeMapper(0,0).url;if(e.open("HEAD",t,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw Error("Couldn't load "+t+". Status: "+e.status);var r=Number(e.getResponseHeader("Content-length")),n="bytes"===e.getResponseHeader("Accept-Ranges");let o=e.getResponseHeader("Content-Encoding");var i=o&&"identity"!==o;if(n||console.warn("Warning: The server did not respond with Accept-Ranges=bytes. It either does not support byte serving or does not advertise it (`Accept-Ranges: bytes` header missing), or your database is hosted on CORS and the server doesn't mark the accept-ranges header as exposed. This may lead to incorrect results.","(seen response headers:",e.getAllResponseHeaders(),")"),i&&console.warn(`Warning: The server responded with ${o} encoding to a HEAD request. Ignoring since it may not do so for Range HTTP requests, but this will lead to incorrect results otherwise since the ranges will be based on the compressed data instead of the uncompressed data.`),i&&(r=null),!this._length){if(!r)throw console.error("response headers",e.getAllResponseHeaders()),Error("Length of the file not known. It must either be supplied in the config or given by the HTTP server.");this._length=r}this.serverChecked=!0}get length(){return this.serverChecked||this.checkServer(),this._length}get chunkSize(){return this.serverChecked||this.checkServer(),this._chunkSize}doXHR(e,t){if(console.log(`[xhr of size ${(t+1-e)/1024} KiB @ ${e/1024} KiB]`),this.requestLimiter(t-e),this.totalFetchedBytes+=t-e,this.totalRequests++,e>t)throw Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>this.length-1)throw Error("only "+this.length+" bytes available! programmer error!");let{fromByte:r,toByte:n,url:o}=this.rangeMapper(e,t);var i=new XMLHttpRequest;if(i.open("GET",o,!1),this.length!==this.chunkSize&&i.setRequestHeader("Range","bytes="+r+"-"+n),i.responseType="arraybuffer",i.overrideMimeType&&i.overrideMimeType("text/plain; charset=x-user-defined"),i.send(null),!(i.status>=200&&i.status<300||304===i.status))throw Error("Couldn't load "+o+". Status: "+i.status);if(void 0!==i.response)return i.response;throw Error("xhr did not return uint8array")}}t.LazyUint8Array=r,t.createLazyFile=function(e,t,n,o,i,s){var a=new r(s),u={isDevice:!1,contents:a},l=e.createFile(t,n,u,o,i);l.contents=a,Object.defineProperties(l,{usedBytes:{get:function(){return this.contents.length}}});var c={};return Object.keys(l.stream_ops).forEach(function(t){var r=l.stream_ops[t];c[t]=function(){return e.forceLoadFile(l),r.apply(null,arguments)}}),c.read=function(t,r,n,o,i){return e.forceLoadFile(l),t.node.contents.copyInto(r,n,o,i)},l.stream_ops=c,l}},630:function(__unused_webpack_module,exports,__webpack_require__){"use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&__createBinding(t,e,r);return __setModuleDefault(t,e),t},__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.toObjects=void 0;let Comlink=__importStar(__webpack_require__(870)),sql_wasm_js_1=__importDefault(__webpack_require__(365)),sql_wasm_wasm_1=__importDefault(__webpack_require__(720)),lazyFile_1=__webpack_require__(794),vtab_1=__webpack_require__(457);function initTransferHandlers(e){Comlink.transferHandlers.set("WORKERSQLPROXIES",{canHandle:t=>{let r=t instanceof e.Database,n=t&&t.db&&t.db instanceof e.Database;return r||n},serialize(e){let{port1:t,port2:r}=new MessageChannel;return Comlink.expose(e,t),[r,[r]]},deserialize:e=>{}})}async function init(e){let t=await sql_wasm_js_1.default({locateFile:t=>e});return initTransferHandlers(t),t}function toObjects(e){return e.flatMap(e=>e.values.map(t=>{let r={};for(let n=0;n{if("jsonconfig"===e.from){let t=new URL(e.configUrl,location.href),r=await fetch(t.toString());if(!r.ok)throw console.error("httpvfs config error",await r.text()),Error(`Could not load httpvfs config: ${r.status}: ${r.statusText}`);let n=await r.json();return{from:"inline",config:"chunked"===n.serverMode?{...n,urlPrefix:new URL(n.urlPrefix,t).toString()}:{...n,url:new URL(n.url,t).toString()},virtualFilename:e.virtualFilename}}return e}))}sql_wasm_wasm_1.default,exports.toObjects=toObjects;let mod={db:null,inited:!1,sqljs:null,bytesRead:0,async SplitFileHttpDatabase(e,t,r,n=1/0){let o;if(this.inited)throw Error("sorry, only one db is supported right now");this.inited=!0,this.sqljs||(this.sqljs=init(e));let i=await this.sqljs;this.bytesRead=0;let s=e=>{if(this.bytesRead+e>n)throw this.bytesRead=0,new i.FS.ErrnoError(6);this.bytesRead+=e},a=new Map;for(let{config:e,virtualFilename:n}of(await fetchConfigs(t))){let t;let u="chunked"===e.serverMode?e.urlPrefix:e.url;console.log("constructing url database",u);let l=e.cacheBust?"?cb="+e.cacheBust:"";t="chunked"==e.serverMode?(t,r)=>{let n=t/e.serverChunkSize|0,o=t%e.serverChunkSize,i=o+(r-t);return{url:e.urlPrefix+String(n).padStart(e.suffixLength,"0")+l,fromByte:o,toByte:i}}:(t,r)=>({url:e.url+l,fromByte:t,toByte:r});let c=n||u.replace(/\//g,"_");r||(r=c,o=e),console.log("filename",c),console.log("constructing url database",u,"filename",c);let f=lazyFile_1.createLazyFile(i.FS,"/",c,!0,!0,{rangeMapper:t,requestChunkSize:e.requestChunkSize,fileLength:"chunked"===e.serverMode?e.databaseLengthBytes:void 0,logPageReads:!0,maxReadHeads:3,requestLimiter:s});a.set(c,f)}if(this.db=new i.CustomDatabase(r),o){let e=(await this.db.exec("pragma page_size; pragma cache_size=0"))[0].values[0][0];e!==o.requestChunkSize&&console.warn(`Chunk size does not match page size: pragma page_size = ${e} but chunkSize = ${o.requestChunkSize}`)}return this.db.lazyFiles=a,this.db.create_vtab(vtab_1.SeriesVtab),this.db.query=(...e)=>toObjects(this.db.exec(...e)),this.db},getResetAccessedPages(e){if(!this.db)return[];let t=this.db.lazyFiles.get(e||this.db.filename);if(!t)throw Error("unknown lazy file");let r=[...t.contents.readPages];return t.contents.readPages=[],r},getStats(e){let t=this.db;if(!t)return null;let r=t.lazyFiles.get(e||t.filename);if(!r)throw Error("unknown lazy file");return{filename:t.filename,totalBytes:r.contents.length,totalFetchedBytes:r.contents.totalFetchedBytes,totalRequests:r.contents.totalRequests}},async evalCode(code){return await eval(`(async function (db) { + ${code} + })`)(this.db)}};Comlink.expose(mod)},457:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.SeriesVtab=void 0,function(e){e[e.idx=0]="idx",e[e.id=1]="id",e[e.tagName=2]="tagName",e[e.textContent=3]="textContent",e[e.innerHTML=4]="innerHTML",e[e.outerHTML=5]="outerHTML",e[e.className=6]="className",e[e.parent=7]="parent",e[e.selector=8]="selector",e[e.querySelector=9]="querySelector"}(r||(r={}));let n=Object.keys(r).map(e=>r[e]).filter(e=>"string"==typeof e);function o(e){let t={};for(let n=0;n`");let s=this.module.getValue(t+64,"i32");return this.module.setValue(t+20,s,"i32"),0}catch(t){return console.error("xbestindex",t),this.setVtabError(e,String(t)),21}}xFilter(e,t,o,s,a){if(console.log("xfilter",s),1!==s)return console.error("did not get a single argument to xFilter"),21;let u=this.module.extract_value(a+0),l=this.getCursor(e);l.querySelector=u;let c=t,f=n.filter(e=>c&1<=t.elements.length)}xColumn(e,t,n){let o=this.getCursor(e),i=o.elements[o.index];if(r[n]in i)this.module.set_return_value(t,i[r[n]]);else switch(n){case r.idx:this.module.set_return_value(t,o.index);break;case r.querySelector:this.module.set_return_value(t,o.querySelector);break;default:throw Error(`unknown column ${r[n]}`)}return 0}setVtabError(e,t){let r=this.module.lengthBytesUTF8(t)+1,n=this.module.sqlite3_malloc(r);console.log("writing error",t,r),this.module.stringToUTF8(t,n,r),this.module.setValue(e+8,n,"i32")}xUpdate(e,t,r,n){try{let[e,n,...s]=Array.from({length:t},(e,t)=>this.module.extract_value(r+4*t));if(e){if(e&&!n)console.log("DELETE",e),i({type:"delete",selector:e});else{if(e!==n)throw"The selector row can't be set";i({type:"update",value:o(s)})}}else console.assert(null===n),i({type:"insert",value:o(s)});return 0}catch(t){return this.setVtabError(e,String(t)),21}}xRowid(e,t){throw Error("xRowid not implemented")}xFindFunction(e,t,r,n,o){return"match"!==this.module.UTF8ToString(r)?0:(this.module.setValue(n,this.module.addFunction((e,t,r)=>{this.module.set_return_value(e,!0)},"viii"),"i32"),150)}}},365:(e,t,r)=>{e=r.nmd(e);var n=void 0,o=function(t){return n||(n=new Promise(function(n,o){var i,s=(i=void 0!==t?t:{}).onAbort;i.onAbort=function(e){o(Error(e)),s&&s(e)},i.postRun=i.postRun||[],i.postRun.push(function(){n(i)}),e=void 0,(i=void 0!==i?i:{}).onRuntimeInitialized=function(){var e=eI(4),t=i.cwrap,r=t("sqlite3_open","number",["string","number"]),n=(t("sqlite3_open_v2","number",["string","number","number","string"]),t("sqlite3_close_v2","number",["number"])),o=t("sqlite3_exec","number",["number","string","number","number","number"]),s=t("sqlite3_changes","number",["number"]),a=t("sqlite3_prepare_v2","number",["number","string","number","number","number"]),u=t("sqlite3_sql","string",["number"]),l=t("sqlite3_normalized_sql","string",["number"]),c=t("sqlite3_prepare_v2","number",["number","number","number","number","number"]),f=t("sqlite3_bind_text","number",["number","number","number","number","number"]),d=t("sqlite3_bind_blob","number",["number","number","number","number","number"]),h=t("sqlite3_bind_double","number",["number","number","number"]),m=t("sqlite3_bind_int","number",["number","number","number"]),p=t("sqlite3_bind_parameter_index","number",["number","string"]),v=t("sqlite3_step","number",["number"]),g=t("sqlite3_errmsg","string",["number"]),y=t("sqlite3_column_count","number",["number"]),b=t("sqlite3_data_count","number",["number"]),_=t("sqlite3_column_double","number",["number","number"]),w=t("sqlite3_column_text","string",["number","number"]),E=t("sqlite3_column_blob","number",["number","number"]),k=t("sqlite3_column_bytes","number",["number","number"]),S=t("sqlite3_column_type","number",["number","number"]),q=t("sqlite3_column_name","string",["number","number"]),M=t("sqlite3_reset","number",["number"]),F=t("sqlite3_clear_bindings","number",["number"]),D=t("sqlite3_finalize","number",["number"]),A=t("sqlite3_create_module_v2","number",["number","string","number","number","number"]),P=t("sqlite3_create_function_v2","number",["number","string","number","number","number","number","number","number","number"]),R=t("sqlite3_value_type","number",["number"]),z=t("sqlite3_value_bytes","number",["number"]),T=t("sqlite3_value_text","string",["number"]),B=t("sqlite3_value_blob","number",["number"]),N=t("sqlite3_value_double","number",["number"]),H=t("sqlite3_result_double","",["number","number"]),I=t("sqlite3_result_null","",["number"]),U=t("sqlite3_result_text","",["number","string","number","number"]),V=t("sqlite3_result_blob","",["number","number","number","number"]),W=t("sqlite3_result_int","",["number","number"]),X=t("sqlite3_result_error","",["number","string","number"]),G=t("sqlite3_malloc","number",["number"]);i.sqlite3_malloc=G;var $=t("RegisterExtensionFunctions","number",["number"]);function K(e,t){this.stmt=e,this.db=t,this.pos=1,this.allocatedmem=[]}function Y(e,t){this.db=t;var r=L(e)+1;if(this.sqlPtr=eC(r),null===this.sqlPtr)throw Error("Unable to allocate memory for the SQL string");C(e,this.sqlPtr,r),this.nextSqlPtr=this.sqlPtr,this.nextSqlString=null,this.activeStatement=null}function Q(t){this.filename="dbfile_"+(0xffffffff*Math.random()>>>0),null!=t&&eh.createDataFile("/",this.filename,t,!0,!0);let n=r(this.filename,e);this.db=eo(e,"i32"),this.handleError(n),$(this.db),this.statements={},this.functions={}}function J(t){this.filename=t;let n=r(this.filename,e);this.db=eo(e,"i32"),this.handleError(n),$(this.db),this.statements={},this.functions={}}K.prototype.bind=function(e){if(!this.stmt)throw"Statement closed";return this.reset(),Array.isArray(e)?this.bindFromArray(e):null==e||"object"!=typeof e||this.bindFromObject(e)},K.prototype.bind_=K.prototype.bind,K.prototype.step=function(){if(!this.stmt)throw"Statement closed";this.pos=1;var e=v(this.stmt);switch(e){case 100:return!0;case 101:return!1;default:throw this.db.handleError(e)}},K.prototype.getNumber=function(e){return null==e&&(e=this.pos,this.pos+=1),_(this.stmt,e)},K.prototype.getString=function(e){return null==e&&(e=this.pos,this.pos+=1),w(this.stmt,e)},K.prototype.getBlob=function(e){null==e&&(e=this.pos,this.pos+=1);for(var t=k(this.stmt,e),r=E(this.stmt,e),n=new Uint8Array(t),o=0;o{f||(c=r(905),f=r(101))},a=function(e,t){return d(),e=f.normalize(e),c.readFileSync(e,t?void 0:"utf8")},l=e=>{var t=a(e,!0);return t.buffer||(t=new Uint8Array(t)),t},u=(e,t,r)=>{d(),e=f.normalize(e),c.readFile(e,function(e,n){e?r(e):t(n.buffer)})},process.argv.length>1&&(p=process.argv[1].replace(/\\/g,"/")),m=process.argv.slice(2),e.exports=i,i.inspect=function(){return"[Emscripten Module object]"}):(v||g)&&(g?b=self.location.href:"undefined"!=typeof document&&document.currentScript&&(b=document.currentScript.src),b=0!==b.indexOf("blob:")?b.substr(0,b.replace(/[?#].*/,"").lastIndexOf("/")+1):"",a=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},g&&(l=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),u=(e,t,r)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?t(n.response):r()},n.onerror=r,n.send(null)});var _,w=i.print||console.log.bind(console),E=i.printErr||console.warn.bind(console);Object.assign(i,h),h=null,i.arguments&&(m=i.arguments),i.thisProgram&&(p=i.thisProgram),i.quit&&i.quit,i.wasmBinary&&(_=i.wasmBinary),i.noExitRuntime,"object"!=typeof WebAssembly&&Z("no native wasm support detected");var k,S,x,q,M,F,D,A,P,R=!1,z="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function T(e,t,r){for(var n=t+r,o=t;e[o]&&!(o>=n);)++o;if(o-t>16&&e.buffer&&z)return z.decode(e.subarray(t,o));for(var i="";t>10,56320|1023&l)}}else i+=String.fromCharCode((31&s)<<6|a)}else i+=String.fromCharCode(s)}return i}function j(e,t){return e?T(q,e,t):""}function O(e,t,r,n){if(!(n>0))return 0;for(var o=r,i=r+n-1,s=0;s=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++s)),a<=127){if(r>=i)break;t[r++]=a}else if(a<=2047){if(r+1>=i)break;t[r++]=192|a>>6,t[r++]=128|63&a}else if(a<=65535){if(r+2>=i)break;t[r++]=224|a>>12,t[r++]=128|a>>6&63,t[r++]=128|63&a}else{if(r+3>=i)break;t[r++]=240|a>>18,t[r++]=128|a>>12&63,t[r++]=128|a>>6&63,t[r++]=128|63&a}}return t[r]=0,r-o}function C(e,t,r){return O(e,q,t,r)}function L(e){for(var t=0,r=0;r=55296&&n<=57343?(t+=4,++r):t+=3}return t}function B(e){S=e,i.HEAP8=x=new Int8Array(e),i.HEAP16=M=new Int16Array(e),i.HEAP32=F=new Int32Array(e),i.HEAPU8=q=new Uint8Array(e),i.HEAPU16=new Uint16Array(e),i.HEAPU32=D=new Uint32Array(e),i.HEAPF32=A=new Float32Array(e),i.HEAPF64=P=new Float64Array(e)}i.INITIAL_MEMORY;var N,H,I,U,V,W=[],X=[],G=[],$=0,K=null,Y=null;function Q(e){$++,i.monitorRunDependencies&&i.monitorRunDependencies($)}function J(e){if($--,i.monitorRunDependencies&&i.monitorRunDependencies($),0==$&&(null!==K&&(clearInterval(K),K=null),Y)){var t=Y;Y=null,t()}}function Z(e){throw i.onAbort&&i.onAbort(e),E(e="Aborted("+e+")"),R=!0,e+=". Build with -sASSERTIONS for more info.",new WebAssembly.RuntimeError(e)}function ee(e){return e.startsWith("data:application/octet-stream;base64,")}function et(e){return e.startsWith("file://")}function er(e){try{if(e==H&&_)return new Uint8Array(_);if(l)return l(e);throw"both async and sync fetching of the wasm failed"}catch(e){Z(e)}}function en(e){for(;e.length>0;)e.shift()(i)}function eo(e,t="i8"){switch(t.endsWith("*")&&(t="*"),t){case"i1":case"i8":return x[e>>0];case"i16":return M[e>>1];case"i32":case"i64":return F[e>>2];case"float":return A[e>>2];case"double":return P[e>>3];case"*":return D[e>>2];default:Z("invalid type for getValue: "+t)}return null}function ei(e,t,r="i8"){switch(r.endsWith("*")&&(r="*"),r){case"i1":case"i8":x[e>>0]=t;break;case"i16":M[e>>1]=t;break;case"i32":F[e>>2]=t;break;case"i64":V=[t>>>0,+Math.abs(U=t)>=1?U>0?(0|Math.min(+Math.floor(U/0x100000000),0xffffffff))>>>0:~~+Math.ceil((U-+(~~U>>>0))/0x100000000)>>>0:0],F[e>>2]=V[0],F[e+4>>2]=V[1];break;case"float":A[e>>2]=t;break;case"double":P[e>>3]=t;break;case"*":D[e>>2]=t;break;default:Z("invalid type for setValue: "+r)}}ee(H="sql-wasm.wasm")||(I=H,H=i.locateFile?i.locateFile(I,b):b+I);var es={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,t)=>{for(var r=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},normalize:e=>{var t=es.isAbs(e),r="/"===e.substr(-1);return(e=es.normalizeArray(e.split("/").filter(e=>!!e),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=es.splitPath(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},basename:e=>{if("/"===e)return"/";var t=(e=(e=es.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return -1===t?e:e.substr(t+1)},join:function(){var e=Array.prototype.slice.call(arguments);return es.normalize(e.join("/"))},join2:(e,t)=>es.normalize(e+"/"+t)},ea={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:eh.cwd();if("string"!=typeof n)throw TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,t=es.isAbs(n)}return(t?"/":"")+(e=es.normalizeArray(e.split("/").filter(e=>!!e),!t).join("/"))||"."},relative:(e,t)=>{function r(e){for(var t=0;t=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=ea.resolve(e).substr(1),t=ea.resolve(t).substr(1);for(var n=r(e.split("/")),o=r(t.split("/")),i=Math.min(n.length,o.length),s=i,a=0;a0?r:L(e)+1),o=O(e,n,0,n.length);return t&&(n.length=o),n}var el={ttys:[],init:function(){},shutdown:function(){},register:function(e,t){el.ttys[e]={input:[],output:[],ops:t},eh.registerDevice(e,el.stream_ops)},stream_ops:{open:function(e){var t=el.ttys[e.node.rdev];if(!t)throw new eh.ErrnoError(43);e.tty=t,e.seekable=!1},close:function(e){e.tty.ops.fsync(e.tty)},fsync:function(e){e.tty.ops.fsync(e.tty)},read:function(e,t,r,n,o){if(!e.tty||!e.tty.ops.get_char)throw new eh.ErrnoError(60);for(var i,s=0,a=0;a0?r.slice(0,n).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&null!==(t=readline())&&(t+="\n");if(!t)return null;e.input=eu(t,!0)}return e.input.shift()},put_char:function(e,t){null===t||10===t?(w(T(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync:function(e){e.output&&e.output.length>0&&(w(T(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,t){null===t||10===t?(E(T(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync:function(e){e.output&&e.output.length>0&&(E(T(e.output,0)),e.output=[])}}};function ec(e){e=function(e,t){return 65536*Math.ceil(e/65536)}(e);var t=eB(65536,e);return t?function(e,t){return q.fill(0,e,e+t),e}(t,e):0}var ef,ed={ops_table:null,mount:function(e){return ed.createNode(null,"/",16895,0)},createNode:function(e,t,r,n){if(eh.isBlkdev(r)||eh.isFIFO(r))throw new eh.ErrnoError(63);ed.ops_table||(ed.ops_table={dir:{node:{getattr:ed.node_ops.getattr,setattr:ed.node_ops.setattr,lookup:ed.node_ops.lookup,mknod:ed.node_ops.mknod,rename:ed.node_ops.rename,unlink:ed.node_ops.unlink,rmdir:ed.node_ops.rmdir,readdir:ed.node_ops.readdir,symlink:ed.node_ops.symlink},stream:{llseek:ed.stream_ops.llseek}},file:{node:{getattr:ed.node_ops.getattr,setattr:ed.node_ops.setattr},stream:{llseek:ed.stream_ops.llseek,read:ed.stream_ops.read,write:ed.stream_ops.write,allocate:ed.stream_ops.allocate,mmap:ed.stream_ops.mmap,msync:ed.stream_ops.msync}},link:{node:{getattr:ed.node_ops.getattr,setattr:ed.node_ops.setattr,readlink:ed.node_ops.readlink},stream:{}},chrdev:{node:{getattr:ed.node_ops.getattr,setattr:ed.node_ops.setattr},stream:eh.chrdev_stream_ops}});var o=eh.createNode(e,t,r,n);return eh.isDir(o.mode)?(o.node_ops=ed.ops_table.dir.node,o.stream_ops=ed.ops_table.dir.stream,o.contents={}):eh.isFile(o.mode)?(o.node_ops=ed.ops_table.file.node,o.stream_ops=ed.ops_table.file.stream,o.usedBytes=0,o.contents=null):eh.isLink(o.mode)?(o.node_ops=ed.ops_table.link.node,o.stream_ops=ed.ops_table.link.stream):eh.isChrdev(o.mode)&&(o.node_ops=ed.ops_table.chrdev.node,o.stream_ops=ed.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[t]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage:function(e,t){var r=e.contents?e.contents.length:0;if(!(r>=t)){t=Math.max(t,r*(r<1048576?2:1.125)>>>0),0!=r&&(t=Math.max(t,256));var n=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage:function(e,t){if(e.usedBytes!=t){if(0==t)e.contents=null,e.usedBytes=0;else{var r=e.contents;e.contents=new Uint8Array(t),r&&e.contents.set(r.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}}},node_ops:{getattr:function(e){var t={};return t.dev=eh.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,eh.isDir(e.mode)?t.size=4096:eh.isFile(e.mode)?t.size=e.usedBytes:eh.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr:function(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&ed.resizeFileStorage(e,t.size)},lookup:function(e,t){throw eh.genericErrors[44]},mknod:function(e,t,r,n){return ed.createNode(e,t,r,n)},rename:function(e,t,r){if(eh.isDir(e.mode)){var n;try{n=eh.lookupNode(t,r)}catch(e){}if(n)for(var o in n.contents)throw new eh.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=r,t.contents[r]=e,t.timestamp=e.parent.timestamp,e.parent=t},unlink:function(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir:function(e,t){var r=eh.lookupNode(e,t);for(var n in r.contents)throw new eh.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir:function(e){var t=[".",".."];for(var r in e.contents)e.contents.hasOwnProperty(r)&&t.push(r);return t},symlink:function(e,t,r){var n=ed.createNode(e,t,41471,0);return n.link=r,n},readlink:function(e){if(!eh.isLink(e.mode))throw new eh.ErrnoError(28);return e.link}},stream_ops:{read:function(e,t,r,n,o){var i=e.node.contents;if(o>=e.node.usedBytes)return 0;var s=Math.min(e.node.usedBytes-o,n);if(s>8&&i.subarray)t.set(i.subarray(o,o+s),r);else for(var a=0;a0||r+t{if(!(e=ea.resolve(eh.cwd(),e)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new eh.ErrnoError(32);for(var r=es.normalizeArray(e.split("/").filter(e=>!!e),!1),n=eh.root,o="/",i=0;i40)throw new eh.ErrnoError(32)}}return{path:o,node:n}},getPath:e=>{for(var t;;){if(eh.isRoot(e)){var r=e.mount.mountpoint;return t?"/"!==r[r.length-1]?r+"/"+t:r+t:r}t=t?e.name+"/"+t:e.name,e=e.parent}},hashName:(e,t)=>{for(var r=0,n=0;n>>0)%eh.nameTable.length},hashAddNode:e=>{var t=eh.hashName(e.parent.id,e.name);e.name_next=eh.nameTable[t],eh.nameTable[t]=e},hashRemoveNode:e=>{var t=eh.hashName(e.parent.id,e.name);if(eh.nameTable[t]===e)eh.nameTable[t]=e.name_next;else for(var r=eh.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode:(e,t)=>{var r=eh.mayLookup(e);if(r)throw new eh.ErrnoError(r,e);for(var n=eh.hashName(e.id,t),o=eh.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===e.id&&i===t)return o}return eh.lookup(e,t)},createNode:(e,t,r,n)=>{var o=new eh.FSNode(e,t,r,n);return eh.hashAddNode(o),o},destroyNode:e=>{eh.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>49152==(49152&e),flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:e=>{var t=eh.flagModes[e];if(void 0===t)throw Error("Unknown file open mode: "+e);return t},flagsToPermissionString:e=>{var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:(e,t)=>eh.ignorePermissions||(!t.includes("r")||292&e.mode)&&(!t.includes("w")||146&e.mode)&&(!t.includes("x")||73&e.mode)?0:2,mayLookup:e=>eh.nodePermissions(e,"x")||(e.node_ops.lookup?0:2),mayCreate:(e,t)=>{try{return eh.lookupNode(e,t),20}catch(e){}return eh.nodePermissions(e,"wx")},mayDelete:(e,t,r)=>{try{n=eh.lookupNode(e,t)}catch(e){return e.errno}var n,o=eh.nodePermissions(e,"wx");if(o)return o;if(r){if(!eh.isDir(n.mode))return 54;if(eh.isRoot(n)||eh.getPath(n)===eh.cwd())return 10}else if(eh.isDir(n.mode))return 31;return 0},mayOpen:(e,t)=>e?eh.isLink(e.mode)?32:eh.isDir(e.mode)&&("r"!==eh.flagsToPermissionString(t)||512&t)?31:eh.nodePermissions(e,eh.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd:(e=0,t=eh.MAX_OPEN_FDS)=>{for(var r=e;r<=t;r++)if(!eh.streams[r])return r;throw new eh.ErrnoError(33)},getStream:e=>eh.streams[e],createStream:(e,t,r)=>{eh.FSStream||(eh.FSStream=function(){this.shared={}},eh.FSStream.prototype={},Object.defineProperties(eh.FSStream.prototype,{object:{get:function(){return this.node},set:function(e){this.node=e}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}},flags:{get:function(){return this.shared.flags},set:function(e){this.shared.flags=e}},position:{get:function(){return this.shared.position},set:function(e){this.shared.position=e}}})),e=Object.assign(new eh.FSStream,e);var n=eh.nextfd(t,r);return e.fd=n,eh.streams[n]=e,e},closeStream:e=>{eh.streams[e]=null},chrdev_stream_ops:{open:e=>{var t=eh.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:()=>{throw new eh.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice:(e,t)=>{eh.devices[e]={stream_ops:t}},getDevice:e=>eh.devices[e],getMounts:e=>{for(var t=[],r=[e];r.length;){var n=r.pop();t.push(n),r.push.apply(r,n.mounts)}return t},syncfs:(e,t)=>{"function"==typeof e&&(t=e,e=!1),eh.syncFSRequests++,eh.syncFSRequests>1&&E("warning: "+eh.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var r=eh.getMounts(eh.root.mount),n=0;function o(e){return eh.syncFSRequests--,t(e)}function i(e){if(e)return i.errored?void 0:(i.errored=!0,o(e));++n>=r.length&&o(null)}r.forEach(t=>{if(!t.type.syncfs)return i(null);t.type.syncfs(t,e,i)})},mount:(e,t,r)=>{var n,o="/"===r,i=!r;if(o&&eh.root)throw new eh.ErrnoError(10);if(!o&&!i){var s=eh.lookupPath(r,{follow_mount:!1});if(r=s.path,n=s.node,eh.isMountpoint(n))throw new eh.ErrnoError(10);if(!eh.isDir(n.mode))throw new eh.ErrnoError(54)}var a={type:e,opts:t,mountpoint:r,mounts:[]},u=e.mount(a);return u.mount=a,a.root=u,o?eh.root=u:n&&(n.mounted=a,n.mount&&n.mount.mounts.push(a)),u},unmount:e=>{var t=eh.lookupPath(e,{follow_mount:!1});if(!eh.isMountpoint(t.node))throw new eh.ErrnoError(28);var r=t.node,n=r.mounted,o=eh.getMounts(n);Object.keys(eh.nameTable).forEach(e=>{for(var t=eh.nameTable[e];t;){var r=t.name_next;o.includes(t.mount)&&eh.destroyNode(t),t=r}}),r.mounted=null;var i=r.mount.mounts.indexOf(n);r.mount.mounts.splice(i,1)},lookup:(e,t)=>e.node_ops.lookup(e,t),mknod:(e,t,r)=>{var n=eh.lookupPath(e,{parent:!0}).node,o=es.basename(e);if(!o||"."===o||".."===o)throw new eh.ErrnoError(28);var i=eh.mayCreate(n,o);if(i)throw new eh.ErrnoError(i);if(!n.node_ops.mknod)throw new eh.ErrnoError(63);return n.node_ops.mknod(n,o,t,r)},create:(e,t)=>(t=(void 0!==t?t:438)&4095|32768,eh.mknod(e,t,0)),mkdir:(e,t)=>(t=(void 0!==t?t:511)&1023|16384,eh.mknod(e,t,0)),mkdirTree:(e,t)=>{for(var r=e.split("/"),n="",o=0;o(void 0===r&&(r=t,t=438),t|=8192,eh.mknod(e,t,r)),symlink:(e,t)=>{if(!ea.resolve(e))throw new eh.ErrnoError(44);var r=eh.lookupPath(t,{parent:!0}).node;if(!r)throw new eh.ErrnoError(44);var n=es.basename(t),o=eh.mayCreate(r,n);if(o)throw new eh.ErrnoError(o);if(!r.node_ops.symlink)throw new eh.ErrnoError(63);return r.node_ops.symlink(r,n,e)},rename:(e,t)=>{var r,n,o=es.dirname(e),i=es.dirname(t),s=es.basename(e),a=es.basename(t);if(r=eh.lookupPath(e,{parent:!0}).node,n=eh.lookupPath(t,{parent:!0}).node,!r||!n)throw new eh.ErrnoError(44);if(r.mount!==n.mount)throw new eh.ErrnoError(75);var u,l=eh.lookupNode(r,s),c=ea.relative(e,i);if("."!==c.charAt(0))throw new eh.ErrnoError(28);if("."!==(c=ea.relative(t,o)).charAt(0))throw new eh.ErrnoError(55);try{u=eh.lookupNode(n,a)}catch(e){}if(l!==u){var f=eh.isDir(l.mode),d=eh.mayDelete(r,s,f);if(d||(d=u?eh.mayDelete(n,a,f):eh.mayCreate(n,a)))throw new eh.ErrnoError(d);if(!r.node_ops.rename)throw new eh.ErrnoError(63);if(eh.isMountpoint(l)||u&&eh.isMountpoint(u))throw new eh.ErrnoError(10);if(n!==r&&(d=eh.nodePermissions(r,"w")))throw new eh.ErrnoError(d);eh.hashRemoveNode(l);try{r.node_ops.rename(l,n,a)}catch(e){throw e}finally{eh.hashAddNode(l)}}},rmdir:e=>{var t=eh.lookupPath(e,{parent:!0}).node,r=es.basename(e),n=eh.lookupNode(t,r),o=eh.mayDelete(t,r,!0);if(o)throw new eh.ErrnoError(o);if(!t.node_ops.rmdir)throw new eh.ErrnoError(63);if(eh.isMountpoint(n))throw new eh.ErrnoError(10);t.node_ops.rmdir(t,r),eh.destroyNode(n)},readdir:e=>{var t=eh.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new eh.ErrnoError(54);return t.node_ops.readdir(t)},unlink:e=>{var t=eh.lookupPath(e,{parent:!0}).node;if(!t)throw new eh.ErrnoError(44);var r=es.basename(e),n=eh.lookupNode(t,r),o=eh.mayDelete(t,r,!1);if(o)throw new eh.ErrnoError(o);if(!t.node_ops.unlink)throw new eh.ErrnoError(63);if(eh.isMountpoint(n))throw new eh.ErrnoError(10);t.node_ops.unlink(t,r),eh.destroyNode(n)},readlink:e=>{var t=eh.lookupPath(e).node;if(!t)throw new eh.ErrnoError(44);if(!t.node_ops.readlink)throw new eh.ErrnoError(28);return ea.resolve(eh.getPath(t.parent),t.node_ops.readlink(t))},stat:(e,t)=>{var r=eh.lookupPath(e,{follow:!t}).node;if(!r)throw new eh.ErrnoError(44);if(!r.node_ops.getattr)throw new eh.ErrnoError(63);return r.node_ops.getattr(r)},lstat:e=>eh.stat(e,!0),chmod:(e,t,r)=>{var n;if(!(n="string"==typeof e?eh.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new eh.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod:(e,t)=>{eh.chmod(e,t,!0)},fchmod:(e,t)=>{var r=eh.getStream(e);if(!r)throw new eh.ErrnoError(8);eh.chmod(r.node,t)},chown:(e,t,r,n)=>{var o;if(!(o="string"==typeof e?eh.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new eh.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(e,t,r)=>{eh.chown(e,t,r,!0)},fchown:(e,t,r)=>{var n=eh.getStream(e);if(!n)throw new eh.ErrnoError(8);eh.chown(n.node,t,r)},truncate:(e,t)=>{if(t<0)throw new eh.ErrnoError(28);if(!(r="string"==typeof e?eh.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new eh.ErrnoError(63);if(eh.isDir(r.mode))throw new eh.ErrnoError(31);if(!eh.isFile(r.mode))throw new eh.ErrnoError(28);var r,n=eh.nodePermissions(r,"w");if(n)throw new eh.ErrnoError(n);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate:(e,t)=>{var r=eh.getStream(e);if(!r)throw new eh.ErrnoError(8);if(0==(2097155&r.flags))throw new eh.ErrnoError(28);eh.truncate(r.node,t)},utime:(e,t,r)=>{var n=eh.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,r)})},open:(e,t,r)=>{if(""===e)throw new eh.ErrnoError(44);if(r=void 0===r?438:r,r=64&(t="string"==typeof t?eh.modeStringToFlags(t):t)?4095&r|32768:0,"object"==typeof e)n=e;else{e=es.normalize(e);try{n=eh.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var n,o=!1;if(64&t){if(n){if(128&t)throw new eh.ErrnoError(20)}else n=eh.mknod(e,r,0),o=!0}if(!n)throw new eh.ErrnoError(44);if(eh.isChrdev(n.mode)&&(t&=-513),65536&t&&!eh.isDir(n.mode))throw new eh.ErrnoError(54);if(!o){var s=eh.mayOpen(n,t);if(s)throw new eh.ErrnoError(s)}512&t&&!o&&eh.truncate(n,0),t&=-131713;var a=eh.createStream({node:n,path:eh.getPath(n),flags:t,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return a.stream_ops.open&&a.stream_ops.open(a),!i.logReadFiles||1&t||(eh.readFiles||(eh.readFiles={}),e in eh.readFiles||(eh.readFiles[e]=1)),a},close:e=>{if(eh.isClosed(e))throw new eh.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{eh.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek:(e,t,r)=>{if(eh.isClosed(e))throw new eh.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new eh.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new eh.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,r),e.ungotten=[],e.position},read:(e,t,r,n,o)=>{if(n<0||o<0)throw new eh.ErrnoError(28);if(eh.isClosed(e)||1==(2097155&e.flags))throw new eh.ErrnoError(8);if(eh.isDir(e.node.mode))throw new eh.ErrnoError(31);if(!e.stream_ops.read)throw new eh.ErrnoError(28);var i=void 0!==o;if(i){if(!e.seekable)throw new eh.ErrnoError(70)}else o=e.position;var s=e.stream_ops.read(e,t,r,n,o);return i||(e.position+=s),s},write:(e,t,r,n,o,i)=>{if(n<0||o<0)throw new eh.ErrnoError(28);if(eh.isClosed(e)||0==(2097155&e.flags))throw new eh.ErrnoError(8);if(eh.isDir(e.node.mode))throw new eh.ErrnoError(31);if(!e.stream_ops.write)throw new eh.ErrnoError(28);e.seekable&&1024&e.flags&&eh.llseek(e,0,2);var s=void 0!==o;if(s){if(!e.seekable)throw new eh.ErrnoError(70)}else o=e.position;var a=e.stream_ops.write(e,t,r,n,o,i);return s||(e.position+=a),a},allocate:(e,t,r)=>{if(eh.isClosed(e))throw new eh.ErrnoError(8);if(t<0||r<=0)throw new eh.ErrnoError(28);if(0==(2097155&e.flags))throw new eh.ErrnoError(8);if(!eh.isFile(e.node.mode)&&!eh.isDir(e.node.mode))throw new eh.ErrnoError(43);if(!e.stream_ops.allocate)throw new eh.ErrnoError(138);e.stream_ops.allocate(e,t,r)},mmap:(e,t,r,n,o)=>{if(0!=(2&n)&&0==(2&o)&&2!=(2097155&e.flags)||1==(2097155&e.flags))throw new eh.ErrnoError(2);if(!e.stream_ops.mmap)throw new eh.ErrnoError(43);return e.stream_ops.mmap(e,t,r,n,o)},msync:(e,t,r,n,o)=>e&&e.stream_ops.msync?e.stream_ops.msync(e,t,r,n,o):0,munmap:e=>0,ioctl:(e,t,r)=>{if(!e.stream_ops.ioctl)throw new eh.ErrnoError(59);return e.stream_ops.ioctl(e,t,r)},readFile:(e,t={})=>{if(t.flags=t.flags||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw Error('Invalid encoding type "'+t.encoding+'"');var r,n=eh.open(e,t.flags),o=eh.stat(e).size,i=new Uint8Array(o);return eh.read(n,i,0,o,0),"utf8"===t.encoding?r=T(i,0):"binary"===t.encoding&&(r=i),eh.close(n),r},writeFile:(e,t,r={})=>{r.flags=r.flags||577;var n=eh.open(e,r.flags,r.mode);if("string"==typeof t){var o=new Uint8Array(L(t)+1),i=O(t,o,0,o.length);eh.write(n,o,0,i,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw Error("Unsupported data type");eh.write(n,t,0,t.byteLength,void 0,r.canOwn)}eh.close(n)},cwd:()=>eh.currentPath,chdir:e=>{var t=eh.lookupPath(e,{follow:!0});if(null===t.node)throw new eh.ErrnoError(44);if(!eh.isDir(t.node.mode))throw new eh.ErrnoError(54);var r=eh.nodePermissions(t.node,"x");if(r)throw new eh.ErrnoError(r);eh.currentPath=t.path},createDefaultDirectories:()=>{eh.mkdir("/tmp"),eh.mkdir("/home"),eh.mkdir("/home/web_user")},createDefaultDevices:()=>{eh.mkdir("/dev"),eh.registerDevice(eh.makedev(1,3),{read:()=>0,write:(e,t,r,n,o)=>n}),eh.mkdev("/dev/null",eh.makedev(1,3)),el.register(eh.makedev(5,0),el.default_tty_ops),el.register(eh.makedev(6,0),el.default_tty1_ops),eh.mkdev("/dev/tty",eh.makedev(5,0)),eh.mkdev("/dev/tty1",eh.makedev(6,0));var e=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return()=>(crypto.getRandomValues(e),e[0])}if(y)try{var t=r(821);return()=>t.randomBytes(1)[0]}catch(e){}return()=>Z("randomDevice")}();eh.createDevice("/dev","random",e),eh.createDevice("/dev","urandom",e),eh.mkdir("/dev/shm"),eh.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{eh.mkdir("/proc");var e=eh.mkdir("/proc/self");eh.mkdir("/proc/self/fd"),eh.mount({mount:()=>{var t=eh.createNode(e,"fd",16895,73);return t.node_ops={lookup:(e,t)=>{var r=+t,n=eh.getStream(r);if(!n)throw new eh.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},t}},{},"/proc/self/fd")},createStandardStreams:()=>{i.stdin?eh.createDevice("/dev","stdin",i.stdin):eh.symlink("/dev/tty","/dev/stdin"),i.stdout?eh.createDevice("/dev","stdout",null,i.stdout):eh.symlink("/dev/tty","/dev/stdout"),i.stderr?eh.createDevice("/dev","stderr",null,i.stderr):eh.symlink("/dev/tty1","/dev/stderr"),eh.open("/dev/stdin",0),eh.open("/dev/stdout",1),eh.open("/dev/stderr",1)},ensureErrnoError:()=>{eh.ErrnoError||(eh.ErrnoError=function(e,t){this.node=t,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},eh.ErrnoError.prototype=Error(),eh.ErrnoError.prototype.constructor=eh.ErrnoError,[44].forEach(e=>{eh.genericErrors[e]=new eh.ErrnoError(e),eh.genericErrors[e].stack=""}))},staticInit:()=>{eh.ensureErrnoError(),eh.nameTable=Array(4096),eh.mount(ed,{},"/"),eh.createDefaultDirectories(),eh.createDefaultDevices(),eh.createSpecialDirectories(),eh.filesystems={MEMFS:ed}},init:(e,t,r)=>{eh.init.initialized=!0,eh.ensureErrnoError(),i.stdin=e||i.stdin,i.stdout=t||i.stdout,i.stderr=r||i.stderr,eh.createStandardStreams()},quit:()=>{eh.init.initialized=!1;for(var e=0;e{var r=0;return e&&(r|=365),t&&(r|=146),r},findObject:(e,t)=>{var r=eh.analyzePath(e,t);return r.exists?r.object:null},analyzePath:(e,t)=>{try{e=(n=eh.lookupPath(e,{follow:!t})).path}catch(e){}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=eh.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=es.basename(e),n=eh.lookupPath(e,{follow:!t}),r.exists=!0,r.path=n.path,r.object=n.node,r.name=n.node.name,r.isRoot="/"===n.path}catch(e){r.error=e.errno}return r},createPath:(e,t,r,n)=>{e="string"==typeof e?e:eh.getPath(e);for(var o=t.split("/").reverse();o.length;){var i=o.pop();if(i){var s=es.join2(e,i);try{eh.mkdir(s)}catch(e){}e=s}}return s},createFile:(e,t,r,n,o)=>{var i=es.join2("string"==typeof e?e:eh.getPath(e),t),s=eh.getMode(n,o);return eh.create(i,s)},createDataFile:(e,t,r,n,o,i)=>{var s=t;e&&(e="string"==typeof e?e:eh.getPath(e),s=t?es.join2(e,t):e);var a=eh.getMode(n,o),u=eh.create(s,a);if(r){if("string"==typeof r){for(var l=Array(r.length),c=0,f=r.length;c{var o=es.join2("string"==typeof e?e:eh.getPath(e),t),i=eh.getMode(!!r,!!n);eh.createDevice.major||(eh.createDevice.major=64);var s=eh.makedev(eh.createDevice.major++,0);return eh.registerDevice(s,{open:e=>{e.seekable=!1},close:e=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(e,t,n,o,i)=>{for(var s,a=0,u=0;u{for(var s=0;s{if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!a)throw Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=eu(a(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new eh.ErrnoError(29)}},createLazyFile:(e,t,r,n,o)=>{function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize,r=e/this.chunkSize|0;return this.getter(r)[t]}},i.prototype.setDataGetter=function(e){this.getter=e},i.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",r,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw Error("Couldn't load "+r+". Status: "+e.status);var t,n=Number(e.getResponseHeader("Content-length")),o=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,i=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,s=1048576;o||(s=n);var a=this;a.setDataGetter(e=>{var t=e*s,o=(e+1)*s-1;if(o=Math.min(o,n-1),void 0===a.chunks[e]&&(a.chunks[e]=((e,t)=>{if(e>t)throw Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>n-1)throw Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",r,!1),n!==s&&o.setRequestHeader("Range","bytes="+e+"-"+t),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw Error("Couldn't load "+r+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):eu(o.responseText||"",!0)})(t,o)),void 0===a.chunks[e])throw Error("doXHR failed!");return a.chunks[e]}),!i&&n||(s=n=1,s=n=this.getter(0).length,w("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=s,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!g)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var s=new i;Object.defineProperties(s,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var a={isDevice:!1,contents:s}}else a={isDevice:!1,url:r};var u=eh.createFile(e,t,a,n,o);a.contents?u.contents=a.contents:a.url&&(u.contents=null,u.url=a.url),Object.defineProperties(u,{usedBytes:{get:function(){return this.contents.length}}});var l={};function c(e,t,r,n,o){var i=e.node.contents;if(o>=i.length)return 0;var s=Math.min(i.length-o,n);if(i.slice)for(var a=0;a{var t=u.stream_ops[e];l[e]=function(){return eh.forceLoadFile(u),t.apply(null,arguments)}}),l.read=(e,t,r,n,o)=>(eh.forceLoadFile(u),c(e,t,r,n,o)),l.mmap=(e,t,r,n,o)=>{eh.forceLoadFile(u);var i=ec(t);if(!i)throw new eh.ErrnoError(48);return c(e,x,i,t,r),{ptr:i,allocated:!0}},u.stream_ops=l,u},createPreloadedFile:(e,t,r,n,o,i,s,a,l,c)=>{var f=t?ea.resolve(es.join2(e,t)):e;function d(r){function u(r){c&&c(),a||eh.createDataFile(e,t,r,n,o,l),i&&i(),J()}Browser.handledByPreloadPlugin(r,f,u,()=>{s&&s(),J()})||u(r)}Q(),"string"==typeof r?function(e,t,r,n){var o="al "+e;u(e,r=>{r||Z('Loading data file "'+e+'" failed (no arrayBuffer).'),t(new Uint8Array(r)),o&&J()},t=>{if(!r)throw'Loading data file "'+e+'" failed.';r()}),o&&Q()}(r,e=>d(e),s):d(r)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(e,t,r)=>{t=t||(()=>{}),r=r||(()=>{});var n=eh.indexedDB();try{var o=n.open(eh.DB_NAME(),eh.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=()=>{w("creating db"),o.result.createObjectStore(eh.DB_STORE_NAME)},o.onsuccess=()=>{var n=o.result.transaction([eh.DB_STORE_NAME],"readwrite"),i=n.objectStore(eh.DB_STORE_NAME),s=0,a=0,u=e.length;function l(){0==a?t():r()}e.forEach(e=>{var t=i.put(eh.analyzePath(e).object.contents,e);t.onsuccess=()=>{++s+a==u&&l()},t.onerror=()=>{a++,s+a==u&&l()}}),n.onerror=r},o.onerror=r},loadFilesFromDB:(e,t,r)=>{t=t||(()=>{}),r=r||(()=>{});var n=eh.indexedDB();try{var o=n.open(eh.DB_NAME(),eh.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=r,o.onsuccess=()=>{var n=o.result;try{var i=n.transaction([eh.DB_STORE_NAME],"readonly")}catch(e){return void r(e)}var s=i.objectStore(eh.DB_STORE_NAME),a=0,u=0,l=e.length;function c(){0==u?t():r()}e.forEach(e=>{var t=s.get(e);t.onsuccess=()=>{eh.analyzePath(e).exists&&eh.unlink(e),eh.createDataFile(es.dirname(e),es.basename(e),t.result,!0,!0,!0),++a+u==l&&c()},t.onerror=()=>{u++,a+u==l&&c()}}),i.onerror=r},o.onerror=r}},em={DEFAULT_POLLMASK:5,calculateAt:function(e,t,r){var n;if(es.isAbs(t))return t;if(n=-100===e?eh.cwd():em.getStreamFromFD(e).path,0==t.length){if(!r)throw new eh.ErrnoError(44);return n}return es.join2(n,t)},doStat:function(e,t,r){try{var n=e(t)}catch(e){if(e&&e.node&&es.normalize(t)!==es.normalize(eh.getPath(e.node)))return -54;throw e}return F[r>>2]=n.dev,F[r+8>>2]=n.ino,F[r+12>>2]=n.mode,D[r+16>>2]=n.nlink,F[r+20>>2]=n.uid,F[r+24>>2]=n.gid,F[r+28>>2]=n.rdev,V=[n.size>>>0,+Math.abs(U=n.size)>=1?U>0?(0|Math.min(+Math.floor(U/0x100000000),0xffffffff))>>>0:~~+Math.ceil((U-+(~~U>>>0))/0x100000000)>>>0:0],F[r+40>>2]=V[0],F[r+44>>2]=V[1],F[r+48>>2]=4096,F[r+52>>2]=n.blocks,V=[Math.floor(n.atime.getTime()/1e3)>>>0,+Math.abs(U=Math.floor(n.atime.getTime()/1e3))>=1?U>0?(0|Math.min(+Math.floor(U/0x100000000),0xffffffff))>>>0:~~+Math.ceil((U-+(~~U>>>0))/0x100000000)>>>0:0],F[r+56>>2]=V[0],F[r+60>>2]=V[1],D[r+64>>2]=0,V=[Math.floor(n.mtime.getTime()/1e3)>>>0,+Math.abs(U=Math.floor(n.mtime.getTime()/1e3))>=1?U>0?(0|Math.min(+Math.floor(U/0x100000000),0xffffffff))>>>0:~~+Math.ceil((U-+(~~U>>>0))/0x100000000)>>>0:0],F[r+72>>2]=V[0],F[r+76>>2]=V[1],D[r+80>>2]=0,V=[Math.floor(n.ctime.getTime()/1e3)>>>0,+Math.abs(U=Math.floor(n.ctime.getTime()/1e3))>=1?U>0?(0|Math.min(+Math.floor(U/0x100000000),0xffffffff))>>>0:~~+Math.ceil((U-+(~~U>>>0))/0x100000000)>>>0:0],F[r+88>>2]=V[0],F[r+92>>2]=V[1],D[r+96>>2]=0,V=[n.ino>>>0,+Math.abs(U=n.ino)>=1?U>0?(0|Math.min(+Math.floor(U/0x100000000),0xffffffff))>>>0:~~+Math.ceil((U-+(~~U>>>0))/0x100000000)>>>0:0],F[r+104>>2]=V[0],F[r+108>>2]=V[1],0},doMsync:function(e,t,r,n,o){var i=q.slice(e,e+r);eh.msync(t,i,o,r,n)},varargs:void 0,get:function(){return em.varargs+=4,F[em.varargs-4>>2]},getStr:function(e){return j(e)},getStreamFromFD:function(e){var t=eh.getStream(e);if(!t)throw new eh.ErrnoError(8);return t}};function ep(e,t){return t+2097152>>>0<4194305-!!e?(e>>>0)+0x100000000*t:NaN}function ev(e){return D[e>>2]+0x100000000*F[e+4>>2]}function eg(e){var t=L(e)+1,r=eC(t);return r&&O(e,x,r,t),r}function ey(e){try{return k.grow(e-S.byteLength+65535>>>16),B(k.buffer),1}catch(e){}}ef=y?()=>{var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:()=>performance.now();var eb={};function e_(){if(!e_.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:p||"./this.program"};for(var t in eb)void 0===eb[t]?delete e[t]:e[t]=eb[t];var r=[];for(var t in e)r.push(t+"="+e[t]);e_.strings=r}return e_.strings}function ew(e,t){e<128?t.push(e):t.push(e%128|128,e>>7)}var eE=[];function ek(e){var t=eE[e];return t||(e>=eE.length&&(eE.length=e+1),eE[e]=t=N.get(e)),t}var eS=void 0,ex=[];function eq(e,t){N.set(e,t),eE[e]=N.get(e)}function eM(e,t){if(eS||(eS=new WeakMap,function(e,t){if(eS)for(var r=0;r<0+t;r++){var n=ek(r);n&&eS.set(n,r)}}(0,N.length)),eS.has(e))return eS.get(e);var r=function(){if(ex.length)return ex.pop();try{N.grow(1)}catch(e){if(!(e instanceof RangeError))throw e;throw"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH."}return N.length-1}();try{eq(r,e)}catch(n){if(!(n instanceof TypeError))throw n;eq(r,function(e,t){if("function"==typeof WebAssembly.Function)return new WebAssembly.Function(function(e){for(var t={i:"i32",j:"i64",f:"f32",d:"f64",p:"i32"},r={parameters:[],results:"v"==e[0]?[]:[t[e[0]]]},n=1;n{var t=0;if(null!=e&&0!==e){var r=1+(e.length<<2);C(e,t=eI(r),r)}return t},array:e=>{var t=eI(e.length);return function(e,t){x.set(e,t)}(e,t),t}},s=eP(e),a=[],u=0;if(n)for(var l=0;l>1]=2,0;case 16:case 8:default:return -28;case 9:return F[eO()>>2]=28,-1}}catch(e){if(void 0===eh||!(e instanceof eh.ErrnoError))throw e;return-e.errno}},G:function(e,t){try{var r=em.getStreamFromFD(e);return em.doStat(eh.stat,r.path,t)}catch(e){if(void 0===eh||!(e instanceof eh.ErrnoError))throw e;return-e.errno}},l:function(e,t,r){try{var n=ep(t,r);return isNaN(n)?-61:(eh.ftruncate(e,n),0)}catch(e){if(void 0===eh||!(e instanceof eh.ErrnoError))throw e;return-e.errno}},B:function(e,t){try{if(0===t)return -28;var r=eh.cwd(),n=L(r)+1;return t>2];s=1e3*o+i/1e6,a=1e3*(o=ev(r+=16))+(i=F[r+8>>2])/1e6}else var s=Date.now(),a=s;return eh.utime(t,s,a),0}catch(e){if(void 0===eh||!(e instanceof eh.ErrnoError))throw e;return-e.errno}},e:function(){return Date.now()},i:function(e,t){var r=new Date(1e3*ev(e));F[t>>2]=r.getSeconds(),F[t+4>>2]=r.getMinutes(),F[t+8>>2]=r.getHours(),F[t+12>>2]=r.getDate(),F[t+16>>2]=r.getMonth(),F[t+20>>2]=r.getFullYear()-1900,F[t+24>>2]=r.getDay();var n=new Date(r.getFullYear(),0,1),o=(r.getTime()-n.getTime())/864e5|0;F[t+28>>2]=o,F[t+36>>2]=-60*r.getTimezoneOffset();var i=new Date(r.getFullYear(),6,1).getTimezoneOffset(),s=n.getTimezoneOffset(),a=0|(i!=s&&r.getTimezoneOffset()==Math.min(s,i));F[t+32>>2]=a},w:function(e,t,r,n,o,i){try{var s=em.getStreamFromFD(n),a=eh.mmap(s,e,o,t,r),u=a.ptr;return F[i>>2]=a.allocated,u}catch(e){if(void 0===eh||!(e instanceof eh.ErrnoError))throw e;return-e.errno}},x:function(e,t,r,n,o,i){try{var s=em.getStreamFromFD(o);2&r&&em.doMsync(e,s,t,n,i),eh.munmap(s)}catch(e){if(void 0===eh||!(e instanceof eh.ErrnoError))throw e;return-e.errno}},j:function e(t,r,n){e.called||(e.called=!0,function(e,t,r){var n=(new Date).getFullYear(),o=new Date(n,0,1),i=new Date(n,6,1),s=o.getTimezoneOffset(),a=i.getTimezoneOffset(),u=Math.max(s,a);function l(e){var t=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return t?t[1]:"GMT"}F[e>>2]=60*u,F[t>>2]=Number(s!=a);var c=l(o),f=l(i),d=eg(c),h=eg(f);a>2]=d,D[r+4>>2]=h):(D[r>>2]=h,D[r+4>>2]=d)}(t,r,n))},q:function(){return 0x80000000},d:ef,o:function(e,t,r){q.copyWithin(e,t,t+r)},c:function(e){var t,r=q.length,n=0x80000000;if((e>>>=0)>0x80000000)return!1;for(var o=1;o<=4;o*=2){var i=r*(1+.2/o);if(i=Math.min(i,e+0x6000000),ey(Math.min(n,(t=Math.max(e,i))+(65536-t%65536)%65536)))return!0}return!1},z:function(e,t){var r=0;return e_().forEach(function(n,o){var i=t+r;D[e+4*o>>2]=i,function(e,t,r){for(var n=0;n>0]=e.charCodeAt(n);x[t>>0]=0}(n,i),r+=n.length+1}),0},A:function(e,t){var r=e_();D[e>>2]=r.length;var n=0;return r.forEach(function(e){n+=e.length+1}),D[t>>2]=n,0},f:function(e){try{var t=em.getStreamFromFD(e);return eh.close(t),0}catch(e){if(void 0===eh||!(e instanceof eh.ErrnoError))throw e;return e.errno}},m:function(e,t){try{var r=em.getStreamFromFD(e),n=r.tty?2:eh.isDir(r.mode)?3:eh.isLink(r.mode)?7:4;return x[t>>0]=n,0}catch(e){if(void 0===eh||!(e instanceof eh.ErrnoError))throw e;return e.errno}},u:function(e,t,r,n){try{var o=function(e,t,r,n){for(var o=0,i=0;i>2],a=D[t+4>>2];t+=8;var u=eh.read(e,x,s,a,void 0);if(u<0)return -1;if(o+=u,u>2]=o,0}catch(e){if(void 0===eh||!(e instanceof eh.ErrnoError))throw e;return e.errno}},k:function(e,t,r,n,o){try{var i=ep(t,r);if(isNaN(i))return 61;var s=em.getStreamFromFD(e);return eh.llseek(s,i,n),V=[s.position>>>0,(U=s.position,+Math.abs(U)>=1?U>0?(0|Math.min(+Math.floor(U/0x100000000),0xffffffff))>>>0:~~+Math.ceil((U-+(~~U>>>0))/0x100000000)>>>0:0)],F[o>>2]=V[0],F[o+4>>2]=V[1],s.getdents&&0===i&&0===n&&(s.getdents=null),0}catch(e){if(void 0===eh||!(e instanceof eh.ErrnoError))throw e;return e.errno}},C:function(e){try{var t=em.getStreamFromFD(e);return t.stream_ops&&t.stream_ops.fsync?t.stream_ops.fsync(t):0}catch(e){if(void 0===eh||!(e instanceof eh.ErrnoError))throw e;return e.errno}},r:function(e,t,r,n){try{var o=function(e,t,r,n){for(var o=0,i=0;i>2],a=D[t+4>>2];t+=8;var u=eh.write(e,x,s,a,void 0);if(u<0)return -1;o+=u}return o}(em.getStreamFromFD(e),t,r);return D[n>>2]=o,0}catch(e){if(void 0===eh||!(e instanceof eh.ErrnoError))throw e;return e.errno}}},eO=(function(){var e={a:ej};function t(e,t){var r,n=e.exports;i.asm=n,B((k=i.asm.J).buffer),N=i.asm.Da,r=i.asm.K,X.unshift(r),J()}function r(e){t(e.instance)}function n(t){return(function(){if(!_&&(v||g)){if("function"==typeof fetch&&!et(H))return fetch(H,{credentials:"same-origin"}).then(function(e){if(!e.ok)throw"failed to load wasm binary file at '"+H+"'";return e.arrayBuffer()}).catch(function(){return er(H)});if(u)return new Promise(function(e,t){u(H,function(t){e(new Uint8Array(t))},t)})}return Promise.resolve().then(function(){return er(H)})})().then(function(t){return WebAssembly.instantiate(t,e)}).then(function(e){return e}).then(t,function(e){E("failed to asynchronously prepare wasm: "+e),Z(e)})}if(Q(),i.instantiateWasm)try{return i.instantiateWasm(e,t)}catch(e){return E("Module.instantiateWasm callback failed with error: "+e),!1}_||"function"!=typeof WebAssembly.instantiateStreaming||ee(H)||et(H)||y||"function"!=typeof fetch?n(r):fetch(H,{credentials:"same-origin"}).then(function(t){return WebAssembly.instantiateStreaming(t,e).then(r,function(e){return E("wasm streaming compile failed: "+e),E("falling back to ArrayBuffer instantiation"),n(r)})})}(),i.___wasm_call_ctors=function(){return(i.___wasm_call_ctors=i.asm.K).apply(null,arguments)},i._sqlite3_malloc=function(){return(i._sqlite3_malloc=i.asm.L).apply(null,arguments)},i._sqlite3_free=function(){return(i._sqlite3_free=i.asm.M).apply(null,arguments)},i.___errno_location=function(){return(eO=i.___errno_location=i.asm.N).apply(null,arguments)}),eC=(i._sqlite3_finalize=function(){return(i._sqlite3_finalize=i.asm.O).apply(null,arguments)},i._sqlite3_reset=function(){return(i._sqlite3_reset=i.asm.P).apply(null,arguments)},i._sqlite3_clear_bindings=function(){return(i._sqlite3_clear_bindings=i.asm.Q).apply(null,arguments)},i._sqlite3_value_blob=function(){return(i._sqlite3_value_blob=i.asm.R).apply(null,arguments)},i._sqlite3_value_text=function(){return(i._sqlite3_value_text=i.asm.S).apply(null,arguments)},i._sqlite3_value_bytes=function(){return(i._sqlite3_value_bytes=i.asm.T).apply(null,arguments)},i._sqlite3_value_double=function(){return(i._sqlite3_value_double=i.asm.U).apply(null,arguments)},i._sqlite3_value_int=function(){return(i._sqlite3_value_int=i.asm.V).apply(null,arguments)},i._sqlite3_value_type=function(){return(i._sqlite3_value_type=i.asm.W).apply(null,arguments)},i._sqlite3_result_blob=function(){return(i._sqlite3_result_blob=i.asm.X).apply(null,arguments)},i._sqlite3_result_double=function(){return(i._sqlite3_result_double=i.asm.Y).apply(null,arguments)},i._sqlite3_result_error=function(){return(i._sqlite3_result_error=i.asm.Z).apply(null,arguments)},i._sqlite3_result_int=function(){return(i._sqlite3_result_int=i.asm._).apply(null,arguments)},i._sqlite3_result_int64=function(){return(i._sqlite3_result_int64=i.asm.$).apply(null,arguments)},i._sqlite3_result_null=function(){return(i._sqlite3_result_null=i.asm.aa).apply(null,arguments)},i._sqlite3_result_text=function(){return(i._sqlite3_result_text=i.asm.ba).apply(null,arguments)},i._sqlite3_step=function(){return(i._sqlite3_step=i.asm.ca).apply(null,arguments)},i._sqlite3_column_count=function(){return(i._sqlite3_column_count=i.asm.da).apply(null,arguments)},i._sqlite3_data_count=function(){return(i._sqlite3_data_count=i.asm.ea).apply(null,arguments)},i._sqlite3_column_blob=function(){return(i._sqlite3_column_blob=i.asm.fa).apply(null,arguments)},i._sqlite3_column_bytes=function(){return(i._sqlite3_column_bytes=i.asm.ga).apply(null,arguments)},i._sqlite3_column_double=function(){return(i._sqlite3_column_double=i.asm.ha).apply(null,arguments)},i._sqlite3_column_text=function(){return(i._sqlite3_column_text=i.asm.ia).apply(null,arguments)},i._sqlite3_column_type=function(){return(i._sqlite3_column_type=i.asm.ja).apply(null,arguments)},i._sqlite3_column_name=function(){return(i._sqlite3_column_name=i.asm.ka).apply(null,arguments)},i._sqlite3_bind_blob=function(){return(i._sqlite3_bind_blob=i.asm.la).apply(null,arguments)},i._sqlite3_bind_double=function(){return(i._sqlite3_bind_double=i.asm.ma).apply(null,arguments)},i._sqlite3_bind_int=function(){return(i._sqlite3_bind_int=i.asm.na).apply(null,arguments)},i._sqlite3_bind_text=function(){return(i._sqlite3_bind_text=i.asm.oa).apply(null,arguments)},i._sqlite3_bind_parameter_index=function(){return(i._sqlite3_bind_parameter_index=i.asm.pa).apply(null,arguments)},i._sqlite3_sql=function(){return(i._sqlite3_sql=i.asm.qa).apply(null,arguments)},i._sqlite3_normalized_sql=function(){return(i._sqlite3_normalized_sql=i.asm.ra).apply(null,arguments)},i._sqlite3_errmsg=function(){return(i._sqlite3_errmsg=i.asm.sa).apply(null,arguments)},i._sqlite3_exec=function(){return(i._sqlite3_exec=i.asm.ta).apply(null,arguments)},i._sqlite3_prepare_v2=function(){return(i._sqlite3_prepare_v2=i.asm.ua).apply(null,arguments)},i._sqlite3_create_module_v2=function(){return(i._sqlite3_create_module_v2=i.asm.va).apply(null,arguments)},i._sqlite3_declare_vtab=function(){return(i._sqlite3_declare_vtab=i.asm.wa).apply(null,arguments)},i._sqlite3_changes=function(){return(i._sqlite3_changes=i.asm.xa).apply(null,arguments)},i._sqlite3_close_v2=function(){return(i._sqlite3_close_v2=i.asm.ya).apply(null,arguments)},i._sqlite3_create_function_v2=function(){return(i._sqlite3_create_function_v2=i.asm.za).apply(null,arguments)},i._sqlite3_open=function(){return(i._sqlite3_open=i.asm.Aa).apply(null,arguments)},i._malloc=function(){return(eC=i._malloc=i.asm.Ba).apply(null,arguments)}),eL=i._free=function(){return(eL=i._free=i.asm.Ca).apply(null,arguments)},eB=(i._RegisterExtensionFunctions=function(){return(i._RegisterExtensionFunctions=i.asm.Ea).apply(null,arguments)},i._emscripten_builtin_memalign=function(){return(eB=i._emscripten_builtin_memalign=i.asm.Fa).apply(null,arguments)}),eN=i.stackSave=function(){return(eN=i.stackSave=i.asm.Ga).apply(null,arguments)},eH=i.stackRestore=function(){return(eH=i.stackRestore=i.asm.Ha).apply(null,arguments)},eI=i.stackAlloc=function(){return(eI=i.stackAlloc=i.asm.Ia).apply(null,arguments)};function eU(e){function t(){eT||(eT=!0,i.calledRun=!0,R||(i.noFSInit||eh.init.initialized||eh.init(),eh.ignorePermissions=!1,el.init(),en(X),i.onRuntimeInitialized&&i.onRuntimeInitialized(),function(){var e;if(i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)e=i.postRun.shift(),G.unshift(e);en(G)}()))}e=e||m,$>0||(function(){var e;if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)e=i.preRun.shift(),W.unshift(e);en(W)}(),$>0||(i.setStatus?(i.setStatus("Running..."),setTimeout(function(){setTimeout(function(){i.setStatus("")},1),t()},1)):t()))}if(i.UTF8ToString=j,i.stringToUTF8=C,i.lengthBytesUTF8=L,i.stackAlloc=eI,i.stackSave=eN,i.stackRestore=eH,i.ccall=eR,i.cwrap=function(e,t,r,n){var o=(r=r||[]).every(e=>"number"===e||"boolean"===e);return"string"!==t&&o&&!n?eP(e):function(){return eR(e,t,r,arguments)}},i.addFunction=eM,i.setValue=ei,i.getValue=eo,Y=function e(){eT||eU(),eT||(Y=e)},i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();return eU(),i}))};e.exports=o,e.exports.default=o},720:(e,t,r)=>{"use strict";e.exports=r.p+"sql-wasm.wasm"},821:()=>{},905:()=>{},101:()=>{}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(r.exports,r,r.exports,__webpack_require__),r.loaded=!0,r.exports}__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),__webpack_require__.p="";var __webpack_exports__=__webpack_require__(630);return __webpack_exports__})()}); \ No newline at end of file diff --git a/docs/scripts/extract-docs-context.js b/docs/scripts/extract-docs-context.js index 2bd7f4d..cdc252f 100644 --- a/docs/scripts/extract-docs-context.js +++ b/docs/scripts/extract-docs-context.js @@ -1,6 +1,33 @@ const fs = require('fs/promises'); const path = require('path'); const { glob } = require('glob'); +const sqlite3 = require('better-sqlite3'); + +class EmbeddingPipeline { + static task = 'feature-extraction'; + static model = 'sauravpanda/gte-small-onnx'; + static instance = null; + + static async getInstance(progress_callback = null) { + if (this.instance === null) { + // Optionally set cache directory + const { pipeline, env } = await import('@xenova/transformers'); + this.instance = await pipeline(this.task, this.model, { progress_callback }); + } + return this.instance; + } +} + +async function generateEmbedding(text) { + try { + const extractor = await EmbeddingPipeline.getInstance(); + const output = await extractor(text, { pooling: 'mean', normalize: true }); + return Array.from(output.data); + } catch (error) { + console.error('Error generating embedding:', error); + return null; + } +} async function extractTextFromBlocks(blocks) { if (!Array.isArray(blocks)) { @@ -67,26 +94,47 @@ async function main() { const contextDir = path.join(process.cwd(), 'public', 'context'); await fs.mkdir(contextDir, { recursive: true }); + const dbPath = path.join(contextDir, 'docs.db'); + const db = sqlite3(dbPath); + + db.exec(` + CREATE TABLE IF NOT EXISTS documents ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + path TEXT NOT NULL, + content TEXT NOT NULL, + embedding BLOB, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP + ) + `); + + // Initialize the embedding model once + console.log('Initializing embedding model...'); + // const extractor = await pipeline('feature-extraction', 'sauravpanda/gte-small-onnx'); + const enDocsDir = path.join(process.cwd(), 'compiled', 'en'); const docFiles = await glob('**/*.json', { cwd: enDocsDir, ignore: '**/_meta.json' }); - let combinedContent = []; + db.prepare('DELETE FROM documents').run(); + const insert = db.prepare('INSERT INTO documents (path, content, embedding) VALUES (?, ?, ?)'); + + console.log('Processing documents and generating embeddings...'); for (const file of docFiles) { const fullPath = path.join(enDocsDir, file); const content = await processDocFile(fullPath); if (content) { - combinedContent.push(`[Document: ${file}]\n${content}\n-------------`); + const embedding = await generateEmbedding(content); + insert.run(file, content, embedding ? JSON.stringify(embedding) : null); + console.log(`Processed: ${file}`); } } - const outputPath = path.join(contextDir, 'en_docs.txt'); - await fs.writeFile(outputPath, combinedContent.join('\n')); - - console.log('Documentation context has been extracted successfully!'); + db.exec(`CREATE INDEX IF NOT EXISTS idx_embedding ON documents(embedding)`); + console.log('Documentation context and embeddings have been stored in SQLite database!'); + db.close(); } catch (error) { console.error('Error processing documentation:', error); process.exit(1); diff --git a/docs/src/app/aiSearch/page.tsx b/docs/src/app/aiSearch/page.tsx index 5e849e3..0239b37 100644 --- a/docs/src/app/aiSearch/page.tsx +++ b/docs/src/app/aiSearch/page.tsx @@ -1,6 +1,6 @@ "use client" -import { useState } from 'react' +import { useState, useCallback } from 'react' import { SearchHeader } from '@/components/aiSearch/SearchHeader' import { SearchBar } from '@/components/aiSearch/SearchBar' import { LegacyDocsToggle } from '@/components/aiSearch/LegacyDocsToggle' @@ -17,196 +17,294 @@ import { Source } from '@/types/Source' import AILoader from '@/components/aiSearch/AILoader' import { getHeaderConfig } from '@/lib/headerConfig' import { Header } from '@/components/layout/Header' +import { generateEmbedding } from '@/lib/aisearch/embeddings' +import { getDbWorker } from '@/lib/aisearch/dbWorker' + +function cosineSimilarity(a: number[], b: number[]): number { + if (a.some(isNaN) || b.some(isNaN)) { + console.error("NaN values detected in vectors:"); + console.error("Vector A NaN indices:", a.map((val, i) => isNaN(val) ? i : null).filter(x => x !== null)); + console.error("Vector B NaN indices:", b.map((val, i) => isNaN(val) ? i : null).filter(x => x !== null)); + throw new Error("Invalid vectors containing NaN values"); + } + + const dotProduct = a.reduce((sum, val, i) => sum + val * b[i], 0); + const magnitudeA = Math.sqrt(a.reduce((sum, val) => sum + val * val, 0)); + const magnitudeB = Math.sqrt(b.reduce((sum, val) => sum + val * val, 0)); + return dotProduct / (magnitudeA * magnitudeB); +} export default function Home() { - const [query, setQuery] = useState('') - const [aiResponse, setAiResponse] = useState('') - const [isLoading, setIsLoading] = useState(false) - const [error, setError] = useState(null) - const recommendedArticles = getRecommendedArticles() - const searchConfig = getSearchConfig() - const headerConfig = getHeaderConfig() - const config = getAkiradocsConfig() - const [sources, setSources] = useState([]) - - // If AI Search is disabled, show the disabled message - if (!config.navigation.header.items.find((item: any) => item.href === '/aiSearch')?.show) { - return ( -
-
-

AI Search is Disabled

-

- AI Search is currently disabled. To enable this feature, set "aiSearch": true in your configuration file. -

- -
-
- ) - } + const [query, setQuery] = useState('') + const [aiResponse, setAiResponse] = useState('') + const [loaderText, setLoaderText] = useState('Loading database ...') + const [isLoading, setIsLoading] = useState(false) + const [error, setError] = useState(null) + const recommendedArticles = getRecommendedArticles() + const searchConfig = getSearchConfig() + const headerConfig = getHeaderConfig() + const config = getAkiradocsConfig() + const [sources, setSources] = useState([]) + const handleGenerateEmbedding = useCallback(async (text: string) => { + try { + setIsLoading(true); + // console.log("Loading model for embedding"); + const embedding = await generateEmbedding(text, (progress) => {}); + return embedding; + } catch (error) { + console.error('Error generating embedding:', error); + throw error; + } + finally { + setLoaderText('Searching database for relevant information ...') + } + }, []); - const extractSources = (response: string): { cleanResponse: string, sources: Source[] } => { - // Split the response into parts - const parts = response.split('Sources:'); - if (parts.length < 2) { - return { cleanResponse: response, sources: [] }; + // If AI Search is disabled, show the disabled message + if (!config.navigation.header.items.find((item: any) => item.href === '/aiSearch')?.show) { + return ( +
+
+

AI Search is Disabled

+

+ AI Search is currently disabled. To enable this feature, set "aiSearch": true in your configuration file. +

+ +
+
+ ) } - const cleanResponse = parts[0].trim(); - const sourcesText = parts[1].trim(); - - // Extract sources from the text - const sources: Source[] = sourcesText - .split('\n') - .filter(line => line.trim().length > 0 && line.includes('.json')) // Only process non-empty lines containing .json - .map(line => ({ - title: line.trim().split('/').pop()?.replace('.json', '') || '', // Get the filename without extension - url: line.trim() - })); - - return { cleanResponse, sources }; - }; - - const handleSearch = async (e: React.FormEvent) => { - e.preventDefault() - setIsLoading(true) - setError(null) - setSources([]) - - try { - const contextResponse = await fetch('/context/en_docs.txt'); - if (!contextResponse.ok) { - throw new Error(`Failed to fetch context: ${contextResponse.status}`); - } - const contextData = await contextResponse.text(); - const docsContext = contextData; - - const engine = await CreateMLCEngine( - "Llama-3.2-1B-Instruct-q4f16_1-MLC", - { initProgressCallback: (progress: any) => console.log(progress) - }, - { - context_window_size: 100000, + const extractSources = (response: string): { cleanResponse: string, sources: Source[] } => { + // Split the response into parts + const parts = response.split('Sources:'); + if (parts.length < 2) { + return { cleanResponse: response, sources: [] }; } - ); - - const messages = [ - { - role: "system", - content: `You are a technical documentation assistant specialized in providing accurate, concise answers based on the official documentation. - Your responses should be: - 1. Direct and to the point - 2. Based strictly on the provided documentation context - 3. Include relevant code examples when available - 4. Written in a technical but clear style - - Documentation context: ${docsContext}` - }, - { - role: "user", - content: `Answer the following question using only the provided documentation context. + + const cleanResponse = parts[0].trim(); + const sourcesText = parts[1].trim(); + + // Extract sources from the text + const sources: Source[] = sourcesText + .split('\n') + .filter(line => line.trim().length > 0 && line.includes('.json')) // Only process non-empty lines containing .json + .map(line => ({ + title: line.trim().split('/').pop()?.replace('.json', '') || '', // Get the filename without extension + url: line.trim() + })); + + return { cleanResponse, sources }; + }; + + const handleSearch = async (e: React.FormEvent) => { + e.preventDefault() + setIsLoading(true) + setError(null) + setSources([]) + + const startTime = performance.now() + + try { + // Generate embedding for the query + const queryEmbedding = await handleGenerateEmbedding(query); + // console.log("Query embedding:", queryEmbedding) + // Get database worker + const worker = await getDbWorker(); + + // Get all documents + const allDocs = await worker.db.query(` + SELECT path, content, embedding + FROM documents + WHERE embedding IS NOT NULL + `); + + // Calculate similarity scores and filter results + const similarityThreshold = 0.5; + const scoredDocs = allDocs + .map((doc: any) => { + // Clean the embedding string and parse it + const cleanEmbeddingStr = doc.embedding.replace(/[\[\]]/g, ''); // Remove square brackets + const embeddingArray = cleanEmbeddingStr + .split(',') + .map((val: string) => { + const parsed = parseFloat(val.trim()); + if (isNaN(parsed)) { + console.error(`Invalid embedding value found: "${val}"`); + } + return parsed; + }); + + return { + ...doc, + similarity_score: cosineSimilarity(queryEmbedding, embeddingArray) + }; + }) + .filter((doc: any) => doc.similarity_score > similarityThreshold) + .sort((a: any, b: any) => b.similarity_score - a.similarity_score) + .slice(0, 5); + + console.log("RAG top 5 results:", scoredDocs); + + // If no relevant documents found, return early + if (scoredDocs.length === 0) { + setAiResponse("I cannot answer this question from the given documentation. The available content doesn't seem relevant enough to provide a accurate answer."); + setIsLoading(false); + return; + } + + setLoaderText('Loading the AI model ...') + + // Combine relevant documents into context + const docsContext = scoredDocs + .map((doc: any) => ` + Source: ${doc.path} + --- Content --- + ${doc.content} + --- End of Content --- + `) + .join('\n'); + + const engine = await CreateMLCEngine( + "Llama-3.2-1B-Instruct-q4f16_1-MLC", + { initProgressCallback: (progress: any) => { + console.log(progress) + setLoaderText(`Loading the AI model ${Math.round(progress.progress * 100)}% ...`) + } }, + { + context_window_size: 20000, + } + ); + + + + const engineLoadTime = performance.now() // Track engine load time + console.log(`Time taken for engine initialization: ${(engineLoadTime - startTime) / 1000}s`) + setLoaderText('Processing information and generating AI response ...') + const messages = [ + { + role: "system", + content: `You are a technical documentation assistant for AkiraDocs. Your purpose is to: +1. Provide accurate, helpful answers using ONLY the provided documentation +2. Stay positive and factual based on the documentation provided.` + }, + { + role: "user", + content: ` + Please provide a helpful answer which is short and concise to the following question using only the provided documentation. + Question: ${query} + + Answer the question using only the provided documentation. + + Do not make assumptions or add information not in the documentation. + + If relevant, include short code snippets. Only add code snippets if it is helpful to the question. + + Dont add any notes or comments to the answer. - Requirements for your response: - 1. If the answer isn't clearly supported by the documentation, say "I don't have enough information to answer this question accurately." - 2. Don't make assumptions or provide information not found in the documentation - 3. If relevant, include short code snippets to illustrate your answer. - 4. Only answer questions related to the Documentaion Context. - 5. Try to be concise and to the point. + Make sure the question is answered properly avoiding unnecessary information. + + Ensure the final output is in markdown format. Make sure it pretty and clean. + + Sources (if used): + - (<path>) - After your answer, if you used any sources from the documentation, list them in this format: - ------------- - Sources: - - <title> (<path>)` + Here is the documentation, only answer based on this information: + ${docsContext} + ` + } + ]; + + // console.log("Messages:", messages) + + const chunks = await engine.chat.completions.create({ + messages: messages as ChatCompletionMessageParam[], + stream: true, + stream_options: { include_usage: true }, + max_tokens: 300, + temperature: 0.3, + top_p: 0.95, + frequency_penalty: 0.5, + presence_penalty: 0.5, + }); + + let aiContent = ""; + for await (const chunk of chunks) { + const newContent = chunk.choices[0]?.delta.content || ""; + aiContent += newContent; + + // Process partial content for streaming + const { cleanResponse } = extractSources(aiContent); + setAiResponse(cleanResponse); + } + + // Only extract and set sources after streaming is complete + const { sources } = extractSources(aiContent); + setSources(sources); + + const endTime = performance.now() // Track total time + console.log(`Total time taken for AI search: ${(endTime - startTime) / 1000}s`) + + } catch (error) { + console.error('Search error:', error); + setError(error instanceof Error ? error.message : 'An error occurred'); + } finally { + setIsLoading(false); } - ]; - - console.log("messages", messages) - - const chunks = await engine.chat.completions.create({ - messages: messages as ChatCompletionMessageParam[], - stream: true, - stream_options: { include_usage: true } - }); - - let aiContent = ""; - for await (const chunk of chunks) { - const newContent = chunk.choices[0]?.delta.content || ""; - aiContent += newContent; - // Update the response in real-time - setAiResponse(aiContent); - } - - // Extract sources after the full response is received - const { cleanResponse, sources } = extractSources(aiContent); - setAiResponse(cleanResponse); - setSources(sources); - - } catch (error) { - console.error('Error during AI search:', error); - - // Check for WebGPU error - if (error instanceof Error && error.name === 'WebGPUNotAvailableError') { - setError('WebGPU is not yet supported on this browser. Please try using another browser.'); - } else { - setError('Sorry, there was an error processing your request.'); - } - setAiResponse(''); - } finally { - setIsLoading(false) } - } - - const handleBack = () => { - setAiResponse('') - } - - return ( - <div className="flex flex-col min-h-screen"> - <Header {...headerConfig} currentLocale={`en`} currentType={`aiSearch`}/> - <div className="min-h-screen py-12 px-4 sm:px-6 lg:px-8"> - - <div className="max-w-4xl mx-auto"> - <SearchHeader - logo={searchConfig.logo} - title={searchConfig.title} - description={searchConfig.description} - /> - <div className="flex flex-col sm:flex-row space-y-4 sm:space-y-0 sm:space-x-4 justify-center items-center mb-12"> - <SearchBar - query={query} - onQueryChange={setQuery} - onSubmit={handleSearch} - /> - <LegacyDocsToggle/> - </div> - <AnimatePresence> - {isLoading ? ( - <div className="flex flex-col justify-center items-center space-y-4 py-12"> - <AILoader /> - <p className="text-muted-foreground text-sm animate-pulse"> - Loading AI response... - </p> - </div> - ) : error ? ( - <div className="text-center p-4 rounded-lg bg-red-50 text-red-800"> - <p className="text-lg font-medium mb-2">Error</p> - <p>{error}</p> + const handleBack = () => { + setAiResponse('') + } + + return ( + <div className="flex flex-col min-h-screen"> + <Header {...headerConfig} currentLocale={`en`} currentType={`aiSearch`}/> + <div className="min-h-screen py-12 px-4 sm:px-6 lg:px-8"> + + <div className="max-w-4xl mx-auto"> + <SearchHeader + logo={searchConfig.logo} + title={searchConfig.title} + description={searchConfig.description} + /> + <div className="flex flex-col sm:flex-row space-y-4 sm:space-y-0 sm:space-x-4 justify-center items-center mb-12"> + <SearchBar + query={query} + onQueryChange={setQuery} + onSubmit={handleSearch} + /> + <LegacyDocsToggle/> + </div> + + <AnimatePresence> + {isLoading ? ( + <div className="flex flex-col justify-center items-center space-y-4 py-12"> + <AILoader /> + <p className="text-muted-foreground text-sm animate-pulse"> + {loaderText} + </p> + </div> + ) : error ? ( + <div className="text-center p-4 rounded-lg bg-red-50 text-red-800"> + <p className="text-lg font-medium mb-2">Error</p> + <p>{error}</p> + </div> + ) : aiResponse ? ( + <AIResponse + response={aiResponse} + sources={sources} + onBack={handleBack} + /> + ) : recommendedArticles && ( + <RecommendedArticles articles={recommendedArticles} /> + )} + </AnimatePresence> + </div> </div> - ) : aiResponse ? ( - <AIResponse - response={aiResponse} - sources={sources} - onBack={handleBack} - /> - ) : recommendedArticles && ( - <RecommendedArticles articles={recommendedArticles} /> - )} - </AnimatePresence> - </div> - </div> - </div> - ) + </div> + ) } diff --git a/docs/src/components/aiSearch/AIResponse.tsx b/docs/src/components/aiSearch/AIResponse.tsx index ca46310..e78f31f 100644 --- a/docs/src/components/aiSearch/AIResponse.tsx +++ b/docs/src/components/aiSearch/AIResponse.tsx @@ -8,6 +8,7 @@ import { AIResponseActions } from "./AIResponseActions" import { AIResponseSources } from "./AIResponseSources" import ReactMarkdown from 'react-markdown' import { Source } from "@/types/Source" +import { memo } from 'react' interface AIResponseProps { response: string @@ -15,6 +16,20 @@ interface AIResponseProps { onBack: () => void } +// Memoize the markdown component to prevent unnecessary re-renders +const MemoizedMarkdown = memo(({ content }: { content: string }) => ( + <ReactMarkdown + components={{ + pre({ children }) { + return <div className="not-prose">{children}</div> + } + }} + > + {content} + </ReactMarkdown> +)) +MemoizedMarkdown.displayName = 'MemoizedMarkdown' + export function AIResponse({ response, sources, onBack }: AIResponseProps) { return ( <motion.div @@ -35,8 +50,21 @@ export function AIResponse({ response, sources, onBack }: AIResponseProps) { </Button> </CardHeader> <CardContent className="pt-6"> - <div className="prose dark:prose-invert max-w-none"> - <ReactMarkdown>{response}</ReactMarkdown> + <div className="prose dark:prose-invert max-w-none + prose-headings:font-semibold + prose-h1:text-xl prose-h1:mt-8 prose-h1:mb-4 + prose-h2:text-lg prose-h2:mt-6 prose-h2:mb-3 + prose-p:my-4 prose-p:leading-relaxed + prose-ul:space-y-2 prose-ul:list-disc prose-ul:pl-6 + prose-ol:space-y-2 prose-ol:list-decimal prose-ol:pl-6 + prose-li:pl-2 + [&_pre]:bg-secondary [&_pre]:p-4 [&_pre]:rounded-lg [&_pre]:my-4 + [&_code:not(pre_code)]:bg-secondary [&_code:not(pre_code)]:px-1.5 [&_code:not(pre_code)]:py-0.5 [&_code:not(pre_code)]:rounded-sm + [&_pre_code]:bg-transparent [&_pre_code]:p-0 [&_pre_code]:rounded-none + [&>*:first-child]:mt-0 + [&>p>strong]:block [&>p>strong]:mt-8 [&>p>strong]:mb-4 [&>p>strong]:text-lg + [&>p:has(>strong:only-child)]:m-0"> + <MemoizedMarkdown content={response} /> </div> </CardContent> <CardFooter className="flex flex-col items-start space-y-4"> diff --git a/docs/src/components/aiSearch/AIResponseSources.tsx b/docs/src/components/aiSearch/AIResponseSources.tsx index 5b160ed..d146d15 100644 --- a/docs/src/components/aiSearch/AIResponseSources.tsx +++ b/docs/src/components/aiSearch/AIResponseSources.tsx @@ -12,7 +12,7 @@ export function AIResponseSources({ sources }: AIResponseSourcesProps) { {sources.map((source, index) => ( <li key={index}> <a - href={source.url} + href={`${window.location.origin}/en/${source.url.replace('%20', '')}?utm_source=akiradocs`} target="_blank" rel="noopener noreferrer" className="text-sm text-indigo-600 dark:text-indigo-400 hover:underline" diff --git a/docs/src/lib/aisearch/dbWorker.ts b/docs/src/lib/aisearch/dbWorker.ts new file mode 100644 index 0000000..9e6a3b2 --- /dev/null +++ b/docs/src/lib/aisearch/dbWorker.ts @@ -0,0 +1,35 @@ +import { createDbWorker } from "sql.js-httpvfs"; +import { SplitFileConfig } from "sql.js-httpvfs/dist/sqlite.worker"; + +let dbInstance: any = null; + +export async function getDbWorker() { + if (dbInstance) return dbInstance; + + const workerUrl = new URL( + "sql.js-httpvfs/dist/sqlite.worker.js", + import.meta.url + ); + const wasmUrl = new URL( + "sql.js-httpvfs/dist/sql-wasm.wasm", + import.meta.url + ); + + const config: SplitFileConfig = { + from: "inline" as const, + config: { + serverMode: "full", + requestChunkSize: 4096, + url: "/context/docs.db" + } + }; + + const worker = await createDbWorker( + [config], + workerUrl.toString(), + wasmUrl.toString() + ); + + dbInstance = worker; + return dbInstance; +} \ No newline at end of file diff --git a/docs/src/lib/aisearch/embeddings.ts b/docs/src/lib/aisearch/embeddings.ts new file mode 100644 index 0000000..f93f006 --- /dev/null +++ b/docs/src/lib/aisearch/embeddings.ts @@ -0,0 +1,34 @@ +export interface ProgressCallback { + file: string; + progress: number; + loaded: number; + total: number; +} + +export async function generateEmbedding( + text: string, + onProgress?: (progress: ProgressCallback) => void +): Promise<number[]> { + return new Promise((resolve, reject) => { + const worker = new Worker( + new URL('./embeddings.worker.ts', import.meta.url), + { type: 'module' } + ); + + worker.addEventListener('message', (event) => { + if (event.data.status === 'progress' && onProgress) { + onProgress(event.data.progress); + } else if (event.data.status === 'complete') { + resolve(event.data.output); + worker.terminate(); + } + }); + + worker.addEventListener('error', (error) => { + reject(error); + worker.terminate(); + }); + + worker.postMessage({ text }); + }); +} \ No newline at end of file diff --git a/docs/src/lib/aisearch/embeddings.worker.ts b/docs/src/lib/aisearch/embeddings.worker.ts new file mode 100644 index 0000000..52b26d6 --- /dev/null +++ b/docs/src/lib/aisearch/embeddings.worker.ts @@ -0,0 +1,30 @@ +import { pipeline, ProgressCallback, type PipelineType } from "@huggingface/transformers"; + +class EmbeddingPipelineSingleton { + static task: PipelineType = 'feature-extraction'; + static model = 'sauravpanda/gte-small-onnx'; + static instance: Promise<any> | null = null; + + static async getInstance(progress_callback: ProgressCallback | null = null) { + this.instance ??= pipeline(this.task, this.model, { + progress_callback: progress_callback ?? undefined + }); + return this.instance; + } +} + +self.addEventListener('message', async (event) => { + const embedder = await EmbeddingPipelineSingleton.getInstance(x => { + self.postMessage({ status: 'progress', progress: x }); + }); + + const output = await embedder(event.data.text, { + pooling: 'mean', + normalize: true + }); + + self.postMessage({ + status: 'complete', + output: Array.from(output.data), + }); +}); \ No newline at end of file diff --git a/packages/akiradocs/compiled/manifest.json b/packages/akiradocs/compiled/manifest.json index 9b82fb7..d96ba5d 100644 --- a/packages/akiradocs/compiled/manifest.json +++ b/packages/akiradocs/compiled/manifest.json @@ -37,6 +37,7 @@ "fr/articles/welcome.json", "fr/docs/_meta.json", "fr/docs/getting-started/quickstart.json", - "fr/docs/introduction.json" + "fr/docs/introduction.json", + "manifest.json" ] } \ No newline at end of file diff --git a/packages/akiradocs/next.config.mjs b/packages/akiradocs/next.config.mjs index b73b4e6..798fa4a 100644 --- a/packages/akiradocs/next.config.mjs +++ b/packages/akiradocs/next.config.mjs @@ -1,14 +1,30 @@ /** @type {import('next').NextConfig} */ // import MillionLint from "@million/lint"; +import path from 'path'; +import { fileURLToPath } from 'url'; + +const __dirname = path.dirname(fileURLToPath(import.meta.url)); const nextConfig = { webpack: (config) => { config.module.rules.push({ test: /\.json$/, type: 'json', - }) + }); + + config.resolve.alias = { + ...config.resolve.alias, + "sharp$": false, + "onnxruntime-node$": false, + } + + config.resolve.alias['@huggingface/transformers'] = path.resolve(__dirname, 'node_modules/@huggingface/transformers'); + return config }, + experimental: { + esmExternals: true // Enable ES modules + }, // i18n: { // locales: ['en', 'es', 'fr', 'de'], // defaultLocale: 'en', diff --git a/packages/akiradocs/package-lock.json b/packages/akiradocs/package-lock.json index f48f35a..cd20ac1 100644 --- a/packages/akiradocs/package-lock.json +++ b/packages/akiradocs/package-lock.json @@ -14,6 +14,7 @@ "@dnd-kit/utilities": "^3.2.2", "@google/generative-ai": "^0.2.1", "@heroicons/react": "^2.1.5", + "@huggingface/transformers": "^3.2.3", "@mdx-js/loader": "^3.1.0", "@mdx-js/react": "^3.1.0", "@million/lint": "^1.0.12", @@ -36,7 +37,9 @@ "@radix-ui/react-toggle": "^1.1.0", "@radix-ui/react-toggle-group": "^1.1.0", "@radix-ui/react-tooltip": "^1.1.3", + "@xenova/transformers": "^2.17.2", "ai": "^4.0.2", + "better-sqlite3": "^11.7.0", "class-variance-authority": "^0.7.0", "clsx": "^2.1.1", "cross-spawn": "^7.0.6", @@ -56,7 +59,9 @@ "react-error-boundary": "^4.1.2", "react-markdown": "^9.0.1", "react-syntax-highlighter": "^15.6.1", + "sharp": "^0.33.5", "sonner": "^1.7.0", + "sql.js-httpvfs": "^0.8.12", "styled-components": "^6.1.13", "tailwind-merge": "^2.5.4", "tailwindcss-animate": "^1.0.7" @@ -529,7 +534,6 @@ }, "node_modules/@clack/prompts/node_modules/is-unicode-supported": { "version": "1.3.0", - "extraneous": true, "inBundle": true, "license": "MIT", "engines": { @@ -610,6 +614,16 @@ "react": ">=16.8.0" } }, + "node_modules/@emnapi/runtime": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.3.1.tgz", + "integrity": "sha512-kEBmG8KyqtxJZv+ygbEim+KCGtIq1fC22Ms3S4ziXmYKm8uyoLX0MHONVKwp+9opg390VaKRNt4a7A9NwmpNhw==", + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, "node_modules/@emotion/is-prop-valid": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-1.2.2.tgz", @@ -1118,6 +1132,27 @@ "hono": "^4" } }, + "node_modules/@huggingface/jinja": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@huggingface/jinja/-/jinja-0.3.2.tgz", + "integrity": "sha512-F2FvuIc+w1blGsaqJI/OErRbWH6bVJDCBI8Rm5D86yZ2wlwrGERsfIaru7XUv9eYC3DMP3ixDRRtF0h6d8AZcQ==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/@huggingface/transformers": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/@huggingface/transformers/-/transformers-3.2.3.tgz", + "integrity": "sha512-o7QZphrCH3a3m0kF/MaSNv3DMDZCpTifdZ9k4Lwl2n9QhY8JIGOOtZDVa+Wv2cqKU6iJm1SiCqDdZpo8H20c8g==", + "license": "Apache-2.0", + "dependencies": { + "@huggingface/jinja": "^0.3.2", + "onnxruntime-node": "1.20.1", + "onnxruntime-web": "1.21.0-dev.20241205-d27fecd3d3", + "sharp": "^0.33.5" + } + }, "node_modules/@humanwhocodes/config-array": { "version": "0.13.0", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", @@ -1174,6 +1209,28 @@ "@img/sharp-libvips-darwin-arm64": "1.0.4" } }, + "node_modules/@img/sharp-darwin-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.33.5.tgz", + "integrity": "sha512-fyHac4jIc1ANYGRDxtiqelIbdWkIuQaI84Mv45KvGRRxSAa7o7d1ZKAOBaYbnepLC1WqxfpimdeWfvqqSGwR2Q==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-x64": "1.0.4" + } + }, "node_modules/@img/sharp-libvips-darwin-arm64": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.0.4.tgz", @@ -1189,6 +1246,307 @@ "url": "https://opencollective.com/libvips" } }, + "node_modules/@img/sharp-libvips-darwin-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.0.4.tgz", + "integrity": "sha512-xnGR8YuZYfJGmWPvmlunFaWJsb9T/AO2ykoP3Fz/0X5XV2aoYBPkX6xqCQvUTKKiLddarLaxpzNe+b1hjeWHAQ==", + "cpu": [ + "x64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.0.5.tgz", + "integrity": "sha512-gvcC4ACAOPRNATg/ov8/MnbxFDJqf/pDePbBnuBDcjsI8PssmjoKMAz4LtLaVi+OnSb5FK/yIOamqDwGmXW32g==", + "cpu": [ + "arm" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.0.4.tgz", + "integrity": "sha512-9B+taZ8DlyyqzZQnoeIvDVR/2F4EbMepXMc/NdVbkzsJbzkUjhXv/70GQJ7tdLA4YJgNP25zukcxpX2/SueNrA==", + "cpu": [ + "arm64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-s390x": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.0.4.tgz", + "integrity": "sha512-u7Wz6ntiSSgGSGcjZ55im6uvTrOxSIS8/dgoVMoiGE9I6JAfU50yH5BoDlYA1tcuGS7g/QNtetJnxA6QEsCVTA==", + "cpu": [ + "s390x" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.0.4.tgz", + "integrity": "sha512-MmWmQ3iPFZr0Iev+BAgVMb3ZyC4KeFc3jFxnNbEPas60e1cIfevbtuyf9nDGIzOaW9PdnDciJm+wFFaTlj5xYw==", + "cpu": [ + "x64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-arm64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.0.4.tgz", + "integrity": "sha512-9Ti+BbTYDcsbp4wfYib8Ctm1ilkugkA/uscUn6UXK1ldpC1JjiXbLfFZtRlBhjPZ5o1NCLiDbg8fhUPKStHoTA==", + "cpu": [ + "arm64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.0.4.tgz", + "integrity": "sha512-viYN1KX9m+/hGkJtvYYp+CCLgnJXwiQB39damAO7WMdKWlIhmYTfHjwSbQeUK/20vY154mwezd9HflVFM1wVSw==", + "cpu": [ + "x64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-linux-arm": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.33.5.tgz", + "integrity": "sha512-JTS1eldqZbJxjvKaAkxhZmBqPRGmxgu+qFKSInv8moZ2AmT5Yib3EQ1c6gp493HvrvV8QgdOXdyaIBrhvFhBMQ==", + "cpu": [ + "arm" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm": "1.0.5" + } + }, + "node_modules/@img/sharp-linux-arm64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.33.5.tgz", + "integrity": "sha512-JMVv+AMRyGOHtO1RFBiJy/MBsgz0x4AWrT6QoEVVTyh1E39TrCUpTRI7mx9VksGX4awWASxqCYLCV4wBZHAYxA==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm64": "1.0.4" + } + }, + "node_modules/@img/sharp-linux-s390x": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.33.5.tgz", + "integrity": "sha512-y/5PCd+mP4CA/sPDKl2961b+C9d+vPAveS33s6Z3zfASk2j5upL6fXVPZi7ztePZ5CuH+1kW8JtvxgbuXHRa4Q==", + "cpu": [ + "s390x" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-s390x": "1.0.4" + } + }, + "node_modules/@img/sharp-linux-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.33.5.tgz", + "integrity": "sha512-opC+Ok5pRNAzuvq1AG0ar+1owsu842/Ab+4qvU879ippJBHvyY5n2mxF1izXqkPYlGuP/M556uh53jRLJmzTWA==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-x64": "1.0.4" + } + }, + "node_modules/@img/sharp-linuxmusl-arm64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.33.5.tgz", + "integrity": "sha512-XrHMZwGQGvJg2V/oRSUfSAfjfPxO+4DkiRh6p2AFjLQztWUuY/o8Mq0eMQVIY7HJ1CDQUJlxGGZRw1a5bqmd1g==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-arm64": "1.0.4" + } + }, + "node_modules/@img/sharp-linuxmusl-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.33.5.tgz", + "integrity": "sha512-WT+d/cgqKkkKySYmqoZ8y3pxx7lx9vVejxW/W4DOFMYVSkErR+w7mf2u8m/y4+xHe7yY9DAXQMWQhpnMuFfScw==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-x64": "1.0.4" + } + }, + "node_modules/@img/sharp-wasm32": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.33.5.tgz", + "integrity": "sha512-ykUW4LVGaMcU9lu9thv85CbRMAwfeadCJHRsg2GmeRa/cJxsVY9Rbd57JcMxBkKHag5U/x7TSBpScF4U8ElVzg==", + "cpu": [ + "wasm32" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT", + "optional": true, + "dependencies": { + "@emnapi/runtime": "^1.2.0" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-ia32": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.33.5.tgz", + "integrity": "sha512-T36PblLaTwuVJ/zw/LaH0PdZkRz5rd3SmMHX8GSmR7vtNSP5Z6bQkExdSK7xGWyxLw4sUknBuugTelgw2faBbQ==", + "cpu": [ + "ia32" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.33.5.tgz", + "integrity": "sha512-MpY/o8/8kj+EcnxwvrP4aTJSWw/aZ7JIGR4aBeZkZw5B7/Jn+tY9/VNwtcoGmdT7GfggGIU4kygOMSbYnOrAbg==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, "node_modules/@isaacs/cliui": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", @@ -1230,6 +1588,18 @@ "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, + "node_modules/@isaacs/fs-minipass": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@isaacs/fs-minipass/-/fs-minipass-4.0.1.tgz", + "integrity": "sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==", + "license": "ISC", + "dependencies": { + "minipass": "^7.0.4" + }, + "engines": { + "node": ">=18.0.0" + } + }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.5", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", @@ -2098,6 +2468,70 @@ "node": ">=12" } }, + "node_modules/@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", + "license": "BSD-3-Clause", + "dependencies": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "node_modules/@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==", + "license": "BSD-3-Clause" + }, "node_modules/@radix-ui/number": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@radix-ui/number/-/number-1.1.0.tgz", @@ -3331,6 +3765,12 @@ "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, + "node_modules/@types/long": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", + "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==", + "license": "MIT" + }, "node_modules/@types/mdast": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz", @@ -3610,22 +4050,109 @@ "integrity": "sha512-vG0XZo8AdTH9OE6VFRwAZldNc7qtJ/6NLGWak+BtENuEUXGZgFpihILPiBvKXvJ2nFu27XNGC6rKiwuaoMbYzQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.14.0", - "eslint-visitor-keys": "^3.4.3" + "@typescript-eslint/types": "8.14.0", + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==" + }, + "node_modules/@xenova/transformers": { + "version": "2.17.2", + "resolved": "https://registry.npmjs.org/@xenova/transformers/-/transformers-2.17.2.tgz", + "integrity": "sha512-lZmHqzrVIkSvZdKZEx7IYY51TK0WDrC8eR0c5IMnBsO8di8are1zzw8BlLhyO2TklZKLN5UffNGs1IJwT6oOqQ==", + "license": "Apache-2.0", + "dependencies": { + "@huggingface/jinja": "^0.2.2", + "onnxruntime-web": "1.14.0", + "sharp": "^0.32.0" + }, + "optionalDependencies": { + "onnxruntime-node": "1.14.0" + } + }, + "node_modules/@xenova/transformers/node_modules/@huggingface/jinja": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@huggingface/jinja/-/jinja-0.2.2.tgz", + "integrity": "sha512-/KPde26khDUIPkTGU82jdtTW9UAuvUTumCAbFs/7giR0SxsvZC4hru51PBvpijH6BVkHcROcvZM/lpy5h1jRRA==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/@xenova/transformers/node_modules/long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==", + "license": "Apache-2.0" + }, + "node_modules/@xenova/transformers/node_modules/onnxruntime-common": { + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/onnxruntime-common/-/onnxruntime-common-1.14.0.tgz", + "integrity": "sha512-3LJpegM2iMNRX2wUmtYfeX/ytfOzNwAWKSq1HbRrKc9+uqG/FsEA0bbKZl1btQeZaXhC26l44NWpNUeXPII7Ew==", + "license": "MIT" + }, + "node_modules/@xenova/transformers/node_modules/onnxruntime-node": { + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/onnxruntime-node/-/onnxruntime-node-1.14.0.tgz", + "integrity": "sha512-5ba7TWomIV/9b6NH/1x/8QEeowsb+jBEvFzU6z0T4mNsFwdPqXeFUM7uxC6QeSRkEbWu3qEB0VMjrvzN/0S9+w==", + "license": "MIT", + "optional": true, + "os": [ + "win32", + "darwin", + "linux" + ], + "dependencies": { + "onnxruntime-common": "~1.14.0" + } + }, + "node_modules/@xenova/transformers/node_modules/onnxruntime-web": { + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/onnxruntime-web/-/onnxruntime-web-1.14.0.tgz", + "integrity": "sha512-Kcqf43UMfW8mCydVGcX9OMXI2VN17c0p6XvR7IPSZzBf/6lteBzXHvcEVWDPmCKuGombl997HgLqj91F11DzXw==", + "license": "MIT", + "dependencies": { + "flatbuffers": "^1.12.0", + "guid-typescript": "^1.0.9", + "long": "^4.0.0", + "onnx-proto": "^4.0.4", + "onnxruntime-common": "~1.14.0", + "platform": "^1.3.6" + } + }, + "node_modules/@xenova/transformers/node_modules/sharp": { + "version": "0.32.6", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.32.6.tgz", + "integrity": "sha512-KyLTWwgcR9Oe4d9HwCwNM2l7+J0dUQwn/yf7S0EnTtb0eVS4RxO0eUSvxPtzT4F3SY+C4K6fqdv/DO27sJ/v/w==", + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "color": "^4.2.3", + "detect-libc": "^2.0.2", + "node-addon-api": "^6.1.0", + "prebuild-install": "^7.1.1", + "semver": "^7.5.4", + "simple-get": "^4.0.1", + "tar-fs": "^3.0.4", + "tunnel-agent": "^0.6.0" }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": ">=14.15.0" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" + "url": "https://opencollective.com/libvips" } }, - "node_modules/@ungap/structured-clone": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", - "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==" - }, "node_modules/@xstate/fsm": { "version": "1.6.5", "resolved": "https://registry.npmjs.org/@xstate/fsm/-/fsm-1.6.5.tgz", @@ -4047,6 +4574,12 @@ "node": ">= 0.4" } }, + "node_modules/b4a": { + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.7.tgz", + "integrity": "sha512-OnAYlL5b7LEkALw87fUVafQw5rVR9RjwGd4KUwNQ6DrrNmaVaUCgLipfVlzrPQ4tWOR9P0IXGNOx50jYCCdSJg==", + "license": "Apache-2.0" + }, "node_modules/babel-plugin-syntax-hermes-parser": { "version": "0.21.1", "resolved": "https://registry.npmjs.org/babel-plugin-syntax-hermes-parser/-/babel-plugin-syntax-hermes-parser-0.21.1.tgz", @@ -4070,6 +4603,52 @@ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, + "node_modules/bare-events": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.5.0.tgz", + "integrity": "sha512-/E8dDe9dsbLyh2qrZ64PEPadOQ0F4gbl1sUJOrmph7xOiIxfY8vwab/4bFLh4Y88/Hk/ujKcrQKc+ps0mv873A==", + "license": "Apache-2.0", + "optional": true + }, + "node_modules/bare-fs": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-2.3.5.tgz", + "integrity": "sha512-SlE9eTxifPDJrT6YgemQ1WGFleevzwY+XAP1Xqgl56HtcrisC2CHCZ2tq6dBpcH2TnNxwUEUGhweo+lrQtYuiw==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "bare-events": "^2.0.0", + "bare-path": "^2.0.0", + "bare-stream": "^2.0.0" + } + }, + "node_modules/bare-os": { + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/bare-os/-/bare-os-2.4.4.tgz", + "integrity": "sha512-z3UiI2yi1mK0sXeRdc4O1Kk8aOa/e+FNWZcTiPB/dfTWyLypuE99LibgRaQki914Jq//yAWylcAt+mknKdixRQ==", + "license": "Apache-2.0", + "optional": true + }, + "node_modules/bare-path": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/bare-path/-/bare-path-2.1.3.tgz", + "integrity": "sha512-lh/eITfU8hrj9Ru5quUp0Io1kJWIk1bTjzo7JH1P5dWmQ2EL4hFUlfI8FonAhSlgIfhn63p84CDY/x+PisgcXA==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "bare-os": "^2.1.0" + } + }, + "node_modules/bare-stream": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/bare-stream/-/bare-stream-2.6.1.tgz", + "integrity": "sha512-eVZbtKM+4uehzrsj49KtCy3Pbg7kO1pJ3SKZ1SFrIH/0pnj9scuGGgUlNDf/7qS8WKtGdiJY5Kyhs/ivYPTB/g==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "streamx": "^2.21.0" + } + }, "node_modules/base64-arraybuffer": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz", @@ -4079,6 +4658,37 @@ "node": ">= 0.6.0" } }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/better-sqlite3": { + "version": "11.7.0", + "resolved": "https://registry.npmjs.org/better-sqlite3/-/better-sqlite3-11.7.0.tgz", + "integrity": "sha512-mXpa5jnIKKHeoGzBrUJrc65cXFKcILGZpU3FXR0pradUEm9MA7UZz02qfEejaMcm9iXrSOCenwwYMJ/tZ1y5Ig==", + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "bindings": "^1.5.0", + "prebuild-install": "^7.1.1" + } + }, "node_modules/binary-extensions": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", @@ -4090,6 +4700,26 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/bindings": { + "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" + } + }, + "node_modules/bl": { + "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", + "readable-stream": "^3.4.0" + } + }, "node_modules/boxen": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/boxen/-/boxen-5.1.2.tgz", @@ -4202,6 +4832,30 @@ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, "node_modules/busboy": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", @@ -4382,6 +5036,15 @@ "node": ">= 6" } }, + "node_modules/chownr": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-3.0.0.tgz", + "integrity": "sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==", + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=18" + } + }, "node_modules/ci-info": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.1.0.tgz", @@ -4523,7 +5186,6 @@ "version": "4.2.3", "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz", "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==", - "optional": true, "dependencies": { "color-convert": "^2.0.1", "color-string": "^1.9.0" @@ -4552,7 +5214,6 @@ "version": "1.9.1", "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", - "optional": true, "dependencies": { "color-name": "^1.0.0", "simple-swizzle": "^0.2.2" @@ -4570,6 +5231,12 @@ "node": ">= 0.8" } }, + "node_modules/comlink": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/comlink/-/comlink-4.4.2.tgz", + "integrity": "sha512-OxGdvBmJuNKSCMO4NTl1L47VRp6xn2wG4F/2hYzB6tiCb709otOxtEYCSvK80PtjODfXXZu8ds+Nw5kVCjqd2g==", + "license": "Apache-2.0" + }, "node_modules/comma-separated-tokens": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz", @@ -4789,6 +5456,21 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/decompress-response": { + "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" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/deep-extend": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", @@ -4859,7 +5541,6 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz", "integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==", - "optional": true, "engines": { "node": ">=8" } @@ -4981,6 +5662,15 @@ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" }, + "node_modules/end-of-stream": { + "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-client": { "version": "6.6.2", "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-6.6.2.tgz", @@ -5812,6 +6502,15 @@ "node": ">=18.0.0" } }, + "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" + } + }, "node_modules/extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", @@ -5856,6 +6555,12 @@ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, + "node_modules/fast-fifo": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz", + "integrity": "sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==", + "license": "MIT" + }, "node_modules/fast-glob": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", @@ -5950,6 +6655,12 @@ "node": "^10.12.0 || >=12.0.0" } }, + "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==", + "license": "MIT" + }, "node_modules/fill-range": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", @@ -5996,6 +6707,12 @@ "node": "^10.12.0 || >=12.0.0" } }, + "node_modules/flatbuffers": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/flatbuffers/-/flatbuffers-1.12.0.tgz", + "integrity": "sha512-c7CZADjRcl6j0PlvFy0ZqXQ67qSEZfrVPynmnL+2zPc+NtMvrF8Y0QceMo7QqnSPc7+uWjUIAbvCQ5WIKlMVdQ==", + "license": "SEE LICENSE IN LICENSE.txt" + }, "node_modules/flatted": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", @@ -6091,6 +6808,12 @@ } } }, + "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==", + "license": "MIT" + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -6206,6 +6929,12 @@ "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" } }, + "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==", + "license": "MIT" + }, "node_modules/glob": { "version": "11.0.0", "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.0.tgz", @@ -6364,6 +7093,12 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/guid-typescript": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/guid-typescript/-/guid-typescript-1.0.9.tgz", + "integrity": "sha512-Y8T4vYhEfwJOTbouREvG+3XDsjr8E3kIr7uf+JZ0BYloFsttiHU0WfvANVsR7TxNUJa/WpCnw/Ino/p+DeBhBQ==", + "license": "ISC" + }, "node_modules/has-bigints": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", @@ -6653,6 +7388,26 @@ "ms": "^2.0.0" } }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, "node_modules/ignore": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", @@ -6709,8 +7464,7 @@ "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "node_modules/ini": { "version": "2.0.0", @@ -6789,8 +7543,7 @@ "node_modules/is-arrayish": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", - "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==", - "optional": true + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==" }, "node_modules/is-async-function": { "version": "2.0.0", @@ -7534,6 +8287,12 @@ "url": "https://tidelift.com/funding/github/npm/loglevel" } }, + "node_modules/long": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", + "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==", + "license": "Apache-2.0" + }, "node_modules/longest-streak": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-3.1.0.tgz", @@ -8390,38 +9149,159 @@ "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "license": "MIT", "dependencies": { - "mime-db": "1.52.0" + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mimic-response": { + "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" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/minizlib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-3.0.1.tgz", + "integrity": "sha512-umcy022ILvb5/3Djuu8LWeqUa8D68JaBzlttKeMWen48SjabqS3iY5w/vzeMzMUNhLDifyhbOwKDSznB1vvrwg==", + "license": "MIT", + "dependencies": { + "minipass": "^7.0.4", + "rimraf": "^5.0.5" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/minizlib/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" + } + }, + "node_modules/minizlib/node_modules/glob": { + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/minizlib/node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/minizlib/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "license": "ISC" + }, + "node_modules/minizlib/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" }, "engines": { - "node": ">= 0.6" + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, + "node_modules/minizlib/node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "license": "BlueOak-1.0.0", "dependencies": { - "brace-expansion": "^1.1.7" + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" }, "engines": { - "node": "*" - } - }, - "node_modules/minimist": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "node": ">=16 || 14 >=14.18" + }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/minipass": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", - "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", - "engines": { - "node": ">=16 || 14 >=14.17" + "node_modules/minizlib/node_modules/rimraf": { + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.10.tgz", + "integrity": "sha512-l0OE8wL34P4nJH/H2ffoaniAokM2qSmrtXHmlpvYr5AVVX8msAyW0l8NVJFDxlSK4u3Uh/f41cQheDVdnYijwQ==", + "license": "ISC", + "dependencies": { + "glob": "^10.3.7" + }, + "bin": { + "rimraf": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/mitt": { @@ -8430,6 +9310,27 @@ "integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==", "license": "MIT" }, + "node_modules/mkdirp": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", + "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", + "license": "MIT", + "bin": { + "mkdirp": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "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==", + "license": "MIT" + }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -8462,6 +9363,12 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, + "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==", + "license": "MIT" + }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -8557,6 +9464,24 @@ "node": "^10 || ^12 || >=14" } }, + "node_modules/node-abi": { + "version": "3.71.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.71.0.tgz", + "integrity": "sha512-SZ40vRiy/+wRTf21hxkkEjPJZpARzUMVcJoQse2EF8qkUWbbO2z7vd5oA/H6bVH6SZQ5STGcu0KRDS7biNRfxw==", + "license": "MIT", + "dependencies": { + "semver": "^7.3.5" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/node-addon-api": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-6.1.0.tgz", + "integrity": "sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA==", + "license": "MIT" + }, "node_modules/node-domexception": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", @@ -8732,11 +9657,93 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, "dependencies": { "wrappy": "1" } }, + "node_modules/onnx-proto": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/onnx-proto/-/onnx-proto-4.0.4.tgz", + "integrity": "sha512-aldMOB3HRoo6q/phyB6QRQxSt895HNNw82BNyZ2CMh4bjeKv7g/c+VpAFtJuEMVfYLMbRx61hbuqnKceLeDcDA==", + "license": "MIT", + "dependencies": { + "protobufjs": "^6.8.8" + } + }, + "node_modules/onnx-proto/node_modules/long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==", + "license": "Apache-2.0" + }, + "node_modules/onnx-proto/node_modules/protobufjs": { + "version": "6.11.4", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", + "integrity": "sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==", + "hasInstallScript": true, + "license": "BSD-3-Clause", + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/long": "^4.0.1", + "@types/node": ">=13.7.0", + "long": "^4.0.0" + }, + "bin": { + "pbjs": "bin/pbjs", + "pbts": "bin/pbts" + } + }, + "node_modules/onnxruntime-common": { + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/onnxruntime-common/-/onnxruntime-common-1.20.1.tgz", + "integrity": "sha512-YiU0s0IzYYC+gWvqD1HzLc46Du1sXpSiwzKb63PACIJr6LfL27VsXSXQvt68EzD3V0D5Bc0vyJTjmMxp0ylQiw==", + "license": "MIT" + }, + "node_modules/onnxruntime-node": { + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/onnxruntime-node/-/onnxruntime-node-1.20.1.tgz", + "integrity": "sha512-di/I4HDXRw+FLgq+TyHmQEDd3cEp9iFFZm0r4uJ1Wd7b/WE1VXtKWo8yemex347c6GNF/3Pv86ZfPhIWxORr0w==", + "hasInstallScript": true, + "license": "MIT", + "os": [ + "win32", + "darwin", + "linux" + ], + "dependencies": { + "onnxruntime-common": "1.20.1", + "tar": "^7.0.1" + } + }, + "node_modules/onnxruntime-web": { + "version": "1.21.0-dev.20241205-d27fecd3d3", + "resolved": "https://registry.npmjs.org/onnxruntime-web/-/onnxruntime-web-1.21.0-dev.20241205-d27fecd3d3.tgz", + "integrity": "sha512-neeC9mv1sFWjUFrTaDl7enufNxbtSSTwR5V2i35ga4yXWS6r1MbpUwWwD1X+VKANujbSG8M5pk/ohRAOm2QhMQ==", + "license": "MIT", + "dependencies": { + "flatbuffers": "^1.12.0", + "guid-typescript": "^1.0.9", + "long": "^5.2.3", + "onnxruntime-common": "1.21.0-dev.20241205-6ed77cc374", + "platform": "^1.3.6", + "protobufjs": "^7.2.4" + } + }, + "node_modules/onnxruntime-web/node_modules/onnxruntime-common": { + "version": "1.21.0-dev.20241205-6ed77cc374", + "resolved": "https://registry.npmjs.org/onnxruntime-common/-/onnxruntime-common-1.21.0-dev.20241205-6ed77cc374.tgz", + "integrity": "sha512-U4DGq/dZiboIEK0Zv1KUuWJesJ/txUALpWSXwI8kqOCSxe8GrI65xfRFeMbqYFhPVGAWZPsBpT1zo1s4ksrlrg==", + "license": "MIT" + }, "node_modules/openai": { "version": "4.76.0", "resolved": "https://registry.npmjs.org/openai/-/openai-4.76.0.tgz", @@ -8977,6 +9984,12 @@ "@napi-rs/nice": "^1.0.1" } }, + "node_modules/platform": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/platform/-/platform-1.3.6.tgz", + "integrity": "sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg==", + "license": "MIT" + }, "node_modules/possible-typed-array-names": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", @@ -9133,6 +10146,66 @@ "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==" }, + "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==", + "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", + "node-abi": "^3.3.0", + "pump": "^3.0.0", + "rc": "^1.2.7", + "simple-get": "^4.0.0", + "tar-fs": "^2.0.0", + "tunnel-agent": "^0.6.0" + }, + "bin": { + "prebuild-install": "bin.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/prebuild-install/node_modules/chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", + "license": "ISC" + }, + "node_modules/prebuild-install/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==", + "license": "MIT", + "dependencies": { + "chownr": "^1.1.1", + "mkdirp-classic": "^0.5.2", + "pump": "^3.0.0", + "tar-stream": "^2.1.4" + } + }, + "node_modules/prebuild-install/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", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -9191,6 +10264,40 @@ "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==", "license": "ISC" }, + "node_modules/protobufjs": { + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.4.0.tgz", + "integrity": "sha512-mRUWCc3KUU4w1jU8sGxICXH/gNS94DvI1gxqDvBzhj1JpcsimQkYiOJfwsPUykUI5ZaspFbSgmBLER8IrQ3tqw==", + "hasInstallScript": true, + "license": "BSD-3-Clause", + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/node": ">=13.7.0", + "long": "^5.0.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/pump": { + "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" + } + }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", @@ -9247,6 +10354,12 @@ } ] }, + "node_modules/queue-tick": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/queue-tick/-/queue-tick-1.0.1.tgz", + "integrity": "sha512-kJt5qhMxoszgU/62PLP1CJytzd2NKetjSRnyuj31fDd3Rlcz3fzlFdFLD1SItunPwyqEOkca6GbV612BWfaBag==", + "license": "MIT" + }, "node_modules/rc": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", @@ -9433,6 +10546,20 @@ "pify": "^2.3.0" } }, + "node_modules/readable-stream": { + "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", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", @@ -9946,6 +11073,26 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, "node_modules/safe-regex-test": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz", @@ -10063,7 +11210,7 @@ "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.33.5.tgz", "integrity": "sha512-haPVm1EkS9pgvHrQ/F3Xy+hgcuMV0Wm9vfIBSiwZ05k+xgb0PkBQpGsAA/oWdDobNaZTH5ppvHtzCFbnSEwHVw==", "hasInstallScript": true, - "optional": true, + "license": "Apache-2.0", "dependencies": { "color": "^4.2.3", "detect-libc": "^2.0.3", @@ -10145,11 +11292,55 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/simple-get": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz", + "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "decompress-response": "^6.0.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, "node_modules/simple-swizzle": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", - "optional": true, "dependencies": { "is-arrayish": "^0.3.1" } @@ -10227,6 +11418,15 @@ "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==" }, + "node_modules/sql.js-httpvfs": { + "version": "0.8.12", + "resolved": "https://registry.npmjs.org/sql.js-httpvfs/-/sql.js-httpvfs-0.8.12.tgz", + "integrity": "sha512-lcEBc2q0psFRfdCx8Di22oUIkkv5MUIaVO/fGCj/Jjx6YQDKVylQEcjd7NSSbmINHTRwVkm/vWP8uuevT7Rkkw==", + "license": "Apache-2.0", + "dependencies": { + "comlink": "^4.3.0" + } + }, "node_modules/streamsearch": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", @@ -10235,6 +11435,29 @@ "node": ">=10.0.0" } }, + "node_modules/streamx": { + "version": "2.21.1", + "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.21.1.tgz", + "integrity": "sha512-PhP9wUnFLa+91CPy3N6tiQsK+gnYyUNuk15S3YG/zjYE7RuPeCjJngqnzpC31ow0lzBHQ+QGO4cNJnd0djYUsw==", + "license": "MIT", + "dependencies": { + "fast-fifo": "^1.3.2", + "queue-tick": "^1.0.1", + "text-decoder": "^1.1.0" + }, + "optionalDependencies": { + "bare-events": "^2.2.0" + } + }, + "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" + } + }, "node_modules/string-width": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", @@ -10752,6 +11975,66 @@ "node": ">=6" } }, + "node_modules/tar": { + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/tar/-/tar-7.4.3.tgz", + "integrity": "sha512-5S7Va8hKfV7W5U6g3aYxXmlPoZVAwUMy9AOKyF2fVuZa2UD3qZjg578OrLRt8PcNN1PleVaL/5/yYATNL0ICUw==", + "license": "ISC", + "dependencies": { + "@isaacs/fs-minipass": "^4.0.0", + "chownr": "^3.0.0", + "minipass": "^7.1.2", + "minizlib": "^3.0.1", + "mkdirp": "^3.0.1", + "yallist": "^5.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/tar-fs": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.0.6.tgz", + "integrity": "sha512-iokBDQQkUyeXhgPYaZxmczGPhnhXZ0CmrqI+MOb/WFGS9DW5wnfrLgtjUJBvz50vQ3qfRwJ62QVoCFu8mPVu5w==", + "license": "MIT", + "dependencies": { + "pump": "^3.0.0", + "tar-stream": "^3.1.5" + }, + "optionalDependencies": { + "bare-fs": "^2.1.1", + "bare-path": "^2.1.0" + } + }, + "node_modules/tar-stream": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.7.tgz", + "integrity": "sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ==", + "license": "MIT", + "dependencies": { + "b4a": "^1.6.4", + "fast-fifo": "^1.2.0", + "streamx": "^2.15.0" + } + }, + "node_modules/tar/node_modules/yallist": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-5.0.0.tgz", + "integrity": "sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==", + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=18" + } + }, + "node_modules/text-decoder": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.2.3.tgz", + "integrity": "sha512-3/o9z3X0X0fTupwsYvR03pJ/DjWuqqrfwBgTQzdWDiQSm9KitAyz/9WqsT2JQW7KV2m+bC2ol/zqpW37NHxLaA==", + "license": "Apache-2.0", + "dependencies": { + "b4a": "^1.6.4" + } + }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -10931,6 +12214,18 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==" }, + "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" + }, + "engines": { + "node": "*" + } + }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -11610,8 +12905,7 @@ "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==", - "dev": true + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, "node_modules/write-file-atomic": { "version": "3.0.3", diff --git a/packages/akiradocs/package.json b/packages/akiradocs/package.json index a391fc2..6907677 100644 --- a/packages/akiradocs/package.json +++ b/packages/akiradocs/package.json @@ -20,6 +20,7 @@ "@dnd-kit/utilities": "^3.2.2", "@google/generative-ai": "^0.2.1", "@heroicons/react": "^2.1.5", + "@huggingface/transformers": "^3.2.3", "@mdx-js/loader": "^3.1.0", "@mdx-js/react": "^3.1.0", "@million/lint": "^1.0.12", @@ -42,7 +43,9 @@ "@radix-ui/react-toggle": "^1.1.0", "@radix-ui/react-toggle-group": "^1.1.0", "@radix-ui/react-tooltip": "^1.1.3", + "@xenova/transformers": "^2.17.2", "ai": "^4.0.2", + "better-sqlite3": "^11.7.0", "class-variance-authority": "^0.7.0", "clsx": "^2.1.1", "cross-spawn": "^7.0.6", @@ -62,7 +65,9 @@ "react-error-boundary": "^4.1.2", "react-markdown": "^9.0.1", "react-syntax-highlighter": "^15.6.1", + "sharp": "^0.33.5", "sonner": "^1.7.0", + "sql.js-httpvfs": "^0.8.12", "styled-components": "^6.1.13", "tailwind-merge": "^2.5.4", "tailwindcss-animate": "^1.0.7" diff --git a/packages/akiradocs/public/context/docs.db b/packages/akiradocs/public/context/docs.db new file mode 100644 index 0000000..f9adc30 Binary files /dev/null and b/packages/akiradocs/public/context/docs.db differ diff --git a/packages/akiradocs/public/sql.js-httpvfs/sql-wasm.wasm b/packages/akiradocs/public/sql.js-httpvfs/sql-wasm.wasm new file mode 100644 index 0000000..66d4a5d Binary files /dev/null and b/packages/akiradocs/public/sql.js-httpvfs/sql-wasm.wasm differ diff --git a/packages/akiradocs/public/sql.js-httpvfs/sqlite.worker.js b/packages/akiradocs/public/sql.js-httpvfs/sqlite.worker.js new file mode 100644 index 0000000..b905898 --- /dev/null +++ b/packages/akiradocs/public/sql.js-httpvfs/sqlite.worker.js @@ -0,0 +1,5 @@ +!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(this,function(){return(()=>{var __webpack_modules__={870:(e,t,r)=>{"use strict";r.r(t),r.d(t,{createEndpoint:()=>o,expose:()=>l,proxy:()=>g,proxyMarker:()=>n,releaseProxy:()=>i,transfer:()=>v,transferHandlers:()=>u,windowEndpoint:()=>y,wrap:()=>f});let n=Symbol("Comlink.proxy"),o=Symbol("Comlink.endpoint"),i=Symbol("Comlink.releaseProxy"),s=Symbol("Comlink.thrown"),a=e=>"object"==typeof e&&null!==e||"function"==typeof e,u=new Map([["proxy",{canHandle:e=>a(e)&&e[n],serialize(e){let{port1:t,port2:r}=new MessageChannel;return l(e,t),[r,[r]]},deserialize:e=>(e.start(),f(e))}],["throw",{canHandle:e=>a(e)&&s in e,serialize:({value:e})=>[e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[]],deserialize(e){if(e.isError)throw Object.assign(Error(e.value.message),e.value);throw e.value}}]]);function l(e,t=self){t.addEventListener("message",function r(n){let o;if(!n||!n.data)return;let{id:i,type:a,path:u}=Object.assign({path:[]},n.data),f=(n.data.argumentList||[]).map(_);try{let t=u.slice(0,-1).reduce((e,t)=>e[t],e),r=u.reduce((e,t)=>e[t],e);switch(a){case 0:o=r;break;case 1:t[u.slice(-1)[0]]=_(n.data.value),o=!0;break;case 2:o=r.apply(t,f);break;case 3:o=g(new r(...f));break;case 4:{let{port1:t,port2:r}=new MessageChannel;l(e,r),o=v(t,[t])}break;case 5:o=void 0}}catch(e){o={value:e,[s]:0}}Promise.resolve(o).catch(e=>({value:e,[s]:0})).then(e=>{let[n,o]=b(e);t.postMessage(Object.assign(Object.assign({},n),{id:i}),o),5===a&&(t.removeEventListener("message",r),c(t))})}),t.start&&t.start()}function c(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function f(e,t){return h(e,[],t)}function d(e){if(e)throw Error("Proxy has been released and is not useable")}function h(e,t=[],r=function(){}){let n=!1,s=new Proxy(r,{get(r,o){if(d(n),o===i)return()=>w(e,{type:5,path:t.map(e=>e.toString())}).then(()=>{c(e),n=!0});if("then"===o){if(0===t.length)return{then:()=>s};let r=w(e,{type:0,path:t.map(e=>e.toString())}).then(_);return r.then.bind(r)}return h(e,[...t,o])},set(r,o,i){d(n);let[s,a]=b(i);return w(e,{type:1,path:[...t,o].map(e=>e.toString()),value:s},a).then(_)},apply(r,i,s){d(n);let a=t[t.length-1];if(a===o)return w(e,{type:4}).then(_);if("bind"===a)return h(e,t.slice(0,-1));let[u,l]=m(s);return w(e,{type:2,path:t.map(e=>e.toString()),argumentList:u},l).then(_)},construct(r,o){d(n);let[i,s]=m(o);return w(e,{type:3,path:t.map(e=>e.toString()),argumentList:i},s).then(_)}});return s}function m(e){var t;let r=e.map(b);return[r.map(e=>e[0]),(t=r.map(e=>e[1]),Array.prototype.concat.apply([],t))]}let p=new WeakMap;function v(e,t){return p.set(e,t),e}function g(e){return Object.assign(e,{[n]:!0})}function y(e,t=self,r="*"){return{postMessage:(t,n)=>e.postMessage(t,r,n),addEventListener:t.addEventListener.bind(t),removeEventListener:t.removeEventListener.bind(t)}}function b(e){for(let[t,r]of u)if(r.canHandle(e)){let[n,o]=r.serialize(e);return[{type:3,name:t,value:n},o]}return[{type:0,value:e},p.get(e)||[]]}function _(e){switch(e.type){case 3:return u.get(e.name).deserialize(e.value);case 0:return e.value}}function w(e,t,r){return new Promise(n=>{let o=[,,,,].fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-");e.addEventListener("message",function t(r){r.data&&r.data.id&&r.data.id===o&&(e.removeEventListener("message",t),n(r.data))}),e.start&&e.start(),e.postMessage(Object.assign({id:o},t),r)})}},794:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createLazyFile=t.LazyUint8Array=void 0;class r{constructor(e){this.serverChecked=!1,this.chunks=[],this.totalFetchedBytes=0,this.totalRequests=0,this.readPages=[],this.readHeads=[],this.lastGet=-1,this._chunkSize=e.requestChunkSize,this.maxSpeed=Math.round((e.maxReadSpeed||5242880)/this._chunkSize),this.maxReadHeads=e.maxReadHeads??3,this.rangeMapper=e.rangeMapper,this.logPageReads=e.logPageReads??!1,e.fileLength&&(this._length=e.fileLength),this.requestLimiter=null==e.requestLimiter?e=>{}:e.requestLimiter}copyInto(e,t,r,n){if(n>=this.length)return 0;let o=n+(r=Math.min(this.length-n,r)),i=0;for(;i<r;){let r=n+i,s=r%this.chunkSize,a=r/this.chunkSize|0,u=Math.min(this.chunkSize,o-r),l=this.getChunk(a);0===s&&u===this.chunkSize||(l=l.subarray(s,s+u)),e.set(l,t+i),i+=l.length}return r}moveReadHead(e){for(let[t,r]of this.readHeads.entries()){let n=r.startChunk+r.speed,o=Math.min(this.maxSpeed,2*r.speed);if(e>=n&&e<n+o)return r.speed=o,r.startChunk=n,0!==t&&(this.readHeads.splice(t,1),this.readHeads.unshift(r)),r}let t={startChunk:e,speed:1};for(this.readHeads.unshift(t);this.readHeads.length>this.maxReadHeads;)this.readHeads.pop();return t}getChunk(e){let t=!0;if(void 0===this.chunks[e]){t=!1;let r=this.moveReadHead(e),n=r.speed,o=r.startChunk*this.chunkSize,i=(r.startChunk+n)*this.chunkSize-1;i=Math.min(i,this.length-1);let s=this.doXHR(o,i);for(let e=0;e<n;e++){let t=r.startChunk+e;if(e*this.chunkSize>=s.byteLength)break;let n=(e+1)*this.chunkSize>s.byteLength?s.byteLength-e*this.chunkSize:this.chunkSize;this.chunks[t]=new Uint8Array(s,e*this.chunkSize,n)}}if(void 0===this.chunks[e])throw Error("doXHR failed (bug)!");return this.logPageReads&&this.lastGet!=e&&(this.lastGet=e,this.readPages.push({pageno:e,wasCached:t,prefetch:t?0:this.readHeads[0].speed-1})),this.chunks[e]}checkServer(){var e=new XMLHttpRequest;let t=this.rangeMapper(0,0).url;if(e.open("HEAD",t,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw Error("Couldn't load "+t+". Status: "+e.status);var r=Number(e.getResponseHeader("Content-length")),n="bytes"===e.getResponseHeader("Accept-Ranges");let o=e.getResponseHeader("Content-Encoding");var i=o&&"identity"!==o;if(n||console.warn("Warning: The server did not respond with Accept-Ranges=bytes. It either does not support byte serving or does not advertise it (`Accept-Ranges: bytes` header missing), or your database is hosted on CORS and the server doesn't mark the accept-ranges header as exposed. This may lead to incorrect results.","(seen response headers:",e.getAllResponseHeaders(),")"),i&&console.warn(`Warning: The server responded with ${o} encoding to a HEAD request. Ignoring since it may not do so for Range HTTP requests, but this will lead to incorrect results otherwise since the ranges will be based on the compressed data instead of the uncompressed data.`),i&&(r=null),!this._length){if(!r)throw console.error("response headers",e.getAllResponseHeaders()),Error("Length of the file not known. It must either be supplied in the config or given by the HTTP server.");this._length=r}this.serverChecked=!0}get length(){return this.serverChecked||this.checkServer(),this._length}get chunkSize(){return this.serverChecked||this.checkServer(),this._chunkSize}doXHR(e,t){if(console.log(`[xhr of size ${(t+1-e)/1024} KiB @ ${e/1024} KiB]`),this.requestLimiter(t-e),this.totalFetchedBytes+=t-e,this.totalRequests++,e>t)throw Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>this.length-1)throw Error("only "+this.length+" bytes available! programmer error!");let{fromByte:r,toByte:n,url:o}=this.rangeMapper(e,t);var i=new XMLHttpRequest;if(i.open("GET",o,!1),this.length!==this.chunkSize&&i.setRequestHeader("Range","bytes="+r+"-"+n),i.responseType="arraybuffer",i.overrideMimeType&&i.overrideMimeType("text/plain; charset=x-user-defined"),i.send(null),!(i.status>=200&&i.status<300||304===i.status))throw Error("Couldn't load "+o+". Status: "+i.status);if(void 0!==i.response)return i.response;throw Error("xhr did not return uint8array")}}t.LazyUint8Array=r,t.createLazyFile=function(e,t,n,o,i,s){var a=new r(s),u={isDevice:!1,contents:a},l=e.createFile(t,n,u,o,i);l.contents=a,Object.defineProperties(l,{usedBytes:{get:function(){return this.contents.length}}});var c={};return Object.keys(l.stream_ops).forEach(function(t){var r=l.stream_ops[t];c[t]=function(){return e.forceLoadFile(l),r.apply(null,arguments)}}),c.read=function(t,r,n,o,i){return e.forceLoadFile(l),t.node.contents.copyInto(r,n,o,i)},l.stream_ops=c,l}},630:function(__unused_webpack_module,exports,__webpack_require__){"use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&__createBinding(t,e,r);return __setModuleDefault(t,e),t},__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.toObjects=void 0;let Comlink=__importStar(__webpack_require__(870)),sql_wasm_js_1=__importDefault(__webpack_require__(365)),sql_wasm_wasm_1=__importDefault(__webpack_require__(720)),lazyFile_1=__webpack_require__(794),vtab_1=__webpack_require__(457);function initTransferHandlers(e){Comlink.transferHandlers.set("WORKERSQLPROXIES",{canHandle:t=>{let r=t instanceof e.Database,n=t&&t.db&&t.db instanceof e.Database;return r||n},serialize(e){let{port1:t,port2:r}=new MessageChannel;return Comlink.expose(e,t),[r,[r]]},deserialize:e=>{}})}async function init(e){let t=await sql_wasm_js_1.default({locateFile:t=>e});return initTransferHandlers(t),t}function toObjects(e){return e.flatMap(e=>e.values.map(t=>{let r={};for(let n=0;n<e.columns.length;n++)r[e.columns[n]]=t[n];return r}))}async function fetchConfigs(e){return Promise.all(e.map(async e=>{if("jsonconfig"===e.from){let t=new URL(e.configUrl,location.href),r=await fetch(t.toString());if(!r.ok)throw console.error("httpvfs config error",await r.text()),Error(`Could not load httpvfs config: ${r.status}: ${r.statusText}`);let n=await r.json();return{from:"inline",config:"chunked"===n.serverMode?{...n,urlPrefix:new URL(n.urlPrefix,t).toString()}:{...n,url:new URL(n.url,t).toString()},virtualFilename:e.virtualFilename}}return e}))}sql_wasm_wasm_1.default,exports.toObjects=toObjects;let mod={db:null,inited:!1,sqljs:null,bytesRead:0,async SplitFileHttpDatabase(e,t,r,n=1/0){let o;if(this.inited)throw Error("sorry, only one db is supported right now");this.inited=!0,this.sqljs||(this.sqljs=init(e));let i=await this.sqljs;this.bytesRead=0;let s=e=>{if(this.bytesRead+e>n)throw this.bytesRead=0,new i.FS.ErrnoError(6);this.bytesRead+=e},a=new Map;for(let{config:e,virtualFilename:n}of(await fetchConfigs(t))){let t;let u="chunked"===e.serverMode?e.urlPrefix:e.url;console.log("constructing url database",u);let l=e.cacheBust?"?cb="+e.cacheBust:"";t="chunked"==e.serverMode?(t,r)=>{let n=t/e.serverChunkSize|0,o=t%e.serverChunkSize,i=o+(r-t);return{url:e.urlPrefix+String(n).padStart(e.suffixLength,"0")+l,fromByte:o,toByte:i}}:(t,r)=>({url:e.url+l,fromByte:t,toByte:r});let c=n||u.replace(/\//g,"_");r||(r=c,o=e),console.log("filename",c),console.log("constructing url database",u,"filename",c);let f=lazyFile_1.createLazyFile(i.FS,"/",c,!0,!0,{rangeMapper:t,requestChunkSize:e.requestChunkSize,fileLength:"chunked"===e.serverMode?e.databaseLengthBytes:void 0,logPageReads:!0,maxReadHeads:3,requestLimiter:s});a.set(c,f)}if(this.db=new i.CustomDatabase(r),o){let e=(await this.db.exec("pragma page_size; pragma cache_size=0"))[0].values[0][0];e!==o.requestChunkSize&&console.warn(`Chunk size does not match page size: pragma page_size = ${e} but chunkSize = ${o.requestChunkSize}`)}return this.db.lazyFiles=a,this.db.create_vtab(vtab_1.SeriesVtab),this.db.query=(...e)=>toObjects(this.db.exec(...e)),this.db},getResetAccessedPages(e){if(!this.db)return[];let t=this.db.lazyFiles.get(e||this.db.filename);if(!t)throw Error("unknown lazy file");let r=[...t.contents.readPages];return t.contents.readPages=[],r},getStats(e){let t=this.db;if(!t)return null;let r=t.lazyFiles.get(e||t.filename);if(!r)throw Error("unknown lazy file");return{filename:t.filename,totalBytes:r.contents.length,totalFetchedBytes:r.contents.totalFetchedBytes,totalRequests:r.contents.totalRequests}},async evalCode(code){return await eval(`(async function (db) { + ${code} + })`)(this.db)}};Comlink.expose(mod)},457:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.SeriesVtab=void 0,function(e){e[e.idx=0]="idx",e[e.id=1]="id",e[e.tagName=2]="tagName",e[e.textContent=3]="textContent",e[e.innerHTML=4]="innerHTML",e[e.outerHTML=5]="outerHTML",e[e.className=6]="className",e[e.parent=7]="parent",e[e.selector=8]="selector",e[e.querySelector=9]="querySelector"}(r||(r={}));let n=Object.keys(r).map(e=>r[e]).filter(e=>"string"==typeof e);function o(e){let t={};for(let n=0;n<e.length;n++)t[r[n]]=e[n];return t}function i(e){let t=new SharedArrayBuffer(1048576),r=new Int32Array(t,0,2);r[0]=1,self.postMessage({action:"eval",notify:t,request:e}),Atomics.wait(r,0,1);let n=new Uint8Array(t,8,r[1]).slice(),o=JSON.parse((new TextDecoder).decode(n));if("err"in o)throw Error(o.err);return o.ok}t.SeriesVtab=class{constructor(e,t){this.module=e,this.db=t,this.name="dom",this.iVersion=2,this.cursors=new Map,console.log("constructed vfs")}getCursor(e){let t=this.cursors.get(e);if(!t)throw Error("impl error");return t}xConnect(e,t,r,o,i,s){console.log("xconnect!!"),this.db.handleError(this.module.ccall("sqlite3_declare_vtab","number",["number","string"],[e,`create table x( + ${n.slice(0,-1).join(", ")} PRIMARY KEY + ) WITHOUT ROWID`]));let a=this.module._malloc(12);return this.module.setValue(i,a,"*"),0}xDisconnect(e){return this.module._free(e),0}xOpen(e,t){let r=this.module._malloc(4);return this.cursors.set(r,{elements:[],index:0,querySelector:""}),this.module.setValue(t,r,"*"),0}xClose(e){return this.module._free(e),0}xBestIndex(e,t){try{let e=this.module.getValue(t+0,"i32"),n=this.module.getValue(t+4,"i32"),o=64,i=!1;for(let s=0;s<e;s++){let e=n+12*s,a=this.module.getValue(e,"i32"),u=this.module.getValue(e+4,"i8");if(this.module.getValue(e+5,"i8")){if(u===o){if(a!==r.selector)throw Error("The match operator can only be applied to the selector column!");{i=!0;let e=this.module.getValue(t+16,"i32"),r=8;this.module.setValue(e+s*r,1,"i32")}}console.log(`constraint ${s}: ${r[a]} (op=${u})`)}}if(!i)throw Error("You must query the dom using `select ... from dom where selector MATCH <css-selector>`");let s=this.module.getValue(t+64,"i32");return this.module.setValue(t+20,s,"i32"),0}catch(t){return console.error("xbestindex",t),this.setVtabError(e,String(t)),21}}xFilter(e,t,o,s,a){if(console.log("xfilter",s),1!==s)return console.error("did not get a single argument to xFilter"),21;let u=this.module.extract_value(a+0),l=this.getCursor(e);l.querySelector=u;let c=t,f=n.filter(e=>c&1<<r[e]);return console.log("used columns",f),l.elements=i({type:"select",selector:u,columns:f}),0}xNext(e){return this.getCursor(e).index++,0}xEof(e){let t=this.getCursor(e);return+(t.index>=t.elements.length)}xColumn(e,t,n){let o=this.getCursor(e),i=o.elements[o.index];if(r[n]in i)this.module.set_return_value(t,i[r[n]]);else switch(n){case r.idx:this.module.set_return_value(t,o.index);break;case r.querySelector:this.module.set_return_value(t,o.querySelector);break;default:throw Error(`unknown column ${r[n]}`)}return 0}setVtabError(e,t){let r=this.module.lengthBytesUTF8(t)+1,n=this.module.sqlite3_malloc(r);console.log("writing error",t,r),this.module.stringToUTF8(t,n,r),this.module.setValue(e+8,n,"i32")}xUpdate(e,t,r,n){try{let[e,n,...s]=Array.from({length:t},(e,t)=>this.module.extract_value(r+4*t));if(e){if(e&&!n)console.log("DELETE",e),i({type:"delete",selector:e});else{if(e!==n)throw"The selector row can't be set";i({type:"update",value:o(s)})}}else console.assert(null===n),i({type:"insert",value:o(s)});return 0}catch(t){return this.setVtabError(e,String(t)),21}}xRowid(e,t){throw Error("xRowid not implemented")}xFindFunction(e,t,r,n,o){return"match"!==this.module.UTF8ToString(r)?0:(this.module.setValue(n,this.module.addFunction((e,t,r)=>{this.module.set_return_value(e,!0)},"viii"),"i32"),150)}}},365:(e,t,r)=>{e=r.nmd(e);var n=void 0,o=function(t){return n||(n=new Promise(function(n,o){var i,s=(i=void 0!==t?t:{}).onAbort;i.onAbort=function(e){o(Error(e)),s&&s(e)},i.postRun=i.postRun||[],i.postRun.push(function(){n(i)}),e=void 0,(i=void 0!==i?i:{}).onRuntimeInitialized=function(){var e=eI(4),t=i.cwrap,r=t("sqlite3_open","number",["string","number"]),n=(t("sqlite3_open_v2","number",["string","number","number","string"]),t("sqlite3_close_v2","number",["number"])),o=t("sqlite3_exec","number",["number","string","number","number","number"]),s=t("sqlite3_changes","number",["number"]),a=t("sqlite3_prepare_v2","number",["number","string","number","number","number"]),u=t("sqlite3_sql","string",["number"]),l=t("sqlite3_normalized_sql","string",["number"]),c=t("sqlite3_prepare_v2","number",["number","number","number","number","number"]),f=t("sqlite3_bind_text","number",["number","number","number","number","number"]),d=t("sqlite3_bind_blob","number",["number","number","number","number","number"]),h=t("sqlite3_bind_double","number",["number","number","number"]),m=t("sqlite3_bind_int","number",["number","number","number"]),p=t("sqlite3_bind_parameter_index","number",["number","string"]),v=t("sqlite3_step","number",["number"]),g=t("sqlite3_errmsg","string",["number"]),y=t("sqlite3_column_count","number",["number"]),b=t("sqlite3_data_count","number",["number"]),_=t("sqlite3_column_double","number",["number","number"]),w=t("sqlite3_column_text","string",["number","number"]),E=t("sqlite3_column_blob","number",["number","number"]),k=t("sqlite3_column_bytes","number",["number","number"]),S=t("sqlite3_column_type","number",["number","number"]),q=t("sqlite3_column_name","string",["number","number"]),M=t("sqlite3_reset","number",["number"]),F=t("sqlite3_clear_bindings","number",["number"]),D=t("sqlite3_finalize","number",["number"]),A=t("sqlite3_create_module_v2","number",["number","string","number","number","number"]),P=t("sqlite3_create_function_v2","number",["number","string","number","number","number","number","number","number","number"]),R=t("sqlite3_value_type","number",["number"]),z=t("sqlite3_value_bytes","number",["number"]),T=t("sqlite3_value_text","string",["number"]),B=t("sqlite3_value_blob","number",["number"]),N=t("sqlite3_value_double","number",["number"]),H=t("sqlite3_result_double","",["number","number"]),I=t("sqlite3_result_null","",["number"]),U=t("sqlite3_result_text","",["number","string","number","number"]),V=t("sqlite3_result_blob","",["number","number","number","number"]),W=t("sqlite3_result_int","",["number","number"]),X=t("sqlite3_result_error","",["number","string","number"]),G=t("sqlite3_malloc","number",["number"]);i.sqlite3_malloc=G;var $=t("RegisterExtensionFunctions","number",["number"]);function K(e,t){this.stmt=e,this.db=t,this.pos=1,this.allocatedmem=[]}function Y(e,t){this.db=t;var r=L(e)+1;if(this.sqlPtr=eC(r),null===this.sqlPtr)throw Error("Unable to allocate memory for the SQL string");C(e,this.sqlPtr,r),this.nextSqlPtr=this.sqlPtr,this.nextSqlString=null,this.activeStatement=null}function Q(t){this.filename="dbfile_"+(0xffffffff*Math.random()>>>0),null!=t&&eh.createDataFile("/",this.filename,t,!0,!0);let n=r(this.filename,e);this.db=eo(e,"i32"),this.handleError(n),$(this.db),this.statements={},this.functions={}}function J(t){this.filename=t;let n=r(this.filename,e);this.db=eo(e,"i32"),this.handleError(n),$(this.db),this.statements={},this.functions={}}K.prototype.bind=function(e){if(!this.stmt)throw"Statement closed";return this.reset(),Array.isArray(e)?this.bindFromArray(e):null==e||"object"!=typeof e||this.bindFromObject(e)},K.prototype.bind_=K.prototype.bind,K.prototype.step=function(){if(!this.stmt)throw"Statement closed";this.pos=1;var e=v(this.stmt);switch(e){case 100:return!0;case 101:return!1;default:throw this.db.handleError(e)}},K.prototype.getNumber=function(e){return null==e&&(e=this.pos,this.pos+=1),_(this.stmt,e)},K.prototype.getString=function(e){return null==e&&(e=this.pos,this.pos+=1),w(this.stmt,e)},K.prototype.getBlob=function(e){null==e&&(e=this.pos,this.pos+=1);for(var t=k(this.stmt,e),r=E(this.stmt,e),n=new Uint8Array(t),o=0;o<t;o+=1)n[o]=x[r+o];return n},K.prototype.get=function(e){null!=e&&this.bind(e)&&this.step();for(var t=[],r=b(this.stmt),n=0;n<r;n+=1)switch(S(this.stmt,n)){case 1:case 2:t.push(this.getNumber(n));break;case 3:t.push(this.getString(n));break;case 4:t.push(this.getBlob(n));break;default:t.push(null)}return t},K.prototype.getColumnNames=function(){for(var e=[],t=y(this.stmt),r=0;r<t;r+=1)e.push(q(this.stmt,r));return e},K.prototype.getAsObject=function(e){for(var t=this.get(e),r=this.getColumnNames(),n={},o=0;o<r.length;o+=1)n[r[o]]=t[o];return n},K.prototype.getSQL=function(){return u(this.stmt)},K.prototype.getNormalizedSQL=function(){return l(this.stmt)},K.prototype.run=function(e){return null!=e&&this.bind(e),this.step(),this.reset()},K.prototype.bindString=function(e,t){null==t&&(t=this.pos,this.pos+=1);var r=eu(e),n=eA(r,eD);return this.allocatedmem.push(n),this.db.handleError(f(this.stmt,t,n,r.length-1,0)),!0},K.prototype.bindBlob=function(e,t){null==t&&(t=this.pos,this.pos+=1);var r=eA(e,eD);return this.allocatedmem.push(r),this.db.handleError(d(this.stmt,t,r,e.length,0)),!0},K.prototype.bindNumber=function(e,t){null==t&&(t=this.pos,this.pos+=1);var r=e===(0|e)?m:h;return this.db.handleError(r(this.stmt,t,e)),!0},K.prototype.bindNull=function(e){return null==e&&(e=this.pos,this.pos+=1),0===d(this.stmt,e,0,0,0)},K.prototype.bindValue=function(e,t){switch(null==t&&(t=this.pos,this.pos+=1),typeof e){case"string":return this.bindString(e,t);case"number":case"boolean":return this.bindNumber(e+0,t);case"object":if(null===e)return this.bindNull(t);if(null!=e.length)return this.bindBlob(e,t)}throw"Wrong API use : tried to bind a value of an unknown type ("+e+")."},K.prototype.bindFromObject=function(e){var t=this;return Object.keys(e).forEach(function(r){var n=p(t.stmt,r);0!==n&&t.bindValue(e[r],n)}),!0},K.prototype.bindFromArray=function(e){for(var t=0;t<e.length;t+=1)this.bindValue(e[t],t+1);return!0},K.prototype.reset=function(){return this.freemem(),0===F(this.stmt)&&0===M(this.stmt)},K.prototype.freemem=function(){for(var e;void 0!==(e=this.allocatedmem.pop());)eL(e)},K.prototype.free=function(){var e;return this.freemem(),e=0===D(this.stmt),delete this.db.statements[this.stmt],this.stmt=0,e},Y.prototype.next=function(){if(null===this.sqlPtr)return{done:!0};if(null!==this.activeStatement&&(this.activeStatement.free(),this.activeStatement=null),!this.db.db)throw this.finalize(),Error("Database closed");var t=eN(),r=eI(4);ei(e,0,"i32"),ei(r,0,"i32");try{this.db.handleError(c(this.db.db,this.nextSqlPtr,-1,e,r)),this.nextSqlPtr=eo(r,"i32");var n=eo(e,"i32");return 0===n?(this.finalize(),{done:!0}):(this.activeStatement=new K(n,this.db),this.db.statements[n]=this.activeStatement,{value:this.activeStatement,done:!1})}catch(e){throw this.nextSqlString=j(this.nextSqlPtr),this.finalize(),e}finally{eH(t)}},Y.prototype.finalize=function(){eL(this.sqlPtr),this.sqlPtr=null},Y.prototype.getRemainingSQL=function(){return null!==this.nextSqlString?this.nextSqlString:j(this.nextSqlPtr)},"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator&&(Y.prototype[Symbol.iterator]=function(){return this}),Q.prototype.run=function(t,r){if(!this.db)throw"Database closed";if(r){var n=this.prepare(t,r);try{n.step()}finally{n.free()}}else this.handleError(o(this.db,t,0,0,e));return this},Q.prototype.exec=function(t,r){if(!this.db)throw"Database closed";var n,o,i,s=eN(),a=null;try{for(var u=(o=L(n=t)+1,i=eI(o),O(n,x,i,o),i),l=eI(4),f=[];0!==eo(u,"i8");){ei(e,0,"i32"),ei(l,0,"i32"),this.handleError(c(this.db,u,-1,e,l));var d=eo(e,"i32");if(u=eo(l,"i32"),0!==d){var h=null;for(a=new K(d,this),null!=r&&a.bind(r);a.step();)null===h&&(h={columns:a.getColumnNames(),values:[]},f.push(h)),h.values.push(a.get());a.free()}}return f}catch(e){throw a&&a.free(),e}finally{eH(s)}},Q.prototype.each=function(e,t,r,n){var o;"function"==typeof t&&(n=r,r=t,t=void 0),o=this.prepare(e,t);try{for(;o.step();)r(o.getAsObject())}finally{o.free()}if("function"==typeof n)return n()},Q.prototype.prepare=function(t,r){ei(e,0,"i32"),this.handleError(a(this.db,t,-1,e,0));var n=eo(e,"i32");if(0===n)throw"Nothing to prepare";var o=new K(n,this);return null!=r&&o.bind(r),this.statements[n]=o,o},Q.prototype.iterateStatements=function(e){return new Y(e,this)},Q.prototype.export=function(){Object.values(this.statements).forEach(function(e){e.free()}),Object.values(this.functions).forEach(eF),this.functions={},this.handleError(n(this.db));var t=eh.readFile(this.filename,{encoding:"binary"});return this.handleError(r(this.filename,e)),this.db=eo(e,"i32"),t},Q.prototype.close=function(){null!==this.db&&(Object.values(this.statements).forEach(function(e){e.free()}),Object.values(this.functions).forEach(eF),this.functions={},this.handleError(n(this.db)),eh.unlink("/"+this.filename),this.db=null)},Q.prototype.handleError=function(e){if(0===e)return null;throw Error("SQLite: "+(g(this.db)||"Code "+e))},Q.prototype.getRowsModified=function(){return s(this.db)},Q.prototype.create_function=function(e,t){Object.prototype.hasOwnProperty.call(this.functions,e)&&(eF(this.functions[e]),delete this.functions[e]);var r=eM(function(e,r,n){for(var o,s=[],a=0;a<r;a+=1)s.push(i.extract_value(n+4*a));try{o=t.apply(null,s)}catch(t){return void X(e,"JS threw: "+t,-1)}i.set_return_value(e,o)},"viii");return this.functions[e]=r,this.handleError(P(this.db,e,t.length,1,0,r,0,0,0)),this},i.extract_value=function(e){var t=eo(e,"i32"),r=R(t);return 1===r||2===r?N(t):3===r?T(t):4===r?function(e){for(var t=z(e),r=B(e),n=new Uint8Array(t),o=0;o<t;o+=1)n[o]=x[r+o];return n}(t):null},i.set_return_value=function(e,t){switch(typeof t){case"boolean":W(e,t?1:0);break;case"number":H(e,t);break;case"string":U(e,t,-1,-1);break;case"object":if(null===t)I(e);else if(null!=t.length){var r=eA(t,eD);V(e,r,t.length,-1),eL(r)}else X(e,"Wrong API use : tried to return a value of an unknown type ("+t+").",-1);break;default:console.warn("unknown sqlite result type: ",typeof t,t),I(e)}},Q.prototype.create_vtab=function(e){let t=new e(i,this),r={iVersion:null,xCreate:"ptr",xConnect:"ptr",xBestIndex:"ptr",xDisconnect:"ptr",xDestroy:"ptr",xOpen:"ptr",xClose:"ptr",xFilter:"ptr",xNext:"ptr",xEof:"ptr",xColumn:"ptr",xRowid:"ptr",xUpdate:"ptr",xBegin:"ptr",xSync:"ptr",xCommit:"ptr",xRollback:"ptr",xFindFunction:"ptr",xRename:"ptr",xSavepoint:"ptr",xRelease:"ptr",xRollbackTo:"ptr",xShadowName:"ptr"},n=eC(4*Object.keys(r).length),o=0;for(let e in r){let i=t[e]||0,s="i32";if(r[e]&&t[e]){let r=t[e].bind(t);i=eM(r,Array(1+r.length).fill("i").join("")),s="*"}ei(n+4*o,i,s),o++}this.handleError(A(this.db,t.name,n,0,0))},i.Database=Q,i.CustomDatabase=J,i.FS=eh,J.prototype=Object.create(Q.prototype)};var a,u,l,c,f,d,h=Object.assign({},i),m=[],p="./this.program",v="object"==typeof window,g="function"==typeof importScripts,y="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,b="";y?(b=g?r(101).dirname(b)+"/":"//",d=()=>{f||(c=r(905),f=r(101))},a=function(e,t){return d(),e=f.normalize(e),c.readFileSync(e,t?void 0:"utf8")},l=e=>{var t=a(e,!0);return t.buffer||(t=new Uint8Array(t)),t},u=(e,t,r)=>{d(),e=f.normalize(e),c.readFile(e,function(e,n){e?r(e):t(n.buffer)})},process.argv.length>1&&(p=process.argv[1].replace(/\\/g,"/")),m=process.argv.slice(2),e.exports=i,i.inspect=function(){return"[Emscripten Module object]"}):(v||g)&&(g?b=self.location.href:"undefined"!=typeof document&&document.currentScript&&(b=document.currentScript.src),b=0!==b.indexOf("blob:")?b.substr(0,b.replace(/[?#].*/,"").lastIndexOf("/")+1):"",a=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},g&&(l=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),u=(e,t,r)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?t(n.response):r()},n.onerror=r,n.send(null)});var _,w=i.print||console.log.bind(console),E=i.printErr||console.warn.bind(console);Object.assign(i,h),h=null,i.arguments&&(m=i.arguments),i.thisProgram&&(p=i.thisProgram),i.quit&&i.quit,i.wasmBinary&&(_=i.wasmBinary),i.noExitRuntime,"object"!=typeof WebAssembly&&Z("no native wasm support detected");var k,S,x,q,M,F,D,A,P,R=!1,z="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function T(e,t,r){for(var n=t+r,o=t;e[o]&&!(o>=n);)++o;if(o-t>16&&e.buffer&&z)return z.decode(e.subarray(t,o));for(var i="";t<o;){var s=e[t++];if(128&s){var a=63&e[t++];if(192!=(224&s)){var u=63&e[t++];if((s=224==(240&s)?(15&s)<<12|a<<6|u:(7&s)<<18|a<<12|u<<6|63&e[t++])<65536)i+=String.fromCharCode(s);else{var l=s-65536;i+=String.fromCharCode(55296|l>>10,56320|1023&l)}}else i+=String.fromCharCode((31&s)<<6|a)}else i+=String.fromCharCode(s)}return i}function j(e,t){return e?T(q,e,t):""}function O(e,t,r,n){if(!(n>0))return 0;for(var o=r,i=r+n-1,s=0;s<e.length;++s){var a=e.charCodeAt(s);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++s)),a<=127){if(r>=i)break;t[r++]=a}else if(a<=2047){if(r+1>=i)break;t[r++]=192|a>>6,t[r++]=128|63&a}else if(a<=65535){if(r+2>=i)break;t[r++]=224|a>>12,t[r++]=128|a>>6&63,t[r++]=128|63&a}else{if(r+3>=i)break;t[r++]=240|a>>18,t[r++]=128|a>>12&63,t[r++]=128|a>>6&63,t[r++]=128|63&a}}return t[r]=0,r-o}function C(e,t,r){return O(e,q,t,r)}function L(e){for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n<=127?t++:n<=2047?t+=2:n>=55296&&n<=57343?(t+=4,++r):t+=3}return t}function B(e){S=e,i.HEAP8=x=new Int8Array(e),i.HEAP16=M=new Int16Array(e),i.HEAP32=F=new Int32Array(e),i.HEAPU8=q=new Uint8Array(e),i.HEAPU16=new Uint16Array(e),i.HEAPU32=D=new Uint32Array(e),i.HEAPF32=A=new Float32Array(e),i.HEAPF64=P=new Float64Array(e)}i.INITIAL_MEMORY;var N,H,I,U,V,W=[],X=[],G=[],$=0,K=null,Y=null;function Q(e){$++,i.monitorRunDependencies&&i.monitorRunDependencies($)}function J(e){if($--,i.monitorRunDependencies&&i.monitorRunDependencies($),0==$&&(null!==K&&(clearInterval(K),K=null),Y)){var t=Y;Y=null,t()}}function Z(e){throw i.onAbort&&i.onAbort(e),E(e="Aborted("+e+")"),R=!0,e+=". Build with -sASSERTIONS for more info.",new WebAssembly.RuntimeError(e)}function ee(e){return e.startsWith("data:application/octet-stream;base64,")}function et(e){return e.startsWith("file://")}function er(e){try{if(e==H&&_)return new Uint8Array(_);if(l)return l(e);throw"both async and sync fetching of the wasm failed"}catch(e){Z(e)}}function en(e){for(;e.length>0;)e.shift()(i)}function eo(e,t="i8"){switch(t.endsWith("*")&&(t="*"),t){case"i1":case"i8":return x[e>>0];case"i16":return M[e>>1];case"i32":case"i64":return F[e>>2];case"float":return A[e>>2];case"double":return P[e>>3];case"*":return D[e>>2];default:Z("invalid type for getValue: "+t)}return null}function ei(e,t,r="i8"){switch(r.endsWith("*")&&(r="*"),r){case"i1":case"i8":x[e>>0]=t;break;case"i16":M[e>>1]=t;break;case"i32":F[e>>2]=t;break;case"i64":V=[t>>>0,+Math.abs(U=t)>=1?U>0?(0|Math.min(+Math.floor(U/0x100000000),0xffffffff))>>>0:~~+Math.ceil((U-+(~~U>>>0))/0x100000000)>>>0:0],F[e>>2]=V[0],F[e+4>>2]=V[1];break;case"float":A[e>>2]=t;break;case"double":P[e>>3]=t;break;case"*":D[e>>2]=t;break;default:Z("invalid type for setValue: "+r)}}ee(H="sql-wasm.wasm")||(I=H,H=i.locateFile?i.locateFile(I,b):b+I);var es={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,t)=>{for(var r=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},normalize:e=>{var t=es.isAbs(e),r="/"===e.substr(-1);return(e=es.normalizeArray(e.split("/").filter(e=>!!e),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=es.splitPath(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},basename:e=>{if("/"===e)return"/";var t=(e=(e=es.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return -1===t?e:e.substr(t+1)},join:function(){var e=Array.prototype.slice.call(arguments);return es.normalize(e.join("/"))},join2:(e,t)=>es.normalize(e+"/"+t)},ea={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:eh.cwd();if("string"!=typeof n)throw TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,t=es.isAbs(n)}return(t?"/":"")+(e=es.normalizeArray(e.split("/").filter(e=>!!e),!t).join("/"))||"."},relative:(e,t)=>{function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=ea.resolve(e).substr(1),t=ea.resolve(t).substr(1);for(var n=r(e.split("/")),o=r(t.split("/")),i=Math.min(n.length,o.length),s=i,a=0;a<i;a++)if(n[a]!==o[a]){s=a;break}var u=[];for(a=s;a<n.length;a++)u.push("..");return(u=u.concat(o.slice(s))).join("/")}};function eu(e,t,r){var n=Array(r>0?r:L(e)+1),o=O(e,n,0,n.length);return t&&(n.length=o),n}var el={ttys:[],init:function(){},shutdown:function(){},register:function(e,t){el.ttys[e]={input:[],output:[],ops:t},eh.registerDevice(e,el.stream_ops)},stream_ops:{open:function(e){var t=el.ttys[e.node.rdev];if(!t)throw new eh.ErrnoError(43);e.tty=t,e.seekable=!1},close:function(e){e.tty.ops.fsync(e.tty)},fsync:function(e){e.tty.ops.fsync(e.tty)},read:function(e,t,r,n,o){if(!e.tty||!e.tty.ops.get_char)throw new eh.ErrnoError(60);for(var i,s=0,a=0;a<n;a++){try{i=e.tty.ops.get_char(e.tty)}catch(e){throw new eh.ErrnoError(29)}if(void 0===i&&0===s)throw new eh.ErrnoError(6);if(null==i)break;s++,t[r+a]=i}return s&&(e.node.timestamp=Date.now()),s},write:function(e,t,r,n,o){if(!e.tty||!e.tty.ops.put_char)throw new eh.ErrnoError(60);try{for(var i=0;i<n;i++)e.tty.ops.put_char(e.tty,t[r+i])}catch(e){throw new eh.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:function(e){if(!e.input.length){var t=null;if(y){var r=Buffer.alloc(256),n=0;try{n=c.readSync(process.stdin.fd,r,0,256,-1)}catch(e){if(!e.toString().includes("EOF"))throw e;n=0}t=n>0?r.slice(0,n).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&null!==(t=readline())&&(t+="\n");if(!t)return null;e.input=eu(t,!0)}return e.input.shift()},put_char:function(e,t){null===t||10===t?(w(T(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync:function(e){e.output&&e.output.length>0&&(w(T(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,t){null===t||10===t?(E(T(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync:function(e){e.output&&e.output.length>0&&(E(T(e.output,0)),e.output=[])}}};function ec(e){e=function(e,t){return 65536*Math.ceil(e/65536)}(e);var t=eB(65536,e);return t?function(e,t){return q.fill(0,e,e+t),e}(t,e):0}var ef,ed={ops_table:null,mount:function(e){return ed.createNode(null,"/",16895,0)},createNode:function(e,t,r,n){if(eh.isBlkdev(r)||eh.isFIFO(r))throw new eh.ErrnoError(63);ed.ops_table||(ed.ops_table={dir:{node:{getattr:ed.node_ops.getattr,setattr:ed.node_ops.setattr,lookup:ed.node_ops.lookup,mknod:ed.node_ops.mknod,rename:ed.node_ops.rename,unlink:ed.node_ops.unlink,rmdir:ed.node_ops.rmdir,readdir:ed.node_ops.readdir,symlink:ed.node_ops.symlink},stream:{llseek:ed.stream_ops.llseek}},file:{node:{getattr:ed.node_ops.getattr,setattr:ed.node_ops.setattr},stream:{llseek:ed.stream_ops.llseek,read:ed.stream_ops.read,write:ed.stream_ops.write,allocate:ed.stream_ops.allocate,mmap:ed.stream_ops.mmap,msync:ed.stream_ops.msync}},link:{node:{getattr:ed.node_ops.getattr,setattr:ed.node_ops.setattr,readlink:ed.node_ops.readlink},stream:{}},chrdev:{node:{getattr:ed.node_ops.getattr,setattr:ed.node_ops.setattr},stream:eh.chrdev_stream_ops}});var o=eh.createNode(e,t,r,n);return eh.isDir(o.mode)?(o.node_ops=ed.ops_table.dir.node,o.stream_ops=ed.ops_table.dir.stream,o.contents={}):eh.isFile(o.mode)?(o.node_ops=ed.ops_table.file.node,o.stream_ops=ed.ops_table.file.stream,o.usedBytes=0,o.contents=null):eh.isLink(o.mode)?(o.node_ops=ed.ops_table.link.node,o.stream_ops=ed.ops_table.link.stream):eh.isChrdev(o.mode)&&(o.node_ops=ed.ops_table.chrdev.node,o.stream_ops=ed.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[t]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage:function(e,t){var r=e.contents?e.contents.length:0;if(!(r>=t)){t=Math.max(t,r*(r<1048576?2:1.125)>>>0),0!=r&&(t=Math.max(t,256));var n=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage:function(e,t){if(e.usedBytes!=t){if(0==t)e.contents=null,e.usedBytes=0;else{var r=e.contents;e.contents=new Uint8Array(t),r&&e.contents.set(r.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}}},node_ops:{getattr:function(e){var t={};return t.dev=eh.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,eh.isDir(e.mode)?t.size=4096:eh.isFile(e.mode)?t.size=e.usedBytes:eh.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr:function(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&ed.resizeFileStorage(e,t.size)},lookup:function(e,t){throw eh.genericErrors[44]},mknod:function(e,t,r,n){return ed.createNode(e,t,r,n)},rename:function(e,t,r){if(eh.isDir(e.mode)){var n;try{n=eh.lookupNode(t,r)}catch(e){}if(n)for(var o in n.contents)throw new eh.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=r,t.contents[r]=e,t.timestamp=e.parent.timestamp,e.parent=t},unlink:function(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir:function(e,t){var r=eh.lookupNode(e,t);for(var n in r.contents)throw new eh.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir:function(e){var t=[".",".."];for(var r in e.contents)e.contents.hasOwnProperty(r)&&t.push(r);return t},symlink:function(e,t,r){var n=ed.createNode(e,t,41471,0);return n.link=r,n},readlink:function(e){if(!eh.isLink(e.mode))throw new eh.ErrnoError(28);return e.link}},stream_ops:{read:function(e,t,r,n,o){var i=e.node.contents;if(o>=e.node.usedBytes)return 0;var s=Math.min(e.node.usedBytes-o,n);if(s>8&&i.subarray)t.set(i.subarray(o,o+s),r);else for(var a=0;a<s;a++)t[r+a]=i[o+a];return s},write:function(e,t,r,n,o,i){if(t.buffer===x.buffer&&(i=!1),!n)return 0;var s=e.node;if(s.timestamp=Date.now(),t.subarray&&(!s.contents||s.contents.subarray)){if(i)return s.contents=t.subarray(r,r+n),s.usedBytes=n,n;if(0===s.usedBytes&&0===o)return s.contents=t.slice(r,r+n),s.usedBytes=n,n;if(o+n<=s.usedBytes)return s.contents.set(t.subarray(r,r+n),o),n}if(ed.expandFileStorage(s,o+n),s.contents.subarray&&t.subarray)s.contents.set(t.subarray(r,r+n),o);else for(var a=0;a<n;a++)s.contents[o+a]=t[r+a];return s.usedBytes=Math.max(s.usedBytes,o+n),n},llseek:function(e,t,r){var n=t;if(1===r?n+=e.position:2===r&&eh.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new eh.ErrnoError(28);return n},allocate:function(e,t,r){ed.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap:function(e,t,r,n,o){if(!eh.isFile(e.node.mode))throw new eh.ErrnoError(43);var i,s,a=e.node.contents;if(2&o||a.buffer!==S){if((r>0||r+t<a.length)&&(a=a.subarray?a.subarray(r,r+t):Array.prototype.slice.call(a,r,r+t)),s=!0,!(i=ec(t)))throw new eh.ErrnoError(48);x.set(a,i)}else s=!1,i=a.byteOffset;return{ptr:i,allocated:s}},msync:function(e,t,r,n,o){if(!eh.isFile(e.node.mode))throw new eh.ErrnoError(43);return 2&o||ed.stream_ops.write(e,t,0,n,r,!1),0}}},eh={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(e,t={})=>{if(!(e=ea.resolve(eh.cwd(),e)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new eh.ErrnoError(32);for(var r=es.normalizeArray(e.split("/").filter(e=>!!e),!1),n=eh.root,o="/",i=0;i<r.length;i++){var s=i===r.length-1;if(s&&t.parent)break;if(n=eh.lookupNode(n,r[i]),o=es.join2(o,r[i]),eh.isMountpoint(n)&&(!s||s&&t.follow_mount)&&(n=n.mounted.root),!s||t.follow)for(var a=0;eh.isLink(n.mode);){var u=eh.readlink(o);if(o=ea.resolve(es.dirname(o),u),n=eh.lookupPath(o,{recurse_count:t.recurse_count+1}).node,a++>40)throw new eh.ErrnoError(32)}}return{path:o,node:n}},getPath:e=>{for(var t;;){if(eh.isRoot(e)){var r=e.mount.mountpoint;return t?"/"!==r[r.length-1]?r+"/"+t:r+t:r}t=t?e.name+"/"+t:e.name,e=e.parent}},hashName:(e,t)=>{for(var r=0,n=0;n<t.length;n++)r=(r<<5)-r+t.charCodeAt(n)|0;return(e+r>>>0)%eh.nameTable.length},hashAddNode:e=>{var t=eh.hashName(e.parent.id,e.name);e.name_next=eh.nameTable[t],eh.nameTable[t]=e},hashRemoveNode:e=>{var t=eh.hashName(e.parent.id,e.name);if(eh.nameTable[t]===e)eh.nameTable[t]=e.name_next;else for(var r=eh.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode:(e,t)=>{var r=eh.mayLookup(e);if(r)throw new eh.ErrnoError(r,e);for(var n=eh.hashName(e.id,t),o=eh.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===e.id&&i===t)return o}return eh.lookup(e,t)},createNode:(e,t,r,n)=>{var o=new eh.FSNode(e,t,r,n);return eh.hashAddNode(o),o},destroyNode:e=>{eh.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>49152==(49152&e),flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:e=>{var t=eh.flagModes[e];if(void 0===t)throw Error("Unknown file open mode: "+e);return t},flagsToPermissionString:e=>{var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:(e,t)=>eh.ignorePermissions||(!t.includes("r")||292&e.mode)&&(!t.includes("w")||146&e.mode)&&(!t.includes("x")||73&e.mode)?0:2,mayLookup:e=>eh.nodePermissions(e,"x")||(e.node_ops.lookup?0:2),mayCreate:(e,t)=>{try{return eh.lookupNode(e,t),20}catch(e){}return eh.nodePermissions(e,"wx")},mayDelete:(e,t,r)=>{try{n=eh.lookupNode(e,t)}catch(e){return e.errno}var n,o=eh.nodePermissions(e,"wx");if(o)return o;if(r){if(!eh.isDir(n.mode))return 54;if(eh.isRoot(n)||eh.getPath(n)===eh.cwd())return 10}else if(eh.isDir(n.mode))return 31;return 0},mayOpen:(e,t)=>e?eh.isLink(e.mode)?32:eh.isDir(e.mode)&&("r"!==eh.flagsToPermissionString(t)||512&t)?31:eh.nodePermissions(e,eh.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd:(e=0,t=eh.MAX_OPEN_FDS)=>{for(var r=e;r<=t;r++)if(!eh.streams[r])return r;throw new eh.ErrnoError(33)},getStream:e=>eh.streams[e],createStream:(e,t,r)=>{eh.FSStream||(eh.FSStream=function(){this.shared={}},eh.FSStream.prototype={},Object.defineProperties(eh.FSStream.prototype,{object:{get:function(){return this.node},set:function(e){this.node=e}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}},flags:{get:function(){return this.shared.flags},set:function(e){this.shared.flags=e}},position:{get:function(){return this.shared.position},set:function(e){this.shared.position=e}}})),e=Object.assign(new eh.FSStream,e);var n=eh.nextfd(t,r);return e.fd=n,eh.streams[n]=e,e},closeStream:e=>{eh.streams[e]=null},chrdev_stream_ops:{open:e=>{var t=eh.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:()=>{throw new eh.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice:(e,t)=>{eh.devices[e]={stream_ops:t}},getDevice:e=>eh.devices[e],getMounts:e=>{for(var t=[],r=[e];r.length;){var n=r.pop();t.push(n),r.push.apply(r,n.mounts)}return t},syncfs:(e,t)=>{"function"==typeof e&&(t=e,e=!1),eh.syncFSRequests++,eh.syncFSRequests>1&&E("warning: "+eh.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var r=eh.getMounts(eh.root.mount),n=0;function o(e){return eh.syncFSRequests--,t(e)}function i(e){if(e)return i.errored?void 0:(i.errored=!0,o(e));++n>=r.length&&o(null)}r.forEach(t=>{if(!t.type.syncfs)return i(null);t.type.syncfs(t,e,i)})},mount:(e,t,r)=>{var n,o="/"===r,i=!r;if(o&&eh.root)throw new eh.ErrnoError(10);if(!o&&!i){var s=eh.lookupPath(r,{follow_mount:!1});if(r=s.path,n=s.node,eh.isMountpoint(n))throw new eh.ErrnoError(10);if(!eh.isDir(n.mode))throw new eh.ErrnoError(54)}var a={type:e,opts:t,mountpoint:r,mounts:[]},u=e.mount(a);return u.mount=a,a.root=u,o?eh.root=u:n&&(n.mounted=a,n.mount&&n.mount.mounts.push(a)),u},unmount:e=>{var t=eh.lookupPath(e,{follow_mount:!1});if(!eh.isMountpoint(t.node))throw new eh.ErrnoError(28);var r=t.node,n=r.mounted,o=eh.getMounts(n);Object.keys(eh.nameTable).forEach(e=>{for(var t=eh.nameTable[e];t;){var r=t.name_next;o.includes(t.mount)&&eh.destroyNode(t),t=r}}),r.mounted=null;var i=r.mount.mounts.indexOf(n);r.mount.mounts.splice(i,1)},lookup:(e,t)=>e.node_ops.lookup(e,t),mknod:(e,t,r)=>{var n=eh.lookupPath(e,{parent:!0}).node,o=es.basename(e);if(!o||"."===o||".."===o)throw new eh.ErrnoError(28);var i=eh.mayCreate(n,o);if(i)throw new eh.ErrnoError(i);if(!n.node_ops.mknod)throw new eh.ErrnoError(63);return n.node_ops.mknod(n,o,t,r)},create:(e,t)=>(t=(void 0!==t?t:438)&4095|32768,eh.mknod(e,t,0)),mkdir:(e,t)=>(t=(void 0!==t?t:511)&1023|16384,eh.mknod(e,t,0)),mkdirTree:(e,t)=>{for(var r=e.split("/"),n="",o=0;o<r.length;++o)if(r[o]){n+="/"+r[o];try{eh.mkdir(n,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,t,r)=>(void 0===r&&(r=t,t=438),t|=8192,eh.mknod(e,t,r)),symlink:(e,t)=>{if(!ea.resolve(e))throw new eh.ErrnoError(44);var r=eh.lookupPath(t,{parent:!0}).node;if(!r)throw new eh.ErrnoError(44);var n=es.basename(t),o=eh.mayCreate(r,n);if(o)throw new eh.ErrnoError(o);if(!r.node_ops.symlink)throw new eh.ErrnoError(63);return r.node_ops.symlink(r,n,e)},rename:(e,t)=>{var r,n,o=es.dirname(e),i=es.dirname(t),s=es.basename(e),a=es.basename(t);if(r=eh.lookupPath(e,{parent:!0}).node,n=eh.lookupPath(t,{parent:!0}).node,!r||!n)throw new eh.ErrnoError(44);if(r.mount!==n.mount)throw new eh.ErrnoError(75);var u,l=eh.lookupNode(r,s),c=ea.relative(e,i);if("."!==c.charAt(0))throw new eh.ErrnoError(28);if("."!==(c=ea.relative(t,o)).charAt(0))throw new eh.ErrnoError(55);try{u=eh.lookupNode(n,a)}catch(e){}if(l!==u){var f=eh.isDir(l.mode),d=eh.mayDelete(r,s,f);if(d||(d=u?eh.mayDelete(n,a,f):eh.mayCreate(n,a)))throw new eh.ErrnoError(d);if(!r.node_ops.rename)throw new eh.ErrnoError(63);if(eh.isMountpoint(l)||u&&eh.isMountpoint(u))throw new eh.ErrnoError(10);if(n!==r&&(d=eh.nodePermissions(r,"w")))throw new eh.ErrnoError(d);eh.hashRemoveNode(l);try{r.node_ops.rename(l,n,a)}catch(e){throw e}finally{eh.hashAddNode(l)}}},rmdir:e=>{var t=eh.lookupPath(e,{parent:!0}).node,r=es.basename(e),n=eh.lookupNode(t,r),o=eh.mayDelete(t,r,!0);if(o)throw new eh.ErrnoError(o);if(!t.node_ops.rmdir)throw new eh.ErrnoError(63);if(eh.isMountpoint(n))throw new eh.ErrnoError(10);t.node_ops.rmdir(t,r),eh.destroyNode(n)},readdir:e=>{var t=eh.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new eh.ErrnoError(54);return t.node_ops.readdir(t)},unlink:e=>{var t=eh.lookupPath(e,{parent:!0}).node;if(!t)throw new eh.ErrnoError(44);var r=es.basename(e),n=eh.lookupNode(t,r),o=eh.mayDelete(t,r,!1);if(o)throw new eh.ErrnoError(o);if(!t.node_ops.unlink)throw new eh.ErrnoError(63);if(eh.isMountpoint(n))throw new eh.ErrnoError(10);t.node_ops.unlink(t,r),eh.destroyNode(n)},readlink:e=>{var t=eh.lookupPath(e).node;if(!t)throw new eh.ErrnoError(44);if(!t.node_ops.readlink)throw new eh.ErrnoError(28);return ea.resolve(eh.getPath(t.parent),t.node_ops.readlink(t))},stat:(e,t)=>{var r=eh.lookupPath(e,{follow:!t}).node;if(!r)throw new eh.ErrnoError(44);if(!r.node_ops.getattr)throw new eh.ErrnoError(63);return r.node_ops.getattr(r)},lstat:e=>eh.stat(e,!0),chmod:(e,t,r)=>{var n;if(!(n="string"==typeof e?eh.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new eh.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod:(e,t)=>{eh.chmod(e,t,!0)},fchmod:(e,t)=>{var r=eh.getStream(e);if(!r)throw new eh.ErrnoError(8);eh.chmod(r.node,t)},chown:(e,t,r,n)=>{var o;if(!(o="string"==typeof e?eh.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new eh.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(e,t,r)=>{eh.chown(e,t,r,!0)},fchown:(e,t,r)=>{var n=eh.getStream(e);if(!n)throw new eh.ErrnoError(8);eh.chown(n.node,t,r)},truncate:(e,t)=>{if(t<0)throw new eh.ErrnoError(28);if(!(r="string"==typeof e?eh.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new eh.ErrnoError(63);if(eh.isDir(r.mode))throw new eh.ErrnoError(31);if(!eh.isFile(r.mode))throw new eh.ErrnoError(28);var r,n=eh.nodePermissions(r,"w");if(n)throw new eh.ErrnoError(n);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate:(e,t)=>{var r=eh.getStream(e);if(!r)throw new eh.ErrnoError(8);if(0==(2097155&r.flags))throw new eh.ErrnoError(28);eh.truncate(r.node,t)},utime:(e,t,r)=>{var n=eh.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,r)})},open:(e,t,r)=>{if(""===e)throw new eh.ErrnoError(44);if(r=void 0===r?438:r,r=64&(t="string"==typeof t?eh.modeStringToFlags(t):t)?4095&r|32768:0,"object"==typeof e)n=e;else{e=es.normalize(e);try{n=eh.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var n,o=!1;if(64&t){if(n){if(128&t)throw new eh.ErrnoError(20)}else n=eh.mknod(e,r,0),o=!0}if(!n)throw new eh.ErrnoError(44);if(eh.isChrdev(n.mode)&&(t&=-513),65536&t&&!eh.isDir(n.mode))throw new eh.ErrnoError(54);if(!o){var s=eh.mayOpen(n,t);if(s)throw new eh.ErrnoError(s)}512&t&&!o&&eh.truncate(n,0),t&=-131713;var a=eh.createStream({node:n,path:eh.getPath(n),flags:t,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return a.stream_ops.open&&a.stream_ops.open(a),!i.logReadFiles||1&t||(eh.readFiles||(eh.readFiles={}),e in eh.readFiles||(eh.readFiles[e]=1)),a},close:e=>{if(eh.isClosed(e))throw new eh.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{eh.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek:(e,t,r)=>{if(eh.isClosed(e))throw new eh.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new eh.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new eh.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,r),e.ungotten=[],e.position},read:(e,t,r,n,o)=>{if(n<0||o<0)throw new eh.ErrnoError(28);if(eh.isClosed(e)||1==(2097155&e.flags))throw new eh.ErrnoError(8);if(eh.isDir(e.node.mode))throw new eh.ErrnoError(31);if(!e.stream_ops.read)throw new eh.ErrnoError(28);var i=void 0!==o;if(i){if(!e.seekable)throw new eh.ErrnoError(70)}else o=e.position;var s=e.stream_ops.read(e,t,r,n,o);return i||(e.position+=s),s},write:(e,t,r,n,o,i)=>{if(n<0||o<0)throw new eh.ErrnoError(28);if(eh.isClosed(e)||0==(2097155&e.flags))throw new eh.ErrnoError(8);if(eh.isDir(e.node.mode))throw new eh.ErrnoError(31);if(!e.stream_ops.write)throw new eh.ErrnoError(28);e.seekable&&1024&e.flags&&eh.llseek(e,0,2);var s=void 0!==o;if(s){if(!e.seekable)throw new eh.ErrnoError(70)}else o=e.position;var a=e.stream_ops.write(e,t,r,n,o,i);return s||(e.position+=a),a},allocate:(e,t,r)=>{if(eh.isClosed(e))throw new eh.ErrnoError(8);if(t<0||r<=0)throw new eh.ErrnoError(28);if(0==(2097155&e.flags))throw new eh.ErrnoError(8);if(!eh.isFile(e.node.mode)&&!eh.isDir(e.node.mode))throw new eh.ErrnoError(43);if(!e.stream_ops.allocate)throw new eh.ErrnoError(138);e.stream_ops.allocate(e,t,r)},mmap:(e,t,r,n,o)=>{if(0!=(2&n)&&0==(2&o)&&2!=(2097155&e.flags)||1==(2097155&e.flags))throw new eh.ErrnoError(2);if(!e.stream_ops.mmap)throw new eh.ErrnoError(43);return e.stream_ops.mmap(e,t,r,n,o)},msync:(e,t,r,n,o)=>e&&e.stream_ops.msync?e.stream_ops.msync(e,t,r,n,o):0,munmap:e=>0,ioctl:(e,t,r)=>{if(!e.stream_ops.ioctl)throw new eh.ErrnoError(59);return e.stream_ops.ioctl(e,t,r)},readFile:(e,t={})=>{if(t.flags=t.flags||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw Error('Invalid encoding type "'+t.encoding+'"');var r,n=eh.open(e,t.flags),o=eh.stat(e).size,i=new Uint8Array(o);return eh.read(n,i,0,o,0),"utf8"===t.encoding?r=T(i,0):"binary"===t.encoding&&(r=i),eh.close(n),r},writeFile:(e,t,r={})=>{r.flags=r.flags||577;var n=eh.open(e,r.flags,r.mode);if("string"==typeof t){var o=new Uint8Array(L(t)+1),i=O(t,o,0,o.length);eh.write(n,o,0,i,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw Error("Unsupported data type");eh.write(n,t,0,t.byteLength,void 0,r.canOwn)}eh.close(n)},cwd:()=>eh.currentPath,chdir:e=>{var t=eh.lookupPath(e,{follow:!0});if(null===t.node)throw new eh.ErrnoError(44);if(!eh.isDir(t.node.mode))throw new eh.ErrnoError(54);var r=eh.nodePermissions(t.node,"x");if(r)throw new eh.ErrnoError(r);eh.currentPath=t.path},createDefaultDirectories:()=>{eh.mkdir("/tmp"),eh.mkdir("/home"),eh.mkdir("/home/web_user")},createDefaultDevices:()=>{eh.mkdir("/dev"),eh.registerDevice(eh.makedev(1,3),{read:()=>0,write:(e,t,r,n,o)=>n}),eh.mkdev("/dev/null",eh.makedev(1,3)),el.register(eh.makedev(5,0),el.default_tty_ops),el.register(eh.makedev(6,0),el.default_tty1_ops),eh.mkdev("/dev/tty",eh.makedev(5,0)),eh.mkdev("/dev/tty1",eh.makedev(6,0));var e=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return()=>(crypto.getRandomValues(e),e[0])}if(y)try{var t=r(821);return()=>t.randomBytes(1)[0]}catch(e){}return()=>Z("randomDevice")}();eh.createDevice("/dev","random",e),eh.createDevice("/dev","urandom",e),eh.mkdir("/dev/shm"),eh.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{eh.mkdir("/proc");var e=eh.mkdir("/proc/self");eh.mkdir("/proc/self/fd"),eh.mount({mount:()=>{var t=eh.createNode(e,"fd",16895,73);return t.node_ops={lookup:(e,t)=>{var r=+t,n=eh.getStream(r);if(!n)throw new eh.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},t}},{},"/proc/self/fd")},createStandardStreams:()=>{i.stdin?eh.createDevice("/dev","stdin",i.stdin):eh.symlink("/dev/tty","/dev/stdin"),i.stdout?eh.createDevice("/dev","stdout",null,i.stdout):eh.symlink("/dev/tty","/dev/stdout"),i.stderr?eh.createDevice("/dev","stderr",null,i.stderr):eh.symlink("/dev/tty1","/dev/stderr"),eh.open("/dev/stdin",0),eh.open("/dev/stdout",1),eh.open("/dev/stderr",1)},ensureErrnoError:()=>{eh.ErrnoError||(eh.ErrnoError=function(e,t){this.node=t,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},eh.ErrnoError.prototype=Error(),eh.ErrnoError.prototype.constructor=eh.ErrnoError,[44].forEach(e=>{eh.genericErrors[e]=new eh.ErrnoError(e),eh.genericErrors[e].stack="<generic error, no stack>"}))},staticInit:()=>{eh.ensureErrnoError(),eh.nameTable=Array(4096),eh.mount(ed,{},"/"),eh.createDefaultDirectories(),eh.createDefaultDevices(),eh.createSpecialDirectories(),eh.filesystems={MEMFS:ed}},init:(e,t,r)=>{eh.init.initialized=!0,eh.ensureErrnoError(),i.stdin=e||i.stdin,i.stdout=t||i.stdout,i.stderr=r||i.stderr,eh.createStandardStreams()},quit:()=>{eh.init.initialized=!1;for(var e=0;e<eh.streams.length;e++){var t=eh.streams[e];t&&eh.close(t)}},getMode:(e,t)=>{var r=0;return e&&(r|=365),t&&(r|=146),r},findObject:(e,t)=>{var r=eh.analyzePath(e,t);return r.exists?r.object:null},analyzePath:(e,t)=>{try{e=(n=eh.lookupPath(e,{follow:!t})).path}catch(e){}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=eh.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=es.basename(e),n=eh.lookupPath(e,{follow:!t}),r.exists=!0,r.path=n.path,r.object=n.node,r.name=n.node.name,r.isRoot="/"===n.path}catch(e){r.error=e.errno}return r},createPath:(e,t,r,n)=>{e="string"==typeof e?e:eh.getPath(e);for(var o=t.split("/").reverse();o.length;){var i=o.pop();if(i){var s=es.join2(e,i);try{eh.mkdir(s)}catch(e){}e=s}}return s},createFile:(e,t,r,n,o)=>{var i=es.join2("string"==typeof e?e:eh.getPath(e),t),s=eh.getMode(n,o);return eh.create(i,s)},createDataFile:(e,t,r,n,o,i)=>{var s=t;e&&(e="string"==typeof e?e:eh.getPath(e),s=t?es.join2(e,t):e);var a=eh.getMode(n,o),u=eh.create(s,a);if(r){if("string"==typeof r){for(var l=Array(r.length),c=0,f=r.length;c<f;++c)l[c]=r.charCodeAt(c);r=l}eh.chmod(u,146|a);var d=eh.open(u,577);eh.write(d,r,0,r.length,0,i),eh.close(d),eh.chmod(u,a)}return u},createDevice:(e,t,r,n)=>{var o=es.join2("string"==typeof e?e:eh.getPath(e),t),i=eh.getMode(!!r,!!n);eh.createDevice.major||(eh.createDevice.major=64);var s=eh.makedev(eh.createDevice.major++,0);return eh.registerDevice(s,{open:e=>{e.seekable=!1},close:e=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(e,t,n,o,i)=>{for(var s,a=0,u=0;u<o;u++){try{s=r()}catch(e){throw new eh.ErrnoError(29)}if(void 0===s&&0===a)throw new eh.ErrnoError(6);if(null==s)break;a++,t[n+u]=s}return a&&(e.node.timestamp=Date.now()),a},write:(e,t,r,o,i)=>{for(var s=0;s<o;s++)try{n(t[r+s])}catch(e){throw new eh.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),s}}),eh.mkdev(o,i,s)},forceLoadFile:e=>{if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!a)throw Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=eu(a(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new eh.ErrnoError(29)}},createLazyFile:(e,t,r,n,o)=>{function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize,r=e/this.chunkSize|0;return this.getter(r)[t]}},i.prototype.setDataGetter=function(e){this.getter=e},i.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",r,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw Error("Couldn't load "+r+". Status: "+e.status);var t,n=Number(e.getResponseHeader("Content-length")),o=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,i=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,s=1048576;o||(s=n);var a=this;a.setDataGetter(e=>{var t=e*s,o=(e+1)*s-1;if(o=Math.min(o,n-1),void 0===a.chunks[e]&&(a.chunks[e]=((e,t)=>{if(e>t)throw Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>n-1)throw Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",r,!1),n!==s&&o.setRequestHeader("Range","bytes="+e+"-"+t),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw Error("Couldn't load "+r+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):eu(o.responseText||"",!0)})(t,o)),void 0===a.chunks[e])throw Error("doXHR failed!");return a.chunks[e]}),!i&&n||(s=n=1,s=n=this.getter(0).length,w("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=s,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!g)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var s=new i;Object.defineProperties(s,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var a={isDevice:!1,contents:s}}else a={isDevice:!1,url:r};var u=eh.createFile(e,t,a,n,o);a.contents?u.contents=a.contents:a.url&&(u.contents=null,u.url=a.url),Object.defineProperties(u,{usedBytes:{get:function(){return this.contents.length}}});var l={};function c(e,t,r,n,o){var i=e.node.contents;if(o>=i.length)return 0;var s=Math.min(i.length-o,n);if(i.slice)for(var a=0;a<s;a++)t[r+a]=i[o+a];else for(a=0;a<s;a++)t[r+a]=i.get(o+a);return s}return Object.keys(u.stream_ops).forEach(e=>{var t=u.stream_ops[e];l[e]=function(){return eh.forceLoadFile(u),t.apply(null,arguments)}}),l.read=(e,t,r,n,o)=>(eh.forceLoadFile(u),c(e,t,r,n,o)),l.mmap=(e,t,r,n,o)=>{eh.forceLoadFile(u);var i=ec(t);if(!i)throw new eh.ErrnoError(48);return c(e,x,i,t,r),{ptr:i,allocated:!0}},u.stream_ops=l,u},createPreloadedFile:(e,t,r,n,o,i,s,a,l,c)=>{var f=t?ea.resolve(es.join2(e,t)):e;function d(r){function u(r){c&&c(),a||eh.createDataFile(e,t,r,n,o,l),i&&i(),J()}Browser.handledByPreloadPlugin(r,f,u,()=>{s&&s(),J()})||u(r)}Q(),"string"==typeof r?function(e,t,r,n){var o="al "+e;u(e,r=>{r||Z('Loading data file "'+e+'" failed (no arrayBuffer).'),t(new Uint8Array(r)),o&&J()},t=>{if(!r)throw'Loading data file "'+e+'" failed.';r()}),o&&Q()}(r,e=>d(e),s):d(r)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(e,t,r)=>{t=t||(()=>{}),r=r||(()=>{});var n=eh.indexedDB();try{var o=n.open(eh.DB_NAME(),eh.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=()=>{w("creating db"),o.result.createObjectStore(eh.DB_STORE_NAME)},o.onsuccess=()=>{var n=o.result.transaction([eh.DB_STORE_NAME],"readwrite"),i=n.objectStore(eh.DB_STORE_NAME),s=0,a=0,u=e.length;function l(){0==a?t():r()}e.forEach(e=>{var t=i.put(eh.analyzePath(e).object.contents,e);t.onsuccess=()=>{++s+a==u&&l()},t.onerror=()=>{a++,s+a==u&&l()}}),n.onerror=r},o.onerror=r},loadFilesFromDB:(e,t,r)=>{t=t||(()=>{}),r=r||(()=>{});var n=eh.indexedDB();try{var o=n.open(eh.DB_NAME(),eh.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=r,o.onsuccess=()=>{var n=o.result;try{var i=n.transaction([eh.DB_STORE_NAME],"readonly")}catch(e){return void r(e)}var s=i.objectStore(eh.DB_STORE_NAME),a=0,u=0,l=e.length;function c(){0==u?t():r()}e.forEach(e=>{var t=s.get(e);t.onsuccess=()=>{eh.analyzePath(e).exists&&eh.unlink(e),eh.createDataFile(es.dirname(e),es.basename(e),t.result,!0,!0,!0),++a+u==l&&c()},t.onerror=()=>{u++,a+u==l&&c()}}),i.onerror=r},o.onerror=r}},em={DEFAULT_POLLMASK:5,calculateAt:function(e,t,r){var n;if(es.isAbs(t))return t;if(n=-100===e?eh.cwd():em.getStreamFromFD(e).path,0==t.length){if(!r)throw new eh.ErrnoError(44);return n}return es.join2(n,t)},doStat:function(e,t,r){try{var n=e(t)}catch(e){if(e&&e.node&&es.normalize(t)!==es.normalize(eh.getPath(e.node)))return -54;throw e}return F[r>>2]=n.dev,F[r+8>>2]=n.ino,F[r+12>>2]=n.mode,D[r+16>>2]=n.nlink,F[r+20>>2]=n.uid,F[r+24>>2]=n.gid,F[r+28>>2]=n.rdev,V=[n.size>>>0,+Math.abs(U=n.size)>=1?U>0?(0|Math.min(+Math.floor(U/0x100000000),0xffffffff))>>>0:~~+Math.ceil((U-+(~~U>>>0))/0x100000000)>>>0:0],F[r+40>>2]=V[0],F[r+44>>2]=V[1],F[r+48>>2]=4096,F[r+52>>2]=n.blocks,V=[Math.floor(n.atime.getTime()/1e3)>>>0,+Math.abs(U=Math.floor(n.atime.getTime()/1e3))>=1?U>0?(0|Math.min(+Math.floor(U/0x100000000),0xffffffff))>>>0:~~+Math.ceil((U-+(~~U>>>0))/0x100000000)>>>0:0],F[r+56>>2]=V[0],F[r+60>>2]=V[1],D[r+64>>2]=0,V=[Math.floor(n.mtime.getTime()/1e3)>>>0,+Math.abs(U=Math.floor(n.mtime.getTime()/1e3))>=1?U>0?(0|Math.min(+Math.floor(U/0x100000000),0xffffffff))>>>0:~~+Math.ceil((U-+(~~U>>>0))/0x100000000)>>>0:0],F[r+72>>2]=V[0],F[r+76>>2]=V[1],D[r+80>>2]=0,V=[Math.floor(n.ctime.getTime()/1e3)>>>0,+Math.abs(U=Math.floor(n.ctime.getTime()/1e3))>=1?U>0?(0|Math.min(+Math.floor(U/0x100000000),0xffffffff))>>>0:~~+Math.ceil((U-+(~~U>>>0))/0x100000000)>>>0:0],F[r+88>>2]=V[0],F[r+92>>2]=V[1],D[r+96>>2]=0,V=[n.ino>>>0,+Math.abs(U=n.ino)>=1?U>0?(0|Math.min(+Math.floor(U/0x100000000),0xffffffff))>>>0:~~+Math.ceil((U-+(~~U>>>0))/0x100000000)>>>0:0],F[r+104>>2]=V[0],F[r+108>>2]=V[1],0},doMsync:function(e,t,r,n,o){var i=q.slice(e,e+r);eh.msync(t,i,o,r,n)},varargs:void 0,get:function(){return em.varargs+=4,F[em.varargs-4>>2]},getStr:function(e){return j(e)},getStreamFromFD:function(e){var t=eh.getStream(e);if(!t)throw new eh.ErrnoError(8);return t}};function ep(e,t){return t+2097152>>>0<4194305-!!e?(e>>>0)+0x100000000*t:NaN}function ev(e){return D[e>>2]+0x100000000*F[e+4>>2]}function eg(e){var t=L(e)+1,r=eC(t);return r&&O(e,x,r,t),r}function ey(e){try{return k.grow(e-S.byteLength+65535>>>16),B(k.buffer),1}catch(e){}}ef=y?()=>{var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:()=>performance.now();var eb={};function e_(){if(!e_.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:p||"./this.program"};for(var t in eb)void 0===eb[t]?delete e[t]:e[t]=eb[t];var r=[];for(var t in e)r.push(t+"="+e[t]);e_.strings=r}return e_.strings}function ew(e,t){e<128?t.push(e):t.push(e%128|128,e>>7)}var eE=[];function ek(e){var t=eE[e];return t||(e>=eE.length&&(eE.length=e+1),eE[e]=t=N.get(e)),t}var eS=void 0,ex=[];function eq(e,t){N.set(e,t),eE[e]=N.get(e)}function eM(e,t){if(eS||(eS=new WeakMap,function(e,t){if(eS)for(var r=0;r<0+t;r++){var n=ek(r);n&&eS.set(n,r)}}(0,N.length)),eS.has(e))return eS.get(e);var r=function(){if(ex.length)return ex.pop();try{N.grow(1)}catch(e){if(!(e instanceof RangeError))throw e;throw"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH."}return N.length-1}();try{eq(r,e)}catch(n){if(!(n instanceof TypeError))throw n;eq(r,function(e,t){if("function"==typeof WebAssembly.Function)return new WebAssembly.Function(function(e){for(var t={i:"i32",j:"i64",f:"f32",d:"f64",p:"i32"},r={parameters:[],results:"v"==e[0]?[]:[t[e[0]]]},n=1;n<e.length;++n)r.parameters.push(t[e[n]]);return r}(t),e);var r=[1,96],n=t.slice(0,1),o=t.slice(1),i={i:127,p:127,j:126,f:125,d:124};ew(o.length,r);for(var s=0;s<o.length;++s)r.push(i[o[s]]);"v"==n?r.push(0):r.push(1,i[n]);var a=[0,97,115,109,1,0,0,0,1];ew(r.length,a),a.push.apply(a,r),a.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var u=new WebAssembly.Module(new Uint8Array(a));return new WebAssembly.Instance(u,{e:{f:e}}).exports.f}(e,t))}return eS.set(e,r),r}function eF(e){eS.delete(ek(e)),ex.push(e)}var eD=0;function eA(e,t){var r;return r=1==t?eI(e.length):eC(e.length),e.subarray||e.slice||(e=new Uint8Array(e)),q.set(e,r),r}function eP(e){return i["_"+e]}function eR(e,t,r,n,o){var i={string:e=>{var t=0;if(null!=e&&0!==e){var r=1+(e.length<<2);C(e,t=eI(r),r)}return t},array:e=>{var t=eI(e.length);return function(e,t){x.set(e,t)}(e,t),t}},s=eP(e),a=[],u=0;if(n)for(var l=0;l<n.length;l++){var c=i[r[l]];c?(0===u&&(u=eN()),a[l]=c(n[l])):a[l]=n[l]}return function(e){return 0!==u&&eH(u),function(e){return"string"===t?j(e):"boolean"===t?!!e:e}(e)}(s.apply(null,a))}var ez=function(e,t,r,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=eh.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n};Object.defineProperties(ez.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}},isFolder:{get:function(){return eh.isDir(this.mode)}},isDevice:{get:function(){return eh.isChrdev(this.mode)}}}),eh.FSNode=ez,eh.staticInit();var eT,ej={a:function(e,t,r,n){Z("Assertion failed: "+j(e)+", at: "+[t?j(t):"unknown filename",r,n?j(n):"unknown function"])},g:function(e,t){try{return e=em.getStr(e),eh.chmod(e,t),0}catch(e){if(void 0===eh||!(e instanceof eh.ErrnoError))throw e;return-e.errno}},I:function(e,t,r,n){try{if(t=em.getStr(t),t=em.calculateAt(e,t),-8&r)return -28;var o=eh.lookupPath(t,{follow:!0}).node;if(!o)return -44;var i="";return 4&r&&(i+="r"),2&r&&(i+="w"),1&r&&(i+="x"),i&&eh.nodePermissions(o,i)?-2:0}catch(e){if(void 0===eh||!(e instanceof eh.ErrnoError))throw e;return-e.errno}},h:function(e,t){try{return eh.fchmod(e,t),0}catch(e){if(void 0===eh||!(e instanceof eh.ErrnoError))throw e;return-e.errno}},H:function(e,t,r){try{return eh.fchown(e,t,r),0}catch(e){if(void 0===eh||!(e instanceof eh.ErrnoError))throw e;return-e.errno}},b:function(e,t,r){em.varargs=r;try{var n=em.getStreamFromFD(e);switch(t){case 0:return(o=em.get())<0?-28:eh.createStream(n,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=em.get();return n.flags|=o,0;case 5:return M[(o=em.get())+0>>1]=2,0;case 16:case 8:default:return -28;case 9:return F[eO()>>2]=28,-1}}catch(e){if(void 0===eh||!(e instanceof eh.ErrnoError))throw e;return-e.errno}},G:function(e,t){try{var r=em.getStreamFromFD(e);return em.doStat(eh.stat,r.path,t)}catch(e){if(void 0===eh||!(e instanceof eh.ErrnoError))throw e;return-e.errno}},l:function(e,t,r){try{var n=ep(t,r);return isNaN(n)?-61:(eh.ftruncate(e,n),0)}catch(e){if(void 0===eh||!(e instanceof eh.ErrnoError))throw e;return-e.errno}},B:function(e,t){try{if(0===t)return -28;var r=eh.cwd(),n=L(r)+1;return t<n?-68:(C(r,e,t),n)}catch(e){if(void 0===eh||!(e instanceof eh.ErrnoError))throw e;return-e.errno}},E:function(e,t){try{return e=em.getStr(e),em.doStat(eh.lstat,e,t)}catch(e){if(void 0===eh||!(e instanceof eh.ErrnoError))throw e;return-e.errno}},y:function(e,t,r){try{return t=em.getStr(t),t=em.calculateAt(e,t),"/"===(t=es.normalize(t))[t.length-1]&&(t=t.substr(0,t.length-1)),eh.mkdir(t,r,0),0}catch(e){if(void 0===eh||!(e instanceof eh.ErrnoError))throw e;return-e.errno}},D:function(e,t,r,n){try{t=em.getStr(t);var o=256&n,i=4096&n;return n&=-4353,t=em.calculateAt(e,t,i),em.doStat(o?eh.lstat:eh.stat,t,r)}catch(e){if(void 0===eh||!(e instanceof eh.ErrnoError))throw e;return-e.errno}},v:function(e,t,r,n){em.varargs=n;try{t=em.getStr(t),t=em.calculateAt(e,t);var o=n?em.get():0;return eh.open(t,r,o).fd}catch(e){if(void 0===eh||!(e instanceof eh.ErrnoError))throw e;return-e.errno}},t:function(e,t,r,n){try{if(t=em.getStr(t),t=em.calculateAt(e,t),n<=0)return -28;var o=eh.readlink(t),i=Math.min(n,L(o)),s=x[r+i];return C(o,r,n+1),x[r+i]=s,i}catch(e){if(void 0===eh||!(e instanceof eh.ErrnoError))throw e;return-e.errno}},s:function(e){try{return e=em.getStr(e),eh.rmdir(e),0}catch(e){if(void 0===eh||!(e instanceof eh.ErrnoError))throw e;return-e.errno}},F:function(e,t){try{return e=em.getStr(e),em.doStat(eh.stat,e,t)}catch(e){if(void 0===eh||!(e instanceof eh.ErrnoError))throw e;return-e.errno}},p:function(e,t,r){try{return t=em.getStr(t),t=em.calculateAt(e,t),0===r?eh.unlink(t):512===r?eh.rmdir(t):Z("Invalid flags passed to unlinkat"),0}catch(e){if(void 0===eh||!(e instanceof eh.ErrnoError))throw e;return-e.errno}},n:function(e,t,r,n){try{if(t=em.getStr(t),t=em.calculateAt(e,t,!0),r){var o=ev(r),i=F[r+8>>2];s=1e3*o+i/1e6,a=1e3*(o=ev(r+=16))+(i=F[r+8>>2])/1e6}else var s=Date.now(),a=s;return eh.utime(t,s,a),0}catch(e){if(void 0===eh||!(e instanceof eh.ErrnoError))throw e;return-e.errno}},e:function(){return Date.now()},i:function(e,t){var r=new Date(1e3*ev(e));F[t>>2]=r.getSeconds(),F[t+4>>2]=r.getMinutes(),F[t+8>>2]=r.getHours(),F[t+12>>2]=r.getDate(),F[t+16>>2]=r.getMonth(),F[t+20>>2]=r.getFullYear()-1900,F[t+24>>2]=r.getDay();var n=new Date(r.getFullYear(),0,1),o=(r.getTime()-n.getTime())/864e5|0;F[t+28>>2]=o,F[t+36>>2]=-60*r.getTimezoneOffset();var i=new Date(r.getFullYear(),6,1).getTimezoneOffset(),s=n.getTimezoneOffset(),a=0|(i!=s&&r.getTimezoneOffset()==Math.min(s,i));F[t+32>>2]=a},w:function(e,t,r,n,o,i){try{var s=em.getStreamFromFD(n),a=eh.mmap(s,e,o,t,r),u=a.ptr;return F[i>>2]=a.allocated,u}catch(e){if(void 0===eh||!(e instanceof eh.ErrnoError))throw e;return-e.errno}},x:function(e,t,r,n,o,i){try{var s=em.getStreamFromFD(o);2&r&&em.doMsync(e,s,t,n,i),eh.munmap(s)}catch(e){if(void 0===eh||!(e instanceof eh.ErrnoError))throw e;return-e.errno}},j:function e(t,r,n){e.called||(e.called=!0,function(e,t,r){var n=(new Date).getFullYear(),o=new Date(n,0,1),i=new Date(n,6,1),s=o.getTimezoneOffset(),a=i.getTimezoneOffset(),u=Math.max(s,a);function l(e){var t=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return t?t[1]:"GMT"}F[e>>2]=60*u,F[t>>2]=Number(s!=a);var c=l(o),f=l(i),d=eg(c),h=eg(f);a<s?(D[r>>2]=d,D[r+4>>2]=h):(D[r>>2]=h,D[r+4>>2]=d)}(t,r,n))},q:function(){return 0x80000000},d:ef,o:function(e,t,r){q.copyWithin(e,t,t+r)},c:function(e){var t,r=q.length,n=0x80000000;if((e>>>=0)>0x80000000)return!1;for(var o=1;o<=4;o*=2){var i=r*(1+.2/o);if(i=Math.min(i,e+0x6000000),ey(Math.min(n,(t=Math.max(e,i))+(65536-t%65536)%65536)))return!0}return!1},z:function(e,t){var r=0;return e_().forEach(function(n,o){var i=t+r;D[e+4*o>>2]=i,function(e,t,r){for(var n=0;n<e.length;++n)x[t++>>0]=e.charCodeAt(n);x[t>>0]=0}(n,i),r+=n.length+1}),0},A:function(e,t){var r=e_();D[e>>2]=r.length;var n=0;return r.forEach(function(e){n+=e.length+1}),D[t>>2]=n,0},f:function(e){try{var t=em.getStreamFromFD(e);return eh.close(t),0}catch(e){if(void 0===eh||!(e instanceof eh.ErrnoError))throw e;return e.errno}},m:function(e,t){try{var r=em.getStreamFromFD(e),n=r.tty?2:eh.isDir(r.mode)?3:eh.isLink(r.mode)?7:4;return x[t>>0]=n,0}catch(e){if(void 0===eh||!(e instanceof eh.ErrnoError))throw e;return e.errno}},u:function(e,t,r,n){try{var o=function(e,t,r,n){for(var o=0,i=0;i<r;i++){var s=D[t>>2],a=D[t+4>>2];t+=8;var u=eh.read(e,x,s,a,void 0);if(u<0)return -1;if(o+=u,u<a)break}return o}(em.getStreamFromFD(e),t,r);return D[n>>2]=o,0}catch(e){if(void 0===eh||!(e instanceof eh.ErrnoError))throw e;return e.errno}},k:function(e,t,r,n,o){try{var i=ep(t,r);if(isNaN(i))return 61;var s=em.getStreamFromFD(e);return eh.llseek(s,i,n),V=[s.position>>>0,(U=s.position,+Math.abs(U)>=1?U>0?(0|Math.min(+Math.floor(U/0x100000000),0xffffffff))>>>0:~~+Math.ceil((U-+(~~U>>>0))/0x100000000)>>>0:0)],F[o>>2]=V[0],F[o+4>>2]=V[1],s.getdents&&0===i&&0===n&&(s.getdents=null),0}catch(e){if(void 0===eh||!(e instanceof eh.ErrnoError))throw e;return e.errno}},C:function(e){try{var t=em.getStreamFromFD(e);return t.stream_ops&&t.stream_ops.fsync?t.stream_ops.fsync(t):0}catch(e){if(void 0===eh||!(e instanceof eh.ErrnoError))throw e;return e.errno}},r:function(e,t,r,n){try{var o=function(e,t,r,n){for(var o=0,i=0;i<r;i++){var s=D[t>>2],a=D[t+4>>2];t+=8;var u=eh.write(e,x,s,a,void 0);if(u<0)return -1;o+=u}return o}(em.getStreamFromFD(e),t,r);return D[n>>2]=o,0}catch(e){if(void 0===eh||!(e instanceof eh.ErrnoError))throw e;return e.errno}}},eO=(function(){var e={a:ej};function t(e,t){var r,n=e.exports;i.asm=n,B((k=i.asm.J).buffer),N=i.asm.Da,r=i.asm.K,X.unshift(r),J()}function r(e){t(e.instance)}function n(t){return(function(){if(!_&&(v||g)){if("function"==typeof fetch&&!et(H))return fetch(H,{credentials:"same-origin"}).then(function(e){if(!e.ok)throw"failed to load wasm binary file at '"+H+"'";return e.arrayBuffer()}).catch(function(){return er(H)});if(u)return new Promise(function(e,t){u(H,function(t){e(new Uint8Array(t))},t)})}return Promise.resolve().then(function(){return er(H)})})().then(function(t){return WebAssembly.instantiate(t,e)}).then(function(e){return e}).then(t,function(e){E("failed to asynchronously prepare wasm: "+e),Z(e)})}if(Q(),i.instantiateWasm)try{return i.instantiateWasm(e,t)}catch(e){return E("Module.instantiateWasm callback failed with error: "+e),!1}_||"function"!=typeof WebAssembly.instantiateStreaming||ee(H)||et(H)||y||"function"!=typeof fetch?n(r):fetch(H,{credentials:"same-origin"}).then(function(t){return WebAssembly.instantiateStreaming(t,e).then(r,function(e){return E("wasm streaming compile failed: "+e),E("falling back to ArrayBuffer instantiation"),n(r)})})}(),i.___wasm_call_ctors=function(){return(i.___wasm_call_ctors=i.asm.K).apply(null,arguments)},i._sqlite3_malloc=function(){return(i._sqlite3_malloc=i.asm.L).apply(null,arguments)},i._sqlite3_free=function(){return(i._sqlite3_free=i.asm.M).apply(null,arguments)},i.___errno_location=function(){return(eO=i.___errno_location=i.asm.N).apply(null,arguments)}),eC=(i._sqlite3_finalize=function(){return(i._sqlite3_finalize=i.asm.O).apply(null,arguments)},i._sqlite3_reset=function(){return(i._sqlite3_reset=i.asm.P).apply(null,arguments)},i._sqlite3_clear_bindings=function(){return(i._sqlite3_clear_bindings=i.asm.Q).apply(null,arguments)},i._sqlite3_value_blob=function(){return(i._sqlite3_value_blob=i.asm.R).apply(null,arguments)},i._sqlite3_value_text=function(){return(i._sqlite3_value_text=i.asm.S).apply(null,arguments)},i._sqlite3_value_bytes=function(){return(i._sqlite3_value_bytes=i.asm.T).apply(null,arguments)},i._sqlite3_value_double=function(){return(i._sqlite3_value_double=i.asm.U).apply(null,arguments)},i._sqlite3_value_int=function(){return(i._sqlite3_value_int=i.asm.V).apply(null,arguments)},i._sqlite3_value_type=function(){return(i._sqlite3_value_type=i.asm.W).apply(null,arguments)},i._sqlite3_result_blob=function(){return(i._sqlite3_result_blob=i.asm.X).apply(null,arguments)},i._sqlite3_result_double=function(){return(i._sqlite3_result_double=i.asm.Y).apply(null,arguments)},i._sqlite3_result_error=function(){return(i._sqlite3_result_error=i.asm.Z).apply(null,arguments)},i._sqlite3_result_int=function(){return(i._sqlite3_result_int=i.asm._).apply(null,arguments)},i._sqlite3_result_int64=function(){return(i._sqlite3_result_int64=i.asm.$).apply(null,arguments)},i._sqlite3_result_null=function(){return(i._sqlite3_result_null=i.asm.aa).apply(null,arguments)},i._sqlite3_result_text=function(){return(i._sqlite3_result_text=i.asm.ba).apply(null,arguments)},i._sqlite3_step=function(){return(i._sqlite3_step=i.asm.ca).apply(null,arguments)},i._sqlite3_column_count=function(){return(i._sqlite3_column_count=i.asm.da).apply(null,arguments)},i._sqlite3_data_count=function(){return(i._sqlite3_data_count=i.asm.ea).apply(null,arguments)},i._sqlite3_column_blob=function(){return(i._sqlite3_column_blob=i.asm.fa).apply(null,arguments)},i._sqlite3_column_bytes=function(){return(i._sqlite3_column_bytes=i.asm.ga).apply(null,arguments)},i._sqlite3_column_double=function(){return(i._sqlite3_column_double=i.asm.ha).apply(null,arguments)},i._sqlite3_column_text=function(){return(i._sqlite3_column_text=i.asm.ia).apply(null,arguments)},i._sqlite3_column_type=function(){return(i._sqlite3_column_type=i.asm.ja).apply(null,arguments)},i._sqlite3_column_name=function(){return(i._sqlite3_column_name=i.asm.ka).apply(null,arguments)},i._sqlite3_bind_blob=function(){return(i._sqlite3_bind_blob=i.asm.la).apply(null,arguments)},i._sqlite3_bind_double=function(){return(i._sqlite3_bind_double=i.asm.ma).apply(null,arguments)},i._sqlite3_bind_int=function(){return(i._sqlite3_bind_int=i.asm.na).apply(null,arguments)},i._sqlite3_bind_text=function(){return(i._sqlite3_bind_text=i.asm.oa).apply(null,arguments)},i._sqlite3_bind_parameter_index=function(){return(i._sqlite3_bind_parameter_index=i.asm.pa).apply(null,arguments)},i._sqlite3_sql=function(){return(i._sqlite3_sql=i.asm.qa).apply(null,arguments)},i._sqlite3_normalized_sql=function(){return(i._sqlite3_normalized_sql=i.asm.ra).apply(null,arguments)},i._sqlite3_errmsg=function(){return(i._sqlite3_errmsg=i.asm.sa).apply(null,arguments)},i._sqlite3_exec=function(){return(i._sqlite3_exec=i.asm.ta).apply(null,arguments)},i._sqlite3_prepare_v2=function(){return(i._sqlite3_prepare_v2=i.asm.ua).apply(null,arguments)},i._sqlite3_create_module_v2=function(){return(i._sqlite3_create_module_v2=i.asm.va).apply(null,arguments)},i._sqlite3_declare_vtab=function(){return(i._sqlite3_declare_vtab=i.asm.wa).apply(null,arguments)},i._sqlite3_changes=function(){return(i._sqlite3_changes=i.asm.xa).apply(null,arguments)},i._sqlite3_close_v2=function(){return(i._sqlite3_close_v2=i.asm.ya).apply(null,arguments)},i._sqlite3_create_function_v2=function(){return(i._sqlite3_create_function_v2=i.asm.za).apply(null,arguments)},i._sqlite3_open=function(){return(i._sqlite3_open=i.asm.Aa).apply(null,arguments)},i._malloc=function(){return(eC=i._malloc=i.asm.Ba).apply(null,arguments)}),eL=i._free=function(){return(eL=i._free=i.asm.Ca).apply(null,arguments)},eB=(i._RegisterExtensionFunctions=function(){return(i._RegisterExtensionFunctions=i.asm.Ea).apply(null,arguments)},i._emscripten_builtin_memalign=function(){return(eB=i._emscripten_builtin_memalign=i.asm.Fa).apply(null,arguments)}),eN=i.stackSave=function(){return(eN=i.stackSave=i.asm.Ga).apply(null,arguments)},eH=i.stackRestore=function(){return(eH=i.stackRestore=i.asm.Ha).apply(null,arguments)},eI=i.stackAlloc=function(){return(eI=i.stackAlloc=i.asm.Ia).apply(null,arguments)};function eU(e){function t(){eT||(eT=!0,i.calledRun=!0,R||(i.noFSInit||eh.init.initialized||eh.init(),eh.ignorePermissions=!1,el.init(),en(X),i.onRuntimeInitialized&&i.onRuntimeInitialized(),function(){var e;if(i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)e=i.postRun.shift(),G.unshift(e);en(G)}()))}e=e||m,$>0||(function(){var e;if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)e=i.preRun.shift(),W.unshift(e);en(W)}(),$>0||(i.setStatus?(i.setStatus("Running..."),setTimeout(function(){setTimeout(function(){i.setStatus("")},1),t()},1)):t()))}if(i.UTF8ToString=j,i.stringToUTF8=C,i.lengthBytesUTF8=L,i.stackAlloc=eI,i.stackSave=eN,i.stackRestore=eH,i.ccall=eR,i.cwrap=function(e,t,r,n){var o=(r=r||[]).every(e=>"number"===e||"boolean"===e);return"string"!==t&&o&&!n?eP(e):function(){return eR(e,t,r,arguments)}},i.addFunction=eM,i.setValue=ei,i.getValue=eo,Y=function e(){eT||eU(),eT||(Y=e)},i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();return eU(),i}))};e.exports=o,e.exports.default=o},720:(e,t,r)=>{"use strict";e.exports=r.p+"sql-wasm.wasm"},821:()=>{},905:()=>{},101:()=>{}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(r.exports,r,r.exports,__webpack_require__),r.loaded=!0,r.exports}__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),__webpack_require__.p="";var __webpack_exports__=__webpack_require__(630);return __webpack_exports__})()}); \ No newline at end of file diff --git a/packages/akiradocs/scripts/extract-docs-context.js b/packages/akiradocs/scripts/extract-docs-context.js index 2bd7f4d..cdc252f 100644 --- a/packages/akiradocs/scripts/extract-docs-context.js +++ b/packages/akiradocs/scripts/extract-docs-context.js @@ -1,6 +1,33 @@ const fs = require('fs/promises'); const path = require('path'); const { glob } = require('glob'); +const sqlite3 = require('better-sqlite3'); + +class EmbeddingPipeline { + static task = 'feature-extraction'; + static model = 'sauravpanda/gte-small-onnx'; + static instance = null; + + static async getInstance(progress_callback = null) { + if (this.instance === null) { + // Optionally set cache directory + const { pipeline, env } = await import('@xenova/transformers'); + this.instance = await pipeline(this.task, this.model, { progress_callback }); + } + return this.instance; + } +} + +async function generateEmbedding(text) { + try { + const extractor = await EmbeddingPipeline.getInstance(); + const output = await extractor(text, { pooling: 'mean', normalize: true }); + return Array.from(output.data); + } catch (error) { + console.error('Error generating embedding:', error); + return null; + } +} async function extractTextFromBlocks(blocks) { if (!Array.isArray(blocks)) { @@ -67,26 +94,47 @@ async function main() { const contextDir = path.join(process.cwd(), 'public', 'context'); await fs.mkdir(contextDir, { recursive: true }); + const dbPath = path.join(contextDir, 'docs.db'); + const db = sqlite3(dbPath); + + db.exec(` + CREATE TABLE IF NOT EXISTS documents ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + path TEXT NOT NULL, + content TEXT NOT NULL, + embedding BLOB, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP + ) + `); + + // Initialize the embedding model once + console.log('Initializing embedding model...'); + // const extractor = await pipeline('feature-extraction', 'sauravpanda/gte-small-onnx'); + const enDocsDir = path.join(process.cwd(), 'compiled', 'en'); const docFiles = await glob('**/*.json', { cwd: enDocsDir, ignore: '**/_meta.json' }); - let combinedContent = []; + db.prepare('DELETE FROM documents').run(); + const insert = db.prepare('INSERT INTO documents (path, content, embedding) VALUES (?, ?, ?)'); + + console.log('Processing documents and generating embeddings...'); for (const file of docFiles) { const fullPath = path.join(enDocsDir, file); const content = await processDocFile(fullPath); if (content) { - combinedContent.push(`[Document: ${file}]\n${content}\n-------------`); + const embedding = await generateEmbedding(content); + insert.run(file, content, embedding ? JSON.stringify(embedding) : null); + console.log(`Processed: ${file}`); } } - const outputPath = path.join(contextDir, 'en_docs.txt'); - await fs.writeFile(outputPath, combinedContent.join('\n')); - - console.log('Documentation context has been extracted successfully!'); + db.exec(`CREATE INDEX IF NOT EXISTS idx_embedding ON documents(embedding)`); + console.log('Documentation context and embeddings have been stored in SQLite database!'); + db.close(); } catch (error) { console.error('Error processing documentation:', error); process.exit(1); diff --git a/packages/akiradocs/src/app/aiSearch/page.tsx b/packages/akiradocs/src/app/aiSearch/page.tsx index 5e849e3..4261df2 100644 --- a/packages/akiradocs/src/app/aiSearch/page.tsx +++ b/packages/akiradocs/src/app/aiSearch/page.tsx @@ -1,6 +1,6 @@ "use client" -import { useState } from 'react' +import { useState, useCallback } from 'react' import { SearchHeader } from '@/components/aiSearch/SearchHeader' import { SearchBar } from '@/components/aiSearch/SearchBar' import { LegacyDocsToggle } from '@/components/aiSearch/LegacyDocsToggle' @@ -17,10 +17,27 @@ import { Source } from '@/types/Source' import AILoader from '@/components/aiSearch/AILoader' import { getHeaderConfig } from '@/lib/headerConfig' import { Header } from '@/components/layout/Header' +import { generateEmbedding } from '@/lib/aisearch/embeddings' +import { getDbWorker } from '@/lib/aisearch/dbWorker' + +function cosineSimilarity(a: number[], b: number[]): number { + if (a.some(isNaN) || b.some(isNaN)) { + console.error("NaN values detected in vectors:"); + console.error("Vector A NaN indices:", a.map((val, i) => isNaN(val) ? i : null).filter(x => x !== null)); + console.error("Vector B NaN indices:", b.map((val, i) => isNaN(val) ? i : null).filter(x => x !== null)); + throw new Error("Invalid vectors containing NaN values"); + } + + const dotProduct = a.reduce((sum, val, i) => sum + val * b[i], 0); + const magnitudeA = Math.sqrt(a.reduce((sum, val) => sum + val * val, 0)); + const magnitudeB = Math.sqrt(b.reduce((sum, val) => sum + val * val, 0)); + return dotProduct / (magnitudeA * magnitudeB); +} export default function Home() { const [query, setQuery] = useState('') const [aiResponse, setAiResponse] = useState('') + const [loaderText, setLoaderText] = useState('Loading database ...') const [isLoading, setIsLoading] = useState(false) const [error, setError] = useState<string | null>(null) const recommendedArticles = getRecommendedArticles() @@ -28,6 +45,20 @@ export default function Home() { const headerConfig = getHeaderConfig() const config = getAkiradocsConfig() const [sources, setSources] = useState<Source[]>([]) + const handleGenerateEmbedding = useCallback(async (text: string) => { + try { + setIsLoading(true); + // console.log("Loading model for embedding"); + const embedding = await generateEmbedding(text, (progress) => {}); + return embedding; + } catch (error) { + console.error('Error generating embedding:', error); + throw error; + } + finally { + setLoaderText('Searching database for relevant information ...') + } + }, []); // If AI Search is disabled, show the disabled message if (!config.navigation.header.items.find((item: any) => item.href === '/aiSearch')?.show) { @@ -74,87 +105,157 @@ export default function Home() { setError(null) setSources([]) - try { - const contextResponse = await fetch('/context/en_docs.txt'); - if (!contextResponse.ok) { - throw new Error(`Failed to fetch context: ${contextResponse.status}`); - } - const contextData = await contextResponse.text(); - const docsContext = contextData; + const startTime = performance.now() + + try { + // Generate embedding for the query + const queryEmbedding = await handleGenerateEmbedding(query); + // console.log("Query embedding:", queryEmbedding) + // Get database worker + const worker = await getDbWorker(); + + // Get all documents + const allDocs = await worker.db.query(` + SELECT path, content, embedding + FROM documents + WHERE embedding IS NOT NULL + `); + + // Calculate similarity scores and filter results + const similarityThreshold = 0.5; + const scoredDocs = allDocs + .map((doc: any) => { + // Clean the embedding string and parse it + const cleanEmbeddingStr = doc.embedding.replace(/[\[\]]/g, ''); // Remove square brackets + const embeddingArray = cleanEmbeddingStr + .split(',') + .map((val: string) => { + const parsed = parseFloat(val.trim()); + if (isNaN(parsed)) { + console.error(`Invalid embedding value found: "${val}"`); + } + return parsed; + }); + + return { + ...doc, + similarity_score: cosineSimilarity(queryEmbedding, embeddingArray) + }; + }) + .filter((doc: any) => doc.similarity_score > similarityThreshold) + .sort((a: any, b: any) => b.similarity_score - a.similarity_score) + .slice(0, 5); + + console.log("RAG top 5 results:", scoredDocs); + + // If no relevant documents found, return early + if (scoredDocs.length === 0) { + setAiResponse("I cannot answer this question from the given documentation. The available content doesn't seem relevant enough to provide a accurate answer."); + setIsLoading(false); + return; + } + + setLoaderText('Loading the AI model ...') + + // Combine relevant documents into context + const docsContext = scoredDocs + .map((doc: any) => ` + Source: ${doc.path} + --- Content --- + ${doc.content} + --- End of Content --- + `) + .join('\n'); const engine = await CreateMLCEngine( "Llama-3.2-1B-Instruct-q4f16_1-MLC", - { initProgressCallback: (progress: any) => console.log(progress) - }, + { initProgressCallback: (progress: any) => { + console.log(progress) + setLoaderText(`Loading the AI model ${Math.round(progress.progress * 100)}% ...`) + } }, { - context_window_size: 100000, + context_window_size: 20000, } ); + + + const engineLoadTime = performance.now() // Track engine load time + console.log(`Time taken for engine initialization: ${(engineLoadTime - startTime) / 1000}s`) + setLoaderText('Processing information and generating AI response ...') const messages = [ { role: "system", - content: `You are a technical documentation assistant specialized in providing accurate, concise answers based on the official documentation. - Your responses should be: - 1. Direct and to the point - 2. Based strictly on the provided documentation context - 3. Include relevant code examples when available - 4. Written in a technical but clear style - - Documentation context: ${docsContext}` + content: `You are a technical documentation assistant for AkiraDocs. Your purpose is to: +1. Provide accurate, helpful answers using ONLY the provided documentation +2. Stay positive and factual based on the documentation provided. +3. Make sure the markdown answer is pretty, clean and easy to read.` }, { role: "user", - content: `Answer the following question using only the provided documentation context. + content: ` + Please provide a helpful answer which is short and concise to the following question using only the provided documentation. + Question: ${query} - Requirements for your response: - 1. If the answer isn't clearly supported by the documentation, say "I don't have enough information to answer this question accurately." - 2. Don't make assumptions or provide information not found in the documentation - 3. If relevant, include short code snippets to illustrate your answer. - 4. Only answer questions related to the Documentaion Context. - 5. Try to be concise and to the point. + Answer the question using only the provided documentation. + + Do not make assumptions or add information not in the documentation. + + If relevant, include short code snippets. Only add code snippets if it is helpful to the question. + + Dont add any notes or comments to the answer. + + Make sure the question is answered properly avoiding unnecessary information. + + Ensure the final output is in markdown format. Make sure it pretty and clean. - After your answer, if you used any sources from the documentation, list them in this format: + End of the answer, if you used any sources from the documentation, list them in this format: ------------- Sources: - - <title> (<path>)` + - <title> (<path>) + + Here is the documentation, only answer based on this information: + ${docsContext} + ` } ]; - console.log("messages", messages) + // console.log("Messages:", messages) const chunks = await engine.chat.completions.create({ messages: messages as ChatCompletionMessageParam[], stream: true, - stream_options: { include_usage: true } + stream_options: { include_usage: true }, + max_tokens: 500, + temperature: 0.7, + top_p: 0.95, + frequency_penalty: 0.5, + presence_penalty: 0.5, }); let aiContent = ""; for await (const chunk of chunks) { const newContent = chunk.choices[0]?.delta.content || ""; aiContent += newContent; - // Update the response in real-time - setAiResponse(aiContent); - } - - // Extract sources after the full response is received - const { cleanResponse, sources } = extractSources(aiContent); + + // Process partial content for streaming + const { cleanResponse } = extractSources(aiContent); setAiResponse(cleanResponse); + } + + // Only extract and set sources after streaming is complete + const { sources } = extractSources(aiContent); setSources(sources); - } catch (error) { - console.error('Error during AI search:', error); - - // Check for WebGPU error - if (error instanceof Error && error.name === 'WebGPUNotAvailableError') { - setError('WebGPU is not yet supported on this browser. Please try using another browser.'); - } else { - setError('Sorry, there was an error processing your request.'); - } - setAiResponse(''); + const endTime = performance.now() // Track total time + console.log(`Total time taken for AI search: ${(endTime - startTime) / 1000}s`) + + } catch (error) { + console.error('Search error:', error); + setError(error instanceof Error ? error.message : 'An error occurred'); } finally { - setIsLoading(false) + setIsLoading(false); } } @@ -187,7 +288,7 @@ export default function Home() { <div className="flex flex-col justify-center items-center space-y-4 py-12"> <AILoader /> <p className="text-muted-foreground text-sm animate-pulse"> - Loading AI response... + {loaderText} </p> </div> ) : error ? ( diff --git a/packages/akiradocs/src/components/aiSearch/AIResponse.tsx b/packages/akiradocs/src/components/aiSearch/AIResponse.tsx index ca46310..e78f31f 100644 --- a/packages/akiradocs/src/components/aiSearch/AIResponse.tsx +++ b/packages/akiradocs/src/components/aiSearch/AIResponse.tsx @@ -8,6 +8,7 @@ import { AIResponseActions } from "./AIResponseActions" import { AIResponseSources } from "./AIResponseSources" import ReactMarkdown from 'react-markdown' import { Source } from "@/types/Source" +import { memo } from 'react' interface AIResponseProps { response: string @@ -15,6 +16,20 @@ interface AIResponseProps { onBack: () => void } +// Memoize the markdown component to prevent unnecessary re-renders +const MemoizedMarkdown = memo(({ content }: { content: string }) => ( + <ReactMarkdown + components={{ + pre({ children }) { + return <div className="not-prose">{children}</div> + } + }} + > + {content} + </ReactMarkdown> +)) +MemoizedMarkdown.displayName = 'MemoizedMarkdown' + export function AIResponse({ response, sources, onBack }: AIResponseProps) { return ( <motion.div @@ -35,8 +50,21 @@ export function AIResponse({ response, sources, onBack }: AIResponseProps) { </Button> </CardHeader> <CardContent className="pt-6"> - <div className="prose dark:prose-invert max-w-none"> - <ReactMarkdown>{response}</ReactMarkdown> + <div className="prose dark:prose-invert max-w-none + prose-headings:font-semibold + prose-h1:text-xl prose-h1:mt-8 prose-h1:mb-4 + prose-h2:text-lg prose-h2:mt-6 prose-h2:mb-3 + prose-p:my-4 prose-p:leading-relaxed + prose-ul:space-y-2 prose-ul:list-disc prose-ul:pl-6 + prose-ol:space-y-2 prose-ol:list-decimal prose-ol:pl-6 + prose-li:pl-2 + [&_pre]:bg-secondary [&_pre]:p-4 [&_pre]:rounded-lg [&_pre]:my-4 + [&_code:not(pre_code)]:bg-secondary [&_code:not(pre_code)]:px-1.5 [&_code:not(pre_code)]:py-0.5 [&_code:not(pre_code)]:rounded-sm + [&_pre_code]:bg-transparent [&_pre_code]:p-0 [&_pre_code]:rounded-none + [&>*:first-child]:mt-0 + [&>p>strong]:block [&>p>strong]:mt-8 [&>p>strong]:mb-4 [&>p>strong]:text-lg + [&>p:has(>strong:only-child)]:m-0"> + <MemoizedMarkdown content={response} /> </div> </CardContent> <CardFooter className="flex flex-col items-start space-y-4"> diff --git a/packages/akiradocs/src/components/aiSearch/AIResponseSources.tsx b/packages/akiradocs/src/components/aiSearch/AIResponseSources.tsx index 5b160ed..d146d15 100644 --- a/packages/akiradocs/src/components/aiSearch/AIResponseSources.tsx +++ b/packages/akiradocs/src/components/aiSearch/AIResponseSources.tsx @@ -12,7 +12,7 @@ export function AIResponseSources({ sources }: AIResponseSourcesProps) { {sources.map((source, index) => ( <li key={index}> <a - href={source.url} + href={`${window.location.origin}/en/${source.url.replace('%20', '')}?utm_source=akiradocs`} target="_blank" rel="noopener noreferrer" className="text-sm text-indigo-600 dark:text-indigo-400 hover:underline" diff --git a/packages/akiradocs/src/lib/aisearch/dbWorker.ts b/packages/akiradocs/src/lib/aisearch/dbWorker.ts new file mode 100644 index 0000000..9e6a3b2 --- /dev/null +++ b/packages/akiradocs/src/lib/aisearch/dbWorker.ts @@ -0,0 +1,35 @@ +import { createDbWorker } from "sql.js-httpvfs"; +import { SplitFileConfig } from "sql.js-httpvfs/dist/sqlite.worker"; + +let dbInstance: any = null; + +export async function getDbWorker() { + if (dbInstance) return dbInstance; + + const workerUrl = new URL( + "sql.js-httpvfs/dist/sqlite.worker.js", + import.meta.url + ); + const wasmUrl = new URL( + "sql.js-httpvfs/dist/sql-wasm.wasm", + import.meta.url + ); + + const config: SplitFileConfig = { + from: "inline" as const, + config: { + serverMode: "full", + requestChunkSize: 4096, + url: "/context/docs.db" + } + }; + + const worker = await createDbWorker( + [config], + workerUrl.toString(), + wasmUrl.toString() + ); + + dbInstance = worker; + return dbInstance; +} \ No newline at end of file diff --git a/packages/akiradocs/src/lib/aisearch/embeddings.ts b/packages/akiradocs/src/lib/aisearch/embeddings.ts new file mode 100644 index 0000000..f93f006 --- /dev/null +++ b/packages/akiradocs/src/lib/aisearch/embeddings.ts @@ -0,0 +1,34 @@ +export interface ProgressCallback { + file: string; + progress: number; + loaded: number; + total: number; +} + +export async function generateEmbedding( + text: string, + onProgress?: (progress: ProgressCallback) => void +): Promise<number[]> { + return new Promise((resolve, reject) => { + const worker = new Worker( + new URL('./embeddings.worker.ts', import.meta.url), + { type: 'module' } + ); + + worker.addEventListener('message', (event) => { + if (event.data.status === 'progress' && onProgress) { + onProgress(event.data.progress); + } else if (event.data.status === 'complete') { + resolve(event.data.output); + worker.terminate(); + } + }); + + worker.addEventListener('error', (error) => { + reject(error); + worker.terminate(); + }); + + worker.postMessage({ text }); + }); +} \ No newline at end of file diff --git a/packages/akiradocs/src/lib/aisearch/embeddings.worker.ts b/packages/akiradocs/src/lib/aisearch/embeddings.worker.ts new file mode 100644 index 0000000..52b26d6 --- /dev/null +++ b/packages/akiradocs/src/lib/aisearch/embeddings.worker.ts @@ -0,0 +1,30 @@ +import { pipeline, ProgressCallback, type PipelineType } from "@huggingface/transformers"; + +class EmbeddingPipelineSingleton { + static task: PipelineType = 'feature-extraction'; + static model = 'sauravpanda/gte-small-onnx'; + static instance: Promise<any> | null = null; + + static async getInstance(progress_callback: ProgressCallback | null = null) { + this.instance ??= pipeline(this.task, this.model, { + progress_callback: progress_callback ?? undefined + }); + return this.instance; + } +} + +self.addEventListener('message', async (event) => { + const embedder = await EmbeddingPipelineSingleton.getInstance(x => { + self.postMessage({ status: 'progress', progress: x }); + }); + + const output = await embedder(event.data.text, { + pooling: 'mean', + normalize: true + }); + + self.postMessage({ + status: 'complete', + output: Array.from(output.data), + }); +}); \ No newline at end of file diff --git a/packages/create-app/package.json b/packages/create-app/package.json index f6c40d3..9f8a964 100644 --- a/packages/create-app/package.json +++ b/packages/create-app/package.json @@ -1,6 +1,6 @@ { "name": "create-akiradocs", - "version": "1.0.52", + "version": "1.0.53", "description": "Create Akira Docs documentation sites with one command", "main": "./dist/index.js", "type": "module",