diff --git a/.gitignore b/.gitignore index a1c2eaee3..e30c60964 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,8 @@ packages/cocos-cli-types/**/* # static static/tools/ +static/web/scene-bundle.js +static/web/scene-bundle.js.map # 构建文件 /dist diff --git a/package-lock.json b/package-lock.json index 155946f74..7209e7894 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,14 +13,14 @@ "@babel/core": "7.22.20", "@cocos/asset-db": "^3.0.0-alpha.7", "@cocos/build-polyfills": "2.0.0", - "@cocos/ccbuild": "2.3.17", - "@cocos/creator-programming-rollup-plugin-mod-lo": "1.4.4", + "@cocos/ccbuild": "2.3.18", + "@cocos/creator-programming-rollup-plugin-mod-lo": "1.4.6", "@cocos/data-uri": "^1.0.6", "@cocos/fbx-gltf-conv": "^1.0.0-alpha.49.editor.1", "@cocos/fbx2gltf": "^1.0.8", - "@cocos/lib-programming": "3.8.13", + "@cocos/lib-programming": "3.8.15", "@cocos/module-system": "^0.0.21", - "@cocos/quick-compiler": "^4.2.24", + "@cocos/quick-compiler": "^4.2.26", "@ffprobe-installer/ffprobe": "^1.4.1", "@microsoft/api-extractor": "^7.55.0", "@modelcontextprotocol/sdk": "^1.18.0", @@ -2397,9 +2397,9 @@ } }, "node_modules/@cocos/ccbuild": { - "version": "2.3.17", - "resolved": "https://registry.npmmirror.com/@cocos/ccbuild/-/ccbuild-2.3.17.tgz", - "integrity": "sha512-Gbl3ROtQAsk+DdesYHm+yXquD0ojkw9XBOTz0e4E1Nu+oZ9zoRcqL6Hql3A3FCxpRgRhLZt7GgwVC3vHa0T4Ww==", + "version": "2.3.18", + "resolved": "https://registry.npmmirror.com/@cocos/ccbuild/-/ccbuild-2.3.18.tgz", + "integrity": "sha512-daopEI22kQEnCNVbT1wSW0ETNgHi/yQBHNDS6M/mC0cCEgv1L9QtLNcwp1iP27tdHm6t5YCYLKprpdNAyeutQA==", "license": "MIT", "workspaces": [ "./modules/*" @@ -2858,17 +2858,6 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "license": "ISC" }, - "node_modules/@cocos/creator-programming-babel-preset-cc": { - "version": "1.0.3", - "resolved": "https://registry.npmmirror.com/@cocos/creator-programming-babel-preset-cc/-/creator-programming-babel-preset-cc-1.0.3.tgz", - "integrity": "sha512-MBDRX/2aDTMN5XTCE9QFre66xlHIFv3aTryxdL21i1g2H1pNu8H4dj+uMlHZ20JnbbxBj/9V1ZO0XQBc0Q+2kg==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/plugin-proposal-decorators": "^7.8.3", - "@babel/plugin-transform-typescript": "^7.18.4", - "babel-plugin-const-enum": "^1.0.1" - } - }, "node_modules/@cocos/creator-programming-common": { "version": "1.2.4", "resolved": "https://registry.npmmirror.com/@cocos/creator-programming-common/-/creator-programming-common-1.2.4.tgz", @@ -2889,9 +2878,10 @@ } }, "node_modules/@cocos/creator-programming-mod-lo": { - "version": "1.12.2", - "resolved": "https://registry.npmmirror.com/@cocos/creator-programming-mod-lo/-/creator-programming-mod-lo-1.12.2.tgz", - "integrity": "sha512-rVwCwtbZy3NuqDJgIzcku/Y6Q9o5DV0AAQ0W3SpzAmig9Rf4B1cXvw73gRz9w2R47Ac0/vW2xYe4h9nQJ994dQ==", + "version": "1.12.5", + "resolved": "https://registry.npmmirror.com/@cocos/creator-programming-mod-lo/-/creator-programming-mod-lo-1.12.5.tgz", + "integrity": "sha512-gcCtaRdkicyxr7DGDKf7luYNejk1Zi8RcuN0a/mV8DFVoyqJYtZ42ffClKsL4jRIhDH0QdOpkLdndS6VgpZ8Ew==", + "license": "ISC", "dependencies": { "@babel/core": "^7.14.8", "@babel/generator": "~7.16.0", @@ -2902,7 +2892,7 @@ "@babel/plugin-transform-modules-systemjs": "~7.16.0", "@babel/preset-env": "^7.14.8", "@babel/template": "~7.16.0", - "@cocos/creator-programming-babel-preset-cc": "1.0.3", + "@cocos/creator-programming-babel-preset-cc": "1.0.7", "@cocos/creator-programming-common": "^1.2.4", "@cocos/creator-programming-import-maps": "^1.0.1", "acorn": "^8.4.1", @@ -2922,6 +2912,7 @@ "version": "7.16.8", "resolved": "https://registry.npmmirror.com/@babel/generator/-/generator-7.16.8.tgz", "integrity": "sha512-1ojZwE9+lOXzcWdWmO6TbUzDfqLD39CmEhN8+2cX9XkDo5yW1OpgfejfliysR2AWLpMamTiOiAp/mtroaymhpw==", + "license": "MIT", "dependencies": { "@babel/types": "^7.16.8", "jsesc": "^2.5.1", @@ -2935,6 +2926,7 @@ "version": "0.5.7", "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.5.7.tgz", "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } @@ -2943,6 +2935,7 @@ "version": "7.16.12", "resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.16.12.tgz", "integrity": "sha512-VfaV15po8RiZssrkPweyvbGVSe4x2y+aciFCgn0n0/SJMR22cwofRV1mtnJQYcSB1wUTaA/X1LnA3es66MCO5A==", + "license": "MIT", "bin": { "parser": "bin/babel-parser.js" }, @@ -2954,6 +2947,7 @@ "version": "7.16.7", "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.16.7.tgz", "integrity": "sha512-DuK5E3k+QQmnOqBR9UkusByy5WZWGRxfzV529s9nPra1GE7olmxfqO2FHobEOYSPIjPBTr4p66YDcjQnt8cBmw==", + "license": "MIT", "dependencies": { "@babel/helper-hoist-variables": "^7.16.7", "@babel/helper-module-transforms": "^7.16.7", @@ -2972,6 +2966,7 @@ "version": "7.16.7", "resolved": "https://registry.npmmirror.com/@babel/template/-/template-7.16.7.tgz", "integrity": "sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w==", + "license": "MIT", "dependencies": { "@babel/code-frame": "^7.16.7", "@babel/parser": "^7.16.7", @@ -2981,10 +2976,26 @@ "node": ">=6.9.0" } }, + "node_modules/@cocos/creator-programming-mod-lo/node_modules/@cocos/creator-programming-babel-preset-cc": { + "version": "1.0.7", + "resolved": "https://registry.npmmirror.com/@cocos/creator-programming-babel-preset-cc/-/creator-programming-babel-preset-cc-1.0.7.tgz", + "integrity": "sha512-emWZEktqxb17xzpXlz6t+IQ0u/j871qmN2BOtAl3EjI8/sigtDhVykvsYbs2+lDj5zfWBDSCJQNb6V2QjKoeIg==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.3", + "@babel/plugin-proposal-decorators": "^7.8.3", + "@babel/plugin-transform-class-properties": "^7.18.6", + "@babel/plugin-transform-private-methods": "^7.18.6", + "@babel/plugin-transform-private-property-in-object": "^7.18.6", + "@babel/plugin-transform-typescript": "^7.18.4", + "babel-plugin-const-enum": "^1.0.1" + } + }, "node_modules/@cocos/creator-programming-mod-lo/node_modules/brace-expansion": { "version": "2.0.2", "resolved": "https://registry.npmmirror.com/brace-expansion/-/brace-expansion-2.0.2.tgz", "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } @@ -2993,6 +3004,7 @@ "version": "9.1.0", "resolved": "https://registry.npmmirror.com/fs-extra/-/fs-extra-9.1.0.tgz", "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "license": "MIT", "dependencies": { "at-least-node": "^1.0.0", "graceful-fs": "^4.2.0", @@ -3007,6 +3019,7 @@ "version": "11.1.0", "resolved": "https://registry.npmmirror.com/globby/-/globby-11.1.0.tgz", "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "license": "MIT", "dependencies": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", @@ -3026,6 +3039,7 @@ "version": "2.5.2", "resolved": "https://registry.npmmirror.com/jsesc/-/jsesc-2.5.2.tgz", "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "license": "MIT", "bin": { "jsesc": "bin/jsesc" }, @@ -3034,11 +3048,12 @@ } }, "node_modules/@cocos/creator-programming-mod-lo/node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmmirror.com/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "version": "9.0.9", + "resolved": "https://registry.npmmirror.com/minimatch/-/minimatch-9.0.9.tgz", + "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==", + "license": "ISC", "dependencies": { - "brace-expansion": "^2.0.1" + "brace-expansion": "^2.0.2" }, "engines": { "node": ">=16 || 14 >=14.17" @@ -3051,21 +3066,22 @@ "version": "3.0.0", "resolved": "https://registry.npmmirror.com/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/@cocos/creator-programming-quick-pack": { - "version": "1.7.13", - "resolved": "https://registry.npmmirror.com/@cocos/creator-programming-quick-pack/-/creator-programming-quick-pack-1.7.13.tgz", - "integrity": "sha512-fYwQSdvIxljiE8GuG+KjxWclK5e6v2jx9YP7yQ5RBij2CiCCWLiJ6Oks6kNvccXILYdZA6Ef9LJRi6JfnQeoUQ==", + "version": "1.7.15", + "resolved": "https://registry.npmmirror.com/@cocos/creator-programming-quick-pack/-/creator-programming-quick-pack-1.7.15.tgz", + "integrity": "sha512-D/aEBGlB9q7oFc7EdquJIiKk5y4QQLi8QRjh4CxXJ9t3yyp2zssoj69/fwYpxCFHVAabC742QrEHcMkeDyLYYg==", "license": "ISC", "dependencies": { "@babel/plugin-proposal-dynamic-import": "^7.14.5", "@babel/plugin-transform-modules-systemjs": "^7.14.5", "@cocos/creator-programming-common": "^1.2.4", "@cocos/creator-programming-import-maps": "^1.0.1", - "@cocos/creator-programming-mod-lo": "1.12.2", + "@cocos/creator-programming-mod-lo": "1.12.5", "fs-extra": "9.0.1", "proper-lockfile": "^4.1.2", "relateurl": "^0.2.7", @@ -3097,14 +3113,14 @@ } }, "node_modules/@cocos/creator-programming-rollup-plugin-mod-lo": { - "version": "1.4.4", - "resolved": "https://registry.npmmirror.com/@cocos/creator-programming-rollup-plugin-mod-lo/-/creator-programming-rollup-plugin-mod-lo-1.4.4.tgz", - "integrity": "sha512-UX/oMG2MphAjuSOfkWsDP3N3rCcOzP162yToxLHmqS08mX0TdsCY3BN2EPlx3iI8nWKXBZvygxrP6cD5GzFUbA==", + "version": "1.4.6", + "resolved": "https://registry.npmmirror.com/@cocos/creator-programming-rollup-plugin-mod-lo/-/creator-programming-rollup-plugin-mod-lo-1.4.6.tgz", + "integrity": "sha512-4kfFSBYmYwEEHatYiVKl8NdvnxG9Y5cDYnbZMaRBG4ywoHGdliLBh43gviunm7AC4ZyOZPgdyR7BrzifgaWMMg==", "license": "ISC", "dependencies": { "@babel/core": "~7.16.0", "@cocos/creator-programming-common": "^1.2.4", - "@cocos/creator-programming-mod-lo": "1.12.2" + "@cocos/creator-programming-mod-lo": "1.12.5" } }, "node_modules/@cocos/creator-programming-rollup-plugin-mod-lo/node_modules/@babel/core": { @@ -3177,14 +3193,14 @@ } }, "node_modules/@cocos/lib-programming": { - "version": "3.8.13", - "resolved": "https://registry.npmmirror.com/@cocos/lib-programming/-/lib-programming-3.8.13.tgz", - "integrity": "sha512-Fclj9yv0fWR+iVFSBsqrKGPZ29oUn9mAa5dZ6oioQA0FrchLR1lCAcW+uBmJ7WMxnzgNwTpVHLGi719unyFIOA==", + "version": "3.8.15", + "resolved": "https://registry.npmmirror.com/@cocos/lib-programming/-/lib-programming-3.8.15.tgz", + "integrity": "sha512-lrPkqMkl5m5PkpeS/ZdDYL+w5axey5T3Y2T/bEkhKk8GX6ilvjgqSzZRa2HuP+AYefA3WjfOzRfjmaV2lU9SzA==", "license": "MIT", "dependencies": { "@babel/core": "^7.13.14", "@babel/plugin-transform-modules-systemjs": "^7.13.8", - "@cocos/creator-programming-quick-pack": "1.7.13", + "@cocos/creator-programming-quick-pack": "1.7.15", "@cocos/systemjs-source": "6.8.3-source.tla-bug.4", "@rollup/plugin-replace": "^2.3.3", "cjs-module-lexer": "^1.0.0", @@ -3308,9 +3324,9 @@ } }, "node_modules/@cocos/quick-compiler": { - "version": "4.2.24", - "resolved": "https://registry.npmmirror.com/@cocos/quick-compiler/-/quick-compiler-4.2.24.tgz", - "integrity": "sha512-4R6tuYS3qfbZC5tQTH6YrmBl/qDig1nqJLkipnYJuLBzvszVcXmdybv/q3Wf12Yzl6KbHtrjKKhU8Rr/lfDLGA==", + "version": "4.2.26", + "resolved": "https://registry.npmmirror.com/@cocos/quick-compiler/-/quick-compiler-4.2.26.tgz", + "integrity": "sha512-8Mdp1WnRPUWSVWlNFW6EDbnD49URD+cgoyBvWY1Nwfg64ELmgkXa0OODzCqtAONiDYlb016Y5CqbO158hWl0bw==", "license": "ISC", "dependencies": { "@babel/core": "^7.13.10", @@ -3321,7 +3337,7 @@ "@babel/plugin-transform-modules-umd": "^7.9.0", "@babel/preset-env": "^7.8.7", "@cocos/babel-plugin-dynamic-import-vars": "^1.0.2", - "@cocos/creator-programming-babel-preset-cc": "1.0.3", + "@cocos/creator-programming-babel-preset-cc": "1.0.7", "@cocos/transform-utilities": "1.0.57", "@rollup/plugin-babel": "^5.2.1", "@rollup/plugin-commonjs": "^16.0.0", @@ -3341,6 +3357,21 @@ "@cocos/ccbuild": "*" } }, + "node_modules/@cocos/quick-compiler/node_modules/@cocos/creator-programming-babel-preset-cc": { + "version": "1.0.7", + "resolved": "https://registry.npmmirror.com/@cocos/creator-programming-babel-preset-cc/-/creator-programming-babel-preset-cc-1.0.7.tgz", + "integrity": "sha512-emWZEktqxb17xzpXlz6t+IQ0u/j871qmN2BOtAl3EjI8/sigtDhVykvsYbs2+lDj5zfWBDSCJQNb6V2QjKoeIg==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.3", + "@babel/plugin-proposal-decorators": "^7.8.3", + "@babel/plugin-transform-class-properties": "^7.18.6", + "@babel/plugin-transform-private-methods": "^7.18.6", + "@babel/plugin-transform-private-property-in-object": "^7.18.6", + "@babel/plugin-transform-typescript": "^7.18.4", + "babel-plugin-const-enum": "^1.0.1" + } + }, "node_modules/@cocos/quick-compiler/node_modules/@rollup/plugin-babel": { "version": "5.3.1", "resolved": "https://registry.npmmirror.com/@rollup/plugin-babel/-/plugin-babel-5.3.1.tgz", @@ -9783,6 +9814,7 @@ "version": "2.3.3", "resolved": "https://registry.npmmirror.com/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz", "integrity": "sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ==", + "license": "MIT", "dependencies": { "object.assign": "^4.1.0" } diff --git a/package.json b/package.json index 298497abb..5d2fe1d32 100644 --- a/package.json +++ b/package.json @@ -32,8 +32,8 @@ "compiler": "FORCE_UPDATE=true npm i", "compiler:engine": "node --max-old-space-size=8192 workflow/compiler-engine.js --force", "build:cc-module": "node workflow/build-cc-module.js", - "build": "npm run build:clear && node workflow/prepare-dts.js && tsc -b && node workflow/generate-schema.js", - "compile": "npm run build:clear && node workflow/prepare-dts.js && tsc -b && node workflow/generate-schema.js", + "build": "npm run build:clear && node workflow/prepare-dts.js && tsc -b && node workflow/build-scene-bundle.js && node workflow/generate-schema.js", + "compile": "npm run build:clear && node workflow/prepare-dts.js && tsc -b && node workflow/build-scene-bundle.js && node workflow/generate-schema.js", "build:clear": "node workflow/build-clear.js", "build:watch": "tsc -b --watch", "postinstall": "node workflow/postinstall.js", @@ -41,6 +41,7 @@ "pack:script": "node workflow/pack-scripts.js", "release": "npx --yes gulp release --gulpfile workflow/release.js", "start:mcp-debug": "node ./dist/cli.js start-mcp-server --project=./tests/fixtures/projects/asset-operation", + "start:preview": "node ./dist/cli.js preview --project=./tests/fixtures/projects/asset-operation", "start:mcp-inspector": "npx @modelcontextprotocol/inspector", "cli": "node ./dist/cli.js", "rebuild": "node workflow/electron-rebuild.js" @@ -106,14 +107,14 @@ "@babel/core": "7.22.20", "@cocos/asset-db": "^3.0.0-alpha.7", "@cocos/build-polyfills": "2.0.0", - "@cocos/ccbuild": "2.3.17", - "@cocos/creator-programming-rollup-plugin-mod-lo": "1.4.4", + "@cocos/ccbuild": "2.3.18", + "@cocos/creator-programming-rollup-plugin-mod-lo": "1.4.6", "@cocos/data-uri": "^1.0.6", "@cocos/fbx-gltf-conv": "^1.0.0-alpha.49.editor.1", "@cocos/fbx2gltf": "^1.0.8", - "@cocos/lib-programming": "3.8.13", + "@cocos/lib-programming": "3.8.15", "@cocos/module-system": "^0.0.21", - "@cocos/quick-compiler": "^4.2.24", + "@cocos/quick-compiler": "^4.2.26", "@ffprobe-installer/ffprobe": "^1.4.1", "@microsoft/api-extractor": "^7.55.0", "@modelcontextprotocol/sdk": "^1.18.0", diff --git a/packages/engine-compiler/src/core/compiler.ts b/packages/engine-compiler/src/core/compiler.ts index 969838d70..e8cc22c1f 100644 --- a/packages/engine-compiler/src/core/compiler.ts +++ b/packages/engine-compiler/src/core/compiler.ts @@ -1,12 +1,12 @@ import { QuickCompiler } from '@cocos/quick-compiler'; import { StatsQuery } from '@cocos/ccbuild'; import { editorBrowserslistQuery } from '@cocos/lib-programming/dist/utils'; -import { dirname, join } from 'path'; -import { emptyDir, ensureDir, outputFile, readFile, readJSONSync, remove, existsSync, mkdirSync, copyFileSync } from 'fs-extra'; +import * as ps from 'path'; +import * as fsExtra from 'fs-extra'; import { IFeatureItem, IModuleItem, ModuleRenderConfig } from './modules'; const VERSION = '3'; -const TEMP_ENGINE_CONFIG: any = { "configs": { "defaultConfig": { "name": "默认配置", "cache": { "base": { "_value": true }, "gfx-webgl": { "_value": true }, "gfx-webgl2": { "_value": false }, "gfx-webgpu": { "_value": false }, "animation": { "_value": true }, "skeletal-animation": { "_value": true }, "3d": { "_value": true }, "meshopt": { "_value": false }, "2d": { "_value": true }, "sorting-2d": { "_value": false }, "rich-text": { "_value": true }, "mask": { "_value": true }, "graphics": { "_value": true }, "ui-skew": { "_value": true }, "affine-transform": { "_value": true }, "ui": { "_value": true }, "particle": { "_value": true }, "physics": { "_value": true, "_option": "physics-physx" }, "physics-ammo": { "_value": true, "_flags": { "LOAD_BULLET_MANUALLY": false } }, "physics-cannon": { "_value": false }, "physics-physx": { "_value": false, "_flags": { "LOAD_PHYSX_MANUALLY": false } }, "physics-builtin": { "_value": false }, "physics-2d": { "_value": true, "_option": "physics-2d-box2d" }, "physics-2d-box2d": { "_value": true }, "physics-2d-box2d-wasm": { "_value": false, "_flags": { "LOAD_BOX2D_MANUALLY": false } }, "physics-2d-builtin": { "_value": false }, "physics-2d-box2d-jsb": { "_value": false }, "intersection-2d": { "_value": true }, "primitive": { "_value": true }, "profiler": { "_value": true }, "occlusion-query": { "_value": false }, "geometry-renderer": { "_value": false }, "debug-renderer": { "_value": false }, "particle-2d": { "_value": true }, "audio": { "_value": true }, "video": { "_value": true }, "webview": { "_value": true }, "tween": { "_value": true }, "websocket": { "_value": true }, "websocket-server": { "_value": false }, "terrain": { "_value": true }, "light-probe": { "_value": true }, "tiled-map": { "_value": true }, "vendor-google": { "_value": false }, "spine": { "_value": true, "_option": "spine-3.8" }, "spine-3.8": { "_value": true, "_flags": { "LOAD_SPINE_MANUALLY": false } }, "spine-4.2": { "_value": false, "_flags": { "LOAD_SPINE_MANUALLY": false } }, "dragon-bones": { "_value": true }, "marionette": { "_value": true }, "procedural-animation": { "_value": true }, "custom-pipeline-post-process": { "_value": false }, "render-pipeline": { "_value": true, "_option": "custom-pipeline" }, "custom-pipeline": { "_value": true }, "legacy-pipeline": { "_value": false }, "xr": { "_value": false } }, "flags": { "LOAD_BULLET_MANUALLY": false, "LOAD_SPINE_MANUALLY": false, "LOAD_PHYSX_MANUALLY": false }, "includeModules": ["2d", "3d", "affine-transform", "animation", "audio", "base", "custom-pipeline", "dragon-bones", "gfx-webgl", "graphics", "intersection-2d", "light-probe", "marionette", "mask", "particle", "particle-2d", "physics-2d-box2d", "physics-physx", "primitive", "procedural-animation", "profiler", "rich-text", "skeletal-animation", "spine-3.8", "terrain", "tiled-map", "tween", "ui", "ui-skew", "video", "websocket", "webview"], "noDeprecatedFeatures": { "value": false, "version": "" } } }, "globalConfigKey": "defaultConfig", "graphics": { "pipeline": "custom-pipeline", "custom-pipeline-post-process": false } }; +const TEMP_ENGINE_CONFIG: any = { configs: { defaultConfig: { name: '默认配置', cache: { base: { _value: true }, 'gfx-webgl': { _value: true }, 'gfx-webgl2': { _value: false }, 'gfx-webgpu': { _value: false }, animation: { _value: true }, 'skeletal-animation': { _value: true }, '3d': { _value: true }, meshopt: { _value: false }, '2d': { _value: true }, 'sorting-2d': { _value: false }, 'rich-text': { _value: true }, mask: { _value: true }, graphics: { _value: true }, 'ui-skew': { _value: true }, 'affine-transform': { _value: true }, ui: { _value: true }, particle: { _value: true }, physics: { _value: true, _option: 'physics-physx' }, 'physics-ammo': { _value: true, _flags: { LOAD_BULLET_MANUALLY: false } }, 'physics-cannon': { _value: false }, 'physics-physx': { _value: false, _flags: { LOAD_PHYSX_MANUALLY: false } }, 'physics-builtin': { _value: false }, 'physics-2d': { _value: true, _option: 'physics-2d-box2d' }, 'physics-2d-box2d': { _value: true }, 'physics-2d-box2d-wasm': { _value: false, _flags: { LOAD_BOX2D_MANUALLY: false } }, 'physics-2d-builtin': { _value: false }, 'physics-2d-box2d-jsb': { _value: false }, 'intersection-2d': { _value: true }, primitive: { _value: true }, profiler: { _value: true }, 'occlusion-query': { _value: false }, 'geometry-renderer': { _value: false }, 'debug-renderer': { _value: false }, 'particle-2d': { _value: true }, audio: { _value: true }, video: { _value: true }, webview: { _value: true }, tween: { _value: true }, websocket: { _value: true }, 'websocket-server': { _value: false }, terrain: { _value: true }, 'light-probe': { _value: true }, 'tiled-map': { _value: true }, 'vendor-google': { _value: false }, spine: { _value: true, _option: 'spine-3.8' }, 'spine-3.8': { _value: true, _flags: { LOAD_SPINE_MANUALLY: false } }, 'spine-4.2': { _value: false, _flags: { LOAD_SPINE_MANUALLY: false } }, 'dragon-bones': { _value: true }, marionette: { _value: true }, 'procedural-animation': { _value: true }, 'custom-pipeline-post-process': { _value: false }, 'render-pipeline': { _value: true, _option: 'custom-pipeline' }, 'custom-pipeline': { _value: true }, 'legacy-pipeline': { _value: false }, xr: { _value: false } }, flags: { LOAD_BULLET_MANUALLY: false, LOAD_SPINE_MANUALLY: false, LOAD_PHYSX_MANUALLY: false }, includeModules: ['2d', '3d', 'affine-transform', 'animation', 'audio', 'base', 'custom-pipeline', 'dragon-bones', 'gfx-webgl', 'graphics', 'intersection-2d', 'light-probe', 'marionette', 'mask', 'particle', 'particle-2d', 'physics-2d-box2d', 'physics-physx', 'primitive', 'procedural-animation', 'profiler', 'rich-text', 'skeletal-animation', 'spine-3.8', 'terrain', 'tiled-map', 'tween', 'ui', 'ui-skew', 'video', 'websocket', 'webview'], noDeprecatedFeatures: { value: false, version: '' } } }, globalConfigKey: 'defaultConfig', graphics: { pipeline: 'custom-pipeline', 'custom-pipeline-post-process': false } }; interface IRebuildOptions { debugNative?: boolean; isNativeScene?: boolean; @@ -23,42 +23,46 @@ export class EngineCompiler { private editorFeaturesCache: string[] = []; private outDir: string = ''; private statsQuery: StatsQuery | null = null; + private isWeb: boolean; + private constructor( private enginePath: string, + isWeb: boolean = false, ) { - this.outDir = join(enginePath, 'bin', '.cache', 'dev-cli'); + this.outDir = ps.join(enginePath, 'bin', '.cache', 'dev-cli'); + this.isWeb = isWeb; } public getOutDir(): string { return this.outDir; } - static create(path: string) { - return new EngineCompiler(path); + static create(path: string, isWeb?: boolean) { + return new EngineCompiler(path, isWeb); } async compile(force: boolean = false): Promise { // 发布之后不需要编译内置引擎 // 开始第一次编译引擎 - const versionFile = join(this.outDir, 'VERSION'); + const versionFile = ps.join(this.outDir, 'VERSION'); let needClear = false; try { - const version = await readFile(versionFile, 'utf8'); + const version = await fsExtra.readFile(versionFile, 'utf8'); if (version !== VERSION) { needClear = true; } } catch { needClear = true; } - this.compiler = await this.generateCompiler(); + this.compiler = await this.generateCompiler({ isWebview: this.isWeb }); const isNativeScene = false; const debugNative = false; if (needClear) { console.debug('[EditorQuickCompiler]Version information lost.'); - await emptyDir(this.outDir); + await this.clear(); } else { console.debug('[EditorQuickCompiler]Version information looks good.'); } @@ -71,10 +75,10 @@ export class EngineCompiler { this.statsQuery = this.statsQuery || await StatsQuery.create(this.enginePath); } - async generateCompiler(options?: { isNative?: boolean }): Promise { - const logFile = join(this.enginePath, 'bin', '.cache', 'logs', 'log.txt'); + async generateCompiler(options?: { isNative?: boolean, isWebview?: boolean }): Promise { + const logFile = ps.join(this.enginePath, 'bin', '.cache', 'logs', 'log.txt'); if (logFile) { - await ensureDir(dirname(logFile)); + await fsExtra.ensureDir(ps.dirname(logFile)); } this.statsQuery = this.statsQuery || await StatsQuery.create(this.enginePath); let allFeatures = this.statsQuery.getFeatures(); @@ -108,6 +112,10 @@ export class EngineCompiler { DEBUG: true, }, }; + if (options?.isWebview) { + env.platform = 'HTML5'; // Webview targeting HTML5 platform + } + const featureUnitPrefix = 'cce:/internal/x/cc-fu/'; // cc-fu -> cc feature unit if (options?.isNative) { env.platform = 'NATIVE'; @@ -121,7 +129,7 @@ export class EngineCompiler { const editorFeatures = await this.filterEngineModules(env, allFeatures); this.editorFeaturesCache.push(...editorFeatures); - const nativeOutDir = join(this.enginePath, 'bin/.editor'); + const nativeOutDir = ps.join(this.enginePath, 'bin/.editor'); return new QuickCompiler({ rootDir: this.enginePath, outDir: nativeOutDir, @@ -143,14 +151,16 @@ export class EngineCompiler { } else { const editorFeatures = await this.filterEngineModules(env, allFeatures); this.editorFeaturesCache.push(...editorFeatures); + const outputDir = options?.isWebview ? ps.join(this.outDir, 'web') : ps.join(this.outDir, 'editor'); + return new QuickCompiler({ rootDir: this.enginePath, - outDir: this.outDir, + outDir: outputDir, platform: env.platform, targets: [ { featureUnitPrefix, - dir: join(this.outDir, 'editor'), + dir: outputDir, format: 'systemjs', // inlineSourceMap: true, // 使用 indexed source map 加快编译速度: @@ -164,13 +174,6 @@ export class EngineCompiler { loader: true, // 编辑器里没有 SystemJS,所以需要生成 loader loose: true, // TODO(cjh): 当前 ccbuild 构建强制使用了 loose 模式且后面一个 preview target 也是强制开启,先把当前 editor target 也开启 loose 模式,临时修复 Though the "loose" option was set to "false" in your @babel/preset-env config ... 问题。后续需要考虑使用项目设置中的「宽松模式」设置选项。 }, - // { - // featureUnitPrefix, - // dir: join(this.outDir, 'preview'), - // format: 'systemjs', - // loose: true, - // // indexedSourceMap: true, - // }, ], logFile, }); @@ -235,8 +238,8 @@ export class EngineCompiler { await this.updateAdapter(); await this.compiler.build(); await this.rebuildImportMaps(); - const versionFile = join(this.outDir, 'VERSION'); - await outputFile(versionFile, VERSION, { encoding: 'utf8' }); + const versionFile = ps.join(this.outDir, 'VERSION'); + await fsExtra.outputFile(versionFile, VERSION, { encoding: 'utf8' }); // eslint-disable-next-line no-useless-catch } catch (error) { @@ -250,34 +253,34 @@ export class EngineCompiler { async clear() { try { - await remove(this.outDir); + const clearPath = ps.join(this.outDir, this.isWeb ? 'web' : 'editor'); + await fsExtra.remove(clearPath); } catch (error) { } } async compileEngine(directory: string, force?: boolean, options?: IRebuildOptions) { this.enginePath = directory; - this.outDir = join(directory, 'bin', '.cache', 'dev-cli'); - // 发布之后不需要编译内置引擎 + // this.outDir = join(directory, 'bin', '.cache', 'dev-cli'); // Removed to avoid overriding constructor-init outDir // 开始第一次编译引擎 - const versionFile = join(this.outDir, 'VERSION'); + const versionFile = ps.join(this.outDir, 'VERSION'); let needClear = false; try { - const version = await readFile(versionFile, 'utf8'); + const version = await fsExtra.readFile(versionFile, 'utf8'); if (version !== VERSION) { needClear = true; } } catch { needClear = true; } - this.compiler = await this.generateCompiler(); + this.compiler = await this.generateCompiler({ isWebview: this.isWeb }); const isNativeScene = options && options.isNativeScene && await this.getIsSceneNative(); const debugNative = false; if (needClear) { console.debug('[EditorQuickCompiler] Version information lost.'); - await emptyDir(this.outDir); + await this.clear(); } else { console.debug('[EditorQuickCompiler] Version information looks good.'); } @@ -299,7 +302,7 @@ export class EngineCompiler { } queryEnvLimitModule() { - const modulesInfo: ModuleRenderConfig = readJSONSync(join(this.enginePath, 'editor', 'engine-features', 'render-config.json')); + const modulesInfo: ModuleRenderConfig = fsExtra.readJSONSync(ps.join(this.enginePath, 'editor', 'engine-features', 'render-config.json')); const envLimitModule: IEnvLimitModule = {}; const stepModule = (moduleKey: string, moduleItem: IFeatureItem) => { @@ -330,21 +333,21 @@ export class EngineCompiler { try { let isSuccess = true; - const nativeOutDir = join(this.enginePath, 'bin/.editor'); - const webAdapter = join(this.enginePath, 'bin/adapter/nodejs/web-adapter.js'); - if (!existsSync(nativeOutDir)) { - mkdirSync(nativeOutDir); + const nativeOutDir = ps.join(this.enginePath, 'bin/.editor'); + const webAdapter = ps.join(this.enginePath, 'bin/adapter/nodejs/web-adapter.js'); + if (!fsExtra.existsSync(nativeOutDir)) { + fsExtra.mkdirSync(nativeOutDir); } - if (existsSync(webAdapter)) { - const output = join(nativeOutDir, 'web-adapter.js'); - copyFileSync(webAdapter, output); + if (fsExtra.existsSync(webAdapter)) { + const output = ps.join(nativeOutDir, 'web-adapter.js'); + fsExtra.copyFileSync(webAdapter, output); } else { isSuccess = false; console.error(`${webAdapter} not exist, please build engine first`); } - const engineAdapter = join(this.enginePath, 'bin/adapter/nodejs/engine-adapter.js'); - if (existsSync(engineAdapter)) { - copyFileSync(engineAdapter, join(nativeOutDir, 'engine-adapter.js')); + const engineAdapter = ps.join(this.enginePath, 'bin/adapter/nodejs/engine-adapter.js'); + if (fsExtra.existsSync(engineAdapter)) { + fsExtra.copyFileSync(engineAdapter, ps.join(nativeOutDir, 'engine-adapter.js')); } else { isSuccess = false; console.error(`${engineAdapter} not exist, please build engine first`); diff --git a/packages/engine-compiler/src/index.ts b/packages/engine-compiler/src/index.ts index f4aefe4a8..fef49e094 100644 --- a/packages/engine-compiler/src/index.ts +++ b/packages/engine-compiler/src/index.ts @@ -3,9 +3,10 @@ import { EngineCompiler } from './core/compiler'; /** * 根据路径编译引擎 * @param path + * @param outDirName */ -export async function compileEngine(path: string) { - const compiler = EngineCompiler.create(path); +export async function compileEngine(enginePath: string, isWeb?: boolean) { + const compiler = EngineCompiler.create(enginePath, isWeb); await compiler.clear(); - await compiler.compileEngine(path, true); + await compiler.compileEngine(enginePath, true); } diff --git a/src/cli.ts b/src/cli.ts index f945f7d08..21b9d7c35 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -5,6 +5,7 @@ initSentry(); import { Command } from 'commander'; import { BuildCommand, McpServerCommand, CommandRegistry, CreateCommand, MakeCommand, RunCommand } from './commands'; import { config } from './display/config'; +import { PreviewCommand } from './commands/preview'; const program = new Command(); @@ -27,6 +28,7 @@ commandRegistry.register(new BuildCommand(program)); commandRegistry.register(new McpServerCommand(program)); commandRegistry.register(new MakeCommand(program)); commandRegistry.register(new RunCommand(program)); +commandRegistry.register(new PreviewCommand(program)); // 注册所有命令 commandRegistry.registerAll(); diff --git a/src/commands/preview.ts b/src/commands/preview.ts new file mode 100644 index 000000000..63f34f13a --- /dev/null +++ b/src/commands/preview.ts @@ -0,0 +1,40 @@ +import chalk from 'chalk'; +import { BaseCommand } from './base'; + + +/** + * Preview 命令类 + */ +export class PreviewCommand extends BaseCommand { + register(): void { + this.program + .command('preview') + .description('Preview a Cocos project') + .requiredOption('-j, --project ', 'Path to the Cocos project (required)') + .option('-p, --port ', 'Port number for the preview server', '9527') + .action(async (options: any) => { + try { + const resolvedPath = this.validateProjectPath(options.project); + const port = parseInt(options.port, 10); + + // 验证端口号 + if (isNaN(port) || port < 1 || port > 65535) { + console.error(chalk.red('Error: Invalid port number. Port must be between 1 and 65535.')); + process.exit(1); + } + + const { default: Launcher } = await import('../core/launcher'); + const launcher = new Launcher(resolvedPath); + await launcher.startPreview(port); + + + // 保持进程运行 + process.stdin.resume(); + } catch (error) { + console.error(chalk.red('Failed to start MCP server')); + console.error(error); + process.exit(1); + } + }); + } +} diff --git a/src/core/engine/compile-process.ts b/src/core/engine/compile-process.ts new file mode 100644 index 000000000..afa91e1ab --- /dev/null +++ b/src/core/engine/compile-process.ts @@ -0,0 +1,51 @@ +import { join } from 'path'; +import { fork } from 'child_process'; + +/** + * 在独立的子进程中运行引擎编译 + * 这样可以避免繁重的 babel 转译阻塞主进程事件循环 + */ +export function startCompileEngineProcess(force: boolean = false): Promise { + return new Promise((resolve, reject) => { + // 根据运行环境决定是使用 ts-node 还是直接执行 js + const isTsNode = (process as any)[Symbol.for('ts-node.register.instance')] || process.env.TS_NODE_DEV; + + let workerPath = join(__dirname, 'compile-worker.ts'); + const execArgv = [...process.execArgv]; + + // 如果是编译后的环境 + if (!__filename.endsWith('.ts')) { + workerPath = join(__dirname, 'compile-worker.js'); + } else if (!isTsNode && __filename.endsWith('.ts')) { + // ts 环境但没有直接注册 ts-node(比如被某些 runner 调用) + execArgv.push('-r', 'ts-node/register'); + } + + console.log(`🚀 启动引擎编译子进程...`); + const worker = fork(workerPath, [], { + stdio: 'inherit', + execArgv, + }); + + worker.on('message', (message: any) => { + if (message.type === 'done') { + resolve(); + } else if (message.type === 'error') { + reject(new Error(`[Worker Error] ${message.message}\n${message.stack}`)); + } + }); + + worker.on('error', (err) => { + reject(err); + }); + + worker.on('exit', (code) => { + if (code !== 0 && code !== null) { + reject(new Error(`Engine compile worker exited with code ${code}`)); + } + }); + + // 告诉 worker 开始编译 + worker.send({ type: 'start', force }); + }); +} diff --git a/src/core/engine/compile-worker.ts b/src/core/engine/compile-worker.ts new file mode 100644 index 000000000..7513d1023 --- /dev/null +++ b/src/core/engine/compile-worker.ts @@ -0,0 +1,34 @@ +import { join } from 'path'; +import { GlobalPaths } from '../../global'; + +// 监听来自主进程的消息 +process.on('message', async (message: any) => { + if (message && message.type === 'start') { + try { + const engineCompilerPath = join(GlobalPaths.workspace, 'packages', 'engine-compiler', 'dist', 'index'); + const { compileEngine } = require(engineCompilerPath); + + const enginePath = GlobalPaths.enginePath; + //compile for editor + await compileEngine(enginePath); + //compile for web + await compileEngine(enginePath, true); + + // 编译成功后给主进程发送完成消息 + if (process.send) { + process.send({ type: 'done' }); + } + process.exit(0); + } catch (error: any) { + console.error('Engine compile worker failed:', error); + if (process.send) { + process.send({ + type: 'error', + message: error.message, + stack: error.stack + }); + } + process.exit(1); + } + } +}); diff --git a/src/core/engine/editor-extends/index.ts b/src/core/engine/editor-extends/index.ts index d282d6b53..ecd76260f 100644 --- a/src/core/engine/editor-extends/index.ts +++ b/src/core/engine/editor-extends/index.ts @@ -11,6 +11,9 @@ export { walkProperties } from './missing-reporter/object-walker'; import utils from '../../base/utils'; import EventEmitter from 'events'; +if (!EventEmitter.prototype.off) { + EventEmitter.prototype.off = EventEmitter.prototype.removeListener; +} import ScriptManager from './manager/script'; import NodeManager from './manager/node'; import ComponentManager from './manager/component'; diff --git a/src/core/engine/index.ts b/src/core/engine/index.ts index 53d71813a..07fe22a35 100644 --- a/src/core/engine/index.ts +++ b/src/core/engine/index.ts @@ -358,6 +358,56 @@ class EngineManager implements IEngine { return this; } + async getGameConfig(serverURL: string, importBase: string, nativeBase: string, isPreview?: boolean) { + const { physicsConfig, macroConfig, customLayers, sortingLayers, highQuality } = this.getConfig(); + const bundles = assetManager.queryAssets({ isBundle: true }).map((item: any) => item.meta?.userData?.bundleName ?? item.name); + const builtinAssets = serverURL && await this.queryInternalAssetList(this.getInfo().typescript.path); + return { + debugMode: cc.debug.DebugMode.WARN, + overrideSettings: { + engine: { + builtinAssets: builtinAssets || [], + macros: macroConfig, + sortingLayers, + customLayers: customLayers.map((layer: any) => { + const index = layerMask.findIndex((num) => { return layer.value === num; }); + return { + name: layer.name, + bit: index, + }; + }), + }, + profiling: { + showFPS: isPreview ? true : false, + }, + screen: { + frameRate: 30, + exactFitScreen: true, + }, + rendering: { + renderMode: 2, + highQualityMode: highQuality, + }, + physics: { + ...physicsConfig, + // 物理引擎如果没有明确设置,默认是开启的,因此需要明确定义为false + enabled: serverURL ? true : false, + }, + assets: { + importBase: importBase, + nativeBase: nativeBase, + remoteBundles: ['internal', 'main'].concat(bundles), + server: serverURL, + } + }, + exactFitScreen: true, + }; + } + + getModules(): string[] { + return this.getConfig().includeModules || []; + } + async queryInternalAssetList(enginePath: string) { // 添加引擎依赖的预加载内置资源到主包内 const ccConfigJson = await fse.readJSON(join(enginePath, 'cc.config.json')); diff --git a/src/core/launcher.ts b/src/core/launcher.ts index 6d70022c1..3088bfe8f 100644 --- a/src/core/launcher.ts +++ b/src/core/launcher.ts @@ -2,10 +2,15 @@ import { join } from 'path'; import { IBuildCommandOption, Platform } from './builder/@types/protected'; import utils from './base/utils'; import { newConsole } from './base/console'; -import { startServer } from '../server'; +import { startServer, getServerUrl } from '../server'; import { GlobalConfig, GlobalPaths } from '../global'; import scripting from './scripting'; import { startupScene } from './scene'; +import { spawn } from 'child_process'; +import { middlewareService } from '../server/middleware'; +import ScriptingMiddleware from './scene/scripting.middleware'; +import SceneMiddleware from './scene/scene.middleware'; +import { sceneConfigInstance } from './scene/scene-configs'; /** @@ -60,6 +65,10 @@ export default class Launcher { // 在导入资源之前,初始化 scripting 模块,才能正常导入编译脚本 const { Engine } = await import('./engine'); await scripting.initialize(this.projectPath, GlobalPaths.enginePath, Engine.getConfig().includeModules); + + const { createProgrammingFacet } = await import('./scripting/programming/FacetInstance'); + await createProgrammingFacet(Engine.getInfo().typescript.path, scripting.projectPath, Engine.getConfig().includeModules); + // 启动以及初始化资源数据库 const { initAssetDB, startAssetDB } = await import('./assets'); await initAssetDB(); @@ -75,10 +84,33 @@ export default class Launcher { // 初始化构建 const { init: initBuilder } = await import('./builder'); await initBuilder(); + // 启动场景进程,需要在 Builder 之后,因为服务器路由场景还没有做前缀约束匹配范围比较广 await startupScene(GlobalPaths.enginePath, this.projectPath); } + async startPreview(port?: number) { + await this.import(); + await startServer(port); + // 初始化构建 + const { init: initBuilder } = await import('./builder'); + await initBuilder(); + + middlewareService.register('scripting', ScriptingMiddleware); + middlewareService.register('Scene', SceneMiddleware); + await sceneConfigInstance.init(); + + const { Rpc } = await import('./scene/main-process/rpc'); + await Rpc.startup(); + + const browserPath = process.platform === 'win32' + ? 'start' + : process.platform === 'darwin' + ? 'open' + : 'xdg-open'; + spawn(browserPath, [getServerUrl()], { stdio: 'ignore', detached: true }); + } + /** * 构建,主要是作为命令行构建的入口 * @param platform diff --git a/src/core/scene/main-process/rpc.ts b/src/core/scene/main-process/rpc.ts index cdfd5a07a..1f5d56b81 100644 --- a/src/core/scene/main-process/rpc.ts +++ b/src/core/scene/main-process/rpc.ts @@ -22,17 +22,19 @@ export class RpcProxy { return this.rpcInstance?.isConnect(); } - async startup(prc: ChildProcess | NodeJS.Process) { + async startup(prc?: ChildProcess | NodeJS.Process) { // 在创建新实例前,先清理旧实例,防止内存泄漏 this.dispose(); this.rpcInstance = new ProcessRPC(); - this.rpcInstance.attach(prc); + if (prc) { + this.rpcInstance.attach(prc); + } this.rpcInstance.register({ assetManager: assetManager, programming: scriptManager, sceneConfigInstance: sceneConfigInstance, }); - console.log('[Node] Scene Process RPC ready'); + console.log(`[Node] Scene Process RPC ready ${prc ? '(Attached)' : '(Detached - Web Mode)'}`); } /** diff --git a/src/core/scene/process-rpc/process-rpc.ts b/src/core/scene/process-rpc/process-rpc.ts index 8acb0d510..753c274ed 100644 --- a/src/core/scene/process-rpc/process-rpc.ts +++ b/src/core/scene/process-rpc/process-rpc.ts @@ -84,6 +84,8 @@ export class ProcessRPC> { private msgId = 0; private process: NodeJS.Process | ChildProcess | undefined; private onMessageBind = this.onMessage.bind(this); + private serverUrl: string | undefined; + private isWebMode = false; /** * @param proc - NodeJS.Process 或 ChildProcess 实例 @@ -91,9 +93,20 @@ export class ProcessRPC> { attach(proc: NodeJS.Process | ChildProcess) { this.dispose(); this.process = proc; + this.isWebMode = false; this.listen(); } + /** + * 设置 Web 传输模式(浏览器环境使用) + * @param baseUrl - 服务器基础连接 + */ + setWebTransport(baseUrl: string) { + this.dispose(); + this.serverUrl = baseUrl; + this.isWebMode = true; + } + /** * 注册模块,只支持对象或者类实例 * @param handler - 注册模块列表 @@ -110,6 +123,8 @@ export class ProcessRPC> { this.callbacks.clear(); this.process?.off('message', this.onMessageBind); this.process = undefined; + this.serverUrl = undefined; + this.isWebMode = false; } /** @@ -194,6 +209,27 @@ export class ProcessRPC> { : [args: Parameters, options?: RequestOptions] ): Promise>> { const [args, options] = rest; + + if (this.isWebMode && this.serverUrl) { + const url = `${this.serverUrl}/rpc/${String(module)}/${String(method)}`; + return fetch(url, { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(args || []) + }).then(async (res) => { + if (res.ok) { + const rpcRes = (await res.json()) as RpcResponse; + if (rpcRes.error) { + throw new Error(rpcRes.error); + } + return rpcRes.result; + } + throw new Error(`RPC request failed with status: ${res.status}`); + }); + } + return new Promise((resolve, reject) => { const id = ++this.msgId; @@ -219,12 +255,27 @@ export class ProcessRPC> { }); if (!this.process) { - throw new Error('未挂载进程'); + throw new Error('RPC 尚未挂载进程且未开启 Web 模式'); } this.process.send?.(req); }); } + /** + * 直接执行本地注册的模块方法(用于服务器接收到基于 HTTP 的 RPC 请求时直接处理) + */ + async executeLocal( + module: K, + method: M, + args: any[] + ): Promise>> { + const target = this.handlers[module as string]; + if (!target || typeof target[method as string] !== 'function') { + throw new Error(`Method not found: ${String(module)}.${String(method)}`); + } + return await target[method as string](...(args || [])); + } + /** * 发送单向消息(无返回值) */ diff --git a/src/core/scene/scene-process/engine-bootstrap.ts b/src/core/scene/scene-process/engine-bootstrap.ts new file mode 100644 index 000000000..25e15849b --- /dev/null +++ b/src/core/scene/scene-process/engine-bootstrap.ts @@ -0,0 +1,109 @@ +import * as EditorExtends from '../../engine/editor-extends'; +import { Rpc } from './rpc'; +import { serviceManager } from './service/service-manager'; +import { Service as DecoratorService } from './service/core/decorator'; +import './service'; + +// Patch UuidUtils for casing compatibility +if (EditorExtends.UuidUtils) { + const U = EditorExtends.UuidUtils as any; + U.decompressUuid = U.decompressUuid || U.decompressUUID; + U.compressUuid = U.compressUuid || U.compressUUID; + U.isUuid = U.isUuid || U.isUUID; + U.uuid = U.uuid || U.generate; +} + +(globalThis as any).EditorExtends = EditorExtends; + +export { serviceManager, EditorExtends }; +export const Service = DecoratorService; + +declare const cc: any; + +export async function startup(options: { + projectPath: string; + serverURL: string; +}) { + const defaultConfig = await fetch('/scripting/engine/game-config'); + const config = await defaultConfig.json(); + const modules = await fetch('/scripting/engine/modules'); + const features = (await modules.json()) as string[]; + const { projectPath, serverURL } = options; + + if (typeof window !== 'undefined') { + (window as any).__CC_PROJECT_PATH__ = projectPath; + } + serviceManager.initialize(serverURL); + + const requiredModules = [ + 'cc', + 'cc/editor/populate-internal-constants', + 'cc/editor/serialization', + 'cc/editor/new-gen-anim', + 'cc/editor/embedded-player', + 'cc/editor/reflection-probe', + 'cc/editor/lod-group-utils', + 'cc/editor/material', + 'cc/editor/2d-misc', + 'cc/editor/offline-mappings', + 'cc/editor/custom-pipeline', + 'cc/editor/animation-clip-migration', + 'cc/editor/exotic-animation', + 'cc/editor/color-utils', + ]; + + // IMPORTANT: We must NOT use import() here because Rollup's + // resolveId hook aliases cc/editor/* to a cc re-export stub, + // which means the real engine side-effect modules never load. + // We use the __moduleImport placeholder which is replaced with SystemJS's module.import(). + for (const mod of requiredModules) { + try { + await System.import(mod); + } catch (e) { + console.error('Failed to load engine module:', mod, 'e:', e); + } + } + + // ---- hack creator 使用的一些 engine 参数 + await import('cc/polyfill/engine'); + // overwrite + const overwrite = await import('cc/overwrite'); + const handle = overwrite.default || overwrite; + if (typeof handle === 'function') { + handle(cc); + } + + (globalThis as any).cce = (globalThis as any).cce || {}; + (globalThis as any).cce.Script = DecoratorService.Script; + (globalThis as any).cli = DecoratorService; + + if (EditorExtends.init) { + await EditorExtends.init(); + } + await Rpc.startup({ serverURL }); + + cc.physics.selector.runInEditor = true; + await cc.game.init(config); + + let backend = 'builtin'; + const Backends: Record = { + 'physics-cannon': 'cannon.js', + 'physics-ammo': 'bullet', + 'physics-builtin': 'builtin', + 'physics-physx': 'physx', + }; + features.forEach((m: string) => { + if (m in Backends) { + backend = Backends[m]; + } + }); + + // 切换物理引擎 + cc.physics.selector.switchTo(backend); + //TODO + cc.view.setDesignResolutionSize(1920, 1080, cc.ResolutionPolicy.SHOW_ALL); + + await cc.game.run(async () => { + cc.game.pause(); + }); +} diff --git a/src/core/scene/scene-process/main.ts b/src/core/scene/scene-process/main.ts index 4a4adfa00..68ad5320d 100644 --- a/src/core/scene/scene-process/main.ts +++ b/src/core/scene/scene-process/main.ts @@ -24,7 +24,7 @@ async function startup() { } // 初始化 service-manager - serviceManager.initialize(); + serviceManager.initialize(serverURL ?? ''); await Engine.init(enginePath); // 这里 importBase 与 nativeBase 用服务器是为了让服务器转换资源真实存放的路径 diff --git a/src/core/scene/scene-process/rpc.ts b/src/core/scene/scene-process/rpc.ts index 3a356887a..d3b8e7286 100644 --- a/src/core/scene/scene-process/rpc.ts +++ b/src/core/scene/scene-process/rpc.ts @@ -11,14 +11,19 @@ export class RpcProxy { return this.rpcInstance; } - async startup() { + async startup(options?: { serverURL: string }) { // 在创建新实例前,先清理旧实例,防止内存泄漏 this.dispose(); this.rpcInstance = new ProcessRPC(); - this.rpcInstance.attach(process); - const { Service } = await import('./service/core/decorator'); - this.rpcInstance.register(Service); - console.log('[Scene] Scene Process RPC ready'); + if (options?.serverURL) { + this.rpcInstance.setWebTransport(options.serverURL); + console.log('[Scene] Scene Process Web RPC ready'); + } else { + this.rpcInstance.attach(process); + const { Service } = await import('./service/core/decorator'); + this.rpcInstance.register(Service); + console.log('[Scene] Scene Process RPC ready'); + } } /** diff --git a/src/core/scene/scene-process/service/editor.ts b/src/core/scene/scene-process/service/editor.ts index 7fbff050b..3cc3eff65 100644 --- a/src/core/scene/scene-process/service/editor.ts +++ b/src/core/scene/scene-process/service/editor.ts @@ -14,8 +14,8 @@ import { ReloadResult, } from '../../common'; import { PrefabEditor, SceneEditor } from './editors'; -import { Rpc } from '../rpc'; import { IAssetInfo } from '../../../assets/@types/public'; +import { Rpc } from '../rpc'; /** * EditorAsset - 统一的编辑器管理入口 diff --git a/src/core/scene/scene-process/service/script.ts b/src/core/scene/scene-process/service/script.ts index aa04fdddb..f09728acd 100644 --- a/src/core/scene/scene-process/service/script.ts +++ b/src/core/scene/scene-process/service/script.ts @@ -5,6 +5,7 @@ import { Rpc } from '../rpc'; import { BaseService, register } from './core'; import { IScriptEvents, IScriptService } from '../../common'; import utils from '../../../base/utils'; +import { serviceManager } from './service-manager'; /** * 异步迭代。有以下特点: @@ -166,9 +167,12 @@ export class ScriptService extends BaseService implements IScript importExceptionHandler: (...args) => this._handleImportException(...args), cceModuleMap, }); - // eslint-disable-next-line no-undef + globalThis.self = window; - this._executor.addPolyfillFile(require.resolve('@cocos/build-polyfills/prebuilt/editor/bundle')); + const isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined'; + if (!isBrowser && typeof require !== 'undefined' && require.resolve) { + this._executor.addPolyfillFile(require.resolve('@cocos/build-polyfills/prebuilt/editor/bundle')); + } // 同步插件脚本列表 await this._syncPluginScripts.nextIteration(); // 重载项目与插件脚本 @@ -275,7 +279,7 @@ export class ScriptService extends BaseService implements IScript loadPluginInEditor: true, }])) .then((pluginScripts) => { - this._executor.setPluginScripts(pluginScripts); + this._executor.setPluginScripts(pluginScripts || []); }) .catch((reason) => { console.error(reason); diff --git a/src/core/scene/scene-process/service/service-manager.ts b/src/core/scene/scene-process/service/service-manager.ts index 87dffb1ee..754abbc19 100644 --- a/src/core/scene/scene-process/service/service-manager.ts +++ b/src/core/scene/scene-process/service/service-manager.ts @@ -49,14 +49,20 @@ type ServiceEventType = typeof SERVICE_EVENTS_MAP[keyof typeof SERVICE_EVENTS_MA export class ServiceManager { private initialized = false; private eventHandlers = new Map void>(); + private serverUrl: string = ''; - initialize() { + initialize(serverUrl: string) { if (this.initialized) return; this.initialized = true; + this.serverUrl = serverUrl; this.unregisterAutoForwardEvents(); this.registerAutoForwardEvents(); } + getServerUrl() { + return this.serverUrl; + } + private registerAutoForwardEvents() { Object.entries(SERVICE_EVENTS_MAP).forEach(([eventType, methodName]) => { const handler = (...args: any[]) => { diff --git a/src/core/scene/scene.middleware.ts b/src/core/scene/scene.middleware.ts index ee94338c8..f31095fa5 100644 --- a/src/core/scene/scene.middleware.ts +++ b/src/core/scene/scene.middleware.ts @@ -5,6 +5,44 @@ import fse from 'fs-extra'; export default { get: [ + { + url: '/engine/read-file-sync', + async handler(req: Request, res: Response) { + let filePath = req.query.path as string; + if (!filePath) { + return res.status(400).send('Path is required'); + } + + // Normalize path to fix mixed slashes on Windows + filePath = path.normalize(filePath); + + if (!(await fse.pathExists(filePath))) { + // Fallback for .wasm.wasm -> .wasm if the double extension file is missing + if (filePath.endsWith('.wasm.wasm')) { + const fallbackPath = filePath.slice(0, -5); + if (await fse.pathExists(fallbackPath)) { + filePath = fallbackPath; + } + } + } + + if (await fse.pathExists(filePath)) { + const content = await fse.readFile(filePath); + res.status(200).send(content); + } else { + res.status(404).send('File not found: ' + filePath); + } + } + }, + { + // TODO 这里后续需要改引擎 wasm/wasm-nodejs.ts 的写法,改成向服务器请求数据 + url: '/engine/query-engine-info', + async handler(req: Request, res: Response) { + const { Engine } = await import('../engine'); + const engineInfo = Engine.getInfo(); + res.status(200).send(engineInfo); + }, + }, { // TODO 这里后续需要改引擎 wasm/wasm-nodejs.ts 的写法,改成向服务器请求数据 url: '/engine_external/', @@ -23,9 +61,9 @@ export default { }, }, { - url: '/query-extname/:uuid', + url: /^\/query-extname\/(.+)$/, async handler(req: Request, res: Response) { - const uuid = req.params.uuid; + const uuid = req.params[0]; const { assetManager } = await import('../assets'); const assetInfo = assetManager.queryAssetInfo(uuid); if (assetInfo && assetInfo.library['.bin'] && Object.keys(assetInfo.library).length === 1) { @@ -36,6 +74,34 @@ export default { }, }, { + url: /^\/query-asset-info\/(.+)$/, + async handler(req: Request, res: Response) { + const uuid = req.params[0]; + const { assetManager } = await import('../assets'); + const assetInfo = assetManager.queryAssetInfo(uuid); + if (assetInfo) { + res.status(200).json(assetInfo); + } else { + res.status(404).json({ error: 'Asset not found', uuid }); + } + }, + }, + { + url: '/query-asset-infos/:cctype', + async handler(req: Request, res: Response) { + const ccType = req.params.cctype; + const { assetManager } = await import('../assets'); + const assetInfos = assetManager.queryAssetInfos({ ccType }); + if (assetInfos) { + res.status(200).json(assetInfos); + } else { + res.status(404).json({ error: 'Asset not found', ccType }); + } + }, + }, + { + // Serve library assets by UUID - try asset database first, + // then fall back to library directories on disk url: '/:dir/:uuid/:nativeName.:ext', async handler(req: Request, res: Response, next: NextFunction) { if (req.params.dir === 'build' || req.params.dir === 'mcp') { @@ -54,6 +120,27 @@ export default { file: `${nativeName}.${ext}` }); } + + const isBrowser = !!(req.headers['accept']?.includes('text/html') || + req.headers['sec-ch-ua'] || + req.query.isBrowser === 'true'); + + if (isBrowser) { + const content = await fse.readFile(filePath); + const extname = path.extname(filePath); + const mimeMap: Record = { + '.json': 'application/json', + '.bin': 'application/octet-stream', + '.cconb': 'application/octet-stream', + '.wasm': 'application/wasm', + '.png': 'image/png', + '.jpg': 'image/jpeg', + '.jpeg': 'image/jpeg' + }; + res.setHeader('Content-Type', mimeMap[extname] || 'application/octet-stream'); + return res.status(200).send(content); + } + res.status(200).send(filePath || req.url); }, }, @@ -72,14 +159,52 @@ export default { uuid, }); } + + const isBrowser = !!(req.headers['accept']?.includes('text/html') || + req.headers['sec-ch-ua'] || + req.query.isBrowser === 'true'); + + if (isBrowser) { + const content = await fse.readFile(filePath); + const extname = path.extname(filePath); + const mimeMap: Record = { + '.json': 'application/json', + '.bin': 'application/octet-stream', + '.cconb': 'application/octet-stream', + '.wasm': 'application/wasm', + '.png': 'image/png', + '.jpg': 'image/jpeg', + '.jpeg': 'image/jpeg' + }; + res.setHeader('Content-Type', mimeMap[extname] || 'application/octet-stream'); + return res.status(200).send(content); + } + res.status(200).send(filePath || req.url); }, } ], - post: [], + post: [ + { + url: '/rpc/:module/:method', + async handler(req: Request, res: Response) { + const { module, method } = req.params; + const args = req.body; + try { + const { Rpc } = await import('./main-process/rpc'); + const result = await Rpc.getInstance().executeLocal(module as any, method as any, args); + console.log(`[Scene Web RPC] ${module}.${method} ->`, typeof result === 'undefined' ? 'undefined' : (result === null ? 'null' : typeof result)); + res.status(200).json({ type: 'response', result }); + } catch (e: any) { + console.error(`[Scene] RPC Error (${module}.${method}):`, e); + res.status(200).json({ type: 'response', error: e?.message || String(e) }); + } + } + } + ], staticFiles: [], socket: { connection: (socket: any) => { }, disconnect: (socket: any) => { } }, -} as IMiddlewareContribution; +} as IMiddlewareContribution; \ No newline at end of file diff --git a/src/core/scene/scripting.middleware.ts b/src/core/scene/scripting.middleware.ts new file mode 100644 index 000000000..b686c1c07 --- /dev/null +++ b/src/core/scene/scripting.middleware.ts @@ -0,0 +1,269 @@ +import type { IMiddlewareContribution } from '../../server/interfaces'; +import { Request, Response, NextFunction } from 'express'; +import path, { basename, join, relative } from 'path'; +import ejs from 'ejs'; +import { pathExists, stat } from 'fs-extra'; +import { GlobalPaths } from '../../global'; +import { readFileSync } from 'fs'; + +export default { + get: [ + { + url: '/', + async handler(req: Request, res: Response, next: NextFunction) { + try { + const { getPreviewFacet } = await import('../scripting/programming/FacetInstance'); + const facet = getPreviewFacet(); + const { Engine } = await import('../engine'); + const enginePath = Engine.getInfo().typescript.path; + const engineDistRelPath = relative(enginePath, facet.engineDistRoot).replace(/\\/g, '/'); + const { default: scripting } = await import('../../core/scripting'); + const serverBaseUrl = `${req.protocol}://${req.get('host')}`; + const renderData = { + title: `Cocos Creator Preview - ${basename(scripting.projectPath)}`, + packImportMapURL: `/scripting/x/${facet.packImportMapURL}`, + packResolutionDetailMapURL: `/scripting/x/${facet.packResolutionDetailMapURL}`, + engineDistPath: `/scripting/engine/${engineDistRelPath}`, + projectPath: scripting.projectPath.replace(/\\/g, '/'), + enginePath: enginePath.replace(/\\/g, '/'), + serverURL: serverBaseUrl + }; + const templatePath = join(GlobalPaths.workspace, 'static', 'web', 'index.ejs'); + const html = await ejs.renderFile(templatePath, renderData); + res.status(200).send(html); + } catch (err) { + next(err); + } + }, + }, + { + url: '/scripting/engine/game-config', + async handler(req: Request, res: Response) { + const { Engine } = await import('../engine'); + const serverBaseUrl = `${req.protocol}://${req.get('host')}`; + const config = await Engine.getGameConfig(serverBaseUrl, serverBaseUrl, serverBaseUrl); + res.json(config); + }, + }, + { + url: '/scripting/engine/modules', + async handler(req: Request, res: Response) { + const { Engine } = await import('../engine'); + const modules = Engine.getModules(); + res.json(modules); + }, + }, + { + url: '/scripting/engine/bin/.editor/:filename', + async handler(req: Request, res: Response) { + const { filename } = req.params; + const { Engine } = await import('../engine'); + const enginePath = Engine.getInfo().typescript.path; + const engineFilePath = path.join(enginePath, 'bin', '.editor', filename); + + try { + const content = readFileSync(engineFilePath); + res.setHeader('Content-Type', 'application/javascript'); + res.status(200).send(content); + } catch (error) { + res.status(404).send('File not found'); + } + }, + }, + { + url: '/scripting/import-map-global', + async handler(req: Request, res: Response) { + const { getPreviewFacet } = await import('../scripting/programming/FacetInstance'); + const facet = getPreviewFacet(); + const importMap = await facet.getGlobalImportMap(); + console.log(`[Preview Server] Global import map:`, JSON.stringify(importMap, null, 2).substring(0, 500)); + res.json(importMap); + }, + }, + { + url: /^\/scripting\/x/, + async handler(req: Request, res: Response, next: NextFunction) { + const { getPreviewFacet } = await import('../scripting/programming/FacetInstance'); + const facet = getPreviewFacet(); + + const url = req.path.substring('/scripting/x'.length).replace(/^\//, ''); + if (url === '' || url === '/') { + return next(); + } + + // Forward query string + const query = Object.keys(req.query).length === 0 ? '' : `?${new URLSearchParams(req.query as any).toString()}`; + const fullUrl = url + query; + + console.log(`[Preview Server] Packing resource requested: ${fullUrl}`); + try { + const packResource = await facet.loadPackResource(fullUrl); + if (packResource.type === 'json') { + res.json(packResource.json); + } else if (packResource.type === 'chunk') { + res.sendFile(packResource.chunk.path); + } else { + console.warn(`[Preview Server] Unknown pack resource type for ${fullUrl}:`, packResource); + next(new Error('Unknown pack resource type')); + } + } catch (err) { + console.error(`[Preview Server] Failed to load pack resource ${fullUrl}:`, err); + next(err); + } + }, + }, + { + url: /^\/scripting\/engine/, + async handler(req: Request, res: Response, next: NextFunction) { + try { + const { Engine } = await import('../engine'); + const enginePath = Engine.getInfo().typescript.path; + // Use req.originalUrl because some directories have percent-encoded + // names on disk (e.g. "external%3Aemscripten"). Express decodes + // req.path, turning %3A into ':', which breaks lookup. + // Decode ONE level of percent-encoding: %253A → %3A (files on disk + // use single-encoded names, but SystemJS deps use double-encoded). + const rawPath = req.originalUrl.split('?')[0]; + let relPath = rawPath.substring('/scripting/engine'.length); + relPath = decodeURIComponent(relPath); + const { default: scripting } = await import('../../core/scripting'); + // Try engine root first — preserve percent-encoded dir names + let resourcePath = join(enginePath, relPath); + + // If not found, try project temp engine target + if (!(await pathExists(resourcePath))) { + const engineDistBase = '/bin/.cache/dev-cli/web'; + let projectorRelPath = relPath; + if (relPath.startsWith(engineDistBase)) { + projectorRelPath = relPath.substring(engineDistBase.length); + } + resourcePath = join(scripting.projectPath, 'temp', 'cli', 'programming', 'packer-driver', 'targets', 'preview', projectorRelPath).replace(/\\/g, '/'); + } + + // If it's a directory, try index.json or index.js + if (await pathExists(resourcePath) && (await stat(resourcePath)).isDirectory()) { + const indexJson = join(resourcePath, 'index.json'); + if (await pathExists(indexJson)) { + resourcePath = indexJson; + } + } + + if (!(await pathExists(resourcePath)) && !relPath.endsWith('.js')) { + const jsPath = `${resourcePath}.js`; + if (await pathExists(jsPath)) { + resourcePath = jsPath; + } + } + + console.log(`[Preview Server] Engine resource requested: ${req.path} -> ${resourcePath}`); + if (await pathExists(resourcePath) && (await stat(resourcePath)).isFile()) { + res.sendFile(resourcePath, { dotfiles: 'allow' }); + } else { + console.warn(`[Preview Server] Engine resource NOT FOUND on disk: ${resourcePath}`); + next(); + } + } catch (err) { + console.error('[Preview Server] Engine handler error:', err); + next(err); + } + }, + }, + { + url: /^\/scripting\//, + async handler(req: Request, res: Response, next: NextFunction) { + const relPath = req.path.substring('/scripting/'.length); + // Handle absolute monorepo paths resolved by Rollup + if (relPath.includes('code/cocos-cli/') || relPath.includes('code\\cocos-cli\\')) { + const monorepoPath = relPath.split('code/cocos-cli/')[1] || relPath.split('code\\cocos-cli\\')[1]; + let resourcePath = join(GlobalPaths.workspace, monorepoPath); + if (!(await pathExists(resourcePath))) { + resourcePath = `${resourcePath}.js`; + } + if (!(await pathExists(resourcePath))) { + const jsonPath = `${resourcePath.replace(/\.js$/, '')}.json`; + if (await pathExists(jsonPath)) { + resourcePath = jsonPath; + } + } + if (!(await pathExists(resourcePath)) || !(await stat(resourcePath)).isFile()) { + // Try index.js if it's a directory or not a file + const dirPath = resourcePath.replace(/\.js$/, ''); + const indexPath = join(dirPath, 'index.js'); + if (await pathExists(indexPath)) { + resourcePath = indexPath; + } + } + console.log(`[Preview Server] Monorepo resource requested: ${req.path} -> ${resourcePath}`); + if (await pathExists(resourcePath) && (await stat(resourcePath)).isFile()) { + return res.sendFile(resourcePath, { dotfiles: 'allow' }); + } + } + next(); + }, + }, + { + url: /^\/static\/web/, + async handler(req: Request, res: Response, next: NextFunction) { + const relPath = req.path.substring('/static/web'.length); + const resourcePath = join(GlobalPaths.workspace, 'static', 'web', relPath); + console.log(`[Preview Server] Static resource requested: ${relPath} -> ${resourcePath}`); + if (await pathExists(resourcePath) && (await stat(resourcePath)).isFile()) { + res.sendFile(resourcePath); + } else { + console.warn(`[Preview Server] Static resource not found: ${resourcePath}`); + next(); + } + }, + }, + { + url: /^\/scripting\/systemjs/, + async handler(req: Request, res: Response, next: NextFunction) { + const { getPreviewFacet } = await import('../scripting/programming/FacetInstance'); + const facet = getPreviewFacet(); + const relPath = req.path.substring('/scripting/systemjs'.length); + if (relPath.startsWith('/extras/')) { + const extraPath = join(GlobalPaths.workspace, 'node_modules', '@cocos', 'systemjs', 'dist', relPath); + if (await pathExists(extraPath) && (await stat(extraPath)).isFile()) { + return res.sendFile(extraPath); + } + } + const resourcePath = join(facet.systemJsHomeDir, relPath); + console.log(`[Preview Server] SystemJS resource requested: ${relPath} -> ${resourcePath}`); + if (await pathExists(resourcePath) && (await stat(resourcePath)).isFile()) { + res.sendFile(resourcePath); + } else { + console.warn(`[Preview Server] SystemJS resource not found: ${resourcePath}`); + next(); + } + }, + }, + { + url: /^\/scripting\/scene/, + async handler(req: Request, res: Response, next: NextFunction) { + let relPath = req.path.substring('/scripting/scene'.length); + try { + relPath = decodeURIComponent(relPath); + } catch { + // Ignore error + } + const resourcePath = join(GlobalPaths.workspace, 'dist', 'core', 'scene', relPath); + let finalPath = resourcePath; + if (!(await pathExists(finalPath))) { + finalPath = `${finalPath}.js`; + } + + if (await pathExists(finalPath) && (await stat(finalPath)).isFile()) { + res.sendFile(finalPath, { dotfiles: 'allow' }); + } else { + next(); + } + }, + }, + ], + post: [], + staticFiles: [], + socket: { + connection: (_socket: any) => { }, + disconnect: (_socket: any) => { } + }, +} as IMiddlewareContribution; diff --git a/src/core/scripting/compile-process.ts b/src/core/scripting/compile-process.ts new file mode 100644 index 000000000..08a40c9f7 --- /dev/null +++ b/src/core/scripting/compile-process.ts @@ -0,0 +1,60 @@ +import { join } from 'path'; +import { fork } from 'child_process'; +import { AssetChangeInfo } from './packer-driver/asset-db-interop'; + +export interface ICompileWorkerData { + projectPath: string; + enginePath: string; + features: string[]; + assetChanges?: AssetChangeInfo[]; +} + +/** + * 在独立的子进程中运行项目脚本编译 + * 避免 QuickPacker 的 Rollup 等繁重任务阻塞主进程事件循环 + */ +export function startCompileScriptProcess(data: ICompileWorkerData, completeCallback: () => void): Promise { + return new Promise((resolve, reject) => { + // 根据运行环境决定是使用 ts-node 还是直接执行 js + const isTsNode = (process as any)[Symbol.for('ts-node.register.instance')] || process.env.TS_NODE_DEV; + + let workerPath = join(__dirname, 'compile-worker.ts'); + const execArgv = [...process.execArgv]; + + // 如果是编译后的环境 + if (!__filename.endsWith('.ts')) { + workerPath = join(__dirname, 'compile-worker.js'); + } else if (!isTsNode && __filename.endsWith('.ts')) { + // ts 环境但没有直接注册 ts-node(比如 CLI 调用) + execArgv.push('-r', 'ts-node/register'); + } + + console.log(`🚀 启动项目脚本编译子进程...`); + const worker = fork(workerPath, [], { + stdio: 'inherit', + execArgv, + }); + + worker.on('message', (message: any) => { + if (message.type === 'done') { + resolve(); + completeCallback(); + } else if (message.type === 'error') { + reject(new Error(`[Worker Error] ${message.message}\n${message.stack}`)); + } + }); + + worker.on('error', (err) => { + reject(err); + }); + + worker.on('exit', (code) => { + if (code !== 0 && code !== null) { + reject(new Error(`Script compile worker exited with code ${code}`)); + } + }); + + // 告诉 worker 开始编译并传递必要的初始化参数 + worker.send({ type: 'start', data }); + }); +} diff --git a/src/core/scripting/compile-worker.ts b/src/core/scripting/compile-worker.ts new file mode 100644 index 000000000..a261db9ca --- /dev/null +++ b/src/core/scripting/compile-worker.ts @@ -0,0 +1,34 @@ +import scripting from './index'; + +// 监听来自主进程的消息 +process.on('message', async (message: any) => { + if (message && message.type === 'start') { + try { + const { projectPath, enginePath, features, assetChanges } = message.data; + + // 初始化 Scripting,但不需要驻留 watch,因为这只是单次构建进程 + await scripting.initialize(projectPath, enginePath, features); + + // 执行脚本编译 + await scripting.compileScripts(assetChanges); + + // 编译成功后给主进程发送完成消息 + if (process.send) { + process.send({ type: 'done' }); + } + // 确保 PackerDriver 退出并清理资源 + await scripting.close(); + process.exit(0); + } catch (error: any) { + console.error('Script compile worker failed:', error); + if (process.send) { + process.send({ + type: 'error', + message: error.message, + stack: error.stack + }); + } + process.exit(1); + } + } +}); diff --git a/src/core/scripting/index.ts b/src/core/scripting/index.ts index e4bf5c293..8c7f1edea 100644 --- a/src/core/scripting/index.ts +++ b/src/core/scripting/index.ts @@ -60,6 +60,7 @@ class ScriptManager { private _initialized = false; private _pendingCompileTimer: NodeJS.Timeout | null = null; private _pendingCompileTaskId: string | null = null; + private _projectPath: string = ''; /** * 初始化Scripting模块 @@ -71,11 +72,16 @@ class ScriptManager { if (this._initialized) { return; } + this._projectPath = projectPath; const packerDriver = await PackerDriver.create(projectPath, enginePath); await packerDriver.init(features); this._initialized = true; } + get projectPath() { + return this._projectPath; + } + /** * 查询文件的依赖者(谁使用了这个文件) * @param path 文件路径 @@ -213,7 +219,7 @@ class ScriptManager { quickPackLoaderContext, cceModuleMap, }); - // eslint-disable-next-line no-undef + globalThis.self = window; executor.addPolyfillFile(require.resolve('@cocos/build-polyfills/prebuilt/editor/bundle')); } diff --git a/src/core/scripting/language-service/command.ts b/src/core/scripting/language-service/command.ts index 00c6031f0..9ce6c9f0c 100644 --- a/src/core/scripting/language-service/command.ts +++ b/src/core/scripting/language-service/command.ts @@ -1,6 +1,6 @@ import { join } from 'path'; import ts, { TextChange } from 'typescript'; -import { LanguageServiceAdapter } from '.'; +import { LanguageServiceAdapter, FilePath } from '.'; import { DbURLInfo } from '../intelligence'; import { asserts } from '../utils/asserts'; import { dbURLRoot, removeTSExt, resolveFileName } from '../utils/path'; diff --git a/src/core/scripting/language-service/index.ts b/src/core/scripting/language-service/index.ts index 1d9ff0080..941e452c3 100644 --- a/src/core/scripting/language-service/index.ts +++ b/src/core/scripting/language-service/index.ts @@ -9,6 +9,8 @@ import { AwaitCommand, Command, RenameCommand } from './command'; import { asserts } from '../utils/asserts'; import { scriptConfig } from '../shared/query-shared-settings'; +export type FilePath = string; + /** * 这个类用来处理内存中的文件 */ diff --git a/src/core/scripting/packer-driver/asset-db-interop.ts b/src/core/scripting/packer-driver/asset-db-interop.ts index a63cda916..ddbd88ec8 100644 --- a/src/core/scripting/packer-driver/asset-db-interop.ts +++ b/src/core/scripting/packer-driver/asset-db-interop.ts @@ -143,9 +143,12 @@ export interface AssetChangeInfo { uuid: string; filePath: string; importer: string; - userData: Object; + userData: object; } +export type UUID = string; +export type FilePath = string; + export interface AssetChange { type: AssetChangeType; uuid: UUID; diff --git a/src/core/scripting/packer-driver/index.ts b/src/core/scripting/packer-driver/index.ts index bf04bef05..0bc019797 100644 --- a/src/core/scripting/packer-driver/index.ts +++ b/src/core/scripting/packer-driver/index.ts @@ -23,7 +23,6 @@ import { PackerDriverLogger } from './logger'; import { LanguageServiceAdapter } from '../language-service'; import { AsyncDelegate } from '../utils/delegate'; import JSON5 from 'json5'; -import minimatch from 'minimatch'; import { existsSync } from 'fs'; import { url2path } from '../../assets/utils'; import { compressUuid } from '../../builder/worker/builder/utils'; @@ -522,7 +521,9 @@ export class PackerDriver { target.deleteCacheFile((err as any).file); continue; } - buildResult.depsGraph && (this._depsGraph = buildResult.depsGraph); // 更新依赖图 + if (buildResult.depsGraph) { + this._depsGraph = buildResult.depsGraph; + } this._needUpdateDepsCache = true; } this._building = false; diff --git a/src/core/scripting/programming/Facet.ts b/src/core/scripting/programming/Facet.ts new file mode 100644 index 000000000..8f181388e --- /dev/null +++ b/src/core/scripting/programming/Facet.ts @@ -0,0 +1,248 @@ +'use strict'; + +import ps from 'path'; +import fs from 'fs-extra'; +import type { QuickPackLoader } from '@cocos/creator-programming-quick-pack/lib/loader'; + +import { ImportMap } from '../../builder/@types/protected'; +import { StatsQuery } from '@cocos/ccbuild'; +import * as moduleSystem from '@cocos/module-system'; + +/** + * 异步迭代。有以下特点: + * 1. 每次调用 `nextIteration()` 会执行一次传入的**迭代函数**;迭代函数允许是异步的,在构造函数中确定之后不能更改; + * 2. 同时**最多仅会有一例**迭代在执行; + * 3. **迭代是可合并的**,也就是说,在前面的迭代没完成之前,后面的所有迭代都会被合并成一个。 + */ +class AsyncIterationConcurrency { + private _iterate: () => Promise; + + private _executionPromise: Promise | null = null; + + private _pendingPromise: Promise | null = null; + + constructor(iterate: () => Promise) { + this._iterate = iterate; + } + + public nextIteration(): Promise { + if (!this._executionPromise) { + // 如果未在执行,那就去执行 + // assert(!this._pendingPromise) + return this._executionPromise = Promise.resolve(this._iterate()).finally(() => { + this._executionPromise = null; + }); + } else if (!this._pendingPromise) { + // 如果没有等待队列,创建等待 promise,在 执行 promise 完成后执行 + return this._pendingPromise = this._executionPromise.finally(() => { + this._pendingPromise = null; + // 等待 promise 将等待执行 promise,并在完成后重新入队 + return this.nextIteration(); + }); + } else { + // 如果已经有等待队列,那就等待现有的队列 + console.debug(`[Facet] There is a pending promise task, waiting ...`); + return this._pendingPromise; + } + } +} + +interface IEngineOptions { + /** + * 引擎仓库根目录。 + */ + root: string; + + /** + * 引擎编译后的根目录。 + */ + distRoot: string; + + /** + * 引擎基础 URL。 + */ + baseUrl: string; + + /** + * 使用的引擎功能。 + */ + features: string[]; +} + +export class ProgrammingFacet { + private _packerDriverUpdateCount = 0; + private _asyncIteration: AsyncIterationConcurrency; + public static async create( + engine: IEngineOptions, + projectPath: string + ) { + const previewFacet = new ProgrammingFacet( + engine.root, + engine.distRoot, // engineDistRoot + projectPath + ); + await previewFacet._initialize({ engine }); + return previewFacet; + } + + + + get engineRoot() { + return this._engineRoot; + } + + get engineDistRoot() { + return this._engineDistRoot; + } + + get systemJsHomeDir() { + return this._systemJsHomeDir; + } + + get systemJsIndexFile() { + return this._systemJsBundleFileName; + } + + get engineImportMapURL() { + return '/scripting/engine/import-map.json'; + } + + get packImportMapURL() { + return this._quickPackLoader!.importMapURL; + } + + get packResolutionDetailMapURL() { + return this._quickPackLoader!.resolutionDetailMapURL; + } + + public async loadPackResource(url: string) { + return await this._getQuickPackLoader().loadAny(url); + } + + public async getGlobalImportMap() { + return this._staticImportMap; + } + + private async reload(): Promise { + const reloadIndex = ++this._packerDriverUpdateCount; + console.debug(`[[Facet.reload]], before lock, count: ${reloadIndex}`); + const loader = this._getQuickPackLoader(); + let unlockPromise: (() => Promise) | undefined; + try { + unlockPromise = await loader.lock(); + } catch (err: any) { + console.error(`[[Facet.reload]] lock failed: ${err}, stack: ${err.stack}, count: ${reloadIndex}`); + } + console.debug(`[[Facet.reload]], after lock, count: ${reloadIndex}`); + + try { + await loader.reload(); + } catch (err: any) { + console.error(`[[Facet.reload]], failed: ${err}, ${err.stack}, count: ${reloadIndex}`); + throw err; + } finally { + console.debug(`[[Facet.reload]], before unlock, count: ${reloadIndex}`); + try { + if (unlockPromise) { + await unlockPromise(); + } + } catch (err: any) { + console.error(`[[Facet.reload]] unlock failed: ${err}, stack: ${err.stack}, count: ${reloadIndex}`); + } + console.debug(`[[Facet.reload]], after unlock, count: ${reloadIndex}`); + } + } + + public async notifyPackDriverUpdated() { + return this._asyncIteration.nextIteration(); + } + + private _staticImportMap: ImportMap & { imports: NonNullable } = { + imports: {}, + }; + + private _engineRoot: string; + + private _engineDistRoot: string; + + private _systemJsHomeDir: string; + + private _systemJsBundleFileName = 'system.js'; + + private declare _engineStatsQuery: StatsQuery; + + private _quickPackLoader: QuickPackLoader | undefined; + + private constructor( + engineRoot: string, + engineDistRoot: string, + projectRoot: string, + ) { + this._systemJsHomeDir = ps.join(projectRoot, 'temp', 'cli', 'programming', 'preview', 'systemjs'); + this._engineRoot = engineRoot; + this._engineDistRoot = engineDistRoot; + this._asyncIteration = new AsyncIterationConcurrency(async () => { + return this.reload(); + }); + } + + private _getQuickPackLoader() { + if (!this._quickPackLoader) { + throw new Error('Loader has not been created.'); + } else { + return this._quickPackLoader; + } + } + + private async _initialize({ + engine, + }: { + engine: IEngineOptions; + }) { + this._engineStatsQuery = await StatsQuery.create(engine.root); + const imports = this._staticImportMap.imports; + + imports['cc'] = 'q-bundled:///virtual/cc.js'; + imports['cc/env'] = 'cc/editor/populate-internal-constants'; + // TODO: deprecated cce.env is only live in 3.0-preview + imports['cce.env'] = imports['cc/env']; + imports['cc/userland/macro'] = './userland/macro'; + + console.debug(`Preview import map: ${JSON.stringify(this._staticImportMap, undefined, 2)}`); + + await this._buildSystemJs(); + + await this._resetQuickPackLoader(); + } + + private async _buildSystemJs() { + const systemJsBundleOutFile = ps.join(this._systemJsHomeDir, this._systemJsBundleFileName); + await fs.ensureDir(ps.dirname(systemJsBundleOutFile)); + + // NOTE: The @cocos/rollup-plugin-typescript requires document.baseURI to resolve tslib in Node.js environment. + // In cocos-cli, web-adapter.js (loaded by initEngine) polyfills `document` but not `baseURI`. + // If `document` is defined, the rollup plugin enters a browser-only branch and fails if `baseURI` is missing. + if (typeof document !== 'undefined' && !document.baseURI) { + const { pathToFileURL } = require('url'); + (document as any).baseURI = pathToFileURL(ps.join(process.cwd(), 'index.js')).href; + } + + await moduleSystem.build({ + out: systemJsBundleOutFile, + minify: false, + sourceMap: true, + platform: 'web-mobile', + editor: true, + }); + } + + private async _resetQuickPackLoader() { + const { default: scripting } = await import('../index'); + const contextSerialize = scripting.getPackerDriverLoaderContext('preview'); + const { QuickPackLoaderContext, QuickPackLoader } = await import('@cocos/creator-programming-quick-pack/lib/loader'); + const context = QuickPackLoaderContext.deserialize(contextSerialize!); + const quickPackLoader = new QuickPackLoader(context); + this._quickPackLoader = quickPackLoader; + } +} + diff --git a/src/core/scripting/programming/FacetInstance.ts b/src/core/scripting/programming/FacetInstance.ts new file mode 100644 index 000000000..b3e6ec03a --- /dev/null +++ b/src/core/scripting/programming/FacetInstance.ts @@ -0,0 +1,27 @@ +import ps, { join } from 'path'; +import { ProgrammingFacet } from './Facet'; + + +let programmingFacet: ProgrammingFacet | null; + +export async function createProgrammingFacet(enginePath: string, projectPath: string, features: string[]) { + if (!programmingFacet) { + programmingFacet = await ProgrammingFacet.create( + { + root: enginePath, + distRoot: join(enginePath, 'bin', '.cache', 'dev-cli', 'web'), + baseUrl: '/scripting/engine', + features, + }, + projectPath + ); + } + return programmingFacet; +} + +export function getPreviewFacet() { + if (!programmingFacet) { + throw new Error('ProgrammingFacet not init, please init firstly.'); + } + return programmingFacet; +} diff --git a/src/core/scripting/programming/editor.d.ts b/src/core/scripting/programming/editor.d.ts new file mode 100644 index 000000000..4c8995fe8 --- /dev/null +++ b/src/core/scripting/programming/editor.d.ts @@ -0,0 +1,9 @@ +declare global { + namespace Editor { + namespace Message { + function request(pkg: string, message: string, ...args: any[]): Promise; + } + } +} + +export {}; diff --git a/src/core/scripting/shared/cache.ts b/src/core/scripting/shared/cache.ts index 184ba1d2d..c796b2c55 100644 --- a/src/core/scripting/shared/cache.ts +++ b/src/core/scripting/shared/cache.ts @@ -1,5 +1,8 @@ /// 这个模块存放公用的缓存 +export type MTime = string; +export type FilePath = string; + export interface TypeScriptAssetInfoCache { version?: MTime, content?: string, diff --git a/src/lib/engine/engine.ts b/src/lib/engine/engine.ts index 21684c422..24d5da623 100644 --- a/src/lib/engine/engine.ts +++ b/src/lib/engine/engine.ts @@ -21,3 +21,7 @@ export async function initEngine(enginePath: string, projectPath: string, server return await initEngine(enginePath, projectPath, serverURL); } +export async function startEngineCompilation(force: boolean = false) { + const { startCompileEngineProcess } = await import('../../core/engine/compile-process'); + await startCompileEngineProcess(force); +} \ No newline at end of file diff --git a/src/lib/scripting/scripting.ts b/src/lib/scripting/scripting.ts index 4d220575b..649e46af8 100644 --- a/src/lib/scripting/scripting.ts +++ b/src/lib/scripting/scripting.ts @@ -1,5 +1,7 @@ import { GlobalPaths } from '../../global'; import scripting from '../../core/scripting'; +import type { AssetChangeInfo } from '../../core/scripting'; +import type { ProgrammingFacet } from '../../core/scripting/programming/Facet'; export type * from '../../core/scripting/interface'; @@ -11,3 +13,40 @@ export async function init(projectPath: string): Promise { Engine.getConfig().includeModules); } +export async function initProgrammingFacet(): Promise { + const { Engine } = await import('../../core/engine'); + const features = Engine.getConfig().includeModules || []; + const enginePath = GlobalPaths.enginePath; + + const { createProgrammingFacet } = await import('../../core/scripting/programming/FacetInstance'); + return await createProgrammingFacet(enginePath, scripting.projectPath, features); +} + +export async function getProgrammingFacet(): Promise { + const { getPreviewFacet } = await import('../../core/scripting/programming/FacetInstance'); + return getPreviewFacet(); +} + +/** + * 在独立的子进程中运行项目脚本编译 + * 以避免阻塞主进程 + */ +export async function startCompileScript(assetChanges?: AssetChangeInfo[]) { + const { Engine } = await import('../../core/engine'); + const features = Engine.getConfig().includeModules; + + const { startCompileScriptProcess } = await import('../../core/scripting/compile-process'); + const facet = await getProgrammingFacet(); + await startCompileScriptProcess({ + projectPath: scripting.projectPath, + enginePath: GlobalPaths.enginePath, + features, + assetChanges + }, () => { + if (facet) { + facet.notifyPackDriverUpdated(); + } + }); +} + + diff --git a/src/server/server.ts b/src/server/server.ts index 6163b90f2..ef05c8a42 100644 --- a/src/server/server.ts +++ b/src/server/server.ts @@ -138,6 +138,7 @@ export class ServerService { init() { this.app.use(compression()); + this.app.use(express.json()); this.app.use(cors); this.app.use(consoleLogService.injectMiddleware); this.app.use(middlewareService.router); diff --git a/static/web/boot.js b/static/web/boot.js new file mode 100644 index 000000000..641da1011 --- /dev/null +++ b/static/web/boot.js @@ -0,0 +1,54 @@ +/* global window, document, System, globalThis, fetch */ +/* eslint-disable quotes */ +const env = window.WebEnv; + +(async function () { + try { + await import("/static/web/polyfills.bundle.js"); + await import("/scripting/systemjs/system.js"); + await import("/scripting/systemjs/extras/named-register.js"); + + // Inject import maps. System.import naturally waits for them! + const sources = [ + `${env.engineDistPath}/import-map.json`, + env.packImportMapURL, + '/scripting/import-map-global' + ]; + sources.forEach(src => { + const script = document.createElement('script'); + Object.assign(script, { + type: 'systemjs-importmap', + src + }); + document.head.appendChild(script); + }); + + System.setResolutionDetailMapCallback(function () { + const url = new URL(env.packResolutionDetailMapURL, env.serverURL); + return fetch(url).then(function (response) { + return response.json(); + }).then(function (json) { + return { json, url: url.href }; + }); + }); + + await import("/static/web/editor-stub-preload.js"); + await import(`${env.engineDistPath}/bundled/index.js`); + + const _originalSystem = System; + console.log('[Scene] loading scene bundle'); + // SystemJS natively awaits the attached import maps above + const SceneBundle = await System.import('/static/web/scene-bundle.js?t=' + Date.now()); + const { startup } = SceneBundle; + + globalThis.System = _originalSystem; + await startup({ + enginePath: env.enginePath, + projectPath: env.projectPath, + serverURL: env.serverURL + }); + console.log('Cocos Engine and Scene Services loaded successfully'); + } catch (err) { + console.error('Failed to load Cocos Engine or Services:', err.stack || err); + } +})(); diff --git a/static/web/editor-stub-preload.js b/static/web/editor-stub-preload.js new file mode 100644 index 000000000..ea8f171af --- /dev/null +++ b/static/web/editor-stub-preload.js @@ -0,0 +1,142 @@ +/* global window */ + +window.CC_EDITOR = true; +const serverUrl = window.WebEnv.serverURL; + +window.Editor = { + Message: { + request: async function (target, method, uuid) { + if (method === 'query-asset-info') { + return await fetch(`${serverUrl}/query-asset-info/${uuid}`) + .then(function (r) { return r.json(); }) + .catch(function () { return ''; }); + } else if (method === 'query-engine-info') { + return await fetch(`${serverUrl}/engine/query-engine-info`) + .then(function (r) { return r.json(); }) + .catch(function () { return ''; }); + } + return Promise.resolve(null); + }, + }, +}; + +if (typeof window.require === 'undefined') { + const fsMock = { + readFile: function (filePath) { + const requestUrl = `${serverUrl}/engine/read-file-sync?path=${encodeURIComponent(filePath)}`; + return fetch(requestUrl).then(function (res) { + if (res.ok) { + return res.arrayBuffer(); + } + throw new Error('Failed to read file: ' + filePath); + }); + }, + readFileSync: function (filePath) { + const requestUrl = `${serverUrl}/engine/read-file-sync?path=${encodeURIComponent(filePath)}`; + const xhr = new XMLHttpRequest(); + xhr.open('GET', requestUrl, false); // synchronous + xhr.overrideMimeType('text/plain; charset=x-user-defined'); + xhr.send(null); + + if (xhr.status === 200) { + const val = xhr.responseText; + const len = val.length; + const buf = new Uint8Array(len); + for (let i = 0; i < len; i++) { + buf[i] = val.charCodeAt(i) & 0xff; + } + return buf; + } + throw new Error('Failed to read file synchronously: ' + filePath); + } + }; + + window.require = function (name) { + if (name === 'fs' || name === 'fs-extra') { + return fsMock; + } + throw new Error('Module ' + name + ' not found in editor-stub-preload require mock'); + }; +} + +window.EditorExtends = { + emit: function () { }, + on: function () { }, + off: function () { }, + removeListener: function () { }, + UuidUtils: { + uuid: function () { return ''; }, + compressUuid: function (u) { return u; }, + compressUUID: function (u) { return u; }, + decompressUuid: function (u) { return u; }, + isUuid: function () { return false; }, + }, + Component: { + allow: false, + addMenu: function () { }, + removeMenu: function () { }, + getMenus: function () { return []; }, + add: function () { }, + remove: function () { }, + clear: function () { }, + getComponent: function () { return null; }, + getComponentFromPath: function () { return null; }, + getPathFromUuid: function () { return ''; }, + getComponents: function () { return {}; }, + changeUUID: function () { }, + emit: function () { }, + on: function () { }, + off: function () { }, + removeListener: function () { }, + }, + Node: { + allow: false, + add: function () { }, + remove: function () { }, + clear: function () { }, + updateNodeName: function () { }, + getNode: function () { return null; }, + getNodeByPath: function () { return null; }, + getNodePath: function () { return ''; }, + getNodeUuidByPath: function () { return null; }, + getNodeByPathOrThrow: function () { throw new Error('Not implemented'); }, + getNodeUuidByPathOrThrow: function () { throw new Error('Not implemented'); }, + getNodes: function () { return {}; }, + getNodesByAsset: function () { return []; }, + getNodesInScene: function () { return {}; }, + changeNodeUUID: function () { }, + emit: function () { }, + on: function () { }, + off: function () { }, + removeListener: function () { }, + }, + Script: { + allow: false, + add: function () { }, + remove: function () { }, + getCtors: function () { return []; }, + emit: function () { }, + on: function () { }, + off: function () { }, + removeListener: function () { }, + }, + MissingReporter: { + classInstance: (function () { + const finder = function (type, data, owner, propName) { + // Resolve class by type ID, same as cc.js.getClassById + return cc && cc.js ? cc.js.getClassById(type) : null; + }; + finder.onDereferenced = function () { }; + return { + classFinder: finder, + reportMissingClass: function () { }, + reset: function () { }, + }; + })(), + class: null, + object: function () { return { stashByOwner: function () { } }; }, + }, + serialize: { + asAsset: function (uuid) { return uuid; }, + }, +}; \ No newline at end of file diff --git a/static/web/index.ejs b/static/web/index.ejs new file mode 100644 index 000000000..d0752ccd7 --- /dev/null +++ b/static/web/index.ejs @@ -0,0 +1,60 @@ + + + + + <%= title %> + + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + + + + diff --git a/static/web/load-scene.js b/static/web/load-scene.js new file mode 100644 index 000000000..6d3b4227e --- /dev/null +++ b/static/web/load-scene.js @@ -0,0 +1,24 @@ +/* global window, cc, fetch */ + +window.loadScene = async function (serverURL) { + const sceneListPromise = await fetch(`${serverURL}/query-asset-infos/cc.SceneAsset`); + const sceneList = await sceneListPromise.json(); + const length = sceneList.length; + let sceneUrl = null; + for (let i = 0; i < length; i++) { + const source = sceneList[i].source; + if (source.startsWith('db://internal')) { + continue; + } + sceneUrl = sceneList[i].source; + break; + } + + if (!sceneUrl) { + console.error('No user scene found to load.'); + return; + } + + await cli.Editor.open({ urlOrUUID: sceneUrl }); + cc.game.resume(); +}; diff --git a/static/web/polyfills.bundle.js b/static/web/polyfills.bundle.js new file mode 100644 index 000000000..f00a2ccd4 --- /dev/null +++ b/static/web/polyfills.bundle.js @@ -0,0 +1,782 @@ +// Polyfills bundle for browser preview +// Generated by workflow/build-polyfills.js +// Includes: core-js (ES API polyfills) + regenerator-runtime (async/await) + +/** + * core-js 3.46.0 + * © 2014-2025 Denis Pushkarev (zloirock.ru) + * license: https://github.com/zloirock/core-js/blob/v3.46.0/LICENSE + * source: https://github.com/zloirock/core-js + */ +!function(t){"use strict";var r,e,n;r=[function(t,r,e){e(1),e(97),e(98),e(99),e(100),e(101),e(102),e(103),e(104),e(105),e(106),e(107),e(108),e(109),e(110),e(111),e(112),e(113),e(126),e(127),e(129),e(139),e(140),e(141),e(143),e(147),e(150),e(152),e(154),e(155),e(156),e(157),e(159),e(160),e(162),e(163),e(165),e(169),e(170),e(171),e(172),e(177),e(178),e(180),e(181),e(182),e(184),e(188),e(189),e(190),e(191),e(192),e(197),e(199),e(200),e(202),e(205),e(206),e(207),e(208),e(209),e(211),e(222),e(224),e(225),e(227),e(228),e(231),e(234),e(240),e(241),e(242),e(243),e(244),e(245),e(249),e(250),e(252),e(253),e(255),e(256),e(258),e(259),e(260),e(261),e(262),e(263),e(271),e(272),e(273),e(274),e(276),e(277),e(278),e(279),e(280),e(281),e(282),e(93),e(283),e(284),e(292),e(294),e(296),e(297),e(298),e(299),e(300),e(302),e(303),e(304),e(305),e(306),e(307),e(309),e(310),e(311),e(312),e(313),e(314),e(315),e(316),e(317),e(321),e(322),e(324),e(326),e(327),e(328),e(329),e(330),e(332),e(334),e(335),e(336),e(337),e(339),e(340),e(342),e(343),e(344),e(345),e(347),e(348),e(349),e(350),e(351),e(352),e(353),e(354),e(355),e(357),e(358),e(359),e(360),e(361),e(362),e(363),e(364),e(365),e(366),e(367),e(369),e(370),e(371),e(372),e(396),e(397),e(398),e(399),e(400),e(401),e(408),e(409),e(410),e(411),e(412),e(413),e(414),e(416),e(417),e(418),e(419),e(420),e(421),e(422),e(423),e(424),e(425),e(433),e(435),e(436),e(438),e(439),e(440),e(441),e(442),e(444),e(454),e(456),e(458),e(460),e(462),e(465),e(467),e(468),e(470),e(473),e(474),e(475),e(476),e(477),e(481),e(482),e(484),e(485),e(486),e(487),e(489),e(490),e(491),e(492),e(493),e(494),e(495),e(497),e(500),e(503),e(506),e(507),e(508),e(509),e(510),e(511),e(512),e(513),e(514),e(515),e(516),e(517),e(518),e(526),e(527),e(528),e(529),e(530),e(531),e(532),e(533),e(534),e(535),e(536),e(537),e(538),e(540),e(541),e(542),e(543),e(544),e(545),e(546),e(547),e(548),e(549),e(550),e(551),e(552),e(553),e(554),e(555),e(556),e(557),e(558),e(559),e(560),e(561),e(562),e(563),e(564),e(565),e(566),e(571),e(573),e(575),e(576),e(577),e(578),e(579),e(582),e(584),e(585),e(586),e(588),e(589),e(591),e(592),e(593),e(594),e(595),e(598),e(599),e(603),e(604),e(605),e(606),e(607),e(609),e(610),e(612),e(613),e(614),e(615),e(616),e(617),e(618),e(620),e(622),e(623),e(624),e(625),e(627),e(628),e(629),e(630),e(631),e(633),e(634),e(635),e(636),e(637),e(639),e(640),e(641),e(645),e(646),e(649),e(651),e(652),e(654),e(655),e(656),e(657),e(658),e(659),e(661),e(662),e(663),e(665),e(666),e(667),e(668),e(669),e(670),e(672),e(673),e(674),e(675),e(677),e(678),e(681),e(682),e(683),e(685),e(686),e(687),e(688),e(689),e(690),e(691),e(692),e(693),e(694),e(695),e(696),e(697),e(699),e(700),e(701),e(705),e(707),e(708),e(709),e(710),e(711),e(712),e(713),e(714),e(715),e(716),e(717),e(720),e(721),e(722),e(723),e(724),e(725),e(726),e(727),e(728),e(729),e(730),e(731),e(732),e(733),e(734),e(735),e(736),e(738),e(739),e(742),e(743),e(745),e(746),e(748),e(749),e(750),e(751),e(752),e(753),e(754),e(755),e(756),e(757),e(758),e(759),e(760),e(761),e(763),e(764),e(765),e(766),e(767),e(769),e(770),e(773),e(774),e(775),e(776),e(777),e(778),e(781),e(782),e(784),e(785),e(786),e(790),e(791),e(792),e(793),e(796),e(801),e(802),e(803),e(804),e(805),e(806),t.exports=e(807)},function(t,r,e){e(2),e(90),e(92),e(93),e(96)},function(r,e,n){var o=n(3),i=n(4),a=n(8),u=n(14),c=n(36),f=n(6),s=n(26),l=n(7),h=n(38),p=n(24),g=n(46),v=n(12),d=n(18),y=n(68),m=n(11),b=n(71),w=n(73),x=n(57),S=n(75),E=n(66),A=n(5),I=n(44),O=n(72),R=n(10),M=n(47),T=n(77),k=n(34),P=n(53),j=n(54),C=n(40),N=n(33),D=n(78),U=n(79),_=n(81),L=n(82),B=n(51),z=n(83).forEach,W=P("hidden"),V="Symbol",H="prototype",q=B.set,G=B.getterFor(V),K=Object[H],Y=i.Symbol,$=Y&&Y[H],J=i.RangeError,X=i.TypeError,Q=i.QObject,Z=A.f,tt=I.f,rt=S.f,et=R.f,nt=u([].push),ot=k("symbols"),it=k("op-symbols"),ut=k("wks"),ct=!Q||!Q[H]||!Q[H].findChild,fallbackDefineProperty=function(t,r,e){var n=Z(K,r);n&&delete K[r],tt(t,r,e),n&&t!==K&&tt(K,r,n)},ft=f&&l(function(){return 7!==b(tt({},"a",{get:function(){return tt(this,"a",{value:7}).a}})).a})?fallbackDefineProperty:tt,wrap=function(t,r){var e=ot[t]=b($);return q(e,{type:V,tag:t,description:r}),f||(e.description=r),e},st=function defineProperty(t,r,e){t===K&&st(it,r,e),g(t);var n=d(r);return g(e),h(ot,n)?(e.enumerable?(h(t,W)&&t[W][n]&&(t[W][n]=!1),e=b(e,{enumerable:m(0,!1)})):(h(t,W)||tt(t,W,m(1,b(null))),t[W][n]=!0),ft(t,n,e)):tt(t,n,e)},lt=function defineProperties(t,r){var e,n;return g(t),e=v(r),n=w(e).concat($getOwnPropertySymbols(e)),z(n,function(r){f&&!a(ht,e,r)||st(t,r,e[r])}),t},ht=function propertyIsEnumerable(t){var r=d(t),e=a(et,this,r);return!(this===K&&h(ot,r)&&!h(it,r))&&(!(e||!h(this,r)||!h(ot,r)||h(this,W)&&this[W][r])||e)},pt=function getOwnPropertyDescriptor(t,r){var e,n=v(t),o=d(r);if(n!==K||!h(ot,o)||h(it,o))return!(e=Z(n,o))||!h(ot,o)||h(n,W)&&n[W][o]||(e.enumerable=!0),e},gt=function getOwnPropertyNames(t){var r=rt(v(t)),e=[];return z(r,function(t){h(ot,t)||h(j,t)||nt(e,t)}),e},$getOwnPropertySymbols=function(t){var r=t===K,e=rt(r?it:v(t)),n=[];return z(e,function(t){!h(ot,t)||r&&!h(K,t)||nt(n,ot[t])}),n};s||(Y=function Symbol(){var r,e,n;if(p($,this))throw new X("Symbol is not a constructor");return r=arguments.length&&arguments[0]!==t?y(arguments[0]):t,e=C(r),n=function(r){var o,u=this===t?i:this;u===K&&a(n,it,r),h(u,W)&&h(u[W],e)&&(u[W][e]=!1),o=m(1,r);try{ft(u,e,o)}catch(c){if(!(c instanceof J))throw c;fallbackDefineProperty(u,e,o)}},f&&ct&&ft(K,e,{configurable:!0,set:n}),wrap(e,r)},M($=Y[H],"toString",function toString(){return G(this).tag}),M(Y,"withoutSetter",function(t){return wrap(C(t),t)}),R.f=ht,I.f=st,O.f=lt,A.f=pt,x.f=S.f=gt,E.f=$getOwnPropertySymbols,D.f=function(t){return wrap(N(t),t)},f&&(T($,"description",{configurable:!0,get:function description(){return G(this).description}}),c||M(K,"propertyIsEnumerable",ht,{unsafe:!0}))),o({global:!0,constructor:!0,wrap:!0,forced:!s,sham:!s},{Symbol:Y}),z(w(ut),function(t){U(t)}),o({target:V,stat:!0,forced:!s},{useSetter:function(){ct=!0},useSimple:function(){ct=!1}}),o({target:"Object",stat:!0,forced:!s,sham:!f},{create:function create(r,e){return e===t?b(r):lt(b(r),e)},defineProperty:st,defineProperties:lt,getOwnPropertyDescriptor:pt}),o({target:"Object",stat:!0,forced:!s},{getOwnPropertyNames:gt}),_(),L(Y,V),j[W]=!0},function(r,e,n){var o=n(4),i=n(5).f,a=n(43),u=n(47),c=n(37),f=n(55),s=n(67);r.exports=function(r,e){var n,l,h,p,g,v=r.target,d=r.global,y=r.stat;if(n=d?o:y?o[v]||c(v,{}):o[v]&&o[v].prototype)for(l in e){if(p=e[l],h=r.dontCallGetSet?(g=i(n,l))&&g.value:n[l],!s(d?l:v+(y?".":"#")+l,r.forced)&&h!==t){if(typeof p==typeof h)continue;f(p,h)}(r.sham||h&&h.sham)&&a(p,"sham",!0),u(n,l,p,r)}}},function(t,r,e){var check=function(t){return t&&t.Math===Math&&t};t.exports=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof global&&global)||check("object"==typeof this&&this)||function(){return this}()||Function("return this")()},function(t,r,e){var n=e(6),o=e(8),i=e(10),a=e(11),u=e(12),c=e(18),f=e(38),s=e(41),l=Object.getOwnPropertyDescriptor;r.f=n?l:function getOwnPropertyDescriptor(t,r){if(t=u(t),r=c(r),s)try{return l(t,r)}catch(e){}if(f(t,r))return a(!o(i.f,t,r),t[r])}},function(t,r,e){var n=e(7);t.exports=!n(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})},function(t,r,e){t.exports=function(t){try{return!!t()}catch(r){return!0}}},function(t,r,e){var n=e(9),o=(function(){}).call;t.exports=n?o.bind(o):function(){return o.apply(o,arguments)}},function(t,r,e){var n=e(7);t.exports=!n(function(){var t=(function(){}).bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})},function(t,r,e){var n={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,i=o&&!n.call({1:2},1);r.f=i?function propertyIsEnumerable(t){var r=o(this,t);return!!r&&r.enumerable}:n},function(t,r,e){t.exports=function(t,r){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:r}}},function(t,r,e){var n=e(13),o=e(16);t.exports=function(t){return n(o(t))}},function(t,r,e){var n=e(14),o=e(7),i=e(15),a=Object,u=n("".split);t.exports=o(function(){return!a("z").propertyIsEnumerable(0)})?function(t){return"String"===i(t)?u(t,""):a(t)}:a},function(t,r,e){var n=e(9),o=Function.prototype,i=o.call,a=n&&o.bind.bind(i,i);t.exports=n?a:function(t){return function(){return i.apply(t,arguments)}}},function(t,r,e){var n=e(14),o=n({}.toString),i=n("".slice);t.exports=function(t){return i(o(t),8,-1)}},function(t,r,e){var n=e(17),o=TypeError;t.exports=function(t){if(n(t))throw new o("Can't call method on "+t);return t}},function(r,e,n){r.exports=function(r){return null===r||r===t}},function(t,r,e){var n=e(19),o=e(22);t.exports=function(t){var r=n(t,"string");return o(r)?r:r+""}},function(r,e,n){var o=n(8),i=n(20),a=n(22),u=n(29),c=n(32),f=n(33),s=TypeError,l=f("toPrimitive");r.exports=function(r,e){var n,f;if(!i(r)||a(r))return r;if(n=u(r,l)){if(e===t&&(e="default"),f=o(n,r,e),!i(f)||a(f))return f;throw new s("Can't convert object to primitive value")}return e===t&&(e="number"),c(r,e)}},function(t,r,e){var n=e(21);t.exports=function(t){return"object"==typeof t?null!==t:n(t)}},function(r,e,n){var o="object"==typeof document&&document.all;r.exports="undefined"==typeof o&&o!==t?function(t){return"function"==typeof t||t===o}:function(t){return"function"==typeof t}},function(t,r,e){var n=e(23),o=e(21),i=e(24),a=e(25),u=Object;t.exports=a?function(t){return"symbol"==typeof t}:function(t){var r=n("Symbol");return o(r)&&i(r.prototype,u(t))}},function(r,e,n){var o=n(4),i=n(21);r.exports=function(r,e){return arguments.length<2?i(n=o[r])?n:t:o[r]&&o[r][e];var n}},function(t,r,e){var n=e(14);t.exports=n({}.isPrototypeOf)},function(t,r,e){var n=e(26);t.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(t,r,e){var n=e(27),o=e(7),i=e(4).String;t.exports=!!Object.getOwnPropertySymbols&&!o(function(){var t=Symbol("symbol detection");return!i(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&n&&n<41})},function(t,r,e){var n,o,i=e(4),a=e(28),u=i.process,c=i.Deno,f=u&&u.versions||c&&c.version,s=f&&f.v8;s&&(o=(n=s.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!o&&a&&(!(n=a.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=a.match(/Chrome\/(\d+)/))&&(o=+n[1]),t.exports=o},function(t,r,e){var n=e(4).navigator,o=n&&n.userAgent;t.exports=o?String(o):""},function(r,e,n){var o=n(30),i=n(17);r.exports=function(r,e){var n=r[e];return i(n)?t:o(n)}},function(t,r,e){var n=e(21),o=e(31),i=TypeError;t.exports=function(t){if(n(t))return t;throw new i(o(t)+" is not a function")}},function(t,r,e){var n=String;t.exports=function(t){try{return n(t)}catch(r){return"Object"}}},function(t,r,e){var n=e(8),o=e(21),i=e(20),a=TypeError;t.exports=function(t,r){var e,u;if("string"===r&&o(e=t.toString)&&!i(u=n(e,t)))return u;if(o(e=t.valueOf)&&!i(u=n(e,t)))return u;if("string"!==r&&o(e=t.toString)&&!i(u=n(e,t)))return u;throw new a("Can't convert object to primitive value")}},function(t,r,e){var n=e(4),o=e(34),i=e(38),a=e(40),u=e(26),c=e(25),f=n.Symbol,s=o("wks"),l=c?f["for"]||f:f&&f.withoutSetter||a;t.exports=function(t){return i(s,t)||(s[t]=u&&i(f,t)?f[t]:l("Symbol."+t)),s[t]}},function(t,r,e){var n=e(35);t.exports=function(t,r){return n[t]||(n[t]=r||{})}},function(t,r,e){var n=e(36),o=e(4),i=e(37),a="__core-js_shared__",u=t.exports=o[a]||i(a,{});(u.versions||(u.versions=[])).push({version:"3.46.0",mode:n?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru), 2025 CoreJS Company (core-js.io)",license:"https://github.com/zloirock/core-js/blob/v3.46.0/LICENSE",source:"https://github.com/zloirock/core-js"})},function(t,r,e){t.exports=!1},function(t,r,e){var n=e(4),o=Object.defineProperty;t.exports=function(t,r){try{o(n,t,{value:r,configurable:!0,writable:!0})}catch(e){n[t]=r}return r}},function(t,r,e){var n=e(14),o=e(39),i=n({}.hasOwnProperty);t.exports=Object.hasOwn||function hasOwn(t,r){return i(o(t),r)}},function(t,r,e){var n=e(16),o=Object;t.exports=function(t){return o(n(t))}},function(r,e,n){var o=n(14),i=0,a=Math.random(),u=o(1.1.toString);r.exports=function(r){return"Symbol("+(r===t?"":r)+")_"+u(++i+a,36)}},function(t,r,e){var n=e(6),o=e(7),i=e(42);t.exports=!n&&!o(function(){return 7!==Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a})},function(t,r,e){var n=e(4),o=e(20),i=n.document,a=o(i)&&o(i.createElement);t.exports=function(t){return a?i.createElement(t):{}}},function(t,r,e){var n=e(6),o=e(44),i=e(11);t.exports=n?function(t,r,e){return o.f(t,r,i(1,e))}:function(t,r,e){return t[r]=e,t}},function(t,r,e){var n=e(6),o=e(41),i=e(45),a=e(46),u=e(18),c=TypeError,f=Object.defineProperty,s=Object.getOwnPropertyDescriptor,l="enumerable",h="configurable",p="writable";r.f=n?i?function defineProperty(t,r,e){if(a(t),r=u(r),a(e),"function"==typeof t&&"prototype"===r&&"value"in e&&p in e&&!e[p]){var n=s(t,r);n&&n[p]&&(t[r]=e.value,e={configurable:h in e?e[h]:n[h],enumerable:l in e?e[l]:n[l],writable:!1})}return f(t,r,e)}:f:function defineProperty(t,r,e){if(a(t),r=u(r),a(e),o)try{return f(t,r,e)}catch(n){}if("get"in e||"set"in e)throw new c("Accessors not supported");return"value"in e&&(t[r]=e.value),t}},function(t,r,e){var n=e(6),o=e(7);t.exports=n&&o(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})},function(t,r,e){var n=e(20),o=String,i=TypeError;t.exports=function(t){if(n(t))return t;throw new i(o(t)+" is not an object")}},function(r,e,n){var o=n(21),i=n(44),a=n(48),u=n(37);r.exports=function(r,e,n,c){var f,s;if(c||(c={}),f=c.enumerable,s=c.name!==t?c.name:e,o(n)&&a(n,s,c),c.global)f?r[e]=n:u(e,n);else{try{c.unsafe?r[e]&&(f=!0):delete r[e]}catch(l){}f?r[e]=n:i.f(r,e,{value:n,enumerable:!1,configurable:!c.nonConfigurable,writable:!c.nonWritable})}return r}},function(r,e,n){var o=n(14),i=n(7),a=n(21),u=n(38),c=n(6),f=n(49).CONFIGURABLE,s=n(50),l=n(51),h=l.enforce,p=l.get,g=String,v=Object.defineProperty,d=o("".slice),y=o("".replace),m=o([].join),b=c&&!i(function(){return 8!==v(function(){},"length",{value:8}).length}),w=String(String).split("String"),x=r.exports=function(r,e,n){"Symbol("===d(g(e),0,7)&&(e="["+y(g(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!u(r,"name")||f&&r.name!==e)&&(c?v(r,"name",{value:e,configurable:!0}):r.name=e),b&&n&&u(n,"arity")&&r.length!==n.arity&&v(r,"length",{value:n.arity});try{n&&u(n,"constructor")&&n.constructor?c&&v(r,"prototype",{writable:!1}):r.prototype&&(r.prototype=t)}catch(i){}var o=h(r);return u(o,"source")||(o.source=m(w,"string"==typeof e?e:"")),r};Function.prototype.toString=x(function toString(){return a(this)&&p(this).source||s(this)},"toString")},function(t,r,e){var n=e(6),o=e(38),i=Function.prototype,a=n&&Object.getOwnPropertyDescriptor,u=o(i,"name"),c=u&&"something"===(function something(){}).name,f=u&&(!n||n&&a(i,"name").configurable);t.exports={EXISTS:u,PROPER:c,CONFIGURABLE:f}},function(t,r,e){var n=e(14),o=e(21),i=e(35),a=n(Function.toString);o(i.inspectSource)||(i.inspectSource=function(t){return a(t)}),t.exports=i.inspectSource},function(t,r,e){var n,o,i,a,u,c=e(52),f=e(4),s=e(20),l=e(43),h=e(38),p=e(35),g=e(53),v=e(54),d="Object already initialized",y=f.TypeError;c||p.state?((a=p.state||(p.state=new(0,f.WeakMap))).get=a.get,a.has=a.has,a.set=a.set,n=function(t,r){if(a.has(t))throw new y(d);return r.facade=t,a.set(t,r),r},o=function(t){return a.get(t)||{}},i=function(t){return a.has(t)}):(v[u=g("state")]=!0,n=function(t,r){if(h(t,u))throw new y(d);return r.facade=t,l(t,u,r),r},o=function(t){return h(t,u)?t[u]:{}},i=function(t){return h(t,u)}),t.exports={set:n,get:o,has:i,enforce:function(t){return i(t)?o(t):n(t,{})},getterFor:function(t){return function(r){var e;if(!s(r)||(e=o(r)).type!==t)throw new y("Incompatible receiver, "+t+" required");return e}}}},function(t,r,e){var n=e(4),o=e(21),i=n.WeakMap;t.exports=o(i)&&/native code/.test(String(i))},function(t,r,e){var n=e(34),o=e(40),i=n("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},function(t,r,e){t.exports={}},function(t,r,e){var n=e(38),o=e(56),i=e(5),a=e(44);t.exports=function(t,r,e){var u,c,f=o(r),s=a.f,l=i.f;for(u=0;uf;)o(n,e=r[f++])&&(~a(s,e)||c(s,e));return s}},function(t,r,e){var n=e(12),o=e(60),i=e(63),createMethod=function(t){return function(r,e,a){var u,c,f=n(r),s=i(f);if(0===s)return!t&&-1;if(u=o(a,s),t&&e!=e){for(;s>u;)if((c=f[u++])!=c)return!0}else for(;s>u;u++)if((t||u in f)&&f[u]===e)return t||u||0;return!t&&-1}};t.exports={includes:createMethod(!0),indexOf:createMethod(!1)}},function(t,r,e){var n=e(61),o=Math.max,i=Math.min;t.exports=function(t,r){var e=n(t);return e<0?o(e+r,0):i(e,r)}},function(t,r,e){var n=e(62);t.exports=function(t){var r=+t;return r!=r||0===r?0:n(r)}},function(t,r,e){var n=Math.ceil,o=Math.floor;t.exports=Math.trunc||function trunc(t){var r=+t;return(r>0?o:n)(r)}},function(t,r,e){var n=e(64);t.exports=function(t){return n(t.length)}},function(t,r,e){var n=e(61),o=Math.min;t.exports=function(t){var r=n(t);return r>0?o(r,9007199254740991):0}},function(t,r,e){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(t,r,e){r.f=Object.getOwnPropertySymbols},function(t,r,e){var n=e(7),o=e(21),i=/#|\.prototype\./,isForced=function(t,r){var e=u[a(t)];return e===f||e!==c&&(o(r)?n(r):!!r)},a=isForced.normalize=function(t){return String(t).replace(i,".").toLowerCase()},u=isForced.data={},c=isForced.NATIVE="N",f=isForced.POLYFILL="P";t.exports=isForced},function(t,r,e){var n=e(69),o=String;t.exports=function(t){if("Symbol"===n(t))throw new TypeError("Cannot convert a Symbol value to a string");return o(t)}},function(r,e,n){var o=n(70),i=n(21),a=n(15),u=n(33)("toStringTag"),c=Object,f="Arguments"===a(function(){return arguments}());r.exports=o?a:function(r){var e,n,o;return r===t?"Undefined":null===r?"Null":"string"==typeof(n=function(t,r){try{return t[r]}catch(e){}}(e=c(r),u))?n:f?a(e):"Object"===(o=a(e))&&i(e.callee)?"Arguments":o}},function(t,r,e){var n={};n[e(33)("toStringTag")]="z",t.exports="[object z]"===String(n)},function(r,e,n){var o,i=n(46),a=n(72),u=n(65),c=n(54),f=n(74),s=n(42),l=n(53),h="prototype",p="script",g=l("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(t){return"<"+p+">"+t+""},NullProtoObjectViaActiveX=function(t){t.write(scriptTag("")),t.close();var r=t.parentWindow.Object;return t=null,r},NullProtoObject=function(){try{o=new ActiveXObject("htmlfile")}catch(i){}var t,r,e;NullProtoObject="undefined"!=typeof document?document.domain&&o?NullProtoObjectViaActiveX(o):(r=s("iframe"),e="java"+p+":",r.style.display="none",f.appendChild(r),r.src=String(e),(t=r.contentWindow.document).open(),t.write(scriptTag("document.F=Object")),t.close(),t.F):NullProtoObjectViaActiveX(o);for(var n=u.length;n--;)delete NullProtoObject[h][u[n]];return NullProtoObject()};c[g]=!0,r.exports=Object.create||function create(r,e){var n;return null!==r?(EmptyConstructor[h]=i(r),n=new EmptyConstructor,EmptyConstructor[h]=null,n[g]=r):n=NullProtoObject(),e===t?n:a.f(n,e)}},function(t,r,e){var n=e(6),o=e(45),i=e(44),a=e(46),u=e(12),c=e(73);r.f=n&&!o?Object.defineProperties:function defineProperties(t,r){var e,n,o,f,s;for(a(t),e=u(r),o=(n=c(r)).length,f=0;o>f;)i.f(t,s=n[f++],e[s]);return t}},function(t,r,e){var n=e(58),o=e(65);t.exports=Object.keys||function keys(t){return n(t,o)}},function(t,r,e){var n=e(23);t.exports=n("document","documentElement")},function(t,r,e){var n=e(15),o=e(12),i=e(57).f,a=e(76),u="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function getOwnPropertyNames(t){return u&&"Window"===n(t)?function(t){try{return i(t)}catch(r){return a(u)}}(t):i(o(t))}},function(t,r,e){var n=e(14);t.exports=n([].slice)},function(t,r,e){var n=e(48),o=e(44);t.exports=function(t,r,e){return e.get&&n(e.get,r,{getter:!0}),e.set&&n(e.set,r,{setter:!0}),o.f(t,r,e)}},function(t,r,e){var n=e(33);r.f=n},function(t,r,e){var n=e(80),o=e(38),i=e(78),a=e(44).f;t.exports=function(t){var r=n.Symbol||(n.Symbol={});o(r,t)||a(r,t,{value:i.f(t)})}},function(t,r,e){var n=e(4);t.exports=n},function(t,r,e){var n=e(8),o=e(23),i=e(33),a=e(47);t.exports=function(){var t=o("Symbol"),r=t&&t.prototype,e=r&&r.valueOf,u=i("toPrimitive");r&&!r[u]&&a(r,u,function(t){return n(e,this)},{arity:1})}},function(t,r,e){var n=e(44).f,o=e(38),i=e(33)("toStringTag");t.exports=function(t,r,e){t&&!e&&(t=t.prototype),t&&!o(t,i)&&n(t,i,{configurable:!0,value:r})}},function(r,e,n){var o=n(84),i=n(14),a=n(13),u=n(39),c=n(63),f=n(86),s=i([].push),createMethod=function(r){var e=1===r,n=2===r,i=3===r,l=4===r,h=6===r,p=7===r,g=5===r||h;return function(v,d,y,m){for(var b,w,x=u(v),S=a(x),E=c(S),A=o(d,y),I=0,O=m||f,R=e?O(v,E):n||p?O(v,0):t;E>I;I++)if((g||I in S)&&(w=A(b=S[I],I,x),r))if(e)R[I]=w;else if(w)switch(r){case 3:return!0;case 5:return b;case 6:return I;case 2:s(R,b)}else switch(r){case 4:return!1;case 7:s(R,b)}return h?-1:i||l?l:R}};r.exports={forEach:createMethod(0),map:createMethod(1),filter:createMethod(2),some:createMethod(3),every:createMethod(4),find:createMethod(5),findIndex:createMethod(6),filterReject:createMethod(7)}},function(r,e,n){var o=n(85),i=n(30),a=n(9),u=o(o.bind);r.exports=function(r,e){return i(r),e===t?r:a?u(r,e):function(){return r.apply(e,arguments)}}},function(t,r,e){var n=e(15),o=e(14);t.exports=function(t){if("Function"===n(t))return o(t)}},function(t,r,e){var n=e(87);t.exports=function(t,r){return new(n(t))(0===r?0:r)}},function(r,e,n){var o=n(88),i=n(89),a=n(20),u=n(33)("species"),c=Array;r.exports=function(r){var e;return o(r)&&(i(e=r.constructor)&&(e===c||o(e.prototype))||a(e)&&null===(e=e[u]))&&(e=t),e===t?c:e}},function(t,r,e){var n=e(15);t.exports=Array.isArray||function isArray(t){return"Array"===n(t)}},function(t,r,e){var n=e(14),o=e(7),i=e(21),a=e(69),u=e(23),c=e(50),noop=function(){},f=u("Reflect","construct"),s=/^\s*(?:class|function)\b/,l=n(s.exec),h=!s.test(noop),p=function isConstructor(t){if(!i(t))return!1;try{return f(noop,[],t),!0}catch(r){return!1}},g=function isConstructor(t){if(!i(t))return!1;switch(a(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return h||!!l(s,c(t))}catch(r){return!0}};g.sham=!0,t.exports=!f||o(function(){var t;return p(p.call)||!p(Object)||!p(function(){t=!0})||t})?g:p},function(t,r,e){var n=e(3),o=e(23),i=e(38),a=e(68),u=e(34),c=e(91),f=u("string-to-symbol-registry"),s=u("symbol-to-string-registry");n({target:"Symbol",stat:!0,forced:!c},{"for":function(t){var r,e=a(t);return i(f,e)?f[e]:(r=o("Symbol")(e),f[e]=r,s[r]=e,r)}})},function(t,r,e){var n=e(26);t.exports=n&&!!Symbol["for"]&&!!Symbol.keyFor},function(t,r,e){var n=e(3),o=e(38),i=e(22),a=e(31),u=e(34),c=e(91),f=u("symbol-to-string-registry");n({target:"Symbol",stat:!0,forced:!c},{keyFor:function keyFor(t){if(!i(t))throw new TypeError(a(t)+" is not a symbol");if(o(f,t))return f[t]}})},function(r,e,n){var o=n(3),i=n(23),a=n(94),u=n(8),c=n(14),f=n(7),s=n(21),l=n(22),h=n(76),p=n(95),g=n(26),v=String,d=i("JSON","stringify"),y=c(/./.exec),m=c("".charAt),b=c("".charCodeAt),w=c("".replace),x=c(1.1.toString),S=/[\uD800-\uDFFF]/g,E=/^[\uD800-\uDBFF]$/,A=/^[\uDC00-\uDFFF]$/,I=!g||f(function(){var t=i("Symbol")("stringify detection");return"[null]"!==d([t])||"{}"!==d({a:t})||"{}"!==d(Object(t))}),O=f(function(){return'"\\udf06\\ud834"'!==d("\udf06\ud834")||'"\\udead"'!==d("\udead")}),stringifyWithSymbolsFix=function(r,e){var n=h(arguments),o=p(e);if(s(o)||r!==t&&!l(r))return n[1]=function(t,r){if(s(o)&&(r=u(o,this,v(t),r)),!l(r))return r},a(d,null,n)},fixIllFormed=function(t,r,e){var n=m(e,r-1),o=m(e,r+1);return y(E,t)&&!y(A,o)||y(A,t)&&!y(E,n)?"\\u"+x(b(t,0),16):t};d&&o({target:"JSON",stat:!0,arity:3,forced:I||O},{stringify:function stringify(t,r,e){var n=h(arguments),o=a(I?stringifyWithSymbolsFix:d,null,n);return O&&"string"==typeof o?w(o,S,fixIllFormed):o}})},function(t,r,e){var n=e(9),o=Function.prototype,i=o.apply,a=o.call;t.exports="object"==typeof Reflect&&Reflect.apply||(n?a.bind(i):function(){return a.apply(i,arguments)})},function(t,r,e){var n=e(14),o=e(88),i=e(21),a=e(15),u=e(68),c=n([].push);t.exports=function(t){var r,e,n,f,s,l;if(i(t))return t;if(o(t)){for(r=t.length,e=[],n=0;nS&&p(o,arguments[S]),o}),w.prototype=m,"Error"!==A?c?c(w,b):f(w,b,{name:!0}):v&&x in I&&(s(w,I,x),s(w,I,"prepareStackTrace")),f(w,I),!d)try{m.name!==A&&a(m,"name",A),m.constructor=w}catch(O){}return w}}},function(r,e,n){var o=n(116),i=n(20),a=n(16),u=n(117);r.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,r=!1,e={};try{(t=o(Object.prototype,"__proto__","set"))(e,[]),r=e instanceof Array}catch(n){}return function setPrototypeOf(e,n){return a(e),u(n),i(e)?(r?t(e,n):e.__proto__=n,e):e}}():t)},function(t,r,e){var n=e(14),o=e(30);t.exports=function(t,r,e){try{return n(o(Object.getOwnPropertyDescriptor(t,r)[e]))}catch(i){}}},function(t,r,e){var n=e(118),o=String,i=TypeError;t.exports=function(t){if(n(t))return t;throw new i("Can't set "+o(t)+" as a prototype")}},function(t,r,e){var n=e(20);t.exports=function(t){return n(t)||null===t}},function(t,r,e){var n=e(44).f;t.exports=function(t,r,e){e in t||n(t,e,{configurable:!0,get:function(){return r[e]},set:function(t){r[e]=t}})}},function(t,r,e){var n=e(21),o=e(20),i=e(115);t.exports=function(t,r,e){var a,u;return i&&n(a=r.constructor)&&a!==e&&o(u=a.prototype)&&u!==e.prototype&&i(t,u),t}},function(r,e,n){var o=n(68);r.exports=function(r,e){return r===t?arguments.length<2?"":e:o(r)}},function(t,r,e){var n=e(20),o=e(43);t.exports=function(t,r){n(r)&&"cause"in r&&o(t,"cause",r.cause)}},function(t,r,e){var n=e(43),o=e(124),i=e(125),a=Error.captureStackTrace;t.exports=function(t,r,e,u){i&&(a?a(t,r):n(t,"stack",o(e,u)))}},function(t,r,e){var n=e(14),o=Error,i=n("".replace),a=String(new o("zxcasd").stack),u=/\n\s*at [^:]*:[^\n]*/,c=u.test(a);t.exports=function(t,r){if(c&&"string"==typeof t&&!o.prepareStackTrace)for(;r--;)t=i(t,u,"");return t}},function(t,r,e){var n=e(7),o=e(11);t.exports=!n(function(){var t=new Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",o(1,7)),7!==t.stack)})},function(t,r,e){var n=e(3),o=e(23),i=e(20),a=e(69),u=e(7),c="Error",f="DOMException",s=Object.setPrototypeOf||{}.__proto__,l=o(f),h=Error,p=h.isError;n({target:"Error",stat:!0,sham:!0,forced:!p||!s||u(function(){return l&&!p(new l(f))||!p(new h(c,{cause:function(){}}))||p(o("Object","create")(h.prototype))})},{isError:function isError(t){if(!i(t))return!1;var r=a(t);return r===c||r===f}})},function(t,r,e){var n=e(47),o=e(128),i=Error.prototype;i.toString!==o&&n(i,"toString",o)},function(t,r,e){var n=e(6),o=e(7),i=e(46),a=e(121),u=Error.prototype.toString,c=o(function(){if(n){var t=Object.create(Object.defineProperty({},"name",{get:function(){return this===t}}));if("true"!==u.call(t))return!0}return"2: 1"!==u.call({message:1,name:2})||"Error"!==u.call({})});t.exports=c?function toString(){var t=i(this),r=a(t.name,"Error"),e=a(t.message);return r?e?r+": "+e:r:e}:u},function(t,r,e){e(130)},function(r,e,n){ +var o,i=n(3),a=n(24),u=n(131),c=n(115),f=n(55),s=n(71),l=n(43),h=n(11),p=n(122),g=n(123),v=n(133),d=n(121),y=n(33)("toStringTag"),m=Error,b=[].push,w=function AggregateError(r,e){var n,i,f=a(o,this);return c?n=c(new m,f?u(this):o):(n=f?this:s(o),l(n,y,"Error")),e!==t&&l(n,"message",d(e)),g(n,w,n.stack,1),arguments.length>2&&p(n,arguments[2]),v(r,b,{that:i=[]}),l(n,"errors",i),n};c?c(w,m):f(w,m,{name:!0}),o=w.prototype=s(m.prototype,{constructor:h(1,w),message:h(1,""),name:h(1,"AggregateError")}),i({global:!0,constructor:!0,arity:2},{AggregateError:w})},function(t,r,e){var n=e(38),o=e(21),i=e(39),a=e(53),u=e(132),c=a("IE_PROTO"),f=Object,s=f.prototype;t.exports=u?f.getPrototypeOf:function(t){var r,e=i(t);return n(e,c)?e[c]:o(r=e.constructor)&&e instanceof r?r.prototype:e instanceof f?s:null}},function(t,r,e){var n=e(7);t.exports=!n(function(){function F(){}return F.prototype.constructor=null,Object.getPrototypeOf(new F)!==F.prototype})},function(t,r,e){var n=e(84),o=e(8),i=e(46),a=e(31),u=e(134),c=e(63),f=e(24),s=e(136),l=e(137),h=e(138),p=TypeError,Result=function(t,r){this.stopped=t,this.result=r},g=Result.prototype;t.exports=function(t,r,e){var v,d,y,m,b,w,x,S=!(!e||!e.AS_ENTRIES),E=!(!e||!e.IS_RECORD),A=!(!e||!e.IS_ITERATOR),I=!(!e||!e.INTERRUPTED),O=n(r,e&&e.that),stop=function(t){return v&&h(v,"normal"),new Result(!0,t)},callFn=function(t){return S?(i(t),I?O(t[0],t[1],stop):O(t[0],t[1])):I?O(t,stop):O(t)};if(E)v=t.iterator;else if(A)v=t;else{if(!(d=l(t)))throw new p(a(t)+" is not iterable");if(u(d)){for(y=0,m=c(t);m>y;y++)if((b=callFn(t[y]))&&f(g,b))return b;return new Result(!1)}v=s(t,d)}for(w=E?t.next:v.next;!(x=o(w,v)).done;){try{b=callFn(x.value)}catch(R){h(v,"throw",R)}if("object"==typeof b&&b&&f(g,b))return b}return new Result(!1)}},function(r,e,n){var o=n(33),i=n(135),a=o("iterator"),u=Array.prototype;r.exports=function(r){return r!==t&&(i.Array===r||u[a]===r)}},function(t,r,e){t.exports={}},function(t,r,e){var n=e(8),o=e(30),i=e(46),a=e(31),u=e(137),c=TypeError;t.exports=function(t,r){var e=arguments.length<2?u(t):r;if(o(e))return i(n(e,t));throw new c(a(t)+" is not iterable")}},function(t,r,e){var n=e(69),o=e(29),i=e(17),a=e(135),u=e(33)("iterator");t.exports=function(t){if(!i(t))return o(t,u)||o(t,"@@iterator")||a[n(t)]}},function(t,r,e){var n=e(8),o=e(46),i=e(29);t.exports=function(t,r,e){var a,u;o(t);try{if(!(a=i(t,"return"))){if("throw"===r)throw e;return e}a=n(a,t)}catch(c){u=!0,a=c}if("throw"===r)throw e;if(u)throw a;return o(a),e}},function(t,r,e){var n=e(3),o=e(23),i=e(94),a=e(7),u=e(114),c="AggregateError",f=o(c),s=!a(function(){return 1!==f([1]).errors[0]})&&a(function(){return 7!==f([1],c,{cause:7}).cause});n({global:!0,constructor:!0,arity:2,forced:s},{AggregateError:u(c,function(t){return function AggregateError(r,e){return i(t,this,arguments)}},s,!0)})},function(r,e,n){var o,i=n(3),a=n(4),u=n(24),c=n(131),f=n(115),s=n(55),l=n(71),h=n(43),p=n(11),g=n(123),v=n(121),d=n(33),y=n(7),m=n(36),b=a.SuppressedError,w=d("toStringTag"),x=Error,S=!!b&&3!==b.length,E=!!b&&y(function(){return 4===new b(1,2,3,{cause:4}).cause}),A=S||E,I=function SuppressedError(r,e,n){var i,a=u(o,this);return f?i=!A||a&&c(this)!==o?f(new x,a?c(this):o):new b:(i=a?this:l(o),h(i,w,"Error")),n!==t&&h(i,"message",v(n)),g(i,I,i.stack,1),h(i,"error",r),h(i,"suppressed",e),i};f?f(I,x):s(I,x,{name:!0}),o=I.prototype=A?b.prototype:l(x.prototype,{constructor:p(1,I),message:p(1,""),name:p(1,"SuppressedError")}),A&&!m&&(o.constructor=I),i({global:!0,constructor:!0,arity:3,forced:A},{SuppressedError:I})},function(r,e,n){var o=n(3),i=n(39),a=n(63),u=n(61),c=n(142);o({target:"Array",proto:!0},{at:function at(r){var e=i(this),n=a(e),o=u(r),c=o>=0?o:n+o;return c<0||c>=n?t:e[c]}}),c("at")},function(r,e,n){var o=n(33),i=n(71),a=n(44).f,u=o("unscopables"),c=Array.prototype;c[u]===t&&a(c,u,{configurable:!0,value:i(null)}),r.exports=function(t){c[u][t]=!0}},function(r,e,n){var o=n(3),i=n(7),a=n(88),u=n(20),c=n(39),f=n(63),s=n(144),l=n(145),h=n(86),p=n(146),g=n(33),v=n(27),d=g("isConcatSpreadable"),y=v>=51||!i(function(){var t=[];return t[d]=!1,t.concat()[0]!==t}),isConcatSpreadable=function(r){if(!u(r))return!1;var e=r[d];return e!==t?!!e:a(r)};o({target:"Array",proto:!0,arity:1,forced:!y||!p("concat")},{concat:function concat(t){var r,e,n,o,i,a=c(this),u=h(a,0),p=0;for(r=-1,n=arguments.length;r9007199254740991)throw n("Maximum allowed index exceeded");return t}},function(t,r,e){var n=e(6),o=e(44),i=e(11);t.exports=function(t,r,e){n?o.f(t,r,i(0,e)):t[r]=e}},function(t,r,e){var n=e(7),o=e(33),i=e(27),a=o("species");t.exports=function(t){return i>=51||!n(function(){var r=[];return(r.constructor={})[a]=function(){return{foo:1}},1!==r[t](Boolean).foo})}},function(t,r,e){var n=e(3),o=e(148),i=e(142);n({target:"Array",proto:!0},{copyWithin:o}),i("copyWithin")},function(r,e,n){var o=n(39),i=n(60),a=n(63),u=n(149),c=Math.min;r.exports=[].copyWithin||function copyWithin(r,e){var n=o(this),f=a(n),s=i(r,f),l=i(e,f),h=arguments.length>2?arguments[2]:t,p=c((h===t?f:i(h,f))-l,f-s),g=1;for(l0;)l in n?n[s]=n[l]:u(n,s),s+=g,l+=g;return n}},function(t,r,e){var n=e(31),o=TypeError;t.exports=function(t,r){if(!delete t[r])throw new o("Cannot delete property "+n(r)+" of "+n(t))}},function(r,e,n){var o=n(3),i=n(83).every;o({target:"Array",proto:!0,forced:!n(151)("every")},{every:function every(r){return i(this,r,arguments.length>1?arguments[1]:t)}})},function(t,r,e){var n=e(7);t.exports=function(t,r){var e=[][t];return!!e&&n(function(){e.call(null,r||function(){return 1},1)})}},function(t,r,e){var n=e(3),o=e(153),i=e(142);n({target:"Array",proto:!0},{fill:o}),i("fill")},function(r,e,n){var o=n(39),i=n(60),a=n(63);r.exports=function fill(r){for(var e=o(this),n=a(e),u=arguments.length,c=i(u>1?arguments[1]:t,n),f=u>2?arguments[2]:t,s=f===t?n:i(f,n);s>c;)e[c++]=r;return e}},function(r,e,n){var o=n(3),i=n(83).filter;o({target:"Array",proto:!0,forced:!n(146)("filter")},{filter:function filter(r){return i(this,r,arguments.length>1?arguments[1]:t)}})},function(r,e,n){var o=n(3),i=n(83).find,a=n(142),u="find",c=!0;u in[]&&Array(1)[u](function(){c=!1}),o({target:"Array",proto:!0,forced:c},{find:function find(r){return i(this,r,arguments.length>1?arguments[1]:t)}}),a(u)},function(r,e,n){var o=n(3),i=n(83).findIndex,a=n(142),u="findIndex",c=!0;u in[]&&Array(1)[u](function(){c=!1}),o({target:"Array",proto:!0,forced:c},{findIndex:function findIndex(r){return i(this,r,arguments.length>1?arguments[1]:t)}}),a(u)},function(r,e,n){var o=n(3),i=n(158).findLast,a=n(142);o({target:"Array",proto:!0},{findLast:function findLast(r){return i(this,r,arguments.length>1?arguments[1]:t)}}),a("findLast")},function(r,e,n){var o=n(84),i=n(13),a=n(39),u=n(63),createMethod=function(r){var e=1===r;return function(n,c,f){for(var s,l=a(n),h=i(l),p=u(h),g=o(c,f);p-- >0;)if(g(s=h[p],p,l))switch(r){case 0:return s;case 1:return p}return e?-1:t}};r.exports={findLast:createMethod(0),findLastIndex:createMethod(1)}},function(r,e,n){var o=n(3),i=n(158).findLastIndex,a=n(142);o({target:"Array",proto:!0},{findLastIndex:function findLastIndex(r){return i(this,r,arguments.length>1?arguments[1]:t)}}),a("findLastIndex")},function(r,e,n){var o=n(3),i=n(161),a=n(39),u=n(63),c=n(61),f=n(86);o({target:"Array",proto:!0},{flat:function flat(){var r=arguments.length?arguments[0]:t,e=a(this),n=u(e),o=f(e,0);return o.length=i(o,e,e,n,0,r===t?1:c(r)),o}})},function(t,r,e){var n=e(88),o=e(63),i=e(144),a=e(84),flattenIntoArray=function(t,r,e,u,c,f,s,l){for(var h,p,g=c,v=0,d=!!s&&a(s,l);v0&&n(h)?(p=o(h),g=flattenIntoArray(t,r,h,p,g,f-1)-1):(i(g+1),t[g]=h),g++),v++;return g};t.exports=flattenIntoArray},function(r,e,n){var o=n(3),i=n(161),a=n(30),u=n(39),c=n(63),f=n(86);o({target:"Array",proto:!0},{flatMap:function flatMap(r){var e,n=u(this),o=c(n);return a(r),(e=f(n,0)).length=i(e,n,n,o,0,1,r,arguments.length>1?arguments[1]:t),e}})},function(t,r,e){var n=e(3),o=e(164);n({target:"Array",proto:!0,forced:[].forEach!==o},{forEach:o})},function(r,e,n){var o=n(83).forEach,i=n(151)("forEach");r.exports=i?[].forEach:function forEach(r){return o(this,r,arguments.length>1?arguments[1]:t)}},function(t,r,e){var n=e(3),o=e(166);n({target:"Array",stat:!0,forced:!e(168)(function(t){Array.from(t)})},{from:o})},function(r,e,n){var o=n(84),i=n(8),a=n(39),u=n(167),c=n(134),f=n(89),s=n(63),l=n(145),h=n(136),p=n(137),g=Array;r.exports=function from(r){var e,n,v,d,y,m,b,w,x=a(r),S=f(this),E=arguments.length,A=E>1?arguments[1]:t,I=A!==t;if(I&&(A=o(A,E>2?arguments[2]:t)),n=0,!(e=p(x))||this===g&&c(e))for(v=s(x),d=S?new this(v):g(v);v>n;n++)w=I?A(x[n],n):x[n],l(d,n,w);else for(d=S?new this:[],b=(m=h(x,e)).next;!(y=i(b,m)).done;n++)w=I?u(m,A,[y.value,n],!0):y.value,l(d,n,w);return d.length=n,d}},function(t,r,e){var n=e(46),o=e(138);t.exports=function(t,r,e,i){try{return i?r(n(e)[0],e[1]):r(e)}catch(a){o(t,"throw",a)}}},function(t,r,e){var n,o,i=e(33)("iterator"),a=!1;try{n=0,(o={next:function(){return{done:!!n++}},"return":function(){a=!0}})[i]=function(){return this},Array.from(o,function(){throw 2})}catch(u){}t.exports=function(t,r){var e,n;try{if(!r&&!a)return!1}catch(u){return!1}e=!1;try{(n={})[i]=function(){return{next:function(){return{done:e=!0}}}},t(n)}catch(u){}return e}},function(r,e,n){var o=n(3),i=n(59).includes,a=n(7),u=n(142);o({target:"Array",proto:!0,forced:a(function(){return!Array(1).includes()})},{includes:function includes(r){return i(this,r,arguments.length>1?arguments[1]:t)}}),u("includes")},function(r,e,n){var o=n(3),i=n(85),a=n(59).indexOf,u=n(151),c=i([].indexOf),f=!!c&&1/c([1],1,-0)<0;o({target:"Array",proto:!0,forced:f||!u("indexOf")},{indexOf:function indexOf(r){var e=arguments.length>1?arguments[1]:t;return f?c(this,r,e)||0:a(this,r,e)}})},function(t,r,e){e(3)({target:"Array",stat:!0},{isArray:e(88)})},function(r,e,n){var o,i=n(12),a=n(142),u=n(135),c=n(51),f=n(44).f,s=n(173),l=n(176),h=n(36),p=n(6),g="Array Iterator",v=c.set,d=c.getterFor(g);if(r.exports=s(Array,"Array",function(t,r){v(this,{type:g,target:i(t),index:0,kind:r})},function(){var r=d(this),e=r.target,n=r.index++;if(!e||n>=e.length)return r.target=null,l(t,!0);switch(r.kind){case"keys":return l(n,!1);case"values":return l(e[n],!1)}return l([n,e[n]],!1)},"values"),o=u.Arguments=u.Array,a("keys"),a("values"),a("entries"),!h&&p&&"values"!==o.name)try{f(o,"name",{value:"values"})}catch(y){}},function(t,r,e){var n=e(3),o=e(8),i=e(36),a=e(49),u=e(21),c=e(174),f=e(131),s=e(115),l=e(82),h=e(43),p=e(47),g=e(33),v=e(135),d=e(175),y=a.PROPER,m=a.CONFIGURABLE,b=d.IteratorPrototype,w=d.BUGGY_SAFARI_ITERATORS,x=g("iterator"),S="keys",E="values",A="entries",returnThis=function(){return this};t.exports=function(t,r,e,a,g,d,I){var O,R,M,T,k,P,j,C,N,D;if(c(e,r,a),O=function(t){if(t===g&&P)return P;if(!w&&t&&t in T)return T[t];switch(t){case S:return function keys(){return new e(this,t)};case E:return function values(){return new e(this,t)};case A:return function entries(){return new e(this,t)}}return function(){return new e(this)}},R=r+" Iterator",M=!1,k=(T=t.prototype)[x]||T["@@iterator"]||g&&T[g],P=!w&&k||O(g),(j="Array"===r&&T.entries||k)&&(C=f(j.call(new t)))!==Object.prototype&&C.next&&(i||f(C)===b||(s?s(C,b):u(C[x])||p(C,x,returnThis)),l(C,R,!0,!0),i&&(v[R]=returnThis)),y&&g===E&&k&&k.name!==E&&(!i&&m?h(T,"name",E):(M=!0,P=function values(){return o(k,this)})),g)if(N={values:O(E),keys:d?P:O(S),entries:O(A)},I)for(D in N)(w||M||!(D in T))&&p(T,D,N[D]);else n({target:r,proto:!0,forced:w||M},N);return i&&!I||T[x]===P||p(T,x,P,{name:g}),v[r]=P,N}},function(t,r,e){var n=e(175).IteratorPrototype,o=e(71),i=e(11),a=e(82),u=e(135),returnThis=function(){return this};t.exports=function(t,r,e,c){var f=r+" Iterator";return t.prototype=o(n,{next:i(+!c,e)}),a(t,f,!1,!0),u[f]=returnThis,t}},function(t,r,e){var n,o,i,a=e(7),u=e(21),c=e(20),f=e(71),s=e(131),l=e(47),h=e(33),p=e(36),g=h("iterator"),v=!1;[].keys&&("next"in(i=[].keys())?(o=s(s(i)))!==Object.prototype&&(n=o):v=!0),!c(n)||a(function(){var t={};return n[g].call(t)!==t})?n={}:p&&(n=f(n)),u(n[g])||l(n,g,function(){return this}),t.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:v}},function(t,r,e){t.exports=function(t,r){return{value:t,done:r}}},function(r,e,n){var o=n(3),i=n(14),a=n(13),u=n(12),c=n(151),f=i([].join);o({target:"Array",proto:!0,forced:a!==Object||!c("join",",")},{join:function join(r){return f(u(this),r===t?",":r)}})},function(t,r,e){var n=e(3),o=e(179);n({target:"Array",proto:!0,forced:o!==[].lastIndexOf},{lastIndexOf:o})},function(t,r,e){var n=e(94),o=e(12),i=e(61),a=e(63),u=e(151),c=Math.min,f=[].lastIndexOf,s=!!f&&1/[1].lastIndexOf(1,-0)<0,l=u("lastIndexOf");t.exports=s||!l?function lastIndexOf(t){var r,e,u;if(s)return n(f,this,arguments)||0;if(r=o(this),0===(e=a(r)))return-1;for(u=e-1,arguments.length>1&&(u=c(u,i(arguments[1]))),u<0&&(u=e+u);u>=0;u--)if(u in r&&r[u]===t)return u||0;return-1}:f},function(r,e,n){var o=n(3),i=n(83).map;o({target:"Array",proto:!0,forced:!n(146)("map")},{map:function map(r){return i(this,r,arguments.length>1?arguments[1]:t)}})},function(t,r,e){var n=e(3),o=e(7),i=e(89),a=e(145),u=Array;n({target:"Array",stat:!0,forced:o(function(){function F(){}return!(u.of.call(F)instanceof F)})},{of:function of(){for(var t=0,r=arguments.length,e=new(i(this)?this:u)(r);r>t;)a(e,t,arguments[t++]);return e.length=r,e}})},function(t,r,e){var n=e(3),o=e(39),i=e(63),a=e(183),u=e(144);n({target:"Array",proto:!0,arity:1,forced:e(7)(function(){return 4294967297!==[].push.call({length:4294967296},1)})||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(t){return t instanceof TypeError}}()},{push:function push(t){var r,e=o(this),n=i(e),c=arguments.length;for(u(n+c),r=0;r79&&u<83||!a("reduce")},{reduce:function reduce(r){var e=arguments.length;return i(this,r,e,e>1?arguments[1]:t)}})},function(t,r,e){var n=e(30),o=e(39),i=e(13),a=e(63),u=TypeError,c="Reduce of empty array with no initial value",createMethod=function(t){return function(r,e,f,s){var l,h,p=o(r),g=i(p),v=a(p);if(n(e),0===v&&f<2)throw new u(c);if(l=t?v-1:0,h=t?-1:1,f<2)for(;;){if(l in g){s=g[l],l+=h;break}if(l+=h,t?l<0:v<=l)throw new u(c)}for(;t?l>=0:v>l;l+=h)l in g&&(s=e(s,g[l],l,p));return s}};t.exports={left:createMethod(!1),right:createMethod(!0)}},function(t,r,e){var n=e(187);t.exports="NODE"===n},function(t,r,e){var n=e(4),o=e(28),i=e(15),userAgentStartsWith=function(t){return o.slice(0,t.length)===t};t.exports=userAgentStartsWith("Bun/")?"BUN":userAgentStartsWith("Cloudflare-Workers")?"CLOUDFLARE":userAgentStartsWith("Deno/")?"DENO":userAgentStartsWith("Node.js/")?"NODE":n.Bun&&"string"==typeof Bun.version?"BUN":n.Deno&&"object"==typeof Deno.version?"DENO":"process"===i(n.process)?"NODE":n.window&&n.document?"BROWSER":"REST"},function(r,e,n){var o=n(3),i=n(185).right,a=n(151),u=n(27);o({target:"Array",proto:!0,forced:!n(186)&&u>79&&u<83||!a("reduceRight")},{reduceRight:function reduceRight(r){return i(this,r,arguments.length,arguments.length>1?arguments[1]:t)}})},function(t,r,e){var n=e(3),o=e(14),i=e(88),a=o([].reverse),u=[1,2];n({target:"Array",proto:!0,forced:String(u)===String(u.reverse())},{reverse:function reverse(){return i(this)&&(this.length=this.length),a(this)}})},function(r,e,n){var o=n(3),i=n(88),a=n(89),u=n(20),c=n(60),f=n(63),s=n(12),l=n(145),h=n(33),p=n(146),g=n(76),v=p("slice"),d=h("species"),y=Array,m=Math.max;o({target:"Array",proto:!0,forced:!v},{slice:function slice(r,e){var n,o,h,p=s(this),v=f(p),b=c(r,v),w=c(e===t?v:e,v);if(i(p)&&((a(n=p.constructor)&&(n===y||i(n.prototype))||u(n)&&null===(n=n[d]))&&(n=t),n===y||n===t))return g(p,b,w);for(o=new(n===t?y:n)(m(w-b,0)),h=0;b1?arguments[1]:t)}})},function(r,e,n){var o=n(3),i=n(14),a=n(30),u=n(39),c=n(63),f=n(149),s=n(68),l=n(7),h=n(193),p=n(151),g=n(194),v=n(195),d=n(27),y=n(196),m=[],b=i(m.sort),w=i(m.push),x=l(function(){m.sort(t)}),S=l(function(){m.sort(null)}),E=p("sort"),A=!l(function(){var t,r,e,n,o;if(d)return d<70;if(!(g&&g>3)){if(v)return!0;if(y)return y<603;for(t="",r=65;r<76;r++){switch(e=String.fromCharCode(r),r){case 66:case 69:case 70:case 72:n=3;break;case 68:case 71:n=4;break;default:n=2}for(o=0;o<47;o++)m.push({k:e+o,v:n})}for(m.sort(function(t,r){return r.v-t.v}),o=0;os(n)?1:-1}}(r)),i=c(n),l=0;l0;)t[a]=t[--a];a!==e++&&(t[a]=i)}else for(u=o(g/2),c=sort(n(t,0,u),r),f=sort(n(t,u),r),s=c.length,l=f.length,h=0,p=0;hw-n+e;d--)h(b,d-1)}else if(e>n)for(d=w-n;d>x;d--)m=d+e-1,(y=d+n-1)in b?b[m]=b[y]:h(b,m);for(d=0;d2?e:n(r),a=new t(i);i>o;)a[o]=r[o++];return a}},function(t,r,e){var n=e(4);t.exports=function(t,r){var e=n[t],o=e&&e.prototype;return o&&o[r]}},function(t,r,e){var n=e(3),o=e(142),i=e(144),a=e(63),u=e(60),c=e(12),f=e(61),s=Array,l=Math.max,h=Math.min;n({target:"Array",proto:!0},{toSpliced:function toSpliced(t,r){var e,n,o,p,g=c(this),v=a(g),d=u(t,v),y=arguments.length,m=0;for(0===y?e=n=0:1===y?(e=0,n=v-d):(e=y-2,n=h(l(f(r),0),v-d)),o=i(v+e-n),p=s(o);m=f||l<0)throw new i("Incorrect index");for(u=new r(f),c=0;c>8&255]},packInt32=function(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]},unpackInt32=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},packFloat32=function(t){return J(w(t),23,4)},packFloat64=function(t){return J(t,52,8)},addGetter=function(t,r,e){p(t[N],r,{configurable:!0,get:function(){return e(this)[r]}})},get=function(t,r,e,n){var o,i,a=_(t),u=b(e),c=!!n;if(u+r>a.byteLength)throw new K(D);return i=I(a.bytes,o=u+a.byteOffset,o+r),c?i:$(i)},set=function(t,r,e,n,o,i){var a,u,c,f=_(t),s=b(e),l=n(+o),h=!!i;if(s+r>f.byteLength)throw new K(D);for(a=f.bytes,u=s+f.byteOffset,c=0;c>24)},setUint8:function setUint8(t,r){a(this,t,r<<24>>24)}},{unsafe:!0})):(W=(z=function ArrayBuffer(t){d(this,W);var r=b(t);L(this,{type:j,bytes:Y(G(r),0),byteLength:r}),f||(this.byteLength=r,this.detached=!1)})[N],H=(V=function DataView(r,e,n){var o,i,a;if(d(this,H),d(r,W),i=(o=U(r)).byteLength,(a=y(e))<0||a>i)throw new K("Wrong offset");if(a+(n=n===t?i-a:m(n))>i)throw new K("Wrong length");L(this,{type:C,buffer:r,byteLength:n,byteOffset:a,bytes:o.bytes}),f||(this.buffer=r,this.byteLength=n,this.byteOffset=a)})[N],f&&(addGetter(z,"byteLength",U),addGetter(V,"buffer",_),addGetter(V,"byteLength",_),addGetter(V,"byteOffset",_)),g(H,{getInt8:function getInt8(t){return get(this,1,t)[0]<<24>>24},getUint8:function getUint8(t){return get(this,1,t)[0]},getInt16:function getInt16(t){var r=get(this,2,t,arguments.length>1&&arguments[1]);return(r[1]<<8|r[0])<<16>>16},getUint16:function getUint16(t){var r=get(this,2,t,arguments.length>1&&arguments[1]);return r[1]<<8|r[0]},getInt32:function getInt32(t){return unpackInt32(get(this,4,t,arguments.length>1&&arguments[1]))},getUint32:function getUint32(t){return unpackInt32(get(this,4,t,arguments.length>1&&arguments[1]))>>>0},getFloat32:function getFloat32(t){return X(get(this,4,t,arguments.length>1&&arguments[1]),23)},getFloat64:function getFloat64(t){return X(get(this,8,t,arguments.length>1&&arguments[1]),52)},setInt8:function setInt8(t,r){set(this,1,t,packInt8,r)},setUint8:function setUint8(t,r){set(this,1,t,packInt8,r)},setInt16:function setInt16(t,r){set(this,2,t,packInt16,r,arguments.length>2&&arguments[2])},setUint16:function setUint16(t,r){set(this,2,t,packInt16,r,arguments.length>2&&arguments[2])},setInt32:function setInt32(t,r){set(this,4,t,packInt32,r,arguments.length>2&&arguments[2])},setUint32:function setUint32(t,r){set(this,4,t,packInt32,r,arguments.length>2&&arguments[2])},setFloat32:function setFloat32(t,r){set(this,4,t,packFloat32,r,arguments.length>2&&arguments[2])},setFloat64:function setFloat64(t,r){set(this,8,t,packFloat64,r,arguments.length>2&&arguments[2])}})),M(z,j),M(V,C),r.exports={ArrayBuffer:z,DataView:V}},function(t,r,e){t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},function(t,r,e){var n=e(47);t.exports=function(t,r,e){for(var o in r)n(t,o,r[o],e);return t}},function(t,r,e){var n=e(24),o=TypeError;t.exports=function(t,r){if(n(r,t))return t;throw new o("Incorrect invocation")}},function(r,e,n){var o=n(61),i=n(64),a=RangeError;r.exports=function(r){var e,n;if(r===t)return 0;if((e=o(r))!==(n=i(e)))throw new a("Wrong length or index");return n}},function(t,r,e){var n=e(218);t.exports=Math.fround||function fround(t){return n(t,1.1920928955078125e-7,34028234663852886e22,11754943508222875e-54)}},function(t,r,e){var n=e(219),o=e(220),i=Math.abs;t.exports=function(t,r,e,a){var u,c,f=+t,s=i(f),l=n(f);return se||c!=c?l*Infinity:l*c}},function(t,r,e){t.exports=Math.sign||function sign(t){var r=+t;return 0===r||r!=r?r:r<0?-1:1}},function(t,r,e){var n=4503599627370496;t.exports=function(t){return t+n-n}},function(t,r,e){var n=Array,o=Math.abs,i=Math.pow,a=Math.floor,u=Math.log,c=Math.LN2;t.exports={pack:function(t,r,e){var f,s,l,h=n(e),p=8*e-r-1,g=(1<>1,d=23===r?i(2,-24)-i(2,-77):0,y=t<0||0===t&&1/t<0?1:0,m=0;for((t=o(t))!=t||t===Infinity?(s=t!=t?1:0,f=g):(f=a(u(t)/c),t*(l=i(2,-f))<1&&(f--,l*=2),(t+=f+v>=1?d/l:d*i(2,1-v))*l>=2&&(f++,l/=2),f+v>=g?(s=0,f=g):f+v>=1?(s=(t*l-1)*i(2,r),f+=v):(s=t*i(2,v-1)*i(2,r),f=0));r>=8;)h[m++]=255&s,s/=256,r-=8;for(f=f<0;)h[m++]=255&f,f/=256,p-=8;return h[m-1]|=128*y,h},unpack:function(t,r){var e,n=t.length,o=8*n-r-1,a=(1<>1,c=o-7,f=n-1,s=t[f--],l=127&s;for(s>>=7;c>0;)l=256*l+t[f--],c-=8;for(e=l&(1<<-c)-1,l>>=-c,c+=r;c>0;)e=256*e+t[f--],c-=8;if(0===l)l=1-u;else{if(l===a)return e?NaN:s?-Infinity:Infinity;e+=i(2,r),l-=u}return(s?-1:1)*e*i(2,l-r)}}},function(t,r,e){var n=e(3),o=e(223);n({target:"ArrayBuffer",stat:!0,forced:!o.NATIVE_ARRAY_BUFFER_VIEWS},{isView:o.isView})},function(r,e,n){var o,i,a,u=n(213),c=n(6),f=n(4),s=n(21),l=n(20),h=n(38),p=n(69),g=n(31),v=n(43),d=n(47),y=n(77),m=n(24),b=n(131),w=n(115),x=n(33),S=n(40),E=n(51),A=E.enforce,I=E.get,O=f.Int8Array,R=O&&O.prototype,M=f.Uint8ClampedArray,T=M&&M.prototype,k=O&&b(O),P=R&&b(R),j=Object.prototype,C=f.TypeError,N=x("toStringTag"),D=S("TYPED_ARRAY_TAG"),U="TypedArrayConstructor",_=u&&!!w&&"Opera"!==p(f.opera),L=!1,B={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},z={BigInt64Array:8,BigUint64Array:8},getTypedArrayConstructor=function(t){var r,e=b(t);if(l(e))return(r=I(e))&&h(r,U)?r[U]:getTypedArrayConstructor(e)},isTypedArray=function(t){if(!l(t))return!1;var r=p(t);return h(B,r)||h(z,r)};for(o in B)(a=(i=f[o])&&i.prototype)?A(a)[U]=i:_=!1;for(o in z)(a=(i=f[o])&&i.prototype)&&(A(a)[U]=i);if((!_||!s(k)||k===Function.prototype)&&(k=function TypedArray(){throw new C("Incorrect invocation")},_))for(o in B)f[o]&&w(f[o],k);if((!_||!P||P===j)&&(P=k.prototype,_))for(o in B)f[o]&&w(f[o].prototype,P);if(_&&b(T)!==P&&w(T,P),c&&!h(P,N))for(o in L=!0,y(P,N,{configurable:!0,get:function(){return l(this)?this[D]:t}}),B)f[o]&&v(f[o],D,o);r.exports={NATIVE_ARRAY_BUFFER_VIEWS:_,TYPED_ARRAY_TAG:L&&D,aTypedArray:function(t){if(isTypedArray(t))return t;throw new C("Target is not a typed array")},aTypedArrayConstructor:function(t){if(s(t)&&(!w||m(k,t)))return t;throw new C(g(t)+" is not a typed array constructor")},exportTypedArrayMethod:function(t,r,e,n){var o,i;if(c){if(e)for(o in B)if((i=f[o])&&h(i.prototype,t))try{delete i.prototype[t]}catch(a){try{i.prototype[t]=r}catch(u){}}P[t]&&!e||d(P,t,e?r:_&&R[t]||r,n)}},exportTypedArrayStaticMethod:function(t,r,e){var n,o;if(c){if(w){if(e)for(n in B)if((o=f[n])&&h(o,t))try{delete o[t]}catch(i){}if(k[t]&&!e)return;try{return d(k,t,e?r:_&&k[t]||r)}catch(i){}}for(n in B)!(o=f[n])||o[t]&&!e||d(o,t,r)}},getTypedArrayConstructor:getTypedArrayConstructor,isView:function isView(t){if(!l(t))return!1;var r=p(t);return"DataView"===r||h(B,r)||h(z,r)},isTypedArray:isTypedArray,TypedArray:k,TypedArrayPrototype:P}},function(r,e,n){var o=n(3),i=n(85),a=n(7),u=n(212),c=n(46),f=n(60),s=n(64),l=u.ArrayBuffer,h=u.DataView,p=h.prototype,g=i(l.prototype.slice),v=i(p.getUint8),d=i(p.setUint8);o({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:a(function(){return!new l(2).slice(1,t).byteLength})},{slice:function slice(r,e){var n,o,i,a,u,p,y;if(g&&e===t)return g(c(this),r);for(n=c(this).byteLength,o=f(r,n),i=f(e===t?n:e,n),a=new l(s(i-o)),u=new h(this),p=new h(a),y=0;o1&&arguments[1]),e=r>>>15,o=1023&r,31===(n=r>>>10&31)?0===o?0===e?Infinity:-Infinity:NaN:0===n?o*(0===e?a:-a):i(2,n-15)*(0===e?1+o*u:-1-o*u);var r,e,n,o}})},function(t,r,e){var n=e(3),o=e(14),i=e(229),a=e(216),u=e(230),c=e(220),f=Math.pow,s=1024,l=o(DataView.prototype.setUint16);n({target:"DataView",proto:!0},{setFloat16:function setFloat16(t,r){l(i(this),a(t),function(t){var r,e,n;return t!=t?32256:0===t?(1/t===-Infinity)<<15:((r=t<0)&&(t=-t),t>=65520?r<<15|31744:t<61005353927612305e-21?r<<15|c(16777216*t):-15==(e=0|u(t))?r<<15|s:(n=c((t*f(2,-e)-1)*s))===s?r<<15|e+16<<10:r<<15|e+15<<10|n)}(+r),arguments.length>2&&arguments[2])}})},function(t,r,e){var n=e(69),o=TypeError;t.exports=function(t){if("DataView"===n(t))return t;throw new o("Argument is not a DataView")}},function(t,r,e){var n=Math.log,o=Math.LN2;t.exports=Math.log2||function log2(t){return n(t)/o}},function(t,r,e){var n=e(6),o=e(77),i=e(232),a=ArrayBuffer.prototype;n&&!("detached"in a)&&o(a,"detached",{configurable:!0,get:function detached(){return i(this)}})},function(t,r,e){var n=e(4),o=e(213),i=e(233),a=n.DataView;t.exports=function(t){if(!o||0!==i(t))return!1;try{return new a(t),!1}catch(r){return!0}}},function(t,r,e){var n=e(4),o=e(116),i=e(15),a=n.ArrayBuffer,u=n.TypeError;t.exports=a&&o(a.prototype,"byteLength","get")||function(t){if("ArrayBuffer"!==i(t))throw new u("ArrayBuffer expected");return t.byteLength}},function(r,e,n){var o=n(3),i=n(235);i&&o({target:"ArrayBuffer",proto:!0},{transfer:function transfer(){return i(this,arguments.length?arguments[0]:t,!0)}})},function(r,e,n){var o=n(4),i=n(14),a=n(116),u=n(216),c=n(236),f=n(233),s=n(237),l=n(239),h=o.structuredClone,p=o.ArrayBuffer,g=o.DataView,v=Math.min,d=p.prototype,y=g.prototype,m=i(d.slice),b=a(d,"resizable","get"),w=a(d,"maxByteLength","get"),x=i(y.getInt8),S=i(y.setInt8);r.exports=(l||s)&&function(r,e,n){var o,i,a,d,y,E,A=f(r),I=e===t?A:u(e),O=!b||!b(r);if(c(r),l&&(r=h(r,{transfer:[r]}),A===I&&(n||O)))return r;if(A>=I&&(!n||O))o=m(r,0,I);else for(i=n&&!O&&w?{maxByteLength:w(r)}:t,o=new p(I,i),a=new g(r),d=new g(o),y=v(I,A),E=0;E92||"NODE"===a&&i>94||"BROWSER"===a&&i>97)&&(t=new ArrayBuffer(8),r=u(t,{transfer:[t]}),0!==t.byteLength||8!==r.byteLength)})},function(r,e,n){var o=n(3),i=n(235);i&&o({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function transferToFixedLength(){return i(this,arguments.length?arguments[0]:t,!1)}})},function(t,r,e){var n=e(3),o=e(14),i=e(7)(function(){return 120!==new Date(16e11).getYear()}),a=o(Date.prototype.getFullYear);n({target:"Date",proto:!0,forced:i},{getYear:function getYear(){return a(this)-1900}})},function(t,r,e){var n=e(3),o=e(14),i=Date,a=o(i.prototype.getTime);n({target:"Date",stat:!0},{now:function now(){return a(new i)}})},function(t,r,e){var n=e(3),o=e(14),i=e(61),a=Date.prototype,u=o(a.getTime),c=o(a.setFullYear);n({target:"Date",proto:!0},{setYear:function setYear(t){var r;return u(this),r=i(t),c(this,r>=0&&r<=99?r+1900:r)}})},function(t,r,e){e(3)({target:"Date",proto:!0},{toGMTString:Date.prototype.toUTCString})},function(t,r,e){var n=e(3),o=e(246);n({target:"Date",proto:!0,forced:Date.prototype.toISOString!==o},{toISOString:o})},function(t,r,e){var n=e(14),o=e(7),i=e(247).start,a=RangeError,u=isFinite,c=Math.abs,f=Date.prototype,s=f.toISOString,l=n(f.getTime),h=n(f.getUTCDate),p=n(f.getUTCFullYear),g=n(f.getUTCHours),v=n(f.getUTCMilliseconds),d=n(f.getUTCMinutes),y=n(f.getUTCMonth),m=n(f.getUTCSeconds);t.exports=o(function(){return"0385-07-25T07:06:39.999Z"!==s.call(new Date(-50000000000001))})||!o(function(){s.call(new Date(NaN))})?function toISOString(){var t,r,e,n;if(!u(l(this)))throw new a("Invalid time value");return r=p(t=this),e=v(t),(n=r<0?"-":r>9999?"+":"")+i(c(r),n?6:4,0)+"-"+i(y(t)+1,2,0)+"-"+i(h(t),2,0)+"T"+i(g(t),2,0)+":"+i(d(t),2,0)+":"+i(m(t),2,0)+"."+i(e,3,0)+"Z"}:s},function(r,e,n){var o=n(14),i=n(64),a=n(68),u=n(248),c=n(16),f=o(u),s=o("".slice),l=Math.ceil,createMethod=function(r){return function(e,n,o){var u,h,p=a(c(e)),g=i(n),v=p.length,d=o===t?" ":a(o);return g<=v||""===d?p:((h=f(d,l((u=g-v)/d.length))).length>u&&(h=s(h,0,u)),r?p+h:h+p)}};r.exports={start:createMethod(!1),end:createMethod(!0)}},function(t,r,e){var n=e(61),o=e(68),i=e(16),a=RangeError;t.exports=function repeat(t){var r=o(i(this)),e="",u=n(t);if(u<0||u===Infinity)throw new a("Wrong number of repetitions");for(;u>0;(u>>>=1)&&(r+=r))1&u&&(e+=r);return e}},function(t,r,e){var n=e(3),o=e(7),i=e(39),a=e(19);n({target:"Date",proto:!0,arity:1,forced:o(function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})})},{toJSON:function toJSON(t){var r=i(this),e=a(r,"number");return"number"!=typeof e||isFinite(e)?r.toISOString():null}})},function(t,r,e){var n=e(38),o=e(47),i=e(251),a=e(33)("toPrimitive"),u=Date.prototype;n(u,a)||o(u,a,i)},function(t,r,e){var n=e(46),o=e(32),i=TypeError;t.exports=function(t){if(n(this),"string"===t||"default"===t)t="string";else if("number"!==t)throw new i("Incorrect hint");return o(this,t)}},function(t,r,e){var n=e(14),o=e(47),i=Date.prototype,a="Invalid Date",u="toString",c=n(i[u]),f=n(i.getTime);String(new Date(NaN))!==a&&o(i,u,function toString(){var t=f(this);return t==t?c(this):a})},function(r,e,n){var o=n(3),i=n(6),a=n(23),u=n(30),c=n(215),f=n(47),s=n(214),l=n(77),h=n(33),p=n(51),g=n(254),v=a("SuppressedError"),d=ReferenceError,y=h("dispose"),m=h("toStringTag"),b="DisposableStack",w=p.set,x=p.getterFor(b),S="sync-dispose",E="disposed",getPendingDisposableStackInternalState=function(t){var r=x(t);if(r.state===E)throw new d(b+" already disposed");return r},A=function DisposableStack(){w(c(this,I),{type:b,state:"pending",stack:[]}),i||(this.disposed=!1)},I=A.prototype;s(I,{dispose:function dispose(){var t,r,e,n,o,a=x(this);if(a.state!==E){for(a.state=E,i||(this.disposed=!0),r=(t=a.stack).length,e=!1;r;){o=t[--r],t[r]=null;try{o()}catch(u){e?n=new v(u,n):(e=!0,n=u)}}if(a.stack=null,e)throw n}},use:function use(t){return g(getPendingDisposableStackInternalState(this),t,S),t},adopt:function adopt(r,e){var n=getPendingDisposableStackInternalState(this);return u(e),g(n,t,S,function(){e(r)}),r},defer:function defer(r){var e=getPendingDisposableStackInternalState(this);u(r),g(e,t,S,r)},move:function move(){var t=getPendingDisposableStackInternalState(this),r=new A;return x(r).stack=t.stack,t.stack=[],t.state=E,i||(this.disposed=!0),r}}),i&&l(I,"disposed",{configurable:!0,get:function disposed(){return x(this).state===E}}),f(I,y,I.dispose,{name:"dispose"}),f(I,m,b,{nonWritable:!0}),o({global:!0,constructor:!0},{DisposableStack:A})},function(r,e,n){var o=n(23),i=n(8),a=n(14),u=n(84),c=n(46),f=n(30),s=n(17),l=n(29),h=n(33),p=h("asyncDispose"),g=h("dispose"),v=a([].push),createDisposableResource=function(r,e,n){return arguments.length<3&&!s(r)&&(n=f(function(r,e){if("async-dispose"===e){var n=l(r,p);return n!==t||(n=l(r,g))===t?n:function(){var r=this;return new(o("Promise"))(function(e){i(n,r),e(t)})}}return l(r,g)}(c(r),e))),n===t?function(){return t}:u(n,r)};r.exports=function(r,e,n,o){var i;if(arguments.length<4){if(s(e)&&"sync-dispose"===n)return;i=createDisposableResource(e,n)}else i=createDisposableResource(t,n,o);v(r.stack,i)}},function(t,r,e){var n=e(3),o=e(14),i=e(68),a=o("".charAt),u=o("".charCodeAt),c=o(/./.exec),f=o(1.1.toString),s=o("".toUpperCase),l=/[\w*+\-./@]/,hex=function(t,r){for(var e=f(t,16);e.length=0;i--)if(r[i]!==t)try{n=o(r[i].iterator,e,n)}catch(a){e="throw",n=a}if("throw"===e)throw n;return n}},function(t,r,e){t.exports=function(t,r){var e="function"==typeof Iterator&&Iterator.prototype[t];if(e)try{e.call({next:null},r).next()}catch(n){return!0}}},function(t,r,e){var n=e(4);t.exports=function(t,r){var e=n.Iterator,o=e&&e.prototype,i=o&&o[t],a=!1;if(i)try{i.call({next:function(){return{done:!0}},"return":function(){a=!0}},-1)}catch(u){u instanceof r||(a=!1)}if(!a)return i}},function(t,r,e){var n=e(3),o=e(8),i=e(133),a=e(30),u=e(46),c=e(264),f=e(138),s=e(270)("every",TypeError);n({target:"Iterator",proto:!0,real:!0,forced:s},{every:function every(t){var r,e;u(this);try{a(t)}catch(n){f(this,"throw",n)}return s?o(s,this,t):(r=c(this),e=0,!i(r,function(r,n){if(!t(r,e++))return n()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped)}})},function(t,r,e){var n=e(3),o=e(8),i=e(30),a=e(46),u=e(264),c=e(267),f=e(167),s=e(36),l=e(138),h=e(269),p=e(270),g=!s&&!h("filter",function(){}),v=!s&&!g&&p("filter",TypeError),d=s||g||v,y=c(function(){for(var t,r,e=this.iterator,n=this.predicate,i=this.next;;){if(t=a(o(i,e)),this.done=!!t.done)return;if(f(e,n,[r=t.value,this.counter++],!0))return r}});n({target:"Iterator",proto:!0,real:!0,forced:d},{filter:function filter(t){a(this);try{i(t)}catch(r){l(this,"throw",r)}return v?o(v,this,t):new y(u(this),{predicate:t})}})},function(t,r,e){var n=e(3),o=e(8),i=e(133),a=e(30),u=e(46),c=e(264),f=e(138),s=e(270)("find",TypeError);n({target:"Iterator",proto:!0,real:!0,forced:s},{find:function find(t){var r,e;u(this);try{a(t)}catch(n){f(this,"throw",n)}return s?o(s,this,t):(r=c(this),e=0,i(r,function(r,n){if(t(r,e++))return n(r)},{IS_RECORD:!0,INTERRUPTED:!0}).result)}})},function(t,r,e){var n=e(3),o=e(8),i=e(30),a=e(46),u=e(264),c=e(275),f=e(267),s=e(138),l=e(36),h=e(269),p=e(270),g=!l&&!h("flatMap",function(){}),v=!l&&!g&&p("flatMap",TypeError),d=l||g||v,y=f(function(){for(var t,r,e=this.iterator,n=this.mapper;;){if(r=this.inner)try{if(!(t=a(o(r.next,r.iterator))).done)return t.value;this.inner=null}catch(i){s(e,"throw",i)}if(t=a(o(this.next,e)),this.done=!!t.done)return;try{this.inner=c(n(t.value,this.counter++),!1)}catch(i){s(e,"throw",i)}}});n({target:"Iterator",proto:!0,real:!0,forced:d},{flatMap:function flatMap(t){a(this);try{i(t)}catch(r){s(this,"throw",r)}return v?o(v,this,t):new y(u(this),{mapper:t,inner:null})}})},function(r,e,n){var o=n(8),i=n(46),a=n(264),u=n(137);r.exports=function(r,e){e&&"string"==typeof r||i(r);var n=u(r);return a(i(n!==t?o(n,r):r))}},function(t,r,e){var n=e(3),o=e(8),i=e(133),a=e(30),u=e(46),c=e(264),f=e(138),s=e(270)("forEach",TypeError);n({target:"Iterator",proto:!0,real:!0,forced:s},{forEach:function forEach(t){var r,e;u(this);try{a(t)}catch(n){f(this,"throw",n)}if(s)return o(s,this,t);r=c(this),e=0,i(r,function(r){t(r,e++)},{IS_RECORD:!0})}})},function(t,r,e){var n=e(3),o=e(8),i=e(39),a=e(24),u=e(175).IteratorPrototype,c=e(267),f=e(275),s=e(36)||function(){try{Iterator.from({"return":null})["return"]()}catch(t){return!0}}(),l=c(function(){return o(this.next,this.iterator)},!0);n({target:"Iterator",stat:!0,forced:s},{from:function from(t){var r=f("string"==typeof t?i(t):t,!0);return a(u,r.iterator)?r.iterator:new l(r)}})},function(t,r,e){var n=e(3),o=e(8),i=e(30),a=e(46),u=e(264),c=e(267),f=e(167),s=e(138),l=e(269),h=e(270),p=e(36),g=!p&&!l("map",function(){}),v=!p&&!g&&h("map",TypeError),d=p||g||v,y=c(function(){var t=this.iterator,r=a(o(this.next,t));if(!(this.done=!!r.done))return f(t,this.mapper,[r.value,this.counter++],!0)});n({target:"Iterator",proto:!0,real:!0,forced:d},{map:function map(t){a(this);try{i(t)}catch(r){s(this,"throw",r)}return v?o(v,this,t):new y(u(this),{mapper:t})}})},function(r,e,n){var o=n(3),i=n(133),a=n(30),u=n(46),c=n(264),f=n(138),s=n(270),l=n(94),h=n(7),p=TypeError,g=h(function(){[].keys().reduce(function(){},t)}),v=!g&&s("reduce",p);o({target:"Iterator",proto:!0,real:!0,forced:g||v},{reduce:function reduce(r){var e,n,o,s;u(this);try{a(r)}catch(h){f(this,"throw",h)}if(n=(e=arguments.length<2)?t:arguments[1],v)return l(v,this,e?[r]:[r,n]);if(o=c(this),s=0,i(o,function(t){e?(e=!1,n=t):n=r(n,t,s),s++},{IS_RECORD:!0}),e)throw new p("Reduce of empty iterator with no initial value");return n}})},function(t,r,e){var n=e(3),o=e(8),i=e(133),a=e(30),u=e(46),c=e(264),f=e(138),s=e(270)("some",TypeError);n({target:"Iterator",proto:!0,real:!0,forced:s},{some:function some(t){var r,e;u(this);try{a(t)}catch(n){f(this,"throw",n)}return s?o(s,this,t):(r=c(this),e=0,i(r,function(r,n){if(t(r,e++))return n()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped)}})},function(r,e,n){var o=n(3),i=n(8),a=n(46),u=n(264),c=n(265),f=n(266),s=n(267),l=n(138),h=n(270),p=n(36),g=!p&&h("take",RangeError),v=s(function(){var r,e=this.iterator;return this.remaining--?(r=a(i(this.next,e)),(this.done=!!r.done)?t:r.value):(this.done=!0,l(e,"normal",t))});o({target:"Iterator",proto:!0,real:!0,forced:p||g},{take:function take(t){var r;a(this);try{r=f(c(+t))}catch(e){l(this,"throw",e)}return g?i(g,this,r):new v(u(this),{remaining:r})}})},function(t,r,e){var n=e(3),o=e(46),i=e(133),a=e(264),u=[].push;n({target:"Iterator",proto:!0,real:!0},{toArray:function toArray(){var t=[];return i(a(o(this)),u,{that:t,IS_RECORD:!0}),t}})},function(t,r,e){var n=e(4);e(82)(n.JSON,"JSON",!0)},function(t,r,e){e(285)},function(r,e,n){n(286)("Map",function(r){return function Map(){return r(this,arguments.length?arguments[0]:t)}},n(291))},function(r,e,n){var o=n(3),i=n(4),a=n(14),u=n(67),c=n(47),f=n(287),s=n(133),l=n(215),h=n(21),p=n(17),g=n(20),v=n(7),d=n(168),y=n(82),m=n(120);r.exports=function(r,e,n){var b,w,x,S,E,A=-1!==r.indexOf("Map"),I=-1!==r.indexOf("Weak"),O=A?"set":"add",R=i[r],M=R&&R.prototype,T=R,k={},fixMethod=function(r){var e=a(M[r]);c(M,r,"add"===r?function add(t){return e(this,0===t?0:t),this}:"delete"===r?function(t){return!(I&&!g(t))&&e(this,0===t?0:t)}:"get"===r?function get(r){return I&&!g(r)?t:e(this,0===r?0:r)}:"has"===r?function has(t){return!(I&&!g(t))&&e(this,0===t?0:t)}:function set(t,r){return e(this,0===t?0:t,r),this})};return u(r,!h(R)||!(I||M.forEach&&!v(function(){(new R).entries().next()})))?(T=n.getConstructor(e,r,A,O),f.enable()):u(r,!0)&&(w=(b=new T)[O](I?{}:-0,1)!==b,x=v(function(){b.has(1)}),S=d(function(t){new R(t)}),E=!I&&v(function(){for(var t=new R,r=5;r--;)t[O](r,r);return!t.has(-0)}),S||((T=e(function(t,r){l(t,M);var e=m(new R,t,T);return p(r)||s(r,e[O],{that:e,AS_ENTRIES:A}),e})).prototype=M,M.constructor=T),(x||E)&&(fixMethod("delete"),fixMethod("has"),A&&fixMethod("get")),(E||w)&&fixMethod(O),I&&M.clear&&delete M.clear),k[r]=T,o({global:!0,constructor:!0,forced:T!==R},k),y(T,r),I||n.setStrong(T,r,A),T}},function(t,r,e){var n=e(3),o=e(14),i=e(54),a=e(20),u=e(38),c=e(44).f,f=e(57),s=e(75),l=e(288),h=e(40),p=e(290),g=!1,v=h("meta"),d=0,setMetadata=function(t){c(t,v,{value:{objectID:"O"+d++,weakData:{}}})},y=t.exports={enable:function(){var t,r,e;y.enable=function(){},g=!0,t=f.f,r=o([].splice),(e={})[v]=1,t(e).length&&(f.f=function(e){var n,o,i=t(e);for(n=0,o=i.length;n1?arguments[1]:t);e=e?e.next:n.first;)for(o(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function has(t){return!!getEntry(this,t)}}),a(p,n?{get:function get(t){var r=getEntry(this,t);return r&&r.value},set:function set(t,r){return define(this,0===t?0:t,r)}}:{add:function add(t){return define(this,t=0===t?0:t,t)}}),g&&i(p,"size",{configurable:!0,get:function(){return d(this).size}}),h},setStrong:function(r,e,n){var o=e+" Iterator",i=m(e),a=m(o);l(r,e,function(t,r){y(this,{type:o,target:t,state:i(t),kind:r,last:null})},function(){for(var r=a(this),e=r.kind,n=r.last;n&&n.removed;)n=n.previous;return r.target&&(r.last=n=n?n.next:r.state.first)?h("keys"===e?n.key:"values"===e?n.value:[n.key,n.value],!1):(r.target=null,h(t,!0))},n?"entries":"values",!n,!0),p(e)}}},function(t,r,e){var n=e(3),o=e(14),i=e(30),a=e(16),u=e(133),c=e(293),f=e(36),s=e(7),l=c.Map,h=c.has,p=c.get,g=c.set,v=o([].push),d=f||s(function(){return 1!==l.groupBy("ab",function(t){return t}).get("a").length});n({target:"Map",stat:!0,forced:f||d},{groupBy:function groupBy(t,r){var e,n;return a(t),i(r),e=new l,n=0,u(t,function(t){var o=r(t,n++);h(e,o)?v(p(e,o),t):g(e,o,[t])}),e}})},function(t,r,e){var n=e(14),o=Map.prototype;t.exports={Map:Map,set:n(o.set),get:n(o.get),has:n(o.has),remove:n(o["delete"]),proto:o}},function(t,r,e){var n=e(3),o=e(295),i=Math.acosh,a=Math.log,u=Math.sqrt,c=Math.LN2;n({target:"Math",stat:!0,forced:!i||710!==Math.floor(i(Number.MAX_VALUE))||i(Infinity)!==Infinity},{acosh:function acosh(t){var r=+t;return r<1?NaN:r>94906265.62425156?a(r)+c:o(r-1+u(r-1)*u(r+1))}})},function(t,r,e){var n=Math.log;t.exports=Math.log1p||function log1p(t){var r=+t;return r>-1e-8&&r<1e-8?r-r*r/2:n(1+r)}},function(t,r,e){var n=e(3),o=Math.asinh,i=Math.log,a=Math.sqrt;n({target:"Math",stat:!0,forced:!(o&&1/o(0)>0)},{asinh:function asinh(t){var r=+t;return isFinite(r)&&0!==r?r<0?-asinh(-r):i(r+a(r*r+1)):r}})},function(t,r,e){var n=e(3),o=Math.atanh,i=Math.log;n({target:"Math",stat:!0,forced:!(o&&1/o(-0)<0)},{atanh:function atanh(t){var r=+t;return 0===r?r:i((1+r)/(1-r))/2}})},function(t,r,e){var n=e(3),o=e(219),i=Math.abs,a=Math.pow;n({target:"Math",stat:!0},{cbrt:function cbrt(t){var r=+t;return o(r)*a(i(r),1/3)}})},function(t,r,e){var n=e(3),o=Math.floor,i=Math.log,a=Math.LOG2E;n({target:"Math",stat:!0},{clz32:function clz32(t){var r=t>>>0;return r?31-o(i(r+.5)*a):32}})},function(t,r,e){var n=e(3),o=e(301),i=Math.cosh,a=Math.abs,u=Math.E;n({target:"Math",stat:!0,forced:!i||i(710)===Infinity},{cosh:function cosh(t){var r=o(a(t)-1)+1;return(r+1/(r*u*u))*(u/2)}})},function(t,r,e){var n=Math.expm1,o=Math.exp;t.exports=!n||n(10)>22025.465794806718||n(10)<22025.465794806718||-2e-17!==n(-2e-17)?function expm1(t){var r=+t;return 0===r?r:r>-1e-6&&r<1e-6?r+r*r/2:o(r)-1}:n},function(t,r,e){var n=e(3),o=e(301);n({target:"Math",stat:!0,forced:o!==Math.expm1},{expm1:o})},function(t,r,e){e(3)({target:"Math",stat:!0},{fround:e(217)})},function(t,r,e){var n=e(3),o=e(218);n({target:"Math",stat:!0},{f16round:function f16round(t){return o(t,.0009765625,65504,6103515625e-14)}})},function(t,r,e){var n=e(3),o=Math.hypot,i=Math.abs,a=Math.sqrt;n({target:"Math",stat:!0,arity:2,forced:!!o&&o(Infinity,NaN)!==Infinity},{hypot:function hypot(t,r){for(var e,n,o=0,u=0,c=arguments.length,f=0;u0?(n=e/f)*n:e;return f===Infinity?Infinity:f*a(o)}})},function(t,r,e){var n=e(3),o=e(7),i=Math.imul;n({target:"Math",stat:!0,forced:o(function(){return-5!==i(4294967295,5)||2!==i.length})},{imul:function imul(t,r){var e=65535,n=+t,o=+r,i=e&n,a=e&o;return 0|i*a+((e&n>>>16)*a+i*(e&o>>>16)<<16>>>0)}})},function(t,r,e){e(3)({target:"Math",stat:!0},{log10:e(308)})},function(t,r,e){var n=Math.log,o=Math.LOG10E;t.exports=Math.log10||function log10(t){return n(t)*o}},function(t,r,e){e(3)({target:"Math",stat:!0},{log1p:e(295)})},function(t,r,e){e(3)({target:"Math",stat:!0},{log2:e(230)})},function(t,r,e){e(3)({target:"Math",stat:!0},{sign:e(219)})},function(t,r,e){var n=e(3),o=e(7),i=e(301),a=Math.abs,u=Math.exp,c=Math.E;n({target:"Math",stat:!0,forced:o(function(){return-2e-17!==Math.sinh(-2e-17)})},{sinh:function sinh(t){var r=+t;return a(r)<1?(i(r)-i(-r))/2:(u(r-1)-u(-r-1))*(c/2)}})},function(t,r,e){var n=e(3),o=e(14),i=e(133),a=RangeError,u=TypeError,c=Infinity,f=NaN,s=Math.abs,l=Math.pow,h=o([].push),p=l(2,1023),g=l(2,53)-1,v=Number.MAX_VALUE,d=l(2,971),y={},m={},b={},w={},x={},twosum=function(t,r){var e=t+r;return{hi:e,lo:r-(e-t)}};n({target:"Math",stat:!0},{sumPrecise:function sumPrecise(t){var r,e,n,o,l,S,E,A,I,O,R,M,T,k,P=[],j=0,C=w;switch(i(t,function(t){if(++j>=g)throw new a("Maximum allowed index exceeded");if("number"!=typeof t)throw new u("Value is not a number");C!==y&&(t!=t?C=y:t===c?C=C===m?y:b:t===-c?C=C===b?y:m:0===t&&1/t!==c||C!==w&&C!==x||(C=x,h(P,t)))}),C){case y:return f;case m:return-c;case b:return c;case w:return-0}for(r=[],e=0,I=0;I=0?r[T]:0,T--,s(e)>1||e>0&&k>0||e<0&&k<0)return e>0?c:-c;if(E=(l=twosum(e*p,k/2)).lo,E*=2,s(2*(S=l.hi))===c)return S>0?S===p&&E===-d/2&&T>=0&&r[T]<0?v:c:S===-p&&E===d/2&&T>=0&&r[T]>0?-v:-c;0!==E&&(r[++T]=E,E=0),S*=2}for(;T>=0&&(S=(l=twosum(S,r[T--])).hi,0===(E=l.lo)););return T>=0&&(E<0&&r[T]<0||E>0&&r[T]>0)&&(o=2*E)===(n=S+o)-S&&(S=n),S}})},function(t,r,e){var n=e(3),o=e(301),i=Math.exp;n({target:"Math",stat:!0},{tanh:function tanh(t){var r=+t,e=o(r),n=o(-r);return e===Infinity?1:n===Infinity?-1:(e-n)/(i(r)+i(-r))}})},function(t,r,e){e(82)(Math,"Math",!0)},function(t,r,e){e(3)({target:"Math",stat:!0},{trunc:e(62)})},function(t,r,e){var n,o=e(3),i=e(36),a=e(6),u=e(4),c=e(80),f=e(14),s=e(67),l=e(38),h=e(120),p=e(24),g=e(22),v=e(19),d=e(7),y=e(57).f,m=e(5).f,b=e(44).f,w=e(318),x=e(319).trim,S="Number",E=u[S],A=c[S],I=E.prototype,O=u.TypeError,R=f("".slice),M=f("".charCodeAt),toNumber=function(t){var r,e,n,o,i,a,u,c,f=v(t,"number");if(g(f))throw new O("Cannot convert a Symbol value to a number");if("string"==typeof f&&f.length>2)if(f=x(f),43===(r=M(f,0))||45===r){if(88===(e=M(f,2))||120===e)return NaN}else if(48===r){switch(M(f,1)){case 66:case 98:n=2,o=49;break;case 79:case 111:n=8,o=55;break;default:return+f}for(a=(i=R(f,2)).length,u=0;uo)return NaN;return parseInt(i,n)}return+f},T=s(S,!E(" 0o1")||!E("0b1")||E("+0x1")),k=function Number(t){var r,e=arguments.length<1?0:E(function(t){var r=v(t,"number");return"bigint"==typeof r?r:toNumber(r)}(t));return p(I,r=this)&&d(function(){w(r)})?h(Object(e),this,k):e};k.prototype=I,T&&!i&&(I.constructor=k),o({global:!0,constructor:!0,wrap:!0,forced:T},{Number:k}),n=function(t,r){for(var e,n=a?y(r):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),o=0;n.length>o;o++)l(r,e=n[o])&&!l(t,e)&&b(t,e,m(r,e))},i&&A&&n(c[S],A),(T||i)&&n(c[S],E)},function(t,r,e){var n=e(14);t.exports=n(1.1.valueOf)},function(t,r,e){var n=e(14),o=e(16),i=e(68),a=e(320),u=n("".replace),c=RegExp("^["+a+"]+"),f=RegExp("(^|[^"+a+"])["+a+"]+$"),createMethod=function(t){return function(r){var e=i(o(r));return 1&t&&(e=u(e,c,"")),2&t&&(e=u(e,f,"$1")),e}};t.exports={start:createMethod(1),end:createMethod(2),trim:createMethod(3)}},function(t,r,e){t.exports="\t\n\x0B\f\r                 \u2028\u2029\ufeff"},function(t,r,e){e(3)({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{EPSILON:Math.pow(2,-52)})},function(t,r,e){e(3)({target:"Number",stat:!0},{isFinite:e(323)})},function(t,r,e){var n=e(4).isFinite;t.exports=Number.isFinite||function isFinite(t){return"number"==typeof t&&n(t)}},function(t,r,e){e(3)({target:"Number",stat:!0},{isInteger:e(325)})},function(t,r,e){var n=e(20),o=Math.floor;t.exports=Number.isInteger||function isInteger(t){return!n(t)&&isFinite(t)&&o(t)===t}},function(t,r,e){e(3)({target:"Number",stat:!0},{isNaN:function isNaN(t){return t!=t}})},function(t,r,e){var n=e(3),o=e(325),i=Math.abs;n({target:"Number",stat:!0},{isSafeInteger:function isSafeInteger(t){return o(t)&&i(t)<=9007199254740991}})},function(t,r,e){e(3)({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MAX_SAFE_INTEGER:9007199254740991})},function(t,r,e){e(3)({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MIN_SAFE_INTEGER:-9007199254740991})},function(t,r,e){var n=e(3),o=e(331);n({target:"Number",stat:!0,forced:Number.parseFloat!==o},{parseFloat:o})},function(t,r,e){var n=e(4),o=e(7),i=e(14),a=e(68),u=e(319).trim,c=e(320),f=i("".charAt),s=n.parseFloat,l=n.Symbol,h=l&&l.iterator,p=1/s(c+"-0")!==-Infinity||h&&!o(function(){s(Object(h))});t.exports=p?function parseFloat(t){var r=u(a(t)),e=s(r);return 0===e&&"-"===f(r,0)?-0:e}:s},function(t,r,e){var n=e(3),o=e(333);n({target:"Number",stat:!0,forced:Number.parseInt!==o},{parseInt:o})},function(t,r,e){var n=e(4),o=e(7),i=e(14),a=e(68),u=e(319).trim,c=e(320),f=n.parseInt,s=n.Symbol,l=s&&s.iterator,h=/^[+-]?0x/i,p=i(h.exec),g=8!==f(c+"08")||22!==f(c+"0x16")||l&&!o(function(){f(Object(l))});t.exports=g?function parseInt(t,r){var e=u(a(t));return f(e,r>>>0||(p(h,e)?16:10))}:f},function(r,e,n){var o=n(3),i=n(14),a=n(61),u=n(318),c=n(248),f=n(308),s=n(7),l=RangeError,h=String,p=isFinite,g=Math.abs,v=Math.floor,d=Math.pow,y=Math.round,m=i(1.1.toExponential),b=i(c),w=i("".slice),x="-6.9000e-11"===m(-69e-12,4)&&"1.25e+0"===m(1.255,2)&&"1.235e+4"===m(12345,3)&&"3e+1"===m(25,0);o({target:"Number",proto:!0,forced:!x||!(s(function(){m(1,Infinity)})&&s(function(){m(1,-Infinity)}))||!!s(function(){m(Infinity,Infinity),m(NaN,Infinity)})},{toExponential:function toExponential(r){var e,n,o,i,c,s,S,E,A,I=u(this);if(r===t)return m(I);if(e=a(r),!p(I))return String(I);if(e<0||e>20)throw new l("Incorrect fraction digits");return x?m(I,e):(n="",I<0&&(n="-",I=-I),0===I?(i=0,o=b("0",e+1)):(S=f(I),i=v(S),E=d(10,i-e),2*I>=(2*(A=y(I/E))+1)*E&&(A+=1),A>=d(10,e+1)&&(A/=10,i+=1),o=h(A)),0!==e&&(o=w(o,0,1)+"."+w(o,1)),0===i?(c="+",s="0"):(c=i>0?"+":"-",s=h(g(i))),n+(o+="e"+c+s))}})},function(t,r,e){var n=e(3),o=e(14),i=e(61),a=e(318),u=e(248),c=e(7),f=RangeError,s=String,l=Math.floor,h=o(u),p=o("".slice),g=o(1.1.toFixed),pow=function(t,r,e){return 0===r?e:r%2==1?pow(t,r-1,e*t):pow(t*t,r/2,e)},multiply=function(t,r,e){for(var n=-1,o=e;++n<6;)t[n]=(o+=r*t[n])%1e7,o=l(o/1e7)},divide=function(t,r){for(var e=6,n=0;--e>=0;)t[e]=l((n+=t[e])/r),n=n%r*1e7},dataToString=function(t){for(var r,e=6,n="";--e>=0;)""===n&&0!==e&&0===t[e]||(r=s(t[e]),n=""===n?r:n+h("0",7-r.length)+r);return n};n({target:"Number",proto:!0,forced:c(function(){return"0.000"!==g(8e-5,3)||"1"!==g(.9,0)||"1.25"!==g(1.255,2)||"1000000000000000128"!==g(0xde0b6b3a7640080,0)})||!c(function(){g({})})},{toFixed:function toFixed(t){var r,e,n,o,u=a(this),c=i(t),l=[0,0,0,0,0,0],g="",v="0";if(c<0||c>20)throw new f("Incorrect fraction digits");if(u!=u)return"NaN";if(u<=-1e21||u>=1e21)return s(u);if(u<0&&(g="-",u=-u),u>1e-21)if(e=(r=function(t){for(var r=0,e=t;e>=4096;)r+=12,e/=4096;for(;e>=2;)r+=1,e/=2;return r}(u*pow(2,69,1))-69)<0?u*pow(2,-r,1):u/pow(2,r,1),e*=4503599627370496,(r=52-r)>0){for(multiply(l,0,e),n=c;n>=7;)multiply(l,1e7,0),n-=7;for(multiply(l,pow(10,n,1),0),n=r-1;n>=23;)divide(l,1<<23),n-=23;divide(l,1<0?g+((o=v.length)<=c?"0."+h("0",c-o)+v:p(v,0,o-c)+"."+p(v,o-c)):g+v}})},function(r,e,n){var o=n(3),i=n(14),a=n(7),u=n(318),c=i(1.1.toPrecision);o({target:"Number",proto:!0,forced:a(function(){return"1"!==c(1,t)})||!a(function(){c({})})},{toPrecision:function toPrecision(r){return r===t?c(u(this)):c(u(this),r)}})},function(t,r,e){var n=e(3),o=e(338);n({target:"Object",stat:!0,arity:2,forced:Object.assign!==o},{assign:o})},function(t,r,e){var n=e(6),o=e(14),i=e(8),a=e(7),u=e(73),c=e(66),f=e(10),s=e(39),l=e(13),h=Object.assign,p=Object.defineProperty,g=o([].concat);t.exports=!h||a(function(){var t,r,e,o;return!(!n||1===h({b:1},h(p({},"a",{enumerable:!0,get:function(){p(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)||(r={},o="abcdefghijklmnopqrst", +(t={})[e=Symbol("assign detection")]=7,o.split("").forEach(function(t){r[t]=t}),7!==h({},t)[e]||u(h({},r)).join("")!==o)})?function assign(t,r){for(var e,o,a,h,p,v=s(t),d=arguments.length,y=1,m=c.f,b=f.f;d>y;)for(e=l(arguments[y++]),a=(o=m?g(u(e),m(e)):u(e)).length,h=0;a>h;)p=o[h++],n&&!i(b,e,p)||(v[p]=e[p]);return v}:h},function(t,r,e){e(3)({target:"Object",stat:!0,sham:!e(6)},{create:e(71)})},function(t,r,e){var n=e(3),o=e(6),i=e(341),a=e(30),u=e(39),c=e(44);o&&n({target:"Object",proto:!0,forced:i},{__defineGetter__:function __defineGetter__(t,r){c.f(u(this),t,{get:a(r),enumerable:!0,configurable:!0})}})},function(t,r,e){var n=e(36),o=e(4),i=e(7),a=e(196);t.exports=n||!i(function(){if(!(a&&a<535)){var t=Math.random();__defineSetter__.call(null,t,function(){}),delete o[t]}})},function(t,r,e){var n=e(3),o=e(6),i=e(72).f;n({target:"Object",stat:!0,forced:Object.defineProperties!==i,sham:!o},{defineProperties:i})},function(t,r,e){var n=e(3),o=e(6),i=e(44).f;n({target:"Object",stat:!0,forced:Object.defineProperty!==i,sham:!o},{defineProperty:i})},function(t,r,e){var n=e(3),o=e(6),i=e(341),a=e(30),u=e(39),c=e(44);o&&n({target:"Object",proto:!0,forced:i},{__defineSetter__:function __defineSetter__(t,r){c.f(u(this),t,{set:a(r),enumerable:!0,configurable:!0})}})},function(t,r,e){var n=e(3),o=e(346).entries;n({target:"Object",stat:!0},{entries:function entries(t){return o(t)}})},function(t,r,e){var n=e(6),o=e(7),i=e(14),a=e(131),u=e(73),c=e(12),f=i(e(10).f),s=i([].push),l=n&&o(function(){var t=Object.create(null);return t[2]=2,!f(t,2)}),createMethod=function(t){return function(r){for(var e,o=c(r),i=u(o),h=l&&null===a(o),p=i.length,g=0,v=[];p>g;)e=i[g++],n&&!(h?e in o:f(o,e))||s(v,t?[e,o[e]]:o[e]);return v}};t.exports={entries:createMethod(!0),values:createMethod(!1)}},function(t,r,e){var n=e(3),o=e(290),i=e(7),a=e(20),u=e(287).onFreeze,c=Object.freeze;n({target:"Object",stat:!0,forced:i(function(){c(1)}),sham:!o},{freeze:function freeze(t){return c&&a(t)?c(u(t)):t}})},function(t,r,e){var n=e(3),o=e(133),i=e(145);n({target:"Object",stat:!0},{fromEntries:function fromEntries(t){var r={};return o(t,function(t,e){i(r,t,e)},{AS_ENTRIES:!0}),r}})},function(t,r,e){var n=e(3),o=e(7),i=e(12),a=e(5).f,u=e(6);n({target:"Object",stat:!0,forced:!u||o(function(){a(1)}),sham:!u},{getOwnPropertyDescriptor:function getOwnPropertyDescriptor(t,r){return a(i(t),r)}})},function(r,e,n){var o=n(3),i=n(6),a=n(56),u=n(12),c=n(5),f=n(145);o({target:"Object",stat:!0,sham:!i},{getOwnPropertyDescriptors:function getOwnPropertyDescriptors(r){for(var e,n,o=u(r),i=c.f,s=a(o),l={},h=0;s.length>h;)(n=i(o,e=s[h++]))!==t&&f(l,e,n);return l}})},function(t,r,e){var n=e(3),o=e(7),i=e(75).f;n({target:"Object",stat:!0,forced:o(function(){return!Object.getOwnPropertyNames(1)})},{getOwnPropertyNames:i})},function(t,r,e){var n=e(3),o=e(7),i=e(39),a=e(131),u=e(132);n({target:"Object",stat:!0,forced:o(function(){a(1)}),sham:!u},{getPrototypeOf:function getPrototypeOf(t){return a(i(t))}})},function(t,r,e){var n=e(3),o=e(145),i=e(23),a=e(14),u=e(30),c=e(16),f=e(18),s=e(133),l=e(7),h=Object.groupBy,p=i("Object","create"),g=a([].push);n({target:"Object",stat:!0,forced:!h||l(function(){return 1!==h("ab",function(t){return t}).a.length})},{groupBy:function groupBy(t,r){var e,n;return c(t),u(r),e=p(null),n=0,s(t,function(t){var i=f(r(t,n++));i in e?g(e[i],t):o(e,i,[t])}),e}})},function(t,r,e){e(3)({target:"Object",stat:!0},{hasOwn:e(38)})},function(t,r,e){e(3)({target:"Object",stat:!0},{is:e(356)})},function(t,r,e){t.exports=Object.is||function is(t,r){return t===r?0!==t||1/t==1/r:t!=t&&r!=r}},function(t,r,e){var n=e(3),o=e(288);n({target:"Object",stat:!0,forced:Object.isExtensible!==o},{isExtensible:o})},function(t,r,e){var n=e(3),o=e(7),i=e(20),a=e(15),u=e(289),c=Object.isFrozen;n({target:"Object",stat:!0,forced:u||o(function(){c(1)})},{isFrozen:function isFrozen(t){return!i(t)||!(!u||"ArrayBuffer"!==a(t))||!!c&&c(t)}})},function(t,r,e){var n=e(3),o=e(7),i=e(20),a=e(15),u=e(289),c=Object.isSealed;n({target:"Object",stat:!0,forced:u||o(function(){c(1)})},{isSealed:function isSealed(t){return!i(t)||!(!u||"ArrayBuffer"!==a(t))||!!c&&c(t)}})},function(t,r,e){var n=e(3),o=e(39),i=e(73);n({target:"Object",stat:!0,forced:e(7)(function(){i(1)})},{keys:function keys(t){return i(o(t))}})},function(t,r,e){var n=e(3),o=e(6),i=e(341),a=e(39),u=e(18),c=e(131),f=e(5).f;o&&n({target:"Object",proto:!0,forced:i},{__lookupGetter__:function __lookupGetter__(t){var r,e=a(this),n=u(t);do{if(r=f(e,n))return r.get}while(e=c(e))}})},function(t,r,e){var n=e(3),o=e(6),i=e(341),a=e(39),u=e(18),c=e(131),f=e(5).f;o&&n({target:"Object",proto:!0,forced:i},{__lookupSetter__:function __lookupSetter__(t){var r,e=a(this),n=u(t);do{if(r=f(e,n))return r.set}while(e=c(e))}})},function(t,r,e){var n=e(3),o=e(20),i=e(287).onFreeze,a=e(290),u=e(7),c=Object.preventExtensions;n({target:"Object",stat:!0,forced:u(function(){c(1)}),sham:!a},{preventExtensions:function preventExtensions(t){return c&&o(t)?c(i(t)):t}})},function(t,r,e){var n=e(6),o=e(77),i=e(20),a=e(118),u=e(39),c=e(16),f=Object.getPrototypeOf,s=Object.setPrototypeOf,l=Object.prototype,h="__proto__";if(n&&f&&s&&!(h in l))try{o(l,h,{configurable:!0,get:function __proto__(){return f(u(this))},set:function __proto__(t){var r=c(this);a(t)&&i(r)&&s(r,t)}})}catch(p){}},function(t,r,e){var n=e(3),o=e(20),i=e(287).onFreeze,a=e(290),u=e(7),c=Object.seal;n({target:"Object",stat:!0,forced:u(function(){c(1)}),sham:!a},{seal:function seal(t){return c&&o(t)?c(i(t)):t}})},function(t,r,e){e(3)({target:"Object",stat:!0},{setPrototypeOf:e(115)})},function(t,r,e){var n=e(70),o=e(47),i=e(368);n||o(Object.prototype,"toString",i,{unsafe:!0})},function(t,r,e){var n=e(70),o=e(69);t.exports=n?{}.toString:function toString(){return"[object "+o(this)+"]"}},function(t,r,e){var n=e(3),o=e(346).values;n({target:"Object",stat:!0},{values:function values(t){return o(t)}})},function(t,r,e){var n=e(3),o=e(331);n({global:!0,forced:parseFloat!==o},{parseFloat:o})},function(t,r,e){var n=e(3),o=e(333);n({global:!0,forced:parseInt!==o},{parseInt:o})},function(t,r,e){e(373),e(389),e(391),e(392),e(393),e(394)},function(r,e,n){var o,i,a,u,c=n(3),f=n(36),s=n(186),l=n(4),h=n(80),p=n(8),g=n(47),v=n(115),d=n(82),y=n(198),m=n(30),b=n(21),w=n(20),x=n(215),S=n(374),E=n(376).set,A=n(379),I=n(384),O=n(385),R=n(381),M=n(51),T=n(386),k=n(387),P=n(388),j="Promise",C=k.CONSTRUCTOR,N=k.REJECTION_EVENT,D=k.SUBCLASSING,U=M.getterFor(j),_=M.set,L=T&&T.prototype,B=T,z=L,W=l.TypeError,V=l.document,H=l.process,q=P.f,G=q,K=!!(V&&V.createEvent&&l.dispatchEvent),Y="unhandledrejection",isThenable=function(t){var r;return!(!w(t)||!b(r=t.then))&&r},callReaction=function(t,r){var e,n,o,i=r.value,a=1===r.state,u=a?t.ok:t.fail,c=t.resolve,f=t.reject,s=t.domain;try{u?(a||(2===r.rejection&&onHandleUnhandled(r),r.rejection=1),!0===u?e=i:(s&&s.enter(),e=u(i),s&&(s.exit(),o=!0)),e===t.promise?f(new W("Promise-chain cycle")):(n=isThenable(e))?p(n,e,c,f):c(e)):f(i)}catch(l){s&&!o&&s.exit(),f(l)}},notify=function(t,r){t.notified||(t.notified=!0,A(function(){for(var e,n=t.reactions;e=n.get();)callReaction(e,t);t.notified=!1,r&&!t.rejection&&onUnhandled(t)}))},dispatchEvent=function(t,r,e){var n,o;K?((n=V.createEvent("Event")).promise=r,n.reason=e,n.initEvent(t,!1,!0),l.dispatchEvent(n)):n={promise:r,reason:e},!N&&(o=l["on"+t])?o(n):t===Y&&I("Unhandled promise rejection",e)},onUnhandled=function(t){p(E,l,function(){var r,e=t.facade,n=t.value;if(isUnhandled(t)&&(r=O(function(){s?H.emit("unhandledRejection",n,e):dispatchEvent(Y,e,n)}),t.rejection=s||isUnhandled(t)?2:1,r.error))throw r.value})},isUnhandled=function(t){return 1!==t.rejection&&!t.parent},onHandleUnhandled=function(t){p(E,l,function(){var r=t.facade;s?H.emit("rejectionHandled",r):dispatchEvent("rejectionhandled",r,t.value)})},bind=function(t,r,e){return function(n){t(r,n,e)}},internalReject=function(t,r,e){t.done||(t.done=!0,e&&(t=e),t.value=r,t.state=2,notify(t,!0))},internalResolve=function(t,r,e){if(!t.done){t.done=!0,e&&(t=e);try{if(t.facade===r)throw new W("Promise can't be resolved itself");var n=isThenable(r);n?A(function(){var e={done:!1};try{p(n,r,bind(internalResolve,e,t),bind(internalReject,e,t))}catch(o){internalReject(e,o,t)}}):(t.value=r,t.state=1,notify(t,!1))}catch(o){internalReject({done:!1},o,t)}}};if(C&&(B=function Promise(t){x(this,z),m(t),p(o,this);var r=U(this);try{t(bind(internalResolve,r),bind(internalReject,r))}catch(e){internalReject(r,e)}},(o=function Promise(t){_(this,{type:j,done:!1,notified:!1,parent:!1,reactions:new R,rejection:!1,state:0,value:null})}).prototype=g(z=B.prototype,"then",function then(r,e){var n=U(this),o=q(S(this,B));return n.parent=!0,o.ok=!b(r)||r,o.fail=b(e)&&e,o.domain=s?H.domain:t,0===n.state?n.reactions.add(o):A(function(){callReaction(o,n)}),o.promise}),i=function(){var t=new o,r=U(t);this.promise=t,this.resolve=bind(internalResolve,r),this.reject=bind(internalReject,r)},P.f=q=function(t){return t===B||t===a?new i(t):G(t)},!f&&b(T)&&L!==Object.prototype)){u=L.then,D||g(L,"then",function then(t,r){var e=this;return new B(function(t,r){p(u,e,t,r)}).then(t,r)},{unsafe:!0});try{delete L.constructor}catch($){}v&&v(L,z)}c({global:!0,constructor:!0,wrap:!0,forced:C},{Promise:B}),a=h.Promise,d(B,j,!1,!0),y(j)},function(r,e,n){var o=n(46),i=n(375),a=n(17),u=n(33)("species");r.exports=function(r,e){var n,c=o(r).constructor;return c===t||a(n=o(c)[u])?e:i(n)}},function(t,r,e){var n=e(89),o=e(31),i=TypeError;t.exports=function(t){if(n(t))return t;throw new i(o(t)+" is not a constructor")}},function(r,e,n){var o,i,a,u,c,f,s,l,h=n(4),p=n(94),g=n(84),v=n(21),d=n(38),y=n(7),m=n(74),b=n(76),w=n(42),x=n(377),S=n(378),E=n(186),A=h.setImmediate,I=h.clearImmediate,O=h.process,R=h.Dispatch,M=h.Function,T=h.MessageChannel,k=h.String,P=0,j={},C="onreadystatechange";y(function(){o=h.location}),c=function(t){if(d(j,t)){var r=j[t];delete j[t],r()}},f=function(t){return function(){c(t)}},s=function(t){c(t.data)},l=function(t){h.postMessage(k(t),o.protocol+"//"+o.host)},A&&I||(A=function setImmediate(r){var e,n;return x(arguments.length,1),e=v(r)?r:M(r),n=b(arguments,1),j[++P]=function(){p(e,t,n)},i(P),P},I=function clearImmediate(t){delete j[t]},E?i=function(t){O.nextTick(f(t))}:R&&R.now?i=function(t){R.now(f(t))}:T&&!S?(u=(a=new T).port2,a.port1.onmessage=s,i=g(u.postMessage,u)):h.addEventListener&&v(h.postMessage)&&!h.importScripts&&o&&"file:"!==o.protocol&&!y(l)?(i=l,h.addEventListener("message",s,!1)):i=C in w("script")?function(t){m.appendChild(w("script"))[C]=function(){m.removeChild(this),c(t)}}:function(t){setTimeout(f(t),0)}),r.exports={set:A,clear:I}},function(t,r,e){var n=TypeError;t.exports=function(t,r){if(t1?u(arguments,1):[],n=c.f(this),o=s(function(){return a(f(r),t,e)});return(o.error?n.reject:n.resolve)(o.value),n.promise}})},function(t,r,e){var n=e(3),o=e(388);n({target:"Promise",stat:!0},{withResolvers:function withResolvers(){var t=o.f(this);return{promise:t.promise,resolve:t.resolve,reject:t.reject}}})},function(t,r,e){var n=e(3),o=e(402),i=e(7),a=Array.fromAsync;n({target:"Array",stat:!0,forced:!a||i(function(){var t=0;return a.call(function(){return t++,[]},{length:0}),1!==t})},{fromAsync:o})},function(r,e,n){var o=n(84),i=n(14),a=n(39),u=n(89),c=n(403),f=n(136),s=n(264),l=n(137),h=n(29),p=n(23),g=n(204),v=n(33),d=n(404),y=n(406).toArray,m=v("asyncIterator"),b=i(g("Array","values")),w=i(b([]).next),safeArrayIterator=function(){return new SafeArrayIterator(this)},SafeArrayIterator=function(t){this.iterator=b(t)};SafeArrayIterator.prototype.next=function(){return w(this.iterator)},r.exports=function fromAsync(r){var e=this,n=arguments.length,i=n>1?arguments[1]:t,g=n>2?arguments[2]:t;return new(p("Promise"))(function(n){var p,v,b,w,x=a(r);i!==t&&(i=o(i,g)),v=(p=h(x,m))?t:l(x)||safeArrayIterator,b=u(e)?new e:[],w=p?c(x,p):new d(s(f(x,v))),n(y(w,i,b))})}},function(t,r,e){var n=e(8),o=e(404),i=e(46),a=e(136),u=e(264),c=e(29),f=e(33)("asyncIterator");t.exports=function(t,r){var e=arguments.length<2?c(t,f):r;return e?i(n(e,t)):new o(u(a(t)))}},function(r,e,n){var o=n(8),i=n(46),a=n(71),u=n(29),c=n(214),f=n(51),s=n(138),l=n(23),h=n(405),p=n(176),g=l("Promise"),v="AsyncFromSyncIterator",d=f.set,y=f.getterFor(v),asyncFromSyncIteratorContinuation=function(t,r,e,n,o){var i=t.done;g.resolve(t.value).then(function(t){r(p(t,i))},function(t){if(!i&&o)try{s(n,"throw",t)}catch(r){t=r}e(t)})},m=function AsyncIterator(t){t.type=v,d(this,t)};m.prototype=c(a(h),{next:function next(){var t=y(this);return new g(function(r,e){var n=i(o(t.next,t.iterator));asyncFromSyncIteratorContinuation(n,r,e,t.iterator,!0)})},"return":function(){var r=y(this).iterator;return new g(function(e,n){var a,c=u(r,"return");if(c===t)return e(p(t,!0));a=i(o(c,r)),asyncFromSyncIteratorContinuation(a,e,n,r)})}}),r.exports=m},function(t,r,e){var n,o,i=e(4),a=e(35),u=e(21),c=e(71),f=e(131),s=e(47),l=e(33),h=e(36),p="USE_FUNCTION_CONSTRUCTOR",g=l("asyncIterator"),v=i.AsyncIterator,d=a.AsyncIteratorPrototype;if(d)n=d;else if(u(v))n=v.prototype;else if(a[p]||i[p])try{o=f(f(f(Function("return async function*(){}()")()))),f(o)===Object.prototype&&(n=o)}catch(y){}n?h&&(n=c(n)):n={},u(n[g])||s(n,g,function(){return this}),t.exports=n},function(r,e,n){var o=n(8),i=n(30),a=n(46),u=n(20),c=n(144),f=n(23),s=n(264),l=n(407),createMethod=function(r){var e=0===r,n=1===r,h=2===r,p=3===r;return function(r,g,v){var d,y,m,b,w,x;return a(r),!(d=g!==t)&&e||i(g),y=s(r),m=f("Promise"),b=y.iterator,w=y.next,x=0,new m(function(r,i){var ifAbruptCloseAsyncIterator=function(t){l(b,i,t,i)},loop=function(){try{if(d)try{c(x)}catch(f){ifAbruptCloseAsyncIterator(f)}m.resolve(a(o(w,b))).then(function(o){var c,f,s;try{if(a(o).done)e?(v.length=x,r(v)):r(!p&&(h||t));else{c=o.value;try{d?(f=g(c,x),s=function(t){if(n)loop();else if(h)t?loop():l(b,r,!1,i);else if(e)try{v[x++]=t,loop()}catch(o){ifAbruptCloseAsyncIterator(o)}else t?l(b,r,p||c,i):loop()},u(f)?m.resolve(f).then(s,ifAbruptCloseAsyncIterator):s(f)):(v[x++]=c,loop())}catch(y){ifAbruptCloseAsyncIterator(y)}}}catch(w){i(w)}},i)}catch(s){i(s)}};loop()})}};r.exports={toArray:createMethod(0),forEach:createMethod(1),every:createMethod(2),some:createMethod(3),find:createMethod(4)}},function(t,r,e){var n=e(8),o=e(23),i=e(29);t.exports=function(t,r,e,a){try{var u=i(t,"return");if(u)return o("Promise").resolve(n(u,t)).then(function(){r(e)},function(t){a(t)})}catch(c){return a(c)}r(e)}},function(r,e,n){var o=n(3),i=n(6),a=n(23),u=n(30),c=n(215),f=n(47),s=n(214),l=n(77),h=n(33),p=n(51),g=n(254),v=n(27),d=a("Promise"),y=a("SuppressedError"),m=ReferenceError,b=h("asyncDispose"),w=h("toStringTag"),x="AsyncDisposableStack",S=p.set,E=p.getterFor(x),A="async-dispose",I="disposed",getPendingAsyncDisposableStackInternalState=function(t){var r=E(t);if(r.state===I)throw new m(x+" already disposed");return r},O=function AsyncDisposableStack(){S(c(this,R),{type:x,state:"pending",stack:[]}),i||(this.disposed=!1)},R=O.prototype;s(R,{disposeAsync:function disposeAsync(){var r=this;return new d(function(e,n){var o,a,u,c,f,s,l=E(r);if(l.state===I)return e(t);l.state=I,i||(r.disposed=!0),a=(o=l.stack).length,u=!1,f=function(t){u?c=new y(t,c):(u=!0,c=t),s()},(s=function(){if(a){var r=o[--a];o[a]=null;try{d.resolve(r()).then(s,f)}catch(i){f(i)}}else l.stack=null,u?n(c):e(t)})()})},use:function use(t){return g(getPendingAsyncDisposableStackInternalState(this),t,A),t},adopt:function adopt(r,e){var n=getPendingAsyncDisposableStackInternalState(this);return u(e),g(n,t,A,function(){return e(r)}),r},defer:function defer(r){var e=getPendingAsyncDisposableStackInternalState(this);u(r),g(e,t,A,r)},move:function move(){var t=getPendingAsyncDisposableStackInternalState(this),r=new O;return E(r).stack=t.stack,t.stack=[],t.state=I,i||(this.disposed=!0),r}}),i&&l(R,"disposed",{configurable:!0,get:function disposed(){return E(this).state===I}}),f(R,b,R.disposeAsync,{name:"disposeAsync"}),f(R,w,x,{nonWritable:!0}),o({global:!0,constructor:!0,forced:v&&v<136},{AsyncDisposableStack:O})},function(r,e,n){var o=n(8),i=n(47),a=n(23),u=n(29),c=n(38),f=n(33),s=n(405),l=f("asyncDispose"),h=a("Promise");c(s,l)||i(s,l,function(){var r=this;return new h(function(e,n){var i=u(r,"return");i?h.resolve(o(i,r)).then(function(){e(t)},n):e(t)})})},function(t,r,e){var n=e(3),o=e(94),i=e(30),a=e(46);n({target:"Reflect",stat:!0,forced:!e(7)(function(){Reflect.apply(function(){})})},{apply:function apply(t,r,e){return o(i(t),r,a(e))}})},function(t,r,e){var n=e(3),o=e(23),i=e(94),a=e(257),u=e(375),c=e(46),f=e(20),s=e(71),l=e(7),h=o("Reflect","construct"),p=Object.prototype,g=[].push,v=l(function(){function F(){}return!(h(function(){},[],F)instanceof F)}),d=!l(function(){h(function(){})}),y=v||d;n({target:"Reflect",stat:!0,forced:y,sham:y},{construct:function construct(t,r){var e,n,o,l,y;if(u(t),c(r),e=arguments.length<3?t:u(arguments[2]),d&&!v)return h(t,r,e);if(t===e){switch(r.length){case 0:return new t;case 1:return new t(r[0]);case 2:return new t(r[0],r[1]);case 3:return new t(r[0],r[1],r[2]);case 4:return new t(r[0],r[1],r[2],r[3])}return i(g,n=[null],r),new(i(a,t,n))}return l=s(f(o=e.prototype)?o:p),y=i(t,l,r),f(y)?y:l}})},function(t,r,e){var n=e(3),o=e(6),i=e(46),a=e(18),u=e(44);n({target:"Reflect",stat:!0,forced:e(7)(function(){Reflect.defineProperty(u.f({},1,{value:1}),1,{value:2})}),sham:!o},{defineProperty:function defineProperty(t,r,e){i(t);var n=a(r);i(e);try{return u.f(t,n,e),!0}catch(o){return!1}}})},function(t,r,e){var n=e(3),o=e(46),i=e(5).f;n({target:"Reflect",stat:!0},{deleteProperty:function deleteProperty(t,r){var e=i(o(t),r);return!(e&&!e.configurable)&&delete t[r]}})},function(r,e,n){var o=n(3),i=n(8),a=n(20),u=n(46),c=n(415),f=n(5),s=n(131);o({target:"Reflect",stat:!0},{get:function get(r,e){var n,o,l=arguments.length<3?r:arguments[2];return u(r)===l?r[e]:(n=f.f(r,e))?c(n)?n.value:n.get===t?t:i(n.get,l):a(o=s(r))?get(o,e,l):t}})},function(r,e,n){var o=n(38);r.exports=function(r){return r!==t&&(o(r,"value")||o(r,"writable"))}},function(t,r,e){var n=e(3),o=e(6),i=e(46),a=e(5);n({target:"Reflect",stat:!0,sham:!o},{getOwnPropertyDescriptor:function getOwnPropertyDescriptor(t,r){return a.f(i(t),r)}})},function(t,r,e){var n=e(3),o=e(46),i=e(131);n({target:"Reflect",stat:!0,sham:!e(132)},{getPrototypeOf:function getPrototypeOf(t){return i(o(t))}})},function(t,r,e){e(3)({target:"Reflect",stat:!0},{has:function has(t,r){return r in t}})},function(t,r,e){var n=e(3),o=e(46),i=e(288);n({target:"Reflect",stat:!0},{isExtensible:function isExtensible(t){return o(t),i(t)}})},function(t,r,e){e(3)({target:"Reflect",stat:!0},{ownKeys:e(56)})},function(t,r,e){var n=e(3),o=e(23),i=e(46);n({target:"Reflect",stat:!0,sham:!e(290)},{preventExtensions:function preventExtensions(t){i(t);try{var r=o("Object","preventExtensions");return r&&r(t),!0}catch(e){return!1}}})},function(r,e,n){var o=n(3),i=n(8),a=n(46),u=n(20),c=n(415),f=n(7),s=n(44),l=n(5),h=n(131),p=n(11);o({target:"Reflect",stat:!0,forced:f(function(){var Constructor=function(){},t=s.f(new Constructor,"a",{configurable:!0});return!1!==Reflect.set(Constructor.prototype,"a",1,t)})},{set:function set(r,e,n){var o,f,g,v=arguments.length<4?r:arguments[3],d=l.f(a(r),e);if(!d){if(u(f=h(r)))return set(f,e,n,v);d=p(0)}if(c(d)){if(!1===d.writable||!u(v))return!1;if(o=l.f(v,e)){if(o.get||o.set||!1===o.writable)return!1;o.value=n,s.f(v,e,o)}else s.f(v,e,p(0,n))}else{if((g=d.set)===t)return!1;i(g,v,n)}return!0}})},function(t,r,e){var n=e(3),o=e(46),i=e(117),a=e(115);a&&n({target:"Reflect",stat:!0},{setPrototypeOf:function setPrototypeOf(t,r){o(t),i(r);try{return a(t,r),!0}catch(e){return!1}}})},function(t,r,e){var n=e(3),o=e(4),i=e(82);n({global:!0},{Reflect:{}}),i(o.Reflect,"Reflect",!0)},function(r,e,n){var o,i,a,u=n(6),c=n(4),f=n(14),s=n(67),l=n(120),h=n(43),p=n(71),g=n(57).f,v=n(24),d=n(426),y=n(68),m=n(427),b=n(430),w=n(119),x=n(47),S=n(7),E=n(38),A=n(51).enforce,I=n(198),O=n(33),R=n(431),M=n(432),T=O("match"),k=c.RegExp,P=k.prototype,j=c.SyntaxError,C=f(P.exec),N=f("".charAt),D=f("".replace),U=f("".indexOf),_=f("".slice),L=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,B=/a/g,z=/a/g,W=new k(B)!==B,V=b.MISSED_STICKY,H=b.UNSUPPORTED_Y,q=u&&(!W||V||R||M||S(function(){return z[T]=!1,k(B)!==B||k(z)===z||"/a/i"!==String(k(B,"i"))}));if(s("RegExp",q)){for(o=function RegExp(r,e){var n,i,a,u,c,f,s=v(P,this),g=d(r),b=e===t,w=[],x=r;if(!s&&g&&b&&r.constructor===o)return r;if((g||v(P,r))&&(r=r.source,b&&(e=m(x))),r=r===t?"":y(r),e=e===t?"":y(e),x=r,R&&"dotAll"in B&&(i=!!e&&U(e,"s")>-1)&&(e=D(e,/s/g,"")),n=e,V&&"sticky"in B&&(a=!!e&&U(e,"y")>-1)&&H&&(e=D(e,/y/g,"")),M&&(r=(u=function(t){for(var r,e=t.length,n=0,o="",i=[],a=p(null),u=!1,c=!1,f=0,s="";n<=e;n++){if("\\"===(r=N(t,n)))r+=N(t,++n);else if("]"===r)u=!1;else if(!u)switch(!0){case"["===r:u=!0;break;case"("===r:if(o+=r,"?:"===_(t,n+1,n+3))continue;C(L,_(t,n+1))&&(n+=2,c=!0),f++;continue;case">"===r&&c:if(""===s||E(a,s))throw new j("Invalid capture group name");a[s]=!0,i[i.length]=[s,f],c=!1,s="";continue}c?s+=r:o+=r}return[o,i]}(r))[0],w=u[1]),c=l(k(r,e),s?this:P,o),(i||a||w.length)&&(f=A(c),i&&(f.dotAll=!0,f.raw=o(function(t){for(var r,e=t.length,n=0,o="",i=!1;n<=e;n++)"\\"!==(r=N(t,n))?i||"."!==r?("["===r?i=!0:"]"===r&&(i=!1),o+=r):o+="[\\s\\S]":o+=r+N(t,++n);return o}(r),n)),a&&(f.sticky=!0),w.length&&(f.groups=w)),r!==x)try{h(c,"source",""===x?"(?:)":x)}catch(S){}return c},i=g(k),a=0;i.length>a;)w(o,k,i[a++]);P.constructor=o,o.prototype=P,x(c,"RegExp",o,{constructor:!0})}I("RegExp")},function(r,e,n){var o=n(20),i=n(15),a=n(33)("match");r.exports=function(r){var e;return o(r)&&((e=r[a])!==t?!!e:"RegExp"===i(r))}},function(t,r,e){var n=e(8),o=e(38),i=e(24),a=e(428),u=e(429),c=RegExp.prototype;t.exports=a.correct?function(t){return t.flags}:function(t){return a.correct||!i(c,t)||o(t,"flags")?t.flags:n(u,t)}},function(t,r,e){var n=e(4),o=e(7),i=n.RegExp,a=!o(function(){var t,r,e,n,o,a,u=!0;try{i(".","d")}catch(c){u=!1}for(a in t={},r="",e=u?"dgimsy":"gimsy",n=function(e,n){Object.defineProperty(t,e,{get:function(){return r+=n,!0}})},o={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"},u&&(o.hasIndices="d"),o)n(a,o[a]);return Object.getOwnPropertyDescriptor(i.prototype,"flags").get.call(t)!==e||r!==e});t.exports={correct:a}},function(t,r,e){var n=e(46);t.exports=function(){var t=n(this),r="";return t.hasIndices&&(r+="d"),t.global&&(r+="g"),t.ignoreCase&&(r+="i"),t.multiline&&(r+="m"),t.dotAll&&(r+="s"),t.unicode&&(r+="u"),t.unicodeSets&&(r+="v"),t.sticky&&(r+="y"),r}},function(t,r,e){var n=e(7),o=e(4).RegExp,i=n(function(){var t=o("a","y");return t.lastIndex=2,null!==t.exec("abcd")}),a=i||n(function(){return!o("a","y").sticky}),u=i||n(function(){var t=o("^r","gy");return t.lastIndex=2,null!==t.exec("str")});t.exports={BROKEN_CARET:u,MISSED_STICKY:a,UNSUPPORTED_Y:i}},function(t,r,e){var n=e(7),o=e(4).RegExp;t.exports=n(function(){var t=o(".","s");return!(t.dotAll&&t.test("\n")&&"s"===t.flags)})},function(t,r,e){var n=e(7),o=e(4).RegExp;t.exports=n(function(){var t=o("(?b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$c")})},function(t,r,e){var n=e(3),o=e(14),i=e(434),a=e(38),u=e(247).start,c=e(320),f=Array,s=RegExp.escape,l=o("".charAt),h=o("".charCodeAt),p=o(1.1.toString),g=o([].join),v=/^[0-9a-z]/i,d=/^[$()*+./?[\\\]^{|}]/,y=RegExp("^[!\"#%&',\\-:;<=>@`~"+c+"]"),m=o(v.exec),b={"\t":"t","\n":"n","\x0B":"v","\f":"f","\r":"r"},escapeChar=function(t){var r=p(h(t,0),16);return r.length<3?"\\x"+u(r,2,"0"):"\\u"+u(r,4,"0")};n({target:"RegExp",stat:!0,forced:!s||"\\x61b"!==s("ab")},{escape:function escape(t){var r,e,n,o,u;for(i(t),e=f(r=t.length),n=0;n=56320||n+1>=r||56320!=(64512&h(t,n+1))?e[n]=escapeChar(o):(e[n]=o,e[++n]=l(t,n));return g(e,"")}})},function(t,r,e){var n=TypeError;t.exports=function(t){if("string"==typeof t)return t;throw new n("Argument is not a string")}},function(t,r,e){var n=e(6),o=e(431),i=e(15),a=e(77),u=e(51).get,c=RegExp.prototype,f=TypeError;n&&o&&a(c,"dotAll",{configurable:!0,get:function dotAll(){if(this!==c){if("RegExp"===i(this))return!!u(this).dotAll;throw new f("Incompatible receiver, RegExp required")}}})},function(t,r,e){var n=e(3),o=e(437);n({target:"RegExp",proto:!0,forced:/./.exec!==o},{exec:o})},function(r,e,n){var o,i,a=n(8),u=n(14),c=n(68),f=n(429),s=n(430),l=n(34),h=n(71),p=n(51).get,g=n(431),v=n(432),d=l("native-string-replace","".replace),y=/t/.exec,m=y,b=u("".charAt),w=u("".indexOf),x=u("".replace),S=u("".slice),E=(i=/b*/g,a(y,o=/a/,"a"),a(y,i,"a"),0!==o.lastIndex||0!==i.lastIndex),A=s.BROKEN_CARET,I=/()??/.exec("")[1]!==t;(E||I||A||g||v)&&(m=function exec(r){var e,n,o,i,u,s,l,g,v,O,R,M,T,k=this,P=p(k),j=c(r),C=P.raw;if(C)return C.lastIndex=k.lastIndex,e=a(m,C,j),k.lastIndex=C.lastIndex,e;if(g=P.groups,v=A&&k.sticky,O=a(f,k),R=k.source,M=0,T=j,v&&(O=x(O,"y",""),-1===w(O,"g")&&(O+="g"),T=S(j,k.lastIndex),k.lastIndex>0&&(!k.multiline||k.multiline&&"\n"!==b(j,k.lastIndex-1))&&(R="(?: "+R+")",T=" "+T,M++),n=new RegExp("^(?:"+R+")",O)),I&&(n=new RegExp("^"+R+"$(?!\\s)",O)),E&&(o=k.lastIndex),i=a(y,v?n:k,T),v?i?(i.input=S(i.input,M),i[0]=S(i[0],M),i.index=k.lastIndex,k.lastIndex+=i[0].length):k.lastIndex=0:E&&i&&(k.lastIndex=k.global?i.index+i[0].length:o),I&&i&&i.length>1&&a(d,i[0],n,function(){for(u=1;u1;return r.has(1)&&r.clear(),{done:e,value:2}}}}},r=new Set([1,2,3,4]);return 3!==r.difference(t).size})},{difference:o})},function(t,r,e){var n=e(446),o=e(447),i=e(448),a=e(451),u=e(452),c=e(449),f=e(450),s=o.has,l=o.remove;t.exports=function difference(t){var r=n(this),e=u(t),o=i(r);return a(r)<=e.size?c(r,function(t){e.includes(t)&&l(o,t)}):f(e.getIterator(),function(t){s(o,t)&&l(o,t)}),o}},function(t,r,e){var n=e(447).has;t.exports=function(t){return n(t),t}},function(t,r,e){var n=e(14),o=Set.prototype;t.exports={Set:Set,add:n(o.add),has:n(o.has),remove:n(o["delete"]),proto:o}},function(t,r,e){var n=e(447),o=e(449),i=n.Set,a=n.add;t.exports=function(t){var r=new i;return o(t,function(t){a(r,t)}),r}},function(t,r,e){var n=e(14),o=e(450),i=e(447),a=i.Set,u=i.proto,c=n(u.forEach),f=n(u.keys),s=f(new a).next;t.exports=function(t,r,e){return e?o({iterator:f(t),next:s},r):c(t,r)}},function(r,e,n){var o=n(8);r.exports=function(r,e,n){for(var i,a,u=n?r:r.iterator,c=r.next;!(i=o(c,u)).done;)if((a=e(i.value))!==t)return a}},function(t,r,e){var n=e(116),o=e(447);t.exports=n(o.proto,"size","get")||function(t){return t.size}},function(t,r,e){var n=e(30),o=e(46),i=e(8),a=e(61),u=e(264),c="Invalid size",f=RangeError,s=TypeError,l=Math.max,SetRecord=function(t,r){this.set=t,this.size=l(r,0),this.has=n(t.has),this.keys=n(t.keys)};SetRecord.prototype={getIterator:function(){return u(o(i(this.keys,this.set)))},includes:function(t){return i(this.has,this.set,t)}},t.exports=function(t){var r,e;if(o(t),(r=+t.size)!=r)throw new s(c);if((e=a(r))<0)throw new f(c);return new SetRecord(t,e)}},function(t,r,e){var n=e(23),createSetLike=function(t){return{size:t,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},createSetLikeWithInfinitySize=function(t){return{size:t,has:function(){return!0},keys:function(){throw new Error("e")}}};t.exports=function(t,r){var e,o=n("Set");try{(new o)[t](createSetLike(0));try{return(new o)[t](createSetLike(-1)),!1}catch(i){if(!r)return!0;try{return(new o)[t](createSetLikeWithInfinitySize(-Infinity)),!1}catch(a){return(e=new o).add(1),e.add(2),r(e[t](createSetLikeWithInfinitySize(Infinity)))}}}catch(a){return!1}}},function(t,r,e){var n=e(3),o=e(7),i=e(455);n({target:"Set",proto:!0,real:!0,forced:!e(453)("intersection",function(t){return 2===t.size&&t.has(1)&&t.has(2)})||o(function(){return"3,2"!==String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))})},{intersection:i})},function(t,r,e){var n=e(446),o=e(447),i=e(451),a=e(452),u=e(449),c=e(450),f=o.Set,s=o.add,l=o.has;t.exports=function intersection(t){var r=n(this),e=a(t),o=new f;return i(r)>e.size?c(e.getIterator(),function(t){l(r,t)&&s(o,t)}):u(r,function(t){e.includes(t)&&s(o,t)}),o}},function(t,r,e){var n=e(3),o=e(457);n({target:"Set",proto:!0,real:!0,forced:!e(453)("isDisjointFrom",function(t){return!t})},{isDisjointFrom:o})},function(t,r,e){var n=e(446),o=e(447).has,i=e(451),a=e(452),u=e(449),c=e(450),f=e(138);t.exports=function isDisjointFrom(t){var r,e=n(this),s=a(t);return i(e)<=s.size?!1!==u(e,function(t){if(s.includes(t))return!1},!0):(r=s.getIterator(),!1!==c(r,function(t){if(o(e,t))return f(r,"normal",!1)}))}},function(t,r,e){var n=e(3),o=e(459);n({target:"Set",proto:!0,real:!0,forced:!e(453)("isSubsetOf",function(t){return t})},{isSubsetOf:o})},function(t,r,e){var n=e(446),o=e(451),i=e(449),a=e(452);t.exports=function isSubsetOf(t){var r=n(this),e=a(t);return!(o(r)>e.size)&&!1!==i(r,function(t){if(!e.includes(t))return!1},!0)}},function(t,r,e){var n=e(3),o=e(461);n({target:"Set",proto:!0,real:!0,forced:!e(453)("isSupersetOf",function(t){return!t})},{isSupersetOf:o})},function(t,r,e){var n=e(446),o=e(447).has,i=e(451),a=e(452),u=e(450),c=e(138);t.exports=function isSupersetOf(t){var r,e=n(this),f=a(t);return!(i(e)=0?o:n+o;return i<0||i>=n?t:s(e,i)}})},function(t,r,e){var n=e(3),o=e(469).codeAt;n({target:"String",proto:!0},{codePointAt:function codePointAt(t){return o(this,t)}})},function(r,e,n){var o=n(14),i=n(61),a=n(68),u=n(16),c=o("".charAt),f=o("".charCodeAt),s=o("".slice),createMethod=function(r){return function(e,n){var o,l,h=a(u(e)),p=i(n),g=h.length;return p<0||p>=g?r?"":t:(o=f(h,p))<55296||o>56319||p+1===g||(l=f(h,p+1))<56320||l>57343?r?c(h,p):o:r?s(h,p,p+2):l-56320+(o-55296<<10)+65536}};r.exports={codeAt:createMethod(!1),charAt:createMethod(!0)}},function(r,e,n){var o,i=n(3),a=n(85),u=n(5).f,c=n(64),f=n(68),s=n(471),l=n(16),h=n(472),p=n(36),g=a("".slice),v=Math.min,d=h("endsWith");i({target:"String",proto:!0,forced:!!(p||d||(o=u(String.prototype,"endsWith"),!o||o.writable))&&!d},{endsWith:function endsWith(r){var e,n,o,i,a=f(l(this));return s(r),n=a.length,o=(e=arguments.length>1?arguments[1]:t)===t?n:v(c(e),n),i=f(r),g(a,o-i.length,o)===i}})},function(t,r,e){var n=e(426),o=TypeError;t.exports=function(t){if(n(t))throw new o("The method doesn't accept regular expressions");return t}},function(t,r,e){var n=e(33)("match");t.exports=function(t){var r=/./;try{"/./"[t](r)}catch(e){try{return r[n]=!1,"/./"[t](r)}catch(o){}}return!1}},function(t,r,e){var n=e(3),o=e(14),i=e(60),a=RangeError,u=String.fromCharCode,c=String.fromCodePoint,f=o([].join);n({target:"String",stat:!0,arity:1,forced:!!c&&1!==c.length},{fromCodePoint:function fromCodePoint(t){for(var r,e=[],n=arguments.length,o=0;n>o;){if(r=+arguments[o++],i(r,1114111)!==r)throw new a(r+" is not a valid code point");e[o]=r<65536?u(r):u(55296+((r-=65536)>>10),r%1024+56320)}return f(e,"")}})},function(r,e,n){var o=n(3),i=n(14),a=n(471),u=n(16),c=n(68),f=n(472),s=i("".indexOf);o({target:"String",proto:!0,forced:!f("includes")},{includes:function includes(r){return!!~s(c(u(this)),c(a(r)),arguments.length>1?arguments[1]:t)}})},function(t,r,e){var n=e(3),o=e(14),i=e(16),a=e(68),u=o("".charCodeAt);n({target:"String",proto:!0},{isWellFormed:function isWellFormed(){var t,r,e=a(i(this)),n=e.length;for(t=0;t=56320||++t>=n||56320!=(64512&u(e,t))))return!1;return!0}})},function(r,e,n){var o=n(469).charAt,i=n(68),a=n(51),u=n(173),c=n(176),f="String Iterator",s=a.set,l=a.getterFor(f);u(String,"String",function(t){s(this,{type:f,string:i(t),index:0})},function next(){var r,e=l(this),n=e.string,i=e.index;return i>=n.length?c(t,!0):(r=o(n,i),e.index+=r.length,c(r,!1))})},function(r,e,n){var o=n(8),i=n(14),a=n(478),u=n(46),c=n(20),f=n(64),s=n(68),l=n(16),h=n(29),p=n(479),g=n(427),v=n(480),d=i("".indexOf);a("match",function(r,e,n){return[function match(e){var n=l(this),i=c(e)?h(e,r):t;return i?o(i,e,n):new RegExp(e)[r](s(n))},function(t){var r,o,i,a,c,l,h=u(this),y=s(t),m=n(e,h,y);if(m.done)return m.value;if(r=s(g(h)),-1===d(r,"g"))return v(h,y);for(o=-1!==d(r,"u"),h.lastIndex=0,i=[],a=0;null!==(c=v(h,y));)l=s(c[0]),i[a]=l,""===l&&(h.lastIndex=p(y,f(h.lastIndex),o)),a++;return 0===a?null:i}]})},function(t,r,e){var n,o,i,a,u,c,f,s;e(436),n=e(8),o=e(47),i=e(437),a=e(7),u=e(33),c=e(43),f=u("species"),s=RegExp.prototype,t.exports=function(t,r,e,l){var h,p,g=u(t),v=!a(function(){var r={};return r[g]=function(){return 7},7!==""[t](r)}),d=v&&!a(function(){var r=!1,e=/a/;return"split"===t&&((e={}).constructor={},e.constructor[f]=function(){return e},e.flags="",e[g]=/./[g]),e.exec=function(){return r=!0,null},e[g](""),!r});v&&d&&!e||(h=/./[g],p=r(g,""[t],function(t,r,e,o,a){var u=r.exec;return u===i||u===s.exec?v&&!a?{done:!0,value:n(h,r,e,o)}:{done:!0,value:n(t,e,r,o)}:{done:!1}}),o(String.prototype,t,p[0]),o(s,g,p[1])),l&&c(s[g],"sham",!0)}},function(t,r,e){var n=e(469).charAt;t.exports=function(t,r,e){return r+(e?n(t,r).length:1)}},function(t,r,e){var n=e(8),o=e(46),i=e(21),a=e(15),u=e(437),c=TypeError;t.exports=function(t,r){var e,f=t.exec;if(i(f))return null!==(e=n(f,t,r))&&o(e),e;if("RegExp"===a(t))return n(u,t,r);throw new c("RegExp#exec called on incompatible receiver")}},function(r,e,n){var o=n(3),i=n(8),a=n(85),u=n(174),c=n(176),f=n(16),s=n(64),l=n(68),h=n(46),p=n(20),g=n(15),v=n(426),d=n(427),y=n(29),m=n(47),b=n(7),w=n(33),x=n(374),S=n(479),E=n(480),A=n(51),I=n(36),O=w("matchAll"),R="RegExp String",M=R+" Iterator",T=A.set,k=A.getterFor(M),P=RegExp.prototype,j=TypeError,C=a("".indexOf),N=a("".matchAll),D=!!N&&!b(function(){N("a",/./)}),U=u(function RegExpStringIterator(t,r,e,n){T(this,{type:M,regexp:t,string:r,global:e,unicode:n,done:!1})},R,function next(){var r,e,n,o=k(this);return o.done?c(t,!0):null===(n=E(r=o.regexp,e=o.string))?(o.done=!0,c(t,!0)):o.global?(""===l(n[0])&&(r.lastIndex=S(e,s(r.lastIndex),o.unicode)),c(n,!1)):(o.done=!0,c(n,!1))}),$matchAll=function(t){var r=h(this),e=l(t),n=x(r,RegExp),o=l(d(r)),i=new n(n===RegExp?r.source:r,o),a=!!~C(o,"g"),u=!!~C(o,"u");return i.lastIndex=s(r.lastIndex),new U(i,e,a,u)};o({target:"String",proto:!0,forced:D},{matchAll:function matchAll(r){var e,n,o,a,u=f(this);if(p(r)){if(v(r)&&(e=l(f(d(r))),!~C(e,"g")))throw new j("`.matchAll` does not allow non-global regexes");if(D)return N(u,r);if((o=y(r,O))===t&&I&&"RegExp"===g(r)&&(o=$matchAll),o)return i(o,r,u)}else if(D)return N(u,r);return n=l(u),a=new RegExp(r,"g"),I?i($matchAll,a,n):a[O](n)}}),I||O in P||m(P,O,$matchAll)},function(r,e,n){var o=n(3),i=n(247).end;o({target:"String",proto:!0,forced:n(483)},{padEnd:function padEnd(r){return i(this,r,arguments.length>1?arguments[1]:t)}})},function(t,r,e){var n=e(28);t.exports=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(n)},function(r,e,n){var o=n(3),i=n(247).start;o({target:"String",proto:!0,forced:n(483)},{padStart:function padStart(r){return i(this,r,arguments.length>1?arguments[1]:t)}})},function(t,r,e){var n=e(3),o=e(14),i=e(12),a=e(39),u=e(68),c=e(63),f=o([].push),s=o([].join);n({target:"String",stat:!0},{raw:function raw(t){var r,e,n,o=i(a(t).raw),l=c(o);if(!l)return"";for(r=arguments.length,e=[],n=0;;){if(f(e,u(o[n++])),n===l)return s(e,"");n=k&&(T+=R(z,k,C)+D,k=C+j.length)}return T+R(z,k)}]},!!c(function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$")})||!M||T)},function(r,e,n){var o=n(14),i=n(39),a=Math.floor,u=o("".charAt),c=o("".replace),f=o("".slice),s=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,l=/\$([$&'`]|\d{1,2})/g;r.exports=function(r,e,n,o,h,p){var g=n+r.length,v=o.length,d=l;return h!==t&&(h=i(h),d=s),c(p,d,function(i,c){var s,l,p;switch(u(c,0)){case"$":return"$";case"&":return r;case"`":return f(e,0,n);case"'":return f(e,g);case"<":s=h[f(c,1,-1)];break;default:if(0===(l=+c))return i;if(l>v)return 0===(p=a(l/10))?i:p<=v?o[p-1]===t?u(c,1):o[p-1]+u(c,1):i;s=o[l-1]}return s===t?"":s})}},function(r,e,n){var o=n(3),i=n(8),a=n(14),u=n(16),c=n(21),f=n(20),s=n(426),l=n(68),h=n(29),p=n(427),g=n(488),v=n(33),d=n(36),y=v("replace"),m=TypeError,b=a("".indexOf),w=a("".replace),x=a("".slice),S=Math.max;o({target:"String",proto:!0},{replaceAll:function replaceAll(r,e){var n,o,a,v,E,A,I,O,R,M,T=u(this),k=0,P="";if(f(r)){if((n=s(r))&&(o=l(u(p(r))),!~b(o,"g")))throw new m("`.replaceAll` does not allow non-global regexes");if(a=h(r,y))return i(a,r,T,e);if(d&&n)return w(l(T),r,e)}for(v=l(T),E=l(r),(A=c(e))||(e=l(e)),O=S(1,I=E.length),R=b(v,E);-1!==R;)M=A?l(e(E,R,v)):g(E,v,R,[],t,e),P+=x(v,k,R)+M,k=R+I,R=R+O>v.length?-1:b(v,E,R+O);return k1||"".split(/.?/).length;a("split",function(r,e,n){var i="0".split(t,0).length?function(r,n){return r===t&&0===n?[]:o(e,this,r,n)}:e;return[function split(e,n){var a=f(this),u=c(e)?g(e,r):t;return u?o(u,e,a,n):o(i,p(a),e,n)},function(r,o){var a,c,f,g,d,y,S,A,I,O,R,M=u(this),T=p(r);if(!E&&(a=n(i,M,T,o,i!==e)).done)return a.value;if(c=s(M,RegExp),f=M.unicode,g=new c(m?"^(?:"+M.source+")":M,(M.ignoreCase?"i":"")+(M.multiline?"m":"")+(M.unicode?"u":"")+(m?"g":"y")),0==(d=o===t?4294967295:o>>>0))return[];if(0===T.length)return null===v(g,T)?[T]:[];for(y=0,S=0,A=[];S1?arguments[1]:t,o.length)),n=f(r),g(o,e,e+n.length)===n}})},function(r,e,n){var o=n(3),i=n(14),a=n(16),u=n(61),c=n(68),f=i("".slice),s=Math.max,l=Math.min;o({target:"String",proto:!0,forced:!"".substr||"b"!=="ab".substr(-1)},{substr:function substr(r,e){var n,o,i=c(a(this)),h=i.length,p=u(r);return p===Infinity&&(p=0),p<0&&(p=s(h+p,0)),(n=e===t?h:u(e))<=0||n===Infinity||p>=(o=l(p+n,h))?"":f(i,p,o)}})},function(t,r,e){var n=e(3),o=e(8),i=e(14),a=e(16),u=e(68),c=e(7),f=Array,s=i("".charAt),l=i("".charCodeAt),h=i([].join),p="".toWellFormed,g=p&&c(function(){return"1"!==o(p,1)});n({target:"String",proto:!0,forced:g},{toWellFormed:function toWellFormed(){var t,r,e,n,i=u(a(this));if(g)return o(p,i);for(r=f(t=i.length),e=0;e=56320||e+1>=t||56320!=(64512&l(i,e+1))?r[e]="�":(r[e]=s(i,e),r[++e]=s(i,e));return h(r,"")}})},function(t,r,e){var n=e(3),o=e(319).trim;n({target:"String",proto:!0,forced:e(496)("trim")},{trim:function trim(){return o(this)}})},function(t,r,e){var n=e(49).PROPER,o=e(7),i=e(320);t.exports=function(t){return o(function(){return!!i[t]()||"​…᠎"!=="​…᠎"[t]()||n&&i[t].name!==t})}},function(t,r,e){var n,o;e(498),n=e(3),o=e(499),n({target:"String",proto:!0,name:"trimEnd",forced:"".trimEnd!==o},{trimEnd:o})},function(t,r,e){var n=e(3),o=e(499);n({target:"String",proto:!0,name:"trimEnd",forced:"".trimRight!==o},{trimRight:o})},function(t,r,e){var n=e(319).end,o=e(496);t.exports=o("trimEnd")?function trimEnd(){return n(this)}:"".trimEnd},function(t,r,e){var n,o;e(501),n=e(3),o=e(502),n({target:"String",proto:!0,name:"trimStart",forced:"".trimStart!==o},{trimStart:o})},function(t,r,e){var n=e(3),o=e(502);n({target:"String",proto:!0,name:"trimStart",forced:"".trimLeft!==o},{trimLeft:o})},function(t,r,e){var n=e(319).start,o=e(496);t.exports=o("trimStart")?function trimStart(){return n(this)}:"".trimStart},function(t,r,e){var n=e(3),o=e(504);n({target:"String",proto:!0,forced:e(505)("anchor")},{anchor:function anchor(t){return o(this,"a","name",t)}})},function(t,r,e){var n=e(14),o=e(16),i=e(68),a=/"/g,u=n("".replace);t.exports=function(t,r,e,n){var c=i(o(t)),f="<"+r;return""!==e&&(f+=" "+e+'="'+u(i(n),a,""")+'"'),f+">"+c+""}},function(t,r,e){var n=e(7);t.exports=function(t){return n(function(){var r=""[t]('"');return r!==r.toLowerCase()||r.split('"').length>3})}},function(t,r,e){var n=e(3),o=e(504);n({target:"String",proto:!0,forced:e(505)("big")},{big:function big(){return o(this,"big","","")}})},function(t,r,e){var n=e(3),o=e(504);n({target:"String",proto:!0,forced:e(505)("blink")},{blink:function blink(){return o(this,"blink","","")}})},function(t,r,e){var n=e(3),o=e(504);n({target:"String",proto:!0,forced:e(505)("bold")},{bold:function bold(){return o(this,"b","","")}})},function(t,r,e){var n=e(3),o=e(504);n({target:"String",proto:!0,forced:e(505)("fixed")},{fixed:function fixed(){return o(this,"tt","","")}})},function(t,r,e){var n=e(3),o=e(504);n({target:"String",proto:!0,forced:e(505)("fontcolor")},{fontcolor:function fontcolor(t){return o(this,"font","color",t)}})},function(t,r,e){var n=e(3),o=e(504);n({target:"String",proto:!0,forced:e(505)("fontsize")},{fontsize:function fontsize(t){return o(this,"font","size",t)}})},function(t,r,e){var n=e(3),o=e(504);n({target:"String",proto:!0,forced:e(505)("italics")},{italics:function italics(){return o(this,"i","","")}})},function(t,r,e){var n=e(3),o=e(504);n({target:"String",proto:!0,forced:e(505)("link")},{link:function link(t){return o(this,"a","href",t)}})},function(t,r,e){var n=e(3),o=e(504);n({target:"String",proto:!0,forced:e(505)("small")},{small:function small(){return o(this,"small","","")}})},function(t,r,e){var n=e(3),o=e(504);n({target:"String",proto:!0,forced:e(505)("strike")},{strike:function strike(){return o(this,"strike","","")}})},function(t,r,e){var n=e(3),o=e(504);n({target:"String",proto:!0,forced:e(505)("sub")},{sub:function sub(){return o(this,"sub","","")}})},function(t,r,e){var n=e(3),o=e(504);n({target:"String",proto:!0,forced:e(505)("sup")},{sup:function sup(){return o(this,"sup","","")}})},function(t,r,e){e(519)("Float32",function(t){return function Float32Array(r,e,n){return t(this,r,e,n)}})},function(r,e,n){var o=n(3),i=n(4),a=n(8),u=n(6),c=n(520),f=n(223),s=n(212),l=n(215),h=n(11),p=n(43),g=n(325),v=n(64),d=n(216),y=n(521),m=n(522),b=n(18),w=n(38),x=n(69),S=n(20),E=n(22),A=n(71),I=n(24),O=n(115),R=n(57).f,M=n(523),T=n(83).forEach,k=n(198),P=n(77),j=n(44),C=n(5),N=n(203),D=n(51),U=n(120),_=D.get,L=D.set,B=D.enforce,z=j.f,W=C.f,V=i.RangeError,H=s.ArrayBuffer,q=H.prototype,G=s.DataView,K=f.NATIVE_ARRAY_BUFFER_VIEWS,Y=f.TYPED_ARRAY_TAG,$=f.TypedArray,J=f.TypedArrayPrototype,X=f.isTypedArray,Q="BYTES_PER_ELEMENT",Z="Wrong length",addGetter=function(t,r){P(t,r,{configurable:!0,get:function(){return _(this)[r]}})},isArrayBuffer=function(t){var r;return I(q,t)||"ArrayBuffer"===(r=x(t))||"SharedArrayBuffer"===r},isTypedArrayIndex=function(t,r){return X(t)&&!E(r)&&r in t&&g(+r)&&r>=0},tt=function getOwnPropertyDescriptor(t,r){return r=b(r),isTypedArrayIndex(t,r)?h(2,t[r]):W(t,r)},rt=function defineProperty(t,r,e){return r=b(r),!(isTypedArrayIndex(t,r)&&S(e)&&w(e,"value"))||w(e,"get")||w(e,"set")||e.configurable||w(e,"writable")&&!e.writable||w(e,"enumerable")&&!e.enumerable?z(t,r,e):(t[r]=e.value,t)};u?(K||(C.f=tt,j.f=rt,addGetter(J,"buffer"),addGetter(J,"byteOffset"),addGetter(J,"byteLength"),addGetter(J,"length")),o({target:"Object",stat:!0,forced:!K},{getOwnPropertyDescriptor:tt,defineProperty:rt}),r.exports=function(r,e,n){var u,f=r.match(/\d+/)[0]/8,s=r+(n?"Clamped":"")+"Array",h="get"+r,g="set"+r,b=i[s],w=b,x=w&&w.prototype,E={},addElement=function(t,r){z(t,r,{get:function(){return function(t,r){var e=_(t);return e.view[h](r*f+e.byteOffset,!0)}(this,r)},set:function(t){return function(t,r,e){var o=_(t);o.view[g](r*f+o.byteOffset,n?m(e):e,!0)}(this,r,t)},enumerable:!0})};K?c&&(w=e(function(r,e,n,o){return l(r,x),U(S(e)?isArrayBuffer(e)?o!==t?new b(e,y(n,f),o):n!==t?new b(e,y(n,f)):new b(e):X(e)?N(w,e):a(M,w,e):new b(d(e)),r,w)}),O&&O(w,$),T(R(b),function(t){t in w||p(w,t,b[t])}),w.prototype=x):(w=e(function(r,e,n,o){var i,u,c,s,h,p;if(l(r,x),i=0,u=0,S(e)){if(!isArrayBuffer(e))return X(e)?N(w,e):a(M,w,e);if(c=e,u=y(n,f),p=e.byteLength,o===t){if(p%f)throw new V(Z);if((s=p-u)<0)throw new V(Z)}else if((s=v(o)*f)+u>p)throw new V(Z);h=s/f}else h=d(e),c=new H(s=h*f);for(L(r,{buffer:c,byteOffset:u,byteLength:s,length:h,view:new G(c)});i255?255:255&r}},function(r,e,n){var o=n(84),i=n(8),a=n(375),u=n(39),c=n(63),f=n(136),s=n(137),l=n(134),h=n(524),p=n(223).aTypedArrayConstructor,g=n(525);r.exports=function from(r){var e,n,v,d,y,m,b,w,x=a(this),S=u(r),E=arguments.length,A=E>1?arguments[1]:t,I=A!==t,O=s(S);if(O&&!l(O))for(w=(b=f(S,O)).next,S=[];!(m=i(w,b)).done;)S.push(m.value);for(I&&E>2&&(A=o(A,arguments[2])),n=c(S),v=new(p(x))(n),d=h(v),e=0;n>e;e++)y=I?A(S[e],e):S[e],v[e]=d?g(y):+y;return v}},function(t,r,e){var n=e(69);t.exports=function(t){var r=n(t);return"BigInt64Array"===r||"BigUint64Array"===r}},function(t,r,e){var n=e(19),o=TypeError;t.exports=function(t){var r=n(t,"number");if("number"==typeof r)throw new o("Can't convert number to bigint");return BigInt(r)}},function(t,r,e){e(519)("Float64",function(t){return function Float64Array(r,e,n){return t(this,r,e,n)}})},function(t,r,e){e(519)("Int8",function(t){return function Int8Array(r,e,n){return t(this,r,e,n)}})},function(t,r,e){e(519)("Int16",function(t){return function Int16Array(r,e,n){return t(this,r,e,n)}})},function(t,r,e){e(519)("Int32",function(t){return function Int32Array(r,e,n){return t(this,r,e,n)}})},function(t,r,e){e(519)("Uint8",function(t){return function Uint8Array(r,e,n){return t(this,r,e,n)}})},function(t,r,e){e(519)("Uint8",function(t){return function Uint8ClampedArray(r,e,n){return t(this,r,e,n)}},!0)},function(t,r,e){e(519)("Uint16",function(t){return function Uint16Array(r,e,n){return t(this,r,e,n)}})},function(t,r,e){e(519)("Uint32",function(t){return function Uint32Array(r,e,n){return t(this,r,e,n)}})},function(r,e,n){var o=n(223),i=n(63),a=n(61),u=o.aTypedArray;(0,o.exportTypedArrayMethod)("at",function at(r){var e=u(this),n=i(e),o=a(r),c=o>=0?o:n+o;return c<0||c>=n?t:e[c]})},function(r,e,n){var o=n(14),i=n(223),a=o(n(148)),u=i.aTypedArray;(0,i.exportTypedArrayMethod)("copyWithin",function copyWithin(r,e){return a(u(this),r,e,arguments.length>2?arguments[2]:t)})},function(r,e,n){var o=n(223),i=n(83).every,a=o.aTypedArray;(0,o.exportTypedArrayMethod)("every",function every(r){return i(a(this),r,arguments.length>1?arguments[1]:t)})},function(r,e,n){var o=n(223),i=n(153),a=n(525),u=n(69),c=n(8),f=n(14),s=n(7),l=o.aTypedArray,h=o.exportTypedArrayMethod,p=f("".slice);h("fill",function fill(r){var e,n=arguments.length;return l(this),e="Big"===p(u(this),0,3)?a(r):+r,c(i,this,e,n>1?arguments[1]:t,n>2?arguments[2]:t)},s(function(){var t=0;return new Int8Array(2).fill({valueOf:function(){return t++}}),1!==t}))},function(r,e,n){var o=n(223),i=n(83).filter,a=n(539),u=o.aTypedArray;(0,o.exportTypedArrayMethod)("filter",function filter(r){var e=i(u(this),r,arguments.length>1?arguments[1]:t);return a(this,e)})},function(t,r,e){var n=e(203),o=e(223).getTypedArrayConstructor;t.exports=function(t,r){return n(o(t),r)}},function(r,e,n){var o=n(223),i=n(83).find,a=o.aTypedArray;(0,o.exportTypedArrayMethod)("find",function find(r){return i(a(this),r,arguments.length>1?arguments[1]:t)})},function(r,e,n){var o=n(223),i=n(83).findIndex,a=o.aTypedArray;(0,o.exportTypedArrayMethod)("findIndex",function findIndex(r){return i(a(this),r,arguments.length>1?arguments[1]:t)})},function(r,e,n){var o=n(223),i=n(158).findLast,a=o.aTypedArray;(0,o.exportTypedArrayMethod)("findLast",function findLast(r){return i(a(this),r,arguments.length>1?arguments[1]:t)})},function(r,e,n){var o=n(223),i=n(158).findLastIndex,a=o.aTypedArray;(0,o.exportTypedArrayMethod)("findLastIndex",function findLastIndex(r){return i(a(this),r,arguments.length>1?arguments[1]:t)})},function(r,e,n){var o=n(223),i=n(83).forEach,a=o.aTypedArray;(0,o.exportTypedArrayMethod)("forEach",function forEach(r){i(a(this),r,arguments.length>1?arguments[1]:t)})},function(t,r,e){var n=e(520);(0,e(223).exportTypedArrayStaticMethod)("from",e(523),n)},function(r,e,n){var o=n(223),i=n(59).includes,a=o.aTypedArray;(0,o.exportTypedArrayMethod)("includes",function includes(r){return i(a(this),r,arguments.length>1?arguments[1]:t)})},function(r,e,n){var o=n(223),i=n(59).indexOf,a=o.aTypedArray;(0,o.exportTypedArrayMethod)("indexOf",function indexOf(r){return i(a(this),r,arguments.length>1?arguments[1]:t)})},function(t,r,e){var n=e(4),o=e(7),i=e(14),a=e(223),u=e(172),c=e(33)("iterator"),f=n.Uint8Array,s=i(u.values),l=i(u.keys),h=i(u.entries),p=a.aTypedArray,g=a.exportTypedArrayMethod,v=f&&f.prototype,d=!o(function(){v[c].call([1])}),y=!!v&&v.values&&v[c]===v.values&&"values"===v.values.name,m=function values(){return s(p(this))};g("entries",function entries(){return h(p(this))},d),g("keys",function keys(){return l(p(this))},d),g("values",m,d||!y,{name:"values"}),g(c,m,d||!y,{name:"values"})},function(t,r,e){var n=e(223),o=e(14),i=n.aTypedArray,a=n.exportTypedArrayMethod,u=o([].join);a("join",function join(t){return u(i(this),t)})},function(t,r,e){var n=e(223),o=e(94),i=e(179),a=n.aTypedArray;(0,n.exportTypedArrayMethod)("lastIndexOf",function lastIndexOf(t){var r=arguments.length;return o(i,a(this),r>1?[t,arguments[1]]:[t])})},function(r,e,n){var o=n(223),i=n(83).map,a=o.aTypedArray,u=o.getTypedArrayConstructor;(0,o.exportTypedArrayMethod)("map",function map(r){return i(a(this),r,arguments.length>1?arguments[1]:t,function(t,r){return new(u(t))(r)})})},function(t,r,e){var n=e(223),o=e(520),i=n.aTypedArrayConstructor;(0,n.exportTypedArrayStaticMethod)("of",function of(){for(var t=0,r=arguments.length,e=new(i(this))(r);r>t;)e[t]=arguments[t++];return e},o)},function(r,e,n){var o=n(223),i=n(185).left,a=o.aTypedArray;(0,o.exportTypedArrayMethod)("reduce",function reduce(r){var e=arguments.length;return i(a(this),r,e,e>1?arguments[1]:t)})},function(r,e,n){var o=n(223),i=n(185).right,a=o.aTypedArray;(0,o.exportTypedArrayMethod)("reduceRight",function reduceRight(r){var e=arguments.length;return i(a(this),r,e,e>1?arguments[1]:t)})},function(t,r,e){var n=e(223),o=n.aTypedArray,i=Math.floor;(0,n.exportTypedArrayMethod)("reverse",function reverse(){for(var t,r=this,e=o(r).length,n=i(e/2),a=0;a1?arguments[1]:t,1),n=f(r),y)return i(g,this,n,e);if(o=this.length,s=0,(a=u(n))+e>o)throw new l("Wrong length");for(;so;)f[o]=e[o++];return f},o(function(){new Int8Array(1).slice()}))},function(r,e,n){var o=n(223),i=n(83).some,a=o.aTypedArray;(0,o.exportTypedArrayMethod)("some",function some(r){return i(a(this),r,arguments.length>1?arguments[1]:t)})},function(r,e,n){var o=n(4),i=n(85),a=n(7),u=n(30),c=n(193),f=n(223),s=n(194),l=n(195),h=n(27),p=n(196),g=f.aTypedArray,v=f.exportTypedArrayMethod,d=o.Uint16Array,y=d&&i(d.prototype.sort),m=!(!y||a(function(){y(new d(2),null)})&&a(function(){y(new d(2),{})})),b=!!y&&!a(function(){var t,r,e,n;if(h)return h<74;if(s)return s<67;if(l)return!0;if(p)return p<602;for(t=new d(516),r=Array(516),e=0;e<516;e++)n=e%4,t[e]=515-e,r[e]=e-2*n+3;for(y(t,function(t,r){return(t/4|0)-(r/4|0)}),e=0;e<516;e++)if(t[e]!==r[e])return!0});v("sort",function sort(r){return r!==t&&u(r),b?y(this,r):c(g(this),function(r){return function(e,n){return r!==t?+r(e,n)||0:n!=n?-1:e!=e?1:0===e&&0===n?1/e>0&&1/n<0?1:-1:e>n}}(r))},!b||m)},function(r,e,n){var o=n(223),i=n(64),a=n(60),u=o.aTypedArray,c=o.getTypedArrayConstructor;(0,o.exportTypedArrayMethod)("subarray",function subarray(r,e){var n=u(this),o=n.length,f=a(r,o);return new(c(n))(n.buffer,n.byteOffset+f*n.BYTES_PER_ELEMENT,i((e===t?o:a(e,o))-f))})},function(t,r,e){var n=e(4),o=e(94),i=e(223),a=e(7),u=e(76),c=n.Int8Array,f=i.aTypedArray,s=i.exportTypedArrayMethod,l=[].toLocaleString,h=!!c&&a(function(){l.call(new c(1))});s("toLocaleString",function toLocaleString(){return o(l,h?u(f(this)):f(this),u(arguments))},a(function(){ +return[1,2].toLocaleString()!==new c([1,2]).toLocaleString()})||!a(function(){c.prototype.toLocaleString.call([1,2])}))},function(t,r,e){var n=e(201),o=e(223),i=o.aTypedArray,a=o.getTypedArrayConstructor;(0,o.exportTypedArrayMethod)("toReversed",function toReversed(){return n(i(this),a(this))})},function(r,e,n){var o=n(223),i=n(14),a=n(30),u=n(203),c=o.aTypedArray,f=o.getTypedArrayConstructor,s=o.exportTypedArrayMethod,l=i(o.TypedArrayPrototype.sort);s("toSorted",function toSorted(r){var e,n;return r!==t&&a(r),e=c(this),n=u(f(e),e),l(n,r)})},function(t,r,e){var n=e(223).exportTypedArrayMethod,o=e(7),i=e(4),a=e(14),u=i.Uint8Array,c=u&&u.prototype||{},f=[].toString,s=a([].join);o(function(){f.call({})})&&(f=function toString(){return s(this)}),n("toString",f,c.toString!==f)},function(t,r,e){var n=e(210),o=e(223),i=e(524),a=e(61),u=e(525),c=o.aTypedArray,f=o.getTypedArrayConstructor,s=o.exportTypedArrayMethod,l=function(){try{new Int8Array(1)["with"](2,{valueOf:function(){throw 8}})}catch(t){return 8===t}}(),h=l&&function(){try{new Int8Array(1)["with"](-.5,1)}catch(t){return!0}}();s("with",{"with":function(t,r){var e=c(this),o=a(t),s=i(e)?u(r):+r;return n(e,f(e),o,s)}}["with"],!l||h)},function(r,e,n){var o=n(3),i=n(4),a=n(203),u=n(567),c=i.Uint8Array,f=!c||!c.fromBase64||!function(){try{return void c.fromBase64("a")}catch(t){}try{c.fromBase64("",null)}catch(t){return!0}}();c&&o({target:"Uint8Array",stat:!0,forced:f},{fromBase64:function fromBase64(r){var e=u(r,arguments.length>1?arguments[1]:t,null,9007199254740991);return a(c,e.bytes)}})},function(r,e,n){var o=n(4),i=n(14),a=n(568),u=n(434),c=n(38),f=n(569),s=n(570),l=n(236),h=f.c2i,p=f.c2iUrl,g=o.SyntaxError,v=o.TypeError,d=i("".charAt),skipAsciiWhitespace=function(t,r){for(var e,n=t.length;r>16&255,n>>8&255,255&n],2===i){if(e&&0!==o[1])throw new g("Extra bits");return[o[0]]}if(3===i){if(e&&0!==o[2])throw new g("Extra bits");return[o[0],o[1]]}return o},writeBytes=function(t,r,e){var n,o=r.length;for(n=0;n0){if("stop-before-partial"===f)break;if("loose"!==f)throw new g("Missing padding");if(1===x.length)throw new g("Malformed padding: exactly one additional character");b=writeBytes(m,decodeBase64Chunk(x,i,!1),b)}w=y;break}if(E=d(r,S),++S,"="===E){if(x.length<2)throw new g("Padding is too early");if(S=skipAsciiWhitespace(r,S),2===x.length){if(S===y){if("stop-before-partial"===f)break;throw new g("Malformed padding: only one =")}"="===d(r,S)&&(++S,S=skipAsciiWhitespace(r,S))}if(S1?arguments[1]:t,this,this.length);return{read:e.read,written:e.written}}})},function(t,r,e){var n=e(69),o=TypeError;t.exports=function(t){if("Uint8Array"===n(t))return t;throw new o("Argument is not an Uint8Array")}},function(t,r,e){var n=e(3),o=e(4),i=e(434),a=e(574),u=e(236),c=e(572);o.Uint8Array&&n({target:"Uint8Array",proto:!0},{setFromHex:function setFromHex(t){a(this),i(t),u(this.buffer);var r=c(t,this).read;return{read:r,written:r/2}}})},function(r,e,n){var o=n(3),i=n(4),a=n(14),u=n(568),c=n(574),f=n(236),s=n(569),l=n(570),h=s.i2c,p=s.i2cUrl,g=a("".charAt),v=i.Uint8Array,d=!v||!v.prototype.toBase64||!function(){try{(new v).toBase64(null)}catch(t){return!0}}();v&&o({target:"Uint8Array",proto:!0,forced:d},{toBase64:function toBase64(){var r,e,n,o,i,a=c(this),s=arguments.length?u(arguments[0]):t,v="base64"===l(s)?h:p,d=!!s&&!!s.omitPadding;for(f(this.buffer),r="",e=0,n=a.length,i=function(t){return g(v,o>>6*t&63)};e+21?arguments[1]:t)}}),a("filterOut")},function(r,e,n){var o=n(3),i=n(83).filterReject,a=n(142);o({target:"Array",proto:!0,forced:!0},{filterReject:function filterReject(r){return i(this,r,arguments.length>1?arguments[1]:t)}}),a("filterReject")},function(r,e,n){var o=n(3),i=n(587),a=n(142);o({target:"Array",proto:!0},{group:function group(r){return i(this,r,arguments.length>1?arguments[1]:t)}}),a("group")},function(t,r,e){var n=e(84),o=e(14),i=e(13),a=e(39),u=e(18),c=e(63),f=e(71),s=e(203),l=Array,h=o([].push);t.exports=function(t,r,e,o){for(var p,g,v,d=a(t),y=i(d),m=n(r,e),b=f(null),w=c(y),x=0;w>x;x++)(g=u(m(v=y[x],x,d)))in b?h(b[g],v):b[g]=[v];if(o&&(p=o(d))!==l)for(g in b)b[g]=s(p,b[g]);return b}},function(r,e,n){var o=n(3),i=n(587),a=n(151),u=n(142);o({target:"Array",proto:!0,forced:!a("groupBy")},{groupBy:function groupBy(r){return i(this,r,arguments.length>1?arguments[1]:t)}}),u("groupBy")},function(t,r,e){var n=e(3),o=e(151),i=e(142),a=e(590);n({target:"Array",proto:!0,name:"groupToMap",forced:e(36)||!o("groupByToMap")},{groupByToMap:a}),i("groupByToMap")},function(r,e,n){var o=n(84),i=n(14),a=n(13),u=n(39),c=n(63),f=n(293),s=f.Map,l=f.get,h=f.has,p=f.set,g=i([].push);r.exports=function groupToMap(r){for(var e,n,i=u(this),f=a(i),v=o(r,arguments.length>1?arguments[1]:t),d=new s,y=c(f),m=0;y>m;m++)e=v(n=f[m],m,i),h(d,e)?g(l(d,e),n):p(d,e,[n]);return d}},function(t,r,e){var n=e(3),o=e(142),i=e(590);n({target:"Array",proto:!0,forced:e(36)},{groupToMap:i}),o("groupToMap")},function(r,e,n){var o=n(3),i=n(88),a=Object.isFrozen,isFrozenStringArray=function(r,e){var n,o,u;if(!a||!i(r)||!a(r))return!1;for(n=0,o=r.length;nr,g=!1,n===t)y=t;else if(c(n))y=n.step,g=!!n.inclusive;else{if(typeof n!=o)throw new d(l);y=n}if(u(y)&&(y=f?a:-a),typeof y!=o)throw new d(l);if(y===Infinity||y===-Infinity||y===i&&r!==e)throw new v(l);p(this,{type:h,start:r,end:e,step:y,inclusive:g,hitsEnd:r!=r||e!=e||y!=y||e>r!=y>i,currentCount:i,zero:i}),s||(this.start=r,this.end=e,this.step=y,this.inclusive=g)},h,function next(){var r,e,n,o,i=g(this);return i.hitsEnd?a(t,!0):(e=i.end,(n=(r=i.start)+i.step*i.currentCount++)===e&&(i.hitsEnd=!0),o=i.inclusive,(e>r?o?n>e:n>=e:o?e>n:e>=n)?(i.hitsEnd=!0,a(t,!0)):a(n,!1))}),addGetter=function(t){f(y.prototype,t,{get:function(){return g(this)[t]},set:function(){},configurable:!0,enumerable:!1})};s&&(addGetter("start"),addGetter("end"),addGetter("inclusive"),addGetter("step")),r.exports=y},function(t,r,e){var n=e(3),o=e(94),i=e(621),a=e(23),u=e(71),c=Object,initializer=function(){var t=a("Object","freeze");return t?t(u(null)):u(null)};n({global:!0,forced:!0},{compositeKey:function compositeKey(){return o(i,c,arguments).get("object",initializer)}})},function(t,r,e){var n,o,i,a,u,c,f,s,l;e(284),e(579),n=e(23),o=e(71),i=e(20),a=Object,u=TypeError,c=n("Map"),f=n("WeakMap"),(s=function(){this.object=null,this.symbol=null,this.primitives=null,this.objectsByIndex=o(null)}).prototype.get=function(t,r){return this[t]||(this[t]=r())},s.prototype.next=function(t,r,e){var n=e?this.objectsByIndex[t]||(this.objectsByIndex[t]=new f):this.primitives||(this.primitives=new c),o=n.get(r);return o||n.set(r,o=new s),o},l=new s,t.exports=function(){var t,r,e=l,n=arguments.length;for(t=0;t>>0===t?new h(u(r),{chunkSize:t}):c(r,"throw",new s("chunkSize must be integer in [1, 2^32-1]"))}})},function(t,r,e){var n=e(3),o=e(8),i=e(30),a=e(46),u=e(137),c=e(267),f=Array,s=c(function(){for(var t,r,e,n,i;;){if(!(t=this.iterator)){if((r=this.nextIterableIndex++)>=(e=this.iterables).length)return void(this.done=!0);n=e[r],this.iterables[r]=null,t=this.iterator=o(n.method,n.iterable),this.next=t.next}if(!(i=a(o(this.next,t))).done)return i.value;this.iterator=null,this.next=null}});n({target:"Iterator",stat:!0},{concat:function concat(){var t,r,e=arguments.length,n=f(e);for(t=0;t>>0===e?n!==t&&"only-full"!==n&&n!==v?f(r,"throw",new h("Incorrect `undersized` argument")):new d(c(r),{windowSize:e,buffer:[],allowPartial:n===v}):f(r,"throw",new l("`windowSize` must be integer in [1, 2^32-1]"))}},function(t,r,e){var n=e(3),o=e(46),i=e(404),a=e(611),u=e(264);n({target:"Iterator",proto:!0,real:!0,forced:!0},{toAsync:function toAsync(){return new a(u(new i(u(o(this)))))}})},function(r,e,n){var o=n(3),i=n(638);o({target:"Iterator",proto:!0,real:!0,forced:!0},{windows:function windows(r){return i(this,r,arguments.length<2?t:arguments[1])}})},function(r,e,n){var o=n(3),i=n(46),a=n(568),u=n(8),c=n(14),f=n(642),s=n(275),l=n(643),h=n(138),p=n(268),g=n(644),v=c([].concat),d=c([].push),y="throw";o({target:"Iterator",stat:!0,forced:!0},{zip:function zip(r){var e,n,o,c,m,b,w,x,S,E,A,I,O,R;for(i(r),e=arguments.length>1?a(arguments[1]):t,o="longest"===(n=l(e))?a(e&&e.padding):t,c=[],m=[],b=f(r);!x;){try{x=(S=i(u(b.next,b.iterator))).done}catch(M){return p(c,y,M)}if(!x){try{w=s(S.value,!0)}catch(M){return p(v([b.iterator],c),y,M)}d(c,w)}}if(E=c.length,"longest"===n)if(o===t)for(A=0;A1?a(arguments[1]):t,o="longest"===(n=p(e))?a(e&&e.padding):t,f=[],s=[],w=y(r),x=[],S=l.f,E=0;E1?arguments[1]:t);return!1!==u(e,function(t,r){if(!n(t,r,e))return!1},!0)}})},function(r,e,n){var o=n(3),i=n(84),a=n(653),u=n(293),c=n(597),f=u.Map,s=u.set;o({target:"Map",proto:!0,real:!0,forced:!0},{filter:function filter(r){var e=a(this),n=i(r,arguments.length>1?arguments[1]:t),o=new f;return c(e,function(t,r){n(t,r,e)&&s(o,r,t)}),o}})},function(r,e,n){var o=n(3),i=n(84),a=n(653),u=n(597);o({target:"Map",proto:!0,real:!0,forced:!0},{find:function find(r){var e=a(this),n=i(r,arguments.length>1?arguments[1]:t),o=u(e,function(t,r){if(n(t,r,e))return{value:t}},!0);return o&&o.value}})},function(r,e,n){var o=n(3),i=n(84),a=n(653),u=n(597);o({target:"Map",proto:!0,real:!0,forced:!0},{findKey:function findKey(r){var e=a(this),n=i(r,arguments.length>1?arguments[1]:t),o=u(e,function(t,r){if(n(t,r,e))return{key:r}},!0);return o&&o.key}})},function(t,r,e){var n=e(3),o=e(293);n({target:"Map",stat:!0,forced:!0},{from:e(660)(o.Map,o.set,!0)})},function(r,e,n){var o=n(84),i=n(46),a=n(39),u=n(133);r.exports=function(r,e,n){return function from(c){var f=a(c),s=arguments.length,l=s>1?arguments[1]:t,h=l!==t,p=h?o(l,s>2?arguments[2]:t):t,g=new r,v=0;return u(f,function(t){var r=h?p(t,v++):t;n?e(g,i(r)[0],r[1]):e(g,r)}),g}}},function(t,r,e){var n=e(3),o=e(653),i=e(293),a=e(36),u=i.get,c=i.has,f=i.set;n({target:"Map",proto:!0,real:!0,forced:a},{getOrInsert:function getOrInsert(t,r){return c(o(this),t)?u(this,t):(f(this,t,r),r)}})},function(t,r,e){var n=e(3),o=e(30),i=e(653),a=e(293),u=e(36),c=a.get,f=a.has,s=a.set;n({target:"Map",proto:!0,real:!0,forced:u},{getOrInsertComputed:function getOrInsertComputed(t,r){if(i(this),o(r),f(this,t))return c(this,t);0===t&&1/t===-Infinity&&(t=0);var e=r(t);return s(this,t,e),e}})},function(t,r,e){var n=e(3),o=e(664),i=e(653),a=e(597);n({target:"Map",proto:!0,real:!0,forced:!0},{includes:function includes(t){return!0===a(i(this),function(r){if(o(r,t))return!0},!0)}})},function(t,r,e){t.exports=function(t,r){return t===r||t!=t&&r!=r}},function(t,r,e){var n=e(3),o=e(8),i=e(133),a=e(21),u=e(30),c=e(293).Map;n({target:"Map",stat:!0,forced:!0},{keyBy:function keyBy(t,r){var e,n=new(a(this)?this:c);return u(r),e=u(n.set),i(t,function(t){o(e,n,r(t),t)}),n}})},function(t,r,e){var n=e(3),o=e(653),i=e(597);n({target:"Map",proto:!0,real:!0,forced:!0},{keyOf:function keyOf(t){var r=i(o(this),function(r,e){if(r===t)return{key:e}},!0);return r&&r.key}})},function(r,e,n){var o=n(3),i=n(84),a=n(653),u=n(293),c=n(597),f=u.Map,s=u.set;o({target:"Map",proto:!0,real:!0,forced:!0},{mapKeys:function mapKeys(r){var e=a(this),n=i(r,arguments.length>1?arguments[1]:t),o=new f;return c(e,function(t,r){s(o,n(t,r,e),t)}),o}})},function(r,e,n){var o=n(3),i=n(84),a=n(653),u=n(293),c=n(597),f=u.Map,s=u.set;o({target:"Map",proto:!0,real:!0,forced:!0},{mapValues:function mapValues(r){var e=a(this),n=i(r,arguments.length>1?arguments[1]:t),o=new f;return c(e,function(t,r){s(o,r,n(t,r,e))}),o}})},function(t,r,e){var n=e(3),o=e(653),i=e(133),a=e(293).set;n({target:"Map",proto:!0,real:!0,arity:1,forced:!0},{merge:function merge(t){for(var r=o(this),e=arguments.length,n=0;n1?arguments[1]:t);return!0===u(e,function(t,r){if(n(t,r,e))return!0},!0)}})},function(r,e,n){var o=n(3),i=n(30),a=n(653),u=n(293),c=TypeError,f=u.get,s=u.has,l=u.set;o({target:"Map",proto:!0,real:!0,forced:!0},{update:function update(r,e){var n,o,u=a(this),h=arguments.length;if(i(e),!(n=s(u,r))&&h<3)throw new c("Updating absent value");return o=n?f(u,r):i(h>2?arguments[2]:t)(r,u),l(u,r,e(o,r,u)),u}})},function(t,r,e){e(3)({target:"Map",proto:!0,real:!0,name:"upsert",forced:!0},{updateOrInsert:e(676)})},function(r,e,n){var o=n(8),i=n(30),a=n(21),u=n(46),c=TypeError;r.exports=function upsert(r,e){var n,f=u(this),s=i(f.get),l=i(f.has),h=i(f.set),p=arguments.length>2?arguments[2]:t;if(!a(e)&&!a(p))throw new c("At least one callback required");return o(l,f,r)?(n=o(s,f,r),a(e)&&(n=e(n),o(h,f,r,n))):a(p)&&(n=p(),o(h,f,r,n)),n}},function(t,r,e){e(3)({target:"Map",proto:!0,real:!0,forced:!0},{upsert:e(676)})},function(t,r,e){e(3)({target:"Math",stat:!0,forced:!0},{clamp:e(679)})},function(t,r,e){var n=e(680),o=Math.min,i=Math.max;t.exports=function clamp(t,r,e){return o(i(n(t),n(r)),n(e))}},function(t,r,e){var n=TypeError;t.exports=function(t){if("number"==typeof t)return t;throw new n("Argument is not a number")}},function(t,r,e){e(3)({target:"Math",stat:!0,nonConfigurable:!0,nonWritable:!0},{DEG_PER_RAD:Math.PI/180})},function(t,r,e){var n=e(3),o=180/Math.PI;n({target:"Math",stat:!0,forced:!0},{degrees:function degrees(t){return t*o}})},function(t,r,e){var n=e(3),o=e(684),i=e(217);n({target:"Math",stat:!0,forced:!0},{fscale:function fscale(t,r,e,n,a){return i(o(t,r,e,n,a))}})},function(t,r,e){t.exports=function scale(t,r,e,n,o){var i=+t,a=+r,u=+e,c=+n,f=+o;return i!=i||a!=a||u!=u||c!=c||f!=f?NaN:i===Infinity||i===-Infinity?i:(i-a)*(f-c)/(u-a)+c}},function(t,r,e){e(3)({target:"Math",stat:!0,forced:!0},{iaddh:function iaddh(t,r,e,n){var o=t>>>0,i=e>>>0;return(r>>>0)+(n>>>0)+((o&i|(o|i)&~(o+i>>>0))>>>31)|0}})},function(t,r,e){e(3)({target:"Math",stat:!0,forced:!0},{imulh:function imulh(t,r){var e=65535,n=+t,o=+r,i=n&e,a=o&e,u=n>>16,c=o>>16,f=(u*a>>>0)+(i*a>>>16);return u*c+(f>>16)+((i*c>>>0)+(f&e)>>16)}})},function(t,r,e){e(3)({target:"Math",stat:!0,forced:!0},{isubh:function isubh(t,r,e,n){var o=t>>>0,i=e>>>0;return(r>>>0)-(n>>>0)-((~o&i|(o^~i)&o-i>>>0)>>>31)|0}})},function(t,r,e){e(3)({target:"Math",stat:!0,nonConfigurable:!0,nonWritable:!0},{RAD_PER_DEG:180/Math.PI})},function(t,r,e){var n=e(3),o=Math.PI/180;n({target:"Math",stat:!0,forced:!0},{radians:function radians(t){return t*o}})},function(t,r,e){e(3)({target:"Math",stat:!0,forced:!0},{scale:e(684)})},function(t,r,e){var n=e(3),o=e(46),i=e(323),a=e(174),u=e(176),c=e(51),f="Seeded Random",s=f+" Generator",l=c.set,h=c.getterFor(s),p=TypeError,g=a(function SeededRandomGenerator(t){l(this,{type:s,seed:t%2147483647})},f,function next(){var t=h(this),r=t.seed=(1103515245*t.seed+12345)%2147483647;return u((1073741823&r)/1073741823,!1)});n({target:"Math",stat:!0,forced:!0},{seededPRNG:function seededPRNG(t){var r=o(t).seed;if(!i(r))throw new p('Math.seededPRNG() argument should have a "seed" field with a finite value.');return new g(r)}})},function(t,r,e){e(3)({target:"Math",stat:!0,forced:!0},{signbit:function signbit(t){var r=+t;return r==r&&0===r?1/r===-Infinity:r<0}})},function(t,r,e){e(3)({target:"Math",stat:!0,forced:!0},{umulh:function umulh(t,r){var e=65535,n=+t,o=+r,i=n&e,a=o&e,u=n>>>16,c=o>>>16,f=(u*a>>>0)+(i*a>>>16);return u*c+(f>>>16)+((i*c>>>0)+(f&e)>>>16)}})},function(t,r,e){var n=e(3),o=e(679),i=e(318);n({target:"Number",proto:!0,forced:!0},{clamp:function clamp(t,r){return o(i(this),t,r)}})},function(r,e,n){var o=n(3),i=n(14),a=n(61),u="Invalid number representation",c=RangeError,f=SyntaxError,s=TypeError,l=parseInt,h=Math.pow,p=/^[\d.a-z]+$/,g=i("".charAt),v=i(p.exec),d=i(1.1.toString),y=i("".slice),m=i("".split);o({target:"Number",stat:!0,forced:!0},{fromString:function fromString(r,e){var n,o,i,b=1;if("string"!=typeof r)throw new s(u);if(!r.length)throw new f(u);if("-"===g(r,0)&&(b=-1,!(r=y(r,1)).length))throw new f(u);if((n=e===t?10:a(e))<2||n>36)throw new c("Invalid radix");if(!v(p,r))throw new f(u);if(o=m(r,"."),i=l(o[0],n),o.length>1&&(i+=l(o[1],n)/h(n,o[1].length)),10===n&&d(i,n)!==r)throw new f(u);return b*i}})},function(t,r,e){var n=e(3),o=e(619);n({target:"Number",stat:!0,forced:!0},{range:function range(t,r,e){return new o(t,r,e,"number",0,1)}})},function(t,r,e){var n=e(3),o=e(698);n({target:"Object",stat:!0,forced:!0},{iterateEntries:function iterateEntries(t){return new o(t,"entries")}})},function(r,e,n){var o=n(51),i=n(174),a=n(176),u=n(38),c=n(73),f=n(39),s="Object Iterator",l=o.set,h=o.getterFor(s);r.exports=i(function ObjectIterator(t,r){var e=f(t);l(this,{type:s,mode:r,object:e,keys:c(e),index:0})},"Object",function next(){for(var r,e,n=h(this),o=n.keys;;){if(null===o||n.index>=o.length)return n.object=n.keys=null,a(t,!0);if(r=o[n.index++],u(e=n.object,r)){switch(n.mode){case"keys":return a(r,!1);case"values":return a(e[r],!1)}return a([r,e[r]],!1)}}})},function(t,r,e){var n=e(3),o=e(698);n({target:"Object",stat:!0,forced:!0},{iterateKeys:function iterateKeys(t){return new o(t,"keys")}})},function(t,r,e){var n=e(3),o=e(698);n({target:"Object",stat:!0,forced:!0},{iterateValues:function iterateValues(t){return new o(t,"values")}})},function(t,r,e){e(702),e(703),e(704)},function(r,e,n){var o,i,a,u,c=n(3),f=n(8),s=n(6),l=n(198),h=n(30),p=n(46),g=n(215),v=n(21),d=n(17),y=n(20),m=n(29),b=n(47),w=n(214),x=n(77),S=n(384),E=n(33),A=n(51),I=E("observable"),O="Observable",R="Subscription",M="SubscriptionObserver",T=A.getterFor,k=A.set,P=T(O),j=T(R),C=T(M),SubscriptionState=function(t){this.observer=p(t),this.cleanup=null,this.subscriptionObserver=null};SubscriptionState.prototype={type:R,clean:function(){var t=this.cleanup;if(t){this.cleanup=null;try{t()}catch(r){S(r)}}},close:function(){var t;s||(t=this.subscriptionObserver,this.facade.closed=!0,t&&(t.closed=!0)),this.observer=null},isClosed:function(){return null===this.observer}},(o=function(t,r){var e,n,o,a,u=k(this,new SubscriptionState(t));s||(this.closed=!1);try{(e=m(t,"start"))&&f(e,t,this)}catch(c){S(c)}if(!u.isClosed()){n=u.subscriptionObserver=new i(u);try{o=r(n),a=o,d(o)||(u.cleanup=v(o.unsubscribe)?function(){a.unsubscribe()}:h(o))}catch(c){return void n.error(c)}u.isClosed()&&u.clean()}}).prototype=w({},{unsubscribe:function unsubscribe(){var t=j(this);t.isClosed()||(t.close(),t.clean())}}),s&&x(o.prototype,"closed",{configurable:!0,get:function closed(){return j(this).isClosed()}}),(i=function(t){k(this,{type:M,subscriptionState:t}),s||(this.closed=!1)}).prototype=w({},{next:function next(t){var r,e,n=C(this).subscriptionState;if(!n.isClosed()){r=n.observer;try{(e=m(r,"next"))&&f(e,r,t)}catch(o){S(o)}}},error:function error(t){var r,e,n=C(this).subscriptionState;if(!n.isClosed()){r=n.observer,n.close();try{(e=m(r,"error"))?f(e,r,t):S(t)}catch(o){S(o)}n.clean()}},complete:function complete(){var t,r,e=C(this).subscriptionState;if(!e.isClosed()){t=e.observer,e.close();try{(r=m(t,"complete"))&&f(r,t)}catch(n){S(n)}e.clean()}}}),s&&x(i.prototype,"closed",{configurable:!0,get:function closed(){return C(this).subscriptionState.isClosed()}}),w(u=(a=function Observable(t){g(this,u),k(this,{type:O,subscriber:h(t)})}).prototype,{subscribe:function subscribe(r){var e=arguments.length;return new o(v(r)?{next:r,error:e>1?arguments[1]:t,complete:e>2?arguments[2]:t}:y(r)?r:{},P(this).subscriber)}}),b(u,I,function(){return this}),c({global:!0,constructor:!0,forced:!0},{Observable:a}),l(O)},function(t,r,e){var n=e(3),o=e(23),i=e(8),a=e(46),u=e(89),c=e(136),f=e(29),s=e(133),l=e(33)("observable");n({target:"Observable",stat:!0,forced:!0},{from:function from(t){var r,e,n=u(this)?this:o("Observable"),h=f(a(t),l);return h?(r=a(i(h,t))).constructor===n?r:new n(function(t){return r.subscribe(t)}):(e=c(t),new n(function(t){s(e,function(r,e){if(t.next(r),t.closed)return e()},{IS_ITERATOR:!0,INTERRUPTED:!0}),t.complete()}))}})},function(t,r,e){var n=e(3),o=e(23),i=e(89),a=o("Array");n({target:"Observable",stat:!0,forced:!0},{of:function of(){for(var t=i(this)?this:o("Observable"),r=arguments.length,e=a(r),n=0;n1?arguments[1]:t);return!1!==u(e,function(t){if(!n(t,t,e))return!1},!0)}})},function(r,e,n){var o=n(3),i=n(84),a=n(446),u=n(447),c=n(449),f=u.Set,s=u.add;o({target:"Set",proto:!0,real:!0,forced:!0},{filter:function filter(r){var e=a(this),n=i(r,arguments.length>1?arguments[1]:t),o=new f;return c(e,function(t){n(t,t,e)&&s(o,t)}),o}})},function(r,e,n){var o=n(3),i=n(84),a=n(446),u=n(449);o({target:"Set",proto:!0,real:!0,forced:!0},{find:function find(r){var e=a(this),n=i(r,arguments.length>1?arguments[1]:t),o=u(e,function(t){if(n(t,t,e))return{value:t}},!0);return o&&o.value}})},function(t,r,e){var n=e(3),o=e(447);n({target:"Set",stat:!0,forced:!0},{from:e(660)(o.Set,o.add,!1)})},function(t,r,e){var n=e(3),o=e(8),i=e(718),a=e(455);n({target:"Set",proto:!0,real:!0,forced:!0},{intersection:function intersection(t){return o(a,this,i(t))}})},function(t,r,e){var n=e(3),o=e(8),i=e(718),a=e(457);n({target:"Set",proto:!0,real:!0,forced:!0},{isDisjointFrom:function isDisjointFrom(t){return o(a,this,i(t))}})},function(t,r,e){var n=e(3),o=e(8),i=e(718),a=e(459);n({target:"Set",proto:!0,real:!0,forced:!0},{isSubsetOf:function isSubsetOf(t){return o(a,this,i(t))}})},function(t,r,e){var n=e(3),o=e(8),i=e(718),a=e(461);n({target:"Set",proto:!0,real:!0,forced:!0},{isSupersetOf:function isSupersetOf(t){return o(a,this,i(t))}})},function(r,e,n){var o=n(3),i=n(14),a=n(446),u=n(449),c=n(68),f=i([].join),s=i([].push);o({target:"Set",proto:!0,real:!0,forced:!0},{join:function join(r){var e=a(this),n=r===t?",":c(r),o=[];return u(e,function(t){s(o,t)}),f(o,n)}})},function(r,e,n){var o=n(3),i=n(84),a=n(446),u=n(447),c=n(449),f=u.Set,s=u.add;o({target:"Set",proto:!0,real:!0,forced:!0},{map:function map(r){var e=a(this),n=i(r,arguments.length>1?arguments[1]:t),o=new f;return c(e,function(t){s(o,n(t,t,e))}),o}})},function(t,r,e){var n=e(3),o=e(447);n({target:"Set",stat:!0,forced:!0},{of:e(671)(o.Set,o.add,!1)})},function(r,e,n){var o=n(3),i=n(30),a=n(446),u=n(449),c=TypeError;o({target:"Set",proto:!0,real:!0,forced:!0},{reduce:function reduce(r){var e=a(this),n=arguments.length<2,o=n?t:arguments[1];if(i(r),u(e,function(t){n?(n=!1,o=t):o=r(o,t,t,e)}),n)throw new c("Reduce of empty set with no initial value");return o}})},function(r,e,n){var o=n(3),i=n(84),a=n(446),u=n(449);o({target:"Set",proto:!0,real:!0,forced:!0},{some:function some(r){var e=a(this),n=i(r,arguments.length>1?arguments[1]:t);return!0===u(e,function(t){if(n(t,t,e))return!0},!0)}})},function(t,r,e){var n=e(3),o=e(8),i=e(718),a=e(463);n({target:"Set",proto:!0,real:!0,forced:!0},{symmetricDifference:function symmetricDifference(t){return o(a,this,i(t))}})},function(t,r,e){var n=e(3),o=e(8),i=e(718),a=e(466);n({target:"Set",proto:!0,real:!0,forced:!0},{union:function union(t){return o(a,this,i(t))}})},function(r,e,n){var o=n(3),i=n(469).charAt,a=n(16),u=n(61),c=n(68);o({target:"String",proto:!0,forced:!0},{at:function at(r){var e=c(a(this)),n=e.length,o=u(r),f=o>=0?o:n+o;return f<0||f>=n?t:i(e,f)}})},function(t,r,e){e(3)({target:"String",stat:!0,forced:!0},{cooked:e(737)})},function(r,e,n){var o=n(14),i=n(12),a=n(68),u=n(63),c=TypeError,f=o([].push),s=o([].join);r.exports=function cooked(r){var e,n,o,l,h=i(r),p=u(h);if(!p)return"";for(e=arguments.length,n=[],o=0;;){if((l=h[o++])===t)throw new c("Incorrect template");if(f(n,a(l)),o===p)return s(n,"");o=n.length?a(t,!0):(r=h(n,o),e.index+=r.length,a({codePoint:l(r,0),position:o},!1))});o({target:"String",proto:!0,forced:!0},{codePoints:function codePoints(){return new d(c(u(this)))}})},function(r,e,n){var o=n(290),i=n(3),a=n(48),u=n(14),c=n(94),f=n(46),s=n(39),l=n(21),h=n(63),p=n(44).f,g=n(76),v=n(740),d=n(737),y=n(741),m=n(320),b=new v.WeakMap,w=v.get,x=v.has,S=v.set,E=Array,A=TypeError,I=Object.freeze||Object,O=Object.isFrozen,R=Math.min,M=u("".charAt),T=u("".slice),k=u("".split),P=u(/./.exec),j=/([\n\u2028\u2029]|\r\n?)/g,C=RegExp("^["+m+"]*"),N=RegExp("[^"+m+"]"),D="Invalid tag",dedentStringsArray=function(t){var r,e,n,o,i,a,u,c,f,l,p,g=s(t),v=h(g),d=E(v),y=E(v),m=0;if(!v)throw new A(D);for(;m0)throw new A("Invalid opening line");r[1]=""}if(a){if(1===r.length||P(N,r[r.length-1]))throw new A("Invalid closing line");r[r.length-2]="",r[r.length-1]=""}for(u=2;u=48&&e<=57},parseHex=function(t,r,e){var n,o;if(e>=t.length)return-1;for(n=0;r=48&&t<=57?t-48:t>=97&&t<=102?t-97+10:t>=65&&t<=70?t-65+10:-1};t.exports=function(t){for(var r,e,n,o="",c=0,l=0;(l=f(t,"\\",l))>-1;){if(o+=s(t,c,l),++l===t.length)return;switch(e=u(t,l++)){case"b":o+="\b";break;case"t":o+="\t";break;case"n":o+="\n";break;case"v":o+="\x0B";break;case"f":o+="\f";break;case"r":o+="\r";break;case"\r":l1114111)return;o+=a(r);break;default:if(isDigit(e,0))return;o+=e}c=l}return o+s(t,c)}},function(t,r,e){e(79)("customMatcher")},function(t,r,e){e(3)({target:"Symbol",stat:!0},{isRegisteredSymbol:e(744)})},function(r,e,n){var o=n(23),i=n(14),a=o("Symbol"),u=a.keyFor,c=i(a.prototype.valueOf);r.exports=a.isRegisteredSymbol||function isRegisteredSymbol(r){try{return u(c(r))!==t}catch(e){return!1}}},function(t,r,e){e(3)({target:"Symbol",stat:!0,name:"isRegisteredSymbol"},{isRegistered:e(744)})},function(t,r,e){e(3)({target:"Symbol",stat:!0,forced:!0},{isWellKnownSymbol:e(747)})},function(t,r,e){var n,o,i,a,u=e(34),c=e(23),f=e(14),s=e(22),l=e(33),h=c("Symbol"),p=h.isWellKnownSymbol,g=c("Object","getOwnPropertyNames"),v=f(h.prototype.valueOf),d=u("wks");for(n=0,i=(o=g(h)).length;n1?arguments[1]:t,s=n>2?arguments[2]:t;return new(o("Promise"))(function(t){i(e),t(a(r,u,s))}).then(function(t){return c(f(e),t)})},!0)},function(r,e,n){var o=n(223),i=n(83).filterReject,a=n(539),u=o.aTypedArray;(0,o.exportTypedArrayMethod)("filterOut",function filterOut(r){var e=i(u(this),r,arguments.length>1?arguments[1]:t);return a(this,e)},!0)},function(r,e,n){var o=n(223),i=n(83).filterReject,a=n(539),u=o.aTypedArray;(0,o.exportTypedArrayMethod)("filterReject",function filterReject(r){var e=i(u(this),r,arguments.length>1?arguments[1]:t);return a(this,e)},!0)},function(r,e,n){var o=n(223),i=n(587),a=o.aTypedArray,u=o.getTypedArrayConstructor;(0,o.exportTypedArrayMethod)("groupBy",function groupBy(r){var e=arguments.length>1?arguments[1]:t;return i(a(this),r,e,u)},!0)},function(t,r,e){var n=e(223),o=e(63),i=e(524),a=e(60),u=e(525),c=e(61),f=n.aTypedArray,s=n.getTypedArrayConstructor,l=Math.max,h=Math.min;(0,n.exportTypedArrayMethod)("toSpliced",function toSpliced(t,r){var e,n,p,g,v,d,y,m,b=f(this),w=s(b),x=o(b),S=a(t,x),E=arguments.length,A=0;if(0===E)e=n=0;else if(1===E)e=0,n=x-S;else if(n=h(l(c(r),0),x-S),e=E-2)for(g=new w(e),p=i(g),m=2;m>(-2*a&6)));return e}})},function(t,r,e){var n=e(3),o=e(4),i=e(23),a=e(14),u=e(8),c=e(7),f=e(68),s=e(377),l=e(569).i2c,h=i("btoa"),p=a("".charAt),g=a("".charCodeAt),v=!!h&&!c(function(){return"aGk="!==h("hi")}),d=v&&!c(function(){h()}),y=v&&c(function(){return"bnVsbA=="!==h(null)});n({global:!0,bind:!0,enumerable:!0,forced:!v||d||y||v&&1!==h.length},{btoa:function btoa(t){var r,e,n,a,c,d;if(s(arguments.length,1),v)return u(h,o,f(t));for(r=f(t),e="",n=0,a=l;p(r,n)||(a="=",n%1);){if((d=g(r,n+=3/4))>255)throw new(i("DOMException"))("The string contains characters outside of the Latin1 range","InvalidCharacterError");e+=p(a,63&(c=c<<8|d)>>8-n%1*8)}return e}})},function(t,r,e){var n,o=e(4),i=e(779),a=e(780),u=e(164),c=e(43),handlePrototype=function(t){if(t&&t.forEach!==u)try{c(t,"forEach",u)}catch(r){t.forEach=u}};for(n in i)i[n]&&handlePrototype(o[n]&&o[n].prototype);handlePrototype(a)},function(t,r,e){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},function(r,e,n){var o=n(42)("span").classList,i=o&&o.constructor&&o.constructor.prototype;r.exports=i===Object.prototype?t:i},function(t,r,e){var n,o=e(4),i=e(779),a=e(780),u=e(172),c=e(43),f=e(82),s=e(33)("iterator"),l=u.values,handlePrototype=function(t,r){if(t){if(t[s]!==l)try{c(t,s,l)}catch(n){t[s]=l}if(f(t,r,!0),i[r])for(var e in u)if(t[e]!==u[e])try{c(t,e,u[e])}catch(n){t[e]=u[e]}}};for(n in i)handlePrototype(o[n]&&o[n].prototype,n);handlePrototype(a,"DOMTokenList")},function(r,e,n){var o,i,a,u,c,f,s,l,h,p,g=n(3),v=n(23),d=n(238),y=n(7),m=n(71),b=n(11),w=n(44).f,x=n(47),S=n(77),E=n(38),A=n(215),I=n(46),O=n(128),R=n(121),M=n(783),T=n(124),k=n(51),P=n(6),j=n(36),C="DOMException",N="DATA_CLONE_ERR",D=v("Error"),U=v(C)||function(){try{(new(v("MessageChannel")||d("worker_threads").MessageChannel)).port1.postMessage(new WeakMap)}catch(t){if(t.name===N&&25===t.code)return t.constructor}}(),_=U&&U.prototype,L=D.prototype,B=k.set,z=k.getterFor(C),W="stack"in new D(C),codeFor=function(t){return E(M,t)&&M[t].m?M[t].c:0},V=function DOMException(){var r,e,n,o,i;A(this,H),e=R((r=arguments.length)<1?t:arguments[0]),n=R(r<2?t:arguments[1],"Error"),o=codeFor(n),B(this,{type:C,name:n,message:e,code:o}),P||(this.name=n,this.message=e,this.code=o),W&&((i=new D(e)).name=C,w(this,"stack",b(1,T(i.stack,1))))},H=V.prototype=m(L),createGetterDescriptor=function(t){return{enumerable:!0,configurable:!0,get:t}},getterFor=function(t){return createGetterDescriptor(function(){return z(this)[t]})};for(s in P&&(S(H,"code",getterFor("code")),S(H,"message",getterFor("message")),S(H,"name",getterFor("name"))),w(H,"constructor",b(1,V)),i=(o=y(function(){return!(new U instanceof D)}))||y(function(){return L.toString!==O||"2: 1"!==String(new U(1,2))}),a=o||y(function(){return 25!==new U(1,"DataCloneError").code}),g({global:!0,constructor:!0,forced:u=j?i||a||o||25!==U[N]||25!==_[N]:o},{DOMException:u?V:U}),f=(c=v(C)).prototype,i&&(j||U===c)&&x(f,"toString",O),a&&P&&U===c&&S(f,"code",createGetterDescriptor(function(){return codeFor(I(this).name)})),M)E(M,s)&&(h=(l=M[s]).s,p=b(6,l.c),E(c,h)||w(c,h,p),E(f,h)||w(f,h,p))},function(t,r,e){t.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},function(r,e,n){var o,i,a,u,c,f=n(3),s=n(4),l=n(23),h=n(11),p=n(44).f,g=n(38),v=n(215),d=n(120),y=n(121),m=n(783),b=n(124),w=n(6),x=n(36),S="DOMException",E=l("Error"),A=l(S),I=function DOMException(){var r,e,n,o,i;return v(this,O),e=y((r=arguments.length)<1?t:arguments[0]),n=y(r<2?t:arguments[1],"Error"),o=new A(e,n),(i=new E(e)).name=S,p(o,"stack",h(1,b(i.stack,1))),d(o,this,I),o},O=I.prototype=A.prototype,R="stack"in new E(S),M="stack"in new A(1,2),T=A&&w&&Object.getOwnPropertyDescriptor(s,S),k=R&&!!(!T||T.writable&&T.configurable)&&!M;if(f({global:!0,constructor:!0,forced:x||k},{DOMException:k?I:A}),(i=(o=l(S)).prototype).constructor!==o)for(a in x||p(i,"constructor",h(1,o)),m)g(m,a)&&(g(o,c=(u=m[a]).s)||p(o,c,h(6,u.c)))},function(t,r,e){var n=e(23),o="DOMException";e(82)(n(o),o)},function(t,r,e){e(787),e(788)},function(t,r,e){var n=e(3),o=e(4),i=e(376).clear;n({global:!0,bind:!0,enumerable:!0,forced:o.clearImmediate!==i},{clearImmediate:i})},function(t,r,e){var n=e(3),o=e(4),i=e(376).set,a=e(789),u=o.setImmediate?a(i,!1):i;n({global:!0,bind:!0,enumerable:!0,forced:o.setImmediate!==u},{setImmediate:u})},function(t,r,e){var n,o=e(4),i=e(94),a=e(21),u=e(187),c=e(28),f=e(76),s=e(377),l=o.Function,h=/MSIE .\./.test(c)||"BUN"===u&&((n=o.Bun.version.split(".")).length<3||"0"===n[0]&&(n[1]<3||"3"===n[1]&&"0"===n[2]));t.exports=function(t,r){var e=r?2:1;return h?function(n,o){var u=s(arguments.length,1)>e,c=a(n)?n:l(n),h=u?f(arguments,e):[],p=u?function(){i(c,this,h)}:c;return r?t(p,o):t(p)}:t}},function(t,r,e){var n=e(3),o=e(4),i=e(379),a=e(30),u=e(377),c=e(7),f=e(6);n({global:!0,enumerable:!0,dontCallGetSet:!0,forced:c(function(){return f&&1!==Object.getOwnPropertyDescriptor(o,"queueMicrotask").value.length})},{queueMicrotask:function queueMicrotask(t){u(arguments.length,1),i(a(t))}})},function(t,r,e){var n,o=e(3),i=e(4),a=e(77),u=e(6),c=TypeError,f=Object.defineProperty,s=i.self!==i;try{u?(n=Object.getOwnPropertyDescriptor(i,"self"),!s&&n&&n.get&&n.enumerable||a(i,"self",{get:function self(){return i},set:function self(t){if(this!==i)throw new c("Illegal invocation");f(i,"self",{value:t,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})):o({global:!0,simple:!0,forced:s},{self:i})}catch(l){}},function(r,e,n){var o,i=n(36),a=n(3),u=n(4),c=n(23),f=n(14),s=n(7),l=n(40),h=n(21),p=n(89),g=n(17),v=n(20),d=n(22),y=n(133),m=n(46),b=n(69),w=n(38),x=n(145),S=n(43),E=n(63),A=n(377),I=n(427),O=n(293),R=n(447),M=n(449),T=n(237),k=n(125),P=n(239),j=u.Object,C=u.Array,N=u.Date,D=u.Error,U=u.TypeError,_=u.PerformanceMark,L=c("DOMException"),B=O.Map,z=O.has,W=O.get,V=O.set,H=R.Set,q=R.add,G=R.has,K=c("Object","keys"),Y=f([].push),$=f((!0).valueOf),J=f(1.1.valueOf),X=f("".valueOf),Q=f(N.prototype.getTime),Z=l("structuredClone"),tt="DataCloneError",rt="Transferring",checkBasicSemantic=function(t){return!s(function(){var r=new u.Set([7]),e=t(r),n=t(j(7));return e===r||!e.has(7)||!v(n)||7!==+n})&&t},checkErrorsCloning=function(t,r){return!s(function(){var e=new r,n=t({a:e,b:e});return!(n&&n.a===n.b&&n.a instanceof r&&n.a.stack===e.stack)})},et=u.structuredClone,nt=i||!checkErrorsCloning(et,D)||!checkErrorsCloning(et,L)||(o=et,!!s(function(){var t=o(new u.AggregateError([1],Z,{cause:3}));return"AggregateError"!==t.name||1!==t.errors[0]||t.message!==Z||3!==t.cause})),ot=!et&&checkBasicSemantic(function(t){return new _(Z,{detail:t}).detail}),it=checkBasicSemantic(et)||ot,throwUncloneable=function(t){throw new L("Uncloneable type: "+t,tt)},throwUnpolyfillable=function(t,r){throw new L((r||"Cloning")+" of "+t+" cannot be properly polyfilled in this engine",tt)},tryNativeRestrictedStructuredClone=function(t,r){return it||throwUnpolyfillable(r),it(t)},cloneBuffer=function(r,e,n){var o,i,a,c,f,s;if(z(e,r))return W(e,r);if("SharedArrayBuffer"===(n||b(r)))o=it?it(r):r;else{(s=u.DataView)||h(r.slice)||throwUnpolyfillable("ArrayBuffer");try{if(h(r.slice)&&!r.resizable)o=r.slice(0);else{i=r.byteLength,o=new ArrayBuffer(i,"maxByteLength"in r?{maxByteLength:r.maxByteLength}:t),a=new s(r),c=new s(o);for(f=0;f1&&!g(arguments[1])?m(arguments[1]):t,a=i?i.transfer:t;return a!==t&&(n=function(r,e){var n,o,i,a,c,f,s,l,g;if(!v(r))throw new U("Transfer option cannot be converted to a sequence");for(n=[],y(r,function(t){Y(n,m(t))}),o=0,i=E(n),a=new H;o?@[\\\]^|]/,nt=/[\0\t\n\r #/:<>?@[\\\]^|]/,ot=/^[\u0000-\u0020]+/,it=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,ut=/[\t\n\r]/g,ft=function(t){var r,e,n,o,i,a,u,c=W(t,".");if(c.length&&""===c[c.length-1]&&c.length--,(r=c.length)>4)return t;for(e=[],n=0;n1&&"0"===C(o,0)&&(i=N(Q,o)?16:8,o=V(o,8===i?1:2)),""===o)a=0;else{if(!N(10===i?tt:8===i?Z:rt,o))return t;a=k(o,i)}L(e,a)}for(n=0;n=j(256,5-r))return null}else if(a>255)return null;for(u=_(e),n=0;n6)return;for(n=0;chr();){if(o=null,n>0){if(!("."===chr()&&n<4))return;l++}if(!N(X,chr()))return;for(;N(X,chr());){if(i=k(chr(),10),null===o)o=i;else{if(0===o)return;o=10*o+i}if(o>255)return;l++}c[f]=256*c[f]+o,2!==++n&&4!==n||f++}if(4!==n)return;break}if(":"===chr()){if(l++,!chr())return}else if(chr())return;c[f++]=r}else{if(null!==s)return;l++,s=++f}}if(null!==s)for(a=f-s,f=7;0!==f&&a>0;)u=c[f],c[f--]=c[s+a-1],c[s+--a]=u;else if(8!==f)return;return c},lt=function(t){for(var r=null,e=1,n=null,o=0,i=0;i<8;i++)0!==t[i]?(o>e&&(r=n,e=o),n=null,o=0):(null===n&&(n=i),++o);return o>e?n:r},ht=function(t){var r,e,n,o;if("number"==typeof t){for(r=[],e=0;e<4;e++)q(r,t%256),t=P(t/256);return D(r,".")}if("object"==typeof t){for(r="",n=lt(t),e=0;e<8;e++)o&&0===t[e]||(o&&(o=!1),n===e?(r+=e?":":"::",o=!0):(r+=U(t[e],16),e<7&&(r+=":")));return"["+r+"]"}return t},gt=g({},pt={},{" ":1,'"':1,"<":1,">":1,"`":1}),vt=g({},gt,{"#":1,"?":1,"{":1,"}":1}),dt=g({},vt,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),yt=function(t,r){var e=y(t,0);return e>32&&e<127&&!p(r,t)?t:encodeURIComponent(t)},mt={ftp:21,file:null,http:80,https:443,ws:80,wss:443},bt=function(t,r){var e;return 2===t.length&&N($,C(t,0))&&(":"===(e=C(t,1))||!r&&"|"===e)},wt=function(t){var r;return t.length>1&&bt(V(t,0,2))&&(2===t.length||"/"===(r=C(t,2))||"\\"===r||"?"===r||"#"===r)},xt=function(t){return"."===t||"%2e"===H(t)},St=function(t){return".."===(t=H(t))||"%2e."===t||".%2e"===t||"%2e%2e"===t},Et={},At={},It={},Ot={},Rt={},Mt={},Tt={},kt={},Pt={},jt={},Ct={},Nt={},Dt={},Ut={},Ft={},_t={},Lt={},Bt={},zt={},Wt={},Vt={},(Ht=function(r,e,n){var o,i,a,u=b(r);if(e){if(i=this.parse(u))throw new T(i);this.searchParams=null}else{if(n!==t&&(o=new Ht(n,!0)),i=this.parse(u,null,o))throw new T(i);(a=R(new O)).bindURL(this),this.searchParams=a}}).prototype={type:"URL",parse:function(t,r,e){var n,o,i,a,u,c,f,s,l=this,h=r||Et,g=0,y="",m=!1,w=!1,x=!1;for(t=b(t),r||(l.scheme="",l.username="",l.password="",l.host=null,l.port=null,l.path=[],l.query=null,l.fragment=null,l.cannotBeABaseURL=!1,t=B(t,ot,""),t=B(t,it,"$1")),t=B(t,ut,""),n=v(t);g<=n.length;){switch(o=n[g],h){case Et:if(!o||!N($,o)){if(r)return G;h=It;continue}y+=H(o),h=At;break;case At:if(o&&(N(J,o)||"+"===o||"-"===o||"."===o))y+=H(o);else{if(":"!==o){if(r)return G;y="",h=It,g=0;continue}if(r&&(l.isSpecial()!==p(mt,y)||"file"===y&&(l.includesCredentials()||null!==l.port)||"file"===l.scheme&&!l.host))return;if(l.scheme=y,r)return void(l.isSpecial()&&mt[l.scheme]===l.port&&(l.port=null));y="","file"===l.scheme?h=Ut:l.isSpecial()&&e&&e.scheme===l.scheme?h=Ot:l.isSpecial()?h=kt:"/"===n[g+1]?(h=Rt,g++):(l.cannotBeABaseURL=!0,L(l.path,""),h=zt)}break;case It:if(!e||e.cannotBeABaseURL&&"#"!==o)return G;if(e.cannotBeABaseURL&&"#"===o){l.scheme=e.scheme,l.path=d(e.path),l.query=e.query,l.fragment="",l.cannotBeABaseURL=!0,h=Vt;break}h="file"===e.scheme?Ut:Mt;continue;case Ot:if("/"!==o||"/"!==n[g+1]){h=Mt;continue}h=Pt,g++;break;case Rt:if("/"===o){h=jt;break}h=Bt;continue;case Mt:if(l.scheme=e.scheme,o===ct)l.username=e.username,l.password=e.password,l.host=e.host,l.port=e.port,l.path=d(e.path),l.query=e.query;else if("/"===o||"\\"===o&&l.isSpecial())h=Tt;else if("?"===o)l.username=e.username,l.password=e.password,l.host=e.host,l.port=e.port,l.path=d(e.path),l.query="",h=Wt;else{if("#"!==o){l.username=e.username,l.password=e.password,l.host=e.host,l.port=e.port,l.path=d(e.path),l.path.length--,h=Bt;continue}l.username=e.username,l.password=e.password,l.host=e.host,l.port=e.port,l.path=d(e.path),l.query=e.query,l.fragment="",h=Vt}break;case Tt:if(!l.isSpecial()||"/"!==o&&"\\"!==o){if("/"!==o){l.username=e.username,l.password=e.password,l.host=e.host,l.port=e.port,h=Bt;continue}h=jt}else h=Pt;break;case kt:if(h=Pt,"/"!==o||"/"!==C(y,g+1))continue;g++;break;case Pt:if("/"!==o&&"\\"!==o){h=jt;continue}break;case jt:if("@"===o){for(m&&(y="%40"+y),m=!0,i=v(y),u=0;u65535)return Y;l.port=l.isSpecial()&&s===mt[l.scheme]?null:s,y=""}if(r)return;h=Lt;continue}return Y}y+=o;break;case Ut:if(l.scheme="file","/"===o||"\\"===o)h=Ft;else{if(!e||"file"!==e.scheme){h=Bt;continue}switch(o){case ct:l.host=e.host,l.path=d(e.path),l.query=e.query;break;case"?":l.host=e.host,l.path=d(e.path),l.query="",h=Wt;break;case"#":l.host=e.host,l.path=d(e.path),l.query=e.query,l.fragment="",h=Vt;break;default:wt(D(d(n,g),""))||(l.host=e.host,l.path=d(e.path),l.shortenPath()),h=Bt;continue}}break;case Ft:if("/"===o||"\\"===o){h=_t;break}e&&"file"===e.scheme&&!wt(D(d(n,g),""))&&(bt(e.path[0],!0)?L(l.path,e.path[0]):l.host=e.host),h=Bt;continue;case _t:if(o===ct||"/"===o||"\\"===o||"?"===o||"#"===o){if(!r&&bt(y))h=Bt;else if(""===y){if(l.host="",r)return;h=Lt}else{if(a=l.parseHost(y))return a;if("localhost"===l.host&&(l.host=""),r)return;y="",h=Lt}continue}y+=o;break;case Lt:if(l.isSpecial()){if(h=Bt,"/"!==o&&"\\"!==o)continue}else if(r||"?"!==o)if(r||"#"!==o){if(o!==ct&&(h=Bt,"/"!==o))continue}else l.fragment="",h=Vt;else l.query="",h=Wt;break;case Bt:if(o===ct||"/"===o||"\\"===o&&l.isSpecial()||!r&&("?"===o||"#"===o)){if(St(y)?(l.shortenPath(),"/"===o||"\\"===o&&l.isSpecial()||L(l.path,"")):xt(y)?"/"===o||"\\"===o&&l.isSpecial()||L(l.path,""):("file"===l.scheme&&!l.path.length&&bt(y)&&(l.host&&(l.host=""),y=C(y,0)+":"),L(l.path,y)),y="","file"===l.scheme&&(o===ct||"?"===o||"#"===o))for(;l.path.length>1&&""===l.path[0];)z(l.path);"?"===o?(l.query="",h=Wt):"#"===o&&(l.fragment="",h=Vt)}else y+=yt(o,vt);break;case zt:"?"===o?(l.query="",h=Wt):"#"===o?(l.fragment="",h=Vt):o!==ct&&(l.path[0]+=yt(o,pt));break;case Wt:r||"#"!==o?o!==ct&&("'"===o&&l.isSpecial()?l.query+="%27":l.query+="#"===o?"%23":yt(o,pt)):(l.fragment="",h=Vt);break;case Vt:o!==ct&&(l.fragment+=yt(o,gt))}g++}},parseHost:function(t){var r,e,n;if("["===C(t,0)){if("]"!==C(t,t.length-1))return K;if(!(r=st(V(t,1,-1))))return K;this.host=r}else if(this.isSpecial()){if(t=m(t),N(et,t))return K;if(null===(r=ft(t)))return K;this.host=r}else{if(N(nt,t))return K;for(r="",e=v(t),n=0;n1?arguments[1]:t,o=A(e,new Ht(r,!1,n));i||(e.href=o.serialize(),e.origin=o.getOrigin(),e.protocol=o.getProtocol(),e.username=o.getUsername(),e.password=o.getPassword(),e.host=o.getHost(),e.hostname=o.getHostname(),e.port=o.getPort(),e.pathname=o.getPathname(),e.search=o.getSearch(),e.searchParams=o.getSearchParams(),e.hash=o.getHash())},Gt=qt.prototype,Kt=function(t,r){return{get:function(){return I(this)[t]()},set:r&&function(t){return I(this)[r](t)},configurable:!0,enumerable:!0}},i&&(l(Gt,"href",Kt("serialize","setHref")),l(Gt,"origin",Kt("getOrigin")),l(Gt,"protocol",Kt("getProtocol","setProtocol")),l(Gt,"username",Kt("getUsername","setUsername")),l(Gt,"password",Kt("getPassword","setPassword")),l(Gt,"host",Kt("getHost","setHost")),l(Gt,"hostname",Kt("getHostname","setHostname")),l(Gt,"port",Kt("getPort","setPort")),l(Gt,"pathname",Kt("getPathname","setPathname")),l(Gt,"search",Kt("getSearch","setSearch")),l(Gt,"searchParams",Kt("getSearchParams")),l(Gt,"hash",Kt("getHash","setHash"))),s(Gt,"toJSON",function toJSON(){return I(this).serialize()},{enumerable:!0}),s(Gt,"toString",function toString(){return I(this).serialize()},{enumerable:!0}),M&&($t=M.revokeObjectURL,(Yt=M.createObjectURL)&&s(qt,"createObjectURL",c(Yt,M)),$t&&s(qt,"revokeObjectURL",c($t,M))),w(qt,"URL"),o({global:!0,constructor:!0,forced:!a,sham:!i},{URL:qt})},function(r,e,n){var o=n(7),i=n(33),a=n(6),u=n(36),c=i("iterator");r.exports=!o(function(){var r=new URL("b?a=1&b=2&c=3","https://a"),e=r.searchParams,n=new URLSearchParams("a=1&a=2&b=3"),o="";return r.pathname="c%20d",e.forEach(function(t,r){e["delete"]("b"),o+=r+t}),n["delete"]("a",2),n["delete"]("b",t),u&&(!r.toJSON||!n.has("a",1)||n.has("a",2)||!n.has("a",t)||n.has("b"))||!e.size&&(u||!a)||!e.sort||"https://a/c%20d?a=1&c=3"!==r.href||"3"!==e.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!e[c]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("https://тест").host||"#%D0%B1"!==new URL("https://a#б").hash||"a1c3"!==o||"x"!==new URL("https://x",t).host})},function(t,r,e){var n=e(14),o=2147483647,i=/[^\0-\u007E]/,a=/[.\u3002\uFF0E\uFF61]/g,u="Overflow: input needs wider integers to process",c=RangeError,f=n(a.exec),s=Math.floor,l=String.fromCharCode,h=n("".charCodeAt),p=n([].join),g=n([].push),v=n("".replace),d=n("".split),y=n("".toLowerCase),digitToBasic=function(t){return t+22+75*(t<26)},adapt=function(t,r,e){var n=0;for(t=e?s(t/700):t>>1,t+=s(t/r);t>455;)t=s(t/35),n+=36;return s(n+36*t/(t+38))},encode=function(t){var r,e,n,i,a,f,v,d,y,m,b,w,x,S,E,A=[];for(r=(t=function(t){for(var r,e,n=[],o=0,i=t.length;o=55296&&r<=56319&&o=e&&fs((o-n)/(m=d+1)))throw new c(u);for(n+=(y-e)*m,e=y,a=0;ao)throw new c(u);if(f===e){for(b=n,w=36;!(b<(x=w<=i?1:w>=i+26?26:w-i));)g(A,l(digitToBasic(x+(S=b-x)%(E=36-x)))),b=s(S/E),w+=36;g(A,l(digitToBasic(b))),i=adapt(n,m,d===v),n=0,d++}}n++,e++}return p(A,"")};t.exports=function(t){var r,e,n=[],o=d(v(y(t),a,"."),".");for(r=0;r0&&0!==(t&r);r>>=1)e++;return e},lt=function(t){var r=null;switch(t.length){case 1:r=t[0];break;case 2:r=(31&t[0])<<6|63&t[1];break;case 3:r=(15&t[0])<<12|(63&t[1])<<6|63&t[2];break;case 4:r=(7&t[0])<<18|(63&t[1])<<12|(63&t[2])<<6|63&t[3]}return r>1114111?null:r},ht=function(t){var r,e,n,o,i,a,u,c,f,s;for(r=(t=tt(t,ut," ")).length,e="",n=0;nr){e+="%",n++;continue}if((i=ft(t,n+1))!=i){e+=o,n++;continue}if(n+=2,0===(a=st(i)))o=Y(i);else{if(1===a||a>4){e+="�",n++;continue}for(u=[i],c=1;cr||"%"!==X(t,n));){if((f=ft(t,n+1))!=f){n+=3;break}if(f>191||f<128)break;Z(u,f),n+=2,c++}if(u.length!==a){e+="�";continue}null===(s=lt(u))?e+="�":o=$(s)}}e+=o,n++}return e},pt=/[!'()~]|%20/g,gt={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},vt=function(t){return gt[t]},dt=function(t){return tt(K(t),pt,vt)},yt=d(function Iterator(t,r){_(this,{type:U,target:L(t).entries,index:0,kind:r})},D,function next(){var r,e=B(this),n=e.target,o=e.index++;if(!n||o>=n.length)return e.target=null,k(t,!0);switch(r=n[o],e.kind){case"keys":return k(r.key,!1);case"values":return k(r.value,!1)}return k([r.key,r.value],!1)},!0),(mt=function(r){this.entries=[],this.url=null,r!==t&&(A(r)?this.parseObject(r):this.parseQuery("string"==typeof r?"?"===X(r,0)?ot(r,1):r:I(r)))}).prototype={type:D,bindURL:function(t){this.url=t,this.update()},parseObject:function(t){var r,e,n,o,i,a,u,f,s=this.entries,l=T(t);if(l)for(e=(r=M(t,l)).next;!(n=c(e,r)).done;){if(o=M(E(n.value)),(a=c(i=o.next,o)).done||(u=c(i,o)).done||!c(i,o).done)throw new G("Expected sequence with length 2");Z(s,{key:I(a.value),value:I(u.value)})}else for(f in t)w(t,f)&&Z(s,{key:f,value:I(t[f])})},parseQuery:function(t){var r,e,n,o,i;if(t)for(r=this.entries,e=nt(t,"&"),n=0;n0?arguments[0]:t)),s||(this.size=r.entries.length)},g(wt=bt.prototype,{append:function append(t,r){var e=L(this);P(arguments.length,2),Z(e.entries,{key:I(t),value:I(r)}),s||this.length++,e.updateURL()},"delete":function(r){for(var e,n=L(this),o=P(arguments.length,1),i=n.entries,a=I(r),u=o<2?t:arguments[1],c=u===t?u:I(u),f=0;fr.key?1:-1}),t.updateURL()},forEach:function forEach(r){for(var e,n=L(this).entries,o=x(r,arguments.length>1?arguments[1]:t),i=0;i1?Et(arguments[1]):{})}}),b(W)&&(At=function Request(t){return m(this,H),new W(t,arguments.length>1?Et(arguments[1]):{})},H.constructor=At,At.prototype=H,o({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:At}))),r.exports={URLSearchParams:bt,getState:L}},function(r,e,n){var o=n(3),i=n(23),a=n(7),u=n(377),c=n(68),f=n(798),s=i("URL"),l=f&&a(function(){s.canParse()}),h=a(function(){return 1!==s.canParse.length});o({target:"URL",stat:!0,forced:!l||h},{canParse:function canParse(r){var e=u(arguments.length,1),n=c(r),o=e<2||arguments[1]===t?t:c(arguments[1]);try{return!!new s(n,o)}catch(i){return!1}}})},function(r,e,n){var o=n(3),i=n(23),a=n(377),u=n(68),c=n(798),f=i("URL");o({target:"URL",stat:!0,forced:!c},{parse:function parse(r){var e=a(arguments.length,1),n=u(r),o=e<2||arguments[1]===t?t:u(arguments[1]);try{return new f(n,o)}catch(i){return null}}})},function(t,r,e){var n=e(3),o=e(8);n({target:"URL",proto:!0,enumerable:!0},{toJSON:function toJSON(){return o(URL.prototype.toString,this)}})},function(t,r,e){e(800)},function(r,e,n){var o=n(47),i=n(14),a=n(68),u=n(377),c=URLSearchParams,f=c.prototype,s=i(f.append),l=i(f["delete"]),h=i(f.forEach),p=i([].push),g=new c("a=1&a=2&b=3");g["delete"]("a",1),g["delete"]("b",t),g+""!="a=2"&&o(f,"delete",function(r){var e,n,o,i,c,f,g,v,d=arguments.length,y=d<2?t:arguments[1];if(d&&y===t)return l(this,r);for(e=[],h(this,function(t,r){p(e,{key:r,value:t})}),u(d,1),n=a(r),o=a(y),i=0,c=0,f=!1,g=e.length;i result for the + // current iteration. + result.value = unwrapped; + resolve(result); + }, function(error) { + // If a rejected Promise was yielded, throw the rejection back + // into the async generator function so it can be handled there. + return invoke("throw", error, resolve, reject); + }); + } + } + + var previousPromise; + + function enqueue(method, arg) { + function callInvokeWithMethodAndArg() { + return new PromiseImpl(function(resolve, reject) { + invoke(method, arg, resolve, reject); + }); + } + + return previousPromise = + // If enqueue has been called before, then we want to wait until + // all previous Promises have been resolved before calling invoke, + // so that results are always delivered in the correct order. If + // enqueue has not been called before, then it is important to + // call invoke immediately, without waiting on a callback to fire, + // so that the async generator function has the opportunity to do + // any necessary setup in a predictable way. This predictability + // is why the Promise constructor synchronously invokes its + // executor callback, and why async functions synchronously + // execute code before the first await. Since we implement simple + // async functions in terms of async generators, it is especially + // important to get this right, even though it requires care. + previousPromise ? previousPromise.then( + callInvokeWithMethodAndArg, + // Avoid propagating failures to Promises returned by later + // invocations of the iterator. + callInvokeWithMethodAndArg + ) : callInvokeWithMethodAndArg(); + } + + // Define the unified helper method that is used to implement .next, + // .throw, and .return (see defineIteratorMethods). + defineProperty(this, "_invoke", { value: enqueue }); + } + + defineIteratorMethods(AsyncIterator.prototype); + define(AsyncIterator.prototype, asyncIteratorSymbol, function () { + return this; + }); + exports.AsyncIterator = AsyncIterator; + + // Note that simple async functions are implemented on top of + // AsyncIterator objects; they just return a Promise for the value of + // the final result produced by the iterator. + exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) { + if (PromiseImpl === void 0) PromiseImpl = Promise; + + var iter = new AsyncIterator( + wrap(innerFn, outerFn, self, tryLocsList), + PromiseImpl + ); + + return exports.isGeneratorFunction(outerFn) + ? iter // If outerFn is a generator, return the full iterator. + : iter.next().then(function(result) { + return result.done ? result.value : iter.next(); + }); + }; + + function makeInvokeMethod(innerFn, self, context) { + var state = GenStateSuspendedStart; + + return function invoke(method, arg) { + if (state === GenStateExecuting) { + throw new Error("Generator is already running"); + } + + if (state === GenStateCompleted) { + if (method === "throw") { + throw arg; + } + + // Be forgiving, per 25.3.3.3.3 of the spec: + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume + return doneResult(); + } + + context.method = method; + context.arg = arg; + + while (true) { + var delegate = context.delegate; + if (delegate) { + var delegateResult = maybeInvokeDelegate(delegate, context); + if (delegateResult) { + if (delegateResult === ContinueSentinel) continue; + return delegateResult; + } + } + + if (context.method === "next") { + // Setting context._sent for legacy support of Babel's + // function.sent implementation. + context.sent = context._sent = context.arg; + + } else if (context.method === "throw") { + if (state === GenStateSuspendedStart) { + state = GenStateCompleted; + throw context.arg; + } + + context.dispatchException(context.arg); + + } else if (context.method === "return") { + context.abrupt("return", context.arg); + } + + state = GenStateExecuting; + + var record = tryCatch(innerFn, self, context); + if (record.type === "normal") { + // If an exception is thrown from innerFn, we leave state === + // GenStateExecuting and loop back for another invocation. + state = context.done + ? GenStateCompleted + : GenStateSuspendedYield; + + if (record.arg === ContinueSentinel) { + continue; + } + + return { + value: record.arg, + done: context.done + }; + + } else if (record.type === "throw") { + state = GenStateCompleted; + // Dispatch the exception by looping back around to the + // context.dispatchException(context.arg) call above. + context.method = "throw"; + context.arg = record.arg; + } + } + }; + } + + // Call delegate.iterator[context.method](context.arg) and handle the + // result, either by returning a { value, done } result from the + // delegate iterator, or by modifying context.method and context.arg, + // setting context.delegate to null, and returning the ContinueSentinel. + function maybeInvokeDelegate(delegate, context) { + var methodName = context.method; + var method = delegate.iterator[methodName]; + if (method === undefined) { + // A .throw or .return when the delegate iterator has no .throw + // method, or a missing .next mehtod, always terminate the + // yield* loop. + context.delegate = null; + + // Note: ["return"] must be used for ES3 parsing compatibility. + if (methodName === "throw" && delegate.iterator["return"]) { + // If the delegate iterator has a return method, give it a + // chance to clean up. + context.method = "return"; + context.arg = undefined; + maybeInvokeDelegate(delegate, context); + + if (context.method === "throw") { + // If maybeInvokeDelegate(context) changed context.method from + // "return" to "throw", let that override the TypeError below. + return ContinueSentinel; + } + } + if (methodName !== "return") { + context.method = "throw"; + context.arg = new TypeError( + "The iterator does not provide a '" + methodName + "' method"); + } + + return ContinueSentinel; + } + + var record = tryCatch(method, delegate.iterator, context.arg); + + if (record.type === "throw") { + context.method = "throw"; + context.arg = record.arg; + context.delegate = null; + return ContinueSentinel; + } + + var info = record.arg; + + if (! info) { + context.method = "throw"; + context.arg = new TypeError("iterator result is not an object"); + context.delegate = null; + return ContinueSentinel; + } + + if (info.done) { + // Assign the result of the finished delegate to the temporary + // variable specified by delegate.resultName (see delegateYield). + context[delegate.resultName] = info.value; + + // Resume execution at the desired location (see delegateYield). + context.next = delegate.nextLoc; + + // If context.method was "throw" but the delegate handled the + // exception, let the outer generator proceed normally. If + // context.method was "next", forget context.arg since it has been + // "consumed" by the delegate iterator. If context.method was + // "return", allow the original .return call to continue in the + // outer generator. + if (context.method !== "return") { + context.method = "next"; + context.arg = undefined; + } + + } else { + // Re-yield the result returned by the delegate method. + return info; + } + + // The delegate iterator is finished, so forget it and continue with + // the outer generator. + context.delegate = null; + return ContinueSentinel; + } + + // Define Generator.prototype.{next,throw,return} in terms of the + // unified ._invoke helper method. + defineIteratorMethods(Gp); + + define(Gp, toStringTagSymbol, "Generator"); + + // A Generator should always return itself as the iterator object when the + // @@iterator function is called on it. Some browsers' implementations of the + // iterator prototype chain incorrectly implement this, causing the Generator + // object to not be returned from this call. This ensures that doesn't happen. + // See https://github.com/facebook/regenerator/issues/274 for more details. + define(Gp, iteratorSymbol, function() { + return this; + }); + + define(Gp, "toString", function() { + return "[object Generator]"; + }); + + function pushTryEntry(locs) { + var entry = { tryLoc: locs[0] }; + + if (1 in locs) { + entry.catchLoc = locs[1]; + } + + if (2 in locs) { + entry.finallyLoc = locs[2]; + entry.afterLoc = locs[3]; + } + + this.tryEntries.push(entry); + } + + function resetTryEntry(entry) { + var record = entry.completion || {}; + record.type = "normal"; + delete record.arg; + entry.completion = record; + } + + function Context(tryLocsList) { + // The root entry object (effectively a try statement without a catch + // or a finally block) gives us a place to store values thrown from + // locations where there is no enclosing try statement. + this.tryEntries = [{ tryLoc: "root" }]; + tryLocsList.forEach(pushTryEntry, this); + this.reset(true); + } + + exports.keys = function(val) { + var object = Object(val); + var keys = []; + for (var key in object) { + keys.push(key); + } + keys.reverse(); + + // Rather than returning an object with a next method, we keep + // things simple and return the next function itself. + return function next() { + while (keys.length) { + var key = keys.pop(); + if (key in object) { + next.value = key; + next.done = false; + return next; + } + } + + // To avoid creating an additional object, we just hang the .value + // and .done properties off the next function object itself. This + // also ensures that the minifier will not anonymize the function. + next.done = true; + return next; + }; + }; + + function values(iterable) { + if (iterable) { + var iteratorMethod = iterable[iteratorSymbol]; + if (iteratorMethod) { + return iteratorMethod.call(iterable); + } + + if (typeof iterable.next === "function") { + return iterable; + } + + if (!isNaN(iterable.length)) { + var i = -1, next = function next() { + while (++i < iterable.length) { + if (hasOwn.call(iterable, i)) { + next.value = iterable[i]; + next.done = false; + return next; + } + } + + next.value = undefined; + next.done = true; + + return next; + }; + + return next.next = next; + } + } + + // Return an iterator with no values. + return { next: doneResult }; + } + exports.values = values; + + function doneResult() { + return { value: undefined, done: true }; + } + + Context.prototype = { + constructor: Context, + + reset: function(skipTempReset) { + this.prev = 0; + this.next = 0; + // Resetting context._sent for legacy support of Babel's + // function.sent implementation. + this.sent = this._sent = undefined; + this.done = false; + this.delegate = null; + + this.method = "next"; + this.arg = undefined; + + this.tryEntries.forEach(resetTryEntry); + + if (!skipTempReset) { + for (var name in this) { + // Not sure about the optimal order of these conditions: + if (name.charAt(0) === "t" && + hasOwn.call(this, name) && + !isNaN(+name.slice(1))) { + this[name] = undefined; + } + } + } + }, + + stop: function() { + this.done = true; + + var rootEntry = this.tryEntries[0]; + var rootRecord = rootEntry.completion; + if (rootRecord.type === "throw") { + throw rootRecord.arg; + } + + return this.rval; + }, + + dispatchException: function(exception) { + if (this.done) { + throw exception; + } + + var context = this; + function handle(loc, caught) { + record.type = "throw"; + record.arg = exception; + context.next = loc; + + if (caught) { + // If the dispatched exception was caught by a catch block, + // then let that catch block handle the exception normally. + context.method = "next"; + context.arg = undefined; + } + + return !! caught; + } + + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + var record = entry.completion; + + if (entry.tryLoc === "root") { + // Exception thrown outside of any try block that could handle + // it, so set the completion value of the entire function to + // throw the exception. + return handle("end"); + } + + if (entry.tryLoc <= this.prev) { + var hasCatch = hasOwn.call(entry, "catchLoc"); + var hasFinally = hasOwn.call(entry, "finallyLoc"); + + if (hasCatch && hasFinally) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } else if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + + } else if (hasCatch) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } + + } else if (hasFinally) { + if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + + } else { + throw new Error("try statement without catch or finally"); + } + } + } + }, + + abrupt: function(type, arg) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc <= this.prev && + hasOwn.call(entry, "finallyLoc") && + this.prev < entry.finallyLoc) { + var finallyEntry = entry; + break; + } + } + + if (finallyEntry && + (type === "break" || + type === "continue") && + finallyEntry.tryLoc <= arg && + arg <= finallyEntry.finallyLoc) { + // Ignore the finally entry if control is not jumping to a + // location outside the try/catch block. + finallyEntry = null; + } + + var record = finallyEntry ? finallyEntry.completion : {}; + record.type = type; + record.arg = arg; + + if (finallyEntry) { + this.method = "next"; + this.next = finallyEntry.finallyLoc; + return ContinueSentinel; + } + + return this.complete(record); + }, + + complete: function(record, afterLoc) { + if (record.type === "throw") { + throw record.arg; + } + + if (record.type === "break" || + record.type === "continue") { + this.next = record.arg; + } else if (record.type === "return") { + this.rval = this.arg = record.arg; + this.method = "return"; + this.next = "end"; + } else if (record.type === "normal" && afterLoc) { + this.next = afterLoc; + } + + return ContinueSentinel; + }, + + finish: function(finallyLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.finallyLoc === finallyLoc) { + this.complete(entry.completion, entry.afterLoc); + resetTryEntry(entry); + return ContinueSentinel; + } + } + }, + + "catch": function(tryLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc === tryLoc) { + var record = entry.completion; + if (record.type === "throw") { + var thrown = record.arg; + resetTryEntry(entry); + } + return thrown; + } + } + + // The context.catch method must only be called with a location + // argument that corresponds to a known catch block. + throw new Error("illegal catch attempt"); + }, + + delegateYield: function(iterable, resultName, nextLoc) { + this.delegate = { + iterator: values(iterable), + resultName: resultName, + nextLoc: nextLoc + }; + + if (this.method === "next") { + // Deliberately forget the last sent value so that we don't + // accidentally pass it on to the delegate. + this.arg = undefined; + } + + return ContinueSentinel; + } + }; + + // Regardless of whether this script is executing as a CommonJS module + // or not, return the runtime object so that we can declare the variable + // regeneratorRuntime in the outer scope, which allows this module to be + // injected easily by `bin/regenerator --include-runtime script.js`. + return exports; + +}( + // If this script is executing as a CommonJS module, use module.exports + // as the regeneratorRuntime namespace. Otherwise create a new empty + // object. Either way, the resulting object will be used to initialize + // the regeneratorRuntime variable at the top of this file. + typeof module === "object" ? module.exports : {} +)); + +try { + regeneratorRuntime = runtime; +} catch (accidentalStrictMode) { + // This module should not be running in strict mode, so the above + // assignment should always work unless something is misconfigured. Just + // in case runtime.js accidentally runs in strict mode, in modern engines + // we can explicitly access globalThis. In older engines we can escape + // strict mode using a global Function call. This could conceivably fail + // if a Content Security Policy forbids using Function, but in that case + // the proper solution is to fix the accidental strict mode problem. If + // you've misconfigured your bundler to force strict mode and applied a + // CSP to forbid Function, and you're not willing to fix either of those + // problems, please detail your unique predicament in a GitHub issue. + if (typeof globalThis === "object") { + globalThis.regeneratorRuntime = runtime; + } else { + Function("r", "regeneratorRuntime = r")(runtime); + } +} diff --git a/workflow/build-polyfills.js b/workflow/build-polyfills.js new file mode 100644 index 000000000..b8d9671e9 --- /dev/null +++ b/workflow/build-polyfills.js @@ -0,0 +1,43 @@ +/** + * 构建预览用的 polyfills bundle + * + * 包含: + * - core-js-bundle (ES 标准 API 垫片) + * - regenerator-runtime (async/await 支持) + * + * 输出到 static/web/polyfills.bundle.js + */ +const path = require('path'); +const fs = require('fs-extra'); + +const outDir = path.join(__dirname, '..', 'static', 'web'); +fs.ensureDirSync(outDir); + +const outFile = path.join(outDir, 'polyfills.bundle.js'); + +console.log('📦 Building polyfills bundle...'); + +// 1. core-js-bundle (prebuilt) +const coreJsPath = path.join(require.resolve('core-js-bundle/package.json'), '..', 'minified.js'); +const coreJsCode = fs.readFileSync(coreJsPath, 'utf8'); +console.log(` ✅ core-js-bundle: ${(coreJsCode.length / 1024).toFixed(1)} KB`); + +// 2. regenerator-runtime +const regeneratorPath = require.resolve('regenerator-runtime/runtime'); +const regeneratorCode = fs.readFileSync(regeneratorPath, 'utf8'); +console.log(` ✅ regenerator-runtime: ${(regeneratorCode.length / 1024).toFixed(1)} KB`); + +// 3. Bundle together +const bundle = [ + '// Polyfills bundle for browser preview', + '// Generated by workflow/build-polyfills.js', + '// Includes: core-js (ES API polyfills) + regenerator-runtime (async/await)', + '', + coreJsCode, + '', + regeneratorCode, +].join('\n'); + +fs.writeFileSync(outFile, bundle, 'utf8'); +console.log(`\n✅ Polyfills bundle → ${outFile}`); +console.log(` Total: ${(bundle.length / 1024).toFixed(1)} KB`); diff --git a/workflow/build-scene-bundle.js b/workflow/build-scene-bundle.js new file mode 100644 index 000000000..7f3f0df83 --- /dev/null +++ b/workflow/build-scene-bundle.js @@ -0,0 +1,383 @@ +const { rollup } = require('rollup'); +const commonjs = require('@rollup/plugin-commonjs'); +const { nodeResolve } = require('@rollup/plugin-node-resolve'); +const virtual = require('@rollup/plugin-virtual'); +const json = require('@rollup/plugin-json'); +const path = require('path'); + +async function buildSceneBundle() { + const workspaceDir = path.join(__dirname, '..'); + const sceneProcessDir = path.join(workspaceDir, 'dist', 'core', 'scene', 'scene-process').replace(/\\/g, '/'); + const bridgeFile = path.join(sceneProcessDir, 'engine-bootstrap.js').replace(/\\/g, '/'); + + console.log('[Build] Bundling scene services for preview...'); + + const bundle = await rollup({ + input: 'entry', + external: (id) => { + if (id === 'cc') return true; + return false; + }, + plugins: [ + json(), + virtual({ + entry: ` + import * as Bridge from '${bridgeFile}'; + const { startup, serviceManager, EditorExtends, Service } = Bridge; + export { startup, serviceManager, EditorExtends, Service }; + ` + }), + { + name: 'smart-node-builtins', + resolveId(id) { + const stubs = [ + 'fs', 'node:fs', 'fs-extra', 'graceful-fs', 'lodash', 'package.json', '@cocos/asset-db', + 'constants', 'stream', 'assert', 'crypto', 'child_process', 'vm', 'buffer', + 'tty', 'zlib', 'http', 'https', 'net', 'tls', 'dns', 'readline', 'punycode', + 'cc/mods-mgr', 'inherits', 'sys', 'url', 'process', 'proper-lockfile' + ]; + if (stubs.includes(id)) { + return '\0smart-' + id; + } + if (['cc/preload', 'cc/editor/populate-internal-constants', 'cc/env', 'cce.env'].includes(id)) { + return '\0alias-cc-' + id; + } + if (id === 'cc/editor/serialization') { + return '\0alias-cc-editor-serialization'; + } + + const polyfills = { + events: path.join(workspaceDir, 'node_modules', 'events', 'events.js'), + path: path.join(workspaceDir, 'node_modules', 'path-browserify', 'index.js'), + util: path.join(workspaceDir, 'node_modules', 'util', 'util.js'), + os: path.join(workspaceDir, 'node_modules', 'os-browserify', 'main.js'), + 'reflect-metadata': path.join(workspaceDir, 'node_modules', 'reflect-metadata', 'Reflect.js') + }; + if (polyfills[id]) { + return polyfills[id]; + } + + if (id.endsWith('/package.json')) { + return '\0smart-' + id; + } + return null; + }, + load(id) { + if (id.startsWith('\0smart-')) { + const originalId = id.substring('\0smart-'.length); + // graceful-fs patches the fs object it receives — give it a plain + // mutable object so assignment to its properties doesn't throw. + if (originalId === 'graceful-fs') { + return ` + // graceful-fs stub: plain writable object so monkey-patching works + var _gfs = { + existsSync: function() { return false; }, + readFileSync: function() { return ''; }, + writeFileSync: function() {}, + statSync: function() { return { isFile: function() { return false; }, isDirectory: function() { return false; }, mtime: new Date(0) }; }, + stat: function(p, cb) { cb && cb(null, { isFile: function() { return false; }, isDirectory: function() { return false; }, mtime: new Date(0) }); }, + lstat: function(p, cb) { cb && cb(null, { isFile: function() { return false; }, isDirectory: function() { return false; }, mtime: new Date(0) }); }, + lstatSync: function() { return { isFile: function() { return false; }, isDirectory: function() { return false; }, mtime: new Date(0) }; }, + readdir: function(p, cb) { cb && cb(null, []); }, + readdirSync: function() { return []; }, + mkdir: function(p, o, cb) { var fn = typeof o === 'function' ? o : cb; fn && fn(null); }, + mkdirSync: function() {}, + rmdir: function(p, o, cb) { var fn = typeof o === 'function' ? o : cb; fn && fn(null); }, + rmdirSync: function() {}, + realpath: function(p, o, cb) { var fn = typeof o === 'function' ? o : cb; fn && fn(null, p); }, + realpathSync: function(p) { return p; }, + utimes: function(p, a, m, cb) { cb && cb(null); }, + utimesSync: function() {}, + open: function(p, f, m, cb) { var fn = typeof f === 'function' ? f : (typeof m === 'function' ? m : cb); fn && fn(new Error('ENOENT')); }, + close: function(fd, cb) { cb && cb(null); }, + read: function(fd, buf, off, len, pos, cb) { cb && cb(null, 0); }, + write: function(fd, buf, off, len, pos, cb) { cb && cb(null, 0); }, + readJSON: async function() { return { chunks: {}, entries: {} }; }, + readJson: async function() { return { chunks: {}, entries: {} }; }, + }; + export default _gfs; + export var existsSync = _gfs.existsSync; + export var readFileSync = _gfs.readFileSync; + export var writeFileSync = _gfs.writeFileSync; + export var statSync = _gfs.statSync; + export var stat = _gfs.stat; + export var lstat = _gfs.lstat; + export var lstatSync = _gfs.lstatSync; + export var readdir = _gfs.readdir; + export var readdirSync = _gfs.readdirSync; + export var mkdir = _gfs.mkdir; + export var mkdirSync = _gfs.mkdirSync; + export var rmdir = _gfs.rmdir; + export var rmdirSync = _gfs.rmdirSync; + export var realpath = _gfs.realpath; + export var realpathSync = _gfs.realpathSync; + export var utimes = _gfs.utimes; + export var utimesSync = _gfs.utimesSync; + export var open = _gfs.open; + export var close = _gfs.close; + export var read = _gfs.read; + export var write = _gfs.write; + export var readJSON = _gfs.readJSON; + export var readJson = _gfs.readJson; + `; + } + if (originalId === 'proper-lockfile') { + return ` + const _lockfile = { + lock: async () => (async () => {}), + unlock: async () => {}, + check: async () => false + }; + export default _lockfile; + export const lock = _lockfile.lock; + export const unlock = _lockfile.unlock; + export const check = _lockfile.check; + `; + } + if (originalId === 'process') { + return ` + const _process = { + cwd: () => '/', + platform: 'browser', + nextTick: (fn, ...args) => setTimeout(() => fn(...args), 0), + env: {}, + versions: { node: '16.0.0' }, + stdout: { write: () => {} }, + stderr: { write: () => {} }, + binding: () => ({}), + on: () => {}, + once: () => {}, + removeListener: () => {}, + emit: () => {}, + }; + if (typeof window !== 'undefined' && !window.process) { + window.process = _process; + } + export default _process; + export const cwd = _process.cwd; + export const platform = _process.platform; + export const nextTick = _process.nextTick; + export const env = _process.env; + export const versions = _process.versions; + `; + } + if (originalId === 'url') { + const urlPolyfillPath = path.join(workspaceDir, 'node_modules', 'url', 'url.js').replace(/\\/g, '/'); + return ` + import * as _url from '${urlPolyfillPath}'; + export const URL = _url.URL || window.URL; + export const URLSearchParams = _url.URLSearchParams || window.URLSearchParams; + export const parse = _url.parse; + export const format = _url.format; + export const resolve = _url.resolve; + + export function pathToFileURL(p) { + let resolved = p.replace(/\\\\/g, '/'); + // Handle Windows drive letters: D:/... -> /D:/... + if (resolved.match(/^[a-zA-Z]:/)) resolved = '/' + resolved; + if (!resolved.startsWith('/')) resolved = '/' + resolved; + return new URL('file://' + encodeURI(resolved).replace(/#/g, '%23').replace(/\\?/g, '%3F')); + } + + export function fileURLToPath(u) { + if (typeof u === 'string') u = new URL(u); + if (u.protocol !== 'file:') return u.href; + let p = decodeURIComponent(u.pathname); + if (p.match(/^\\/[a-zA-Z]:/)) { + p = p.substring(1).replace(/\\//g, '\\\\'); + } + return p; + } + + export default { + ..._url, + URL, + URLSearchParams, + pathToFileURL, + fileURLToPath + }; + `; + } + return ` + let realMod = {}; + const isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined'; + const isNode = typeof process !== 'undefined' && process.versions && process.versions.node; + // Allow explicit override via global flag + const useRealNode = (isNode && !isBrowser && globalThis.__ENABLE_NODE_BUILTINS__ !== false) || globalThis.__ENABLE_NODE_BUILTINS__ === true; + + if (useRealNode) { + // Dynamic require to hide it from static analysis + const req = typeof require !== 'undefined' ? require : (typeof _cc_require !== 'undefined' ? _cc_require : null); + if (req) { + try { + const modName = '${originalId.startsWith('node:') ? originalId.substring(5) : originalId}'; + realMod = req(modName); + } catch(e) { + console.warn('Smart polyfill: failed to require ${originalId}'); + } + } + } + + export const existsSync = realMod.existsSync || function() { return false; }; + export const readFileSync = realMod.readFileSync || function() { return ''; }; + export const writeFileSync = realMod.writeFileSync || function() {}; + export const remove = realMod.remove || async function() {}; + export const readJSON = realMod.readJSON || async function() { return { chunks: {}, entries: {} }; }; + export const readJson = realMod.readJson || async function() { return { chunks: {}, entries: {} }; }; + export const statSync = realMod.statSync || function() { return { isFile: () => false, isDirectory: () => false, mtime: new Date(0) }; }; + export const stat = realMod.stat || function(p, cb) { cb && cb(null, { isFile: () => false, isDirectory: () => false, mtime: new Date(0) }); }; + export const lstat = realMod.lstat || function(p, cb) { cb && cb(null, { isFile: () => false, isDirectory: () => false, mtime: new Date(0) }); }; + export const lstatSync = realMod.lstatSync || function() { return { isFile: () => false, isDirectory: () => false, mtime: new Date(0) }; }; + export const mkdir = realMod.mkdir || function(p, o, cb) { var fn = typeof o === 'function' ? o : cb; fn && fn(null); }; + export const mkdirSync = realMod.mkdirSync || function() {}; + export const rmdir = realMod.rmdir || function(p, o, cb) { var fn = typeof o === 'function' ? o : cb; fn && fn(null); }; + export const rmdirSync = realMod.rmdirSync || function() {}; + export const realpath = realMod.realpath || function(p, o, cb) { + var fn = typeof o === 'function' ? o : cb; + if (typeof fn === 'function') fn(null, p); + }; + export const realpathSync = realMod.realpathSync || function(p) { return p; }; + export const utimes = realMod.utimes || function(p, a, m, cb) { cb && cb(null); }; + export const utimesSync = realMod.utimesSync || function() {}; + + export default new Proxy({}, { + get(target, prop) { + if (prop === 'existsSync') return existsSync; + if (prop === 'readFileSync') return readFileSync; + if (prop === 'writeFileSync') return writeFileSync; + if (prop === 'remove') return remove; + if (prop === 'readJSON') return readJSON; + if (prop === 'readJson') return readJson; + if (prop === 'statSync') return statSync; + if (prop === 'stat') return stat; + if (prop === 'lstat') return lstat; + if (prop === 'lstatSync') return lstatSync; + if (prop === 'mkdir') return mkdir; + if (prop === 'mkdirSync') return mkdirSync; + if (prop === 'rmdir') return rmdir; + if (prop === 'rmdirSync') return rmdirSync; + if (prop === 'realpath') return realpath; + if (prop === 'realpathSync') return realpathSync; + if (prop === 'utimes') return utimes; + if (prop === 'utimesSync') return utimesSync; + + if (realMod && prop in realMod) { + return realMod[prop]; + } + + // Fallback for missing methods + if (typeof prop === 'string') { + return function() {}; + } + return undefined; + } + }); + `; + } + if (id === '\0alias-cc-editor-serialization') { + return [ + `import * as cc from 'cc';`, + `function _getInternal() {`, + ` return (cc && cc.internal) || (typeof globalThis !== 'undefined' && globalThis.cc && globalThis.cc.internal) || {};`, + `}`, + `export const BufferBuilder = new Proxy(function() {}, {`, + ` construct(target, args) {`, + ` const C = _getInternal().BufferBuilder;`, + ` if (!C) throw new Error('cc.internal.BufferBuilder is not available. Please ensure engine is correctly compiled.');`, + ` return new C(...args);`, + ` },`, + ` get(target, prop) {`, + ` const C = _getInternal().BufferBuilder;`, + ` return C ? C[prop] : target[prop];`, + ` }`, + `});`, + `export const CCON = new Proxy(function() {}, {`, + ` construct(target, args) {`, + ` const C = _getInternal().CCON;`, + ` if (!C) throw new Error('cc.internal.CCON is not available.');`, + ` return new C(...args);`, + ` },`, + ` get(target, prop) {`, + ` const C = _getInternal().CCON;`, + ` return C ? C[prop] : target[prop];`, + ` }`, + `});`, + `export function encodeCCONBinary(...args) { return _getInternal().encodeCCONBinary(...args); }`, + `export function decodeCCONBinary(...args) { return _getInternal().decodeCCONBinary(...args); }`, + ].join('\n'); + } + if (id.startsWith('\0alias-cc-')) { + return `import * as cc from 'cc';\nexport * from 'cc';\nexport default cc;`; + } + return null; + } + }, + { + // Post-process: fix default import interop for external ESM modules (like cc) + // that are loaded via SystemJS but don't have a "default" export. + // Rollup emits: `require$$0__default = module["default"]` + // but cc's SystemJS registration has no default export. + // Fix: `module["default"] || module` + name: 'fix-external-default-interop', + renderChunk(code) { + let fixed = code.replace(/= module\["default"\];/g, '= module["default"] || module;'); + // Fix url polyfill missing the URL constructor + fixed = fixed.replace(/url_1\.URL/g, 'window.URL'); + return { code: fixed, map: null }; + } + }, + nodeResolve({ + preferBuiltins: true, + browser: true, + }), + commonjs(), + ], + }); + + const bundleOutputFile = path.join(workspaceDir, 'static', 'web', 'scene-bundle.js'); + await bundle.write({ + file: bundleOutputFile, + format: 'system', + sourcemap: true, + banner: ` +(function() { + var _process = { + cwd: function() { + return (typeof window !== 'undefined' && (window.__CC_PROJECT_PATH__ || (window.Editor && window.Editor.Project && window.Editor.Project.path))) || '/'; + }, + platform: 'browser', + nextTick: function(fn) { + var args = Array.prototype.slice.call(arguments, 1); + setTimeout(function() { if (typeof fn === 'function') fn.apply(null, args); }, 0); + }, + env: { NODE_ENV: 'development' }, + versions: { node: '16.0.0' }, + stdout: { write: function() {} }, + stderr: { write: function() {} }, + binding: function() { return {}; }, + on: function() {}, + once: function() {}, + removeListener: function() {}, + emit: function() {}, + }; + if (typeof window !== 'undefined') { + if (!window.process) { + window.process = _process; + } else if (!window.process.cwd) { + window.process.cwd = _process.cwd; + } + } + if (typeof globalThis !== 'undefined' && !globalThis.process) { + globalThis.process = _process; + } +})(); + ` + }); + + console.log('[Build] Successfully bundled to', bundleOutputFile); +} + +buildSceneBundle().catch(err => { + console.error('Failed to bundle scene services:', err); + process.exit(1); +}); diff --git a/workflow/compiler-engine.js b/workflow/compiler-engine.js index dd7972f7f..a6e7765dc 100644 --- a/workflow/compiler-engine.js +++ b/workflow/compiler-engine.js @@ -28,6 +28,9 @@ if (!utils.hasDevelopmentEnvironment()) return; // 编译引擎 const { compileEngine } = require('../packages/engine-compiler/dist/index'); await compileEngine(engine); + + // compile for web + await compileEngine(engine, true); } catch (error) { console.log(error); }